@hashgraph/hedera-wallet-connect 1.0.5 → 1.0.6

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.
Files changed (74) hide show
  1. package/dist/browser-cjs-metafile.json +1 -1
  2. package/dist/browser-cjs.js +1 -1
  3. package/dist/browser-esm-metafile.json +1 -1
  4. package/dist/browser-esm.js +1 -1
  5. package/dist/node-cjs-metafile.json +1 -1
  6. package/dist/node-cjs.js +5 -4
  7. package/dist/node-esm-metafile.json +1 -1
  8. package/dist/node-esm.js +5 -4
  9. package/dist/types/src/index.d.ts +2 -0
  10. package/dist/types/src/index.d.ts.map +1 -0
  11. package/dist/types/src/lib/dapp/DAppSigner.d.ts +29 -0
  12. package/dist/types/src/lib/dapp/DAppSigner.d.ts.map +1 -0
  13. package/dist/types/src/lib/dapp/index.d.ts +177 -0
  14. package/dist/types/src/lib/dapp/index.d.ts.map +1 -0
  15. package/dist/types/src/lib/index.d.ts +4 -0
  16. package/dist/types/src/lib/index.d.ts.map +1 -0
  17. package/dist/types/src/lib/shared/chainIds.d.ts +12 -0
  18. package/dist/types/src/lib/shared/chainIds.d.ts.map +1 -0
  19. package/dist/types/src/lib/shared/errors.d.ts +49 -0
  20. package/dist/types/src/lib/shared/errors.d.ts.map +1 -0
  21. package/dist/types/src/lib/shared/events.d.ts +8 -0
  22. package/dist/types/src/lib/shared/events.d.ts.map +1 -0
  23. package/dist/types/src/lib/shared/index.d.ts +7 -0
  24. package/dist/types/src/lib/shared/index.d.ts.map +1 -0
  25. package/dist/types/src/lib/shared/methods.d.ts +13 -0
  26. package/dist/types/src/lib/shared/methods.d.ts.map +1 -0
  27. package/dist/types/src/lib/shared/payloads.d.ts +102 -0
  28. package/dist/types/src/lib/shared/payloads.d.ts.map +1 -0
  29. package/dist/types/src/lib/shared/utils.d.ts +269 -0
  30. package/dist/types/src/lib/shared/utils.d.ts.map +1 -0
  31. package/dist/types/src/lib/wallet/index.d.ts +40 -0
  32. package/dist/types/src/lib/wallet/index.d.ts.map +1 -0
  33. package/dist/types/src/lib/wallet/provider.d.ts +18 -0
  34. package/dist/types/src/lib/wallet/provider.d.ts.map +1 -0
  35. package/dist/types/src/lib/wallet/types.d.ts +32 -0
  36. package/dist/types/src/lib/wallet/types.d.ts.map +1 -0
  37. package/dist/types/test/_helpers.d.ts +35 -0
  38. package/dist/types/test/_helpers.d.ts.map +1 -0
  39. package/dist/types/test/dapp/DAppConnector.test.d.ts +2 -0
  40. package/dist/types/test/dapp/DAppConnector.test.d.ts.map +1 -0
  41. package/dist/types/test/utils.test.d.ts +2 -0
  42. package/dist/types/test/utils.test.d.ts.map +1 -0
  43. package/dist/types/test/wallet/methods/wallet-executeTransaction.test.d.ts +2 -0
  44. package/dist/types/test/wallet/methods/wallet-executeTransaction.test.d.ts.map +1 -0
  45. package/dist/types/test/wallet/methods/wallet-getNodeAddresses.test.d.ts +2 -0
  46. package/dist/types/test/wallet/methods/wallet-getNodeAddresses.test.d.ts.map +1 -0
  47. package/dist/types/test/wallet/methods/wallet-signAndExecuteQuery.test.d.ts +2 -0
  48. package/dist/types/test/wallet/methods/wallet-signAndExecuteQuery.test.d.ts.map +1 -0
  49. package/dist/types/test/wallet/methods/wallet-signAndExecuteTransaction.test.d.ts +2 -0
  50. package/dist/types/test/wallet/methods/wallet-signAndExecuteTransaction.test.d.ts.map +1 -0
  51. package/dist/types/test/wallet/methods/wallet-signMessage.test.d.ts +2 -0
  52. package/dist/types/test/wallet/methods/wallet-signMessage.test.d.ts.map +1 -0
  53. package/dist/types/test/wallet/methods/wallet-signTransaction.test.d.ts +2 -0
  54. package/dist/types/test/wallet/methods/wallet-signTransaction.test.d.ts.map +1 -0
  55. package/dist/types/test/wallet/wallet-init.test.d.ts +2 -0
  56. package/dist/types/test/wallet/wallet-init.test.d.ts.map +1 -0
  57. package/package.json +3 -3
  58. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
  59. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
  60. package/.github/ISSUE_TEMPLATE/hip_820.md +0 -16
  61. package/.github/dependabot.yml +0 -17
  62. package/.github/workflows/prettier.yml +0 -28
  63. package/.github/workflows/publish.yml +0 -35
  64. package/.github/workflows/test.yml +0 -32
  65. package/.husky/pre-commit +0 -4
  66. package/.lintstagedrc.json +0 -5
  67. package/.prettierignore +0 -3
  68. package/jest.config.ts +0 -33
  69. package/scripts/examples/build.mjs +0 -54
  70. package/scripts/examples/dev.mjs +0 -54
  71. package/scripts/lib/build.mjs +0 -40
  72. package/scripts/lib/context.mjs +0 -71
  73. package/scripts/lib/watch.mjs +0 -28
  74. package/typedoc.json +0 -10
package/dist/node-esm.js CHANGED
@@ -10631,12 +10631,13 @@ Minimum version required to store current data is: `+a+`.
10631
10631
  `+o,d=o;for(let h=-1;h<n+1;h+=2){for(let g=-1;g<n;g++)d+=l[$Ne(i,n,g,h)];d+=l[$Ne(i,n,n,h)]+u}return d+=qh,typeof t=="function"&&t(null,d),d}});var XNe=C(ZNe=>{var eMt=WNe(),tMt=JNe();ZNe.render=function(r,e,t){return e&&e.small?tMt.render(r,e,t):eMt.render(r,e,t)}});var MY=C(tRe=>{var rMt=pw();function eRe(r,e){let t=r.a/255,n=e+'="'+r.hex+'"';return t<1?n+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':n}function BY(r,e,t){let n=r+e;return typeof t<"u"&&(n+=" "+t),n}function nMt(r,e,t){let n="",i=0,a=!1,o=0;for(let s=0;s<r.length;s++){let c=Math.floor(s%e),l=Math.floor(s/e);!c&&!a&&(a=!0),r[s]?(o++,s>0&&c>0&&r[s-1]||(n+=a?BY("M",c+t,.5+l+t):BY("m",i,0),i=0,a=!1),c+1<e&&r[s+1]||(n+=BY("h",o),o=0)):i++}return n}tRe.render=function(e,t,n){let i=rMt.getOptions(t),a=e.modules.size,o=e.modules.data,s=a+i.margin*2,c=i.color.light.a?"<path "+eRe(i.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",l="<path "+eRe(i.color.dark,"stroke")+' d="'+nMt(o,a,i.margin)+'"/>',u='viewBox="0 0 '+s+" "+s+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+u+' shape-rendering="crispEdges">'+c+l+`</svg>
10632
10632
  `;return typeof n=="function"&&n(null,h),h}});var rRe=C(UN=>{var iMt=MY();UN.render=iMt.render;UN.renderToFile=function(e,t,n,i){typeof i>"u"&&(i=n,n=void 0);let a=ge("fs"),s='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+UN.render(t,n);a.writeFile(e,s,i)}});var nRe=C(qN=>{var LY=pw();function aMt(r,e,t){r.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=t,e.width=t,e.style.height=t+"px",e.style.width=t+"px"}function oMt(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}qN.render=function(e,t,n){let i=n,a=t;typeof i>"u"&&(!t||!t.getContext)&&(i=t,t=void 0),t||(a=oMt()),i=LY.getOptions(i);let o=LY.getImageWidth(e.modules.size,i),s=a.getContext("2d"),c=s.createImageData(o,o);return LY.qrToImageData(c.data,e,i),aMt(s,a,o),s.putImageData(c,0,0),a};qN.renderToDataURL=function(e,t,n){let i=n;typeof i>"u"&&(!t||!t.getContext)&&(i=t,t=void 0),i||(i={});let a=qN.render(e,t,i),o=i.type||"image/png",s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}});var aRe=C(hw=>{var sMt=Z$(),FY=gY(),iRe=nRe(),cMt=MY();function UY(r,e,t,n,i){let a=[].slice.call(arguments,1),o=a.length,s=typeof a[o-1]=="function";if(!s&&!sMt())throw new Error("Callback required as last argument");if(s){if(o<2)throw new Error("Too few arguments provided");o===2?(i=t,t=e,e=n=void 0):o===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=t,t=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(t=e,e=n=void 0):o===2&&!e.getContext&&(n=t,t=e,e=void 0),new Promise(function(c,l){try{let u=FY.create(t,n);c(r(u,e,n))}catch(u){l(u)}})}try{let c=FY.create(t,n);i(null,r(c,e,n))}catch(c){i(c)}}hw.create=FY.create;hw.toCanvas=UY.bind(null,iRe.render);hw.toDataURL=UY.bind(null,iRe.renderToDataURL);hw.toString=UY.bind(null,function(r,e,t){return cMt.render(r,t)})});var lRe=C(s0=>{var oRe=Z$(),qY=gY(),lMt=KNe(),sRe=zNe(),uMt=XNe(),cRe=rRe();function mw(r,e,t){if(typeof r>"u")throw new Error("String required as first argument");if(typeof t>"u"&&(t=e,e={}),typeof t!="function")if(oRe())e=t||{},t=null;else throw new Error("Callback required as last argument");return{opts:e,cb:t}}function dMt(r){return r.slice((r.lastIndexOf(".")-1>>>0)+2).toLowerCase()}function jN(r){switch(r){case"svg":return cRe;case"txt":case"utf8":return sRe;case"png":case"image/png":default:return lMt}}function fMt(r){switch(r){case"svg":return cRe;case"terminal":return uMt;case"utf8":default:return sRe}}function gw(r,e,t){if(!t.cb)return new Promise(function(n,i){try{let a=qY.create(e,t.opts);return r(a,t.opts,function(o,s){return o?i(o):n(s)})}catch(a){i(a)}});try{let n=qY.create(e,t.opts);return r(n,t.opts,t.cb)}catch(n){t.cb(n)}}s0.create=qY.create;s0.toCanvas=aRe().toCanvas;s0.toString=function(e,t,n){let i=mw(e,t,n),a=i.opts?i.opts.type:void 0,o=fMt(a);return gw(o.render,e,i)};s0.toDataURL=function(e,t,n){let i=mw(e,t,n),a=jN(i.opts.type);return gw(a.renderToDataURL,e,i)};s0.toBuffer=function(e,t,n){let i=mw(e,t,n),a=jN(i.opts.type);return gw(a.renderToBuffer,e,i)};s0.toFile=function(e,t,n,i){if(typeof e!="string"||!(typeof t=="string"||typeof t=="object"))throw new Error("Invalid argument");if(arguments.length<3&&!oRe())throw new Error("Too few arguments provided");let a=mw(t,n,i),o=a.opts.type||dMt(e),c=jN(o).renderToFile.bind(null,e);return gw(c,t,a)};s0.toFileStream=function(e,t,n){if(arguments.length<2)throw new Error("Too few arguments provided");let i=mw(t,n,e.emit.bind(e,"error")),o=jN("png").renderToFileStream.bind(null,e);gw(o,t,i)}});var dRe=C((N5r,uRe)=>{uRe.exports=lRe()});var ARe={};Aw(ARe,{WcmModal:()=>My,WcmQrCode:()=>H6});function gMt(){var r;let e=(r=bd.state.themeMode)!=null?r:"dark",t={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--wcm-color-fg-1":t.foreground[1],"--wcm-color-fg-2":t.foreground[2],"--wcm-color-fg-3":t.foreground[3],"--wcm-color-bg-1":t.background[1],"--wcm-color-bg-2":t.background[2],"--wcm-color-bg-3":t.background[3],"--wcm-color-overlay":t.overlay}}function hRe(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}function QY(r,e,t){return r===e?!1:(r-e<0?e-r:r-e)<=t+QMt}function $Mt(r,e){let t=Array.prototype.slice.call(xRe.default.create(r,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(t.length);return t.reduce((i,a,o)=>(o%n===0?i.push([a]):i[i.length-1].push(a))&&i,[])}var d0,xRe,pMt,fRe,hMt,mMt,pRe,jY,Xr,yMt,vMt,bMt,Ry,c0,wMt,_Mt,EMt,VY,yw,xMt,AMt,TMt,SMt,HY,Sn,IMt,CMt,kMt,NMt,KY,RMt,OMt,DMt,PMt,zY,BMt,MMt,LMt,FMt,GY,UMt,qMt,jMt,vw,jh,_r,VMt,HMt,KMt,WY,bw,zMt,GMt,WMt,mRe,VN,QMt,gRe,V6,YMt,JMt,ZMt,XMt,Oy,H6,eLt,tLt,rLt,yRe,HN,nLt,iLt,aLt,oLt,$Y,sLt,cLt,lLt,YY,ww,uLt,dLt,fLt,l0,xd,pLt,hLt,mLt,KN,Dy,gLt,yLt,vRe,JY,vLt,bLt,wLt,bRe,_Lt,ELt,xLt,ALt,ZY,TLt,SLt,ILt,Py,u0,Ly,f0,CLt,kLt,NLt,RLt,XY,OLt,DLt,PLt,BLt,eJ,MLt,LLt,FLt,ULt,tJ,qLt,jLt,VLt,rJ,My,HLt,KLt,zLt,_w,Vh,GLt,WLt,QLt,$Lt,nJ,YLt,JLt,ZLt,zN,By,XLt,eFt,tFt,iJ,rFt,nFt,iFt,wRe,GN,aFt,oFt,sFt,cFt,aJ,lFt,uFt,dFt,_Re,WN,fFt,pFt,hFt,mFt,oJ,gFt,yFt,vFt,sJ,bFt,wFt,_Ft,Ew,cJ,Hh,EFt,xFt,AFt,ERe,QN,TRe=yn(()=>{yTe();TTe();NTe();AQ();Rh();d0=Oe(XCe(),1);tke();xRe=Oe(dRe(),1),pMt=Object.defineProperty,fRe=Object.getOwnPropertySymbols,hMt=Object.prototype.hasOwnProperty,mMt=Object.prototype.propertyIsEnumerable,pRe=(r,e,t)=>e in r?pMt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,jY=(r,e)=>{for(var t in e||(e={}))hMt.call(e,t)&&pRe(r,t,e[t]);if(fRe)for(var t of fRe(e))mMt.call(e,t)&&pRe(r,t,e[t]);return r};Xr={getPreset(r){return hRe()[r]},setTheme(){let r=document.querySelector(":root"),{themeVariables:e}=bd.state;if(r){let t=jY(jY(jY({},gMt()),hRe()),e);Object.entries(t).forEach(([n,i])=>r.style.setProperty(n,i))}},globalCss:pn`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},yMt=pn`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`,vMt=Object.defineProperty,bMt=Object.getOwnPropertyDescriptor,Ry=(r,e,t,n)=>{for(var i=n>1?void 0:n?bMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&vMt(e,t,i),i},c0=class extends Or{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){let r={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"},e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),et`<button class="${wd(r)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};c0.styles=[Xr.globalCss,yMt],Ry([Sr({type:Boolean})],c0.prototype,"disabled",2),Ry([Sr()],c0.prototype,"iconLeft",2),Ry([Sr()],c0.prototype,"iconRight",2),Ry([Sr()],c0.prototype,"onClick",2),Ry([Sr()],c0.prototype,"variant",2),c0=Ry([Zr("wcm-button")],c0);wMt=pn`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`,_Mt=Object.defineProperty,EMt=Object.getOwnPropertyDescriptor,VY=(r,e,t,n)=>{for(var i=n>1?void 0:n?EMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&_Mt(e,t,i),i},yw=class extends Or{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){let r={"wcm-secondary":this.variant==="secondary"};return et`<button ?disabled="${this.disabled}" class="${wd(r)}"><slot></slot></button>`}};yw.styles=[Xr.globalCss,wMt],VY([Sr({type:Boolean})],yw.prototype,"disabled",2),VY([Sr()],yw.prototype,"variant",2),yw=VY([Zr("wcm-button-big")],yw);xMt=pn`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`,AMt=Object.defineProperty,TMt=Object.getOwnPropertyDescriptor,SMt=(r,e,t,n)=>{for(var i=n>1?void 0:n?TMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&AMt(e,t,i),i},HY=class extends Or{render(){return et`<div><slot></slot></div>`}};HY.styles=[Xr.globalCss,xMt],HY=SMt([Zr("wcm-info-footer")],HY);Sn={CROSS_ICON:Ni`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:Ni`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:Ni`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:Ni`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:Ni`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:Ni`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:Ni`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:Ni`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:Ni`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:Ni`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:Ni`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:Ni`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:Ni`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:Ni`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:Ni`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,SEARCH_ICON:Ni`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,WALLET_PLACEHOLDER:Ni`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,GLOBE_ICON:Ni`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},IMt=pn`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`,CMt=Object.defineProperty,kMt=Object.getOwnPropertyDescriptor,NMt=(r,e,t,n)=>{for(var i=n>1?void 0:n?kMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&CMt(e,t,i),i},KY=class extends Or{render(){return et`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${Sn.WALLET_CONNECT_LOGO} <button @click="${M6.close}">${Sn.CROSS_ICON}</button></div>`}};KY.styles=[Xr.globalCss,IMt],KY=NMt([Zr("wcm-modal-backcard")],KY);RMt=pn`main{padding:20px;padding-top:0;width:100%}`,OMt=Object.defineProperty,DMt=Object.getOwnPropertyDescriptor,PMt=(r,e,t,n)=>{for(var i=n>1?void 0:n?DMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&OMt(e,t,i),i},zY=class extends Or{render(){return et`<main><slot></slot></main>`}};zY.styles=[Xr.globalCss,RMt],zY=PMt([Zr("wcm-modal-content")],zY);BMt=pn`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`,MMt=Object.defineProperty,LMt=Object.getOwnPropertyDescriptor,FMt=(r,e,t,n)=>{for(var i=n>1?void 0:n?LMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&MMt(e,t,i),i},GY=class extends Or{render(){return et`<footer><slot></slot></footer>`}};GY.styles=[Xr.globalCss,BMt],GY=FMt([Zr("wcm-modal-footer")],GY);UMt=pn`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`,qMt=Object.defineProperty,jMt=Object.getOwnPropertyDescriptor,vw=(r,e,t,n)=>{for(var i=n>1?void 0:n?jMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&qMt(e,t,i),i},jh=class extends Or{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return et`<button class="wcm-back-btn" @click="${ki.goBack}">${Sn.BACK_ICON}</button>`}actionBtnTemplate(){return et`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){let r={"wcm-border":this.border},e=ki.state.history.length>1,t=this.title?et`<wcm-text variant="big-bold">${this.title}</wcm-text>`:et`<slot></slot>`;return et`<header class="${wd(r)}">${e?this.backBtnTemplate():null} ${t} ${this.onAction?this.actionBtnTemplate():null}</header>`}};jh.styles=[Xr.globalCss,UMt],vw([Sr()],jh.prototype,"title",2),vw([Sr()],jh.prototype,"onAction",2),vw([Sr()],jh.prototype,"actionIcon",2),vw([Sr({type:Boolean})],jh.prototype,"border",2),jh=vw([Zr("wcm-modal-header")],jh);_r={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(r,e){let t=r.renderRoot.querySelector(e);if(!t)throw new Error(`${e} not found`);return t},getWalletIcon({id:r,image_id:e}){let{walletImages:t}=vs.state;return t!=null&&t[r]?t[r]:e?bs.getWalletImageUrl(e):""},getWalletName(r,e=!1){return e&&r.length>8?`${r.substring(0,8)}..`:r},isMobileAnimation(){return window.innerWidth<=_r.MOBILE_BREAKPOINT},async preloadImage(r){let e=new Promise((t,n)=>{let i=new Image;i.onload=t,i.onerror=n,i.crossOrigin="anonymous",i.src=r});return Promise.race([e,Lt.wait(3e3)])},getErrorMessage(r){return r instanceof Error?r.message:"Unknown Error"},debounce(r,e=500){let t;return(...n)=>{function i(){r(...n)}t&&clearTimeout(t),t=setTimeout(i,e)}},handleMobileLinking(r){let{walletConnectUri:e}=Li.state,{mobile:t,name:n}=r,i=t?.native,a=t?.universal;_r.setRecentWallet(r);function o(s){let c="";i?c=Lt.formatUniversalUrl(i,s,n):a&&(c=Lt.formatNativeUrl(a,s,n)),Lt.openHref(c,"_self")}e&&o(e)},handleAndroidLinking(){let{walletConnectUri:r}=Li.state;r&&(Lt.setWalletConnectAndroidDeepLink(r),Lt.openHref(r,"_self"))},async handleUriCopy(){let{walletConnectUri:r}=Li.state;if(r)try{await navigator.clipboard.writeText(r),L6.openToast("Link copied","success")}catch{L6.openToast("Failed to copy","error")}},getCustomImageUrls(){let{walletImages:r}=vs.state,e=Object.values(r??{});return Object.values(e)},truncate(r,e=8){return r.length<=e?r:`${r.substring(0,4)}...${r.substring(r.length-4)}`},setRecentWallet(r){try{localStorage.setItem(_r.WCM_RECENT_WALLET_DATA,JSON.stringify(r))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{let r=localStorage.getItem(_r.WCM_RECENT_WALLET_DATA);return r?JSON.parse(r):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(r,e){return r.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Lt.openHref(_r.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){let{desktop:r,mobile:e}=Lt.getWalletRouterData(),t=!!r?.native,n=!!r?.universal,i=!!e?.native||!!e?.universal;return{isDesktop:t,isMobile:i,isWeb:n}},goToConnectingView(r){ki.setData({Wallet:r});let e=Lt.isMobile(),{isDesktop:t,isWeb:n,isMobile:i}=_r.getCachedRouterWalletPlatforms();e?i?ki.push("MobileConnecting"):n?ki.push("WebConnecting"):ki.push("InstallWallet"):t?ki.push("DesktopConnecting"):n?ki.push("WebConnecting"):i?ki.push("MobileQrcodeConnecting"):ki.push("InstallWallet")}},VMt=pn`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`,HMt=Object.defineProperty,KMt=Object.getOwnPropertyDescriptor,WY=(r,e,t,n)=>{for(var i=n>1?void 0:n?KMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&HMt(e,t,i),i},bw=class extends Or{constructor(){super(),this.view=ki.state.view,this.prevView=ki.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=ki.subscribe(r=>{this.view!==r.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([r])=>{let e=`${r.contentRect.height}px`;this.oldHeight!=="0px"&&(0,d0.animate)(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var r,e;(r=this.unsubscribe)==null||r.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return _r.getShadowRootElement(this,".wcm-router")}get contentEl(){return _r.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return et`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return et`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return et`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return et`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return et`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return et`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return et`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return et`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return et`<div>Not Found</div>`}}async onChangeRoute(){await(0,d0.animate)(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=ki.state.view,(0,d0.animate)(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return et`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};bw.styles=[Xr.globalCss,VMt],WY([ws()],bw.prototype,"view",2),WY([ws()],bw.prototype,"prevView",2),bw=WY([Zr("wcm-modal-router")],bw);zMt=pn`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`,GMt=Object.defineProperty,WMt=Object.getOwnPropertyDescriptor,mRe=(r,e,t,n)=>{for(var i=n>1?void 0:n?WMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&GMt(e,t,i),i},VN=class extends Or{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=L6.subscribe(r=>{r.open?(this.open=!0,this.timeout=setTimeout(()=>L6.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this),clearTimeout(this.timeout),L6.closeToast()}render(){let{message:r,variant:e}=L6.state,t={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?et`<div class="${wd(t)}">${e==="success"?Sn.CHECKMARK_ICON:null} ${e==="error"?Sn.CROSS_ICON:null}<wcm-text variant="small-regular">${r}</wcm-text></div>`:null}};VN.styles=[Xr.globalCss,zMt],mRe([ws()],VN.prototype,"open",2),VN=mRe([Zr("wcm-modal-toast")],VN);QMt=.1,gRe=2.5,V6=7;YMt={generate(r,e,t){let n="#141414",i="#ffffff",a=[],o=$Mt(r,"Q"),s=e/o.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach(({x:m,y:b})=>{let E=(o.length-V6)*s*m,I=(o.length-V6)*s*b,R=.45;for(let L=0;L<c.length;L+=1){let U=s*(V6-L*2);a.push(Ni`<rect fill="${L%2===0?n:i}" height="${U}" rx="${U*R}" ry="${U*R}" width="${U}" x="${E+s*L}" y="${I+s*L}">`)}});let l=Math.floor((t+25)/s),u=o.length/2-l/2,d=o.length/2+l/2-1,h=[];o.forEach((m,b)=>{m.forEach((E,I)=>{if(o[b][I]&&!(b<V6&&I<V6||b>o.length-(V6+1)&&I<V6||b<V6&&I>o.length-(V6+1))&&!(b>u&&b<d&&I>u&&I<d)){let R=b*s+s/2,L=I*s+s/2;h.push([R,L])}})});let g={};return h.forEach(([m,b])=>{g[m]?g[m].push(b):g[m]=[b]}),Object.entries(g).map(([m,b])=>{let E=b.filter(I=>b.every(R=>!QY(I,R,s)));return[Number(m),E]}).forEach(([m,b])=>{b.forEach(E=>{a.push(Ni`<circle cx="${m}" cy="${E}" fill="${n}" r="${s/gRe}">`)})}),Object.entries(g).filter(([m,b])=>b.length>1).map(([m,b])=>{let E=b.filter(I=>b.some(R=>QY(I,R,s)));return[Number(m),E]}).map(([m,b])=>{b.sort((I,R)=>I<R?-1:1);let E=[];for(let I of b){let R=E.find(L=>L.some(U=>QY(I,U,s)));R?R.push(I):E.push([I])}return[m,E.map(I=>[I[0],I[I.length-1]])]}).forEach(([m,b])=>{b.forEach(([E,I])=>{a.push(Ni`<line x1="${m}" x2="${m}" y1="${E}" y2="${I}" stroke="${n}" stroke-width="${s/(gRe/2)}" stroke-linecap="round">`)})}),a}},JMt=pn`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`,ZMt=Object.defineProperty,XMt=Object.getOwnPropertyDescriptor,Oy=(r,e,t,n)=>{for(var i=n>1?void 0:n?XMt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&ZMt(e,t,i),i},H6=class extends Or{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){let r=bd.state.themeMode==="light"?this.size:this.size-36;return Ni`<svg height="${r}" width="${r}">${YMt.generate(this.uri,r,r/4)}</svg>`}render(){let r={"wcm-dark":bd.state.themeMode==="dark"};return et`<div style="${`width: ${this.size}px`}" class="${wd(r)}">${this.walletId||this.imageUrl?et`<wcm-wallet-image walletId="${Yo(this.walletId)}" imageId="${Yo(this.imageId)}" imageUrl="${Yo(this.imageUrl)}"></wcm-wallet-image>`:Sn.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};H6.styles=[Xr.globalCss,JMt],Oy([Sr()],H6.prototype,"uri",2),Oy([Sr({type:Number})],H6.prototype,"size",2),Oy([Sr()],H6.prototype,"imageId",2),Oy([Sr()],H6.prototype,"walletId",2),Oy([Sr()],H6.prototype,"imageUrl",2),H6=Oy([Zr("wcm-qrcode")],H6);eLt=pn`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`,tLt=Object.defineProperty,rLt=Object.getOwnPropertyDescriptor,yRe=(r,e,t,n)=>{for(var i=n>1?void 0:n?rLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&tLt(e,t,i),i},HN=class extends Or{constructor(){super(...arguments),this.onChange=()=>null}render(){return et`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Sn.SEARCH_ICON}`}};HN.styles=[Xr.globalCss,eLt],yRe([Sr()],HN.prototype,"onChange",2),HN=yRe([Zr("wcm-search-input")],HN);nLt=pn`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`,iLt=Object.defineProperty,aLt=Object.getOwnPropertyDescriptor,oLt=(r,e,t,n)=>{for(var i=n>1?void 0:n?aLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&iLt(e,t,i),i},$Y=class extends Or{render(){return et`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};$Y.styles=[Xr.globalCss,nLt],$Y=oLt([Zr("wcm-spinner")],$Y);sLt=pn`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`,cLt=Object.defineProperty,lLt=Object.getOwnPropertyDescriptor,YY=(r,e,t,n)=>{for(var i=n>1?void 0:n?lLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&cLt(e,t,i),i},ww=class extends Or{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){let r={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return et`<span><slot class="${wd(r)}"></slot></span>`}};ww.styles=[Xr.globalCss,sLt],YY([Sr()],ww.prototype,"variant",2),YY([Sr()],ww.prototype,"color",2),ww=YY([Zr("wcm-text")],ww);uLt=pn`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`,dLt=Object.defineProperty,fLt=Object.getOwnPropertyDescriptor,l0=(r,e,t,n)=>{for(var i=n>1?void 0:n?fLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&dLt(e,t,i),i},xd=class extends Or{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?et`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?et`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){xQ.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var r;return et`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${Yo(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(r=this.label)!=null?r:_r.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};xd.styles=[Xr.globalCss,uLt],l0([Sr()],xd.prototype,"onClick",2),l0([Sr()],xd.prototype,"name",2),l0([Sr()],xd.prototype,"walletId",2),l0([Sr()],xd.prototype,"label",2),l0([Sr()],xd.prototype,"imageId",2),l0([Sr({type:Boolean})],xd.prototype,"installed",2),l0([Sr({type:Boolean})],xd.prototype,"recent",2),xd=l0([Zr("wcm-wallet-button")],xd);pLt=pn`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`,hLt=Object.defineProperty,mLt=Object.getOwnPropertyDescriptor,KN=(r,e,t,n)=>{for(var i=n>1?void 0:n?mLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&hLt(e,t,i),i},Dy=class extends Or{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var r;let e=(r=this.imageUrl)!=null&&r.length?this.imageUrl:_r.getWalletIcon({id:this.walletId,image_id:this.imageId});return et`${e.length?et`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:Sn.WALLET_PLACEHOLDER}`}};Dy.styles=[Xr.globalCss,pLt],KN([Sr()],Dy.prototype,"walletId",2),KN([Sr()],Dy.prototype,"imageId",2),KN([Sr()],Dy.prototype,"imageUrl",2),Dy=KN([Zr("wcm-wallet-image")],Dy);gLt=Object.defineProperty,yLt=Object.getOwnPropertyDescriptor,vRe=(r,e,t,n)=>{for(var i=n>1?void 0:n?yLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&gLt(e,t,i),i},JY=class extends Or{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(r){try{r!=null&&r.length&&await Promise.all(r.map(async e=>_r.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",r)}}async preloadListings(){if(vs.state.enableExplorer){await bs.getRecomendedWallets(),Li.setIsDataLoaded(!0);let{recomendedWallets:r}=bs.state,e=r.map(t=>_r.getWalletIcon(t));await this.loadImages(e)}else Li.setIsDataLoaded(!0)}async preloadCustomImages(){let r=_r.getCustomImageUrls();await this.loadImages(r)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(r){console.error(r),L6.openToast("Failed preloading","error")}}};vRe([ws()],JY.prototype,"preload",2),JY=vRe([Zr("wcm-explorer-context")],JY);vLt=Object.defineProperty,bLt=Object.getOwnPropertyDescriptor,wLt=(r,e,t,n)=>{for(var i=n>1?void 0:n?bLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&vLt(e,t,i),i},bRe=class extends Or{constructor(){super(),this.unsubscribeTheme=void 0,Xr.setTheme(),this.unsubscribeTheme=bd.subscribe(Xr.setTheme)}disconnectedCallback(){var r;(r=this.unsubscribeTheme)==null||r.call(this)}};bRe=wLt([Zr("wcm-theme-context")],bRe);_Lt=pn`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`,ELt=Object.defineProperty,xLt=Object.getOwnPropertyDescriptor,ALt=(r,e,t,n)=>{for(var i=n>1?void 0:n?xLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&ELt(e,t,i),i},ZY=class extends Or{onGoToQrcode(){ki.push("Qrcode")}render(){let{recomendedWallets:r}=bs.state,e=[...r,...r],t=Lt.RECOMMENDED_WALLET_AMOUNT*2;return et`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Sn.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${Sn.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(t)].map((n,i)=>{let a=e[i%e.length];return a?et`<wcm-wallet-image walletId="${a.id}" imageId="${a.image_id}"></wcm-wallet-image>`:Sn.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${_r.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};ZY.styles=[Xr.globalCss,_Lt],ZY=ALt([Zr("wcm-android-wallet-selection")],ZY);TLt=pn`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`,SLt=Object.defineProperty,ILt=Object.getOwnPropertyDescriptor,Py=(r,e,t,n)=>{for(var i=n>1?void 0:n?ILt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&SLt(e,t,i),i},u0=class extends Or{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var r,e;let t=(e=(r=bd.state.themeVariables)==null?void 0:r["--wcm-wallet-icon-large-border-radius"])!=null?e:Xr.getPreset("--wcm-wallet-icon-large-border-radius"),n=0;t.includes("%")?n=88/100*parseInt(t,10):n=parseInt(t,10),n*=1.17;let i=317-n*1.57,a=425-n*1.8;return et`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${a}"></use></svg>`}render(){let r={"wcm-error":this.isError,"wcm-stale":this.isStale};return et`<div class="${wd(r)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${Yo(this.walletId)}" imageId="${Yo(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};u0.styles=[Xr.globalCss,TLt],Py([Sr()],u0.prototype,"walletId",2),Py([Sr()],u0.prototype,"imageId",2),Py([Sr({type:Boolean})],u0.prototype,"isError",2),Py([Sr({type:Boolean})],u0.prototype,"isStale",2),Py([Sr()],u0.prototype,"label",2),u0=Py([Zr("wcm-connector-waiting")],u0);Ly={manualWallets(){var r,e;let{mobileWallets:t,desktopWallets:n}=vs.state,i=(r=Ly.recentWallet())==null?void 0:r.id,a=Lt.isMobile()?t:n,o=a?.filter(s=>i!==s.id);return(e=Lt.isMobile()?o?.map(({id:s,name:c,links:l})=>({id:s,name:c,mobile:l,links:l})):o?.map(({id:s,name:c,links:l})=>({id:s,name:c,desktop:l,links:l})))!=null?e:[]},recentWallet(){return _r.getRecentWallet()},recomendedWallets(r=!1){var e;let t=r||(e=Ly.recentWallet())==null?void 0:e.id,{recomendedWallets:n}=bs.state;return n.filter(i=>t!==i.id)}},f0={onConnecting(r){_r.goToConnectingView(r)},manualWalletsTemplate(){return Ly.manualWallets().map(r=>et`<wcm-wallet-button walletId="${r.id}" name="${r.name}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(r=!1){return Ly.recomendedWallets(r).map(e=>et`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){let r=Ly.recentWallet();if(r)return et`<wcm-wallet-button name="${r.name}" walletId="${r.id}" imageId="${Yo(r.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`}},CLt=pn`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`,kLt=Object.defineProperty,NLt=Object.getOwnPropertyDescriptor,RLt=(r,e,t,n)=>{for(var i=n>1?void 0:n?NLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&kLt(e,t,i),i},XY=class extends Or{render(){let{explorerExcludedWalletIds:r,enableExplorer:e}=vs.state,t=r!=="ALL"&&e,n=f0.manualWalletsTemplate(),i=f0.recomendedWalletsTemplate(),a=[f0.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);let o=a.length>4||t,s=[];o?s=a.slice(0,3):s=a;let c=!!s.length;return et`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${_r.handleUriCopy}" .actionIcon="${Sn.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${Sn.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${Sn.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${c?et`<wcm-modal-footer><div class="wcm-desktop-title">${Sn.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${s} ${o?et`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};XY.styles=[Xr.globalCss,CLt],XY=RLt([Zr("wcm-desktop-wallet-selection")],XY);OLt=pn`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`,DLt=Object.defineProperty,PLt=Object.getOwnPropertyDescriptor,BLt=(r,e,t,n)=>{for(var i=n>1?void 0:n?PLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&DLt(e,t,i),i},eJ=class extends Or{render(){let{termsOfServiceUrl:r,privacyPolicyUrl:e}=vs.state;return r??e?et`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${r?et`<a href="${r}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${r&&e?"and":null} ${e?et`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};eJ.styles=[Xr.globalCss,OLt],eJ=BLt([Zr("wcm-legal-notice")],eJ);MLt=pn`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`,LLt=Object.defineProperty,FLt=Object.getOwnPropertyDescriptor,ULt=(r,e,t,n)=>{for(var i=n>1?void 0:n?FLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&LLt(e,t,i),i},tJ=class extends Or{onQrcode(){ki.push("Qrcode")}render(){let{explorerExcludedWalletIds:r,enableExplorer:e}=vs.state,t=r!=="ALL"&&e,n=f0.manualWalletsTemplate(),i=f0.recomendedWalletsTemplate(),a=[f0.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);let o=a.length>8||t,s=[];o?s=a.slice(0,7):s=a;let c=!!s.length;return et`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Sn.QRCODE_ICON}"></wcm-modal-header>${c?et`<wcm-modal-content><div>${s} ${o?et`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};tJ.styles=[Xr.globalCss,MLt],tJ=ULt([Zr("wcm-mobile-wallet-selection")],tJ);qLt=pn`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`,jLt=Object.defineProperty,VLt=Object.getOwnPropertyDescriptor,rJ=(r,e,t,n)=>{for(var i=n>1?void 0:n?VLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&jLt(e,t,i),i},My=class extends Or{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=M6.subscribe(r=>{r.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var r;(r=this.unsubscribeModal)==null||r.call(this)}get overlayEl(){return _r.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return _r.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(r){document.querySelector("body")&&(r?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(r){r.target===r.currentTarget&&M6.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{let r=_r.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,t=.2;await Promise.all([(0,d0.animate)(this.overlayEl,{opacity:[0,1]},{delay:e,duration:t}).finished,(0,d0.animate)(this.containerEl,r,{delay:e,duration:t}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();let r=_r.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([(0,d0.animate)(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,(0,d0.animate)(this.containerEl,r,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",r=>{var e;r.key==="Escape"?M6.close():r.key==="Tab"&&((e=r.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var r;(r=this.abortController)==null||r.abort(),this.abortController=void 0}render(){let r={"wcm-overlay":!0,"wcm-active":this.active};return et`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${wd(r)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?et`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};My.styles=[Xr.globalCss,qLt],rJ([ws()],My.prototype,"open",2),rJ([ws()],My.prototype,"active",2),My=rJ([Zr("wcm-modal")],My);HLt=pn`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`,KLt=Object.defineProperty,zLt=Object.getOwnPropertyDescriptor,_w=(r,e,t,n)=>{for(var i=n>1?void 0:n?zLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&KLt(e,t,i),i},Vh=class extends Or{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Lt.isMobile()?ki.replace("MobileConnecting"):ki.replace("MobileQrcodeConnecting")}onDesktop(){ki.replace("DesktopConnecting")}onWeb(){ki.replace("WebConnecting")}render(){return et`<div>${this.isRetry?et`<slot></slot>`:null} ${this.isMobile?et`<wcm-button .onClick="${this.onMobile}" .iconLeft="${Sn.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?et`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${Sn.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?et`<wcm-button .onClick="${this.onWeb}" .iconLeft="${Sn.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};Vh.styles=[Xr.globalCss,HLt],_w([Sr({type:Boolean})],Vh.prototype,"isMobile",2),_w([Sr({type:Boolean})],Vh.prototype,"isDesktop",2),_w([Sr({type:Boolean})],Vh.prototype,"isWeb",2),_w([Sr({type:Boolean})],Vh.prototype,"isRetry",2),Vh=_w([Zr("wcm-platform-selection")],Vh);GLt=pn`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`,WLt=Object.defineProperty,QLt=Object.getOwnPropertyDescriptor,$Lt=(r,e,t,n)=>{for(var i=n>1?void 0:n?QLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&WLt(e,t,i),i},nJ=class extends Or{onClick(){ki.push("WalletExplorer")}render(){let{recomendedWallets:r}=bs.state,e=Ly.manualWallets(),t=[...r,...e].reverse().slice(0,4);return et`<button @click="${this.onClick}"><div class="wcm-icons">${t.map(n=>{let i=_r.getWalletIcon(n);if(i)return et`<img crossorigin="anonymous" src="${i}">`;let a=_r.getWalletIcon({id:n.id});return a?et`<img crossorigin="anonymous" src="${a}">`:Sn.WALLET_PLACEHOLDER})} ${[...Array(4-t.length)].map(()=>Sn.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};nJ.styles=[Xr.globalCss,GLt],nJ=$Lt([Zr("wcm-view-all-wallets-button")],nJ);YLt=pn`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`,JLt=Object.defineProperty,ZLt=Object.getOwnPropertyDescriptor,zN=(r,e,t,n)=>{for(var i=n>1?void 0:n?ZLt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&JLt(e,t,i),i},By=class extends Or{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{let{walletConnectUri:r}=Li.state;this.uri=r},0)}get overlayEl(){return _r.getShadowRootElement(this,".wcm-qr-container")}render(){return et`<div class="wcm-qr-container">${this.uri?et`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${Yo(this.walletId)}" imageId="${Yo(this.imageId)}"></wcm-qrcode>`:et`<wcm-spinner></wcm-spinner>`}</div>`}};By.styles=[Xr.globalCss,YLt],zN([Sr()],By.prototype,"walletId",2),zN([Sr()],By.prototype,"imageId",2),zN([ws()],By.prototype,"uri",2),By=zN([Zr("wcm-walletconnect-qr")],By);XLt=Object.defineProperty,eFt=Object.getOwnPropertyDescriptor,tFt=(r,e,t,n)=>{for(var i=n>1?void 0:n?eFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&XLt(e,t,i),i},iJ=class extends Or{viewTemplate(){return Lt.isAndroid()?et`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:Lt.isMobile()?et`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:et`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return et`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};iJ.styles=[Xr.globalCss],iJ=tFt([Zr("wcm-connect-wallet-view")],iJ);rFt=pn`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`,nFt=Object.defineProperty,iFt=Object.getOwnPropertyDescriptor,wRe=(r,e,t,n)=>{for(var i=n>1?void 0:n?iFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&nFt(e,t,i),i},GN=class extends Or{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(r){let{desktop:e,name:t}=Lt.getWalletRouterData(),n=e?.native;if(n){let i=Lt.formatNativeUrl(n,r,t);Lt.openHref(i,"_self")}}openDesktopApp(){let{walletConnectUri:r}=Li.state,e=Lt.getWalletRouterData();_r.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){let{name:r,id:e,image_id:t}=Lt.getWalletRouterData(),{isMobile:n,isWeb:i}=_r.getCachedRouterWalletPlatforms();return et`<wcm-modal-header title="${r}" .onAction="${_r.handleUriCopy}" .actionIcon="${Sn.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Yo(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${r} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isWeb="${i}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Sn.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};GN.styles=[Xr.globalCss,rFt],wRe([ws()],GN.prototype,"isError",2),GN=wRe([Zr("wcm-desktop-connecting-view")],GN);aFt=pn`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`,oFt=Object.defineProperty,sFt=Object.getOwnPropertyDescriptor,cFt=(r,e,t,n)=>{for(var i=n>1?void 0:n?sFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&oFt(e,t,i),i},aJ=class extends Or{onInstall(r){r&&Lt.openHref(r,"_blank")}render(){let{name:r,id:e,image_id:t,homepage:n}=Lt.getWalletRouterData();return et`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Yo(t)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${r} to continue. If multiple browser extensions are installed, disable non ${r} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${Sn.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};aJ.styles=[Xr.globalCss,aFt],aJ=cFt([Zr("wcm-install-wallet-view")],aJ);lFt=pn`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`,uFt=Object.defineProperty,dFt=Object.getOwnPropertyDescriptor,_Re=(r,e,t,n)=>{for(var i=n>1?void 0:n?dFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&uFt(e,t,i),i},WN=class extends Or{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(r,e=!1){let{mobile:t,name:n}=Lt.getWalletRouterData(),i=t?.native,a=t?.universal;if(i&&!e){let o=Lt.formatNativeUrl(i,r,n);Lt.openHref(o,"_self")}else if(a){let o=Lt.formatUniversalUrl(a,r,n);Lt.openHref(o,"_self")}}openMobileApp(r=!1){let{walletConnectUri:e}=Li.state,t=Lt.getWalletRouterData();_r.setRecentWallet(t),e&&this.onFormatAndRedirect(e,r)}onGoToAppStore(r){r&&Lt.openHref(r,"_blank")}render(){let{name:r,id:e,image_id:t,app:n,mobile:i}=Lt.getWalletRouterData(),{isWeb:a}=_r.getCachedRouterWalletPlatforms(),o=n?.ios,s=i?.universal;return et`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Yo(t)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${a}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Sn.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${s?et`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${Yo(t)}"></wcm-wallet-image><wcm-text>${`Get ${r}`}</wcm-text></div><wcm-button .iconRight="${Sn.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(o)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};WN.styles=[Xr.globalCss,lFt],_Re([ws()],WN.prototype,"isError",2),WN=_Re([Zr("wcm-mobile-connecting-view")],WN);fFt=pn`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`,pFt=Object.defineProperty,hFt=Object.getOwnPropertyDescriptor,mFt=(r,e,t,n)=>{for(var i=n>1?void 0:n?hFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&pFt(e,t,i),i},oJ=class extends Or{render(){let{name:r,id:e,image_id:t}=Lt.getWalletRouterData(),{isDesktop:n,isWeb:i}=_r.getCachedRouterWalletPlatforms();return et`<wcm-modal-header title="${r}" .onAction="${_r.handleUriCopy}" .actionIcon="${Sn.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${Yo(t)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${r} app`}</wcm-text><wcm-platform-selection .isDesktop="${n}" .isWeb="${i}"></wcm-platform-selection></wcm-info-footer>`}};oJ.styles=[Xr.globalCss,fFt],oJ=mFt([Zr("wcm-mobile-qr-connecting-view")],oJ);gFt=Object.defineProperty,yFt=Object.getOwnPropertyDescriptor,vFt=(r,e,t,n)=>{for(var i=n>1?void 0:n?yFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&gFt(e,t,i),i},sJ=class extends Or{render(){return et`<wcm-modal-header title="Scan the code" .onAction="${_r.handleUriCopy}" .actionIcon="${Sn.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};sJ.styles=[Xr.globalCss],sJ=vFt([Zr("wcm-qrcode-view")],sJ);bFt=pn`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`,wFt=Object.defineProperty,_Ft=Object.getOwnPropertyDescriptor,Ew=(r,e,t,n)=>{for(var i=n>1?void 0:n?_Ft(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&wFt(e,t,i),i},cJ=40,Hh=class extends Or{constructor(){super(...arguments),this.loading=!bs.state.wallets.listings.length,this.firstFetch=!bs.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=_r.debounce(r=>{r.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=r,bs.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),bs.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var r;(r=this.intersectionObserver)==null||r.disconnect()}get placeholderEl(){return _r.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([r])=>{r.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){let{wallets:r,search:e}=bs.state,{listings:t,total:n}=this.search?e:r;return n<=cJ||t.length>=n}async fetchWallets(){var r;let{wallets:e,search:t}=bs.state,{listings:n,total:i,page:a}=this.search?t:e;if(!this.endReached&&(this.firstFetch||i>cJ&&n.length<i))try{this.loading=!0;let o=(r=Li.state.chains)==null?void 0:r.join(","),{listings:s}=await bs.getWallets({page:this.firstFetch?1:a+1,entries:cJ,search:this.search,version:2,chains:o}),c=s.map(l=>_r.getWalletIcon(l));await Promise.all([...c.map(async l=>_r.preloadImage(l)),Lt.wait(300)]),this.endReached=this.isLastPage()}catch(o){console.error(o),L6.openToast(_r.getErrorMessage(o),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(r){Lt.isAndroid()?_r.handleMobileLinking(r):_r.goToConnectingView(r)}onSearchChange(r){let{value:e}=r.target;this.searchDebounce(e)}render(){let{wallets:r,search:e}=bs.state,{listings:t}=this.search?e:r,n=this.loading&&!t.length,i=this.search.length>=3,a=f0.manualWalletsTemplate(),o=f0.recomendedWalletsTemplate(!0);i&&(a=a.filter(({values:l})=>_r.caseSafeIncludes(l[0],this.search)),o=o.filter(({values:l})=>_r.caseSafeIncludes(l[0],this.search)));let s=!this.loading&&!t.length&&!o.length,c={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":s};return et`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${wd(c)}"><div class="wcm-grid">${n?null:a} ${n?null:o} ${n?null:t.map(l=>et`${l?et`<wcm-wallet-button imageId="${l.image_id}" name="${l.name}" walletId="${l.id}" .onClick="${()=>this.onConnect(l)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${s?et`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!s&&this.loading?et`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};Hh.styles=[Xr.globalCss,bFt],Ew([ws()],Hh.prototype,"loading",2),Ew([ws()],Hh.prototype,"firstFetch",2),Ew([ws()],Hh.prototype,"search",2),Ew([ws()],Hh.prototype,"endReached",2),Hh=Ew([Zr("wcm-wallet-explorer-view")],Hh);EFt=pn`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`,xFt=Object.defineProperty,AFt=Object.getOwnPropertyDescriptor,ERe=(r,e,t,n)=>{for(var i=n>1?void 0:n?AFt(e,t):e,a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&xFt(e,t,i),i},QN=class extends Or{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(r){let{desktop:e,name:t}=Lt.getWalletRouterData(),n=e?.universal;if(n){let i=Lt.formatUniversalUrl(n,r,t);Lt.openHref(i,"_blank")}}openWebWallet(){let{walletConnectUri:r}=Li.state,e=Lt.getWalletRouterData();_r.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){let{name:r,id:e,image_id:t}=Lt.getWalletRouterData(),{isMobile:n,isDesktop:i}=_r.getCachedRouterWalletPlatforms(),a=Lt.isMobile();return et`<wcm-modal-header title="${r}" .onAction="${_r.handleUriCopy}" .actionIcon="${Sn.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Yo(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${r} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isDesktop="${a?!1:i}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Sn.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};QN.styles=[Xr.globalCss,EFt],ERe([ws()],QN.prototype,"isError",2),QN=ERe([Zr("wcm-web-connecting-view")],QN)});var ZN=(i=>(i.Mainnet="hedera:mainnet",i.Testnet="hedera:testnet",i.Previewnet="hedera:previewnet",i.Devnet="hedera:devnet",i))(ZN||{});var DRe={INVALID_PARAMS:{code:9e3,message:"INVALID_PARAMS"}};function XN(r,e,t){let{code:n,message:i}=DRe[r];return{code:n,message:e?`${i} ${e}`:i,data:t}}var eR=(t=>(t.AccountsChanged="accountsChanged",t.ChainChanged="chainChanged",t))(eR||{});var Fy=(o=>(o.GetNodeAddresses="hedera_getNodeAddresses",o.ExecuteTransaction="hedera_executeTransaction",o.SignMessage="hedera_signMessage",o.SignAndExecuteQuery="hedera_signAndExecuteQuery",o.SignAndExecuteTransaction="hedera_signAndExecuteTransaction",o.SignTransaction="hedera_signTransaction",o))(Fy||{});import{Buffer as Hu}from"buffer";var ia=Oe(Jt(),1);function Ke(r){return Buffer.from(r).toString("hex")}function tt(r){let e=r.startsWith("0x")?r.substring(2):r;return Buffer.from(e,"hex")}var Uy=class extends Error{constructor(e,t,n,i,a){super(`Entity ID ${e.toString()}.${t.toString()}.${n.toString()}-${i} was incorrect.`),this.name="BadEntityIdException",this.shard=e,this.realm=t,this.num=n,this.presentChecksum=i,this.expectedChecksum=a}};var BRe=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,nR=Math.ceil,T3=Math.floor,Ss="[BigNumber Error] ",_J=Ss+"Number primitive has more than 15 significant digits: ",Pc=1e14,Er=14,iR=9007199254740991,aR=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],K6=1e7,qa=1e9;function EJ(r){var e,t,n,i=R.prototype={constructor:R,toString:null,valueOf:null},a=new R(1),o=20,s=4,c=-7,l=21,u=-1e7,d=1e7,h=!1,g=1,m=0,b={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",I=!0;function R(N,F){var O,y,x,w,p,v,A,T,S=this;if(!(S instanceof R))return new R(N,F);if(F==null){if(N&&N._isBigNumber===!0){S.s=N.s,!N.c||N.e>d?S.c=S.e=null:N.e<u?S.c=[S.e=0]:(S.e=N.e,S.c=N.c.slice());return}if((v=typeof N=="number")&&N*0==0){if(S.s=1/N<0?(N=-N,-1):1,N===~~N){for(w=0,p=N;p>=10;p/=10,w++);w>d?S.c=S.e=null:(S.e=w,S.c=[N]);return}T=String(N)}else{if(!BRe.test(T=String(N)))return n(S,T,v);S.s=T.charCodeAt(0)==45?(T=T.slice(1),-1):1}(w=T.indexOf("."))>-1&&(T=T.replace(".","")),(p=T.search(/e/i))>0?(w<0&&(w=p),w+=+T.slice(p+1),T=T.substring(0,p)):w<0&&(w=T.length)}else{if(Ri(F,2,E.length,"Base"),F==10&&I)return S=new R(N),G(S,o+S.e+1,s);if(T=String(N),v=typeof N=="number"){if(N*0!=0)return n(S,T,v,F);if(S.s=1/N<0?(T=T.slice(1),-1):1,R.DEBUG&&T.replace(/^0\.0*|\./,"").length>15)throw Error(_J+N)}else S.s=T.charCodeAt(0)===45?(T=T.slice(1),-1):1;for(O=E.slice(0,F),w=p=0,A=T.length;p<A;p++)if(O.indexOf(y=T.charAt(p))<0){if(y=="."){if(p>w){w=A;continue}}else if(!x&&(T==T.toUpperCase()&&(T=T.toLowerCase())||T==T.toLowerCase()&&(T=T.toUpperCase()))){x=!0,p=-1,w=0;continue}return n(S,String(N),v,F)}v=!1,T=t(T,F,10,S.s),(w=T.indexOf("."))>-1?T=T.replace(".",""):w=T.length}for(p=0;T.charCodeAt(p)===48;p++);for(A=T.length;T.charCodeAt(--A)===48;);if(T=T.slice(p,++A)){if(A-=p,v&&R.DEBUG&&A>15&&(N>iR||N!==T3(N)))throw Error(_J+S.s*N);if((w=w-p-1)>d)S.c=S.e=null;else if(w<u)S.c=[S.e=0];else{if(S.e=w,S.c=[],p=(w+1)%Er,w<0&&(p+=Er),p<A){for(p&&S.c.push(+T.slice(0,p)),A-=Er;p<A;)S.c.push(+T.slice(p,p+=Er));p=Er-(T=T.slice(p)).length}else p-=A;for(;p--;T+="0");S.c.push(+T)}}else S.c=[S.e=0]}R.clone=EJ,R.ROUND_UP=0,R.ROUND_DOWN=1,R.ROUND_CEIL=2,R.ROUND_FLOOR=3,R.ROUND_HALF_UP=4,R.ROUND_HALF_DOWN=5,R.ROUND_HALF_EVEN=6,R.ROUND_HALF_CEIL=7,R.ROUND_HALF_FLOOR=8,R.EUCLID=9,R.config=R.set=function(N){var F,O;if(N!=null)if(typeof N=="object"){if(N.hasOwnProperty(F="DECIMAL_PLACES")&&(O=N[F],Ri(O,0,qa,F),o=O),N.hasOwnProperty(F="ROUNDING_MODE")&&(O=N[F],Ri(O,0,8,F),s=O),N.hasOwnProperty(F="EXPONENTIAL_AT")&&(O=N[F],O&&O.pop?(Ri(O[0],-qa,0,F),Ri(O[1],0,qa,F),c=O[0],l=O[1]):(Ri(O,-qa,qa,F),c=-(l=O<0?-O:O))),N.hasOwnProperty(F="RANGE"))if(O=N[F],O&&O.pop)Ri(O[0],-qa,-1,F),Ri(O[1],1,qa,F),u=O[0],d=O[1];else if(Ri(O,-qa,qa,F),O)u=-(d=O<0?-O:O);else throw Error(Ss+F+" cannot be zero: "+O);if(N.hasOwnProperty(F="CRYPTO"))if(O=N[F],O===!!O)if(O)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))h=O;else throw h=!O,Error(Ss+"crypto unavailable");else h=O;else throw Error(Ss+F+" not true or false: "+O);if(N.hasOwnProperty(F="MODULO_MODE")&&(O=N[F],Ri(O,0,9,F),g=O),N.hasOwnProperty(F="POW_PRECISION")&&(O=N[F],Ri(O,0,qa,F),m=O),N.hasOwnProperty(F="FORMAT"))if(O=N[F],typeof O=="object")b=O;else throw Error(Ss+F+" not an object: "+O);if(N.hasOwnProperty(F="ALPHABET"))if(O=N[F],typeof O=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(O))I=O.slice(0,10)=="0123456789",E=O;else throw Error(Ss+F+" invalid: "+O)}else throw Error(Ss+"Object expected: "+N);return{DECIMAL_PLACES:o,ROUNDING_MODE:s,EXPONENTIAL_AT:[c,l],RANGE:[u,d],CRYPTO:h,MODULO_MODE:g,POW_PRECISION:m,FORMAT:b,ALPHABET:E}},R.isBigNumber=function(N){if(!N||N._isBigNumber!==!0)return!1;if(!R.DEBUG)return!0;var F,O,y=N.c,x=N.e,w=N.s;e:if({}.toString.call(y)=="[object Array]"){if((w===1||w===-1)&&x>=-qa&&x<=qa&&x===T3(x)){if(y[0]===0){if(x===0&&y.length===1)return!0;break e}if(F=(x+1)%Er,F<1&&(F+=Er),String(y[0]).length==F){for(F=0;F<y.length;F++)if(O=y[F],O<0||O>=Pc||O!==T3(O))break e;if(O!==0)return!0}}}else if(y===null&&x===null&&(w===null||w===1||w===-1))return!0;throw Error(Ss+"Invalid BigNumber: "+N)},R.maximum=R.max=function(){return U(arguments,-1)},R.minimum=R.min=function(){return U(arguments,1)},R.random=function(){var N=9007199254740992,F=Math.random()*N&2097151?function(){return T3(Math.random()*N)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(O){var y,x,w,p,v,A=0,T=[],S=new R(a);if(O==null?O=o:Ri(O,0,qa),p=nR(O/Er),h)if(crypto.getRandomValues){for(y=crypto.getRandomValues(new Uint32Array(p*=2));A<p;)v=y[A]*131072+(y[A+1]>>>11),v>=9e15?(x=crypto.getRandomValues(new Uint32Array(2)),y[A]=x[0],y[A+1]=x[1]):(T.push(v%1e14),A+=2);A=p/2}else if(crypto.randomBytes){for(y=crypto.randomBytes(p*=7);A<p;)v=(y[A]&31)*281474976710656+y[A+1]*1099511627776+y[A+2]*4294967296+y[A+3]*16777216+(y[A+4]<<16)+(y[A+5]<<8)+y[A+6],v>=9e15?crypto.randomBytes(7).copy(y,A):(T.push(v%1e14),A+=7);A=p/7}else throw h=!1,Error(Ss+"crypto unavailable");if(!h)for(;A<p;)v=F(),v<9e15&&(T[A++]=v%1e14);for(p=T[--A],O%=Er,p&&O&&(v=aR[Er-O],T[A]=T3(p/v)*v);T[A]===0;T.pop(),A--);if(A<0)T=[w=0];else{for(w=-1;T[0]===0;T.splice(0,1),w-=Er);for(A=1,v=T[0];v>=10;v/=10,A++);A<Er&&(w-=Er-A)}return S.e=w,S.c=T,S}}(),R.sum=function(){for(var N=1,F=arguments,O=new R(F[0]);N<F.length;)O=O.plus(F[N++]);return O},t=function(){var N="0123456789";function F(O,y,x,w){for(var p,v=[0],A,T=0,S=O.length;T<S;){for(A=v.length;A--;v[A]*=y);for(v[0]+=w.indexOf(O.charAt(T++)),p=0;p<v.length;p++)v[p]>x-1&&(v[p+1]==null&&(v[p+1]=0),v[p+1]+=v[p]/x|0,v[p]%=x)}return v.reverse()}return function(O,y,x,w,p){var v,A,T,S,_,B,q,k,z=O.indexOf("."),ie=o,M=s;for(z>=0&&(S=m,m=0,O=O.replace(".",""),k=new R(y),B=k.pow(O.length-z),m=S,k.c=F(Ad(A3(B.c),B.e,"0"),10,x,N),k.e=k.c.length),q=F(O,y,x,p?(v=E,N):(v=N,E)),T=S=q.length;q[--S]==0;q.pop());if(!q[0])return v.charAt(0);if(z<0?--T:(B.c=q,B.e=T,B.s=w,B=e(B,k,ie,M,x),q=B.c,_=B.r,T=B.e),A=T+ie+1,z=q[A],S=x/2,_=_||A<0||q[A+1]!=null,_=M<4?(z!=null||_)&&(M==0||M==(B.s<0?3:2)):z>S||z==S&&(M==4||_||M==6&&q[A-1]&1||M==(B.s<0?8:7)),A<1||!q[0])O=_?Ad(v.charAt(1),-ie,v.charAt(0)):v.charAt(0);else{if(q.length=A,_)for(--x;++q[--A]>x;)q[A]=0,A||(++T,q=[1].concat(q));for(S=q.length;!q[--S];);for(z=0,O="";z<=S;O+=v.charAt(q[z++]));O=Ad(O,T,v.charAt(0))}return O}}(),e=function(){function N(y,x,w){var p,v,A,T,S=0,_=y.length,B=x%K6,q=x/K6|0;for(y=y.slice();_--;)A=y[_]%K6,T=y[_]/K6|0,p=q*A+T*B,v=B*A+p%K6*K6+S,S=(v/w|0)+(p/K6|0)+q*T,y[_]=v%w;return S&&(y=[S].concat(y)),y}function F(y,x,w,p){var v,A;if(w!=p)A=w>p?1:-1;else for(v=A=0;v<w;v++)if(y[v]!=x[v]){A=y[v]>x[v]?1:-1;break}return A}function O(y,x,w,p){for(var v=0;w--;)y[w]-=v,v=y[w]<x[w]?1:0,y[w]=v*p+y[w]-x[w];for(;!y[0]&&y.length>1;y.splice(0,1));}return function(y,x,w,p,v){var A,T,S,_,B,q,k,z,ie,M,te,oe,se,re,le,ae,ue,Ee=y.s==x.s?1:-1,he=y.c,we=x.c;if(!he||!he[0]||!we||!we[0])return new R(!y.s||!x.s||(he?we&&he[0]==we[0]:!we)?NaN:he&&he[0]==0||!we?Ee*0:Ee/0);for(z=new R(Ee),ie=z.c=[],T=y.e-x.e,Ee=w+T+1,v||(v=Pc,T=S3(y.e/Er)-S3(x.e/Er),Ee=Ee/Er|0),S=0;we[S]==(he[S]||0);S++);if(we[S]>(he[S]||0)&&T--,Ee<0)ie.push(1),_=!0;else{for(re=he.length,ae=we.length,S=0,Ee+=2,B=T3(v/(we[0]+1)),B>1&&(we=N(we,B,v),he=N(he,B,v),ae=we.length,re=he.length),se=ae,M=he.slice(0,ae),te=M.length;te<ae;M[te++]=0);ue=we.slice(),ue=[0].concat(ue),le=we[0],we[1]>=v/2&&le++;do{if(B=0,A=F(we,M,ae,te),A<0){if(oe=M[0],ae!=te&&(oe=oe*v+(M[1]||0)),B=T3(oe/le),B>1)for(B>=v&&(B=v-1),q=N(we,B,v),k=q.length,te=M.length;F(q,M,k,te)==1;)B--,O(q,ae<k?ue:we,k,v),k=q.length,A=1;else B==0&&(A=B=1),q=we.slice(),k=q.length;if(k<te&&(q=[0].concat(q)),O(M,q,te,v),te=M.length,A==-1)for(;F(we,M,ae,te)<1;)B++,O(M,ae<te?ue:we,te,v),te=M.length}else A===0&&(B++,M=[0]);ie[S++]=B,M[0]?M[te++]=he[se]||0:(M=[he[se]],te=1)}while((se++<re||M[0]!=null)&&Ee--);_=M[0]!=null,ie[0]||ie.splice(0,1)}if(v==Pc){for(S=1,Ee=ie[0];Ee>=10;Ee/=10,S++);G(z,w+(z.e=S+T*Er-1)+1,p,_)}else z.e=T,z.r=+_;return z}}();function L(N,F,O,y){var x,w,p,v,A;if(O==null?O=s:Ri(O,0,8),!N.c)return N.toString();if(x=N.c[0],p=N.e,F==null)A=A3(N.c),A=y==1||y==2&&(p<=c||p>=l)?Iw(A,p):Ad(A,p,"0");else if(N=G(new R(N),F,O),w=N.e,A=A3(N.c),v=A.length,y==1||y==2&&(F<=w||w<=c)){for(;v<F;A+="0",v++);A=Iw(A,w)}else if(F-=p,A=Ad(A,w,"0"),w+1>v){if(--F>0)for(A+=".";F--;A+="0");}else if(F+=w-v,F>0)for(w+1==v&&(A+=".");F--;A+="0");return N.s<0&&x?"-"+A:A}function U(N,F){for(var O,y,x=1,w=new R(N[0]);x<N.length;x++)y=new R(N[x]),(!y.s||(O=m0(w,y))===F||O===0&&w.s===F)&&(w=y);return w}function V(N,F,O){for(var y=1,x=F.length;!F[--x];F.pop());for(x=F[0];x>=10;x/=10,y++);return(O=y+O*Er-1)>d?N.c=N.e=null:O<u?N.c=[N.e=0]:(N.e=O,N.c=F),N}n=function(){var N=/^(-?)0([xbo])(?=\w[\w.]*$)/i,F=/^([^.]+)\.$/,O=/^\.([^.]+)$/,y=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(w,p,v,A){var T,S=v?p:p.replace(x,"");if(y.test(S))w.s=isNaN(S)?null:S<0?-1:1;else{if(!v&&(S=S.replace(N,function(_,B,q){return T=(q=q.toLowerCase())=="x"?16:q=="b"?2:8,!A||A==T?B:_}),A&&(T=A,S=S.replace(F,"$1").replace(O,"0.$1")),p!=S))return new R(S,T);if(R.DEBUG)throw Error(Ss+"Not a"+(A?" base "+A:"")+" number: "+p);w.s=null}w.c=w.e=null}}();function G(N,F,O,y){var x,w,p,v,A,T,S,_=N.c,B=aR;if(_){e:{for(x=1,v=_[0];v>=10;v/=10,x++);if(w=F-x,w<0)w+=Er,p=F,A=_[T=0],S=T3(A/B[x-p-1]%10);else if(T=nR((w+1)/Er),T>=_.length)if(y){for(;_.length<=T;_.push(0));A=S=0,x=1,w%=Er,p=w-Er+1}else break e;else{for(A=v=_[T],x=1;v>=10;v/=10,x++);w%=Er,p=w-Er+x,S=p<0?0:T3(A/B[x-p-1]%10)}if(y=y||F<0||_[T+1]!=null||(p<0?A:A%B[x-p-1]),y=O<4?(S||y)&&(O==0||O==(N.s<0?3:2)):S>5||S==5&&(O==4||y||O==6&&(w>0?p>0?A/B[x-p]:0:_[T-1])%10&1||O==(N.s<0?8:7)),F<1||!_[0])return _.length=0,y?(F-=N.e+1,_[0]=B[(Er-F%Er)%Er],N.e=-F||0):_[0]=N.e=0,N;if(w==0?(_.length=T,v=1,T--):(_.length=T+1,v=B[Er-w],_[T]=p>0?T3(A/B[x-p]%B[p])*v:0),y)for(;;)if(T==0){for(w=1,p=_[0];p>=10;p/=10,w++);for(p=_[0]+=v,v=1;p>=10;p/=10,v++);w!=v&&(N.e++,_[0]==Pc&&(_[0]=1));break}else{if(_[T]+=v,_[T]!=Pc)break;_[T--]=0,v=1}for(w=_.length;_[--w]===0;_.pop());}N.e>d?N.c=N.e=null:N.e<u&&(N.c=[N.e=0])}return N}function H(N){var F,O=N.e;return O===null?N.toString():(F=A3(N.c),F=O<=c||O>=l?Iw(F,O):Ad(F,O,"0"),N.s<0?"-"+F:F)}return i.absoluteValue=i.abs=function(){var N=new R(this);return N.s<0&&(N.s=1),N},i.comparedTo=function(N,F){return m0(this,new R(N,F))},i.decimalPlaces=i.dp=function(N,F){var O,y,x,w=this;if(N!=null)return Ri(N,0,qa),F==null?F=s:Ri(F,0,8),G(new R(w),N+w.e+1,F);if(!(O=w.c))return null;if(y=((x=O.length-1)-S3(this.e/Er))*Er,x=O[x])for(;x%10==0;x/=10,y--);return y<0&&(y=0),y},i.dividedBy=i.div=function(N,F){return e(this,new R(N,F),o,s)},i.dividedToIntegerBy=i.idiv=function(N,F){return e(this,new R(N,F),0,1)},i.exponentiatedBy=i.pow=function(N,F){var O,y,x,w,p,v,A,T,S,_=this;if(N=new R(N),N.c&&!N.isInteger())throw Error(Ss+"Exponent not an integer: "+H(N));if(F!=null&&(F=new R(F)),v=N.e>14,!_.c||!_.c[0]||_.c[0]==1&&!_.e&&_.c.length==1||!N.c||!N.c[0])return S=new R(Math.pow(+H(_),v?N.s*(2-Sw(N)):+H(N))),F?S.mod(F):S;if(A=N.s<0,F){if(F.c?!F.c[0]:!F.s)return new R(NaN);y=!A&&_.isInteger()&&F.isInteger(),y&&(_=_.mod(F))}else{if(N.e>9&&(_.e>0||_.e<-1||(_.e==0?_.c[0]>1||v&&_.c[1]>=24e7:_.c[0]<8e13||v&&_.c[0]<=9999975e7)))return w=_.s<0&&Sw(N)?-0:0,_.e>-1&&(w=1/w),new R(A?1/w:w);m&&(w=nR(m/Er+2))}for(v?(O=new R(.5),A&&(N.s=1),T=Sw(N)):(x=Math.abs(+H(N)),T=x%2),S=new R(a);;){if(T){if(S=S.times(_),!S.c)break;w?S.c.length>w&&(S.c.length=w):y&&(S=S.mod(F))}if(x){if(x=T3(x/2),x===0)break;T=x%2}else if(N=N.times(O),G(N,N.e+1,1),N.e>14)T=Sw(N);else{if(x=+H(N),x===0)break;T=x%2}_=_.times(_),w?_.c&&_.c.length>w&&(_.c.length=w):y&&(_=_.mod(F))}return y?S:(A&&(S=a.div(S)),F?S.mod(F):w?G(S,m,s,p):S)},i.integerValue=function(N){var F=new R(this);return N==null?N=s:Ri(N,0,8),G(F,F.e+1,N)},i.isEqualTo=i.eq=function(N,F){return m0(this,new R(N,F))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(N,F){return m0(this,new R(N,F))>0},i.isGreaterThanOrEqualTo=i.gte=function(N,F){return(F=m0(this,new R(N,F)))===1||F===0},i.isInteger=function(){return!!this.c&&S3(this.e/Er)>this.c.length-2},i.isLessThan=i.lt=function(N,F){return m0(this,new R(N,F))<0},i.isLessThanOrEqualTo=i.lte=function(N,F){return(F=m0(this,new R(N,F)))===-1||F===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(N,F){var O,y,x,w,p=this,v=p.s;if(N=new R(N,F),F=N.s,!v||!F)return new R(NaN);if(v!=F)return N.s=-F,p.plus(N);var A=p.e/Er,T=N.e/Er,S=p.c,_=N.c;if(!A||!T){if(!S||!_)return S?(N.s=-F,N):new R(_?p:NaN);if(!S[0]||!_[0])return _[0]?(N.s=-F,N):new R(S[0]?p:s==3?-0:0)}if(A=S3(A),T=S3(T),S=S.slice(),v=A-T){for((w=v<0)?(v=-v,x=S):(T=A,x=_),x.reverse(),F=v;F--;x.push(0));x.reverse()}else for(y=(w=(v=S.length)<(F=_.length))?v:F,v=F=0;F<y;F++)if(S[F]!=_[F]){w=S[F]<_[F];break}if(w&&(x=S,S=_,_=x,N.s=-N.s),F=(y=_.length)-(O=S.length),F>0)for(;F--;S[O++]=0);for(F=Pc-1;y>v;){if(S[--y]<_[y]){for(O=y;O&&!S[--O];S[O]=F);--S[O],S[y]+=Pc}S[y]-=_[y]}for(;S[0]==0;S.splice(0,1),--T);return S[0]?V(N,S,T):(N.s=s==3?-1:1,N.c=[N.e=0],N)},i.modulo=i.mod=function(N,F){var O,y,x=this;return N=new R(N,F),!x.c||!N.s||N.c&&!N.c[0]?new R(NaN):!N.c||x.c&&!x.c[0]?new R(x):(g==9?(y=N.s,N.s=1,O=e(x,N,0,3),N.s=y,O.s*=y):O=e(x,N,0,g),N=x.minus(O.times(N)),!N.c[0]&&g==1&&(N.s=x.s),N)},i.multipliedBy=i.times=function(N,F){var O,y,x,w,p,v,A,T,S,_,B,q,k,z,ie,M=this,te=M.c,oe=(N=new R(N,F)).c;if(!te||!oe||!te[0]||!oe[0])return!M.s||!N.s||te&&!te[0]&&!oe||oe&&!oe[0]&&!te?N.c=N.e=N.s=null:(N.s*=M.s,!te||!oe?N.c=N.e=null:(N.c=[0],N.e=0)),N;for(y=S3(M.e/Er)+S3(N.e/Er),N.s*=M.s,A=te.length,_=oe.length,A<_&&(k=te,te=oe,oe=k,x=A,A=_,_=x),x=A+_,k=[];x--;k.push(0));for(z=Pc,ie=K6,x=_;--x>=0;){for(O=0,B=oe[x]%ie,q=oe[x]/ie|0,p=A,w=x+p;w>x;)T=te[--p]%ie,S=te[p]/ie|0,v=q*T+S*B,T=B*T+v%ie*ie+k[w]+O,O=(T/z|0)+(v/ie|0)+q*S,k[w--]=T%z;k[w]=O}return O?++y:k.splice(0,1),V(N,k,y)},i.negated=function(){var N=new R(this);return N.s=-N.s||null,N},i.plus=function(N,F){var O,y=this,x=y.s;if(N=new R(N,F),F=N.s,!x||!F)return new R(NaN);if(x!=F)return N.s=-F,y.minus(N);var w=y.e/Er,p=N.e/Er,v=y.c,A=N.c;if(!w||!p){if(!v||!A)return new R(x/0);if(!v[0]||!A[0])return A[0]?N:new R(v[0]?y:x*0)}if(w=S3(w),p=S3(p),v=v.slice(),x=w-p){for(x>0?(p=w,O=A):(x=-x,O=v),O.reverse();x--;O.push(0));O.reverse()}for(x=v.length,F=A.length,x-F<0&&(O=A,A=v,v=O,F=x),x=0;F;)x=(v[--F]=v[F]+A[F]+x)/Pc|0,v[F]=Pc===v[F]?0:v[F]%Pc;return x&&(v=[x].concat(v),++p),V(N,v,p)},i.precision=i.sd=function(N,F){var O,y,x,w=this;if(N!=null&&N!==!!N)return Ri(N,1,qa),F==null?F=s:Ri(F,0,8),G(new R(w),N,F);if(!(O=w.c))return null;if(x=O.length-1,y=x*Er+1,x=O[x]){for(;x%10==0;x/=10,y--);for(x=O[0];x>=10;x/=10,y++);}return N&&w.e+1>y&&(y=w.e+1),y},i.shiftedBy=function(N){return Ri(N,-iR,iR),this.times("1e"+N)},i.squareRoot=i.sqrt=function(){var N,F,O,y,x,w=this,p=w.c,v=w.s,A=w.e,T=o+4,S=new R("0.5");if(v!==1||!p||!p[0])return new R(!v||v<0&&(!p||p[0])?NaN:p?w:1/0);if(v=Math.sqrt(+H(w)),v==0||v==1/0?(F=A3(p),(F.length+A)%2==0&&(F+="0"),v=Math.sqrt(+F),A=S3((A+1)/2)-(A<0||A%2),v==1/0?F="5e"+A:(F=v.toExponential(),F=F.slice(0,F.indexOf("e")+1)+A),O=new R(F)):O=new R(v+""),O.c[0]){for(A=O.e,v=A+T,v<3&&(v=0);;)if(x=O,O=S.times(x.plus(e(w,x,T,1))),A3(x.c).slice(0,v)===(F=A3(O.c)).slice(0,v))if(O.e<A&&--v,F=F.slice(v-3,v+1),F=="9999"||!y&&F=="4999"){if(!y&&(G(x,x.e+o+2,0),x.times(x).eq(w))){O=x;break}T+=4,v+=4,y=1}else{(!+F||!+F.slice(1)&&F.charAt(0)=="5")&&(G(O,O.e+o+2,1),N=!O.times(O).eq(w));break}}return G(O,O.e+o+1,s,N)},i.toExponential=function(N,F){return N!=null&&(Ri(N,0,qa),N++),L(this,N,F,1)},i.toFixed=function(N,F){return N!=null&&(Ri(N,0,qa),N=N+this.e+1),L(this,N,F)},i.toFormat=function(N,F,O){var y,x=this;if(O==null)N!=null&&F&&typeof F=="object"?(O=F,F=null):N&&typeof N=="object"?(O=N,N=F=null):O=b;else if(typeof O!="object")throw Error(Ss+"Argument not an object: "+O);if(y=x.toFixed(N,F),x.c){var w,p=y.split("."),v=+O.groupSize,A=+O.secondaryGroupSize,T=O.groupSeparator||"",S=p[0],_=p[1],B=x.s<0,q=B?S.slice(1):S,k=q.length;if(A&&(w=v,v=A,A=w,k-=w),v>0&&k>0){for(w=k%v||v,S=q.substr(0,w);w<k;w+=v)S+=T+q.substr(w,v);A>0&&(S+=T+q.slice(w)),B&&(S="-"+S)}y=_?S+(O.decimalSeparator||"")+((A=+O.fractionGroupSize)?_.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(O.fractionGroupSeparator||"")):_):S}return(O.prefix||"")+y+(O.suffix||"")},i.toFraction=function(N){var F,O,y,x,w,p,v,A,T,S,_,B,q=this,k=q.c;if(N!=null&&(v=new R(N),!v.isInteger()&&(v.c||v.s!==1)||v.lt(a)))throw Error(Ss+"Argument "+(v.isInteger()?"out of range: ":"not an integer: ")+H(v));if(!k)return new R(q);for(F=new R(a),T=O=new R(a),y=A=new R(a),B=A3(k),w=F.e=B.length-q.e-1,F.c[0]=aR[(p=w%Er)<0?Er+p:p],N=!N||v.comparedTo(F)>0?w>0?F:T:v,p=d,d=1/0,v=new R(B),A.c[0]=0;S=e(v,F,0,1),x=O.plus(S.times(y)),x.comparedTo(N)!=1;)O=y,y=x,T=A.plus(S.times(x=T)),A=x,F=v.minus(S.times(x=F)),v=x;return x=e(N.minus(O),y,0,1),A=A.plus(x.times(T)),O=O.plus(x.times(y)),A.s=T.s=q.s,w=w*2,_=e(T,y,w,s).minus(q).abs().comparedTo(e(A,O,w,s).minus(q).abs())<1?[T,y]:[A,O],d=p,_},i.toNumber=function(){return+H(this)},i.toPrecision=function(N,F){return N!=null&&Ri(N,1,qa),L(this,N,F,2)},i.toString=function(N){var F,O=this,y=O.s,x=O.e;return x===null?y?(F="Infinity",y<0&&(F="-"+F)):F="NaN":(N==null?F=x<=c||x>=l?Iw(A3(O.c),x):Ad(A3(O.c),x,"0"):N===10&&I?(O=G(new R(O),o+x+1,s),F=Ad(A3(O.c),O.e,"0")):(Ri(N,2,E.length,"Base"),F=t(Ad(A3(O.c),x,"0"),10,N,y,!0)),y<0&&O.c[0]&&(F="-"+F)),F},i.valueOf=i.toJSON=function(){return H(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,r!=null&&R.set(r),R}function S3(r){var e=r|0;return r>0||r===e?e:e-1}function A3(r){for(var e,t,n=1,i=r.length,a=r[0]+"";n<i;){for(e=r[n++]+"",t=Er-e.length;t--;e="0"+e);a+=e}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function m0(r,e){var t,n,i=r.c,a=e.c,o=r.s,s=e.s,c=r.e,l=e.e;if(!o||!s)return null;if(t=i&&!i[0],n=a&&!a[0],t||n)return t?n?0:-s:o;if(o!=s)return o;if(t=o<0,n=c==l,!i||!a)return n?0:!i^t?1:-1;if(!n)return c>l^t?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^t?1:-1;return c==l?0:c>l^t?1:-1}function Ri(r,e,t,n){if(r<e||r>t||r!==T3(r))throw Error(Ss+(n||"Argument")+(typeof r=="number"?r<e||r>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function Sw(r){var e=r.c.length-1;return S3(r.e/Er)==e&&r.c[e]%2!=0}function Iw(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function Ad(r,e,t){var n,i;if(e<0){for(i=t+".";++e;i+=t);r=i+r}else if(n=r.length,++e>n){for(i=t,e-=n;--e;i+=t);r+=i}else e<n&&(r=r.slice(0,e)+"."+r.slice(e));return r}var MRe=EJ(),$e=MRe;var xJ=Oe(Jt(),1),LRe="This value cannot be null | undefined.";var FRe="This value must be a string or Uint8Array.";var URe="The provided variable must be an Array.";var qRe="This value must be a String, Number, or BigNumber to be converted.",jRe="This value must be a String, Number, or BigNumber to be converted.",VRe="Unable to parse given variable. Returns NaN.";function g0(r){return r!=null}function HRe(r){return g0(r)&&r instanceof Uint8Array}function Cw(r){return g0(r)&&(typeof r=="number"||r instanceof Number)}function AJ(r){return g0(r)&&r instanceof $e}function TJ(r){return g0(r)&&r instanceof xJ.default}function oR(r){return g0(r)&&typeof r=="string"}function KRe(r){return g0(r)&&(oR(r)||HRe(r))}function Gh(r){for(let e=0;e<12;e++)if(r[e]!=0)return!1;return!0}function sR(r){if(g0(r))return r;throw new Error(LRe)}function SJ(r){if(KRe(sR(r)))return r;throw new Error(FRe)}function vt(r){if(sR(r),AJ(r)||oR(r)||Cw(r)||TJ(r))return new $e(r);throw new Error(qRe)}function wt(r){if(r instanceof Array)return r.map(vt);throw new Error(URe)}function kw(r){if(sR(r),AJ(r)||oR(r)||Cw(r)||TJ(r)){let e=parseInt(r);if(isNaN(e))throw new Error(VRe);return e}else throw new Error(jRe)}function uo(r,e=0,t=r.byteLength){if(!(Number.isInteger(e)&&e>=0))throw new Error("Invalid offset!");if(!(Number.isInteger(t)&&t>=0))throw new Error("Invalid length!");return new DataView(r.buffer,r.byteOffset+e,Math.min(t,r.byteLength-e))}function cR(r,e,t=new Set){if(typeof r=="object"&&typeof e=="object"){let n=Object.keys(r),i=Object.keys(e);if(n.length!==i.length)return!1;for(let a=0;a<n.length;a++){if(n[a]!==i[a])return!1;if(!t.has(n[a])&&!cR(r[n[a]],e[i[a]],t))return!1}return!0}else return typeof r=="number"&&typeof e=="number"||typeof r=="string"&&typeof e=="string"||typeof r=="boolean"&&typeof e=="boolean"?r===e:!1}function Nw(r){for(var e=r.length,t,n;e!==0;)n=Math.floor(Math.random()*e),e-=1,t=r[e],r[e]=r[n],r[n]=t}function IJ(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;let t=new DataView(r.buffer,r.byteOffset,r.byteLength),n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.byteLength;for(;i--;)if(t.getUint8(i)!==n.getUint8(i))return!1;return!0}var wUe=Oe(br(),1);var Js=class{};var Cn=class extends Error{constructor(e){super(e instanceof Error?e.message:e),this.name="BadKeyError",e instanceof Error&&(this.cause=e,this.stack=e.stack)}};var qee=Oe(Hy(),1);function $h(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;let t=new DataView(r.buffer,r.byteOffset,r.byteLength),n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.byteLength;for(;i--;)if(t.getUint8(i)!==n.getUint8(i))return!1;return!0}function xZ(r,e){if(r.byteLength<e.byteLength)return!1;let t=e.byteLength;for(;t--;)if(r[t]!==e[t])return!1;return!0}function Ca(r){return Buffer.from(r).toString("hex")}function dr(r){let e=r.startsWith("0x")?r.substring(2):r;return Buffer.from(e,"hex")}function AZ(r,e){let t="0123456789abcdef",n="0x";for(let i=0;i<r.length;i++){let a=r[i];n+=t[(a&240)>>4]+t[a&15]}for(n.length>2*e+2&&console.log("result out of range","result");n.length<2*e+2;)n="0x0"+n.substring(2);return n.substring(2)}var y_=Oe(g_(),1),WBe="302a300506032b6570032100",NO=dr(WBe),Vc=class r extends Js{constructor(e){super(),this._keyData=e}get _type(){return"ED25519"}static fromBytes(e){switch(e.length){case 32:return r.fromBytesRaw(e);case 44:return r.fromBytesDer(e);default:throw new Cn(`invalid public key length: ${e.length} bytes`)}}static fromBytesDer(e){let t=y_.default.asn1.fromDer(new y_.default.util.ByteStringBuffer(e)),n;try{n=y_.default.pki.ed25519.publicKeyFromAsn1(t)}catch(i){let a=i!=null&&i.message!=null?i.message:"";throw new Cn(`cannot decode ED25519 public key data from DER format: ${a}`)}return new r(n)}static fromBytesRaw(e){if(e.length!=32)throw new Cn(`invalid public key length: ${e.length} bytes`);return new r(e)}static fromString(e){return r.fromBytes(dr(e))}verify(e,t){return qee.default.sign.detached.verify(e,t,this._keyData)}toBytesDer(){let e=new Uint8Array(NO.length+32);return e.set(NO,0),e.set(this._keyData.subarray(0,32),NO.length),e}toBytesRaw(){return this._keyData.slice()}equals(e){return $h(this._keyData,e._keyData)}};var hf=Oe(Hy(),1);var RO=Oe(Hy(),1);function jee(r){return RO.default.randomBytes(r)}function C0(r){return Promise.resolve(RO.default.randomBytes(r))}import PO from"crypto";function Vee(r){return Buffer.from(r).toString("utf8")}function of(r){return Buffer.from(r,"utf8")}var Zn={Sha256:"SHA-256",Sha384:"SHA-384",Sha512:"SHA-512"};function Hc(r,e,t){let n=typeof e=="string"?of(e):e,i=typeof t=="string"?of(t):t;switch(r){case Zn.Sha256:return Promise.resolve(PO.createHmac("SHA256",n).update(i).digest());case Zn.Sha384:return Promise.resolve(PO.createHmac("SHA384",n).update(i).digest());case Zn.Sha512:return Promise.resolve(PO.createHmac("SHA512",n).update(i).digest());default:throw new Error("(BUG) Non-Exhaustive switch statement for algorithms")}}var yre=Oe(d5(),1),vre=Oe(uD(),1),dD=new yre.default.ec("secp256k1"),zLe=new vre.default("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),bre=2147483648;async function E2(r,e,t){let n=fD(t),i=new Uint8Array(37),a=dr(dD.keyFromPrivate(r).getPublic(!0,"hex"));n?(i[0]=0,i.set(r,1)):i.set(a,0),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(33,t,!1);let o=await Hc(Zn.Sha512,e,i),s=o.subarray(0,32),c=o.subarray(32);try{let l=dD.keyFromPrivate(r).getPrivate().add(dD.keyFromPrivate(s).getPrivate()).mod(zLe),u=AZ(l.toBuffer(),32);return l.eqn(0)?E2(r,e,t+1):{keyData:dr(u),chainCode:c}}catch{return E2(r,e,t+1)}}async function wre(r){if(r.length<16)throw new TypeError("Seed should be at least 128 bits");if(r.length>64)throw new TypeError("Seed should be at most 512 bits");let e=await Hc(Zn.Sha512,"Bitcoin seed",r),t=e.subarray(0,32),n=e.subarray(32);return{keyData:t,chainCode:n}}function P_(r){return r|bre}function fD(r){return(r&bre)!==0}async function M_(r,e,t){if(fD(t))throw new Error("the index should not be pre-hardened");let n=new Uint8Array(37);n[0]=0,n.set(r,1),new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(33,t,!1),n[33]|=128;let i=await Hc(Zn.Sha512,e,n);return{keyData:i.subarray(0,32),chainCode:i.subarray(32)}}async function _re(r){let e=await Hc(Zn.Sha512,"ed25519 seed",r);return{keyData:e.subarray(0,32),chainCode:e.subarray(32)}}var L_=Oe(g_(),1),GLe="302e020100300506032b657004220420",hD=dr(GLe),$a=class r{constructor(e,t){this._keyPair=e instanceof Uint8Array?hf.default.sign.keyPair.fromSeed(e):e,this._chainCode=t??null}get _type(){return"ED25519"}static generate(){let e=jee(64);return new r(hf.default.sign.keyPair.fromSeed(e.subarray(0,32)),e.subarray(32))}static async generateAsync(){let e=await C0(64);return new r(hf.default.sign.keyPair.fromSeed(e.subarray(0,32)),e.subarray(32))}static fromBytes(e){switch(e.length){case 48:return r.fromBytesDer(e);case 32:case 64:return r.fromBytesRaw(e);default:throw new Cn(`invalid private key length: ${e.length} bytes`)}}static fromBytesDer(e){let t=L_.default.asn1.fromDer(new L_.default.util.ByteStringBuffer(e)),n;try{n=L_.default.pki.ed25519.privateKeyFromAsn1(t).privateKeyBytes}catch(a){let o=a!=null&&a.message!=null?a.message:"";throw new Cn(`cannot decode ED25519 private key data from DER format: ${o}`)}let i=hf.default.sign.keyPair.fromSeed(n);return new r(i)}static fromBytesRaw(e){switch(e.length){case 32:return new r(hf.default.sign.keyPair.fromSeed(e));case 64:return new r(hf.default.sign.keyPair.fromSecretKey(e));default:}throw new Cn(`invalid private key length: ${e.length} bytes`)}static fromString(e){return r.fromBytes(dr(e))}static fromStringDer(e){return r.fromBytesDer(dr(e))}static fromStringRaw(e){return r.fromBytesRaw(dr(e))}static async fromSeed(e){let{keyData:t,chainCode:n}=await _re(e);return new r(t,n)}get publicKey(){return new Vc(this._keyPair.publicKey)}sign(e){return hf.default.sign.detached(e,this._keyPair.secretKey)}toBytesDer(){let e=new Uint8Array(hD.length+32);return e.set(hD,0),e.set(this._keyPair.secretKey.subarray(0,32),hD.length),e}toBytesRaw(){return this._keyPair.secretKey.slice(0,32)}};var mf="0123456789abcdef".split(""),WLe=[1,256,65536,16777216],Qc=[0,8,16,24],Ere=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],QLe=r=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(r<<1)>>5,outputBlocks:r>>5,s:(e=>[].concat(e,e,e,e,e))([0,0,0,0,0,0,0,0,0,0])}),$Le=(r,e)=>{for(var t=e.length,n=r.blocks,i=r.blockCount<<2,a=r.blockCount,o=r.outputBlocks,s=r.s,c=0,l,u;c<t;){if(r.reset)for(r.reset=!1,n[0]=r.block,l=1;l<a+1;++l)n[l]=0;if(typeof e!="string")for(l=r.start;c<t&&l<i;++c)n[l>>2]|=e[c]<<Qc[l++&3];else for(l=r.start;c<t&&l<i;++c)u=e.charCodeAt(c),u<128?n[l>>2]|=u<<Qc[l++&3]:u<2048?(n[l>>2]|=(192|u>>6)<<Qc[l++&3],n[l>>2]|=(128|u&63)<<Qc[l++&3]):u<55296||u>=57344?(n[l>>2]|=(224|u>>12)<<Qc[l++&3],n[l>>2]|=(128|u>>6&63)<<Qc[l++&3],n[l>>2]|=(128|u&63)<<Qc[l++&3]):(u=65536+((u&1023)<<10|e.charCodeAt(++c)&1023),n[l>>2]|=(240|u>>18)<<Qc[l++&3],n[l>>2]|=(128|u>>12&63)<<Qc[l++&3],n[l>>2]|=(128|u>>6&63)<<Qc[l++&3],n[l>>2]|=(128|u&63)<<Qc[l++&3]);if(r.lastByteIndex=l,l>=i){for(r.start=l-i,r.block=n[a],l=0;l<a;++l)s[l]^=n[l];mD(s),r.reset=!0}else r.start=l}if(l=r.lastByteIndex,n[l>>2]|=WLe[l&3],r.lastByteIndex===i)for(n[0]=n[a],l=1;l<a+1;++l)n[l]=0;for(n[a-1]|=2147483648,l=0;l<a;++l)s[l]^=n[l];mD(s);var d="",h,g=0;for(l=0;g<o;){for(l=0;l<a&&g<o;++l,++g)h=s[l],d+=mf[h>>4&15]+mf[h&15]+mf[h>>12&15]+mf[h>>8&15]+mf[h>>20&15]+mf[h>>16&15]+mf[h>>28&15]+mf[h>>24&15];g%a===0&&(mD(s),l=0)}return"0x"+d},mD=r=>{var e,t,n,i,a,o,s,c,l,u,d,h,g,m,b,E,I,R,L,U,V,G,H,N,F,O,y,x,w,p,v,A,T,S,_,B,q,k,z,ie,M,te,oe,se,re,le,ae,ue,Ee,he,we,hn,at,mt,Wn,xt,St,vi,Tt,It,li,Ct,kt;for(n=0;n<48;n+=2)i=r[0]^r[10]^r[20]^r[30]^r[40],a=r[1]^r[11]^r[21]^r[31]^r[41],o=r[2]^r[12]^r[22]^r[32]^r[42],s=r[3]^r[13]^r[23]^r[33]^r[43],c=r[4]^r[14]^r[24]^r[34]^r[44],l=r[5]^r[15]^r[25]^r[35]^r[45],u=r[6]^r[16]^r[26]^r[36]^r[46],d=r[7]^r[17]^r[27]^r[37]^r[47],h=r[8]^r[18]^r[28]^r[38]^r[48],g=r[9]^r[19]^r[29]^r[39]^r[49],e=h^(o<<1|s>>>31),t=g^(s<<1|o>>>31),r[0]^=e,r[1]^=t,r[10]^=e,r[11]^=t,r[20]^=e,r[21]^=t,r[30]^=e,r[31]^=t,r[40]^=e,r[41]^=t,e=i^(c<<1|l>>>31),t=a^(l<<1|c>>>31),r[2]^=e,r[3]^=t,r[12]^=e,r[13]^=t,r[22]^=e,r[23]^=t,r[32]^=e,r[33]^=t,r[42]^=e,r[43]^=t,e=o^(u<<1|d>>>31),t=s^(d<<1|u>>>31),r[4]^=e,r[5]^=t,r[14]^=e,r[15]^=t,r[24]^=e,r[25]^=t,r[34]^=e,r[35]^=t,r[44]^=e,r[45]^=t,e=c^(h<<1|g>>>31),t=l^(g<<1|h>>>31),r[6]^=e,r[7]^=t,r[16]^=e,r[17]^=t,r[26]^=e,r[27]^=t,r[36]^=e,r[37]^=t,r[46]^=e,r[47]^=t,e=u^(i<<1|a>>>31),t=d^(a<<1|i>>>31),r[8]^=e,r[9]^=t,r[18]^=e,r[19]^=t,r[28]^=e,r[29]^=t,r[38]^=e,r[39]^=t,r[48]^=e,r[49]^=t,m=r[0],b=r[1],le=r[11]<<4|r[10]>>>28,ae=r[10]<<4|r[11]>>>28,x=r[20]<<3|r[21]>>>29,w=r[21]<<3|r[20]>>>29,It=r[31]<<9|r[30]>>>23,li=r[30]<<9|r[31]>>>23,te=r[40]<<18|r[41]>>>14,oe=r[41]<<18|r[40]>>>14,S=r[2]<<1|r[3]>>>31,_=r[3]<<1|r[2]>>>31,E=r[13]<<12|r[12]>>>20,I=r[12]<<12|r[13]>>>20,ue=r[22]<<10|r[23]>>>22,Ee=r[23]<<10|r[22]>>>22,p=r[33]<<13|r[32]>>>19,v=r[32]<<13|r[33]>>>19,Ct=r[42]<<2|r[43]>>>30,kt=r[43]<<2|r[42]>>>30,mt=r[5]<<30|r[4]>>>2,Wn=r[4]<<30|r[5]>>>2,B=r[14]<<6|r[15]>>>26,q=r[15]<<6|r[14]>>>26,R=r[25]<<11|r[24]>>>21,L=r[24]<<11|r[25]>>>21,he=r[34]<<15|r[35]>>>17,we=r[35]<<15|r[34]>>>17,A=r[45]<<29|r[44]>>>3,T=r[44]<<29|r[45]>>>3,N=r[6]<<28|r[7]>>>4,F=r[7]<<28|r[6]>>>4,xt=r[17]<<23|r[16]>>>9,St=r[16]<<23|r[17]>>>9,k=r[26]<<25|r[27]>>>7,z=r[27]<<25|r[26]>>>7,U=r[36]<<21|r[37]>>>11,V=r[37]<<21|r[36]>>>11,hn=r[47]<<24|r[46]>>>8,at=r[46]<<24|r[47]>>>8,se=r[8]<<27|r[9]>>>5,re=r[9]<<27|r[8]>>>5,O=r[18]<<20|r[19]>>>12,y=r[19]<<20|r[18]>>>12,vi=r[29]<<7|r[28]>>>25,Tt=r[28]<<7|r[29]>>>25,ie=r[38]<<8|r[39]>>>24,M=r[39]<<8|r[38]>>>24,G=r[48]<<14|r[49]>>>18,H=r[49]<<14|r[48]>>>18,r[0]=m^~E&R,r[1]=b^~I&L,r[10]=N^~O&x,r[11]=F^~y&w,r[20]=S^~B&k,r[21]=_^~q&z,r[30]=se^~le&ue,r[31]=re^~ae&Ee,r[40]=mt^~xt&vi,r[41]=Wn^~St&Tt,r[2]=E^~R&U,r[3]=I^~L&V,r[12]=O^~x&p,r[13]=y^~w&v,r[22]=B^~k&ie,r[23]=q^~z&M,r[32]=le^~ue&he,r[33]=ae^~Ee&we,r[42]=xt^~vi&It,r[43]=St^~Tt&li,r[4]=R^~U&G,r[5]=L^~V&H,r[14]=x^~p&A,r[15]=w^~v&T,r[24]=k^~ie&te,r[25]=z^~M&oe,r[34]=ue^~he&hn,r[35]=Ee^~we&at,r[44]=vi^~It&Ct,r[45]=Tt^~li&kt,r[6]=U^~G&m,r[7]=V^~H&b,r[16]=p^~A&N,r[17]=v^~T&F,r[26]=ie^~te&S,r[27]=M^~oe&_,r[36]=he^~hn&se,r[37]=we^~at&re,r[46]=It^~Ct&mt,r[47]=li^~kt&Wn,r[8]=G^~m&E,r[9]=H^~b&I,r[18]=A^~N&O,r[19]=T^~F&y,r[28]=te^~S&B,r[29]=oe^~_&q,r[38]=hn^~se&le,r[39]=at^~re&ae,r[48]=Ct^~mt&xt,r[49]=kt^~Wn&St,r[0]^=Ere[n],r[1]^=Ere[n+1]},YLe=r=>e=>{var t;if(e.slice(0,2)==="0x"){t=[];for(var n=2,i=e.length;n<i;n+=2)t.push(parseInt(e.slice(n,n+2),16))}else t=e;return $Le(QLe(r),t)},f5=YLe(256);var xre=Oe(d5(),1),p5=new xre.default.ec("secp256k1");function gD(){let r=p5.genKeyPair();return{privateKey:dr(r.getPrivate("hex")),publicKey:dr(r.getPublic(!0,"hex"))}}async function Are(){return Promise.resolve(gD())}function gf(r){let e=p5.keyFromPrivate(r);return{privateKey:dr(e.getPrivate("hex")),publicKey:dr(e.getPublic(!0,"hex"))}}function Tre(r){let e=p5.keyFromPublic(r);return dr(e.getPublic(!1,"hex"))}function Sre(r,e){let t=Ca(e),n=dr(f5(`0x${t}`)),a=p5.keyFromPrivate(r).sign(n),o=a.r.toArray("be",32),s=a.s.toArray("be",32),c=new Uint8Array(64);return c.set(o,0),c.set(s,32),c}function Ire(r,e,t){let n=Ca(e),i=dr(f5(`0x${n}`));return p5.keyFromPublic(r).verify(i,{r:t.subarray(0,32),s:t.subarray(32,64)})}var Cre=Oe(d5(),1),JLe=new Cre.default.ec("secp256k1"),ZLe="302d300706052b8104000a032200",U_=dr(ZLe),XLe="3036301006072a8648ce3d020106052b8104000a032200",yD=dr(XLe),$c=class r extends Js{constructor(e){super(),this._keyData=e}get _type(){return"secp256k1"}static fromBytes(e){switch(e.length){case 33:return r.fromBytesRaw(e);default:return r.fromBytesDer(e)}}static fromBytesDer(e){let t=new Uint8Array;switch(e.length){case 47:t=e.subarray(U_.length);break;case 56:t=e.subarray(yD.length,yD.length+33);break;default:let a=JLe.keyFromPublic(e.subarray(yD.length),"der").getPublic().encodeCompressed("hex");t=dr(a);break}if(t.length==0)throw new Cn("cannot decode ECDSA private key data from DER format");return new r(t)}static fromBytesRaw(e){if(e.length!=33)throw new Cn(`invalid public key length: ${e.length} bytes`);return new r(e)}static fromString(e){return r.fromBytes(dr(e))}verify(e,t){return Ire(this._keyData,e,t)}toBytesDer(){let e=new Uint8Array(U_.length+this._keyData.length);return e.set(U_,0),e.set(this._keyData,U_.length),e}toBytesRaw(){return new Uint8Array(this._keyData.subarray())}toEthereumAddress(){let e=dr(f5(`0x${Ca(Tre(this.toBytesRaw()).subarray(1))}`));return Ca(e.subarray(12))}equals(e){return $h(this._keyData,e._keyData)}};var eFe="3030020100300706052b8104000a04220420",h5=dr(eFe),tFe="30540201010420",kre=dr(tFe),Do=class r{constructor(e,t){this._keyPair=e,this._chainCode=t??null}get _type(){return"secp256k1"}static generate(){return new r(gD())}static async generateAsync(){return new r(await Are())}static fromBytes(e){switch(e.length){case 32:return r.fromBytesRaw(e);default:return r.fromBytesDer(e)}}static fromBytesDer(e){let t=new Uint8Array;return xZ(e,h5)?t=e.subarray(h5.length):t=e.subarray(kre.length,kre.length+32),new r(gf(t))}static fromBytesRaw(e){return new r(gf(e))}static fromString(e){return r.fromBytes(dr(e))}static fromStringDer(e){return r.fromBytesDer(dr(e))}static fromStringRaw(e){return r.fromBytesRaw(dr(e))}static async fromSeed(e){let{keyData:t,chainCode:n}=await wre(e);return new r(gf(t),n)}get publicKey(){return new $c(this._keyPair.publicKey)}sign(e){return Sre(this._keyPair.privateKey,e)}toBytesDer(){let e=new Uint8Array(h5.length+32);return e.set(h5,0),e.set(this._keyPair.privateKey.subarray(0,32),h5.length),e}toBytesRaw(){let e=new Uint8Array(32);return e.set(this._keyPair.privateKey.slice(0,32),0),e}};var t3=class r extends Js{constructor(e){super(),this._key=e}get _type(){return this._key._type}static fromBytes(e){let t;try{return new r(Vc.fromBytes(e))}catch(n){t=n!=null&&n.message!=null?n.message:""}try{return new r($c.fromBytes(e))}catch(n){t=n!=null&&n.message!=null?n.message:""}throw new Cn(`public key cannot be decoded from bytes: ${t}`)}static fromBytesED25519(e){return new r(Vc.fromBytes(e))}static fromBytesECDSA(e){return new r($c.fromBytes(e))}static fromString(e){return r.fromBytes(dr(e))}static fromStringED25519(e){return r.fromBytesED25519(dr(e))}static fromStringECDSA(e){return r.fromBytesECDSA(dr(e))}verify(e,t){return this._key.verify(e,t)}verifyTransaction(e){console.log("Deprecated: use `@hashgraph/sdk`.PublicKey instead"),e._requireFrozen(),e.isFrozen()||e.freeze();for(let t of e._signedTransactions)if(t.sigMap!=null&&t.sigMap.sigPair!=null){let n=!1;for(let i of t.sigMap.sigPair){let a=i.pubKeyPrefix;if($h(a,this.toBytesRaw())){n=!0;let o=t.bodyBytes,s=i.ed25519!=null?i.ed25519:i.ECDSASecp256k1;if(!this.verify(o,s))return!1}}if(!n)return!1}return!0}toBytes(){return this._key instanceof Vc?this.toBytesRaw():this.toBytesDer()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toString(){return this.toStringDer()}toStringDer(){return Ca(this.toBytesDer())}toStringRaw(){return Ca(this.toBytesRaw())}toEthereumAddress(){if(this._key instanceof $c)return this._key.toEthereumAddress();throw new Error("unsupported operation on Ed25519PublicKey")}equals(e){return this._key instanceof Vc&&e._key instanceof Vc?this._key.equals(e._key):this._key instanceof $c&&e._key instanceof $c?this._key.equals(e._key):!1}};import vD from"crypto";var M0={Aes128Ctr:"AES-128-CTR",Aes128Cbc:"AES-128-CBC"};function Nre(r,e,t,n){let i=vD.createCipheriv(r,e.slice(0,16),t);return Promise.resolve(Buffer.concat([i.update(n),i.final()]))}function x2(r,e,t,n){let i=vD.createDecipheriv(r,e.slice(0,16),t);return Promise.resolve(Buffer.concat([i.update(n),i.final()]))}function Rre(r,e){return Promise.resolve(vD.createHash("md5").update(r).update(dr(e).slice(0,8)).digest())}import rFe from"util";import nFe from"crypto";async function Dd(r,e,t,n,i){let a=typeof e=="string"?of(e):e,o=typeof t=="string"?of(t):t,s=rFe.promisify(nFe.pbkdf2);switch(r){case Zn.Sha256:return s(a,o,n,i,"sha256");case Zn.Sha384:return s(a,o,n,i,"sha384");case Zn.Sha512:return s(a,o,n,i,"sha512");default:throw new Error("(BUG) Non-Exhaustive switch statement for algorithms")}}var Ore="hmac-sha256";async function Dre(r,e){let a=await C0(32),o=await Dd(Zn.Sha256,e,a,262144,32),s=await C0(16),c=await Nre(M0.Aes128Ctr,o.slice(0,16),s,r),l=await Hc(Zn.Sha384,o.slice(16),c),u={version:1,crypto:{ciphertext:Ca(c),cipherparams:{iv:Ca(s)},cipher:M0.Aes128Ctr,kdf:"pbkdf2",kdfparams:{dkLen:32,salt:Ca(a),c:262144,prf:Ore},mac:Ca(l)}};return of(JSON.stringify(u))}async function Pre(r,e){let t=JSON.parse(Vee(r));if(t.version!==1)throw new Cn(`unsupported keystore version: ${t.version}`);let{ciphertext:n,cipherparams:{iv:i},cipher:a,kdf:o,kdfparams:{dkLen:s,salt:c,c:l,prf:u},mac:d}=t.crypto;if(o!=="pbkdf2")throw new Cn(`unsupported key derivation function:" + ${o}`);if(u!==Ore)throw new Cn(`unsupported key derivation hash function: ${u}`);let h=dr(c),g=dr(i),m=dr(n),b=await Dd(Zn.Sha256,e,h,l,s),E=dr(d),I=await Hc(Zn.Sha384,b.slice(16),m);if(!E.every((R,L)=>R===I[L]))throw new Cn("HMAC mismatch; passphrase is incorrect");return x2(a,b.slice(0,16),g,m)}function m5(r){return Bre(r)[0]}function Bre(r){let[e,t]=oFe(r.subarray(1)),n=t.subarray(0,e),i=t.subarray(e);switch(r[0]){case 2:return[{int:Mre(n)},i];case 4:return[{bytes:n},i];case 5:return[{},i];case 6:return[{ident:aFe(n)},i];case 48:return[{seq:iFe(n)},i];default:throw new Error(`unsupported DER type tag: ${r[0]}`)}}function iFe(r){let e=r,t=[];for(;e.length!==0;){let[n,i]=Bre(e);t.push(n),e=i}return t}function aFe(r){let e=[Math.floor(r[0]/40),r[0]%40],t=0;for(let n of r.subarray(1))t*=128,n<128?(t+=n,e.push(t),t=0):t+=n&127;return e.join(".")}function oFe(r){if(r[0]<128)return[r[0],r.subarray(1)];let e=r[0]-128,t=r.subarray(1,e+1),n=r.subarray(e+1);return[Mre(t),n]}function Mre(r){let e=r.length;if(e===1)return r[0];let t=new DataView(r.buffer,r.byteOffset,r.byteLength);if(e===2)return t.getUint16(0,!1);if(e===3){let n=Uint8Array.of(0,...r);t=new DataView(n.buffer,n.byteOffset,n.byteLength)}if(e>4)throw new Error(`unsupported DER integer length of ${e} bytes`);return t.getUint32(0,!1)}var yf=class{constructor(e){if("seq"in e&&e.seq.length>=1&&"ident"in e.seq[0])this.algIdent=e.seq[0].ident,this.parameters=e.seq[1];else throw new Error(`error parsing AlgorithmIdentifier from ${JSON.stringify(e)}`)}toString(){return JSON.stringify(this)}},wD=class{constructor(e){if("seq"in e&&e.seq.length===2)this.kdf=new yf(e.seq[0]),this.encScheme=new yf(e.seq[1]);else throw new Error(`error parsing PBES2Params from ${JSON.stringify(e)}`)}},_D=class{constructor(e){if("seq"in e&&e.seq.length>=2&&"bytes"in e.seq[0]&&"int"in e.seq[1]&&(this.salt=e.seq[0].bytes,this.iterCount=e.seq[1].int,e.seq.length>2)){if("seq"in e.seq[2]){this.prf=new yf(e.seq[2]);return}else"int"in e.seq[2]&&(this.keyLength=e.seq[2].int);e.seq.length===4&&(this.prf=new yf(e.seq[3]));return}throw new Error(`error parsing PBKDF2Params from ${JSON.stringify(e)}`)}},ED=class r{constructor(e){if("seq"in e&&e.seq.length===3){if("int"in e.seq[0]&&e.seq[0].int===0)this.version=0;else throw new Error(`expected version = 0, got ${JSON.stringify(e.seq[0])}`);if(this.algId=new yf(e.seq[1]),"bytes"in e.seq[2])this.privateKey=e.seq[2].bytes;else throw new Error(`expected octet string as 3rd element, got ${JSON.stringify(e.seq[2])}`);return}throw new Error(`error parsing PrivateKeyInfo from ${JSON.stringify(e)}`)}static parse(e){return new r(m5(e))}},j_=class r{constructor(e){if("seq"in e&&e.seq.length===2&&"bytes"in e.seq[1]){this.algId=new yf(e.seq[0]),this.data=e.seq[1].bytes;return}throw new Error(`error parsing EncryptedPrivateKeyInfo from ${JSON.stringify(e)}`)}static parse(e){return new r(m5(e))}async decrypt(e){if(this.algId.algIdent!=="1.2.840.113549.1.5.13"||!this.algId.parameters)throw new Error(`unsupported key encryption algorithm: ${this.algId.toString()}`);let t=new wD(this.algId.parameters);if(t.kdf.algIdent!=="1.2.840.113549.1.5.12"||!t.kdf.parameters)throw new Error(`unsupported key derivation function: ${t.kdf.toString()}`);let n=new _D(t.kdf.parameters);if(n.prf){if(n.prf.algIdent!=="1.2.840.113549.2.9")throw new Error(`unsupported PRF ${n.prf.toString()}`)}else throw new Error("unsupported PRF HMAC-SHA-1");if(t.encScheme.algIdent!=="2.16.840.1.101.3.4.1.2")throw new Error(`unsupported encryption scheme: ${t.encScheme.toString()}`);if(!t.encScheme.parameters||!("bytes"in t.encScheme.parameters))throw new Error(`expected IV as bytes for AES-128-CBC, got: ${JSON.stringify(t.encScheme.parameters)}`);let i=n.keyLength||16,a=t.encScheme.parameters.bytes,o=await Dd(Zn.Sha256,e,n.salt,n.iterCount,i),s=await x2(M0.Aes128Cbc,o,a,this.data);return ED.parse(s)}};function xD(r){return Buffer.from(r,"base64")}var kne=Oe(Cne(),1),Nne=Oe(g_(),1);import{Buffer as QFe}from"buffer";var $Fe="1.3.101.112";async function YFe(r,e){let t=r.replace(/-----BEGIN (.*)-----|-----END (.*)-----|\n|\r/g,""),n=xD(t);if(e){let i;try{i=j_.parse(n)}catch(c){let l=c!=null&&c.message!=null?c.message:"";throw new Cn(`failed to parse encrypted private key: ${l}`)}let a=await i.decrypt(e),o=null;if(a.algId.algIdent===$Fe)o=$a;else throw new Cn(`unknown private key algorithm ${a.algId.toString()}`);let s=m5(a.privateKey);if(!("bytes"in s))throw new Cn(`expected ASN bytes, got ${JSON.stringify(s)}`);return o.fromBytes(s.bytes)}return n.subarray(16)}async function JFe(r,e){let t=r.replace(/-----BEGIN (.*)-----|-----END (.*)-----|\n|\r/g,""),n=xD(t);if(e){let a=Nne.default.pem.decode(r)[0].dekInfo.parameters,o=dr(a),s=r.split(`
10633
10633
  `),c=await Rre(e,a),l=QFe.from(s.slice(4,s.length-1).join(""),"base64"),u=await x2(M0.Aes128Cbc,c,o,l);return Do.fromBytesDer(u)}else return kne.fromBER(n).result.valueBlock.value[1].valueBlock.valueHexView}async function Rne(r,e){return r.includes("BEGIN EC PRIVATE KEY")?JFe(r,e):YFe(r,e)}function One(r,e){let t=new Uint8Array(r.length+8);t.set(r,0);let n=new DataView(t.buffer,t.byteOffset,t.byteLength);e===0xffffffffff?(n.setInt32(r.length+0,255),n.setInt32(r.length+4,-1)):(n.setInt32(r.length+0,e<0?-1:0),n.setInt32(r.length+4,e));let i=Uint8Array.from([255]);return Dd(Zn.Sha512,t,i,2048,32)}var XFe={privateKeyConstructor:null,privateKeyFromBytes:null,mnemonicFromString:null},U3=XFe;var Pn=class r extends Js{constructor(e){super(),this._key=e}get _type(){return this._key._type}get _chainCode(){return this._key._chainCode}static generateED25519(){return new r($a.generate())}static generateECDSA(){return new r(Do.generate())}static generate(){return r.generateED25519()}static async generateAsync(){return r.generateED25519Async()}static async generateED25519Async(){return new r(await $a.generateAsync())}static async generateECDSAAsync(){return new r(await Do.generateAsync())}static fromBytes(e){let t;e.length==32&&console.warn("WARNING: Consider using fromStringECDSA() or fromStringED2551() on a HEX-encoded string and fromStringDer() on a HEX-encoded string with DER prefix instead.");try{return new r($a.fromBytes(e))}catch(n){t=n!=null&&n.message!=null?n.message:""}try{return new r(Do.fromBytes(e))}catch(n){t=n!=null&&n.message!=null?n.message:""}throw new Cn(`private key cannot be decoded from bytes: ${t}`)}static fromBytesECDSA(e){return new r(Do.fromBytes(e))}static fromBytesED25519(e){return new r($a.fromBytes(e))}static fromString(e){return r.fromBytes(dr(e))}static fromStringECDSA(e){return r.fromBytesECDSA(dr(e))}static fromStringED25519(e){return r.fromBytesED25519(dr(e))}static async fromSeedED25519(e){let t=await $a.fromSeed(e);return new r(t)}static async fromSeedECDSAsecp256k1(e){let t=await Do.fromSeed(e);return new r(t)}static async fromMnemonic(e,t=""){if(U3.mnemonicFromString==null)throw new Error("Mnemonic not found in cache");return(typeof e=="string"?U3.mnemonicFromString(e):e).toEd25519PrivateKey(t)}static async fromKeystore(e,t=""){return r.fromBytes(await Pre(e,t))}static async fromPem(e,t=""){let n=await Rne(e,t);return n instanceof $a||n instanceof Do?new r(n):e.includes("BEGIN EC PRIVATE KEY")?new r(Do.fromBytes(n)):new r($a.fromBytes(n))}async derive(e){if(this._key._chainCode==null)throw new Error("this private key does not support key derivation");if(this._key instanceof $a){let{keyData:t,chainCode:n}=await M_(this.toBytesRaw(),this._key._chainCode,e);return new r(new $a(t,n))}else{let{keyData:t,chainCode:n}=await E2(this.toBytesRaw(),this._key._chainCode,e);return new r(new Do(gf(t),n))}}async legacyDerive(e){let t=await One(this.toBytesRaw().subarray(0,32),e),n=this._key.constructor;return new r(new n(t))}get publicKey(){return new t3(this._key.publicKey)}sign(e){return this._key.sign(e)}signTransaction(e){if(e.isFrozen()||e.freeze(),e._signedTransactions.length!=1)throw new Error("`PrivateKey.signTransaction()` requires `Transaction` to have a single node `AccountId` set");let t=e._signedTransactions[0],n=Ca(this.publicKey.toBytesRaw());t.sigMap==null&&(t.sigMap={}),t.sigMap.sigPair==null&&(t.sigMap.sigPair=[]);for(let o of t.sigMap.sigPair)if(o.pubKeyPrefix!=null&&Ca(o.pubKeyPrefix)===n)switch(this._type){case"ED25519":return o.ed25519;case"secp256k1":return o.ECDSASecp256k1}let i=this.sign(t.bodyBytes!=null?t.bodyBytes:new Uint8Array),a={pubKeyPrefix:this.publicKey.toBytesRaw()};switch(this._type){case"ED25519":a.ed25519=i;break;case"secp256k1":a.ECDSASecp256k1=i;break}return t.sigMap.sigPair.push(a),e._signerPublicKeys.add(n),i}isDerivable(){return this._key._chainCode!=null}toBytes(){return this._key instanceof $a?this.toBytesRaw():this.toBytesDer()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toString(){return this.toStringDer()}toStringDer(){return Ca(this.toBytesDer())}toStringRaw(){return Ca(this.toBytesRaw())}toKeystore(e=""){return Dre(this.toBytesRaw(),e)}};U3.privateKeyConstructor=r=>new Pn(r);U3.privateKeyFromBytes=r=>Pn.fromBytes(r);var eUe=Object.freeze({BadLength:"BadLength",UnknownWords:"UnknownWords",ChecksumMismatch:"ChecksumMismatch"}),q3=eUe;var Jc=class r extends Error{constructor(e,t,n){let i;switch(t){case q3.BadLength:i="mnemonic is of an unexpected number of words";break;case q3.ChecksumMismatch:i="checksum byte in mnemonic did not match the rest of the mnemonic";break;case q3.UnknownWords:i="mnemonic contained words that are not in the standard word list";break;default:throw new Error(`unexpected value ${t.toString()} for 'reason'`)}super(`invalid mnemonic: ${i}`),typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r),this.name="BadMnemonicError",this.reason=t,this.mnemonic=e,this.unknownWordIndices=n}};var sE=["aback","abbey","abbot","abide","ablaze","able","aboard","abode","abort","abound","about","above","abroad","abrupt","absent","absorb","absurd","abuse","accent","accept","access","accord","accuse","ace","ache","aching","acid","acidic","acorn","acre","across","act","action","active","actor","actual","acute","adam","adapt","add","added","addict","adept","adhere","adjust","admire","admit","adobe","adopt","adrift","adult","adverb","advice","aerial","afar","affair","affect","afford","afghan","afield","afloat","afraid","afresh","after","again","age","agency","agenda","agent","aghast","agile","ago","agony","agree","agreed","ahead","aid","aide","aim","air","airman","airy","akin","alarm","alaska","albeit","album","ale","alert","alibi","alice","alien","alight","align","alike","alive","alkali","all","alley","allied","allow","alloy","ally","almond","almost","aloft","alone","along","aloof","aloud","alpha","alpine","also","altar","alter","always","amaze","amazon","amber","ambush","amen","amend","amid","amidst","amiss","among","amount","ample","amuse","anchor","and","andrew","anew","angel","anger","angle","angry","animal","ankle","annoy","annual","answer","anthem","any","anyhow","anyway","apart","apathy","apex","apiece","appeal","appear","apple","apply","april","apron","arab","arcade","arcane","arch","arctic","ardent","are","area","argue","arid","arise","ark","arm","armful","army","aroma","around","arouse","array","arrest","arrive","arrow","arson","art","artery","artful","artist","ascent","ash","ashen","ashore","aside","ask","asleep","aspect","assay","assent","assert","assess","asset","assign","assist","assume","assure","asthma","astute","asylum","ate","athens","atlas","atom","atomic","attach","attack","attain","attend","attic","auburn","audio","audit","august","aunt","auntie","aura","austin","author","auto","autumn","avail","avenge","avenue","avert","avid","avoid","await","awake","awaken","award","aware","awash","away","awful","awhile","axe","axes","axiom","axis","axle","aye","babe","baby","bach","back","backup","bacon","bad","badge","badly","bag","baggy","bail","bait","bake","baker","bakery","bald","ball","ballad","ballet","ballot","baltic","bamboo","ban","banal","banana","band","bang","bank","bar","barber","bare","barely","barge","bark","barley","barn","baron","barrel","barren","basalt","base","basic","basil","basin","basis","basket","bass","bat","batch","bath","baton","battle","bay","beach","beacon","beak","beam","bean","bear","beard","beast","beat","beauty","become","bed","beech","beef","beefy","beep","beer","beet","beetle","before","beg","beggar","begin","behalf","behave","behind","beige","being","belief","bell","belly","belong","below","belt","bench","bend","benign","bent","berlin","berry","berth","beset","beside","best","bestow","bet","beta","betray","better","beware","beyond","bias","biceps","bicker","bid","big","bigger","bike","bile","bill","bin","binary","bind","biopsy","birch","bird","birdie","birth","bishop","bit","bitch","bite","bitter","black","blade","blame","bland","blast","blaze","bleak","blend","bless","blew","blind","blink","blip","bliss","blitz","block","blond","blood","bloody","bloom","blot","blouse","blow","blue","bluff","blunt","blur","blush","boar","board","boast","boat","bob","bodily","body","bogus","boil","bold","bolt","bomb","bombay","bond","bone","bonn","bonnet","bonus","bony","book","boom","boost","boot","booth","booze","border","bore","borrow","bosom","boss","boston","both","bother","bottle","bottom","bought","bounce","bound","bounty","bout","bovine","bow","bowel","bowl","box","boy","boyish","brace","brain","brainy","brake","bran","branch","brand","brandy","brass","brave","bravo","brazil","breach","bread","break","breast","breath","bred","breed","breeze","brew","bribe","brick","bride","bridge","brief","bright","brim","brine","bring","brink","brisk","broad","broke","broken","bronze","brook","broom","brown","bruise","brush","brutal","brute","bubble","buck","bucket","buckle","budget","buffet","buggy","build","bulb","bulge","bulk","bulky","bull","bullet","bully","bump","bumpy","bunch","bundle","bunk","bunny","burden","bureau","burial","buried","burly","burn","burnt","burrow","burst","bury","bus","bush","bust","bustle","busy","but","butler","butt","butter","button","buy","buyer","buzz","bye","byte","cab","cabin","cable","cache","cactus","caesar","cage","cairo","cajun","cajole","cake","calf","call","caller","calm","calmly","came","camel","camera","camp","campus","can","canada","canal","canary","cancel","cancer","candid","candle","candy","cane","canine","canoe","canopy","canvas","canyon","cap","cape","car","carbon","card","care","career","caress","cargo","carl","carnal","carol","carp","carpet","carrot","carry","cart","cartel","case","cash","cask","cast","castle","casual","cat","catch","cater","cattle","caught","causal","cause","cave","cease","celery","cell","cellar","celtic","cement","censor","census","cent","cereal","chain","chair","chalk","chalky","champ","chance","change","chant","chaos","chap","chapel","charge","charm","chart","chase","chat","cheap","cheat","check","cheek","cheeky","cheer","cheery","cheese","chef","cheque","cherry","chess","chest","chew","chic","chick","chief","child","chile","chill","chilly","chin","china","chip","choice","choir","choose","chop","choppy","chord","chorus","chose","chosen","chris","chrome","chunk","chunky","church","cider","cigar","cinema","circa","circle","circus","cite","city","civic","civil","clad","claim","clammy","clan","clap","clash","clasp","class","clause","claw","clay","clean","clear","clergy","clerk","clever","click","client","cliff","climax","climb","clinch","cling","clinic","clip","cloak","clock","clone","close","closer","closet","cloth","cloud","cloudy","clout","clown","club","clue","clumsy","clung","clutch","coach","coal","coarse","coast","coat","coax","cobalt","cobra","coca","cock","cocoa","code","coffee","coffin","cohort","coil","coin","coke","cold","collar","colon","colony","colt","column","comb","combat","come","comedy","comic","commit","common","compel","comply","concur","cone","confer","congo","consul","convex","convey","convoy","cook","cool","cope","copper","copy","coral","cord","core","cork","corn","corner","corps","corpse","corpus","cortex","cosmic","cosmos","cost","costly","cotton","couch","cough","could","count","county","coup","couple","coupon","course","court","cousin","cove","cover","covert","cow","coward","cowboy","cozy","crab","crack","cradle","craft","crafty","crag","crane","crash","crate","crater","crawl","crazy","creak","cream","creamy","create","credit","creed","creek","creep","creepy","crept","crest","crew","cried","crime","crisis","crisp","critic","crook","crop","cross","crow","crowd","crown","crude","cruel","cruise","crunch","crush","crust","crux","cry","crypt","cuba","cube","cubic","cuckoo","cuff","cult","cup","curb","cure","curfew","curl","curry","curse","cursor","curve","cuss","custom","cut","cute","cycle","cyclic","cynic","czech","dad","daddy","dagger","daily","dairy","daisy","dale","dam","damage","damp","dampen","dance","danger","danish","dare","dark","darken","darn","dart","dash","data","date","david","dawn","day","dead","deadly","deaf","deal","dealer","dean","dear","death","debate","debit","debris","debt","debtor","decade","decay","decent","decide","deck","decor","decree","deduce","deed","deep","deeply","deer","defeat","defect","defend","defer","define","defy","degree","deity","delay","delete","delhi","delta","demand","demise","demo","demure","denial","denote","dense","dental","deny","depart","depend","depict","deploy","depot","depth","deputy","derive","desert","design","desire","desist","desk","detail","detect","deter","detest","detour","device","devise","devoid","devote","devour","dial","diana","diary","dice","dictum","did","die","diesel","diet","differ","dig","digest","digit","dine","dinghy","dinner","diode","dip","dire","direct","dirt","dirty","disc","disco","dish","disk","dismal","dispel","ditch","dive","divert","divide","divine","dizzy","docile","dock","doctor","dog","dogma","dole","doll","dollar","dolly","domain","dome","domino","donate","done","donkey","donor","doom","door","dorsal","dose","dot","double","doubt","dough","dour","dove","down","dozen","draft","drag","dragon","drain","drama","drank","draw","drawer","dread","dream","dreary","dress","drew","dried","drift","drill","drink","drip","drive","driver","drop","drove","drown","drug","drum","drunk","dry","dual","duck","duct","due","duel","duet","duke","dull","duly","dumb","dummy","dump","dune","dung","duress","during","dusk","dust","dusty","dutch","duty","dwarf","dwell","dyer","dying","dynamo","each","eager","eagle","ear","earl","early","earn","earth","ease","easel","easily","east","easter","easy","eat","eaten","eater","echo","eddy","eden","edge","edible","edict","edit","editor","eel","eerie","eerily","effect","effort","egg","ego","eight","eighth","eighty","either","elbow","elder","eldest","elect","eleven","elicit","elite","else","elude","elves","embark","emblem","embryo","emerge","emit","empire","employ","empty","enable","enamel","end","endure","enemy","energy","engage","engine","enjoy","enlist","enough","ensure","entail","enter","entire","entry","envoy","envy","enzyme","epic","epoch","equal","equate","equip","equity","era","erect","eric","erode","erotic","errant","error","escape","escort","essay","essex","estate","esteem","ethic","ethnic","europe","evade","eve","even","event","ever","every","evict","evil","evoke","evolve","exact","exam","exceed","excel","except","excess","excise","excite","excuse","exempt","exert","exile","exist","exit","exodus","exotic","expand","expect","expert","expire","export","expose","extend","extra","eye","eyed","fabric","face","facial","fact","factor","fade","fail","faint","fair","fairly","fairy","faith","fake","falcon","fall","false","falter","fame","family","famine","famous","fan","fancy","far","farce","fare","farm","farmer","fast","fasten","faster","fat","fatal","fate","father","fatty","fault","faulty","fauna","fear","feast","feat","fed","fee","feeble","feed","feel","feet","fell","fellow","felt","female","fence","fend","ferry","fetal","fetch","feudal","fever","few","fewer","fiasco","fiddle","field","fiend","fierce","fiery","fifth","fifty","fig","fight","figure","file","fill","filled","filler","film","filter","filth","filthy","final","finale","find","fine","finery","finger","finish","finite","fire","firm","firmly","first","fiscal","fish","fisher","fist","fit","fitful","five","fix","flag","flair","flak","flame","flank","flap","flare","flash","flask","flat","flavor","flaw","fled","flee","fleece","fleet","flesh","fleshy","flew","flick","flight","flimsy","flint","flirt","float","flock","flood","floor","floppy","flora","floral","flour","flow","flower","fluent","fluffy","fluid","flung","flurry","flush","flute","flux","fly","flyer","foal","foam","focal","focus","fog","foil","fold","folk","follow","folly","fond","fondly","font","food","fool","foot","for","forbid","force","ford","forest","forge","forget","fork","form","formal","format","former","fort","forth","forty","forum","fossil","foster","foul","found","four","fourth","fox","foyer","frail","frame","franc","france","frank","fraud","fred","free","freed","freely","freeze","french","frenzy","fresh","friar","friday","fridge","fried","friend","fright","fringe","frock","frog","from","front","frost","frosty","frown","frozen","frugal","fruit","fry","fudge","fuel","full","fully","fumes","fun","fund","funny","fur","furry","fury","fuse","fusion","fuss","fussy","futile","future","fuzzy","gadget","gain","gala","galaxy","gale","gall","galley","gallon","gallop","gamble","game","gamma","gandhi","gang","gap","garage","garden","garlic","gas","gasp","gate","gather","gauge","gaunt","gave","gaze","gear","geese","gem","gemini","gender","gene","geneva","genial","genius","genre","gentle","gently","gentry","genus","george","germ","get","ghetto","ghost","giant","gift","giggle","gill","gilt","ginger","girl","give","given","glad","glade","glance","gland","glare","glass","glassy","gleam","glee","glide","global","globe","gloom","gloomy","gloria","glory","gloss","glossy","glove","glow","glue","gnat","gnu","goal","goat","gold","golden","golf","gone","gong","goo","good","goose","gore","gorge","gory","gosh","gospel","gossip","got","gothic","govern","gown","grab","grace","grade","grail","grain","grand","grant","grape","graph","grasp","grass","grassy","grate","grave","gravel","gravy","grease","greasy","great","greece","greed","greedy","greek","green","greet","grew","grey","grid","grief","grill","grim","grin","grind","grip","grit","gritty","groan","groin","groom","groove","gross","ground","group","grove","grow","grown","growth","grudge","grunt","guard","guess","guest","guide","guild","guilt","guilty","guise","guitar","gulf","gully","gun","gunman","guru","gut","guy","gypsy","habit","hack","had","hail","hair","hairy","haiti","hale","half","hall","halt","hamlet","hammer","hand","handle","handy","hang","hangar","hanoi","happen","happy","harass","harbor","hard","harder","hardly","hare","harem","harm","harp","harry","harsh","has","hash","hassle","haste","hasten","hasty","hat","hatch","hate","haul","haunt","havana","have","haven","havoc","hawaii","hawk","hay","hazard","haze","hazel","hazy","head","heal","health","heap","hear","heard","heart","hearth","hearty","heat","heater","heaven","heavy","hebrew","heck","hectic","hedge","heel","hefty","height","heir","held","helium","helix","hell","hello","helm","helmet","help","hemp","hence","henry","her","herald","herb","herd","here","hereby","hermes","hernia","hero","heroic","heroin","hey","heyday","hick","hidden","hide","high","higher","highly","hill","him","hind","hinder","hint","hippie","hire","his","hiss","hit","hive","hoard","hoarse","hobby","hockey","hold","holder","hole","hollow","holly","holy","home","honest","honey","hood","hook","hope","horn","horrid","horror","horse","hose","host","hot","hotel","hound","hour","house","hover","how","huge","hull","human","humane","humble","humid","hung","hunger","hungry","hunt","hurdle","hurl","hurry","hurt","hush","hut","hybrid","hymn","hyphen","ice","icing","icon","idaho","idea","ideal","idiom","idiot","idle","idly","idol","ignite","ignore","ill","image","immune","impact","imply","import","impose","inca","incest","inch","income","incur","indeed","index","india","indian","indoor","induce","inept","inert","infant","infect","infer","influx","inform","inject","injure","injury","ink","inlaid","inland","inlet","inmate","inn","innate","inner","input","insane","insect","insert","inset","inside","insist","insult","insure","intact","intake","intend","inter","into","invade","invent","invest","invite","invoke","inward","iowa","iran","iraq","irish","iron","ironic","irony","isaac","isabel","island","isle","israel","issue","italy","itch","item","itself","ivan","ivory","jack","jacket","jacob","jade","jaguar","jail","james","jane","japan","jargon","java","jaw","jazz","jeep","jelly","jerky","jest","jet","jewel","jewish","jim","job","jock","jockey","joe","john","join","joint","joke","jolly","jolt","jordan","joseph","joy","joyful","joyous","judge","judy","juice","juicy","july","jumble","jumbo","jump","june","jungle","junior","junk","junta","jury","just","kansas","karate","karl","keel","keen","keep","keeper","kenya","kept","kernel","kettle","key","khaki","kick","kid","kidnap","kidney","kill","killer","kin","kind","kindly","king","kiss","kite","kitten","knack","knee","kneel","knew","knife","knight","knit","knob","knock","knot","know","known","koran","korea","kuwait","label","lace","lack","lad","ladder","laden","lady","lagoon","laity","lake","lamb","lame","lamp","lance","land","lane","lap","lapse","large","larval","laser","last","latch","late","lately","latent","later","latest","latin","latter","laugh","launch","lava","lavish","law","lawful","lawn","lawyer","lay","layer","layman","lazy","lead","leader","leaf","leafy","league","leak","leaky","lean","leap","learn","lease","leash","least","leave","led","ledge","left","leg","legacy","legal","legend","legion","lemon","lend","length","lens","lent","leo","leper","lesion","less","lessen","lesser","lesson","lest","let","lethal","letter","level","lever","levy","lewis","liable","liar","libel","libya","lice","lick","lid","lie","lied","lier","life","lift","light","like","likely","limb","lime","limit","limp","line","linear","linen","linger","link","lint","lion","lip","liquid","liquor","list","listen","lit","live","lively","liver","liz","lizard","load","loaf","loan","lobby","lobe","local","locate","lock","locus","lodge","loft","lofty","log","logic","logo","london","lone","lonely","long","longer","look","loop","loose","loosen","loot","lord","lorry","lose","loss","lost","lot","lotion","lotus","loud","loudly","lounge","lousy","love","lovely","lover","low","lower","lowest","loyal","lucid","luck","lucky","lucy","lull","lump","lumpy","lunacy","lunar","lunch","lung","lure","lurid","lush","lust","lute","luther","luxury","lying","lymph","lynch","lyric","macho","macro","mad","madam","made","mafia","magic","magma","magnet","magnum","magpie","maid","maiden","mail","main","mainly","major","make","maker","male","malice","mall","malt","mammal","manage","mane","mania","manic","manner","manor","mantle","manual","manure","many","map","maple","marble","march","mare","margin","maria","marina","mark","market","marry","mars","marsh","martin","martyr","mary","mask","mason","mass","mast","master","mat","match","mate","matrix","matter","mature","maxim","may","maybe","mayor","maze","mead","meadow","meal","mean","meant","meat","medal","media","median","medic","medium","meet","mellow","melody","melon","melt","member","memo","memory","menace","mend","mental","mentor","menu","mercy","mere","merely","merge","merger","merit","merry","mesh","mess","messy","met","metal","meter","method","methyl","metric","metro","mexico","miami","mickey","mid","midday","middle","midst","midway","might","mighty","mild","mildew","mile","milk","milky","mill","mimic","mince","mind","mine","mini","mink","minor","mint","minus","minute","mire","mirror","mirth","misery","miss","mist","misty","mite","mix","moan","moat","mob","mobile","mock","mode","model","modem","modern","modest","modify","module","moist","molar","mold","mole","molten","moment","monday","money","monk","monkey","month","mood","moody","moon","moor","moral","morale","morbid","more","morgue","mortal","mortar","mosaic","moscow","moses","mosque","moss","most","mostly","moth","mother","motion","motive","motor","mount","mourn","mouse","mouth","move","movie","mrs","much","muck","mucus","mud","muddle","muddy","mule","mummy","munich","murder","murky","murmur","muscle","museum","music","mussel","must","mutant","mute","mutiny","mutter","mutton","mutual","muzzle","myopic","myriad","myself","mystic","myth","nadir","nail","naked","name","namely","nape","napkin","naples","narrow","nasal","nasty","nathan","nation","native","nature","nausea","naval","nave","navy","near","nearer","nearly","neat","neatly","neck","need","needle","needy","negate","neon","nepal","nephew","nerve","nest","net","neural","never","newly","next","nice","nicely","niche","nickel","niece","night","nile","nimble","nine","ninety","ninth","nobel","noble","nobody","node","noise","noisy","none","noon","nor","norm","normal","north","norway","nose","nosy","not","note","notice","notify","notion","noun","novel","novice","now","nozzle","null","numb","number","nurse","nut","nylon","nymph","oak","oar","oasis","oath","obese","obey","object","oblige","oboe","obtain","obtuse","occult","occupy","occur","ocean","octave","odd","off","offend","offer","office","offset","often","ohio","oil","oily","okay","old","older","oldest","olive","omega","omen","omit","once","one","onion","only","onset","onto","onus","onward","opaque","open","openly","opera","opium","oppose","optic","option","oracle","oral","orange","orbit","orchid","ordeal","order","organ","orgasm","orient","origin","ornate","orphan","oscar","other","otter","ought","ounce","our","out","outer","output","outset","oval","oven","over","overt","owe","owing","owl","own","owner","oxford","oxide","oxygen","oyster","ozone","pace","pack","packet","pact","pad","paddle","paddy","pagan","page","paid","pain","paint","pair","palace","pale","palm","pan","panama","panel","panic","papa","papal","paper","parade","parcel","pardon","parent","paris","parish","park","parody","parrot","part","partly","party","pascal","pass","past","paste","pastel","pastor","pastry","pat","patch","patent","path","patio","patrol","patron","paul","pause","pave","paw","pawn","pay","peace","peach","peak","pear","pearl","pedal","peel","peer","peking","pelvic","pelvis","pen","penal","pence","pencil","penny","people","pepper","per","perch","peril","period","perish","permit","person","peru","pest","pet","peter","petite","petrol","petty","phase","philip","phone","photo","phrase","piano","pick","picket","picnic","pie","piece","pier","pierce","piety","pig","pigeon","piggy","pike","pile","pill","pillar","pillow","pilot","pin","pinch","pine","pink","pint","pious","pipe","pirate","piss","pistol","piston","pit","pitch","pity","pivot","pixel","pizza","place","placid","plague","plain","plan","plane","planet","plank","plant","plasma","plate","play","player","plea","plead","please","pledge","plenty","plight","plot","plough","ploy","plug","plum","plump","plunge","plural","plus","plush","pocket","poem","poet","poetic","poetry","point","poison","poland","polar","pole","police","policy","polish","polite","poll","pollen","polo","pond","ponder","pony","pool","poor","poorly","pop","poppy","pore","pork","port","portal","pose","posh","post","postal","pot","potato","potent","pouch","pound","pour","powder","power","praise","pray","prayer","preach","prefer","prefix","press","pretty","price","pride","priest","primal","prime","prince","print","prior","prism","prison","privy","prize","probe","profit","prompt","prone","proof","propel","proper","prose","proton","proud","prove","proven","proxy","prune","pry","psalm","pseudo","psyche","pub","public","puff","pull","pulp","pulpit","pulsar","pulse","pump","punch","punish","punk","pupil","puppet","puppy","pure","purely","purge","purify","purple","purse","pursue","push","pushy","put","putt","puzzle","quaint","quake","quarry","quart","quartz","quebec","queen","queer","query","quest","queue","quick","quid","quiet","quilt","quirk","quit","quite","quiver","quiz","quota","quote","rabbit","race","racial","racism","rack","racket","radar","radio","radish","radius","raffle","raft","rage","raid","rail","rain","rainy","raise","rake","rally","ramp","random","range","rank","ransom","rape","rapid","rare","rarely","rarity","rash","rat","rate","rather","ratify","ratio","rattle","rave","raven","raw","ray","razor","reach","react","read","reader","ready","real","really","realm","reap","rear","reason","rebel","recall","recent","recess","recipe","reckon","record","recoup","rector","red","redeem","redo","reduce","reed","reef","reek","refer","reform","refuge","refuse","regal","regard","regent","regime","region","regret","reign","reject","relate","relax","relay","relic","relief","relish","rely","remain","remark","remedy","remind","remit","remote","remove","renal","render","rent","rental","repair","repeal","repeat","repent","reply","report","rescue","resent","reside","resign","resin","resist","resort","rest","result","resume","retail","retain","retina","retire","return","reveal","review","revise","revive","revolt","reward","rex","rhine","rhino","rhyme","rhythm","ribbon","rice","rich","rick","rid","ride","rider","ridge","rife","rifle","rift","right","rigid","rile","rim","ring","rinse","riot","ripe","ripen","ripple","rise","risk","risky","rite","ritual","ritz","rival","river","road","roar","roast","rob","robe","robert","robin","robot","robust","rock","rocket","rocky","rod","rode","rodent","rogue","role","roll","roman","rome","roof","room","root","rope","rose","rosy","rot","rotate","rotor","rotten","rouge","rough","round","route","rover","row","royal","rub","rubber","rubble","ruby","rudder","rude","rug","rugby","ruin","rule","ruler","rumble","rump","run","rune","rung","runway","rural","rush","russia","rust","rustic","rusty","sack","sacred","sad","saddle","sadism","sadly","safari","safe","safely","safer","safety","saga","sage","sahara","said","sail","sailor","saint","sake","salad","salary","sale","saline","saliva","salmon","saloon","salt","salty","salute","sam","same","sample","sand","sandy","sane","sash","satin","satire","saturn","sauce","saucer","saudi","sauna","savage","save","saw","say","scale","scalp","scan","scant","scar","scarce","scare","scarf","scary","scene","scenic","scent","school","scold","scope","score","scorn","scotch","scott","scout","scrap","scrape","scream","screen","screw","script","scroll","scrub","scum","sea","seal","seam","seaman","search","season","seat","second","secret","sect","sector","secure","see","seed","seeing","seek","seem","seize","seldom","select","self","sell","seller","semi","senate","send","senile","senior","sense","sensor","sent","sentry","seoul","sequel","serene","serial","series","sermon","serum","serve","server","set","settle","seven","severe","sew","sewage","shabby","shade","shadow","shady","shaft","shaggy","shah","shake","shaky","shall","sham","shame","shape","share","shark","sharp","shawl","she","shear","sheen","sheep","sheer","sheet","shelf","shell","sherry","shield","shift","shine","shiny","ship","shire","shirk","shirt","shiver","shock","shoe","shook","shoot","shop","shore","short","shot","should","shout","show","shower","shrank","shrewd","shrill","shrimp","shrine","shrink","shrub","shrug","shut","shy","shyly","sick","side","siege","sigh","sight","sigma","sign","signal","silent","silk","silken","silky","sill","silly","silo","silver","simple","simply","since","sinful","sing","singer","single","sink","sir","sire","siren","sister","sit","site","sitter","six","sixth","sixty","size","sketch","skill","skin","skinny","skip","skirt","skull","sky","slab","slack","slain","slam","slang","slap","slat","slate","slave","sleek","sleep","sleepy","sleeve","slice","slick","slid","slide","slight","slim","slimy","sling","slip","slit","slogan","slope","sloppy","slot","slow","slowly","slug","slum","slump","smack","small","smart","smash","smear","smell","smelly","smelt","smile","smite","smoke","smoky","smooth","smug","snack","snail","snake","snap","snatch","sneak","snow","snowy","snug","soak","soap","sober","soccer","social","sock","socket","socks","soda","sodden","sodium","sofa","soft","soften","softly","soggy","soil","solar","sold","sole","solely","solemn","solid","solo","solve","some","son","sonar","sonata","song","sonic","sony","soon","sooner","soot","soothe","sordid","sore","sorrow","sorry","sort","soul","sound","soup","sour","source","soviet","sow","space","spade","spain","span","spare","spark","sparse","spasm","spat","spate","speak","spear","speech","speed","speedy","spell","spend","sphere","spice","spicy","spider","spiky","spill","spin","spinal","spine","spiral","spirit","spit","spite","splash","split","spoil","spoke","sponge","spoon","sport","spot","spouse","spray","spread","spree","spring","sprint","spur","squad","square","squash","squat","squid","stab","stable","stack","staff","stage","stain","stair","stairs","stake","stale","stall","stamp","stance","stand","staple","star","starch","stare","stark","start","starve","state","static","statue","status","stay","stead","steady","steak","steal","steam","steel","steep","steer","stem","stench","step","stereo","stern","stew","stick","sticky","stiff","stifle","stigma","still","sting","stint","stir","stitch","stock","stocky","stone","stony","stool","stop","store","storm","stormy","story","stout","stove","stow","strain","strait","strand","strap","strata","straw","stray","streak","stream","street","stress","strict","stride","strife","strike","string","strip","stripe","strive","stroke","stroll","strong","stud","studio","study","stuff","stuffy","stunt","stupid","sturdy","style","submit","subtle","subtly","suburb","such","sudden","sue","suez","suffer","sugar","suit","suite","suitor","sullen","sultan","sum","summer","summit","summon","sun","sunday","sunny","sunset","super","superb","supper","supple","supply","sure","surely","surf","surge","survey","suture","swamp","swan","swap","swarm","sway","swear","sweat","sweaty","sweden","sweep","sweet","swell","swift","swim","swine","swing","swirl","swiss","switch","sword","swore","sydney","symbol","synod","syntax","syria","syrup","system","table","tablet","taboo","tacit","tackle","tact","tactic","tail","tailor","taiwan","take","tale","talent","talk","tall","tally","tame","tampa","tan","tandem","tangle","tank","tap","tape","target","tariff","tarp","tart","tarzan","task","taste","tasty","tattoo","taurus","taut","tavern","tax","taxi","tea","teach","teak","team","tear","tease","tech","teeth","tell","temper","temple","tempo","tempt","ten","tenant","tend","tender","tendon","tennis","tenor","tense","tent","tenth","tenure","teresa","term","terror","terse","test","texas","text","thank","thaw","them","theme","thence","theory","there","these","thesis","they","thick","thief","thigh","thin","thing","think","third","thirst","thirty","this","thomas","thorn","those","though","thread","threat","three","thrill","thrive","throat","throne","throng","throw","thrust","thud","thug","thumb","thus","thyme","tibet","tick","ticket","tidal","tide","tidy","tie","tier","tiger","tight","tile","till","tilt","timber","time","timid","tin","tiny","tip","tire","tissue","title","toad","toast","today","toe","toilet","token","tokyo","told","toll","tom","tomato","tomb","tonal","tone","tongue","tonic","too","took","tool","tooth","top","topaz","topic","torch","torque","torso","tort","toss","total","touch","tough","tour","toward","towel","tower","town","toxic","toxin","toy","trace","track","tract","trade","tragic","trail","train","trait","tram","trance","trap","trauma","travel","tray","tread","treat","treaty","treble","tree","trek","tremor","trench","trend","trendy","trial","tribal","tribe","trick","tricky","tried","trifle","trim","trio","trip","triple","troop","trophy","trot","trough","trout","truce","truck","true","truly","trunk","trust","truth","try","tube","tumble","tuna","tundra","tune","tunic","tunnel","turban","turf","turk","turkey","turn","turtle","tutor","tweed","twelve","twenty","twice","twin","twist","two","tycoon","tying","type","tyrant","ugly","ulcer","ultra","umpire","unable","uncle","under","uneasy","unfair","unify","union","unique","unit","unite","unity","unlike","unrest","unruly","until","update","upheld","uphill","uphold","upon","upper","uproar","upset","upshot","uptake","upturn","upward","urban","urge","urgent","urging","urine","usable","usage","use","useful","user","usual","utmost","utter","vacant","vacuum","vague","vain","valet","valid","valley","value","valve","van","vanish","vanity","vary","vase","vast","vat","vault","vector","veil","vein","velvet","vendor","veneer","venice","venom","vent","venue","venus","verb","verbal","verge","verify","verity","verse","versus","very","vessel","vest","vet","veto","via","viable","vicar","vice","victim","victor","video","vienna","view","vigil","viking","vile","villa","vine","vinyl","viola","violet","violin","viral","virgo","virtue","virus","visa","vision","visit","visual","vital","vivid","vocal","vodka","vogue","voice","void","volley","volume","vote","vowel","voyage","vulgar","wade","wage","waist","wait","waiter","wake","walk","walker","wall","wallet","walnut","wander","want","war","warden","warm","warmth","warn","warp","warsaw","wary","was","wash","wasp","waste","watch","water","watery","wave","wax","way","weak","weaken","wealth","weapon","wear","weary","weave","wedge","wee","weed","week","weekly","weep","weigh","weight","weird","well","were","west","wet","whale","wharf","what","wheat","wheel","when","whence","where","which","whiff","while","whim","whip","whisky","white","who","whole","wholly","whom","whose","why","wicked","wide","widely","widen","wider","widow","width","wife","wig","wild","wildly","will","willow","wily","win","wind","window","windy","wine","wing","wink","winner","winter","wipe","wire","wisdom","wise","wish","wit","witch","with","within","witty","wizard","woke","wolf","wolves","woman","womb","won","wonder","wood","wooden","woods","woody","wool","word","work","worker","world","worm","worry","worse","worst","worth","worthy","would","wound","wrap","wrath","wreath","wreck","wring","wrist","writ","write","writer","wrong","xerox","yacht","yale","yard","yarn","yeah","year","yeard","yeast","yellow","yet","yield","yogurt","yolk","you","young","your","youth","zaire","zeal","zebra","zenith","zero","zeus","zigzag","zinc","zombie","zone"];var Y5=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];var Fne=Oe(Hy(),1);import tUe from"crypto";async function cE(r){return tUe.createHash("sha256").update(r).digest()}async function ND(r,e){let t=r.join(" "),n=`mnemonic${e}`.normalize("NFKD");return Dd(Zn.Sha512,t,n,2048,64)}function RD(r,e){let t=r.map(o=>e.indexOf(o.toLowerCase())),n=nUe(t,e.length,256,33),i=n[n.length-1],a=new Uint8Array(n.length-1);for(let o=0;o<n.length-1;o+=1)a[o]=n[o]^i;return[a,i]}async function Pne(r,e){let t=r.length*11,n=[];n.fill(!1,0,t);for(let[l,u]of r.entries()){let d=e.indexOf(u.toLowerCase());if(d<0)throw new Error(`Word not found in wordlist: ${u}`);for(let h=0;h<11;h+=1)n[l*11+h]=(d&1<<10-h)!==0}let i=t/33,a=t-i,o=new Uint8Array(a/8);for(let l=0;l<o.length;l+=1)for(let u=0;u<8;u+=1)n[l*8+u]&&(o[l]|=1<<7-u);let s=await cE(o),c=iUe(s);for(let l=0;l<i;l+=1)if(n[a+l]!==c[l])throw new Error("Checksum mismatch");return o}function Bne(r){let e=255;for(let t=0;t<r.length-1;t+=1){e^=r[t];for(let n=0;n<8;n+=1)e=e>>>1^(e&1?178:0)}return e^255}function nUe(r,e,t,n){let i=new $e(0);for(let o of r)i=i.times(e),i=i.plus(o);let a=new Uint8Array(n);for(let o=n-1;o>=0;o-=1){let s=i.dividedToIntegerBy(t),c=i.modulo(t);i=s,a[o]=c.toNumber()}return a}function iUe(r){let e=[];e.fill(!1,0,r.length*8);for(let t=0;t<r.length;t+=1)for(let n=0;n<8;n+=1)e[t*8+n]=(r[t]&1<<7-n)!==0;return e}var oUe="ed25519 seed",sUe="Bitcoin seed",R2=2147483648,lE=[44,3030,0,0],Une=[44|R2,3030|R2,0|R2,0],qne=[44|R2,60|R2,0|R2,0,0],ru=class r{constructor({words:e}){this.words=e}static generate(){return r._generate(24)}static generate12(){return r._generate(12)}static async _generate(e){let t;if(e===12)t=16;else if(e===24)t=32;else throw new Error(`unsupported phrase length ${e}, only 12 or 24 are supported`);let n=await C0(t),i=jne(Array.from(n)),a=await Lne(n),s=(i+a).match(/(.{1,11})/g),c=(s??[]).map(l=>Y5[Mne(l)]);return new r({words:c})}static fromWords(e){return new r({words:e})._validate()}toPrivateKey(e=""){return this.toEd25519PrivateKey(e)}async toEd25519PrivateKey(e="",t=lE){let{keyData:n,chainCode:i}=await this._toKeyData(e,oUe);for(let o of t)({keyData:n,chainCode:i}=await M_(n,i,o));let a=Fne.default.sign.keyPair.fromSeed(n);if(U3.privateKeyConstructor==null)throw new Error("PrivateKey not found in cache");return U3.privateKeyConstructor(new $a(a,i))}async toStandardEd25519PrivateKey(e="",t){let n=await r.toSeed(this.words,e),i=await Pn.fromSeedED25519(n);t=t??0;for(let a of[44,3030,0,0,t])i=await i.derive(a);return i}async toEcdsaPrivateKey(e="",t=lE){let{keyData:n,chainCode:i}=await this._toKeyData(e,sUe);for(let a of t)({keyData:n,chainCode:i}=await E2(n,i,a));if(U3.privateKeyConstructor==null)throw new Error("PrivateKey not found in cache");return U3.privateKeyConstructor(new Do(gf(n),i))}async toStandardECDSAsecp256k1PrivateKey(e="",t){let n=await r.toSeed(this.words,e),i=await Pn.fromSeedECDSAsecp256k1(n);t=t??0;for(let a of[P_(44),P_(3030),P_(0),0,t])i=await i.derive(a);return i}static async toSeed(e,t){return await ND(e,t)}async _toKeyData(e,t){let n=await ND(this.words,e),i=await Hc(Zn.Sha512,t,n);return{keyData:i.subarray(0,32),chainCode:i.subarray(32)}}static async fromString(e){return r.fromWords(e.split(/\s|,/))}async _validate(){if(this.words.length===22){let e=this.words.reduce((a,o,s)=>sE.includes(o.toLowerCase())?a:[...a,s],[]);if(e.length>0)throw new Jc(this,q3.UnknownWords,e);let[t,n]=RD(this.words,sE),i=Bne(t);if(n!==i)throw new Jc(this,q3.ChecksumMismatch,[])}else{if(!(this.words.length===12||this.words.length===24))throw new Jc(this,q3.BadLength,[]);let e=this.words.reduce((l,u,d)=>Y5.includes(u)?l:[...l,d],[]);if(e.length>0)throw new Jc(this,q3.UnknownWords,e);let t=this.words.map(l=>Y5.indexOf(l).toString(2).padStart(11,"0")).join(""),n=Math.floor(t.length/33)*32,i=t.slice(0,n),a=t.slice(n),s=i.match(/(.{1,8})/g).map(Mne);if(await Lne(Uint8Array.from(s))!==a)throw new Jc(this,q3.ChecksumMismatch,[])}return this}async toLegacyPrivateKey(){let e;if(this.words.length===22?[e]=RD(this.words,sE):e=await Pne(this.words,Y5),U3.privateKeyFromBytes==null)throw new Error("PrivateKey not found in cache");return U3.privateKeyFromBytes(e)}toString(){return this.words.join(" ")}};function Mne(r){return parseInt(r,2)}function jne(r){return r.map(e=>e.toString(2).padStart(8,"0")).join("")}async function Lne(r){let t=r.length*8/32,n=await cE(r);return jne(Array.from(n)).slice(0,t)}function uE(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;let t=new DataView(r.buffer,r.byteOffset,r.byteLength),n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.byteLength;for(;i--;)if(t.getUint8(i)!==n.getUint8(i))return!1;return!0}var DD=class{constructor(){this._timeDrift=0,this._contractId=null,this._keyList=null,this._thresholdKey=null,this._publicKeyED25519=null,this._publicKeyECDSA=null,this._privateKeyConstructor=null,this._mnemonicFromString=null,this._accountIdConstructor=null,this._delegateContractId=null,this._evmAddress=null,this._ethereumTransactionDataLegacyFromBytes=null,this._ethereumTransactionDataEip1559FromBytes=null,this._ethereumTransactionDataEip2930FromBytes=null,this._transactionReceiptQueryConstructor=null,this._transactionRecordQueryConstructor=null}setTimeDrift(e){this._timeDrift=e}get timeDrift(){if(this._timeDrift==null)throw new Error("Cache.timeDrift was used before it was set");return this._timeDrift}setContractId(e){this._contractId=e}get contractId(){if(this._contractId==null)throw new Error("Cache.contractId was used before it was set");return this._contractId}setKeyList(e){this._keyList=e}get keyList(){if(this._keyList==null)throw new Error("Cache.keyList was used before it was set");return this._keyList}setThresholdKey(e){this._thresholdKey=e}get thresholdKey(){if(this._thresholdKey==null)throw new Error("Cache.thresholdKey was used before it was set");return this._thresholdKey}setPublicKeyED25519(e){this._publicKeyED25519=e}get publicKeyED25519(){if(this._publicKeyED25519==null)throw new Error("Cache.publicKeyED25519 was used before it was set");return this._publicKeyED25519}setPublicKeyECDSA(e){this._publicKeyECDSA=e}get publicKeyECDSA(){if(this._publicKeyECDSA==null)throw new Error("Cache.publicKeyECDSA was used before it was set");return this._publicKeyECDSA}setPrivateKeyConstructor(e){this._privateKeyConstructor=e}get privateKeyConstructor(){if(this._privateKeyConstructor==null)throw new Error("Cache.privateKeyConstructor was used before it was set");return this._privateKeyConstructor}setMnemonicFromString(e){this._mnemonicFromString=e}get mnemonicFromString(){if(this._mnemonicFromString==null)throw new Error("Cache.mnemonicFromString was used before it was set");return this.mnemonicFromString}setAccountIdConstructor(e){this._accountIdConstructor=e}get accountIdConstructor(){if(this._accountIdConstructor==null)throw new Error("Cache.accountIdConstructor was used before it was set");return this._accountIdConstructor}setDelegateContractId(e){this._delegateContractId=e}get delegateContractId(){if(this._delegateContractId==null)throw new Error("Cache.delegateContractId was used before it was set");return this._delegateContractId}setEvmAddress(e){this._evmAddress=e}get evmAddress(){if(this._evmAddress==null)throw new Error("Cache.evmAddress was used before it was set");return this._evmAddress}setEthereumTransactionDataLegacyFromBytes(e){this._ethereumTransactionDataLegacyFromBytes=e}get ethereumTransactionDataLegacyFromBytes(){if(this._ethereumTransactionDataLegacyFromBytes==null)throw new Error("Cache.ethereumTransactionDataLegacyFromBytes was used before it was set");return this._ethereumTransactionDataLegacyFromBytes}setEthereumTransactionDataEip1559FromBytes(e){this._ethereumTransactionDataEip1559FromBytes=e}get ethereumTransactionDataEip1559FromBytes(){if(this._ethereumTransactionDataEip1559FromBytes==null)throw new Error("Cache.ethereumTransactionDataEip1559FromBytes was used before it was set");return this._ethereumTransactionDataEip1559FromBytes}setEthereumTransactionDataEip2930FromBytes(e){this._ethereumTransactionDataEip2930FromBytes=e}get ethereumTransactionDataEip2930FromBytes(){if(this._ethereumTransactionDataEip2930FromBytes==null)throw new Error("Cache.ethereumTransactionDataEip2930FromBytes was used before it was set");return this._ethereumTransactionDataEip2930FromBytes}setTransactionReceiptQueryConstructor(e){this._transactionReceiptQueryConstructor=e}get transactionReceiptQueryConstructor(){if(this._transactionReceiptQueryConstructor==null)throw new Error("Cache.transactionReceiptQueryConstructor was used before it was set");return this._transactionReceiptQueryConstructor}setTransactionRecordQueryConstructor(e){this._transactionRecordQueryConstructor=e}get transactionRecordQueryConstructor(){if(this._transactionRecordQueryConstructor==null)throw new Error("Cache.transactionRecordQueryConstructor was used before it was set");return this._transactionRecordQueryConstructor}setAddressBookQueryConstructor(e){this._addressBookQueryConstructor=e}get addressBookQueryConstructor(){if(this._addressBookQueryConstructor==null)throw new Error("Cache.addressBookQueryConstructor was used before it was set");return this._addressBookQueryConstructor}},cUe=new DD,ar=cUe;var nt=class{_toProtobufKey(){throw new Error("not implemented")}static _fromProtobufKey(e){return e.contractID!=null?ar.contractId(e.contractID):e.delegatableContractId!=null?ar.delegateContractId(e.delegatableContractId):e.ed25519!=null&&e.ed25519.byteLength>0?ar.publicKeyED25519(e.ed25519):e.ECDSASecp256k1!=null&&e.ECDSASecp256k1.byteLength>0?ar.publicKeyECDSA(e.ECDSASecp256k1):e.thresholdKey!=null&&e.thresholdKey.threshold!=null?ar.thresholdKey(e.thresholdKey):e.keyList!=null?ar.keyList(e.keyList):null}};var ei=class r extends nt{constructor(e){super(),this._key=e}static fromBytes(e){return new r(t3.fromBytes(e))}static fromBytesED25519(e){return new r(t3.fromBytesED25519(e))}static fromBytesECDSA(e){return new r(t3.fromBytesECDSA(e))}static fromString(e){return new r(t3.fromString(e))}static fromStringECDSA(e){return new r(t3.fromStringECDSA(e))}static fromStringED25519(e){return new r(t3.fromStringED25519(e))}verify(e,t){return this._key.verify(e,t)}verifyTransaction(e){e._requireFrozen(),e.isFrozen()||e.freeze();for(let t of e._signedTransactions.list)if(t.sigMap!=null&&t.sigMap.sigPair!=null){let n=!1;for(let i of t.sigMap.sigPair){let a=i.pubKeyPrefix;if(uE(a,this.toBytesRaw())){n=!0;let o=t.bodyBytes,s=null;if(i.ed25519!=null?s=i.ed25519:i.ECDSASecp256k1!=null&&(s=i.ECDSASecp256k1),s==null)continue;if(!this.verify(o,s))return!1}}if(!n)return!1}return!0}toBytes(){return this._key.toBytes()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toEthereumAddress(){return this._key.toEthereumAddress()}toEvmAddress(){return this._key.toEthereumAddress()}toString(){return this._key.toString()}toStringDer(){return this._key.toStringDer()}toStringRaw(){return this._key.toStringRaw()}equals(e){return this._key.equals(e._key)}_toProtobufKey(){switch(this._key._type){case"ED25519":return{ed25519:this._key.toBytesRaw()};case"secp256k1":return{ECDSASecp256k1:this._key.toBytesRaw()};default:throw new Error(`unrecognized key type ${this._key._type}`)}}_toProtobufSignature(e){switch(this._key._type){case"ED25519":return{pubKeyPrefix:this._key.toBytesRaw(),ed25519:e};case"secp256k1":return{pubKeyPrefix:this._key.toBytesRaw(),ECDSASecp256k1:e};default:throw new Error(`unrecognized key type ${this._key._type}`)}}toAccountId(e,t){return ar.accountIdConstructor(e,t,this)}};ar.setPublicKeyED25519(r=>ei.fromBytesED25519(r));ar.setPublicKeyECDSA(r=>ei.fromBytesECDSA(r));var _Ue=/^(\d+)(?:\.(\d+)\.([a-fA-F0-9]+))?(?:-([a-z]{5}))?$/;function j3(r,e,t){if(e==null&&t!=null||e!=null&&t==null)throw new Error("invalid entity ID");let[n,i,a]=typeof r=="number"||ia.default.isLong(r)?[t!=null?ia.default.fromValue(r):ia.default.ZERO,e!=null?ia.default.fromValue(e):ia.default.ZERO,t!=null?ia.default.fromValue(t):ia.default.fromValue(r)]:[r.shard!=null?ia.default.fromValue(r.shard):ia.default.ZERO,r.realm!=null?ia.default.fromValue(r.realm):ia.default.ZERO,ia.default.fromValue(r.num)];if(n.isNegative()||i.isNegative()||a.isNegative())throw new Error("negative numbers are not allowed in IDs");return{shard:n,realm:i,num:a}}function au(r,e){let t=r[0].compare(e[0]);return t!=0||(t=r[1].compare(e[1]),t!=0)?t:r[2].compare(e[2])}function J5(r){let e=_Ue.exec(r);if(e==null)throw new Error(`failed to parse entity id: ${r}`);return e[2]==null&&e[3]==null?{shard:"0",realm:"0",numOrHex:e[1],checksum:e[4]}:{shard:e[1],realm:e[2],numOrHex:e[3],checksum:e[4]}}function vf(r){let e=J5(r);if(Number.isNaN(e.shard)||Number.isNaN(e.realm)||Number.isNaN(e.numOrHex))throw new Error("invalid format for entity ID");return{shard:e.shard!=null?ia.default.fromString(e.shard):ia.default.ZERO,realm:e.realm!=null?ia.default.fromString(e.realm):ia.default.ZERO,num:ia.default.fromString(e.numOrHex),checksum:e.checksum}}function r3(r){let e=r.startsWith("0x")?tt(r.slice(2)):tt(r);if(e.length!==20)throw new Error(`Invalid hex encoded solidity address length:
10634
- expected length 40, got length ${r.length}`);let t=ia.default.fromBytesBE([0,0,0,0,...e.slice(0,4)]),n=ia.default.fromBytesBE(Array.from(e.slice(4,12))),i=ia.default.fromBytesBE(Array.from(e.slice(12,20)));return[t,n,i]}function V3(r){let e=new Uint8Array(20),t=uo(e),[n,i,a]=r;return t.setUint32(0,kw(n)),t.setUint32(8,kw(i)),t.setUint32(16,kw(a)),Ke(e)}function nie(r,e){let t="",n=[],i=0,a=0,o=0,s=0,c=0,l=26*26*26,u=26*26*26*26*26,d=97,h=1000003,g=31,m=new Uint8Array(r.length+6);m.set(r,0),m.set([0,0,0,0,0,0],r.length);for(let b=0;b<e.length;b++)n.push(e[b]==="."?10:parseInt(e[b],10));for(let b=0;b<n.length;b++)o=(g*o+n[b])%l,b%2===0?i=(i+n[b])%11:a=(a+n[b])%11;for(let b=0;b<m.length;b++)s=(g*s+m[b])%u;c=(((e.length%5*11+i)*11+a)*l+o+s)%u,c=c*h%u;for(let b=0;b<5;b++)t=String.fromCharCode(d+c%26)+t,c/=26;return t}function H3(r,e,t,n,i){if(i._network._ledgerId==null||n==null)return;let a=nie(i._network._ledgerId._ledgerId,`${r.toString()}.${e.toString()}.${t.toString()}`);if(n!=a)throw new Uy(r,e,t,n,a)}function K3(r,e){if(e==null)throw new Error("client cannot be null");if(e._network._ledgerId==null)throw new Error("cannot calculate checksum with a client that does not contain a recognzied ledger ID");let t=nie(e._network._ledgerId._ledgerId,r);return`${r}-${t}`}var D2=class r{constructor(e){this._mnemonic=e}static async generate(){return new r(await ru._generate(24))}static async generate12(){return new r(await ru._generate(12))}static async fromWords(e){return new r(await ru.fromWords(e))}async toPrivateKey(e=""){return ar.privateKeyConstructor(await this._mnemonic.toPrivateKey(e))}async toEd25519PrivateKey(e="",t){return ar.privateKeyConstructor(await this._mnemonic.toEd25519PrivateKey(e,t))}async toStandardEd25519PrivateKey(e="",t){return ar.privateKeyConstructor(await this._mnemonic.toStandardEd25519PrivateKey(e,t))}async toEcdsaPrivateKey(e="",t){return ar.privateKeyConstructor(await this._mnemonic.toEcdsaPrivateKey(e,t))}async toStandardECDSAsecp256k1PrivateKey(e="",t){return ar.privateKeyConstructor(await this._mnemonic.toStandardECDSAsecp256k1PrivateKey(e,t))}static async fromString(e){return new r(await ru.fromString(e))}async toLegacyPrivateKey(){return ar.privateKeyConstructor(await this._mnemonic.toLegacyPrivateKey())}async toSeed(e){return await ru.toSeed(this._mnemonic.words,e)}toString(){return this._mnemonic.toString()}};var Xc=class r extends nt{constructor(e){super(),this._key=e}static generateED25519(){return new r(Pn.generateED25519())}static generateECDSA(){return new r(Pn.generateECDSA())}static generate(){return r.generateED25519()}static async generateAsync(){return new r(await Pn.generateAsync())}static async generateED25519Async(){return new r(await Pn.generateED25519Async())}static async generateECDSAAsync(){return new r(await Pn.generateECDSAAsync())}static fromBytes(e){return new r(Pn.fromBytes(e))}static fromBytesECDSA(e){return new r(Pn.fromBytesECDSA(e))}static fromBytesED25519(e){return new r(Pn.fromBytesED25519(e))}static fromString(e){return new r(Pn.fromString(e))}static fromStringDer(e){return new r(Pn.fromString(e))}static fromStringECDSA(e){return new r(Pn.fromStringECDSA(e))}static fromStringED25519(e){return new r(Pn.fromStringED25519(e))}static async fromSeedED25519(e){return new r(await Pn.fromSeedED25519(e))}static async fromSeedECDSAsecp256k1(e){return new r(await Pn.fromSeedECDSAsecp256k1(e))}static async fromMnemonic(e,t=""){return e instanceof D2?new r(await Pn.fromMnemonic(e._mnemonic,t)):new r(await Pn.fromMnemonic(e,t))}static async fromKeystore(e,t=""){return new r(await Pn.fromKeystore(e,t))}static async fromPem(e,t=""){return new r(await Pn.fromPem(e,t))}async derive(e){return new r(await this._key.derive(e))}async legacyDerive(e){return new r(await this._key.legacyDerive(e))}get publicKey(){return new ei(this._key.publicKey)}get chainCode(){return this._key._chainCode}sign(e){return this._key.sign(e)}signTransaction(e){let t=e._signedTransactions.get(0),n=t.bodyBytes!=null?this.sign(t.bodyBytes):new Uint8Array;return e.addSignature(this.publicKey,n),n}isDerivable(){return this._key.isDerivable()}toBytes(){return this._key.toBytes()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toString(){return this._key.toStringDer()}toStringDer(){return this._key.toStringDer()}toStringRaw(){return this._key.toStringRaw()}toKeystore(e=""){return this._key.toKeystore(e)}_toProtobufKey(){return this.publicKey._toProtobufKey()}toAccountId(e,t){return this.publicKey.toAccountId(e,t)}get type(){return this._key._type}};ar.setPrivateKeyConstructor(r=>new Xc(r));var Oi=class r extends nt{constructor(e,t){super(),e==null?this._keys=[]:e instanceof nt?this._keys=[e]:this._keys=e,this._threshold=t??null}static of(...e){return new r(e,null)}static from(e,t,n){return t==null?new r(Array.from(e)):new r(Array.from(e,t,n))}get threshold(){return this._threshold}setThreshold(e){return this._threshold=e,this}push(...e){return this._keys.push(...e)}splice(e,t,...n){return new r(this._keys.splice(e,t,...n),this.threshold)}slice(e,t){return new r(this._keys.slice(e,t),this.threshold)}[Symbol.iterator](){return this._keys[Symbol.iterator]()}toArray(){return this._keys.slice()}toString(){return JSON.stringify({threshold:this._threshold,keys:this._keys.toString()})}_toProtobufKey(){let e=this._keys.map(t=>t._toProtobufKey());return this.threshold==null?{keyList:{keys:e}}:{thresholdKey:{threshold:this.threshold,keys:{keys:e}}}}static __fromProtobufKeyList(e){let t=(e.keys!=null?e.keys:[]).map(n=>nt._fromProtobufKey(n));return new r(t)}static __fromProtobufThresoldKey(e){let t=r.__fromProtobufKeyList(e.keys!=null?e.keys:{});return t.setThreshold(e.threshold!=null?e.threshold:0),t}};ar.setKeyList(r=>Oi.__fromProtobufKeyList(r));ar.setThresholdKey(r=>Oi.__fromProtobufThresoldKey(r));function iie(r){return $e.isBigNumber(r)?r:new $e(r.toString())}var Nn=class r{constructor(e,t,n){this._name=e,this._symbol=t,this._tinybar=n,Object.freeze(this)}static fromString(e){switch(e){case r.Hbar._symbol:return r.Hbar;case r.Tinybar._symbol:return r.Tinybar;case r.Microbar._symbol:return r.Microbar;case r.Millibar._symbol:return r.Millibar;case r.Kilobar._symbol:return r.Kilobar;case r.Megabar._symbol:return r.Megabar;case r.Gigabar._symbol:return r.Gigabar;default:throw new Error("Unknown unit.")}}};Nn.Tinybar=new Nn("tinybar","t\u210F",new $e(1));Nn.Microbar=new Nn("microbar","\u03BC\u210F",new $e(100));Nn.Millibar=new Nn("millibar","m\u210F",new $e(1e5));Nn.Hbar=new Nn("hbar","\u210F",new $e("100000000"));Nn.Kilobar=new Nn("kilobar","k\u210F",new $e(1e3).multipliedBy(new $e("100000000")));Nn.Megabar=new Nn("megabar","M\u210F",new $e(1e6).multipliedBy(new $e("100000000")));Nn.Gigabar=new Nn("gigabar","G\u210F",new $e("1000000000").multipliedBy(new $e("100000000")));var MD=Oe(Jt(),1),Ge=class r{constructor(e,t=Nn.Hbar){if(t===Nn.Tinybar)this._valueInTinybar=iie(e);else{let n;MD.default.isLong(e)?n=new $e(e.toString(10)):$e.isBigNumber(e)||typeof e=="string"||typeof e=="number"?n=new $e(e):n=new $e(0),this._valueInTinybar=n.multipliedBy(t._tinybar)}if(!this._valueInTinybar.isInteger())throw new Error("Hbar in tinybars contains decimals")}static from(e,t){return new r(e,t)}static fromTinybars(e){return typeof e=="string"?this.fromString(e,Nn.Tinybar):new r(e,Nn.Tinybar)}static fromString(e,t=Nn.Hbar){if(/^((?:\+|-)?\d+(?:\.\d+)?)(?: (tℏ|μℏ|mℏ|ℏ|kℏ|Mℏ|Gℏ))?$/.test(e)){let[i,a]=e.split(" ");return a!=null&&(t=Nn.fromString(a)),new r(new $e(i),t)}else throw new Error("invalid argument provided")}to(e){return this._valueInTinybar.dividedBy(e._tinybar)}toBigNumber(){return this.to(Nn.Hbar)}toTinybars(){return MD.default.fromValue(this._valueInTinybar.toFixed())}negated(){return r.fromTinybars(this._valueInTinybar.negated())}isNegative(){return this._valueInTinybar.isNegative()}toString(e){return e!=null?`${this._valueInTinybar.dividedBy(e._tinybar).toString()} ${e._symbol}`:this._valueInTinybar.isLessThan(1e4)&&this._valueInTinybar.isGreaterThan(-1e4)?`${this._valueInTinybar.toFixed()} ${Nn.Tinybar._symbol}`:`${this.to(Nn.Hbar).toString()} ${Nn.Hbar._symbol}`}};var ou=class r extends Error{constructor(e,t){super(t),this.name="StatusError",this.status=e.status,this.transactionId=e.transactionId,this.message=t,typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}toJSON(){return{name:this.name,status:this.status.toString(),transactionId:this.transactionId.toString(),message:this.message}}toString(){return JSON.stringify(this.toJSON())}valueOf(){return this.toJSON()}};var el=class extends ou{constructor(e){super(e,`receipt for transaction ${e.transactionId.toString()} contained error status ${e.status.toString()}`),this.transactionReceipt=e.transactionReceipt}};var P=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Ok:return"OK";case r.InvalidTransaction:return"INVALID_TRANSACTION";case r.PayerAccountNotFound:return"PAYER_ACCOUNT_NOT_FOUND";case r.InvalidNodeAccount:return"INVALID_NODE_ACCOUNT";case r.TransactionExpired:return"TRANSACTION_EXPIRED";case r.InvalidTransactionStart:return"INVALID_TRANSACTION_START";case r.InvalidTransactionDuration:return"INVALID_TRANSACTION_DURATION";case r.InvalidSignature:return"INVALID_SIGNATURE";case r.MemoTooLong:return"MEMO_TOO_LONG";case r.InsufficientTxFee:return"INSUFFICIENT_TX_FEE";case r.InsufficientPayerBalance:return"INSUFFICIENT_PAYER_BALANCE";case r.DuplicateTransaction:return"DUPLICATE_TRANSACTION";case r.Busy:return"BUSY";case r.NotSupported:return"NOT_SUPPORTED";case r.InvalidFileId:return"INVALID_FILE_ID";case r.InvalidAccountId:return"INVALID_ACCOUNT_ID";case r.InvalidContractId:return"INVALID_CONTRACT_ID";case r.InvalidTransactionId:return"INVALID_TRANSACTION_ID";case r.ReceiptNotFound:return"RECEIPT_NOT_FOUND";case r.RecordNotFound:return"RECORD_NOT_FOUND";case r.InvalidSolidityId:return"INVALID_SOLIDITY_ID";case r.Unknown:return"UNKNOWN";case r.Success:return"SUCCESS";case r.FailInvalid:return"FAIL_INVALID";case r.FailFee:return"FAIL_FEE";case r.FailBalance:return"FAIL_BALANCE";case r.KeyRequired:return"KEY_REQUIRED";case r.BadEncoding:return"BAD_ENCODING";case r.InsufficientAccountBalance:return"INSUFFICIENT_ACCOUNT_BALANCE";case r.InvalidSolidityAddress:return"INVALID_SOLIDITY_ADDRESS";case r.InsufficientGas:return"INSUFFICIENT_GAS";case r.ContractSizeLimitExceeded:return"CONTRACT_SIZE_LIMIT_EXCEEDED";case r.LocalCallModificationException:return"LOCAL_CALL_MODIFICATION_EXCEPTION";case r.ContractRevertExecuted:return"CONTRACT_REVERT_EXECUTED";case r.ContractExecutionException:return"CONTRACT_EXECUTION_EXCEPTION";case r.InvalidReceivingNodeAccount:return"INVALID_RECEIVING_NODE_ACCOUNT";case r.MissingQueryHeader:return"MISSING_QUERY_HEADER";case r.AccountUpdateFailed:return"ACCOUNT_UPDATE_FAILED";case r.InvalidKeyEncoding:return"INVALID_KEY_ENCODING";case r.NullSolidityAddress:return"NULL_SOLIDITY_ADDRESS";case r.ContractUpdateFailed:return"CONTRACT_UPDATE_FAILED";case r.InvalidQueryHeader:return"INVALID_QUERY_HEADER";case r.InvalidFeeSubmitted:return"INVALID_FEE_SUBMITTED";case r.InvalidPayerSignature:return"INVALID_PAYER_SIGNATURE";case r.KeyNotProvided:return"KEY_NOT_PROVIDED";case r.InvalidExpirationTime:return"INVALID_EXPIRATION_TIME";case r.NoWaclKey:return"NO_WACL_KEY";case r.FileContentEmpty:return"FILE_CONTENT_EMPTY";case r.InvalidAccountAmounts:return"INVALID_ACCOUNT_AMOUNTS";case r.EmptyTransactionBody:return"EMPTY_TRANSACTION_BODY";case r.InvalidTransactionBody:return"INVALID_TRANSACTION_BODY";case r.InvalidSignatureTypeMismatchingKey:return"INVALID_SIGNATURE_TYPE_MISMATCHING_KEY";case r.InvalidSignatureCountMismatchingKey:return"INVALID_SIGNATURE_COUNT_MISMATCHING_KEY";case r.EmptyLiveHashBody:return"EMPTY_LIVE_HASH_BODY";case r.EmptyLiveHash:return"EMPTY_LIVE_HASH";case r.EmptyLiveHashKeys:return"EMPTY_LIVE_HASH_KEYS";case r.InvalidLiveHashSize:return"INVALID_LIVE_HASH_SIZE";case r.EmptyQueryBody:return"EMPTY_QUERY_BODY";case r.EmptyLiveHashQuery:return"EMPTY_LIVE_HASH_QUERY";case r.LiveHashNotFound:return"LIVE_HASH_NOT_FOUND";case r.AccountIdDoesNotExist:return"ACCOUNT_ID_DOES_NOT_EXIST";case r.LiveHashAlreadyExists:return"LIVE_HASH_ALREADY_EXISTS";case r.InvalidFileWacl:return"INVALID_FILE_WACL";case r.SerializationFailed:return"SERIALIZATION_FAILED";case r.TransactionOversize:return"TRANSACTION_OVERSIZE";case r.TransactionTooManyLayers:return"TRANSACTION_TOO_MANY_LAYERS";case r.ContractDeleted:return"CONTRACT_DELETED";case r.PlatformNotActive:return"PLATFORM_NOT_ACTIVE";case r.KeyPrefixMismatch:return"KEY_PREFIX_MISMATCH";case r.PlatformTransactionNotCreated:return"PLATFORM_TRANSACTION_NOT_CREATED";case r.InvalidRenewalPeriod:return"INVALID_RENEWAL_PERIOD";case r.InvalidPayerAccountId:return"INVALID_PAYER_ACCOUNT_ID";case r.AccountDeleted:return"ACCOUNT_DELETED";case r.FileDeleted:return"FILE_DELETED";case r.AccountRepeatedInAccountAmounts:return"ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS";case r.SettingNegativeAccountBalance:return"SETTING_NEGATIVE_ACCOUNT_BALANCE";case r.ObtainerRequired:return"OBTAINER_REQUIRED";case r.ObtainerSameContractId:return"OBTAINER_SAME_CONTRACT_ID";case r.ObtainerDoesNotExist:return"OBTAINER_DOES_NOT_EXIST";case r.ModifyingImmutableContract:return"MODIFYING_IMMUTABLE_CONTRACT";case r.FileSystemException:return"FILE_SYSTEM_EXCEPTION";case r.AutorenewDurationNotInRange:return"AUTORENEW_DURATION_NOT_IN_RANGE";case r.ErrorDecodingBytestring:return"ERROR_DECODING_BYTESTRING";case r.ContractFileEmpty:return"CONTRACT_FILE_EMPTY";case r.ContractBytecodeEmpty:return"CONTRACT_BYTECODE_EMPTY";case r.InvalidInitialBalance:return"INVALID_INITIAL_BALANCE";case r.InvalidReceiveRecordThreshold:return"INVALID_RECEIVE_RECORD_THRESHOLD";case r.InvalidSendRecordThreshold:return"INVALID_SEND_RECORD_THRESHOLD";case r.AccountIsNotGenesisAccount:return"ACCOUNT_IS_NOT_GENESIS_ACCOUNT";case r.PayerAccountUnauthorized:return"PAYER_ACCOUNT_UNAUTHORIZED";case r.InvalidFreezeTransactionBody:return"INVALID_FREEZE_TRANSACTION_BODY";case r.FreezeTransactionBodyNotFound:return"FREEZE_TRANSACTION_BODY_NOT_FOUND";case r.TransferListSizeLimitExceeded:return"TRANSFER_LIST_SIZE_LIMIT_EXCEEDED";case r.ResultSizeLimitExceeded:return"RESULT_SIZE_LIMIT_EXCEEDED";case r.NotSpecialAccount:return"NOT_SPECIAL_ACCOUNT";case r.ContractNegativeGas:return"CONTRACT_NEGATIVE_GAS";case r.ContractNegativeValue:return"CONTRACT_NEGATIVE_VALUE";case r.InvalidFeeFile:return"INVALID_FEE_FILE";case r.InvalidExchangeRateFile:return"INVALID_EXCHANGE_RATE_FILE";case r.InsufficientLocalCallGas:return"INSUFFICIENT_LOCAL_CALL_GAS";case r.EntityNotAllowedToDelete:return"ENTITY_NOT_ALLOWED_TO_DELETE";case r.AuthorizationFailed:return"AUTHORIZATION_FAILED";case r.FileUploadedProtoInvalid:return"FILE_UPLOADED_PROTO_INVALID";case r.FileUploadedProtoNotSavedToDisk:return"FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK";case r.FeeScheduleFilePartUploaded:return"FEE_SCHEDULE_FILE_PART_UPLOADED";case r.ExchangeRateChangeLimitExceeded:return"EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED";case r.MaxContractStorageExceeded:return"MAX_CONTRACT_STORAGE_EXCEEDED";case r.TransferAccountSameAsDeleteAccount:return"TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT";case r.TotalLedgerBalanceInvalid:return"TOTAL_LEDGER_BALANCE_INVALID";case r.ExpirationReductionNotAllowed:return"EXPIRATION_REDUCTION_NOT_ALLOWED";case r.MaxGasLimitExceeded:return"MAX_GAS_LIMIT_EXCEEDED";case r.MaxFileSizeExceeded:return"MAX_FILE_SIZE_EXCEEDED";case r.ReceiverSigRequired:return"RECEIVER_SIG_REQUIRED";case r.InvalidTopicId:return"INVALID_TOPIC_ID";case r.InvalidAdminKey:return"INVALID_ADMIN_KEY";case r.InvalidSubmitKey:return"INVALID_SUBMIT_KEY";case r.Unauthorized:return"UNAUTHORIZED";case r.InvalidTopicMessage:return"INVALID_TOPIC_MESSAGE";case r.InvalidAutorenewAccount:return"INVALID_AUTORENEW_ACCOUNT";case r.AutorenewAccountNotAllowed:return"AUTORENEW_ACCOUNT_NOT_ALLOWED";case r.TopicExpired:return"TOPIC_EXPIRED";case r.InvalidChunkNumber:return"INVALID_CHUNK_NUMBER";case r.InvalidChunkTransactionId:return"INVALID_CHUNK_TRANSACTION_ID";case r.AccountFrozenForToken:return"ACCOUNT_FROZEN_FOR_TOKEN";case r.TokensPerAccountLimitExceeded:return"TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED";case r.InvalidTokenId:return"INVALID_TOKEN_ID";case r.InvalidTokenDecimals:return"INVALID_TOKEN_DECIMALS";case r.InvalidTokenInitialSupply:return"INVALID_TOKEN_INITIAL_SUPPLY";case r.InvalidTreasuryAccountForToken:return"INVALID_TREASURY_ACCOUNT_FOR_TOKEN";case r.InvalidTokenSymbol:return"INVALID_TOKEN_SYMBOL";case r.TokenHasNoFreezeKey:return"TOKEN_HAS_NO_FREEZE_KEY";case r.TransfersNotZeroSumForToken:return"TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN";case r.MissingTokenSymbol:return"MISSING_TOKEN_SYMBOL";case r.TokenSymbolTooLong:return"TOKEN_SYMBOL_TOO_LONG";case r.AccountKycNotGrantedForToken:return"ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN";case r.TokenHasNoKycKey:return"TOKEN_HAS_NO_KYC_KEY";case r.InsufficientTokenBalance:return"INSUFFICIENT_TOKEN_BALANCE";case r.TokenWasDeleted:return"TOKEN_WAS_DELETED";case r.TokenHasNoSupplyKey:return"TOKEN_HAS_NO_SUPPLY_KEY";case r.TokenHasNoWipeKey:return"TOKEN_HAS_NO_WIPE_KEY";case r.InvalidTokenMintAmount:return"INVALID_TOKEN_MINT_AMOUNT";case r.InvalidTokenBurnAmount:return"INVALID_TOKEN_BURN_AMOUNT";case r.TokenNotAssociatedToAccount:return"TOKEN_NOT_ASSOCIATED_TO_ACCOUNT";case r.CannotWipeTokenTreasuryAccount:return"CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT";case r.InvalidKycKey:return"INVALID_KYC_KEY";case r.InvalidWipeKey:return"INVALID_WIPE_KEY";case r.InvalidFreezeKey:return"INVALID_FREEZE_KEY";case r.InvalidSupplyKey:return"INVALID_SUPPLY_KEY";case r.MissingTokenName:return"MISSING_TOKEN_NAME";case r.TokenNameTooLong:return"TOKEN_NAME_TOO_LONG";case r.InvalidWipingAmount:return"INVALID_WIPING_AMOUNT";case r.TokenIsImmutable:return"TOKEN_IS_IMMUTABLE";case r.TokenAlreadyAssociatedToAccount:return"TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT";case r.TransactionRequiresZeroTokenBalances:return"TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES";case r.AccountIsTreasury:return"ACCOUNT_IS_TREASURY";case r.TokenIdRepeatedInTokenList:return"TOKEN_ID_REPEATED_IN_TOKEN_LIST";case r.TokenTransferListSizeLimitExceeded:return"TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED";case r.EmptyTokenTransferBody:return"EMPTY_TOKEN_TRANSFER_BODY";case r.EmptyTokenTransferAccountAmounts:return"EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS";case r.InvalidScheduleId:return"INVALID_SCHEDULE_ID";case r.ScheduleIsImmutable:return"SCHEDULE_IS_IMMUTABLE";case r.InvalidSchedulePayerId:return"INVALID_SCHEDULE_PAYER_ID";case r.InvalidScheduleAccountId:return"INVALID_SCHEDULE_ACCOUNT_ID";case r.NoNewValidSignatures:return"NO_NEW_VALID_SIGNATURES";case r.UnresolvableRequiredSigners:return"UNRESOLVABLE_REQUIRED_SIGNERS";case r.ScheduledTransactionNotInWhitelist:return"SCHEDULED_TRANSACTION_NOT_IN_WHITELIST";case r.SomeSignaturesWereInvalid:return"SOME_SIGNATURES_WERE_INVALID";case r.TransactionIdFieldNotAllowed:return"TRANSACTION_ID_FIELD_NOT_ALLOWED";case r.IdenticalScheduleAlreadyCreated:return"IDENTICAL_SCHEDULE_ALREADY_CREATED";case r.InvalidZeroByteInString:return"INVALID_ZERO_BYTE_IN_STRING";case r.ScheduleAlreadyDeleted:return"SCHEDULE_ALREADY_DELETED";case r.ScheduleAlreadyExecuted:return"SCHEDULE_ALREADY_EXECUTED";case r.MessageSizeTooLarge:return"MESSAGE_SIZE_TOO_LARGE";case r.OperationRepeatedInBucketGroups:return"OPERATION_REPEATED_IN_BUCKET_GROUPS";case r.BucketCapacityOverflow:return"BUCKET_CAPACITY_OVERFLOW";case r.NodeCapacityNotSufficientForOperation:return"NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION";case r.BucketHasNoThrottleGroups:return"BUCKET_HAS_NO_THROTTLE_GROUPS";case r.ThrottleGroupHasZeroOpsPerSec:return"THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC";case r.SuccessButMissingExpectedOperation:return"SUCCESS_BUT_MISSING_EXPECTED_OPERATION";case r.UnparseableThrottleDefinitions:return"UNPARSEABLE_THROTTLE_DEFINITIONS";case r.InvalidThrottleDefinitions:return"INVALID_THROTTLE_DEFINITIONS";case r.AccountExpiredAndPendingRemoval:return"ACCOUNT_EXPIRED_AND_PENDING_REMOVAL";case r.InvalidTokenMaxSupply:return"INVALID_TOKEN_MAX_SUPPLY";case r.InvalidTokenNftSerialNumber:return"INVALID_TOKEN_NFT_SERIAL_NUMBER";case r.InvalidNftId:return"INVALID_NFT_ID";case r.MetadataTooLong:return"METADATA_TOO_LONG";case r.BatchSizeLimitExceeded:return"BATCH_SIZE_LIMIT_EXCEEDED";case r.InvalidQueryRange:return"INVALID_QUERY_RANGE";case r.FractionDividesByZero:return"FRACTION_DIVIDES_BY_ZERO";case r.InsufficientPayerBalanceForCustomFee:return"INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE";case r.CustomFeesListTooLong:return"CUSTOM_FEES_LIST_TOO_LONG";case r.InvalidCustomFeeCollector:return"INVALID_CUSTOM_FEE_COLLECTOR";case r.InvalidTokenIdInCustomFees:return"INVALID_TOKEN_ID_IN_CUSTOM_FEES";case r.TokenNotAssociatedToFeeCollector:return"TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR";case r.TokenMaxSupplyReached:return"TOKEN_MAX_SUPPLY_REACHED";case r.SenderDoesNotOwnNftSerialNo:return"SENDER_DOES_NOT_OWN_NFT_SERIAL_NO";case r.CustomFeeNotFullySpecified:return"CUSTOM_FEE_NOT_FULLY_SPECIFIED";case r.CustomFeeMustBePositive:return"CUSTOM_FEE_MUST_BE_POSITIVE";case r.TokenHasNoFeeScheduleKey:return"TOKEN_HAS_NO_FEE_SCHEDULE_KEY";case r.CustomFeeOutsideNumericRange:return"CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE";case r.RoyaltyFractionCannotExceedOne:return"ROYALTY_FRACTION_CANNOT_EXCEED_ONE";case r.FractionalFeeMaxAmountLessThanMinAmount:return"FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT";case r.CustomScheduleAlreadyHasNoFees:return"CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES";case r.CustomFeeDenominationMustBeFungibleCommon:return"CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON";case r.CustomFractionalFeeOnlyAllowedForFungibleCommon:return"CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON";case r.InvalidCustomFeeScheduleKey:return"INVALID_CUSTOM_FEE_SCHEDULE_KEY";case r.InvalidTokenMintMetadata:return"INVALID_TOKEN_MINT_METADATA";case r.InvalidTokenBurnMetadata:return"INVALID_TOKEN_BURN_METADATA";case r.CurrentTreasuryStillOwnsNfts:return"CURRENT_TREASURY_STILL_OWNS_NFTS";case r.AccountStillOwnsNfts:return"ACCOUNT_STILL_OWNS_NFTS";case r.TreasuryMustOwnBurnedNft:return"TREASURY_MUST_OWN_BURNED_NFT";case r.AccountDoesNotOwnWipedNft:return"ACCOUNT_DOES_NOT_OWN_WIPED_NFT";case r.AccountAmountTransfersOnlyAllowedForFungibleCommon:return"ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON";case r.MaxNftsInPriceRegimeHaveBeenMinted:return"MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED";case r.PayerAccountDeleted:return"PAYER_ACCOUNT_DELETED";case r.CustomFeeChargingExceededMaxRecursionDepth:return"CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH";case r.CustomFeeChargingExceededMaxAccountAmounts:return"CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS";case r.InsufficientSenderAccountBalanceForCustomFee:return"INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE";case r.SerialNumberLimitReached:return"SERIAL_NUMBER_LIMIT_REACHED";case r.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique:return"CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE";case r.NoRemainingAutomaticAssociations:return"NO_REMAINING_AUTOMATIC_ASSOCIATIONS";case r.ExistingAutomaticAssociationsExceedGivenLimit:return"EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT";case r.RequestedNumAutomaticAssociationsExceedsAssociationLimit:return"REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT";case r.TokenIsPaused:return"TOKEN_IS_PAUSED";case r.TokenHasNoPauseKey:return"TOKEN_HAS_NO_PAUSE_KEY";case r.InvalidPauseKey:return"INVALID_PAUSE_KEY";case r.FreezeUpdateFileDoesNotExist:return"FREEZE_UPDATE_FILE_DOES_NOT_EXIST";case r.FreezeUpdateFileHashDoesNotMatch:return"FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH";case r.NoUpgradeHasBeenPrepared:return"NO_UPGRADE_HAS_BEEN_PREPARED";case r.NoFreezeIsScheduled:return"NO_FREEZE_IS_SCHEDULED";case r.UpdateFileHashChangedSincePrepareUpgrade:return"UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE";case r.FreezeStartTimeMustBeFuture:return"FREEZE_START_TIME_MUST_BE_FUTURE";case r.PreparedUpdateFileIsImmutable:return"PREPARED_UPDATE_FILE_IS_IMMUTABLE";case r.FreezeAlreadyScheduled:return"FREEZE_ALREADY_SCHEDULED";case r.FreezeUpgradeInProgress:return"FREEZE_UPGRADE_IN_PROGRESS";case r.UpdateFileIdDoesNotMatchPrepared:return"UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED";case r.UpdateFileHashDoesNotMatchPrepared:return"UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED";case r.ConsensusGasExhausted:return"CONSENSUS_GAS_EXHAUSTED";case r.RevertedSuccess:return"REVERTED_SUCCESS";case r.MaxStorageInPriceRegimeHasBeenUsed:return"MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED";case r.InvalidAliasKey:return"INVALID_ALIAS_KEY";case r.UnexpectedTokenDecimals:return"UNEXPECTED_TOKEN_DECIMALS";case r.InvalidProxyAccountId:return"INVALID_PROXY_ACCOUNT_ID";case r.InvalidTransferAccountId:return"INVALID_TRANSFER_ACCOUNT_ID";case r.InvalidFeeCollectorAccountId:return"INVALID_FEE_COLLECTOR_ACCOUNT_ID";case r.AliasIsImmutable:return"ALIAS_IS_IMMUTABLE";case r.SpenderAccountSameAsOwner:return"SPENDER_ACCOUNT_SAME_AS_OWNER";case r.AmountExceedsTokenMaxSupply:return"AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY";case r.NegativeAllowanceAmount:return"NEGATIVE_ALLOWANCE_AMOUNT";case r.CannotApproveForAllFungibleCommon:return"CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON";case r.SpenderDoesNotHaveAllowance:return"SPENDER_DOES_NOT_HAVE_ALLOWANCE";case r.AmountExceedsAllowance:return"AMOUNT_EXCEEDS_ALLOWANCE";case r.MaxAllowancesExceeded:return"MAX_ALLOWANCES_EXCEEDED";case r.EmptyAllowances:return"EMPTY_ALLOWANCES";case r.SpenderAccountRepeatedInAllowances:return"SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES";case r.RepeatedSerialNumsInNftAllowances:return"REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES";case r.FungibleTokenInNftAllowances:return"FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES";case r.NftInFungibleTokenAllowances:return"NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES";case r.InvalidAllowanceOwnerId:return"INVALID_ALLOWANCE_OWNER_ID";case r.InvalidAllowanceSpenderId:return"INVALID_ALLOWANCE_SPENDER_ID";case r.RepeatedAllowancesToDelete:return"REPEATED_ALLOWANCES_TO_DELETE";case r.InvalidDelegatingSpender:return"INVALID_DELEGATING_SPENDER";case r.DelegatingSpenderCannotGrantApproveForAll:return"DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL";case r.DelegatingSpenderDoesNotHaveApproveForAll:return"DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL";case r.ScheduleExpirationTimeTooFarInFuture:return"SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE";case r.ScheduleExpirationTimeMustBeHigherThanConsensusTime:return"SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME";case r.ScheduleFutureThrottleExceeded:return"SCHEDULE_FUTURE_THROTTLE_EXCEEDED";case r.ScheduleFutureGasLimitExceeded:return"SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED";case r.InvalidEthereumTransaction:return"INVALID_ETHEREUM_TRANSACTION";case r.WrongChainId:return"WRONG_CHAIN_ID";case r.WrongNonce:return"WRONG_NONCE";case r.AccessListUnsupported:return"ACCESS_LIST_UNSUPPORTED";case r.SchedulePendingExpiration:return"SCHEDULE_PENDING_EXPIRATION";case r.ContractIsTokenTreasury:return"CONTRACT_IS_TOKEN_TREASURY";case r.ContractHasNonZeroTokenBalances:return"CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES";case r.ContractExpiredAndPendingRemoval:return"CONTRACT_EXPIRED_AND_PENDING_REMOVAL";case r.ContractHasNoAutoRenewAccount:return"CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT";case r.PermanentRemovalRequiresSystemInitiation:return"PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION";case r.ProxyAccountIdFieldIsDeprecated:return"PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED";case r.SelfStakingIsNotAllowed:return"SELF_STAKING_IS_NOT_ALLOWED";case r.InvalidStakingId:return"INVALID_STAKING_ID";case r.StakingNotEnabled:return"STAKING_NOT_ENABLED";case r.InvalidPrngRange:return"INVALID_PRNG_RANGE";case r.MaxEntitiesInPriceRegimeHaveBeenCreated:return"MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED";case r.InvalidFullPrefixSignatureForPrecompile:return"INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE";case r.InsufficientBalancesForStorageRent:return"INSUFFICIENT_BALANCES_FOR_STORAGE_RENT";case r.MaxChildRecordsExceeded:return"MAX_CHILD_RECORDS_EXCEEDED";case r.InsufficientBalancesForRenewalFees:return"INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES";case r.TransactionHasUnknownFields:return"TRANSACTION_HAS_UNKNOWN_FIELDS";case r.AccountIsImmutable:return"ACCOUNT_IS_IMMUTABLE";case r.AliasAlreadyAssigned:return"ALIAS_ALREADY_ASSIGNED";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Ok;case 1:return r.InvalidTransaction;case 2:return r.PayerAccountNotFound;case 3:return r.InvalidNodeAccount;case 4:return r.TransactionExpired;case 5:return r.InvalidTransactionStart;case 6:return r.InvalidTransactionDuration;case 7:return r.InvalidSignature;case 8:return r.MemoTooLong;case 9:return r.InsufficientTxFee;case 10:return r.InsufficientPayerBalance;case 11:return r.DuplicateTransaction;case 12:return r.Busy;case 13:return r.NotSupported;case 14:return r.InvalidFileId;case 15:return r.InvalidAccountId;case 16:return r.InvalidContractId;case 17:return r.InvalidTransactionId;case 18:return r.ReceiptNotFound;case 19:return r.RecordNotFound;case 20:return r.InvalidSolidityId;case 21:return r.Unknown;case 22:return r.Success;case 23:return r.FailInvalid;case 24:return r.FailFee;case 25:return r.FailBalance;case 26:return r.KeyRequired;case 27:return r.BadEncoding;case 28:return r.InsufficientAccountBalance;case 29:return r.InvalidSolidityAddress;case 30:return r.InsufficientGas;case 31:return r.ContractSizeLimitExceeded;case 32:return r.LocalCallModificationException;case 33:return r.ContractRevertExecuted;case 34:return r.ContractExecutionException;case 35:return r.InvalidReceivingNodeAccount;case 36:return r.MissingQueryHeader;case 37:return r.AccountUpdateFailed;case 38:return r.InvalidKeyEncoding;case 39:return r.NullSolidityAddress;case 40:return r.ContractUpdateFailed;case 41:return r.InvalidQueryHeader;case 42:return r.InvalidFeeSubmitted;case 43:return r.InvalidPayerSignature;case 44:return r.KeyNotProvided;case 45:return r.InvalidExpirationTime;case 46:return r.NoWaclKey;case 47:return r.FileContentEmpty;case 48:return r.InvalidAccountAmounts;case 49:return r.EmptyTransactionBody;case 50:return r.InvalidTransactionBody;case 51:return r.InvalidSignatureTypeMismatchingKey;case 52:return r.InvalidSignatureCountMismatchingKey;case 53:return r.EmptyLiveHashBody;case 54:return r.EmptyLiveHash;case 55:return r.EmptyLiveHashKeys;case 56:return r.InvalidLiveHashSize;case 57:return r.EmptyQueryBody;case 58:return r.EmptyLiveHashQuery;case 59:return r.LiveHashNotFound;case 60:return r.AccountIdDoesNotExist;case 61:return r.LiveHashAlreadyExists;case 62:return r.InvalidFileWacl;case 63:return r.SerializationFailed;case 64:return r.TransactionOversize;case 65:return r.TransactionTooManyLayers;case 66:return r.ContractDeleted;case 67:return r.PlatformNotActive;case 68:return r.KeyPrefixMismatch;case 69:return r.PlatformTransactionNotCreated;case 70:return r.InvalidRenewalPeriod;case 71:return r.InvalidPayerAccountId;case 72:return r.AccountDeleted;case 73:return r.FileDeleted;case 74:return r.AccountRepeatedInAccountAmounts;case 75:return r.SettingNegativeAccountBalance;case 76:return r.ObtainerRequired;case 77:return r.ObtainerSameContractId;case 78:return r.ObtainerDoesNotExist;case 79:return r.ModifyingImmutableContract;case 80:return r.FileSystemException;case 81:return r.AutorenewDurationNotInRange;case 82:return r.ErrorDecodingBytestring;case 83:return r.ContractFileEmpty;case 84:return r.ContractBytecodeEmpty;case 85:return r.InvalidInitialBalance;case 86:return r.InvalidReceiveRecordThreshold;case 87:return r.InvalidSendRecordThreshold;case 88:return r.AccountIsNotGenesisAccount;case 89:return r.PayerAccountUnauthorized;case 90:return r.InvalidFreezeTransactionBody;case 91:return r.FreezeTransactionBodyNotFound;case 92:return r.TransferListSizeLimitExceeded;case 93:return r.ResultSizeLimitExceeded;case 94:return r.NotSpecialAccount;case 95:return r.ContractNegativeGas;case 96:return r.ContractNegativeValue;case 97:return r.InvalidFeeFile;case 98:return r.InvalidExchangeRateFile;case 99:return r.InsufficientLocalCallGas;case 100:return r.EntityNotAllowedToDelete;case 101:return r.AuthorizationFailed;case 102:return r.FileUploadedProtoInvalid;case 103:return r.FileUploadedProtoNotSavedToDisk;case 104:return r.FeeScheduleFilePartUploaded;case 105:return r.ExchangeRateChangeLimitExceeded;case 106:return r.MaxContractStorageExceeded;case 107:return r.TransferAccountSameAsDeleteAccount;case 108:return r.TotalLedgerBalanceInvalid;case 110:return r.ExpirationReductionNotAllowed;case 111:return r.MaxGasLimitExceeded;case 112:return r.MaxFileSizeExceeded;case 113:return r.ReceiverSigRequired;case 150:return r.InvalidTopicId;case 155:return r.InvalidAdminKey;case 156:return r.InvalidSubmitKey;case 157:return r.Unauthorized;case 158:return r.InvalidTopicMessage;case 159:return r.InvalidAutorenewAccount;case 160:return r.AutorenewAccountNotAllowed;case 162:return r.TopicExpired;case 163:return r.InvalidChunkNumber;case 164:return r.InvalidChunkTransactionId;case 165:return r.AccountFrozenForToken;case 166:return r.TokensPerAccountLimitExceeded;case 167:return r.InvalidTokenId;case 168:return r.InvalidTokenDecimals;case 169:return r.InvalidTokenInitialSupply;case 170:return r.InvalidTreasuryAccountForToken;case 171:return r.InvalidTokenSymbol;case 172:return r.TokenHasNoFreezeKey;case 173:return r.TransfersNotZeroSumForToken;case 174:return r.MissingTokenSymbol;case 175:return r.TokenSymbolTooLong;case 176:return r.AccountKycNotGrantedForToken;case 177:return r.TokenHasNoKycKey;case 178:return r.InsufficientTokenBalance;case 179:return r.TokenWasDeleted;case 180:return r.TokenHasNoSupplyKey;case 181:return r.TokenHasNoWipeKey;case 182:return r.InvalidTokenMintAmount;case 183:return r.InvalidTokenBurnAmount;case 184:return r.TokenNotAssociatedToAccount;case 185:return r.CannotWipeTokenTreasuryAccount;case 186:return r.InvalidKycKey;case 187:return r.InvalidWipeKey;case 188:return r.InvalidFreezeKey;case 189:return r.InvalidSupplyKey;case 190:return r.MissingTokenName;case 191:return r.TokenNameTooLong;case 192:return r.InvalidWipingAmount;case 193:return r.TokenIsImmutable;case 194:return r.TokenAlreadyAssociatedToAccount;case 195:return r.TransactionRequiresZeroTokenBalances;case 196:return r.AccountIsTreasury;case 197:return r.TokenIdRepeatedInTokenList;case 198:return r.TokenTransferListSizeLimitExceeded;case 199:return r.EmptyTokenTransferBody;case 200:return r.EmptyTokenTransferAccountAmounts;case 201:return r.InvalidScheduleId;case 202:return r.ScheduleIsImmutable;case 203:return r.InvalidSchedulePayerId;case 204:return r.InvalidScheduleAccountId;case 205:return r.NoNewValidSignatures;case 206:return r.UnresolvableRequiredSigners;case 207:return r.ScheduledTransactionNotInWhitelist;case 208:return r.SomeSignaturesWereInvalid;case 209:return r.TransactionIdFieldNotAllowed;case 210:return r.IdenticalScheduleAlreadyCreated;case 211:return r.InvalidZeroByteInString;case 212:return r.ScheduleAlreadyDeleted;case 213:return r.ScheduleAlreadyExecuted;case 214:return r.MessageSizeTooLarge;case 215:return r.OperationRepeatedInBucketGroups;case 216:return r.BucketCapacityOverflow;case 217:return r.NodeCapacityNotSufficientForOperation;case 218:return r.BucketHasNoThrottleGroups;case 219:return r.ThrottleGroupHasZeroOpsPerSec;case 220:return r.SuccessButMissingExpectedOperation;case 221:return r.UnparseableThrottleDefinitions;case 222:return r.InvalidThrottleDefinitions;case 223:return r.AccountExpiredAndPendingRemoval;case 224:return r.InvalidTokenMaxSupply;case 225:return r.InvalidTokenNftSerialNumber;case 226:return r.InvalidNftId;case 227:return r.MetadataTooLong;case 228:return r.BatchSizeLimitExceeded;case 229:return r.InvalidQueryRange;case 230:return r.FractionDividesByZero;case 231:return r.InsufficientPayerBalanceForCustomFee;case 232:return r.CustomFeesListTooLong;case 233:return r.InvalidCustomFeeCollector;case 234:return r.InvalidTokenIdInCustomFees;case 235:return r.TokenNotAssociatedToFeeCollector;case 236:return r.TokenMaxSupplyReached;case 237:return r.SenderDoesNotOwnNftSerialNo;case 238:return r.CustomFeeNotFullySpecified;case 239:return r.CustomFeeMustBePositive;case 240:return r.TokenHasNoFeeScheduleKey;case 241:return r.CustomFeeOutsideNumericRange;case 242:return r.RoyaltyFractionCannotExceedOne;case 243:return r.FractionalFeeMaxAmountLessThanMinAmount;case 244:return r.CustomScheduleAlreadyHasNoFees;case 245:return r.CustomFeeDenominationMustBeFungibleCommon;case 246:return r.CustomFractionalFeeOnlyAllowedForFungibleCommon;case 247:return r.InvalidCustomFeeScheduleKey;case 248:return r.InvalidTokenMintMetadata;case 249:return r.InvalidTokenBurnMetadata;case 250:return r.CurrentTreasuryStillOwnsNfts;case 251:return r.AccountStillOwnsNfts;case 252:return r.TreasuryMustOwnBurnedNft;case 253:return r.AccountDoesNotOwnWipedNft;case 254:return r.AccountAmountTransfersOnlyAllowedForFungibleCommon;case 255:return r.MaxNftsInPriceRegimeHaveBeenMinted;case 256:return r.PayerAccountDeleted;case 257:return r.CustomFeeChargingExceededMaxRecursionDepth;case 258:return r.CustomFeeChargingExceededMaxAccountAmounts;case 259:return r.InsufficientSenderAccountBalanceForCustomFee;case 260:return r.SerialNumberLimitReached;case 261:return r.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique;case 262:return r.NoRemainingAutomaticAssociations;case 263:return r.ExistingAutomaticAssociationsExceedGivenLimit;case 264:return r.RequestedNumAutomaticAssociationsExceedsAssociationLimit;case 265:return r.TokenIsPaused;case 266:return r.TokenHasNoPauseKey;case 267:return r.InvalidPauseKey;case 268:return r.FreezeUpdateFileDoesNotExist;case 269:return r.FreezeUpdateFileHashDoesNotMatch;case 270:return r.NoUpgradeHasBeenPrepared;case 271:return r.NoFreezeIsScheduled;case 272:return r.UpdateFileHashChangedSincePrepareUpgrade;case 273:return r.FreezeStartTimeMustBeFuture;case 274:return r.PreparedUpdateFileIsImmutable;case 275:return r.FreezeAlreadyScheduled;case 276:return r.FreezeUpgradeInProgress;case 277:return r.UpdateFileIdDoesNotMatchPrepared;case 278:return r.UpdateFileHashDoesNotMatchPrepared;case 279:return r.ConsensusGasExhausted;case 280:return r.RevertedSuccess;case 281:return r.MaxStorageInPriceRegimeHasBeenUsed;case 282:return r.InvalidAliasKey;case 283:return r.UnexpectedTokenDecimals;case 284:return r.InvalidProxyAccountId;case 285:return r.InvalidTransferAccountId;case 286:return r.InvalidFeeCollectorAccountId;case 287:return r.AliasIsImmutable;case 288:return r.SpenderAccountSameAsOwner;case 289:return r.AmountExceedsTokenMaxSupply;case 290:return r.NegativeAllowanceAmount;case 291:return r.CannotApproveForAllFungibleCommon;case 292:return r.SpenderDoesNotHaveAllowance;case 293:return r.AmountExceedsAllowance;case 294:return r.MaxAllowancesExceeded;case 295:return r.EmptyAllowances;case 296:return r.SpenderAccountRepeatedInAllowances;case 297:return r.RepeatedSerialNumsInNftAllowances;case 298:return r.FungibleTokenInNftAllowances;case 299:return r.NftInFungibleTokenAllowances;case 300:return r.InvalidAllowanceOwnerId;case 301:return r.InvalidAllowanceSpenderId;case 302:return r.RepeatedAllowancesToDelete;case 303:return r.InvalidDelegatingSpender;case 304:return r.DelegatingSpenderCannotGrantApproveForAll;case 305:return r.DelegatingSpenderDoesNotHaveApproveForAll;case 306:return r.ScheduleExpirationTimeTooFarInFuture;case 307:return r.ScheduleExpirationTimeMustBeHigherThanConsensusTime;case 308:return r.ScheduleFutureThrottleExceeded;case 309:return r.ScheduleFutureGasLimitExceeded;case 310:return r.InvalidEthereumTransaction;case 311:return r.WrongChainId;case 312:return r.WrongNonce;case 313:return r.AccessListUnsupported;case 314:return r.SchedulePendingExpiration;case 315:return r.ContractIsTokenTreasury;case 316:return r.ContractHasNonZeroTokenBalances;case 317:return r.ContractExpiredAndPendingRemoval;case 318:return r.ContractHasNoAutoRenewAccount;case 319:return r.PermanentRemovalRequiresSystemInitiation;case 320:return r.ProxyAccountIdFieldIsDeprecated;case 321:return r.SelfStakingIsNotAllowed;case 322:return r.InvalidStakingId;case 323:return r.StakingNotEnabled;case 324:return r.InvalidPrngRange;case 325:return r.MaxEntitiesInPriceRegimeHaveBeenCreated;case 326:return r.InvalidFullPrefixSignatureForPrecompile;case 327:return r.InsufficientBalancesForStorageRent;case 328:return r.MaxChildRecordsExceeded;case 329:return r.InsufficientBalancesForRenewalFees;case 330:return r.TransactionHasUnknownFields;case 331:return r.AccountIsImmutable;case 332:return r.AliasAlreadyAssigned;default:throw new Error(`(BUG) Status.fromCode() does not handle code: ${e}`)}}valueOf(){return this._code}};P.Ok=new P(0);P.InvalidTransaction=new P(1);P.PayerAccountNotFound=new P(2);P.InvalidNodeAccount=new P(3);P.TransactionExpired=new P(4);P.InvalidTransactionStart=new P(5);P.InvalidTransactionDuration=new P(6);P.InvalidSignature=new P(7);P.MemoTooLong=new P(8);P.InsufficientTxFee=new P(9);P.InsufficientPayerBalance=new P(10);P.DuplicateTransaction=new P(11);P.Busy=new P(12);P.NotSupported=new P(13);P.InvalidFileId=new P(14);P.InvalidAccountId=new P(15);P.InvalidContractId=new P(16);P.InvalidTransactionId=new P(17);P.ReceiptNotFound=new P(18);P.RecordNotFound=new P(19);P.InvalidSolidityId=new P(20);P.Unknown=new P(21);P.Success=new P(22);P.FailInvalid=new P(23);P.FailFee=new P(24);P.FailBalance=new P(25);P.KeyRequired=new P(26);P.BadEncoding=new P(27);P.InsufficientAccountBalance=new P(28);P.InvalidSolidityAddress=new P(29);P.InsufficientGas=new P(30);P.ContractSizeLimitExceeded=new P(31);P.LocalCallModificationException=new P(32);P.ContractRevertExecuted=new P(33);P.ContractExecutionException=new P(34);P.InvalidReceivingNodeAccount=new P(35);P.MissingQueryHeader=new P(36);P.AccountUpdateFailed=new P(37);P.InvalidKeyEncoding=new P(38);P.NullSolidityAddress=new P(39);P.ContractUpdateFailed=new P(40);P.InvalidQueryHeader=new P(41);P.InvalidFeeSubmitted=new P(42);P.InvalidPayerSignature=new P(43);P.KeyNotProvided=new P(44);P.InvalidExpirationTime=new P(45);P.NoWaclKey=new P(46);P.FileContentEmpty=new P(47);P.InvalidAccountAmounts=new P(48);P.EmptyTransactionBody=new P(49);P.InvalidTransactionBody=new P(50);P.InvalidSignatureTypeMismatchingKey=new P(51);P.InvalidSignatureCountMismatchingKey=new P(52);P.EmptyLiveHashBody=new P(53);P.EmptyLiveHash=new P(54);P.EmptyLiveHashKeys=new P(55);P.InvalidLiveHashSize=new P(56);P.EmptyQueryBody=new P(57);P.EmptyLiveHashQuery=new P(58);P.LiveHashNotFound=new P(59);P.AccountIdDoesNotExist=new P(60);P.LiveHashAlreadyExists=new P(61);P.InvalidFileWacl=new P(62);P.SerializationFailed=new P(63);P.TransactionOversize=new P(64);P.TransactionTooManyLayers=new P(65);P.ContractDeleted=new P(66);P.PlatformNotActive=new P(67);P.KeyPrefixMismatch=new P(68);P.PlatformTransactionNotCreated=new P(69);P.InvalidRenewalPeriod=new P(70);P.InvalidPayerAccountId=new P(71);P.AccountDeleted=new P(72);P.FileDeleted=new P(73);P.AccountRepeatedInAccountAmounts=new P(74);P.SettingNegativeAccountBalance=new P(75);P.ObtainerRequired=new P(76);P.ObtainerSameContractId=new P(77);P.ObtainerDoesNotExist=new P(78);P.ModifyingImmutableContract=new P(79);P.FileSystemException=new P(80);P.AutorenewDurationNotInRange=new P(81);P.ErrorDecodingBytestring=new P(82);P.ContractFileEmpty=new P(83);P.ContractBytecodeEmpty=new P(84);P.InvalidInitialBalance=new P(85);P.InvalidReceiveRecordThreshold=new P(86);P.InvalidSendRecordThreshold=new P(87);P.AccountIsNotGenesisAccount=new P(88);P.PayerAccountUnauthorized=new P(89);P.InvalidFreezeTransactionBody=new P(90);P.FreezeTransactionBodyNotFound=new P(91);P.TransferListSizeLimitExceeded=new P(92);P.ResultSizeLimitExceeded=new P(93);P.NotSpecialAccount=new P(94);P.ContractNegativeGas=new P(95);P.ContractNegativeValue=new P(96);P.InvalidFeeFile=new P(97);P.InvalidExchangeRateFile=new P(98);P.InsufficientLocalCallGas=new P(99);P.EntityNotAllowedToDelete=new P(100);P.AuthorizationFailed=new P(101);P.FileUploadedProtoInvalid=new P(102);P.FileUploadedProtoNotSavedToDisk=new P(103);P.FeeScheduleFilePartUploaded=new P(104);P.ExchangeRateChangeLimitExceeded=new P(105);P.MaxContractStorageExceeded=new P(106);P.TransferAccountSameAsDeleteAccount=new P(107);P.TotalLedgerBalanceInvalid=new P(108);P.ExpirationReductionNotAllowed=new P(110);P.MaxGasLimitExceeded=new P(111);P.MaxFileSizeExceeded=new P(112);P.ReceiverSigRequired=new P(113);P.InvalidTopicId=new P(150);P.InvalidAdminKey=new P(155);P.InvalidSubmitKey=new P(156);P.Unauthorized=new P(157);P.InvalidTopicMessage=new P(158);P.InvalidAutorenewAccount=new P(159);P.AutorenewAccountNotAllowed=new P(160);P.TopicExpired=new P(162);P.InvalidChunkNumber=new P(163);P.InvalidChunkTransactionId=new P(164);P.AccountFrozenForToken=new P(165);P.TokensPerAccountLimitExceeded=new P(166);P.InvalidTokenId=new P(167);P.InvalidTokenDecimals=new P(168);P.InvalidTokenInitialSupply=new P(169);P.InvalidTreasuryAccountForToken=new P(170);P.InvalidTokenSymbol=new P(171);P.TokenHasNoFreezeKey=new P(172);P.TransfersNotZeroSumForToken=new P(173);P.MissingTokenSymbol=new P(174);P.TokenSymbolTooLong=new P(175);P.AccountKycNotGrantedForToken=new P(176);P.TokenHasNoKycKey=new P(177);P.InsufficientTokenBalance=new P(178);P.TokenWasDeleted=new P(179);P.TokenHasNoSupplyKey=new P(180);P.TokenHasNoWipeKey=new P(181);P.InvalidTokenMintAmount=new P(182);P.InvalidTokenBurnAmount=new P(183);P.TokenNotAssociatedToAccount=new P(184);P.CannotWipeTokenTreasuryAccount=new P(185);P.InvalidKycKey=new P(186);P.InvalidWipeKey=new P(187);P.InvalidFreezeKey=new P(188);P.InvalidSupplyKey=new P(189);P.MissingTokenName=new P(190);P.TokenNameTooLong=new P(191);P.InvalidWipingAmount=new P(192);P.TokenIsImmutable=new P(193);P.TokenAlreadyAssociatedToAccount=new P(194);P.TransactionRequiresZeroTokenBalances=new P(195);P.AccountIsTreasury=new P(196);P.TokenIdRepeatedInTokenList=new P(197);P.TokenTransferListSizeLimitExceeded=new P(198);P.EmptyTokenTransferBody=new P(199);P.EmptyTokenTransferAccountAmounts=new P(200);P.InvalidScheduleId=new P(201);P.ScheduleIsImmutable=new P(202);P.InvalidSchedulePayerId=new P(203);P.InvalidScheduleAccountId=new P(204);P.NoNewValidSignatures=new P(205);P.UnresolvableRequiredSigners=new P(206);P.ScheduledTransactionNotInWhitelist=new P(207);P.SomeSignaturesWereInvalid=new P(208);P.TransactionIdFieldNotAllowed=new P(209);P.IdenticalScheduleAlreadyCreated=new P(210);P.InvalidZeroByteInString=new P(211);P.ScheduleAlreadyDeleted=new P(212);P.ScheduleAlreadyExecuted=new P(213);P.MessageSizeTooLarge=new P(214);P.OperationRepeatedInBucketGroups=new P(215);P.BucketCapacityOverflow=new P(216);P.NodeCapacityNotSufficientForOperation=new P(217);P.BucketHasNoThrottleGroups=new P(218);P.ThrottleGroupHasZeroOpsPerSec=new P(219);P.SuccessButMissingExpectedOperation=new P(220);P.UnparseableThrottleDefinitions=new P(221);P.InvalidThrottleDefinitions=new P(222);P.AccountExpiredAndPendingRemoval=new P(223);P.InvalidTokenMaxSupply=new P(224);P.InvalidTokenNftSerialNumber=new P(225);P.InvalidNftId=new P(226);P.MetadataTooLong=new P(227);P.BatchSizeLimitExceeded=new P(228);P.InvalidQueryRange=new P(229);P.FractionDividesByZero=new P(230);P.InsufficientPayerBalanceForCustomFee=new P(231);P.CustomFeesListTooLong=new P(232);P.InvalidCustomFeeCollector=new P(233);P.InvalidTokenIdInCustomFees=new P(234);P.TokenNotAssociatedToFeeCollector=new P(235);P.TokenMaxSupplyReached=new P(236);P.SenderDoesNotOwnNftSerialNo=new P(237);P.CustomFeeNotFullySpecified=new P(238);P.CustomFeeMustBePositive=new P(239);P.TokenHasNoFeeScheduleKey=new P(240);P.CustomFeeOutsideNumericRange=new P(241);P.RoyaltyFractionCannotExceedOne=new P(242);P.FractionalFeeMaxAmountLessThanMinAmount=new P(243);P.CustomScheduleAlreadyHasNoFees=new P(244);P.CustomFeeDenominationMustBeFungibleCommon=new P(245);P.CustomFractionalFeeOnlyAllowedForFungibleCommon=new P(246);P.InvalidCustomFeeScheduleKey=new P(247);P.InvalidTokenMintMetadata=new P(248);P.InvalidTokenBurnMetadata=new P(249);P.CurrentTreasuryStillOwnsNfts=new P(250);P.AccountStillOwnsNfts=new P(251);P.TreasuryMustOwnBurnedNft=new P(252);P.AccountDoesNotOwnWipedNft=new P(253);P.AccountAmountTransfersOnlyAllowedForFungibleCommon=new P(254);P.MaxNftsInPriceRegimeHaveBeenMinted=new P(255);P.PayerAccountDeleted=new P(256);P.CustomFeeChargingExceededMaxRecursionDepth=new P(257);P.CustomFeeChargingExceededMaxAccountAmounts=new P(258);P.InsufficientSenderAccountBalanceForCustomFee=new P(259);P.SerialNumberLimitReached=new P(260);P.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique=new P(261);P.NoRemainingAutomaticAssociations=new P(262);P.ExistingAutomaticAssociationsExceedGivenLimit=new P(263);P.RequestedNumAutomaticAssociationsExceedsAssociationLimit=new P(264);P.TokenIsPaused=new P(265);P.TokenHasNoPauseKey=new P(266);P.InvalidPauseKey=new P(267);P.FreezeUpdateFileDoesNotExist=new P(268);P.FreezeUpdateFileHashDoesNotMatch=new P(269);P.NoUpgradeHasBeenPrepared=new P(270);P.NoFreezeIsScheduled=new P(271);P.UpdateFileHashChangedSincePrepareUpgrade=new P(272);P.FreezeStartTimeMustBeFuture=new P(273);P.PreparedUpdateFileIsImmutable=new P(274);P.FreezeAlreadyScheduled=new P(275);P.FreezeUpgradeInProgress=new P(276);P.UpdateFileIdDoesNotMatchPrepared=new P(277);P.UpdateFileHashDoesNotMatchPrepared=new P(278);P.ConsensusGasExhausted=new P(279);P.RevertedSuccess=new P(280);P.MaxStorageInPriceRegimeHasBeenUsed=new P(281);P.InvalidAliasKey=new P(282);P.UnexpectedTokenDecimals=new P(283);P.InvalidProxyAccountId=new P(284);P.InvalidTransferAccountId=new P(285);P.InvalidFeeCollectorAccountId=new P(286);P.AliasIsImmutable=new P(287);P.SpenderAccountSameAsOwner=new P(288);P.AmountExceedsTokenMaxSupply=new P(289);P.NegativeAllowanceAmount=new P(290);P.CannotApproveForAllFungibleCommon=new P(291);P.SpenderDoesNotHaveAllowance=new P(292);P.AmountExceedsAllowance=new P(293);P.MaxAllowancesExceeded=new P(294);P.EmptyAllowances=new P(295);P.SpenderAccountRepeatedInAllowances=new P(296);P.RepeatedSerialNumsInNftAllowances=new P(297);P.FungibleTokenInNftAllowances=new P(298);P.NftInFungibleTokenAllowances=new P(299);P.InvalidAllowanceOwnerId=new P(300);P.InvalidAllowanceSpenderId=new P(301);P.RepeatedAllowancesToDelete=new P(302);P.InvalidDelegatingSpender=new P(303);P.DelegatingSpenderCannotGrantApproveForAll=new P(304);P.DelegatingSpenderDoesNotHaveApproveForAll=new P(305);P.ScheduleExpirationTimeTooFarInFuture=new P(306);P.ScheduleExpirationTimeMustBeHigherThanConsensusTime=new P(307);P.ScheduleFutureThrottleExceeded=new P(308);P.ScheduleFutureGasLimitExceeded=new P(309);P.InvalidEthereumTransaction=new P(310);P.WrongChainId=new P(311);P.WrongNonce=new P(312);P.AccessListUnsupported=new P(313);P.SchedulePendingExpiration=new P(314);P.ContractIsTokenTreasury=new P(315);P.ContractHasNonZeroTokenBalances=new P(316);P.ContractExpiredAndPendingRemoval=new P(317);P.ContractHasNoAutoRenewAccount=new P(318);P.PermanentRemovalRequiresSystemInitiation=new P(319);P.ProxyAccountIdFieldIsDeprecated=new P(320);P.SelfStakingIsNotAllowed=new P(321);P.InvalidStakingId=new P(322);P.StakingNotEnabled=new P(323);P.InvalidPrngRange=new P(324);P.MaxEntitiesInPriceRegimeHaveBeenCreated=new P(325);P.InvalidFullPrefixSignatureForPrecompile=new P(326);P.InsufficientBalancesForStorageRent=new P(327);P.MaxChildRecordsExceeded=new P(328);P.InsufficientBalancesForRenewalFees=new P(329);P.TransactionHasUnknownFields=new P(330);P.AccountIsImmutable=new P(331);P.AliasAlreadyAssigned=new P(332);var Ud=Oe(Jt(),1);var f8=Oe(br(),1);var ns=class r extends nt{constructor(e){super(),this._bytes=e}static fromString(e){return new r(tt(e))}static fromBytes(e){return new r(e)}toBytes(){return this._bytes}toString(){return Ke(this._bytes)}equals(e){return IJ(this._bytes,e._bytes)}};function Z5(r,e){return function(){return r.apply(e,arguments)}}var{toString:EUe}=Object.prototype,{getPrototypeOf:UD}=Object,yE=(r=>e=>{let t=EUe.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),su=r=>(r=r.toLowerCase(),e=>yE(e)===r),vE=r=>e=>typeof e===r,{isArray:P2}=Array,X5=vE("undefined");function xUe(r){return r!==null&&!X5(r)&&r.constructor!==null&&!X5(r.constructor)&&z3(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}var sie=su("ArrayBuffer");function AUe(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&sie(r.buffer),e}var TUe=vE("string"),z3=vE("function"),cie=vE("number"),bE=r=>r!==null&&typeof r=="object",SUe=r=>r===!0||r===!1,gE=r=>{if(yE(r)!=="object")return!1;let e=UD(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},IUe=su("Date"),CUe=su("File"),kUe=su("Blob"),NUe=su("FileList"),RUe=r=>bE(r)&&z3(r.pipe),OUe=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||z3(r.append)&&((e=yE(r))==="formdata"||e==="object"&&z3(r.toString)&&r.toString()==="[object FormData]"))},DUe=su("URLSearchParams"),PUe=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function e8(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),P2(r))for(n=0,i=r.length;n<i;n++)e.call(null,r[n],n,r);else{let a=t?Object.getOwnPropertyNames(r):Object.keys(r),o=a.length,s;for(n=0;n<o;n++)s=a[n],e.call(null,r[s],s,r)}}function lie(r,e){e=e.toLowerCase();let t=Object.keys(r),n=t.length,i;for(;n-- >0;)if(i=t[n],e===i.toLowerCase())return i;return null}var uie=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,die=r=>!X5(r)&&r!==uie;function FD(){let{caseless:r}=die(this)&&this||{},e={},t=(n,i)=>{let a=r&&lie(e,i)||i;gE(e[a])&&gE(n)?e[a]=FD(e[a],n):gE(n)?e[a]=FD({},n):P2(n)?e[a]=n.slice():e[a]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&e8(arguments[n],t);return e}var BUe=(r,e,t,{allOwnKeys:n}={})=>(e8(e,(i,a)=>{t&&z3(i)?r[a]=Z5(i,t):r[a]=i},{allOwnKeys:n}),r),MUe=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),LUe=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},FUe=(r,e,t,n)=>{let i,a,o,s={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),a=i.length;a-- >0;)o=i[a],(!n||n(o,r,e))&&!s[o]&&(e[o]=r[o],s[o]=!0);r=t!==!1&&UD(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},UUe=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;let n=r.indexOf(e,t);return n!==-1&&n===t},qUe=r=>{if(!r)return null;if(P2(r))return r;let e=r.length;if(!cie(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},jUe=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&UD(Uint8Array)),VUe=(r,e)=>{let n=(r&&r[Symbol.iterator]).call(r),i;for(;(i=n.next())&&!i.done;){let a=i.value;e.call(r,a[0],a[1])}},HUe=(r,e)=>{let t,n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},KUe=su("HTMLFormElement"),zUe=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),aie=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),GUe=su("RegExp"),fie=(r,e)=>{let t=Object.getOwnPropertyDescriptors(r),n={};e8(t,(i,a)=>{let o;(o=e(i,a,r))!==!1&&(n[a]=o||i)}),Object.defineProperties(r,n)},WUe=r=>{fie(r,(e,t)=>{if(z3(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let n=r[t];if(z3(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},QUe=(r,e)=>{let t={},n=i=>{i.forEach(a=>{t[a]=!0})};return P2(r)?n(r):n(String(r).split(e)),t},$Ue=()=>{},YUe=(r,e)=>(r=+r,Number.isFinite(r)?r:e),LD="abcdefghijklmnopqrstuvwxyz",oie="0123456789",pie={DIGIT:oie,ALPHA:LD,ALPHA_DIGIT:LD+LD.toUpperCase()+oie},JUe=(r=16,e=pie.ALPHA_DIGIT)=>{let t="",{length:n}=e;for(;r--;)t+=e[Math.random()*n|0];return t};function ZUe(r){return!!(r&&z3(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}var XUe=r=>{let e=new Array(10),t=(n,i)=>{if(bE(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;let a=P2(n)?[]:{};return e8(n,(o,s)=>{let c=t(o,i+1);!X5(c)&&(a[s]=c)}),e[i]=void 0,a}}return n};return t(r,0)},eqe=su("AsyncFunction"),tqe=r=>r&&(bE(r)||z3(r))&&z3(r.then)&&z3(r.catch),be={isArray:P2,isArrayBuffer:sie,isBuffer:xUe,isFormData:OUe,isArrayBufferView:AUe,isString:TUe,isNumber:cie,isBoolean:SUe,isObject:bE,isPlainObject:gE,isUndefined:X5,isDate:IUe,isFile:CUe,isBlob:kUe,isRegExp:GUe,isFunction:z3,isStream:RUe,isURLSearchParams:DUe,isTypedArray:jUe,isFileList:NUe,forEach:e8,merge:FD,extend:BUe,trim:PUe,stripBOM:MUe,inherits:LUe,toFlatObject:FUe,kindOf:yE,kindOfTest:su,endsWith:UUe,toArray:qUe,forEachEntry:VUe,matchAll:HUe,isHTMLForm:KUe,hasOwnProperty:aie,hasOwnProp:aie,reduceDescriptors:fie,freezeMethods:WUe,toObjectSet:QUe,toCamelCase:zUe,noop:$Ue,toFiniteNumber:YUe,findKey:lie,global:uie,isContextDefined:die,ALPHABET:pie,generateString:JUe,isSpecCompliantForm:ZUe,toJSONObject:XUe,isAsyncFn:eqe,isThenable:tqe};function B2(r,e,t,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),i&&(this.response=i)}be.inherits(B2,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:be.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var hie=B2.prototype,mie={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{mie[r]={value:r}});Object.defineProperties(B2,mie);Object.defineProperty(hie,"isAxiosError",{value:!0});B2.from=(r,e,t,n,i,a)=>{let o=Object.create(hie);return be.toFlatObject(r,o,function(c){return c!==Error.prototype},s=>s!=="isAxiosError"),B2.call(o,r.message,e,t,n,i),o.cause=r,o.name=r.name,a&&Object.assign(o,a),o};var _t=B2;var Jie=Oe(Yie(),1),EE=Jie.default;function YD(r){return be.isPlainObject(r)||be.isArray(r)}function Xie(r){return be.endsWith(r,"[]")?r.slice(0,-2):r}function Zie(r,e,t){return r?r.concat(e).map(function(i,a){return i=Xie(i),!t&&a?"["+i+"]":i}).join(t?".":""):e}function Fqe(r){return be.isArray(r)&&!r.some(YD)}var Uqe=be.toFlatObject(be,{},null,function(e){return/^is[A-Z]/.test(e)});function qqe(r,e,t){if(!be.isObject(r))throw new TypeError("target must be an object");e=e||new(EE||FormData),t=be.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,E){return!be.isUndefined(E[b])});let n=t.metaTokens,i=t.visitor||u,a=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&be.isSpecCompliantForm(e);if(!be.isFunction(i))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(be.isDate(m))return m.toISOString();if(!c&&be.isBlob(m))throw new _t("Blob is not supported. Use a Buffer instead.");return be.isArrayBuffer(m)||be.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,b,E){let I=m;if(m&&!E&&typeof m=="object"){if(be.endsWith(b,"{}"))b=n?b:b.slice(0,-2),m=JSON.stringify(m);else if(be.isArray(m)&&Fqe(m)||(be.isFileList(m)||be.endsWith(b,"[]"))&&(I=be.toArray(m)))return b=Xie(b),I.forEach(function(L,U){!(be.isUndefined(L)||L===null)&&e.append(o===!0?Zie([b],U,a):o===null?b:b+"[]",l(L))}),!1}return YD(m)?!0:(e.append(Zie(E,b,a),l(m)),!1)}let d=[],h=Object.assign(Uqe,{defaultVisitor:u,convertValue:l,isVisitable:YD});function g(m,b){if(!be.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(m),be.forEach(m,function(I,R){(!(be.isUndefined(I)||I===null)&&i.call(e,I,be.isString(R)?R.trim():R,b,h))===!0&&g(I,b?b.concat(R):[R])}),d.pop()}}if(!be.isObject(r))throw new TypeError("data must be an object");return g(r),e}var bf=qqe;function eae(r){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function tae(r,e){this._pairs=[],r&&bf(r,this,e)}var rae=tae.prototype;rae.append=function(e,t){this._pairs.push([e,t])};rae.toString=function(e){let t=e?function(n){return e.call(this,n,eae)}:eae;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};var nae=tae;function jqe(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function q0(r,e,t){if(!e)return r;let n=t&&t.encode||jqe,i=t&&t.serialize,a;if(i?a=i(e,t):a=be.isURLSearchParams(e)?e.toString():new nae(e,t).toString(n),a){let o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r}var JD=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){be.forEach(this.handlers,function(n){n!==null&&e(n)})}},ZD=JD;var M2={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};import Vqe from"url";var iae=Vqe.URLSearchParams;var aae={isNode:!0,classes:{URLSearchParams:iae,FormData:EE,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var XD={};Aw(XD,{hasBrowserEnv:()=>oae,hasStandardBrowserEnv:()=>Hqe,hasStandardBrowserWebWorkerEnv:()=>Kqe});var oae=typeof window<"u"&&typeof document<"u",Hqe=(r=>oae&&["ReactNative","NativeScript","NS"].indexOf(r)<0)(typeof navigator<"u"&&navigator.product),Kqe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var ka={...XD,...aae};function eP(r,e){return bf(r,new ka.classes.URLSearchParams,Object.assign({visitor:function(t,n,i,a){return ka.isNode&&be.isBuffer(t)?(this.append(n,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function zqe(r){return be.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Gqe(r){let e={},t=Object.keys(r),n,i=t.length,a;for(n=0;n<i;n++)a=t[n],e[a]=r[a];return e}function Wqe(r){function e(t,n,i,a){let o=t[a++];if(o==="__proto__")return!0;let s=Number.isFinite(+o),c=a>=t.length;return o=!o&&be.isArray(i)?i.length:o,c?(be.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s):((!i[o]||!be.isObject(i[o]))&&(i[o]=[]),e(t,n,i[o],a)&&be.isArray(i[o])&&(i[o]=Gqe(i[o])),!s)}if(be.isFormData(r)&&be.isFunction(r.entries)){let t={};return be.forEachEntry(r,(n,i)=>{e(zqe(n),i,t,0)}),t}return null}var xE=Wqe;function Qqe(r,e,t){if(be.isString(r))try{return(e||JSON.parse)(r),be.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}var tP={transitional:M2,adapter:["xhr","http"],transformRequest:[function(e,t){let n=t.getContentType()||"",i=n.indexOf("application/json")>-1,a=be.isObject(e);if(a&&be.isHTMLForm(e)&&(e=new FormData(e)),be.isFormData(e))return i&&i?JSON.stringify(xE(e)):e;if(be.isArrayBuffer(e)||be.isBuffer(e)||be.isStream(e)||be.isFile(e)||be.isBlob(e))return e;if(be.isArrayBufferView(e))return e.buffer;if(be.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return eP(e,this.formSerializer).toString();if((s=be.isFileList(e))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return bf(s?{"files[]":e}:e,c&&new c,this.formSerializer)}}return a||i?(t.setContentType("application/json",!1),Qqe(e)):e}],transformResponse:[function(e){let t=this.transitional||tP.transitional,n=t&&t.forcedJSONParsing,i=this.responseType==="json";if(e&&be.isString(e)&&(n&&!this.responseType||i)){let o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?_t.from(s,_t.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ka.classes.FormData,Blob:ka.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};be.forEach(["delete","get","head","post","put","patch"],r=>{tP.headers[r]={}});var L2=tP;var $qe=be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),sae=r=>{let e={},t,n,i;return r&&r.split(`
10634
+ expected length 40, got length ${r.length}`);let t=ia.default.fromBytesBE([0,0,0,0,...e.slice(0,4)]),n=ia.default.fromBytesBE(Array.from(e.slice(4,12))),i=ia.default.fromBytesBE(Array.from(e.slice(12,20)));return[t,n,i]}function V3(r){let e=new Uint8Array(20),t=uo(e),[n,i,a]=r;return t.setUint32(0,kw(n)),t.setUint32(8,kw(i)),t.setUint32(16,kw(a)),Ke(e)}function nie(r,e){let t="",n=[],i=0,a=0,o=0,s=0,c=0,l=26*26*26,u=26*26*26*26*26,d=97,h=1000003,g=31,m=new Uint8Array(r.length+6);m.set(r,0),m.set([0,0,0,0,0,0],r.length);for(let b=0;b<e.length;b++)n.push(e[b]==="."?10:parseInt(e[b],10));for(let b=0;b<n.length;b++)o=(g*o+n[b])%l,b%2===0?i=(i+n[b])%11:a=(a+n[b])%11;for(let b=0;b<m.length;b++)s=(g*s+m[b])%u;c=(((e.length%5*11+i)*11+a)*l+o+s)%u,c=c*h%u;for(let b=0;b<5;b++)t=String.fromCharCode(d+c%26)+t,c/=26;return t}function H3(r,e,t,n,i){if(i._network._ledgerId==null||n==null)return;let a=nie(i._network._ledgerId._ledgerId,`${r.toString()}.${e.toString()}.${t.toString()}`);if(n!=a)throw new Uy(r,e,t,n,a)}function K3(r,e){if(e==null)throw new Error("client cannot be null");if(e._network._ledgerId==null)throw new Error("cannot calculate checksum with a client that does not contain a recognzied ledger ID");let t=nie(e._network._ledgerId._ledgerId,r);return`${r}-${t}`}var D2=class r{constructor(e){this._mnemonic=e}static async generate(){return new r(await ru._generate(24))}static async generate12(){return new r(await ru._generate(12))}static async fromWords(e){return new r(await ru.fromWords(e))}async toPrivateKey(e=""){return ar.privateKeyConstructor(await this._mnemonic.toPrivateKey(e))}async toEd25519PrivateKey(e="",t){return ar.privateKeyConstructor(await this._mnemonic.toEd25519PrivateKey(e,t))}async toStandardEd25519PrivateKey(e="",t){return ar.privateKeyConstructor(await this._mnemonic.toStandardEd25519PrivateKey(e,t))}async toEcdsaPrivateKey(e="",t){return ar.privateKeyConstructor(await this._mnemonic.toEcdsaPrivateKey(e,t))}async toStandardECDSAsecp256k1PrivateKey(e="",t){return ar.privateKeyConstructor(await this._mnemonic.toStandardECDSAsecp256k1PrivateKey(e,t))}static async fromString(e){return new r(await ru.fromString(e))}async toLegacyPrivateKey(){return ar.privateKeyConstructor(await this._mnemonic.toLegacyPrivateKey())}async toSeed(e){return await ru.toSeed(this._mnemonic.words,e)}toString(){return this._mnemonic.toString()}};var Xc=class r extends nt{constructor(e){super(),this._key=e}static generateED25519(){return new r(Pn.generateED25519())}static generateECDSA(){return new r(Pn.generateECDSA())}static generate(){return r.generateED25519()}static async generateAsync(){return new r(await Pn.generateAsync())}static async generateED25519Async(){return new r(await Pn.generateED25519Async())}static async generateECDSAAsync(){return new r(await Pn.generateECDSAAsync())}static fromBytes(e){return new r(Pn.fromBytes(e))}static fromBytesECDSA(e){return new r(Pn.fromBytesECDSA(e))}static fromBytesED25519(e){return new r(Pn.fromBytesED25519(e))}static fromString(e){return new r(Pn.fromString(e))}static fromStringDer(e){return new r(Pn.fromString(e))}static fromStringECDSA(e){return new r(Pn.fromStringECDSA(e))}static fromStringED25519(e){return new r(Pn.fromStringED25519(e))}static async fromSeedED25519(e){return new r(await Pn.fromSeedED25519(e))}static async fromSeedECDSAsecp256k1(e){return new r(await Pn.fromSeedECDSAsecp256k1(e))}static async fromMnemonic(e,t=""){return e instanceof D2?new r(await Pn.fromMnemonic(e._mnemonic,t)):new r(await Pn.fromMnemonic(e,t))}static async fromKeystore(e,t=""){return new r(await Pn.fromKeystore(e,t))}static async fromPem(e,t=""){return new r(await Pn.fromPem(e,t))}async derive(e){return new r(await this._key.derive(e))}async legacyDerive(e){return new r(await this._key.legacyDerive(e))}get publicKey(){return new ei(this._key.publicKey)}get chainCode(){return this._key._chainCode}sign(e){return this._key.sign(e)}signTransaction(e){let t=e._signedTransactions.get(0),n=t.bodyBytes!=null?this.sign(t.bodyBytes):new Uint8Array;return e.addSignature(this.publicKey,n),n}isDerivable(){return this._key.isDerivable()}toBytes(){return this._key.toBytes()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toString(){return this._key.toStringDer()}toStringDer(){return this._key.toStringDer()}toStringRaw(){return this._key.toStringRaw()}toKeystore(e=""){return this._key.toKeystore(e)}_toProtobufKey(){return this.publicKey._toProtobufKey()}toAccountId(e,t){return this.publicKey.toAccountId(e,t)}get type(){return this._key._type}};ar.setPrivateKeyConstructor(r=>new Xc(r));var Oi=class r extends nt{constructor(e,t){super(),e==null?this._keys=[]:e instanceof nt?this._keys=[e]:this._keys=e,this._threshold=t??null}static of(...e){return new r(e,null)}static from(e,t,n){return t==null?new r(Array.from(e)):new r(Array.from(e,t,n))}get threshold(){return this._threshold}setThreshold(e){return this._threshold=e,this}push(...e){return this._keys.push(...e)}splice(e,t,...n){return new r(this._keys.splice(e,t,...n),this.threshold)}slice(e,t){return new r(this._keys.slice(e,t),this.threshold)}[Symbol.iterator](){return this._keys[Symbol.iterator]()}toArray(){return this._keys.slice()}toString(){return JSON.stringify({threshold:this._threshold,keys:this._keys.toString()})}_toProtobufKey(){let e=this._keys.map(t=>t._toProtobufKey());return this.threshold==null?{keyList:{keys:e}}:{thresholdKey:{threshold:this.threshold,keys:{keys:e}}}}static __fromProtobufKeyList(e){let t=(e.keys!=null?e.keys:[]).map(n=>nt._fromProtobufKey(n));return new r(t)}static __fromProtobufThresoldKey(e){let t=r.__fromProtobufKeyList(e.keys!=null?e.keys:{});return t.setThreshold(e.threshold!=null?e.threshold:0),t}};ar.setKeyList(r=>Oi.__fromProtobufKeyList(r));ar.setThresholdKey(r=>Oi.__fromProtobufThresoldKey(r));function iie(r){return $e.isBigNumber(r)?r:new $e(r.toString())}var Nn=class r{constructor(e,t,n){this._name=e,this._symbol=t,this._tinybar=n,Object.freeze(this)}static fromString(e){switch(e){case r.Hbar._symbol:return r.Hbar;case r.Tinybar._symbol:return r.Tinybar;case r.Microbar._symbol:return r.Microbar;case r.Millibar._symbol:return r.Millibar;case r.Kilobar._symbol:return r.Kilobar;case r.Megabar._symbol:return r.Megabar;case r.Gigabar._symbol:return r.Gigabar;default:throw new Error("Unknown unit.")}}};Nn.Tinybar=new Nn("tinybar","t\u210F",new $e(1));Nn.Microbar=new Nn("microbar","\u03BC\u210F",new $e(100));Nn.Millibar=new Nn("millibar","m\u210F",new $e(1e5));Nn.Hbar=new Nn("hbar","\u210F",new $e("100000000"));Nn.Kilobar=new Nn("kilobar","k\u210F",new $e(1e3).multipliedBy(new $e("100000000")));Nn.Megabar=new Nn("megabar","M\u210F",new $e(1e6).multipliedBy(new $e("100000000")));Nn.Gigabar=new Nn("gigabar","G\u210F",new $e("1000000000").multipliedBy(new $e("100000000")));var MD=Oe(Jt(),1),Ge=class r{constructor(e,t=Nn.Hbar){if(t===Nn.Tinybar)this._valueInTinybar=iie(e);else{let n;MD.default.isLong(e)?n=new $e(e.toString(10)):$e.isBigNumber(e)||typeof e=="string"||typeof e=="number"?n=new $e(e):n=new $e(0),this._valueInTinybar=n.multipliedBy(t._tinybar)}if(!this._valueInTinybar.isInteger())throw new Error("Hbar in tinybars contains decimals")}static from(e,t){return new r(e,t)}static fromTinybars(e){return typeof e=="string"?this.fromString(e,Nn.Tinybar):new r(e,Nn.Tinybar)}static fromString(e,t=Nn.Hbar){if(/^((?:\+|-)?\d+(?:\.\d+)?)(?: (tℏ|μℏ|mℏ|ℏ|kℏ|Mℏ|Gℏ))?$/.test(e)){let[i,a]=e.split(" ");return a!=null&&(t=Nn.fromString(a)),new r(new $e(i),t)}else throw new Error("invalid argument provided")}to(e){return this._valueInTinybar.dividedBy(e._tinybar)}toBigNumber(){return this.to(Nn.Hbar)}toTinybars(){return MD.default.fromValue(this._valueInTinybar.toFixed())}negated(){return r.fromTinybars(this._valueInTinybar.negated())}isNegative(){return this._valueInTinybar.isNegative()}toString(e){return e!=null?`${this._valueInTinybar.dividedBy(e._tinybar).toString()} ${e._symbol}`:this._valueInTinybar.isLessThan(1e4)&&this._valueInTinybar.isGreaterThan(-1e4)?`${this._valueInTinybar.toFixed()} ${Nn.Tinybar._symbol}`:`${this.to(Nn.Hbar).toString()} ${Nn.Hbar._symbol}`}};var ou=class r extends Error{constructor(e,t){super(t),this.name="StatusError",this.status=e.status,this.transactionId=e.transactionId,this.message=t,typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}toJSON(){return{name:this.name,status:this.status.toString(),transactionId:this.transactionId.toString(),message:this.message}}toString(){return JSON.stringify(this.toJSON())}valueOf(){return this.toJSON()}};var el=class extends ou{constructor(e){super(e,`receipt for transaction ${e.transactionId.toString()} contained error status ${e.status.toString()}`),this.transactionReceipt=e.transactionReceipt}};var P=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Ok:return"OK";case r.InvalidTransaction:return"INVALID_TRANSACTION";case r.PayerAccountNotFound:return"PAYER_ACCOUNT_NOT_FOUND";case r.InvalidNodeAccount:return"INVALID_NODE_ACCOUNT";case r.TransactionExpired:return"TRANSACTION_EXPIRED";case r.InvalidTransactionStart:return"INVALID_TRANSACTION_START";case r.InvalidTransactionDuration:return"INVALID_TRANSACTION_DURATION";case r.InvalidSignature:return"INVALID_SIGNATURE";case r.MemoTooLong:return"MEMO_TOO_LONG";case r.InsufficientTxFee:return"INSUFFICIENT_TX_FEE";case r.InsufficientPayerBalance:return"INSUFFICIENT_PAYER_BALANCE";case r.DuplicateTransaction:return"DUPLICATE_TRANSACTION";case r.Busy:return"BUSY";case r.NotSupported:return"NOT_SUPPORTED";case r.InvalidFileId:return"INVALID_FILE_ID";case r.InvalidAccountId:return"INVALID_ACCOUNT_ID";case r.InvalidContractId:return"INVALID_CONTRACT_ID";case r.InvalidTransactionId:return"INVALID_TRANSACTION_ID";case r.ReceiptNotFound:return"RECEIPT_NOT_FOUND";case r.RecordNotFound:return"RECORD_NOT_FOUND";case r.InvalidSolidityId:return"INVALID_SOLIDITY_ID";case r.Unknown:return"UNKNOWN";case r.Success:return"SUCCESS";case r.FailInvalid:return"FAIL_INVALID";case r.FailFee:return"FAIL_FEE";case r.FailBalance:return"FAIL_BALANCE";case r.KeyRequired:return"KEY_REQUIRED";case r.BadEncoding:return"BAD_ENCODING";case r.InsufficientAccountBalance:return"INSUFFICIENT_ACCOUNT_BALANCE";case r.InvalidSolidityAddress:return"INVALID_SOLIDITY_ADDRESS";case r.InsufficientGas:return"INSUFFICIENT_GAS";case r.ContractSizeLimitExceeded:return"CONTRACT_SIZE_LIMIT_EXCEEDED";case r.LocalCallModificationException:return"LOCAL_CALL_MODIFICATION_EXCEPTION";case r.ContractRevertExecuted:return"CONTRACT_REVERT_EXECUTED";case r.ContractExecutionException:return"CONTRACT_EXECUTION_EXCEPTION";case r.InvalidReceivingNodeAccount:return"INVALID_RECEIVING_NODE_ACCOUNT";case r.MissingQueryHeader:return"MISSING_QUERY_HEADER";case r.AccountUpdateFailed:return"ACCOUNT_UPDATE_FAILED";case r.InvalidKeyEncoding:return"INVALID_KEY_ENCODING";case r.NullSolidityAddress:return"NULL_SOLIDITY_ADDRESS";case r.ContractUpdateFailed:return"CONTRACT_UPDATE_FAILED";case r.InvalidQueryHeader:return"INVALID_QUERY_HEADER";case r.InvalidFeeSubmitted:return"INVALID_FEE_SUBMITTED";case r.InvalidPayerSignature:return"INVALID_PAYER_SIGNATURE";case r.KeyNotProvided:return"KEY_NOT_PROVIDED";case r.InvalidExpirationTime:return"INVALID_EXPIRATION_TIME";case r.NoWaclKey:return"NO_WACL_KEY";case r.FileContentEmpty:return"FILE_CONTENT_EMPTY";case r.InvalidAccountAmounts:return"INVALID_ACCOUNT_AMOUNTS";case r.EmptyTransactionBody:return"EMPTY_TRANSACTION_BODY";case r.InvalidTransactionBody:return"INVALID_TRANSACTION_BODY";case r.InvalidSignatureTypeMismatchingKey:return"INVALID_SIGNATURE_TYPE_MISMATCHING_KEY";case r.InvalidSignatureCountMismatchingKey:return"INVALID_SIGNATURE_COUNT_MISMATCHING_KEY";case r.EmptyLiveHashBody:return"EMPTY_LIVE_HASH_BODY";case r.EmptyLiveHash:return"EMPTY_LIVE_HASH";case r.EmptyLiveHashKeys:return"EMPTY_LIVE_HASH_KEYS";case r.InvalidLiveHashSize:return"INVALID_LIVE_HASH_SIZE";case r.EmptyQueryBody:return"EMPTY_QUERY_BODY";case r.EmptyLiveHashQuery:return"EMPTY_LIVE_HASH_QUERY";case r.LiveHashNotFound:return"LIVE_HASH_NOT_FOUND";case r.AccountIdDoesNotExist:return"ACCOUNT_ID_DOES_NOT_EXIST";case r.LiveHashAlreadyExists:return"LIVE_HASH_ALREADY_EXISTS";case r.InvalidFileWacl:return"INVALID_FILE_WACL";case r.SerializationFailed:return"SERIALIZATION_FAILED";case r.TransactionOversize:return"TRANSACTION_OVERSIZE";case r.TransactionTooManyLayers:return"TRANSACTION_TOO_MANY_LAYERS";case r.ContractDeleted:return"CONTRACT_DELETED";case r.PlatformNotActive:return"PLATFORM_NOT_ACTIVE";case r.KeyPrefixMismatch:return"KEY_PREFIX_MISMATCH";case r.PlatformTransactionNotCreated:return"PLATFORM_TRANSACTION_NOT_CREATED";case r.InvalidRenewalPeriod:return"INVALID_RENEWAL_PERIOD";case r.InvalidPayerAccountId:return"INVALID_PAYER_ACCOUNT_ID";case r.AccountDeleted:return"ACCOUNT_DELETED";case r.FileDeleted:return"FILE_DELETED";case r.AccountRepeatedInAccountAmounts:return"ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS";case r.SettingNegativeAccountBalance:return"SETTING_NEGATIVE_ACCOUNT_BALANCE";case r.ObtainerRequired:return"OBTAINER_REQUIRED";case r.ObtainerSameContractId:return"OBTAINER_SAME_CONTRACT_ID";case r.ObtainerDoesNotExist:return"OBTAINER_DOES_NOT_EXIST";case r.ModifyingImmutableContract:return"MODIFYING_IMMUTABLE_CONTRACT";case r.FileSystemException:return"FILE_SYSTEM_EXCEPTION";case r.AutorenewDurationNotInRange:return"AUTORENEW_DURATION_NOT_IN_RANGE";case r.ErrorDecodingBytestring:return"ERROR_DECODING_BYTESTRING";case r.ContractFileEmpty:return"CONTRACT_FILE_EMPTY";case r.ContractBytecodeEmpty:return"CONTRACT_BYTECODE_EMPTY";case r.InvalidInitialBalance:return"INVALID_INITIAL_BALANCE";case r.InvalidReceiveRecordThreshold:return"INVALID_RECEIVE_RECORD_THRESHOLD";case r.InvalidSendRecordThreshold:return"INVALID_SEND_RECORD_THRESHOLD";case r.AccountIsNotGenesisAccount:return"ACCOUNT_IS_NOT_GENESIS_ACCOUNT";case r.PayerAccountUnauthorized:return"PAYER_ACCOUNT_UNAUTHORIZED";case r.InvalidFreezeTransactionBody:return"INVALID_FREEZE_TRANSACTION_BODY";case r.FreezeTransactionBodyNotFound:return"FREEZE_TRANSACTION_BODY_NOT_FOUND";case r.TransferListSizeLimitExceeded:return"TRANSFER_LIST_SIZE_LIMIT_EXCEEDED";case r.ResultSizeLimitExceeded:return"RESULT_SIZE_LIMIT_EXCEEDED";case r.NotSpecialAccount:return"NOT_SPECIAL_ACCOUNT";case r.ContractNegativeGas:return"CONTRACT_NEGATIVE_GAS";case r.ContractNegativeValue:return"CONTRACT_NEGATIVE_VALUE";case r.InvalidFeeFile:return"INVALID_FEE_FILE";case r.InvalidExchangeRateFile:return"INVALID_EXCHANGE_RATE_FILE";case r.InsufficientLocalCallGas:return"INSUFFICIENT_LOCAL_CALL_GAS";case r.EntityNotAllowedToDelete:return"ENTITY_NOT_ALLOWED_TO_DELETE";case r.AuthorizationFailed:return"AUTHORIZATION_FAILED";case r.FileUploadedProtoInvalid:return"FILE_UPLOADED_PROTO_INVALID";case r.FileUploadedProtoNotSavedToDisk:return"FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK";case r.FeeScheduleFilePartUploaded:return"FEE_SCHEDULE_FILE_PART_UPLOADED";case r.ExchangeRateChangeLimitExceeded:return"EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED";case r.MaxContractStorageExceeded:return"MAX_CONTRACT_STORAGE_EXCEEDED";case r.TransferAccountSameAsDeleteAccount:return"TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT";case r.TotalLedgerBalanceInvalid:return"TOTAL_LEDGER_BALANCE_INVALID";case r.ExpirationReductionNotAllowed:return"EXPIRATION_REDUCTION_NOT_ALLOWED";case r.MaxGasLimitExceeded:return"MAX_GAS_LIMIT_EXCEEDED";case r.MaxFileSizeExceeded:return"MAX_FILE_SIZE_EXCEEDED";case r.ReceiverSigRequired:return"RECEIVER_SIG_REQUIRED";case r.InvalidTopicId:return"INVALID_TOPIC_ID";case r.InvalidAdminKey:return"INVALID_ADMIN_KEY";case r.InvalidSubmitKey:return"INVALID_SUBMIT_KEY";case r.Unauthorized:return"UNAUTHORIZED";case r.InvalidTopicMessage:return"INVALID_TOPIC_MESSAGE";case r.InvalidAutorenewAccount:return"INVALID_AUTORENEW_ACCOUNT";case r.AutorenewAccountNotAllowed:return"AUTORENEW_ACCOUNT_NOT_ALLOWED";case r.TopicExpired:return"TOPIC_EXPIRED";case r.InvalidChunkNumber:return"INVALID_CHUNK_NUMBER";case r.InvalidChunkTransactionId:return"INVALID_CHUNK_TRANSACTION_ID";case r.AccountFrozenForToken:return"ACCOUNT_FROZEN_FOR_TOKEN";case r.TokensPerAccountLimitExceeded:return"TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED";case r.InvalidTokenId:return"INVALID_TOKEN_ID";case r.InvalidTokenDecimals:return"INVALID_TOKEN_DECIMALS";case r.InvalidTokenInitialSupply:return"INVALID_TOKEN_INITIAL_SUPPLY";case r.InvalidTreasuryAccountForToken:return"INVALID_TREASURY_ACCOUNT_FOR_TOKEN";case r.InvalidTokenSymbol:return"INVALID_TOKEN_SYMBOL";case r.TokenHasNoFreezeKey:return"TOKEN_HAS_NO_FREEZE_KEY";case r.TransfersNotZeroSumForToken:return"TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN";case r.MissingTokenSymbol:return"MISSING_TOKEN_SYMBOL";case r.TokenSymbolTooLong:return"TOKEN_SYMBOL_TOO_LONG";case r.AccountKycNotGrantedForToken:return"ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN";case r.TokenHasNoKycKey:return"TOKEN_HAS_NO_KYC_KEY";case r.InsufficientTokenBalance:return"INSUFFICIENT_TOKEN_BALANCE";case r.TokenWasDeleted:return"TOKEN_WAS_DELETED";case r.TokenHasNoSupplyKey:return"TOKEN_HAS_NO_SUPPLY_KEY";case r.TokenHasNoWipeKey:return"TOKEN_HAS_NO_WIPE_KEY";case r.InvalidTokenMintAmount:return"INVALID_TOKEN_MINT_AMOUNT";case r.InvalidTokenBurnAmount:return"INVALID_TOKEN_BURN_AMOUNT";case r.TokenNotAssociatedToAccount:return"TOKEN_NOT_ASSOCIATED_TO_ACCOUNT";case r.CannotWipeTokenTreasuryAccount:return"CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT";case r.InvalidKycKey:return"INVALID_KYC_KEY";case r.InvalidWipeKey:return"INVALID_WIPE_KEY";case r.InvalidFreezeKey:return"INVALID_FREEZE_KEY";case r.InvalidSupplyKey:return"INVALID_SUPPLY_KEY";case r.MissingTokenName:return"MISSING_TOKEN_NAME";case r.TokenNameTooLong:return"TOKEN_NAME_TOO_LONG";case r.InvalidWipingAmount:return"INVALID_WIPING_AMOUNT";case r.TokenIsImmutable:return"TOKEN_IS_IMMUTABLE";case r.TokenAlreadyAssociatedToAccount:return"TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT";case r.TransactionRequiresZeroTokenBalances:return"TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES";case r.AccountIsTreasury:return"ACCOUNT_IS_TREASURY";case r.TokenIdRepeatedInTokenList:return"TOKEN_ID_REPEATED_IN_TOKEN_LIST";case r.TokenTransferListSizeLimitExceeded:return"TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED";case r.EmptyTokenTransferBody:return"EMPTY_TOKEN_TRANSFER_BODY";case r.EmptyTokenTransferAccountAmounts:return"EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS";case r.InvalidScheduleId:return"INVALID_SCHEDULE_ID";case r.ScheduleIsImmutable:return"SCHEDULE_IS_IMMUTABLE";case r.InvalidSchedulePayerId:return"INVALID_SCHEDULE_PAYER_ID";case r.InvalidScheduleAccountId:return"INVALID_SCHEDULE_ACCOUNT_ID";case r.NoNewValidSignatures:return"NO_NEW_VALID_SIGNATURES";case r.UnresolvableRequiredSigners:return"UNRESOLVABLE_REQUIRED_SIGNERS";case r.ScheduledTransactionNotInWhitelist:return"SCHEDULED_TRANSACTION_NOT_IN_WHITELIST";case r.SomeSignaturesWereInvalid:return"SOME_SIGNATURES_WERE_INVALID";case r.TransactionIdFieldNotAllowed:return"TRANSACTION_ID_FIELD_NOT_ALLOWED";case r.IdenticalScheduleAlreadyCreated:return"IDENTICAL_SCHEDULE_ALREADY_CREATED";case r.InvalidZeroByteInString:return"INVALID_ZERO_BYTE_IN_STRING";case r.ScheduleAlreadyDeleted:return"SCHEDULE_ALREADY_DELETED";case r.ScheduleAlreadyExecuted:return"SCHEDULE_ALREADY_EXECUTED";case r.MessageSizeTooLarge:return"MESSAGE_SIZE_TOO_LARGE";case r.OperationRepeatedInBucketGroups:return"OPERATION_REPEATED_IN_BUCKET_GROUPS";case r.BucketCapacityOverflow:return"BUCKET_CAPACITY_OVERFLOW";case r.NodeCapacityNotSufficientForOperation:return"NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION";case r.BucketHasNoThrottleGroups:return"BUCKET_HAS_NO_THROTTLE_GROUPS";case r.ThrottleGroupHasZeroOpsPerSec:return"THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC";case r.SuccessButMissingExpectedOperation:return"SUCCESS_BUT_MISSING_EXPECTED_OPERATION";case r.UnparseableThrottleDefinitions:return"UNPARSEABLE_THROTTLE_DEFINITIONS";case r.InvalidThrottleDefinitions:return"INVALID_THROTTLE_DEFINITIONS";case r.AccountExpiredAndPendingRemoval:return"ACCOUNT_EXPIRED_AND_PENDING_REMOVAL";case r.InvalidTokenMaxSupply:return"INVALID_TOKEN_MAX_SUPPLY";case r.InvalidTokenNftSerialNumber:return"INVALID_TOKEN_NFT_SERIAL_NUMBER";case r.InvalidNftId:return"INVALID_NFT_ID";case r.MetadataTooLong:return"METADATA_TOO_LONG";case r.BatchSizeLimitExceeded:return"BATCH_SIZE_LIMIT_EXCEEDED";case r.InvalidQueryRange:return"INVALID_QUERY_RANGE";case r.FractionDividesByZero:return"FRACTION_DIVIDES_BY_ZERO";case r.InsufficientPayerBalanceForCustomFee:return"INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE";case r.CustomFeesListTooLong:return"CUSTOM_FEES_LIST_TOO_LONG";case r.InvalidCustomFeeCollector:return"INVALID_CUSTOM_FEE_COLLECTOR";case r.InvalidTokenIdInCustomFees:return"INVALID_TOKEN_ID_IN_CUSTOM_FEES";case r.TokenNotAssociatedToFeeCollector:return"TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR";case r.TokenMaxSupplyReached:return"TOKEN_MAX_SUPPLY_REACHED";case r.SenderDoesNotOwnNftSerialNo:return"SENDER_DOES_NOT_OWN_NFT_SERIAL_NO";case r.CustomFeeNotFullySpecified:return"CUSTOM_FEE_NOT_FULLY_SPECIFIED";case r.CustomFeeMustBePositive:return"CUSTOM_FEE_MUST_BE_POSITIVE";case r.TokenHasNoFeeScheduleKey:return"TOKEN_HAS_NO_FEE_SCHEDULE_KEY";case r.CustomFeeOutsideNumericRange:return"CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE";case r.RoyaltyFractionCannotExceedOne:return"ROYALTY_FRACTION_CANNOT_EXCEED_ONE";case r.FractionalFeeMaxAmountLessThanMinAmount:return"FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT";case r.CustomScheduleAlreadyHasNoFees:return"CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES";case r.CustomFeeDenominationMustBeFungibleCommon:return"CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON";case r.CustomFractionalFeeOnlyAllowedForFungibleCommon:return"CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON";case r.InvalidCustomFeeScheduleKey:return"INVALID_CUSTOM_FEE_SCHEDULE_KEY";case r.InvalidTokenMintMetadata:return"INVALID_TOKEN_MINT_METADATA";case r.InvalidTokenBurnMetadata:return"INVALID_TOKEN_BURN_METADATA";case r.CurrentTreasuryStillOwnsNfts:return"CURRENT_TREASURY_STILL_OWNS_NFTS";case r.AccountStillOwnsNfts:return"ACCOUNT_STILL_OWNS_NFTS";case r.TreasuryMustOwnBurnedNft:return"TREASURY_MUST_OWN_BURNED_NFT";case r.AccountDoesNotOwnWipedNft:return"ACCOUNT_DOES_NOT_OWN_WIPED_NFT";case r.AccountAmountTransfersOnlyAllowedForFungibleCommon:return"ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON";case r.MaxNftsInPriceRegimeHaveBeenMinted:return"MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED";case r.PayerAccountDeleted:return"PAYER_ACCOUNT_DELETED";case r.CustomFeeChargingExceededMaxRecursionDepth:return"CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH";case r.CustomFeeChargingExceededMaxAccountAmounts:return"CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS";case r.InsufficientSenderAccountBalanceForCustomFee:return"INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE";case r.SerialNumberLimitReached:return"SERIAL_NUMBER_LIMIT_REACHED";case r.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique:return"CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE";case r.NoRemainingAutomaticAssociations:return"NO_REMAINING_AUTOMATIC_ASSOCIATIONS";case r.ExistingAutomaticAssociationsExceedGivenLimit:return"EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT";case r.RequestedNumAutomaticAssociationsExceedsAssociationLimit:return"REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT";case r.TokenIsPaused:return"TOKEN_IS_PAUSED";case r.TokenHasNoPauseKey:return"TOKEN_HAS_NO_PAUSE_KEY";case r.InvalidPauseKey:return"INVALID_PAUSE_KEY";case r.FreezeUpdateFileDoesNotExist:return"FREEZE_UPDATE_FILE_DOES_NOT_EXIST";case r.FreezeUpdateFileHashDoesNotMatch:return"FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH";case r.NoUpgradeHasBeenPrepared:return"NO_UPGRADE_HAS_BEEN_PREPARED";case r.NoFreezeIsScheduled:return"NO_FREEZE_IS_SCHEDULED";case r.UpdateFileHashChangedSincePrepareUpgrade:return"UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE";case r.FreezeStartTimeMustBeFuture:return"FREEZE_START_TIME_MUST_BE_FUTURE";case r.PreparedUpdateFileIsImmutable:return"PREPARED_UPDATE_FILE_IS_IMMUTABLE";case r.FreezeAlreadyScheduled:return"FREEZE_ALREADY_SCHEDULED";case r.FreezeUpgradeInProgress:return"FREEZE_UPGRADE_IN_PROGRESS";case r.UpdateFileIdDoesNotMatchPrepared:return"UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED";case r.UpdateFileHashDoesNotMatchPrepared:return"UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED";case r.ConsensusGasExhausted:return"CONSENSUS_GAS_EXHAUSTED";case r.RevertedSuccess:return"REVERTED_SUCCESS";case r.MaxStorageInPriceRegimeHasBeenUsed:return"MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED";case r.InvalidAliasKey:return"INVALID_ALIAS_KEY";case r.UnexpectedTokenDecimals:return"UNEXPECTED_TOKEN_DECIMALS";case r.InvalidProxyAccountId:return"INVALID_PROXY_ACCOUNT_ID";case r.InvalidTransferAccountId:return"INVALID_TRANSFER_ACCOUNT_ID";case r.InvalidFeeCollectorAccountId:return"INVALID_FEE_COLLECTOR_ACCOUNT_ID";case r.AliasIsImmutable:return"ALIAS_IS_IMMUTABLE";case r.SpenderAccountSameAsOwner:return"SPENDER_ACCOUNT_SAME_AS_OWNER";case r.AmountExceedsTokenMaxSupply:return"AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY";case r.NegativeAllowanceAmount:return"NEGATIVE_ALLOWANCE_AMOUNT";case r.CannotApproveForAllFungibleCommon:return"CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON";case r.SpenderDoesNotHaveAllowance:return"SPENDER_DOES_NOT_HAVE_ALLOWANCE";case r.AmountExceedsAllowance:return"AMOUNT_EXCEEDS_ALLOWANCE";case r.MaxAllowancesExceeded:return"MAX_ALLOWANCES_EXCEEDED";case r.EmptyAllowances:return"EMPTY_ALLOWANCES";case r.SpenderAccountRepeatedInAllowances:return"SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES";case r.RepeatedSerialNumsInNftAllowances:return"REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES";case r.FungibleTokenInNftAllowances:return"FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES";case r.NftInFungibleTokenAllowances:return"NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES";case r.InvalidAllowanceOwnerId:return"INVALID_ALLOWANCE_OWNER_ID";case r.InvalidAllowanceSpenderId:return"INVALID_ALLOWANCE_SPENDER_ID";case r.RepeatedAllowancesToDelete:return"REPEATED_ALLOWANCES_TO_DELETE";case r.InvalidDelegatingSpender:return"INVALID_DELEGATING_SPENDER";case r.DelegatingSpenderCannotGrantApproveForAll:return"DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL";case r.DelegatingSpenderDoesNotHaveApproveForAll:return"DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL";case r.ScheduleExpirationTimeTooFarInFuture:return"SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE";case r.ScheduleExpirationTimeMustBeHigherThanConsensusTime:return"SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME";case r.ScheduleFutureThrottleExceeded:return"SCHEDULE_FUTURE_THROTTLE_EXCEEDED";case r.ScheduleFutureGasLimitExceeded:return"SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED";case r.InvalidEthereumTransaction:return"INVALID_ETHEREUM_TRANSACTION";case r.WrongChainId:return"WRONG_CHAIN_ID";case r.WrongNonce:return"WRONG_NONCE";case r.AccessListUnsupported:return"ACCESS_LIST_UNSUPPORTED";case r.SchedulePendingExpiration:return"SCHEDULE_PENDING_EXPIRATION";case r.ContractIsTokenTreasury:return"CONTRACT_IS_TOKEN_TREASURY";case r.ContractHasNonZeroTokenBalances:return"CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES";case r.ContractExpiredAndPendingRemoval:return"CONTRACT_EXPIRED_AND_PENDING_REMOVAL";case r.ContractHasNoAutoRenewAccount:return"CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT";case r.PermanentRemovalRequiresSystemInitiation:return"PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION";case r.ProxyAccountIdFieldIsDeprecated:return"PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED";case r.SelfStakingIsNotAllowed:return"SELF_STAKING_IS_NOT_ALLOWED";case r.InvalidStakingId:return"INVALID_STAKING_ID";case r.StakingNotEnabled:return"STAKING_NOT_ENABLED";case r.InvalidPrngRange:return"INVALID_PRNG_RANGE";case r.MaxEntitiesInPriceRegimeHaveBeenCreated:return"MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED";case r.InvalidFullPrefixSignatureForPrecompile:return"INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE";case r.InsufficientBalancesForStorageRent:return"INSUFFICIENT_BALANCES_FOR_STORAGE_RENT";case r.MaxChildRecordsExceeded:return"MAX_CHILD_RECORDS_EXCEEDED";case r.InsufficientBalancesForRenewalFees:return"INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES";case r.TransactionHasUnknownFields:return"TRANSACTION_HAS_UNKNOWN_FIELDS";case r.AccountIsImmutable:return"ACCOUNT_IS_IMMUTABLE";case r.AliasAlreadyAssigned:return"ALIAS_ALREADY_ASSIGNED";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Ok;case 1:return r.InvalidTransaction;case 2:return r.PayerAccountNotFound;case 3:return r.InvalidNodeAccount;case 4:return r.TransactionExpired;case 5:return r.InvalidTransactionStart;case 6:return r.InvalidTransactionDuration;case 7:return r.InvalidSignature;case 8:return r.MemoTooLong;case 9:return r.InsufficientTxFee;case 10:return r.InsufficientPayerBalance;case 11:return r.DuplicateTransaction;case 12:return r.Busy;case 13:return r.NotSupported;case 14:return r.InvalidFileId;case 15:return r.InvalidAccountId;case 16:return r.InvalidContractId;case 17:return r.InvalidTransactionId;case 18:return r.ReceiptNotFound;case 19:return r.RecordNotFound;case 20:return r.InvalidSolidityId;case 21:return r.Unknown;case 22:return r.Success;case 23:return r.FailInvalid;case 24:return r.FailFee;case 25:return r.FailBalance;case 26:return r.KeyRequired;case 27:return r.BadEncoding;case 28:return r.InsufficientAccountBalance;case 29:return r.InvalidSolidityAddress;case 30:return r.InsufficientGas;case 31:return r.ContractSizeLimitExceeded;case 32:return r.LocalCallModificationException;case 33:return r.ContractRevertExecuted;case 34:return r.ContractExecutionException;case 35:return r.InvalidReceivingNodeAccount;case 36:return r.MissingQueryHeader;case 37:return r.AccountUpdateFailed;case 38:return r.InvalidKeyEncoding;case 39:return r.NullSolidityAddress;case 40:return r.ContractUpdateFailed;case 41:return r.InvalidQueryHeader;case 42:return r.InvalidFeeSubmitted;case 43:return r.InvalidPayerSignature;case 44:return r.KeyNotProvided;case 45:return r.InvalidExpirationTime;case 46:return r.NoWaclKey;case 47:return r.FileContentEmpty;case 48:return r.InvalidAccountAmounts;case 49:return r.EmptyTransactionBody;case 50:return r.InvalidTransactionBody;case 51:return r.InvalidSignatureTypeMismatchingKey;case 52:return r.InvalidSignatureCountMismatchingKey;case 53:return r.EmptyLiveHashBody;case 54:return r.EmptyLiveHash;case 55:return r.EmptyLiveHashKeys;case 56:return r.InvalidLiveHashSize;case 57:return r.EmptyQueryBody;case 58:return r.EmptyLiveHashQuery;case 59:return r.LiveHashNotFound;case 60:return r.AccountIdDoesNotExist;case 61:return r.LiveHashAlreadyExists;case 62:return r.InvalidFileWacl;case 63:return r.SerializationFailed;case 64:return r.TransactionOversize;case 65:return r.TransactionTooManyLayers;case 66:return r.ContractDeleted;case 67:return r.PlatformNotActive;case 68:return r.KeyPrefixMismatch;case 69:return r.PlatformTransactionNotCreated;case 70:return r.InvalidRenewalPeriod;case 71:return r.InvalidPayerAccountId;case 72:return r.AccountDeleted;case 73:return r.FileDeleted;case 74:return r.AccountRepeatedInAccountAmounts;case 75:return r.SettingNegativeAccountBalance;case 76:return r.ObtainerRequired;case 77:return r.ObtainerSameContractId;case 78:return r.ObtainerDoesNotExist;case 79:return r.ModifyingImmutableContract;case 80:return r.FileSystemException;case 81:return r.AutorenewDurationNotInRange;case 82:return r.ErrorDecodingBytestring;case 83:return r.ContractFileEmpty;case 84:return r.ContractBytecodeEmpty;case 85:return r.InvalidInitialBalance;case 86:return r.InvalidReceiveRecordThreshold;case 87:return r.InvalidSendRecordThreshold;case 88:return r.AccountIsNotGenesisAccount;case 89:return r.PayerAccountUnauthorized;case 90:return r.InvalidFreezeTransactionBody;case 91:return r.FreezeTransactionBodyNotFound;case 92:return r.TransferListSizeLimitExceeded;case 93:return r.ResultSizeLimitExceeded;case 94:return r.NotSpecialAccount;case 95:return r.ContractNegativeGas;case 96:return r.ContractNegativeValue;case 97:return r.InvalidFeeFile;case 98:return r.InvalidExchangeRateFile;case 99:return r.InsufficientLocalCallGas;case 100:return r.EntityNotAllowedToDelete;case 101:return r.AuthorizationFailed;case 102:return r.FileUploadedProtoInvalid;case 103:return r.FileUploadedProtoNotSavedToDisk;case 104:return r.FeeScheduleFilePartUploaded;case 105:return r.ExchangeRateChangeLimitExceeded;case 106:return r.MaxContractStorageExceeded;case 107:return r.TransferAccountSameAsDeleteAccount;case 108:return r.TotalLedgerBalanceInvalid;case 110:return r.ExpirationReductionNotAllowed;case 111:return r.MaxGasLimitExceeded;case 112:return r.MaxFileSizeExceeded;case 113:return r.ReceiverSigRequired;case 150:return r.InvalidTopicId;case 155:return r.InvalidAdminKey;case 156:return r.InvalidSubmitKey;case 157:return r.Unauthorized;case 158:return r.InvalidTopicMessage;case 159:return r.InvalidAutorenewAccount;case 160:return r.AutorenewAccountNotAllowed;case 162:return r.TopicExpired;case 163:return r.InvalidChunkNumber;case 164:return r.InvalidChunkTransactionId;case 165:return r.AccountFrozenForToken;case 166:return r.TokensPerAccountLimitExceeded;case 167:return r.InvalidTokenId;case 168:return r.InvalidTokenDecimals;case 169:return r.InvalidTokenInitialSupply;case 170:return r.InvalidTreasuryAccountForToken;case 171:return r.InvalidTokenSymbol;case 172:return r.TokenHasNoFreezeKey;case 173:return r.TransfersNotZeroSumForToken;case 174:return r.MissingTokenSymbol;case 175:return r.TokenSymbolTooLong;case 176:return r.AccountKycNotGrantedForToken;case 177:return r.TokenHasNoKycKey;case 178:return r.InsufficientTokenBalance;case 179:return r.TokenWasDeleted;case 180:return r.TokenHasNoSupplyKey;case 181:return r.TokenHasNoWipeKey;case 182:return r.InvalidTokenMintAmount;case 183:return r.InvalidTokenBurnAmount;case 184:return r.TokenNotAssociatedToAccount;case 185:return r.CannotWipeTokenTreasuryAccount;case 186:return r.InvalidKycKey;case 187:return r.InvalidWipeKey;case 188:return r.InvalidFreezeKey;case 189:return r.InvalidSupplyKey;case 190:return r.MissingTokenName;case 191:return r.TokenNameTooLong;case 192:return r.InvalidWipingAmount;case 193:return r.TokenIsImmutable;case 194:return r.TokenAlreadyAssociatedToAccount;case 195:return r.TransactionRequiresZeroTokenBalances;case 196:return r.AccountIsTreasury;case 197:return r.TokenIdRepeatedInTokenList;case 198:return r.TokenTransferListSizeLimitExceeded;case 199:return r.EmptyTokenTransferBody;case 200:return r.EmptyTokenTransferAccountAmounts;case 201:return r.InvalidScheduleId;case 202:return r.ScheduleIsImmutable;case 203:return r.InvalidSchedulePayerId;case 204:return r.InvalidScheduleAccountId;case 205:return r.NoNewValidSignatures;case 206:return r.UnresolvableRequiredSigners;case 207:return r.ScheduledTransactionNotInWhitelist;case 208:return r.SomeSignaturesWereInvalid;case 209:return r.TransactionIdFieldNotAllowed;case 210:return r.IdenticalScheduleAlreadyCreated;case 211:return r.InvalidZeroByteInString;case 212:return r.ScheduleAlreadyDeleted;case 213:return r.ScheduleAlreadyExecuted;case 214:return r.MessageSizeTooLarge;case 215:return r.OperationRepeatedInBucketGroups;case 216:return r.BucketCapacityOverflow;case 217:return r.NodeCapacityNotSufficientForOperation;case 218:return r.BucketHasNoThrottleGroups;case 219:return r.ThrottleGroupHasZeroOpsPerSec;case 220:return r.SuccessButMissingExpectedOperation;case 221:return r.UnparseableThrottleDefinitions;case 222:return r.InvalidThrottleDefinitions;case 223:return r.AccountExpiredAndPendingRemoval;case 224:return r.InvalidTokenMaxSupply;case 225:return r.InvalidTokenNftSerialNumber;case 226:return r.InvalidNftId;case 227:return r.MetadataTooLong;case 228:return r.BatchSizeLimitExceeded;case 229:return r.InvalidQueryRange;case 230:return r.FractionDividesByZero;case 231:return r.InsufficientPayerBalanceForCustomFee;case 232:return r.CustomFeesListTooLong;case 233:return r.InvalidCustomFeeCollector;case 234:return r.InvalidTokenIdInCustomFees;case 235:return r.TokenNotAssociatedToFeeCollector;case 236:return r.TokenMaxSupplyReached;case 237:return r.SenderDoesNotOwnNftSerialNo;case 238:return r.CustomFeeNotFullySpecified;case 239:return r.CustomFeeMustBePositive;case 240:return r.TokenHasNoFeeScheduleKey;case 241:return r.CustomFeeOutsideNumericRange;case 242:return r.RoyaltyFractionCannotExceedOne;case 243:return r.FractionalFeeMaxAmountLessThanMinAmount;case 244:return r.CustomScheduleAlreadyHasNoFees;case 245:return r.CustomFeeDenominationMustBeFungibleCommon;case 246:return r.CustomFractionalFeeOnlyAllowedForFungibleCommon;case 247:return r.InvalidCustomFeeScheduleKey;case 248:return r.InvalidTokenMintMetadata;case 249:return r.InvalidTokenBurnMetadata;case 250:return r.CurrentTreasuryStillOwnsNfts;case 251:return r.AccountStillOwnsNfts;case 252:return r.TreasuryMustOwnBurnedNft;case 253:return r.AccountDoesNotOwnWipedNft;case 254:return r.AccountAmountTransfersOnlyAllowedForFungibleCommon;case 255:return r.MaxNftsInPriceRegimeHaveBeenMinted;case 256:return r.PayerAccountDeleted;case 257:return r.CustomFeeChargingExceededMaxRecursionDepth;case 258:return r.CustomFeeChargingExceededMaxAccountAmounts;case 259:return r.InsufficientSenderAccountBalanceForCustomFee;case 260:return r.SerialNumberLimitReached;case 261:return r.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique;case 262:return r.NoRemainingAutomaticAssociations;case 263:return r.ExistingAutomaticAssociationsExceedGivenLimit;case 264:return r.RequestedNumAutomaticAssociationsExceedsAssociationLimit;case 265:return r.TokenIsPaused;case 266:return r.TokenHasNoPauseKey;case 267:return r.InvalidPauseKey;case 268:return r.FreezeUpdateFileDoesNotExist;case 269:return r.FreezeUpdateFileHashDoesNotMatch;case 270:return r.NoUpgradeHasBeenPrepared;case 271:return r.NoFreezeIsScheduled;case 272:return r.UpdateFileHashChangedSincePrepareUpgrade;case 273:return r.FreezeStartTimeMustBeFuture;case 274:return r.PreparedUpdateFileIsImmutable;case 275:return r.FreezeAlreadyScheduled;case 276:return r.FreezeUpgradeInProgress;case 277:return r.UpdateFileIdDoesNotMatchPrepared;case 278:return r.UpdateFileHashDoesNotMatchPrepared;case 279:return r.ConsensusGasExhausted;case 280:return r.RevertedSuccess;case 281:return r.MaxStorageInPriceRegimeHasBeenUsed;case 282:return r.InvalidAliasKey;case 283:return r.UnexpectedTokenDecimals;case 284:return r.InvalidProxyAccountId;case 285:return r.InvalidTransferAccountId;case 286:return r.InvalidFeeCollectorAccountId;case 287:return r.AliasIsImmutable;case 288:return r.SpenderAccountSameAsOwner;case 289:return r.AmountExceedsTokenMaxSupply;case 290:return r.NegativeAllowanceAmount;case 291:return r.CannotApproveForAllFungibleCommon;case 292:return r.SpenderDoesNotHaveAllowance;case 293:return r.AmountExceedsAllowance;case 294:return r.MaxAllowancesExceeded;case 295:return r.EmptyAllowances;case 296:return r.SpenderAccountRepeatedInAllowances;case 297:return r.RepeatedSerialNumsInNftAllowances;case 298:return r.FungibleTokenInNftAllowances;case 299:return r.NftInFungibleTokenAllowances;case 300:return r.InvalidAllowanceOwnerId;case 301:return r.InvalidAllowanceSpenderId;case 302:return r.RepeatedAllowancesToDelete;case 303:return r.InvalidDelegatingSpender;case 304:return r.DelegatingSpenderCannotGrantApproveForAll;case 305:return r.DelegatingSpenderDoesNotHaveApproveForAll;case 306:return r.ScheduleExpirationTimeTooFarInFuture;case 307:return r.ScheduleExpirationTimeMustBeHigherThanConsensusTime;case 308:return r.ScheduleFutureThrottleExceeded;case 309:return r.ScheduleFutureGasLimitExceeded;case 310:return r.InvalidEthereumTransaction;case 311:return r.WrongChainId;case 312:return r.WrongNonce;case 313:return r.AccessListUnsupported;case 314:return r.SchedulePendingExpiration;case 315:return r.ContractIsTokenTreasury;case 316:return r.ContractHasNonZeroTokenBalances;case 317:return r.ContractExpiredAndPendingRemoval;case 318:return r.ContractHasNoAutoRenewAccount;case 319:return r.PermanentRemovalRequiresSystemInitiation;case 320:return r.ProxyAccountIdFieldIsDeprecated;case 321:return r.SelfStakingIsNotAllowed;case 322:return r.InvalidStakingId;case 323:return r.StakingNotEnabled;case 324:return r.InvalidPrngRange;case 325:return r.MaxEntitiesInPriceRegimeHaveBeenCreated;case 326:return r.InvalidFullPrefixSignatureForPrecompile;case 327:return r.InsufficientBalancesForStorageRent;case 328:return r.MaxChildRecordsExceeded;case 329:return r.InsufficientBalancesForRenewalFees;case 330:return r.TransactionHasUnknownFields;case 331:return r.AccountIsImmutable;case 332:return r.AliasAlreadyAssigned;default:throw new Error(`(BUG) Status.fromCode() does not handle code: ${e}`)}}valueOf(){return this._code}};P.Ok=new P(0);P.InvalidTransaction=new P(1);P.PayerAccountNotFound=new P(2);P.InvalidNodeAccount=new P(3);P.TransactionExpired=new P(4);P.InvalidTransactionStart=new P(5);P.InvalidTransactionDuration=new P(6);P.InvalidSignature=new P(7);P.MemoTooLong=new P(8);P.InsufficientTxFee=new P(9);P.InsufficientPayerBalance=new P(10);P.DuplicateTransaction=new P(11);P.Busy=new P(12);P.NotSupported=new P(13);P.InvalidFileId=new P(14);P.InvalidAccountId=new P(15);P.InvalidContractId=new P(16);P.InvalidTransactionId=new P(17);P.ReceiptNotFound=new P(18);P.RecordNotFound=new P(19);P.InvalidSolidityId=new P(20);P.Unknown=new P(21);P.Success=new P(22);P.FailInvalid=new P(23);P.FailFee=new P(24);P.FailBalance=new P(25);P.KeyRequired=new P(26);P.BadEncoding=new P(27);P.InsufficientAccountBalance=new P(28);P.InvalidSolidityAddress=new P(29);P.InsufficientGas=new P(30);P.ContractSizeLimitExceeded=new P(31);P.LocalCallModificationException=new P(32);P.ContractRevertExecuted=new P(33);P.ContractExecutionException=new P(34);P.InvalidReceivingNodeAccount=new P(35);P.MissingQueryHeader=new P(36);P.AccountUpdateFailed=new P(37);P.InvalidKeyEncoding=new P(38);P.NullSolidityAddress=new P(39);P.ContractUpdateFailed=new P(40);P.InvalidQueryHeader=new P(41);P.InvalidFeeSubmitted=new P(42);P.InvalidPayerSignature=new P(43);P.KeyNotProvided=new P(44);P.InvalidExpirationTime=new P(45);P.NoWaclKey=new P(46);P.FileContentEmpty=new P(47);P.InvalidAccountAmounts=new P(48);P.EmptyTransactionBody=new P(49);P.InvalidTransactionBody=new P(50);P.InvalidSignatureTypeMismatchingKey=new P(51);P.InvalidSignatureCountMismatchingKey=new P(52);P.EmptyLiveHashBody=new P(53);P.EmptyLiveHash=new P(54);P.EmptyLiveHashKeys=new P(55);P.InvalidLiveHashSize=new P(56);P.EmptyQueryBody=new P(57);P.EmptyLiveHashQuery=new P(58);P.LiveHashNotFound=new P(59);P.AccountIdDoesNotExist=new P(60);P.LiveHashAlreadyExists=new P(61);P.InvalidFileWacl=new P(62);P.SerializationFailed=new P(63);P.TransactionOversize=new P(64);P.TransactionTooManyLayers=new P(65);P.ContractDeleted=new P(66);P.PlatformNotActive=new P(67);P.KeyPrefixMismatch=new P(68);P.PlatformTransactionNotCreated=new P(69);P.InvalidRenewalPeriod=new P(70);P.InvalidPayerAccountId=new P(71);P.AccountDeleted=new P(72);P.FileDeleted=new P(73);P.AccountRepeatedInAccountAmounts=new P(74);P.SettingNegativeAccountBalance=new P(75);P.ObtainerRequired=new P(76);P.ObtainerSameContractId=new P(77);P.ObtainerDoesNotExist=new P(78);P.ModifyingImmutableContract=new P(79);P.FileSystemException=new P(80);P.AutorenewDurationNotInRange=new P(81);P.ErrorDecodingBytestring=new P(82);P.ContractFileEmpty=new P(83);P.ContractBytecodeEmpty=new P(84);P.InvalidInitialBalance=new P(85);P.InvalidReceiveRecordThreshold=new P(86);P.InvalidSendRecordThreshold=new P(87);P.AccountIsNotGenesisAccount=new P(88);P.PayerAccountUnauthorized=new P(89);P.InvalidFreezeTransactionBody=new P(90);P.FreezeTransactionBodyNotFound=new P(91);P.TransferListSizeLimitExceeded=new P(92);P.ResultSizeLimitExceeded=new P(93);P.NotSpecialAccount=new P(94);P.ContractNegativeGas=new P(95);P.ContractNegativeValue=new P(96);P.InvalidFeeFile=new P(97);P.InvalidExchangeRateFile=new P(98);P.InsufficientLocalCallGas=new P(99);P.EntityNotAllowedToDelete=new P(100);P.AuthorizationFailed=new P(101);P.FileUploadedProtoInvalid=new P(102);P.FileUploadedProtoNotSavedToDisk=new P(103);P.FeeScheduleFilePartUploaded=new P(104);P.ExchangeRateChangeLimitExceeded=new P(105);P.MaxContractStorageExceeded=new P(106);P.TransferAccountSameAsDeleteAccount=new P(107);P.TotalLedgerBalanceInvalid=new P(108);P.ExpirationReductionNotAllowed=new P(110);P.MaxGasLimitExceeded=new P(111);P.MaxFileSizeExceeded=new P(112);P.ReceiverSigRequired=new P(113);P.InvalidTopicId=new P(150);P.InvalidAdminKey=new P(155);P.InvalidSubmitKey=new P(156);P.Unauthorized=new P(157);P.InvalidTopicMessage=new P(158);P.InvalidAutorenewAccount=new P(159);P.AutorenewAccountNotAllowed=new P(160);P.TopicExpired=new P(162);P.InvalidChunkNumber=new P(163);P.InvalidChunkTransactionId=new P(164);P.AccountFrozenForToken=new P(165);P.TokensPerAccountLimitExceeded=new P(166);P.InvalidTokenId=new P(167);P.InvalidTokenDecimals=new P(168);P.InvalidTokenInitialSupply=new P(169);P.InvalidTreasuryAccountForToken=new P(170);P.InvalidTokenSymbol=new P(171);P.TokenHasNoFreezeKey=new P(172);P.TransfersNotZeroSumForToken=new P(173);P.MissingTokenSymbol=new P(174);P.TokenSymbolTooLong=new P(175);P.AccountKycNotGrantedForToken=new P(176);P.TokenHasNoKycKey=new P(177);P.InsufficientTokenBalance=new P(178);P.TokenWasDeleted=new P(179);P.TokenHasNoSupplyKey=new P(180);P.TokenHasNoWipeKey=new P(181);P.InvalidTokenMintAmount=new P(182);P.InvalidTokenBurnAmount=new P(183);P.TokenNotAssociatedToAccount=new P(184);P.CannotWipeTokenTreasuryAccount=new P(185);P.InvalidKycKey=new P(186);P.InvalidWipeKey=new P(187);P.InvalidFreezeKey=new P(188);P.InvalidSupplyKey=new P(189);P.MissingTokenName=new P(190);P.TokenNameTooLong=new P(191);P.InvalidWipingAmount=new P(192);P.TokenIsImmutable=new P(193);P.TokenAlreadyAssociatedToAccount=new P(194);P.TransactionRequiresZeroTokenBalances=new P(195);P.AccountIsTreasury=new P(196);P.TokenIdRepeatedInTokenList=new P(197);P.TokenTransferListSizeLimitExceeded=new P(198);P.EmptyTokenTransferBody=new P(199);P.EmptyTokenTransferAccountAmounts=new P(200);P.InvalidScheduleId=new P(201);P.ScheduleIsImmutable=new P(202);P.InvalidSchedulePayerId=new P(203);P.InvalidScheduleAccountId=new P(204);P.NoNewValidSignatures=new P(205);P.UnresolvableRequiredSigners=new P(206);P.ScheduledTransactionNotInWhitelist=new P(207);P.SomeSignaturesWereInvalid=new P(208);P.TransactionIdFieldNotAllowed=new P(209);P.IdenticalScheduleAlreadyCreated=new P(210);P.InvalidZeroByteInString=new P(211);P.ScheduleAlreadyDeleted=new P(212);P.ScheduleAlreadyExecuted=new P(213);P.MessageSizeTooLarge=new P(214);P.OperationRepeatedInBucketGroups=new P(215);P.BucketCapacityOverflow=new P(216);P.NodeCapacityNotSufficientForOperation=new P(217);P.BucketHasNoThrottleGroups=new P(218);P.ThrottleGroupHasZeroOpsPerSec=new P(219);P.SuccessButMissingExpectedOperation=new P(220);P.UnparseableThrottleDefinitions=new P(221);P.InvalidThrottleDefinitions=new P(222);P.AccountExpiredAndPendingRemoval=new P(223);P.InvalidTokenMaxSupply=new P(224);P.InvalidTokenNftSerialNumber=new P(225);P.InvalidNftId=new P(226);P.MetadataTooLong=new P(227);P.BatchSizeLimitExceeded=new P(228);P.InvalidQueryRange=new P(229);P.FractionDividesByZero=new P(230);P.InsufficientPayerBalanceForCustomFee=new P(231);P.CustomFeesListTooLong=new P(232);P.InvalidCustomFeeCollector=new P(233);P.InvalidTokenIdInCustomFees=new P(234);P.TokenNotAssociatedToFeeCollector=new P(235);P.TokenMaxSupplyReached=new P(236);P.SenderDoesNotOwnNftSerialNo=new P(237);P.CustomFeeNotFullySpecified=new P(238);P.CustomFeeMustBePositive=new P(239);P.TokenHasNoFeeScheduleKey=new P(240);P.CustomFeeOutsideNumericRange=new P(241);P.RoyaltyFractionCannotExceedOne=new P(242);P.FractionalFeeMaxAmountLessThanMinAmount=new P(243);P.CustomScheduleAlreadyHasNoFees=new P(244);P.CustomFeeDenominationMustBeFungibleCommon=new P(245);P.CustomFractionalFeeOnlyAllowedForFungibleCommon=new P(246);P.InvalidCustomFeeScheduleKey=new P(247);P.InvalidTokenMintMetadata=new P(248);P.InvalidTokenBurnMetadata=new P(249);P.CurrentTreasuryStillOwnsNfts=new P(250);P.AccountStillOwnsNfts=new P(251);P.TreasuryMustOwnBurnedNft=new P(252);P.AccountDoesNotOwnWipedNft=new P(253);P.AccountAmountTransfersOnlyAllowedForFungibleCommon=new P(254);P.MaxNftsInPriceRegimeHaveBeenMinted=new P(255);P.PayerAccountDeleted=new P(256);P.CustomFeeChargingExceededMaxRecursionDepth=new P(257);P.CustomFeeChargingExceededMaxAccountAmounts=new P(258);P.InsufficientSenderAccountBalanceForCustomFee=new P(259);P.SerialNumberLimitReached=new P(260);P.CustomRoyaltyFeeOnlyAllowedForNonFungibleUnique=new P(261);P.NoRemainingAutomaticAssociations=new P(262);P.ExistingAutomaticAssociationsExceedGivenLimit=new P(263);P.RequestedNumAutomaticAssociationsExceedsAssociationLimit=new P(264);P.TokenIsPaused=new P(265);P.TokenHasNoPauseKey=new P(266);P.InvalidPauseKey=new P(267);P.FreezeUpdateFileDoesNotExist=new P(268);P.FreezeUpdateFileHashDoesNotMatch=new P(269);P.NoUpgradeHasBeenPrepared=new P(270);P.NoFreezeIsScheduled=new P(271);P.UpdateFileHashChangedSincePrepareUpgrade=new P(272);P.FreezeStartTimeMustBeFuture=new P(273);P.PreparedUpdateFileIsImmutable=new P(274);P.FreezeAlreadyScheduled=new P(275);P.FreezeUpgradeInProgress=new P(276);P.UpdateFileIdDoesNotMatchPrepared=new P(277);P.UpdateFileHashDoesNotMatchPrepared=new P(278);P.ConsensusGasExhausted=new P(279);P.RevertedSuccess=new P(280);P.MaxStorageInPriceRegimeHasBeenUsed=new P(281);P.InvalidAliasKey=new P(282);P.UnexpectedTokenDecimals=new P(283);P.InvalidProxyAccountId=new P(284);P.InvalidTransferAccountId=new P(285);P.InvalidFeeCollectorAccountId=new P(286);P.AliasIsImmutable=new P(287);P.SpenderAccountSameAsOwner=new P(288);P.AmountExceedsTokenMaxSupply=new P(289);P.NegativeAllowanceAmount=new P(290);P.CannotApproveForAllFungibleCommon=new P(291);P.SpenderDoesNotHaveAllowance=new P(292);P.AmountExceedsAllowance=new P(293);P.MaxAllowancesExceeded=new P(294);P.EmptyAllowances=new P(295);P.SpenderAccountRepeatedInAllowances=new P(296);P.RepeatedSerialNumsInNftAllowances=new P(297);P.FungibleTokenInNftAllowances=new P(298);P.NftInFungibleTokenAllowances=new P(299);P.InvalidAllowanceOwnerId=new P(300);P.InvalidAllowanceSpenderId=new P(301);P.RepeatedAllowancesToDelete=new P(302);P.InvalidDelegatingSpender=new P(303);P.DelegatingSpenderCannotGrantApproveForAll=new P(304);P.DelegatingSpenderDoesNotHaveApproveForAll=new P(305);P.ScheduleExpirationTimeTooFarInFuture=new P(306);P.ScheduleExpirationTimeMustBeHigherThanConsensusTime=new P(307);P.ScheduleFutureThrottleExceeded=new P(308);P.ScheduleFutureGasLimitExceeded=new P(309);P.InvalidEthereumTransaction=new P(310);P.WrongChainId=new P(311);P.WrongNonce=new P(312);P.AccessListUnsupported=new P(313);P.SchedulePendingExpiration=new P(314);P.ContractIsTokenTreasury=new P(315);P.ContractHasNonZeroTokenBalances=new P(316);P.ContractExpiredAndPendingRemoval=new P(317);P.ContractHasNoAutoRenewAccount=new P(318);P.PermanentRemovalRequiresSystemInitiation=new P(319);P.ProxyAccountIdFieldIsDeprecated=new P(320);P.SelfStakingIsNotAllowed=new P(321);P.InvalidStakingId=new P(322);P.StakingNotEnabled=new P(323);P.InvalidPrngRange=new P(324);P.MaxEntitiesInPriceRegimeHaveBeenCreated=new P(325);P.InvalidFullPrefixSignatureForPrecompile=new P(326);P.InsufficientBalancesForStorageRent=new P(327);P.MaxChildRecordsExceeded=new P(328);P.InsufficientBalancesForRenewalFees=new P(329);P.TransactionHasUnknownFields=new P(330);P.AccountIsImmutable=new P(331);P.AliasAlreadyAssigned=new P(332);var Ud=Oe(Jt(),1);var f8=Oe(br(),1);var ns=class r extends nt{constructor(e){super(),this._bytes=e}static fromString(e){return new r(tt(e))}static fromBytes(e){return new r(e)}toBytes(){return this._bytes}toString(){return Ke(this._bytes)}equals(e){return IJ(this._bytes,e._bytes)}};function Z5(r,e){return function(){return r.apply(e,arguments)}}var{toString:EUe}=Object.prototype,{getPrototypeOf:UD}=Object,yE=(r=>e=>{let t=EUe.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),su=r=>(r=r.toLowerCase(),e=>yE(e)===r),vE=r=>e=>typeof e===r,{isArray:P2}=Array,X5=vE("undefined");function xUe(r){return r!==null&&!X5(r)&&r.constructor!==null&&!X5(r.constructor)&&z3(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}var sie=su("ArrayBuffer");function AUe(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&sie(r.buffer),e}var TUe=vE("string"),z3=vE("function"),cie=vE("number"),bE=r=>r!==null&&typeof r=="object",SUe=r=>r===!0||r===!1,gE=r=>{if(yE(r)!=="object")return!1;let e=UD(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},IUe=su("Date"),CUe=su("File"),kUe=su("Blob"),NUe=su("FileList"),RUe=r=>bE(r)&&z3(r.pipe),OUe=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||z3(r.append)&&((e=yE(r))==="formdata"||e==="object"&&z3(r.toString)&&r.toString()==="[object FormData]"))},DUe=su("URLSearchParams"),PUe=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function e8(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),P2(r))for(n=0,i=r.length;n<i;n++)e.call(null,r[n],n,r);else{let a=t?Object.getOwnPropertyNames(r):Object.keys(r),o=a.length,s;for(n=0;n<o;n++)s=a[n],e.call(null,r[s],s,r)}}function lie(r,e){e=e.toLowerCase();let t=Object.keys(r),n=t.length,i;for(;n-- >0;)if(i=t[n],e===i.toLowerCase())return i;return null}var uie=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,die=r=>!X5(r)&&r!==uie;function FD(){let{caseless:r}=die(this)&&this||{},e={},t=(n,i)=>{let a=r&&lie(e,i)||i;gE(e[a])&&gE(n)?e[a]=FD(e[a],n):gE(n)?e[a]=FD({},n):P2(n)?e[a]=n.slice():e[a]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&e8(arguments[n],t);return e}var BUe=(r,e,t,{allOwnKeys:n}={})=>(e8(e,(i,a)=>{t&&z3(i)?r[a]=Z5(i,t):r[a]=i},{allOwnKeys:n}),r),MUe=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),LUe=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},FUe=(r,e,t,n)=>{let i,a,o,s={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),a=i.length;a-- >0;)o=i[a],(!n||n(o,r,e))&&!s[o]&&(e[o]=r[o],s[o]=!0);r=t!==!1&&UD(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},UUe=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;let n=r.indexOf(e,t);return n!==-1&&n===t},qUe=r=>{if(!r)return null;if(P2(r))return r;let e=r.length;if(!cie(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},jUe=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&UD(Uint8Array)),VUe=(r,e)=>{let n=(r&&r[Symbol.iterator]).call(r),i;for(;(i=n.next())&&!i.done;){let a=i.value;e.call(r,a[0],a[1])}},HUe=(r,e)=>{let t,n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},KUe=su("HTMLFormElement"),zUe=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),aie=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),GUe=su("RegExp"),fie=(r,e)=>{let t=Object.getOwnPropertyDescriptors(r),n={};e8(t,(i,a)=>{let o;(o=e(i,a,r))!==!1&&(n[a]=o||i)}),Object.defineProperties(r,n)},WUe=r=>{fie(r,(e,t)=>{if(z3(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let n=r[t];if(z3(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},QUe=(r,e)=>{let t={},n=i=>{i.forEach(a=>{t[a]=!0})};return P2(r)?n(r):n(String(r).split(e)),t},$Ue=()=>{},YUe=(r,e)=>(r=+r,Number.isFinite(r)?r:e),LD="abcdefghijklmnopqrstuvwxyz",oie="0123456789",pie={DIGIT:oie,ALPHA:LD,ALPHA_DIGIT:LD+LD.toUpperCase()+oie},JUe=(r=16,e=pie.ALPHA_DIGIT)=>{let t="",{length:n}=e;for(;r--;)t+=e[Math.random()*n|0];return t};function ZUe(r){return!!(r&&z3(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}var XUe=r=>{let e=new Array(10),t=(n,i)=>{if(bE(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;let a=P2(n)?[]:{};return e8(n,(o,s)=>{let c=t(o,i+1);!X5(c)&&(a[s]=c)}),e[i]=void 0,a}}return n};return t(r,0)},eqe=su("AsyncFunction"),tqe=r=>r&&(bE(r)||z3(r))&&z3(r.then)&&z3(r.catch),be={isArray:P2,isArrayBuffer:sie,isBuffer:xUe,isFormData:OUe,isArrayBufferView:AUe,isString:TUe,isNumber:cie,isBoolean:SUe,isObject:bE,isPlainObject:gE,isUndefined:X5,isDate:IUe,isFile:CUe,isBlob:kUe,isRegExp:GUe,isFunction:z3,isStream:RUe,isURLSearchParams:DUe,isTypedArray:jUe,isFileList:NUe,forEach:e8,merge:FD,extend:BUe,trim:PUe,stripBOM:MUe,inherits:LUe,toFlatObject:FUe,kindOf:yE,kindOfTest:su,endsWith:UUe,toArray:qUe,forEachEntry:VUe,matchAll:HUe,isHTMLForm:KUe,hasOwnProperty:aie,hasOwnProp:aie,reduceDescriptors:fie,freezeMethods:WUe,toObjectSet:QUe,toCamelCase:zUe,noop:$Ue,toFiniteNumber:YUe,findKey:lie,global:uie,isContextDefined:die,ALPHABET:pie,generateString:JUe,isSpecCompliantForm:ZUe,toJSONObject:XUe,isAsyncFn:eqe,isThenable:tqe};function B2(r,e,t,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),i&&(this.response=i)}be.inherits(B2,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:be.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var hie=B2.prototype,mie={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{mie[r]={value:r}});Object.defineProperties(B2,mie);Object.defineProperty(hie,"isAxiosError",{value:!0});B2.from=(r,e,t,n,i,a)=>{let o=Object.create(hie);return be.toFlatObject(r,o,function(c){return c!==Error.prototype},s=>s!=="isAxiosError"),B2.call(o,r.message,e,t,n,i),o.cause=r,o.name=r.name,a&&Object.assign(o,a),o};var _t=B2;var Jie=Oe(Yie(),1),EE=Jie.default;function YD(r){return be.isPlainObject(r)||be.isArray(r)}function Xie(r){return be.endsWith(r,"[]")?r.slice(0,-2):r}function Zie(r,e,t){return r?r.concat(e).map(function(i,a){return i=Xie(i),!t&&a?"["+i+"]":i}).join(t?".":""):e}function Fqe(r){return be.isArray(r)&&!r.some(YD)}var Uqe=be.toFlatObject(be,{},null,function(e){return/^is[A-Z]/.test(e)});function qqe(r,e,t){if(!be.isObject(r))throw new TypeError("target must be an object");e=e||new(EE||FormData),t=be.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,E){return!be.isUndefined(E[b])});let n=t.metaTokens,i=t.visitor||u,a=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&be.isSpecCompliantForm(e);if(!be.isFunction(i))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(be.isDate(m))return m.toISOString();if(!c&&be.isBlob(m))throw new _t("Blob is not supported. Use a Buffer instead.");return be.isArrayBuffer(m)||be.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,b,E){let I=m;if(m&&!E&&typeof m=="object"){if(be.endsWith(b,"{}"))b=n?b:b.slice(0,-2),m=JSON.stringify(m);else if(be.isArray(m)&&Fqe(m)||(be.isFileList(m)||be.endsWith(b,"[]"))&&(I=be.toArray(m)))return b=Xie(b),I.forEach(function(L,U){!(be.isUndefined(L)||L===null)&&e.append(o===!0?Zie([b],U,a):o===null?b:b+"[]",l(L))}),!1}return YD(m)?!0:(e.append(Zie(E,b,a),l(m)),!1)}let d=[],h=Object.assign(Uqe,{defaultVisitor:u,convertValue:l,isVisitable:YD});function g(m,b){if(!be.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(m),be.forEach(m,function(I,R){(!(be.isUndefined(I)||I===null)&&i.call(e,I,be.isString(R)?R.trim():R,b,h))===!0&&g(I,b?b.concat(R):[R])}),d.pop()}}if(!be.isObject(r))throw new TypeError("data must be an object");return g(r),e}var bf=qqe;function eae(r){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function tae(r,e){this._pairs=[],r&&bf(r,this,e)}var rae=tae.prototype;rae.append=function(e,t){this._pairs.push([e,t])};rae.toString=function(e){let t=e?function(n){return e.call(this,n,eae)}:eae;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};var nae=tae;function jqe(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function q0(r,e,t){if(!e)return r;let n=t&&t.encode||jqe,i=t&&t.serialize,a;if(i?a=i(e,t):a=be.isURLSearchParams(e)?e.toString():new nae(e,t).toString(n),a){let o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r}var JD=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){be.forEach(this.handlers,function(n){n!==null&&e(n)})}},ZD=JD;var M2={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};import Vqe from"url";var iae=Vqe.URLSearchParams;var aae={isNode:!0,classes:{URLSearchParams:iae,FormData:EE,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var XD={};Aw(XD,{hasBrowserEnv:()=>oae,hasStandardBrowserEnv:()=>Hqe,hasStandardBrowserWebWorkerEnv:()=>Kqe});var oae=typeof window<"u"&&typeof document<"u",Hqe=(r=>oae&&["ReactNative","NativeScript","NS"].indexOf(r)<0)(typeof navigator<"u"&&navigator.product),Kqe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var ka={...XD,...aae};function eP(r,e){return bf(r,new ka.classes.URLSearchParams,Object.assign({visitor:function(t,n,i,a){return ka.isNode&&be.isBuffer(t)?(this.append(n,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function zqe(r){return be.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Gqe(r){let e={},t=Object.keys(r),n,i=t.length,a;for(n=0;n<i;n++)a=t[n],e[a]=r[a];return e}function Wqe(r){function e(t,n,i,a){let o=t[a++];if(o==="__proto__")return!0;let s=Number.isFinite(+o),c=a>=t.length;return o=!o&&be.isArray(i)?i.length:o,c?(be.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s):((!i[o]||!be.isObject(i[o]))&&(i[o]=[]),e(t,n,i[o],a)&&be.isArray(i[o])&&(i[o]=Gqe(i[o])),!s)}if(be.isFormData(r)&&be.isFunction(r.entries)){let t={};return be.forEachEntry(r,(n,i)=>{e(zqe(n),i,t,0)}),t}return null}var xE=Wqe;function Qqe(r,e,t){if(be.isString(r))try{return(e||JSON.parse)(r),be.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}var tP={transitional:M2,adapter:["xhr","http"],transformRequest:[function(e,t){let n=t.getContentType()||"",i=n.indexOf("application/json")>-1,a=be.isObject(e);if(a&&be.isHTMLForm(e)&&(e=new FormData(e)),be.isFormData(e))return i?JSON.stringify(xE(e)):e;if(be.isArrayBuffer(e)||be.isBuffer(e)||be.isStream(e)||be.isFile(e)||be.isBlob(e))return e;if(be.isArrayBufferView(e))return e.buffer;if(be.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return eP(e,this.formSerializer).toString();if((s=be.isFileList(e))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return bf(s?{"files[]":e}:e,c&&new c,this.formSerializer)}}return a||i?(t.setContentType("application/json",!1),Qqe(e)):e}],transformResponse:[function(e){let t=this.transitional||tP.transitional,n=t&&t.forcedJSONParsing,i=this.responseType==="json";if(e&&be.isString(e)&&(n&&!this.responseType||i)){let o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?_t.from(s,_t.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ka.classes.FormData,Blob:ka.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};be.forEach(["delete","get","head","post","put","patch"],r=>{tP.headers[r]={}});var L2=tP;var $qe=be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),sae=r=>{let e={},t,n,i;return r&&r.split(`
10635
10635
  `).forEach(function(o){i=o.indexOf(":"),t=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!t||e[t]&&$qe[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e};var cae=Symbol("internals");function t8(r){return r&&String(r).trim().toLowerCase()}function AE(r){return r===!1||r==null?r:be.isArray(r)?r.map(AE):String(r)}function Yqe(r){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}var Jqe=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function rP(r,e,t,n,i){if(be.isFunction(n))return n.call(this,e,t);if(i&&(e=t),!!be.isString(e)){if(be.isString(n))return e.indexOf(n)!==-1;if(be.isRegExp(n))return n.test(e)}}function Zqe(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function Xqe(r,e){let t=be.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:function(i,a,o){return this[n].call(this,e,i,a,o)},configurable:!0})})}var F2=class{constructor(e){e&&this.set(e)}set(e,t,n){let i=this;function a(s,c,l){let u=t8(c);if(!u)throw new Error("header name must be a non-empty string");let d=be.findKey(i,u);(!d||i[d]===void 0||l===!0||l===void 0&&i[d]!==!1)&&(i[d||c]=AE(s))}let o=(s,c)=>be.forEach(s,(l,u)=>a(l,u,c));return be.isPlainObject(e)||e instanceof this.constructor?o(e,t):be.isString(e)&&(e=e.trim())&&!Jqe(e)?o(sae(e),t):e!=null&&a(t,e,n),this}get(e,t){if(e=t8(e),e){let n=be.findKey(this,e);if(n){let i=this[n];if(!t)return i;if(t===!0)return Yqe(i);if(be.isFunction(t))return t.call(this,i,n);if(be.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=t8(e),e){let n=be.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||rP(this,this[n],n,t)))}return!1}delete(e,t){let n=this,i=!1;function a(o){if(o=t8(o),o){let s=be.findKey(n,o);s&&(!t||rP(n,n[s],s,t))&&(delete n[s],i=!0)}}return be.isArray(e)?e.forEach(a):a(e),i}clear(e){let t=Object.keys(this),n=t.length,i=!1;for(;n--;){let a=t[n];(!e||rP(this,this[a],a,e,!0))&&(delete this[a],i=!0)}return i}normalize(e){let t=this,n={};return be.forEach(this,(i,a)=>{let o=be.findKey(n,a);if(o){t[o]=AE(i),delete t[a];return}let s=e?Zqe(a):String(a).trim();s!==a&&delete t[a],t[s]=AE(i),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return be.forEach(this,(n,i)=>{n!=null&&n!==!1&&(t[i]=e&&be.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
10636
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[cae]=this[cae]={accessors:{}}).accessors,i=this.prototype;function a(o){let s=t8(o);n[s]||(Xqe(i,o),n[s]=!0)}return be.isArray(e)?e.forEach(a):a(e),this}};F2.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);be.reduceDescriptors(F2.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(n){this[t]=n}}});be.freezeMethods(F2);var Na=F2;function r8(r,e){let t=this||L2,n=e||t,i=Na.from(n.headers),a=n.data;return be.forEach(r,function(s){a=s.call(t,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function n8(r){return!!(r&&r.__CANCEL__)}function lae(r,e,t){_t.call(this,r??"canceled",_t.ERR_CANCELED,e,t),this.name="CanceledError"}be.inherits(lae,_t,{__CANCEL__:!0});var rl=lae;function wf(r,e,t){let n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new _t("Request failed with status code "+t.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function nP(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function iP(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function j0(r,e){return r&&!nP(e)?iP(r,e):e}var qae=Oe(dae(),1),jae=Oe(Nae(),1);import Xje from"http";import eVe from"https";import tVe from"util";import Ef from"zlib";var K0="1.6.5";function l8(r){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}var qje=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function wP(r,e,t){let n=t&&t.Blob||ka.classes.Blob,i=l8(r);if(e===void 0&&n&&(e=!0),i==="data"){r=i.length?r.slice(i.length+1):r;let a=qje.exec(r);if(!a)throw new _t("Invalid URL",_t.ERR_INVALID_URL);let o=a[1],s=a[2],c=a[3],l=Buffer.from(decodeURIComponent(c),s?"base64":"utf8");if(e){if(!n)throw new _t("Blob is not supported",_t.ERR_NOT_SUPPORT);return new n([l],{type:o})}return l}throw new _t("Unsupported protocol "+i,_t.ERR_NOT_SUPPORT)}import H2 from"stream";import Hje from"stream";function jje(r,e){let t=0,n=1e3/e,i=null;return function(o,s){let c=Date.now();if(o||c-t>n)return i&&(clearTimeout(i),i=null),t=c,r.apply(null,s);i||(i=setTimeout(()=>(i=null,t=Date.now(),r.apply(null,s)),n-(c-t)))}}var Rae=jje;function Vje(r,e){r=r||10;let t=new Array(r),n=new Array(r),i=0,a=0,o;return e=e!==void 0?e:1e3,function(c){let l=Date.now(),u=n[a];o||(o=l),t[i]=c,n[i]=l;let d=a,h=0;for(;d!==i;)h+=t[d++],d=d%r;if(i=(i+1)%r,i===a&&(a=(a+1)%r),l-o<e)return;let g=u&&l-u;return g?Math.round(h*1e3/g):void 0}}var NE=Vje;var RE=Symbol("internals"),_P=class extends Hje.Transform{constructor(e){e=be.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(s,c)=>!be.isUndefined(c[s])),super({readableHighWaterMark:e.chunkSize});let t=this,n=this[RE]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=NE(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",s=>{s==="progress"&&(n.isCaptured||(n.isCaptured=!0))});let a=0;n.updateProgress=Rae(function(){let c=n.length,l=n.bytesSeen,u=l-a;if(!u||t.destroyed)return;let d=i(u);a=l,process.nextTick(()=>{t.emit("progress",{loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:d||void 0,estimated:d&&c&&l<=c?(c-l)/d:void 0})})},n.ticksRate);let o=()=>{n.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){let t=this[RE];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){let i=this,a=this[RE],o=a.maxRate,s=this.readableHighWaterMark,c=a.timeWindow,l=1e3/c,u=o/l,d=a.minChunkSize!==!1?Math.max(a.minChunkSize,u*.01):0;function h(m,b){let E=Buffer.byteLength(m);a.bytesSeen+=E,a.bytes+=E,a.isCaptured&&a.updateProgress(),i.push(m)?process.nextTick(b):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(b)}}let g=(m,b)=>{let E=Buffer.byteLength(m),I=null,R=s,L,U=0;if(o){let V=Date.now();(!a.ts||(U=V-a.ts)>=c)&&(a.ts=V,L=u-a.bytes,a.bytes=L<0?-L:0,U=0),L=u-a.bytes}if(o){if(L<=0)return setTimeout(()=>{b(null,m)},c-U);L<R&&(R=L)}R&&E>R&&E-R>d&&(I=m.subarray(R),m=m.subarray(0,R)),h(m,I?()=>{process.nextTick(b,null,I)}:b)};g(e,function m(b,E){if(b)return n(b);E?g(E,m):n(null)})}setLength(e){return this[RE].length=+e,this}},EP=_P;import rVe from"events";import{TextEncoder as zje}from"util";import{Readable as Gje}from"stream";var{asyncIterator:Oae}=Symbol,Kje=async function*(r){r.stream?yield*r.stream():r.arrayBuffer?yield await r.arrayBuffer():r[Oae]?yield*r[Oae]():yield r},OE=Kje;var Wje=be.ALPHABET.ALPHA_DIGIT+"-_",u8=new zje,_f=`\r
10637
- `,Qje=u8.encode(_f),$je=2,xP=class{constructor(e,t){let{escapeName:n}=this.constructor,i=be.isString(t),a=`Content-Disposition: form-data; name="${n(e)}"${!i&&t.name?`; filename="${n(t.name)}"`:""}${_f}`;i?t=u8.encode(String(t).replace(/\r?\n|\r\n?/g,_f)):a+=`Content-Type: ${t.type||"application/octet-stream"}${_f}`,this.headers=u8.encode(a+_f),this.contentLength=i?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+$je,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;be.isTypedArray(e)?yield e:yield*OE(e),yield Qje}static escapeName(e){return String(e).replace(/[\r\n"]/g,t=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}},Yje=(r,e,t)=>{let{tag:n="form-data-boundary",size:i=25,boundary:a=n+"-"+be.generateString(i,Wje)}=t||{};if(!be.isFormData(r))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let o=u8.encode("--"+a+_f),s=u8.encode("--"+a+"--"+_f+_f),c=s.byteLength,l=Array.from(r.entries()).map(([d,h])=>{let g=new xP(d,h);return c+=g.size,g});c+=o.byteLength*l.length,c=be.toFiniteNumber(c);let u={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(c)&&(u["Content-Length"]=c),e&&e(u),Gje.from(async function*(){for(let d of l)yield o,yield*d.encode();yield s}())},Dae=Yje;import Jje from"stream";var AP=class extends Jje.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,t)}this.__transform(e,t,n)}},Pae=AP;var Zje=(r,e)=>be.isAsyncFn(r)?function(...t){let n=t.pop();r.apply(this,t).then(i=>{try{e?n(null,...e(i)):n(null,i)}catch(a){n(a)}},n)}:r,Bae=Zje;var Mae={flush:Ef.constants.Z_SYNC_FLUSH,finishFlush:Ef.constants.Z_SYNC_FLUSH},nVe={flush:Ef.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ef.constants.BROTLI_OPERATION_FLUSH},Lae=be.isFunction(Ef.createBrotliDecompress),{http:iVe,https:aVe}=jae.default,oVe=/https:?/,Fae=ka.protocols.map(r=>r+":");function sVe(r){r.beforeRedirects.proxy&&r.beforeRedirects.proxy(r),r.beforeRedirects.config&&r.beforeRedirects.config(r)}function Vae(r,e,t){let n=e;if(!n&&n!==!1){let i=(0,qae.getProxyForUrl)(t);i&&(n=new URL(i))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let a=Buffer.from(n.auth,"utf8").toString("base64");r.headers["Proxy-Authorization"]="Basic "+a}r.headers.host=r.hostname+(r.port?":"+r.port:"");let i=n.hostname||n.host;r.hostname=i,r.host=i,r.port=n.port,r.path=t,n.protocol&&(r.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}r.beforeRedirects.proxy=function(a){Vae(a,e,a.href)}}var cVe=typeof process<"u"&&be.kindOf(process)==="process",lVe=r=>new Promise((e,t)=>{let n,i,a=(c,l)=>{i||(i=!0,n&&n(c,l))},o=c=>{a(c),e(c)},s=c=>{a(c,!0),t(c)};r(o,s,c=>n=c).catch(s)}),uVe=({address:r,family:e})=>{if(!be.isString(r))throw TypeError("address must be a string");return{address:r,family:e||(r.indexOf(".")<0?6:4)}},Uae=(r,e)=>uVe(be.isObject(r)?r:{address:r,family:e}),Hae=cVe&&function(e){return lVe(async function(n,i,a){let{data:o,lookup:s,family:c}=e,{responseType:l,responseEncoding:u}=e,d=e.method.toUpperCase(),h,g=!1,m;if(s){let T=Bae(s,S=>be.isArray(S)?S:[S]);s=(S,_,B)=>{T(S,_,(q,k,z)=>{if(q)return B(q);let ie=be.isArray(k)?k.map(M=>Uae(M)):[Uae(k,z)];_.all?B(q,ie):B(q,ie[0].address,ie[0].family)})}}let b=new rVe,E=()=>{e.cancelToken&&e.cancelToken.unsubscribe(I),e.signal&&e.signal.removeEventListener("abort",I),b.removeAllListeners()};a((T,S)=>{h=!0,S&&(g=!0,E())});function I(T){b.emit("abort",!T||T.type?new rl(null,e,m):T)}b.once("abort",i),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(I),e.signal&&(e.signal.aborted?I():e.signal.addEventListener("abort",I)));let R=j0(e.baseURL,e.url),L=new URL(R,"http://localhost"),U=L.protocol||Fae[0];if(U==="data:"){let T;if(d!=="GET")return wf(n,i,{status:405,statusText:"method not allowed",headers:{},config:e});try{T=wP(e.url,l==="blob",{Blob:e.env&&e.env.Blob})}catch(S){throw _t.from(S,_t.ERR_BAD_REQUEST,e)}return l==="text"?(T=T.toString(u),(!u||u==="utf8")&&(T=be.stripBOM(T))):l==="stream"&&(T=H2.Readable.from(T)),wf(n,i,{data:T,status:200,statusText:"OK",headers:new Na,config:e})}if(Fae.indexOf(U)===-1)return i(new _t("Unsupported protocol "+U,_t.ERR_BAD_REQUEST,e));let V=Na.from(e.headers).normalize();V.set("User-Agent","axios/"+K0,!1);let G=e.onDownloadProgress,H=e.onUploadProgress,N=e.maxRate,F,O;if(be.isSpecCompliantForm(o)){let T=V.getContentType(/boundary=([-_\w\d]{10,70})/i);o=Dae(o,S=>{V.set(S)},{tag:`axios-${K0}-boundary`,boundary:T&&T[1]||void 0})}else if(be.isFormData(o)&&be.isFunction(o.getHeaders)){if(V.set(o.getHeaders()),!V.hasContentLength())try{let T=await tVe.promisify(o.getLength).call(o);Number.isFinite(T)&&T>=0&&V.setContentLength(T)}catch{}}else if(be.isBlob(o))o.size&&V.setContentType(o.type||"application/octet-stream"),V.setContentLength(o.size||0),o=H2.Readable.from(OE(o));else if(o&&!be.isStream(o)){if(!Buffer.isBuffer(o))if(be.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(be.isString(o))o=Buffer.from(o,"utf-8");else return i(new _t("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",_t.ERR_BAD_REQUEST,e));if(V.setContentLength(o.length,!1),e.maxBodyLength>-1&&o.length>e.maxBodyLength)return i(new _t("Request body larger than maxBodyLength limit",_t.ERR_BAD_REQUEST,e))}let y=be.toFiniteNumber(V.getContentLength());be.isArray(N)?(F=N[0],O=N[1]):F=O=N,o&&(H||F)&&(be.isStream(o)||(o=H2.Readable.from(o,{objectMode:!1})),o=H2.pipeline([o,new EP({length:y,maxRate:be.toFiniteNumber(F)})],be.noop),H&&o.on("progress",T=>{H(Object.assign(T,{upload:!0}))}));let x;if(e.auth){let T=e.auth.username||"",S=e.auth.password||"";x=T+":"+S}if(!x&&L.username){let T=L.username,S=L.password;x=T+":"+S}x&&V.delete("authorization");let w;try{w=q0(L.pathname+L.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(T){let S=new Error(T.message);return S.config=e,S.url=e.url,S.exists=!0,i(S)}V.set("Accept-Encoding","gzip, compress, deflate"+(Lae?", br":""),!1);let p={path:w,method:d,headers:V.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:x,protocol:U,family:c,beforeRedirect:sVe,beforeRedirects:{}};!be.isUndefined(s)&&(p.lookup=s),e.socketPath?p.socketPath=e.socketPath:(p.hostname=L.hostname,p.port=L.port,Vae(p,e.proxy,U+"//"+L.hostname+(L.port?":"+L.port:"")+p.path));let v,A=oVe.test(p.protocol);if(p.agent=A?e.httpsAgent:e.httpAgent,e.transport?v=e.transport:e.maxRedirects===0?v=A?eVe:Xje:(e.maxRedirects&&(p.maxRedirects=e.maxRedirects),e.beforeRedirect&&(p.beforeRedirects.config=e.beforeRedirect),v=A?aVe:iVe),e.maxBodyLength>-1?p.maxBodyLength=e.maxBodyLength:p.maxBodyLength=1/0,e.insecureHTTPParser&&(p.insecureHTTPParser=e.insecureHTTPParser),m=v.request(p,function(S){if(m.destroyed)return;let _=[S],B=+S.headers["content-length"];if(G){let M=new EP({length:be.toFiniteNumber(B),maxRate:be.toFiniteNumber(O)});G&&M.on("progress",te=>{G(Object.assign(te,{download:!0}))}),_.push(M)}let q=S,k=S.req||m;if(e.decompress!==!1&&S.headers["content-encoding"])switch((d==="HEAD"||S.statusCode===204)&&delete S.headers["content-encoding"],(S.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":_.push(Ef.createUnzip(Mae)),delete S.headers["content-encoding"];break;case"deflate":_.push(new Pae),_.push(Ef.createUnzip(Mae)),delete S.headers["content-encoding"];break;case"br":Lae&&(_.push(Ef.createBrotliDecompress(nVe)),delete S.headers["content-encoding"])}q=_.length>1?H2.pipeline(_,be.noop):_[0];let z=H2.finished(q,()=>{z(),E()}),ie={status:S.statusCode,statusText:S.statusMessage,headers:new Na(S.headers),config:e,request:k};if(l==="stream")ie.data=q,wf(n,i,ie);else{let M=[],te=0;q.on("data",function(se){M.push(se),te+=se.length,e.maxContentLength>-1&&te>e.maxContentLength&&(g=!0,q.destroy(),i(new _t("maxContentLength size of "+e.maxContentLength+" exceeded",_t.ERR_BAD_RESPONSE,e,k)))}),q.on("aborted",function(){if(g)return;let se=new _t("maxContentLength size of "+e.maxContentLength+" exceeded",_t.ERR_BAD_RESPONSE,e,k);q.destroy(se),i(se)}),q.on("error",function(se){m.destroyed||i(_t.from(se,null,e,k))}),q.on("end",function(){try{let se=M.length===1?M[0]:Buffer.concat(M);l!=="arraybuffer"&&(se=se.toString(u),(!u||u==="utf8")&&(se=be.stripBOM(se))),ie.data=se}catch(se){return i(_t.from(se,null,e,ie.request,ie))}wf(n,i,ie)})}b.once("abort",M=>{q.destroyed||(q.emit("error",M),q.destroy())})}),b.once("abort",T=>{i(T),m.destroy(T)}),m.on("error",function(S){i(_t.from(S,null,e,m))}),m.on("socket",function(S){S.setKeepAlive(!0,1e3*60)}),e.timeout){let T=parseInt(e.timeout,10);if(Number.isNaN(T)){i(new _t("error trying to parse `config.timeout` to int",_t.ERR_BAD_OPTION_VALUE,e,m));return}m.setTimeout(T,function(){if(h)return;let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",B=e.transitional||M2;e.timeoutErrorMessage&&(_=e.timeoutErrorMessage),i(new _t(_,B.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,e,m)),I()})}if(be.isStream(o)){let T=!1,S=!1;o.on("end",()=>{T=!0}),o.once("error",_=>{S=!0,m.destroy(_)}),o.on("close",()=>{!T&&!S&&I(new rl("Request stream has been aborted",e,m))}),o.pipe(m)}else m.end(o)})};var Kae=ka.hasStandardBrowserEnv?{write(r,e,t,n,i,a){let o=[r+"="+encodeURIComponent(e)];be.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),be.isString(n)&&o.push("path="+n),be.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(r){let e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var zae=ka.hasStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),n;function i(a){let o=a;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(o){let s=be.isString(o)?i(o):o;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}();function Gae(r,e){let t=0,n=NE(50,250);return i=>{let a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-t,c=n(s),l=a<=o;t=a;let u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:i};u[e?"download":"upload"]=!0,r(u)}}var dVe=typeof XMLHttpRequest<"u",Wae=dVe&&function(r){return new Promise(function(t,n){let i=r.data,a=Na.from(r.headers).normalize(),{responseType:o,withXSRFToken:s}=r,c;function l(){r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let u;if(be.isFormData(i)){if(ka.hasStandardBrowserEnv||ka.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((u=a.getContentType())!==!1){let[b,...E]=u?u.split(";").map(I=>I.trim()).filter(Boolean):[];a.setContentType([b||"multipart/form-data",...E].join("; "))}}let d=new XMLHttpRequest;if(r.auth){let b=r.auth.username||"",E=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";a.set("Authorization","Basic "+btoa(b+":"+E))}let h=j0(r.baseURL,r.url);d.open(r.method.toUpperCase(),q0(h,r.params,r.paramsSerializer),!0),d.timeout=r.timeout;function g(){if(!d)return;let b=Na.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),I={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:b,config:r,request:d};wf(function(L){t(L),l()},function(L){n(L),l()},I),d=null}if("onloadend"in d?d.onloadend=g:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(g)},d.onabort=function(){d&&(n(new _t("Request aborted",_t.ECONNABORTED,r,d)),d=null)},d.onerror=function(){n(new _t("Network Error",_t.ERR_NETWORK,r,d)),d=null},d.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",I=r.transitional||M2;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),n(new _t(E,I.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,r,d)),d=null},ka.hasStandardBrowserEnv&&(s&&be.isFunction(s)&&(s=s(r)),s||s!==!1&&zae(h))){let b=r.xsrfHeaderName&&r.xsrfCookieName&&Kae.read(r.xsrfCookieName);b&&a.set(r.xsrfHeaderName,b)}i===void 0&&a.setContentType(null),"setRequestHeader"in d&&be.forEach(a.toJSON(),function(E,I){d.setRequestHeader(I,E)}),be.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),o&&o!=="json"&&(d.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&d.addEventListener("progress",Gae(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Gae(r.onUploadProgress)),(r.cancelToken||r.signal)&&(c=b=>{d&&(n(!b||b.type?new rl(null,r,d):b),d.abort(),d=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));let m=l8(h);if(m&&ka.protocols.indexOf(m)===-1){n(new _t("Unsupported protocol "+m+":",_t.ERR_BAD_REQUEST,r));return}d.send(i||null)})};var TP={http:Hae,xhr:Wae};be.forEach(TP,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});var Qae=r=>`- ${r}`,fVe=r=>be.isFunction(r)||r===null||r===!1,DE={getAdapter:r=>{r=be.isArray(r)?r:[r];let{length:e}=r,t,n,i={};for(let a=0;a<e;a++){t=r[a];let o;if(n=t,!fVe(t)&&(n=TP[(o=String(t)).toLowerCase()],n===void 0))throw new _t(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+a]=n}if(!n){let a=Object.entries(i).map(([s,c])=>`adapter ${s} `+(c===!1?"is not supported by the environment":"is not available in the build")),o=e?a.length>1?`since :
10636
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[cae]=this[cae]={accessors:{}}).accessors,i=this.prototype;function a(o){let s=t8(o);n[s]||(Xqe(i,o),n[s]=!0)}return be.isArray(e)?e.forEach(a):a(e),this}};F2.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);be.reduceDescriptors(F2.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(n){this[t]=n}}});be.freezeMethods(F2);var Na=F2;function r8(r,e){let t=this||L2,n=e||t,i=Na.from(n.headers),a=n.data;return be.forEach(r,function(s){a=s.call(t,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function n8(r){return!!(r&&r.__CANCEL__)}function lae(r,e,t){_t.call(this,r??"canceled",_t.ERR_CANCELED,e,t),this.name="CanceledError"}be.inherits(lae,_t,{__CANCEL__:!0});var rl=lae;function wf(r,e,t){let n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new _t("Request failed with status code "+t.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function nP(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function iP(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function j0(r,e){return r&&!nP(e)?iP(r,e):e}var qae=Oe(dae(),1),jae=Oe(Nae(),1);import Xje from"http";import eVe from"https";import tVe from"util";import Ef from"zlib";var K0="1.6.7";function l8(r){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}var qje=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function wP(r,e,t){let n=t&&t.Blob||ka.classes.Blob,i=l8(r);if(e===void 0&&n&&(e=!0),i==="data"){r=i.length?r.slice(i.length+1):r;let a=qje.exec(r);if(!a)throw new _t("Invalid URL",_t.ERR_INVALID_URL);let o=a[1],s=a[2],c=a[3],l=Buffer.from(decodeURIComponent(c),s?"base64":"utf8");if(e){if(!n)throw new _t("Blob is not supported",_t.ERR_NOT_SUPPORT);return new n([l],{type:o})}return l}throw new _t("Unsupported protocol "+i,_t.ERR_NOT_SUPPORT)}import H2 from"stream";import Hje from"stream";function jje(r,e){let t=0,n=1e3/e,i=null;return function(o,s){let c=Date.now();if(o||c-t>n)return i&&(clearTimeout(i),i=null),t=c,r.apply(null,s);i||(i=setTimeout(()=>(i=null,t=Date.now(),r.apply(null,s)),n-(c-t)))}}var Rae=jje;function Vje(r,e){r=r||10;let t=new Array(r),n=new Array(r),i=0,a=0,o;return e=e!==void 0?e:1e3,function(c){let l=Date.now(),u=n[a];o||(o=l),t[i]=c,n[i]=l;let d=a,h=0;for(;d!==i;)h+=t[d++],d=d%r;if(i=(i+1)%r,i===a&&(a=(a+1)%r),l-o<e)return;let g=u&&l-u;return g?Math.round(h*1e3/g):void 0}}var NE=Vje;var RE=Symbol("internals"),_P=class extends Hje.Transform{constructor(e){e=be.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(s,c)=>!be.isUndefined(c[s])),super({readableHighWaterMark:e.chunkSize});let t=this,n=this[RE]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=NE(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",s=>{s==="progress"&&(n.isCaptured||(n.isCaptured=!0))});let a=0;n.updateProgress=Rae(function(){let c=n.length,l=n.bytesSeen,u=l-a;if(!u||t.destroyed)return;let d=i(u);a=l,process.nextTick(()=>{t.emit("progress",{loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:d||void 0,estimated:d&&c&&l<=c?(c-l)/d:void 0})})},n.ticksRate);let o=()=>{n.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){let t=this[RE];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){let i=this,a=this[RE],o=a.maxRate,s=this.readableHighWaterMark,c=a.timeWindow,l=1e3/c,u=o/l,d=a.minChunkSize!==!1?Math.max(a.minChunkSize,u*.01):0;function h(m,b){let E=Buffer.byteLength(m);a.bytesSeen+=E,a.bytes+=E,a.isCaptured&&a.updateProgress(),i.push(m)?process.nextTick(b):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(b)}}let g=(m,b)=>{let E=Buffer.byteLength(m),I=null,R=s,L,U=0;if(o){let V=Date.now();(!a.ts||(U=V-a.ts)>=c)&&(a.ts=V,L=u-a.bytes,a.bytes=L<0?-L:0,U=0),L=u-a.bytes}if(o){if(L<=0)return setTimeout(()=>{b(null,m)},c-U);L<R&&(R=L)}R&&E>R&&E-R>d&&(I=m.subarray(R),m=m.subarray(0,R)),h(m,I?()=>{process.nextTick(b,null,I)}:b)};g(e,function m(b,E){if(b)return n(b);E?g(E,m):n(null)})}setLength(e){return this[RE].length=+e,this}},EP=_P;import rVe from"events";import{TextEncoder as zje}from"util";import{Readable as Gje}from"stream";var{asyncIterator:Oae}=Symbol,Kje=async function*(r){r.stream?yield*r.stream():r.arrayBuffer?yield await r.arrayBuffer():r[Oae]?yield*r[Oae]():yield r},OE=Kje;var Wje=be.ALPHABET.ALPHA_DIGIT+"-_",u8=new zje,_f=`\r
10637
+ `,Qje=u8.encode(_f),$je=2,xP=class{constructor(e,t){let{escapeName:n}=this.constructor,i=be.isString(t),a=`Content-Disposition: form-data; name="${n(e)}"${!i&&t.name?`; filename="${n(t.name)}"`:""}${_f}`;i?t=u8.encode(String(t).replace(/\r?\n|\r\n?/g,_f)):a+=`Content-Type: ${t.type||"application/octet-stream"}${_f}`,this.headers=u8.encode(a+_f),this.contentLength=i?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+$je,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;be.isTypedArray(e)?yield e:yield*OE(e),yield Qje}static escapeName(e){return String(e).replace(/[\r\n"]/g,t=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}},Yje=(r,e,t)=>{let{tag:n="form-data-boundary",size:i=25,boundary:a=n+"-"+be.generateString(i,Wje)}=t||{};if(!be.isFormData(r))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let o=u8.encode("--"+a+_f),s=u8.encode("--"+a+"--"+_f+_f),c=s.byteLength,l=Array.from(r.entries()).map(([d,h])=>{let g=new xP(d,h);return c+=g.size,g});c+=o.byteLength*l.length,c=be.toFiniteNumber(c);let u={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(c)&&(u["Content-Length"]=c),e&&e(u),Gje.from(async function*(){for(let d of l)yield o,yield*d.encode();yield s}())},Dae=Yje;import Jje from"stream";var AP=class extends Jje.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,t)}this.__transform(e,t,n)}},Pae=AP;var Zje=(r,e)=>be.isAsyncFn(r)?function(...t){let n=t.pop();r.apply(this,t).then(i=>{try{e?n(null,...e(i)):n(null,i)}catch(a){n(a)}},n)}:r,Bae=Zje;var Mae={flush:Ef.constants.Z_SYNC_FLUSH,finishFlush:Ef.constants.Z_SYNC_FLUSH},nVe={flush:Ef.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ef.constants.BROTLI_OPERATION_FLUSH},Lae=be.isFunction(Ef.createBrotliDecompress),{http:iVe,https:aVe}=jae.default,oVe=/https:?/,Fae=ka.protocols.map(r=>r+":");function sVe(r,e){r.beforeRedirects.proxy&&r.beforeRedirects.proxy(r),r.beforeRedirects.config&&r.beforeRedirects.config(r,e)}function Vae(r,e,t){let n=e;if(!n&&n!==!1){let i=(0,qae.getProxyForUrl)(t);i&&(n=new URL(i))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let a=Buffer.from(n.auth,"utf8").toString("base64");r.headers["Proxy-Authorization"]="Basic "+a}r.headers.host=r.hostname+(r.port?":"+r.port:"");let i=n.hostname||n.host;r.hostname=i,r.host=i,r.port=n.port,r.path=t,n.protocol&&(r.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}r.beforeRedirects.proxy=function(a){Vae(a,e,a.href)}}var cVe=typeof process<"u"&&be.kindOf(process)==="process",lVe=r=>new Promise((e,t)=>{let n,i,a=(c,l)=>{i||(i=!0,n&&n(c,l))},o=c=>{a(c),e(c)},s=c=>{a(c,!0),t(c)};r(o,s,c=>n=c).catch(s)}),uVe=({address:r,family:e})=>{if(!be.isString(r))throw TypeError("address must be a string");return{address:r,family:e||(r.indexOf(".")<0?6:4)}},Uae=(r,e)=>uVe(be.isObject(r)?r:{address:r,family:e}),Hae=cVe&&function(e){return lVe(async function(n,i,a){let{data:o,lookup:s,family:c}=e,{responseType:l,responseEncoding:u}=e,d=e.method.toUpperCase(),h,g=!1,m;if(s){let T=Bae(s,S=>be.isArray(S)?S:[S]);s=(S,_,B)=>{T(S,_,(q,k,z)=>{if(q)return B(q);let ie=be.isArray(k)?k.map(M=>Uae(M)):[Uae(k,z)];_.all?B(q,ie):B(q,ie[0].address,ie[0].family)})}}let b=new rVe,E=()=>{e.cancelToken&&e.cancelToken.unsubscribe(I),e.signal&&e.signal.removeEventListener("abort",I),b.removeAllListeners()};a((T,S)=>{h=!0,S&&(g=!0,E())});function I(T){b.emit("abort",!T||T.type?new rl(null,e,m):T)}b.once("abort",i),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(I),e.signal&&(e.signal.aborted?I():e.signal.addEventListener("abort",I)));let R=j0(e.baseURL,e.url),L=new URL(R,"http://localhost"),U=L.protocol||Fae[0];if(U==="data:"){let T;if(d!=="GET")return wf(n,i,{status:405,statusText:"method not allowed",headers:{},config:e});try{T=wP(e.url,l==="blob",{Blob:e.env&&e.env.Blob})}catch(S){throw _t.from(S,_t.ERR_BAD_REQUEST,e)}return l==="text"?(T=T.toString(u),(!u||u==="utf8")&&(T=be.stripBOM(T))):l==="stream"&&(T=H2.Readable.from(T)),wf(n,i,{data:T,status:200,statusText:"OK",headers:new Na,config:e})}if(Fae.indexOf(U)===-1)return i(new _t("Unsupported protocol "+U,_t.ERR_BAD_REQUEST,e));let V=Na.from(e.headers).normalize();V.set("User-Agent","axios/"+K0,!1);let G=e.onDownloadProgress,H=e.onUploadProgress,N=e.maxRate,F,O;if(be.isSpecCompliantForm(o)){let T=V.getContentType(/boundary=([-_\w\d]{10,70})/i);o=Dae(o,S=>{V.set(S)},{tag:`axios-${K0}-boundary`,boundary:T&&T[1]||void 0})}else if(be.isFormData(o)&&be.isFunction(o.getHeaders)){if(V.set(o.getHeaders()),!V.hasContentLength())try{let T=await tVe.promisify(o.getLength).call(o);Number.isFinite(T)&&T>=0&&V.setContentLength(T)}catch{}}else if(be.isBlob(o))o.size&&V.setContentType(o.type||"application/octet-stream"),V.setContentLength(o.size||0),o=H2.Readable.from(OE(o));else if(o&&!be.isStream(o)){if(!Buffer.isBuffer(o))if(be.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(be.isString(o))o=Buffer.from(o,"utf-8");else return i(new _t("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",_t.ERR_BAD_REQUEST,e));if(V.setContentLength(o.length,!1),e.maxBodyLength>-1&&o.length>e.maxBodyLength)return i(new _t("Request body larger than maxBodyLength limit",_t.ERR_BAD_REQUEST,e))}let y=be.toFiniteNumber(V.getContentLength());be.isArray(N)?(F=N[0],O=N[1]):F=O=N,o&&(H||F)&&(be.isStream(o)||(o=H2.Readable.from(o,{objectMode:!1})),o=H2.pipeline([o,new EP({length:y,maxRate:be.toFiniteNumber(F)})],be.noop),H&&o.on("progress",T=>{H(Object.assign(T,{upload:!0}))}));let x;if(e.auth){let T=e.auth.username||"",S=e.auth.password||"";x=T+":"+S}if(!x&&L.username){let T=L.username,S=L.password;x=T+":"+S}x&&V.delete("authorization");let w;try{w=q0(L.pathname+L.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(T){let S=new Error(T.message);return S.config=e,S.url=e.url,S.exists=!0,i(S)}V.set("Accept-Encoding","gzip, compress, deflate"+(Lae?", br":""),!1);let p={path:w,method:d,headers:V.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:x,protocol:U,family:c,beforeRedirect:sVe,beforeRedirects:{}};!be.isUndefined(s)&&(p.lookup=s),e.socketPath?p.socketPath=e.socketPath:(p.hostname=L.hostname,p.port=L.port,Vae(p,e.proxy,U+"//"+L.hostname+(L.port?":"+L.port:"")+p.path));let v,A=oVe.test(p.protocol);if(p.agent=A?e.httpsAgent:e.httpAgent,e.transport?v=e.transport:e.maxRedirects===0?v=A?eVe:Xje:(e.maxRedirects&&(p.maxRedirects=e.maxRedirects),e.beforeRedirect&&(p.beforeRedirects.config=e.beforeRedirect),v=A?aVe:iVe),e.maxBodyLength>-1?p.maxBodyLength=e.maxBodyLength:p.maxBodyLength=1/0,e.insecureHTTPParser&&(p.insecureHTTPParser=e.insecureHTTPParser),m=v.request(p,function(S){if(m.destroyed)return;let _=[S],B=+S.headers["content-length"];if(G){let M=new EP({length:be.toFiniteNumber(B),maxRate:be.toFiniteNumber(O)});G&&M.on("progress",te=>{G(Object.assign(te,{download:!0}))}),_.push(M)}let q=S,k=S.req||m;if(e.decompress!==!1&&S.headers["content-encoding"])switch((d==="HEAD"||S.statusCode===204)&&delete S.headers["content-encoding"],(S.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":_.push(Ef.createUnzip(Mae)),delete S.headers["content-encoding"];break;case"deflate":_.push(new Pae),_.push(Ef.createUnzip(Mae)),delete S.headers["content-encoding"];break;case"br":Lae&&(_.push(Ef.createBrotliDecompress(nVe)),delete S.headers["content-encoding"])}q=_.length>1?H2.pipeline(_,be.noop):_[0];let z=H2.finished(q,()=>{z(),E()}),ie={status:S.statusCode,statusText:S.statusMessage,headers:new Na(S.headers),config:e,request:k};if(l==="stream")ie.data=q,wf(n,i,ie);else{let M=[],te=0;q.on("data",function(se){M.push(se),te+=se.length,e.maxContentLength>-1&&te>e.maxContentLength&&(g=!0,q.destroy(),i(new _t("maxContentLength size of "+e.maxContentLength+" exceeded",_t.ERR_BAD_RESPONSE,e,k)))}),q.on("aborted",function(){if(g)return;let se=new _t("maxContentLength size of "+e.maxContentLength+" exceeded",_t.ERR_BAD_RESPONSE,e,k);q.destroy(se),i(se)}),q.on("error",function(se){m.destroyed||i(_t.from(se,null,e,k))}),q.on("end",function(){try{let se=M.length===1?M[0]:Buffer.concat(M);l!=="arraybuffer"&&(se=se.toString(u),(!u||u==="utf8")&&(se=be.stripBOM(se))),ie.data=se}catch(se){return i(_t.from(se,null,e,ie.request,ie))}wf(n,i,ie)})}b.once("abort",M=>{q.destroyed||(q.emit("error",M),q.destroy())})}),b.once("abort",T=>{i(T),m.destroy(T)}),m.on("error",function(S){i(_t.from(S,null,e,m))}),m.on("socket",function(S){S.setKeepAlive(!0,1e3*60)}),e.timeout){let T=parseInt(e.timeout,10);if(Number.isNaN(T)){i(new _t("error trying to parse `config.timeout` to int",_t.ERR_BAD_OPTION_VALUE,e,m));return}m.setTimeout(T,function(){if(h)return;let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",B=e.transitional||M2;e.timeoutErrorMessage&&(_=e.timeoutErrorMessage),i(new _t(_,B.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,e,m)),I()})}if(be.isStream(o)){let T=!1,S=!1;o.on("end",()=>{T=!0}),o.once("error",_=>{S=!0,m.destroy(_)}),o.on("close",()=>{!T&&!S&&I(new rl("Request stream has been aborted",e,m))}),o.pipe(m)}else m.end(o)})};var Kae=ka.hasStandardBrowserEnv?{write(r,e,t,n,i,a){let o=[r+"="+encodeURIComponent(e)];be.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),be.isString(n)&&o.push("path="+n),be.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(r){let e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var zae=ka.hasStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),n;function i(a){let o=a;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(o){let s=be.isString(o)?i(o):o;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}();function Gae(r,e){let t=0,n=NE(50,250);return i=>{let a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-t,c=n(s),l=a<=o;t=a;let u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:i};u[e?"download":"upload"]=!0,r(u)}}var dVe=typeof XMLHttpRequest<"u",Wae=dVe&&function(r){return new Promise(function(t,n){let i=r.data,a=Na.from(r.headers).normalize(),{responseType:o,withXSRFToken:s}=r,c;function l(){r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let u;if(be.isFormData(i)){if(ka.hasStandardBrowserEnv||ka.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((u=a.getContentType())!==!1){let[b,...E]=u?u.split(";").map(I=>I.trim()).filter(Boolean):[];a.setContentType([b||"multipart/form-data",...E].join("; "))}}let d=new XMLHttpRequest;if(r.auth){let b=r.auth.username||"",E=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";a.set("Authorization","Basic "+btoa(b+":"+E))}let h=j0(r.baseURL,r.url);d.open(r.method.toUpperCase(),q0(h,r.params,r.paramsSerializer),!0),d.timeout=r.timeout;function g(){if(!d)return;let b=Na.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),I={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:b,config:r,request:d};wf(function(L){t(L),l()},function(L){n(L),l()},I),d=null}if("onloadend"in d?d.onloadend=g:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(g)},d.onabort=function(){d&&(n(new _t("Request aborted",_t.ECONNABORTED,r,d)),d=null)},d.onerror=function(){n(new _t("Network Error",_t.ERR_NETWORK,r,d)),d=null},d.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",I=r.transitional||M2;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),n(new _t(E,I.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,r,d)),d=null},ka.hasStandardBrowserEnv&&(s&&be.isFunction(s)&&(s=s(r)),s||s!==!1&&zae(h))){let b=r.xsrfHeaderName&&r.xsrfCookieName&&Kae.read(r.xsrfCookieName);b&&a.set(r.xsrfHeaderName,b)}i===void 0&&a.setContentType(null),"setRequestHeader"in d&&be.forEach(a.toJSON(),function(E,I){d.setRequestHeader(I,E)}),be.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),o&&o!=="json"&&(d.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&d.addEventListener("progress",Gae(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Gae(r.onUploadProgress)),(r.cancelToken||r.signal)&&(c=b=>{d&&(n(!b||b.type?new rl(null,r,d):b),d.abort(),d=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));let m=l8(h);if(m&&ka.protocols.indexOf(m)===-1){n(new _t("Unsupported protocol "+m+":",_t.ERR_BAD_REQUEST,r));return}d.send(i||null)})};var TP={http:Hae,xhr:Wae};be.forEach(TP,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});var Qae=r=>`- ${r}`,fVe=r=>be.isFunction(r)||r===null||r===!1,DE={getAdapter:r=>{r=be.isArray(r)?r:[r];let{length:e}=r,t,n,i={};for(let a=0;a<e;a++){t=r[a];let o;if(n=t,!fVe(t)&&(n=TP[(o=String(t)).toLowerCase()],n===void 0))throw new _t(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+a]=n}if(!n){let a=Object.entries(i).map(([s,c])=>`adapter ${s} `+(c===!1?"is not supported by the environment":"is not available in the build")),o=e?a.length>1?`since :
10638
10638
  `+a.map(Qae).join(`
10639
- `):" "+Qae(a[0]):"as no adapter specified";throw new _t("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:TP};function SP(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new rl(null,r)}function PE(r){return SP(r),r.headers=Na.from(r.headers),r.data=r8.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),DE.getAdapter(r.adapter||L2.adapter)(r).then(function(n){return SP(r),n.data=r8.call(r,r.transformResponse,n),n.headers=Na.from(n.headers),n},function(n){return n8(n)||(SP(r),n&&n.response&&(n.response.data=r8.call(r,r.transformResponse,n.response),n.response.headers=Na.from(n.response.headers))),Promise.reject(n)})}var $ae=r=>r instanceof Na?r.toJSON():r;function Fd(r,e){e=e||{};let t={};function n(l,u,d){return be.isPlainObject(l)&&be.isPlainObject(u)?be.merge.call({caseless:d},l,u):be.isPlainObject(u)?be.merge({},u):be.isArray(u)?u.slice():u}function i(l,u,d){if(be.isUndefined(u)){if(!be.isUndefined(l))return n(void 0,l,d)}else return n(l,u,d)}function a(l,u){if(!be.isUndefined(u))return n(void 0,u)}function o(l,u){if(be.isUndefined(u)){if(!be.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function s(l,u,d){if(d in e)return n(l,u);if(d in r)return n(void 0,l)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(l,u)=>i($ae(l),$ae(u),!0)};return be.forEach(Object.keys(Object.assign({},r,e)),function(u){let d=c[u]||i,h=d(r[u],e[u],u);be.isUndefined(h)&&d!==s||(t[u]=h)}),t}var IP={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{IP[r]=function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r}});var Yae={};IP.transitional=function(e,t,n){function i(a,o){return"[Axios v"+K0+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,s)=>{if(e===!1)throw new _t(i(o," has been removed"+(t?" in "+t:"")),_t.ERR_DEPRECATED);return t&&!Yae[o]&&(Yae[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,o,s):!0}};function pVe(r,e,t){if(typeof r!="object")throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),i=n.length;for(;i-- >0;){let a=n[i],o=e[a];if(o){let s=r[a],c=s===void 0||o(s,a,r);if(c!==!0)throw new _t("option "+a+" must be "+c,_t.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new _t("Unknown option "+a,_t.ERR_BAD_OPTION)}}var BE={assertOptions:pVe,validators:IP};var xf=BE.validators,K2=class{constructor(e){this.defaults=e,this.interceptors={request:new ZD,response:new ZD}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Fd(this.defaults,t);let{transitional:n,paramsSerializer:i,headers:a}=t;n!==void 0&&BE.assertOptions(n,{silentJSONParsing:xf.transitional(xf.boolean),forcedJSONParsing:xf.transitional(xf.boolean),clarifyTimeoutError:xf.transitional(xf.boolean)},!1),i!=null&&(be.isFunction(i)?t.paramsSerializer={serialize:i}:BE.assertOptions(i,{encode:xf.function,serialize:xf.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&be.merge(a.common,a[t.method]);a&&be.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),t.headers=Na.concat(o,a);let s=[],c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(t)===!1||(c=c&&b.synchronous,s.unshift(b.fulfilled,b.rejected))});let l=[];this.interceptors.response.forEach(function(b){l.push(b.fulfilled,b.rejected)});let u,d=0,h;if(!c){let m=[PE.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,l),h=m.length,u=Promise.resolve(t);d<h;)u=u.then(m[d++],m[d++]);return u}h=s.length;let g=t;for(d=0;d<h;){let m=s[d++],b=s[d++];try{g=m(g)}catch(E){b.call(this,E);break}}try{u=PE.call(this,g)}catch(m){return Promise.reject(m)}for(d=0,h=l.length;d<h;)u=u.then(l[d++],l[d++]);return u}getUri(e){e=Fd(this.defaults,e);let t=j0(e.baseURL,e.url);return q0(t,e.params,e.paramsSerializer)}};be.forEach(["delete","get","head","options"],function(e){K2.prototype[e]=function(t,n){return this.request(Fd(n||{},{method:e,url:t,data:(n||{}).data}))}});be.forEach(["post","put","patch"],function(e){function t(n){return function(a,o,s){return this.request(Fd(s||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}K2.prototype[e]=t(),K2.prototype[e+"Form"]=t(!0)});var d8=K2;var CP=class r{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(a){t=a});let n=this;this.promise.then(i=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a,o=new Promise(s=>{n.subscribe(s),a=s}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},e(function(a,o,s){n.reason||(n.reason=new rl(a,o,s),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new r(function(i){e=i}),cancel:e}}},Jae=CP;function kP(r){return function(t){return r.apply(null,t)}}function NP(r){return be.isObject(r)&&r.isAxiosError===!0}var RP={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(RP).forEach(([r,e])=>{RP[e]=r});var Zae=RP;function Xae(r){let e=new d8(r),t=Z5(d8.prototype.request,e);return be.extend(t,d8.prototype,e,{allOwnKeys:!0}),be.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return Xae(Fd(r,i))},t}var va=Xae(L2);va.Axios=d8;va.CanceledError=rl;va.CancelToken=Jae;va.isCancel=n8;va.VERSION=K0;va.toFormData=bf;va.AxiosError=_t;va.Cancel=va.CanceledError;va.all=function(e){return Promise.all(e)};va.spread=kP;va.isAxiosError=NP;va.mergeConfig=Fd;va.AxiosHeaders=Na;va.formToJSON=r=>xE(be.isHTMLForm(r)?new FormData(r):r);va.getAdapter=DE.getAdapter;va.HttpStatusCode=Zae;va.default=va;var z0=va;var{Axios:IGt,AxiosError:CGt,CanceledError:kGt,isCancel:NGt,CancelToken:RGt,VERSION:OGt,all:DGt,Cancel:PGt,isAxiosError:BGt,spread:MGt,toFormData:LGt,AxiosHeaders:FGt,HttpStatusCode:UGt,formToJSON:qGt,getAdapter:jGt,mergeConfig:VGt}=z0;var ne=class r{constructor(e,t,n,i,a){let o=j3(e,t,n);this.shard=o.shard,this.realm=o.realm,this.num=o.num,this.aliasKey=i??null,this.evmAddress=a??null,this._checksum=null}static fromString(e){let t=Ud.default.ZERO,n=Ud.default.ZERO,i=Ud.default.ZERO,a,o;if(e.startsWith("0x")&&e.length==42||e.length==40)o=ns.fromString(e);else{let s=J5(e);if(Number.isNaN(s.shard)||Number.isNaN(s.realm))throw new Error("invalid format for entity ID");s.shard!=null&&(t=Ud.default.fromString(s.shard)),s.realm!=null&&(n=Ud.default.fromString(s.realm)),s.numOrHex.length<20?i=Ud.default.fromString(s.numOrHex):s.numOrHex.length==40?o=ns.fromString(s.numOrHex):a=ei.fromString(s.numOrHex)}return new r(t,n,i,a,o)}static fromEvmAddress(e,t,n){let i=typeof n=="string"?ns.fromString(n):n;return Gh(i.toBytes())?this.fromSolidityAddress(i.toString()):new r(e,t,0,void 0,i)}static fromEvmPublicAddress(e){return new r(0,0,0,void 0,e)}static _fromProtobuf(e){let t,n;return e.alias!=null&&(e.alias.length===20?n=ns.fromBytes(e.alias):t=nt._fromProtobufKey(f8.proto.Key.decode(e.alias))),t instanceof ei||(t=void 0),new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.accountNum!=null?e.accountNum:0,t,n)}get checksum(){return this._checksum}getEvmAddress(){return this.evmAddress}async populateAccountNum(e){if(this.evmAddress===null)throw new Error("field `evmAddress` should not be null");let t=e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"));await new Promise(a=>{setTimeout(a,3e3)});let n=`https://${t}/api/v1/accounts/${this.evmAddress.toString()}`,i=(await z0.get(n)).data.account;return this.num=Ud.default.fromString(i.slice(i.lastIndexOf(".")+1)),this}async populateAccountEvmAddress(e){if(this.num===null)throw new Error("field `num` should not be null");let t=e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"));await new Promise(a=>{setTimeout(a,3e3)});let n=`https://${t}/api/v1/accounts/${this.num.toString()}`,i=(await z0.get(n)).data.evm_address;return this.evmAddress=ns.fromString(i),this}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){if(this.aliasKey!=null)throw new Error("cannot calculate checksum with an account ID that has a aliasKey");H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(f8.proto.AccountID.decode(e))}static fromSolidityAddress(e){return Gh(tt(e))?new r(...r3(e)):this.fromEvmAddress(0,0,e)}toSolidityAddress(){return this.evmAddress!=null?this.evmAddress.toString():this.aliasKey!=null&&this.aliasKey._key._type=="secp256k1"?this.aliasKey.toEvmAddress():V3([this.shard,this.realm,this.num])}_toProtobuf(){let e=null;return this.aliasKey!=null?e=f8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():this.evmAddress!=null&&(e=this.evmAddress._bytes),{alias:e,accountNum:this.aliasKey!=null?null:this.num,shardNum:this.shard,realmNum:this.realm}}toBytes(){return f8.proto.AccountID.encode(this._toProtobuf()).finish()}toString(){let e=this.num.toString();return this.aliasKey!=null?e=this.aliasKey.toString():this.evmAddress!=null&&(e=this.evmAddress.toString()),`${this.shard.toString()}.${this.realm.toString()}.${e}`}toStringWithChecksum(e){if(this.aliasKey!=null)throw new Error("cannot calculate checksum with an account ID that has a aliasKey");return K3(this.toString(),e)}equals(e){let t=!1;return this.aliasKey!=null&&e.aliasKey!=null?t=this.aliasKey.equals(e.aliasKey):this.evmAddress!=null&&e.evmAddress!=null?t=this.evmAddress.equals(e.evmAddress):this.aliasKey==null&&e.aliasKey==null&&this.evmAddress==null&&e.evmAddress==null&&(t=this.num.eq(e.num)),this.shard.eq(e.shard)&&this.realm.eq(e.realm)&&t}clone(){let e=new r(this);return e._checksum=this._checksum,e.aliasKey=this.aliasKey,e.evmAddress=this.evmAddress,e}compare(e){let t=this.shard.compare(e.shard);if(t!=0||(t=this.realm.compare(e.realm),t!=0))return t;if(this.aliasKey!=null&&e.aliasKey!=null){let n=this.aliasKey.toString(),i=e.aliasKey.toString();return n>i?1:n<i?-1:0}else if(this.evmAddress!=null&&e.evmAddress!=null){let n=this.evmAddress.toString(),i=e.evmAddress.toString();return n>i?1:n<i?-1:0}else return this.aliasKey==null&&e.aliasKey==null&&this.evmAddress==null&&e.evmAddress==null?this.num.compare(e.num):1}};ar.setAccountIdConstructor((r,e,t)=>new ne(r,e,Ud.default.ZERO,t));var er=class r{constructor(e){this._code=e,Object.freeze(this)}static _fromValue(e){switch(e){case 0:return r.Ok;case 1:return r.Cancelled;case 2:return r.Unknown;case 3:return r.InvalidArgument;case 4:return r.DeadlineExceeded;case 5:return r.NotFound;case 6:return r.AlreadyExists;case 7:return r.PermissionDenied;case 8:return r.ResourceExhausted;case 9:return r.FailedPrecondition;case 10:return r.Aborted;case 11:return r.OutOfRange;case 12:return r.Unimplemented;case 13:return r.Internal;case 14:return r.Unavailable;case 15:return r.DataLoss;case 16:return r.Unauthenticated;case 17:return r.Timeout;case 18:return r.GrpcWeb;default:throw new Error("(BUG) non-exhaustive GrpcStatus switch statement")}}toString(){switch(this){case r.Ok:return"OK";case r.Cancelled:return"CANCELLED";case r.Unknown:return"UNKNOWN";case r.InvalidArgument:return"INVALID_ARGUMENT";case r.DeadlineExceeded:return"DEADLINE_EXCEEDED";case r.NotFound:return"NOT_FOUND";case r.AlreadyExists:return"ALREADY_EXISTS";case r.PermissionDenied:return"PERMISSION_DENIED";case r.Unauthenticated:return"UNAUTHENTICATED";case r.ResourceExhausted:return"RESOURCE_EXHAUSTED";case r.FailedPrecondition:return"FAILED_PRECONDITION";case r.Aborted:return"ABORTED";case r.OutOfRange:return"OUT_OF_RANGE";case r.Unimplemented:return"UNIMPLEMENTED";case r.Internal:return"INTERNAL";case r.Unavailable:return"UNAVAILABLE";case r.DataLoss:return"DATA_LOSS";case r.Timeout:return"TIMEOUT";case r.GrpcWeb:return"GRPC_WEB";default:return`UNKNOWN (${this._code})`}}valueOf(){return this._code}};er.Ok=new er(0);er.Cancelled=new er(1);er.Unknown=new er(2);er.InvalidArgument=new er(3);er.DeadlineExceeded=new er(4);er.NotFound=new er(5);er.AlreadyExists=new er(6);er.PermissionDenied=new er(7);er.ResourceExhausted=new er(8);er.FailedPrecondition=new er(9);er.Aborted=new er(10);er.OutOfRange=new er(11);er.Unimplemented=new er(12);er.Internal=new er(13);er.Unavailable=new er(14);er.DataLoss=new er(15);er.Unauthenticated=new er(16);er.Timeout=new er(17);er.GrpcWeb=new er(18);var qd=class r extends Error{constructor(e){super(`gRPC service failed with status: ${e.toString()}`),this.status=e,this.name="GrpcServiceError",typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}static _fromResponse(e){if(e.code!=null&&e.details!=null){let t=er._fromValue(e.code),n=new r(t);return n.message=e.details,n}else return e}};var nl=class r{constructor(){this.list=[],this.locked=!1,this.index=0}setList(e){if(this.locked)throw new Error("list is locked");return this.list=e,this.index=0,this}push(...e){if(this.locked)throw new Error("list is locked");return this.list.push(...e),this}setLocked(){return this.locked=!0,this}clear(){this.list=[],this.index=0}get(e){return this.list[e]}set(e,t){return e===this.length?this.list.push(t):this.list[e]=t,this}setIfAbsent(e,t){return(e==this.length||this.list[e]==null)&&this.set(e,t()),this}get next(){return this.get(this.advance())}get current(){return this.get(this.index)}advance(){let e=this.index;return this.index=(this.index+1)%this.list.length,e}get isEmpty(){return this.length===0}get length(){return this.list.length}clone(){let e=new r;return e.list=this.list,e.locked=this.locked,e}};var p8=class r extends Error{constructor(e){super(`failed with error code: ${e.toString()}`),this.status=e,this.name="HttpError",typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}};var Bn={Finished:"Finished",Retry:"Retry",Error:"Error"},ME=/\brst[^0-9a-zA-Z]stream\b/i,cu=class{constructor(){this._maxAttempts=10,this._nodeAccountIds=new nl,this._signOnDemand=!1,this._minBackoff=null,this._maxBackoff=8e3,this._operator=null,this._requestTimeout=null,this._grpcDeadline=null,this._logger=null}get nodeAccountIds(){return this._nodeAccountIds.isEmpty?null:(this._nodeAccountIds.setLocked(),this._nodeAccountIds.list)}setNodeAccountIds(e){return this._nodeAccountIds.setList(e).setLocked(),this}get maxRetries(){return console.warn("Deprecated: use maxAttempts instead"),this.maxAttempts}setMaxRetries(e){return console.warn("Deprecated: use setMaxAttempts() instead"),this.setMaxAttempts(e)}get maxAttempts(){return this._maxAttempts}setMaxAttempts(e){return this._maxAttempts=e,this}get grpcDeadline(){return this._grpcDeadline}setGrpcDeadline(e){return this._grpcDeadline=e,this}setMinBackoff(e){if(e==null)throw new Error("minBackoff cannot be null.");if(this._maxBackoff!=null&&e>this._maxBackoff)throw new Error("minBackoff cannot be larger than maxBackoff.");return this._minBackoff=e,this}get minBackoff(){return this._minBackoff}setMaxBackoff(e){if(e==null)throw new Error("maxBackoff cannot be null.");if(this._minBackoff!=null&&e<this._minBackoff)throw new Error("maxBackoff cannot be smaller than minBackoff.");return this._maxBackoff=e,this}get maxBackoff(){return this._maxBackoff}_beforeExecute(e){throw new Error("not implemented")}_makeRequestAsync(){throw new Error("not implemented")}_mapStatusError(e,t){throw new Error("not implemented")}_mapResponse(e,t,n){throw new Error("not implemented")}_execute(e,t){throw new Error("not implemented")}_getTransactionId(){throw new Error("not implemented")}_getLogId(){throw new Error("not implemented")}_requestToBytes(e){throw new Error("not implemented")}_responseToBytes(e){throw new Error("not implemented")}_advanceRequest(){this._nodeAccountIds.advance()}_shouldRetry(e,t){throw new Error("not implemented")}_shouldRetryExceptionally(e){return e instanceof qd?e.status._code===er.Timeout._code||e.status._code===er.Unavailable._code||e.status._code===er.ResourceExhausted._code||e.status._code===er.GrpcWeb._code||e.status._code===er.Internal._code&&ME.test(e.message):!0}_setOperatorWith(e,t,n){return this._operator={transactionSigner:n,accountId:e,publicKey:t},this}async executeWithSigner(e){return e.call(this)}async execute(e,t){this._logger=this._logger==null?e._logger!=null?e._logger:null:this._logger,this._requestTimeout==null&&(this._requestTimeout=t??e.requestTimeout),await this._beforeExecute(e),this._maxBackoff==null&&(this._maxBackoff=e.maxBackoff),this._minBackoff==null&&(this._minBackoff=e.minBackoff);let n=e._maxAttempts!=null?e._maxAttempts:this._maxAttempts,i=Date.now(),a=null;for(let o=1;o<=n;o+=1){if(this._requestTimeout!=null&&i+this._requestTimeout<=Date.now())throw new Error("timeout exceeded");let s,c;if(this._nodeAccountIds.locked?(s=this._nodeAccountIds.current,c=e._network.getNode(s)):(c=e._network.getNode(),s=c.accountId,this._nodeAccountIds.setList([s])),c==null)throw new Error(`NodeAccountId not recognized: ${s.toString()}`);let l=this._getLogId();this._logger&&this._logger.debug(`[${l}] Node AccountID: ${c.accountId.toString()}, IP: ${c.address.toString()}`);let u=c.getChannel(),d=await this._makeRequestAsync();this._advanceRequest();let h;if(!c.isHealthy()){this._logger&&this._logger.debug(`[${l}] node is not healthy, skipping waiting ${c.getRemainingTime()}`);continue}try{let b=[];this._grpcDeadline!=null&&b.push(new Promise((E,I)=>setTimeout(()=>I(new Error("grpc deadline exceeded")),this._grpcDeadline))),this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${Ke(this._requestToBytes(d))}`),b.push(this._execute(u,d)),h=await Promise.race(b)}catch(b){let E=qd._fromResponse(b);if(a=E,this._logger&&this._logger.debug(`[${l}] received error ${JSON.stringify(E)}`),(E instanceof qd||E instanceof p8)&&this._shouldRetryExceptionally(E)&&o<=n){this._logger&&this._logger.debug(`[${this._getLogId()}] node with accountId: ${c.accountId.toString()} and proxy IP: ${c.address.toString()} is unhealthy`),e._network.increaseBackoff(c);continue}throw b}this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${Ke(this._responseToBytes(h))}`),e._network.decreaseBackoff(c);let[g,m]=this._shouldRetry(d,h);switch(g!=null&&(a=g),m){case Bn.Retry:await hVe(o,this._minBackoff,this._maxBackoff);continue;case Bn.Finished:return this._mapResponse(h,s,d);case Bn.Error:throw this._mapStatusError(d,h);default:throw new Error("(BUG) non-exhuastive switch statement for `ExecutionState`")}}throw new Error(`max attempts of ${n.toString()} was reached for request with last error being: ${a!=null?a.toString():""}`)}toBytes(){throw new Error("not implemented")}setLogger(e){return this._logger=e,this}get logger(){return this._logger}};function hVe(r,e,t){let n=Math.min(Math.floor(e*Math.pow(2,r)),t);return new Promise(i=>setTimeout(i,n))}var lu=Oe(Jt(),1);var eoe=lu.default.fromNumber(1e9),toe=new Set,ut=class r{constructor(e,t){this.seconds=e instanceof lu.default?e:lu.default.fromNumber(e),this.nanos=t instanceof lu.default?t:lu.default.fromNumber(t),Object.freeze(this)}static generate(){let e=Math.floor(Math.random()*5e3)+8e3,t=Date.now()-e,n=Math.floor(t/1e3)+ar.timeDrift,i=Math.floor(t%1e3)*1e6+Math.floor(Math.random()*1e6),a=new r(n,i);return toe.has(a.toString())?this.generate():(toe.add(a.toString()),a)}static fromDate(e){let t;if(typeof e=="number")t=lu.default.fromNumber(e);else if(typeof e=="string")t=lu.default.fromNumber(Date.parse(e)).mul(1e6);else if(e instanceof Date)t=lu.default.fromNumber(e.getTime()).mul(1e6);else throw new TypeError(`invalid type '${typeof e}' for 'data', expected 'Date'`);return new r(0,0).plusNanos(t)}toDate(){return new Date(this.seconds.toInt()*1e3+Math.floor(this.nanos.toInt()/1e6))}plusNanos(e){let t=this.nanos.add(e);return new r(this.seconds.add(t.div(eoe)),t.mod(eoe))}_toProtobuf(){return{seconds:this.seconds,nanos:this.nanos.toInt()}}static _fromProtobuf(e){return new r(e.seconds instanceof lu.default?e.seconds.toInt():e.seconds!=null?e.seconds:0,e.nanos!=null?e.nanos:0)}toString(){let e=String(this.nanos).padStart(9,"0");return`${this.seconds.toString()}.${e}`}compare(e){let t=this.seconds.compare(e.seconds);return t!=0?t:this.nanos.compare(e.nanos)}};var OP=Oe(br(),1),h8=Oe(Jt(),1);var Qr=class r{constructor(e,t,n=!1,i=null){this.accountId=e,this.validStart=t,this.scheduled=n,this.nonce=null,i!=null&&i!=0&&this.setNonce(i),Object.seal(this)}setNonce(e){return this.nonce=typeof e=="number"?h8.default.fromNumber(e):e,this}static withValidStart(e,t){return new r(e,t)}static generate(e){return new r(typeof e=="string"?ne.fromString(e):new ne(e),ut.generate())}static fromString(e){let t,n,i,a,o,s;return[t,s]=e.split("@"),[n,s]=s.split("."),s.includes("?")?([i,s]=s.split("?scheduled"),a=!0,s.includes("/")?o=s.replace("/",""):o=null):s.includes("/")?([i,o]=s.split("/"),a=!1):i=s,new r(ne.fromString(t),new ut(h8.default.fromValue(n),h8.default.fromValue(i)),a,o!=null?h8.default.fromString(o):null)}setScheduled(e){return this.scheduled=e,this}toString(){if(this.accountId!=null&&this.validStart!=null){let e=String(this.validStart.nanos).padStart(9,"0"),t=this.nonce!=null?"/".concat(this.nonce.toString()):"",n=this.scheduled?"?scheduled":"";return`${this.accountId.toString()}@${this.validStart.seconds.toString()}.${e}${n}${t}`}else throw new Error("neither `accountId` nor `validStart` are set")}static _fromProtobuf(e){if(e.accountID!=null&&e.transactionValidStart!=null)return new r(ne._fromProtobuf(e.accountID),ut._fromProtobuf(e.transactionValidStart),e.scheduled!=null?e.scheduled:void 0,e.nonce!=null?e.nonce:void 0);throw new Error("Neither `nonce` or `accountID` and `transactionValidStart` are set")}_toProtobuf(){return{accountID:this.accountId!=null?this.accountId._toProtobuf():null,transactionValidStart:this.validStart!=null?this.validStart._toProtobuf():null,scheduled:this.scheduled,nonce:this.nonce!=null?this.nonce.toInt():null}}static fromBytes(e){return r._fromProtobuf(OP.proto.TransactionID.decode(e))}toBytes(){return OP.proto.TransactionID.encode(this._toProtobuf()).finish()}clone(){return new r(this.accountId,this.validStart,this.scheduled,this.nonce)}compare(e){let t=this.accountId.compare(e.accountId);return t!=0?t:this.validStart.compare(e.validStart)}getReceipt(e){return ar.transactionReceiptQueryConstructor().setTransactionId(this).execute(e)}async getRecord(e){return await this.getReceipt(e),ar.transactionRecordQueryConstructor().setTransactionId(this).execute(e)}};var W3=Oe(br(),1);var is=class extends ou{constructor(e){super(e,`transaction ${e.transactionId.toString()} failed precheck with status ${e.status.toString()}`),this.contractFunctionResult=e.contractFunctionResult}toJSON(){return{name:this.name,status:this.status.toString(),transactionId:this.transactionId.toString(),message:this.message,contractFunctionResult:this.contractFunctionResult}}};var z2=class extends Error{constructor(e,t){super(),this.message=`query cost of ${e.toString()} HBAR exceeds max set on client: ${t.toString()} HBAR`,this.name="MaxQueryPaymentExceededError",this.queryCost=e,this.maxQueryPayment=t}};var roe=Oe(Jt(),1),$r=new Map,Ar=class extends cu{constructor(){super(),this._paymentTransactionId=null,this._paymentTransactions=[],this._queryPayment=null,this._maxQueryPayment=null,this._timestamp=Date.now()}static fromBytes(e){let t=W3.proto.Query.decode(e);if(t.query==null)throw new Error("(BUG) query.query was not set in the protobuf");let n=$r.get(t.query);if(n==null)throw new Error(`(BUG) Query.fromBytes() not implemented for type ${t.query}`);return n(t)}toBytes(){return W3.proto.Query.encode(this._makeRequest()).finish()}setQueryPayment(e){return this._queryPayment=e,this}setMaxQueryPayment(e){return this._maxQueryPayment=e,this}async getCost(e){if(this._nodeAccountIds.isEmpty&&this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute()),FE.length!=1)throw new Error("CostQuery has not been loaded yet");this._timestamp=Date.now();let t=await FE[0](this).execute(e);return Ge.fromTinybars(t._valueInTinybar.multipliedBy(1.1).toFixed(0))}setPaymentTransactionId(e){return this._paymentTransactionId=e,this}get paymentTransactionId(){return this._paymentTransactionId}_getTransactionId(){if(this._paymentTransactionId==null)throw new Error("Query.PaymentTransactionId was not set duration execution");return this._paymentTransactionId}_isPaymentRequired(){return!0}_validateChecksums(e){}async _beforeExecute(e){if(this._paymentTransactions.length>0)return;if(e.isAutoValidateChecksumsEnabled()&&this._validateChecksums(e),this._nodeAccountIds.isEmpty&&this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute()),this._operator=this._operator!=null?this._operator:e._operator,this._paymentTransactionId==null)if(this._isPaymentRequired())if(this._operator!=null)this._paymentTransactionId=Qr.generate(this._operator.accountId);else throw new Error("`client` must have an `operator` or an explicit payment transaction must be provided");else this._paymentTransactionId=Qr.generate(new ne(0));let t=new Ge(0),n=this._maxQueryPayment!=null?this._maxQueryPayment:e.defaultMaxQueryPayment;if(this._queryPayment!=null)t=this._queryPayment;else if(this._paymentTransactions.length===0&&this._isPaymentRequired()){let i=await this.getCost(e);if(n.toTinybars().toInt()<i.toTinybars().toInt())throw new z2(i,n);t=i,this._logger&&this._logger.debug(`[${this._getLogId()}] received cost for query ${t.toString()}`)}this._queryPayment=t,this._timestamp=Date.now(),this._nodeAccountIds.setLocked();for(let i of this._nodeAccountIds.list){let a=this._getLogId(),o=this._paymentTransactionId,s=this._queryPayment;this._logger&&this._logger.debug(`[${a}] making a payment transaction for node ${i.toString()} and transaction ID ${o.toString()} with amount ${s.toString()}`),this._paymentTransactions.push(await LE(o,i,this._isPaymentRequired()?this._operator:null,s))}}_mapResponseHeader(e){throw new Error("not implemented")}_makeRequestHeader(){let e={};return this._isPaymentRequired()&&this._paymentTransactions.length>0&&(e={responseType:W3.proto.ResponseType.ANSWER_ONLY,payment:this._paymentTransactions[this._nodeAccountIds.index]}),e}_onMakeRequest(e){throw new Error("not implemented")}_makeRequest(){let e={};return this._isPaymentRequired()&&this._paymentTransactions!=null&&(e={payment:this._paymentTransactions[this._nodeAccountIds.index],responseType:W3.proto.ResponseType.ANSWER_ONLY}),this._onMakeRequest(e)}async _makeRequestAsync(){let e={responseType:W3.proto.ResponseType.ANSWER_ONLY};if(this._isPaymentRequired()&&this._paymentTransactions!=null)if(this._nodeAccountIds.locked)e.payment=this._paymentTransactions[this._nodeAccountIds.index];else{let t=this._getLogId(),n=this._nodeAccountIds.current,i=this._paymentTransactionId,a=this._queryPayment;this._logger&&this._logger.debug(`[${t}] making a payment transaction for node ${n.toString()} and transaction ID ${i.toString()} with amount ${a.toString()}`),e.payment=await LE(i,n,this._isPaymentRequired()?this._operator:null,a)}return this._onMakeRequest(e)}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??W3.proto.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.PlatformTransactionNotCreated:return[i,Bn.Retry];case P.Ok:return[i,Bn.Finished];default:return[i,Bn.Error]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??W3.proto.ResponseCodeEnum.OK);return new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}_requestToBytes(e){return W3.proto.Query.encode(e).finish()}_responseToBytes(e){return W3.proto.Response.encode(e).finish()}};async function LE(r,e,t,n){let i=[];t!=null?(i.push({accountID:t.accountId._toProtobuf(),amount:n.negated().toTinybars()}),i.push({accountID:e._toProtobuf(),amount:n.toTinybars()})):(i.push({accountID:new ne(0)._toProtobuf(),amount:n.negated().toTinybars()}),i.push({accountID:e._toProtobuf(),amount:n.toTinybars()}));let a={transactionID:r._toProtobuf(),nodeAccountID:e._toProtobuf(),transactionFee:new Ge(1).toTinybars(),transactionValidDuration:{seconds:roe.default.fromNumber(120)},cryptoTransfer:{transfers:{accountAmounts:i}}},o={bodyBytes:W3.proto.TransactionBody.encode(a).finish()};if(t!=null){let s=await t.transactionSigner(o.bodyBytes);o.sigMap={sigPair:[t.publicKey._toProtobufSignature(s)]}}return{signedTransactionBytes:W3.proto.SignedTransaction.encode(o).finish()}}var FE=[];var DP=Oe(br(),1);var Af=Oe(Jt(),1);var Et=class r extends nt{constructor(e,t,n,i){super();let a=j3(e,t,n);this.shard=a.shard,this.realm=a.realm,this.num=a.num,this.evmAddress=i??null,this._checksum=null}static fromEvmAddress(e,t,n){return Gh(tt(n))?new r(...r3(n)):new r(e,t,0,tt(n))}static fromString(e){let t=J5(e);if(Number.isNaN(t.shard)||Number.isNaN(t.realm))throw new Error("invalid format for entity ID");let n=t.shard!=null?Af.default.fromString(t.shard):Af.default.ZERO,i=t.realm!=null?Af.default.fromString(t.realm):Af.default.ZERO,[a,o]=t.numOrHex.length<40?[Af.default.fromString(t.numOrHex),void 0]:[Af.default.ZERO,tt(t.numOrHex)];return new r(n,i,a,o)}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.contractNum!=null?e.contractNum:0)}get checksum(){return this._checksum}async populateAccountNum(e){if(this.evmAddress===null)throw new Error("field `evmAddress` should not be null");let n=`https://${e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"))}/api/v1/contracts/${Ke(this.evmAddress)}`,i=(await z0.get(n)).data.contract_id;return this.num=Af.default.fromString(i.slice(i.lastIndexOf(".")+1)),this}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(DP.proto.ContractID.decode(e))}static fromSolidityAddress(e){return Gh(tt(e))?new r(...r3(e)):this.fromEvmAddress(0,0,e)}toSolidityAddress(){return this.evmAddress!=null?Ke(this.evmAddress):V3([this.shard,this.realm,this.num])}_toProtobuf(){return{contractNum:this.num,shardNum:this.shard,realmNum:this.realm,evmAddress:this.evmAddress}}toString(){return this.evmAddress!=null?`${this.shard.toString()}.${this.realm.toString()}.${Ke(this.evmAddress)}`:`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return K3(this.toString(),e)}toBytes(){return DP.proto.ContractID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e.evmAddress=this.evmAddress,e}compare(e){return au([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}equals(e){let t=!1;return this.evmAddress!=null&&e.evmAddress!=null&&(t=uE(this.evmAddress,e.evmAddress)),this.shard.eq(e.shard)&&this.realm.eq(e.realm)&&this.num.eq(e.num)&&t}_toProtobufKey(){return{contractID:this._toProtobuf()}}static __fromProtobufKey(e){return r._fromProtobuf(e)}};ar.setContractId(r=>Et.__fromProtobufKey(r));var PP=Oe(br(),1),UE=Oe(Jt(),1),Gt=class r{constructor(e,t,n){let i=j3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?UE.default.fromString(e.shardNum.toString()):0,e.realmNum!=null?UE.default.fromString(e.realmNum.toString()):0,e.fileNum!=null?UE.default.fromString(e.fileNum.toString()):0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(PP.proto.FileID.decode(e))}static fromSolidityAddress(e){let[t,n,i]=r3(e);return new r(t,n,i)}toSolidityAddress(){return V3([this.shard,this.realm,this.num])}_toProtobuf(){return{fileNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return K3(this.toString(),e)}toBytes(){return PP.proto.FileID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return au([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};Gt.ADDRESS_BOOK=new Gt(102);Gt.FEE_SCHEDULE=new Gt(111);Gt.EXCHANGE_RATES=new Gt(112);var BP=Oe(br(),1),aa=class r{constructor(e,t,n){let i=j3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.topicNum!=null?e.topicNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(BP.proto.TopicID.decode(e))}static fromSolidityAddress(e){let[t,n,i]=r3(e);return new r(t,n,i)}toSolidityAddress(){return V3([this.shard,this.realm,this.num])}_toProtobuf(){return{topicNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return K3(this.toString(),e)}toBytes(){return BP.proto.TopicID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return au([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var MP=Oe(br(),1),De=class r{constructor(e,t,n){let i=j3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.tokenNum!=null?e.tokenNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(MP.proto.TokenID.decode(e))}static fromSolidityAddress(e){return new r(...r3(e))}toSolidityAddress(){return V3([this.shard,this.realm,this.num])}_toProtobuf(){return{tokenNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return K3(this.toString(),e)}toBytes(){return MP.proto.TokenID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return au([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var LP=Oe(br(),1),Ra=class r{constructor(e,t,n){let i=j3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.scheduleNum!=null?e.scheduleNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(LP.proto.ScheduleID.decode(e))}static fromSolidityAddress(e){return new r(...r3(e))}toSolidityAddress(){return V3([this.shard,this.realm,this.num])}_toProtobuf(){return{scheduleNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return K3(this.toString(),e)}toBytes(){return LP.proto.ScheduleID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return au([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var FP=Oe(Jt(),1),G0=class r{constructor(e){this.hbars=e.hbars,this.cents=e.cents,this.expirationTime=e.expirationTime,this.exchangeRateInCents=e.cents/e.hbars,Object.freeze(this)}static _fromProtobuf(e){return new r({hbars:e.hbarEquiv,cents:e.centEquiv,expirationTime:new Date(e.expirationTime!=null&&e.expirationTime.seconds!=null?FP.default.isLong(e.expirationTime.seconds)?e.expirationTime.seconds.toInt()*1e3:e.expirationTime.seconds:0)})}_toProtobuf(){return{hbarEquiv:this.hbars,centEquiv:this.cents,expirationTime:{seconds:FP.default.fromNumber(Math.trunc(this.expirationTime.getTime()/1e3))}}}toJSON(){return{hbars:this.hbars,cents:this.cents,expirationTime:this.expirationTime,exchangeRateInCents:this.exchangeRateInCents}}toString(){return JSON.stringify(this.toJSON())}};var qE=Oe(Jt(),1),UP=Oe(br(),1);var il=class r{constructor(e){this.status=e.status,this.accountId=e.accountId,this.fileId=e.fileId,this.contractId=e.contractId,this.topicId=e.topicId,this.tokenId=e.tokenId,this.scheduleId=e.scheduleId,this.exchangeRate=e.exchangeRate,this.topicSequenceNumber=e.topicSequenceNumber,this.topicRunningHash=e.topicRunningHash,this.totalSupply=e.totalSupply,this.scheduledTransactionId=e.scheduledTransactionId,this.serials=e.serials??[],this.duplicates=e.duplicates??[],this.children=e.children??[],Object.freeze(this)}_toProtobuf(){let e=this.duplicates.map(n=>n._toProtobuf().receipt),t=this.children.map(n=>n._toProtobuf().receipt);return{duplicateTransactionReceipts:e,childTransactionReceipts:t,receipt:{status:this.status.valueOf(),accountID:this.accountId!=null?this.accountId._toProtobuf():null,fileID:this.fileId!=null?this.fileId._toProtobuf():null,contractID:this.contractId!=null?this.contractId._toProtobuf():null,topicID:this.topicId!=null?this.topicId._toProtobuf():null,tokenID:this.tokenId!=null?this.tokenId._toProtobuf():null,scheduleID:this.scheduleId!=null?this.scheduleId._toProtobuf():null,topicRunningHash:this.topicRunningHash==null?null:this.topicRunningHash,topicSequenceNumber:this.topicSequenceNumber,exchangeRate:{nextRate:null,currentRate:this.exchangeRate!=null?this.exchangeRate._toProtobuf():null},scheduledTransactionID:this.scheduledTransactionId!=null?this.scheduledTransactionId._toProtobuf():null,serialNumbers:this.serials,newTotalSupply:this.totalSupply}}}static _fromProtobuf(e){let t=e.receipt,n=t.exchangeRate,i=e.childTransactionReceipts!=null?e.childTransactionReceipts.map(o=>r._fromProtobuf({receipt:o})):[],a=e.duplicateTransactionReceipts!=null?e.duplicateTransactionReceipts.map(o=>r._fromProtobuf({receipt:o})):[];return new r({status:P._fromCode(t.status!=null?t.status:0),accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):null,fileId:t.fileID!=null?Gt._fromProtobuf(t.fileID):null,contractId:t.contractID!=null?Et._fromProtobuf(t.contractID):null,topicId:t.topicID!=null?aa._fromProtobuf(t.topicID):null,tokenId:t.tokenID!=null?De._fromProtobuf(t.tokenID):null,scheduleId:t.scheduleID!=null?Ra._fromProtobuf(t.scheduleID):null,exchangeRate:t.exchangeRate!=null?G0._fromProtobuf(n.currentRate):null,topicSequenceNumber:t.topicSequenceNumber==null?null:qE.default.fromString(t.topicSequenceNumber.toString()),topicRunningHash:t.topicRunningHash!=null?new Uint8Array(t.topicRunningHash):null,totalSupply:t.newTotalSupply!=null?qE.default.fromString(t.newTotalSupply.toString()):null,scheduledTransactionId:t.scheduledTransactionID!=null?Qr._fromProtobuf(t.scheduledTransactionID):null,serials:t.serialNumbers!=null?t.serialNumbers.map(o=>qE.default.fromValue(o)):[],children:i,duplicates:a})}static fromBytes(e){return r._fromProtobuf(UP.proto.TransactionGetReceiptResponse.decode(e))}toBytes(){return UP.proto.TransactionGetReceiptResponse.encode(this._toProtobuf()).finish()}toJSON(){return{status:this.status.toString(),accountId:this.accountId?.toString()||null,filedId:this.fileId?.toString()||null,contractId:this.contractId?.toString()||null,topicId:this.topicId?.toString()||null,tokenId:this.tokenId?.toString()||null,scheduleId:this.scheduleId?.toString()||null,exchangeRate:this.exchangeRate?.toJSON()||null,topicSequenceNumber:this.topicSequenceNumber?.toString()||null,topicRunningHash:this.topicRunningHash!=null?Ke(this.topicRunningHash):null,totalSupply:this.totalSupply?.toString()||null,scheduledTransactionId:this.scheduledTransactionId?.toString()||null,serials:this.serials.map(e=>e.toString()),duplicates:this.duplicates.map(e=>e.toJSON()),children:this.children.map(e=>e.toJSON())}}toString(){return JSON.stringify(this.toJSON())}};var mVe=Oe(br(),1),{proto:noe}=mVe,al=class r extends Ar{constructor(e={}){super(),this._transactionId=null,this._includeChildren=null,this._includeDuplicates=null,this._validateStatus=!0,e.transactionId!=null&&this.setTransactionId(e.transactionId),e.includeChildren!=null&&this.setIncludeChildren(e.includeChildren),e.includeDuplicates!=null&&this.setIncludeDuplicates(e.includeDuplicates),e.validateStatus!=null&&this.setValidateStatus(e.validateStatus)}static _fromProtobuf(e){let t=e.transactionGetReceipt;return new r({transactionId:t.transactionID?Qr._fromProtobuf(t.transactionID):void 0,includeDuplicates:t.includeDuplicates!=null?t.includeDuplicates:void 0,includeChildren:t.includeChildReceipts!=null?t.includeChildReceipts:void 0})}get transactionId(){return this._transactionId}setTransactionId(e){return this._transactionId=typeof e=="string"?Qr.fromString(e):e.clone(),this}setIncludeDuplicates(e){return this._includeDuplicates=e,this}get includeDuplicates(){return this._includeDuplicates!=null?this._includeDuplicates:!1}setIncludeChildren(e){return this._includeChildren=e,this}get includeChildren(){return this._includeChildren!=null?this._includeChildren:!1}setValidateStatus(e){return this._validateStatus=e,this}get validateStatus(){return this._validateStatus}_isPaymentRequired(){return!1}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??noe.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received node precheck status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:return[i,Bn.Retry];case P.Ok:break;default:return[i,Bn.Error]}let s=t.transactionGetReceipt.receipt.status;switch(i=P._fromCode(s),this._logger&&this._logger.debug(`[${this._getLogId()}] received receipt status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:return[i,Bn.Retry];case P.Success:return[i,Bn.Finished];default:return[i,this._validateStatus?Bn.Error:Bn.Finished]}}_getTransactionId(){return this._transactionId!=null?this._transactionId:super._getTransactionId()}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??noe.ResponseCodeEnum.OK);switch(i){case P.Ok:break;default:return new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}let a=t.transactionGetReceipt,s=a.receipt.status;if(i=P._fromCode(s),this._transactionId==null)throw new Error("Failed to construct `ReceiptStatusError` because `transactionId` is `null`");return new el({status:i,transactionId:this._transactionId,transactionReceipt:il._fromProtobuf(a)})}_validateChecksums(e){this._transactionId!=null&&this._transactionId.accountId!=null&&this._transactionId.accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getTransactionReceipts(t)}_mapResponseHeader(e){return e.transactionGetReceipt.header}_mapResponse(e,t,n){let i=e.transactionGetReceipt;return Promise.resolve(il._fromProtobuf(i))}_onMakeRequest(e){return{transactionGetReceipt:{header:e,transactionID:this._transactionId!=null?this._transactionId._toProtobuf():null,includeDuplicates:this._includeDuplicates,includeChildReceipts:this._includeChildren}}}_getLogId(){return`TransactionReceiptQuery:${this._timestamp.toString()}`}};$r.set("transactionGetReceipt",al._fromProtobuf);var uu=class r{constructor(e){this.accountId=e.accountId instanceof ne?e.accountId:ne.fromString(e.accountId),this.amount=e.amount instanceof Ge?e.amount:new Ge(e.amount),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e)t.push(new r({accountId:ne._fromProtobuf(n.accountID),amount:Ge.fromTinybars(n.amount!=null?n.amount:0),isApproved:n.isApproval}));return t}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount.toTinybars(),isApproval:this.isApproved}}toJSON(){return{accountId:this.accountId.toString(),amount:this.amount.toTinybars().toString(),isApproved:this.isApproved}}toString(){return JSON.stringify(this.toJSON())}};var G2=class r{constructor(e){this.contractId=e.contractId,this.bloom=e.bloom,this.topics=e.topics,this.data=e.data,Object.freeze(this)}static _fromProtobuf(e){return new r({contractId:Et._fromProtobuf(e.contractID),bloom:e.bloom!=null?e.bloom:new Uint8Array,topics:e.topic!=null?e.topic:[],data:e.data!=null?e.data:new Uint8Array})}_toProtobuf(){return{contractID:this.contractId._toProtobuf(),bloom:this.bloom,topic:this.topics,data:this.data}}};function m8(r){return Buffer.from(r).toString("utf8")}function i3(r){return Buffer.from(r,"utf8")}var wn=Oe(_B(),1),r1=Oe(Jt(),1);var r3e=Oe(Jt(),1),Lze=Oe(br(),1),{proto:t3e}=Lze,ym=class r{constructor(e){this.contractId=e.contractId,this.nonce=e.nonce,Object.freeze(this)}static _fromProtobuf(e){return new r({contractId:Et._fromProtobuf(e.contractId),nonce:e.nonce!=null?e.nonce:r3e.default.ZERO})}_toProtobuf(){return{contractId:this.contractId._toProtobuf(),nonce:this.nonce}}static fromBytes(e){return r._fromProtobuf(t3e.ContractNonceInfo.decode(e))}toBytes(){return t3e.ContractNonceInfo.encode(this._toProtobuf()).finish()}toJSON(){return{contractId:this.contractId.toString(),nonce:this.nonce.toNumber()}}toString(){return JSON.stringify(this.toJSON())}equals(e){return this.contractId.equals(e.contractId)&&this.nonce.eq(e.nonce)}};var bu=class r{constructor(e){this._createResult=e._createResult,this.contractId=e.contractId,this.bytes=e.bytes,this.errorMessage=e.errorMessage,this.bloom=e.bloom,this.gasUsed=e.gasUsed,this.logs=e.logs,this.createdContractIds=e.createdContractIds,this.evmAddress=e.evmAddress,this.stateChanges=e.stateChanges,this.gas=e.gas,this.amount=e.amount,this.functionParameters=e.functionParameters,this.senderAccountId=e.senderAccountId,this.contractNonces=e.contractNonces}static _fromProtobuf(e,t){let n=e.contractID,i=e.gasUsed,a=e.gas?e.gas:-1,o=e.amount?e.amount:-1;return new r({_createResult:t,bytes:e.contractCallResult,contractId:n!=null?Et._fromProtobuf(n):null,errorMessage:e.errorMessage!=null?e.errorMessage:null,bloom:e.bloom,gasUsed:i instanceof r1.default?i:r1.default.fromValue(i),logs:(e.logInfo!=null?e.logInfo:[]).map(s=>G2._fromProtobuf(s)),createdContractIds:(e.createdContractIDs!=null?e.createdContractIDs:[]).map(s=>Et._fromProtobuf(s)),evmAddress:e.evmAddress!=null&&e.evmAddress.value!=null?e.evmAddress.value:null,stateChanges:[],gas:a instanceof r1.default?a:r1.default.fromValue(a),amount:o instanceof r1.default?o:r1.default.fromValue(o),functionParameters:e.functionParameters,senderAccountId:e.senderId!=null?ne._fromProtobuf(e.senderId):null,contractNonces:(e.contractNonces!=null?e.contractNonces:[]).map(s=>ym._fromProtobuf(s))})}asBytes(){return this.bytes}getString(e){return m8(this.getBytes(e))}getBytes(e){let t=this.getInt32(e),n=uo(this.bytes).getInt32(t+28);return this.bytes.subarray(t+32,t+32+n)}getBytes32(e){return this.bytes.subarray((e??0)*32,(e??0)*32+32)}getBool(e){return this.bytes[(e??0)*32+31]!==0}getInt8(e){let t=(e??0)*32+31;return uo(this.bytes).getInt8(t)}getUint8(e){return this.bytes[(e??0)*32+31]}getInt16(e){let t=(e??0)*32+28;return uo(this.bytes).getInt32(t)}getUint16(e){let t=(e??0)*32+28;return uo(this.bytes).getUint32(t)}getInt24(e){let t=(e??0)*32+28;return uo(this.bytes).getInt32(t)}getUint24(e){let t=(e??0)*32+28;return uo(this.bytes).getUint32(t)}getInt32(e){let t=(e??0)*32+28;return uo(this.bytes).getInt32(t)}getUint32(e){let t=(e??0)*32+28;return uo(this.bytes).getUint32(t)}getInt40(e){let t=wn.defaultAbiCoder.decode(["int40"],this._getBytes32(e??0));return new $e(t.toString())}getUint40(e){return new $e(Ke(this._getBytes32(e).subarray(27,32)),16)}getInt48(e){let t=wn.defaultAbiCoder.decode(["int48"],this._getBytes32(e??0));return new $e(t.toString())}getUint48(e){return new $e(Ke(this._getBytes32(e).subarray(26,32)),16)}getInt56(e){let t=wn.defaultAbiCoder.decode(["int56"],this._getBytes32(e??0));return new $e(t.toString())}getUint56(e){return new $e(Ke(this._getBytes32(e).subarray(25,32)),16)}getInt64(e){let t=wn.defaultAbiCoder.decode(["int64"],this._getBytes32(e??0));return new $e(t.toString())}getUint64(e){return new $e(Ke(this._getBytes32(e).subarray(24,32)),16)}getInt72(e){let t=wn.defaultAbiCoder.decode(["int72"],this._getBytes32(e??0));return new $e(t.toString())}getUint72(e){return new $e(Ke(this._getBytes32(e).subarray(23,32)),16)}getInt80(e){let t=wn.defaultAbiCoder.decode(["int80"],this._getBytes32(e??0));return new $e(t.toString())}getUint80(e){return new $e(Ke(this._getBytes32(e).subarray(22,32)),16)}getInt88(e){let t=wn.defaultAbiCoder.decode(["int88"],this._getBytes32(e??0));return new $e(t.toString())}getUint88(e){return new $e(Ke(this._getBytes32(e).subarray(21,32)),16)}getInt96(e){let t=wn.defaultAbiCoder.decode(["int96"],this._getBytes32(e??0));return new $e(t.toString())}getUint96(e){return new $e(Ke(this._getBytes32(e).subarray(20,32)),16)}getInt104(e){let t=wn.defaultAbiCoder.decode(["int104"],this._getBytes32(e??0));return new $e(t.toString())}getUint104(e){return new $e(Ke(this._getBytes32(e).subarray(19,32)),16)}getInt112(e){let t=wn.defaultAbiCoder.decode(["int112"],this._getBytes32(e??0));return new $e(t.toString())}getUint112(e){return new $e(Ke(this._getBytes32(e).subarray(18,32)),16)}getInt120(e){let t=wn.defaultAbiCoder.decode(["int120"],this._getBytes32(e??0));return new $e(t.toString())}getUint120(e){return new $e(Ke(this._getBytes32(e).subarray(17,32)),16)}getInt128(e){let t=wn.defaultAbiCoder.decode(["int128"],this._getBytes32(e??0));return new $e(t.toString())}getUint128(e){return new $e(Ke(this._getBytes32(e).subarray(16,32)),16)}getInt136(e){let t=wn.defaultAbiCoder.decode(["int136"],this._getBytes32(e??0));return new $e(t.toString())}getUint136(e){return new $e(Ke(this._getBytes32(e).subarray(15,32)),16)}getInt144(e){let t=wn.defaultAbiCoder.decode(["int144"],this._getBytes32(e??0));return new $e(t.toString())}getUint144(e){return new $e(Ke(this._getBytes32(e).subarray(14,32)),16)}getInt152(e){let t=wn.defaultAbiCoder.decode(["int152"],this._getBytes32(e??0));return new $e(t.toString())}getUint152(e){return new $e(Ke(this._getBytes32(e).subarray(13,32)),16)}getInt160(e){let t=wn.defaultAbiCoder.decode(["int160"],this._getBytes32(e??0));return new $e(t.toString())}getUint160(e){return new $e(Ke(this._getBytes32(e).subarray(12,32)),16)}getInt168(e){let t=wn.defaultAbiCoder.decode(["int168"],this._getBytes32(e??0));return new $e(t.toString())}getUint168(e){return new $e(Ke(this._getBytes32(e).subarray(11,32)),16)}getInt176(e){let t=wn.defaultAbiCoder.decode(["int176"],this._getBytes32(e??0));return new $e(t.toString())}getUint176(e){return new $e(Ke(this._getBytes32(e).subarray(10,32)),16)}getInt184(e){let t=wn.defaultAbiCoder.decode(["int184"],this._getBytes32(e??0));return new $e(t.toString())}getUint184(e){return new $e(Ke(this._getBytes32(e).subarray(9,32)),16)}getInt192(e){let t=wn.defaultAbiCoder.decode(["int192"],this._getBytes32(e??0));return new $e(t.toString())}getUint192(e){return new $e(Ke(this._getBytes32(e).subarray(8,32)),16)}getInt200(e){let t=wn.defaultAbiCoder.decode(["int200"],this._getBytes32(e??0));return new $e(t.toString())}getUint200(e){return new $e(Ke(this._getBytes32(e).subarray(7,32)),16)}getInt208(e){let t=wn.defaultAbiCoder.decode(["int208"],this._getBytes32(e??0));return new $e(t.toString())}getUint208(e){return new $e(Ke(this._getBytes32(e).subarray(6,32)),16)}getInt216(e){let t=wn.defaultAbiCoder.decode(["int216"],this._getBytes32(e??0));return new $e(t.toString())}getUint216(e){return new $e(Ke(this._getBytes32(e).subarray(5,32)),16)}getInt224(e){let t=wn.defaultAbiCoder.decode(["int224"],this._getBytes32(e??0));return new $e(t.toString())}getUint224(e){return new $e(Ke(this._getBytes32(e).subarray(4,32)),16)}getInt232(e){let t=wn.defaultAbiCoder.decode(["int232"],this._getBytes32(e??0));return new $e(t.toString())}getUint232(e){return new $e(Ke(this._getBytes32(e).subarray(3,32)),16)}getInt240(e){let t=wn.defaultAbiCoder.decode(["int240"],this._getBytes32(e??0));return new $e(t.toString())}getUint240(e){return new $e(Ke(this._getBytes32(e).subarray(2,32)),16)}getInt248(e){let t=wn.defaultAbiCoder.decode(["int248"],this._getBytes32(e??0));return new $e(t.toString())}getUint248(e){return new $e(Ke(this._getBytes32(e).subarray(1,32)),16)}getInt256(e){let t=wn.defaultAbiCoder.decode(["int256"],this._getBytes32(e??0));return new $e(t.toString())}getUint256(e){return new $e(Ke(this._getBytes32(e)),16)}getAddress(e){return Ke(this.bytes.subarray((e??0)*32+12,(e??0)*32+32))}getResult(e){return wn.defaultAbiCoder.decode(e,this.bytes)}_getBytes32(e){return this.bytes.subarray((e??0)*32,(e??0)*32+32)}_toProtobuf(){return{contractID:this.contractId!=null?this.contractId._toProtobuf():null,contractCallResult:this.bytes,errorMessage:this.errorMessage,bloom:this.bloom,gasUsed:this.gasUsed,logInfo:this.logs.map(e=>e._toProtobuf()),createdContractIDs:this.createdContractIds.map(e=>e._toProtobuf()),evmAddress:this.evmAddress!=null?{value:this.evmAddress}:null,gas:this.gas,amount:this.amount,functionParameters:this.functionParameters,senderId:this.senderAccountId!=null?this.senderAccountId._toProtobuf():null,contractNonces:this.contractNonces.map(e=>e._toProtobuf())}}};var fi=class{constructor(e){this._map=new Map,this.__map=new Map,this._fromString=e}get(e){let t=typeof e=="string"?e:e.toString(),n=this._map.get(t);return n??null}_set(e,t){let n=typeof e=="string"?e:e.toString();this._map.set(n,t),this.__map.set(e,t)}values(){return this._map.values()}get size(){return this._map.size}keys(){return this.__map.keys()}[Symbol.iterator](){return this.__map[Symbol.iterator]()}toString(){let e={};for(let[t,n]of this._map)e[t]=n;return JSON.stringify(e)}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t}),e}};var n1=class extends fi{constructor(){super(e=>ne.fromString(e))}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t.toString()}),e}};var i1=class r extends fi{constructor(){super(e=>De.fromString(e))}__set(e,t,n){let i=e.toString(),a=this._map.get(i);a==null&&(a=new n1,this._map.set(i,a),this.__map.set(e,a)),a._set(t,n)}static _fromProtobuf(e){let t=new r;for(let n of e){let i=De._fromProtobuf(n.token);for(let a of n.transfers!=null?n.transfers:[]){let o=ne._fromProtobuf(a.accountID);t.__set(i,o,a.amount)}}return t}_toProtobuf(){let e=[];for(let[t,n]of this){let i=[];for(let[a,o]of n)i.push({accountID:a._toProtobuf(),amount:o});e.push({token:t._toProtobuf(),transfers:i})}return e}};var n3e=Oe(Jt(),1);var a1=class r extends fi{constructor(){super(e=>De.fromString(e))}__set(e,t){let n=e.toString(),i=this._map.get(n);i==null&&(i=[],this._map.set(n,i),this.__map.set(e,i)),i.push(t)}static _fromProtobuf(e){let t=new r;for(let n of e){let i=De._fromProtobuf(n.token);for(let a of n.nftTransfers!=null?n.nftTransfers:[]){let o=ne._fromProtobuf(a.senderAccountID),s=ne._fromProtobuf(a.receiverAccountID);t.__set(i,{sender:o,recipient:s,serial:n3e.default.fromValue(a.serialNumber),isApproved:!1})}}return t}_toProtobuf(){let e=[];for(let[t,n]of this){let i=[];for(let a of n)i.push({senderAccountID:a.sender._toProtobuf(),receiverAccountID:a.recipient._toProtobuf(),serialNumber:a.serial});e.push({token:t._toProtobuf(),nftTransfers:i})}return e}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t.map(i=>({sender:i.sender.toString(),recipient:i.recipient.toString(),serial:i.serial,isApproved:i.isApproved}))}),e}};var k8=Oe(br(),1);var i3e=Oe(Jt(),1),vm=class r{constructor(e={}){this._feeCollectorAccountId=null,e.feeCollectorAccountId!=null&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._amount=null,e.amount!=null&&this.setAmount(e.amount),this._payerAccountIds=null,e.payerAccountIds!=null&&this.setPayerAccountIds(e.payerAccountIds)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId=typeof e=="string"?ne.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?De.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount=typeof e=="number"?i3e.default.fromNumber(e):e,this}get payerAccountIds(){return this._payerAccountIds}setPayerAccountIds(e){return this._payerAccountIds=e,this}static _fromProtobuf(e){return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,tokenId:e.tokenId!=null?De._fromProtobuf(e.tokenId):void 0,amount:e.amount!=null?e.amount:void 0,payerAccountIds:e.effectivePayerAccountId!=null?e.effectivePayerAccountId.map(t=>ne._fromProtobuf(t)):void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,tokenId:this._tokenId!=null?this._tokenId._toProtobuf():null,amount:this._amount,effectivePayerAccountId:this._payerAccountIds!=null?this._payerAccountIds.map(e=>e._toProtobuf()):null}}toJSON(){return{feeCollectorAccountId:this.feeCollectorAccountId?.toString()||null,tokenId:this._tokenId?.toString()||null,amount:this._amount?.toString()||null,payerAccountIds:this._payerAccountIds?.map(e=>e.toString())||[]}}};var C8=class r{constructor(e={}){this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._defaultMaxTransactionFee=new Ge(5)}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?De.fromString(e):e,this}static _fromProtobuf(e){return new r({accountId:e.accountId!=null?ne._fromProtobuf(e.accountId):void 0,tokenId:e.tokenId!=null?De._fromProtobuf(e.tokenId):void 0})}_toProtobuf(){return{accountId:this._accountId!=null?this._accountId._toProtobuf():void 0,tokenId:this._tokenId!=null?this._tokenId._toProtobuf():void 0}}toJSON(){return{accountId:this._accountId?.toString()||null,tokenId:this._tokenId?.toString()||null}}};var EB=Oe(Jt(),1);var Wd=class r{constructor(e){this.tokenId=e.tokenId instanceof De?e.tokenId:De.fromString(e.tokenId),this.accountId=e.accountId instanceof ne?e.accountId:ne.fromString(e.accountId),this.expectedDecimals=e.expectedDecimals,this.amount=EB.default.fromValue(e.amount),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e){let i=De._fromProtobuf(n.token),a=n.expectedDecimals!=null?n.expectedDecimals.value:null;for(let o of n.transfers!=null?n.transfers:[])t.push(new r({tokenId:i,accountId:ne._fromProtobuf(o.accountID),expectedDecimals:a,amount:o.amount!=null?o.amount:EB.default.ZERO,isApproved:o.isApproval==!0}))}return t}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount,isApproval:this.isApproved}}toJSON(){return{tokenId:this.tokenId.toString(),accountId:this.accountId.toString(),expectedDecimals:this.expectedDecimals,amount:this.amount.toString(),isApproved:this.isApproved}}toString(){return JSON.stringify(this.toJSON())}};var wu=class r{constructor(e){this.receipt=e.receipt,this.transactionHash=e.transactionHash,this.consensusTimestamp=e.consensusTimestamp,this.transactionId=e.transactionId,this.transactionMemo=e.transactionMemo,this.transactionFee=e.transactionFee,this.transfers=e.transfers,this.contractFunctionResult=e.contractFunctionResult!=null?e.contractFunctionResult:null,this.tokenTransfers=e.tokenTransfers,this.tokenTransfersList=e.tokenTransfersList,this.scheduleRef=e.scheduleRef,this.assessedCustomFees=e.assessedCustomFees,this.nftTransfers=e.nftTransfers,this.automaticTokenAssociations=e.automaticTokenAssociations,this.parentConsensusTimestamp=e.parentConsensusTimestamp,this.aliasKey=e.aliasKey,this.duplicates=e.duplicates,this.children=e.children,this.hbarAllowanceAdjustments=e.hbarAllowanceAdjustments,this.tokenAllowanceAdjustments=e.tokenAllowanceAdjustments,this.nftAllowanceAdjustments=e.nftAllowanceAdjustments,this.ethereumHash=e.ethereumHash,this.paidStakingRewards=e.paidStakingRewards,this.prngBytes=e.prngBytes,this.prngNumber=e.prngNumber,this.evmAddress=e.evmAddress,Object.freeze(this)}_toProtobuf(){let e=this.tokenTransfers._toProtobuf(),t=this.nftTransfers._toProtobuf(),n=[];for(let o of e)for(let s of t)o.token!=null&&s.token!=null&&o.token.shardNum===s.token.shardNum&&o.token.realmNum===s.token.realmNum&&o.token.tokenNum===s.token.tokenNum?n.push({token:o.token,transfers:o.transfers,nftTransfers:o.nftTransfers}):(n.push(o),n.push(s));let i=this.duplicates.map(o=>o._toProtobuf().transactionRecord),a=this.children.map(o=>o._toProtobuf().transactionRecord);return{duplicateTransactionRecords:i,childTransactionRecords:a,transactionRecord:{receipt:this.receipt._toProtobuf().receipt,transactionHash:this.transactionHash!=null?this.transactionHash:null,consensusTimestamp:this.consensusTimestamp!=null?this.consensusTimestamp._toProtobuf():null,transactionID:this.transactionId!=null?this.transactionId._toProtobuf():null,memo:this.transactionMemo!=null?this.transactionMemo:null,transactionFee:this.transactionFee!=null?this.transactionFee.toTinybars():null,contractCallResult:this.contractFunctionResult!=null&&!this.contractFunctionResult._createResult?this.contractFunctionResult._toProtobuf():null,contractCreateResult:this.contractFunctionResult!=null&&this.contractFunctionResult._createResult?this.contractFunctionResult._toProtobuf():null,transferList:this.transfers!=null?{accountAmounts:this.transfers.map(o=>o._toProtobuf())}:null,tokenTransferLists:n,scheduleRef:this.scheduleRef!=null?this.scheduleRef._toProtobuf():null,assessedCustomFees:this.assessedCustomFees.map(o=>o._toProtobuf()),automaticTokenAssociations:this.automaticTokenAssociations.map(o=>o._toProtobuf()),parentConsensusTimestamp:this.parentConsensusTimestamp!=null?this.parentConsensusTimestamp._toProtobuf():null,alias:this.aliasKey!=null?k8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():null,ethereumHash:this.ethereumHash,paidStakingRewards:this.paidStakingRewards.map(o=>o._toProtobuf()),prngBytes:this.prngBytes,prngNumber:this.prngNumber!=null?this.prngNumber:null,evmAddress:this.evmAddress!=null?this.evmAddress.toBytes():null}}}static _fromProtobuf(e){let t=e.transactionRecord,n=t.alias!=null&&t.alias.length>0?nt._fromProtobufKey(k8.proto.Key.decode(t.alias)):null;n instanceof ei||(n=null);let i=e.childTransactionRecords!=null?e.childTransactionRecords.map(s=>r._fromProtobuf({transactionRecord:s})):[],a=e.duplicateTransactionRecords!=null?e.duplicateTransactionRecords.map(s=>r._fromProtobuf({transactionRecord:s})):[],o=t.contractCallResult!=null?bu._fromProtobuf(t.contractCallResult,!1):t.contractCreateResult!=null?bu._fromProtobuf(t.contractCreateResult,!0):void 0;return new r({receipt:il._fromProtobuf({receipt:t.receipt}),transactionHash:t.transactionHash!=null?t.transactionHash:new Uint8Array,consensusTimestamp:ut._fromProtobuf(t.consensusTimestamp),transactionId:Qr._fromProtobuf(t.transactionID),transactionMemo:t.memo!=null?t.memo:"",transactionFee:Ge.fromTinybars(t.transactionFee!=null?t.transactionFee:0),transfers:uu._fromProtobuf(t.transferList!=null?t.transferList.accountAmounts!=null?t.transferList.accountAmounts:[]:[]),contractFunctionResult:o,tokenTransfers:i1._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),tokenTransfersList:Wd._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),scheduleRef:t.scheduleRef!=null?Ra._fromProtobuf(t.scheduleRef):null,assessedCustomFees:t.assessedCustomFees!=null?t.assessedCustomFees.map(s=>vm._fromProtobuf(s)):[],nftTransfers:a1._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),automaticTokenAssociations:t.automaticTokenAssociations!=null?t.automaticTokenAssociations.map(s=>C8._fromProtobuf(s)):[],parentConsensusTimestamp:t.parentConsensusTimestamp!=null?ut._fromProtobuf(t.parentConsensusTimestamp):null,aliasKey:n,duplicates:a,children:i,hbarAllowanceAdjustments:[],tokenAllowanceAdjustments:[],nftAllowanceAdjustments:[],ethereumHash:t.ethereumHash!=null?t.ethereumHash:null,paidStakingRewards:t.paidStakingRewards!=null?uu._fromProtobuf(t.paidStakingRewards):[],prngBytes:t.prngBytes!=null?t.prngBytes:null,prngNumber:t.prngNumber!=null?t.prngNumber:null,evmAddress:t.evmAddress!=null?ns.fromBytes(t.evmAddress):null})}static fromBytes(e){return r._fromProtobuf(k8.proto.TransactionGetRecordResponse.decode(e))}toBytes(){return k8.proto.TransactionGetRecordResponse.encode(this._toProtobuf()).finish()}toJSON(){return{receipt:this.receipt.toJSON(),transactionHash:Ke(this.transactionHash),consensusTimestamp:this.consensusTimestamp.toDate(),transactionId:this.transactionId.toString(),transactionMemo:this.transactionMemo,transactionFee:this.transactionFee.toTinybars().toString(),transfers:this.transfers.map(e=>e.toJSON()),tokenTransfers:this.tokenTransfers,tokenTransfersList:this.tokenTransfersList.map(e=>e.toJSON()),scheduleRef:this.scheduleRef?.toString()||null,assessedCustomFees:this.assessedCustomFees,nftTransfers:this.nftTransfers,automaticTokenAssociations:this.automaticTokenAssociations,parentConsensusTimestamp:this.parentConsensusTimestamp?.toDate()||null,aliasKey:this.aliasKey?.toString()||null,duplicates:this.duplicates,children:this.children,ethereumHash:this.ethereumHash!=null?Ke(this.ethereumHash):null,paidStakingRewards:this.paidStakingRewards,prngBytes:this.prngBytes!=null?Ke(this.prngBytes):null,prngNumber:this.prngNumber,evmAddress:this.evmAddress?.toString()||null}}toString(){return JSON.stringify(this.toJSON())}};var bm=class extends ou{constructor(e){super(e,`Record for transaction ${e.transactionId.toString()} contained error status ${e.status.toString()}`),this.transactionRecord=e.transactionRecord}};var xB=Oe(br(),1),{proto:a3e}=xB,o1=class r extends Ar{constructor(e={}){super(),this._transactionId=null,this._includeChildren=null,this._includeDuplicates=null,this._validateReceiptStatus=!0,e.transactionId!=null&&this.setTransactionId(e.transactionId),e.includeChildren!=null&&this.setIncludeChildren(e.includeChildren),e.includeDuplicates!=null&&this.setIncludeDuplicates(e.includeDuplicates),e.validateReceiptStatus!=null&&this.setValidateReceiptStatus(e.validateReceiptStatus)}get transactionId(){return this._transactionId}static _fromProtobuf(e){let t=e.transactionGetRecord;return new r({transactionId:t.transactionID?Qr._fromProtobuf(t.transactionID):void 0,includeChildren:t.includeChildRecords!=null?t.includeChildRecords:void 0,includeDuplicates:t.includeDuplicates!=null?t.includeDuplicates:void 0})}setTransactionId(e){return this._transactionId=typeof e=="string"?Qr.fromString(e):e.clone(),this}setIncludeChildren(e){return this._includeChildren=e,this}get includeChildren(){return this._includeChildren!=null?this._includeChildren:!1}setIncludeDuplicates(e){return this._duplicates=e,this}get includeDuplicates(){return this._duplicates!=null?this._duplicates:!1}setValidateReceiptStatus(e){return this._validateReceiptStatus=e,this}get validateReceiptStatus(){return this._validateReceiptStatus}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??a3e.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received node precheck status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:case P.RecordNotFound:return[i,Bn.Retry];case P.Ok:break;default:return[i,Bn.Error]}let a=t.transactionGetRecord;if(a.header.responseType===xB.proto.ResponseType.COST_ANSWER)return[i,Bn.Finished];let l=a.transactionRecord.receipt.status;switch(i=P._fromCode(l),this._logger&&this._logger.debug(`[${this._getLogId()}] received record's receipt ${i.toString()}`),i){case P.Ok:case P.Busy:case P.Unknown:case P.ReceiptNotFound:case P.RecordNotFound:return[i,Bn.Retry];case P.Success:return[i,Bn.Finished];default:return[i,this._validateReceiptStatus?Bn.Error:Bn.Finished]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??a3e.ResponseCodeEnum.OK);switch(i){case P.Ok:break;case P.ContractRevertExecuted:return new bm({status:i,transactionId:this._getTransactionId(),transactionRecord:wu._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})});default:return new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}let s=t.transactionGetRecord.transactionRecord.receipt,c=s.status;switch(i=P._fromCode(c),i){case P.ContractRevertExecuted:return new bm({status:i,transactionId:this._getTransactionId(),transactionRecord:wu._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})});default:return new el({status:i,transactionId:this._getTransactionId(),transactionReceipt:il._fromProtobuf({receipt:s})})}}_validateChecksums(e){this._transactionId!=null&&this._transactionId.accountId!=null&&this._transactionId.accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getTxRecordByTxID(t)}_mapResponseHeader(e){return e.transactionGetRecord.header}_mapResponse(e,t,n){let i=e.transactionGetRecord;return Promise.resolve(wu._fromProtobuf(i))}_onMakeRequest(e){return{transactionGetRecord:{header:e,transactionID:this._transactionId!=null?this._transactionId._toProtobuf():null,includeChildRecords:this._includeChildren,includeDuplicates:this._includeDuplicates}}}_getLogId(){return`TransactionRecordQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("transactionGetRecord",o1._fromProtobuf);var s1=class r{constructor(e){this.nodeId=e.nodeId,this.transactionHash=e.transactionHash,this.transactionId=e.transactionId,Object.freeze(this)}static fromJSON(e){return new r({nodeId:ne.fromString(e.nodeId),transactionHash:tt(e.transactionHash),transactionId:Qr.fromString(e.transactionId)})}async getReceipt(e){let t=await this.getReceiptQuery().execute(e);if(t.status!==P.Success)throw new el({transactionReceipt:t,status:t.status,transactionId:this.transactionId});return t}async getRecord(e){return await this.getReceipt(e),this.getRecordQuery().execute(e)}async getVerboseRecord(e){try{return await this.getReceiptQuery().execute(e),this.getRecordQuery().execute(e)}catch{return this.getRecordQuery().execute(e)}}async getReceiptWithSigner(e){let t=await this.getReceiptQuery().executeWithSigner(e);if(t.status!==P.Success)throw new el({transactionReceipt:t,status:t.status,transactionId:this.transactionId});return t}async getRecordWithSigner(e){return await this.getReceiptWithSigner(e),this.getRecordQuery().executeWithSigner(e)}getReceiptQuery(){return new al().setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}getRecordQuery(){return new o1().setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}toJSON(){return{nodeId:this.nodeId.toString(),transactionHash:Ke(this.transactionHash),transactionId:this.transactionId.toString()}}toString(){return JSON.stringify(this.toJSON())}};import Fze from"crypto";function N8(r){return Promise.resolve(Fze.createHash("sha384").update(r).digest())}var R8=class r extends fi{constructor(){super(e=>ne.fromString(e))}static async _fromTransaction(e){let t=new r;for(let n=0;n<e._nodeAccountIds.length;n++){let i=e._nodeAccountIds.list[n],a=e._transactions.get(n),o=await N8(a.signedTransactionBytes);t._set(i,o)}return t}};var O8=class r extends fi{constructor(){super(e=>ei.fromString(e))}static _fromTransactionSigMap(e){let t=new r,n=e.sigPair!=null?e.sigPair:[];for(let i of n)i.pubKeyPrefix!=null&&(i.ed25519!=null?t._set(ei.fromBytesED25519(i.pubKeyPrefix),i.ed25519):i.ECDSASecp256k1!=null&&t._set(ei.fromBytesECDSA(i.pubKeyPrefix),i.ECDSASecp256k1));return t}};var wm=class r extends fi{constructor(){super(e=>ne.fromString(e))}static _fromTransaction(e){let t=new r;for(let n=0;n<e._nodeAccountIds.length;n++){let i=e._signedTransactions.get(n).sigMap;i!=null&&t._set(e._nodeAccountIds.list[n],O8._fromTransactionSigMap(i))}return t}};var D8=Oe(Jt(),1);var os=Oe(br(),1);var _u=D8.default.fromValue(7776e3),AB=Ge.fromTinybars(D8.default.fromString("9223372036854775807")),s3e=120,c3e=1024,We=new Map,ke=class extends cu{constructor(){super(),this._transactions=new nl,this._signedTransactions=new nl,this._signerPublicKeys=new Set,this._transactionValidDuration=s3e,this._defaultMaxTransactionFee=new Ge(2),this._maxTransactionFee=null,this._transactionMemo="",this._transactionIds=new nl,this._publicKeys=[],this._transactionSigners=[],this._regenerateTransactionId=null}static fromBytes(e){let t=[],n=[],i=[],a=[],o=[],s=[],c=os.proto.TransactionList.decode(e).transactionList;if(c.length===0){let d=os.proto.Transaction.decode(e);d.signedTransactionBytes.length!==0?c.push(d):c.push({signedTransactionBytes:os.proto.SignedTransaction.encode({bodyBytes:d.bodyBytes,sigMap:d.sigMap}).finish()})}for(let d of c){if(d.signedTransactionBytes==null)throw new Error("Transaction.signedTransactionBytes are null");let h=os.proto.SignedTransaction.decode(d.signedTransactionBytes);t.push(h);let g=os.proto.TransactionBody.decode(h.bodyBytes);if(g.data==null)throw new Error("(BUG) body.data was not set in the protobuf");if(s.push(g),g.transactionID!=null){let m=Qr._fromProtobuf(g.transactionID);a.includes(m.toString())||(n.push(m),a.push(m.toString()))}if(g.nodeAccountID!=null){let m=ne._fromProtobuf(g.nodeAccountID);o.includes(m.toString())||(i.push(m),o.push(m.toString()))}}let l=s[0];if(l==null||l.data==null)throw new Error("No transaction found in bytes or failed to decode TransactionBody");let u=We.get(l.data);if(u==null)throw new Error(`(BUG) Transaction.fromBytes() not implemented for type ${l.data}`);return u(c,t,n,i,s)}schedule(){if(this._requireNotFrozen(),Cx.length!=1)throw new Error("ScheduleCreateTransaction has not been loaded yet");return Cx[0]()._setScheduledTransaction(this)}static _fromProtobufTransactions(e,t,n,i,a,o){let s=o[0];for(let l=0;l<i.length;l++)for(let u=0;u<a.length-1;u++)if(!cR(o[l*a.length+u],o[l*a.length+u+1],new Set(["nodeAccountID"])))throw new Error("failed to validate transaction bodies");let c=new ne(0);for(let l=0;l<a.length;l++)a[l].equals(c)&&a.splice(l--,1);e._transactions.setList(t),e._signedTransactions.setList(n).setLocked(),e._transactionIds.setList(i).setLocked(),e._nodeAccountIds.setList(a).setLocked(),e._transactionValidDuration=s.transactionValidDuration!=null&&s.transactionValidDuration.seconds!=null?D8.default.fromValue(s.transactionValidDuration.seconds).toInt():s3e,e._maxTransactionFee=s.transactionFee!=null?Ge.fromTinybars(s.transactionFee):new Ge(0),e._transactionMemo=s.memo!=null?s.memo:"";for(let l=0;l<a.length;l++){let u=n[l];if(u.sigMap!=null&&u.sigMap.sigPair!=null)for(let d of u.sigMap.sigPair)e._signerPublicKeys.add(Ke(d.pubKeyPrefix)),e._publicKeys.push(ei.fromBytes(d.pubKeyPrefix)),e._transactionSigners.push(null)}return e}setNodeAccountIds(e){return this._requireNotFrozen(),super.setNodeAccountIds(e),this}get transactionValidDuration(){return this._transactionValidDuration}setTransactionValidDuration(e){return this._requireNotFrozen(),this._transactionValidDuration=e,this}get maxTransactionFee(){return this._maxTransactionFee}setMaxTransactionFee(e){return this._requireNotFrozen(),this._maxTransactionFee=e instanceof Ge?e:new Ge(e),this}get regenerateTransactionId(){return this._regenerateTransactionId}setRegenerateTransactionId(e){return this._requireNotFrozen(),this._regenerateTransactionId=e,this}get transactionMemo(){return this._transactionMemo}setTransactionMemo(e){return this._requireNotFrozen(),this._transactionMemo=e,this}get transactionId(){return this._transactionIds.isEmpty?null:(this._transactionIds.setLocked(),this._transactionIds.current)}setTransactionId(e){return this._requireNotFrozen(),this._transactionIds.setList([e]).setLocked(),this}sign(e){return this.signWith(e.publicKey,t=>Promise.resolve(e.sign(t)))}async signWith(e,t){this._signOnDemand||this._requireFrozen();let n=e.toBytesRaw(),i=Ke(n);if(this._signerPublicKeys.has(i))return this;if(this._transactions.clear(),this._signerPublicKeys.add(i),this._signOnDemand)return this._publicKeys.push(e),this._transactionSigners.push(t),this;this._transactionIds.setLocked(),this._nodeAccountIds.setLocked();for(let a of this._signedTransactions.list){let o=a.bodyBytes,s=await t(o);a.sigMap==null&&(a.sigMap={}),a.sigMap.sigPair==null&&(a.sigMap.sigPair=[]),a.sigMap.sigPair.push(e._toProtobufSignature(s))}return this}signWithOperator(e){let t=e._operator;if(t==null)throw new Error("`client` must have an operator to sign with the operator");return this._isFrozen()||this.freezeWith(e),this.signWith(t.publicKey,t.transactionSigner)}addSignature(e,t){this._requireOneNodeAccountId(),this.isFrozen()||this.freeze();let n=e.toBytesRaw(),i=Ke(n);if(this._signerPublicKeys.has(i))return this;this._transactions.clear(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._signedTransactions.setLocked();for(let a of this._signedTransactions.list)a.sigMap==null&&(a.sigMap={}),a.sigMap.sigPair==null&&(a.sigMap.sigPair=[]),a.sigMap.sigPair.push(e._toProtobufSignature(t));return this._signerPublicKeys.add(i),this._publicKeys.push(e),this._transactionSigners.push(null),this}getSignatures(){return this._requireFrozen(),this._requireNotSignOnDemand(),this._buildAllTransactions(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),wm._fromTransaction(this)}async getSignaturesAsync(){return this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),wm._fromTransaction(this)}_setTransactionId(){if(this._operatorAccountId==null&&this._transactionIds.isEmpty)throw new Error("`transactionId` must be set or `client` must be provided with `freezeWith`")}_setNodeAccountIds(e){if(this._nodeAccountIds.isEmpty){if(e==null)throw new Error("`nodeAccountId` must be set or `client` must be provided with `freezeWith`");this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute())}}_buildSignedTransactions(){this._signedTransactions.locked||this._signedTransactions.setList(this._nodeAccountIds.list.map(e=>this._makeSignedTransaction(e)))}freeze(){return this.freezeWith(null)}_freezeWithAccountId(e){this._operatorAccountId==null&&(this._operatorAccountId=e)}freezeWith(e){if(this._signOnDemand=e!=null?e.signOnDemand:!1,this._operator=e!=null?e._operator:null,this._freezeWithAccountId(e!=null?e.operatorAccountId:null),this._maxTransactionFee=this._maxTransactionFee==null?e!=null&&e.defaultMaxTransactionFee!=null?e.defaultMaxTransactionFee:this._defaultMaxTransactionFee:this._maxTransactionFee,this._regenerateTransactionId=e!=null&&this._regenerateTransactionId==null?e.defaultRegenerateTransactionId:this._regenerateTransactionId,this._setNodeAccountIds(e),this._setTransactionId(),e!=null)for(let t of this._transactionIds.list)t.accountId!=null&&t.accountId.validateChecksum(e);return this._buildNewTransactionIdList(),this._signOnDemand||this._buildSignedTransactions(),this}async signWithSigner(e){return await e.signTransaction(this),this}async freezeWithSigner(e){return await e.populateTransaction(this),this.freeze(),this}toBytes(){return this._requireFrozen(),this._requireNotSignOnDemand(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._buildAllTransactions(),os.proto.TransactionList.encode({transactionList:this._transactions.list}).finish()}async toBytesAsync(){return this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),os.proto.TransactionList.encode({transactionList:this._transactions.list}).finish()}async getTransactionHash(){return this._requireFrozen(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),N8(this._transactions.get(0).signedTransactionBytes)}async getTransactionHashPerNode(){return this._requireFrozen(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),await R8._fromTransaction(this)}isFrozen(){return this._signedTransactions.length>0}_getTransactionId(){let e=this.transactionId;if(e==null)throw new Error("transaction must have been frozen before getting the transaction ID, try calling `freeze`");return e}_validateChecksums(e){}async _beforeExecute(e){this._logger&&this._logger.info(`Network used: ${e._network.networkName}`),this._isFrozen()||this.freezeWith(e),e.isAutoValidateChecksumsEnabled()&&this._validateChecksums(e),(this._operator==null||this._operator==null)&&(this._operator=e!=null?e._operator:null),(this._operatorAccountId==null||this._operatorAccountId==null)&&(this._operatorAccountId=e!=null&&e._operator!=null?e._operator.accountId:null),this._operator!=null&&await this.signWith(this._operator.publicKey,this._operator.transactionSigner)}async _makeRequestAsync(){let e=this._transactionIds.index*this._nodeAccountIds.length+this._nodeAccountIds.index;return this._signOnDemand?await this._buildTransactionAsync():(this._buildTransaction(e),this._transactions.get(e))}async _signTransaction(){let e=this._makeSignedTransaction(this._nodeAccountIds.next),t=e.bodyBytes;for(let n=0;n<this._publicKeys.length;n++){let i=this._publicKeys[n],a=this._transactionSigners[n];if(a==null)continue;let o=await a(t);e.sigMap==null&&(e.sigMap={}),e.sigMap.sigPair==null&&(e.sigMap.sigPair=[]),e.sigMap.sigPair.push(i._toProtobufSignature(o))}return e}_buildNewTransactionIdList(){if(this._transactionIds.locked||this._operatorAccountId==null)return;let e=Qr.withValidStart(this._operatorAccountId,ut.generate());this._transactionIds.set(this._transactionIds.index,e)}_buildAllTransactions(){for(let e=0;e<this._signedTransactions.length;e++)this._buildTransaction(e)}async _buildAllTransactionsAsync(){if(!this._signOnDemand){this._buildAllTransactions();return}if(this._buildSignedTransactions(),!this._transactions.locked)for(let e=0;e<this._signedTransactions.length;e++)this._transactions.push(await this._buildTransactionAsync())}_buildTransaction(e){if(this._transactions.length<e)for(let t=this._transactions.length;t<e;t++)this._transactions.push(null);this._transactions.setIfAbsent(e,()=>({signedTransactionBytes:os.proto.SignedTransaction.encode(this._signedTransactions.get(e)).finish()}))}async _buildTransactionAsync(){return{signedTransactionBytes:os.proto.SignedTransaction.encode(await this._signTransaction()).finish()}}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=t,i=P._fromCode(n??os.proto.ResponseCodeEnum.OK);switch(this._logger&&(this._logger.debug(`[${this._getLogId()}] received status ${i.toString()}`),this._logger.info(`SDK Transaction Status Response: ${i.toString()}`)),i){case P.Busy:case P.Unknown:case P.PlatformTransactionNotCreated:case P.PlatformNotActive:return[i,Bn.Retry];case P.Ok:return[i,Bn.Finished];case P.TransactionExpired:return this._transactionIds.locked||this._regenerateTransactionId!=null&&!this._regenerateTransactionId?[i,Bn.Error]:(this._buildNewTransactionIdList(),[i,Bn.Retry]);default:return[i,Bn.Error]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=t,i=P._fromCode(n??os.proto.ResponseCodeEnum.OK);return this._logger&&this._logger.info(`Transaction Error Info: ${i.toString()}, ${this.transactionId.toString()}`),new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}async _mapResponse(e,t,n){let i=await N8(n.signedTransactionBytes),a=this._getTransactionId();return this._transactionIds.advance(),this._logger&&this._logger.info(`Transaction Info: ${JSON.stringify(new s1({nodeId:t,transactionHash:i,transactionId:a}).toJSON())}`),new s1({nodeId:t,transactionHash:i,transactionId:a})}_makeSignedTransaction(e){let t=this._makeTransactionBody(e);return this._logger&&this._logger.info(`Transaction Body: ${JSON.stringify(t)}`),{bodyBytes:os.proto.TransactionBody.encode(t).finish(),sigMap:{sigPair:[]}}}_makeTransactionBody(e){return{[this._getTransactionDataCase()]:this._makeTransactionData(),transactionFee:this._maxTransactionFee!=null?this._maxTransactionFee.toTinybars():null,memo:this._transactionMemo,transactionID:this._transactionIds.current._toProtobuf(),nodeAccountID:e!=null?e._toProtobuf():null,transactionValidDuration:{seconds:D8.default.fromNumber(this._transactionValidDuration)}}}_getTransactionDataCase(){throw new Error("not implemented")}_getScheduledTransactionBody(){return{memo:this.transactionMemo,transactionFee:this._maxTransactionFee==null?this._defaultMaxTransactionFee.toTinybars():this._maxTransactionFee.toTinybars(),[this._getTransactionDataCase()]:this._makeTransactionData()}}_makeTransactionData(){throw new Error("not implemented")}_isFrozen(){return this._signOnDemand||this._signedTransactions.length>0||this._transactions.length>0}_requireNotFrozen(){if(this._isFrozen())throw new Error("transaction is immutable; it has at least one signature or has been explicitly frozen")}_requireNotSignOnDemand(){if(this._signOnDemand)throw new Error("Please use `toBytesAsync()` if `signOnDemand` is enabled")}_requireFrozen(){if(!this._isFrozen())throw new Error("transaction must have been frozen before calculating the hash will be stable, try calling `freeze`")}_requireOneNodeAccountId(){if(this._nodeAccountIds.length!=1)throw"transaction did not have exactly one node ID set"}_requestToBytes(e){return os.proto.Transaction.encode(e).finish()}_responseToBytes(e){return os.proto.TransactionResponse.encode(e).finish()}},Cx=[];var TB=Oe(br(),1);var P8=Oe(Jt(),1),sa=class r{constructor(e,t){this.tokenId=e,this.serial=typeof t=="number"?P8.default.fromNumber(t):t,Object.freeze(this)}static fromString(e){let t=e.split("/").length>1?e.split("/"):e.split("@");for(let a of t)if(a==="")throw new Error("invalid format for NftId: use [token]/[serial] or [token]@[serial]");let n=De.fromString(t[0]),i=P8.default.fromString(t[1]);return new r(n,i)}static _fromProtobuf(e){return new r(De._fromProtobuf(e.tokenID),e.serialNumber!=null?e.serialNumber:P8.default.ZERO)}static fromBytes(e){return r._fromProtobuf(TB.proto.NftID.decode(e))}_toProtobuf(){return{tokenID:this.tokenId._toProtobuf(),serialNumber:P8.default.fromValue(this.serial!==void 0?this.serial:0)}}toString(){return`${this.tokenId.toString()}/${this.serial.toString()}`}toBytes(){return TB.proto.NftID.encode(this._toProtobuf()).finish()}};var Uze=Oe(Jt(),1);var Qd=class r{constructor(e){this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.amount=e.amount,Object.freeze(this)}static _fromProtobuf(e){return new r({spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,amount:Ge.fromTinybars(e.amount!=null?e.amount:0)})}static _fromGrantedProtobuf(e,t){return new r({spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,amount:Ge.fromTinybars(e.amount!=null?e.amount:0)})}_toProtobuf(){return{owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,amount:this.amount!=null?this.amount.toTinybars():null}}_validateChecksums(e){this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}toJSON(){return{ownerAccountId:this.ownerAccountId!=null?this.ownerAccountId.toString():null,spenderAccountId:this.spenderAccountId!=null?this.spenderAccountId.toString():null,amount:this.amount!=null?this.amount.toString():null}}};var SB=Oe(Jt(),1),$d=class r{constructor(e){this.tokenId=e.tokenId,this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.amount=e.amount,Object.freeze(this)}static _fromProtobuf(e){return new r({tokenId:De._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,amount:e.amount!=null?SB.default.fromValue(e.amount):null})}static _fromGrantedProtobuf(e,t){return new r({tokenId:De._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,amount:e.amount!=null?SB.default.fromValue(e.amount):null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,amount:this.amount}}_validateChecksums(e){this.tokenId.validateChecksum(e),this.ownerAccountId!=null&&this.ownerAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}};var IB=Oe(Jt(),1),X3=class r{constructor(e){this.tokenId=e.tokenId,this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.serialNumbers=e.serialNumbers,this.allSerials=e.allSerials,this.delegatingSpender=e.delegatingSpender,Object.freeze(this)}static _fromProtobuf(e){let t=e.approvedForAll!=null&&e.approvedForAll.value==!0;return new r({tokenId:De._fromProtobuf(e.tokenId),spenderAccountId:e.spender!=null?ne._fromProtobuf(e.spender):null,ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,serialNumbers:t?null:e.serialNumbers!=null?e.serialNumbers.map(n=>IB.default.fromValue(n)):[],allSerials:t,delegatingSpender:e.delegatingSpender!=null?ne._fromProtobuf(e.delegatingSpender):null})}static _fromGrantedProtobuf(e,t){return new r({tokenId:De._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,serialNumbers:[],allSerials:null,delegatingSpender:null})}static _fromRemoveProtobuf(e){return new r({tokenId:De._fromProtobuf(e.tokenId),spenderAccountId:null,ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,serialNumbers:e.serialNumbers!=null?e.serialNumbers.map(t=>IB.default.fromValue(t)):[],allSerials:null,delegatingSpender:null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,approvedForAll:this.serialNumbers==null?{value:this.allSerials}:null,serialNumbers:this.serialNumbers,delegatingSpender:this.delegatingSpender!=null?this.delegatingSpender._toProtobuf():null}}_validateChecksums(e){this.tokenId.validateChecksum(e),this.ownerAccountId!=null&&this.ownerAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}};var CB=Oe(Jt(),1);var B8=class r extends ke{constructor(e={}){super(),this._hbarApprovals=e.hbarApprovals!=null?e.hbarApprovals:[],this._tokenApprovals=e.tokenApprovals!=null?e.tokenApprovals:[],this._nftApprovals=e.nftApprovals!=null?e.nftApprovals:[]}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoApproveAllowance;return ke._fromProtobufTransactions(new r({hbarApprovals:(s.cryptoAllowances!=null?s.cryptoAllowances:[]).map(c=>Qd._fromProtobuf(c)),tokenApprovals:(s.tokenAllowances!=null?s.tokenAllowances:[]).map(c=>$d._fromProtobuf(c)),nftApprovals:(s.nftAllowances!=null?s.nftAllowances:[]).map(c=>X3._fromProtobuf(c))}),e,t,n,i,a)}get hbarApprovals(){return this._hbarApprovals}approveHbarAllowance(e,t,n){return this._requireNotFrozen(),this._hbarApprovals.push(new Qd({spenderAccountId:typeof t=="string"?ne.fromString(t):t instanceof Et?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,ownerAccountId:typeof e=="string"?ne.fromString(e):e instanceof Et?ne.fromEvmAddress(0,0,e.toSolidityAddress()):e,amount:n instanceof Ge?n:new Ge(n)})),this}addHbarAllowance(e,t){return this._requireNotFrozen(),this._hbarApprovals.push(new Qd({spenderAccountId:typeof e=="string"?ne.fromString(e):e,amount:t instanceof Ge?t:new Ge(t),ownerAccountId:null})),this}get tokenApprovals(){return this._tokenApprovals}approveTokenAllowance(e,t,n,i){return this._requireNotFrozen(),this._tokenApprovals.push(new $d({tokenId:typeof e=="string"?De.fromString(e):e,spenderAccountId:typeof n=="string"?ne.fromString(n):n instanceof Et?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof Et?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,amount:typeof i=="number"?CB.default.fromNumber(i):i})),this}addTokenAllowance(e,t,n){return this._requireNotFrozen(),this._tokenApprovals.push(new $d({tokenId:typeof e=="string"?De.fromString(e):e,spenderAccountId:typeof t=="string"?ne.fromString(t):t,amount:typeof n=="number"?CB.default.fromNumber(n):n,ownerAccountId:null})),this}addTokenNftAllowance(e,t){return this._approveTokenNftAllowance(e,null,t,null)}get tokenNftApprovals(){return this._nftApprovals}_approveTokenNftAllowance(e,t,n,i){this._requireNotFrozen();let a=typeof e=="string"?sa.fromString(e):e,o=typeof n=="string"?ne.fromString(n):n instanceof Et?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,s=!1;for(let c of this._nftApprovals)if(c.tokenId.compare(a.tokenId)===0&&c.spenderAccountId!=null&&c.spenderAccountId.compare(o)===0){c.serialNumbers!=null&&c.serialNumbers.push(a.serial),s=!0;break}return s||this._nftApprovals.push(new X3({tokenId:a.tokenId,spenderAccountId:o,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof Et?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,serialNumbers:[a.serial],allSerials:!1,delegatingSpender:typeof i=="string"?ne.fromString(i):i})),this}approveTokenNftAllowance(e,t,n){return this._approveTokenNftAllowance(e,t,n,null)}approveTokenNftAllowanceWithDelegatingSpender(e,t,n,i){return this._approveTokenNftAllowance(e,t,n,i)}_approveAllTokenNftAllowance(e,t,n,i){return this._requireNotFrozen(),this._nftApprovals.push(new X3({tokenId:typeof e=="string"?De.fromString(e):e,spenderAccountId:typeof n=="string"?ne.fromString(n):n instanceof Et?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof Et?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,serialNumbers:null,allSerials:i,delegatingSpender:null})),this}addAllTokenNftAllowance(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!0)}approveTokenNftAllowanceAllSerials(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!0)}deleteTokenNftAllowanceAllSerials(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!1)}_validateChecksums(e){this._hbarApprovals.map(t=>t._validateChecksums(e)),this._tokenApprovals.map(t=>t._validateChecksums(e)),this._nftApprovals.map(t=>t._validateChecksums(e))}_execute(e,t){return e.crypto.approveAllowances(t)}_getTransactionDataCase(){return"cryptoApproveAllowance"}_makeTransactionData(){return{cryptoAllowances:this._hbarApprovals.map(e=>e._toProtobuf()),tokenAllowances:this._tokenApprovals.map(e=>e._toProtobuf()),nftAllowances:this._nftApprovals.map(e=>e._toProtobuf())}}_getLogId(){return`AccountAllowanceApproveTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoApproveAllowance",B8._fromProtobuf);var M8=class r extends ke{constructor(e={}){super(),this._nftAllowances=e.nftAllowances!=null?e.nftAllowances:[]}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDeleteAllowance;return ke._fromProtobufTransactions(new r({nftAllowances:(s.nftAllowances!=null?s.nftAllowances:[]).map(c=>X3._fromProtobuf(c))}),e,t,n,i,a)}get tokenNftAllowanceDeletions(){return this._nftAllowances}deleteAllTokenNftAllowances(e,t){this._requireNotFrozen();let n=typeof e=="string"?sa.fromString(e):e,i=typeof t=="string"?ne.fromString(t):t,a=!1;for(let o of this._nftAllowances)if(o.tokenId.compare(n.tokenId)===0){o.serialNumbers!=null&&o.serialNumbers.push(n.serial),a=!0;break}return a||this._nftAllowances.push(new X3({tokenId:n.tokenId,spenderAccountId:null,serialNumbers:[n.serial],ownerAccountId:i,allSerials:!1,delegatingSpender:null})),this}_validateChecksums(e){this._nftAllowances.map(t=>t._validateChecksums(e))}_execute(e,t){return e.crypto.deleteAllowances(t)}_getTransactionDataCase(){return"cryptoDeleteAllowance"}_makeTransactionData(){return{nftAllowances:this._nftAllowances.map(e=>e._toProtobuf())}}_getLogId(){return`AccountAllowanceDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoDeleteAllowance",M8._fromProtobuf);var l3e=Oe(Jt(),1);var L8=class extends fi{constructor(){super(e=>De.fromString(e))}};var F8=class extends fi{constructor(){super(e=>De.fromString(e))}};var kB=Oe(br(),1),_m=class r{constructor(e){this.hbars=e.hbars,this.tokens=e.tokens,this.tokenDecimals=e.tokenDecimals,Object.freeze(this)}static fromBytes(e){return r._fromProtobuf(kB.proto.CryptoGetAccountBalanceResponse.decode(e))}static _fromProtobuf(e){let t=new L8,n=new F8;if(e.tokenBalances!=null)for(let i of e.tokenBalances){let a=De._fromProtobuf(i.tokenId);n._set(a,i.decimals!=null?i.decimals:0),t._set(a,l3e.default.fromValue(i.balance))}return new r({hbars:Ge.fromTinybars(e.balance),tokens:t,tokenDecimals:n})}_toProtobuf(){let e=[];for(let[t,n]of this.tokens!=null?this.tokens:[])e.push({tokenId:t._toProtobuf(),balance:n,decimals:this.tokenDecimals!=null?this.tokenDecimals.get(t):null});return{balance:this.hbars.toTinybars(),tokenBalances:e}}toBytes(){return kB.proto.CryptoGetAccountBalanceResponse.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){let e=[];for(let[t,n]of this.tokens!=null?this.tokens:[]){let i=this.tokenDecimals!=null?this.tokenDecimals.get(t):null;e.push({tokenId:t.toString(),balance:n.toString(),decimals:i??0})}return{hbars:this.hbars.toString(),tokens:e}}};var ec=class r extends Ar{constructor(e={}){super(),this._accountId=null,this._contractId=null,e.accountId!=null&&this.setAccountId(e.accountId),e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.cryptogetAccountBalance;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,contractId:t.contractID!=null?Et._fromProtobuf(t.contractID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}_isPaymentRequired(){return!1}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.crypto.cryptoGetBalance(t)}_mapResponseHeader(e){return e.cryptogetAccountBalance.header}_mapResponse(e,t,n){let i=e.cryptogetAccountBalance;return Promise.resolve(_m._fromProtobuf(i))}_onMakeRequest(e){return{cryptogetAccountBalance:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`AccountBalanceQuery:${this._timestamp.toString()}`}};$r.set("cryptogetAccountBalance",ec._fromProtobuf);var UJt=Oe(br(),1);var NB=Oe(Jt(),1),pr=class r{constructor(e){this.seconds=e instanceof NB.default?e:NB.default.fromNumber(e),Object.freeze(this)}_toProtobuf(){return{seconds:this.seconds}}static _fromProtobuf(e){return new r(e.seconds)}};var RB=Oe(Jt(),1);var U8=class r extends ke{constructor(e={}){super(),this._key=null,this._initialBalance=null,this._sendRecordThreshold=AB,this._receiveRecordThreshold=AB,this._receiverSignatureRequired=!1,this._proxyAccountId=null,this._autoRenewPeriod=new pr(_u),this._accountMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=!1,this._alias=null,e.key!=null&&this.setKey(e.key),e.receiverSignatureRequired!=null&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),e.initialBalance!=null&&this.setInitialBalance(e.initialBalance),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.accountMemo!=null&&this.setAccountMemo(e.accountMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.alias!=null&&this.setAlias(e.alias)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoCreateAccount,c;return s.alias!=null&&s.alias.length>0&&s.alias.length===20&&(c=ns.fromBytes(s.alias)),ke._fromProtobufTransactions(new r({key:s.key!=null?nt._fromProtobufKey(s.key):void 0,initialBalance:s.initialBalance!=null?s.initialBalance:void 0,receiverSignatureRequired:s.receiverSigRequired!=null?s.receiverSigRequired:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,accountMemo:s.memo!=null?s.memo:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null?s.maxAutomaticTokenAssociations:void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward==!0,alias:c}),e,t,n,i,a)}get key(){return this._key}setKey(e){return this._requireNotFrozen(),this._key=e,this}get initialBalance(){return this._initialBalance}setInitialBalance(e){return this._requireNotFrozen(),this._initialBalance=e instanceof Ge?e:new Ge(e),this}get receiverSignatureRequired(){return this._receiverSignatureRequired}setReceiverSignatureRequired(e){return this._requireNotFrozen(),this._receiverSignatureRequired=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get accountMemo(){return this._accountMemo}setAccountMemo(e){return this._requireNotFrozen(),this._accountMemo=e,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=typeof e=="number"?RB.default.fromNumber(e):e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=RB.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get alias(){return this._alias}setAlias(e){if(typeof e=="string")if(e.startsWith("0x")&&e.length==42||e.length==40)this._alias=ns.fromString(e);else throw new Error('evmAddress must be a valid EVM address with or without "0x" prefix');else this._alias=e;return this}_validateChecksums(e){this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.createAccount(t)}_getTransactionDataCase(){return"cryptoCreateAccount"}_makeTransactionData(){let e=null;return this._alias!=null&&(e=this._alias.toBytes()),{key:this._key!=null?this._key._toProtobufKey():null,initialBalance:this._initialBalance!=null?this._initialBalance.toTinybars():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,receiveRecordThreshold:this._receiveRecordThreshold.toTinybars(),sendRecordThreshold:this._sendRecordThreshold.toTinybars(),receiverSigRequired:this._receiverSignatureRequired,memo:this._accountMemo,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?this._maxAutomaticTokenAssociations.toInt():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards,alias:e}}_getLogId(){return`AccountCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoCreateAccount",U8._fromProtobuf);var q8=class r extends ke{constructor(e={}){super(),this._accountId=null,this._transferAccountId=null,e.accountId!=null&&this.setAccountId(e.accountId),e.transferAccountId!=null&&this.setTransferAccountId(e.transferAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDelete;return ke._fromProtobufTransactions(new r({accountId:s.deleteAccountID!=null?ne._fromProtobuf(s.deleteAccountID):void 0,transferAccountId:s.transferAccountID!=null?ne._fromProtobuf(s.transferAccountID):void 0}),e,t,n,i,a)}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get transferAccountId(){return this._transferAccountId}setTransferAccountId(e){return this._requireNotFrozen(),this._transferAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._transferAccountId!=null&&this._transferAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.cryptoDelete(t)}_getTransactionDataCase(){return"cryptoDelete"}_makeTransactionData(){return{deleteAccountID:this._accountId!=null?this._accountId._toProtobuf():null,transferAccountID:this._transferAccountId!=null?this._transferAccountId._toProtobuf():null}}_getLogId(){return`AccountDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoDelete",q8._fromProtobuf);var OB=Oe(br(),1),c1=class r{constructor(e){this.declineStakingReward=e.declineStakingReward,this.stakePeriodStart=e.stakePeriodStart,this.pendingReward=e.pendingReward,this.stakedToMe=e.stakedToMe,this.stakedAccountId=e.stakedAccountId,this.stakedNodeId=e.stakedNodeId,Object.freeze(this)}static _fromProtobuf(e){return new r({declineStakingReward:e.declineReward==!0,stakePeriodStart:e.stakePeriodStart!=null?ut._fromProtobuf(e.stakePeriodStart):null,pendingReward:e.pendingReward!=null?Ge.fromTinybars(e.pendingReward):null,stakedToMe:e.stakedToMe!=null?Ge.fromTinybars(e.stakedToMe):null,stakedAccountId:e.stakedAccountId!=null?ne._fromProtobuf(e.stakedAccountId):null,stakedNodeId:e.stakedNodeId!=null?e.stakedNodeId:null})}_toProtobuf(){return{declineReward:this.declineStakingReward,stakePeriodStart:this.stakePeriodStart!=null?this.stakePeriodStart._toProtobuf():null,pendingReward:this.pendingReward!=null?this.pendingReward.toTinybars():null,stakedToMe:this.stakedToMe!=null?this.stakedToMe.toTinybars():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId}}static fromBytes(e){return r._fromProtobuf(OB.proto.StakingInfo.decode(e))}toBytes(){return OB.proto.StakingInfo.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{declineStakingReward:this.declineStakingReward,stakePeriodStart:this.stakePeriodStart!=null?this.stakePeriodStart.toString():null,pendingReward:this.pendingReward!=null?this.pendingReward.toString():null,stakedToMe:this.stakedToMe!=null?this.stakedToMe.toString():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId.toString():null,stakedNodeId:this.stakedNodeId!=null?this.stakedNodeId.toString():null}}};var Df=class r{constructor(e){this.accountId=e.accountId,this.hash=e.hash,this.keys=e.keys,this.duration=e.duration,Object.freeze(this)}static _fromProtobuf(e){let t=e;return new r({accountId:ne._fromProtobuf(t.accountId),hash:t.hash!=null?t.hash:new Uint8Array,keys:t.keys!=null?Oi.__fromProtobufKeyList(t.keys):new Oi,duration:pr._fromProtobuf(t.duration)})}_toProtobuf(){return{accountId:this.accountId._toProtobuf(),hash:this.hash,keys:this.keys._toProtobufKey().keyList,duration:this.duration._toProtobuf()}}};var u1=Oe(Jt(),1);var kx=Oe(Jt(),1);var j8=class r{constructor(e){this.tokenId=e.tokenId,this.symbol=e.symbol,this.balance=e.balance,this.isKycGranted=e.isKycGranted,this.isFrozen=e.isFrozen,this.automaticAssociation=e.automaticAssociation,Object.freeze(this)}static _fromProtobuf(e){let t=De._fromProtobuf(e.tokenId),n=e.kycStatus==null||e.kycStatus===0?null:e.kycStatus===1,i=e.freezeStatus==null||e.freezeStatus===0?null:e.freezeStatus===1;return new r({tokenId:t,symbol:e.symbol,balance:e.balance!=null?e.balance instanceof kx.default?e.balance:kx.default.fromValue(e.balance):kx.default.ZERO,isKycGranted:n,isFrozen:i,automaticAssociation:e.automaticAssociation!=null?e.automaticAssociation:null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),symbol:this.symbol,balance:this.balance,kycStatus:this.isKycGranted==null?0:this.isKycGranted?1:2,freezeStatus:this.isFrozen==null?0:this.isFrozen?1:2,automaticAssociation:this.automaticAssociation}}};var l1=class r extends fi{constructor(){super(e=>De.fromString(e))}static _fromProtobuf(e){let t=new r;for(let n of e){let i=De._fromProtobuf(n.tokenId);t._set(i,j8._fromProtobuf(n))}return t}_toProtobuf(){let e=[];for(let[t,n]of this)e.push(n._toProtobuf());return e}};var V8=Oe(br(),1);var gr=class r{constructor(e){this._ledgerId=e,Object.freeze(this)}static fromString(e){switch(e){case tc[0]:case"0":return r.MAINNET;case tc[1]:case"1":return r.TESTNET;case tc[2]:case"2":return r.PREVIEWNET;case tc[3]:case"3":return r.LOCAL_NODE;default:{let t=tt(e);if(t.length==0&&e.length!=0)throw new Error("Default reached for fromString");return new r(t)}}}toString(){if(this._ledgerId.length==1)switch(this._ledgerId[0]){case 0:return tc[0];case 1:return tc[1];case 2:return tc[2];case 3:return tc[3];default:return Ke(this._ledgerId)}else return Ke(this._ledgerId)}static fromBytes(e){return new r(e)}toBytes(){return this._ledgerId}isMainnet(){return this.toString()==tc[0]}isTestnet(){return this.toString()==tc[1]}isPreviewnet(){return this.toString()==tc[2]}isLocalNode(){return this.toString()==tc[3]}},tc=["mainnet","testnet","previewnet","local-node"];gr.MAINNET=new gr(new Uint8Array([0]));gr.TESTNET=new gr(new Uint8Array([1]));gr.PREVIEWNET=new gr(new Uint8Array([2]));gr.LOCAL_NODE=new gr(new Uint8Array([3]));var Em=class r{constructor(e){this.accountId=e.accountId,this.contractAccountId=e.contractAccountId,this.isDeleted=e.isDeleted,this.proxyAccountId=e.proxyAccountId,this.proxyReceived=e.proxyReceived,this.key=e.key,this.balance=e.balance,this.sendRecordThreshold=e.sendRecordThreshold,this.receiveRecordThreshold=e.receiveRecordThreshold,this.isReceiverSignatureRequired=e.isReceiverSignatureRequired,this.expirationTime=e.expirationTime,this.autoRenewPeriod=e.autoRenewPeriod,this.liveHashes=e.liveHashes,this.tokenRelationships=e.tokenRelationships,this.accountMemo=e.accountMemo,this.ownedNfts=e.ownedNfts,this.maxAutomaticTokenAssociations=e.maxAutomaticTokenAssociations,this.aliasKey=e.aliasKey,this.ledgerId=e.ledgerId,this.hbarAllowances=e.hbarAllowances,this.tokenAllowances=e.tokenAllowances,this.nftAllowances=e.nftAllowances,this.ethereumNonce=e.ethereumNonce,this.stakingInfo=e.stakingInfo,Object.freeze(this)}static _fromProtobuf(e){let t=e.alias!=null&&e.alias.length>0?nt._fromProtobufKey(V8.proto.Key.decode(e.alias)):null;t instanceof ei||(t=null);let n=ne._fromProtobuf(e.accountID);return new r({accountId:n,contractAccountId:e.contractAccountID!=null?e.contractAccountID:null,isDeleted:e.deleted!=null?e.deleted:!1,key:nt._fromProtobufKey(e.key),balance:Ge.fromTinybars(e.balance!=null?e.balance:0),sendRecordThreshold:Ge.fromTinybars(e.generateSendRecordThreshold!=null?e.generateSendRecordThreshold:0),receiveRecordThreshold:Ge.fromTinybars(e.generateReceiveRecordThreshold!=null?e.generateReceiveRecordThreshold:0),isReceiverSignatureRequired:e.receiverSigRequired!=null?e.receiverSigRequired:!1,expirationTime:ut._fromProtobuf(e.expirationTime),autoRenewPeriod:e.autoRenewPeriod!=null?new pr(e.autoRenewPeriod.seconds):new pr(0),proxyAccountId:e.proxyAccountID!=null&&u1.default.fromValue(e.proxyAccountID.shardNum).toInt()!==0&&u1.default.fromValue(e.proxyAccountID.realmNum).toInt()!==0&&u1.default.fromValue(e.proxyAccountID.accountNum).toInt()!==0?ne._fromProtobuf(e.proxyAccountID):null,proxyReceived:Ge.fromTinybars(e.proxyReceived!=null?e.proxyReceived:0),liveHashes:(e.liveHashes!=null?e.liveHashes:[]).map(i=>Df._fromProtobuf(i)),tokenRelationships:l1._fromProtobuf(e.tokenRelationships!=null?e.tokenRelationships:[]),accountMemo:e.memo!=null?e.memo:"",ownedNfts:e.ownedNfts?e.ownedNfts:u1.default.ZERO,maxAutomaticTokenAssociations:e.maxAutomaticTokenAssociations?u1.default.fromNumber(e.maxAutomaticTokenAssociations):u1.default.ZERO,aliasKey:t,ledgerId:e.ledgerId!=null?gr.fromBytes(e.ledgerId):null,hbarAllowances:[],tokenAllowances:[],nftAllowances:[],ethereumNonce:e.ethereumNonce!=null?e.ethereumNonce:null,stakingInfo:e.stakingInfo!=null?c1._fromProtobuf(e.stakingInfo):null})}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),contractAccountID:this.contractAccountId,deleted:this.isDeleted,proxyAccountID:this.proxyAccountId!=null?this.proxyAccountId._toProtobuf():null,proxyReceived:this.proxyReceived.toTinybars(),key:this.key._toProtobufKey(),balance:this.balance.toTinybars(),generateSendRecordThreshold:this.sendRecordThreshold.toTinybars(),generateReceiveRecordThreshold:this.receiveRecordThreshold.toTinybars(),receiverSigRequired:this.isReceiverSignatureRequired,expirationTime:this.expirationTime._toProtobuf(),autoRenewPeriod:this.autoRenewPeriod._toProtobuf(),liveHashes:this.liveHashes.map(e=>e._toProtobuf()),tokenRelationships:this.tokenRelationships!=null?this.tokenRelationships._toProtobuf():null,memo:this.accountMemo,ownedNfts:this.ownedNfts,maxAutomaticTokenAssociations:this.maxAutomaticTokenAssociations.toInt(),alias:this.aliasKey!=null?V8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():null,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,ethereumNonce:this.ethereumNonce,stakingInfo:this.stakingInfo!=null?this.stakingInfo._toProtobuf():null}}static fromBytes(e){return r._fromProtobuf(V8.proto.CryptoGetInfoResponse.AccountInfo.decode(e))}toBytes(){return V8.proto.CryptoGetInfoResponse.AccountInfo.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{balance:this.balance.toString(),accountId:this.accountId.toString(),contractAccountId:this.contractAccountId,isDeleted:this.isDeleted,proxyAccountId:this.proxyAccountId!=null?this.proxyAccountId.toString():null,proxyReceived:this.proxyReceived.toString(),key:this.key!=null?this.key.toString():null,sendRecordThreshold:this.sendRecordThreshold.toString(),receiveRecordThreshold:this.receiveRecordThreshold.toString(),isReceiverSignatureRequired:this.isReceiverSignatureRequired,expirationTime:this.expirationTime.toString(),autoRenewPeriod:this.autoRenewPeriod.toString(),accountMemo:this.accountMemo,ownedNfts:this.ownedNfts.toString(),maxAutomaticTokenAssociations:this.maxAutomaticTokenAssociations.toString(),aliasKey:this.aliasKey!=null?this.aliasKey.toString():null,ledgerId:this.ledgerId!=null?this.ledgerId.toString():null,ethereumNonce:this.ethereumNonce!=null?this.ethereumNonce.toString():null,stakingInfo:this.stakingInfo!=null?this.stakingInfo.toJSON():null}}};var sl=class r extends Ar{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetInfo;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getAccountInfo(t)}async getCost(e){return super.getCost(e)}_mapResponseHeader(e){return e.cryptoGetInfo.header}_mapResponse(e,t,n){let i=e.cryptoGetInfo;return Promise.resolve(Em._fromProtobuf(i.accountInfo))}_onMakeRequest(e){return{cryptoGetInfo:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("cryptoGetInfo",sl._fromProtobuf);var Eu=class r extends Ar{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetAccountRecords;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getAccountRecords(t)}_mapResponseHeader(e){return e.cryptoGetAccountRecords.header}_mapResponse(e,t,n){let a=e.cryptoGetAccountRecords.records;return Promise.resolve(a.map(o=>wu._fromProtobuf({transactionRecord:o})))}_onMakeRequest(e){return{cryptoGetAccountRecords:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountRecordsQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("cryptoGetAccountRecords",Eu._fromProtobuf);var xm=class r{constructor(e){this.accountId=e.accountId,this.amount=e.amount instanceof Ge?e.amount:new Ge(e.amount),Object.freeze(this)}static _fromProtobuf(e){return new r({accountId:ne._fromProtobuf(e.accountID),amount:Ge.fromTinybars(e.amount!=null?e.amount:0)})}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount.toTinybars()}}};var H8=class r extends Ar{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetProxyStakers;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getStakersByAccountID(t)}_mapResponseHeader(e){return e.cryptoGetProxyStakers.header}_mapResponse(e){let n=e.cryptoGetProxyStakers.stakers;return Promise.resolve((n.proxyStaker!=null?n.proxyStaker:[]).map(i=>xm._fromProtobuf(i)))}_onMakeRequest(e){return{cryptoGetProxyStakers:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountStakersQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("cryptoGetProxyStakers",H8._fromProtobuf);var K8=Oe(Jt(),1);var z8=class r extends ke{constructor(e={}){super(),this._accountId=null,this._key=null,this._receiverSignatureRequired=!1,this._proxyAccountId=null,this._autoRenewPeriod=null,this._expirationTime=null,this._accountMemo=null,this._maxAutomaticTokenAssociations=null,this._aliasKey=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=null,e.accountId!=null&&this.setAccountId(e.accountId),e.key!=null&&this.setKey(e.key),e.receiverSignatureRequired!=null&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.accountMemo!=null&&this.setAccountMemo(e.accountMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoUpdateAccount;return ke._fromProtobufTransactions(new r({accountId:s.accountIDToUpdate!=null?ne._fromProtobuf(s.accountIDToUpdate):void 0,key:s.key!=null?nt._fromProtobufKey(s.key):void 0,receiverSignatureRequired:s.receiverSigRequired!=null?s.receiverSigRequired:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0,accountMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null&&s.maxAutomaticTokenAssociations.value!=null?K8.default.fromNumber(s.maxAutomaticTokenAssociations.value):void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward!=null&&!!s.declineReward}),e,t,n,i,a)}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get key(){return this._key}setKey(e){return this._requireNotFrozen(),this._key=e,this}get receiverSignatureRequired(){return this._receiverSignatureRequired}setReceiverSignatureRequired(e){return this._requireNotFrozen(),this._receiverSignatureRequired=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof Date?ut.fromDate(e):e,this}get accountMemo(){return this._accountMemo}setAccountMemo(e){return this._requireNotFrozen(),this._accountMemo=e,this}clearAccountMemo(){return this._requireNotFrozen(),this._accountMemo=null,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=typeof e=="number"?K8.default.fromNumber(e):e,this}get aliasKey(){return null}setAliasKey(e){return this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}clearStakedAccountId(){return this._requireNotFrozen(),this._stakedAccountId=new ne(0,0,0),this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=K8.default.fromValue(e),this}clearStakedNodeId(){return this._requireNotFrozen(),this._stakedNodeId=K8.default.fromNumber(-1),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.updateAccount(t)}_getTransactionDataCase(){return"cryptoUpdateAccount"}_makeTransactionData(){return{accountIDToUpdate:this._accountId!=null?this._accountId._toProtobuf():null,key:this._key!=null?this._key._toProtobufKey():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,receiverSigRequiredWrapper:this._receiverSignatureRequired==null?null:{value:this._receiverSignatureRequired},memo:this._accountMemo!=null?{value:this._accountMemo}:null,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?{value:this._maxAutomaticTokenAssociations.toInt()}:null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards!=null?{value:this.declineStakingRewards}:null}}_getLogId(){return`AccountUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoUpdateAccount",z8._fromProtobuf);var Am=class{constructor(e={}){this._left=null,e.left!=null&&this.setLeft(e.left),this._right=null,e.right!=null&&this.setRight(e.right)}get left(){return this._left}setLeft(e){return this._left=e,this}get right(){return this._right}setRight(e){return this._right=e,this}toString(){return this._left!=null&&this._right!=null?`${this._left.toString()}.${this._right.toString()}`:""}};var G8=class r{constructor(e={}){this._network=null,e.network!=null&&this.setNetwork(e.network),this._host=null,e.host!=null&&this.setHost(e.host)}get newtork(){return this._network}setNetwork(e){return this._network=e,this}get host(){return this._host}setHost(e){return this._host=e,this}static _fromProtobuf(e){return new r({network:new Am().setLeft(e[0]).setRight(e[1]),host:new Am().setLeft(e[2]).setRight(e[3])})}_toProtobuf(){return Uint8Array.of(this._network!=null&&this._network._left!=null?this._network._left:0,this._network!=null&&this._network.right!=null?this._network.right:0,this._host!=null&&this._host.left!=null?this._host.left:0,this._host!=null&&this._host.right!=null?this._host.right:0)}toString(){return this._network!=null&&this._host!=null?`${this._network.toString()}.${this._host.toString()}`:""}};var W8=class r{constructor(e={}){this._address=null,e.address!=null&&this.setAddress(e.address),this._port=null,e.port!=null&&this.setPort(e.port)}get address(){return this.address}setAddress(e){return this._address=e,this}get port(){return this._port}setPort(e){return this._port=e,this}static _fromProtobuf(e){return new r({address:e.ipAddressV4!=null?G8._fromProtobuf(e.ipAddressV4):void 0,port:e.port!=null?e.port:void 0})}_toProtobuf(){return{ipAddressV4:this._address!=null?this._address._toProtobuf():null,port:this._port}}toString(){return`${this._address!=null?this._address.toString():""}:${this._port!=null?this._port.toString():""}`}toJSON(){return{address:this._address!=null?this._address.toString():null,port:this._port!=null?this._port.toString():null}}};var d1=class r{constructor(e={}){this._publicKey=null,e.publicKey!=null&&this.setPublicKey(e.publicKey),this._nodeId=null,e.nodeId!=null&&this.setNodeId(e.nodeId),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._certHash=null,e.certHash!=null&&this.setCertHash(e.certHash),this._addresses=[],e.addresses!=null&&this.setAddresses(e.addresses),this._description=null,e.description!=null&&this.setDescription(e.description),this._stake=null,e.stake!=null&&this.setStake(e.stake)}get publicKey(){return this._publicKey}setPublicKey(e){return this._publicKey=e,this}get nodeId(){return this._nodeId}setNodeId(e){return this._nodeId=e,this}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get certHash(){return this._certHash}setCertHash(e){return this._certHash=e,this}get addresses(){return this._addresses}setAddresses(e){return this._addresses=e,this}get description(){return this._description}setDescription(e){return this._description=e,this}get stake(){return this._stake}setStake(e){return this._stake=e,this}static _fromProtobuf(e){return new r({publicKey:e.RSA_PubKey!=null?e.RSA_PubKey:void 0,nodeId:e.nodeId!=null?e.nodeId:void 0,accountId:e.nodeAccountId!=null?ne._fromProtobuf(e.nodeAccountId):void 0,certHash:e.nodeCertHash!=null?e.nodeCertHash:void 0,addresses:e.serviceEndpoint!=null?e.serviceEndpoint.map(t=>W8._fromProtobuf(t)):void 0,description:e.description!=null?e.description:void 0,stake:e.stake!=null?e.stake:void 0})}_toProtobuf(){return{RSA_PubKey:this._publicKey,nodeId:this._nodeId,nodeAccountId:this._accountId!=null?this._accountId._toProtobuf():null,nodeCertHash:this._certHash,serviceEndpoint:this._addresses.map(e=>e._toProtobuf()),description:this._description,stake:this._stake}}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{publicKey:this._publicKey,nodeId:this._nodeId!=null?this._nodeId.toString():null,accountId:this._accountId!=null?this._accountId.toString():null,certHash:this._certHash!=null?m8(this._certHash):null,addresses:this._addresses.map(e=>e.toJSON()),description:this._description,stake:this._stake!=null?this._stake.toString():null}}};var DB=Oe(br(),1),a3=class r{constructor(e={}){this._nodeAddresses=[],e.nodeAddresses!=null&&this.setNodeAddresses(e.nodeAddresses)}get nodeAddresses(){return this._nodeAddresses}setNodeAddresses(e){return this._nodeAddresses=e,this}static fromBytes(e){return r._fromProtobuf(DB.proto.NodeAddressBook.decode(e))}static _fromProtobuf(e){return new r({nodeAddresses:e.nodeAddress!=null?e.nodeAddress.map(t=>d1._fromProtobuf(t)):void 0})}_toProtobuf(){return{nodeAddress:this._nodeAddresses.map(e=>e._toProtobuf())}}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{nodeAddresses:this._nodeAddresses.map(e=>e.toJSON())}}toBytes(){return DB.proto.NodeAddressBook.encode(this._toProtobuf()).finish()}};var Nx=Oe(br(),1);var Q8=class extends Ar{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId),this._limit=null,e.limit!=null&&this.setLimit(e.limit),this._retryHandler=t=>{if(t!=null){if(t instanceof Error)return!0;switch(t.code){case 13:return ME.test(t.details.toString());case 5:case 8:case 14:case 17:return!0;default:return!1}}return!1},this._addresses=[],this._attempt=0}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}get limit(){return this._limit}setLimit(e){return this._limit=e,this}setMaxAttempts(e){return this._maxAttempts=e,this}setMaxBackoff(e){return this._maxBackoff=e,this}execute(e,t){return new Promise((n,i)=>{this._makeServerStreamRequest(e,n,i,t)})}_makeServerStreamRequest(e,t,n,i){let a=Nx.com.hedera.mirror.api.proto.AddressBookQuery.encode({fileId:this._fileId!=null?this._fileId._toProtobuf():null,limit:this._limit}).finish();e._mirrorNetwork.getNextMirrorNode().getChannel().makeServerStreamRequest("NetworkService","getNodes",a,o=>{this._addresses.push(d1._fromProtobuf(Nx.proto.NodeAddress.decode(o))),this._limit!=null&&this._limit>0&&(this._limit=this._limit-1)},o=>{let s=o instanceof Error?o.message:o.details;if(this._attempt<this._maxAttempts&&!e.isClientShutDown&&this._retryHandler(o)){let c=Math.min(250*2**this._attempt,this._maxBackoff);this._attempt>=this._maxAttempts&&console.warn(`Error getting nodes from mirror for file ${this._fileId!=null?this._fileId.toString():"UNKNOWN"} during attempt ${this._attempt}. Waiting ${c} ms before next attempt: ${s}`),this._logger&&this._logger.debug(`Error getting nodes from mirror for file ${this._fileId!=null?this._fileId.toString():"UNKNOWN"} during attempt ${this._attempt}. Waiting ${c} ms before next attempt: ${s}`),this._attempt+=1,setTimeout(()=>{this._makeServerStreamRequest(e,t,n,i)},c)}else n(new Error("failed to query address book"))},()=>{t(new a3({nodeAddresses:this._addresses}))})}};ar.setAddressBookQueryConstructor(()=>new Q8);var $8=class r extends Ar{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.contractGetBytecode;return new r({contractId:t.contractID!=null?Et._fromProtobuf(t.contractID):void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.contractGetBytecode(t)}_mapResponseHeader(e){return e.contractGetBytecodeResponse.header}_mapResponse(e){let t=e.contractGetBytecodeResponse;return Promise.resolve(t.bytecode!=null?t.bytecode:new Uint8Array)}_onMakeRequest(e){return{contractGetBytecode:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`ContractByteCodeQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("contractGetBytecode",$8._fromProtobuf);var Pf="0123456789abcdef".split(""),qze=[1,256,65536,16777216],cl=[0,8,16,24],u3e=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],jze=r=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(r<<1)>>5,outputBlocks:r>>5,s:(e=>[].concat(e,e,e,e,e))([0,0,0,0,0,0,0,0,0,0])}),Vze=(r,e)=>{for(var t=e.length,n=r.blocks,i=r.blockCount<<2,a=r.blockCount,o=r.outputBlocks,s=r.s,c=0,l,u;c<t;){if(r.reset)for(r.reset=!1,n[0]=r.block,l=1;l<a+1;++l)n[l]=0;if(typeof e!="string")for(l=r.start;c<t&&l<i;++c)n[l>>2]|=e[c]<<cl[l++&3];else for(l=r.start;c<t&&l<i;++c)u=e.charCodeAt(c),u<128?n[l>>2]|=u<<cl[l++&3]:u<2048?(n[l>>2]|=(192|u>>6)<<cl[l++&3],n[l>>2]|=(128|u&63)<<cl[l++&3]):u<55296||u>=57344?(n[l>>2]|=(224|u>>12)<<cl[l++&3],n[l>>2]|=(128|u>>6&63)<<cl[l++&3],n[l>>2]|=(128|u&63)<<cl[l++&3]):(u=65536+((u&1023)<<10|e.charCodeAt(++c)&1023),n[l>>2]|=(240|u>>18)<<cl[l++&3],n[l>>2]|=(128|u>>12&63)<<cl[l++&3],n[l>>2]|=(128|u>>6&63)<<cl[l++&3],n[l>>2]|=(128|u&63)<<cl[l++&3]);if(r.lastByteIndex=l,l>=i){for(r.start=l-i,r.block=n[a],l=0;l<a;++l)s[l]^=n[l];PB(s),r.reset=!0}else r.start=l}if(l=r.lastByteIndex,n[l>>2]|=qze[l&3],r.lastByteIndex===i)for(n[0]=n[a],l=1;l<a+1;++l)n[l]=0;for(n[a-1]|=2147483648,l=0;l<a;++l)s[l]^=n[l];PB(s);var d="",h,g=0;for(l=0;g<o;){for(l=0;l<a&&g<o;++l,++g)h=s[l],d+=Pf[h>>4&15]+Pf[h&15]+Pf[h>>12&15]+Pf[h>>8&15]+Pf[h>>20&15]+Pf[h>>16&15]+Pf[h>>28&15]+Pf[h>>24&15];g%a===0&&(PB(s),l=0)}return"0x"+d},PB=r=>{var e,t,n,i,a,o,s,c,l,u,d,h,g,m,b,E,I,R,L,U,V,G,H,N,F,O,y,x,w,p,v,A,T,S,_,B,q,k,z,ie,M,te,oe,se,re,le,ae,ue,Ee,he,we,hn,at,mt,Wn,xt,St,vi,Tt,It,li,Ct,kt;for(n=0;n<48;n+=2)i=r[0]^r[10]^r[20]^r[30]^r[40],a=r[1]^r[11]^r[21]^r[31]^r[41],o=r[2]^r[12]^r[22]^r[32]^r[42],s=r[3]^r[13]^r[23]^r[33]^r[43],c=r[4]^r[14]^r[24]^r[34]^r[44],l=r[5]^r[15]^r[25]^r[35]^r[45],u=r[6]^r[16]^r[26]^r[36]^r[46],d=r[7]^r[17]^r[27]^r[37]^r[47],h=r[8]^r[18]^r[28]^r[38]^r[48],g=r[9]^r[19]^r[29]^r[39]^r[49],e=h^(o<<1|s>>>31),t=g^(s<<1|o>>>31),r[0]^=e,r[1]^=t,r[10]^=e,r[11]^=t,r[20]^=e,r[21]^=t,r[30]^=e,r[31]^=t,r[40]^=e,r[41]^=t,e=i^(c<<1|l>>>31),t=a^(l<<1|c>>>31),r[2]^=e,r[3]^=t,r[12]^=e,r[13]^=t,r[22]^=e,r[23]^=t,r[32]^=e,r[33]^=t,r[42]^=e,r[43]^=t,e=o^(u<<1|d>>>31),t=s^(d<<1|u>>>31),r[4]^=e,r[5]^=t,r[14]^=e,r[15]^=t,r[24]^=e,r[25]^=t,r[34]^=e,r[35]^=t,r[44]^=e,r[45]^=t,e=c^(h<<1|g>>>31),t=l^(g<<1|h>>>31),r[6]^=e,r[7]^=t,r[16]^=e,r[17]^=t,r[26]^=e,r[27]^=t,r[36]^=e,r[37]^=t,r[46]^=e,r[47]^=t,e=u^(i<<1|a>>>31),t=d^(a<<1|i>>>31),r[8]^=e,r[9]^=t,r[18]^=e,r[19]^=t,r[28]^=e,r[29]^=t,r[38]^=e,r[39]^=t,r[48]^=e,r[49]^=t,m=r[0],b=r[1],le=r[11]<<4|r[10]>>>28,ae=r[10]<<4|r[11]>>>28,x=r[20]<<3|r[21]>>>29,w=r[21]<<3|r[20]>>>29,It=r[31]<<9|r[30]>>>23,li=r[30]<<9|r[31]>>>23,te=r[40]<<18|r[41]>>>14,oe=r[41]<<18|r[40]>>>14,S=r[2]<<1|r[3]>>>31,_=r[3]<<1|r[2]>>>31,E=r[13]<<12|r[12]>>>20,I=r[12]<<12|r[13]>>>20,ue=r[22]<<10|r[23]>>>22,Ee=r[23]<<10|r[22]>>>22,p=r[33]<<13|r[32]>>>19,v=r[32]<<13|r[33]>>>19,Ct=r[42]<<2|r[43]>>>30,kt=r[43]<<2|r[42]>>>30,mt=r[5]<<30|r[4]>>>2,Wn=r[4]<<30|r[5]>>>2,B=r[14]<<6|r[15]>>>26,q=r[15]<<6|r[14]>>>26,R=r[25]<<11|r[24]>>>21,L=r[24]<<11|r[25]>>>21,he=r[34]<<15|r[35]>>>17,we=r[35]<<15|r[34]>>>17,A=r[45]<<29|r[44]>>>3,T=r[44]<<29|r[45]>>>3,N=r[6]<<28|r[7]>>>4,F=r[7]<<28|r[6]>>>4,xt=r[17]<<23|r[16]>>>9,St=r[16]<<23|r[17]>>>9,k=r[26]<<25|r[27]>>>7,z=r[27]<<25|r[26]>>>7,U=r[36]<<21|r[37]>>>11,V=r[37]<<21|r[36]>>>11,hn=r[47]<<24|r[46]>>>8,at=r[46]<<24|r[47]>>>8,se=r[8]<<27|r[9]>>>5,re=r[9]<<27|r[8]>>>5,O=r[18]<<20|r[19]>>>12,y=r[19]<<20|r[18]>>>12,vi=r[29]<<7|r[28]>>>25,Tt=r[28]<<7|r[29]>>>25,ie=r[38]<<8|r[39]>>>24,M=r[39]<<8|r[38]>>>24,G=r[48]<<14|r[49]>>>18,H=r[49]<<14|r[48]>>>18,r[0]=m^~E&R,r[1]=b^~I&L,r[10]=N^~O&x,r[11]=F^~y&w,r[20]=S^~B&k,r[21]=_^~q&z,r[30]=se^~le&ue,r[31]=re^~ae&Ee,r[40]=mt^~xt&vi,r[41]=Wn^~St&Tt,r[2]=E^~R&U,r[3]=I^~L&V,r[12]=O^~x&p,r[13]=y^~w&v,r[22]=B^~k&ie,r[23]=q^~z&M,r[32]=le^~ue&he,r[33]=ae^~Ee&we,r[42]=xt^~vi&It,r[43]=St^~Tt&li,r[4]=R^~U&G,r[5]=L^~V&H,r[14]=x^~p&A,r[15]=w^~v&T,r[24]=k^~ie&te,r[25]=z^~M&oe,r[34]=ue^~he&hn,r[35]=Ee^~we&at,r[44]=vi^~It&Ct,r[45]=Tt^~li&kt,r[6]=U^~G&m,r[7]=V^~H&b,r[16]=p^~A&N,r[17]=v^~T&F,r[26]=ie^~te&S,r[27]=M^~oe&_,r[36]=he^~hn&se,r[37]=we^~at&re,r[46]=It^~Ct&mt,r[47]=li^~kt&Wn,r[8]=G^~m&E,r[9]=H^~b&I,r[18]=A^~N&O,r[19]=T^~F&y,r[28]=te^~S&B,r[29]=oe^~_&q,r[38]=hn^~se&le,r[39]=at^~re&ae,r[48]=Ct^~mt&xt,r[49]=kt^~Wn&St,r[0]^=u3e[n],r[1]^=u3e[n+1]},Hze=r=>e=>{var t;if(e.slice(0,2)==="0x"){t=[];for(var n=2,i=e.length;n<i;n+=2)t.push(parseInt(e.slice(n,n+2),16))}else t=e;return Vze(jze(r),t)},d3e=Hze(256);var Q={uint8:0,int8:1,uint16:2,int16:3,uint24:4,int24:5,uint32:6,int32:7,uint40:8,int40:9,uint48:10,int48:11,uint56:12,int56:13,uint64:14,int64:15,uint72:16,int72:17,uint80:18,int80:19,uint88:20,int88:21,uint96:22,int96:23,uint104:24,int104:25,uint112:26,int112:27,uint120:28,int120:29,uint128:30,int128:31,uint136:32,int136:33,uint144:34,int144:35,uint152:36,int152:37,uint160:38,int160:39,uint168:40,int168:41,uint176:42,int176:43,uint184:44,int184:45,uint192:46,int192:47,uint200:48,int200:49,uint208:50,int208:51,uint216:52,int216:53,uint224:54,int224:55,uint232:56,int232:57,uint240:58,int240:59,uint248:60,int248:61,uint256:62,int256:63,string:64,bool:65,bytes:66,bytes32:67,address:68,func:69},Tm=class{constructor(e){this.name=null,this._params="",this._paramTypes=[],e!=null&&(this._name=e)}addString(){return this._addParam({ty:Q.string,array:!1})}addStringArray(){return this._addParam({ty:Q.string,array:!0})}addBytes(){return this._addParam({ty:Q.bytes,array:!1})}addBytes32(){return this._addParam({ty:Q.bytes32,array:!1})}addBytesArray(){return this._addParam({ty:Q.bytes,array:!0})}addBytes32Array(){return this._addParam({ty:Q.bytes32,array:!0})}addInt8(){return this._addParam({ty:Q.int8,array:!1})}addUint8(){return this._addParam({ty:Q.uint8,array:!1})}addInt16(){return this._addParam({ty:Q.int16,array:!1})}addUint16(){return this._addParam({ty:Q.uint16,array:!1})}addInt24(){return this._addParam({ty:Q.int24,array:!1})}addUint24(){return this._addParam({ty:Q.uint24,array:!1})}addInt32(){return this._addParam({ty:Q.int32,array:!1})}addUint32(){return this._addParam({ty:Q.uint32,array:!1})}addInt40(){return this._addParam({ty:Q.int40,array:!1})}addUint40(){return this._addParam({ty:Q.uint40,array:!1})}addInt48(){return this._addParam({ty:Q.int48,array:!1})}addUint48(){return this._addParam({ty:Q.uint48,array:!1})}addInt56(){return this._addParam({ty:Q.int56,array:!1})}addUint56(){return this._addParam({ty:Q.uint56,array:!1})}addInt64(){return this._addParam({ty:Q.int64,array:!1})}addUint64(){return this._addParam({ty:Q.uint64,array:!1})}addInt72(){return this._addParam({ty:Q.int72,array:!1})}addUint72(){return this._addParam({ty:Q.uint72,array:!1})}addInt80(){return this._addParam({ty:Q.int80,array:!1})}addUint80(){return this._addParam({ty:Q.uint80,array:!1})}addInt88(){return this._addParam({ty:Q.int88,array:!1})}addUint88(){return this._addParam({ty:Q.uint88,array:!1})}addInt96(){return this._addParam({ty:Q.int96,array:!1})}addUint96(){return this._addParam({ty:Q.uint96,array:!1})}addInt104(){return this._addParam({ty:Q.int104,array:!1})}addUint104(){return this._addParam({ty:Q.uint104,array:!1})}addInt112(){return this._addParam({ty:Q.int112,array:!1})}addUint112(){return this._addParam({ty:Q.uint112,array:!1})}addInt120(){return this._addParam({ty:Q.int120,array:!1})}addUint120(){return this._addParam({ty:Q.uint120,array:!1})}addInt128(){return this._addParam({ty:Q.int128,array:!1})}addUint128(){return this._addParam({ty:Q.uint128,array:!1})}addInt136(){return this._addParam({ty:Q.int136,array:!1})}addUint136(){return this._addParam({ty:Q.uint136,array:!1})}addInt144(){return this._addParam({ty:Q.int144,array:!1})}addUint144(){return this._addParam({ty:Q.uint144,array:!1})}addInt152(){return this._addParam({ty:Q.int152,array:!1})}addUint152(){return this._addParam({ty:Q.uint152,array:!1})}addInt160(){return this._addParam({ty:Q.int160,array:!1})}addUint160(){return this._addParam({ty:Q.uint160,array:!1})}addInt168(){return this._addParam({ty:Q.int168,array:!1})}addUint168(){return this._addParam({ty:Q.uint168,array:!1})}addInt176(){return this._addParam({ty:Q.int176,array:!1})}addUint176(){return this._addParam({ty:Q.uint176,array:!1})}addInt184(){return this._addParam({ty:Q.int184,array:!1})}addUint184(){return this._addParam({ty:Q.uint184,array:!1})}addInt192(){return this._addParam({ty:Q.int192,array:!1})}addUint192(){return this._addParam({ty:Q.uint192,array:!1})}addInt200(){return this._addParam({ty:Q.int200,array:!1})}addUint200(){return this._addParam({ty:Q.uint200,array:!1})}addInt208(){return this._addParam({ty:Q.int208,array:!1})}addUint208(){return this._addParam({ty:Q.uint208,array:!1})}addInt216(){return this._addParam({ty:Q.int216,array:!1})}addUint216(){return this._addParam({ty:Q.uint216,array:!1})}addInt224(){return this._addParam({ty:Q.int224,array:!1})}addUint224(){return this._addParam({ty:Q.uint224,array:!1})}addInt232(){return this._addParam({ty:Q.int232,array:!1})}addUint232(){return this._addParam({ty:Q.uint232,array:!1})}addInt240(){return this._addParam({ty:Q.int240,array:!1})}addUint240(){return this._addParam({ty:Q.uint240,array:!1})}addInt248(){return this._addParam({ty:Q.int248,array:!1})}addUint248(){return this._addParam({ty:Q.uint248,array:!1})}addInt256(){return this._addParam({ty:Q.int256,array:!1})}addUint256(){return this._addParam({ty:Q.uint256,array:!1})}addInt8Array(){return this._addParam({ty:Q.int8,array:!0})}addUint8Array(){return this._addParam({ty:Q.uint8,array:!0})}addInt16Array(){return this._addParam({ty:Q.int16,array:!0})}addUint16Array(){return this._addParam({ty:Q.uint16,array:!0})}addInt24Array(){return this._addParam({ty:Q.int24,array:!0})}addUint24Array(){return this._addParam({ty:Q.uint24,array:!0})}addInt32Array(){return this._addParam({ty:Q.int32,array:!0})}addUint32Array(){return this._addParam({ty:Q.uint32,array:!0})}addInt40Array(){return this._addParam({ty:Q.int40,array:!0})}addUint40Array(){return this._addParam({ty:Q.uint40,array:!0})}addInt48Array(){return this._addParam({ty:Q.int48,array:!0})}addUint48Array(){return this._addParam({ty:Q.uint48,array:!0})}addInt56Array(){return this._addParam({ty:Q.int56,array:!0})}addUint56Array(){return this._addParam({ty:Q.uint56,array:!0})}addInt64Array(){return this._addParam({ty:Q.int64,array:!0})}addUint64Array(){return this._addParam({ty:Q.uint64,array:!0})}addInt72Array(){return this._addParam({ty:Q.int72,array:!0})}addUint72Array(){return this._addParam({ty:Q.uint72,array:!0})}addInt80Array(){return this._addParam({ty:Q.int80,array:!0})}addUint80Array(){return this._addParam({ty:Q.uint80,array:!0})}addInt88Array(){return this._addParam({ty:Q.int88,array:!0})}addUint88Array(){return this._addParam({ty:Q.uint88,array:!0})}addInt96Array(){return this._addParam({ty:Q.int96,array:!0})}addUint96Array(){return this._addParam({ty:Q.uint96,array:!0})}addInt104Array(){return this._addParam({ty:Q.int104,array:!0})}addUint104Array(){return this._addParam({ty:Q.uint104,array:!0})}addInt112Array(){return this._addParam({ty:Q.int112,array:!0})}addUint112Array(){return this._addParam({ty:Q.uint112,array:!0})}addInt120Array(){return this._addParam({ty:Q.int120,array:!0})}addUint120Array(){return this._addParam({ty:Q.uint120,array:!0})}addInt128Array(){return this._addParam({ty:Q.int128,array:!0})}addUint128Array(){return this._addParam({ty:Q.uint128,array:!0})}addInt136Array(){return this._addParam({ty:Q.int136,array:!0})}addUint136Array(){return this._addParam({ty:Q.uint136,array:!0})}addInt144Array(){return this._addParam({ty:Q.int144,array:!0})}addUint144Array(){return this._addParam({ty:Q.uint144,array:!0})}addInt152Array(){return this._addParam({ty:Q.int152,array:!0})}addUint152Array(){return this._addParam({ty:Q.uint152,array:!0})}addInt160Array(){return this._addParam({ty:Q.int160,array:!0})}addUint160Array(){return this._addParam({ty:Q.uint160,array:!0})}addInt168Array(){return this._addParam({ty:Q.int168,array:!0})}addUint168Array(){return this._addParam({ty:Q.uint168,array:!0})}addInt176Array(){return this._addParam({ty:Q.int176,array:!0})}addUint176Array(){return this._addParam({ty:Q.uint176,array:!0})}addInt184Array(){return this._addParam({ty:Q.int184,array:!0})}addUint184Array(){return this._addParam({ty:Q.uint184,array:!0})}addInt192Array(){return this._addParam({ty:Q.int192,array:!0})}addUint192Array(){return this._addParam({ty:Q.uint192,array:!0})}addInt200Array(){return this._addParam({ty:Q.int200,array:!0})}addUint200Array(){return this._addParam({ty:Q.uint200,array:!0})}addInt208Array(){return this._addParam({ty:Q.int208,array:!0})}addUint208Array(){return this._addParam({ty:Q.uint208,array:!0})}addInt216Array(){return this._addParam({ty:Q.int216,array:!0})}addUint216Array(){return this._addParam({ty:Q.uint216,array:!0})}addInt224Array(){return this._addParam({ty:Q.int224,array:!0})}addUint224Array(){return this._addParam({ty:Q.uint224,array:!0})}addInt232Array(){return this._addParam({ty:Q.int232,array:!0})}addUint232Array(){return this._addParam({ty:Q.uint232,array:!0})}addInt240Array(){return this._addParam({ty:Q.int240,array:!0})}addUint240Array(){return this._addParam({ty:Q.uint240,array:!0})}addInt248Array(){return this._addParam({ty:Q.int248,array:!0})}addUint248Array(){return this._addParam({ty:Q.uint248,array:!0})}addInt256Array(){return this._addParam({ty:Q.int256,array:!0})}addUint256Array(){return this._addParam({ty:Q.uint256,array:!0})}addBool(){return this._addParam({ty:Q.bool,array:!1})}addAddress(){return this._addParam({ty:Q.address,array:!1})}addAddressArray(){return this._addParam({ty:Q.address,array:!0})}addFunction(){return this._addParam({ty:Q.func,array:!1})}_addParam(e){return this._paramTypes.length>0&&(this._params+=","),this._params+=BB(e),this._paramTypes.push(e),this}_build(e){if(e!=null)this._name=e;else if(this._name==null)throw new Error("`name` required for ContractFunctionSelector");let t=Ke(i3(this.toString()));return tt(d3e(`0x${t}`)).slice(0,4)}toString(){return`${this._name!=null?this._name.toString():""}(${this._params})`}};function BB(r){let e="";switch(r.ty){case Q.uint8:e="uint8";break;case Q.int8:e="int8";break;case Q.uint16:e="uint16";break;case Q.int16:e="int16";break;case Q.uint24:e="uint24";break;case Q.int24:e="int24";break;case Q.uint32:e="uint32";break;case Q.int32:e="int32";break;case Q.uint40:e="uint40";break;case Q.int40:e="int40";break;case Q.uint48:e="uint48";break;case Q.int48:e="int48";break;case Q.uint56:e="uint56";break;case Q.int56:e="int56";break;case Q.uint64:e="uint64";break;case Q.int64:e="int64";break;case Q.uint72:e="uint72";break;case Q.int72:e="int72";break;case Q.uint80:e="uint80";break;case Q.int80:e="int80";break;case Q.uint88:e="uint88";break;case Q.int88:e="int88";break;case Q.uint96:e="uint96";break;case Q.int96:e="int96";break;case Q.uint104:e="uint104";break;case Q.int104:e="int104";break;case Q.uint112:e="uint112";break;case Q.int112:e="int112";break;case Q.uint120:e="uint120";break;case Q.int120:e="int120";break;case Q.uint128:e="uint128";break;case Q.int128:e="int128";break;case Q.uint136:e="uint136";break;case Q.int136:e="int136";break;case Q.uint144:e="uint144";break;case Q.int144:e="int144";break;case Q.uint152:e="uint152";break;case Q.int152:e="int152";break;case Q.uint160:e="uint160";break;case Q.int160:e="int160";break;case Q.uint168:e="uint168";break;case Q.int168:e="int168";break;case Q.uint176:e="uint176";break;case Q.int176:e="int176";break;case Q.uint184:e="uint184";break;case Q.int184:e="int184";break;case Q.uint192:e="uint192";break;case Q.int192:e="int192";break;case Q.uint200:e="uint200";break;case Q.int200:e="int200";break;case Q.uint208:e="uint208";break;case Q.int208:e="int208";break;case Q.uint216:e="uint216";break;case Q.int216:e="int216";break;case Q.uint224:e="uint224";break;case Q.int224:e="int224";break;case Q.uint232:e="uint232";break;case Q.int232:e="int232";break;case Q.uint240:e="uint240";break;case Q.int240:e="int240";break;case Q.uint248:e="uint248";break;case Q.int248:e="int248";break;case Q.uint256:e="uint256";break;case Q.int256:e="int256";break;case Q.string:e="string";break;case Q.bool:e="bool";break;case Q.bytes:e="bytes";break;case Q.bytes32:e="bytes32";break;case Q.address:e="address";break;case Q.func:e="function";break;default:e="";break}return r.array&&(e+="[]"),e}var f3e=Oe(_B(),1),p3e=Oe(na(),1);var xu=class{constructor(){this._selector=new Tm,this._arguments=[]}addString(e){return this._selector.addString(),this._addParam(e,!0)}addStringArray(e){return this._selector.addStringArray(),this._addParam(e,!0)}addBytes(e){return this._selector.addBytes(),this._addParam(e,!0)}addBytes32(e){if(e.length!==32)throw new Error(`addBytes32 expected array to be of length 32, but received ${e.length}`);return this._selector.addBytes32(),this._addParam(e,!1)}addBytesArray(e){return this._selector.addBytesArray(),this._addParam(e,!0)}addBytes32Array(e){for(let[t,n]of e.entries())if(n.length!==32)throw new Error(`addBytes32 expected array to be of length 32, but received ${n.length}`);return this._selector.addBytes32Array(),this._addParam(e,!0)}addBool(e){return this._selector.addBool(),this._addParam(e,!1)}addInt8(e){return this._selector.addInt8(),this._addParam(vt(e),!1)}addUint8(e){return this._selector.addUint8(),this._addParam(vt(e),!1)}addInt16(e){return this._selector.addInt16(),this._addParam(vt(e),!1)}addUint16(e){return this._selector.addUint16(),this._addParam(vt(e),!1)}addInt24(e){return this._selector.addInt24(),this._addParam(vt(e),!1)}addUint24(e){return this._selector.addUint24(),this._addParam(vt(e),!1)}addInt32(e){return this._selector.addInt32(),this._addParam(vt(e),!1)}addUint32(e){return this._selector.addUint32(),this._addParam(vt(e),!1)}addInt40(e){return this._selector.addInt40(),this._addParam(vt(e),!1)}addUint40(e){return this._selector.addUint40(),this._addParam(vt(e),!1)}addInt48(e){return this._selector.addInt48(),this._addParam(vt(e),!1)}addUint48(e){return this._selector.addUint48(),this._addParam(vt(e),!1)}addInt56(e){return this._selector.addInt56(),this._addParam(vt(e),!1)}addUint56(e){return this._selector.addUint56(),this._addParam(vt(e),!1)}addInt64(e){return this._selector.addInt64(),this._addParam(vt(e),!1)}addUint64(e){return this._selector.addUint64(),this._addParam(vt(e),!1)}addInt72(e){return this._selector.addInt72(),this._addParam(vt(e),!1)}addUint72(e){return this._selector.addUint72(),this._addParam(vt(e),!1)}addInt80(e){return this._selector.addInt80(),this._addParam(vt(e),!1)}addUint80(e){return this._selector.addUint80(),this._addParam(vt(e),!1)}addInt88(e){return this._selector.addInt88(),this._addParam(vt(e),!1)}addUint88(e){return this._selector.addUint88(),this._addParam(vt(e),!1)}addInt96(e){return this._selector.addInt96(),this._addParam(vt(e),!1)}addUint96(e){return this._selector.addUint96(),this._addParam(vt(e),!1)}addInt104(e){return this._selector.addInt104(),this._addParam(vt(e),!1)}addUint104(e){return this._selector.addUint104(),this._addParam(vt(e),!1)}addInt112(e){return this._selector.addInt112(),this._addParam(vt(e),!1)}addUint112(e){return this._selector.addUint112(),this._addParam(vt(e),!1)}addInt120(e){return this._selector.addInt120(),this._addParam(vt(e),!1)}addUint120(e){return this._selector.addUint120(),this._addParam(vt(e),!1)}addInt128(e){return this._selector.addInt128(),this._addParam(vt(e),!1)}addUint128(e){return this._selector.addUint128(),this._addParam(vt(e),!1)}addInt136(e){return this._selector.addInt136(),this._addParam(vt(e),!1)}addUint136(e){return this._selector.addUint136(),this._addParam(vt(e),!1)}addInt144(e){return this._selector.addInt144(),this._addParam(vt(e),!1)}addUint144(e){return this._selector.addUint144(),this._addParam(vt(e),!1)}addInt152(e){return this._selector.addInt152(),this._addParam(vt(e),!1)}addUint152(e){return this._selector.addUint152(),this._addParam(vt(e),!1)}addInt160(e){return this._selector.addInt160(),this._addParam(vt(e),!1)}addUint160(e){return this._selector.addUint160(),this._addParam(vt(e),!1)}addInt168(e){return this._selector.addInt168(),this._addParam(vt(e),!1)}addUint168(e){return this._selector.addUint168(),this._addParam(vt(e),!1)}addInt176(e){return this._selector.addInt176(),this._addParam(vt(e),!1)}addUint176(e){return this._selector.addUint176(),this._addParam(vt(e),!1)}addInt184(e){return this._selector.addInt184(),this._addParam(vt(e),!1)}addUint184(e){return this._selector.addUint184(),this._addParam(vt(e),!1)}addInt192(e){return this._selector.addInt192(),this._addParam(vt(e),!1)}addUint192(e){return this._selector.addUint192(),this._addParam(vt(e),!1)}addInt200(e){return this._selector.addInt200(),this._addParam(vt(e),!1)}addUint200(e){return this._selector.addUint200(),this._addParam(vt(e),!1)}addInt208(e){return this._selector.addInt208(),this._addParam(vt(e),!1)}addUint208(e){return this._selector.addUint208(),this._addParam(vt(e),!1)}addInt216(e){return this._selector.addInt216(),this._addParam(vt(e),!1)}addUint216(e){return this._selector.addUint216(),this._addParam(vt(e),!1)}addInt224(e){return this._selector.addInt224(),this._addParam(vt(e),!1)}addUint224(e){return this._selector.addUint224(),this._addParam(vt(e),!1)}addInt232(e){return this._selector.addInt232(),this._addParam(vt(e),!1)}addUint232(e){return this._selector.addUint232(),this._addParam(vt(e),!1)}addInt240(e){return this._selector.addInt240(),this._addParam(vt(e),!1)}addUint240(e){return this._selector.addUint240(),this._addParam(vt(e),!1)}addInt248(e){return this._selector.addInt248(),this._addParam(vt(e),!1)}addUint248(e){return this._selector.addUint248(),this._addParam(vt(e),!1)}addInt256(e){return this._selector.addInt256(),this._addParam(vt(e),!1)}addUint256(e){return this._selector.addUint256(),this._addParam(vt(e),!1)}addInt8Array(e){return this._selector.addInt8Array(),this._addParam(wt(e),!0)}addUint8Array(e){return this._selector.addUint8Array(),this._addParam(wt(e),!0)}addInt16Array(e){return this._selector.addInt16Array(),this._addParam(wt(e),!0)}addUint16Array(e){return this._selector.addUint16Array(),this._addParam(wt(e),!0)}addInt24Array(e){return this._selector.addInt24Array(),this._addParam(wt(e),!0)}addUint24Array(e){return this._selector.addUint24Array(),this._addParam(wt(e),!0)}addInt32Array(e){return this._selector.addInt32Array(),this._addParam(wt(e),!0)}addUint32Array(e){return this._selector.addUint32Array(),this._addParam(wt(e),!0)}addInt40Array(e){return this._selector.addInt40Array(),this._addParam(wt(e),!0)}addUint40Array(e){return this._selector.addUint40Array(),this._addParam(wt(e),!0)}addInt48Array(e){return this._selector.addInt48Array(),this._addParam(wt(e),!0)}addUint48Array(e){return this._selector.addUint48Array(),this._addParam(wt(e),!0)}addInt56Array(e){return this._selector.addInt56Array(),this._addParam(wt(e),!0)}addUint56Array(e){return this._selector.addUint56Array(),this._addParam(wt(e),!0)}addInt64Array(e){return this._selector.addInt64Array(),this._addParam(wt(e),!0)}addUint64Array(e){return this._selector.addUint64Array(),this._addParam(wt(e),!0)}addInt72Array(e){return this._selector.addInt72Array(),this._addParam(wt(e),!0)}addUint72Array(e){return this._selector.addUint72Array(),this._addParam(wt(e),!0)}addInt80Array(e){return this._selector.addInt80Array(),this._addParam(wt(e),!0)}addUint80Array(e){return this._selector.addUint80Array(),this._addParam(wt(e),!0)}addInt88Array(e){return this._selector.addInt88Array(),this._addParam(wt(e),!0)}addUint88Array(e){return this._selector.addUint88Array(),this._addParam(wt(e),!0)}addInt96Array(e){return this._selector.addInt96Array(),this._addParam(wt(e),!0)}addUint96Array(e){return this._selector.addUint96Array(),this._addParam(wt(e),!0)}addInt104Array(e){return this._selector.addInt104Array(),this._addParam(wt(e),!0)}addUint104Array(e){return this._selector.addUint104Array(),this._addParam(wt(e),!0)}addInt112Array(e){return this._selector.addInt112Array(),this._addParam(wt(e),!0)}addUint112Array(e){return this._selector.addUint112Array(),this._addParam(wt(e),!0)}addInt120Array(e){return this._selector.addInt120Array(),this._addParam(wt(e),!0)}addUint120Array(e){return this._selector.addUint120Array(),this._addParam(wt(e),!0)}addInt128Array(e){return this._selector.addInt128Array(),this._addParam(wt(e),!0)}addUint128Array(e){return this._selector.addUint128Array(),this._addParam(wt(e),!0)}addInt136Array(e){return this._selector.addInt136Array(),this._addParam(wt(e),!0)}addUint136Array(e){return this._selector.addUint136Array(),this._addParam(wt(e),!0)}addInt144Array(e){return this._selector.addInt144Array(),this._addParam(wt(e),!0)}addUint144Array(e){return this._selector.addUint144Array(),this._addParam(wt(e),!0)}addInt152Array(e){return this._selector.addInt152Array(),this._addParam(wt(e),!0)}addUint152Array(e){return this._selector.addUint152Array(),this._addParam(wt(e),!0)}addInt160Array(e){return this._selector.addInt160Array(),this._addParam(wt(e),!0)}addUint160Array(e){return this._selector.addUint160Array(),this._addParam(wt(e),!0)}addInt168Array(e){return this._selector.addInt168Array(),this._addParam(wt(e),!0)}addUint168Array(e){return this._selector.addUint168Array(),this._addParam(wt(e),!0)}addInt176Array(e){return this._selector.addInt176Array(),this._addParam(wt(e),!0)}addUint176Array(e){return this._selector.addUint176Array(),this._addParam(wt(e),!0)}addInt184Array(e){return this._selector.addInt184Array(),this._addParam(wt(e),!0)}addUint184Array(e){return this._selector.addUint184Array(),this._addParam(wt(e),!0)}addInt192Array(e){return this._selector.addInt192Array(),this._addParam(wt(e),!0)}addUint192Array(e){return this._selector.addUint192Array(),this._addParam(wt(e),!0)}addInt200Array(e){return this._selector.addInt200Array(),this._addParam(wt(e),!0)}addUint200Array(e){return this._selector.addUint200Array(),this._addParam(wt(e),!0)}addInt208Array(e){return this._selector.addInt208Array(),this._addParam(wt(e),!0)}addUint208Array(e){return this._selector.addUint208Array(),this._addParam(wt(e),!0)}addInt216Array(e){return this._selector.addInt216Array(),this._addParam(wt(e),!0)}addUint216Array(e){return this._selector.addUint216Array(),this._addParam(wt(e),!0)}addInt224Array(e){return this._selector.addInt224Array(),this._addParam(wt(e),!0)}addUint224Array(e){return this._selector.addUint224Array(),this._addParam(wt(e),!0)}addInt232Array(e){return this._selector.addInt232Array(),this._addParam(wt(e),!0)}addUint232Array(e){return this._selector.addUint232Array(),this._addParam(wt(e),!0)}addInt240Array(e){return this._selector.addInt240Array(),this._addParam(wt(e),!0)}addUint240Array(e){return this._selector.addUint240Array(),this._addParam(wt(e),!0)}addInt248Array(e){return this._selector.addInt248Array(),this._addParam(wt(e),!0)}addUint248Array(e){return this._selector.addUint248Array(),this._addParam(wt(e),!0)}addInt256Array(e){return this._selector.addInt256Array(),this._addParam(wt(e),!0)}addUint256Array(e){return this._selector.addUint256Array(),this._addParam(wt(e),!0)}addAddress(e){let t;if(typeof e=="string"){if(e.length!==40&&e.length!==42)throw new Error("`address` type requires parameter to be 40 or 42 characters");t=e}else t=e.toString();let n=t.length===40?tt(t):tt(t.substring(2));return this._selector.addAddress(),this._addParam(n,!1)}addAddressArray(e){let t=[];for(let[n,i]of e.entries()){let a;if(typeof i=="string"){if(i.length!==40&&i.length!==42)throw new Error("`address` type requires parameter to be 40 or 42 characters");a=i}else a=i.toString();let o=a.length===40?tt(a):tt(a.substring(2));t.push(o)}return this._selector.addAddressArray(),this._addParam(t,!0)}addFunction(e,t){let n=tt(e),i=t._build();if(n.length!==20)throw new Error("`function` type requires parameter `address` to be exactly 20 bytes");this._selector.addFunction();let a=new Uint8Array(24);return a.set(n,0),a.set(i,20),this._addParam(a,!1)}_addParam(e,t){let n=this._selector._paramTypes.length-1,i=h3e(e,this._selector._paramTypes[n]);return this._arguments.push({dynamic:t,value:i}),this}_build(e){let t=e!=null,n=t?4:0,i=this._arguments.length===0?n:this._arguments.length*32+this._arguments.map(s=>s.dynamic?s.value.length:0).reduce((s,c)=>s+c)+n,a=new Uint8Array(i);t&&a.set(this._selector._build(e),0);let o=32*this._arguments.length;for(let[s,{dynamic:c,value:l}]of this._arguments.entries())if(c){let u=uo(a,n+s*32+28);u.setUint32(0,o),a.set(l,u.getUint32(0)+n),o+=l.length}else a.set(l,n+s*32);return a}};function h3e(r,e){let t=new Uint8Array(32),n=uo(t),i;if(e.array){if(!Array.isArray(r))throw new TypeError("SolidityType indicates type is array, but parameter is not an array");let a=[];for(let[c,l]of r.entries()){let u=h3e(l,{ty:e.ty,array:!1});a.push(u)}let o=a.map(c=>c.length).reduce((c,l)=>c+l,0);switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.uint256:case Q.int256:case Q.bool:case Q.bytes32:case Q.address:case Q.func:t=new Uint8Array(o+32);break;case Q.bytes:case Q.string:t=new Uint8Array(a.length*32+o+32);break;default:throw new TypeError(`Expected param type to be ArgumentType, but received ${e.ty}`)}n=uo(t,28),n.setUint32(0,a.length);let s=32*a.length;for(let[c,l]of a.entries())switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.uint256:case Q.int256:case Q.bool:case Q.bytes32:case Q.address:case Q.func:t.set(l,c*32+32);break;case Q.bytes:case Q.string:let u=uo(t,(c+1)*32+28);u.setUint32(0,s),t.set(l,u.getUint32(0)+32),s+=l.length;break;default:throw new TypeError(`Expected param type to be ArgumentType, but received ${e.ty}`)}return t}switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.int256:case Q.uint256:{let a=r.toString(16);r>0||r==0?a="0x"+a:a=a.slice(0,1)+"0x"+a.slice(1);let o=f3e.defaultAbiCoder.encode([BB(e)],[a]);return(0,p3e.arrayify)(o)}case Q.address:return t.set(r,12),t;case Q.bool:return t[31]=r?1:0,t;case Q.func:return t.set(r,8),t;case Q.bytes32:return t.set(r,0),t;case Q.bytes:case Q.string:return i=r instanceof Uint8Array?r:i3(r),Math.floor(i.length/32)>=0?Math.floor(i.length%32)!==0?t=new Uint8Array((Math.floor(i.length/32)+1)*32+32):t=new Uint8Array(Math.floor(i.length/32)*32+32):t=new Uint8Array(64),t.set(i,32),n=uo(t,28),n.setUint32(0,i.length),t;default:throw new Error(`Unsupported argument type: ${e.toString()}`)}}var Y8=Oe(Jt(),1),m3e=Oe(br(),1);var J8=class r extends Ar{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId),this._gas=null,e.gas!=null&&this.setGas(e.gas),this._functionParameters=null,e.functionParameters!=null&&(e.functionParameters instanceof Uint8Array?this.setFunctionParameters(e.functionParameters):this.setFunction(e.functionParameters.name,e.functionParameters.parameters)),this._maxResultSize=null,e.maxResultSize!=null&&this.setMaxResultSize(e.maxResultSize),this._senderAccountId=null,e.senderAccountId!=null&&this.setSenderAccountId(e.senderAccountId)}static _fromProtobuf(e){let t=e.contractCallLocal;return new r({contractId:t.contractID!=null?Et._fromProtobuf(t.contractID):void 0,gas:t.gas!=null?t.gas:void 0,functionParameters:t.functionParameters!=null?t.functionParameters:void 0,maxResultSize:t.maxResultSize!=null?t.maxResultSize:void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}get gas(){return this._gas}setGas(e){return this._gas=e instanceof Y8.default?e:Y8.default.fromValue(e),this}get senderAccountId(){return this._senderAccountId}setSenderAccountId(e){return this._senderAccountId=typeof e=="string"?ne.fromString(e):e,this}get functionParameters(){return this._functionParameters}setFunctionParameters(e){return this._functionParameters=e,this}setFunction(e,t){return this._functionParameters=(t??new xu)._build(e),this}setMaxResultSize(e){return this._maxResultSize=e instanceof Y8.default?e:Y8.default.fromValue(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??m3e.proto.ResponseCodeEnum.OK);if(!t.contractCallLocal.functionResult)return new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null});let o=this._mapResponseSync(t);return new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:o})}_execute(e,t){return e.smartContract.contractCallLocalMethod(t)}_mapResponseHeader(e){return e.contractCallLocal.header}_mapResponse(e){let t=e.contractCallLocal;return Promise.resolve(bu._fromProtobuf(t.functionResult,!1))}_mapResponseSync(e){let t=e.contractCallLocal;return bu._fromProtobuf(t.functionResult,!1)}_onMakeRequest(e){return{contractCallLocal:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null,gas:this._gas,maxResultSize:this._maxResultSize,functionParameters:this._functionParameters,senderId:this._senderAccountId!=null?this._senderAccountId._toProtobuf():null}}}_getLogId(){return`ContractCallQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("contractCallLocal",J8._fromProtobuf);var g3e=Oe(Jt(),1),f1=class r extends ke{constructor(e={}){super(),this._keys=null,this._expirationTime=new ut(0,0).plusNanos(g3e.default.fromNumber(Date.now()).mul(1e6).add(_u.mul(1e9))),this._contents=null,this._fileMemo=null,this._defaultMaxTransactionFee=new Ge(5),e.keys!=null&&this.setKeys(e.keys),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.contents!=null&&this.setContents(e.contents),e.fileMemo!=null&&this.setFileMemo(e.fileMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileCreate;return ke._fromProtobufTransactions(new r({keys:s.keys!=null&&s.keys.keys!=null?s.keys.keys.map(c=>nt._fromProtobufKey(c)):void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0,contents:s.contents!=null?s.contents:void 0,fileMemo:s.memo!=null?s.memo:void 0}),e,t,n,i,a)}get keys(){return this._keys}setKeys(e){if(this._requireNotFrozen(),e instanceof Oi&&e.threshold!=null)throw new Error("Cannot set threshold key as file key");return this._keys=e instanceof Oi?e.toArray():e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof ut?e:ut.fromDate(e),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:i3(e),this}get fileMemo(){return this._fileMemo}setFileMemo(e){return this._requireNotFrozen(),this._fileMemo=e,this}_execute(e,t){return e.file.createFile(t)}_getTransactionDataCase(){return"fileCreate"}_makeTransactionData(){return{keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:null,expirationTime:this._expirationTime._toProtobuf(),contents:this._contents,memo:this._fileMemo}}_getLogId(){return`FileCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("fileCreate",f1._fromProtobuf);var p1=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contents=null,this._maxChunks=20,this._chunkSize=4096,this._defaultMaxTransactionFee=new Ge(5),e.fileId!=null&&this.setFileId(e.fileId),e.contents!=null&&this.setContents(e.contents),e.maxChunks!=null&&this.setMaxChunks(e.maxChunks),e.chunkSize!=null&&this.setChunkSize(e.chunkSize),this._transactionIds=new nl}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileAppend,c;for(let l=0;l<a.length;l+=i.length){let u=a[l].fileAppend;if(u.contents==null)break;if(c==null){c=new Uint8Array(u.contents);continue}let d=new Uint8Array(c.length+u.contents.length);d.set(c,0),d.set(u.contents,c.length),c=d}return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,contents:c}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:i3(e),this}get maxChunks(){return this._maxChunks}setMaxChunks(e){return this._requireNotFrozen(),this._maxChunks=e,this}get chunkSize(){return this._chunkSize}setChunkSize(e){return this._chunkSize=e,this}freezeWith(e){if(super.freezeWith(e),this._contents==null)return this;let t=Math.floor((this._contents.length+(this._chunkSize-1))/this._chunkSize);if(t>this._maxChunks)throw new Error(`Contents with size ${this._contents.length} too long for ${this._maxChunks} chunks`);let n=this._getTransactionId();this._transactionIds.locked=!1,this._transactions.clear(),this._transactionIds.clear(),this._signedTransactions.clear();for(let i=0;i<t;i++){this._transactionIds.push(n),this._transactionIds.advance();for(let a of this._nodeAccountIds.list)this._signedTransactions.push(this._makeSignedTransaction(a));n=new Qr(n.accountId,new ut(n.validStart.seconds,n.validStart.nanos.add(1)))}return this._transactionIds.advance(),this._transactionIds.setLocked(),this}schedule(){if(this._requireNotFrozen(),this._contents!=null&&this._contents.length>this._chunkSize)throw new Error(`cannot schedule \`FileAppendTransaction\` with message over ${this._chunkSize} bytes`);return super.schedule()}async execute(e,t){return(await this.executeAll(e,t))[0]}async executeAll(e,t){super._isFrozen()||this.freezeWith(e);let n=this._getTransactionId(),i=e.operatorAccountId;i!=null&&i.equals(n.accountId)&&await super.signWithOperator(e);let a=[],o=t;for(let s=0;s<this._transactionIds.length;s++){let c=Date.now(),l=await super.execute(e,o);o!=null&&(o=Date.now()-c),await l.getReceipt(e),a.push(l)}return a}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.appendContent(t)}_getTransactionDataCase(){return"fileAppend"}_makeTransactionData(){let e=this._contents!=null?this._contents.length:0,t=this._transactionIds.index*this._chunkSize,n=Math.min(t+this._chunkSize,e);return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contents:this._contents!=null?this._contents.slice(t,n):null}}_getLogId(){return`FileAppendTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("fileAppend",p1._fromProtobuf);var Sm=class r extends ke{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileDelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.deleteFile(t)}_getTransactionDataCase(){return"fileDelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null}}_getLogId(){return`FileDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("fileDelete",Sm._fromProtobuf);var Rx=Oe(Jt(),1);var Im=class r extends ke{constructor(e={}){super(),this._bytecodeFileId=null,this._bytecode=null,this._adminKey=null,this._gas=null,this._initialBalance=null,this._proxyAccountId=null,this._autoRenewPeriod=new pr(_u),this._constructorParameters=null,this._contractMemo=null,this._maxAutomaticTokenAssociations=null,this._defaultMaxTransactionFee=new Ge(20),this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=!1,this._autoRenewAccountId=null,e.bytecodeFileId!=null&&this.setBytecodeFileId(e.bytecodeFileId),e.bytecode!=null&&this.setBytecode(e.bytecode),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.gas!=null&&this.setGas(e.gas),e.initialBalance!=null&&this.setInitialBalance(e.initialBalance),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.constructorParameters!=null&&this.setConstructorParameters(e.constructorParameters),e.contractMemo!=null&&this.setContractMemo(e.contractMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractCreateInstance;return ke._fromProtobufTransactions(new r({bytecodeFileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,gas:s.gas!=null?s.gas:void 0,initialBalance:s.initialBalance!=null?s.initialBalance:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,constructorParameters:s.constructorParameters!=null?s.constructorParameters:void 0,contractMemo:s.memo!=null?s.memo:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null?s.maxAutomaticTokenAssociations:void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward==!0,autoRenewAccountId:s.autoRenewAccountId!=null?ne._fromProtobuf(s.autoRenewAccountId):void 0}),e,t,n,i,a)}get bytecodeFileId(){return this._bytecodeFileId}setBytecodeFileId(e){return this._requireNotFrozen(),this._bytecodeFileId=typeof e=="string"?Gt.fromString(e):e.clone(),this._bytecode=null,this}get bytecode(){return this._bytecode}setBytecode(e){return this._requireNotFrozen(),this._bytecode=e,this._bytecodeFileId=null,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get gas(){return this._gas}setGas(e){return this._requireNotFrozen(),this._gas=e instanceof Rx.default?e:Rx.default.fromValue(e),this}get initialBalance(){return this._initialBalance}setInitialBalance(e){return this._requireNotFrozen(),this._initialBalance=e instanceof Ge?e:new Ge(e),this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get constructorParameters(){return this._constructorParameters}setConstructorParameters(e){return this._requireNotFrozen(),this._constructorParameters=e instanceof xu?e._build():e,this}get contractMemo(){return this._contractMemo}setContractMemo(e){return this._requireNotFrozen(),this._contractMemo=e,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._maxAutomaticTokenAssociations=e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=Rx.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=typeof e=="string"?ne.fromString(e):e,this}_validateChecksums(e){this._bytecodeFileId!=null&&this._bytecodeFileId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.smartContract.createContract(t)}_getTransactionDataCase(){return"contractCreateInstance"}_makeTransactionData(){return{fileID:this._bytecodeFileId!=null?this._bytecodeFileId._toProtobuf():null,initcode:this._bytecode,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,gas:this._gas,initialBalance:this._initialBalance!=null?this._initialBalance.toTinybars():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),constructorParameters:this._constructorParameters,memo:this._contractMemo,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards,autoRenewAccountId:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null}}_getLogId(){return`ContractCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("contractCreateInstance",Im._fromProtobuf);var Z8=class r extends ke{constructor(e={}){super(),this._contractId=null,this._transferAccountId=null,this._transferContractId=null,e.contractId!=null&&this.setContractId(e.contractId),e.transferAccountId!=null&&this.setTransferAccountId(e.transferAccountId),e.transferContractId!=null&&this.setTransferContractId(e.transferContractId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractDeleteInstance;return ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?Et._fromProtobuf(s.contractID):void 0,transferAccountId:s.transferAccountID!=null?ne._fromProtobuf(s.transferAccountID):void 0,transferContractId:s.transferContractID!=null?Et._fromProtobuf(s.transferContractID):void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}get transferContractId(){return this._transferContractId}setTransferContractId(e){return this._requireNotFrozen(),this._transferContractId=e instanceof Et?e:Et.fromString(e),this}get transferAccountId(){return this._transferAccountId}setTransferAccountId(e){return this._requireNotFrozen(),this._transferAccountId=e instanceof ne?e:ne.fromString(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e),this._transferAccountId!=null&&this._transferAccountId.validateChecksum(e),this._transferContractId!=null&&this._transferContractId.validateChecksum(e)}_execute(e,t){return e.smartContract.deleteContract(t)}_getTransactionDataCase(){return"contractDeleteInstance"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,transferAccountID:this._transferAccountId?this._transferAccountId._toProtobuf():null,transferContractID:this._transferContractId!=null?this._transferContractId._toProtobuf():null}}_getLogId(){return`ContractDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("contractDeleteInstance",Z8._fromProtobuf);var MB=Oe(Jt(),1),X8=class r extends ke{constructor(e={}){super(),this._contractId=null,this._gas=null,this._amount=null,this._functionParameters=null,e.contractId!=null&&this.setContractId(e.contractId),e.gas!=null&&this.setGas(e.gas),e.amount!=null&&this.setPayableAmount(e.amount),e.functionParameters!=null?this.setFunctionParameters(e.functionParameters):e.function!=null&&this.setFunction(e.function.name,e.function.parameters)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractCall;return ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?Et._fromProtobuf(s.contractID):void 0,gas:s.gas!=null?s.gas:void 0,amount:s.amount!=null?Ge.fromTinybars(s.amount):void 0,functionParameters:s.functionParameters!=null?s.functionParameters:void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}get gas(){return this._gas}setGas(e){return this._requireNotFrozen(),this._gas=e instanceof MB.default?e:MB.default.fromValue(e),this}get payableAmount(){return this._amount}setPayableAmount(e){return this._requireNotFrozen(),this._amount=e instanceof Ge?e:new Ge(e),this}get functionParameters(){return this._functionParameters}setFunctionParameters(e){return this._requireNotFrozen(),this._functionParameters=e,this}setFunction(e,t){return this._requireNotFrozen(),this._functionParameters=t!=null?t._build(e):new xu()._build(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.contractCallMethod(t)}_getTransactionDataCase(){return"contractCall"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,gas:this._gas,amount:this._amount!=null?this._amount.toTinybars():null,functionParameters:this._functionParameters}}_getLogId(){return`ContractExecuteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("contractCall",X8._fromProtobuf);var Ox=Oe(Jt(),1),Kze=Oe(br(),1);var{proto:y3e}=Kze,Cm=class r{constructor(e){this.contractId=e.contractId,this.accountId=e.accountId,this.contractAccountId=e.contractAccountId,this.adminKey=e.adminKey!=null?e.adminKey:null,this.expirationTime=e.expirationTime,this.autoRenewPeriod=e.autoRenewPeriod,this.autoRenewAccountId=e.autoRenewAccountId,this.storage=e.storage,this.contractMemo=e.contractMemo,this.balance=e.balance,this.isDeleted=e.isDeleted,this.tokenRelationships=e.tokenRelationships,this.ledgerId=e.ledgerId,this.stakingInfo=e.stakingInfo,Object.freeze(this)}static _fromProtobuf(e){let t=e.autoRenewPeriod.seconds;return new r({contractId:Et._fromProtobuf(e.contractID),accountId:ne._fromProtobuf(e.accountID),contractAccountId:e.contractAccountID!=null?e.contractAccountID:"",adminKey:e.adminKey!=null?nt._fromProtobufKey(e.adminKey):null,expirationTime:ut._fromProtobuf(e.expirationTime),autoRenewPeriod:new pr(t),autoRenewAccountId:e.autoRenewAccountId!=null?ne._fromProtobuf(e.autoRenewAccountId):null,storage:e.storage!=null?e.storage instanceof Ox.default?e.storage:Ox.default.fromValue(e.storage):Ox.default.ZERO,contractMemo:e.memo!=null?e.memo:"",balance:Ge.fromTinybars(e.balance!=null?e.balance:0),isDeleted:e.deleted,tokenRelationships:l1._fromProtobuf(e.tokenRelationships!=null?e.tokenRelationships:[]),ledgerId:e.ledgerId!=null?gr.fromBytes(e.ledgerId):null,stakingInfo:e.stakingInfo!=null?c1._fromProtobuf(e.stakingInfo):null})}_toProtobuf(){return{contractID:this.contractId._toProtobuf(),accountID:this.accountId._toProtobuf(),contractAccountID:this.contractAccountId,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,expirationTime:this.expirationTime._toProtobuf(),autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,autoRenewAccountId:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():null,storage:this.storage,memo:this.contractMemo,balance:this.balance.toTinybars(),deleted:this.isDeleted,tokenRelationships:this.tokenRelationships!=null?this.tokenRelationships._toProtobuf():null,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,stakingInfo:this.stakingInfo!=null?this.stakingInfo._toProtobuf():null}}static fromBytes(e){return r._fromProtobuf(y3e.ContractGetInfoResponse.ContractInfo.decode(e))}toBytes(){return y3e.ContractGetInfoResponse.ContractInfo.encode(this._toProtobuf()).finish()}};var ev=class r extends Ar{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.contractGetInfo;return new r({contractId:t.contractID!=null?Et._fromProtobuf(t.contractID):void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.getContractInfo(t)}async getCost(e){return super.getCost(e)}_mapResponseHeader(e){return e.contractGetInfo.header}_mapResponse(e,t,n){let i=e.contractGetInfo;return Promise.resolve(Cm._fromProtobuf(i.contractInfo))}_onMakeRequest(e){return{contractGetInfo:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`ContractInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("contractGetInfo",ev._fromProtobuf);var v3e=Oe(Jt(),1),tv=class r extends ke{constructor(e={}){super(),this._contractId=null,this._expirationTime=null,this._adminKey=null,this._proxyAccountId=null,this._autoRenewPeriod=null,this._bytecodeFileId=null,this._contractMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=null,this._autoRenewAccountId=null,e.contractId!=null&&this.setContractId(e.contractId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.bytecodeFileId!=null&&this.setBytecodeFileId(e.bytecodeFileId),e.contractMemo!=null&&this.setContractMemo(e.contractMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractUpdateInstance,c;s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null&&(c=s.autoRenewPeriod.seconds);let l;s.memoWrapper!=null&&s.memoWrapper.value!=null&&(l=s.memoWrapper.value);let u;return s.maxAutomaticTokenAssociations!=null&&s.maxAutomaticTokenAssociations.value!=null&&(u=s.maxAutomaticTokenAssociations.value),ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?Et._fromProtobuf(s.contractID):void 0,bytecodeFileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0,adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:c,contractMemo:l,maxAutomaticTokenAssociations:u,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward!=null&&!!s.declineReward,autoRenewAccountId:s.autoRenewAccountId!=null?ne._fromProtobuf(s.autoRenewAccountId):void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof ut?e:ut.fromDate(e),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get bytecodeFileId(){return this._bytecodeFileId}setBytecodeFileId(e){return console.warn("Deprecated: there is no replacement"),this._requireNotFrozen(),this._bytecodeFileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}get contractMemo(){return this._contractMemo}setContractMemo(e){return this._requireNotFrozen(),this._contractMemo=e,this}clearContractMemo(){return this._requireNotFrozen(),this._contractMemo=null,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=v3e.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=typeof e=="string"?ne.fromString(e):e,this}clearAutoRenewAccountId(){return this._autoRenewAccountId=new ne(0),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e),this._bytecodeFileId!=null&&this._bytecodeFileId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.smartContract.updateContract(t)}_getTransactionDataCase(){return"contractUpdateInstance"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,fileID:this._bytecodeFileId?this._bytecodeFileId._toProtobuf():null,memoWrapper:this._contractMemo!=null?{value:this._contractMemo}:null,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?{value:this._maxAutomaticTokenAssociations}:null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards!=null?{value:this.declineStakingRewards}:null,autoRenewAccountId:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null}}_getLogId(){return`ContractUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("contractUpdateInstance",tv._fromProtobuf);var Au=class{constructor(e={}){this._feeCollectorAccountId=null,this._allCollectorsAreExempt=!1,e.feeCollectorAccountId!=null&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),e.allCollectorsAreExempt!=null&&this.setAllCollectorsAreExempt(e.allCollectorsAreExempt)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId=typeof e=="string"?ne.fromString(e):e,this}get allCollectorsAreExempt(){return this._allCollectorsAreExempt}setAllCollectorsAreExempt(e){return this._allCollectorsAreExempt=e,this}static _fromProtobuf(e){throw new Error("not implemented")}_toProtobuf(){throw new Error("not implemented")}};var b3e=Oe(Jt(),1);var rc=class r extends Au{constructor(e={}){super(e),this._denominatingTokenId=null,e.denominatingTokenId!=null&&this.setDenominatingTokenId(e.denominatingTokenId),this._amount=null,e.amount!=null&&this.setAmount(e.amount)}setHbarAmount(e){return this._amount=e.toTinybars(),this._denominatingTokenId=null,this}get hbarAmount(){return this._denominatingTokenId!=null?null:Ge.fromTinybars(this._amount!=null?this._amount:0)}setDenominatingTokenToSameToken(){return this._denominatingTokenId=new De(0,0,0),this}get denominatingTokenId(){return this._denominatingTokenId}setDenominatingTokenId(e){return this._denominatingTokenId=typeof e=="string"?De.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount=typeof e=="number"?b3e.default.fromNumber(e):e,this}static _fromProtobuf(e){let t=e.fixedFee;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,denominatingTokenId:t.denominatingTokenId!=null?De._fromProtobuf(t.denominatingTokenId):void 0,amount:t.amount!=null?t.amount:void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fixedFee:{denominatingTokenId:this._denominatingTokenId!=null?this._denominatingTokenId._toProtobuf():null,amount:this._amount}}}};var Tu=class r{constructor(e){this._value=e,Object.freeze(this)}toString(){switch(this){case r.Inclusive:return"INCLUSIVE";case r.Exclusive:return"EXCLUSIVE";default:return`UNKNOWN (${this._value.toString()})`}}static _fromValue(e){switch(e){case!1:return r.Inclusive;case!0:return r.Exclusive}}valueOf(){return this._value}};Tu.Inclusive=new Tu(!1);Tu.Exclusive=new Tu(!0);var rv=Oe(Jt(),1),Su=class r extends Au{constructor(e={}){super(e),this._numerator=null,e.numerator!=null&&this.setNumerator(e.numerator),this._denominator=null,e.denominator!=null&&this.setDenominator(e.denominator),this._min=null,e.min!=null&&this.setMin(e.min),this._max,e.max!=null&&this.setMax(e.max),this._assessmentMethod,e.assessmentMethod!=null&&this.setAssessmentMethod(e.assessmentMethod)}get numerator(){return this._numerator}setNumerator(e){return this._numerator=typeof e=="number"?rv.default.fromNumber(e):e,this}get denominator(){return this._denominator}setDenominator(e){return this._denominator=typeof e=="number"?rv.default.fromNumber(e):e,this}get min(){return this._min}setMin(e){return this._min=typeof e=="number"?rv.default.fromNumber(e):e,this}get max(){return this._max}setMax(e){return this._max=typeof e=="number"?rv.default.fromNumber(e):e,this}get assessmentMethod(){return this._assessmentMethod}setAssessmentMethod(e){return this._assessmentMethod=e,this}static _fromProtobuf(e){let t=e.fractionalFee,n=t.fractionalAmount;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,numerator:n.numerator!=null?n.numerator:void 0,denominator:n.denominator!=null?n.denominator:void 0,min:t.minimumAmount!=null?t.minimumAmount:void 0,max:t.maximumAmount!=null?t.maximumAmount:void 0,assessmentMethod:t.netOfTransfers!=null?new Tu(t.netOfTransfers):void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fractionalFee:{fractionalAmount:{numerator:this._numerator,denominator:this._denominator},minimumAmount:this._min,maximumAmount:this._max,netOfTransfers:this._assessmentMethod!=null?this._assessmentMethod.valueOf():!1}}}};var LB=Oe(Jt(),1);var Iu=class r extends Au{constructor(e={}){super(e),this._fallbackFee=null,e.fallbackFee!=null&&this.setFallbackFee(e.fallbackFee),this._numerator=null,e.numerator!=null&&this.setNumerator(e.numerator),this._denominator=null,e.denominator!=null&&this.setDenominator(e.denominator)}get fallbackFee(){return this._fallbackFee}setFallbackFee(e){return this._fallbackFee=e,this}get numerator(){return this._numerator}setNumerator(e){return this._numerator=typeof e=="number"?LB.default.fromNumber(e):e,this}get denominator(){return this._denominator}setDenominator(e){return this._denominator=typeof e=="number"?LB.default.fromNumber(e):e,this}static _fromProtobuf(e){let t=e.royaltyFee,n=t.exchangeValueFraction;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,fallbackFee:t.fallbackFee!=null?rc._fromProtobuf({fixedFee:t.fallbackFee}):void 0,numerator:n.numerator!=null?n.numerator:void 0,denominator:n.denominator!=null?n.denominator:void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,royaltyFee:{exchangeValueFraction:{numerator:this._numerator,denominator:this._denominator},fallbackFee:this._fallbackFee!=null?this._fallbackFee._toProtobuf().fixedFee:null}}}};var nv=class r extends Et{constructor(e,t,n,i){super(e,t,n,i)}static fromEvmAddress(e,t,n){return new r(e,t,0,tt(n))}static fromString(e){return new r(Et.fromString(e))}static _fromProtobuf(e){return new r(Et._fromProtobuf(e))}static fromBytes(e){return new r(Et.fromBytes(e))}static fromSolidityAddress(e){return new r(Et.fromSolidityAddress(e))}clone(){let e=new r(this);return e._checksum=this._checksum,e}_toProtobufKey(){return{delegatableContractId:this._toProtobuf()}}static __fromProtobufKey(e){return r._fromProtobuf(e)}};ar.setDelegateContractId(r=>nv.__fromProtobufKey(r));var km=class r extends ke{constructor(e={}){super(),this._ethereumData=null,this._callDataFileId=null,this._maxGasAllowance=null,e.ethereumData!=null&&this.setEthereumData(e.ethereumData),e.callData!=null&&this.setCallDataFileId(e.callData),e.callDataFileId!=null&&this.setCallDataFileId(e.callDataFileId),e.maxGasAllowance!=null&&this.setMaxGasAllowanceHbar(e.maxGasAllowance)}static _fromProtobuf(e,t,n,i,a){let s=a[0].ethereumTransaction;return ke._fromProtobufTransactions(new r({ethereumData:s.ethereumData!=null?s.ethereumData:void 0,callData:s.callData!=null?Gt._fromProtobuf(s.callData):void 0,maxGasAllowance:s.maxGasAllowance!=null?Ge.fromTinybars(s.maxGasAllowance):void 0}),e,t,n,i,a)}get ethereumData(){return this._ethereumData}setEthereumData(e){return this._requireNotFrozen(),this._ethereumData=e,this}get callData(){return this.callDataFileId}setCallData(e){return this.setCallDataFileId(e)}get callDataFileId(){return this._callDataFileId}setCallDataFileId(e){return this._requireNotFrozen(),this._callDataFileId=e,this}get maxGasAllowance(){return this._maxGasAllowance}setMaxGasAllowance(e){return this.setMaxGasAllowanceHbar(e)}setMaxGasAllowanceHbar(e){return this._requireNotFrozen(),this._maxGasAllowance=e instanceof Ge?e:new Ge(e),this}_validateChecksums(e){this._ethereumData!=null&&this._ethereumData instanceof Gt&&this._ethereumData.validateChecksum(e)}_execute(e,t){return e.smartContract.callEthereum(t)}_getTransactionDataCase(){return"ethereumTransaction"}_makeTransactionData(){return{ethereumData:this._ethereumData,callData:this._callDataFileId!=null?this._callDataFileId._toProtobuf():null,maxGasAllowance:this._maxGasAllowance!=null?this._maxGasAllowance.toTinybars():null}}_getLogId(){return`EthereumTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("ethereumTransaction",km._fromProtobuf);var Dx=Oe(X2(),1);var ll=class{constructor(e){this.callData=e.callData}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");switch(e[0]){case 1:return ar.ethereumTransactionDataEip2930FromBytes(e);case 2:return ar.ethereumTransactionDataEip1559FromBytes(e);default:return ar.ethereumTransactionDataLegacyFromBytes(e)}}toBytes(){throw new Error("not implemented")}toString(){throw new Error("not implemented")}toJSON(){throw new Error("not implemented")}};var iv=class r extends ll{constructor(e){super(e),this.nonce=e.nonce,this.gasPrice=e.gasPrice,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.v=e.v,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=Dx.decode(e);if(t.length!=9)throw new Error("invalid ethereum transaction data");return new r({nonce:tt(t[0]),gasPrice:tt(t[1]),gasLimit:tt(t[2]),to:tt(t[3]),value:tt(t[4]),callData:tt(t[5]),v:tt(t[6]),r:tt(t[7]),s:tt(t[8])})}toBytes(){return tt(Dx.encode([this.nonce,this.gasPrice,this.gasLimit,this.to,this.value,this.callData,this.v,this.r,this.s]))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{nonce:Ke(this.nonce),gasPrice:Ke(this.gasPrice),gasLimit:Ke(this.gasLimit),to:Ke(this.to),value:Ke(this.value),callData:Ke(this.callData),v:Ke(this.v),r:Ke(this.r),s:Ke(this.s)}}};ar.setEthereumTransactionDataLegacyFromBytes(r=>iv.fromBytes(r));var Px=Oe(X2(),1);var av=class r extends ll{constructor(e){super(e),this.chainId=e.chainId,this.nonce=e.nonce,this.maxPriorityGas=e.maxPriorityGas,this.maxGas=e.maxGas,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.accessList=e.accessList,this.recId=e.recId,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=Px.decode(e.subarray(1));if(!Array.isArray(t))throw new Error("ethereum data is not a list");if(t.length!=12)throw new Error("invalid ethereum transaction data");return new r({chainId:tt(t[0]),nonce:tt(t[1]),maxPriorityGas:tt(t[2]),maxGas:tt(t[3]),gasLimit:tt(t[4]),to:tt(t[5]),value:tt(t[6]),callData:tt(t[7]),accessList:t[8].map(n=>tt(n)),recId:tt(t[9]),r:tt(t[10]),s:tt(t[11])})}toBytes(){let e=Px.encode([this.chainId,this.nonce,this.maxPriorityGas,this.maxGas,this.gasLimit,this.to,this.value,this.callData,this.accessList,this.recId,this.r,this.s]);return tt("02"+e.substring(2))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{chainId:Ke(this.chainId),nonce:Ke(this.nonce),maxPriorityGas:Ke(this.maxPriorityGas),maxGas:Ke(this.maxGas),gasLimit:Ke(this.gasLimit),to:Ke(this.to),value:Ke(this.value),callData:Ke(this.callData),accessList:this.accessList.map(e=>Ke(e)),recId:Ke(this.recId),r:Ke(this.r),s:Ke(this.s)}}};ar.setEthereumTransactionDataEip1559FromBytes(r=>av.fromBytes(r));var Bx=Oe(X2(),1);var ov=class r extends ll{constructor(e){super(e),this.chainId=e.chainId,this.nonce=e.nonce,this.gasPrice=e.gasPrice,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.accessList=e.accessList,this.recId=e.recId,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=Bx.decode(e.subarray(1));if(!Array.isArray(t))throw new Error("ethereum data is not a list");if(t.length!==11)throw new Error("invalid ethereum transaction data");return new r({chainId:tt(t[0]),nonce:tt(t[1]),gasPrice:tt(t[2]),gasLimit:tt(t[3]),to:tt(t[4]),value:tt(t[5]),callData:tt(t[6]),accessList:t[7].map(n=>tt(n)),recId:tt(t[8]),r:tt(t[9]),s:tt(t[10])})}toBytes(){let e=Bx.encode([this.chainId,this.nonce,this.gasPrice,this.gasLimit,this.to,this.value,this.callData,this.accessList,this.recId,this.r,this.s]);return tt("01"+e.substring(2))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{chainId:Ke(this.chainId),nonce:Ke(this.nonce),gasPrice:Ke(this.gasPrice),gasLimit:Ke(this.gasLimit),to:Ke(this.to),value:Ke(this.value),callData:Ke(this.callData),accessList:this.accessList.map(e=>Ke(e)),recId:Ke(this.recId),r:Ke(this.r),s:Ke(this.s)}}};ar.setEthereumTransactionDataEip2930FromBytes(r=>ov.fromBytes(r));var zze=Oe(br(),1),{proto:Itr}=zze;var Gze=Oe(br(),1);var Qze=Oe(br(),1);var Eo=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Default:return"DEFAULT";case r.TokenFungibleCommon:return"TOKEN_FUNGIBLE_COMMON";case r.TokenNonFungibleUnique:return"TOKEN_NON_FUNGIBLE_UNIQUE";case r.TokenFungibleCommonWithCustomFees:return"TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES";case r.TokenNonFungibleUniqueWithCustomFees:return"TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES";case r.ScheduleCreateContractCall:return"SCHEDULE_CREATE_CONTRACT_CALL";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Default;case 1:return r.TokenFungibleCommon;case 2:return r.TokenNonFungibleUnique;case 3:return r.TokenFungibleCommonWithCustomFees;case 4:return r.TokenNonFungibleUniqueWithCustomFees;case 5:return r.ScheduleCreateContractCall}throw new Error(`(BUG) SubType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};Eo.Default=new Eo(0);Eo.TokenFungibleCommon=new Eo(1);Eo.TokenNonFungibleUnique=new Eo(2);Eo.TokenFungibleCommonWithCustomFees=new Eo(3);Eo.TokenNonFungibleUniqueWithCustomFees=new Eo(4);Eo.ScheduleCreateContractCall=new Eo(5);var Zze=Oe(br(),1);var Yze=Oe(br(),1);var Ae=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.None:return"NONE";case r.CryptoTransfer:return"CryptoTransfer";case r.CryptoUpdate:return"CryptoUpdate";case r.CryptoDelete:return"CryptoDelete";case r.CryptoAddLiveHash:return"CryptoAddLiveHash";case r.CryptoDeleteLiveHash:return"CryptoDeleteLiveHash";case r.ContractCall:return"ContractCall";case r.ContractCreate:return"ContractCreate";case r.ContractUpdate:return"ContractUpdate";case r.FileCreate:return"FileCreate";case r.FileAppend:return"FileAppend";case r.FileUpdate:return"FileUpdate";case r.FileDelete:return"FileDelete";case r.CryptoGetAccountBalance:return"CryptoGetAccountBalance";case r.CryptoGetAccountRecords:return"CryptoGetAccountRecords";case r.CryptoGetInfo:return"CryptoGetInfo";case r.ContractCallLocal:return"ContractCallLocal";case r.ContractGetInfo:return"ContractGetInfo";case r.ContractGetBytecode:return"ContractGetBytecode";case r.GetBySolidityID:return"GetBySolidityID";case r.GetByKey:return"GetByKey";case r.CryptoGetLiveHash:return"CryptoGetLiveHash";case r.CryptoGetStakers:return"CryptoGetStakers";case r.FileGetContents:return"FileGetContents";case r.FileGetInfo:return"FileGetInfo";case r.TransactionGetRecord:return"TransactionGetRecord";case r.ContractGetRecords:return"ContractGetRecords";case r.CryptoCreate:return"CryptoCreate";case r.SystemDelete:return"SystemDelete";case r.SystemUndelete:return"SystemUndelete";case r.ContractDelete:return"ContractDelete";case r.Freeze:return"Freeze";case r.CreateTransactionRecord:return"CreateTransactionRecord";case r.CryptoAccountAutoRenew:return"CryptoAccountAutoRenew";case r.ContractAutoRenew:return"ContractAutoRenew";case r.GetVersionInfo:return"GetVersionInfo";case r.TransactionGetReceipt:return"TransactionGetReceipt";case r.ConsensusCreateTopic:return"ConsensusCreateTopic";case r.ConsensusUpdateTopic:return"ConsensusUpdateTopic";case r.ConsensusDeleteTopic:return"ConsensusDeleteTopic";case r.ConsensusGetTopicInfo:return"ConsensusGetTopicInfo";case r.ConsensusSubmitMessage:return"ConsensusSubmitMessage";case r.UncheckedSubmit:return"UncheckedSubmit";case r.TokenCreate:return"TokenCreate";case r.TokenGetInfo:return"TokenGetInfo";case r.TokenFreezeAccount:return"TokenFreezeAccount";case r.TokenUnfreezeAccount:return"TokenUnfreezeAccount";case r.TokenGrantKycToAccount:return"TokenGrantKycToAccount";case r.TokenRevokeKycFromAccount:return"TokenRevokeKycFromAccount";case r.TokenDelete:return"TokenDelete";case r.TokenUpdate:return"TokenUpdate";case r.TokenMint:return"TokenMint";case r.TokenBurn:return"TokenBurn";case r.TokenAccountWipe:return"TokenAccountWipe";case r.TokenAssociateToAccount:return"TokenAssociateToAccount";case r.TokenDissociateFromAccount:return"TokenDissociateFromAccount";case r.ScheduleCreate:return"ScheduleCreate";case r.ScheduleDelete:return"ScheduleDelete";case r.ScheduleSign:return"ScheduleSign";case r.ScheduleGetInfo:return"ScheduleGetInfo";case r.TokenGetAccountNftInfos:return"TokenGetAccountNftInfos";case r.TokenGetNftInfo:return"TokenGetNftInfo";case r.TokenGetNftInfos:return"TokenGetNftInfos";case r.TokenFeeScheduleUpdate:return"TokenFeeScheduleUpdate";case r.NetworkGetExecutionTime:return"NetworkGetExecutionTime";case r.TokenPause:return"TokenPause";case r.TokenUnpause:return"TokenUnpause";case r.CryptoApproveAllowance:return"CryptoApproveAllowance";case r.CryptoDeleteAllowance:return"CryptoDeleteAllowance";case r.GetAccountDetails:return"GetAccountDetails";case r.EthereumTransaction:return"EthereumTransaction";case r.NodeStakeUpdate:return"NodeStakeUpdate";case r.Prng:return"UtilPrng";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.None;case 1:return r.CryptoTransfer;case 2:return r.CryptoUpdate;case 3:return r.CryptoDelete;case 4:return r.CryptoAddLiveHash;case 5:return r.CryptoDeleteLiveHash;case 6:return r.ContractCall;case 7:return r.ContractCreate;case 8:return r.ContractUpdate;case 9:return r.FileCreate;case 10:return r.FileAppend;case 11:return r.FileUpdate;case 12:return r.FileDelete;case 13:return r.CryptoGetAccountBalance;case 14:return r.CryptoGetAccountRecords;case 15:return r.CryptoGetInfo;case 16:return r.ContractCallLocal;case 17:return r.ContractGetInfo;case 18:return r.ContractGetBytecode;case 19:return r.GetBySolidityID;case 20:return r.GetByKey;case 21:return r.CryptoGetLiveHash;case 22:return r.CryptoGetStakers;case 23:return r.FileGetContents;case 24:return r.FileGetInfo;case 25:return r.TransactionGetRecord;case 26:return r.ContractGetRecords;case 27:return r.CryptoCreate;case 28:return r.SystemDelete;case 29:return r.SystemUndelete;case 30:return r.ContractDelete;case 31:return r.Freeze;case 32:return r.CreateTransactionRecord;case 33:return r.CryptoAccountAutoRenew;case 34:return r.ContractAutoRenew;case 35:return r.GetVersionInfo;case 36:return r.TransactionGetReceipt;case 50:return r.ConsensusCreateTopic;case 51:return r.ConsensusUpdateTopic;case 52:return r.ConsensusDeleteTopic;case 53:return r.ConsensusGetTopicInfo;case 54:return r.ConsensusSubmitMessage;case 55:return r.UncheckedSubmit;case 56:return r.TokenCreate;case 58:return r.TokenGetInfo;case 59:return r.TokenFreezeAccount;case 60:return r.TokenUnfreezeAccount;case 61:return r.TokenGrantKycToAccount;case 62:return r.TokenRevokeKycFromAccount;case 63:return r.TokenDelete;case 64:return r.TokenUpdate;case 65:return r.TokenMint;case 66:return r.TokenBurn;case 67:return r.TokenAccountWipe;case 68:return r.TokenAssociateToAccount;case 69:return r.TokenDissociateFromAccount;case 70:return r.ScheduleCreate;case 71:return r.ScheduleDelete;case 72:return r.ScheduleSign;case 73:return r.ScheduleGetInfo;case 74:return r.TokenGetAccountNftInfos;case 75:return r.TokenGetNftInfo;case 76:return r.TokenGetNftInfos;case 77:return r.TokenFeeScheduleUpdate;case 78:return r.NetworkGetExecutionTime;case 79:return r.TokenPause;case 80:return r.TokenUnpause;case 81:return r.CryptoApproveAllowance;case 82:return r.CryptoDeleteAllowance;case 83:return r.GetAccountDetails;case 84:return r.EthereumTransaction;case 85:return r.NodeStakeUpdate;case 86:return r.Prng}throw new Error(`(BUG) RequestType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};Ae.None=new Ae(0);Ae.CryptoTransfer=new Ae(1);Ae.CryptoUpdate=new Ae(2);Ae.CryptoDelete=new Ae(3);Ae.CryptoAddLiveHash=new Ae(4);Ae.CryptoDeleteLiveHash=new Ae(5);Ae.ContractCall=new Ae(6);Ae.ContractCreate=new Ae(7);Ae.ContractUpdate=new Ae(8);Ae.FileCreate=new Ae(9);Ae.FileAppend=new Ae(10);Ae.FileUpdate=new Ae(11);Ae.FileDelete=new Ae(12);Ae.CryptoGetAccountBalance=new Ae(13);Ae.CryptoGetAccountRecords=new Ae(14);Ae.CryptoGetInfo=new Ae(15);Ae.ContractCallLocal=new Ae(16);Ae.ContractGetInfo=new Ae(17);Ae.ContractGetBytecode=new Ae(18);Ae.GetBySolidityID=new Ae(19);Ae.GetByKey=new Ae(20);Ae.CryptoGetLiveHash=new Ae(21);Ae.CryptoGetStakers=new Ae(22);Ae.FileGetContents=new Ae(23);Ae.FileGetInfo=new Ae(24);Ae.TransactionGetRecord=new Ae(25);Ae.ContractGetRecords=new Ae(26);Ae.CryptoCreate=new Ae(27);Ae.SystemDelete=new Ae(28);Ae.SystemUndelete=new Ae(29);Ae.ContractDelete=new Ae(30);Ae.Freeze=new Ae(31);Ae.CreateTransactionRecord=new Ae(32);Ae.CryptoAccountAutoRenew=new Ae(33);Ae.ContractAutoRenew=new Ae(34);Ae.GetVersionInfo=new Ae(35);Ae.TransactionGetReceipt=new Ae(36);Ae.ConsensusCreateTopic=new Ae(50);Ae.ConsensusUpdateTopic=new Ae(51);Ae.ConsensusDeleteTopic=new Ae(52);Ae.ConsensusGetTopicInfo=new Ae(53);Ae.ConsensusSubmitMessage=new Ae(54);Ae.UncheckedSubmit=new Ae(55);Ae.TokenCreate=new Ae(56);Ae.TokenGetInfo=new Ae(58);Ae.TokenFreezeAccount=new Ae(59);Ae.TokenUnfreezeAccount=new Ae(60);Ae.TokenGrantKycToAccount=new Ae(61);Ae.TokenRevokeKycFromAccount=new Ae(62);Ae.TokenDelete=new Ae(63);Ae.TokenUpdate=new Ae(64);Ae.TokenMint=new Ae(65);Ae.TokenBurn=new Ae(66);Ae.TokenAccountWipe=new Ae(67);Ae.TokenAssociateToAccount=new Ae(68);Ae.TokenDissociateFromAccount=new Ae(69);Ae.ScheduleCreate=new Ae(70);Ae.ScheduleDelete=new Ae(71);Ae.ScheduleSign=new Ae(72);Ae.ScheduleGetInfo=new Ae(73);Ae.TokenGetAccountNftInfos=new Ae(74);Ae.TokenGetNftInfo=new Ae(75);Ae.TokenGetNftInfos=new Ae(76);Ae.TokenFeeScheduleUpdate=new Ae(77);Ae.NetworkGetExecutionTime=new Ae(78);Ae.TokenPause=new Ae(79);Ae.TokenUnpause=new Ae(80);Ae.CryptoApproveAllowance=new Ae(81);Ae.CryptoDeleteAllowance=new Ae(82);Ae.GetAccountDetails=new Ae(83);Ae.EthereumTransaction=new Ae(84);Ae.NodeStakeUpdate=new Ae(85);Ae.Prng=new Ae(86);var eGe=Oe(br(),1);var sv=class r extends Ar{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e){let t=e.fileGetContents;return new r({fileId:t.fileID!=null?Gt._fromProtobuf(t.fileID):void 0})}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.getFileContent(t)}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}_mapResponseHeader(e){return e.fileGetContents.header}_mapResponse(e){let i=e.fileGetContents.fileContents.contents;return Promise.resolve(i)}_onMakeRequest(e){return{fileGetContents:{header:e,fileID:this._fileId!=null?this._fileId._toProtobuf():null}}}_getLogId(){return`FileContentsQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("fileGetContents",sv._fromProtobuf);var FB=Oe(Jt(),1);var UB=Oe(br(),1),{proto:tGe}=UB,Nm=class r{constructor(e){this.fileId=e.fileId,this.size=e.size,this.expirationTime=e.expirationTime,this.isDeleted=e.isDeleted,this.keys=e.keys,this.fileMemo=e.fileMemo,this.ledgerId=e.ledgerId,Object.freeze(this)}static _fromProtobuf(e){let t=e.size;return new r({fileId:Gt._fromProtobuf(e.fileID),size:t instanceof FB.default?t:FB.default.fromValue(t),expirationTime:ut._fromProtobuf(e.expirationTime),isDeleted:e.deleted,keys:e.keys!=null?Oi.__fromProtobufKeyList(e.keys):new Oi,fileMemo:e.memo!=null?e.memo:"",ledgerId:e.ledgerId!=null?gr.fromBytes(e.ledgerId):null})}_toProtobuf(){return{fileID:this.fileId._toProtobuf(),size:this.size,expirationTime:this.expirationTime._toProtobuf(),deleted:this.isDeleted,keys:this.keys._toProtobufKey().keyList,memo:this.fileMemo,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null}}static fromBytes(e){return r._fromProtobuf(UB.proto.FileGetInfoResponse.FileInfo.decode(e))}toBytes(){return tGe.FileGetInfoResponse.FileInfo.encode(this._toProtobuf()).finish()}};var cv=class r extends Ar{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e){let t=e.fileGetInfo;return new r({fileId:t.fileID!=null?Gt._fromProtobuf(t.fileID):void 0})}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.getFileInfo(t)}_mapResponseHeader(e){return e.fileGetInfo.header}_mapResponse(e,t,n){let i=e.fileGetInfo;return Promise.resolve(Nm._fromProtobuf(i.fileInfo))}_onMakeRequest(e){return{fileGetInfo:{header:e,fileID:this._fileId!=null?this._fileId._toProtobuf():null}}}_getLogId(){return`FileInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("fileGetInfo",cv._fromProtobuf);var lv=class r extends ke{constructor(e={}){super(),this._fileId=null,this._keys=null,this._expirationTime=null,this._contents=null,this._fileMemo=null,e.fileId!=null&&this.setFileId(e.fileId),e.keys!=null&&this.setKeys(e.keys),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.contents!=null&&this.setContents(e.contents),e.fileMemo!=null&&this.setFileMemo(e.fileMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileUpdate;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,keys:s.keys!=null&&s.keys.keys!=null?s.keys.keys.map(c=>nt._fromProtobufKey(c)):void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0,contents:s.contents!=null?s.contents:void 0,fileMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}get keys(){return this._keys}setKeys(e){if(this._requireNotFrozen(),e instanceof Oi&&e.threshold!=null)throw new Error("Cannot set threshold key as file key");return this._keys=e instanceof Oi?e.toArray():e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof ut?e:ut.fromDate(e),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:i3(e),this}get fileMemo(){return this._fileMemo}setFileMemo(e){return this._requireNotFrozen(),this._fileMemo=e,this}clearFileMemo(){return this._requireNotFrozen(),this._fileMemo=null,this}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.updateFile(t)}_getTransactionDataCase(){return"fileUpdate"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,contents:this._contents,memo:this._fileMemo!=null?{value:this._fileMemo}:null}}_getLogId(){return`FileUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("fileUpdate",lv._fromProtobuf);var xo=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.UnknownFreezeType:return"UNKNOWN_FREEZE_TYPE";case r.FreezeOnly:return"FREEZE_ONLY";case r.PrepareUpgrade:return"PREPARE_UPGRADE";case r.FreezeUpgrade:return"FREEZE_UPGRADE";case r.FreezeAbort:return"FREEZE_ABORT";case r.TelemetryUpgrade:return"TELEMETRY_UPGRADE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.UnknownFreezeType;case 1:return r.FreezeOnly;case 2:return r.PrepareUpgrade;case 3:return r.FreezeUpgrade;case 4:return r.FreezeAbort;case 5:return r.TelemetryUpgrade;default:throw new Error(`(BUG) Status.fromCode() does not handle code: ${e}`)}}valueOf(){return this._code}};xo.UnknownFreezeType=new xo(0);xo.FreezeOnly=new xo(1);xo.PrepareUpgrade=new xo(2);xo.FreezeUpgrade=new xo(3);xo.FreezeAbort=new xo(4);xo.TelemetryUpgrade=new xo(5);var uv=class r extends ke{constructor(e={}){super(),this._startTime=null,this._startTimestamp=null,this._endTime=null,this._fileId=null,this._fileHash=null,this._freezeType=null,e.startTime!=null&&this.setStartTime(e.startTime.hour,e.startTime.minute),e.endTime!=null&&this.setEndTime(e.endTime.hour,e.endTime.minute),e.startTimestamp!=null&&this.setStartTimestamp(e.startTimestamp),e.updateFileId!=null&&this.setUpdateFileId(e.updateFileId),e.fileId!=null&&this.setFileId(e.fileId),e.fileHash!=null&&this.setFileHash(e.fileHash),e.freezeType!=null&&this.setFreezeType(e.freezeType)}static _fromProtobuf(e,t,n,i,a){let s=a[0].freeze;return ke._fromProtobufTransactions(new r({startTime:s.startHour!=null&&s.startMin!=null?{hour:s.startHour,minute:s.startMin}:void 0,endTime:s.endHour!=null&&s.endMin!=null?{hour:s.endHour,minute:s.endMin}:void 0,startTimestamp:s.startTime!=null?ut._fromProtobuf(s.startTime):void 0,updateFileId:s.updateFile!=null?Gt._fromProtobuf(s.updateFile):void 0,fileHash:s.fileHash!=null?s.fileHash:void 0,freezeType:s.freezeType!=null?xo._fromCode(s.freezeType):void 0}),e,t,n,i,a)}get startTime(){return null}setStartTime(e,t){if(this._requireNotFrozen(),typeof e=="string"){let n=e.split(":");this._startTime={hour:Number(n[0]),minute:Number(n[1])}}else this._startTime={hour:e,minute:t};return this}get startTimestamp(){return this._startTimestamp}setStartTimestamp(e){return this._requireNotFrozen(),this._startTimestamp=e,this}get endTime(){return console.warn("`FreezeTransaction.endTime` is deprecated"),this._endTime}setEndTime(e,t){if(console.warn("`FreezeTransaction.endTime` is deprecated"),this._requireNotFrozen(),typeof e=="string"){let n=e.split(":");this._endTime={hour:Number(n[0]),minute:Number(n[1])}}else this._endTime={hour:e,minute:t};return this}get updateFileId(){return this.fileId}setUpdateFileId(e){return this.setFileId(e)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e,this}get fileHash(){return this._fileHash}setFileHash(e){return this._requireNotFrozen(),this._fileHash=typeof e=="string"?tt(e):e,this}get freezeType(){return this._freezeType}setFreezeType(e){return this._requireNotFrozen(),this._freezeType=e,this}_getTransactionDataCase(){return"freeze"}_makeTransactionData(){return{startTime:this._startTimestamp!=null?this._startTimestamp._toProtobuf():null,updateFile:this._fileId!=null?this._fileId._toProtobuf():null,fileHash:this._fileHash,freezeType:this._freezeType!=null?this._freezeType.valueOf():null}}_getLogId(){return`FreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("freeze",uv._fromProtobuf);var dv=class r extends ke{constructor(e={}){super(),this._hash=null,this._keys=null,this._duration=null,this._accountId=null,e.hash!=null&&this.setHash(e.hash),e.keys!=null&&this.setKeys(e.keys),e.duration!=null&&this.setDuration(e.duration),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let c=a[0].cryptoAddLiveHash.liveHash;return ke._fromProtobufTransactions(new r({hash:c.hash!=null?c.hash:void 0,keys:c.keys!=null&&c.keys.keys!=null?c.keys.keys.map(l=>nt._fromProtobufKey(l)):void 0,duration:c.duration!=null&&c.duration.seconds!=null?c.duration.seconds:void 0,accountId:c.accountId!=null?ne._fromProtobuf(c.accountId):void 0}),e,t,n,i,a)}get hash(){return this._hash}setHash(e){return this._requireNotFrozen(),this._hash=e,this}get keys(){return this._keys}setKeys(e){return this._requireNotFrozen(),this._keys=e instanceof Oi?e.toArray():e,this}get duration(){return this._duration}setDuration(e){return this._requireNotFrozen(),this._duration=e instanceof pr?e:new pr(e),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.addLiveHash(t)}_getTransactionDataCase(){return"cryptoAddLiveHash"}_makeTransactionData(){return{liveHash:{hash:this._hash,keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:void 0,duration:this._duration!=null?this._duration._toProtobuf():null,accountId:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`LiveHashAddTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoAddLiveHash",dv._fromProtobuf);var fv=class r extends ke{constructor(e={}){super(),this._hash=null,this._accountId=null,e.hash!=null&&this.setHash(e.hash),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDeleteLiveHash;return ke._fromProtobufTransactions(new r({hash:s.liveHashToDelete!=null?s.liveHashToDelete:void 0,accountId:s.accountOfLiveHash!=null?ne._fromProtobuf(s.accountOfLiveHash):void 0}),e,t,n,i,a)}get hash(){return this._hash}setHash(e){return this._requireNotFrozen(),this._hash=e,this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.deleteLiveHash(t)}_getTransactionDataCase(){return"cryptoDeleteLiveHash"}_makeTransactionData(){return{liveHashToDelete:this._hash,accountOfLiveHash:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`LiveHashDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoDeleteLiveHash",fv._fromProtobuf);var pv=class r extends Ar{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._hash=null,e.hash!=null&&this.setHash(e.hash)}static _fromProtobuf(e){let t=e.cryptoGetLiveHash;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,hash:t.hash!=null?t.hash:void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=e instanceof ne?e:ne.fromString(e),this}get liveHash(){return this._hash}setHash(e){return this._hash=e,this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getLiveHash(t)}_mapResponseHeader(e){return e.cryptoGetLiveHash.header}_mapResponse(e){let t=e.cryptoGetLiveHash;return Promise.resolve(Df._fromProtobuf(t.liveHash))}_onMakeRequest(e){return{cryptoGetLiveHash:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null,hash:this._hash}}}_getLogId(){return`LiveHashQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("cryptoGetLiveHash",pv._fromProtobuf);var qB=Oe(br(),1),h1=class r{constructor(e){this.major=e.major,this.minor=e.minor,this.patch=e.patch,Object.freeze(this)}static _fromProtobuf(e){return new r({major:e.major,minor:e.minor,patch:e.patch})}_toProtobuf(){return{major:this.major,minor:this.minor,patch:this.patch}}static fromBytes(e){return r._fromProtobuf(qB.proto.SemanticVersion.decode(e))}toBytes(){return qB.proto.SemanticVersion.encode(this._toProtobuf()).finish()}};var jB=Oe(br(),1),Rm=class r{constructor(e){this.protobufVersion=e.protobufVersion,this.servicesVesion=e.servicesVesion,Object.freeze(this)}static _fromProtobuf(e){return new r({protobufVersion:h1._fromProtobuf(e.hapiProtoVersion),servicesVesion:h1._fromProtobuf(e.hederaServicesVersion)})}_toProtobuf(){return{hapiProtoVersion:this.protobufVersion._toProtobuf(),hederaServicesVersion:this.servicesVesion._toProtobuf()}}static fromBytes(e){return r._fromProtobuf(jB.proto.NetworkGetVersionInfoResponse.decode(e))}toBytes(){return jB.proto.NetworkGetVersionInfoResponse.encode(this._toProtobuf()).finish()}};var hv=class r extends Ar{constructor(){super()}static _fromProtobuf(e){return new r}_execute(e,t){return e.network.getVersionInfo(t)}_mapResponseHeader(e){return e.networkGetVersionInfo.header}_mapResponse(e){let t=e.networkGetVersionInfo;return Promise.resolve(Rm._fromProtobuf(t))}_onMakeRequest(e){return{networkGetVersionInfo:{header:e}}}_getLogId(){return`NetworkVersionInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("networkGetVersionInfo",hv._fromProtobuf);var mv=class r extends ke{constructor(e={}){super(),this._range=null,e.range!=null&&this.setRange(e.range)}setRange(e){return this._range=e,this}get range(){return this._range}_validateChecksums(e){this._range!=null&&Cw(this._range)&&this._validateChecksums(e)}_execute(e,t){return e.util.prng(t)}static _fromProtobuf(e,t,n,i,a){let s=a[0].utilPrng;return ke._fromProtobufTransactions(new r({range:s.range}),e,t,n,i,a)}_getTransactionDataCase(){return"utilPrng"}_makeTransactionData(){return{range:this.range}}_getLogId(){return`RandomGenerate:${this._transactionIds.current.validStart.toString()}`}};We.set("utilPrng",mv._fromProtobuf);var Mx=Oe(br(),1),Om=class r extends ke{constructor(e={}){super(),this._adminKey=null,this._scheduledTransaction=null,this._payerAccountId=null,this._scheduleMemo=null,this._scheduledSignerPublicKeys=new Set,this._expirationTime=null,this._waitForExpiry=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),e.payerAccountID!=null&&this.setPayerAccountId(e.payerAccountID),e.scheduleMemo!=null&&this.setScheduleMemo(e.scheduleMemo),this._defaultMaxTransactionFee=new Ge(5)}static _fromProtobuf(e,t,n,i,a){let o=a[0],s=o.scheduleCreate,c=new r({adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,payerAccountID:s.payerAccountID!=null?ne._fromProtobuf(s.payerAccountID):void 0,scheduleMemo:s.memo!=null?s.memo:void 0,waitForExpiry:s.waitForExpiry!=null?s.waitForExpiry:void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0});if(o.scheduleCreate!=null){let l=o.scheduleCreate.scheduledTransactionBody,u=Mx.proto.TransactionBody.encode(l).finish(),h={signedTransactionBytes:Mx.proto.SignedTransaction.encode({bodyBytes:u}).finish()},g=Mx.proto.TransactionList.encode({transactionList:[h]}).finish(),m=ke.fromBytes(g);c._setScheduledTransaction(m)}return ke._fromProtobufTransactions(c,e,t,n,i,a)}_setScheduledTransaction(e){return this._scheduledTransaction=e,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get payerAccountId(){return this._payerAccountId}setPayerAccountId(e){return this._requireNotFrozen(),this._payerAccountId=e,this}setScheduleMemo(e){return this._requireNotFrozen(),this._scheduleMemo=e,this}get getScheduleMemo(){return this._requireNotFrozen(),this._scheduleMemo}setScheduledTransaction(e){return this._requireNotFrozen(),e._requireNotFrozen(),this._scheduledTransaction=e.schedule()._scheduledTransaction,this}_validateChecksums(e){this._payerAccountId!=null&&this._payerAccountId.validateChecksum(e)}_execute(e,t){return e.schedule.createSchedule(t)}_getTransactionDataCase(){return"scheduleCreate"}_makeTransactionData(){return{adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,payerAccountID:this._payerAccountId!=null?this._payerAccountId._toProtobuf():null,scheduledTransactionBody:this._scheduledTransaction!=null?this._scheduledTransaction._getScheduledTransactionBody():null,memo:this._scheduleMemo,waitForExpiry:this._waitForExpiry,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`ScheduleCreateTransaction:${this._transactionIds.current.validStart.toString()}`}setExpirationTime(e){return this._expirationTime=e,this}get expirationTime(){return this._requireNotFrozen(),this._expirationTime}setWaitForExpiry(e){return this._waitForExpiry=e,this}get waitForExpiry(){return this._requireNotFrozen(),this._waitForExpiry}};We.set("scheduleCreate",Om._fromProtobuf);Cx.push(()=>new Om);var gv=class r extends ke{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId),this._defaultMaxTransactionFee=new Ge(5)}static _fromProtobuf(e,t,n,i,a){let s=a[0].scheduleDelete;return ke._fromProtobufTransactions(new r({scheduleId:s.scheduleID!=null?Ra._fromProtobuf(s.scheduleID):void 0}),e,t,n,i,a)}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._requireNotFrozen(),this._scheduleId=typeof e=="string"?Ra.fromString(e):e.clone(),this}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.deleteSchedule(t)}_getTransactionDataCase(){return"scheduleDelete"}_makeTransactionData(){return{scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}_getLogId(){return`ScheduleDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("scheduleDelete",gv._fromProtobuf);var rGe=Oe(br(),1);var{proto:Lx}=rGe,Dm=class r{constructor(e){this.scheduleId=e.scheduleId,this.creatorAccountId=e.creatorAccountID,this.payerAccountId=e.payerAccountID,this.schedulableTransactionBody=e.schedulableTransactionBody,this.signers=e.signers,this.scheduleMemo=e.scheduleMemo,this.adminKey=e.adminKey!=null?e.adminKey:null,this.expirationTime=e.expirationTime,this.executed=e.executed,this.deleted=e.deleted,this.scheduledTransactionId=e.scheduledTransactionId,this.waitForExpiry=e.waitForExpiry,Object.freeze(this)}static _fromProtobuf(e){return new r({scheduleId:Ra._fromProtobuf(e.scheduleID),creatorAccountID:e.creatorAccountID!=null?ne._fromProtobuf(e.creatorAccountID):null,payerAccountID:e.payerAccountID!=null?ne._fromProtobuf(e.payerAccountID):null,schedulableTransactionBody:e.scheduledTransactionBody!=null?e.scheduledTransactionBody:null,adminKey:e.adminKey!=null?nt._fromProtobufKey(e.adminKey):null,signers:e.signers!=null?Oi.__fromProtobufKeyList(e.signers):null,scheduleMemo:e.memo!=null?e.memo:null,expirationTime:e.expirationTime!=null?ut._fromProtobuf(e.expirationTime):null,executed:e.executionTime!=null?ut._fromProtobuf(e.executionTime):null,deleted:e.deletionTime!=null?ut._fromProtobuf(e.deletionTime):null,scheduledTransactionId:e.scheduledTransactionID!=null?Qr._fromProtobuf(e.scheduledTransactionID):null,waitForExpiry:e.waitForExpiry!=null?e.waitForExpiry:!1})}_toProtobuf(){return{scheduleID:this.scheduleId!=null?this.scheduleId._toProtobuf():null,creatorAccountID:this.creatorAccountId!=null?this.creatorAccountId._toProtobuf():null,payerAccountID:this.payerAccountId!=null?this.payerAccountId._toProtobuf():null,scheduledTransactionBody:this.schedulableTransactionBody!=null?this.schedulableTransactionBody:null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,signers:this.signers!=null?this.signers._toProtobufKey().keyList:null,memo:this.scheduleMemo!=null?this.scheduleMemo:"",expirationTime:this.expirationTime!=null?this.expirationTime._toProtobuf():null,scheduledTransactionID:this.scheduledTransactionId!=null?this.scheduledTransactionId._toProtobuf():null,waitForExpiry:this.waitForExpiry}}get scheduledTransaction(){if(this.schedulableTransactionBody==null)throw new Error("Scheduled transaction body is empty");let e=new Lx.SchedulableTransactionBody(this.schedulableTransactionBody),t=e.data;return ke.fromBytes(Lx.TransactionList.encode({transactionList:[{signedTransactionBytes:Lx.SignedTransaction.encode({bodyBytes:Lx.TransactionBody.encode({transactionFee:this.schedulableTransactionBody.transactionFee,memo:this.schedulableTransactionBody.memo,[t]:e[t]}).finish()}).finish()}]}).finish())}};var yv=class r extends Ar{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId)}static _fromProtobuf(e){let t=e.scheduleGetInfo;return new r({scheduleId:t.scheduleID!=null?Ra._fromProtobuf(t.scheduleID):void 0})}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._scheduleId=typeof e=="string"?Ra.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.getScheduleInfo(t)}_mapResponseHeader(e){return e.scheduleGetInfo.header}_mapResponse(e,t,n){let i=e.scheduleGetInfo;return Promise.resolve(Dm._fromProtobuf(i.scheduleInfo))}_onMakeRequest(e){return{scheduleGetInfo:{header:e,scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}}_getLogId(){return`ScheduleInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("scheduleGetInfo",yv._fromProtobuf);var vv=class r extends ke{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId),this._defaultMaxTransactionFee=new Ge(5)}static _fromProtobuf(e,t,n,i,a){let s=a[0].scheduleSign;return ke._fromProtobufTransactions(new r({scheduleId:s.scheduleID!=null?Ra._fromProtobuf(s.scheduleID):void 0}),e,t,n,i,a)}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._requireNotFrozen(),this._scheduleId=typeof e=="string"?Ra.fromString(e):e.clone(),this}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.signSchedule(t)}_getTransactionDataCase(){return"scheduleSign"}_makeTransactionData(){return{scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}_getLogId(){return`ScheduleSignTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("scheduleSign",vv._fromProtobuf);var Pm=class{constructor(e){this.publicKey=e.publicKey,this.signature=e.signature,this.accountId=e.accountId}};var bv=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contractId=null,this._expirationTime=null,e.fileId!=null&&this.setFileId(e.fileId),e.contractId!=null&&this.setContractId(e.contractId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime)}static _fromProtobuf(e,t,n,i,a){let s=a[0].systemDelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,contractId:s.contractID!=null?Et._fromProtobuf(s.contractID):void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e instanceof Gt?e:Gt.fromString(e),this}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=e instanceof Et?e:Et.fromString(e),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e,this}_execute(e,t){return this._fileId!=null?e.file.systemDelete(t):e.smartContract.systemDelete(t)}_getTransactionDataCase(){return"systemDelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`SystemDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("systemDelete",bv._fromProtobuf);var wv=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contractId=null,e.fileId!=null&&this.setFileId(e.fileId),e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].systemUndelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,contractId:s.contractID!=null?Et._fromProtobuf(s.contractID):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e instanceof Gt?e:Gt.fromString(e),this}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=e instanceof Et?e:Et.fromString(e),this}_execute(e,t){return this._fileId!=null?e.file.systemUndelete(t):e.smartContract.systemUndelete(t)}_getTransactionDataCase(){return"systemUndelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}_getLogId(){return`SystemUndeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("systemUndelete",wv._fromProtobuf);var _v=class r extends ke{constructor(e={}){super(),this._tokenIds=null,this._accountId=null,this._defaultMaxTransactionFee=new Ge(5),e.tokenIds!=null&&this.setTokenIds(e.tokenIds),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenAssociate;return ke._fromProtobufTransactions(new r({tokenIds:s.tokens!=null?s.tokens.map(c=>De._fromProtobuf(c)):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenIds(){return this._tokenIds}setTokenIds(e){return this._requireNotFrozen(),this._tokenIds=e.map(t=>typeof t=="string"?De.fromString(t):t.clone()),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e);for(let t of this._tokenIds!=null?this._tokenIds:[])t?.validateChecksum(e)}_execute(e,t){return e.token.associateTokens(t)}_getTransactionDataCase(){return"tokenAssociate"}_makeTransactionData(){return{tokens:this._tokenIds!=null?this._tokenIds.map(e=>e._toProtobuf()):null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenAssociateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenAssociate",_v._fromProtobuf);var Ev=Oe(Jt(),1),xv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._amount=null,this._serials=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.amount!=null&&this.setAmount(e.amount),e.serials!=null&&this.setSerials(e.serials)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenBurn;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,amount:s.amount!=null?s.amount:void 0,serials:s.serialNumbers!=null?s.serialNumbers:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof Ev.default?e:Ev.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}get serials(){return this._serials}setSerials(e){return this._requireNotFrozen(),this._serials=e.map(t=>t instanceof Ev.default?t:Ev.default.fromValue(t)),this}_execute(e,t){return e.token.burnToken(t)}_getTransactionDataCase(){return"tokenBurn"}_makeTransactionData(){return{amount:this._amount,serialNumbers:this._serials,token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenBurnTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenBurn",xv._fromProtobuf);var Av=Oe(Jt(),1);var nc=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.FungibleCommon:return"FUNGIBLE_COMMON";case r.NonFungibleUnique:return"NON_FUNGIBLE_UNIQUE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.FungibleCommon;case 1:return r.NonFungibleUnique}throw new Error(`(BUG) TokenType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};nc.FungibleCommon=new nc(0);nc.NonFungibleUnique=new nc(1);var ic=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Infinite:return"INFINITE";case r.Finite:return"FINITE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Infinite;case 1:return r.Finite}throw new Error(`(BUG) TokenSupplyType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};ic.Infinite=new ic(0);ic.Finite=new ic(1);var Tv=class r extends ke{constructor(e={}){super(),this._tokenName=null,this._tokenSymbol=null,this._decimals=null,this._initialSupply=null,this._treasuryAccountId=null,this._adminKey=null,this._kycKey=null,this._freezeKey=null,this._pauseKey=null,this._wipeKey=null,this._supplyKey=null,this._feeScheduleKey=null,this._freezeDefault=null,this._autoRenewAccountId=null,this._expirationTime=null,this._autoRenewPeriod=new pr(_u),this._tokenMemo=null,this._customFees=[],this._tokenType=null,this._supplyType=null,this._maxSupply=null,this._defaultMaxTransactionFee=new Ge(30),e.tokenName!=null&&this.setTokenName(e.tokenName),e.tokenSymbol!=null&&this.setTokenSymbol(e.tokenSymbol),e.decimals!=null&&this.setDecimals(e.decimals),e.initialSupply!=null&&this.setInitialSupply(e.initialSupply),e.treasuryAccountId!=null&&this.setTreasuryAccountId(e.treasuryAccountId),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.kycKey!=null&&this.setKycKey(e.kycKey),e.freezeKey!=null&&this.setFreezeKey(e.freezeKey),e.pauseKey!=null&&this.setPauseKey(e.pauseKey),e.wipeKey!=null&&this.setWipeKey(e.wipeKey),e.supplyKey!=null&&this.setSupplyKey(e.supplyKey),e.feeScheduleKey!=null&&this.setFeeScheduleKey(e.feeScheduleKey),e.freezeDefault!=null&&this.setFreezeDefault(e.freezeDefault),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.tokenMemo!=null&&this.setTokenMemo(e.tokenMemo),e.customFees!=null&&this.setCustomFees(e.customFees),e.tokenType!=null&&this.setTokenType(e.tokenType),e.supplyType!=null&&this.setSupplyType(e.supplyType),e.maxSupply!=null&&this.setMaxSupply(e.maxSupply)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenCreation;return ke._fromProtobufTransactions(new r({tokenName:s.name!=null?s.name:void 0,tokenSymbol:s.symbol!=null?s.symbol:void 0,decimals:s.decimals!=null?s.decimals:void 0,initialSupply:s.initialSupply!=null?s.initialSupply:void 0,treasuryAccountId:s.treasury!=null?ne._fromProtobuf(s.treasury):void 0,adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,kycKey:s.kycKey!=null?nt._fromProtobufKey(s.kycKey):void 0,freezeKey:s.freezeKey!=null?nt._fromProtobufKey(s.freezeKey):void 0,pauseKey:s.pauseKey!=null?nt._fromProtobufKey(s.pauseKey):void 0,wipeKey:s.wipeKey!=null?nt._fromProtobufKey(s.wipeKey):void 0,supplyKey:s.supplyKey!=null?nt._fromProtobufKey(s.supplyKey):void 0,feeScheduleKey:s.feeScheduleKey!=null?nt._fromProtobufKey(s.feeScheduleKey):void 0,freezeDefault:s.freezeDefault!=null?s.freezeDefault:void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,expirationTime:s.expiry!=null?ut._fromProtobuf(s.expiry):void 0,autoRenewPeriod:s.autoRenewPeriod!=null?pr._fromProtobuf(s.autoRenewPeriod):void 0,tokenMemo:s.memo!=null?s.memo:void 0,customFees:s.customFees!=null?s.customFees.map(c=>c.fixedFee!=null?rc._fromProtobuf(c):c.fractionalFee!=null?Su._fromProtobuf(c):Iu._fromProtobuf(c)):void 0,tokenType:s.tokenType!=null?nc._fromCode(s.tokenType):void 0,supplyType:s.supplyType!=null?ic._fromCode(s.supplyType):void 0,maxSupply:s.maxSupply!=null?s.maxSupply:void 0}),e,t,n,i,a)}get tokenName(){return this._tokenName}setTokenName(e){return this._requireNotFrozen(),this._tokenName=e,this}get tokenSymbol(){return this._tokenSymbol}setTokenSymbol(e){return this._requireNotFrozen(),this._tokenSymbol=e,this}get decimals(){return this._decimals}setDecimals(e){return this._requireNotFrozen(),this._decimals=e instanceof Av.default?e:Av.default.fromValue(e),this}get initialSupply(){return this._initialSupply}setInitialSupply(e){return this._requireNotFrozen(),this._initialSupply=Av.default.fromValue(e),this}get treasuryAccountId(){return this._treasuryAccountId}setTreasuryAccountId(e){return this._requireNotFrozen(),this._treasuryAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get kycKey(){return this._kycKey}setKycKey(e){return this._requireNotFrozen(),this._kycKey=e,this}get freezeKey(){return this._freezeKey}setFreezeKey(e){return this._requireNotFrozen(),this._freezeKey=e,this}get pauseKey(){return this._pauseKey}setPauseKey(e){return this._requireNotFrozen(),this._pauseKey=e,this}get wipeKey(){return this._wipeKey}setWipeKey(e){return this._requireNotFrozen(),this._wipeKey=e,this}get supplyKey(){return this._supplyKey}setSupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}get feeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}get freezeDefault(){return this._freezeDefault}setFreezeDefault(e){return this._requireNotFrozen(),this._freezeDefault=e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._autoRenewPeriod=null,this._expirationTime=e instanceof ut?e:ut.fromDate(e),this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get tokenMemo(){return this._tokenMemo}setTokenMemo(e){return this._requireNotFrozen(),this._tokenMemo=e,this}get customFees(){return this._customFees}setCustomFees(e){return this._customFees=e,this}get tokenType(){return this._tokenType}setTokenType(e){return this._tokenType=e,this}get supplyType(){return this._supplyType}setSupplyType(e){return this._supplyType=e,this}get maxSupply(){return this._maxSupply}setMaxSupply(e){return this._maxSupply=typeof e=="number"?Av.default.fromNumber(e):e,this}_freezeWithAccountId(e){super._freezeWithAccountId(e),this._autoRenewPeriod!=null&&e!=null&&(this._autoRenewAccountId=e)}freezeWith(e){return e!=null&&e.operatorAccountId!=null&&this._freezeWithAccountId(e.operatorAccountId),super.freezeWith(e)}_validateChecksums(e){this._treasuryAccountId!=null&&this._treasuryAccountId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.token.createToken(t)}_getTransactionDataCase(){return"tokenCreation"}_makeTransactionData(){return{name:this._tokenName,symbol:this._tokenSymbol,decimals:this._decimals!=null?this._decimals.toInt():null,initialSupply:this._initialSupply,treasury:this._treasuryAccountId!=null?this._treasuryAccountId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,kycKey:this._kycKey!=null?this._kycKey._toProtobufKey():null,freezeKey:this._freezeKey!=null?this._freezeKey._toProtobufKey():null,pauseKey:this._pauseKey!=null?this._pauseKey._toProtobufKey():null,wipeKey:this._wipeKey!=null?this._wipeKey._toProtobufKey():null,supplyKey:this._supplyKey!=null?this._supplyKey._toProtobufKey():null,feeScheduleKey:this._feeScheduleKey!=null?this._feeScheduleKey._toProtobufKey():null,freezeDefault:this._freezeDefault,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,expiry:this._expirationTime!=null?this._expirationTime._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,memo:this._tokenMemo,customFees:this.customFees.map(e=>e._toProtobuf()),tokenType:this._tokenType!=null?this._tokenType._code:null,supplyType:this._supplyType!=null?this._supplyType._code:null,maxSupply:this.maxSupply}}_getLogId(){return`TokenCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenCreation",Tv._fromProtobuf);var Sv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenDeletion;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.deleteToken(t)}_getTransactionDataCase(){return"tokenDeletion"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenDeletion",Sv._fromProtobuf);var Iv=class r extends ke{constructor(e={}){super(),this._tokenIds=null,this._accountId=null,this._defaultMaxTransactionFee=new Ge(5),e.tokenIds!=null&&this.setTokenIds(e.tokenIds),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenDissociate;return ke._fromProtobufTransactions(new r({tokenIds:s.tokens!=null?s.tokens.map(c=>De._fromProtobuf(c)):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenIds(){return this._tokenIds}setTokenIds(e){return this._requireNotFrozen(),this._tokenIds=e.map(t=>typeof t=="string"?De.fromString(t):t.clone()),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e);for(let t of this._tokenIds!=null?this._tokenIds:[])t?.validateChecksum(e)}_execute(e,t){return e.token.dissociateTokens(t)}_getTransactionDataCase(){return"tokenDissociate"}_makeTransactionData(){return{tokens:this._tokenIds!=null?this._tokenIds.map(e=>e._toProtobuf()):null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenDissociateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenDissociate",Iv._fromProtobuf);var Cv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._customFees=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.customFees!=null&&this.setCustomFees(e.customFees)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenFeeScheduleUpdate;return ke._fromProtobufTransactions(new r({tokenId:s.tokenId!=null?De._fromProtobuf(s.tokenId):void 0,customFees:s.customFees!=null?s.customFees.map(c=>c.fixedFee!=null?rc._fromProtobuf(c):c.fractionalFee!=null?Su._fromProtobuf(c):Iu._fromProtobuf(c)):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):De._fromProtobuf(e._toProtobuf()),this}get customFees(){return this._customFees}setCustomFees(e){return this._requireNotFrozen(),this._customFees=e,this}_execute(e,t){return e.token.updateTokenFeeSchedule(t)}_getTransactionDataCase(){return"tokenFeeScheduleUpdate"}_makeTransactionData(){return{tokenId:this._tokenId!=null?this._tokenId._toProtobuf():null,customFees:this._customFees.map(e=>e._toProtobuf())}}_getLogId(){return`TokenFeeScheduleUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenFeeScheduleUpdate",Cv._fromProtobuf);var kv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenFreeze;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.freezeTokenAccount(t)}_getTransactionDataCase(){return"tokenFreeze"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenFreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenFreeze",kv._fromProtobuf);var Nv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenGrantKyc;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.grantKycToTokenAccount(t)}_getTransactionDataCase(){return"tokenGrantKyc"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenGrantKycTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenGrantKyc",Nv._fromProtobuf);var w3e=Oe(Jt(),1),VB=Oe(br(),1);var Bm=class r{constructor(e){this.tokenId=e.tokenId,this.name=e.name,this.symbol=e.symbol,this.decimals=e.decimals,this.totalSupply=e.totalSupply,this.treasuryAccountId=e.treasuryAccountId,this.adminKey=e.adminKey,this.kycKey=e.kycKey,this.freezeKey=e.freezeKey,this.pauseKey=e.pauseKey,this.wipeKey=e.wipeKey,this.supplyKey=e.supplyKey,this.feeScheduleKey=e.feeScheduleKey,this.defaultFreezeStatus=e.defaultFreezeStatus,this.defaultKycStatus=e.defaultKycStatus,this.pauseStatus=e.pauseStatus,this.isDeleted=e.isDeleted,this.autoRenewAccountId=e.autoRenewAccountId,this.autoRenewPeriod=e.autoRenewPeriod,this.expirationTime=e.expirationTime,this.tokenMemo=e.tokenMemo,this.customFees=e.customFees,this.tokenType=e.tokenType,this.supplyType=e.supplyType,this.maxSupply=e.maxSupply,this.ledgerId=e.ledgerId}static _fromProtobuf(e){let t=e.defaultFreezeStatus,n=e.defaultKycStatus,i=e.pauseStatus,a=e.autoRenewAccount!=null?ne._fromProtobuf(e.autoRenewAccount):new ne(0);return new r({tokenId:De._fromProtobuf(e.tokenId),name:e.name,symbol:e.symbol,decimals:e.decimals,totalSupply:w3e.default.fromValue(e.totalSupply),treasuryAccountId:e.treasury!=null?ne._fromProtobuf(e.treasury):null,adminKey:e.adminKey!=null?nt._fromProtobufKey(e.adminKey):null,kycKey:e.kycKey!=null?nt._fromProtobufKey(e.kycKey):null,freezeKey:e.freezeKey!=null?nt._fromProtobufKey(e.freezeKey):null,pauseKey:e.pauseKey!=null?nt._fromProtobufKey(e.pauseKey):null,wipeKey:e.wipeKey!=null?nt._fromProtobufKey(e.wipeKey):null,supplyKey:e.supplyKey!=null?nt._fromProtobufKey(e.supplyKey):null,feeScheduleKey:e.feeScheduleKey!=null?nt._fromProtobufKey(e.feeScheduleKey):null,defaultFreezeStatus:t===0?null:t==1,defaultKycStatus:n===0?null:n==1,pauseStatus:i===0?null:i==1,isDeleted:e.deleted,autoRenewAccountId:a.shard.toInt()==0&&a.realm.toInt()==0&&a.num.toInt()==0?null:a,autoRenewPeriod:e.autoRenewPeriod!=null?pr._fromProtobuf(e.autoRenewPeriod):null,expirationTime:e.expiry!=null?ut._fromProtobuf(e.expiry):null,tokenMemo:e.memo!=null?e.memo:"",customFees:e.customFees!=null?e.customFees.map(o=>o.fixedFee!=null?rc._fromProtobuf(o):o.fractionalFee!=null?Su._fromProtobuf(o):Iu._fromProtobuf(o)):[],tokenType:e.tokenType!=null?nc._fromCode(e.tokenType):null,supplyType:e.supplyType!=null?ic._fromCode(e.supplyType):null,maxSupply:e.maxSupply!=null?e.maxSupply:null,ledgerId:e.ledgerId!=null?gr.fromBytes(e.ledgerId):null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),name:this.name,symbol:this.symbol,decimals:this.decimals,totalSupply:this.totalSupply,treasury:this.treasuryAccountId!=null?this.treasuryAccountId._toProtobuf():null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,kycKey:this.kycKey!=null?this.kycKey._toProtobufKey():null,freezeKey:this.freezeKey!=null?this.freezeKey._toProtobufKey():null,pauseKey:this.pauseKey!=null?this.pauseKey._toProtobufKey():null,wipeKey:this.wipeKey!=null?this.wipeKey._toProtobufKey():null,supplyKey:this.supplyKey!=null?this.supplyKey._toProtobufKey():null,feeScheduleKey:this.feeScheduleKey!=null?this.feeScheduleKey._toProtobufKey():null,defaultFreezeStatus:this.defaultFreezeStatus==null?0:this.defaultFreezeStatus?1:2,defaultKycStatus:this.defaultKycStatus==null?0:this.defaultKycStatus?1:2,pauseStatus:this.pauseStatus==null?0:this.pauseStatus?1:2,deleted:this.isDeleted,autoRenewAccount:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():void 0,autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,expiry:this.expirationTime!=null?this.expirationTime._toProtobuf():null,memo:this.tokenMemo,customFees:this.customFees.map(e=>e._toProtobuf()),tokenType:this.tokenType!=null?this.tokenType._code:null,supplyType:this.supplyType!=null?this.supplyType._code:null,maxSupply:this.maxSupply,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null}}static fromBytes(e){return r._fromProtobuf(VB.proto.TokenInfo.decode(e))}toBytes(){return VB.proto.TokenInfo.encode(this._toProtobuf()).finish()}};var Rv=class r extends Ar{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e){let t=e.tokenGetInfo;return new r({tokenId:t.token!=null?De._fromProtobuf(t.token):void 0})}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.getTokenInfo(t)}_mapResponseHeader(e){return e.tokenGetInfo.header}_mapResponse(e,t,n){let i=e.tokenGetInfo;return Promise.resolve(Bm._fromProtobuf(i.tokenInfo))}_onMakeRequest(e){return{tokenGetInfo:{header:e,token:this._tokenId!=null?this._tokenId._toProtobuf():null}}}_getLogId(){return`TokenInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("tokenGetInfo",Rv._fromProtobuf);var HB=Oe(Jt(),1);var Ov=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._amount=null,this._metadata=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.amount!=null&&this.setAmount(e.amount),e.metadata!=null&&this.setMetadata(e.metadata)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenMint;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,amount:s.amount!=null?s.amount:void 0,metadata:s.metadata!=null?s.metadata:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof HB.default?e:HB.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}get metadata(){return this._metadata}addMetadata(e){return this._requireNotFrozen(),typeof e=="string"&&console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead."),this._metadata.push(typeof e=="string"?tt(e):e),this}setMetadata(e){this._requireNotFrozen();for(let t of e)if(typeof t=="string"){console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead.");break}return this._metadata=e.map(t=>typeof t=="string"?tt(t):t),this}_execute(e,t){return e.token.mintToken(t)}_getTransactionDataCase(){return"tokenMint"}_makeTransactionData(){return{amount:this._amount,token:this._tokenId!=null?this._tokenId._toProtobuf():null,metadata:this._metadata}}_getLogId(){return`TokenMintTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenMint",Ov._fromProtobuf);var Mm=class r{constructor(e){this.nftId=e.nftId,this.accountId=e.accountId,this.creationTime=e.creationTime,this.metadata=e.metadata,this.ledgerId=e.ledgerId,this.spenderId=e.spenderId,Object.freeze(this)}static _fromProtobuf(e){return new r({nftId:sa._fromProtobuf(e.nftID),accountId:ne._fromProtobuf(e.accountID),creationTime:ut._fromProtobuf(e.creationTime),metadata:e.metadata!==void 0?e.metadata:null,ledgerId:e.ledgerId!=null?gr.fromBytes(e.ledgerId):null,spenderId:e.spenderId!=null?ne._fromProtobuf(e.spenderId):null})}_toProtobuf(){return{nftID:this.nftId._toProtobuf(),accountID:this.accountId._toProtobuf(),creationTime:this.creationTime._toProtobuf(),metadata:this.metadata,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,spenderId:this.spenderId!=null?this.spenderId._toProtobuf():null}}toJson(){return{nftId:this.nftId.toString(),accountId:this.accountId.toString(),creationTime:this.creationTime.toString(),metadata:this.metadata!=null?Ke(this.metadata):null,ledgerId:this.ledgerId!=null?this.ledgerId.toString():null,spenderId:this.spenderId!=null?this.spenderId.toString():null}}toString(){return JSON.stringify(this.toJson())}};var KB=Oe(Jt(),1),Dv=class r extends Ar{constructor(e={}){super(),this._nftId=null,e.nftId!=null&&this.setNftId(e.nftId),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._start=null,e.start!=null&&this.setStart(e.start),this._end=null,e.end!=null&&this.setEnd(e.end)}static _fromProtobuf(e){if(e.tokenGetNftInfo!=null){let t=e.tokenGetNftInfo;return new r({nftId:t.nftID!=null?sa._fromProtobuf(t.nftID):void 0})}else if(e.tokenGetAccountNftInfos!=null){let t=e.tokenGetAccountNftInfos;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,start:t.start!=null?t.start:void 0,end:t.end!=null?t.end:void 0})}else{let t=e.tokenGetNftInfos;return new r({tokenId:t.tokenID!=null?De._fromProtobuf(t.tokenID):void 0,start:t.start!=null?t.start:void 0,end:t.end!=null?t.end:void 0})}}get nftId(){return this._nftId}setNftId(e){return this._nftId=typeof e=="string"?sa.fromString(e):sa._fromProtobuf(e._toProtobuf()),this}get accountId(){return console.warn("`TokenNftInfoQuery.accountId` is deprecated with no replacement"),this._accountId}setAccountId(e){return console.warn("`TokenNftInfoQuery.setAccountId()` is deprecated with no replacement"),this._accountId=typeof e=="string"?ne.fromString(e):ne._fromProtobuf(e._toProtobuf()),this}get tokenId(){return console.warn("`TokenNftInfoQuery.tokenId` is deprecated with no replacement"),this._tokenId}setTokenId(e){return console.warn("`TokenNftInfoQuery.setTokenId()` is deprecated with no replacement"),this._tokenId=typeof e=="string"?De.fromString(e):De._fromProtobuf(e._toProtobuf()),this}get start(){return console.warn("`TokenNftInfoQuery.start` is deprecated with no replacement"),this._start}setStart(e){return console.warn("`TokenNftInfoQuery.setStart()` is deprecated with no replacement"),this._start=typeof e=="number"?KB.default.fromNumber(e):e,this}get end(){return console.warn("`TokenNftInfoQuery.end` is deprecated with no replacement"),this._end}setEnd(e){return console.warn("`TokenNftInfoQuery.setEnd()` is deprecated with no replacement"),this._end=typeof e=="number"?KB.default.fromNumber(e):e,this}async getCost(e){return super.getCost(e)}_execute(e,t){return e.token.getTokenNftInfo(t)}_mapResponseHeader(e){return e.tokenGetNftInfo.header}_mapResponse(e,t,n){let i=[e.tokenGetNftInfo.nft];return Promise.resolve(i.map(a=>Mm._fromProtobuf(a)))}_onMakeRequest(e){return{tokenGetNftInfo:{header:e,nftID:this._nftId!=null?this._nftId._toProtobuf():null}}}_getLogId(){return`TokenNftInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("tokenGetNftInfo",Dv._fromProtobuf);var Pv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenPause;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.pauseToken(t)}_getTransactionDataCase(){return"tokenPause"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenPauseTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenPause",Pv._fromProtobuf);var Bv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenRevokeKyc;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.revokeKycFromTokenAccount(t)}_getTransactionDataCase(){return"tokenRevokeKyc"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenRevokeKycTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenRevokeKyc",Bv._fromProtobuf);var Mv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUnfreeze;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.unfreezeTokenAccount(t)}_getTransactionDataCase(){return"tokenUnfreeze"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenUnfreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenUnfreeze",Mv._fromProtobuf);var Lv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUnpause;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.unpauseToken(t)}_getTransactionDataCase(){return"tokenUnpause"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenUnpauseTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenUnpause",Lv._fromProtobuf);var Fv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._tokenName=null,this._tokenSymbol=null,this._treasuryAccountId=null,this._adminKey=null,this._kycKey=null,this._freezeKey=null,this._wipeKey=null,this._supplyKey=null,this._autoRenewAccountId=null,this._expirationTime=null,this._autoRenewPeriod=null,this._tokenMemo=null,this._feeScheduleKey=null,this._pauseKey=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.tokenName!=null&&this.setTokenName(e.tokenName),e.tokenSymbol!=null&&this.setTokenSymbol(e.tokenSymbol),e.treasuryAccountId!=null&&this.setTreasuryAccountId(e.treasuryAccountId),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.kycKey!=null&&this.setKycKey(e.kycKey),e.freezeKey!=null&&this.setFreezeKey(e.freezeKey),e.wipeKey!=null&&this.setWipeKey(e.wipeKey),e.supplyKey!=null&&this.setSupplyKey(e.supplyKey),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.tokenMemo!=null&&this.setTokenMemo(e.tokenMemo),e.feeScheduleKey!=null&&this.setFeeScheduleKey(e.feeScheduleKey),e.pauseKey!=null&&this.setPauseKey(e.pauseKey)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUpdate;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,tokenName:s.name!=null?s.name:void 0,tokenSymbol:s.symbol!=null?s.symbol:void 0,treasuryAccountId:s.treasury!=null?ne._fromProtobuf(s.treasury):void 0,adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,kycKey:s.kycKey!=null?nt._fromProtobufKey(s.kycKey):void 0,freezeKey:s.freezeKey!=null?nt._fromProtobufKey(s.freezeKey):void 0,wipeKey:s.wipeKey!=null?nt._fromProtobufKey(s.wipeKey):void 0,supplyKey:s.supplyKey!=null?nt._fromProtobufKey(s.supplyKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,expirationTime:s.expiry!=null?ut._fromProtobuf(s.expiry):void 0,autoRenewPeriod:s.autoRenewPeriod!=null?pr._fromProtobuf(s.autoRenewPeriod):void 0,tokenMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,feeScheduleKey:s.feeScheduleKey!=null?nt._fromProtobufKey(s.feeScheduleKey):void 0,pauseKey:s.pauseKey!=null?nt._fromProtobufKey(s.pauseKey):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get tokenName(){return this._tokenName}setTokenName(e){return this._requireNotFrozen(),this._tokenName=e,this}get tokenSymbol(){return this._tokenSymbol}setTokenSymbol(e){return this._requireNotFrozen(),this._tokenSymbol=e,this}get treasuryAccountId(){return this._treasuryAccountId}setTreasuryAccountId(e){return this._requireNotFrozen(),this._treasuryAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get kycKey(){return this._kycKey}setKycKey(e){return this._requireNotFrozen(),this._kycKey=e,this}get freezeKey(){return this._freezeKey}setFreezeKey(e){return this._requireNotFrozen(),this._freezeKey=e,this}get wipeKey(){return this._wipeKey}setWipeKey(e){return this._requireNotFrozen(),this._wipeKey=e,this}get supplyKey(){return this._supplyKey}setSupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}setsupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof ut?e:ut.fromDate(e),this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get tokenMemo(){return this._tokenMemo}setTokenMemo(e){return this._requireNotFrozen(),this._tokenMemo=e,this}get feeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}get pauseKey(){return this._pauseKey}setPauseKey(e){return this._requireNotFrozen(),this._pauseKey=e,this}clearTokenMemo(){return this._requireNotFrozen(),this._tokenMemo=null,this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._treasuryAccountId!=null&&this._treasuryAccountId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.token.updateToken(t)}_getTransactionDataCase(){return"tokenUpdate"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,name:this.tokenName,symbol:this.tokenSymbol,treasury:this._treasuryAccountId!=null?this._treasuryAccountId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,kycKey:this._kycKey!=null?this._kycKey._toProtobufKey():null,freezeKey:this._freezeKey!=null?this._freezeKey._toProtobufKey():null,pauseKey:this._pauseKey!=null?this._pauseKey._toProtobufKey():null,wipeKey:this._wipeKey!=null?this._wipeKey._toProtobufKey():null,supplyKey:this._supplyKey!=null?this._supplyKey._toProtobufKey():null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,expiry:this._expirationTime!=null?this._expirationTime._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,memo:this._tokenMemo!=null?{value:this._tokenMemo}:null,feeScheduleKey:this._feeScheduleKey!=null?this._feeScheduleKey._toProtobufKey():null}}_getLogId(){return`TokenUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenUpdate",Fv._fromProtobuf);var Fx=Oe(Jt(),1),Uv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,this._serials=[],this._amount=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId),e.amount!=null&&this.setAmount(e.amount),e.serials!=null&&this.setSerials(e.serials)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenWipe;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0,amount:s.amount!=null?s.amount:void 0,serials:s.serialNumbers!=null?s.serialNumbers:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof Fx.default?e:Fx.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}get serials(){return this._serials}setSerials(e){return this._requireNotFrozen(),this._serials=e.map(t=>typeof t=="number"?Fx.default.fromNumber(t):t),this}_execute(e,t){return e.token.wipeTokenAccount(t)}_getTransactionDataCase(){return"tokenWipe"}_makeTransactionData(){return{amount:this._amount,token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null,serialNumbers:this.serials}}_getLogId(){return`TokenWipeTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenWipe",Uv._fromProtobuf);var qv=class r extends ke{constructor(e={}){super(),this._adminKey=null,this._submitKey=null,this._autoRenewAccountId=null,this._autoRenewPeriod=new pr(_u),this._topicMemo=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),e.submitKey!=null&&this.setSubmitKey(e.submitKey),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.topicMemo!=null&&this.setTopicMemo(e.topicMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusCreateTopic;return ke._fromProtobufTransactions(new r({adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,submitKey:s.submitKey!=null?nt._fromProtobufKey(s.submitKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,topicMemo:s.memo!=null?s.memo:void 0}),e,t,n,i,a)}get topicMemo(){return this._topicMemo}getTopicMemo(){return this._topicMemo}setTopicMemo(e){return this._requireNotFrozen(),this._topicMemo=e,this}get adminKey(){return this._adminKey}getAdminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get submitKey(){return this._submitKey}getSubmitKey(){return this._submitKey}setSubmitKey(e){return this._requireNotFrozen(),this._submitKey=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}getAutoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}getAutoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}_validateChecksums(e){this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.consensus.createTopic(t)}_getTransactionDataCase(){return"consensusCreateTopic"}_makeTransactionData(){return{adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,submitKey:this._submitKey!=null?this._submitKey._toProtobufKey():null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),memo:this._topicMemo}}_getLogId(){return`TopicCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("consensusCreateTopic",qv._fromProtobuf);var jv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusDeleteTopic;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?aa._fromProtobuf(s.topicID):void 0}),e,t,n,i,a)}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?aa.fromString(e):e.clone(),this}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e)}_execute(e,t){return e.consensus.deleteTopic(t)}_getTransactionDataCase(){return"consensusDeleteTopic"}_makeTransactionData(){return{topicID:this._topicId!=null?this._topicId._toProtobuf():null}}_getLogId(){return`TopicDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("consensusDeleteTopic",jv._fromProtobuf);var Ux=Oe(Jt(),1);var zB=Oe(br(),1);var Lm=class r{constructor(e){this.topicId=e.topicId,this.topicMemo=e.topicMemo,this.runningHash=e.runningHash,this.sequenceNumber=e.sequenceNumber,this.expirationTime=e.expirationTime,this.adminKey=e.adminKey,this.submitKey=e.submitKey,this.autoRenewPeriod=e.autoRenewPeriod,this.autoRenewAccountId=e.autoRenewAccountId,this.ledgerId=e.ledgerId,Object.freeze(this)}static _fromProtobuf(e){let t=e.topicInfo;return new r({topicId:aa._fromProtobuf(e.topicID),topicMemo:t.memo!=null?t.memo:"",runningHash:t.runningHash!=null?t.runningHash:new Uint8Array,sequenceNumber:t.sequenceNumber!=null?t.sequenceNumber instanceof Ux.default?t.sequenceNumber:Ux.default.fromValue(t.sequenceNumber):Ux.default.ZERO,expirationTime:t.expirationTime!=null?ut._fromProtobuf(t.expirationTime):null,adminKey:t.adminKey!=null?nt._fromProtobufKey(t.adminKey):null,submitKey:t.submitKey!=null?nt._fromProtobufKey(t.submitKey):null,autoRenewPeriod:t.autoRenewPeriod!=null?new pr(t.autoRenewPeriod.seconds):null,autoRenewAccountId:t.autoRenewAccount!=null?ne._fromProtobuf(t.autoRenewAccount):null,ledgerId:t.ledgerId!=null?gr.fromBytes(t.ledgerId):null})}_toProtobuf(){return{topicID:this.topicId._toProtobuf(),topicInfo:{memo:this.topicMemo,runningHash:this.runningHash,sequenceNumber:this.sequenceNumber,expirationTime:this.expirationTime!=null?this.expirationTime._toProtobuf():null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,submitKey:this.submitKey!=null?this.submitKey._toProtobufKey():null,autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,autoRenewAccount:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():null}}}static fromBytes(e){return r._fromProtobuf({topicInfo:zB.proto.ConsensusTopicInfo.decode(e)})}toBytes(){return zB.proto.ConsensusTopicInfo.encode(this._toProtobuf().topicInfo).finish()}};var Vv=class r extends Ar{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId)}static _fromProtobuf(e){let t=e.consensusGetTopicInfo;return new r({topicId:t.topicID!=null?aa._fromProtobuf(t.topicID):void 0})}get topicId(){return this._topicId}setTopicId(e){return this._topicId=typeof e=="string"?aa.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e)}_execute(e,t){return e.consensus.getTopicInfo(t)}_mapResponseHeader(e){return e.consensusGetTopicInfo.header}_mapResponse(e,t,n){return Promise.resolve(Lm._fromProtobuf(e.consensusGetTopicInfo))}_onMakeRequest(e){return{consensusGetTopicInfo:{header:e,topicID:this._topicId!=null?this._topicId._toProtobuf():null}}}_getLogId(){return`TopicInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("consensusGetTopicInfo",Vv._fromProtobuf);var nGe=Oe(Jt(),1);var aGe=Oe(Jt(),1);var cGe=Oe(br(),1);var lGe=Oe(Jt(),1);var Hv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId),this._message=null,e.message!=null&&this.setMessage(e.message),this._maxChunks=20,this._chunkSize=c3e,e.maxChunks!=null&&this.setMaxChunks(e.maxChunks),e.chunkSize!=null&&this.setChunkSize(e.chunkSize),this._chunkInfo=null}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusSubmitMessage;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?aa._fromProtobuf(s.topicID):void 0,message:s.message!=null?s.message:void 0}),e,t,n,i,a)}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?aa.fromString(e):e.clone(),this}get message(){return this._message}getMessage(){return this._message}setMessage(e){return this._requireNotFrozen(),e=SJ(e),this._message=e instanceof Uint8Array?e:i3(e),this}get maxChunks(){return this._maxChunks}getMaxChunks(){return this._maxChunks}setMaxChunks(e){return this._requireNotFrozen(),this._maxChunks=e,this}get chunkSize(){return this._chunkSize}getChunkSize(){return this._chunkSize}setChunkSize(e){return this._chunkSize=e,this}freezeWith(e){if(super.freezeWith(e),this._message==null)return this;let t=Math.floor((this._message.length+(this._chunkSize-1))/this._chunkSize);if(t>this._maxChunks)throw new Error(`Message with size ${this._message.length} too long for ${this._maxChunks} chunks`);let n=this._getTransactionId()._toProtobuf(),i=this._getTransactionId();this._transactionIds.locked=!1,this._transactions.clear(),this._transactionIds.clear(),this._signedTransactions.clear();for(let a=0;a<t;a++){this._chunkInfo={initialTransactionID:n,total:t,number:a+1},this._transactionIds.push(i),this._transactionIds.advance();for(let o of this._nodeAccountIds.list)this._signedTransactions.push(this._makeSignedTransaction(o));i=new Qr(i.accountId,new ut(i.validStart.seconds,i.validStart.nanos.add(1)))}return this._transactionIds.advance(),this._chunkInfo=null,this}schedule(){if(this._requireNotFrozen(),this._message!=null&&this._message.length>this._chunkSize)throw new Error(`cannot schedule \`TopicMessageSubmitTransaction\` with message over ${this._chunkSize} bytes`);return super.schedule()}async execute(e,t){return(await this.executeAll(e,t))[0]}async executeAll(e,t){super._isFrozen()||this.freezeWith(e);let n=this._getTransactionId(),i=e.operatorAccountId;i!=null&&i.equals(n.accountId)&&await super.signWithOperator(e);let a=[],o=t;for(let s=0;s<this._transactionIds.length;s++){let c=Date.now();a.push(await super.execute(e,o)),o!=null&&(o=Date.now()-c)}return a}_execute(e,t){return e.consensus.submitMessage(t)}_getTransactionDataCase(){return"consensusSubmitMessage"}_makeTransactionData(){if(this._chunkInfo!=null&&this._message!=null){let t=(this._chunkInfo.number-1)*this._chunkSize,n=t+this._chunkSize;return n>this._message.length&&(n=this._message.length),{topicID:this._topicId!=null?this._topicId._toProtobuf():null,message:this._message.slice(t,n),chunkInfo:this._chunkInfo}}else return{topicID:this._topicId!=null?this._topicId._toProtobuf():null,message:this._message}}_getLogId(){return`TopicMessageSubmitTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("consensusSubmitMessage",Hv._fromProtobuf);var Kv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId),this._topicMemo=null,e.topicMemo!=null&&this.setTopicMemo(e.topicMemo),this._submitKey=null,e.submitKey!=null&&this.setSubmitKey(e.submitKey),this._adminKey=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),this._autoRenewAccountId=null,e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),this._autoRenewPeriod=null,e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),this._expirationTime=null,e.expirationTime!=null&&this.setExpirationTime(e.expirationTime)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusUpdateTopic;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?aa._fromProtobuf(s.topicID):void 0,adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,submitKey:s.submitKey!=null?nt._fromProtobufKey(s.submitKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,topicMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0}),e,t,n,i,a)}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof Date?ut.fromDate(e):e,this}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?aa.fromString(e):e.clone(),this}clearTopicId(){return this._requireNotFrozen(),this._topicId=null,this}get topicMemo(){return this._topicMemo}setTopicMemo(e){return this._requireNotFrozen(),this._topicMemo=e,this}clearTopicMemo(){return this._requireNotFrozen(),this._topicMemo=null,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}clearAdminKey(){return this._requireNotFrozen(),this._adminKey=null,this}get submitKey(){return this._submitKey}setSubmitKey(e){return this._requireNotFrozen(),this._submitKey=e,this}clearSubmitKey(){return this._requireNotFrozen(),this._submitKey=null,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}clearAutoRenewAccountId(){return this._requireNotFrozen(),this._autoRenewAccountId=null,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.consensus.updateTopic(t)}_getTransactionDataCase(){return"consensusUpdateTopic"}_makeTransactionData(){return{topicID:this._topicId!=null?this._topicId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,submitKey:this._submitKey!=null?this._submitKey._toProtobufKey():null,memo:this._topicMemo!=null?{value:this._topicMemo}:null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`TopicUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("consensusUpdateTopic",Kv._fromProtobuf);var Wv=Oe(Jt(),1);var zv=class extends fi{constructor(){super(e=>De.fromString(e))}};var Gv=class r extends fi{constructor(){super(e=>ne.fromString(e))}static _fromProtobuf(e){let t=new r;for(let n of e.accountAmounts!=null?e.accountAmounts:[]){let i=ne._fromProtobuf(n.accountID);t._set(i,Ge.fromTinybars(n.amount))}return t}};var GB=Oe(Jt(),1);var Fm=class r{constructor(e){this.tokenId=e.tokenId instanceof De?e.tokenId:De.fromString(e.tokenId),this.senderAccountId=e.senderAccountId instanceof ne?e.senderAccountId:ne.fromString(e.senderAccountId),this.receiverAccountId=e.receiverAccountId instanceof ne?e.receiverAccountId:ne.fromString(e.receiverAccountId),this.serialNumber=GB.default.fromValue(e.serialNumber),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e){let i=De._fromProtobuf(n.token);for(let a of n.nftTransfers!=null?n.nftTransfers:[])t.push(new r({tokenId:i,senderAccountId:ne._fromProtobuf(a.senderAccountID),receiverAccountId:ne._fromProtobuf(a.receiverAccountID),serialNumber:a.serialNumber!=null?a.serialNumber:GB.default.ZERO,isApproved:a.isApproval==!0}))}return t}_toProtobuf(){return{senderAccountID:this.senderAccountId._toProtobuf(),receiverAccountID:this.receiverAccountId._toProtobuf(),serialNumber:this.serialNumber,isApproval:this.isApproved}}};var Qv=class r extends ke{constructor(e={}){super(),this._tokenTransfers=[],this._hbarTransfers=[],this._nftTransfers=[],this._defaultMaxTransactionFee=new Ge(1);for(let t of e.tokenTransfers!=null?e.tokenTransfers:[])this.addTokenTransfer(t.tokenId,t.accountId,t.amount);for(let t of e.hbarTransfers!=null?e.hbarTransfers:[])this.addHbarTransfer(t.accountId,t.amount);for(let t of e.nftTransfers!=null?e.nftTransfers:[])this.addNftTransfer(t.tokenId,t.serial,t.sender,t.recipient)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoTransfer,c=new r;return c._tokenTransfers=Wd._fromProtobuf(s.tokenTransfers!=null?s.tokenTransfers:[]),c._hbarTransfers=uu._fromProtobuf(s.transfers!=null?s.transfers.accountAmounts!=null?s.transfers.accountAmounts:[]:[]),c._nftTransfers=Fm._fromProtobuf(s.tokenTransfers!=null?s.tokenTransfers:[]),ke._fromProtobufTransactions(c,e,t,n,i,a)}get tokenTransfers(){let e=new i1;for(let t of this._tokenTransfers){let n=e.get(t.tokenId);n!=null?n._set(t.accountId,t.amount):(n=new n1,n._set(t.accountId,t.amount),e._set(t.tokenId,n))}return e}_addTokenTransfer(e,t,n,i){this._requireNotFrozen();let a=e instanceof De?e:De.fromString(e),o=t instanceof ne?t:ne.fromString(t),s=n instanceof Wv.default?n:Wv.default.fromNumber(n);for(let c of this._tokenTransfers)if(c.tokenId.compare(a)===0&&c.accountId.compare(o)===0)return c.amount=c.amount.add(s),c.expectedDecimals=null,this;return this._tokenTransfers.push(new Wd({tokenId:e,accountId:t,expectedDecimals:null,amount:n,isApproved:i})),this}addTokenTransfer(e,t,n){return this._addTokenTransfer(e,t,n,!1)}addApprovedTokenTransfer(e,t,n){return this._addTokenTransfer(e,t,n,!0)}addTokenTransferWithDecimals(e,t,n,i){this._requireNotFrozen();let a=e instanceof De?e:De.fromString(e),o=t instanceof ne?t:ne.fromString(t),s=n instanceof Wv.default?n:Wv.default.fromNumber(n),c=!1;for(let l of this._tokenTransfers)if(l.tokenId.compare(a)===0){if(l.expectedDecimals!=null&&l.expectedDecimals!==i)throw new Error("expected decimals mis-match");l.expectedDecimals=i,l.accountId.compare(o)===0&&(l.amount=l.amount.add(s),l.expectedDecimals=i,c=!0)}return c?this:(this._tokenTransfers.push(new Wd({tokenId:e,accountId:t,expectedDecimals:i,amount:n,isApproved:!1})),this)}get tokenIdDecimals(){let e=new zv;for(let t of this._tokenTransfers)e._set(t.tokenId,t.expectedDecimals);return e}get hbarTransfers(){let e=new Gv;for(let t of this._hbarTransfers)e._set(t.accountId,t.amount);return e}_addHbarTransfer(e,t,n){this._requireNotFrozen();let i=e instanceof ne?e.clone():ne.fromString(e),a=t instanceof Ge?t:new Ge(t);for(let o of this._hbarTransfers)if(o.accountId.compare(i)===0)return o.amount=Ge.fromTinybars(o.amount.toTinybars().add(a.toTinybars())),this;return this._hbarTransfers.push(new uu({accountId:i,amount:a,isApproved:n})),this}addHbarTransfer(e,t){return this._addHbarTransfer(e,t,!1)}addApprovedHbarTransfer(e,t){return this._addHbarTransfer(e,t,!0)}_validateChecksums(e){for(let t of this._hbarTransfers)t.accountId.validateChecksum(e);for(let t of this._tokenTransfers)t.tokenId.validateChecksum(e),t.accountId.validateChecksum(e);for(let t of this._nftTransfers)t.tokenId.validateChecksum(e),t.senderAccountId.validateChecksum(e),t.receiverAccountId.validateChecksum(e)}get nftTransfers(){let e=new a1;for(let t of this._nftTransfers){let n=e.get(t.tokenId),i={sender:t.senderAccountId,recipient:t.receiverAccountId,serial:t.serialNumber,isApproved:t.isApproved};n!=null?n.push(i):e._set(t.tokenId,[i])}return e}_addNftTransfer(e,t,n,i,a){this._requireNotFrozen();let o,s,c;if(t instanceof sa)o=t,s=typeof n=="string"?ne.fromString(n):n,c=typeof i=="string"?ne.fromString(i):i;else if(t instanceof De)o=new sa(t,n),s=typeof i=="string"?ne.fromString(i):i,c=typeof a=="string"?ne.fromString(a):a;else try{o=sa.fromString(t),s=typeof n=="string"?ne.fromString(n):n,c=typeof i=="string"?ne.fromString(i):i}catch{let u=De.fromString(t);o=new sa(u,n),s=typeof i=="string"?ne.fromString(i):i,c=typeof a=="string"?ne.fromString(a):a}for(let l of this._nftTransfers)if(l.tokenId.compare(o.tokenId)===0&&l.serialNumber.compare(o.serial)===0)return l.senderAccountId=s,l.receiverAccountId=c,this;return this._nftTransfers.push(new Fm({tokenId:o.tokenId,serialNumber:o.serial,senderAccountId:s,receiverAccountId:c,isApproved:e})),this}addNftTransfer(e,t,n,i){return this._addNftTransfer(!1,e,t,n,i)}addApprovedNftTransfer(e,t,n,i){return this._addNftTransfer(!0,e,t,n,i)}setHbarTransferApproval(e,t){let n=typeof e=="string"?ne.fromString(e):e;for(let i of this._hbarTransfers)i.accountId.compare(n)===0&&(i.isApproved=t);return this}setTokenTransferApproval(e,t,n){let i=typeof e=="string"?De.fromString(e):e,a=typeof t=="string"?ne.fromString(t):t;for(let o of this._tokenTransfers)o.tokenId.compare(i)===0&&o.accountId.compare(a)===0&&(o.isApproved=n);return this}setNftTransferApproval(e,t){let n=typeof e=="string"?sa.fromString(e):e;for(let i of this._nftTransfers)i.tokenId.compare(n.tokenId)===0&&i.serialNumber.compare(n.serial)===0&&(i.isApproved=t);return this}_execute(e,t){return e.crypto.cryptoTransfer(t)}_getTransactionDataCase(){return"cryptoTransfer"}_makeTransactionData(){let e=[];this._tokenTransfers.sort((i,a)=>{let o=i.tokenId.compare(a.tokenId);return o!==0?o:i.accountId.compare(a.accountId)}),this._nftTransfers.sort((i,a)=>{let o=i.senderAccountId.compare(a.senderAccountId);if(o!=0)return o;let s=i.receiverAccountId.compare(a.receiverAccountId);return s!=0?s:i.serialNumber.compare(a.serialNumber)});let t=0,n=0;for(;t<this._tokenTransfers.length||n<this._nftTransfers.length;)if(t<this._tokenTransfers.length&&n<this._nftTransfers.length){let i=this._tokenTransfers[t].tokenId,a=this._nftTransfers[n].tokenId,o=e.length>0?e[e.length-1]:null,s=o!=null?o.tokenId:null;if(o!=null&&s!=null&&s.compare(i)===0){o.transfers.push(this._tokenTransfers[t++]);continue}if(o!=null&&s!=null&&s.compare(a)===0){o.nftTransfers.push(this._nftTransfers[n++]);continue}let c=i.compare(a);c===0?e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[this._nftTransfers[n++]]}):c<0?e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[]}):e.push({tokenId:a,expectedDecimals:null,transfers:[],nftTransfers:[this._nftTransfers[n++]]})}else if(t<this._tokenTransfers.length){let i=this._tokenTransfers[t].tokenId,a;for(let s of e)s.tokenId.compare(i)===0&&(a=s);let o=a!=null?a.tokenId:null;if(a!=null&&o!=null&&o.compare(i)===0){a.transfers.push(this._tokenTransfers[t++]);continue}e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[]})}else if(n<this._nftTransfers.length){let i=this._nftTransfers[n].tokenId,a;for(let s of e)s.tokenId.compare(i)===0&&(a=s);let o=a!=null?a.tokenId:null;if(a!=null&&o!=null&&o.compare(i)===0){a.nftTransfers.push(this._nftTransfers[n++]);continue}e.push({tokenId:i,expectedDecimals:null,transfers:[],nftTransfers:[this._nftTransfers[n++]]})}return this._hbarTransfers.sort((i,a)=>i.accountId.compare(a.accountId)),{transfers:{accountAmounts:this._hbarTransfers.map(i=>({accountID:i.accountId._toProtobuf(),amount:i.amount.toTinybars(),isApproval:i.isApproved}))},tokenTransfers:e.map(i=>({token:i.tokenId._toProtobuf(),expectedDecimals:i.expectedDecimals!=null?{value:i.expectedDecimals}:null,transfers:i.transfers.map(a=>a._toProtobuf()),nftTransfers:i.nftTransfers.map(a=>a._toProtobuf())}))}}_getLogId(){return`TransferTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoTransfer",Qv._fromProtobuf);var Um=class r{constructor(e,t,n){let i=typeof t=="string"?Xc.fromStringDer(t):t;this.publicKey=i.publicKey,this.signer=a=>Promise.resolve(i.sign(a)),this.provider=n,this.accountId=typeof e=="string"?ne.fromString(e):e}static createRandomED25519(){let e=Xc.generateED25519(),n=e.publicKey.toAccountId(0,0);return Promise.resolve(new r(n,e))}static createRandomECDSA(){let e=Xc.generateECDSA(),n=e.publicKey.toAccountId(0,0);return Promise.resolve(new r(n,e))}getProvider(){return this.provider}getAccountId(){return this.accountId}getAccountKey(){return this.publicKey}getLedgerId(){return this.provider==null?null:this.provider.getLedgerId()}getNetwork(){return this.provider==null?{}:this.provider.getNetwork()}getMirrorNetwork(){return this.provider==null?[]:this.provider.getMirrorNetwork()}async sign(e){let t=[];for(let n of e)t.push(new Pm({publicKey:this.publicKey,signature:await this.signer(n),accountId:this.accountId}));return t}getAccountBalance(){return this.call(new ec().setAccountId(this.accountId))}getAccountInfo(){return this.call(new sl().setAccountId(this.accountId))}getAccountRecords(){return this.call(new Eu().setAccountId(this.accountId))}signTransaction(e){return e.signWith(this.publicKey,this.signer)}checkTransaction(e){let t=e.transactionId;if(t!=null&&t.accountId!=null&&t.accountId.compare(this.accountId)!=0)throw new Error("transaction's ID constructed with a different account ID");if(this.provider==null)return Promise.resolve(e);let n=(e.nodeAccountIds!=null?e.nodeAccountIds:[]).map(a=>a.toString()),i=Object.values(this.provider.getNetwork()).map(a=>a.toString());if(!n.reduce((a,o)=>a&&i.includes(o),!0))throw new Error("Transaction already set node account IDs to values not within the current network");return Promise.resolve(e)}populateTransaction(e){if(e._freezeWithAccountId(this.accountId),e.transactionId==null&&e.setTransactionId(Qr.generate(this.accountId)),e.nodeAccountIds!=null&&e.nodeAccountIds.length!=0)return Promise.resolve(e.freeze());if(this.provider==null)return Promise.resolve(e);let t=Object.values(this.provider.getNetwork()).map(n=>typeof n=="string"?ne.fromString(n):n);return Nw(t),e.setNodeAccountIds(t.slice(0,(t.length+3-1)/3)),Promise.resolve(e.freeze())}call(e){if(this.provider==null)throw new Error("cannot send request with an wallet that doesn't contain a provider");return this.provider.call(e._setOperatorWith(this.accountId,this.publicKey,this.signer))}};var HYe=Oe(Ale(),1);var Oa=class r{constructor(e){this._name=e,Object.freeze(this)}toString(){switch(this){case r.Silent:return"silent";case r.Trace:return"trace";case r.Debug:return"debug";case r.Info:return"info";case r.Warn:return"warn";case r.Error:return"error";case r.Fatal:return"fatal";default:return`Unknown log level (${this._name})`}}static _fromString(e){switch(e){case"silent":return r.Silent;case"trace":return r.Trace;case"debug":return r.Debug;case"info":return r.Info;case"warn":return r.Warn;case"error":return r.Error;case"fatal":return r.Fatal;default:throw new Error(`Unknown log level: ${e}`)}}};Oa.Silent=new Oa("silent");Oa.Trace=new Oa("trace");Oa.Debug=new Oa("debug");Oa.Info=new Oa("info");Oa.Warn=new Oa("warn");Oa.Error=new Oa("error");Oa.Fatal=new Oa("fatal");var Tle=Oe(br(),1),aA=class extends cu{constructor(e){super(),this._query=e,this._grpcDeadline=e._grpcDeadline,this._requestTimeout=e._requestTimeout,this._nodeAccountIds=e._nodeAccountIds.clone(),this._operator=e._operator,this._header=null}_getTransactionId(){return this._query._getTransactionId()}_getLogId(){return`CostQuery:${this._query._getLogId()}`}async _beforeExecute(e){if(e==null)throw new Error("Cannot do CostQuery without Client");let t=this._operator!=null?this._operator:e._operator;if(t==null)throw new Error("`client` must have an `operator` or an explicit payment transaction must be provided");this._query._nodeAccountIds.isEmpty&&this._query._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute());let n=Qr.generate(t.accountId);this._query.paymentTransactionId==null&&this._query.setPaymentTransactionId(n);let i=this._getLogId(),a=new ne(0),o=Qr.generate(new ne(0)),s=new Ge(0);this._logger&&this._logger.debug(`[${i}] making a payment transaction for node ${a.toString()} and transaction ID ${o.toString()} with amount ${s.toString()}`),this._header={payment:await LE(o,new ne(0),t,s),responseType:Tle.proto.ResponseType.COST_ANSWER}}_makeRequestAsync(){return Promise.resolve(this._query._onMakeRequest(this._header))}_shouldRetry(e,t){return this._query._shouldRetry(e,t)}_mapStatusError(e,t){return this._query._mapStatusError(e,t)}_mapResponse(e,t,n){let i=this._query._mapResponseHeader(e).cost;return Promise.resolve(Ge.fromTinybars(i))}_execute(e,t){return this._query._execute(e,t)}_requestToBytes(e){return this._query._requestToBytes(e)}_responseToBytes(e){return this._query._responseToBytes(e)}};FE.push(r=>new aA(r));import zit from"fs";import Git from"util";var KYe=/^(\S+):(\d+)$/,Xv=class r{constructor(e={}){if(e.address!=null){let t=KYe.exec(e.address);if(t==null)throw new Error(`failed to parse address: ${e.address}`);this._address=t[1],this._port=t[2]!=null?parseInt(t[2]):null}else if(e.host!=null&&e.port!=null)this._address=e.host,this._port=e.port;else throw new Error(`failed to create a managed node address: ${JSON.stringify(e)}`);Object.freeze(this)}static fromString(e){return new r({address:e})}toInsecure(){let e=this.port===50212?50211:this.port;return new r({host:this.address,port:e})}toSecure(){let e=this.port===50211?50212:this.port;return new r({host:this.address,port:e})}get address(){return this._address}get port(){return this._port}isTransportSecurity(){return this._port==50212||this._port==443}toString(){return this.port==null?this.address:`${this.address}:${this.port}`}};var b1=class{constructor(e={}){if(e.newNode!=null)this._address=typeof e.newNode.address=="string"?Xv.fromString(e.newNode.address):e.newNode.address,this._cert=void 0,this._channel=null,this._channelInitFunction=e.newNode.channelInitFunction,this._lastUsed=Date.now(),this._readmitTime=Date.now(),this._useCount=0,this._badGrpcStatusCount=0,this._minBackoff=8e3,this._maxBackoff=1e3*60*60,this._currentBackoff=this._minBackoff;else if(e.cloneNode!=null)this._address=e.cloneNode.address,this._cert=e.cloneNode.node._cert,this._channel=e.cloneNode.node._channel,this._channelInitFunction=e.cloneNode.node._channelInitFunction,this._currentBackoff=e.cloneNode.node._currentBackoff,this._lastUsed=e.cloneNode.node._lastUsed,this._readmitTime=e.cloneNode.node._readmitTime,this._useCount=e.cloneNode.node._useCount,this._badGrpcStatusCount=e.cloneNode.node._badGrpcStatusCount,this._minBackoff=e.cloneNode.node._minBackoff,this._maxBackoff=e.cloneNode.node._minBackoff;else throw new Error(`failed to create ManagedNode: ${JSON.stringify(e)}`)}getKey(){throw new Error("not implemented")}setCert(e){return this}get address(){return this._address}get attempts(){return this._badGrpcStatusCount}get minBackoff(){return this._minBackoff}setMinBackoff(e){return this._currentBackoff<=e&&(this._currentBackoff=e),this._minBackoff=e,this}get maxBackoff(){return this._maxBackoff}setMaxBackoff(e){return this._currentBackoff<=e&&(this._currentBackoff=e),this._maxBackoff=e,this}getChannel(){return this._useCount++,this.__lastUsed=Date.now(),this._channel!=null?this._channel:(this._channel=this._channelInitFunction(this.address.toString(),this._cert),this._channel)}isHealthy(){return this._readmitTime<=Date.now()}increaseBackoff(){this._currentBackoff=Math.min(this._currentBackoff*2,this._maxBackoff),this._readmitTime=Date.now()+this._currentBackoff}decreaseBackoff(){this._currentBackoff=Math.max(this._currentBackoff/2,this._minBackoff)}getRemainingTime(){return this._readmitTime-this._lastUsed}backoff(){return new Promise(e=>setTimeout(e,this.getRemainingTime()))}compare(e){let t=this.getRemainingTime()-e.getRemainingTime();return t!=0||(t=this._currentBackoff-e._currentBackoff,t!=0)||(t=this._badGrpcStatusCount-e._badGrpcStatusCount,t!=0)||(t=this._useCount-e._useCount,t!=0)?t:this._lastUsed-e._lastUsed}close(){this._channel!=null&&this._channel.close(),this._channel=null}};var Sle={"0.0.3":`-----BEGIN CERTIFICATE-----
10639
+ `):" "+Qae(a[0]):"as no adapter specified";throw new _t("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:TP};function SP(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new rl(null,r)}function PE(r){return SP(r),r.headers=Na.from(r.headers),r.data=r8.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),DE.getAdapter(r.adapter||L2.adapter)(r).then(function(n){return SP(r),n.data=r8.call(r,r.transformResponse,n),n.headers=Na.from(n.headers),n},function(n){return n8(n)||(SP(r),n&&n.response&&(n.response.data=r8.call(r,r.transformResponse,n.response),n.response.headers=Na.from(n.response.headers))),Promise.reject(n)})}var $ae=r=>r instanceof Na?r.toJSON():r;function Fd(r,e){e=e||{};let t={};function n(l,u,d){return be.isPlainObject(l)&&be.isPlainObject(u)?be.merge.call({caseless:d},l,u):be.isPlainObject(u)?be.merge({},u):be.isArray(u)?u.slice():u}function i(l,u,d){if(be.isUndefined(u)){if(!be.isUndefined(l))return n(void 0,l,d)}else return n(l,u,d)}function a(l,u){if(!be.isUndefined(u))return n(void 0,u)}function o(l,u){if(be.isUndefined(u)){if(!be.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function s(l,u,d){if(d in e)return n(l,u);if(d in r)return n(void 0,l)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(l,u)=>i($ae(l),$ae(u),!0)};return be.forEach(Object.keys(Object.assign({},r,e)),function(u){let d=c[u]||i,h=d(r[u],e[u],u);be.isUndefined(h)&&d!==s||(t[u]=h)}),t}var IP={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{IP[r]=function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r}});var Yae={};IP.transitional=function(e,t,n){function i(a,o){return"[Axios v"+K0+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,s)=>{if(e===!1)throw new _t(i(o," has been removed"+(t?" in "+t:"")),_t.ERR_DEPRECATED);return t&&!Yae[o]&&(Yae[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,o,s):!0}};function pVe(r,e,t){if(typeof r!="object")throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),i=n.length;for(;i-- >0;){let a=n[i],o=e[a];if(o){let s=r[a],c=s===void 0||o(s,a,r);if(c!==!0)throw new _t("option "+a+" must be "+c,_t.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new _t("Unknown option "+a,_t.ERR_BAD_OPTION)}}var BE={assertOptions:pVe,validators:IP};var xf=BE.validators,K2=class{constructor(e){this.defaults=e,this.interceptors={request:new ZD,response:new ZD}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;let a=i.stack?i.stack.replace(/^.+\n/,""):"";n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=`
10640
+ `+a):n.stack=a}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Fd(this.defaults,t);let{transitional:n,paramsSerializer:i,headers:a}=t;n!==void 0&&BE.assertOptions(n,{silentJSONParsing:xf.transitional(xf.boolean),forcedJSONParsing:xf.transitional(xf.boolean),clarifyTimeoutError:xf.transitional(xf.boolean)},!1),i!=null&&(be.isFunction(i)?t.paramsSerializer={serialize:i}:BE.assertOptions(i,{encode:xf.function,serialize:xf.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&be.merge(a.common,a[t.method]);a&&be.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),t.headers=Na.concat(o,a);let s=[],c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(t)===!1||(c=c&&b.synchronous,s.unshift(b.fulfilled,b.rejected))});let l=[];this.interceptors.response.forEach(function(b){l.push(b.fulfilled,b.rejected)});let u,d=0,h;if(!c){let m=[PE.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,l),h=m.length,u=Promise.resolve(t);d<h;)u=u.then(m[d++],m[d++]);return u}h=s.length;let g=t;for(d=0;d<h;){let m=s[d++],b=s[d++];try{g=m(g)}catch(E){b.call(this,E);break}}try{u=PE.call(this,g)}catch(m){return Promise.reject(m)}for(d=0,h=l.length;d<h;)u=u.then(l[d++],l[d++]);return u}getUri(e){e=Fd(this.defaults,e);let t=j0(e.baseURL,e.url);return q0(t,e.params,e.paramsSerializer)}};be.forEach(["delete","get","head","options"],function(e){K2.prototype[e]=function(t,n){return this.request(Fd(n||{},{method:e,url:t,data:(n||{}).data}))}});be.forEach(["post","put","patch"],function(e){function t(n){return function(a,o,s){return this.request(Fd(s||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}K2.prototype[e]=t(),K2.prototype[e+"Form"]=t(!0)});var d8=K2;var CP=class r{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(a){t=a});let n=this;this.promise.then(i=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a,o=new Promise(s=>{n.subscribe(s),a=s}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},e(function(a,o,s){n.reason||(n.reason=new rl(a,o,s),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new r(function(i){e=i}),cancel:e}}},Jae=CP;function kP(r){return function(t){return r.apply(null,t)}}function NP(r){return be.isObject(r)&&r.isAxiosError===!0}var RP={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(RP).forEach(([r,e])=>{RP[e]=r});var Zae=RP;function Xae(r){let e=new d8(r),t=Z5(d8.prototype.request,e);return be.extend(t,d8.prototype,e,{allOwnKeys:!0}),be.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return Xae(Fd(r,i))},t}var va=Xae(L2);va.Axios=d8;va.CanceledError=rl;va.CancelToken=Jae;va.isCancel=n8;va.VERSION=K0;va.toFormData=bf;va.AxiosError=_t;va.Cancel=va.CanceledError;va.all=function(e){return Promise.all(e)};va.spread=kP;va.isAxiosError=NP;va.mergeConfig=Fd;va.AxiosHeaders=Na;va.formToJSON=r=>xE(be.isHTMLForm(r)?new FormData(r):r);va.getAdapter=DE.getAdapter;va.HttpStatusCode=Zae;va.default=va;var z0=va;var{Axios:IGt,AxiosError:CGt,CanceledError:kGt,isCancel:NGt,CancelToken:RGt,VERSION:OGt,all:DGt,Cancel:PGt,isAxiosError:BGt,spread:MGt,toFormData:LGt,AxiosHeaders:FGt,HttpStatusCode:UGt,formToJSON:qGt,getAdapter:jGt,mergeConfig:VGt}=z0;var ne=class r{constructor(e,t,n,i,a){let o=j3(e,t,n);this.shard=o.shard,this.realm=o.realm,this.num=o.num,this.aliasKey=i??null,this.evmAddress=a??null,this._checksum=null}static fromString(e){let t=Ud.default.ZERO,n=Ud.default.ZERO,i=Ud.default.ZERO,a,o;if(e.startsWith("0x")&&e.length==42||e.length==40)o=ns.fromString(e);else{let s=J5(e);if(Number.isNaN(s.shard)||Number.isNaN(s.realm))throw new Error("invalid format for entity ID");s.shard!=null&&(t=Ud.default.fromString(s.shard)),s.realm!=null&&(n=Ud.default.fromString(s.realm)),s.numOrHex.length<20?i=Ud.default.fromString(s.numOrHex):s.numOrHex.length==40?o=ns.fromString(s.numOrHex):a=ei.fromString(s.numOrHex)}return new r(t,n,i,a,o)}static fromEvmAddress(e,t,n){let i=typeof n=="string"?ns.fromString(n):n;return Gh(i.toBytes())?this.fromSolidityAddress(i.toString()):new r(e,t,0,void 0,i)}static fromEvmPublicAddress(e){return new r(0,0,0,void 0,e)}static _fromProtobuf(e){let t,n;return e.alias!=null&&(e.alias.length===20?n=ns.fromBytes(e.alias):t=nt._fromProtobufKey(f8.proto.Key.decode(e.alias))),t instanceof ei||(t=void 0),new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.accountNum!=null?e.accountNum:0,t,n)}get checksum(){return this._checksum}getEvmAddress(){return this.evmAddress}async populateAccountNum(e){if(this.evmAddress===null)throw new Error("field `evmAddress` should not be null");let t=e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"));await new Promise(a=>{setTimeout(a,3e3)});let n=`https://${t}/api/v1/accounts/${this.evmAddress.toString()}`,i=(await z0.get(n)).data.account;return this.num=Ud.default.fromString(i.slice(i.lastIndexOf(".")+1)),this}async populateAccountEvmAddress(e){if(this.num===null)throw new Error("field `num` should not be null");let t=e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"));await new Promise(a=>{setTimeout(a,3e3)});let n=`https://${t}/api/v1/accounts/${this.num.toString()}`,i=(await z0.get(n)).data.evm_address;return this.evmAddress=ns.fromString(i),this}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){if(this.aliasKey!=null)throw new Error("cannot calculate checksum with an account ID that has a aliasKey");H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(f8.proto.AccountID.decode(e))}static fromSolidityAddress(e){return Gh(tt(e))?new r(...r3(e)):this.fromEvmAddress(0,0,e)}toSolidityAddress(){return this.evmAddress!=null?this.evmAddress.toString():this.aliasKey!=null&&this.aliasKey._key._type=="secp256k1"?this.aliasKey.toEvmAddress():V3([this.shard,this.realm,this.num])}_toProtobuf(){let e=null;return this.aliasKey!=null?e=f8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():this.evmAddress!=null&&(e=this.evmAddress._bytes),{alias:e,accountNum:this.aliasKey!=null?null:this.num,shardNum:this.shard,realmNum:this.realm}}toBytes(){return f8.proto.AccountID.encode(this._toProtobuf()).finish()}toString(){let e=this.num.toString();return this.aliasKey!=null?e=this.aliasKey.toString():this.evmAddress!=null&&(e=this.evmAddress.toString()),`${this.shard.toString()}.${this.realm.toString()}.${e}`}toStringWithChecksum(e){if(this.aliasKey!=null)throw new Error("cannot calculate checksum with an account ID that has a aliasKey");return K3(this.toString(),e)}equals(e){let t=!1;return this.aliasKey!=null&&e.aliasKey!=null?t=this.aliasKey.equals(e.aliasKey):this.evmAddress!=null&&e.evmAddress!=null?t=this.evmAddress.equals(e.evmAddress):this.aliasKey==null&&e.aliasKey==null&&this.evmAddress==null&&e.evmAddress==null&&(t=this.num.eq(e.num)),this.shard.eq(e.shard)&&this.realm.eq(e.realm)&&t}clone(){let e=new r(this);return e._checksum=this._checksum,e.aliasKey=this.aliasKey,e.evmAddress=this.evmAddress,e}compare(e){let t=this.shard.compare(e.shard);if(t!=0||(t=this.realm.compare(e.realm),t!=0))return t;if(this.aliasKey!=null&&e.aliasKey!=null){let n=this.aliasKey.toString(),i=e.aliasKey.toString();return n>i?1:n<i?-1:0}else if(this.evmAddress!=null&&e.evmAddress!=null){let n=this.evmAddress.toString(),i=e.evmAddress.toString();return n>i?1:n<i?-1:0}else return this.aliasKey==null&&e.aliasKey==null&&this.evmAddress==null&&e.evmAddress==null?this.num.compare(e.num):1}};ar.setAccountIdConstructor((r,e,t)=>new ne(r,e,Ud.default.ZERO,t));var er=class r{constructor(e){this._code=e,Object.freeze(this)}static _fromValue(e){switch(e){case 0:return r.Ok;case 1:return r.Cancelled;case 2:return r.Unknown;case 3:return r.InvalidArgument;case 4:return r.DeadlineExceeded;case 5:return r.NotFound;case 6:return r.AlreadyExists;case 7:return r.PermissionDenied;case 8:return r.ResourceExhausted;case 9:return r.FailedPrecondition;case 10:return r.Aborted;case 11:return r.OutOfRange;case 12:return r.Unimplemented;case 13:return r.Internal;case 14:return r.Unavailable;case 15:return r.DataLoss;case 16:return r.Unauthenticated;case 17:return r.Timeout;case 18:return r.GrpcWeb;default:throw new Error("(BUG) non-exhaustive GrpcStatus switch statement")}}toString(){switch(this){case r.Ok:return"OK";case r.Cancelled:return"CANCELLED";case r.Unknown:return"UNKNOWN";case r.InvalidArgument:return"INVALID_ARGUMENT";case r.DeadlineExceeded:return"DEADLINE_EXCEEDED";case r.NotFound:return"NOT_FOUND";case r.AlreadyExists:return"ALREADY_EXISTS";case r.PermissionDenied:return"PERMISSION_DENIED";case r.Unauthenticated:return"UNAUTHENTICATED";case r.ResourceExhausted:return"RESOURCE_EXHAUSTED";case r.FailedPrecondition:return"FAILED_PRECONDITION";case r.Aborted:return"ABORTED";case r.OutOfRange:return"OUT_OF_RANGE";case r.Unimplemented:return"UNIMPLEMENTED";case r.Internal:return"INTERNAL";case r.Unavailable:return"UNAVAILABLE";case r.DataLoss:return"DATA_LOSS";case r.Timeout:return"TIMEOUT";case r.GrpcWeb:return"GRPC_WEB";default:return`UNKNOWN (${this._code})`}}valueOf(){return this._code}};er.Ok=new er(0);er.Cancelled=new er(1);er.Unknown=new er(2);er.InvalidArgument=new er(3);er.DeadlineExceeded=new er(4);er.NotFound=new er(5);er.AlreadyExists=new er(6);er.PermissionDenied=new er(7);er.ResourceExhausted=new er(8);er.FailedPrecondition=new er(9);er.Aborted=new er(10);er.OutOfRange=new er(11);er.Unimplemented=new er(12);er.Internal=new er(13);er.Unavailable=new er(14);er.DataLoss=new er(15);er.Unauthenticated=new er(16);er.Timeout=new er(17);er.GrpcWeb=new er(18);var qd=class r extends Error{constructor(e){super(`gRPC service failed with status: ${e.toString()}`),this.status=e,this.name="GrpcServiceError",typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}static _fromResponse(e){if(e.code!=null&&e.details!=null){let t=er._fromValue(e.code),n=new r(t);return n.message=e.details,n}else return e}};var nl=class r{constructor(){this.list=[],this.locked=!1,this.index=0}setList(e){if(this.locked)throw new Error("list is locked");return this.list=e,this.index=0,this}push(...e){if(this.locked)throw new Error("list is locked");return this.list.push(...e),this}setLocked(){return this.locked=!0,this}clear(){this.list=[],this.index=0}get(e){return this.list[e]}set(e,t){return e===this.length?this.list.push(t):this.list[e]=t,this}setIfAbsent(e,t){return(e==this.length||this.list[e]==null)&&this.set(e,t()),this}get next(){return this.get(this.advance())}get current(){return this.get(this.index)}advance(){let e=this.index;return this.index=(this.index+1)%this.list.length,e}get isEmpty(){return this.length===0}get length(){return this.list.length}clone(){let e=new r;return e.list=this.list,e.locked=this.locked,e}};var p8=class r extends Error{constructor(e){super(`failed with error code: ${e.toString()}`),this.status=e,this.name="HttpError",typeof Error.captureStackTrace<"u"&&Error.captureStackTrace(this,r)}};var Bn={Finished:"Finished",Retry:"Retry",Error:"Error"},ME=/\brst[^0-9a-zA-Z]stream\b/i,cu=class{constructor(){this._maxAttempts=10,this._nodeAccountIds=new nl,this._signOnDemand=!1,this._minBackoff=null,this._maxBackoff=8e3,this._operator=null,this._requestTimeout=null,this._grpcDeadline=null,this._logger=null}get nodeAccountIds(){return this._nodeAccountIds.isEmpty?null:(this._nodeAccountIds.setLocked(),this._nodeAccountIds.list)}setNodeAccountIds(e){return this._nodeAccountIds.setList(e).setLocked(),this}get maxRetries(){return console.warn("Deprecated: use maxAttempts instead"),this.maxAttempts}setMaxRetries(e){return console.warn("Deprecated: use setMaxAttempts() instead"),this.setMaxAttempts(e)}get maxAttempts(){return this._maxAttempts}setMaxAttempts(e){return this._maxAttempts=e,this}get grpcDeadline(){return this._grpcDeadline}setGrpcDeadline(e){return this._grpcDeadline=e,this}setMinBackoff(e){if(e==null)throw new Error("minBackoff cannot be null.");if(this._maxBackoff!=null&&e>this._maxBackoff)throw new Error("minBackoff cannot be larger than maxBackoff.");return this._minBackoff=e,this}get minBackoff(){return this._minBackoff}setMaxBackoff(e){if(e==null)throw new Error("maxBackoff cannot be null.");if(this._minBackoff!=null&&e<this._minBackoff)throw new Error("maxBackoff cannot be smaller than minBackoff.");return this._maxBackoff=e,this}get maxBackoff(){return this._maxBackoff}_beforeExecute(e){throw new Error("not implemented")}_makeRequestAsync(){throw new Error("not implemented")}_mapStatusError(e,t){throw new Error("not implemented")}_mapResponse(e,t,n){throw new Error("not implemented")}_execute(e,t){throw new Error("not implemented")}_getTransactionId(){throw new Error("not implemented")}_getLogId(){throw new Error("not implemented")}_requestToBytes(e){throw new Error("not implemented")}_responseToBytes(e){throw new Error("not implemented")}_advanceRequest(){this._nodeAccountIds.advance()}_shouldRetry(e,t){throw new Error("not implemented")}_shouldRetryExceptionally(e){return e instanceof qd?e.status._code===er.Timeout._code||e.status._code===er.Unavailable._code||e.status._code===er.ResourceExhausted._code||e.status._code===er.GrpcWeb._code||e.status._code===er.Internal._code&&ME.test(e.message):!0}_setOperatorWith(e,t,n){return this._operator={transactionSigner:n,accountId:e,publicKey:t},this}async executeWithSigner(e){return e.call(this)}async execute(e,t){this._logger=this._logger==null?e._logger!=null?e._logger:null:this._logger,this._requestTimeout==null&&(this._requestTimeout=t??e.requestTimeout),await this._beforeExecute(e),this._maxBackoff==null&&(this._maxBackoff=e.maxBackoff),this._minBackoff==null&&(this._minBackoff=e.minBackoff);let n=e._maxAttempts!=null?e._maxAttempts:this._maxAttempts,i=Date.now(),a=null;for(let o=1;o<=n;o+=1){if(this._requestTimeout!=null&&i+this._requestTimeout<=Date.now())throw new Error("timeout exceeded");let s,c;if(this._nodeAccountIds.locked?(s=this._nodeAccountIds.current,c=e._network.getNode(s)):(c=e._network.getNode(),s=c.accountId,this._nodeAccountIds.setList([s])),c==null)throw new Error(`NodeAccountId not recognized: ${s.toString()}`);let l=this._getLogId();this._logger&&this._logger.debug(`[${l}] Node AccountID: ${c.accountId.toString()}, IP: ${c.address.toString()}`);let u=c.getChannel(),d=await this._makeRequestAsync();this._advanceRequest();let h;if(!c.isHealthy()){this._logger&&this._logger.debug(`[${l}] node is not healthy, skipping waiting ${c.getRemainingTime()}`);continue}try{let b=[];this._grpcDeadline!=null&&b.push(new Promise((E,I)=>setTimeout(()=>I(new Error("grpc deadline exceeded")),this._grpcDeadline))),this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${Ke(this._requestToBytes(d))}`),b.push(this._execute(u,d)),h=await Promise.race(b)}catch(b){let E=qd._fromResponse(b);if(a=E,this._logger&&this._logger.debug(`[${l}] received error ${JSON.stringify(E)}`),(E instanceof qd||E instanceof p8)&&this._shouldRetryExceptionally(E)&&o<=n){this._logger&&this._logger.debug(`[${this._getLogId()}] node with accountId: ${c.accountId.toString()} and proxy IP: ${c.address.toString()} is unhealthy`),e._network.increaseBackoff(c);continue}throw b}this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${Ke(this._responseToBytes(h))}`),e._network.decreaseBackoff(c);let[g,m]=this._shouldRetry(d,h);switch(g!=null&&(a=g),m){case Bn.Retry:await hVe(o,this._minBackoff,this._maxBackoff);continue;case Bn.Finished:return this._mapResponse(h,s,d);case Bn.Error:throw this._mapStatusError(d,h);default:throw new Error("(BUG) non-exhuastive switch statement for `ExecutionState`")}}throw new Error(`max attempts of ${n.toString()} was reached for request with last error being: ${a!=null?a.toString():""}`)}toBytes(){throw new Error("not implemented")}setLogger(e){return this._logger=e,this}get logger(){return this._logger}};function hVe(r,e,t){let n=Math.min(Math.floor(e*Math.pow(2,r)),t);return new Promise(i=>setTimeout(i,n))}var lu=Oe(Jt(),1);var eoe=lu.default.fromNumber(1e9),toe=new Set,ut=class r{constructor(e,t){this.seconds=e instanceof lu.default?e:lu.default.fromNumber(e),this.nanos=t instanceof lu.default?t:lu.default.fromNumber(t),Object.freeze(this)}static generate(){let e=Math.floor(Math.random()*5e3)+8e3,t=Date.now()-e,n=Math.floor(t/1e3)+ar.timeDrift,i=Math.floor(t%1e3)*1e6+Math.floor(Math.random()*1e6),a=new r(n,i);return toe.has(a.toString())?this.generate():(toe.add(a.toString()),a)}static fromDate(e){let t;if(typeof e=="number")t=lu.default.fromNumber(e);else if(typeof e=="string")t=lu.default.fromNumber(Date.parse(e)).mul(1e6);else if(e instanceof Date)t=lu.default.fromNumber(e.getTime()).mul(1e6);else throw new TypeError(`invalid type '${typeof e}' for 'data', expected 'Date'`);return new r(0,0).plusNanos(t)}toDate(){return new Date(this.seconds.toInt()*1e3+Math.floor(this.nanos.toInt()/1e6))}plusNanos(e){let t=this.nanos.add(e);return new r(this.seconds.add(t.div(eoe)),t.mod(eoe))}_toProtobuf(){return{seconds:this.seconds,nanos:this.nanos.toInt()}}static _fromProtobuf(e){return new r(e.seconds instanceof lu.default?e.seconds.toInt():e.seconds!=null?e.seconds:0,e.nanos!=null?e.nanos:0)}toString(){let e=String(this.nanos).padStart(9,"0");return`${this.seconds.toString()}.${e}`}compare(e){let t=this.seconds.compare(e.seconds);return t!=0?t:this.nanos.compare(e.nanos)}};var OP=Oe(br(),1),h8=Oe(Jt(),1);var Qr=class r{constructor(e,t,n=!1,i=null){this.accountId=e,this.validStart=t,this.scheduled=n,this.nonce=null,i!=null&&i!=0&&this.setNonce(i),Object.seal(this)}setNonce(e){return this.nonce=typeof e=="number"?h8.default.fromNumber(e):e,this}static withValidStart(e,t){return new r(e,t)}static generate(e){return new r(typeof e=="string"?ne.fromString(e):new ne(e),ut.generate())}static fromString(e){let t,n,i,a,o,s;return[t,s]=e.split("@"),[n,s]=s.split("."),s.includes("?")?([i,s]=s.split("?scheduled"),a=!0,s.includes("/")?o=s.replace("/",""):o=null):s.includes("/")?([i,o]=s.split("/"),a=!1):i=s,new r(ne.fromString(t),new ut(h8.default.fromValue(n),h8.default.fromValue(i)),a,o!=null?h8.default.fromString(o):null)}setScheduled(e){return this.scheduled=e,this}toString(){if(this.accountId!=null&&this.validStart!=null){let e=String(this.validStart.nanos).padStart(9,"0"),t=this.nonce!=null?"/".concat(this.nonce.toString()):"",n=this.scheduled?"?scheduled":"";return`${this.accountId.toString()}@${this.validStart.seconds.toString()}.${e}${n}${t}`}else throw new Error("neither `accountId` nor `validStart` are set")}static _fromProtobuf(e){if(e.accountID!=null&&e.transactionValidStart!=null)return new r(ne._fromProtobuf(e.accountID),ut._fromProtobuf(e.transactionValidStart),e.scheduled!=null?e.scheduled:void 0,e.nonce!=null?e.nonce:void 0);throw new Error("Neither `nonce` or `accountID` and `transactionValidStart` are set")}_toProtobuf(){return{accountID:this.accountId!=null?this.accountId._toProtobuf():null,transactionValidStart:this.validStart!=null?this.validStart._toProtobuf():null,scheduled:this.scheduled,nonce:this.nonce!=null?this.nonce.toInt():null}}static fromBytes(e){return r._fromProtobuf(OP.proto.TransactionID.decode(e))}toBytes(){return OP.proto.TransactionID.encode(this._toProtobuf()).finish()}clone(){return new r(this.accountId,this.validStart,this.scheduled,this.nonce)}compare(e){let t=this.accountId.compare(e.accountId);return t!=0?t:this.validStart.compare(e.validStart)}getReceipt(e){return ar.transactionReceiptQueryConstructor().setTransactionId(this).execute(e)}async getRecord(e){return await this.getReceipt(e),ar.transactionRecordQueryConstructor().setTransactionId(this).execute(e)}};var W3=Oe(br(),1);var is=class extends ou{constructor(e){super(e,`transaction ${e.transactionId.toString()} failed precheck with status ${e.status.toString()}`),this.contractFunctionResult=e.contractFunctionResult}toJSON(){return{name:this.name,status:this.status.toString(),transactionId:this.transactionId.toString(),message:this.message,contractFunctionResult:this.contractFunctionResult}}};var z2=class extends Error{constructor(e,t){super(),this.message=`query cost of ${e.toString()} HBAR exceeds max set on client: ${t.toString()} HBAR`,this.name="MaxQueryPaymentExceededError",this.queryCost=e,this.maxQueryPayment=t}};var roe=Oe(Jt(),1),$r=new Map,Ar=class extends cu{constructor(){super(),this._paymentTransactionId=null,this._paymentTransactions=[],this._queryPayment=null,this._maxQueryPayment=null,this._timestamp=Date.now()}static fromBytes(e){let t=W3.proto.Query.decode(e);if(t.query==null)throw new Error("(BUG) query.query was not set in the protobuf");let n=$r.get(t.query);if(n==null)throw new Error(`(BUG) Query.fromBytes() not implemented for type ${t.query}`);return n(t)}toBytes(){return W3.proto.Query.encode(this._makeRequest()).finish()}setQueryPayment(e){return this._queryPayment=e,this}setMaxQueryPayment(e){return this._maxQueryPayment=e,this}async getCost(e){if(this._nodeAccountIds.isEmpty&&this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute()),FE.length!=1)throw new Error("CostQuery has not been loaded yet");this._timestamp=Date.now();let t=await FE[0](this).execute(e);return Ge.fromTinybars(t._valueInTinybar.multipliedBy(1.1).toFixed(0))}setPaymentTransactionId(e){return this._paymentTransactionId=e,this}get paymentTransactionId(){return this._paymentTransactionId}_getTransactionId(){if(this._paymentTransactionId==null)throw new Error("Query.PaymentTransactionId was not set duration execution");return this._paymentTransactionId}_isPaymentRequired(){return!0}_validateChecksums(e){}async _beforeExecute(e){if(this._paymentTransactions.length>0)return;if(e.isAutoValidateChecksumsEnabled()&&this._validateChecksums(e),this._nodeAccountIds.isEmpty&&this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute()),this._operator=this._operator!=null?this._operator:e._operator,this._paymentTransactionId==null)if(this._isPaymentRequired())if(this._operator!=null)this._paymentTransactionId=Qr.generate(this._operator.accountId);else throw new Error("`client` must have an `operator` or an explicit payment transaction must be provided");else this._paymentTransactionId=Qr.generate(new ne(0));let t=new Ge(0),n=this._maxQueryPayment!=null?this._maxQueryPayment:e.defaultMaxQueryPayment;if(this._queryPayment!=null)t=this._queryPayment;else if(this._paymentTransactions.length===0&&this._isPaymentRequired()){let i=await this.getCost(e);if(n.toTinybars().toInt()<i.toTinybars().toInt())throw new z2(i,n);t=i,this._logger&&this._logger.debug(`[${this._getLogId()}] received cost for query ${t.toString()}`)}this._queryPayment=t,this._timestamp=Date.now(),this._nodeAccountIds.setLocked();for(let i of this._nodeAccountIds.list){let a=this._getLogId(),o=this._paymentTransactionId,s=this._queryPayment;this._logger&&this._logger.debug(`[${a}] making a payment transaction for node ${i.toString()} and transaction ID ${o.toString()} with amount ${s.toString()}`),this._paymentTransactions.push(await LE(o,i,this._isPaymentRequired()?this._operator:null,s))}}_mapResponseHeader(e){throw new Error("not implemented")}_makeRequestHeader(){let e={};return this._isPaymentRequired()&&this._paymentTransactions.length>0&&(e={responseType:W3.proto.ResponseType.ANSWER_ONLY,payment:this._paymentTransactions[this._nodeAccountIds.index]}),e}_onMakeRequest(e){throw new Error("not implemented")}_makeRequest(){let e={};return this._isPaymentRequired()&&this._paymentTransactions!=null&&(e={payment:this._paymentTransactions[this._nodeAccountIds.index],responseType:W3.proto.ResponseType.ANSWER_ONLY}),this._onMakeRequest(e)}async _makeRequestAsync(){let e={responseType:W3.proto.ResponseType.ANSWER_ONLY};if(this._isPaymentRequired()&&this._paymentTransactions!=null)if(this._nodeAccountIds.locked)e.payment=this._paymentTransactions[this._nodeAccountIds.index];else{let t=this._getLogId(),n=this._nodeAccountIds.current,i=this._paymentTransactionId,a=this._queryPayment;this._logger&&this._logger.debug(`[${t}] making a payment transaction for node ${n.toString()} and transaction ID ${i.toString()} with amount ${a.toString()}`),e.payment=await LE(i,n,this._isPaymentRequired()?this._operator:null,a)}return this._onMakeRequest(e)}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??W3.proto.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.PlatformTransactionNotCreated:return[i,Bn.Retry];case P.Ok:return[i,Bn.Finished];default:return[i,Bn.Error]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??W3.proto.ResponseCodeEnum.OK);return new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}_requestToBytes(e){return W3.proto.Query.encode(e).finish()}_responseToBytes(e){return W3.proto.Response.encode(e).finish()}};async function LE(r,e,t,n){let i=[];t!=null?(i.push({accountID:t.accountId._toProtobuf(),amount:n.negated().toTinybars()}),i.push({accountID:e._toProtobuf(),amount:n.toTinybars()})):(i.push({accountID:new ne(0)._toProtobuf(),amount:n.negated().toTinybars()}),i.push({accountID:e._toProtobuf(),amount:n.toTinybars()}));let a={transactionID:r._toProtobuf(),nodeAccountID:e._toProtobuf(),transactionFee:new Ge(1).toTinybars(),transactionValidDuration:{seconds:roe.default.fromNumber(120)},cryptoTransfer:{transfers:{accountAmounts:i}}},o={bodyBytes:W3.proto.TransactionBody.encode(a).finish()};if(t!=null){let s=await t.transactionSigner(o.bodyBytes);o.sigMap={sigPair:[t.publicKey._toProtobufSignature(s)]}}return{signedTransactionBytes:W3.proto.SignedTransaction.encode(o).finish()}}var FE=[];var DP=Oe(br(),1);var Af=Oe(Jt(),1);var Et=class r extends nt{constructor(e,t,n,i){super();let a=j3(e,t,n);this.shard=a.shard,this.realm=a.realm,this.num=a.num,this.evmAddress=i??null,this._checksum=null}static fromEvmAddress(e,t,n){return Gh(tt(n))?new r(...r3(n)):new r(e,t,0,tt(n))}static fromString(e){let t=J5(e);if(Number.isNaN(t.shard)||Number.isNaN(t.realm))throw new Error("invalid format for entity ID");let n=t.shard!=null?Af.default.fromString(t.shard):Af.default.ZERO,i=t.realm!=null?Af.default.fromString(t.realm):Af.default.ZERO,[a,o]=t.numOrHex.length<40?[Af.default.fromString(t.numOrHex),void 0]:[Af.default.ZERO,tt(t.numOrHex)];return new r(n,i,a,o)}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.contractNum!=null?e.contractNum:0)}get checksum(){return this._checksum}async populateAccountNum(e){if(this.evmAddress===null)throw new Error("field `evmAddress` should not be null");let n=`https://${e.mirrorNetwork[0].slice(0,e.mirrorNetwork[0].indexOf(":"))}/api/v1/contracts/${Ke(this.evmAddress)}`,i=(await z0.get(n)).data.contract_id;return this.num=Af.default.fromString(i.slice(i.lastIndexOf(".")+1)),this}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(DP.proto.ContractID.decode(e))}static fromSolidityAddress(e){return Gh(tt(e))?new r(...r3(e)):this.fromEvmAddress(0,0,e)}toSolidityAddress(){return this.evmAddress!=null?Ke(this.evmAddress):V3([this.shard,this.realm,this.num])}_toProtobuf(){return{contractNum:this.num,shardNum:this.shard,realmNum:this.realm,evmAddress:this.evmAddress}}toString(){return this.evmAddress!=null?`${this.shard.toString()}.${this.realm.toString()}.${Ke(this.evmAddress)}`:`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return K3(this.toString(),e)}toBytes(){return DP.proto.ContractID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e.evmAddress=this.evmAddress,e}compare(e){return au([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}equals(e){let t=!1;return this.evmAddress!=null&&e.evmAddress!=null&&(t=uE(this.evmAddress,e.evmAddress)),this.shard.eq(e.shard)&&this.realm.eq(e.realm)&&this.num.eq(e.num)&&t}_toProtobufKey(){return{contractID:this._toProtobuf()}}static __fromProtobufKey(e){return r._fromProtobuf(e)}};ar.setContractId(r=>Et.__fromProtobufKey(r));var PP=Oe(br(),1),UE=Oe(Jt(),1),Gt=class r{constructor(e,t,n){let i=j3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?UE.default.fromString(e.shardNum.toString()):0,e.realmNum!=null?UE.default.fromString(e.realmNum.toString()):0,e.fileNum!=null?UE.default.fromString(e.fileNum.toString()):0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(PP.proto.FileID.decode(e))}static fromSolidityAddress(e){let[t,n,i]=r3(e);return new r(t,n,i)}toSolidityAddress(){return V3([this.shard,this.realm,this.num])}_toProtobuf(){return{fileNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return K3(this.toString(),e)}toBytes(){return PP.proto.FileID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return au([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};Gt.ADDRESS_BOOK=new Gt(102);Gt.FEE_SCHEDULE=new Gt(111);Gt.EXCHANGE_RATES=new Gt(112);var BP=Oe(br(),1),aa=class r{constructor(e,t,n){let i=j3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.topicNum!=null?e.topicNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(BP.proto.TopicID.decode(e))}static fromSolidityAddress(e){let[t,n,i]=r3(e);return new r(t,n,i)}toSolidityAddress(){return V3([this.shard,this.realm,this.num])}_toProtobuf(){return{topicNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return K3(this.toString(),e)}toBytes(){return BP.proto.TopicID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return au([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var MP=Oe(br(),1),De=class r{constructor(e,t,n){let i=j3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.tokenNum!=null?e.tokenNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(MP.proto.TokenID.decode(e))}static fromSolidityAddress(e){return new r(...r3(e))}toSolidityAddress(){return V3([this.shard,this.realm,this.num])}_toProtobuf(){return{tokenNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return K3(this.toString(),e)}toBytes(){return MP.proto.TokenID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return au([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var LP=Oe(br(),1),Ra=class r{constructor(e,t,n){let i=j3(e,t,n);this.shard=i.shard,this.realm=i.realm,this.num=i.num,this._checksum=null}static fromString(e){let t=vf(e),n=new r(t);return n._checksum=t.checksum,n}static _fromProtobuf(e){return new r(e.shardNum!=null?e.shardNum:0,e.realmNum!=null?e.realmNum:0,e.scheduleNum!=null?e.scheduleNum:0)}get checksum(){return this._checksum}validate(e){console.warn("Deprecated: Use `validateChecksum` instead"),this.validateChecksum(e)}validateChecksum(e){H3(this.shard,this.realm,this.num,this._checksum,e)}static fromBytes(e){return r._fromProtobuf(LP.proto.ScheduleID.decode(e))}static fromSolidityAddress(e){return new r(...r3(e))}toSolidityAddress(){return V3([this.shard,this.realm,this.num])}_toProtobuf(){return{scheduleNum:this.num,shardNum:this.shard,realmNum:this.realm}}toString(){return`${this.shard.toString()}.${this.realm.toString()}.${this.num.toString()}`}toStringWithChecksum(e){return K3(this.toString(),e)}toBytes(){return LP.proto.ScheduleID.encode(this._toProtobuf()).finish()}clone(){let e=new r(this);return e._checksum=this._checksum,e}compare(e){return au([this.shard,this.realm,this.num],[e.shard,e.realm,e.num])}};var FP=Oe(Jt(),1),G0=class r{constructor(e){this.hbars=e.hbars,this.cents=e.cents,this.expirationTime=e.expirationTime,this.exchangeRateInCents=e.cents/e.hbars,Object.freeze(this)}static _fromProtobuf(e){return new r({hbars:e.hbarEquiv,cents:e.centEquiv,expirationTime:new Date(e.expirationTime!=null&&e.expirationTime.seconds!=null?FP.default.isLong(e.expirationTime.seconds)?e.expirationTime.seconds.toInt()*1e3:e.expirationTime.seconds:0)})}_toProtobuf(){return{hbarEquiv:this.hbars,centEquiv:this.cents,expirationTime:{seconds:FP.default.fromNumber(Math.trunc(this.expirationTime.getTime()/1e3))}}}toJSON(){return{hbars:this.hbars,cents:this.cents,expirationTime:this.expirationTime,exchangeRateInCents:this.exchangeRateInCents}}toString(){return JSON.stringify(this.toJSON())}};var qE=Oe(Jt(),1),UP=Oe(br(),1);var il=class r{constructor(e){this.status=e.status,this.accountId=e.accountId,this.fileId=e.fileId,this.contractId=e.contractId,this.topicId=e.topicId,this.tokenId=e.tokenId,this.scheduleId=e.scheduleId,this.exchangeRate=e.exchangeRate,this.topicSequenceNumber=e.topicSequenceNumber,this.topicRunningHash=e.topicRunningHash,this.totalSupply=e.totalSupply,this.scheduledTransactionId=e.scheduledTransactionId,this.serials=e.serials??[],this.duplicates=e.duplicates??[],this.children=e.children??[],Object.freeze(this)}_toProtobuf(){let e=this.duplicates.map(n=>n._toProtobuf().receipt),t=this.children.map(n=>n._toProtobuf().receipt);return{duplicateTransactionReceipts:e,childTransactionReceipts:t,receipt:{status:this.status.valueOf(),accountID:this.accountId!=null?this.accountId._toProtobuf():null,fileID:this.fileId!=null?this.fileId._toProtobuf():null,contractID:this.contractId!=null?this.contractId._toProtobuf():null,topicID:this.topicId!=null?this.topicId._toProtobuf():null,tokenID:this.tokenId!=null?this.tokenId._toProtobuf():null,scheduleID:this.scheduleId!=null?this.scheduleId._toProtobuf():null,topicRunningHash:this.topicRunningHash==null?null:this.topicRunningHash,topicSequenceNumber:this.topicSequenceNumber,exchangeRate:{nextRate:null,currentRate:this.exchangeRate!=null?this.exchangeRate._toProtobuf():null},scheduledTransactionID:this.scheduledTransactionId!=null?this.scheduledTransactionId._toProtobuf():null,serialNumbers:this.serials,newTotalSupply:this.totalSupply}}}static _fromProtobuf(e){let t=e.receipt,n=t.exchangeRate,i=e.childTransactionReceipts!=null?e.childTransactionReceipts.map(o=>r._fromProtobuf({receipt:o})):[],a=e.duplicateTransactionReceipts!=null?e.duplicateTransactionReceipts.map(o=>r._fromProtobuf({receipt:o})):[];return new r({status:P._fromCode(t.status!=null?t.status:0),accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):null,fileId:t.fileID!=null?Gt._fromProtobuf(t.fileID):null,contractId:t.contractID!=null?Et._fromProtobuf(t.contractID):null,topicId:t.topicID!=null?aa._fromProtobuf(t.topicID):null,tokenId:t.tokenID!=null?De._fromProtobuf(t.tokenID):null,scheduleId:t.scheduleID!=null?Ra._fromProtobuf(t.scheduleID):null,exchangeRate:t.exchangeRate!=null?G0._fromProtobuf(n.currentRate):null,topicSequenceNumber:t.topicSequenceNumber==null?null:qE.default.fromString(t.topicSequenceNumber.toString()),topicRunningHash:t.topicRunningHash!=null?new Uint8Array(t.topicRunningHash):null,totalSupply:t.newTotalSupply!=null?qE.default.fromString(t.newTotalSupply.toString()):null,scheduledTransactionId:t.scheduledTransactionID!=null?Qr._fromProtobuf(t.scheduledTransactionID):null,serials:t.serialNumbers!=null?t.serialNumbers.map(o=>qE.default.fromValue(o)):[],children:i,duplicates:a})}static fromBytes(e){return r._fromProtobuf(UP.proto.TransactionGetReceiptResponse.decode(e))}toBytes(){return UP.proto.TransactionGetReceiptResponse.encode(this._toProtobuf()).finish()}toJSON(){return{status:this.status.toString(),accountId:this.accountId?.toString()||null,filedId:this.fileId?.toString()||null,contractId:this.contractId?.toString()||null,topicId:this.topicId?.toString()||null,tokenId:this.tokenId?.toString()||null,scheduleId:this.scheduleId?.toString()||null,exchangeRate:this.exchangeRate?.toJSON()||null,topicSequenceNumber:this.topicSequenceNumber?.toString()||null,topicRunningHash:this.topicRunningHash!=null?Ke(this.topicRunningHash):null,totalSupply:this.totalSupply?.toString()||null,scheduledTransactionId:this.scheduledTransactionId?.toString()||null,serials:this.serials.map(e=>e.toString()),duplicates:this.duplicates.map(e=>e.toJSON()),children:this.children.map(e=>e.toJSON())}}toString(){return JSON.stringify(this.toJSON())}};var mVe=Oe(br(),1),{proto:noe}=mVe,al=class r extends Ar{constructor(e={}){super(),this._transactionId=null,this._includeChildren=null,this._includeDuplicates=null,this._validateStatus=!0,e.transactionId!=null&&this.setTransactionId(e.transactionId),e.includeChildren!=null&&this.setIncludeChildren(e.includeChildren),e.includeDuplicates!=null&&this.setIncludeDuplicates(e.includeDuplicates),e.validateStatus!=null&&this.setValidateStatus(e.validateStatus)}static _fromProtobuf(e){let t=e.transactionGetReceipt;return new r({transactionId:t.transactionID?Qr._fromProtobuf(t.transactionID):void 0,includeDuplicates:t.includeDuplicates!=null?t.includeDuplicates:void 0,includeChildren:t.includeChildReceipts!=null?t.includeChildReceipts:void 0})}get transactionId(){return this._transactionId}setTransactionId(e){return this._transactionId=typeof e=="string"?Qr.fromString(e):e.clone(),this}setIncludeDuplicates(e){return this._includeDuplicates=e,this}get includeDuplicates(){return this._includeDuplicates!=null?this._includeDuplicates:!1}setIncludeChildren(e){return this._includeChildren=e,this}get includeChildren(){return this._includeChildren!=null?this._includeChildren:!1}setValidateStatus(e){return this._validateStatus=e,this}get validateStatus(){return this._validateStatus}_isPaymentRequired(){return!1}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??noe.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received node precheck status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:return[i,Bn.Retry];case P.Ok:break;default:return[i,Bn.Error]}let s=t.transactionGetReceipt.receipt.status;switch(i=P._fromCode(s),this._logger&&this._logger.debug(`[${this._getLogId()}] received receipt status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:return[i,Bn.Retry];case P.Success:return[i,Bn.Finished];default:return[i,this._validateStatus?Bn.Error:Bn.Finished]}}_getTransactionId(){return this._transactionId!=null?this._transactionId:super._getTransactionId()}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??noe.ResponseCodeEnum.OK);switch(i){case P.Ok:break;default:return new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}let a=t.transactionGetReceipt,s=a.receipt.status;if(i=P._fromCode(s),this._transactionId==null)throw new Error("Failed to construct `ReceiptStatusError` because `transactionId` is `null`");return new el({status:i,transactionId:this._transactionId,transactionReceipt:il._fromProtobuf(a)})}_validateChecksums(e){this._transactionId!=null&&this._transactionId.accountId!=null&&this._transactionId.accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getTransactionReceipts(t)}_mapResponseHeader(e){return e.transactionGetReceipt.header}_mapResponse(e,t,n){let i=e.transactionGetReceipt;return Promise.resolve(il._fromProtobuf(i))}_onMakeRequest(e){return{transactionGetReceipt:{header:e,transactionID:this._transactionId!=null?this._transactionId._toProtobuf():null,includeDuplicates:this._includeDuplicates,includeChildReceipts:this._includeChildren}}}_getLogId(){return`TransactionReceiptQuery:${this._timestamp.toString()}`}};$r.set("transactionGetReceipt",al._fromProtobuf);var uu=class r{constructor(e){this.accountId=e.accountId instanceof ne?e.accountId:ne.fromString(e.accountId),this.amount=e.amount instanceof Ge?e.amount:new Ge(e.amount),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e)t.push(new r({accountId:ne._fromProtobuf(n.accountID),amount:Ge.fromTinybars(n.amount!=null?n.amount:0),isApproved:n.isApproval}));return t}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount.toTinybars(),isApproval:this.isApproved}}toJSON(){return{accountId:this.accountId.toString(),amount:this.amount.toTinybars().toString(),isApproved:this.isApproved}}toString(){return JSON.stringify(this.toJSON())}};var G2=class r{constructor(e){this.contractId=e.contractId,this.bloom=e.bloom,this.topics=e.topics,this.data=e.data,Object.freeze(this)}static _fromProtobuf(e){return new r({contractId:Et._fromProtobuf(e.contractID),bloom:e.bloom!=null?e.bloom:new Uint8Array,topics:e.topic!=null?e.topic:[],data:e.data!=null?e.data:new Uint8Array})}_toProtobuf(){return{contractID:this.contractId._toProtobuf(),bloom:this.bloom,topic:this.topics,data:this.data}}};function m8(r){return Buffer.from(r).toString("utf8")}function i3(r){return Buffer.from(r,"utf8")}var wn=Oe(_B(),1),r1=Oe(Jt(),1);var r3e=Oe(Jt(),1),Lze=Oe(br(),1),{proto:t3e}=Lze,ym=class r{constructor(e){this.contractId=e.contractId,this.nonce=e.nonce,Object.freeze(this)}static _fromProtobuf(e){return new r({contractId:Et._fromProtobuf(e.contractId),nonce:e.nonce!=null?e.nonce:r3e.default.ZERO})}_toProtobuf(){return{contractId:this.contractId._toProtobuf(),nonce:this.nonce}}static fromBytes(e){return r._fromProtobuf(t3e.ContractNonceInfo.decode(e))}toBytes(){return t3e.ContractNonceInfo.encode(this._toProtobuf()).finish()}toJSON(){return{contractId:this.contractId.toString(),nonce:this.nonce.toNumber()}}toString(){return JSON.stringify(this.toJSON())}equals(e){return this.contractId.equals(e.contractId)&&this.nonce.eq(e.nonce)}};var bu=class r{constructor(e){this._createResult=e._createResult,this.contractId=e.contractId,this.bytes=e.bytes,this.errorMessage=e.errorMessage,this.bloom=e.bloom,this.gasUsed=e.gasUsed,this.logs=e.logs,this.createdContractIds=e.createdContractIds,this.evmAddress=e.evmAddress,this.stateChanges=e.stateChanges,this.gas=e.gas,this.amount=e.amount,this.functionParameters=e.functionParameters,this.senderAccountId=e.senderAccountId,this.contractNonces=e.contractNonces}static _fromProtobuf(e,t){let n=e.contractID,i=e.gasUsed,a=e.gas?e.gas:-1,o=e.amount?e.amount:-1;return new r({_createResult:t,bytes:e.contractCallResult,contractId:n!=null?Et._fromProtobuf(n):null,errorMessage:e.errorMessage!=null?e.errorMessage:null,bloom:e.bloom,gasUsed:i instanceof r1.default?i:r1.default.fromValue(i),logs:(e.logInfo!=null?e.logInfo:[]).map(s=>G2._fromProtobuf(s)),createdContractIds:(e.createdContractIDs!=null?e.createdContractIDs:[]).map(s=>Et._fromProtobuf(s)),evmAddress:e.evmAddress!=null&&e.evmAddress.value!=null?e.evmAddress.value:null,stateChanges:[],gas:a instanceof r1.default?a:r1.default.fromValue(a),amount:o instanceof r1.default?o:r1.default.fromValue(o),functionParameters:e.functionParameters,senderAccountId:e.senderId!=null?ne._fromProtobuf(e.senderId):null,contractNonces:(e.contractNonces!=null?e.contractNonces:[]).map(s=>ym._fromProtobuf(s))})}asBytes(){return this.bytes}getString(e){return m8(this.getBytes(e))}getBytes(e){let t=this.getInt32(e),n=uo(this.bytes).getInt32(t+28);return this.bytes.subarray(t+32,t+32+n)}getBytes32(e){return this.bytes.subarray((e??0)*32,(e??0)*32+32)}getBool(e){return this.bytes[(e??0)*32+31]!==0}getInt8(e){let t=(e??0)*32+31;return uo(this.bytes).getInt8(t)}getUint8(e){return this.bytes[(e??0)*32+31]}getInt16(e){let t=(e??0)*32+28;return uo(this.bytes).getInt32(t)}getUint16(e){let t=(e??0)*32+28;return uo(this.bytes).getUint32(t)}getInt24(e){let t=(e??0)*32+28;return uo(this.bytes).getInt32(t)}getUint24(e){let t=(e??0)*32+28;return uo(this.bytes).getUint32(t)}getInt32(e){let t=(e??0)*32+28;return uo(this.bytes).getInt32(t)}getUint32(e){let t=(e??0)*32+28;return uo(this.bytes).getUint32(t)}getInt40(e){let t=wn.defaultAbiCoder.decode(["int40"],this._getBytes32(e??0));return new $e(t.toString())}getUint40(e){return new $e(Ke(this._getBytes32(e).subarray(27,32)),16)}getInt48(e){let t=wn.defaultAbiCoder.decode(["int48"],this._getBytes32(e??0));return new $e(t.toString())}getUint48(e){return new $e(Ke(this._getBytes32(e).subarray(26,32)),16)}getInt56(e){let t=wn.defaultAbiCoder.decode(["int56"],this._getBytes32(e??0));return new $e(t.toString())}getUint56(e){return new $e(Ke(this._getBytes32(e).subarray(25,32)),16)}getInt64(e){let t=wn.defaultAbiCoder.decode(["int64"],this._getBytes32(e??0));return new $e(t.toString())}getUint64(e){return new $e(Ke(this._getBytes32(e).subarray(24,32)),16)}getInt72(e){let t=wn.defaultAbiCoder.decode(["int72"],this._getBytes32(e??0));return new $e(t.toString())}getUint72(e){return new $e(Ke(this._getBytes32(e).subarray(23,32)),16)}getInt80(e){let t=wn.defaultAbiCoder.decode(["int80"],this._getBytes32(e??0));return new $e(t.toString())}getUint80(e){return new $e(Ke(this._getBytes32(e).subarray(22,32)),16)}getInt88(e){let t=wn.defaultAbiCoder.decode(["int88"],this._getBytes32(e??0));return new $e(t.toString())}getUint88(e){return new $e(Ke(this._getBytes32(e).subarray(21,32)),16)}getInt96(e){let t=wn.defaultAbiCoder.decode(["int96"],this._getBytes32(e??0));return new $e(t.toString())}getUint96(e){return new $e(Ke(this._getBytes32(e).subarray(20,32)),16)}getInt104(e){let t=wn.defaultAbiCoder.decode(["int104"],this._getBytes32(e??0));return new $e(t.toString())}getUint104(e){return new $e(Ke(this._getBytes32(e).subarray(19,32)),16)}getInt112(e){let t=wn.defaultAbiCoder.decode(["int112"],this._getBytes32(e??0));return new $e(t.toString())}getUint112(e){return new $e(Ke(this._getBytes32(e).subarray(18,32)),16)}getInt120(e){let t=wn.defaultAbiCoder.decode(["int120"],this._getBytes32(e??0));return new $e(t.toString())}getUint120(e){return new $e(Ke(this._getBytes32(e).subarray(17,32)),16)}getInt128(e){let t=wn.defaultAbiCoder.decode(["int128"],this._getBytes32(e??0));return new $e(t.toString())}getUint128(e){return new $e(Ke(this._getBytes32(e).subarray(16,32)),16)}getInt136(e){let t=wn.defaultAbiCoder.decode(["int136"],this._getBytes32(e??0));return new $e(t.toString())}getUint136(e){return new $e(Ke(this._getBytes32(e).subarray(15,32)),16)}getInt144(e){let t=wn.defaultAbiCoder.decode(["int144"],this._getBytes32(e??0));return new $e(t.toString())}getUint144(e){return new $e(Ke(this._getBytes32(e).subarray(14,32)),16)}getInt152(e){let t=wn.defaultAbiCoder.decode(["int152"],this._getBytes32(e??0));return new $e(t.toString())}getUint152(e){return new $e(Ke(this._getBytes32(e).subarray(13,32)),16)}getInt160(e){let t=wn.defaultAbiCoder.decode(["int160"],this._getBytes32(e??0));return new $e(t.toString())}getUint160(e){return new $e(Ke(this._getBytes32(e).subarray(12,32)),16)}getInt168(e){let t=wn.defaultAbiCoder.decode(["int168"],this._getBytes32(e??0));return new $e(t.toString())}getUint168(e){return new $e(Ke(this._getBytes32(e).subarray(11,32)),16)}getInt176(e){let t=wn.defaultAbiCoder.decode(["int176"],this._getBytes32(e??0));return new $e(t.toString())}getUint176(e){return new $e(Ke(this._getBytes32(e).subarray(10,32)),16)}getInt184(e){let t=wn.defaultAbiCoder.decode(["int184"],this._getBytes32(e??0));return new $e(t.toString())}getUint184(e){return new $e(Ke(this._getBytes32(e).subarray(9,32)),16)}getInt192(e){let t=wn.defaultAbiCoder.decode(["int192"],this._getBytes32(e??0));return new $e(t.toString())}getUint192(e){return new $e(Ke(this._getBytes32(e).subarray(8,32)),16)}getInt200(e){let t=wn.defaultAbiCoder.decode(["int200"],this._getBytes32(e??0));return new $e(t.toString())}getUint200(e){return new $e(Ke(this._getBytes32(e).subarray(7,32)),16)}getInt208(e){let t=wn.defaultAbiCoder.decode(["int208"],this._getBytes32(e??0));return new $e(t.toString())}getUint208(e){return new $e(Ke(this._getBytes32(e).subarray(6,32)),16)}getInt216(e){let t=wn.defaultAbiCoder.decode(["int216"],this._getBytes32(e??0));return new $e(t.toString())}getUint216(e){return new $e(Ke(this._getBytes32(e).subarray(5,32)),16)}getInt224(e){let t=wn.defaultAbiCoder.decode(["int224"],this._getBytes32(e??0));return new $e(t.toString())}getUint224(e){return new $e(Ke(this._getBytes32(e).subarray(4,32)),16)}getInt232(e){let t=wn.defaultAbiCoder.decode(["int232"],this._getBytes32(e??0));return new $e(t.toString())}getUint232(e){return new $e(Ke(this._getBytes32(e).subarray(3,32)),16)}getInt240(e){let t=wn.defaultAbiCoder.decode(["int240"],this._getBytes32(e??0));return new $e(t.toString())}getUint240(e){return new $e(Ke(this._getBytes32(e).subarray(2,32)),16)}getInt248(e){let t=wn.defaultAbiCoder.decode(["int248"],this._getBytes32(e??0));return new $e(t.toString())}getUint248(e){return new $e(Ke(this._getBytes32(e).subarray(1,32)),16)}getInt256(e){let t=wn.defaultAbiCoder.decode(["int256"],this._getBytes32(e??0));return new $e(t.toString())}getUint256(e){return new $e(Ke(this._getBytes32(e)),16)}getAddress(e){return Ke(this.bytes.subarray((e??0)*32+12,(e??0)*32+32))}getResult(e){return wn.defaultAbiCoder.decode(e,this.bytes)}_getBytes32(e){return this.bytes.subarray((e??0)*32,(e??0)*32+32)}_toProtobuf(){return{contractID:this.contractId!=null?this.contractId._toProtobuf():null,contractCallResult:this.bytes,errorMessage:this.errorMessage,bloom:this.bloom,gasUsed:this.gasUsed,logInfo:this.logs.map(e=>e._toProtobuf()),createdContractIDs:this.createdContractIds.map(e=>e._toProtobuf()),evmAddress:this.evmAddress!=null?{value:this.evmAddress}:null,gas:this.gas,amount:this.amount,functionParameters:this.functionParameters,senderId:this.senderAccountId!=null?this.senderAccountId._toProtobuf():null,contractNonces:this.contractNonces.map(e=>e._toProtobuf())}}};var fi=class{constructor(e){this._map=new Map,this.__map=new Map,this._fromString=e}get(e){let t=typeof e=="string"?e:e.toString(),n=this._map.get(t);return n??null}_set(e,t){let n=typeof e=="string"?e:e.toString();this._map.set(n,t),this.__map.set(e,t)}values(){return this._map.values()}get size(){return this._map.size}keys(){return this.__map.keys()}[Symbol.iterator](){return this.__map[Symbol.iterator]()}toString(){let e={};for(let[t,n]of this._map)e[t]=n;return JSON.stringify(e)}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t}),e}};var n1=class extends fi{constructor(){super(e=>ne.fromString(e))}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t.toString()}),e}};var i1=class r extends fi{constructor(){super(e=>De.fromString(e))}__set(e,t,n){let i=e.toString(),a=this._map.get(i);a==null&&(a=new n1,this._map.set(i,a),this.__map.set(e,a)),a._set(t,n)}static _fromProtobuf(e){let t=new r;for(let n of e){let i=De._fromProtobuf(n.token);for(let a of n.transfers!=null?n.transfers:[]){let o=ne._fromProtobuf(a.accountID);t.__set(i,o,a.amount)}}return t}_toProtobuf(){let e=[];for(let[t,n]of this){let i=[];for(let[a,o]of n)i.push({accountID:a._toProtobuf(),amount:o});e.push({token:t._toProtobuf(),transfers:i})}return e}};var n3e=Oe(Jt(),1);var a1=class r extends fi{constructor(){super(e=>De.fromString(e))}__set(e,t){let n=e.toString(),i=this._map.get(n);i==null&&(i=[],this._map.set(n,i),this.__map.set(e,i)),i.push(t)}static _fromProtobuf(e){let t=new r;for(let n of e){let i=De._fromProtobuf(n.token);for(let a of n.nftTransfers!=null?n.nftTransfers:[]){let o=ne._fromProtobuf(a.senderAccountID),s=ne._fromProtobuf(a.receiverAccountID);t.__set(i,{sender:o,recipient:s,serial:n3e.default.fromValue(a.serialNumber),isApproved:!1})}}return t}_toProtobuf(){let e=[];for(let[t,n]of this){let i=[];for(let a of n)i.push({senderAccountID:a.sender._toProtobuf(),receiverAccountID:a.recipient._toProtobuf(),serialNumber:a.serial});e.push({token:t._toProtobuf(),nftTransfers:i})}return e}toJSON(){let e={};return this._map.forEach((t,n)=>{e[n]=t.map(i=>({sender:i.sender.toString(),recipient:i.recipient.toString(),serial:i.serial,isApproved:i.isApproved}))}),e}};var k8=Oe(br(),1);var i3e=Oe(Jt(),1),vm=class r{constructor(e={}){this._feeCollectorAccountId=null,e.feeCollectorAccountId!=null&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._amount=null,e.amount!=null&&this.setAmount(e.amount),this._payerAccountIds=null,e.payerAccountIds!=null&&this.setPayerAccountIds(e.payerAccountIds)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId=typeof e=="string"?ne.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?De.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount=typeof e=="number"?i3e.default.fromNumber(e):e,this}get payerAccountIds(){return this._payerAccountIds}setPayerAccountIds(e){return this._payerAccountIds=e,this}static _fromProtobuf(e){return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,tokenId:e.tokenId!=null?De._fromProtobuf(e.tokenId):void 0,amount:e.amount!=null?e.amount:void 0,payerAccountIds:e.effectivePayerAccountId!=null?e.effectivePayerAccountId.map(t=>ne._fromProtobuf(t)):void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,tokenId:this._tokenId!=null?this._tokenId._toProtobuf():null,amount:this._amount,effectivePayerAccountId:this._payerAccountIds!=null?this._payerAccountIds.map(e=>e._toProtobuf()):null}}toJSON(){return{feeCollectorAccountId:this.feeCollectorAccountId?.toString()||null,tokenId:this._tokenId?.toString()||null,amount:this._amount?.toString()||null,payerAccountIds:this._payerAccountIds?.map(e=>e.toString())||[]}}};var C8=class r{constructor(e={}){this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._defaultMaxTransactionFee=new Ge(5)}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?De.fromString(e):e,this}static _fromProtobuf(e){return new r({accountId:e.accountId!=null?ne._fromProtobuf(e.accountId):void 0,tokenId:e.tokenId!=null?De._fromProtobuf(e.tokenId):void 0})}_toProtobuf(){return{accountId:this._accountId!=null?this._accountId._toProtobuf():void 0,tokenId:this._tokenId!=null?this._tokenId._toProtobuf():void 0}}toJSON(){return{accountId:this._accountId?.toString()||null,tokenId:this._tokenId?.toString()||null}}};var EB=Oe(Jt(),1);var Wd=class r{constructor(e){this.tokenId=e.tokenId instanceof De?e.tokenId:De.fromString(e.tokenId),this.accountId=e.accountId instanceof ne?e.accountId:ne.fromString(e.accountId),this.expectedDecimals=e.expectedDecimals,this.amount=EB.default.fromValue(e.amount),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e){let i=De._fromProtobuf(n.token),a=n.expectedDecimals!=null?n.expectedDecimals.value:null;for(let o of n.transfers!=null?n.transfers:[])t.push(new r({tokenId:i,accountId:ne._fromProtobuf(o.accountID),expectedDecimals:a,amount:o.amount!=null?o.amount:EB.default.ZERO,isApproved:o.isApproval==!0}))}return t}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount,isApproval:this.isApproved}}toJSON(){return{tokenId:this.tokenId.toString(),accountId:this.accountId.toString(),expectedDecimals:this.expectedDecimals,amount:this.amount.toString(),isApproved:this.isApproved}}toString(){return JSON.stringify(this.toJSON())}};var wu=class r{constructor(e){this.receipt=e.receipt,this.transactionHash=e.transactionHash,this.consensusTimestamp=e.consensusTimestamp,this.transactionId=e.transactionId,this.transactionMemo=e.transactionMemo,this.transactionFee=e.transactionFee,this.transfers=e.transfers,this.contractFunctionResult=e.contractFunctionResult!=null?e.contractFunctionResult:null,this.tokenTransfers=e.tokenTransfers,this.tokenTransfersList=e.tokenTransfersList,this.scheduleRef=e.scheduleRef,this.assessedCustomFees=e.assessedCustomFees,this.nftTransfers=e.nftTransfers,this.automaticTokenAssociations=e.automaticTokenAssociations,this.parentConsensusTimestamp=e.parentConsensusTimestamp,this.aliasKey=e.aliasKey,this.duplicates=e.duplicates,this.children=e.children,this.hbarAllowanceAdjustments=e.hbarAllowanceAdjustments,this.tokenAllowanceAdjustments=e.tokenAllowanceAdjustments,this.nftAllowanceAdjustments=e.nftAllowanceAdjustments,this.ethereumHash=e.ethereumHash,this.paidStakingRewards=e.paidStakingRewards,this.prngBytes=e.prngBytes,this.prngNumber=e.prngNumber,this.evmAddress=e.evmAddress,Object.freeze(this)}_toProtobuf(){let e=this.tokenTransfers._toProtobuf(),t=this.nftTransfers._toProtobuf(),n=[];for(let o of e)for(let s of t)o.token!=null&&s.token!=null&&o.token.shardNum===s.token.shardNum&&o.token.realmNum===s.token.realmNum&&o.token.tokenNum===s.token.tokenNum?n.push({token:o.token,transfers:o.transfers,nftTransfers:o.nftTransfers}):(n.push(o),n.push(s));let i=this.duplicates.map(o=>o._toProtobuf().transactionRecord),a=this.children.map(o=>o._toProtobuf().transactionRecord);return{duplicateTransactionRecords:i,childTransactionRecords:a,transactionRecord:{receipt:this.receipt._toProtobuf().receipt,transactionHash:this.transactionHash!=null?this.transactionHash:null,consensusTimestamp:this.consensusTimestamp!=null?this.consensusTimestamp._toProtobuf():null,transactionID:this.transactionId!=null?this.transactionId._toProtobuf():null,memo:this.transactionMemo!=null?this.transactionMemo:null,transactionFee:this.transactionFee!=null?this.transactionFee.toTinybars():null,contractCallResult:this.contractFunctionResult!=null&&!this.contractFunctionResult._createResult?this.contractFunctionResult._toProtobuf():null,contractCreateResult:this.contractFunctionResult!=null&&this.contractFunctionResult._createResult?this.contractFunctionResult._toProtobuf():null,transferList:this.transfers!=null?{accountAmounts:this.transfers.map(o=>o._toProtobuf())}:null,tokenTransferLists:n,scheduleRef:this.scheduleRef!=null?this.scheduleRef._toProtobuf():null,assessedCustomFees:this.assessedCustomFees.map(o=>o._toProtobuf()),automaticTokenAssociations:this.automaticTokenAssociations.map(o=>o._toProtobuf()),parentConsensusTimestamp:this.parentConsensusTimestamp!=null?this.parentConsensusTimestamp._toProtobuf():null,alias:this.aliasKey!=null?k8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():null,ethereumHash:this.ethereumHash,paidStakingRewards:this.paidStakingRewards.map(o=>o._toProtobuf()),prngBytes:this.prngBytes,prngNumber:this.prngNumber!=null?this.prngNumber:null,evmAddress:this.evmAddress!=null?this.evmAddress.toBytes():null}}}static _fromProtobuf(e){let t=e.transactionRecord,n=t.alias!=null&&t.alias.length>0?nt._fromProtobufKey(k8.proto.Key.decode(t.alias)):null;n instanceof ei||(n=null);let i=e.childTransactionRecords!=null?e.childTransactionRecords.map(s=>r._fromProtobuf({transactionRecord:s})):[],a=e.duplicateTransactionRecords!=null?e.duplicateTransactionRecords.map(s=>r._fromProtobuf({transactionRecord:s})):[],o=t.contractCallResult!=null?bu._fromProtobuf(t.contractCallResult,!1):t.contractCreateResult!=null?bu._fromProtobuf(t.contractCreateResult,!0):void 0;return new r({receipt:il._fromProtobuf({receipt:t.receipt}),transactionHash:t.transactionHash!=null?t.transactionHash:new Uint8Array,consensusTimestamp:ut._fromProtobuf(t.consensusTimestamp),transactionId:Qr._fromProtobuf(t.transactionID),transactionMemo:t.memo!=null?t.memo:"",transactionFee:Ge.fromTinybars(t.transactionFee!=null?t.transactionFee:0),transfers:uu._fromProtobuf(t.transferList!=null?t.transferList.accountAmounts!=null?t.transferList.accountAmounts:[]:[]),contractFunctionResult:o,tokenTransfers:i1._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),tokenTransfersList:Wd._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),scheduleRef:t.scheduleRef!=null?Ra._fromProtobuf(t.scheduleRef):null,assessedCustomFees:t.assessedCustomFees!=null?t.assessedCustomFees.map(s=>vm._fromProtobuf(s)):[],nftTransfers:a1._fromProtobuf(t.tokenTransferLists!=null?t.tokenTransferLists:[]),automaticTokenAssociations:t.automaticTokenAssociations!=null?t.automaticTokenAssociations.map(s=>C8._fromProtobuf(s)):[],parentConsensusTimestamp:t.parentConsensusTimestamp!=null?ut._fromProtobuf(t.parentConsensusTimestamp):null,aliasKey:n,duplicates:a,children:i,hbarAllowanceAdjustments:[],tokenAllowanceAdjustments:[],nftAllowanceAdjustments:[],ethereumHash:t.ethereumHash!=null?t.ethereumHash:null,paidStakingRewards:t.paidStakingRewards!=null?uu._fromProtobuf(t.paidStakingRewards):[],prngBytes:t.prngBytes!=null?t.prngBytes:null,prngNumber:t.prngNumber!=null?t.prngNumber:null,evmAddress:t.evmAddress!=null?ns.fromBytes(t.evmAddress):null})}static fromBytes(e){return r._fromProtobuf(k8.proto.TransactionGetRecordResponse.decode(e))}toBytes(){return k8.proto.TransactionGetRecordResponse.encode(this._toProtobuf()).finish()}toJSON(){return{receipt:this.receipt.toJSON(),transactionHash:Ke(this.transactionHash),consensusTimestamp:this.consensusTimestamp.toDate(),transactionId:this.transactionId.toString(),transactionMemo:this.transactionMemo,transactionFee:this.transactionFee.toTinybars().toString(),transfers:this.transfers.map(e=>e.toJSON()),tokenTransfers:this.tokenTransfers,tokenTransfersList:this.tokenTransfersList.map(e=>e.toJSON()),scheduleRef:this.scheduleRef?.toString()||null,assessedCustomFees:this.assessedCustomFees,nftTransfers:this.nftTransfers,automaticTokenAssociations:this.automaticTokenAssociations,parentConsensusTimestamp:this.parentConsensusTimestamp?.toDate()||null,aliasKey:this.aliasKey?.toString()||null,duplicates:this.duplicates,children:this.children,ethereumHash:this.ethereumHash!=null?Ke(this.ethereumHash):null,paidStakingRewards:this.paidStakingRewards,prngBytes:this.prngBytes!=null?Ke(this.prngBytes):null,prngNumber:this.prngNumber,evmAddress:this.evmAddress?.toString()||null}}toString(){return JSON.stringify(this.toJSON())}};var bm=class extends ou{constructor(e){super(e,`Record for transaction ${e.transactionId.toString()} contained error status ${e.status.toString()}`),this.transactionRecord=e.transactionRecord}};var xB=Oe(br(),1),{proto:a3e}=xB,o1=class r extends Ar{constructor(e={}){super(),this._transactionId=null,this._includeChildren=null,this._includeDuplicates=null,this._validateReceiptStatus=!0,e.transactionId!=null&&this.setTransactionId(e.transactionId),e.includeChildren!=null&&this.setIncludeChildren(e.includeChildren),e.includeDuplicates!=null&&this.setIncludeDuplicates(e.includeDuplicates),e.validateReceiptStatus!=null&&this.setValidateReceiptStatus(e.validateReceiptStatus)}get transactionId(){return this._transactionId}static _fromProtobuf(e){let t=e.transactionGetRecord;return new r({transactionId:t.transactionID?Qr._fromProtobuf(t.transactionID):void 0,includeChildren:t.includeChildRecords!=null?t.includeChildRecords:void 0,includeDuplicates:t.includeDuplicates!=null?t.includeDuplicates:void 0})}setTransactionId(e){return this._transactionId=typeof e=="string"?Qr.fromString(e):e.clone(),this}setIncludeChildren(e){return this._includeChildren=e,this}get includeChildren(){return this._includeChildren!=null?this._includeChildren:!1}setIncludeDuplicates(e){return this._duplicates=e,this}get includeDuplicates(){return this._duplicates!=null?this._duplicates:!1}setValidateReceiptStatus(e){return this._validateReceiptStatus=e,this}get validateReceiptStatus(){return this._validateReceiptStatus}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??a3e.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received node precheck status ${i.toString()}`),i){case P.Busy:case P.Unknown:case P.ReceiptNotFound:case P.RecordNotFound:return[i,Bn.Retry];case P.Ok:break;default:return[i,Bn.Error]}let a=t.transactionGetRecord;if(a.header.responseType===xB.proto.ResponseType.COST_ANSWER)return[i,Bn.Finished];let l=a.transactionRecord.receipt.status;switch(i=P._fromCode(l),this._logger&&this._logger.debug(`[${this._getLogId()}] received record's receipt ${i.toString()}`),i){case P.Ok:case P.Busy:case P.Unknown:case P.ReceiptNotFound:case P.RecordNotFound:return[i,Bn.Retry];case P.Success:return[i,Bn.Finished];default:return[i,this._validateReceiptStatus?Bn.Error:Bn.Finished]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??a3e.ResponseCodeEnum.OK);switch(i){case P.Ok:break;case P.ContractRevertExecuted:return new bm({status:i,transactionId:this._getTransactionId(),transactionRecord:wu._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})});default:return new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}let s=t.transactionGetRecord.transactionRecord.receipt,c=s.status;switch(i=P._fromCode(c),i){case P.ContractRevertExecuted:return new bm({status:i,transactionId:this._getTransactionId(),transactionRecord:wu._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})});default:return new el({status:i,transactionId:this._getTransactionId(),transactionReceipt:il._fromProtobuf({receipt:s})})}}_validateChecksums(e){this._transactionId!=null&&this._transactionId.accountId!=null&&this._transactionId.accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getTxRecordByTxID(t)}_mapResponseHeader(e){return e.transactionGetRecord.header}_mapResponse(e,t,n){let i=e.transactionGetRecord;return Promise.resolve(wu._fromProtobuf(i))}_onMakeRequest(e){return{transactionGetRecord:{header:e,transactionID:this._transactionId!=null?this._transactionId._toProtobuf():null,includeChildRecords:this._includeChildren,includeDuplicates:this._includeDuplicates}}}_getLogId(){return`TransactionRecordQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("transactionGetRecord",o1._fromProtobuf);var s1=class r{constructor(e){this.nodeId=e.nodeId,this.transactionHash=e.transactionHash,this.transactionId=e.transactionId,Object.freeze(this)}static fromJSON(e){return new r({nodeId:ne.fromString(e.nodeId),transactionHash:tt(e.transactionHash),transactionId:Qr.fromString(e.transactionId)})}async getReceipt(e){let t=await this.getReceiptQuery().execute(e);if(t.status!==P.Success)throw new el({transactionReceipt:t,status:t.status,transactionId:this.transactionId});return t}async getRecord(e){return await this.getReceipt(e),this.getRecordQuery().execute(e)}async getVerboseRecord(e){try{return await this.getReceiptQuery().execute(e),this.getRecordQuery().execute(e)}catch{return this.getRecordQuery().execute(e)}}async getReceiptWithSigner(e){let t=await this.getReceiptQuery().executeWithSigner(e);if(t.status!==P.Success)throw new el({transactionReceipt:t,status:t.status,transactionId:this.transactionId});return t}async getRecordWithSigner(e){return await this.getReceiptWithSigner(e),this.getRecordQuery().executeWithSigner(e)}getReceiptQuery(){return new al().setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}getRecordQuery(){return new o1().setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}toJSON(){return{nodeId:this.nodeId.toString(),transactionHash:Ke(this.transactionHash),transactionId:this.transactionId.toString()}}toString(){return JSON.stringify(this.toJSON())}};import Fze from"crypto";function N8(r){return Promise.resolve(Fze.createHash("sha384").update(r).digest())}var R8=class r extends fi{constructor(){super(e=>ne.fromString(e))}static async _fromTransaction(e){let t=new r;for(let n=0;n<e._nodeAccountIds.length;n++){let i=e._nodeAccountIds.list[n],a=e._transactions.get(n),o=await N8(a.signedTransactionBytes);t._set(i,o)}return t}};var O8=class r extends fi{constructor(){super(e=>ei.fromString(e))}static _fromTransactionSigMap(e){let t=new r,n=e.sigPair!=null?e.sigPair:[];for(let i of n)i.pubKeyPrefix!=null&&(i.ed25519!=null?t._set(ei.fromBytesED25519(i.pubKeyPrefix),i.ed25519):i.ECDSASecp256k1!=null&&t._set(ei.fromBytesECDSA(i.pubKeyPrefix),i.ECDSASecp256k1));return t}};var wm=class r extends fi{constructor(){super(e=>ne.fromString(e))}static _fromTransaction(e){let t=new r;for(let n=0;n<e._nodeAccountIds.length;n++){let i=e._signedTransactions.get(n).sigMap;i!=null&&t._set(e._nodeAccountIds.list[n],O8._fromTransactionSigMap(i))}return t}};var D8=Oe(Jt(),1);var os=Oe(br(),1);var _u=D8.default.fromValue(7776e3),AB=Ge.fromTinybars(D8.default.fromString("9223372036854775807")),s3e=120,c3e=1024,We=new Map,ke=class extends cu{constructor(){super(),this._transactions=new nl,this._signedTransactions=new nl,this._signerPublicKeys=new Set,this._transactionValidDuration=s3e,this._defaultMaxTransactionFee=new Ge(2),this._maxTransactionFee=null,this._transactionMemo="",this._transactionIds=new nl,this._publicKeys=[],this._transactionSigners=[],this._regenerateTransactionId=null}static fromBytes(e){let t=[],n=[],i=[],a=[],o=[],s=[],c=os.proto.TransactionList.decode(e).transactionList;if(c.length===0){let d=os.proto.Transaction.decode(e);d.signedTransactionBytes.length!==0?c.push(d):c.push({signedTransactionBytes:os.proto.SignedTransaction.encode({bodyBytes:d.bodyBytes,sigMap:d.sigMap}).finish()})}for(let d of c){if(d.signedTransactionBytes==null)throw new Error("Transaction.signedTransactionBytes are null");let h=os.proto.SignedTransaction.decode(d.signedTransactionBytes);t.push(h);let g=os.proto.TransactionBody.decode(h.bodyBytes);if(g.data==null)throw new Error("(BUG) body.data was not set in the protobuf");if(s.push(g),g.transactionID!=null){let m=Qr._fromProtobuf(g.transactionID);a.includes(m.toString())||(n.push(m),a.push(m.toString()))}if(g.nodeAccountID!=null){let m=ne._fromProtobuf(g.nodeAccountID);o.includes(m.toString())||(i.push(m),o.push(m.toString()))}}let l=s[0];if(l==null||l.data==null)throw new Error("No transaction found in bytes or failed to decode TransactionBody");let u=We.get(l.data);if(u==null)throw new Error(`(BUG) Transaction.fromBytes() not implemented for type ${l.data}`);return u(c,t,n,i,s)}schedule(){if(this._requireNotFrozen(),Cx.length!=1)throw new Error("ScheduleCreateTransaction has not been loaded yet");return Cx[0]()._setScheduledTransaction(this)}static _fromProtobufTransactions(e,t,n,i,a,o){let s=o[0];for(let l=0;l<i.length;l++)for(let u=0;u<a.length-1;u++)if(!cR(o[l*a.length+u],o[l*a.length+u+1],new Set(["nodeAccountID"])))throw new Error("failed to validate transaction bodies");let c=new ne(0);for(let l=0;l<a.length;l++)a[l].equals(c)&&a.splice(l--,1);e._transactions.setList(t),e._signedTransactions.setList(n).setLocked(),e._transactionIds.setList(i).setLocked(),e._nodeAccountIds.setList(a).setLocked(),e._transactionValidDuration=s.transactionValidDuration!=null&&s.transactionValidDuration.seconds!=null?D8.default.fromValue(s.transactionValidDuration.seconds).toInt():s3e,e._maxTransactionFee=s.transactionFee!=null?Ge.fromTinybars(s.transactionFee):new Ge(0),e._transactionMemo=s.memo!=null?s.memo:"";for(let l=0;l<a.length;l++){let u=n[l];if(u.sigMap!=null&&u.sigMap.sigPair!=null)for(let d of u.sigMap.sigPair)e._signerPublicKeys.add(Ke(d.pubKeyPrefix)),e._publicKeys.push(ei.fromBytes(d.pubKeyPrefix)),e._transactionSigners.push(null)}return e}setNodeAccountIds(e){return this._requireNotFrozen(),super.setNodeAccountIds(e),this}get transactionValidDuration(){return this._transactionValidDuration}setTransactionValidDuration(e){return this._requireNotFrozen(),this._transactionValidDuration=e,this}get maxTransactionFee(){return this._maxTransactionFee}setMaxTransactionFee(e){return this._requireNotFrozen(),this._maxTransactionFee=e instanceof Ge?e:new Ge(e),this}get regenerateTransactionId(){return this._regenerateTransactionId}setRegenerateTransactionId(e){return this._requireNotFrozen(),this._regenerateTransactionId=e,this}get transactionMemo(){return this._transactionMemo}setTransactionMemo(e){return this._requireNotFrozen(),this._transactionMemo=e,this}get transactionId(){return this._transactionIds.isEmpty?null:(this._transactionIds.setLocked(),this._transactionIds.current)}setTransactionId(e){return this._requireNotFrozen(),this._transactionIds.setList([e]).setLocked(),this}sign(e){return this.signWith(e.publicKey,t=>Promise.resolve(e.sign(t)))}async signWith(e,t){this._signOnDemand||this._requireFrozen();let n=e.toBytesRaw(),i=Ke(n);if(this._signerPublicKeys.has(i))return this;if(this._transactions.clear(),this._signerPublicKeys.add(i),this._signOnDemand)return this._publicKeys.push(e),this._transactionSigners.push(t),this;this._transactionIds.setLocked(),this._nodeAccountIds.setLocked();for(let a of this._signedTransactions.list){let o=a.bodyBytes,s=await t(o);a.sigMap==null&&(a.sigMap={}),a.sigMap.sigPair==null&&(a.sigMap.sigPair=[]),a.sigMap.sigPair.push(e._toProtobufSignature(s))}return this}signWithOperator(e){let t=e._operator;if(t==null)throw new Error("`client` must have an operator to sign with the operator");return this._isFrozen()||this.freezeWith(e),this.signWith(t.publicKey,t.transactionSigner)}addSignature(e,t){this._requireOneNodeAccountId(),this.isFrozen()||this.freeze();let n=e.toBytesRaw(),i=Ke(n);if(this._signerPublicKeys.has(i))return this;this._transactions.clear(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._signedTransactions.setLocked();for(let a of this._signedTransactions.list)a.sigMap==null&&(a.sigMap={}),a.sigMap.sigPair==null&&(a.sigMap.sigPair=[]),a.sigMap.sigPair.push(e._toProtobufSignature(t));return this._signerPublicKeys.add(i),this._publicKeys.push(e),this._transactionSigners.push(null),this}getSignatures(){return this._requireFrozen(),this._requireNotSignOnDemand(),this._buildAllTransactions(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),wm._fromTransaction(this)}async getSignaturesAsync(){return this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),wm._fromTransaction(this)}_setTransactionId(){if(this._operatorAccountId==null&&this._transactionIds.isEmpty)throw new Error("`transactionId` must be set or `client` must be provided with `freezeWith`")}_setNodeAccountIds(e){if(this._nodeAccountIds.isEmpty){if(e==null)throw new Error("`nodeAccountId` must be set or `client` must be provided with `freezeWith`");this._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute())}}_buildSignedTransactions(){this._signedTransactions.locked||this._signedTransactions.setList(this._nodeAccountIds.list.map(e=>this._makeSignedTransaction(e)))}freeze(){return this.freezeWith(null)}_freezeWithAccountId(e){this._operatorAccountId==null&&(this._operatorAccountId=e)}freezeWith(e){if(this._signOnDemand=e!=null?e.signOnDemand:!1,this._operator=e!=null?e._operator:null,this._freezeWithAccountId(e!=null?e.operatorAccountId:null),this._maxTransactionFee=this._maxTransactionFee==null?e!=null&&e.defaultMaxTransactionFee!=null?e.defaultMaxTransactionFee:this._defaultMaxTransactionFee:this._maxTransactionFee,this._regenerateTransactionId=e!=null&&this._regenerateTransactionId==null?e.defaultRegenerateTransactionId:this._regenerateTransactionId,this._setNodeAccountIds(e),this._setTransactionId(),e!=null)for(let t of this._transactionIds.list)t.accountId!=null&&t.accountId.validateChecksum(e);return this._buildNewTransactionIdList(),this._signOnDemand||this._buildSignedTransactions(),this}async signWithSigner(e){return await e.signTransaction(this),this}async freezeWithSigner(e){return await e.populateTransaction(this),this.freeze(),this}toBytes(){return this._requireFrozen(),this._requireNotSignOnDemand(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._buildAllTransactions(),os.proto.TransactionList.encode({transactionList:this._transactions.list}).finish()}async toBytesAsync(){return this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),os.proto.TransactionList.encode({transactionList:this._transactions.list}).finish()}async getTransactionHash(){return this._requireFrozen(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),N8(this._transactions.get(0).signedTransactionBytes)}async getTransactionHashPerNode(){return this._requireFrozen(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),await R8._fromTransaction(this)}isFrozen(){return this._signedTransactions.length>0}_getTransactionId(){let e=this.transactionId;if(e==null)throw new Error("transaction must have been frozen before getting the transaction ID, try calling `freeze`");return e}_validateChecksums(e){}async _beforeExecute(e){this._logger&&this._logger.info(`Network used: ${e._network.networkName}`),this._isFrozen()||this.freezeWith(e),e.isAutoValidateChecksumsEnabled()&&this._validateChecksums(e),(this._operator==null||this._operator==null)&&(this._operator=e!=null?e._operator:null),(this._operatorAccountId==null||this._operatorAccountId==null)&&(this._operatorAccountId=e!=null&&e._operator!=null?e._operator.accountId:null),this._operator!=null&&await this.signWith(this._operator.publicKey,this._operator.transactionSigner)}async _makeRequestAsync(){let e=this._transactionIds.index*this._nodeAccountIds.length+this._nodeAccountIds.index;return this._signOnDemand?await this._buildTransactionAsync():(this._buildTransaction(e),this._transactions.get(e))}async _signTransaction(){let e=this._makeSignedTransaction(this._nodeAccountIds.next),t=e.bodyBytes;for(let n=0;n<this._publicKeys.length;n++){let i=this._publicKeys[n],a=this._transactionSigners[n];if(a==null)continue;let o=await a(t);e.sigMap==null&&(e.sigMap={}),e.sigMap.sigPair==null&&(e.sigMap.sigPair=[]),e.sigMap.sigPair.push(i._toProtobufSignature(o))}return e}_buildNewTransactionIdList(){if(this._transactionIds.locked||this._operatorAccountId==null)return;let e=Qr.withValidStart(this._operatorAccountId,ut.generate());this._transactionIds.set(this._transactionIds.index,e)}_buildAllTransactions(){for(let e=0;e<this._signedTransactions.length;e++)this._buildTransaction(e)}async _buildAllTransactionsAsync(){if(!this._signOnDemand){this._buildAllTransactions();return}if(this._buildSignedTransactions(),!this._transactions.locked)for(let e=0;e<this._signedTransactions.length;e++)this._transactions.push(await this._buildTransactionAsync())}_buildTransaction(e){if(this._transactions.length<e)for(let t=this._transactions.length;t<e;t++)this._transactions.push(null);this._transactions.setIfAbsent(e,()=>({signedTransactionBytes:os.proto.SignedTransaction.encode(this._signedTransactions.get(e)).finish()}))}async _buildTransactionAsync(){return{signedTransactionBytes:os.proto.SignedTransaction.encode(await this._signTransaction()).finish()}}_shouldRetry(e,t){let{nodeTransactionPrecheckCode:n}=t,i=P._fromCode(n??os.proto.ResponseCodeEnum.OK);switch(this._logger&&(this._logger.debug(`[${this._getLogId()}] received status ${i.toString()}`),this._logger.info(`SDK Transaction Status Response: ${i.toString()}`)),i){case P.Busy:case P.Unknown:case P.PlatformTransactionNotCreated:case P.PlatformNotActive:return[i,Bn.Retry];case P.Ok:return[i,Bn.Finished];case P.TransactionExpired:return this._transactionIds.locked||this._regenerateTransactionId!=null&&!this._regenerateTransactionId?[i,Bn.Error]:(this._buildNewTransactionIdList(),[i,Bn.Retry]);default:return[i,Bn.Error]}}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=t,i=P._fromCode(n??os.proto.ResponseCodeEnum.OK);return this._logger&&this._logger.info(`Transaction Error Info: ${i.toString()}, ${this.transactionId.toString()}`),new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null})}async _mapResponse(e,t,n){let i=await N8(n.signedTransactionBytes),a=this._getTransactionId();return this._transactionIds.advance(),this._logger&&this._logger.info(`Transaction Info: ${JSON.stringify(new s1({nodeId:t,transactionHash:i,transactionId:a}).toJSON())}`),new s1({nodeId:t,transactionHash:i,transactionId:a})}_makeSignedTransaction(e){let t=this._makeTransactionBody(e);return this._logger&&this._logger.info(`Transaction Body: ${JSON.stringify(t)}`),{bodyBytes:os.proto.TransactionBody.encode(t).finish(),sigMap:{sigPair:[]}}}_makeTransactionBody(e){return{[this._getTransactionDataCase()]:this._makeTransactionData(),transactionFee:this._maxTransactionFee!=null?this._maxTransactionFee.toTinybars():null,memo:this._transactionMemo,transactionID:this._transactionIds.current._toProtobuf(),nodeAccountID:e!=null?e._toProtobuf():null,transactionValidDuration:{seconds:D8.default.fromNumber(this._transactionValidDuration)}}}_getTransactionDataCase(){throw new Error("not implemented")}_getScheduledTransactionBody(){return{memo:this.transactionMemo,transactionFee:this._maxTransactionFee==null?this._defaultMaxTransactionFee.toTinybars():this._maxTransactionFee.toTinybars(),[this._getTransactionDataCase()]:this._makeTransactionData()}}_makeTransactionData(){throw new Error("not implemented")}_isFrozen(){return this._signOnDemand||this._signedTransactions.length>0||this._transactions.length>0}_requireNotFrozen(){if(this._isFrozen())throw new Error("transaction is immutable; it has at least one signature or has been explicitly frozen")}_requireNotSignOnDemand(){if(this._signOnDemand)throw new Error("Please use `toBytesAsync()` if `signOnDemand` is enabled")}_requireFrozen(){if(!this._isFrozen())throw new Error("transaction must have been frozen before calculating the hash will be stable, try calling `freeze`")}_requireOneNodeAccountId(){if(this._nodeAccountIds.length!=1)throw"transaction did not have exactly one node ID set"}_requestToBytes(e){return os.proto.Transaction.encode(e).finish()}_responseToBytes(e){return os.proto.TransactionResponse.encode(e).finish()}},Cx=[];var TB=Oe(br(),1);var P8=Oe(Jt(),1),sa=class r{constructor(e,t){this.tokenId=e,this.serial=typeof t=="number"?P8.default.fromNumber(t):t,Object.freeze(this)}static fromString(e){let t=e.split("/").length>1?e.split("/"):e.split("@");for(let a of t)if(a==="")throw new Error("invalid format for NftId: use [token]/[serial] or [token]@[serial]");let n=De.fromString(t[0]),i=P8.default.fromString(t[1]);return new r(n,i)}static _fromProtobuf(e){return new r(De._fromProtobuf(e.tokenID),e.serialNumber!=null?e.serialNumber:P8.default.ZERO)}static fromBytes(e){return r._fromProtobuf(TB.proto.NftID.decode(e))}_toProtobuf(){return{tokenID:this.tokenId._toProtobuf(),serialNumber:P8.default.fromValue(this.serial!==void 0?this.serial:0)}}toString(){return`${this.tokenId.toString()}/${this.serial.toString()}`}toBytes(){return TB.proto.NftID.encode(this._toProtobuf()).finish()}};var Uze=Oe(Jt(),1);var Qd=class r{constructor(e){this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.amount=e.amount,Object.freeze(this)}static _fromProtobuf(e){return new r({spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,amount:Ge.fromTinybars(e.amount!=null?e.amount:0)})}static _fromGrantedProtobuf(e,t){return new r({spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,amount:Ge.fromTinybars(e.amount!=null?e.amount:0)})}_toProtobuf(){return{owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,amount:this.amount!=null?this.amount.toTinybars():null}}_validateChecksums(e){this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}toJSON(){return{ownerAccountId:this.ownerAccountId!=null?this.ownerAccountId.toString():null,spenderAccountId:this.spenderAccountId!=null?this.spenderAccountId.toString():null,amount:this.amount!=null?this.amount.toString():null}}};var SB=Oe(Jt(),1),$d=class r{constructor(e){this.tokenId=e.tokenId,this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.amount=e.amount,Object.freeze(this)}static _fromProtobuf(e){return new r({tokenId:De._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,amount:e.amount!=null?SB.default.fromValue(e.amount):null})}static _fromGrantedProtobuf(e,t){return new r({tokenId:De._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,amount:e.amount!=null?SB.default.fromValue(e.amount):null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,amount:this.amount}}_validateChecksums(e){this.tokenId.validateChecksum(e),this.ownerAccountId!=null&&this.ownerAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}};var IB=Oe(Jt(),1),X3=class r{constructor(e){this.tokenId=e.tokenId,this.spenderAccountId=e.spenderAccountId,this.ownerAccountId=e.ownerAccountId,this.serialNumbers=e.serialNumbers,this.allSerials=e.allSerials,this.delegatingSpender=e.delegatingSpender,Object.freeze(this)}static _fromProtobuf(e){let t=e.approvedForAll!=null&&e.approvedForAll.value==!0;return new r({tokenId:De._fromProtobuf(e.tokenId),spenderAccountId:e.spender!=null?ne._fromProtobuf(e.spender):null,ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,serialNumbers:t?null:e.serialNumbers!=null?e.serialNumbers.map(n=>IB.default.fromValue(n)):[],allSerials:t,delegatingSpender:e.delegatingSpender!=null?ne._fromProtobuf(e.delegatingSpender):null})}static _fromGrantedProtobuf(e,t){return new r({tokenId:De._fromProtobuf(e.tokenId),spenderAccountId:ne._fromProtobuf(e.spender),ownerAccountId:t,serialNumbers:[],allSerials:null,delegatingSpender:null})}static _fromRemoveProtobuf(e){return new r({tokenId:De._fromProtobuf(e.tokenId),spenderAccountId:null,ownerAccountId:e.owner!=null?ne._fromProtobuf(e.owner):null,serialNumbers:e.serialNumbers!=null?e.serialNumbers.map(t=>IB.default.fromValue(t)):[],allSerials:null,delegatingSpender:null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),spender:this.spenderAccountId!=null?this.spenderAccountId._toProtobuf():null,owner:this.ownerAccountId!=null?this.ownerAccountId._toProtobuf():null,approvedForAll:this.serialNumbers==null?{value:this.allSerials}:null,serialNumbers:this.serialNumbers,delegatingSpender:this.delegatingSpender!=null?this.delegatingSpender._toProtobuf():null}}_validateChecksums(e){this.tokenId.validateChecksum(e),this.ownerAccountId!=null&&this.ownerAccountId.validateChecksum(e),this.spenderAccountId!=null&&this.spenderAccountId.validateChecksum(e)}};var CB=Oe(Jt(),1);var B8=class r extends ke{constructor(e={}){super(),this._hbarApprovals=e.hbarApprovals!=null?e.hbarApprovals:[],this._tokenApprovals=e.tokenApprovals!=null?e.tokenApprovals:[],this._nftApprovals=e.nftApprovals!=null?e.nftApprovals:[]}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoApproveAllowance;return ke._fromProtobufTransactions(new r({hbarApprovals:(s.cryptoAllowances!=null?s.cryptoAllowances:[]).map(c=>Qd._fromProtobuf(c)),tokenApprovals:(s.tokenAllowances!=null?s.tokenAllowances:[]).map(c=>$d._fromProtobuf(c)),nftApprovals:(s.nftAllowances!=null?s.nftAllowances:[]).map(c=>X3._fromProtobuf(c))}),e,t,n,i,a)}get hbarApprovals(){return this._hbarApprovals}approveHbarAllowance(e,t,n){return this._requireNotFrozen(),this._hbarApprovals.push(new Qd({spenderAccountId:typeof t=="string"?ne.fromString(t):t instanceof Et?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,ownerAccountId:typeof e=="string"?ne.fromString(e):e instanceof Et?ne.fromEvmAddress(0,0,e.toSolidityAddress()):e,amount:n instanceof Ge?n:new Ge(n)})),this}addHbarAllowance(e,t){return this._requireNotFrozen(),this._hbarApprovals.push(new Qd({spenderAccountId:typeof e=="string"?ne.fromString(e):e,amount:t instanceof Ge?t:new Ge(t),ownerAccountId:null})),this}get tokenApprovals(){return this._tokenApprovals}approveTokenAllowance(e,t,n,i){return this._requireNotFrozen(),this._tokenApprovals.push(new $d({tokenId:typeof e=="string"?De.fromString(e):e,spenderAccountId:typeof n=="string"?ne.fromString(n):n instanceof Et?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof Et?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,amount:typeof i=="number"?CB.default.fromNumber(i):i})),this}addTokenAllowance(e,t,n){return this._requireNotFrozen(),this._tokenApprovals.push(new $d({tokenId:typeof e=="string"?De.fromString(e):e,spenderAccountId:typeof t=="string"?ne.fromString(t):t,amount:typeof n=="number"?CB.default.fromNumber(n):n,ownerAccountId:null})),this}addTokenNftAllowance(e,t){return this._approveTokenNftAllowance(e,null,t,null)}get tokenNftApprovals(){return this._nftApprovals}_approveTokenNftAllowance(e,t,n,i){this._requireNotFrozen();let a=typeof e=="string"?sa.fromString(e):e,o=typeof n=="string"?ne.fromString(n):n instanceof Et?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,s=!1;for(let c of this._nftApprovals)if(c.tokenId.compare(a.tokenId)===0&&c.spenderAccountId!=null&&c.spenderAccountId.compare(o)===0){c.serialNumbers!=null&&c.serialNumbers.push(a.serial),s=!0;break}return s||this._nftApprovals.push(new X3({tokenId:a.tokenId,spenderAccountId:o,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof Et?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,serialNumbers:[a.serial],allSerials:!1,delegatingSpender:typeof i=="string"?ne.fromString(i):i})),this}approveTokenNftAllowance(e,t,n){return this._approveTokenNftAllowance(e,t,n,null)}approveTokenNftAllowanceWithDelegatingSpender(e,t,n,i){return this._approveTokenNftAllowance(e,t,n,i)}_approveAllTokenNftAllowance(e,t,n,i){return this._requireNotFrozen(),this._nftApprovals.push(new X3({tokenId:typeof e=="string"?De.fromString(e):e,spenderAccountId:typeof n=="string"?ne.fromString(n):n instanceof Et?ne.fromEvmAddress(0,0,n.toSolidityAddress()):n,ownerAccountId:typeof t=="string"?ne.fromString(t):t instanceof Et?ne.fromEvmAddress(0,0,t.toSolidityAddress()):t,serialNumbers:null,allSerials:i,delegatingSpender:null})),this}addAllTokenNftAllowance(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!0)}approveTokenNftAllowanceAllSerials(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!0)}deleteTokenNftAllowanceAllSerials(e,t,n){return this._approveAllTokenNftAllowance(e,t,n,!1)}_validateChecksums(e){this._hbarApprovals.map(t=>t._validateChecksums(e)),this._tokenApprovals.map(t=>t._validateChecksums(e)),this._nftApprovals.map(t=>t._validateChecksums(e))}_execute(e,t){return e.crypto.approveAllowances(t)}_getTransactionDataCase(){return"cryptoApproveAllowance"}_makeTransactionData(){return{cryptoAllowances:this._hbarApprovals.map(e=>e._toProtobuf()),tokenAllowances:this._tokenApprovals.map(e=>e._toProtobuf()),nftAllowances:this._nftApprovals.map(e=>e._toProtobuf())}}_getLogId(){return`AccountAllowanceApproveTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoApproveAllowance",B8._fromProtobuf);var M8=class r extends ke{constructor(e={}){super(),this._nftAllowances=e.nftAllowances!=null?e.nftAllowances:[]}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDeleteAllowance;return ke._fromProtobufTransactions(new r({nftAllowances:(s.nftAllowances!=null?s.nftAllowances:[]).map(c=>X3._fromProtobuf(c))}),e,t,n,i,a)}get tokenNftAllowanceDeletions(){return this._nftAllowances}deleteAllTokenNftAllowances(e,t){this._requireNotFrozen();let n=typeof e=="string"?sa.fromString(e):e,i=typeof t=="string"?ne.fromString(t):t,a=!1;for(let o of this._nftAllowances)if(o.tokenId.compare(n.tokenId)===0){o.serialNumbers!=null&&o.serialNumbers.push(n.serial),a=!0;break}return a||this._nftAllowances.push(new X3({tokenId:n.tokenId,spenderAccountId:null,serialNumbers:[n.serial],ownerAccountId:i,allSerials:!1,delegatingSpender:null})),this}_validateChecksums(e){this._nftAllowances.map(t=>t._validateChecksums(e))}_execute(e,t){return e.crypto.deleteAllowances(t)}_getTransactionDataCase(){return"cryptoDeleteAllowance"}_makeTransactionData(){return{nftAllowances:this._nftAllowances.map(e=>e._toProtobuf())}}_getLogId(){return`AccountAllowanceDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoDeleteAllowance",M8._fromProtobuf);var l3e=Oe(Jt(),1);var L8=class extends fi{constructor(){super(e=>De.fromString(e))}};var F8=class extends fi{constructor(){super(e=>De.fromString(e))}};var kB=Oe(br(),1),_m=class r{constructor(e){this.hbars=e.hbars,this.tokens=e.tokens,this.tokenDecimals=e.tokenDecimals,Object.freeze(this)}static fromBytes(e){return r._fromProtobuf(kB.proto.CryptoGetAccountBalanceResponse.decode(e))}static _fromProtobuf(e){let t=new L8,n=new F8;if(e.tokenBalances!=null)for(let i of e.tokenBalances){let a=De._fromProtobuf(i.tokenId);n._set(a,i.decimals!=null?i.decimals:0),t._set(a,l3e.default.fromValue(i.balance))}return new r({hbars:Ge.fromTinybars(e.balance),tokens:t,tokenDecimals:n})}_toProtobuf(){let e=[];for(let[t,n]of this.tokens!=null?this.tokens:[])e.push({tokenId:t._toProtobuf(),balance:n,decimals:this.tokenDecimals!=null?this.tokenDecimals.get(t):null});return{balance:this.hbars.toTinybars(),tokenBalances:e}}toBytes(){return kB.proto.CryptoGetAccountBalanceResponse.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){let e=[];for(let[t,n]of this.tokens!=null?this.tokens:[]){let i=this.tokenDecimals!=null?this.tokenDecimals.get(t):null;e.push({tokenId:t.toString(),balance:n.toString(),decimals:i??0})}return{hbars:this.hbars.toString(),tokens:e}}};var ec=class r extends Ar{constructor(e={}){super(),this._accountId=null,this._contractId=null,e.accountId!=null&&this.setAccountId(e.accountId),e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.cryptogetAccountBalance;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,contractId:t.contractID!=null?Et._fromProtobuf(t.contractID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}_isPaymentRequired(){return!1}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.crypto.cryptoGetBalance(t)}_mapResponseHeader(e){return e.cryptogetAccountBalance.header}_mapResponse(e,t,n){let i=e.cryptogetAccountBalance;return Promise.resolve(_m._fromProtobuf(i))}_onMakeRequest(e){return{cryptogetAccountBalance:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`AccountBalanceQuery:${this._timestamp.toString()}`}};$r.set("cryptogetAccountBalance",ec._fromProtobuf);var UJt=Oe(br(),1);var NB=Oe(Jt(),1),pr=class r{constructor(e){this.seconds=e instanceof NB.default?e:NB.default.fromNumber(e),Object.freeze(this)}_toProtobuf(){return{seconds:this.seconds}}static _fromProtobuf(e){return new r(e.seconds)}};var RB=Oe(Jt(),1);var U8=class r extends ke{constructor(e={}){super(),this._key=null,this._initialBalance=null,this._sendRecordThreshold=AB,this._receiveRecordThreshold=AB,this._receiverSignatureRequired=!1,this._proxyAccountId=null,this._autoRenewPeriod=new pr(_u),this._accountMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=!1,this._alias=null,e.key!=null&&this.setKey(e.key),e.receiverSignatureRequired!=null&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),e.initialBalance!=null&&this.setInitialBalance(e.initialBalance),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.accountMemo!=null&&this.setAccountMemo(e.accountMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.alias!=null&&this.setAlias(e.alias)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoCreateAccount,c;return s.alias!=null&&s.alias.length>0&&s.alias.length===20&&(c=ns.fromBytes(s.alias)),ke._fromProtobufTransactions(new r({key:s.key!=null?nt._fromProtobufKey(s.key):void 0,initialBalance:s.initialBalance!=null?s.initialBalance:void 0,receiverSignatureRequired:s.receiverSigRequired!=null?s.receiverSigRequired:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,accountMemo:s.memo!=null?s.memo:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null?s.maxAutomaticTokenAssociations:void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward==!0,alias:c}),e,t,n,i,a)}get key(){return this._key}setKey(e){return this._requireNotFrozen(),this._key=e,this}get initialBalance(){return this._initialBalance}setInitialBalance(e){return this._requireNotFrozen(),this._initialBalance=e instanceof Ge?e:new Ge(e),this}get receiverSignatureRequired(){return this._receiverSignatureRequired}setReceiverSignatureRequired(e){return this._requireNotFrozen(),this._receiverSignatureRequired=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get accountMemo(){return this._accountMemo}setAccountMemo(e){return this._requireNotFrozen(),this._accountMemo=e,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=typeof e=="number"?RB.default.fromNumber(e):e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=RB.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get alias(){return this._alias}setAlias(e){if(typeof e=="string")if(e.startsWith("0x")&&e.length==42||e.length==40)this._alias=ns.fromString(e);else throw new Error('evmAddress must be a valid EVM address with or without "0x" prefix');else this._alias=e;return this}_validateChecksums(e){this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.createAccount(t)}_getTransactionDataCase(){return"cryptoCreateAccount"}_makeTransactionData(){let e=null;return this._alias!=null&&(e=this._alias.toBytes()),{key:this._key!=null?this._key._toProtobufKey():null,initialBalance:this._initialBalance!=null?this._initialBalance.toTinybars():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,receiveRecordThreshold:this._receiveRecordThreshold.toTinybars(),sendRecordThreshold:this._sendRecordThreshold.toTinybars(),receiverSigRequired:this._receiverSignatureRequired,memo:this._accountMemo,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?this._maxAutomaticTokenAssociations.toInt():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards,alias:e}}_getLogId(){return`AccountCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoCreateAccount",U8._fromProtobuf);var q8=class r extends ke{constructor(e={}){super(),this._accountId=null,this._transferAccountId=null,e.accountId!=null&&this.setAccountId(e.accountId),e.transferAccountId!=null&&this.setTransferAccountId(e.transferAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDelete;return ke._fromProtobufTransactions(new r({accountId:s.deleteAccountID!=null?ne._fromProtobuf(s.deleteAccountID):void 0,transferAccountId:s.transferAccountID!=null?ne._fromProtobuf(s.transferAccountID):void 0}),e,t,n,i,a)}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get transferAccountId(){return this._transferAccountId}setTransferAccountId(e){return this._requireNotFrozen(),this._transferAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._transferAccountId!=null&&this._transferAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.cryptoDelete(t)}_getTransactionDataCase(){return"cryptoDelete"}_makeTransactionData(){return{deleteAccountID:this._accountId!=null?this._accountId._toProtobuf():null,transferAccountID:this._transferAccountId!=null?this._transferAccountId._toProtobuf():null}}_getLogId(){return`AccountDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoDelete",q8._fromProtobuf);var OB=Oe(br(),1),c1=class r{constructor(e){this.declineStakingReward=e.declineStakingReward,this.stakePeriodStart=e.stakePeriodStart,this.pendingReward=e.pendingReward,this.stakedToMe=e.stakedToMe,this.stakedAccountId=e.stakedAccountId,this.stakedNodeId=e.stakedNodeId,Object.freeze(this)}static _fromProtobuf(e){return new r({declineStakingReward:e.declineReward==!0,stakePeriodStart:e.stakePeriodStart!=null?ut._fromProtobuf(e.stakePeriodStart):null,pendingReward:e.pendingReward!=null?Ge.fromTinybars(e.pendingReward):null,stakedToMe:e.stakedToMe!=null?Ge.fromTinybars(e.stakedToMe):null,stakedAccountId:e.stakedAccountId!=null?ne._fromProtobuf(e.stakedAccountId):null,stakedNodeId:e.stakedNodeId!=null?e.stakedNodeId:null})}_toProtobuf(){return{declineReward:this.declineStakingReward,stakePeriodStart:this.stakePeriodStart!=null?this.stakePeriodStart._toProtobuf():null,pendingReward:this.pendingReward!=null?this.pendingReward.toTinybars():null,stakedToMe:this.stakedToMe!=null?this.stakedToMe.toTinybars():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId}}static fromBytes(e){return r._fromProtobuf(OB.proto.StakingInfo.decode(e))}toBytes(){return OB.proto.StakingInfo.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{declineStakingReward:this.declineStakingReward,stakePeriodStart:this.stakePeriodStart!=null?this.stakePeriodStart.toString():null,pendingReward:this.pendingReward!=null?this.pendingReward.toString():null,stakedToMe:this.stakedToMe!=null?this.stakedToMe.toString():null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId.toString():null,stakedNodeId:this.stakedNodeId!=null?this.stakedNodeId.toString():null}}};var Df=class r{constructor(e){this.accountId=e.accountId,this.hash=e.hash,this.keys=e.keys,this.duration=e.duration,Object.freeze(this)}static _fromProtobuf(e){let t=e;return new r({accountId:ne._fromProtobuf(t.accountId),hash:t.hash!=null?t.hash:new Uint8Array,keys:t.keys!=null?Oi.__fromProtobufKeyList(t.keys):new Oi,duration:pr._fromProtobuf(t.duration)})}_toProtobuf(){return{accountId:this.accountId._toProtobuf(),hash:this.hash,keys:this.keys._toProtobufKey().keyList,duration:this.duration._toProtobuf()}}};var u1=Oe(Jt(),1);var kx=Oe(Jt(),1);var j8=class r{constructor(e){this.tokenId=e.tokenId,this.symbol=e.symbol,this.balance=e.balance,this.isKycGranted=e.isKycGranted,this.isFrozen=e.isFrozen,this.automaticAssociation=e.automaticAssociation,Object.freeze(this)}static _fromProtobuf(e){let t=De._fromProtobuf(e.tokenId),n=e.kycStatus==null||e.kycStatus===0?null:e.kycStatus===1,i=e.freezeStatus==null||e.freezeStatus===0?null:e.freezeStatus===1;return new r({tokenId:t,symbol:e.symbol,balance:e.balance!=null?e.balance instanceof kx.default?e.balance:kx.default.fromValue(e.balance):kx.default.ZERO,isKycGranted:n,isFrozen:i,automaticAssociation:e.automaticAssociation!=null?e.automaticAssociation:null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),symbol:this.symbol,balance:this.balance,kycStatus:this.isKycGranted==null?0:this.isKycGranted?1:2,freezeStatus:this.isFrozen==null?0:this.isFrozen?1:2,automaticAssociation:this.automaticAssociation}}};var l1=class r extends fi{constructor(){super(e=>De.fromString(e))}static _fromProtobuf(e){let t=new r;for(let n of e){let i=De._fromProtobuf(n.tokenId);t._set(i,j8._fromProtobuf(n))}return t}_toProtobuf(){let e=[];for(let[t,n]of this)e.push(n._toProtobuf());return e}};var V8=Oe(br(),1);var gr=class r{constructor(e){this._ledgerId=e,Object.freeze(this)}static fromString(e){switch(e){case tc[0]:case"0":return r.MAINNET;case tc[1]:case"1":return r.TESTNET;case tc[2]:case"2":return r.PREVIEWNET;case tc[3]:case"3":return r.LOCAL_NODE;default:{let t=tt(e);if(t.length==0&&e.length!=0)throw new Error("Default reached for fromString");return new r(t)}}}toString(){if(this._ledgerId.length==1)switch(this._ledgerId[0]){case 0:return tc[0];case 1:return tc[1];case 2:return tc[2];case 3:return tc[3];default:return Ke(this._ledgerId)}else return Ke(this._ledgerId)}static fromBytes(e){return new r(e)}toBytes(){return this._ledgerId}isMainnet(){return this.toString()==tc[0]}isTestnet(){return this.toString()==tc[1]}isPreviewnet(){return this.toString()==tc[2]}isLocalNode(){return this.toString()==tc[3]}},tc=["mainnet","testnet","previewnet","local-node"];gr.MAINNET=new gr(new Uint8Array([0]));gr.TESTNET=new gr(new Uint8Array([1]));gr.PREVIEWNET=new gr(new Uint8Array([2]));gr.LOCAL_NODE=new gr(new Uint8Array([3]));var Em=class r{constructor(e){this.accountId=e.accountId,this.contractAccountId=e.contractAccountId,this.isDeleted=e.isDeleted,this.proxyAccountId=e.proxyAccountId,this.proxyReceived=e.proxyReceived,this.key=e.key,this.balance=e.balance,this.sendRecordThreshold=e.sendRecordThreshold,this.receiveRecordThreshold=e.receiveRecordThreshold,this.isReceiverSignatureRequired=e.isReceiverSignatureRequired,this.expirationTime=e.expirationTime,this.autoRenewPeriod=e.autoRenewPeriod,this.liveHashes=e.liveHashes,this.tokenRelationships=e.tokenRelationships,this.accountMemo=e.accountMemo,this.ownedNfts=e.ownedNfts,this.maxAutomaticTokenAssociations=e.maxAutomaticTokenAssociations,this.aliasKey=e.aliasKey,this.ledgerId=e.ledgerId,this.hbarAllowances=e.hbarAllowances,this.tokenAllowances=e.tokenAllowances,this.nftAllowances=e.nftAllowances,this.ethereumNonce=e.ethereumNonce,this.stakingInfo=e.stakingInfo,Object.freeze(this)}static _fromProtobuf(e){let t=e.alias!=null&&e.alias.length>0?nt._fromProtobufKey(V8.proto.Key.decode(e.alias)):null;t instanceof ei||(t=null);let n=ne._fromProtobuf(e.accountID);return new r({accountId:n,contractAccountId:e.contractAccountID!=null?e.contractAccountID:null,isDeleted:e.deleted!=null?e.deleted:!1,key:nt._fromProtobufKey(e.key),balance:Ge.fromTinybars(e.balance!=null?e.balance:0),sendRecordThreshold:Ge.fromTinybars(e.generateSendRecordThreshold!=null?e.generateSendRecordThreshold:0),receiveRecordThreshold:Ge.fromTinybars(e.generateReceiveRecordThreshold!=null?e.generateReceiveRecordThreshold:0),isReceiverSignatureRequired:e.receiverSigRequired!=null?e.receiverSigRequired:!1,expirationTime:ut._fromProtobuf(e.expirationTime),autoRenewPeriod:e.autoRenewPeriod!=null?new pr(e.autoRenewPeriod.seconds):new pr(0),proxyAccountId:e.proxyAccountID!=null&&u1.default.fromValue(e.proxyAccountID.shardNum).toInt()!==0&&u1.default.fromValue(e.proxyAccountID.realmNum).toInt()!==0&&u1.default.fromValue(e.proxyAccountID.accountNum).toInt()!==0?ne._fromProtobuf(e.proxyAccountID):null,proxyReceived:Ge.fromTinybars(e.proxyReceived!=null?e.proxyReceived:0),liveHashes:(e.liveHashes!=null?e.liveHashes:[]).map(i=>Df._fromProtobuf(i)),tokenRelationships:l1._fromProtobuf(e.tokenRelationships!=null?e.tokenRelationships:[]),accountMemo:e.memo!=null?e.memo:"",ownedNfts:e.ownedNfts?e.ownedNfts:u1.default.ZERO,maxAutomaticTokenAssociations:e.maxAutomaticTokenAssociations?u1.default.fromNumber(e.maxAutomaticTokenAssociations):u1.default.ZERO,aliasKey:t,ledgerId:e.ledgerId!=null?gr.fromBytes(e.ledgerId):null,hbarAllowances:[],tokenAllowances:[],nftAllowances:[],ethereumNonce:e.ethereumNonce!=null?e.ethereumNonce:null,stakingInfo:e.stakingInfo!=null?c1._fromProtobuf(e.stakingInfo):null})}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),contractAccountID:this.contractAccountId,deleted:this.isDeleted,proxyAccountID:this.proxyAccountId!=null?this.proxyAccountId._toProtobuf():null,proxyReceived:this.proxyReceived.toTinybars(),key:this.key._toProtobufKey(),balance:this.balance.toTinybars(),generateSendRecordThreshold:this.sendRecordThreshold.toTinybars(),generateReceiveRecordThreshold:this.receiveRecordThreshold.toTinybars(),receiverSigRequired:this.isReceiverSignatureRequired,expirationTime:this.expirationTime._toProtobuf(),autoRenewPeriod:this.autoRenewPeriod._toProtobuf(),liveHashes:this.liveHashes.map(e=>e._toProtobuf()),tokenRelationships:this.tokenRelationships!=null?this.tokenRelationships._toProtobuf():null,memo:this.accountMemo,ownedNfts:this.ownedNfts,maxAutomaticTokenAssociations:this.maxAutomaticTokenAssociations.toInt(),alias:this.aliasKey!=null?V8.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():null,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,ethereumNonce:this.ethereumNonce,stakingInfo:this.stakingInfo!=null?this.stakingInfo._toProtobuf():null}}static fromBytes(e){return r._fromProtobuf(V8.proto.CryptoGetInfoResponse.AccountInfo.decode(e))}toBytes(){return V8.proto.CryptoGetInfoResponse.AccountInfo.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{balance:this.balance.toString(),accountId:this.accountId.toString(),contractAccountId:this.contractAccountId,isDeleted:this.isDeleted,proxyAccountId:this.proxyAccountId!=null?this.proxyAccountId.toString():null,proxyReceived:this.proxyReceived.toString(),key:this.key!=null?this.key.toString():null,sendRecordThreshold:this.sendRecordThreshold.toString(),receiveRecordThreshold:this.receiveRecordThreshold.toString(),isReceiverSignatureRequired:this.isReceiverSignatureRequired,expirationTime:this.expirationTime.toString(),autoRenewPeriod:this.autoRenewPeriod.toString(),accountMemo:this.accountMemo,ownedNfts:this.ownedNfts.toString(),maxAutomaticTokenAssociations:this.maxAutomaticTokenAssociations.toString(),aliasKey:this.aliasKey!=null?this.aliasKey.toString():null,ledgerId:this.ledgerId!=null?this.ledgerId.toString():null,ethereumNonce:this.ethereumNonce!=null?this.ethereumNonce.toString():null,stakingInfo:this.stakingInfo!=null?this.stakingInfo.toJSON():null}}};var sl=class r extends Ar{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetInfo;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getAccountInfo(t)}async getCost(e){return super.getCost(e)}_mapResponseHeader(e){return e.cryptoGetInfo.header}_mapResponse(e,t,n){let i=e.cryptoGetInfo;return Promise.resolve(Em._fromProtobuf(i.accountInfo))}_onMakeRequest(e){return{cryptoGetInfo:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("cryptoGetInfo",sl._fromProtobuf);var Eu=class r extends Ar{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetAccountRecords;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getAccountRecords(t)}_mapResponseHeader(e){return e.cryptoGetAccountRecords.header}_mapResponse(e,t,n){let a=e.cryptoGetAccountRecords.records;return Promise.resolve(a.map(o=>wu._fromProtobuf({transactionRecord:o})))}_onMakeRequest(e){return{cryptoGetAccountRecords:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountRecordsQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("cryptoGetAccountRecords",Eu._fromProtobuf);var xm=class r{constructor(e){this.accountId=e.accountId,this.amount=e.amount instanceof Ge?e.amount:new Ge(e.amount),Object.freeze(this)}static _fromProtobuf(e){return new r({accountId:ne._fromProtobuf(e.accountID),amount:Ge.fromTinybars(e.amount!=null?e.amount:0)})}_toProtobuf(){return{accountID:this.accountId._toProtobuf(),amount:this.amount.toTinybars()}}};var H8=class r extends Ar{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e){let t=e.cryptoGetProxyStakers;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getStakersByAccountID(t)}_mapResponseHeader(e){return e.cryptoGetProxyStakers.header}_mapResponse(e){let n=e.cryptoGetProxyStakers.stakers;return Promise.resolve((n.proxyStaker!=null?n.proxyStaker:[]).map(i=>xm._fromProtobuf(i)))}_onMakeRequest(e){return{cryptoGetProxyStakers:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountStakersQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("cryptoGetProxyStakers",H8._fromProtobuf);var K8=Oe(Jt(),1);var z8=class r extends ke{constructor(e={}){super(),this._accountId=null,this._key=null,this._receiverSignatureRequired=!1,this._proxyAccountId=null,this._autoRenewPeriod=null,this._expirationTime=null,this._accountMemo=null,this._maxAutomaticTokenAssociations=null,this._aliasKey=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=null,e.accountId!=null&&this.setAccountId(e.accountId),e.key!=null&&this.setKey(e.key),e.receiverSignatureRequired!=null&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.accountMemo!=null&&this.setAccountMemo(e.accountMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoUpdateAccount;return ke._fromProtobufTransactions(new r({accountId:s.accountIDToUpdate!=null?ne._fromProtobuf(s.accountIDToUpdate):void 0,key:s.key!=null?nt._fromProtobufKey(s.key):void 0,receiverSignatureRequired:s.receiverSigRequired!=null?s.receiverSigRequired:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0,accountMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null&&s.maxAutomaticTokenAssociations.value!=null?K8.default.fromNumber(s.maxAutomaticTokenAssociations.value):void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward!=null&&!!s.declineReward}),e,t,n,i,a)}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get key(){return this._key}setKey(e){return this._requireNotFrozen(),this._key=e,this}get receiverSignatureRequired(){return this._receiverSignatureRequired}setReceiverSignatureRequired(e){return this._requireNotFrozen(),this._receiverSignatureRequired=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof Date?ut.fromDate(e):e,this}get accountMemo(){return this._accountMemo}setAccountMemo(e){return this._requireNotFrozen(),this._accountMemo=e,this}clearAccountMemo(){return this._requireNotFrozen(),this._accountMemo=null,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=typeof e=="number"?K8.default.fromNumber(e):e,this}get aliasKey(){return null}setAliasKey(e){return this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}clearStakedAccountId(){return this._requireNotFrozen(),this._stakedAccountId=new ne(0,0,0),this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=K8.default.fromValue(e),this}clearStakedNodeId(){return this._requireNotFrozen(),this._stakedNodeId=K8.default.fromNumber(-1),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.updateAccount(t)}_getTransactionDataCase(){return"cryptoUpdateAccount"}_makeTransactionData(){return{accountIDToUpdate:this._accountId!=null?this._accountId._toProtobuf():null,key:this._key!=null?this._key._toProtobufKey():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,receiverSigRequiredWrapper:this._receiverSignatureRequired==null?null:{value:this._receiverSignatureRequired},memo:this._accountMemo!=null?{value:this._accountMemo}:null,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?{value:this._maxAutomaticTokenAssociations.toInt()}:null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards!=null?{value:this.declineStakingRewards}:null}}_getLogId(){return`AccountUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoUpdateAccount",z8._fromProtobuf);var Am=class{constructor(e={}){this._left=null,e.left!=null&&this.setLeft(e.left),this._right=null,e.right!=null&&this.setRight(e.right)}get left(){return this._left}setLeft(e){return this._left=e,this}get right(){return this._right}setRight(e){return this._right=e,this}toString(){return this._left!=null&&this._right!=null?`${this._left.toString()}.${this._right.toString()}`:""}};var G8=class r{constructor(e={}){this._network=null,e.network!=null&&this.setNetwork(e.network),this._host=null,e.host!=null&&this.setHost(e.host)}get newtork(){return this._network}setNetwork(e){return this._network=e,this}get host(){return this._host}setHost(e){return this._host=e,this}static _fromProtobuf(e){return new r({network:new Am().setLeft(e[0]).setRight(e[1]),host:new Am().setLeft(e[2]).setRight(e[3])})}_toProtobuf(){return Uint8Array.of(this._network!=null&&this._network._left!=null?this._network._left:0,this._network!=null&&this._network.right!=null?this._network.right:0,this._host!=null&&this._host.left!=null?this._host.left:0,this._host!=null&&this._host.right!=null?this._host.right:0)}toString(){return this._network!=null&&this._host!=null?`${this._network.toString()}.${this._host.toString()}`:""}};var W8=class r{constructor(e={}){this._address=null,e.address!=null&&this.setAddress(e.address),this._port=null,e.port!=null&&this.setPort(e.port)}get address(){return this.address}setAddress(e){return this._address=e,this}get port(){return this._port}setPort(e){return this._port=e,this}static _fromProtobuf(e){return new r({address:e.ipAddressV4!=null?G8._fromProtobuf(e.ipAddressV4):void 0,port:e.port!=null?e.port:void 0})}_toProtobuf(){return{ipAddressV4:this._address!=null?this._address._toProtobuf():null,port:this._port}}toString(){return`${this._address!=null?this._address.toString():""}:${this._port!=null?this._port.toString():""}`}toJSON(){return{address:this._address!=null?this._address.toString():null,port:this._port!=null?this._port.toString():null}}};var d1=class r{constructor(e={}){this._publicKey=null,e.publicKey!=null&&this.setPublicKey(e.publicKey),this._nodeId=null,e.nodeId!=null&&this.setNodeId(e.nodeId),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._certHash=null,e.certHash!=null&&this.setCertHash(e.certHash),this._addresses=[],e.addresses!=null&&this.setAddresses(e.addresses),this._description=null,e.description!=null&&this.setDescription(e.description),this._stake=null,e.stake!=null&&this.setStake(e.stake)}get publicKey(){return this._publicKey}setPublicKey(e){return this._publicKey=e,this}get nodeId(){return this._nodeId}setNodeId(e){return this._nodeId=e,this}get accountId(){return this._accountId}setAccountId(e){return this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get certHash(){return this._certHash}setCertHash(e){return this._certHash=e,this}get addresses(){return this._addresses}setAddresses(e){return this._addresses=e,this}get description(){return this._description}setDescription(e){return this._description=e,this}get stake(){return this._stake}setStake(e){return this._stake=e,this}static _fromProtobuf(e){return new r({publicKey:e.RSA_PubKey!=null?e.RSA_PubKey:void 0,nodeId:e.nodeId!=null?e.nodeId:void 0,accountId:e.nodeAccountId!=null?ne._fromProtobuf(e.nodeAccountId):void 0,certHash:e.nodeCertHash!=null?e.nodeCertHash:void 0,addresses:e.serviceEndpoint!=null?e.serviceEndpoint.map(t=>W8._fromProtobuf(t)):void 0,description:e.description!=null?e.description:void 0,stake:e.stake!=null?e.stake:void 0})}_toProtobuf(){return{RSA_PubKey:this._publicKey,nodeId:this._nodeId,nodeAccountId:this._accountId!=null?this._accountId._toProtobuf():null,nodeCertHash:this._certHash,serviceEndpoint:this._addresses.map(e=>e._toProtobuf()),description:this._description,stake:this._stake}}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{publicKey:this._publicKey,nodeId:this._nodeId!=null?this._nodeId.toString():null,accountId:this._accountId!=null?this._accountId.toString():null,certHash:this._certHash!=null?m8(this._certHash):null,addresses:this._addresses.map(e=>e.toJSON()),description:this._description,stake:this._stake!=null?this._stake.toString():null}}};var DB=Oe(br(),1),a3=class r{constructor(e={}){this._nodeAddresses=[],e.nodeAddresses!=null&&this.setNodeAddresses(e.nodeAddresses)}get nodeAddresses(){return this._nodeAddresses}setNodeAddresses(e){return this._nodeAddresses=e,this}static fromBytes(e){return r._fromProtobuf(DB.proto.NodeAddressBook.decode(e))}static _fromProtobuf(e){return new r({nodeAddresses:e.nodeAddress!=null?e.nodeAddress.map(t=>d1._fromProtobuf(t)):void 0})}_toProtobuf(){return{nodeAddress:this._nodeAddresses.map(e=>e._toProtobuf())}}toString(){return JSON.stringify(this.toJSON())}toJSON(){return{nodeAddresses:this._nodeAddresses.map(e=>e.toJSON())}}toBytes(){return DB.proto.NodeAddressBook.encode(this._toProtobuf()).finish()}};var Nx=Oe(br(),1);var Q8=class extends Ar{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId),this._limit=null,e.limit!=null&&this.setLimit(e.limit),this._retryHandler=t=>{if(t!=null){if(t instanceof Error)return!0;switch(t.code){case 13:return ME.test(t.details.toString());case 5:case 8:case 14:case 17:return!0;default:return!1}}return!1},this._addresses=[],this._attempt=0}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}get limit(){return this._limit}setLimit(e){return this._limit=e,this}setMaxAttempts(e){return this._maxAttempts=e,this}setMaxBackoff(e){return this._maxBackoff=e,this}execute(e,t){return new Promise((n,i)=>{this._makeServerStreamRequest(e,n,i,t)})}_makeServerStreamRequest(e,t,n,i){let a=Nx.com.hedera.mirror.api.proto.AddressBookQuery.encode({fileId:this._fileId!=null?this._fileId._toProtobuf():null,limit:this._limit}).finish();e._mirrorNetwork.getNextMirrorNode().getChannel().makeServerStreamRequest("NetworkService","getNodes",a,o=>{this._addresses.push(d1._fromProtobuf(Nx.proto.NodeAddress.decode(o))),this._limit!=null&&this._limit>0&&(this._limit=this._limit-1)},o=>{let s=o instanceof Error?o.message:o.details;if(this._attempt<this._maxAttempts&&!e.isClientShutDown&&this._retryHandler(o)){let c=Math.min(250*2**this._attempt,this._maxBackoff);this._attempt>=this._maxAttempts&&console.warn(`Error getting nodes from mirror for file ${this._fileId!=null?this._fileId.toString():"UNKNOWN"} during attempt ${this._attempt}. Waiting ${c} ms before next attempt: ${s}`),this._logger&&this._logger.debug(`Error getting nodes from mirror for file ${this._fileId!=null?this._fileId.toString():"UNKNOWN"} during attempt ${this._attempt}. Waiting ${c} ms before next attempt: ${s}`),this._attempt+=1,setTimeout(()=>{this._makeServerStreamRequest(e,t,n,i)},c)}else n(new Error("failed to query address book"))},()=>{t(new a3({nodeAddresses:this._addresses}))})}};ar.setAddressBookQueryConstructor(()=>new Q8);var $8=class r extends Ar{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.contractGetBytecode;return new r({contractId:t.contractID!=null?Et._fromProtobuf(t.contractID):void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.contractGetBytecode(t)}_mapResponseHeader(e){return e.contractGetBytecodeResponse.header}_mapResponse(e){let t=e.contractGetBytecodeResponse;return Promise.resolve(t.bytecode!=null?t.bytecode:new Uint8Array)}_onMakeRequest(e){return{contractGetBytecode:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`ContractByteCodeQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("contractGetBytecode",$8._fromProtobuf);var Pf="0123456789abcdef".split(""),qze=[1,256,65536,16777216],cl=[0,8,16,24],u3e=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],jze=r=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(r<<1)>>5,outputBlocks:r>>5,s:(e=>[].concat(e,e,e,e,e))([0,0,0,0,0,0,0,0,0,0])}),Vze=(r,e)=>{for(var t=e.length,n=r.blocks,i=r.blockCount<<2,a=r.blockCount,o=r.outputBlocks,s=r.s,c=0,l,u;c<t;){if(r.reset)for(r.reset=!1,n[0]=r.block,l=1;l<a+1;++l)n[l]=0;if(typeof e!="string")for(l=r.start;c<t&&l<i;++c)n[l>>2]|=e[c]<<cl[l++&3];else for(l=r.start;c<t&&l<i;++c)u=e.charCodeAt(c),u<128?n[l>>2]|=u<<cl[l++&3]:u<2048?(n[l>>2]|=(192|u>>6)<<cl[l++&3],n[l>>2]|=(128|u&63)<<cl[l++&3]):u<55296||u>=57344?(n[l>>2]|=(224|u>>12)<<cl[l++&3],n[l>>2]|=(128|u>>6&63)<<cl[l++&3],n[l>>2]|=(128|u&63)<<cl[l++&3]):(u=65536+((u&1023)<<10|e.charCodeAt(++c)&1023),n[l>>2]|=(240|u>>18)<<cl[l++&3],n[l>>2]|=(128|u>>12&63)<<cl[l++&3],n[l>>2]|=(128|u>>6&63)<<cl[l++&3],n[l>>2]|=(128|u&63)<<cl[l++&3]);if(r.lastByteIndex=l,l>=i){for(r.start=l-i,r.block=n[a],l=0;l<a;++l)s[l]^=n[l];PB(s),r.reset=!0}else r.start=l}if(l=r.lastByteIndex,n[l>>2]|=qze[l&3],r.lastByteIndex===i)for(n[0]=n[a],l=1;l<a+1;++l)n[l]=0;for(n[a-1]|=2147483648,l=0;l<a;++l)s[l]^=n[l];PB(s);var d="",h,g=0;for(l=0;g<o;){for(l=0;l<a&&g<o;++l,++g)h=s[l],d+=Pf[h>>4&15]+Pf[h&15]+Pf[h>>12&15]+Pf[h>>8&15]+Pf[h>>20&15]+Pf[h>>16&15]+Pf[h>>28&15]+Pf[h>>24&15];g%a===0&&(PB(s),l=0)}return"0x"+d},PB=r=>{var e,t,n,i,a,o,s,c,l,u,d,h,g,m,b,E,I,R,L,U,V,G,H,N,F,O,y,x,w,p,v,A,T,S,_,B,q,k,z,ie,M,te,oe,se,re,le,ae,ue,Ee,he,we,hn,at,mt,Wn,xt,St,vi,Tt,It,li,Ct,kt;for(n=0;n<48;n+=2)i=r[0]^r[10]^r[20]^r[30]^r[40],a=r[1]^r[11]^r[21]^r[31]^r[41],o=r[2]^r[12]^r[22]^r[32]^r[42],s=r[3]^r[13]^r[23]^r[33]^r[43],c=r[4]^r[14]^r[24]^r[34]^r[44],l=r[5]^r[15]^r[25]^r[35]^r[45],u=r[6]^r[16]^r[26]^r[36]^r[46],d=r[7]^r[17]^r[27]^r[37]^r[47],h=r[8]^r[18]^r[28]^r[38]^r[48],g=r[9]^r[19]^r[29]^r[39]^r[49],e=h^(o<<1|s>>>31),t=g^(s<<1|o>>>31),r[0]^=e,r[1]^=t,r[10]^=e,r[11]^=t,r[20]^=e,r[21]^=t,r[30]^=e,r[31]^=t,r[40]^=e,r[41]^=t,e=i^(c<<1|l>>>31),t=a^(l<<1|c>>>31),r[2]^=e,r[3]^=t,r[12]^=e,r[13]^=t,r[22]^=e,r[23]^=t,r[32]^=e,r[33]^=t,r[42]^=e,r[43]^=t,e=o^(u<<1|d>>>31),t=s^(d<<1|u>>>31),r[4]^=e,r[5]^=t,r[14]^=e,r[15]^=t,r[24]^=e,r[25]^=t,r[34]^=e,r[35]^=t,r[44]^=e,r[45]^=t,e=c^(h<<1|g>>>31),t=l^(g<<1|h>>>31),r[6]^=e,r[7]^=t,r[16]^=e,r[17]^=t,r[26]^=e,r[27]^=t,r[36]^=e,r[37]^=t,r[46]^=e,r[47]^=t,e=u^(i<<1|a>>>31),t=d^(a<<1|i>>>31),r[8]^=e,r[9]^=t,r[18]^=e,r[19]^=t,r[28]^=e,r[29]^=t,r[38]^=e,r[39]^=t,r[48]^=e,r[49]^=t,m=r[0],b=r[1],le=r[11]<<4|r[10]>>>28,ae=r[10]<<4|r[11]>>>28,x=r[20]<<3|r[21]>>>29,w=r[21]<<3|r[20]>>>29,It=r[31]<<9|r[30]>>>23,li=r[30]<<9|r[31]>>>23,te=r[40]<<18|r[41]>>>14,oe=r[41]<<18|r[40]>>>14,S=r[2]<<1|r[3]>>>31,_=r[3]<<1|r[2]>>>31,E=r[13]<<12|r[12]>>>20,I=r[12]<<12|r[13]>>>20,ue=r[22]<<10|r[23]>>>22,Ee=r[23]<<10|r[22]>>>22,p=r[33]<<13|r[32]>>>19,v=r[32]<<13|r[33]>>>19,Ct=r[42]<<2|r[43]>>>30,kt=r[43]<<2|r[42]>>>30,mt=r[5]<<30|r[4]>>>2,Wn=r[4]<<30|r[5]>>>2,B=r[14]<<6|r[15]>>>26,q=r[15]<<6|r[14]>>>26,R=r[25]<<11|r[24]>>>21,L=r[24]<<11|r[25]>>>21,he=r[34]<<15|r[35]>>>17,we=r[35]<<15|r[34]>>>17,A=r[45]<<29|r[44]>>>3,T=r[44]<<29|r[45]>>>3,N=r[6]<<28|r[7]>>>4,F=r[7]<<28|r[6]>>>4,xt=r[17]<<23|r[16]>>>9,St=r[16]<<23|r[17]>>>9,k=r[26]<<25|r[27]>>>7,z=r[27]<<25|r[26]>>>7,U=r[36]<<21|r[37]>>>11,V=r[37]<<21|r[36]>>>11,hn=r[47]<<24|r[46]>>>8,at=r[46]<<24|r[47]>>>8,se=r[8]<<27|r[9]>>>5,re=r[9]<<27|r[8]>>>5,O=r[18]<<20|r[19]>>>12,y=r[19]<<20|r[18]>>>12,vi=r[29]<<7|r[28]>>>25,Tt=r[28]<<7|r[29]>>>25,ie=r[38]<<8|r[39]>>>24,M=r[39]<<8|r[38]>>>24,G=r[48]<<14|r[49]>>>18,H=r[49]<<14|r[48]>>>18,r[0]=m^~E&R,r[1]=b^~I&L,r[10]=N^~O&x,r[11]=F^~y&w,r[20]=S^~B&k,r[21]=_^~q&z,r[30]=se^~le&ue,r[31]=re^~ae&Ee,r[40]=mt^~xt&vi,r[41]=Wn^~St&Tt,r[2]=E^~R&U,r[3]=I^~L&V,r[12]=O^~x&p,r[13]=y^~w&v,r[22]=B^~k&ie,r[23]=q^~z&M,r[32]=le^~ue&he,r[33]=ae^~Ee&we,r[42]=xt^~vi&It,r[43]=St^~Tt&li,r[4]=R^~U&G,r[5]=L^~V&H,r[14]=x^~p&A,r[15]=w^~v&T,r[24]=k^~ie&te,r[25]=z^~M&oe,r[34]=ue^~he&hn,r[35]=Ee^~we&at,r[44]=vi^~It&Ct,r[45]=Tt^~li&kt,r[6]=U^~G&m,r[7]=V^~H&b,r[16]=p^~A&N,r[17]=v^~T&F,r[26]=ie^~te&S,r[27]=M^~oe&_,r[36]=he^~hn&se,r[37]=we^~at&re,r[46]=It^~Ct&mt,r[47]=li^~kt&Wn,r[8]=G^~m&E,r[9]=H^~b&I,r[18]=A^~N&O,r[19]=T^~F&y,r[28]=te^~S&B,r[29]=oe^~_&q,r[38]=hn^~se&le,r[39]=at^~re&ae,r[48]=Ct^~mt&xt,r[49]=kt^~Wn&St,r[0]^=u3e[n],r[1]^=u3e[n+1]},Hze=r=>e=>{var t;if(e.slice(0,2)==="0x"){t=[];for(var n=2,i=e.length;n<i;n+=2)t.push(parseInt(e.slice(n,n+2),16))}else t=e;return Vze(jze(r),t)},d3e=Hze(256);var Q={uint8:0,int8:1,uint16:2,int16:3,uint24:4,int24:5,uint32:6,int32:7,uint40:8,int40:9,uint48:10,int48:11,uint56:12,int56:13,uint64:14,int64:15,uint72:16,int72:17,uint80:18,int80:19,uint88:20,int88:21,uint96:22,int96:23,uint104:24,int104:25,uint112:26,int112:27,uint120:28,int120:29,uint128:30,int128:31,uint136:32,int136:33,uint144:34,int144:35,uint152:36,int152:37,uint160:38,int160:39,uint168:40,int168:41,uint176:42,int176:43,uint184:44,int184:45,uint192:46,int192:47,uint200:48,int200:49,uint208:50,int208:51,uint216:52,int216:53,uint224:54,int224:55,uint232:56,int232:57,uint240:58,int240:59,uint248:60,int248:61,uint256:62,int256:63,string:64,bool:65,bytes:66,bytes32:67,address:68,func:69},Tm=class{constructor(e){this.name=null,this._params="",this._paramTypes=[],e!=null&&(this._name=e)}addString(){return this._addParam({ty:Q.string,array:!1})}addStringArray(){return this._addParam({ty:Q.string,array:!0})}addBytes(){return this._addParam({ty:Q.bytes,array:!1})}addBytes32(){return this._addParam({ty:Q.bytes32,array:!1})}addBytesArray(){return this._addParam({ty:Q.bytes,array:!0})}addBytes32Array(){return this._addParam({ty:Q.bytes32,array:!0})}addInt8(){return this._addParam({ty:Q.int8,array:!1})}addUint8(){return this._addParam({ty:Q.uint8,array:!1})}addInt16(){return this._addParam({ty:Q.int16,array:!1})}addUint16(){return this._addParam({ty:Q.uint16,array:!1})}addInt24(){return this._addParam({ty:Q.int24,array:!1})}addUint24(){return this._addParam({ty:Q.uint24,array:!1})}addInt32(){return this._addParam({ty:Q.int32,array:!1})}addUint32(){return this._addParam({ty:Q.uint32,array:!1})}addInt40(){return this._addParam({ty:Q.int40,array:!1})}addUint40(){return this._addParam({ty:Q.uint40,array:!1})}addInt48(){return this._addParam({ty:Q.int48,array:!1})}addUint48(){return this._addParam({ty:Q.uint48,array:!1})}addInt56(){return this._addParam({ty:Q.int56,array:!1})}addUint56(){return this._addParam({ty:Q.uint56,array:!1})}addInt64(){return this._addParam({ty:Q.int64,array:!1})}addUint64(){return this._addParam({ty:Q.uint64,array:!1})}addInt72(){return this._addParam({ty:Q.int72,array:!1})}addUint72(){return this._addParam({ty:Q.uint72,array:!1})}addInt80(){return this._addParam({ty:Q.int80,array:!1})}addUint80(){return this._addParam({ty:Q.uint80,array:!1})}addInt88(){return this._addParam({ty:Q.int88,array:!1})}addUint88(){return this._addParam({ty:Q.uint88,array:!1})}addInt96(){return this._addParam({ty:Q.int96,array:!1})}addUint96(){return this._addParam({ty:Q.uint96,array:!1})}addInt104(){return this._addParam({ty:Q.int104,array:!1})}addUint104(){return this._addParam({ty:Q.uint104,array:!1})}addInt112(){return this._addParam({ty:Q.int112,array:!1})}addUint112(){return this._addParam({ty:Q.uint112,array:!1})}addInt120(){return this._addParam({ty:Q.int120,array:!1})}addUint120(){return this._addParam({ty:Q.uint120,array:!1})}addInt128(){return this._addParam({ty:Q.int128,array:!1})}addUint128(){return this._addParam({ty:Q.uint128,array:!1})}addInt136(){return this._addParam({ty:Q.int136,array:!1})}addUint136(){return this._addParam({ty:Q.uint136,array:!1})}addInt144(){return this._addParam({ty:Q.int144,array:!1})}addUint144(){return this._addParam({ty:Q.uint144,array:!1})}addInt152(){return this._addParam({ty:Q.int152,array:!1})}addUint152(){return this._addParam({ty:Q.uint152,array:!1})}addInt160(){return this._addParam({ty:Q.int160,array:!1})}addUint160(){return this._addParam({ty:Q.uint160,array:!1})}addInt168(){return this._addParam({ty:Q.int168,array:!1})}addUint168(){return this._addParam({ty:Q.uint168,array:!1})}addInt176(){return this._addParam({ty:Q.int176,array:!1})}addUint176(){return this._addParam({ty:Q.uint176,array:!1})}addInt184(){return this._addParam({ty:Q.int184,array:!1})}addUint184(){return this._addParam({ty:Q.uint184,array:!1})}addInt192(){return this._addParam({ty:Q.int192,array:!1})}addUint192(){return this._addParam({ty:Q.uint192,array:!1})}addInt200(){return this._addParam({ty:Q.int200,array:!1})}addUint200(){return this._addParam({ty:Q.uint200,array:!1})}addInt208(){return this._addParam({ty:Q.int208,array:!1})}addUint208(){return this._addParam({ty:Q.uint208,array:!1})}addInt216(){return this._addParam({ty:Q.int216,array:!1})}addUint216(){return this._addParam({ty:Q.uint216,array:!1})}addInt224(){return this._addParam({ty:Q.int224,array:!1})}addUint224(){return this._addParam({ty:Q.uint224,array:!1})}addInt232(){return this._addParam({ty:Q.int232,array:!1})}addUint232(){return this._addParam({ty:Q.uint232,array:!1})}addInt240(){return this._addParam({ty:Q.int240,array:!1})}addUint240(){return this._addParam({ty:Q.uint240,array:!1})}addInt248(){return this._addParam({ty:Q.int248,array:!1})}addUint248(){return this._addParam({ty:Q.uint248,array:!1})}addInt256(){return this._addParam({ty:Q.int256,array:!1})}addUint256(){return this._addParam({ty:Q.uint256,array:!1})}addInt8Array(){return this._addParam({ty:Q.int8,array:!0})}addUint8Array(){return this._addParam({ty:Q.uint8,array:!0})}addInt16Array(){return this._addParam({ty:Q.int16,array:!0})}addUint16Array(){return this._addParam({ty:Q.uint16,array:!0})}addInt24Array(){return this._addParam({ty:Q.int24,array:!0})}addUint24Array(){return this._addParam({ty:Q.uint24,array:!0})}addInt32Array(){return this._addParam({ty:Q.int32,array:!0})}addUint32Array(){return this._addParam({ty:Q.uint32,array:!0})}addInt40Array(){return this._addParam({ty:Q.int40,array:!0})}addUint40Array(){return this._addParam({ty:Q.uint40,array:!0})}addInt48Array(){return this._addParam({ty:Q.int48,array:!0})}addUint48Array(){return this._addParam({ty:Q.uint48,array:!0})}addInt56Array(){return this._addParam({ty:Q.int56,array:!0})}addUint56Array(){return this._addParam({ty:Q.uint56,array:!0})}addInt64Array(){return this._addParam({ty:Q.int64,array:!0})}addUint64Array(){return this._addParam({ty:Q.uint64,array:!0})}addInt72Array(){return this._addParam({ty:Q.int72,array:!0})}addUint72Array(){return this._addParam({ty:Q.uint72,array:!0})}addInt80Array(){return this._addParam({ty:Q.int80,array:!0})}addUint80Array(){return this._addParam({ty:Q.uint80,array:!0})}addInt88Array(){return this._addParam({ty:Q.int88,array:!0})}addUint88Array(){return this._addParam({ty:Q.uint88,array:!0})}addInt96Array(){return this._addParam({ty:Q.int96,array:!0})}addUint96Array(){return this._addParam({ty:Q.uint96,array:!0})}addInt104Array(){return this._addParam({ty:Q.int104,array:!0})}addUint104Array(){return this._addParam({ty:Q.uint104,array:!0})}addInt112Array(){return this._addParam({ty:Q.int112,array:!0})}addUint112Array(){return this._addParam({ty:Q.uint112,array:!0})}addInt120Array(){return this._addParam({ty:Q.int120,array:!0})}addUint120Array(){return this._addParam({ty:Q.uint120,array:!0})}addInt128Array(){return this._addParam({ty:Q.int128,array:!0})}addUint128Array(){return this._addParam({ty:Q.uint128,array:!0})}addInt136Array(){return this._addParam({ty:Q.int136,array:!0})}addUint136Array(){return this._addParam({ty:Q.uint136,array:!0})}addInt144Array(){return this._addParam({ty:Q.int144,array:!0})}addUint144Array(){return this._addParam({ty:Q.uint144,array:!0})}addInt152Array(){return this._addParam({ty:Q.int152,array:!0})}addUint152Array(){return this._addParam({ty:Q.uint152,array:!0})}addInt160Array(){return this._addParam({ty:Q.int160,array:!0})}addUint160Array(){return this._addParam({ty:Q.uint160,array:!0})}addInt168Array(){return this._addParam({ty:Q.int168,array:!0})}addUint168Array(){return this._addParam({ty:Q.uint168,array:!0})}addInt176Array(){return this._addParam({ty:Q.int176,array:!0})}addUint176Array(){return this._addParam({ty:Q.uint176,array:!0})}addInt184Array(){return this._addParam({ty:Q.int184,array:!0})}addUint184Array(){return this._addParam({ty:Q.uint184,array:!0})}addInt192Array(){return this._addParam({ty:Q.int192,array:!0})}addUint192Array(){return this._addParam({ty:Q.uint192,array:!0})}addInt200Array(){return this._addParam({ty:Q.int200,array:!0})}addUint200Array(){return this._addParam({ty:Q.uint200,array:!0})}addInt208Array(){return this._addParam({ty:Q.int208,array:!0})}addUint208Array(){return this._addParam({ty:Q.uint208,array:!0})}addInt216Array(){return this._addParam({ty:Q.int216,array:!0})}addUint216Array(){return this._addParam({ty:Q.uint216,array:!0})}addInt224Array(){return this._addParam({ty:Q.int224,array:!0})}addUint224Array(){return this._addParam({ty:Q.uint224,array:!0})}addInt232Array(){return this._addParam({ty:Q.int232,array:!0})}addUint232Array(){return this._addParam({ty:Q.uint232,array:!0})}addInt240Array(){return this._addParam({ty:Q.int240,array:!0})}addUint240Array(){return this._addParam({ty:Q.uint240,array:!0})}addInt248Array(){return this._addParam({ty:Q.int248,array:!0})}addUint248Array(){return this._addParam({ty:Q.uint248,array:!0})}addInt256Array(){return this._addParam({ty:Q.int256,array:!0})}addUint256Array(){return this._addParam({ty:Q.uint256,array:!0})}addBool(){return this._addParam({ty:Q.bool,array:!1})}addAddress(){return this._addParam({ty:Q.address,array:!1})}addAddressArray(){return this._addParam({ty:Q.address,array:!0})}addFunction(){return this._addParam({ty:Q.func,array:!1})}_addParam(e){return this._paramTypes.length>0&&(this._params+=","),this._params+=BB(e),this._paramTypes.push(e),this}_build(e){if(e!=null)this._name=e;else if(this._name==null)throw new Error("`name` required for ContractFunctionSelector");let t=Ke(i3(this.toString()));return tt(d3e(`0x${t}`)).slice(0,4)}toString(){return`${this._name!=null?this._name.toString():""}(${this._params})`}};function BB(r){let e="";switch(r.ty){case Q.uint8:e="uint8";break;case Q.int8:e="int8";break;case Q.uint16:e="uint16";break;case Q.int16:e="int16";break;case Q.uint24:e="uint24";break;case Q.int24:e="int24";break;case Q.uint32:e="uint32";break;case Q.int32:e="int32";break;case Q.uint40:e="uint40";break;case Q.int40:e="int40";break;case Q.uint48:e="uint48";break;case Q.int48:e="int48";break;case Q.uint56:e="uint56";break;case Q.int56:e="int56";break;case Q.uint64:e="uint64";break;case Q.int64:e="int64";break;case Q.uint72:e="uint72";break;case Q.int72:e="int72";break;case Q.uint80:e="uint80";break;case Q.int80:e="int80";break;case Q.uint88:e="uint88";break;case Q.int88:e="int88";break;case Q.uint96:e="uint96";break;case Q.int96:e="int96";break;case Q.uint104:e="uint104";break;case Q.int104:e="int104";break;case Q.uint112:e="uint112";break;case Q.int112:e="int112";break;case Q.uint120:e="uint120";break;case Q.int120:e="int120";break;case Q.uint128:e="uint128";break;case Q.int128:e="int128";break;case Q.uint136:e="uint136";break;case Q.int136:e="int136";break;case Q.uint144:e="uint144";break;case Q.int144:e="int144";break;case Q.uint152:e="uint152";break;case Q.int152:e="int152";break;case Q.uint160:e="uint160";break;case Q.int160:e="int160";break;case Q.uint168:e="uint168";break;case Q.int168:e="int168";break;case Q.uint176:e="uint176";break;case Q.int176:e="int176";break;case Q.uint184:e="uint184";break;case Q.int184:e="int184";break;case Q.uint192:e="uint192";break;case Q.int192:e="int192";break;case Q.uint200:e="uint200";break;case Q.int200:e="int200";break;case Q.uint208:e="uint208";break;case Q.int208:e="int208";break;case Q.uint216:e="uint216";break;case Q.int216:e="int216";break;case Q.uint224:e="uint224";break;case Q.int224:e="int224";break;case Q.uint232:e="uint232";break;case Q.int232:e="int232";break;case Q.uint240:e="uint240";break;case Q.int240:e="int240";break;case Q.uint248:e="uint248";break;case Q.int248:e="int248";break;case Q.uint256:e="uint256";break;case Q.int256:e="int256";break;case Q.string:e="string";break;case Q.bool:e="bool";break;case Q.bytes:e="bytes";break;case Q.bytes32:e="bytes32";break;case Q.address:e="address";break;case Q.func:e="function";break;default:e="";break}return r.array&&(e+="[]"),e}var f3e=Oe(_B(),1),p3e=Oe(na(),1);var xu=class{constructor(){this._selector=new Tm,this._arguments=[]}addString(e){return this._selector.addString(),this._addParam(e,!0)}addStringArray(e){return this._selector.addStringArray(),this._addParam(e,!0)}addBytes(e){return this._selector.addBytes(),this._addParam(e,!0)}addBytes32(e){if(e.length!==32)throw new Error(`addBytes32 expected array to be of length 32, but received ${e.length}`);return this._selector.addBytes32(),this._addParam(e,!1)}addBytesArray(e){return this._selector.addBytesArray(),this._addParam(e,!0)}addBytes32Array(e){for(let[t,n]of e.entries())if(n.length!==32)throw new Error(`addBytes32 expected array to be of length 32, but received ${n.length}`);return this._selector.addBytes32Array(),this._addParam(e,!0)}addBool(e){return this._selector.addBool(),this._addParam(e,!1)}addInt8(e){return this._selector.addInt8(),this._addParam(vt(e),!1)}addUint8(e){return this._selector.addUint8(),this._addParam(vt(e),!1)}addInt16(e){return this._selector.addInt16(),this._addParam(vt(e),!1)}addUint16(e){return this._selector.addUint16(),this._addParam(vt(e),!1)}addInt24(e){return this._selector.addInt24(),this._addParam(vt(e),!1)}addUint24(e){return this._selector.addUint24(),this._addParam(vt(e),!1)}addInt32(e){return this._selector.addInt32(),this._addParam(vt(e),!1)}addUint32(e){return this._selector.addUint32(),this._addParam(vt(e),!1)}addInt40(e){return this._selector.addInt40(),this._addParam(vt(e),!1)}addUint40(e){return this._selector.addUint40(),this._addParam(vt(e),!1)}addInt48(e){return this._selector.addInt48(),this._addParam(vt(e),!1)}addUint48(e){return this._selector.addUint48(),this._addParam(vt(e),!1)}addInt56(e){return this._selector.addInt56(),this._addParam(vt(e),!1)}addUint56(e){return this._selector.addUint56(),this._addParam(vt(e),!1)}addInt64(e){return this._selector.addInt64(),this._addParam(vt(e),!1)}addUint64(e){return this._selector.addUint64(),this._addParam(vt(e),!1)}addInt72(e){return this._selector.addInt72(),this._addParam(vt(e),!1)}addUint72(e){return this._selector.addUint72(),this._addParam(vt(e),!1)}addInt80(e){return this._selector.addInt80(),this._addParam(vt(e),!1)}addUint80(e){return this._selector.addUint80(),this._addParam(vt(e),!1)}addInt88(e){return this._selector.addInt88(),this._addParam(vt(e),!1)}addUint88(e){return this._selector.addUint88(),this._addParam(vt(e),!1)}addInt96(e){return this._selector.addInt96(),this._addParam(vt(e),!1)}addUint96(e){return this._selector.addUint96(),this._addParam(vt(e),!1)}addInt104(e){return this._selector.addInt104(),this._addParam(vt(e),!1)}addUint104(e){return this._selector.addUint104(),this._addParam(vt(e),!1)}addInt112(e){return this._selector.addInt112(),this._addParam(vt(e),!1)}addUint112(e){return this._selector.addUint112(),this._addParam(vt(e),!1)}addInt120(e){return this._selector.addInt120(),this._addParam(vt(e),!1)}addUint120(e){return this._selector.addUint120(),this._addParam(vt(e),!1)}addInt128(e){return this._selector.addInt128(),this._addParam(vt(e),!1)}addUint128(e){return this._selector.addUint128(),this._addParam(vt(e),!1)}addInt136(e){return this._selector.addInt136(),this._addParam(vt(e),!1)}addUint136(e){return this._selector.addUint136(),this._addParam(vt(e),!1)}addInt144(e){return this._selector.addInt144(),this._addParam(vt(e),!1)}addUint144(e){return this._selector.addUint144(),this._addParam(vt(e),!1)}addInt152(e){return this._selector.addInt152(),this._addParam(vt(e),!1)}addUint152(e){return this._selector.addUint152(),this._addParam(vt(e),!1)}addInt160(e){return this._selector.addInt160(),this._addParam(vt(e),!1)}addUint160(e){return this._selector.addUint160(),this._addParam(vt(e),!1)}addInt168(e){return this._selector.addInt168(),this._addParam(vt(e),!1)}addUint168(e){return this._selector.addUint168(),this._addParam(vt(e),!1)}addInt176(e){return this._selector.addInt176(),this._addParam(vt(e),!1)}addUint176(e){return this._selector.addUint176(),this._addParam(vt(e),!1)}addInt184(e){return this._selector.addInt184(),this._addParam(vt(e),!1)}addUint184(e){return this._selector.addUint184(),this._addParam(vt(e),!1)}addInt192(e){return this._selector.addInt192(),this._addParam(vt(e),!1)}addUint192(e){return this._selector.addUint192(),this._addParam(vt(e),!1)}addInt200(e){return this._selector.addInt200(),this._addParam(vt(e),!1)}addUint200(e){return this._selector.addUint200(),this._addParam(vt(e),!1)}addInt208(e){return this._selector.addInt208(),this._addParam(vt(e),!1)}addUint208(e){return this._selector.addUint208(),this._addParam(vt(e),!1)}addInt216(e){return this._selector.addInt216(),this._addParam(vt(e),!1)}addUint216(e){return this._selector.addUint216(),this._addParam(vt(e),!1)}addInt224(e){return this._selector.addInt224(),this._addParam(vt(e),!1)}addUint224(e){return this._selector.addUint224(),this._addParam(vt(e),!1)}addInt232(e){return this._selector.addInt232(),this._addParam(vt(e),!1)}addUint232(e){return this._selector.addUint232(),this._addParam(vt(e),!1)}addInt240(e){return this._selector.addInt240(),this._addParam(vt(e),!1)}addUint240(e){return this._selector.addUint240(),this._addParam(vt(e),!1)}addInt248(e){return this._selector.addInt248(),this._addParam(vt(e),!1)}addUint248(e){return this._selector.addUint248(),this._addParam(vt(e),!1)}addInt256(e){return this._selector.addInt256(),this._addParam(vt(e),!1)}addUint256(e){return this._selector.addUint256(),this._addParam(vt(e),!1)}addInt8Array(e){return this._selector.addInt8Array(),this._addParam(wt(e),!0)}addUint8Array(e){return this._selector.addUint8Array(),this._addParam(wt(e),!0)}addInt16Array(e){return this._selector.addInt16Array(),this._addParam(wt(e),!0)}addUint16Array(e){return this._selector.addUint16Array(),this._addParam(wt(e),!0)}addInt24Array(e){return this._selector.addInt24Array(),this._addParam(wt(e),!0)}addUint24Array(e){return this._selector.addUint24Array(),this._addParam(wt(e),!0)}addInt32Array(e){return this._selector.addInt32Array(),this._addParam(wt(e),!0)}addUint32Array(e){return this._selector.addUint32Array(),this._addParam(wt(e),!0)}addInt40Array(e){return this._selector.addInt40Array(),this._addParam(wt(e),!0)}addUint40Array(e){return this._selector.addUint40Array(),this._addParam(wt(e),!0)}addInt48Array(e){return this._selector.addInt48Array(),this._addParam(wt(e),!0)}addUint48Array(e){return this._selector.addUint48Array(),this._addParam(wt(e),!0)}addInt56Array(e){return this._selector.addInt56Array(),this._addParam(wt(e),!0)}addUint56Array(e){return this._selector.addUint56Array(),this._addParam(wt(e),!0)}addInt64Array(e){return this._selector.addInt64Array(),this._addParam(wt(e),!0)}addUint64Array(e){return this._selector.addUint64Array(),this._addParam(wt(e),!0)}addInt72Array(e){return this._selector.addInt72Array(),this._addParam(wt(e),!0)}addUint72Array(e){return this._selector.addUint72Array(),this._addParam(wt(e),!0)}addInt80Array(e){return this._selector.addInt80Array(),this._addParam(wt(e),!0)}addUint80Array(e){return this._selector.addUint80Array(),this._addParam(wt(e),!0)}addInt88Array(e){return this._selector.addInt88Array(),this._addParam(wt(e),!0)}addUint88Array(e){return this._selector.addUint88Array(),this._addParam(wt(e),!0)}addInt96Array(e){return this._selector.addInt96Array(),this._addParam(wt(e),!0)}addUint96Array(e){return this._selector.addUint96Array(),this._addParam(wt(e),!0)}addInt104Array(e){return this._selector.addInt104Array(),this._addParam(wt(e),!0)}addUint104Array(e){return this._selector.addUint104Array(),this._addParam(wt(e),!0)}addInt112Array(e){return this._selector.addInt112Array(),this._addParam(wt(e),!0)}addUint112Array(e){return this._selector.addUint112Array(),this._addParam(wt(e),!0)}addInt120Array(e){return this._selector.addInt120Array(),this._addParam(wt(e),!0)}addUint120Array(e){return this._selector.addUint120Array(),this._addParam(wt(e),!0)}addInt128Array(e){return this._selector.addInt128Array(),this._addParam(wt(e),!0)}addUint128Array(e){return this._selector.addUint128Array(),this._addParam(wt(e),!0)}addInt136Array(e){return this._selector.addInt136Array(),this._addParam(wt(e),!0)}addUint136Array(e){return this._selector.addUint136Array(),this._addParam(wt(e),!0)}addInt144Array(e){return this._selector.addInt144Array(),this._addParam(wt(e),!0)}addUint144Array(e){return this._selector.addUint144Array(),this._addParam(wt(e),!0)}addInt152Array(e){return this._selector.addInt152Array(),this._addParam(wt(e),!0)}addUint152Array(e){return this._selector.addUint152Array(),this._addParam(wt(e),!0)}addInt160Array(e){return this._selector.addInt160Array(),this._addParam(wt(e),!0)}addUint160Array(e){return this._selector.addUint160Array(),this._addParam(wt(e),!0)}addInt168Array(e){return this._selector.addInt168Array(),this._addParam(wt(e),!0)}addUint168Array(e){return this._selector.addUint168Array(),this._addParam(wt(e),!0)}addInt176Array(e){return this._selector.addInt176Array(),this._addParam(wt(e),!0)}addUint176Array(e){return this._selector.addUint176Array(),this._addParam(wt(e),!0)}addInt184Array(e){return this._selector.addInt184Array(),this._addParam(wt(e),!0)}addUint184Array(e){return this._selector.addUint184Array(),this._addParam(wt(e),!0)}addInt192Array(e){return this._selector.addInt192Array(),this._addParam(wt(e),!0)}addUint192Array(e){return this._selector.addUint192Array(),this._addParam(wt(e),!0)}addInt200Array(e){return this._selector.addInt200Array(),this._addParam(wt(e),!0)}addUint200Array(e){return this._selector.addUint200Array(),this._addParam(wt(e),!0)}addInt208Array(e){return this._selector.addInt208Array(),this._addParam(wt(e),!0)}addUint208Array(e){return this._selector.addUint208Array(),this._addParam(wt(e),!0)}addInt216Array(e){return this._selector.addInt216Array(),this._addParam(wt(e),!0)}addUint216Array(e){return this._selector.addUint216Array(),this._addParam(wt(e),!0)}addInt224Array(e){return this._selector.addInt224Array(),this._addParam(wt(e),!0)}addUint224Array(e){return this._selector.addUint224Array(),this._addParam(wt(e),!0)}addInt232Array(e){return this._selector.addInt232Array(),this._addParam(wt(e),!0)}addUint232Array(e){return this._selector.addUint232Array(),this._addParam(wt(e),!0)}addInt240Array(e){return this._selector.addInt240Array(),this._addParam(wt(e),!0)}addUint240Array(e){return this._selector.addUint240Array(),this._addParam(wt(e),!0)}addInt248Array(e){return this._selector.addInt248Array(),this._addParam(wt(e),!0)}addUint248Array(e){return this._selector.addUint248Array(),this._addParam(wt(e),!0)}addInt256Array(e){return this._selector.addInt256Array(),this._addParam(wt(e),!0)}addUint256Array(e){return this._selector.addUint256Array(),this._addParam(wt(e),!0)}addAddress(e){let t;if(typeof e=="string"){if(e.length!==40&&e.length!==42)throw new Error("`address` type requires parameter to be 40 or 42 characters");t=e}else t=e.toString();let n=t.length===40?tt(t):tt(t.substring(2));return this._selector.addAddress(),this._addParam(n,!1)}addAddressArray(e){let t=[];for(let[n,i]of e.entries()){let a;if(typeof i=="string"){if(i.length!==40&&i.length!==42)throw new Error("`address` type requires parameter to be 40 or 42 characters");a=i}else a=i.toString();let o=a.length===40?tt(a):tt(a.substring(2));t.push(o)}return this._selector.addAddressArray(),this._addParam(t,!0)}addFunction(e,t){let n=tt(e),i=t._build();if(n.length!==20)throw new Error("`function` type requires parameter `address` to be exactly 20 bytes");this._selector.addFunction();let a=new Uint8Array(24);return a.set(n,0),a.set(i,20),this._addParam(a,!1)}_addParam(e,t){let n=this._selector._paramTypes.length-1,i=h3e(e,this._selector._paramTypes[n]);return this._arguments.push({dynamic:t,value:i}),this}_build(e){let t=e!=null,n=t?4:0,i=this._arguments.length===0?n:this._arguments.length*32+this._arguments.map(s=>s.dynamic?s.value.length:0).reduce((s,c)=>s+c)+n,a=new Uint8Array(i);t&&a.set(this._selector._build(e),0);let o=32*this._arguments.length;for(let[s,{dynamic:c,value:l}]of this._arguments.entries())if(c){let u=uo(a,n+s*32+28);u.setUint32(0,o),a.set(l,u.getUint32(0)+n),o+=l.length}else a.set(l,n+s*32);return a}};function h3e(r,e){let t=new Uint8Array(32),n=uo(t),i;if(e.array){if(!Array.isArray(r))throw new TypeError("SolidityType indicates type is array, but parameter is not an array");let a=[];for(let[c,l]of r.entries()){let u=h3e(l,{ty:e.ty,array:!1});a.push(u)}let o=a.map(c=>c.length).reduce((c,l)=>c+l,0);switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.uint256:case Q.int256:case Q.bool:case Q.bytes32:case Q.address:case Q.func:t=new Uint8Array(o+32);break;case Q.bytes:case Q.string:t=new Uint8Array(a.length*32+o+32);break;default:throw new TypeError(`Expected param type to be ArgumentType, but received ${e.ty}`)}n=uo(t,28),n.setUint32(0,a.length);let s=32*a.length;for(let[c,l]of a.entries())switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.uint256:case Q.int256:case Q.bool:case Q.bytes32:case Q.address:case Q.func:t.set(l,c*32+32);break;case Q.bytes:case Q.string:let u=uo(t,(c+1)*32+28);u.setUint32(0,s),t.set(l,u.getUint32(0)+32),s+=l.length;break;default:throw new TypeError(`Expected param type to be ArgumentType, but received ${e.ty}`)}return t}switch(e.ty){case Q.uint8:case Q.int8:case Q.uint16:case Q.int16:case Q.uint24:case Q.int24:case Q.uint32:case Q.int32:case Q.uint40:case Q.int40:case Q.uint48:case Q.int48:case Q.uint56:case Q.int56:case Q.uint64:case Q.int64:case Q.uint72:case Q.int72:case Q.uint80:case Q.int80:case Q.uint88:case Q.int88:case Q.uint96:case Q.int96:case Q.uint104:case Q.int104:case Q.uint112:case Q.int112:case Q.uint120:case Q.int120:case Q.uint128:case Q.int128:case Q.uint136:case Q.int136:case Q.uint144:case Q.int144:case Q.uint152:case Q.int152:case Q.uint160:case Q.int160:case Q.uint168:case Q.int168:case Q.uint176:case Q.int176:case Q.uint184:case Q.int184:case Q.uint192:case Q.int192:case Q.uint200:case Q.int200:case Q.uint208:case Q.int208:case Q.uint216:case Q.int216:case Q.uint224:case Q.int224:case Q.uint232:case Q.int232:case Q.uint240:case Q.int240:case Q.uint248:case Q.int248:case Q.int256:case Q.uint256:{let a=r.toString(16);r>0||r==0?a="0x"+a:a=a.slice(0,1)+"0x"+a.slice(1);let o=f3e.defaultAbiCoder.encode([BB(e)],[a]);return(0,p3e.arrayify)(o)}case Q.address:return t.set(r,12),t;case Q.bool:return t[31]=r?1:0,t;case Q.func:return t.set(r,8),t;case Q.bytes32:return t.set(r,0),t;case Q.bytes:case Q.string:return i=r instanceof Uint8Array?r:i3(r),Math.floor(i.length/32)>=0?Math.floor(i.length%32)!==0?t=new Uint8Array((Math.floor(i.length/32)+1)*32+32):t=new Uint8Array(Math.floor(i.length/32)*32+32):t=new Uint8Array(64),t.set(i,32),n=uo(t,28),n.setUint32(0,i.length),t;default:throw new Error(`Unsupported argument type: ${e.toString()}`)}}var Y8=Oe(Jt(),1),m3e=Oe(br(),1);var J8=class r extends Ar{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId),this._gas=null,e.gas!=null&&this.setGas(e.gas),this._functionParameters=null,e.functionParameters!=null&&(e.functionParameters instanceof Uint8Array?this.setFunctionParameters(e.functionParameters):this.setFunction(e.functionParameters.name,e.functionParameters.parameters)),this._maxResultSize=null,e.maxResultSize!=null&&this.setMaxResultSize(e.maxResultSize),this._senderAccountId=null,e.senderAccountId!=null&&this.setSenderAccountId(e.senderAccountId)}static _fromProtobuf(e){let t=e.contractCallLocal;return new r({contractId:t.contractID!=null?Et._fromProtobuf(t.contractID):void 0,gas:t.gas!=null?t.gas:void 0,functionParameters:t.functionParameters!=null?t.functionParameters:void 0,maxResultSize:t.maxResultSize!=null?t.maxResultSize:void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}get gas(){return this._gas}setGas(e){return this._gas=e instanceof Y8.default?e:Y8.default.fromValue(e),this}get senderAccountId(){return this._senderAccountId}setSenderAccountId(e){return this._senderAccountId=typeof e=="string"?ne.fromString(e):e,this}get functionParameters(){return this._functionParameters}setFunctionParameters(e){return this._functionParameters=e,this}setFunction(e,t){return this._functionParameters=(t??new xu)._build(e),this}setMaxResultSize(e){return this._maxResultSize=e instanceof Y8.default?e:Y8.default.fromValue(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_mapStatusError(e,t){let{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t),i=P._fromCode(n??m3e.proto.ResponseCodeEnum.OK);if(!t.contractCallLocal.functionResult)return new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:null});let o=this._mapResponseSync(t);return new is({status:i,transactionId:this._getTransactionId(),contractFunctionResult:o})}_execute(e,t){return e.smartContract.contractCallLocalMethod(t)}_mapResponseHeader(e){return e.contractCallLocal.header}_mapResponse(e){let t=e.contractCallLocal;return Promise.resolve(bu._fromProtobuf(t.functionResult,!1))}_mapResponseSync(e){let t=e.contractCallLocal;return bu._fromProtobuf(t.functionResult,!1)}_onMakeRequest(e){return{contractCallLocal:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null,gas:this._gas,maxResultSize:this._maxResultSize,functionParameters:this._functionParameters,senderId:this._senderAccountId!=null?this._senderAccountId._toProtobuf():null}}}_getLogId(){return`ContractCallQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("contractCallLocal",J8._fromProtobuf);var g3e=Oe(Jt(),1),f1=class r extends ke{constructor(e={}){super(),this._keys=null,this._expirationTime=new ut(0,0).plusNanos(g3e.default.fromNumber(Date.now()).mul(1e6).add(_u.mul(1e9))),this._contents=null,this._fileMemo=null,this._defaultMaxTransactionFee=new Ge(5),e.keys!=null&&this.setKeys(e.keys),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.contents!=null&&this.setContents(e.contents),e.fileMemo!=null&&this.setFileMemo(e.fileMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileCreate;return ke._fromProtobufTransactions(new r({keys:s.keys!=null&&s.keys.keys!=null?s.keys.keys.map(c=>nt._fromProtobufKey(c)):void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0,contents:s.contents!=null?s.contents:void 0,fileMemo:s.memo!=null?s.memo:void 0}),e,t,n,i,a)}get keys(){return this._keys}setKeys(e){if(this._requireNotFrozen(),e instanceof Oi&&e.threshold!=null)throw new Error("Cannot set threshold key as file key");return this._keys=e instanceof Oi?e.toArray():e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof ut?e:ut.fromDate(e),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:i3(e),this}get fileMemo(){return this._fileMemo}setFileMemo(e){return this._requireNotFrozen(),this._fileMemo=e,this}_execute(e,t){return e.file.createFile(t)}_getTransactionDataCase(){return"fileCreate"}_makeTransactionData(){return{keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:null,expirationTime:this._expirationTime._toProtobuf(),contents:this._contents,memo:this._fileMemo}}_getLogId(){return`FileCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("fileCreate",f1._fromProtobuf);var p1=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contents=null,this._maxChunks=20,this._chunkSize=4096,this._defaultMaxTransactionFee=new Ge(5),e.fileId!=null&&this.setFileId(e.fileId),e.contents!=null&&this.setContents(e.contents),e.maxChunks!=null&&this.setMaxChunks(e.maxChunks),e.chunkSize!=null&&this.setChunkSize(e.chunkSize),this._transactionIds=new nl}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileAppend,c;for(let l=0;l<a.length;l+=i.length){let u=a[l].fileAppend;if(u.contents==null)break;if(c==null){c=new Uint8Array(u.contents);continue}let d=new Uint8Array(c.length+u.contents.length);d.set(c,0),d.set(u.contents,c.length),c=d}return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,contents:c}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:i3(e),this}get maxChunks(){return this._maxChunks}setMaxChunks(e){return this._requireNotFrozen(),this._maxChunks=e,this}get chunkSize(){return this._chunkSize}setChunkSize(e){return this._chunkSize=e,this}freezeWith(e){if(super.freezeWith(e),this._contents==null)return this;let t=Math.floor((this._contents.length+(this._chunkSize-1))/this._chunkSize);if(t>this._maxChunks)throw new Error(`Contents with size ${this._contents.length} too long for ${this._maxChunks} chunks`);let n=this._getTransactionId();this._transactionIds.locked=!1,this._transactions.clear(),this._transactionIds.clear(),this._signedTransactions.clear();for(let i=0;i<t;i++){this._transactionIds.push(n),this._transactionIds.advance();for(let a of this._nodeAccountIds.list)this._signedTransactions.push(this._makeSignedTransaction(a));n=new Qr(n.accountId,new ut(n.validStart.seconds,n.validStart.nanos.add(1)))}return this._transactionIds.advance(),this._transactionIds.setLocked(),this}schedule(){if(this._requireNotFrozen(),this._contents!=null&&this._contents.length>this._chunkSize)throw new Error(`cannot schedule \`FileAppendTransaction\` with message over ${this._chunkSize} bytes`);return super.schedule()}async execute(e,t){return(await this.executeAll(e,t))[0]}async executeAll(e,t){super._isFrozen()||this.freezeWith(e);let n=this._getTransactionId(),i=e.operatorAccountId;i!=null&&i.equals(n.accountId)&&await super.signWithOperator(e);let a=[],o=t;for(let s=0;s<this._transactionIds.length;s++){let c=Date.now(),l=await super.execute(e,o);o!=null&&(o=Date.now()-c),await l.getReceipt(e),a.push(l)}return a}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.appendContent(t)}_getTransactionDataCase(){return"fileAppend"}_makeTransactionData(){let e=this._contents!=null?this._contents.length:0,t=this._transactionIds.index*this._chunkSize,n=Math.min(t+this._chunkSize,e);return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contents:this._contents!=null?this._contents.slice(t,n):null}}_getLogId(){return`FileAppendTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("fileAppend",p1._fromProtobuf);var Sm=class r extends ke{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileDelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.deleteFile(t)}_getTransactionDataCase(){return"fileDelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null}}_getLogId(){return`FileDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("fileDelete",Sm._fromProtobuf);var Rx=Oe(Jt(),1);var Im=class r extends ke{constructor(e={}){super(),this._bytecodeFileId=null,this._bytecode=null,this._adminKey=null,this._gas=null,this._initialBalance=null,this._proxyAccountId=null,this._autoRenewPeriod=new pr(_u),this._constructorParameters=null,this._contractMemo=null,this._maxAutomaticTokenAssociations=null,this._defaultMaxTransactionFee=new Ge(20),this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=!1,this._autoRenewAccountId=null,e.bytecodeFileId!=null&&this.setBytecodeFileId(e.bytecodeFileId),e.bytecode!=null&&this.setBytecode(e.bytecode),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.gas!=null&&this.setGas(e.gas),e.initialBalance!=null&&this.setInitialBalance(e.initialBalance),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.constructorParameters!=null&&this.setConstructorParameters(e.constructorParameters),e.contractMemo!=null&&this.setContractMemo(e.contractMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractCreateInstance;return ke._fromProtobufTransactions(new r({bytecodeFileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,gas:s.gas!=null?s.gas:void 0,initialBalance:s.initialBalance!=null?s.initialBalance:void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,constructorParameters:s.constructorParameters!=null?s.constructorParameters:void 0,contractMemo:s.memo!=null?s.memo:void 0,maxAutomaticTokenAssociations:s.maxAutomaticTokenAssociations!=null?s.maxAutomaticTokenAssociations:void 0,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward==!0,autoRenewAccountId:s.autoRenewAccountId!=null?ne._fromProtobuf(s.autoRenewAccountId):void 0}),e,t,n,i,a)}get bytecodeFileId(){return this._bytecodeFileId}setBytecodeFileId(e){return this._requireNotFrozen(),this._bytecodeFileId=typeof e=="string"?Gt.fromString(e):e.clone(),this._bytecode=null,this}get bytecode(){return this._bytecode}setBytecode(e){return this._requireNotFrozen(),this._bytecode=e,this._bytecodeFileId=null,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get gas(){return this._gas}setGas(e){return this._requireNotFrozen(),this._gas=e instanceof Rx.default?e:Rx.default.fromValue(e),this}get initialBalance(){return this._initialBalance}setInitialBalance(e){return this._requireNotFrozen(),this._initialBalance=e instanceof Ge?e:new Ge(e),this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get constructorParameters(){return this._constructorParameters}setConstructorParameters(e){return this._requireNotFrozen(),this._constructorParameters=e instanceof xu?e._build():e,this}get contractMemo(){return this._contractMemo}setContractMemo(e){return this._requireNotFrozen(),this._contractMemo=e,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._maxAutomaticTokenAssociations=e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=Rx.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=typeof e=="string"?ne.fromString(e):e,this}_validateChecksums(e){this._bytecodeFileId!=null&&this._bytecodeFileId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.smartContract.createContract(t)}_getTransactionDataCase(){return"contractCreateInstance"}_makeTransactionData(){return{fileID:this._bytecodeFileId!=null?this._bytecodeFileId._toProtobuf():null,initcode:this._bytecode,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,gas:this._gas,initialBalance:this._initialBalance!=null?this._initialBalance.toTinybars():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),constructorParameters:this._constructorParameters,memo:this._contractMemo,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards,autoRenewAccountId:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null}}_getLogId(){return`ContractCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("contractCreateInstance",Im._fromProtobuf);var Z8=class r extends ke{constructor(e={}){super(),this._contractId=null,this._transferAccountId=null,this._transferContractId=null,e.contractId!=null&&this.setContractId(e.contractId),e.transferAccountId!=null&&this.setTransferAccountId(e.transferAccountId),e.transferContractId!=null&&this.setTransferContractId(e.transferContractId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractDeleteInstance;return ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?Et._fromProtobuf(s.contractID):void 0,transferAccountId:s.transferAccountID!=null?ne._fromProtobuf(s.transferAccountID):void 0,transferContractId:s.transferContractID!=null?Et._fromProtobuf(s.transferContractID):void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}get transferContractId(){return this._transferContractId}setTransferContractId(e){return this._requireNotFrozen(),this._transferContractId=e instanceof Et?e:Et.fromString(e),this}get transferAccountId(){return this._transferAccountId}setTransferAccountId(e){return this._requireNotFrozen(),this._transferAccountId=e instanceof ne?e:ne.fromString(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e),this._transferAccountId!=null&&this._transferAccountId.validateChecksum(e),this._transferContractId!=null&&this._transferContractId.validateChecksum(e)}_execute(e,t){return e.smartContract.deleteContract(t)}_getTransactionDataCase(){return"contractDeleteInstance"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,transferAccountID:this._transferAccountId?this._transferAccountId._toProtobuf():null,transferContractID:this._transferContractId!=null?this._transferContractId._toProtobuf():null}}_getLogId(){return`ContractDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("contractDeleteInstance",Z8._fromProtobuf);var MB=Oe(Jt(),1),X8=class r extends ke{constructor(e={}){super(),this._contractId=null,this._gas=null,this._amount=null,this._functionParameters=null,e.contractId!=null&&this.setContractId(e.contractId),e.gas!=null&&this.setGas(e.gas),e.amount!=null&&this.setPayableAmount(e.amount),e.functionParameters!=null?this.setFunctionParameters(e.functionParameters):e.function!=null&&this.setFunction(e.function.name,e.function.parameters)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractCall;return ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?Et._fromProtobuf(s.contractID):void 0,gas:s.gas!=null?s.gas:void 0,amount:s.amount!=null?Ge.fromTinybars(s.amount):void 0,functionParameters:s.functionParameters!=null?s.functionParameters:void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}get gas(){return this._gas}setGas(e){return this._requireNotFrozen(),this._gas=e instanceof MB.default?e:MB.default.fromValue(e),this}get payableAmount(){return this._amount}setPayableAmount(e){return this._requireNotFrozen(),this._amount=e instanceof Ge?e:new Ge(e),this}get functionParameters(){return this._functionParameters}setFunctionParameters(e){return this._requireNotFrozen(),this._functionParameters=e,this}setFunction(e,t){return this._requireNotFrozen(),this._functionParameters=t!=null?t._build(e):new xu()._build(e),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.contractCallMethod(t)}_getTransactionDataCase(){return"contractCall"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,gas:this._gas,amount:this._amount!=null?this._amount.toTinybars():null,functionParameters:this._functionParameters}}_getLogId(){return`ContractExecuteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("contractCall",X8._fromProtobuf);var Ox=Oe(Jt(),1),Kze=Oe(br(),1);var{proto:y3e}=Kze,Cm=class r{constructor(e){this.contractId=e.contractId,this.accountId=e.accountId,this.contractAccountId=e.contractAccountId,this.adminKey=e.adminKey!=null?e.adminKey:null,this.expirationTime=e.expirationTime,this.autoRenewPeriod=e.autoRenewPeriod,this.autoRenewAccountId=e.autoRenewAccountId,this.storage=e.storage,this.contractMemo=e.contractMemo,this.balance=e.balance,this.isDeleted=e.isDeleted,this.tokenRelationships=e.tokenRelationships,this.ledgerId=e.ledgerId,this.stakingInfo=e.stakingInfo,Object.freeze(this)}static _fromProtobuf(e){let t=e.autoRenewPeriod.seconds;return new r({contractId:Et._fromProtobuf(e.contractID),accountId:ne._fromProtobuf(e.accountID),contractAccountId:e.contractAccountID!=null?e.contractAccountID:"",adminKey:e.adminKey!=null?nt._fromProtobufKey(e.adminKey):null,expirationTime:ut._fromProtobuf(e.expirationTime),autoRenewPeriod:new pr(t),autoRenewAccountId:e.autoRenewAccountId!=null?ne._fromProtobuf(e.autoRenewAccountId):null,storage:e.storage!=null?e.storage instanceof Ox.default?e.storage:Ox.default.fromValue(e.storage):Ox.default.ZERO,contractMemo:e.memo!=null?e.memo:"",balance:Ge.fromTinybars(e.balance!=null?e.balance:0),isDeleted:e.deleted,tokenRelationships:l1._fromProtobuf(e.tokenRelationships!=null?e.tokenRelationships:[]),ledgerId:e.ledgerId!=null?gr.fromBytes(e.ledgerId):null,stakingInfo:e.stakingInfo!=null?c1._fromProtobuf(e.stakingInfo):null})}_toProtobuf(){return{contractID:this.contractId._toProtobuf(),accountID:this.accountId._toProtobuf(),contractAccountID:this.contractAccountId,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,expirationTime:this.expirationTime._toProtobuf(),autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,autoRenewAccountId:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():null,storage:this.storage,memo:this.contractMemo,balance:this.balance.toTinybars(),deleted:this.isDeleted,tokenRelationships:this.tokenRelationships!=null?this.tokenRelationships._toProtobuf():null,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,stakingInfo:this.stakingInfo!=null?this.stakingInfo._toProtobuf():null}}static fromBytes(e){return r._fromProtobuf(y3e.ContractGetInfoResponse.ContractInfo.decode(e))}toBytes(){return y3e.ContractGetInfoResponse.ContractInfo.encode(this._toProtobuf()).finish()}};var ev=class r extends Ar{constructor(e={}){super(),this._contractId=null,e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e){let t=e.contractGetInfo;return new r({contractId:t.contractID!=null?Et._fromProtobuf(t.contractID):void 0})}get contractId(){return this._contractId}setContractId(e){return this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e)}_execute(e,t){return e.smartContract.getContractInfo(t)}async getCost(e){return super.getCost(e)}_mapResponseHeader(e){return e.contractGetInfo.header}_mapResponse(e,t,n){let i=e.contractGetInfo;return Promise.resolve(Cm._fromProtobuf(i.contractInfo))}_onMakeRequest(e){return{contractGetInfo:{header:e,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}}_getLogId(){return`ContractInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("contractGetInfo",ev._fromProtobuf);var v3e=Oe(Jt(),1),tv=class r extends ke{constructor(e={}){super(),this._contractId=null,this._expirationTime=null,this._adminKey=null,this._proxyAccountId=null,this._autoRenewPeriod=null,this._bytecodeFileId=null,this._contractMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=null,this._autoRenewAccountId=null,e.contractId!=null&&this.setContractId(e.contractId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.proxyAccountId!=null&&this.setProxyAccountId(e.proxyAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.bytecodeFileId!=null&&this.setBytecodeFileId(e.bytecodeFileId),e.contractMemo!=null&&this.setContractMemo(e.contractMemo),e.maxAutomaticTokenAssociations!=null&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),e.stakedAccountId!=null&&this.setStakedAccountId(e.stakedAccountId),e.stakedNodeId!=null&&this.setStakedNodeId(e.stakedNodeId),e.declineStakingReward!=null&&this.setDeclineStakingReward(e.declineStakingReward),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].contractUpdateInstance,c;s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null&&(c=s.autoRenewPeriod.seconds);let l;s.memoWrapper!=null&&s.memoWrapper.value!=null&&(l=s.memoWrapper.value);let u;return s.maxAutomaticTokenAssociations!=null&&s.maxAutomaticTokenAssociations.value!=null&&(u=s.maxAutomaticTokenAssociations.value),ke._fromProtobufTransactions(new r({contractId:s.contractID!=null?Et._fromProtobuf(s.contractID):void 0,bytecodeFileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0,adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,proxyAccountId:s.proxyAccountID!=null?ne._fromProtobuf(s.proxyAccountID):void 0,autoRenewPeriod:c,contractMemo:l,maxAutomaticTokenAssociations:u,stakedAccountId:s.stakedAccountId!=null?ne._fromProtobuf(s.stakedAccountId):void 0,stakedNodeId:s.stakedNodeId!=null?s.stakedNodeId:void 0,declineStakingReward:s.declineReward!=null&&!!s.declineReward,autoRenewAccountId:s.autoRenewAccountId!=null?ne._fromProtobuf(s.autoRenewAccountId):void 0}),e,t,n,i,a)}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=typeof e=="string"?Et.fromString(e):e.clone(),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof ut?e:ut.fromDate(e),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get bytecodeFileId(){return this._bytecodeFileId}setBytecodeFileId(e){return console.warn("Deprecated: there is no replacement"),this._requireNotFrozen(),this._bytecodeFileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}get contractMemo(){return this._contractMemo}setContractMemo(e){return this._requireNotFrozen(),this._contractMemo=e,this}clearContractMemo(){return this._requireNotFrozen(),this._contractMemo=null,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(e){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId=typeof e=="string"?ne.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=v3e.default.fromValue(e),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=typeof e=="string"?ne.fromString(e):e,this}clearAutoRenewAccountId(){return this._autoRenewAccountId=new ne(0),this}_validateChecksums(e){this._contractId!=null&&this._contractId.validateChecksum(e),this._bytecodeFileId!=null&&this._bytecodeFileId.validateChecksum(e),this._proxyAccountId!=null&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.smartContract.updateContract(t)}_getTransactionDataCase(){return"contractUpdateInstance"}_makeTransactionData(){return{contractID:this._contractId!=null?this._contractId._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,proxyAccountID:this._proxyAccountId!=null?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,fileID:this._bytecodeFileId?this._bytecodeFileId._toProtobuf():null,memoWrapper:this._contractMemo!=null?{value:this._contractMemo}:null,maxAutomaticTokenAssociations:this._maxAutomaticTokenAssociations!=null?{value:this._maxAutomaticTokenAssociations}:null,stakedAccountId:this.stakedAccountId!=null?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards!=null?{value:this.declineStakingRewards}:null,autoRenewAccountId:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null}}_getLogId(){return`ContractUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("contractUpdateInstance",tv._fromProtobuf);var Au=class{constructor(e={}){this._feeCollectorAccountId=null,this._allCollectorsAreExempt=!1,e.feeCollectorAccountId!=null&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),e.allCollectorsAreExempt!=null&&this.setAllCollectorsAreExempt(e.allCollectorsAreExempt)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId=typeof e=="string"?ne.fromString(e):e,this}get allCollectorsAreExempt(){return this._allCollectorsAreExempt}setAllCollectorsAreExempt(e){return this._allCollectorsAreExempt=e,this}static _fromProtobuf(e){throw new Error("not implemented")}_toProtobuf(){throw new Error("not implemented")}};var b3e=Oe(Jt(),1);var rc=class r extends Au{constructor(e={}){super(e),this._denominatingTokenId=null,e.denominatingTokenId!=null&&this.setDenominatingTokenId(e.denominatingTokenId),this._amount=null,e.amount!=null&&this.setAmount(e.amount)}setHbarAmount(e){return this._amount=e.toTinybars(),this._denominatingTokenId=null,this}get hbarAmount(){return this._denominatingTokenId!=null?null:Ge.fromTinybars(this._amount!=null?this._amount:0)}setDenominatingTokenToSameToken(){return this._denominatingTokenId=new De(0,0,0),this}get denominatingTokenId(){return this._denominatingTokenId}setDenominatingTokenId(e){return this._denominatingTokenId=typeof e=="string"?De.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount=typeof e=="number"?b3e.default.fromNumber(e):e,this}static _fromProtobuf(e){let t=e.fixedFee;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,denominatingTokenId:t.denominatingTokenId!=null?De._fromProtobuf(t.denominatingTokenId):void 0,amount:t.amount!=null?t.amount:void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fixedFee:{denominatingTokenId:this._denominatingTokenId!=null?this._denominatingTokenId._toProtobuf():null,amount:this._amount}}}};var Tu=class r{constructor(e){this._value=e,Object.freeze(this)}toString(){switch(this){case r.Inclusive:return"INCLUSIVE";case r.Exclusive:return"EXCLUSIVE";default:return`UNKNOWN (${this._value.toString()})`}}static _fromValue(e){switch(e){case!1:return r.Inclusive;case!0:return r.Exclusive}}valueOf(){return this._value}};Tu.Inclusive=new Tu(!1);Tu.Exclusive=new Tu(!0);var rv=Oe(Jt(),1),Su=class r extends Au{constructor(e={}){super(e),this._numerator=null,e.numerator!=null&&this.setNumerator(e.numerator),this._denominator=null,e.denominator!=null&&this.setDenominator(e.denominator),this._min=null,e.min!=null&&this.setMin(e.min),this._max,e.max!=null&&this.setMax(e.max),this._assessmentMethod,e.assessmentMethod!=null&&this.setAssessmentMethod(e.assessmentMethod)}get numerator(){return this._numerator}setNumerator(e){return this._numerator=typeof e=="number"?rv.default.fromNumber(e):e,this}get denominator(){return this._denominator}setDenominator(e){return this._denominator=typeof e=="number"?rv.default.fromNumber(e):e,this}get min(){return this._min}setMin(e){return this._min=typeof e=="number"?rv.default.fromNumber(e):e,this}get max(){return this._max}setMax(e){return this._max=typeof e=="number"?rv.default.fromNumber(e):e,this}get assessmentMethod(){return this._assessmentMethod}setAssessmentMethod(e){return this._assessmentMethod=e,this}static _fromProtobuf(e){let t=e.fractionalFee,n=t.fractionalAmount;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,numerator:n.numerator!=null?n.numerator:void 0,denominator:n.denominator!=null?n.denominator:void 0,min:t.minimumAmount!=null?t.minimumAmount:void 0,max:t.maximumAmount!=null?t.maximumAmount:void 0,assessmentMethod:t.netOfTransfers!=null?new Tu(t.netOfTransfers):void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fractionalFee:{fractionalAmount:{numerator:this._numerator,denominator:this._denominator},minimumAmount:this._min,maximumAmount:this._max,netOfTransfers:this._assessmentMethod!=null?this._assessmentMethod.valueOf():!1}}}};var LB=Oe(Jt(),1);var Iu=class r extends Au{constructor(e={}){super(e),this._fallbackFee=null,e.fallbackFee!=null&&this.setFallbackFee(e.fallbackFee),this._numerator=null,e.numerator!=null&&this.setNumerator(e.numerator),this._denominator=null,e.denominator!=null&&this.setDenominator(e.denominator)}get fallbackFee(){return this._fallbackFee}setFallbackFee(e){return this._fallbackFee=e,this}get numerator(){return this._numerator}setNumerator(e){return this._numerator=typeof e=="number"?LB.default.fromNumber(e):e,this}get denominator(){return this._denominator}setDenominator(e){return this._denominator=typeof e=="number"?LB.default.fromNumber(e):e,this}static _fromProtobuf(e){let t=e.royaltyFee,n=t.exchangeValueFraction;return new r({feeCollectorAccountId:e.feeCollectorAccountId!=null?ne._fromProtobuf(e.feeCollectorAccountId):void 0,allCollectorsAreExempt:e.allCollectorsAreExempt!=null?e.allCollectorsAreExempt:void 0,fallbackFee:t.fallbackFee!=null?rc._fromProtobuf({fixedFee:t.fallbackFee}):void 0,numerator:n.numerator!=null?n.numerator:void 0,denominator:n.denominator!=null?n.denominator:void 0})}_toProtobuf(){return{feeCollectorAccountId:this.feeCollectorAccountId!=null?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,royaltyFee:{exchangeValueFraction:{numerator:this._numerator,denominator:this._denominator},fallbackFee:this._fallbackFee!=null?this._fallbackFee._toProtobuf().fixedFee:null}}}};var nv=class r extends Et{constructor(e,t,n,i){super(e,t,n,i)}static fromEvmAddress(e,t,n){return new r(e,t,0,tt(n))}static fromString(e){return new r(Et.fromString(e))}static _fromProtobuf(e){return new r(Et._fromProtobuf(e))}static fromBytes(e){return new r(Et.fromBytes(e))}static fromSolidityAddress(e){return new r(Et.fromSolidityAddress(e))}clone(){let e=new r(this);return e._checksum=this._checksum,e}_toProtobufKey(){return{delegatableContractId:this._toProtobuf()}}static __fromProtobufKey(e){return r._fromProtobuf(e)}};ar.setDelegateContractId(r=>nv.__fromProtobufKey(r));var km=class r extends ke{constructor(e={}){super(),this._ethereumData=null,this._callDataFileId=null,this._maxGasAllowance=null,e.ethereumData!=null&&this.setEthereumData(e.ethereumData),e.callData!=null&&this.setCallDataFileId(e.callData),e.callDataFileId!=null&&this.setCallDataFileId(e.callDataFileId),e.maxGasAllowance!=null&&this.setMaxGasAllowanceHbar(e.maxGasAllowance)}static _fromProtobuf(e,t,n,i,a){let s=a[0].ethereumTransaction;return ke._fromProtobufTransactions(new r({ethereumData:s.ethereumData!=null?s.ethereumData:void 0,callData:s.callData!=null?Gt._fromProtobuf(s.callData):void 0,maxGasAllowance:s.maxGasAllowance!=null?Ge.fromTinybars(s.maxGasAllowance):void 0}),e,t,n,i,a)}get ethereumData(){return this._ethereumData}setEthereumData(e){return this._requireNotFrozen(),this._ethereumData=e,this}get callData(){return this.callDataFileId}setCallData(e){return this.setCallDataFileId(e)}get callDataFileId(){return this._callDataFileId}setCallDataFileId(e){return this._requireNotFrozen(),this._callDataFileId=e,this}get maxGasAllowance(){return this._maxGasAllowance}setMaxGasAllowance(e){return this.setMaxGasAllowanceHbar(e)}setMaxGasAllowanceHbar(e){return this._requireNotFrozen(),this._maxGasAllowance=e instanceof Ge?e:new Ge(e),this}_validateChecksums(e){this._ethereumData!=null&&this._ethereumData instanceof Gt&&this._ethereumData.validateChecksum(e)}_execute(e,t){return e.smartContract.callEthereum(t)}_getTransactionDataCase(){return"ethereumTransaction"}_makeTransactionData(){return{ethereumData:this._ethereumData,callData:this._callDataFileId!=null?this._callDataFileId._toProtobuf():null,maxGasAllowance:this._maxGasAllowance!=null?this._maxGasAllowance.toTinybars():null}}_getLogId(){return`EthereumTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("ethereumTransaction",km._fromProtobuf);var Dx=Oe(X2(),1);var ll=class{constructor(e){this.callData=e.callData}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");switch(e[0]){case 1:return ar.ethereumTransactionDataEip2930FromBytes(e);case 2:return ar.ethereumTransactionDataEip1559FromBytes(e);default:return ar.ethereumTransactionDataLegacyFromBytes(e)}}toBytes(){throw new Error("not implemented")}toString(){throw new Error("not implemented")}toJSON(){throw new Error("not implemented")}};var iv=class r extends ll{constructor(e){super(e),this.nonce=e.nonce,this.gasPrice=e.gasPrice,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.v=e.v,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=Dx.decode(e);if(t.length!=9)throw new Error("invalid ethereum transaction data");return new r({nonce:tt(t[0]),gasPrice:tt(t[1]),gasLimit:tt(t[2]),to:tt(t[3]),value:tt(t[4]),callData:tt(t[5]),v:tt(t[6]),r:tt(t[7]),s:tt(t[8])})}toBytes(){return tt(Dx.encode([this.nonce,this.gasPrice,this.gasLimit,this.to,this.value,this.callData,this.v,this.r,this.s]))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{nonce:Ke(this.nonce),gasPrice:Ke(this.gasPrice),gasLimit:Ke(this.gasLimit),to:Ke(this.to),value:Ke(this.value),callData:Ke(this.callData),v:Ke(this.v),r:Ke(this.r),s:Ke(this.s)}}};ar.setEthereumTransactionDataLegacyFromBytes(r=>iv.fromBytes(r));var Px=Oe(X2(),1);var av=class r extends ll{constructor(e){super(e),this.chainId=e.chainId,this.nonce=e.nonce,this.maxPriorityGas=e.maxPriorityGas,this.maxGas=e.maxGas,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.accessList=e.accessList,this.recId=e.recId,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=Px.decode(e.subarray(1));if(!Array.isArray(t))throw new Error("ethereum data is not a list");if(t.length!=12)throw new Error("invalid ethereum transaction data");return new r({chainId:tt(t[0]),nonce:tt(t[1]),maxPriorityGas:tt(t[2]),maxGas:tt(t[3]),gasLimit:tt(t[4]),to:tt(t[5]),value:tt(t[6]),callData:tt(t[7]),accessList:t[8].map(n=>tt(n)),recId:tt(t[9]),r:tt(t[10]),s:tt(t[11])})}toBytes(){let e=Px.encode([this.chainId,this.nonce,this.maxPriorityGas,this.maxGas,this.gasLimit,this.to,this.value,this.callData,this.accessList,this.recId,this.r,this.s]);return tt("02"+e.substring(2))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{chainId:Ke(this.chainId),nonce:Ke(this.nonce),maxPriorityGas:Ke(this.maxPriorityGas),maxGas:Ke(this.maxGas),gasLimit:Ke(this.gasLimit),to:Ke(this.to),value:Ke(this.value),callData:Ke(this.callData),accessList:this.accessList.map(e=>Ke(e)),recId:Ke(this.recId),r:Ke(this.r),s:Ke(this.s)}}};ar.setEthereumTransactionDataEip1559FromBytes(r=>av.fromBytes(r));var Bx=Oe(X2(),1);var ov=class r extends ll{constructor(e){super(e),this.chainId=e.chainId,this.nonce=e.nonce,this.gasPrice=e.gasPrice,this.gasLimit=e.gasLimit,this.to=e.to,this.value=e.value,this.accessList=e.accessList,this.recId=e.recId,this.r=e.r,this.s=e.s}static fromBytes(e){if(e.length===0)throw new Error("empty bytes");let t=Bx.decode(e.subarray(1));if(!Array.isArray(t))throw new Error("ethereum data is not a list");if(t.length!==11)throw new Error("invalid ethereum transaction data");return new r({chainId:tt(t[0]),nonce:tt(t[1]),gasPrice:tt(t[2]),gasLimit:tt(t[3]),to:tt(t[4]),value:tt(t[5]),callData:tt(t[6]),accessList:t[7].map(n=>tt(n)),recId:tt(t[8]),r:tt(t[9]),s:tt(t[10])})}toBytes(){let e=Bx.encode([this.chainId,this.nonce,this.gasPrice,this.gasLimit,this.to,this.value,this.callData,this.accessList,this.recId,this.r,this.s]);return tt("01"+e.substring(2))}toString(){return JSON.stringify(this.toJSON(),null,2)}toJSON(){return{chainId:Ke(this.chainId),nonce:Ke(this.nonce),gasPrice:Ke(this.gasPrice),gasLimit:Ke(this.gasLimit),to:Ke(this.to),value:Ke(this.value),callData:Ke(this.callData),accessList:this.accessList.map(e=>Ke(e)),recId:Ke(this.recId),r:Ke(this.r),s:Ke(this.s)}}};ar.setEthereumTransactionDataEip2930FromBytes(r=>ov.fromBytes(r));var zze=Oe(br(),1),{proto:Itr}=zze;var Gze=Oe(br(),1);var Qze=Oe(br(),1);var Eo=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Default:return"DEFAULT";case r.TokenFungibleCommon:return"TOKEN_FUNGIBLE_COMMON";case r.TokenNonFungibleUnique:return"TOKEN_NON_FUNGIBLE_UNIQUE";case r.TokenFungibleCommonWithCustomFees:return"TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES";case r.TokenNonFungibleUniqueWithCustomFees:return"TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES";case r.ScheduleCreateContractCall:return"SCHEDULE_CREATE_CONTRACT_CALL";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Default;case 1:return r.TokenFungibleCommon;case 2:return r.TokenNonFungibleUnique;case 3:return r.TokenFungibleCommonWithCustomFees;case 4:return r.TokenNonFungibleUniqueWithCustomFees;case 5:return r.ScheduleCreateContractCall}throw new Error(`(BUG) SubType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};Eo.Default=new Eo(0);Eo.TokenFungibleCommon=new Eo(1);Eo.TokenNonFungibleUnique=new Eo(2);Eo.TokenFungibleCommonWithCustomFees=new Eo(3);Eo.TokenNonFungibleUniqueWithCustomFees=new Eo(4);Eo.ScheduleCreateContractCall=new Eo(5);var Zze=Oe(br(),1);var Yze=Oe(br(),1);var Ae=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.None:return"NONE";case r.CryptoTransfer:return"CryptoTransfer";case r.CryptoUpdate:return"CryptoUpdate";case r.CryptoDelete:return"CryptoDelete";case r.CryptoAddLiveHash:return"CryptoAddLiveHash";case r.CryptoDeleteLiveHash:return"CryptoDeleteLiveHash";case r.ContractCall:return"ContractCall";case r.ContractCreate:return"ContractCreate";case r.ContractUpdate:return"ContractUpdate";case r.FileCreate:return"FileCreate";case r.FileAppend:return"FileAppend";case r.FileUpdate:return"FileUpdate";case r.FileDelete:return"FileDelete";case r.CryptoGetAccountBalance:return"CryptoGetAccountBalance";case r.CryptoGetAccountRecords:return"CryptoGetAccountRecords";case r.CryptoGetInfo:return"CryptoGetInfo";case r.ContractCallLocal:return"ContractCallLocal";case r.ContractGetInfo:return"ContractGetInfo";case r.ContractGetBytecode:return"ContractGetBytecode";case r.GetBySolidityID:return"GetBySolidityID";case r.GetByKey:return"GetByKey";case r.CryptoGetLiveHash:return"CryptoGetLiveHash";case r.CryptoGetStakers:return"CryptoGetStakers";case r.FileGetContents:return"FileGetContents";case r.FileGetInfo:return"FileGetInfo";case r.TransactionGetRecord:return"TransactionGetRecord";case r.ContractGetRecords:return"ContractGetRecords";case r.CryptoCreate:return"CryptoCreate";case r.SystemDelete:return"SystemDelete";case r.SystemUndelete:return"SystemUndelete";case r.ContractDelete:return"ContractDelete";case r.Freeze:return"Freeze";case r.CreateTransactionRecord:return"CreateTransactionRecord";case r.CryptoAccountAutoRenew:return"CryptoAccountAutoRenew";case r.ContractAutoRenew:return"ContractAutoRenew";case r.GetVersionInfo:return"GetVersionInfo";case r.TransactionGetReceipt:return"TransactionGetReceipt";case r.ConsensusCreateTopic:return"ConsensusCreateTopic";case r.ConsensusUpdateTopic:return"ConsensusUpdateTopic";case r.ConsensusDeleteTopic:return"ConsensusDeleteTopic";case r.ConsensusGetTopicInfo:return"ConsensusGetTopicInfo";case r.ConsensusSubmitMessage:return"ConsensusSubmitMessage";case r.UncheckedSubmit:return"UncheckedSubmit";case r.TokenCreate:return"TokenCreate";case r.TokenGetInfo:return"TokenGetInfo";case r.TokenFreezeAccount:return"TokenFreezeAccount";case r.TokenUnfreezeAccount:return"TokenUnfreezeAccount";case r.TokenGrantKycToAccount:return"TokenGrantKycToAccount";case r.TokenRevokeKycFromAccount:return"TokenRevokeKycFromAccount";case r.TokenDelete:return"TokenDelete";case r.TokenUpdate:return"TokenUpdate";case r.TokenMint:return"TokenMint";case r.TokenBurn:return"TokenBurn";case r.TokenAccountWipe:return"TokenAccountWipe";case r.TokenAssociateToAccount:return"TokenAssociateToAccount";case r.TokenDissociateFromAccount:return"TokenDissociateFromAccount";case r.ScheduleCreate:return"ScheduleCreate";case r.ScheduleDelete:return"ScheduleDelete";case r.ScheduleSign:return"ScheduleSign";case r.ScheduleGetInfo:return"ScheduleGetInfo";case r.TokenGetAccountNftInfos:return"TokenGetAccountNftInfos";case r.TokenGetNftInfo:return"TokenGetNftInfo";case r.TokenGetNftInfos:return"TokenGetNftInfos";case r.TokenFeeScheduleUpdate:return"TokenFeeScheduleUpdate";case r.NetworkGetExecutionTime:return"NetworkGetExecutionTime";case r.TokenPause:return"TokenPause";case r.TokenUnpause:return"TokenUnpause";case r.CryptoApproveAllowance:return"CryptoApproveAllowance";case r.CryptoDeleteAllowance:return"CryptoDeleteAllowance";case r.GetAccountDetails:return"GetAccountDetails";case r.EthereumTransaction:return"EthereumTransaction";case r.NodeStakeUpdate:return"NodeStakeUpdate";case r.Prng:return"UtilPrng";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.None;case 1:return r.CryptoTransfer;case 2:return r.CryptoUpdate;case 3:return r.CryptoDelete;case 4:return r.CryptoAddLiveHash;case 5:return r.CryptoDeleteLiveHash;case 6:return r.ContractCall;case 7:return r.ContractCreate;case 8:return r.ContractUpdate;case 9:return r.FileCreate;case 10:return r.FileAppend;case 11:return r.FileUpdate;case 12:return r.FileDelete;case 13:return r.CryptoGetAccountBalance;case 14:return r.CryptoGetAccountRecords;case 15:return r.CryptoGetInfo;case 16:return r.ContractCallLocal;case 17:return r.ContractGetInfo;case 18:return r.ContractGetBytecode;case 19:return r.GetBySolidityID;case 20:return r.GetByKey;case 21:return r.CryptoGetLiveHash;case 22:return r.CryptoGetStakers;case 23:return r.FileGetContents;case 24:return r.FileGetInfo;case 25:return r.TransactionGetRecord;case 26:return r.ContractGetRecords;case 27:return r.CryptoCreate;case 28:return r.SystemDelete;case 29:return r.SystemUndelete;case 30:return r.ContractDelete;case 31:return r.Freeze;case 32:return r.CreateTransactionRecord;case 33:return r.CryptoAccountAutoRenew;case 34:return r.ContractAutoRenew;case 35:return r.GetVersionInfo;case 36:return r.TransactionGetReceipt;case 50:return r.ConsensusCreateTopic;case 51:return r.ConsensusUpdateTopic;case 52:return r.ConsensusDeleteTopic;case 53:return r.ConsensusGetTopicInfo;case 54:return r.ConsensusSubmitMessage;case 55:return r.UncheckedSubmit;case 56:return r.TokenCreate;case 58:return r.TokenGetInfo;case 59:return r.TokenFreezeAccount;case 60:return r.TokenUnfreezeAccount;case 61:return r.TokenGrantKycToAccount;case 62:return r.TokenRevokeKycFromAccount;case 63:return r.TokenDelete;case 64:return r.TokenUpdate;case 65:return r.TokenMint;case 66:return r.TokenBurn;case 67:return r.TokenAccountWipe;case 68:return r.TokenAssociateToAccount;case 69:return r.TokenDissociateFromAccount;case 70:return r.ScheduleCreate;case 71:return r.ScheduleDelete;case 72:return r.ScheduleSign;case 73:return r.ScheduleGetInfo;case 74:return r.TokenGetAccountNftInfos;case 75:return r.TokenGetNftInfo;case 76:return r.TokenGetNftInfos;case 77:return r.TokenFeeScheduleUpdate;case 78:return r.NetworkGetExecutionTime;case 79:return r.TokenPause;case 80:return r.TokenUnpause;case 81:return r.CryptoApproveAllowance;case 82:return r.CryptoDeleteAllowance;case 83:return r.GetAccountDetails;case 84:return r.EthereumTransaction;case 85:return r.NodeStakeUpdate;case 86:return r.Prng}throw new Error(`(BUG) RequestType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};Ae.None=new Ae(0);Ae.CryptoTransfer=new Ae(1);Ae.CryptoUpdate=new Ae(2);Ae.CryptoDelete=new Ae(3);Ae.CryptoAddLiveHash=new Ae(4);Ae.CryptoDeleteLiveHash=new Ae(5);Ae.ContractCall=new Ae(6);Ae.ContractCreate=new Ae(7);Ae.ContractUpdate=new Ae(8);Ae.FileCreate=new Ae(9);Ae.FileAppend=new Ae(10);Ae.FileUpdate=new Ae(11);Ae.FileDelete=new Ae(12);Ae.CryptoGetAccountBalance=new Ae(13);Ae.CryptoGetAccountRecords=new Ae(14);Ae.CryptoGetInfo=new Ae(15);Ae.ContractCallLocal=new Ae(16);Ae.ContractGetInfo=new Ae(17);Ae.ContractGetBytecode=new Ae(18);Ae.GetBySolidityID=new Ae(19);Ae.GetByKey=new Ae(20);Ae.CryptoGetLiveHash=new Ae(21);Ae.CryptoGetStakers=new Ae(22);Ae.FileGetContents=new Ae(23);Ae.FileGetInfo=new Ae(24);Ae.TransactionGetRecord=new Ae(25);Ae.ContractGetRecords=new Ae(26);Ae.CryptoCreate=new Ae(27);Ae.SystemDelete=new Ae(28);Ae.SystemUndelete=new Ae(29);Ae.ContractDelete=new Ae(30);Ae.Freeze=new Ae(31);Ae.CreateTransactionRecord=new Ae(32);Ae.CryptoAccountAutoRenew=new Ae(33);Ae.ContractAutoRenew=new Ae(34);Ae.GetVersionInfo=new Ae(35);Ae.TransactionGetReceipt=new Ae(36);Ae.ConsensusCreateTopic=new Ae(50);Ae.ConsensusUpdateTopic=new Ae(51);Ae.ConsensusDeleteTopic=new Ae(52);Ae.ConsensusGetTopicInfo=new Ae(53);Ae.ConsensusSubmitMessage=new Ae(54);Ae.UncheckedSubmit=new Ae(55);Ae.TokenCreate=new Ae(56);Ae.TokenGetInfo=new Ae(58);Ae.TokenFreezeAccount=new Ae(59);Ae.TokenUnfreezeAccount=new Ae(60);Ae.TokenGrantKycToAccount=new Ae(61);Ae.TokenRevokeKycFromAccount=new Ae(62);Ae.TokenDelete=new Ae(63);Ae.TokenUpdate=new Ae(64);Ae.TokenMint=new Ae(65);Ae.TokenBurn=new Ae(66);Ae.TokenAccountWipe=new Ae(67);Ae.TokenAssociateToAccount=new Ae(68);Ae.TokenDissociateFromAccount=new Ae(69);Ae.ScheduleCreate=new Ae(70);Ae.ScheduleDelete=new Ae(71);Ae.ScheduleSign=new Ae(72);Ae.ScheduleGetInfo=new Ae(73);Ae.TokenGetAccountNftInfos=new Ae(74);Ae.TokenGetNftInfo=new Ae(75);Ae.TokenGetNftInfos=new Ae(76);Ae.TokenFeeScheduleUpdate=new Ae(77);Ae.NetworkGetExecutionTime=new Ae(78);Ae.TokenPause=new Ae(79);Ae.TokenUnpause=new Ae(80);Ae.CryptoApproveAllowance=new Ae(81);Ae.CryptoDeleteAllowance=new Ae(82);Ae.GetAccountDetails=new Ae(83);Ae.EthereumTransaction=new Ae(84);Ae.NodeStakeUpdate=new Ae(85);Ae.Prng=new Ae(86);var eGe=Oe(br(),1);var sv=class r extends Ar{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e){let t=e.fileGetContents;return new r({fileId:t.fileID!=null?Gt._fromProtobuf(t.fileID):void 0})}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.getFileContent(t)}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}_mapResponseHeader(e){return e.fileGetContents.header}_mapResponse(e){let i=e.fileGetContents.fileContents.contents;return Promise.resolve(i)}_onMakeRequest(e){return{fileGetContents:{header:e,fileID:this._fileId!=null?this._fileId._toProtobuf():null}}}_getLogId(){return`FileContentsQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("fileGetContents",sv._fromProtobuf);var FB=Oe(Jt(),1);var UB=Oe(br(),1),{proto:tGe}=UB,Nm=class r{constructor(e){this.fileId=e.fileId,this.size=e.size,this.expirationTime=e.expirationTime,this.isDeleted=e.isDeleted,this.keys=e.keys,this.fileMemo=e.fileMemo,this.ledgerId=e.ledgerId,Object.freeze(this)}static _fromProtobuf(e){let t=e.size;return new r({fileId:Gt._fromProtobuf(e.fileID),size:t instanceof FB.default?t:FB.default.fromValue(t),expirationTime:ut._fromProtobuf(e.expirationTime),isDeleted:e.deleted,keys:e.keys!=null?Oi.__fromProtobufKeyList(e.keys):new Oi,fileMemo:e.memo!=null?e.memo:"",ledgerId:e.ledgerId!=null?gr.fromBytes(e.ledgerId):null})}_toProtobuf(){return{fileID:this.fileId._toProtobuf(),size:this.size,expirationTime:this.expirationTime._toProtobuf(),deleted:this.isDeleted,keys:this.keys._toProtobufKey().keyList,memo:this.fileMemo,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null}}static fromBytes(e){return r._fromProtobuf(UB.proto.FileGetInfoResponse.FileInfo.decode(e))}toBytes(){return tGe.FileGetInfoResponse.FileInfo.encode(this._toProtobuf()).finish()}};var cv=class r extends Ar{constructor(e={}){super(),this._fileId=null,e.fileId!=null&&this.setFileId(e.fileId)}static _fromProtobuf(e){let t=e.fileGetInfo;return new r({fileId:t.fileID!=null?Gt._fromProtobuf(t.fileID):void 0})}get fileId(){return this._fileId}setFileId(e){return this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.getFileInfo(t)}_mapResponseHeader(e){return e.fileGetInfo.header}_mapResponse(e,t,n){let i=e.fileGetInfo;return Promise.resolve(Nm._fromProtobuf(i.fileInfo))}_onMakeRequest(e){return{fileGetInfo:{header:e,fileID:this._fileId!=null?this._fileId._toProtobuf():null}}}_getLogId(){return`FileInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("fileGetInfo",cv._fromProtobuf);var lv=class r extends ke{constructor(e={}){super(),this._fileId=null,this._keys=null,this._expirationTime=null,this._contents=null,this._fileMemo=null,e.fileId!=null&&this.setFileId(e.fileId),e.keys!=null&&this.setKeys(e.keys),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.contents!=null&&this.setContents(e.contents),e.fileMemo!=null&&this.setFileMemo(e.fileMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].fileUpdate;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,keys:s.keys!=null&&s.keys.keys!=null?s.keys.keys.map(c=>nt._fromProtobufKey(c)):void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0,contents:s.contents!=null?s.contents:void 0,fileMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=typeof e=="string"?Gt.fromString(e):e.clone(),this}get keys(){return this._keys}setKeys(e){if(this._requireNotFrozen(),e instanceof Oi&&e.threshold!=null)throw new Error("Cannot set threshold key as file key");return this._keys=e instanceof Oi?e.toArray():e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof ut?e:ut.fromDate(e),this}get contents(){return this._contents}setContents(e){return this._requireNotFrozen(),this._contents=e instanceof Uint8Array?e:i3(e),this}get fileMemo(){return this._fileMemo}setFileMemo(e){return this._requireNotFrozen(),this._fileMemo=e,this}clearFileMemo(){return this._requireNotFrozen(),this._fileMemo=null,this}_validateChecksums(e){this._fileId!=null&&this._fileId.validateChecksum(e)}_execute(e,t){return e.file.updateFile(t)}_getTransactionDataCase(){return"fileUpdate"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null,contents:this._contents,memo:this._fileMemo!=null?{value:this._fileMemo}:null}}_getLogId(){return`FileUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("fileUpdate",lv._fromProtobuf);var xo=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.UnknownFreezeType:return"UNKNOWN_FREEZE_TYPE";case r.FreezeOnly:return"FREEZE_ONLY";case r.PrepareUpgrade:return"PREPARE_UPGRADE";case r.FreezeUpgrade:return"FREEZE_UPGRADE";case r.FreezeAbort:return"FREEZE_ABORT";case r.TelemetryUpgrade:return"TELEMETRY_UPGRADE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.UnknownFreezeType;case 1:return r.FreezeOnly;case 2:return r.PrepareUpgrade;case 3:return r.FreezeUpgrade;case 4:return r.FreezeAbort;case 5:return r.TelemetryUpgrade;default:throw new Error(`(BUG) Status.fromCode() does not handle code: ${e}`)}}valueOf(){return this._code}};xo.UnknownFreezeType=new xo(0);xo.FreezeOnly=new xo(1);xo.PrepareUpgrade=new xo(2);xo.FreezeUpgrade=new xo(3);xo.FreezeAbort=new xo(4);xo.TelemetryUpgrade=new xo(5);var uv=class r extends ke{constructor(e={}){super(),this._startTime=null,this._startTimestamp=null,this._endTime=null,this._fileId=null,this._fileHash=null,this._freezeType=null,e.startTime!=null&&this.setStartTime(e.startTime.hour,e.startTime.minute),e.endTime!=null&&this.setEndTime(e.endTime.hour,e.endTime.minute),e.startTimestamp!=null&&this.setStartTimestamp(e.startTimestamp),e.updateFileId!=null&&this.setUpdateFileId(e.updateFileId),e.fileId!=null&&this.setFileId(e.fileId),e.fileHash!=null&&this.setFileHash(e.fileHash),e.freezeType!=null&&this.setFreezeType(e.freezeType)}static _fromProtobuf(e,t,n,i,a){let s=a[0].freeze;return ke._fromProtobufTransactions(new r({startTime:s.startHour!=null&&s.startMin!=null?{hour:s.startHour,minute:s.startMin}:void 0,endTime:s.endHour!=null&&s.endMin!=null?{hour:s.endHour,minute:s.endMin}:void 0,startTimestamp:s.startTime!=null?ut._fromProtobuf(s.startTime):void 0,updateFileId:s.updateFile!=null?Gt._fromProtobuf(s.updateFile):void 0,fileHash:s.fileHash!=null?s.fileHash:void 0,freezeType:s.freezeType!=null?xo._fromCode(s.freezeType):void 0}),e,t,n,i,a)}get startTime(){return null}setStartTime(e,t){if(this._requireNotFrozen(),typeof e=="string"){let n=e.split(":");this._startTime={hour:Number(n[0]),minute:Number(n[1])}}else this._startTime={hour:e,minute:t};return this}get startTimestamp(){return this._startTimestamp}setStartTimestamp(e){return this._requireNotFrozen(),this._startTimestamp=e,this}get endTime(){return console.warn("`FreezeTransaction.endTime` is deprecated"),this._endTime}setEndTime(e,t){if(console.warn("`FreezeTransaction.endTime` is deprecated"),this._requireNotFrozen(),typeof e=="string"){let n=e.split(":");this._endTime={hour:Number(n[0]),minute:Number(n[1])}}else this._endTime={hour:e,minute:t};return this}get updateFileId(){return this.fileId}setUpdateFileId(e){return this.setFileId(e)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e,this}get fileHash(){return this._fileHash}setFileHash(e){return this._requireNotFrozen(),this._fileHash=typeof e=="string"?tt(e):e,this}get freezeType(){return this._freezeType}setFreezeType(e){return this._requireNotFrozen(),this._freezeType=e,this}_getTransactionDataCase(){return"freeze"}_makeTransactionData(){return{startTime:this._startTimestamp!=null?this._startTimestamp._toProtobuf():null,updateFile:this._fileId!=null?this._fileId._toProtobuf():null,fileHash:this._fileHash,freezeType:this._freezeType!=null?this._freezeType.valueOf():null}}_getLogId(){return`FreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("freeze",uv._fromProtobuf);var dv=class r extends ke{constructor(e={}){super(),this._hash=null,this._keys=null,this._duration=null,this._accountId=null,e.hash!=null&&this.setHash(e.hash),e.keys!=null&&this.setKeys(e.keys),e.duration!=null&&this.setDuration(e.duration),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let c=a[0].cryptoAddLiveHash.liveHash;return ke._fromProtobufTransactions(new r({hash:c.hash!=null?c.hash:void 0,keys:c.keys!=null&&c.keys.keys!=null?c.keys.keys.map(l=>nt._fromProtobufKey(l)):void 0,duration:c.duration!=null&&c.duration.seconds!=null?c.duration.seconds:void 0,accountId:c.accountId!=null?ne._fromProtobuf(c.accountId):void 0}),e,t,n,i,a)}get hash(){return this._hash}setHash(e){return this._requireNotFrozen(),this._hash=e,this}get keys(){return this._keys}setKeys(e){return this._requireNotFrozen(),this._keys=e instanceof Oi?e.toArray():e,this}get duration(){return this._duration}setDuration(e){return this._requireNotFrozen(),this._duration=e instanceof pr?e:new pr(e),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.addLiveHash(t)}_getTransactionDataCase(){return"cryptoAddLiveHash"}_makeTransactionData(){return{liveHash:{hash:this._hash,keys:this._keys!=null?{keys:this._keys.map(e=>e._toProtobufKey())}:void 0,duration:this._duration!=null?this._duration._toProtobuf():null,accountId:this._accountId!=null?this._accountId._toProtobuf():null}}}_getLogId(){return`LiveHashAddTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoAddLiveHash",dv._fromProtobuf);var fv=class r extends ke{constructor(e={}){super(),this._hash=null,this._accountId=null,e.hash!=null&&this.setHash(e.hash),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoDeleteLiveHash;return ke._fromProtobufTransactions(new r({hash:s.liveHashToDelete!=null?s.liveHashToDelete:void 0,accountId:s.accountOfLiveHash!=null?ne._fromProtobuf(s.accountOfLiveHash):void 0}),e,t,n,i,a)}get hash(){return this._hash}setHash(e){return this._requireNotFrozen(),this._hash=e,this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.deleteLiveHash(t)}_getTransactionDataCase(){return"cryptoDeleteLiveHash"}_makeTransactionData(){return{liveHashToDelete:this._hash,accountOfLiveHash:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`LiveHashDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoDeleteLiveHash",fv._fromProtobuf);var pv=class r extends Ar{constructor(e={}){super(),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._hash=null,e.hash!=null&&this.setHash(e.hash)}static _fromProtobuf(e){let t=e.cryptoGetLiveHash;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,hash:t.hash!=null?t.hash:void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId=e instanceof ne?e:ne.fromString(e),this}get liveHash(){return this._hash}setHash(e){return this._hash=e,this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getLiveHash(t)}_mapResponseHeader(e){return e.cryptoGetLiveHash.header}_mapResponse(e){let t=e.cryptoGetLiveHash;return Promise.resolve(Df._fromProtobuf(t.liveHash))}_onMakeRequest(e){return{cryptoGetLiveHash:{header:e,accountID:this._accountId!=null?this._accountId._toProtobuf():null,hash:this._hash}}}_getLogId(){return`LiveHashQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("cryptoGetLiveHash",pv._fromProtobuf);var qB=Oe(br(),1),h1=class r{constructor(e){this.major=e.major,this.minor=e.minor,this.patch=e.patch,Object.freeze(this)}static _fromProtobuf(e){return new r({major:e.major,minor:e.minor,patch:e.patch})}_toProtobuf(){return{major:this.major,minor:this.minor,patch:this.patch}}static fromBytes(e){return r._fromProtobuf(qB.proto.SemanticVersion.decode(e))}toBytes(){return qB.proto.SemanticVersion.encode(this._toProtobuf()).finish()}};var jB=Oe(br(),1),Rm=class r{constructor(e){this.protobufVersion=e.protobufVersion,this.servicesVesion=e.servicesVesion,Object.freeze(this)}static _fromProtobuf(e){return new r({protobufVersion:h1._fromProtobuf(e.hapiProtoVersion),servicesVesion:h1._fromProtobuf(e.hederaServicesVersion)})}_toProtobuf(){return{hapiProtoVersion:this.protobufVersion._toProtobuf(),hederaServicesVersion:this.servicesVesion._toProtobuf()}}static fromBytes(e){return r._fromProtobuf(jB.proto.NetworkGetVersionInfoResponse.decode(e))}toBytes(){return jB.proto.NetworkGetVersionInfoResponse.encode(this._toProtobuf()).finish()}};var hv=class r extends Ar{constructor(){super()}static _fromProtobuf(e){return new r}_execute(e,t){return e.network.getVersionInfo(t)}_mapResponseHeader(e){return e.networkGetVersionInfo.header}_mapResponse(e){let t=e.networkGetVersionInfo;return Promise.resolve(Rm._fromProtobuf(t))}_onMakeRequest(e){return{networkGetVersionInfo:{header:e}}}_getLogId(){return`NetworkVersionInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("networkGetVersionInfo",hv._fromProtobuf);var mv=class r extends ke{constructor(e={}){super(),this._range=null,e.range!=null&&this.setRange(e.range)}setRange(e){return this._range=e,this}get range(){return this._range}_validateChecksums(e){this._range!=null&&Cw(this._range)&&this._validateChecksums(e)}_execute(e,t){return e.util.prng(t)}static _fromProtobuf(e,t,n,i,a){let s=a[0].utilPrng;return ke._fromProtobufTransactions(new r({range:s.range}),e,t,n,i,a)}_getTransactionDataCase(){return"utilPrng"}_makeTransactionData(){return{range:this.range}}_getLogId(){return`RandomGenerate:${this._transactionIds.current.validStart.toString()}`}};We.set("utilPrng",mv._fromProtobuf);var Mx=Oe(br(),1),Om=class r extends ke{constructor(e={}){super(),this._adminKey=null,this._scheduledTransaction=null,this._payerAccountId=null,this._scheduleMemo=null,this._scheduledSignerPublicKeys=new Set,this._expirationTime=null,this._waitForExpiry=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),e.payerAccountID!=null&&this.setPayerAccountId(e.payerAccountID),e.scheduleMemo!=null&&this.setScheduleMemo(e.scheduleMemo),this._defaultMaxTransactionFee=new Ge(5)}static _fromProtobuf(e,t,n,i,a){let o=a[0],s=o.scheduleCreate,c=new r({adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,payerAccountID:s.payerAccountID!=null?ne._fromProtobuf(s.payerAccountID):void 0,scheduleMemo:s.memo!=null?s.memo:void 0,waitForExpiry:s.waitForExpiry!=null?s.waitForExpiry:void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0});if(o.scheduleCreate!=null){let l=o.scheduleCreate.scheduledTransactionBody,u=Mx.proto.TransactionBody.encode(l).finish(),h={signedTransactionBytes:Mx.proto.SignedTransaction.encode({bodyBytes:u}).finish()},g=Mx.proto.TransactionList.encode({transactionList:[h]}).finish(),m=ke.fromBytes(g);c._setScheduledTransaction(m)}return ke._fromProtobufTransactions(c,e,t,n,i,a)}_setScheduledTransaction(e){return this._scheduledTransaction=e,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get payerAccountId(){return this._payerAccountId}setPayerAccountId(e){return this._requireNotFrozen(),this._payerAccountId=e,this}setScheduleMemo(e){return this._requireNotFrozen(),this._scheduleMemo=e,this}get getScheduleMemo(){return this._requireNotFrozen(),this._scheduleMemo}setScheduledTransaction(e){return this._requireNotFrozen(),e._requireNotFrozen(),this._scheduledTransaction=e.schedule()._scheduledTransaction,this}_validateChecksums(e){this._payerAccountId!=null&&this._payerAccountId.validateChecksum(e)}_execute(e,t){return e.schedule.createSchedule(t)}_getTransactionDataCase(){return"scheduleCreate"}_makeTransactionData(){return{adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,payerAccountID:this._payerAccountId!=null?this._payerAccountId._toProtobuf():null,scheduledTransactionBody:this._scheduledTransaction!=null?this._scheduledTransaction._getScheduledTransactionBody():null,memo:this._scheduleMemo,waitForExpiry:this._waitForExpiry,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`ScheduleCreateTransaction:${this._transactionIds.current.validStart.toString()}`}setExpirationTime(e){return this._expirationTime=e,this}get expirationTime(){return this._requireNotFrozen(),this._expirationTime}setWaitForExpiry(e){return this._waitForExpiry=e,this}get waitForExpiry(){return this._requireNotFrozen(),this._waitForExpiry}};We.set("scheduleCreate",Om._fromProtobuf);Cx.push(()=>new Om);var gv=class r extends ke{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId),this._defaultMaxTransactionFee=new Ge(5)}static _fromProtobuf(e,t,n,i,a){let s=a[0].scheduleDelete;return ke._fromProtobufTransactions(new r({scheduleId:s.scheduleID!=null?Ra._fromProtobuf(s.scheduleID):void 0}),e,t,n,i,a)}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._requireNotFrozen(),this._scheduleId=typeof e=="string"?Ra.fromString(e):e.clone(),this}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.deleteSchedule(t)}_getTransactionDataCase(){return"scheduleDelete"}_makeTransactionData(){return{scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}_getLogId(){return`ScheduleDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("scheduleDelete",gv._fromProtobuf);var rGe=Oe(br(),1);var{proto:Lx}=rGe,Dm=class r{constructor(e){this.scheduleId=e.scheduleId,this.creatorAccountId=e.creatorAccountID,this.payerAccountId=e.payerAccountID,this.schedulableTransactionBody=e.schedulableTransactionBody,this.signers=e.signers,this.scheduleMemo=e.scheduleMemo,this.adminKey=e.adminKey!=null?e.adminKey:null,this.expirationTime=e.expirationTime,this.executed=e.executed,this.deleted=e.deleted,this.scheduledTransactionId=e.scheduledTransactionId,this.waitForExpiry=e.waitForExpiry,Object.freeze(this)}static _fromProtobuf(e){return new r({scheduleId:Ra._fromProtobuf(e.scheduleID),creatorAccountID:e.creatorAccountID!=null?ne._fromProtobuf(e.creatorAccountID):null,payerAccountID:e.payerAccountID!=null?ne._fromProtobuf(e.payerAccountID):null,schedulableTransactionBody:e.scheduledTransactionBody!=null?e.scheduledTransactionBody:null,adminKey:e.adminKey!=null?nt._fromProtobufKey(e.adminKey):null,signers:e.signers!=null?Oi.__fromProtobufKeyList(e.signers):null,scheduleMemo:e.memo!=null?e.memo:null,expirationTime:e.expirationTime!=null?ut._fromProtobuf(e.expirationTime):null,executed:e.executionTime!=null?ut._fromProtobuf(e.executionTime):null,deleted:e.deletionTime!=null?ut._fromProtobuf(e.deletionTime):null,scheduledTransactionId:e.scheduledTransactionID!=null?Qr._fromProtobuf(e.scheduledTransactionID):null,waitForExpiry:e.waitForExpiry!=null?e.waitForExpiry:!1})}_toProtobuf(){return{scheduleID:this.scheduleId!=null?this.scheduleId._toProtobuf():null,creatorAccountID:this.creatorAccountId!=null?this.creatorAccountId._toProtobuf():null,payerAccountID:this.payerAccountId!=null?this.payerAccountId._toProtobuf():null,scheduledTransactionBody:this.schedulableTransactionBody!=null?this.schedulableTransactionBody:null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,signers:this.signers!=null?this.signers._toProtobufKey().keyList:null,memo:this.scheduleMemo!=null?this.scheduleMemo:"",expirationTime:this.expirationTime!=null?this.expirationTime._toProtobuf():null,scheduledTransactionID:this.scheduledTransactionId!=null?this.scheduledTransactionId._toProtobuf():null,waitForExpiry:this.waitForExpiry}}get scheduledTransaction(){if(this.schedulableTransactionBody==null)throw new Error("Scheduled transaction body is empty");let e=new Lx.SchedulableTransactionBody(this.schedulableTransactionBody),t=e.data;return ke.fromBytes(Lx.TransactionList.encode({transactionList:[{signedTransactionBytes:Lx.SignedTransaction.encode({bodyBytes:Lx.TransactionBody.encode({transactionFee:this.schedulableTransactionBody.transactionFee,memo:this.schedulableTransactionBody.memo,[t]:e[t]}).finish()}).finish()}]}).finish())}};var yv=class r extends Ar{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId)}static _fromProtobuf(e){let t=e.scheduleGetInfo;return new r({scheduleId:t.scheduleID!=null?Ra._fromProtobuf(t.scheduleID):void 0})}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._scheduleId=typeof e=="string"?Ra.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.getScheduleInfo(t)}_mapResponseHeader(e){return e.scheduleGetInfo.header}_mapResponse(e,t,n){let i=e.scheduleGetInfo;return Promise.resolve(Dm._fromProtobuf(i.scheduleInfo))}_onMakeRequest(e){return{scheduleGetInfo:{header:e,scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}}_getLogId(){return`ScheduleInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("scheduleGetInfo",yv._fromProtobuf);var vv=class r extends ke{constructor(e={}){super(),this._scheduleId=null,e.scheduleId!=null&&this.setScheduleId(e.scheduleId),this._defaultMaxTransactionFee=new Ge(5)}static _fromProtobuf(e,t,n,i,a){let s=a[0].scheduleSign;return ke._fromProtobufTransactions(new r({scheduleId:s.scheduleID!=null?Ra._fromProtobuf(s.scheduleID):void 0}),e,t,n,i,a)}get scheduleId(){return this._scheduleId}setScheduleId(e){return this._requireNotFrozen(),this._scheduleId=typeof e=="string"?Ra.fromString(e):e.clone(),this}_validateChecksums(e){this._scheduleId!=null&&this._scheduleId.validateChecksum(e)}_execute(e,t){return e.schedule.signSchedule(t)}_getTransactionDataCase(){return"scheduleSign"}_makeTransactionData(){return{scheduleID:this._scheduleId!=null?this._scheduleId._toProtobuf():null}}_getLogId(){return`ScheduleSignTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("scheduleSign",vv._fromProtobuf);var Pm=class{constructor(e){this.publicKey=e.publicKey,this.signature=e.signature,this.accountId=e.accountId}};var bv=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contractId=null,this._expirationTime=null,e.fileId!=null&&this.setFileId(e.fileId),e.contractId!=null&&this.setContractId(e.contractId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime)}static _fromProtobuf(e,t,n,i,a){let s=a[0].systemDelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,contractId:s.contractID!=null?Et._fromProtobuf(s.contractID):void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e instanceof Gt?e:Gt.fromString(e),this}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=e instanceof Et?e:Et.fromString(e),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e,this}_execute(e,t){return this._fileId!=null?e.file.systemDelete(t):e.smartContract.systemDelete(t)}_getTransactionDataCase(){return"systemDelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`SystemDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("systemDelete",bv._fromProtobuf);var wv=class r extends ke{constructor(e={}){super(),this._fileId=null,this._contractId=null,e.fileId!=null&&this.setFileId(e.fileId),e.contractId!=null&&this.setContractId(e.contractId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].systemUndelete;return ke._fromProtobufTransactions(new r({fileId:s.fileID!=null?Gt._fromProtobuf(s.fileID):void 0,contractId:s.contractID!=null?Et._fromProtobuf(s.contractID):void 0}),e,t,n,i,a)}get fileId(){return this._fileId}setFileId(e){return this._requireNotFrozen(),this._fileId=e instanceof Gt?e:Gt.fromString(e),this}get contractId(){return this._contractId}setContractId(e){return this._requireNotFrozen(),this._contractId=e instanceof Et?e:Et.fromString(e),this}_execute(e,t){return this._fileId!=null?e.file.systemUndelete(t):e.smartContract.systemUndelete(t)}_getTransactionDataCase(){return"systemUndelete"}_makeTransactionData(){return{fileID:this._fileId!=null?this._fileId._toProtobuf():null,contractID:this._contractId!=null?this._contractId._toProtobuf():null}}_getLogId(){return`SystemUndeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("systemUndelete",wv._fromProtobuf);var _v=class r extends ke{constructor(e={}){super(),this._tokenIds=null,this._accountId=null,this._defaultMaxTransactionFee=new Ge(5),e.tokenIds!=null&&this.setTokenIds(e.tokenIds),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenAssociate;return ke._fromProtobufTransactions(new r({tokenIds:s.tokens!=null?s.tokens.map(c=>De._fromProtobuf(c)):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenIds(){return this._tokenIds}setTokenIds(e){return this._requireNotFrozen(),this._tokenIds=e.map(t=>typeof t=="string"?De.fromString(t):t.clone()),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e);for(let t of this._tokenIds!=null?this._tokenIds:[])t?.validateChecksum(e)}_execute(e,t){return e.token.associateTokens(t)}_getTransactionDataCase(){return"tokenAssociate"}_makeTransactionData(){return{tokens:this._tokenIds!=null?this._tokenIds.map(e=>e._toProtobuf()):null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenAssociateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenAssociate",_v._fromProtobuf);var Ev=Oe(Jt(),1),xv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._amount=null,this._serials=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.amount!=null&&this.setAmount(e.amount),e.serials!=null&&this.setSerials(e.serials)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenBurn;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,amount:s.amount!=null?s.amount:void 0,serials:s.serialNumbers!=null?s.serialNumbers:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof Ev.default?e:Ev.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}get serials(){return this._serials}setSerials(e){return this._requireNotFrozen(),this._serials=e.map(t=>t instanceof Ev.default?t:Ev.default.fromValue(t)),this}_execute(e,t){return e.token.burnToken(t)}_getTransactionDataCase(){return"tokenBurn"}_makeTransactionData(){return{amount:this._amount,serialNumbers:this._serials,token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenBurnTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenBurn",xv._fromProtobuf);var Av=Oe(Jt(),1);var nc=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.FungibleCommon:return"FUNGIBLE_COMMON";case r.NonFungibleUnique:return"NON_FUNGIBLE_UNIQUE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.FungibleCommon;case 1:return r.NonFungibleUnique}throw new Error(`(BUG) TokenType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};nc.FungibleCommon=new nc(0);nc.NonFungibleUnique=new nc(1);var ic=class r{constructor(e){this._code=e,Object.freeze(this)}toString(){switch(this){case r.Infinite:return"INFINITE";case r.Finite:return"FINITE";default:return`UNKNOWN (${this._code})`}}static _fromCode(e){switch(e){case 0:return r.Infinite;case 1:return r.Finite}throw new Error(`(BUG) TokenSupplyType.fromCode() does not handle code: ${e}`)}valueOf(){return this._code}};ic.Infinite=new ic(0);ic.Finite=new ic(1);var Tv=class r extends ke{constructor(e={}){super(),this._tokenName=null,this._tokenSymbol=null,this._decimals=null,this._initialSupply=null,this._treasuryAccountId=null,this._adminKey=null,this._kycKey=null,this._freezeKey=null,this._pauseKey=null,this._wipeKey=null,this._supplyKey=null,this._feeScheduleKey=null,this._freezeDefault=null,this._autoRenewAccountId=null,this._expirationTime=null,this._autoRenewPeriod=new pr(_u),this._tokenMemo=null,this._customFees=[],this._tokenType=null,this._supplyType=null,this._maxSupply=null,this._defaultMaxTransactionFee=new Ge(30),e.tokenName!=null&&this.setTokenName(e.tokenName),e.tokenSymbol!=null&&this.setTokenSymbol(e.tokenSymbol),e.decimals!=null&&this.setDecimals(e.decimals),e.initialSupply!=null&&this.setInitialSupply(e.initialSupply),e.treasuryAccountId!=null&&this.setTreasuryAccountId(e.treasuryAccountId),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.kycKey!=null&&this.setKycKey(e.kycKey),e.freezeKey!=null&&this.setFreezeKey(e.freezeKey),e.pauseKey!=null&&this.setPauseKey(e.pauseKey),e.wipeKey!=null&&this.setWipeKey(e.wipeKey),e.supplyKey!=null&&this.setSupplyKey(e.supplyKey),e.feeScheduleKey!=null&&this.setFeeScheduleKey(e.feeScheduleKey),e.freezeDefault!=null&&this.setFreezeDefault(e.freezeDefault),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.tokenMemo!=null&&this.setTokenMemo(e.tokenMemo),e.customFees!=null&&this.setCustomFees(e.customFees),e.tokenType!=null&&this.setTokenType(e.tokenType),e.supplyType!=null&&this.setSupplyType(e.supplyType),e.maxSupply!=null&&this.setMaxSupply(e.maxSupply)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenCreation;return ke._fromProtobufTransactions(new r({tokenName:s.name!=null?s.name:void 0,tokenSymbol:s.symbol!=null?s.symbol:void 0,decimals:s.decimals!=null?s.decimals:void 0,initialSupply:s.initialSupply!=null?s.initialSupply:void 0,treasuryAccountId:s.treasury!=null?ne._fromProtobuf(s.treasury):void 0,adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,kycKey:s.kycKey!=null?nt._fromProtobufKey(s.kycKey):void 0,freezeKey:s.freezeKey!=null?nt._fromProtobufKey(s.freezeKey):void 0,pauseKey:s.pauseKey!=null?nt._fromProtobufKey(s.pauseKey):void 0,wipeKey:s.wipeKey!=null?nt._fromProtobufKey(s.wipeKey):void 0,supplyKey:s.supplyKey!=null?nt._fromProtobufKey(s.supplyKey):void 0,feeScheduleKey:s.feeScheduleKey!=null?nt._fromProtobufKey(s.feeScheduleKey):void 0,freezeDefault:s.freezeDefault!=null?s.freezeDefault:void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,expirationTime:s.expiry!=null?ut._fromProtobuf(s.expiry):void 0,autoRenewPeriod:s.autoRenewPeriod!=null?pr._fromProtobuf(s.autoRenewPeriod):void 0,tokenMemo:s.memo!=null?s.memo:void 0,customFees:s.customFees!=null?s.customFees.map(c=>c.fixedFee!=null?rc._fromProtobuf(c):c.fractionalFee!=null?Su._fromProtobuf(c):Iu._fromProtobuf(c)):void 0,tokenType:s.tokenType!=null?nc._fromCode(s.tokenType):void 0,supplyType:s.supplyType!=null?ic._fromCode(s.supplyType):void 0,maxSupply:s.maxSupply!=null?s.maxSupply:void 0}),e,t,n,i,a)}get tokenName(){return this._tokenName}setTokenName(e){return this._requireNotFrozen(),this._tokenName=e,this}get tokenSymbol(){return this._tokenSymbol}setTokenSymbol(e){return this._requireNotFrozen(),this._tokenSymbol=e,this}get decimals(){return this._decimals}setDecimals(e){return this._requireNotFrozen(),this._decimals=e instanceof Av.default?e:Av.default.fromValue(e),this}get initialSupply(){return this._initialSupply}setInitialSupply(e){return this._requireNotFrozen(),this._initialSupply=Av.default.fromValue(e),this}get treasuryAccountId(){return this._treasuryAccountId}setTreasuryAccountId(e){return this._requireNotFrozen(),this._treasuryAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get kycKey(){return this._kycKey}setKycKey(e){return this._requireNotFrozen(),this._kycKey=e,this}get freezeKey(){return this._freezeKey}setFreezeKey(e){return this._requireNotFrozen(),this._freezeKey=e,this}get pauseKey(){return this._pauseKey}setPauseKey(e){return this._requireNotFrozen(),this._pauseKey=e,this}get wipeKey(){return this._wipeKey}setWipeKey(e){return this._requireNotFrozen(),this._wipeKey=e,this}get supplyKey(){return this._supplyKey}setSupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}get feeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}get freezeDefault(){return this._freezeDefault}setFreezeDefault(e){return this._requireNotFrozen(),this._freezeDefault=e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._autoRenewPeriod=null,this._expirationTime=e instanceof ut?e:ut.fromDate(e),this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get tokenMemo(){return this._tokenMemo}setTokenMemo(e){return this._requireNotFrozen(),this._tokenMemo=e,this}get customFees(){return this._customFees}setCustomFees(e){return this._customFees=e,this}get tokenType(){return this._tokenType}setTokenType(e){return this._tokenType=e,this}get supplyType(){return this._supplyType}setSupplyType(e){return this._supplyType=e,this}get maxSupply(){return this._maxSupply}setMaxSupply(e){return this._maxSupply=typeof e=="number"?Av.default.fromNumber(e):e,this}_freezeWithAccountId(e){super._freezeWithAccountId(e),this._autoRenewPeriod!=null&&e!=null&&(this._autoRenewAccountId=e)}freezeWith(e){return e!=null&&e.operatorAccountId!=null&&this._freezeWithAccountId(e.operatorAccountId),super.freezeWith(e)}_validateChecksums(e){this._treasuryAccountId!=null&&this._treasuryAccountId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.token.createToken(t)}_getTransactionDataCase(){return"tokenCreation"}_makeTransactionData(){return{name:this._tokenName,symbol:this._tokenSymbol,decimals:this._decimals!=null?this._decimals.toInt():null,initialSupply:this._initialSupply,treasury:this._treasuryAccountId!=null?this._treasuryAccountId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,kycKey:this._kycKey!=null?this._kycKey._toProtobufKey():null,freezeKey:this._freezeKey!=null?this._freezeKey._toProtobufKey():null,pauseKey:this._pauseKey!=null?this._pauseKey._toProtobufKey():null,wipeKey:this._wipeKey!=null?this._wipeKey._toProtobufKey():null,supplyKey:this._supplyKey!=null?this._supplyKey._toProtobufKey():null,feeScheduleKey:this._feeScheduleKey!=null?this._feeScheduleKey._toProtobufKey():null,freezeDefault:this._freezeDefault,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,expiry:this._expirationTime!=null?this._expirationTime._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,memo:this._tokenMemo,customFees:this.customFees.map(e=>e._toProtobuf()),tokenType:this._tokenType!=null?this._tokenType._code:null,supplyType:this._supplyType!=null?this._supplyType._code:null,maxSupply:this.maxSupply}}_getLogId(){return`TokenCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenCreation",Tv._fromProtobuf);var Sv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenDeletion;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.deleteToken(t)}_getTransactionDataCase(){return"tokenDeletion"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenDeletion",Sv._fromProtobuf);var Iv=class r extends ke{constructor(e={}){super(),this._tokenIds=null,this._accountId=null,this._defaultMaxTransactionFee=new Ge(5),e.tokenIds!=null&&this.setTokenIds(e.tokenIds),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenDissociate;return ke._fromProtobufTransactions(new r({tokenIds:s.tokens!=null?s.tokens.map(c=>De._fromProtobuf(c)):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenIds(){return this._tokenIds}setTokenIds(e){return this._requireNotFrozen(),this._tokenIds=e.map(t=>typeof t=="string"?De.fromString(t):t.clone()),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._accountId!=null&&this._accountId.validateChecksum(e);for(let t of this._tokenIds!=null?this._tokenIds:[])t?.validateChecksum(e)}_execute(e,t){return e.token.dissociateTokens(t)}_getTransactionDataCase(){return"tokenDissociate"}_makeTransactionData(){return{tokens:this._tokenIds!=null?this._tokenIds.map(e=>e._toProtobuf()):null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenDissociateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenDissociate",Iv._fromProtobuf);var Cv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._customFees=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.customFees!=null&&this.setCustomFees(e.customFees)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenFeeScheduleUpdate;return ke._fromProtobufTransactions(new r({tokenId:s.tokenId!=null?De._fromProtobuf(s.tokenId):void 0,customFees:s.customFees!=null?s.customFees.map(c=>c.fixedFee!=null?rc._fromProtobuf(c):c.fractionalFee!=null?Su._fromProtobuf(c):Iu._fromProtobuf(c)):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):De._fromProtobuf(e._toProtobuf()),this}get customFees(){return this._customFees}setCustomFees(e){return this._requireNotFrozen(),this._customFees=e,this}_execute(e,t){return e.token.updateTokenFeeSchedule(t)}_getTransactionDataCase(){return"tokenFeeScheduleUpdate"}_makeTransactionData(){return{tokenId:this._tokenId!=null?this._tokenId._toProtobuf():null,customFees:this._customFees.map(e=>e._toProtobuf())}}_getLogId(){return`TokenFeeScheduleUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenFeeScheduleUpdate",Cv._fromProtobuf);var kv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenFreeze;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.freezeTokenAccount(t)}_getTransactionDataCase(){return"tokenFreeze"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenFreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenFreeze",kv._fromProtobuf);var Nv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenGrantKyc;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.grantKycToTokenAccount(t)}_getTransactionDataCase(){return"tokenGrantKyc"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenGrantKycTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenGrantKyc",Nv._fromProtobuf);var w3e=Oe(Jt(),1),VB=Oe(br(),1);var Bm=class r{constructor(e){this.tokenId=e.tokenId,this.name=e.name,this.symbol=e.symbol,this.decimals=e.decimals,this.totalSupply=e.totalSupply,this.treasuryAccountId=e.treasuryAccountId,this.adminKey=e.adminKey,this.kycKey=e.kycKey,this.freezeKey=e.freezeKey,this.pauseKey=e.pauseKey,this.wipeKey=e.wipeKey,this.supplyKey=e.supplyKey,this.feeScheduleKey=e.feeScheduleKey,this.defaultFreezeStatus=e.defaultFreezeStatus,this.defaultKycStatus=e.defaultKycStatus,this.pauseStatus=e.pauseStatus,this.isDeleted=e.isDeleted,this.autoRenewAccountId=e.autoRenewAccountId,this.autoRenewPeriod=e.autoRenewPeriod,this.expirationTime=e.expirationTime,this.tokenMemo=e.tokenMemo,this.customFees=e.customFees,this.tokenType=e.tokenType,this.supplyType=e.supplyType,this.maxSupply=e.maxSupply,this.ledgerId=e.ledgerId}static _fromProtobuf(e){let t=e.defaultFreezeStatus,n=e.defaultKycStatus,i=e.pauseStatus,a=e.autoRenewAccount!=null?ne._fromProtobuf(e.autoRenewAccount):new ne(0);return new r({tokenId:De._fromProtobuf(e.tokenId),name:e.name,symbol:e.symbol,decimals:e.decimals,totalSupply:w3e.default.fromValue(e.totalSupply),treasuryAccountId:e.treasury!=null?ne._fromProtobuf(e.treasury):null,adminKey:e.adminKey!=null?nt._fromProtobufKey(e.adminKey):null,kycKey:e.kycKey!=null?nt._fromProtobufKey(e.kycKey):null,freezeKey:e.freezeKey!=null?nt._fromProtobufKey(e.freezeKey):null,pauseKey:e.pauseKey!=null?nt._fromProtobufKey(e.pauseKey):null,wipeKey:e.wipeKey!=null?nt._fromProtobufKey(e.wipeKey):null,supplyKey:e.supplyKey!=null?nt._fromProtobufKey(e.supplyKey):null,feeScheduleKey:e.feeScheduleKey!=null?nt._fromProtobufKey(e.feeScheduleKey):null,defaultFreezeStatus:t===0?null:t==1,defaultKycStatus:n===0?null:n==1,pauseStatus:i===0?null:i==1,isDeleted:e.deleted,autoRenewAccountId:a.shard.toInt()==0&&a.realm.toInt()==0&&a.num.toInt()==0?null:a,autoRenewPeriod:e.autoRenewPeriod!=null?pr._fromProtobuf(e.autoRenewPeriod):null,expirationTime:e.expiry!=null?ut._fromProtobuf(e.expiry):null,tokenMemo:e.memo!=null?e.memo:"",customFees:e.customFees!=null?e.customFees.map(o=>o.fixedFee!=null?rc._fromProtobuf(o):o.fractionalFee!=null?Su._fromProtobuf(o):Iu._fromProtobuf(o)):[],tokenType:e.tokenType!=null?nc._fromCode(e.tokenType):null,supplyType:e.supplyType!=null?ic._fromCode(e.supplyType):null,maxSupply:e.maxSupply!=null?e.maxSupply:null,ledgerId:e.ledgerId!=null?gr.fromBytes(e.ledgerId):null})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),name:this.name,symbol:this.symbol,decimals:this.decimals,totalSupply:this.totalSupply,treasury:this.treasuryAccountId!=null?this.treasuryAccountId._toProtobuf():null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,kycKey:this.kycKey!=null?this.kycKey._toProtobufKey():null,freezeKey:this.freezeKey!=null?this.freezeKey._toProtobufKey():null,pauseKey:this.pauseKey!=null?this.pauseKey._toProtobufKey():null,wipeKey:this.wipeKey!=null?this.wipeKey._toProtobufKey():null,supplyKey:this.supplyKey!=null?this.supplyKey._toProtobufKey():null,feeScheduleKey:this.feeScheduleKey!=null?this.feeScheduleKey._toProtobufKey():null,defaultFreezeStatus:this.defaultFreezeStatus==null?0:this.defaultFreezeStatus?1:2,defaultKycStatus:this.defaultKycStatus==null?0:this.defaultKycStatus?1:2,pauseStatus:this.pauseStatus==null?0:this.pauseStatus?1:2,deleted:this.isDeleted,autoRenewAccount:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():void 0,autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,expiry:this.expirationTime!=null?this.expirationTime._toProtobuf():null,memo:this.tokenMemo,customFees:this.customFees.map(e=>e._toProtobuf()),tokenType:this.tokenType!=null?this.tokenType._code:null,supplyType:this.supplyType!=null?this.supplyType._code:null,maxSupply:this.maxSupply,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null}}static fromBytes(e){return r._fromProtobuf(VB.proto.TokenInfo.decode(e))}toBytes(){return VB.proto.TokenInfo.encode(this._toProtobuf()).finish()}};var Rv=class r extends Ar{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e){let t=e.tokenGetInfo;return new r({tokenId:t.token!=null?De._fromProtobuf(t.token):void 0})}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.getTokenInfo(t)}_mapResponseHeader(e){return e.tokenGetInfo.header}_mapResponse(e,t,n){let i=e.tokenGetInfo;return Promise.resolve(Bm._fromProtobuf(i.tokenInfo))}_onMakeRequest(e){return{tokenGetInfo:{header:e,token:this._tokenId!=null?this._tokenId._toProtobuf():null}}}_getLogId(){return`TokenInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("tokenGetInfo",Rv._fromProtobuf);var HB=Oe(Jt(),1);var Ov=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._amount=null,this._metadata=[],e.tokenId!=null&&this.setTokenId(e.tokenId),e.amount!=null&&this.setAmount(e.amount),e.metadata!=null&&this.setMetadata(e.metadata)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenMint;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,amount:s.amount!=null?s.amount:void 0,metadata:s.metadata!=null?s.metadata:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof HB.default?e:HB.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}get metadata(){return this._metadata}addMetadata(e){return this._requireNotFrozen(),typeof e=="string"&&console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead."),this._metadata.push(typeof e=="string"?tt(e):e),this}setMetadata(e){this._requireNotFrozen();for(let t of e)if(typeof t=="string"){console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead.");break}return this._metadata=e.map(t=>typeof t=="string"?tt(t):t),this}_execute(e,t){return e.token.mintToken(t)}_getTransactionDataCase(){return"tokenMint"}_makeTransactionData(){return{amount:this._amount,token:this._tokenId!=null?this._tokenId._toProtobuf():null,metadata:this._metadata}}_getLogId(){return`TokenMintTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenMint",Ov._fromProtobuf);var Mm=class r{constructor(e){this.nftId=e.nftId,this.accountId=e.accountId,this.creationTime=e.creationTime,this.metadata=e.metadata,this.ledgerId=e.ledgerId,this.spenderId=e.spenderId,Object.freeze(this)}static _fromProtobuf(e){return new r({nftId:sa._fromProtobuf(e.nftID),accountId:ne._fromProtobuf(e.accountID),creationTime:ut._fromProtobuf(e.creationTime),metadata:e.metadata!==void 0?e.metadata:null,ledgerId:e.ledgerId!=null?gr.fromBytes(e.ledgerId):null,spenderId:e.spenderId!=null?ne._fromProtobuf(e.spenderId):null})}_toProtobuf(){return{nftID:this.nftId._toProtobuf(),accountID:this.accountId._toProtobuf(),creationTime:this.creationTime._toProtobuf(),metadata:this.metadata,ledgerId:this.ledgerId!=null?this.ledgerId.toBytes():null,spenderId:this.spenderId!=null?this.spenderId._toProtobuf():null}}toJson(){return{nftId:this.nftId.toString(),accountId:this.accountId.toString(),creationTime:this.creationTime.toString(),metadata:this.metadata!=null?Ke(this.metadata):null,ledgerId:this.ledgerId!=null?this.ledgerId.toString():null,spenderId:this.spenderId!=null?this.spenderId.toString():null}}toString(){return JSON.stringify(this.toJson())}};var KB=Oe(Jt(),1),Dv=class r extends Ar{constructor(e={}){super(),this._nftId=null,e.nftId!=null&&this.setNftId(e.nftId),this._accountId=null,e.accountId!=null&&this.setAccountId(e.accountId),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),this._start=null,e.start!=null&&this.setStart(e.start),this._end=null,e.end!=null&&this.setEnd(e.end)}static _fromProtobuf(e){if(e.tokenGetNftInfo!=null){let t=e.tokenGetNftInfo;return new r({nftId:t.nftID!=null?sa._fromProtobuf(t.nftID):void 0})}else if(e.tokenGetAccountNftInfos!=null){let t=e.tokenGetAccountNftInfos;return new r({accountId:t.accountID!=null?ne._fromProtobuf(t.accountID):void 0,start:t.start!=null?t.start:void 0,end:t.end!=null?t.end:void 0})}else{let t=e.tokenGetNftInfos;return new r({tokenId:t.tokenID!=null?De._fromProtobuf(t.tokenID):void 0,start:t.start!=null?t.start:void 0,end:t.end!=null?t.end:void 0})}}get nftId(){return this._nftId}setNftId(e){return this._nftId=typeof e=="string"?sa.fromString(e):sa._fromProtobuf(e._toProtobuf()),this}get accountId(){return console.warn("`TokenNftInfoQuery.accountId` is deprecated with no replacement"),this._accountId}setAccountId(e){return console.warn("`TokenNftInfoQuery.setAccountId()` is deprecated with no replacement"),this._accountId=typeof e=="string"?ne.fromString(e):ne._fromProtobuf(e._toProtobuf()),this}get tokenId(){return console.warn("`TokenNftInfoQuery.tokenId` is deprecated with no replacement"),this._tokenId}setTokenId(e){return console.warn("`TokenNftInfoQuery.setTokenId()` is deprecated with no replacement"),this._tokenId=typeof e=="string"?De.fromString(e):De._fromProtobuf(e._toProtobuf()),this}get start(){return console.warn("`TokenNftInfoQuery.start` is deprecated with no replacement"),this._start}setStart(e){return console.warn("`TokenNftInfoQuery.setStart()` is deprecated with no replacement"),this._start=typeof e=="number"?KB.default.fromNumber(e):e,this}get end(){return console.warn("`TokenNftInfoQuery.end` is deprecated with no replacement"),this._end}setEnd(e){return console.warn("`TokenNftInfoQuery.setEnd()` is deprecated with no replacement"),this._end=typeof e=="number"?KB.default.fromNumber(e):e,this}async getCost(e){return super.getCost(e)}_execute(e,t){return e.token.getTokenNftInfo(t)}_mapResponseHeader(e){return e.tokenGetNftInfo.header}_mapResponse(e,t,n){let i=[e.tokenGetNftInfo.nft];return Promise.resolve(i.map(a=>Mm._fromProtobuf(a)))}_onMakeRequest(e){return{tokenGetNftInfo:{header:e,nftID:this._nftId!=null?this._nftId._toProtobuf():null}}}_getLogId(){return`TokenNftInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("tokenGetNftInfo",Dv._fromProtobuf);var Pv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenPause;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.pauseToken(t)}_getTransactionDataCase(){return"tokenPause"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenPauseTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenPause",Pv._fromProtobuf);var Bv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenRevokeKyc;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.revokeKycFromTokenAccount(t)}_getTransactionDataCase(){return"tokenRevokeKyc"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenRevokeKycTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenRevokeKyc",Bv._fromProtobuf);var Mv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUnfreeze;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}_execute(e,t){return e.token.unfreezeTokenAccount(t)}_getTransactionDataCase(){return"tokenUnfreeze"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null}}_getLogId(){return`TokenUnfreezeTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenUnfreeze",Mv._fromProtobuf);var Lv=class r extends ke{constructor(e={}){super(),this._tokenId=null,e.tokenId!=null&&this.setTokenId(e.tokenId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUnpause;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e)}_execute(e,t){return e.token.unpauseToken(t)}_getTransactionDataCase(){return"tokenUnpause"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null}}_getLogId(){return`TokenUnpauseTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenUnpause",Lv._fromProtobuf);var Fv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._tokenName=null,this._tokenSymbol=null,this._treasuryAccountId=null,this._adminKey=null,this._kycKey=null,this._freezeKey=null,this._wipeKey=null,this._supplyKey=null,this._autoRenewAccountId=null,this._expirationTime=null,this._autoRenewPeriod=null,this._tokenMemo=null,this._feeScheduleKey=null,this._pauseKey=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.tokenName!=null&&this.setTokenName(e.tokenName),e.tokenSymbol!=null&&this.setTokenSymbol(e.tokenSymbol),e.treasuryAccountId!=null&&this.setTreasuryAccountId(e.treasuryAccountId),e.adminKey!=null&&this.setAdminKey(e.adminKey),e.kycKey!=null&&this.setKycKey(e.kycKey),e.freezeKey!=null&&this.setFreezeKey(e.freezeKey),e.wipeKey!=null&&this.setWipeKey(e.wipeKey),e.supplyKey!=null&&this.setSupplyKey(e.supplyKey),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.expirationTime!=null&&this.setExpirationTime(e.expirationTime),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.tokenMemo!=null&&this.setTokenMemo(e.tokenMemo),e.feeScheduleKey!=null&&this.setFeeScheduleKey(e.feeScheduleKey),e.pauseKey!=null&&this.setPauseKey(e.pauseKey)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenUpdate;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,tokenName:s.name!=null?s.name:void 0,tokenSymbol:s.symbol!=null?s.symbol:void 0,treasuryAccountId:s.treasury!=null?ne._fromProtobuf(s.treasury):void 0,adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,kycKey:s.kycKey!=null?nt._fromProtobufKey(s.kycKey):void 0,freezeKey:s.freezeKey!=null?nt._fromProtobufKey(s.freezeKey):void 0,wipeKey:s.wipeKey!=null?nt._fromProtobufKey(s.wipeKey):void 0,supplyKey:s.supplyKey!=null?nt._fromProtobufKey(s.supplyKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,expirationTime:s.expiry!=null?ut._fromProtobuf(s.expiry):void 0,autoRenewPeriod:s.autoRenewPeriod!=null?pr._fromProtobuf(s.autoRenewPeriod):void 0,tokenMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,feeScheduleKey:s.feeScheduleKey!=null?nt._fromProtobufKey(s.feeScheduleKey):void 0,pauseKey:s.pauseKey!=null?nt._fromProtobufKey(s.pauseKey):void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get tokenName(){return this._tokenName}setTokenName(e){return this._requireNotFrozen(),this._tokenName=e,this}get tokenSymbol(){return this._tokenSymbol}setTokenSymbol(e){return this._requireNotFrozen(),this._tokenSymbol=e,this}get treasuryAccountId(){return this._treasuryAccountId}setTreasuryAccountId(e){return this._requireNotFrozen(),this._treasuryAccountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get kycKey(){return this._kycKey}setKycKey(e){return this._requireNotFrozen(),this._kycKey=e,this}get freezeKey(){return this._freezeKey}setFreezeKey(e){return this._requireNotFrozen(),this._freezeKey=e,this}get wipeKey(){return this._wipeKey}setWipeKey(e){return this._requireNotFrozen(),this._wipeKey=e,this}get supplyKey(){return this._supplyKey}setSupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}setsupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof ut?e:ut.fromDate(e),this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}get tokenMemo(){return this._tokenMemo}setTokenMemo(e){return this._requireNotFrozen(),this._tokenMemo=e,this}get feeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}get pauseKey(){return this._pauseKey}setPauseKey(e){return this._requireNotFrozen(),this._pauseKey=e,this}clearTokenMemo(){return this._requireNotFrozen(),this._tokenMemo=null,this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._treasuryAccountId!=null&&this._treasuryAccountId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.token.updateToken(t)}_getTransactionDataCase(){return"tokenUpdate"}_makeTransactionData(){return{token:this._tokenId!=null?this._tokenId._toProtobuf():null,name:this.tokenName,symbol:this.tokenSymbol,treasury:this._treasuryAccountId!=null?this._treasuryAccountId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,kycKey:this._kycKey!=null?this._kycKey._toProtobufKey():null,freezeKey:this._freezeKey!=null?this._freezeKey._toProtobufKey():null,pauseKey:this._pauseKey!=null?this._pauseKey._toProtobufKey():null,wipeKey:this._wipeKey!=null?this._wipeKey._toProtobufKey():null,supplyKey:this._supplyKey!=null?this._supplyKey._toProtobufKey():null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,expiry:this._expirationTime!=null?this._expirationTime._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,memo:this._tokenMemo!=null?{value:this._tokenMemo}:null,feeScheduleKey:this._feeScheduleKey!=null?this._feeScheduleKey._toProtobufKey():null}}_getLogId(){return`TokenUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenUpdate",Fv._fromProtobuf);var Fx=Oe(Jt(),1),Uv=class r extends ke{constructor(e={}){super(),this._tokenId=null,this._accountId=null,this._serials=[],this._amount=null,e.tokenId!=null&&this.setTokenId(e.tokenId),e.accountId!=null&&this.setAccountId(e.accountId),e.amount!=null&&this.setAmount(e.amount),e.serials!=null&&this.setSerials(e.serials)}static _fromProtobuf(e,t,n,i,a){let s=a[0].tokenWipe;return ke._fromProtobufTransactions(new r({tokenId:s.token!=null?De._fromProtobuf(s.token):void 0,accountId:s.account!=null?ne._fromProtobuf(s.account):void 0,amount:s.amount!=null?s.amount:void 0,serials:s.serialNumbers!=null?s.serialNumbers:void 0}),e,t,n,i,a)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId=typeof e=="string"?De.fromString(e):e.clone(),this}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId=typeof e=="string"?ne.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(e){return this._requireNotFrozen(),this._amount=e instanceof Fx.default?e:Fx.default.fromValue(e),this}_validateChecksums(e){this._tokenId!=null&&this._tokenId.validateChecksum(e),this._accountId!=null&&this._accountId.validateChecksum(e)}get serials(){return this._serials}setSerials(e){return this._requireNotFrozen(),this._serials=e.map(t=>typeof t=="number"?Fx.default.fromNumber(t):t),this}_execute(e,t){return e.token.wipeTokenAccount(t)}_getTransactionDataCase(){return"tokenWipe"}_makeTransactionData(){return{amount:this._amount,token:this._tokenId!=null?this._tokenId._toProtobuf():null,account:this._accountId!=null?this._accountId._toProtobuf():null,serialNumbers:this.serials}}_getLogId(){return`TokenWipeTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("tokenWipe",Uv._fromProtobuf);var qv=class r extends ke{constructor(e={}){super(),this._adminKey=null,this._submitKey=null,this._autoRenewAccountId=null,this._autoRenewPeriod=new pr(_u),this._topicMemo=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),e.submitKey!=null&&this.setSubmitKey(e.submitKey),e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),e.topicMemo!=null&&this.setTopicMemo(e.topicMemo)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusCreateTopic;return ke._fromProtobufTransactions(new r({adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,submitKey:s.submitKey!=null?nt._fromProtobufKey(s.submitKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,topicMemo:s.memo!=null?s.memo:void 0}),e,t,n,i,a)}get topicMemo(){return this._topicMemo}getTopicMemo(){return this._topicMemo}setTopicMemo(e){return this._requireNotFrozen(),this._topicMemo=e,this}get adminKey(){return this._adminKey}getAdminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get submitKey(){return this._submitKey}getSubmitKey(){return this._submitKey}setSubmitKey(e){return this._requireNotFrozen(),this._submitKey=e,this}get autoRenewAccountId(){return this._autoRenewAccountId}getAutoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}getAutoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}_validateChecksums(e){this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.consensus.createTopic(t)}_getTransactionDataCase(){return"consensusCreateTopic"}_makeTransactionData(){return{adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,submitKey:this._submitKey!=null?this._submitKey._toProtobufKey():null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),memo:this._topicMemo}}_getLogId(){return`TopicCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("consensusCreateTopic",qv._fromProtobuf);var jv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusDeleteTopic;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?aa._fromProtobuf(s.topicID):void 0}),e,t,n,i,a)}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?aa.fromString(e):e.clone(),this}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e)}_execute(e,t){return e.consensus.deleteTopic(t)}_getTransactionDataCase(){return"consensusDeleteTopic"}_makeTransactionData(){return{topicID:this._topicId!=null?this._topicId._toProtobuf():null}}_getLogId(){return`TopicDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("consensusDeleteTopic",jv._fromProtobuf);var Ux=Oe(Jt(),1);var zB=Oe(br(),1);var Lm=class r{constructor(e){this.topicId=e.topicId,this.topicMemo=e.topicMemo,this.runningHash=e.runningHash,this.sequenceNumber=e.sequenceNumber,this.expirationTime=e.expirationTime,this.adminKey=e.adminKey,this.submitKey=e.submitKey,this.autoRenewPeriod=e.autoRenewPeriod,this.autoRenewAccountId=e.autoRenewAccountId,this.ledgerId=e.ledgerId,Object.freeze(this)}static _fromProtobuf(e){let t=e.topicInfo;return new r({topicId:aa._fromProtobuf(e.topicID),topicMemo:t.memo!=null?t.memo:"",runningHash:t.runningHash!=null?t.runningHash:new Uint8Array,sequenceNumber:t.sequenceNumber!=null?t.sequenceNumber instanceof Ux.default?t.sequenceNumber:Ux.default.fromValue(t.sequenceNumber):Ux.default.ZERO,expirationTime:t.expirationTime!=null?ut._fromProtobuf(t.expirationTime):null,adminKey:t.adminKey!=null?nt._fromProtobufKey(t.adminKey):null,submitKey:t.submitKey!=null?nt._fromProtobufKey(t.submitKey):null,autoRenewPeriod:t.autoRenewPeriod!=null?new pr(t.autoRenewPeriod.seconds):null,autoRenewAccountId:t.autoRenewAccount!=null?ne._fromProtobuf(t.autoRenewAccount):null,ledgerId:t.ledgerId!=null?gr.fromBytes(t.ledgerId):null})}_toProtobuf(){return{topicID:this.topicId._toProtobuf(),topicInfo:{memo:this.topicMemo,runningHash:this.runningHash,sequenceNumber:this.sequenceNumber,expirationTime:this.expirationTime!=null?this.expirationTime._toProtobuf():null,adminKey:this.adminKey!=null?this.adminKey._toProtobufKey():null,submitKey:this.submitKey!=null?this.submitKey._toProtobufKey():null,autoRenewPeriod:this.autoRenewPeriod!=null?this.autoRenewPeriod._toProtobuf():null,autoRenewAccount:this.autoRenewAccountId!=null?this.autoRenewAccountId._toProtobuf():null}}}static fromBytes(e){return r._fromProtobuf({topicInfo:zB.proto.ConsensusTopicInfo.decode(e)})}toBytes(){return zB.proto.ConsensusTopicInfo.encode(this._toProtobuf().topicInfo).finish()}};var Vv=class r extends Ar{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId)}static _fromProtobuf(e){let t=e.consensusGetTopicInfo;return new r({topicId:t.topicID!=null?aa._fromProtobuf(t.topicID):void 0})}get topicId(){return this._topicId}setTopicId(e){return this._topicId=typeof e=="string"?aa.fromString(e):e.clone(),this}async getCost(e){return super.getCost(e)}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e)}_execute(e,t){return e.consensus.getTopicInfo(t)}_mapResponseHeader(e){return e.consensusGetTopicInfo.header}_mapResponse(e,t,n){return Promise.resolve(Lm._fromProtobuf(e.consensusGetTopicInfo))}_onMakeRequest(e){return{consensusGetTopicInfo:{header:e,topicID:this._topicId!=null?this._topicId._toProtobuf():null}}}_getLogId(){return`TopicInfoQuery:${(this._paymentTransactionId!=null&&this._paymentTransactionId.validStart!=null?this._paymentTransactionId.validStart:this._timestamp).toString()}`}};$r.set("consensusGetTopicInfo",Vv._fromProtobuf);var nGe=Oe(Jt(),1);var aGe=Oe(Jt(),1);var cGe=Oe(br(),1);var lGe=Oe(Jt(),1);var Hv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId),this._message=null,e.message!=null&&this.setMessage(e.message),this._maxChunks=20,this._chunkSize=c3e,e.maxChunks!=null&&this.setMaxChunks(e.maxChunks),e.chunkSize!=null&&this.setChunkSize(e.chunkSize),this._chunkInfo=null}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusSubmitMessage;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?aa._fromProtobuf(s.topicID):void 0,message:s.message!=null?s.message:void 0}),e,t,n,i,a)}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?aa.fromString(e):e.clone(),this}get message(){return this._message}getMessage(){return this._message}setMessage(e){return this._requireNotFrozen(),e=SJ(e),this._message=e instanceof Uint8Array?e:i3(e),this}get maxChunks(){return this._maxChunks}getMaxChunks(){return this._maxChunks}setMaxChunks(e){return this._requireNotFrozen(),this._maxChunks=e,this}get chunkSize(){return this._chunkSize}getChunkSize(){return this._chunkSize}setChunkSize(e){return this._chunkSize=e,this}freezeWith(e){if(super.freezeWith(e),this._message==null)return this;let t=Math.floor((this._message.length+(this._chunkSize-1))/this._chunkSize);if(t>this._maxChunks)throw new Error(`Message with size ${this._message.length} too long for ${this._maxChunks} chunks`);let n=this._getTransactionId()._toProtobuf(),i=this._getTransactionId();this._transactionIds.locked=!1,this._transactions.clear(),this._transactionIds.clear(),this._signedTransactions.clear();for(let a=0;a<t;a++){this._chunkInfo={initialTransactionID:n,total:t,number:a+1},this._transactionIds.push(i),this._transactionIds.advance();for(let o of this._nodeAccountIds.list)this._signedTransactions.push(this._makeSignedTransaction(o));i=new Qr(i.accountId,new ut(i.validStart.seconds,i.validStart.nanos.add(1)))}return this._transactionIds.advance(),this._chunkInfo=null,this}schedule(){if(this._requireNotFrozen(),this._message!=null&&this._message.length>this._chunkSize)throw new Error(`cannot schedule \`TopicMessageSubmitTransaction\` with message over ${this._chunkSize} bytes`);return super.schedule()}async execute(e,t){return(await this.executeAll(e,t))[0]}async executeAll(e,t){super._isFrozen()||this.freezeWith(e);let n=this._getTransactionId(),i=e.operatorAccountId;i!=null&&i.equals(n.accountId)&&await super.signWithOperator(e);let a=[],o=t;for(let s=0;s<this._transactionIds.length;s++){let c=Date.now();a.push(await super.execute(e,o)),o!=null&&(o=Date.now()-c)}return a}_execute(e,t){return e.consensus.submitMessage(t)}_getTransactionDataCase(){return"consensusSubmitMessage"}_makeTransactionData(){if(this._chunkInfo!=null&&this._message!=null){let t=(this._chunkInfo.number-1)*this._chunkSize,n=t+this._chunkSize;return n>this._message.length&&(n=this._message.length),{topicID:this._topicId!=null?this._topicId._toProtobuf():null,message:this._message.slice(t,n),chunkInfo:this._chunkInfo}}else return{topicID:this._topicId!=null?this._topicId._toProtobuf():null,message:this._message}}_getLogId(){return`TopicMessageSubmitTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("consensusSubmitMessage",Hv._fromProtobuf);var Kv=class r extends ke{constructor(e={}){super(),this._topicId=null,e.topicId!=null&&this.setTopicId(e.topicId),this._topicMemo=null,e.topicMemo!=null&&this.setTopicMemo(e.topicMemo),this._submitKey=null,e.submitKey!=null&&this.setSubmitKey(e.submitKey),this._adminKey=null,e.adminKey!=null&&this.setAdminKey(e.adminKey),this._autoRenewAccountId=null,e.autoRenewAccountId!=null&&this.setAutoRenewAccountId(e.autoRenewAccountId),this._autoRenewPeriod=null,e.autoRenewPeriod!=null&&this.setAutoRenewPeriod(e.autoRenewPeriod),this._expirationTime=null,e.expirationTime!=null&&this.setExpirationTime(e.expirationTime)}static _fromProtobuf(e,t,n,i,a){let s=a[0].consensusUpdateTopic;return ke._fromProtobufTransactions(new r({topicId:s.topicID!=null?aa._fromProtobuf(s.topicID):void 0,adminKey:s.adminKey!=null?nt._fromProtobufKey(s.adminKey):void 0,submitKey:s.submitKey!=null?nt._fromProtobufKey(s.submitKey):void 0,autoRenewAccountId:s.autoRenewAccount!=null?ne._fromProtobuf(s.autoRenewAccount):void 0,autoRenewPeriod:s.autoRenewPeriod!=null&&s.autoRenewPeriod.seconds!=null?s.autoRenewPeriod.seconds:void 0,topicMemo:s.memo!=null&&s.memo.value!=null?s.memo.value:void 0,expirationTime:s.expirationTime!=null?ut._fromProtobuf(s.expirationTime):void 0}),e,t,n,i,a)}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof Date?ut.fromDate(e):e,this}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId=typeof e=="string"?aa.fromString(e):e.clone(),this}clearTopicId(){return this._requireNotFrozen(),this._topicId=null,this}get topicMemo(){return this._topicMemo}setTopicMemo(e){return this._requireNotFrozen(),this._topicMemo=e,this}clearTopicMemo(){return this._requireNotFrozen(),this._topicMemo=null,this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}clearAdminKey(){return this._requireNotFrozen(),this._adminKey=null,this}get submitKey(){return this._submitKey}setSubmitKey(e){return this._requireNotFrozen(),this._submitKey=e,this}clearSubmitKey(){return this._requireNotFrozen(),this._submitKey=null,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof ne?e:ne.fromString(e),this}clearAutoRenewAccountId(){return this._requireNotFrozen(),this._autoRenewAccountId=null,this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof pr?e:new pr(e),this}_validateChecksums(e){this._topicId!=null&&this._topicId.validateChecksum(e),this._autoRenewAccountId!=null&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.consensus.updateTopic(t)}_getTransactionDataCase(){return"consensusUpdateTopic"}_makeTransactionData(){return{topicID:this._topicId!=null?this._topicId._toProtobuf():null,adminKey:this._adminKey!=null?this._adminKey._toProtobufKey():null,submitKey:this._submitKey!=null?this._submitKey._toProtobufKey():null,memo:this._topicMemo!=null?{value:this._topicMemo}:null,autoRenewAccount:this._autoRenewAccountId!=null?this._autoRenewAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod!=null?this._autoRenewPeriod._toProtobuf():null,expirationTime:this._expirationTime!=null?this._expirationTime._toProtobuf():null}}_getLogId(){return`TopicUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("consensusUpdateTopic",Kv._fromProtobuf);var Wv=Oe(Jt(),1);var zv=class extends fi{constructor(){super(e=>De.fromString(e))}};var Gv=class r extends fi{constructor(){super(e=>ne.fromString(e))}static _fromProtobuf(e){let t=new r;for(let n of e.accountAmounts!=null?e.accountAmounts:[]){let i=ne._fromProtobuf(n.accountID);t._set(i,Ge.fromTinybars(n.amount))}return t}};var GB=Oe(Jt(),1);var Fm=class r{constructor(e){this.tokenId=e.tokenId instanceof De?e.tokenId:De.fromString(e.tokenId),this.senderAccountId=e.senderAccountId instanceof ne?e.senderAccountId:ne.fromString(e.senderAccountId),this.receiverAccountId=e.receiverAccountId instanceof ne?e.receiverAccountId:ne.fromString(e.receiverAccountId),this.serialNumber=GB.default.fromValue(e.serialNumber),this.isApproved=e.isApproved}static _fromProtobuf(e){let t=[];for(let n of e){let i=De._fromProtobuf(n.token);for(let a of n.nftTransfers!=null?n.nftTransfers:[])t.push(new r({tokenId:i,senderAccountId:ne._fromProtobuf(a.senderAccountID),receiverAccountId:ne._fromProtobuf(a.receiverAccountID),serialNumber:a.serialNumber!=null?a.serialNumber:GB.default.ZERO,isApproved:a.isApproval==!0}))}return t}_toProtobuf(){return{senderAccountID:this.senderAccountId._toProtobuf(),receiverAccountID:this.receiverAccountId._toProtobuf(),serialNumber:this.serialNumber,isApproval:this.isApproved}}};var Qv=class r extends ke{constructor(e={}){super(),this._tokenTransfers=[],this._hbarTransfers=[],this._nftTransfers=[],this._defaultMaxTransactionFee=new Ge(1);for(let t of e.tokenTransfers!=null?e.tokenTransfers:[])this.addTokenTransfer(t.tokenId,t.accountId,t.amount);for(let t of e.hbarTransfers!=null?e.hbarTransfers:[])this.addHbarTransfer(t.accountId,t.amount);for(let t of e.nftTransfers!=null?e.nftTransfers:[])this.addNftTransfer(t.tokenId,t.serial,t.sender,t.recipient)}static _fromProtobuf(e,t,n,i,a){let s=a[0].cryptoTransfer,c=new r;return c._tokenTransfers=Wd._fromProtobuf(s.tokenTransfers!=null?s.tokenTransfers:[]),c._hbarTransfers=uu._fromProtobuf(s.transfers!=null?s.transfers.accountAmounts!=null?s.transfers.accountAmounts:[]:[]),c._nftTransfers=Fm._fromProtobuf(s.tokenTransfers!=null?s.tokenTransfers:[]),ke._fromProtobufTransactions(c,e,t,n,i,a)}get tokenTransfers(){let e=new i1;for(let t of this._tokenTransfers){let n=e.get(t.tokenId);n!=null?n._set(t.accountId,t.amount):(n=new n1,n._set(t.accountId,t.amount),e._set(t.tokenId,n))}return e}_addTokenTransfer(e,t,n,i){this._requireNotFrozen();let a=e instanceof De?e:De.fromString(e),o=t instanceof ne?t:ne.fromString(t),s=n instanceof Wv.default?n:Wv.default.fromNumber(n);for(let c of this._tokenTransfers)if(c.tokenId.compare(a)===0&&c.accountId.compare(o)===0)return c.amount=c.amount.add(s),c.expectedDecimals=null,this;return this._tokenTransfers.push(new Wd({tokenId:e,accountId:t,expectedDecimals:null,amount:n,isApproved:i})),this}addTokenTransfer(e,t,n){return this._addTokenTransfer(e,t,n,!1)}addApprovedTokenTransfer(e,t,n){return this._addTokenTransfer(e,t,n,!0)}addTokenTransferWithDecimals(e,t,n,i){this._requireNotFrozen();let a=e instanceof De?e:De.fromString(e),o=t instanceof ne?t:ne.fromString(t),s=n instanceof Wv.default?n:Wv.default.fromNumber(n),c=!1;for(let l of this._tokenTransfers)if(l.tokenId.compare(a)===0){if(l.expectedDecimals!=null&&l.expectedDecimals!==i)throw new Error("expected decimals mis-match");l.expectedDecimals=i,l.accountId.compare(o)===0&&(l.amount=l.amount.add(s),l.expectedDecimals=i,c=!0)}return c?this:(this._tokenTransfers.push(new Wd({tokenId:e,accountId:t,expectedDecimals:i,amount:n,isApproved:!1})),this)}get tokenIdDecimals(){let e=new zv;for(let t of this._tokenTransfers)e._set(t.tokenId,t.expectedDecimals);return e}get hbarTransfers(){let e=new Gv;for(let t of this._hbarTransfers)e._set(t.accountId,t.amount);return e}_addHbarTransfer(e,t,n){this._requireNotFrozen();let i=e instanceof ne?e.clone():ne.fromString(e),a=t instanceof Ge?t:new Ge(t);for(let o of this._hbarTransfers)if(o.accountId.compare(i)===0)return o.amount=Ge.fromTinybars(o.amount.toTinybars().add(a.toTinybars())),this;return this._hbarTransfers.push(new uu({accountId:i,amount:a,isApproved:n})),this}addHbarTransfer(e,t){return this._addHbarTransfer(e,t,!1)}addApprovedHbarTransfer(e,t){return this._addHbarTransfer(e,t,!0)}_validateChecksums(e){for(let t of this._hbarTransfers)t.accountId.validateChecksum(e);for(let t of this._tokenTransfers)t.tokenId.validateChecksum(e),t.accountId.validateChecksum(e);for(let t of this._nftTransfers)t.tokenId.validateChecksum(e),t.senderAccountId.validateChecksum(e),t.receiverAccountId.validateChecksum(e)}get nftTransfers(){let e=new a1;for(let t of this._nftTransfers){let n=e.get(t.tokenId),i={sender:t.senderAccountId,recipient:t.receiverAccountId,serial:t.serialNumber,isApproved:t.isApproved};n!=null?n.push(i):e._set(t.tokenId,[i])}return e}_addNftTransfer(e,t,n,i,a){this._requireNotFrozen();let o,s,c;if(t instanceof sa)o=t,s=typeof n=="string"?ne.fromString(n):n,c=typeof i=="string"?ne.fromString(i):i;else if(t instanceof De)o=new sa(t,n),s=typeof i=="string"?ne.fromString(i):i,c=typeof a=="string"?ne.fromString(a):a;else try{o=sa.fromString(t),s=typeof n=="string"?ne.fromString(n):n,c=typeof i=="string"?ne.fromString(i):i}catch{let u=De.fromString(t);o=new sa(u,n),s=typeof i=="string"?ne.fromString(i):i,c=typeof a=="string"?ne.fromString(a):a}for(let l of this._nftTransfers)if(l.tokenId.compare(o.tokenId)===0&&l.serialNumber.compare(o.serial)===0)return l.senderAccountId=s,l.receiverAccountId=c,this;return this._nftTransfers.push(new Fm({tokenId:o.tokenId,serialNumber:o.serial,senderAccountId:s,receiverAccountId:c,isApproved:e})),this}addNftTransfer(e,t,n,i){return this._addNftTransfer(!1,e,t,n,i)}addApprovedNftTransfer(e,t,n,i){return this._addNftTransfer(!0,e,t,n,i)}setHbarTransferApproval(e,t){let n=typeof e=="string"?ne.fromString(e):e;for(let i of this._hbarTransfers)i.accountId.compare(n)===0&&(i.isApproved=t);return this}setTokenTransferApproval(e,t,n){let i=typeof e=="string"?De.fromString(e):e,a=typeof t=="string"?ne.fromString(t):t;for(let o of this._tokenTransfers)o.tokenId.compare(i)===0&&o.accountId.compare(a)===0&&(o.isApproved=n);return this}setNftTransferApproval(e,t){let n=typeof e=="string"?sa.fromString(e):e;for(let i of this._nftTransfers)i.tokenId.compare(n.tokenId)===0&&i.serialNumber.compare(n.serial)===0&&(i.isApproved=t);return this}_execute(e,t){return e.crypto.cryptoTransfer(t)}_getTransactionDataCase(){return"cryptoTransfer"}_makeTransactionData(){let e=[];this._tokenTransfers.sort((i,a)=>{let o=i.tokenId.compare(a.tokenId);return o!==0?o:i.accountId.compare(a.accountId)}),this._nftTransfers.sort((i,a)=>{let o=i.senderAccountId.compare(a.senderAccountId);if(o!=0)return o;let s=i.receiverAccountId.compare(a.receiverAccountId);return s!=0?s:i.serialNumber.compare(a.serialNumber)});let t=0,n=0;for(;t<this._tokenTransfers.length||n<this._nftTransfers.length;)if(t<this._tokenTransfers.length&&n<this._nftTransfers.length){let i=this._tokenTransfers[t].tokenId,a=this._nftTransfers[n].tokenId,o=e.length>0?e[e.length-1]:null,s=o!=null?o.tokenId:null;if(o!=null&&s!=null&&s.compare(i)===0){o.transfers.push(this._tokenTransfers[t++]);continue}if(o!=null&&s!=null&&s.compare(a)===0){o.nftTransfers.push(this._nftTransfers[n++]);continue}let c=i.compare(a);c===0?e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[this._nftTransfers[n++]]}):c<0?e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[]}):e.push({tokenId:a,expectedDecimals:null,transfers:[],nftTransfers:[this._nftTransfers[n++]]})}else if(t<this._tokenTransfers.length){let i=this._tokenTransfers[t].tokenId,a;for(let s of e)s.tokenId.compare(i)===0&&(a=s);let o=a!=null?a.tokenId:null;if(a!=null&&o!=null&&o.compare(i)===0){a.transfers.push(this._tokenTransfers[t++]);continue}e.push({tokenId:i,expectedDecimals:this._tokenTransfers[t].expectedDecimals,transfers:[this._tokenTransfers[t++]],nftTransfers:[]})}else if(n<this._nftTransfers.length){let i=this._nftTransfers[n].tokenId,a;for(let s of e)s.tokenId.compare(i)===0&&(a=s);let o=a!=null?a.tokenId:null;if(a!=null&&o!=null&&o.compare(i)===0){a.nftTransfers.push(this._nftTransfers[n++]);continue}e.push({tokenId:i,expectedDecimals:null,transfers:[],nftTransfers:[this._nftTransfers[n++]]})}return this._hbarTransfers.sort((i,a)=>i.accountId.compare(a.accountId)),{transfers:{accountAmounts:this._hbarTransfers.map(i=>({accountID:i.accountId._toProtobuf(),amount:i.amount.toTinybars(),isApproval:i.isApproved}))},tokenTransfers:e.map(i=>({token:i.tokenId._toProtobuf(),expectedDecimals:i.expectedDecimals!=null?{value:i.expectedDecimals}:null,transfers:i.transfers.map(a=>a._toProtobuf()),nftTransfers:i.nftTransfers.map(a=>a._toProtobuf())}))}}_getLogId(){return`TransferTransaction:${this._transactionIds.current.validStart.toString()}`}};We.set("cryptoTransfer",Qv._fromProtobuf);var Um=class r{constructor(e,t,n){let i=typeof t=="string"?Xc.fromStringDer(t):t;this.publicKey=i.publicKey,this.signer=a=>Promise.resolve(i.sign(a)),this.provider=n,this.accountId=typeof e=="string"?ne.fromString(e):e}static createRandomED25519(){let e=Xc.generateED25519(),n=e.publicKey.toAccountId(0,0);return Promise.resolve(new r(n,e))}static createRandomECDSA(){let e=Xc.generateECDSA(),n=e.publicKey.toAccountId(0,0);return Promise.resolve(new r(n,e))}getProvider(){return this.provider}getAccountId(){return this.accountId}getAccountKey(){return this.publicKey}getLedgerId(){return this.provider==null?null:this.provider.getLedgerId()}getNetwork(){return this.provider==null?{}:this.provider.getNetwork()}getMirrorNetwork(){return this.provider==null?[]:this.provider.getMirrorNetwork()}async sign(e){let t=[];for(let n of e)t.push(new Pm({publicKey:this.publicKey,signature:await this.signer(n),accountId:this.accountId}));return t}getAccountBalance(){return this.call(new ec().setAccountId(this.accountId))}getAccountInfo(){return this.call(new sl().setAccountId(this.accountId))}getAccountRecords(){return this.call(new Eu().setAccountId(this.accountId))}signTransaction(e){return e.signWith(this.publicKey,this.signer)}checkTransaction(e){let t=e.transactionId;if(t!=null&&t.accountId!=null&&t.accountId.compare(this.accountId)!=0)throw new Error("transaction's ID constructed with a different account ID");if(this.provider==null)return Promise.resolve(e);let n=(e.nodeAccountIds!=null?e.nodeAccountIds:[]).map(a=>a.toString()),i=Object.values(this.provider.getNetwork()).map(a=>a.toString());if(!n.reduce((a,o)=>a&&i.includes(o),!0))throw new Error("Transaction already set node account IDs to values not within the current network");return Promise.resolve(e)}populateTransaction(e){if(e._freezeWithAccountId(this.accountId),e.transactionId==null&&e.setTransactionId(Qr.generate(this.accountId)),e.nodeAccountIds!=null&&e.nodeAccountIds.length!=0)return Promise.resolve(e.freeze());if(this.provider==null)return Promise.resolve(e);let t=Object.values(this.provider.getNetwork()).map(n=>typeof n=="string"?ne.fromString(n):n);return Nw(t),e.setNodeAccountIds(t.slice(0,(t.length+3-1)/3)),Promise.resolve(e.freeze())}call(e){if(this.provider==null)throw new Error("cannot send request with an wallet that doesn't contain a provider");return this.provider.call(e._setOperatorWith(this.accountId,this.publicKey,this.signer))}};var HYe=Oe(Ale(),1);var Oa=class r{constructor(e){this._name=e,Object.freeze(this)}toString(){switch(this){case r.Silent:return"silent";case r.Trace:return"trace";case r.Debug:return"debug";case r.Info:return"info";case r.Warn:return"warn";case r.Error:return"error";case r.Fatal:return"fatal";default:return`Unknown log level (${this._name})`}}static _fromString(e){switch(e){case"silent":return r.Silent;case"trace":return r.Trace;case"debug":return r.Debug;case"info":return r.Info;case"warn":return r.Warn;case"error":return r.Error;case"fatal":return r.Fatal;default:throw new Error(`Unknown log level: ${e}`)}}};Oa.Silent=new Oa("silent");Oa.Trace=new Oa("trace");Oa.Debug=new Oa("debug");Oa.Info=new Oa("info");Oa.Warn=new Oa("warn");Oa.Error=new Oa("error");Oa.Fatal=new Oa("fatal");var Tle=Oe(br(),1),aA=class extends cu{constructor(e){super(),this._query=e,this._grpcDeadline=e._grpcDeadline,this._requestTimeout=e._requestTimeout,this._nodeAccountIds=e._nodeAccountIds.clone(),this._operator=e._operator,this._header=null}_getTransactionId(){return this._query._getTransactionId()}_getLogId(){return`CostQuery:${this._query._getLogId()}`}async _beforeExecute(e){if(e==null)throw new Error("Cannot do CostQuery without Client");let t=this._operator!=null?this._operator:e._operator;if(t==null)throw new Error("`client` must have an `operator` or an explicit payment transaction must be provided");this._query._nodeAccountIds.isEmpty&&this._query._nodeAccountIds.setList(e._network.getNodeAccountIdsForExecute());let n=Qr.generate(t.accountId);this._query.paymentTransactionId==null&&this._query.setPaymentTransactionId(n);let i=this._getLogId(),a=new ne(0),o=Qr.generate(new ne(0)),s=new Ge(0);this._logger&&this._logger.debug(`[${i}] making a payment transaction for node ${a.toString()} and transaction ID ${o.toString()} with amount ${s.toString()}`),this._header={payment:await LE(o,new ne(0),t,s),responseType:Tle.proto.ResponseType.COST_ANSWER}}_makeRequestAsync(){return Promise.resolve(this._query._onMakeRequest(this._header))}_shouldRetry(e,t){return this._query._shouldRetry(e,t)}_mapStatusError(e,t){return this._query._mapStatusError(e,t)}_mapResponse(e,t,n){let i=this._query._mapResponseHeader(e).cost;return Promise.resolve(Ge.fromTinybars(i))}_execute(e,t){return this._query._execute(e,t)}_requestToBytes(e){return this._query._requestToBytes(e)}_responseToBytes(e){return this._query._responseToBytes(e)}};FE.push(r=>new aA(r));import zit from"fs";import Git from"util";var KYe=/^(\S+):(\d+)$/,Xv=class r{constructor(e={}){if(e.address!=null){let t=KYe.exec(e.address);if(t==null)throw new Error(`failed to parse address: ${e.address}`);this._address=t[1],this._port=t[2]!=null?parseInt(t[2]):null}else if(e.host!=null&&e.port!=null)this._address=e.host,this._port=e.port;else throw new Error(`failed to create a managed node address: ${JSON.stringify(e)}`);Object.freeze(this)}static fromString(e){return new r({address:e})}toInsecure(){let e=this.port===50212?50211:this.port;return new r({host:this.address,port:e})}toSecure(){let e=this.port===50211?50212:this.port;return new r({host:this.address,port:e})}get address(){return this._address}get port(){return this._port}isTransportSecurity(){return this._port==50212||this._port==443}toString(){return this.port==null?this.address:`${this.address}:${this.port}`}};var b1=class{constructor(e={}){if(e.newNode!=null)this._address=typeof e.newNode.address=="string"?Xv.fromString(e.newNode.address):e.newNode.address,this._cert=void 0,this._channel=null,this._channelInitFunction=e.newNode.channelInitFunction,this._lastUsed=Date.now(),this._readmitTime=Date.now(),this._useCount=0,this._badGrpcStatusCount=0,this._minBackoff=8e3,this._maxBackoff=1e3*60*60,this._currentBackoff=this._minBackoff;else if(e.cloneNode!=null)this._address=e.cloneNode.address,this._cert=e.cloneNode.node._cert,this._channel=e.cloneNode.node._channel,this._channelInitFunction=e.cloneNode.node._channelInitFunction,this._currentBackoff=e.cloneNode.node._currentBackoff,this._lastUsed=e.cloneNode.node._lastUsed,this._readmitTime=e.cloneNode.node._readmitTime,this._useCount=e.cloneNode.node._useCount,this._badGrpcStatusCount=e.cloneNode.node._badGrpcStatusCount,this._minBackoff=e.cloneNode.node._minBackoff,this._maxBackoff=e.cloneNode.node._minBackoff;else throw new Error(`failed to create ManagedNode: ${JSON.stringify(e)}`)}getKey(){throw new Error("not implemented")}setCert(e){return this}get address(){return this._address}get attempts(){return this._badGrpcStatusCount}get minBackoff(){return this._minBackoff}setMinBackoff(e){return this._currentBackoff<=e&&(this._currentBackoff=e),this._minBackoff=e,this}get maxBackoff(){return this._maxBackoff}setMaxBackoff(e){return this._currentBackoff<=e&&(this._currentBackoff=e),this._maxBackoff=e,this}getChannel(){return this._useCount++,this.__lastUsed=Date.now(),this._channel!=null?this._channel:(this._channel=this._channelInitFunction(this.address.toString(),this._cert),this._channel)}isHealthy(){return this._readmitTime<=Date.now()}increaseBackoff(){this._currentBackoff=Math.min(this._currentBackoff*2,this._maxBackoff),this._readmitTime=Date.now()+this._currentBackoff}decreaseBackoff(){this._currentBackoff=Math.max(this._currentBackoff/2,this._minBackoff)}getRemainingTime(){return this._readmitTime-this._lastUsed}backoff(){return new Promise(e=>setTimeout(e,this.getRemainingTime()))}compare(e){let t=this.getRemainingTime()-e.getRemainingTime();return t!=0||(t=this._currentBackoff-e._currentBackoff,t!=0)||(t=this._badGrpcStatusCount-e._badGrpcStatusCount,t!=0)||(t=this._useCount-e._useCount,t!=0)?t:this._lastUsed-e._lastUsed}close(){this._channel!=null&&this._channel.close(),this._channel=null}};var Sle={"0.0.3":`-----BEGIN CERTIFICATE-----
10640
10641
  MIICnzCCAiWgAwIBAgIUenyqJ4UaFBbwokatcUqAwW3o3rswCgYIKoZIzj0EAwMw
10641
10642
  gYQxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJUWDETMBEGA1UEBwwKUmljaGFyZHNv
10642
10643
  bjEPMA0GA1UECgwGSGVkZXJhMQ8wDQYDVQQLDAZIZWRlcmExEDAOBgNVBAMMBzAw