@hashgraphonline/standards-sdk 0.0.42 → 0.0.43

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.
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).StandardsSDK={})}(this,(function(exports){"use strict";var __defProp2=Object.defineProperty,__typeError=e=>{throw TypeError(e)},__defNormalProp2=(e,t,n)=>t in e?__defProp2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__publicField2=(e,t,n)=>__defNormalProp2(e,"symbol"!=typeof t?t+"":t,n),__accessCheck=(e,t,n)=>t.has(e)||__typeError("Cannot "+n),__privateGet=(e,t,n)=>(__accessCheck(e,t,"read from private field"),n?n.call(e):t.get(e)),__privateAdd=(e,t,n)=>t.has(e)?__typeError("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),__privateSet=(e,t,n,o)=>(__accessCheck(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),__privateMethod=(e,t,n)=>(__accessCheck(e,t,"access private method"),n),__privateWrapper=(e,t,n,o)=>({set _(o){__privateSet(e,t,o,n)},get _(){return __privateGet(e,t,o)}}),_names,_data,_dataLength,_Writer_instances,writeData_fn,_data2,_offset,_bytesRead,_parent,_maxInflation,_Reader_instances,incrementBytesRead_fn,peekBytes_fn,_options,_offset2,_tokens,_TokenString_instances,subTokenString_fn,_ParamType_instances,walkAsync_fn,_AbiCoder_instances,getCoder_fn,_errors,_events,_functions,_abiCoder,_Interface_instances,getFunction_fn,getEvent_fn;function _mergeNamespaces(e,t){for(var n=0;n<t.length;n++){const o=t[n];if("string"!=typeof o&&!Array.isArray(o))for(const t in o)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(o,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}let Logger$2=class e{constructor(e={}){this.level=e.level||"info",this.module=e.module||"",this.enableTimestamp=!1!==e.enableTimestamp,this.silent=e.silent||!1}static getInstance(t={}){return e.instance||(e.instance=new e(t)),e.instance}setLogLevel(e){this.level=e}setSilent(e){this.silent=e}setModule(e){this.module=e}shouldLog(e){if(this.silent)return!1;const t=["debug","info","warn","error"];return t.indexOf(e)>=t.indexOf(this.level)}formatMessage(e,t,n){const o={level:e,message:t,timestamp:(new Date).toISOString(),data:n};return this.module&&(o.module=this.module),o}log(e,t,n){if(!this.shouldLog(e))return;const o=this.formatMessage(e,t,n),r=this.formatOutputMessage(o);switch(e){case"debug":console.debug(r,n||"");break;case"info":console.info(r,n||"");break;case"warn":console.warn(r,n||"");break;case"error":console.error(r,n||"")}}formatOutputMessage(e){const t=[];return this.enableTimestamp&&t.push(`[${e.timestamp}]`),e.module&&t.push(`[${e.module}]`),t.push(`[${e.level.toUpperCase()}]`),t.push(e.message),t.join(" ")}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}};const sleep=e=>new Promise((t=>setTimeout(t,e)));class HCS{constructor(){this.modelViewerLoaded=!1,this.modelViewerLoading=null,this.config={cdnUrl:"https://kiloscribe.com/api/inscription-cdn/",network:"mainnet",retryAttempts:3,retryBackoff:300,debug:!1,showLoadingIndicator:!1,loadingCallbackName:null},this.configMapping={hcsCdnUrl:"cdnUrl",hcsNetwork:"network",hcsRetryAttempts:"retryAttempts",hcsRetryBackoff:"retryBackoff",hcsDebug:"debug",hcsShowLoadingIndicator:"showLoadingIndicator",hcsLoadingCallbackName:"loadingCallbackName"},this.LoadedScripts={},this.LoadedWasm={},this.LoadedImages={},this.LoadedVideos={},this.LoadedAudios={},this.LoadedAudioUrls={},this.LoadedGLBs={},this.scriptLoadedEvent=new Event("HCSScriptLoaded"),this.loadQueue=[],this.isProcessingQueue=!1;try{this.logger=Logger$2.getInstance({module:"HCS-3",level:this.config.debug?"debug":"error"})}catch(e){this.logger=this.createFallbackLogger()}}createFallbackLogger(){return{debug:(...e)=>this.config.debug&&console.debug("[HCS-3]",...e),info:(...e)=>this.config.debug&&console.info("[HCS-3]",...e),warn:(...e)=>console.warn("[HCS-3]",...e),error:(...e)=>console.error("[HCS-3]",...e),setLogLevel:e=>{this.config.debug="debug"===e}}}log(...e){if(0===e.length)this.logger.debug("");else if(1===e.length)this.logger.debug(String(e[0]));else{const t=String(e[0]),n=e.slice(1);this.logger.debug(t,n)}}error(...e){if(0===e.length)this.logger.error("");else if(1===e.length)this.logger.error(String(e[0]));else{const t=String(e[0]),n=e.slice(1);this.logger.error(t,n)}}loadConfigFromHTML(){const e=document.querySelector("script[data-hcs-config]");e&&(Object.keys(this.configMapping).forEach((t=>{if(e.dataset[t]){const n=this.configMapping[t];let o=e.dataset[t];"true"===o&&(o=!0),"false"===o&&(o=!1),isNaN(Number(o))||""===o||(o=Number(o)),this.config[n]=o}})),this.logger.setLogLevel(this.config.debug?"debug":"error")),this.log("Loaded config:",this.config)}updateLoadingStatus(e,t){if("loaded"!==this.LoadedScripts[e]&&(this.config.showLoadingIndicator&&console.log("[HCS Loading] "+e+" : "+t),this.LoadedScripts[e]=t,this.config.loadingCallbackName&&"function"==typeof window[this.config.loadingCallbackName])){const n=window[this.config.loadingCallbackName];"function"==typeof n&&n(e,t)}}async fetchWithRetry(e,t=this.config.retryAttempts,n=this.config.retryBackoff){try{const t=await fetch(e);if(!t.ok)throw new Error("HTTP error! status: "+t.status);return t}catch(o){if(t>0)return this.log("Retrying fetch for "+e+" Attempts left: "+(t-1)),await this.sleep(n),this.fetchWithRetry(e,t-1,2*n);throw o}}sleep(e){return new Promise((t=>setTimeout(t,e)))}isDuplicate(e){return!!this.LoadedScripts[e]}async retrieveHCS1Data(e,t=this.config.cdnUrl,n=this.config.network){const o=n.replace(/['"]+/g,""),r=await this.fetchWithRetry(t+e+"?network="+o);return await r.blob()}async loadScript(e){const t=e.getAttribute("data-src"),n=e.getAttribute("data-script-id"),o=t?.split("/").pop(),r=e.getAttribute("type"),i=e.hasAttribute("data-required"),a="module"===e.getAttribute("type");if(!this.isDuplicate(o||"")){this.updateLoadingStatus(n,"loading");try{const t=e.getAttribute("data-cdn-url")||this.config.cdnUrl,s=e.getAttribute("data-network")||this.config.network,c=await this.retrieveHCS1Data(o,t,s);if("wasm"===r){const t=await c.arrayBuffer(),o=await WebAssembly.compile(t);this.LoadedWasm[n]=await WebAssembly.instantiate(o,{env:{},...e.dataset}),this.updateLoadingStatus(n,"loaded"),window.dispatchEvent(this.scriptLoadedEvent),this.log("Loaded wasm: "+n)}else{const e=await c.text(),t=document.createElement("script");if(t.textContent=e,t.className="hcs-inline-script",n&&t.setAttribute("data-loaded-script-id",n),a){t.type="module";const n=new Blob([e],{type:"application/javascript"});t.src=URL.createObjectURL(n)}document.body.appendChild(t),this.updateLoadingStatus(n,"loaded"),window.dispatchEvent(this.scriptLoadedEvent),this.log("Loaded script: "+n),t.onerror=e=>{if(this.error("Failed to load "+r+": "+n,e),this.updateLoadingStatus(n,"failed"),i)throw e}}}catch(s){if(this.error("Failed to load "+r+": "+n,s),this.updateLoadingStatus(n,"failed"),i)throw s}}}async loadModuleExports(e){const t=document.querySelector('script[data-loaded-script-id="'+e+'"]');if(!t)throw new Error("Module script with id "+e+" not found");const n=t.getAttribute("src");if(!n)throw new Error("Module script "+e+" has no src attribute");try{return await import(n)}catch(o){throw this.error("Failed to import module",o),o}}async loadStylesheet(e){const t=e.getAttribute("data-src"),n=e.getAttribute("data-script-id"),o=t?.split("/").pop(),r=e.hasAttribute("data-required");if(!this.isDuplicate(o||"")){this.updateLoadingStatus(n,"loading");try{const t=e.getAttribute("data-cdn-url")||this.config.cdnUrl,r=e.getAttribute("data-network")||this.config.network,i=await this.retrieveHCS1Data(o,t,r),a=await i.text(),s=document.createElement("style");s.textContent=a,document.head.appendChild(s),this.updateLoadingStatus(n,"loaded"),window.dispatchEvent(this.scriptLoadedEvent),this.log("Loaded and inlined stylesheet: "+n)}catch(i){if(this.error("Failed to load stylesheet: "+n,i),this.updateLoadingStatus(n,"failed"),r)throw i}}}async loadImage(e){const t=e.getAttribute("data-src"),n=t?.split("/").pop();this.log("Loading image: "+n),this.updateLoadingStatus("Image: "+n,"loaded");try{const t=e.getAttribute("data-cdn-url")||this.config.cdnUrl,o=e.getAttribute("data-network")||this.config.network,r=await this.retrieveHCS1Data(n,t,o),i=URL.createObjectURL(r);e.src=i,this.LoadedImages[n]=i,this.updateLoadingStatus("Image: "+n,"loaded"),this.log("Loaded image: "+n)}catch(o){this.error("Failed to load image: "+n,o),this.updateLoadingStatus("Image: "+n,"failed")}}async loadMedia(e,t){const n=e.getAttribute("data-src"),o=n?.split("/").pop();this.log("Loading "+t+": "+o),this.updateLoadingStatus(t+": "+o,"loading");try{const n=e.getAttribute("data-cdn-url")||this.config.cdnUrl,r=e.getAttribute("data-network")||this.config.network,i=await this.retrieveHCS1Data(o,n,r),a=URL.createObjectURL(i);e.src=a,"video"===t?this.LoadedVideos[o]=a:this.LoadedAudioUrls[o]=a,this.updateLoadingStatus(t+": "+o,"loaded"),this.log("Loaded "+t+": "+o)}catch(r){this.error("Failed to load "+t+": "+o,r),this.updateLoadingStatus(t+": "+o,"failed")}}async loadModelViewer(){return this.modelViewerLoading?this.modelViewerLoading:this.modelViewerLoaded?Promise.resolve():(this.modelViewerLoading=new Promise((e=>{const t=document.createElement("script");t.setAttribute("data-src","hcs://1/0.0.7293044"),t.setAttribute("data-script-id","model-viewer"),t.setAttribute("type","module"),window.addEventListener("HCSScriptLoaded",(()=>{this.modelViewerLoaded=!0,e()}),{once:!0}),this.loadScript(t)})),this.modelViewerLoading)}async loadGLB(e){await this.loadModelViewer();const t=e.getAttribute("data-src"),n=t?.split("/").pop();this.log("Loading GLB: "+n),this.updateLoadingStatus("GLB: "+n,"loading");try{const t=e.getAttribute("data-cdn-url")||this.config.cdnUrl,o=e.getAttribute("data-network")||this.config.network;let r;"model-viewer"!==e.tagName.toLowerCase()?(r=document.createElement("model-viewer"),Array.from(e.attributes).forEach((e=>{r.setAttribute(e.name,e.value)})),r.setAttribute("camera-controls",""),r.setAttribute("auto-rotate",""),r.setAttribute("ar",""),e.parentNode?.replaceChild(r,e)):r=e;const i=await this.retrieveHCS1Data(n,t,o),a=URL.createObjectURL(i);r.setAttribute("src",a),this.LoadedGLBs[n]=a,this.updateLoadingStatus("GLB: "+n,"loaded"),this.log("Loaded GLB: "+n)}catch(o){this.error("Failed to load GLB: "+n,o),this.updateLoadingStatus("GLB: "+n,"failed")}}async loadResource(e,t,n){return new Promise((o=>{this.loadQueue.push({element:e,type:t,order:n,resolve:o}),this.processQueue()}))}async processQueue(){if(!this.isProcessingQueue){for(this.isProcessingQueue=!0;this.loadQueue.length>0;){const t=this.loadQueue.shift();try{"script"===t.type?await this.loadScript(t.element):"image"===t.type?await this.loadImage(t.element):"video"===t.type||"audio"===t.type?await this.loadMedia(t.element,t.type):"glb"===t.type?await this.loadGLB(t.element):"css"===t.type&&await this.loadStylesheet(t.element),t.resolve()}catch(e){if(this.error("Error processing queue item:",e),"script"===t.type&&t.element.hasAttribute("data-required"))break}}this.isProcessingQueue=!1}}async replaceHCSInStyle(e){let t=e,n=t.indexOf("hcs://");for(;-1!==n;){let e=n;for(;e<t.length&&!["'",'"'," ",")"].includes(t[e]);)e++;const r=t.substring(n,e),i=r.split("/").pop();try{const o=this.config.cdnUrl,a=this.config.network,s=await this.retrieveHCS1Data(i,o,a),c=URL.createObjectURL(s);t=t.substring(0,n)+c+t.substring(e),this.LoadedImages[i]=c,this.log("Replaced CSS HCS URL: "+r+" with "+c)}catch(o){this.error("Failed to load CSS image: "+i,o)}n=t.indexOf("hcs://",n+1)}return t}async processInlineStyles(){const e=document.querySelectorAll('[style*="hcs://"]');this.log("Found "+e.length+" elements with HCS style references");for(const n of Array.from(e)){const e=n.getAttribute("style");if(e){this.log("Processing style: "+e);const t=await this.replaceHCSInStyle(e);e!==t&&(n.setAttribute("style",t),this.log("Updated style to: "+t))}}const t=document.querySelectorAll("style");for(const n of Array.from(t))if(n.textContent?.includes("hcs://")){const e=await this.replaceHCSInStyle(n.textContent);n.textContent!==e&&(n.textContent=e)}}async init(){return this.loadConfigFromHTML(),new Promise((e=>{const t=async()=>{const t=document.querySelectorAll('script[data-src^="hcs://"]'),n=document.querySelectorAll('img[data-src^="hcs://"], img[src^="hcs://"]'),o=document.querySelectorAll('video[data-src^="hcs://"], video[src^="hcs://"]'),r=document.querySelectorAll('audio[data-src^="hcs://"], audio[src^="hcs://"]'),i=document.querySelectorAll('model-viewer[data-src^="hcs://"]'),a=document.querySelectorAll('link[data-src^="hcs://"]');document.querySelectorAll('[src^="hcs://"]').forEach((e=>{const t=e.getAttribute("src");t&&(e.setAttribute("data-src",t),e.removeAttribute("src"))})),await this.processInlineStyles();const s=[];[{elements:t,type:"script"},{elements:n,type:"image"},{elements:o,type:"video"},{elements:r,type:"audio"},{elements:i,type:"glb"},{elements:a,type:"css"}].forEach((({elements:e,type:t})=>{e.forEach((e=>{const n=parseInt(e.getAttribute("data-load-order")||"")||1/0;s.push(this.loadResource(e,t,n))}))})),await Promise.all(s);const c=new MutationObserver((e=>{e.forEach((e=>{if(e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const t=e;if(t.getAttribute("style")?.includes("hcs://")&&this.processInlineStyles(),"style"===t.tagName.toLowerCase()&&t.textContent?.includes("hcs://")&&this.processInlineStyles(),t.getAttribute("src")?.startsWith("hcs://")){const e=t.getAttribute("src");t.setAttribute("data-src",e),t.removeAttribute("src");switch(t.tagName.toLowerCase()){case"img":this.loadResource(t,"image",1/0);break;case"video":this.loadResource(t,"video",1/0);break;case"audio":this.loadResource(t,"audio",1/0);break;case"script":this.loadResource(t,"script",1/0)}}t.matches('script[data-src^="hcs://"]')?this.loadResource(t,"script",1/0):t.matches('img[data-src^="hcs://"]')?this.loadResource(t,"image",1/0):t.matches('video[data-src^="hcs://"]')?this.loadResource(t,"video",1/0):t.matches('audio[data-src^="hcs://"]')?this.loadResource(t,"audio",1/0):t.matches('model-viewer[data-src^="hcs://"]')?this.loadResource(t,"glb",1/0):t.matches('link[data-src^="hcs://"]')&&this.loadResource(t,"css",1/0);t.querySelectorAll('[data-src^="hcs://"], [src^="hcs://"]').forEach((e=>{const t=e,n=t.tagName.toLowerCase(),o=t.getAttribute("src");switch(o?.startsWith("hcs://")&&(t.setAttribute("data-src",o),t.removeAttribute("src")),n){case"script":this.loadResource(t,"script",1/0);break;case"img":this.loadResource(t,"image",1/0);break;case"video":this.loadResource(t,"video",1/0);break;case"audio":this.loadResource(t,"audio",1/0);break;case"model-viewer":this.loadResource(t,"glb",1/0);break;case"link":this.loadResource(t,"css",1/0)}}))}})),"attributes"===e.type){const t=e.target;if("style"===e.attributeName&&t.getAttribute("style")?.includes("hcs://"))this.processInlineStyles();else if("src"===e.attributeName){const e=t.getAttribute("src");if(e?.startsWith("hcs://")){t.setAttribute("data-src",e),t.removeAttribute("src");const n=t.tagName.toLowerCase();["img","video","audio"].includes(n)&&this.loadResource(t,n,1/0)}}}}))}));document.body?c.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","src","data-src"]}):document.addEventListener("DOMContentLoaded",(()=>{c.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","src","data-src"]})})),e()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()}))}async preloadImage(e){this.log("Loading image:"+e),this.updateLoadingStatus("image: "+e,"loading");const t=await this.retrieveHCS1Data(e),n=URL.createObjectURL(t);return this.LoadedImages[e]=n,this.updateLoadingStatus("image: "+e,"loaded"),n}async preloadAudio(e){const t=document.createElement("audio");t.setAttribute("data-topic-id",e),t.setAttribute("data-src","hcs://1/"+e),document.body.appendChild(t),await this.loadMedia(t,"audio");const n=document.querySelector('audio[data-topic-id="'+e+'"]');return n?this.LoadedAudioUrls[e]=n.src:console.error("Failed to preload audio: "+e),this.LoadedAudioUrls[e]}async playAudio(e,t=1){const n=this.LoadedAudioUrls[e];if(n){const o=new Audio(n);o.volume=t,this.LoadedAudios[e]=o,o.play().catch((e=>{console.error("Failed to play audio:",e)})),o.addEventListener("ended",(()=>{o.remove(),delete this.LoadedAudios[e]}))}else console.error("Audio not preloaded: "+e)}async pauseAudio(e){const t=document.querySelector('audio[data-topic-id="'+e+'"]');t?(console.log("found element",t),t.pause(),this.LoadedAudios[e]?.pause()):this.LoadedAudios[e]?.pause()}async loadAndPlayAudio(e,t=!1,n=1){let o=document.querySelector('audio[data-topic-id="'+e+'"]');if(o)o.volume=n,await o.play();else{const r=document.createElement("audio");r.volume=n,t&&r.setAttribute("autoplay","autoplay"),r.setAttribute("data-topic-id",e),r.setAttribute("data-src","hcs://1/"+e),document.body.appendChild(r),await this.loadMedia(r,"audio"),o=document.querySelector('audio[data-topic-id="'+e+'"]'),t||await o.play()}}}const isServer="undefined"==typeof window;isServer||(window.HCS=new HCS,window.HCS.init().then((()=>{console.log("All HCS resources loaded"),"function"==typeof window.HCSReady&&(console.log("Running HCSReady..."),window.HCSReady())})));class WasmBridge{constructor(){this.wasm=null,this.WASM_VECTOR_LEN=0,this.cachedUint8Memory=null,this.cachedDataViewMemory=null,this.textEncoder=new TextEncoder,this.textDecoder=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),this.textDecoder.decode(),this.logger=Logger$2.getInstance({module:"WasmBridge"})}setLogLevel(e){this.logger.setLogLevel(e)}get wasmInstance(){if(!this.wasm)throw new Error("WASM not initialized");return this.wasm}getUint8Memory(){if(!this.wasm)throw new Error("WASM not initialized");return null!==this.cachedUint8Memory&&0!==this.cachedUint8Memory.byteLength||(this.cachedUint8Memory=new Uint8Array(this.wasm.memory.buffer)),this.cachedUint8Memory}getDataViewMemory(){if(!this.wasm)throw new Error("WASM not initialized");return null!==this.cachedDataViewMemory&&this.cachedDataViewMemory.buffer===this.wasm.memory.buffer||(this.cachedDataViewMemory=new DataView(this.wasm.memory.buffer)),this.cachedDataViewMemory}encodeString(e,t){if(0===e.length)return{read:0,written:0};const n=this.textEncoder.encode(e);return t.set(n),{read:e.length,written:n.length}}passStringToWasm(e,t,n){if(void 0===n){const n=this.textEncoder.encode(e),o=t(n.length,1);return this.getUint8Memory().set(n,o),this.WASM_VECTOR_LEN=n.length,o}let o=this.textEncoder.encode(e).length,r=t(o,1);const i=this.getUint8Memory();let a=0;for(;a<o;a++){const t=e.charCodeAt(a);if(t>127)break;i[r+a]=t}if(a!==o){0!==a&&(e=e.slice(a)),r=n(r,o,o=a+3*this.textEncoder.encode(e).length,1);const t=this.getUint8Memory().subarray(r+a,r+o);a+=this.encodeString(e,t).written}return this.WASM_VECTOR_LEN=a,r}getStringFromWasm(e,t){return e>>>=0,this.textDecoder.decode(this.getUint8Memory().subarray(e,e+t))}createWasmFunction(e){if(!this.wasm)throw new Error("WASM not initialized");return(...t)=>{const n=this.wasm.__wbindgen_add_to_stack_pointer(-16);let o=[0,0];try{const r=[n,...t.map((e=>[this.passStringToWasm(e,this.wasm.__wbindgen_malloc,this.wasm.__wbindgen_realloc),this.WASM_VECTOR_LEN])).flat()];e.apply(this.wasm,r);const i=this.getDataViewMemory().getInt32(n+0,!0),a=this.getDataViewMemory().getInt32(n+4,!0);return o=[i,a],this.getStringFromWasm(i,a)}finally{this.wasm.__wbindgen_add_to_stack_pointer(16),this.wasm.__wbindgen_free(o[0],o[1],1)}}}async initWasm(e){const t=this,n={__wbindgen_placeholder__:{__wbindgen_throw:function(e,n){const o=t.getStringFromWasm(e,n);throw t.logger.error(`WASM error: ${o}`),new Error(o)}}};try{this.logger.debug("Compiling WASM module");const t=await WebAssembly.compile(e);this.logger.debug("Instantiating WASM module");const o=await WebAssembly.instantiate(t,n);return this.wasm=o.exports,this.logger.info("WASM module initialized successfully"),this.wasm}catch(o){throw this.logger.error("Failed to initialize WASM module",o),o}}createStateData(e,t={}){let n={};return e?.c?.inputType?.stateData&&(t.latestRoundData&&Object.keys(e.c.inputType.stateData).every((e=>e in t.latestRoundData))?(n.latestRoundData={},Object.entries(e.c.inputType.stateData).forEach((([e,o])=>{n.latestRoundData[e]=String(t.latestRoundData[e])}))):Object.entries(e.c.inputType.stateData).forEach((([e,o])=>{const r=t[e];r&&"object"==typeof r&&"values"in r&&r.values.length>0?n[e]=String(r.values[0]):n[e]=this.getDefaultValueForType(o)}))),n}getDefaultValueForType(e){return e.startsWith("uint")||e.startsWith("int")||"number"===e?"0":"bool"===e?"false":""}executeWasm(e,t){if(!this.wasm)throw this.logger.error("WASM not initialized"),new Error("WASM not initialized");try{this.logger.debug("Executing WASM with stateData",e);return this.createWasmFunction(this.wasmInstance.process_state)(JSON.stringify(e),JSON.stringify(t))}catch(n){throw this.logger.error("Error executing WASM",n),n}}getParams(){return this.createWasmFunction(this.wasmInstance.get_params)()}}
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).StandardsSDK={})}(this,(function(exports){"use strict";var __defProp2=Object.defineProperty,__typeError=e=>{throw TypeError(e)},__defNormalProp2=(e,t,n)=>t in e?__defProp2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__publicField2=(e,t,n)=>__defNormalProp2(e,"symbol"!=typeof t?t+"":t,n),__accessCheck=(e,t,n)=>t.has(e)||__typeError("Cannot "+n),__privateGet=(e,t,n)=>(__accessCheck(e,t,"read from private field"),n?n.call(e):t.get(e)),__privateAdd=(e,t,n)=>t.has(e)?__typeError("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),__privateSet=(e,t,n,o)=>(__accessCheck(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),__privateMethod=(e,t,n)=>(__accessCheck(e,t,"access private method"),n),__privateWrapper=(e,t,n,o)=>({set _(o){__privateSet(e,t,o,n)},get _(){return __privateGet(e,t,o)}}),_a2,_names,_data,_dataLength,_Writer_instances,writeData_fn,_data2,_offset,_bytesRead,_parent,_maxInflation,_Reader_instances,incrementBytesRead_fn,peekBytes_fn,_options,_offset2,_tokens,_TokenString_instances,subTokenString_fn,_ParamType_instances,walkAsync_fn,_AbiCoder_instances,getCoder_fn,_errors,_events,_functions,_abiCoder,_Interface_instances,getFunction_fn,getEvent_fn;function _mergeNamespaces(e,t){for(var n=0;n<t.length;n++){const o=t[n];if("string"!=typeof o&&!Array.isArray(o))for(const t in o)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(o,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs$1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})})),n}var browser$1={exports:{}},quickFormatUnescaped,hasRequiredQuickFormatUnescaped,hasRequiredBrowser$1;function requireQuickFormatUnescaped(){if(hasRequiredQuickFormatUnescaped)return quickFormatUnescaped;function e(e){try{return JSON.stringify(e)}catch(t){return'"[Circular]"'}}return hasRequiredQuickFormatUnescaped=1,quickFormatUnescaped=function(t,n,o){var r=o&&o.stringify||e;if("object"==typeof t&&null!==t){var i=n.length+1;if(1===i)return t;var a=new Array(i);a[0]=r(t);for(var s=1;s<i;s++)a[s]=r(n[s]);return a.join(" ")}if("string"!=typeof t)return t;var c=n.length;if(0===c)return t;for(var l="",u=0,d=-1,p=t&&t.length||0,f=0;f<p;){if(37===t.charCodeAt(f)&&f+1<p){switch(d=d>-1?d:0,t.charCodeAt(f+1)){case 100:case 102:if(u>=c)break;if(null==n[u])break;d<f&&(l+=t.slice(d,f)),l+=Number(n[u]),d=f+2,f++;break;case 105:if(u>=c)break;if(null==n[u])break;d<f&&(l+=t.slice(d,f)),l+=Math.floor(Number(n[u])),d=f+2,f++;break;case 79:case 111:case 106:if(u>=c)break;if(void 0===n[u])break;d<f&&(l+=t.slice(d,f));var h=typeof n[u];if("string"===h){l+="'"+n[u]+"'",d=f+2,f++;break}if("function"===h){l+=n[u].name||"<anonymous>",d=f+2,f++;break}l+=r(n[u]),d=f+2,f++;break;case 115:if(u>=c)break;d<f&&(l+=t.slice(d,f)),l+=String(n[u]),d=f+2,f++;break;case 37:d<f&&(l+=t.slice(d,f)),l+="%",d=f+2,f++,u--}++u}++f}if(-1===d)return t;d<p&&(l+=t.slice(d));return l}}function requireBrowser$1(){if(hasRequiredBrowser$1)return browser$1.exports;hasRequiredBrowser$1=1;const e=requireQuickFormatUnescaped();browser$1.exports=c;const t=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},n={mapHttpRequest:h,mapHttpResponse:h,wrapRequestSerializer:m,wrapResponseSerializer:m,wrapErrorSerializer:m,req:h,res:h,err:p,errWithCause:p};function o(e,t){return"silent"===e?1/0:t.levels.values[e]}const r=Symbol("pino.logFuncs"),i=Symbol("pino.hierarchy"),a={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function s(e,t){const n={logger:t,parent:e[i]};t[i]=n}function c(e){(e=e||{}).browser=e.browser||{};const n=e.browser.transmit;if(n&&"function"!=typeof n.send)throw Error("pino: transmit option must have a send function");const i=e.browser.write||t;e.browser.write&&(e.browser.asObject=!0);const p=e.serializers||{},h=function(e,t){if(Array.isArray(e))return e.filter((function(e){return"!stdSerializers.err"!==e}));return!0===e&&Object.keys(t)}(e.browser.serialize,p);let m=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(m=!1);const g=Object.keys(e.customLevels||{}),b=["error","fatal","warn","info","debug","trace"].concat(g);"function"==typeof i&&b.forEach((function(e){i[e]=i})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const k=e.level||"info",w=Object.create(i);w.log||(w.log=y),function(e,n,o){const i={};n.forEach((e=>{i[e]=o[e]?o[e]:t[e]||t[a[e]||"log"]||y})),e[r]=i}(w,b,i),s({},w),Object.defineProperty(w,"levelVal",{get:function(){return o(this.level,this)}}),Object.defineProperty(w,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,l(this,v,w,"error"),l(this,v,w,"fatal"),l(this,v,w,"warn"),l(this,v,w,"info"),l(this,v,w,"debug"),l(this,v,w,"trace"),g.forEach((e=>{l(this,v,w,e)}))}});const v={transmit:n,serialize:h,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:b,timestamp:f(e),messageKey:e.messageKey||"msg",onChild:e.onChild||y};function T(t,o,r){if(!o)throw new Error("missing bindings for child Pino");r=r||{},h&&o.serializers&&(r.serializers=o.serializers);const i=r.serializers;if(h&&i){var a=Object.assign({},p,i),c=!0===e.browser.serialize?Object.keys(a):h;delete o.serializers,u([o],c,a,this._stdErrSerialize)}function l(e){this._childLevel=1+(0|e._childLevel),this.bindings=o,a&&(this.serializers=a,this._serialize=c),n&&(this._logEvent=d([].concat(e._logEvent.bindings,o)))}l.prototype=this;const f=new l(this);return s(this,f),f.child=function(...e){return T.call(this,t,...e)},f.level=r.level||this.level,t.onChild(f),f}return w.levels=function(e){const t=e.customLevels||{},n=Object.assign({},c.levels.values,t),o=Object.assign({},c.levels.labels,function(e){const t={};return Object.keys(e).forEach((function(n){t[e[n]]=n})),t}(t));return{values:n,labels:o}}(e),w.level=k,w.setMaxListeners=w.getMaxListeners=w.emit=w.addListener=w.on=w.prependListener=w.once=w.prependOnceListener=w.removeListener=w.removeAllListeners=w.listeners=w.listenerCount=w.eventNames=w.write=w.flush=y,w.serializers=p,w._serialize=h,w._stdErrSerialize=m,w.child=function(...e){return T.call(this,v,...e)},n&&(w._logEvent=d()),w}function l(n,a,s,c){if(Object.defineProperty(n,c,{value:o(n.level,s)>o(c,s)?y:s[r][c],writable:!0,enumerable:!0,configurable:!0}),n[c]===y){if(!a.transmit)return;const e=o(a.transmit.level||n.level,s);if(o(c,s)<e)return}n[c]=function(n,i,a,s){return function(r){return function(){const c=i.timestamp(),l=new Array(arguments.length),p=Object.getPrototypeOf&&Object.getPrototypeOf(this)===t?t:this;for(var f=0;f<l.length;f++)l[f]=arguments[f];var h=!1;if(i.serialize&&(u(l,this._serialize,this.serializers,this._stdErrSerialize),h=!0),i.asObject||i.formatters?r.call(p,function(t,n,o,r,i){const{level:a,log:s=e=>e}=i.formatters||{},c=o.slice();let l=c[0];const u={};r&&(u.time=r);if(a){const e=a(n,t.levels.values[n]);Object.assign(u,e)}else u.level=t.levels.values[n];let d=1+(0|t._childLevel);d<1&&(d=1);if(null!==l&&"object"==typeof l){for(;d--&&"object"==typeof c[0];)Object.assign(u,c.shift());l=c.length?e(c.shift(),c):void 0}else"string"==typeof l&&(l=e(c.shift(),c));void 0!==l&&(u[i.messageKey]=l);return s(u)}(this,s,l,c,i)):r.apply(p,l),i.transmit){const e=o(i.transmit.level||n._level,a),t=o(s,a);if(t<e)return;!function(e,t,n,o=!1){const r=t.send,i=t.ts,a=t.methodLevel,s=t.methodValue,c=t.val,l=e._logEvent.bindings;o||u(n,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize);e._logEvent.ts=i,e._logEvent.messages=n.filter((function(e){return-1===l.indexOf(e)})),e._logEvent.level.label=a,e._logEvent.level.value=s,r(a,e._logEvent,c),e._logEvent=d(l)}(this,{ts:c,methodLevel:s,methodValue:t,transmitValue:a.levels.values[i.transmit.level||n._level],send:i.transmit.send,val:o(n._level,a)},l,h)}}}(n[r][s])}(n,a,s,c);const l=function(e){const t=[];e.bindings&&t.push(e.bindings);let n=e[i];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}(n);0!==l.length&&(n[c]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(l,n[c]))}function u(e,t,n,o){for(const r in e)if(o&&e[r]instanceof Error)e[r]=c.stdSerializers.err(e[r]);else if("object"==typeof e[r]&&!Array.isArray(e[r])&&t)for(const o in e[r])t.indexOf(o)>-1&&o in n&&(e[r][o]=n[o](e[r][o]))}function d(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function p(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)void 0===t[n]&&(t[n]=e[n]);return t}function f(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?g:b}function h(){return{}}function m(e){return e}function y(){}function g(){return!1}function b(){return Date.now()}return c.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},c.stdSerializers=n,c.stdTimeFunctions=Object.assign({},{nullTime:g,epochTime:b,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),browser$1.exports.default=c,browser$1.exports.pino=c,browser$1.exports}var browserExports$1=requireBrowser$1();const e$c=getDefaultExportFromCjs$1(browserExports$1);let Logger$2=(_a2=class{constructor(e={}){const t=e.level||"info";this.moduleContext=e.module||"app";const n={level:t,enabled:!e.silent,transport:!1!==e.prettyPrint?{target:"pino-pretty",options:{colorize:!0,translateTime:"SYS:standard",ignore:"pid,hostname"}}:void 0};this.logger=e$c(n)}static getInstance(e={}){const t=e.module||"default";return _a2.instances.has(t)||_a2.instances.set(t,new _a2(e)),_a2.instances.get(t)}setLogLevel(e){this.logger.level=e}setSilent(e){e&&(this.logger.level="silent")}setModule(e){this.moduleContext=e}debug(e,t){t?this.logger.debug({module:this.moduleContext,...t},e):this.logger.debug({module:this.moduleContext},e)}info(e,t){t?this.logger.info({module:this.moduleContext,...t},e):this.logger.info({module:this.moduleContext},e)}warn(e,t){t?this.logger.warn({module:this.moduleContext,...t},e):this.logger.warn({module:this.moduleContext},e)}error(e,t){t?this.logger.error({module:this.moduleContext,...t},e):this.logger.error({module:this.moduleContext},e)}},_a2.instances=new Map,_a2);const sleep=e=>new Promise((t=>setTimeout(t,e)));class HCS{constructor(){this.modelViewerLoaded=!1,this.modelViewerLoading=null,this.config={cdnUrl:"https://kiloscribe.com/api/inscription-cdn/",network:"mainnet",retryAttempts:3,retryBackoff:300,debug:!1,showLoadingIndicator:!1,loadingCallbackName:null},this.configMapping={hcsCdnUrl:"cdnUrl",hcsNetwork:"network",hcsRetryAttempts:"retryAttempts",hcsRetryBackoff:"retryBackoff",hcsDebug:"debug",hcsShowLoadingIndicator:"showLoadingIndicator",hcsLoadingCallbackName:"loadingCallbackName"},this.LoadedScripts={},this.LoadedWasm={},this.LoadedImages={},this.LoadedVideos={},this.LoadedAudios={},this.LoadedAudioUrls={},this.LoadedGLBs={},this.scriptLoadedEvent=new Event("HCSScriptLoaded"),this.loadQueue=[],this.isProcessingQueue=!1;try{this.logger=Logger$2.getInstance({module:"HCS-3",level:this.config.debug?"debug":"error"})}catch(e){this.logger=this.createFallbackLogger()}}createFallbackLogger(){return{debug:(...e)=>this.config.debug&&console.debug("[HCS-3]",...e),info:(...e)=>this.config.debug&&console.info("[HCS-3]",...e),warn:(...e)=>console.warn("[HCS-3]",...e),error:(...e)=>console.error("[HCS-3]",...e),setLogLevel:e=>{this.config.debug="debug"===e}}}log(...e){if(0===e.length)this.logger.debug("");else if(1===e.length)this.logger.debug(String(e[0]));else{const t=String(e[0]),n=e.slice(1);this.logger.debug(t,n)}}error(...e){if(0===e.length)this.logger.error("");else if(1===e.length)this.logger.error(String(e[0]));else{const t=String(e[0]),n=e.slice(1);this.logger.error(t,n)}}loadConfigFromHTML(){const e=document.querySelector("script[data-hcs-config]");e&&(Object.keys(this.configMapping).forEach((t=>{if(e.dataset[t]){const n=this.configMapping[t];let o=e.dataset[t];"true"===o&&(o=!0),"false"===o&&(o=!1),isNaN(Number(o))||""===o||(o=Number(o)),this.config[n]=o}})),this.logger.setLogLevel(this.config.debug?"debug":"error")),this.log("Loaded config:",this.config)}updateLoadingStatus(e,t){if("loaded"!==this.LoadedScripts[e]&&(this.config.showLoadingIndicator&&console.log("[HCS Loading] "+e+" : "+t),this.LoadedScripts[e]=t,this.config.loadingCallbackName&&"function"==typeof window[this.config.loadingCallbackName])){const n=window[this.config.loadingCallbackName];"function"==typeof n&&n(e,t)}}async fetchWithRetry(e,t=this.config.retryAttempts,n=this.config.retryBackoff){try{const t=await fetch(e);if(!t.ok)throw new Error("HTTP error! status: "+t.status);return t}catch(o){if(t>0)return this.log("Retrying fetch for "+e+" Attempts left: "+(t-1)),await this.sleep(n),this.fetchWithRetry(e,t-1,2*n);throw o}}sleep(e){return new Promise((t=>setTimeout(t,e)))}isDuplicate(e){return!!this.LoadedScripts[e]}async retrieveHCS1Data(e,t=this.config.cdnUrl,n=this.config.network){const o=n.replace(/['"]+/g,""),r=await this.fetchWithRetry(t+e+"?network="+o);return await r.blob()}async loadScript(e){const t=e.getAttribute("data-src"),n=e.getAttribute("data-script-id"),o=t?.split("/").pop(),r=e.getAttribute("type"),i=e.hasAttribute("data-required"),a="module"===e.getAttribute("type");if(!this.isDuplicate(o||"")){this.updateLoadingStatus(n,"loading");try{const t=e.getAttribute("data-cdn-url")||this.config.cdnUrl,s=e.getAttribute("data-network")||this.config.network,c=await this.retrieveHCS1Data(o,t,s);if("wasm"===r){const t=await c.arrayBuffer(),o=await WebAssembly.compile(t);this.LoadedWasm[n]=await WebAssembly.instantiate(o,{env:{},...e.dataset}),this.updateLoadingStatus(n,"loaded"),window.dispatchEvent(this.scriptLoadedEvent),this.log("Loaded wasm: "+n)}else{const e=await c.text(),t=document.createElement("script");if(t.textContent=e,t.className="hcs-inline-script",n&&t.setAttribute("data-loaded-script-id",n),a){t.type="module";const n=new Blob([e],{type:"application/javascript"});t.src=URL.createObjectURL(n)}document.body.appendChild(t),this.updateLoadingStatus(n,"loaded"),window.dispatchEvent(this.scriptLoadedEvent),this.log("Loaded script: "+n),t.onerror=e=>{if(this.error("Failed to load "+r+": "+n,e),this.updateLoadingStatus(n,"failed"),i)throw e}}}catch(s){if(this.error("Failed to load "+r+": "+n,s),this.updateLoadingStatus(n,"failed"),i)throw s}}}async loadModuleExports(e){const t=document.querySelector('script[data-loaded-script-id="'+e+'"]');if(!t)throw new Error("Module script with id "+e+" not found");const n=t.getAttribute("src");if(!n)throw new Error("Module script "+e+" has no src attribute");try{return await import(n)}catch(o){throw this.error("Failed to import module",o),o}}async loadStylesheet(e){const t=e.getAttribute("data-src"),n=e.getAttribute("data-script-id"),o=t?.split("/").pop(),r=e.hasAttribute("data-required");if(!this.isDuplicate(o||"")){this.updateLoadingStatus(n,"loading");try{const t=e.getAttribute("data-cdn-url")||this.config.cdnUrl,r=e.getAttribute("data-network")||this.config.network,i=await this.retrieveHCS1Data(o,t,r),a=await i.text(),s=document.createElement("style");s.textContent=a,document.head.appendChild(s),this.updateLoadingStatus(n,"loaded"),window.dispatchEvent(this.scriptLoadedEvent),this.log("Loaded and inlined stylesheet: "+n)}catch(i){if(this.error("Failed to load stylesheet: "+n,i),this.updateLoadingStatus(n,"failed"),r)throw i}}}async loadImage(e){const t=e.getAttribute("data-src"),n=t?.split("/").pop();this.log("Loading image: "+n),this.updateLoadingStatus("Image: "+n,"loaded");try{const t=e.getAttribute("data-cdn-url")||this.config.cdnUrl,o=e.getAttribute("data-network")||this.config.network,r=await this.retrieveHCS1Data(n,t,o),i=URL.createObjectURL(r);e.src=i,this.LoadedImages[n]=i,this.updateLoadingStatus("Image: "+n,"loaded"),this.log("Loaded image: "+n)}catch(o){this.error("Failed to load image: "+n,o),this.updateLoadingStatus("Image: "+n,"failed")}}async loadMedia(e,t){const n=e.getAttribute("data-src"),o=n?.split("/").pop();this.log("Loading "+t+": "+o),this.updateLoadingStatus(t+": "+o,"loading");try{const n=e.getAttribute("data-cdn-url")||this.config.cdnUrl,r=e.getAttribute("data-network")||this.config.network,i=await this.retrieveHCS1Data(o,n,r),a=URL.createObjectURL(i);e.src=a,"video"===t?this.LoadedVideos[o]=a:this.LoadedAudioUrls[o]=a,this.updateLoadingStatus(t+": "+o,"loaded"),this.log("Loaded "+t+": "+o)}catch(r){this.error("Failed to load "+t+": "+o,r),this.updateLoadingStatus(t+": "+o,"failed")}}async loadModelViewer(){return this.modelViewerLoading?this.modelViewerLoading:this.modelViewerLoaded?Promise.resolve():(this.modelViewerLoading=new Promise((e=>{const t=document.createElement("script");t.setAttribute("data-src","hcs://1/0.0.7293044"),t.setAttribute("data-script-id","model-viewer"),t.setAttribute("type","module"),window.addEventListener("HCSScriptLoaded",(()=>{this.modelViewerLoaded=!0,e()}),{once:!0}),this.loadScript(t)})),this.modelViewerLoading)}async loadGLB(e){await this.loadModelViewer();const t=e.getAttribute("data-src"),n=t?.split("/").pop();this.log("Loading GLB: "+n),this.updateLoadingStatus("GLB: "+n,"loading");try{const t=e.getAttribute("data-cdn-url")||this.config.cdnUrl,o=e.getAttribute("data-network")||this.config.network;let r;"model-viewer"!==e.tagName.toLowerCase()?(r=document.createElement("model-viewer"),Array.from(e.attributes).forEach((e=>{r.setAttribute(e.name,e.value)})),r.setAttribute("camera-controls",""),r.setAttribute("auto-rotate",""),r.setAttribute("ar",""),e.parentNode?.replaceChild(r,e)):r=e;const i=await this.retrieveHCS1Data(n,t,o),a=URL.createObjectURL(i);r.setAttribute("src",a),this.LoadedGLBs[n]=a,this.updateLoadingStatus("GLB: "+n,"loaded"),this.log("Loaded GLB: "+n)}catch(o){this.error("Failed to load GLB: "+n,o),this.updateLoadingStatus("GLB: "+n,"failed")}}async loadResource(e,t,n){return new Promise((o=>{this.loadQueue.push({element:e,type:t,order:n,resolve:o}),this.processQueue()}))}async processQueue(){if(!this.isProcessingQueue){for(this.isProcessingQueue=!0;this.loadQueue.length>0;){const t=this.loadQueue.shift();try{"script"===t.type?await this.loadScript(t.element):"image"===t.type?await this.loadImage(t.element):"video"===t.type||"audio"===t.type?await this.loadMedia(t.element,t.type):"glb"===t.type?await this.loadGLB(t.element):"css"===t.type&&await this.loadStylesheet(t.element),t.resolve()}catch(e){if(this.error("Error processing queue item:",e),"script"===t.type&&t.element.hasAttribute("data-required"))break}}this.isProcessingQueue=!1}}async replaceHCSInStyle(e){let t=e,n=t.indexOf("hcs://");for(;-1!==n;){let e=n;for(;e<t.length&&!["'",'"'," ",")"].includes(t[e]);)e++;const r=t.substring(n,e),i=r.split("/").pop();try{const o=this.config.cdnUrl,a=this.config.network,s=await this.retrieveHCS1Data(i,o,a),c=URL.createObjectURL(s);t=t.substring(0,n)+c+t.substring(e),this.LoadedImages[i]=c,this.log("Replaced CSS HCS URL: "+r+" with "+c)}catch(o){this.error("Failed to load CSS image: "+i,o)}n=t.indexOf("hcs://",n+1)}return t}async processInlineStyles(){const e=document.querySelectorAll('[style*="hcs://"]');this.log("Found "+e.length+" elements with HCS style references");for(const n of Array.from(e)){const e=n.getAttribute("style");if(e){this.log("Processing style: "+e);const t=await this.replaceHCSInStyle(e);e!==t&&(n.setAttribute("style",t),this.log("Updated style to: "+t))}}const t=document.querySelectorAll("style");for(const n of Array.from(t))if(n.textContent?.includes("hcs://")){const e=await this.replaceHCSInStyle(n.textContent);n.textContent!==e&&(n.textContent=e)}}async init(){return this.loadConfigFromHTML(),new Promise((e=>{const t=async()=>{const t=document.querySelectorAll('script[data-src^="hcs://"]'),n=document.querySelectorAll('img[data-src^="hcs://"], img[src^="hcs://"]'),o=document.querySelectorAll('video[data-src^="hcs://"], video[src^="hcs://"]'),r=document.querySelectorAll('audio[data-src^="hcs://"], audio[src^="hcs://"]'),i=document.querySelectorAll('model-viewer[data-src^="hcs://"]'),a=document.querySelectorAll('link[data-src^="hcs://"]');document.querySelectorAll('[src^="hcs://"]').forEach((e=>{const t=e.getAttribute("src");t&&(e.setAttribute("data-src",t),e.removeAttribute("src"))})),await this.processInlineStyles();const s=[];[{elements:t,type:"script"},{elements:n,type:"image"},{elements:o,type:"video"},{elements:r,type:"audio"},{elements:i,type:"glb"},{elements:a,type:"css"}].forEach((({elements:e,type:t})=>{e.forEach((e=>{const n=parseInt(e.getAttribute("data-load-order")||"")||1/0;s.push(this.loadResource(e,t,n))}))})),await Promise.all(s);const c=new MutationObserver((e=>{e.forEach((e=>{if(e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const t=e;if(t.getAttribute("style")?.includes("hcs://")&&this.processInlineStyles(),"style"===t.tagName.toLowerCase()&&t.textContent?.includes("hcs://")&&this.processInlineStyles(),t.getAttribute("src")?.startsWith("hcs://")){const e=t.getAttribute("src");t.setAttribute("data-src",e),t.removeAttribute("src");switch(t.tagName.toLowerCase()){case"img":this.loadResource(t,"image",1/0);break;case"video":this.loadResource(t,"video",1/0);break;case"audio":this.loadResource(t,"audio",1/0);break;case"script":this.loadResource(t,"script",1/0)}}t.matches('script[data-src^="hcs://"]')?this.loadResource(t,"script",1/0):t.matches('img[data-src^="hcs://"]')?this.loadResource(t,"image",1/0):t.matches('video[data-src^="hcs://"]')?this.loadResource(t,"video",1/0):t.matches('audio[data-src^="hcs://"]')?this.loadResource(t,"audio",1/0):t.matches('model-viewer[data-src^="hcs://"]')?this.loadResource(t,"glb",1/0):t.matches('link[data-src^="hcs://"]')&&this.loadResource(t,"css",1/0);t.querySelectorAll('[data-src^="hcs://"], [src^="hcs://"]').forEach((e=>{const t=e,n=t.tagName.toLowerCase(),o=t.getAttribute("src");switch(o?.startsWith("hcs://")&&(t.setAttribute("data-src",o),t.removeAttribute("src")),n){case"script":this.loadResource(t,"script",1/0);break;case"img":this.loadResource(t,"image",1/0);break;case"video":this.loadResource(t,"video",1/0);break;case"audio":this.loadResource(t,"audio",1/0);break;case"model-viewer":this.loadResource(t,"glb",1/0);break;case"link":this.loadResource(t,"css",1/0)}}))}})),"attributes"===e.type){const t=e.target;if("style"===e.attributeName&&t.getAttribute("style")?.includes("hcs://"))this.processInlineStyles();else if("src"===e.attributeName){const e=t.getAttribute("src");if(e?.startsWith("hcs://")){t.setAttribute("data-src",e),t.removeAttribute("src");const n=t.tagName.toLowerCase();["img","video","audio"].includes(n)&&this.loadResource(t,n,1/0)}}}}))}));document.body?c.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","src","data-src"]}):document.addEventListener("DOMContentLoaded",(()=>{c.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","src","data-src"]})})),e()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()}))}async preloadImage(e){this.log("Loading image:"+e),this.updateLoadingStatus("image: "+e,"loading");const t=await this.retrieveHCS1Data(e),n=URL.createObjectURL(t);return this.LoadedImages[e]=n,this.updateLoadingStatus("image: "+e,"loaded"),n}async preloadAudio(e){const t=document.createElement("audio");t.setAttribute("data-topic-id",e),t.setAttribute("data-src","hcs://1/"+e),document.body.appendChild(t),await this.loadMedia(t,"audio");const n=document.querySelector('audio[data-topic-id="'+e+'"]');return n?this.LoadedAudioUrls[e]=n.src:console.error("Failed to preload audio: "+e),this.LoadedAudioUrls[e]}async playAudio(e,t=1){const n=this.LoadedAudioUrls[e];if(n){const o=new Audio(n);o.volume=t,this.LoadedAudios[e]=o,o.play().catch((e=>{console.error("Failed to play audio:",e)})),o.addEventListener("ended",(()=>{o.remove(),delete this.LoadedAudios[e]}))}else console.error("Audio not preloaded: "+e)}async pauseAudio(e){const t=document.querySelector('audio[data-topic-id="'+e+'"]');t?(console.log("found element",t),t.pause(),this.LoadedAudios[e]?.pause()):this.LoadedAudios[e]?.pause()}async loadAndPlayAudio(e,t=!1,n=1){let o=document.querySelector('audio[data-topic-id="'+e+'"]');if(o)o.volume=n,await o.play();else{const r=document.createElement("audio");r.volume=n,t&&r.setAttribute("autoplay","autoplay"),r.setAttribute("data-topic-id",e),r.setAttribute("data-src","hcs://1/"+e),document.body.appendChild(r),await this.loadMedia(r,"audio"),o=document.querySelector('audio[data-topic-id="'+e+'"]'),t||await o.play()}}}const isServer="undefined"==typeof window;isServer||(window.HCS=new HCS,window.HCS.init().then((()=>{console.log("All HCS resources loaded"),"function"==typeof window.HCSReady&&(console.log("Running HCSReady..."),window.HCSReady())})));class WasmBridge{constructor(){this.wasm=null,this.WASM_VECTOR_LEN=0,this.cachedUint8Memory=null,this.cachedDataViewMemory=null,this.textEncoder=new TextEncoder,this.textDecoder=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),this.textDecoder.decode(),this.logger=Logger$2.getInstance({module:"WasmBridge"})}setLogLevel(e){this.logger.setLogLevel(e)}get wasmInstance(){if(!this.wasm)throw new Error("WASM not initialized");return this.wasm}getUint8Memory(){if(!this.wasm)throw new Error("WASM not initialized");return null!==this.cachedUint8Memory&&0!==this.cachedUint8Memory.byteLength||(this.cachedUint8Memory=new Uint8Array(this.wasm.memory.buffer)),this.cachedUint8Memory}getDataViewMemory(){if(!this.wasm)throw new Error("WASM not initialized");return null!==this.cachedDataViewMemory&&this.cachedDataViewMemory.buffer===this.wasm.memory.buffer||(this.cachedDataViewMemory=new DataView(this.wasm.memory.buffer)),this.cachedDataViewMemory}encodeString(e,t){if(0===e.length)return{read:0,written:0};const n=this.textEncoder.encode(e);return t.set(n),{read:e.length,written:n.length}}passStringToWasm(e,t,n){if(void 0===n){const n=this.textEncoder.encode(e),o=t(n.length,1);return this.getUint8Memory().set(n,o),this.WASM_VECTOR_LEN=n.length,o}let o=this.textEncoder.encode(e).length,r=t(o,1);const i=this.getUint8Memory();let a=0;for(;a<o;a++){const t=e.charCodeAt(a);if(t>127)break;i[r+a]=t}if(a!==o){0!==a&&(e=e.slice(a)),r=n(r,o,o=a+3*this.textEncoder.encode(e).length,1);const t=this.getUint8Memory().subarray(r+a,r+o);a+=this.encodeString(e,t).written}return this.WASM_VECTOR_LEN=a,r}getStringFromWasm(e,t){return e>>>=0,this.textDecoder.decode(this.getUint8Memory().subarray(e,e+t))}createWasmFunction(e){if(!this.wasm)throw new Error("WASM not initialized");return(...t)=>{const n=this.wasm.__wbindgen_add_to_stack_pointer(-16);let o=[0,0];try{const r=[n,...t.map((e=>[this.passStringToWasm(e,this.wasm.__wbindgen_malloc,this.wasm.__wbindgen_realloc),this.WASM_VECTOR_LEN])).flat()];e.apply(this.wasm,r);const i=this.getDataViewMemory().getInt32(n+0,!0),a=this.getDataViewMemory().getInt32(n+4,!0);return o=[i,a],this.getStringFromWasm(i,a)}finally{this.wasm.__wbindgen_add_to_stack_pointer(16),this.wasm.__wbindgen_free(o[0],o[1],1)}}}async initWasm(e){const t=this,n={__wbindgen_placeholder__:{__wbindgen_throw:function(e,n){const o=t.getStringFromWasm(e,n);throw t.logger.error(`WASM error: ${o}`),new Error(o)}}};try{this.logger.debug("Compiling WASM module");const t=await WebAssembly.compile(e);this.logger.debug("Instantiating WASM module");const o=await WebAssembly.instantiate(t,n);return this.wasm=o.exports,this.logger.info("WASM module initialized successfully"),this.wasm}catch(o){throw this.logger.error("Failed to initialize WASM module",o),o}}createStateData(e,t={}){let n={};return e?.c?.inputType?.stateData&&(t.latestRoundData&&Object.keys(e.c.inputType.stateData).every((e=>e in t.latestRoundData))?(n.latestRoundData={},Object.entries(e.c.inputType.stateData).forEach((([e,o])=>{n.latestRoundData[e]=String(t.latestRoundData[e])}))):Object.entries(e.c.inputType.stateData).forEach((([e,o])=>{const r=t[e];r&&"object"==typeof r&&"values"in r&&r.values.length>0?n[e]=String(r.values[0]):n[e]=this.getDefaultValueForType(o)}))),n}getDefaultValueForType(e){return e.startsWith("uint")||e.startsWith("int")||"number"===e?"0":"bool"===e?"false":""}executeWasm(e,t){if(!this.wasm)throw this.logger.error("WASM not initialized"),new Error("WASM not initialized");try{this.logger.debug("Executing WASM with stateData",e);return this.createWasmFunction(this.wasmInstance.process_state)(JSON.stringify(e),JSON.stringify(t))}catch(n){throw this.logger.error("Error executing WASM",n),n}}getParams(){return this.createWasmFunction(this.wasmInstance.get_params)()}}
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2009 The Closure Library Authors
@@ -17,7 +17,7 @@
17
17
  * limitations under the License.
18
18
  *
19
19
  * SPDX-License-Identifier: Apache-2.0
20
- */var wasm=null;try{wasm=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Long(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function isLong(e){return!0===(e&&e.__isLong__)}function ctz32(e){var t=Math.clz32(e&-e);return e?31-t:t}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0}),Long.isLong=isLong;var INT_CACHE={},UINT_CACHE={};function fromInt(e,t){var n,o,r;return t?(r=0<=(e>>>=0)&&e<256)&&(o=UINT_CACHE[e])?o:(n=fromBits(e,0,!0),r&&(UINT_CACHE[e]=n),n):(r=-128<=(e|=0)&&e<128)&&(o=INT_CACHE[e])?o:(n=fromBits(e,e<0?-1:0,!1),r&&(INT_CACHE[e]=n),n)}function fromNumber(e,t){if(isNaN(e))return t?UZERO:ZERO;if(t){if(e<0)return UZERO;if(e>=TWO_PWR_64_DBL)return MAX_UNSIGNED_VALUE}else{if(e<=-0x8000000000000000)return MIN_VALUE;if(e+1>=TWO_PWR_63_DBL)return MAX_VALUE}return e<0?fromNumber(-e,t).neg():fromBits(e%TWO_PWR_32_DBL|0,e/TWO_PWR_32_DBL|0,t)}function fromBits(e,t,n){return new Long(e,t,n)}Long.fromInt=fromInt,Long.fromNumber=fromNumber,Long.fromBits=fromBits;var pow_dbl=Math.pow;function fromString(e,t,n){if(0===e.length)throw Error("empty string");if("number"==typeof t?(n=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?UZERO:ZERO;if((n=n||10)<2||36<n)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return fromString(e.substring(1),t,n).neg();for(var r=fromNumber(pow_dbl(n,8)),i=ZERO,a=0;a<e.length;a+=8){var s=Math.min(8,e.length-a),c=parseInt(e.substring(a,a+s),n);if(s<8){var l=fromNumber(pow_dbl(n,s));i=i.mul(l).add(fromNumber(c))}else i=(i=i.mul(r)).add(fromNumber(c))}return i.unsigned=t,i}function fromValue(e,t){return"number"==typeof e?fromNumber(e,t):"string"==typeof e?fromString(e,t):fromBits(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}Long.fromString=fromString,Long.fromValue=fromValue;var TWO_PWR_16_DBL=65536,TWO_PWR_24_DBL=1<<24,TWO_PWR_32_DBL=TWO_PWR_16_DBL*TWO_PWR_16_DBL,TWO_PWR_64_DBL=TWO_PWR_32_DBL*TWO_PWR_32_DBL,TWO_PWR_63_DBL=TWO_PWR_64_DBL/2,TWO_PWR_24=fromInt(TWO_PWR_24_DBL),ZERO=fromInt(0);Long.ZERO=ZERO;var UZERO=fromInt(0,!0);Long.UZERO=UZERO;var ONE=fromInt(1);Long.ONE=ONE;var UONE=fromInt(1,!0);Long.UONE=UONE;var NEG_ONE=fromInt(-1);Long.NEG_ONE=NEG_ONE;var MAX_VALUE=fromBits(-1,2147483647,!1);Long.MAX_VALUE=MAX_VALUE;var MAX_UNSIGNED_VALUE=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=MAX_UNSIGNED_VALUE;var MIN_VALUE=fromBits(0,-2147483648,!1);Long.MIN_VALUE=MIN_VALUE;var LongPrototype=Long.prototype;LongPrototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},LongPrototype.toNumber=function(){return this.unsigned?(this.high>>>0)*TWO_PWR_32_DBL+(this.low>>>0):this.high*TWO_PWR_32_DBL+(this.low>>>0)},LongPrototype.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(MIN_VALUE)){var t=fromNumber(e),n=this.div(t),o=n.mul(t).sub(this);return n.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var r=fromNumber(pow_dbl(e,6),this.unsigned),i=this,a="";;){var s=i.div(r),c=(i.sub(s.mul(r)).toInt()>>>0).toString(e);if((i=s).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},LongPrototype.getHighBits=function(){return this.high},LongPrototype.getHighBitsUnsigned=function(){return this.high>>>0},LongPrototype.getLowBits=function(){return this.low},LongPrototype.getLowBitsUnsigned=function(){return this.low>>>0},LongPrototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(MIN_VALUE)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},LongPrototype.isSafeInteger=function(){var e=this.high>>21;return!e||!this.unsigned&&(-1===e&&!(0===this.low&&-2097152===this.high))},LongPrototype.isZero=function(){return 0===this.high&&0===this.low},LongPrototype.eqz=LongPrototype.isZero,LongPrototype.isNegative=function(){return!this.unsigned&&this.high<0},LongPrototype.isPositive=function(){return this.unsigned||this.high>=0},LongPrototype.isOdd=function(){return!(1&~this.low)},LongPrototype.isEven=function(){return!(1&this.low)},LongPrototype.equals=function(e){return isLong(e)||(e=fromValue(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},LongPrototype.eq=LongPrototype.equals,LongPrototype.notEquals=function(e){return!this.eq(e)},LongPrototype.neq=LongPrototype.notEquals,LongPrototype.ne=LongPrototype.notEquals,LongPrototype.lessThan=function(e){return this.comp(e)<0},LongPrototype.lt=LongPrototype.lessThan,LongPrototype.lessThanOrEqual=function(e){return this.comp(e)<=0},LongPrototype.lte=LongPrototype.lessThanOrEqual,LongPrototype.le=LongPrototype.lessThanOrEqual,LongPrototype.greaterThan=function(e){return this.comp(e)>0},LongPrototype.gt=LongPrototype.greaterThan,LongPrototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},LongPrototype.gte=LongPrototype.greaterThanOrEqual,LongPrototype.ge=LongPrototype.greaterThanOrEqual,LongPrototype.compare=function(e){if(isLong(e)||(e=fromValue(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},LongPrototype.comp=LongPrototype.compare,LongPrototype.negate=function(){return!this.unsigned&&this.eq(MIN_VALUE)?MIN_VALUE:this.not().add(ONE)},LongPrototype.neg=LongPrototype.negate,LongPrototype.add=function(e){isLong(e)||(e=fromValue(e));var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,r=65535&this.low,i=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=0,l=0,u=0,d=0;return u+=(d+=r+(65535&e.low))>>>16,l+=(u+=o+s)>>>16,c+=(l+=n+a)>>>16,c+=t+i,fromBits((u&=65535)<<16|(d&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},LongPrototype.subtract=function(e){return isLong(e)||(e=fromValue(e)),this.add(e.neg())},LongPrototype.sub=LongPrototype.subtract,LongPrototype.multiply=function(e){if(this.isZero())return this;if(isLong(e)||(e=fromValue(e)),wasm)return fromBits(wasm.mul(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned);if(e.isZero())return this.unsigned?UZERO:ZERO;if(this.eq(MIN_VALUE))return e.isOdd()?MIN_VALUE:ZERO;if(e.eq(MIN_VALUE))return this.isOdd()?MIN_VALUE:ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(TWO_PWR_24)&&e.lt(TWO_PWR_24))return fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,r=65535&this.low,i=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=65535&e.low,l=0,u=0,d=0,p=0;return d+=(p+=r*c)>>>16,u+=(d+=o*c)>>>16,d&=65535,u+=(d+=r*s)>>>16,l+=(u+=n*c)>>>16,u&=65535,l+=(u+=o*s)>>>16,u&=65535,l+=(u+=r*a)>>>16,l+=t*c+n*s+o*a+r*i,fromBits((d&=65535)<<16|(p&=65535),(l&=65535)<<16|(u&=65535),this.unsigned)},LongPrototype.mul=LongPrototype.multiply,LongPrototype.divide=function(e){if(isLong(e)||(e=fromValue(e)),e.isZero())throw Error("division by zero");var t,n,o;if(wasm)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?fromBits((this.unsigned?wasm.div_u:wasm.div_s)(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?UZERO:ZERO;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return UZERO;if(e.gt(this.shru(1)))return UONE;o=UZERO}else{if(this.eq(MIN_VALUE))return e.eq(ONE)||e.eq(NEG_ONE)?MIN_VALUE:e.eq(MIN_VALUE)?ONE:(t=this.shr(1).div(e).shl(1)).eq(ZERO)?e.isNegative()?ONE:NEG_ONE:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(MIN_VALUE))return this.unsigned?UZERO:ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=ZERO}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var r=Math.ceil(Math.log(t)/Math.LN2),i=r<=48?1:pow_dbl(2,r-48),a=fromNumber(t),s=a.mul(e);s.isNegative()||s.gt(n);)s=(a=fromNumber(t-=i,this.unsigned)).mul(e);a.isZero()&&(a=ONE),o=o.add(a),n=n.sub(s)}return o},LongPrototype.div=LongPrototype.divide,LongPrototype.modulo=function(e){return isLong(e)||(e=fromValue(e)),wasm?fromBits((this.unsigned?wasm.rem_u:wasm.rem_s)(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},LongPrototype.mod=LongPrototype.modulo,LongPrototype.rem=LongPrototype.modulo,LongPrototype.not=function(){return fromBits(~this.low,~this.high,this.unsigned)},LongPrototype.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},LongPrototype.clz=LongPrototype.countLeadingZeros,LongPrototype.countTrailingZeros=function(){return this.low?ctz32(this.low):ctz32(this.high)+32},LongPrototype.ctz=LongPrototype.countTrailingZeros,LongPrototype.and=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low&e.low,this.high&e.high,this.unsigned)},LongPrototype.or=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low|e.low,this.high|e.high,this.unsigned)},LongPrototype.xor=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low^e.low,this.high^e.high,this.unsigned)},LongPrototype.shiftLeft=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):fromBits(0,this.low<<e-32,this.unsigned)},LongPrototype.shl=LongPrototype.shiftLeft,LongPrototype.shiftRight=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},LongPrototype.shr=LongPrototype.shiftRight,LongPrototype.shiftRightUnsigned=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):fromBits(32===e?this.high:this.high>>>e-32,0,this.unsigned)},LongPrototype.shru=LongPrototype.shiftRightUnsigned,LongPrototype.shr_u=LongPrototype.shiftRightUnsigned,LongPrototype.rotateLeft=function(e){var t;return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?fromBits(this.high,this.low,this.unsigned):e<32?(t=32-e,fromBits(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),fromBits(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},LongPrototype.rotl=LongPrototype.rotateLeft,LongPrototype.rotateRight=function(e){var t;return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?fromBits(this.high,this.low,this.unsigned):e<32?(t=32-e,fromBits(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),fromBits(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},LongPrototype.rotr=LongPrototype.rotateRight,LongPrototype.toSigned=function(){return this.unsigned?fromBits(this.low,this.high,!1):this},LongPrototype.toUnsigned=function(){return this.unsigned?this:fromBits(this.low,this.high,!0)},LongPrototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},LongPrototype.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},LongPrototype.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},Long.fromBytes=function(e,t,n){return n?Long.fromBytesLE(e,t):Long.fromBytesBE(e,t)},Long.fromBytesLE=function(e,t){return new Long(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},Long.fromBytesBE=function(e,t){return new Long(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},"function"==typeof BigInt&&(Long.fromBigInt=function(e,t){return fromBits(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},Long.fromValue=function(e,t){return"bigint"==typeof e?fromBigInt(e,t):fromValue(e,t)},LongPrototype.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e});var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$1=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,n,o,r,i,a=w.prototype={constructor:w,toString:null,valueOf:null},s=new w(1),c=20,l=4,u=-7,d=21,p=-1e7,f=1e7,h=!1,m=1,y=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},b="0123456789abcdefghijklmnopqrstuvwxyz",k=!0;function w(e,t){var r,i,a,s,u,d,h,m,y=this;if(!(y instanceof w))return new w(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>f?y.c=y.e=null:e.e<p?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,u=e;u>=10;u/=10,s++);return void(s>f?y.c=y.e=null:(y.e=s,y.c=[e]))}m=String(e)}else{if(!isNumeric.test(m=String(e)))return o(y,m,d);y.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(s=m.indexOf("."))>-1&&(m=m.replace(".","")),(u=m.search(/e/i))>0?(s<0&&(s=u),s+=+m.slice(u+1),m=m.substring(0,u)):s<0&&(s=m.length)}else{if(intCheck(t,2,b.length,"Base"),10==t&&k)return _(y=new w(e),c+y.e+1,l);if(m=String(e),d="number"==typeof e){if(0*e!=0)return o(y,m,d,t);if(y.s=1/e<0?(m=m.slice(1),-1):1,w.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else y.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=b.slice(0,t),s=u=0,h=m.length;u<h;u++)if(r.indexOf(i=m.charAt(u))<0){if("."==i){if(u>s){s=h;continue}}else if(!a&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){a=!0,u=-1,s=0;continue}return o(y,String(e),d,t)}d=!1,(s=(m=n(m,t,10,y.s)).indexOf("."))>-1?m=m.replace(".",""):s=m.length}for(u=0;48===m.charCodeAt(u);u++);for(h=m.length;48===m.charCodeAt(--h););if(m=m.slice(u,++h)){if(h-=u,d&&w.DEBUG&&h>15&&(e>MAX_SAFE_INTEGER$1||e!==mathfloor(e)))throw Error(tooManyDigits+y.s*e);if((s=s-u-1)>f)y.c=y.e=null;else if(s<p)y.c=[y.e=0];else{if(y.e=s,y.c=[],u=(s+1)%LOG_BASE,s<0&&(u+=LOG_BASE),u<h){for(u&&y.c.push(+m.slice(0,u)),h-=LOG_BASE;u<h;)y.c.push(+m.slice(u,u+=LOG_BASE));u=LOG_BASE-(m=m.slice(u)).length}else u-=h;for(;u--;m+="0");y.c.push(+m)}}else y.c=[y.e=0]}function v(e,t,n,o){var r,i,a,s,c;if(null==n?n=l:intCheck(n,0,8),!e.c)return e.toString();if(r=e.c[0],a=e.e,null==t)c=coeffToString(e.c),c=1==o||2==o&&(a<=u||a>=d)?toExponential(c,a):toFixedPoint(c,a,"0");else if(i=(e=_(new w(e),t,n)).e,s=(c=coeffToString(e.c)).length,1==o||2==o&&(t<=i||i<=u)){for(;s<t;c+="0",s++);c=toExponential(c,i)}else if(t-=a,c=toFixedPoint(c,i,"0"),i+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=i-s)>0)for(i+1==s&&(c+=".");t--;c+="0");return e.s<0&&r?"-"+c:c}function T(e,t){for(var n,o,r=1,i=new w(e[0]);r<e.length;r++)(!(o=new w(e[r])).s||(n=compare(i,o))===t||0===n&&i.s===t)&&(i=o);return i}function I(e,t,n){for(var o=1,r=t.length;!t[--r];t.pop());for(r=t[0];r>=10;r/=10,o++);return(n=o+n*LOG_BASE-1)>f?e.c=e.e=null:n<p?e.c=[e.e=0]:(e.e=n,e.c=t),e}function _(e,t,n,o){var r,i,a,s,c,l,u,d=e.c,h=POWS_TEN;if(d){e:{for(r=1,s=d[0];s>=10;s/=10,r++);if((i=t-r)<0)i+=LOG_BASE,a=t,c=d[l=0],u=mathfloor(c/h[r-a-1]%10);else if((l=mathceil((i+1)/LOG_BASE))>=d.length){if(!o)break e;for(;d.length<=l;d.push(0));c=u=0,r=1,a=(i%=LOG_BASE)-LOG_BASE+1}else{for(c=s=d[l],r=1;s>=10;s/=10,r++);u=(a=(i%=LOG_BASE)-LOG_BASE+r)<0?0:mathfloor(c/h[r-a-1]%10)}if(o=o||t<0||null!=d[l+1]||(a<0?c:c%h[r-a-1]),o=n<4?(u||o)&&(0==n||n==(e.s<0?3:2)):u>5||5==u&&(4==n||o||6==n&&(i>0?a>0?c/h[r-a]:0:d[l-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,o?(t-=e.e+1,d[0]=h[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):d[0]=e.e=0,e;if(0==i?(d.length=l,s=1,l--):(d.length=l+1,s=h[LOG_BASE-i],d[l]=a>0?mathfloor(c/h[r-a]%h[a])*s:0),o)for(;;){if(0==l){for(i=1,a=d[0];a>=10;a/=10,i++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,d[0]==BASE&&(d[0]=1));break}if(d[l]+=s,d[l]!=BASE)break;d[l--]=0,s=1}for(i=d.length;0===d[--i];d.pop());}e.e>f?e.c=e.e=null:e.e<p&&(e.c=[e.e=0])}return e}function A(e){var t,n=e.e;return null===n?e.toString():(t=coeffToString(e.c),t=n<=u||n>=d?toExponential(t,n):toFixedPoint(t,n,"0"),e.s<0?"-"+t:t)}return w.clone=clone,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(n=e[t],0,MAX,t),c=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(n=e[t],0,8,t),l=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(intCheck(n[0],-1e9,0,t),intCheck(n[1],0,MAX,t),u=n[0],d=n[1]):(intCheck(n,-1e9,MAX,t),u=-(d=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)intCheck(n[0],-1e9,-1,t),intCheck(n[1],1,MAX,t),p=n[0],f=n[1];else{if(intCheck(n,-1e9,MAX,t),!n)throw Error(bignumberError+t+" cannot be zero: "+n);p=-(f=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(bignumberError+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw h=!n,Error(bignumberError+"crypto unavailable");h=n}else h=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(n=e[t],0,9,t),m=n),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(n=e[t],0,MAX,t),y=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(bignumberError+t+" not an object: "+n);g=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(bignumberError+t+" invalid: "+n);k="0123456789"==n.slice(0,10),b=n}}return{DECIMAL_PLACES:c,ROUNDING_MODE:l,EXPONENTIAL_AT:[u,d],RANGE:[p,f],CRYPTO:h,MODULO_MODE:m,POW_PRECISION:y,FORMAT:g,ALPHABET:b}},w.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!w.DEBUG)return!0;var t,n,o=e.c,r=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(o)){if((1===i||-1===i)&&r>=-1e9&&r<=MAX&&r===mathfloor(r)){if(0===o[0]){if(0===r&&1===o.length)return!0;break e}if((t=(r+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(o[0]).length==t){for(t=0;t<o.length;t++)if((n=o[t])<0||n>=BASE||n!==mathfloor(n))break e;if(0!==n)return!0}}}else if(null===o&&null===r&&(null===i||1===i||-1===i))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},w.maximum=w.max=function(){return T(arguments,-1)},w.minimum=w.min=function(){return T(arguments,1)},w.random=(r=9007199254740992,i=Math.random()*r&2097151?function(){return mathfloor(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,o,r,a,l=0,u=[],d=new w(s);if(null==e?e=c:intCheck(e,0,MAX),r=mathceil(e/LOG_BASE),h)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(r*=2));l<r;)(a=131072*t[l]+(t[l+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[l]=n[0],t[l+1]=n[1]):(u.push(a%1e14),l+=2);l=r/2}else{if(!crypto.randomBytes)throw h=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(r*=7);l<r;)(a=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(u.push(a%1e14),l+=7);l=r/7}if(!h)for(;l<r;)(a=i())<9e15&&(u[l++]=a%1e14);for(r=u[--l],e%=LOG_BASE,r&&e&&(a=POWS_TEN[LOG_BASE-e],u[l]=mathfloor(r/a)*a);0===u[l];u.pop(),l--);if(l<0)u=[o=0];else{for(o=-1;0===u[0];u.splice(0,1),o-=LOG_BASE);for(l=1,a=u[0];a>=10;a/=10,l++);l<LOG_BASE&&(o-=LOG_BASE-l)}return d.e=o,d.c=u,d}),w.sum=function(){for(var e=1,t=arguments,n=new w(t[0]);e<t.length;)n=n.plus(t[e++]);return n},n=function(){var e="0123456789";function n(e,t,n,o){for(var r,i,a=[0],s=0,c=e.length;s<c;){for(i=a.length;i--;a[i]*=t);for(a[0]+=o.indexOf(e.charAt(s++)),r=0;r<a.length;r++)a[r]>n-1&&(null==a[r+1]&&(a[r+1]=0),a[r+1]+=a[r]/n|0,a[r]%=n)}return a.reverse()}return function(o,r,i,a,s){var u,d,p,f,h,m,g,k,v=o.indexOf("."),T=c,I=l;for(v>=0&&(f=y,y=0,o=o.replace(".",""),m=(k=new w(r)).pow(o.length-v),y=f,k.c=n(toFixedPoint(coeffToString(m.c),m.e,"0"),10,i,e),k.e=k.c.length),p=f=(g=n(o,r,i,s?(u=b,e):(u=e,b))).length;0==g[--f];g.pop());if(!g[0])return u.charAt(0);if(v<0?--p:(m.c=g,m.e=p,m.s=a,g=(m=t(m,k,T,I,i)).c,h=m.r,p=m.e),v=g[d=p+T+1],f=i/2,h=h||d<0||null!=g[d+1],h=I<4?(null!=v||h)&&(0==I||I==(m.s<0?3:2)):v>f||v==f&&(4==I||h||6==I&&1&g[d-1]||I==(m.s<0?8:7)),d<1||!g[0])o=h?toFixedPoint(u.charAt(1),-T,u.charAt(0)):u.charAt(0);else{if(g.length=d,h)for(--i;++g[--d]>i;)g[d]=0,d||(++p,g=[1].concat(g));for(f=g.length;!g[--f];);for(v=0,o="";v<=f;o+=u.charAt(g[v++]));o=toFixedPoint(o,p,u.charAt(0))}return o}}(),t=function(){function e(e,t,n){var o,r,i,a,s=0,c=e.length,l=t%SQRT_BASE,u=t/SQRT_BASE|0;for(e=e.slice();c--;)s=((r=l*(i=e[c]%SQRT_BASE)+(o=u*i+(a=e[c]/SQRT_BASE|0)*l)%SQRT_BASE*SQRT_BASE+s)/n|0)+(o/SQRT_BASE|0)+u*a,e[c]=r%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,o){var r,i;if(n!=o)i=n>o?1:-1;else for(r=i=0;r<n;r++)if(e[r]!=t[r]){i=e[r]>t[r]?1:-1;break}return i}function n(e,t,n,o){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=r*o+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(o,r,i,a,s){var c,l,u,d,p,f,h,m,y,g,b,k,v,T,I,A,O,E=o.s==r.s?1:-1,S=o.c,x=r.c;if(!(S&&S[0]&&x&&x[0]))return new w(o.s&&r.s&&(S?!x||S[0]!=x[0]:x)?S&&0==S[0]||!x?0*E:E/0:NaN);for(y=(m=new w(E)).c=[],E=i+(l=o.e-r.e)+1,s||(s=BASE,l=bitFloor(o.e/LOG_BASE)-bitFloor(r.e/LOG_BASE),E=E/LOG_BASE|0),u=0;x[u]==(S[u]||0);u++);if(x[u]>(S[u]||0)&&l--,E<0)y.push(1),d=!0;else{for(T=S.length,A=x.length,u=0,E+=2,(p=mathfloor(s/(x[0]+1)))>1&&(x=e(x,p,s),S=e(S,p,s),A=x.length,T=S.length),v=A,b=(g=S.slice(0,A)).length;b<A;g[b++]=0);O=x.slice(),O=[0].concat(O),I=x[0],x[1]>=s/2&&I++;do{if(p=0,(c=t(x,g,A,b))<0){if(k=g[0],A!=b&&(k=k*s+(g[1]||0)),(p=mathfloor(k/I))>1)for(p>=s&&(p=s-1),h=(f=e(x,p,s)).length,b=g.length;1==t(f,g,h,b);)p--,n(f,A<h?O:x,h,s),h=f.length,c=1;else 0==p&&(c=p=1),h=(f=x.slice()).length;if(h<b&&(f=[0].concat(f)),n(g,f,b,s),b=g.length,-1==c)for(;t(x,g,A,b)<1;)p++,n(g,A<b?O:x,b,s),b=g.length}else 0===c&&(p++,g=[0]);y[u++]=p,g[0]?g[b++]=S[v]||0:(g=[S[v]],b=1)}while((v++<T||null!=g[0])&&E--);d=null!=g[0],y[0]||y.splice(0,1)}if(s==BASE){for(u=1,E=y[0];E>=10;E/=10,u++);_(m,i+(m.e=u+l*LOG_BASE-1)+1,a,d)}else m.e=l,m.r=+d;return m}}(),o=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,o=/^-?(Infinity|NaN)$/,r=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(i,a,s,c){var l,u=s?a:a.replace(r,"");if(o.test(u))i.s=isNaN(u)?null:u<0?-1:1;else{if(!s&&(u=u.replace(e,(function(e,t,n){return l="x"==(n=n.toLowerCase())?16:"b"==n?2:8,c&&c!=l?e:t})),c&&(l=c,u=u.replace(t,"$1").replace(n,"0.$1")),a!=u))return new w(u,l);if(w.DEBUG)throw Error(bignumberError+"Not a"+(c?" base "+c:"")+" number: "+a);i.s=null}i.c=i.e=null}}(),a.absoluteValue=a.abs=function(){var e=new w(this);return e.s<0&&(e.s=1),e},a.comparedTo=function(e,t){return compare(this,new w(e,t))},a.decimalPlaces=a.dp=function(e,t){var n,o,r,i=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=l:intCheck(t,0,8),_(new w(i),e+i.e+1,t);if(!(n=i.c))return null;if(o=((r=n.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,r=n[r])for(;r%10==0;r/=10,o--);return o<0&&(o=0),o},a.dividedBy=a.div=function(e,n){return t(this,new w(e,n),c,l)},a.dividedToIntegerBy=a.idiv=function(e,n){return t(this,new w(e,n),0,1)},a.exponentiatedBy=a.pow=function(e,t){var n,o,r,i,a,c,u,d,p=this;if((e=new w(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+A(e));if(null!=t&&(t=new w(t)),a=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return d=new w(Math.pow(+A(p),a?e.s*(2-isOdd(e)):+A(e))),t?d.mod(t):d;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new w(NaN);(o=!c&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return i=p.s<0&&isOdd(e)?-0:0,p.e>-1&&(i=1/i),new w(c?1/i:i);y&&(i=mathceil(y/LOG_BASE+2))}for(a?(n=new w(.5),c&&(e.s=1),u=isOdd(e)):u=(r=Math.abs(+A(e)))%2,d=new w(s);;){if(u){if(!(d=d.times(p)).c)break;i?d.c.length>i&&(d.c.length=i):o&&(d=d.mod(t))}if(r){if(0===(r=mathfloor(r/2)))break;u=r%2}else if(_(e=e.times(n),e.e+1,1),e.e>14)u=isOdd(e);else{if(0===(r=+A(e)))break;u=r%2}p=p.times(p),i?p.c&&p.c.length>i&&(p.c.length=i):o&&(p=p.mod(t))}return o?d:(c&&(d=s.div(d)),t?d.mod(t):i?_(d,y,l,undefined):d)},a.integerValue=function(e){var t=new w(this);return null==e?e=l:intCheck(e,0,8),_(t,t.e+1,e)},a.isEqualTo=a.eq=function(e,t){return 0===compare(this,new w(e,t))},a.isFinite=function(){return!!this.c},a.isGreaterThan=a.gt=function(e,t){return compare(this,new w(e,t))>0},a.isGreaterThanOrEqualTo=a.gte=function(e,t){return 1===(t=compare(this,new w(e,t)))||0===t},a.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},a.isLessThan=a.lt=function(e,t){return compare(this,new w(e,t))<0},a.isLessThanOrEqualTo=a.lte=function(e,t){return-1===(t=compare(this,new w(e,t)))||0===t},a.isNaN=function(){return!this.s},a.isNegative=function(){return this.s<0},a.isPositive=function(){return this.s>0},a.isZero=function(){return!!this.c&&0==this.c[0]},a.minus=function(e,t){var n,o,r,i,a=this,s=a.s;if(t=(e=new w(e,t)).s,!s||!t)return new w(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/LOG_BASE,u=e.e/LOG_BASE,d=a.c,p=e.c;if(!c||!u){if(!d||!p)return d?(e.s=-t,e):new w(p?a:NaN);if(!d[0]||!p[0])return p[0]?(e.s=-t,e):new w(d[0]?a:3==l?-0:0)}if(c=bitFloor(c),u=bitFloor(u),d=d.slice(),s=c-u){for((i=s<0)?(s=-s,r=d):(u=c,r=p),r.reverse(),t=s;t--;r.push(0));r.reverse()}else for(o=(i=(s=d.length)<(t=p.length))?s:t,s=t=0;t<o;t++)if(d[t]!=p[t]){i=d[t]<p[t];break}if(i&&(r=d,d=p,p=r,e.s=-e.s),(t=(o=p.length)-(n=d.length))>0)for(;t--;d[n++]=0);for(t=BASE-1;o>s;){if(d[--o]<p[o]){for(n=o;n&&!d[--n];d[n]=t);--d[n],d[o]+=BASE}d[o]-=p[o]}for(;0==d[0];d.splice(0,1),--u);return d[0]?I(e,d,u):(e.s=3==l?-1:1,e.c=[e.e=0],e)},a.modulo=a.mod=function(e,n){var o,r,i=this;return e=new w(e,n),!i.c||!e.s||e.c&&!e.c[0]?new w(NaN):!e.c||i.c&&!i.c[0]?new w(i):(9==m?(r=e.s,e.s=1,o=t(i,e,0,3),e.s=r,o.s*=r):o=t(i,e,0,m),(e=i.minus(o.times(e))).c[0]||1!=m||(e.s=i.s),e)},a.multipliedBy=a.times=function(e,t){var n,o,r,i,a,s,c,l,u,d,p,f,h,m,y,g=this,b=g.c,k=(e=new w(e,t)).c;if(!(b&&k&&b[0]&&k[0]))return!g.s||!e.s||b&&!b[0]&&!k||k&&!k[0]&&!b?e.c=e.e=e.s=null:(e.s*=g.s,b&&k?(e.c=[0],e.e=0):e.c=e.e=null),e;for(o=bitFloor(g.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=g.s,(c=b.length)<(d=k.length)&&(h=b,b=k,k=h,r=c,c=d,d=r),r=c+d,h=[];r--;h.push(0));for(m=BASE,y=SQRT_BASE,r=d;--r>=0;){for(n=0,p=k[r]%y,f=k[r]/y|0,i=r+(a=c);i>r;)n=((l=p*(l=b[--a]%y)+(s=f*l+(u=b[a]/y|0)*p)%y*y+h[i]+n)/m|0)+(s/y|0)+f*u,h[i--]=l%m;h[i]=n}return n?++o:h.splice(0,1),I(e,h,o)},a.negated=function(){var e=new w(this);return e.s=-e.s||null,e},a.plus=function(e,t){var n,o=this,r=o.s;if(t=(e=new w(e,t)).s,!r||!t)return new w(NaN);if(r!=t)return e.s=-t,o.minus(e);var i=o.e/LOG_BASE,a=e.e/LOG_BASE,s=o.c,c=e.c;if(!i||!a){if(!s||!c)return new w(r/0);if(!s[0]||!c[0])return c[0]?e:new w(s[0]?o:0*r)}if(i=bitFloor(i),a=bitFloor(a),s=s.slice(),r=i-a){for(r>0?(a=i,n=c):(r=-r,n=s),n.reverse();r--;n.push(0));n.reverse()}for((r=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=r),r=0;t;)r=(s[--t]=s[t]+c[t]+r)/BASE|0,s[t]=BASE===s[t]?0:s[t]%BASE;return r&&(s=[r].concat(s),++a),I(e,s,a)},a.precision=a.sd=function(e,t){var n,o,r,i=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=l:intCheck(t,0,8),_(new w(i),e,t);if(!(n=i.c))return null;if(o=(r=n.length-1)*LOG_BASE+1,r=n[r]){for(;r%10==0;r/=10,o--);for(r=n[0];r>=10;r/=10,o++);}return e&&i.e+1>o&&(o=i.e+1),o},a.shiftedBy=function(e){return intCheck(e,-9007199254740991,MAX_SAFE_INTEGER$1),this.times("1e"+e)},a.squareRoot=a.sqrt=function(){var e,n,o,r,i,a=this,s=a.c,u=a.s,d=a.e,p=c+4,f=new w("0.5");if(1!==u||!s||!s[0])return new w(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+A(a)))||u==1/0?(((n=coeffToString(s)).length+d)%2==0&&(n+="0"),u=Math.sqrt(+n),d=bitFloor((d+1)/2)-(d<0||d%2),o=new w(n=u==1/0?"5e"+d:(n=u.toExponential()).slice(0,n.indexOf("e")+1)+d)):o=new w(u+""),o.c[0])for((u=(d=o.e)+p)<3&&(u=0);;)if(i=o,o=f.times(i.plus(t(a,i,p,1))),coeffToString(i.c).slice(0,u)===(n=coeffToString(o.c)).slice(0,u)){if(o.e<d&&--u,"9999"!=(n=n.slice(u-3,u+1))&&(r||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(_(o,o.e+c+2,1),e=!o.times(o).eq(a));break}if(!r&&(_(i,i.e+c+2,0),i.times(i).eq(a))){o=i;break}p+=4,u+=4,r=1}return _(o,o.e+c+1,l,e)},a.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),v(this,e,t,1)},a.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),v(this,e,t)},a.toFormat=function(e,t,n){var o,r=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=g;else if("object"!=typeof n)throw Error(bignumberError+"Argument not an object: "+n);if(o=r.toFixed(e,t),r.c){var i,a=o.split("."),s=+n.groupSize,c=+n.secondaryGroupSize,l=n.groupSeparator||"",u=a[0],d=a[1],p=r.s<0,f=p?u.slice(1):u,h=f.length;if(c&&(i=s,s=c,c=i,h-=i),s>0&&h>0){for(i=h%s||s,u=f.substr(0,i);i<h;i+=s)u+=l+f.substr(i,s);c>0&&(u+=l+f.slice(i)),p&&(u="-"+u)}o=d?u+(n.decimalSeparator||"")+((c=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):u}return(n.prefix||"")+o+(n.suffix||"")},a.toFraction=function(e){var n,o,r,i,a,c,u,d,p,h,m,y,g=this,b=g.c;if(null!=e&&(!(u=new w(e)).isInteger()&&(u.c||1!==u.s)||u.lt(s)))throw Error(bignumberError+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+A(u));if(!b)return new w(g);for(n=new w(s),p=o=new w(s),r=d=new w(s),y=coeffToString(b),a=n.e=y.length-g.e-1,n.c[0]=POWS_TEN[(c=a%LOG_BASE)<0?LOG_BASE+c:c],e=!e||u.comparedTo(n)>0?a>0?n:p:u,c=f,f=1/0,u=new w(y),d.c[0]=0;h=t(u,n,0,1),1!=(i=o.plus(h.times(r))).comparedTo(e);)o=r,r=i,p=d.plus(h.times(i=p)),d=i,n=u.minus(h.times(i=n)),u=i;return i=t(e.minus(o),r,0,1),d=d.plus(i.times(p)),o=o.plus(i.times(r)),d.s=p.s=g.s,m=t(p,r,a*=2,l).minus(g).abs().comparedTo(t(d,o,a,l).minus(g).abs())<1?[p,r]:[d,o],f=c,m},a.toNumber=function(){return+A(this)},a.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),v(this,e,t,2)},a.toString=function(e){var t,o=this,r=o.s,i=o.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=i<=u||i>=d?toExponential(coeffToString(o.c),i):toFixedPoint(coeffToString(o.c),i,"0"):10===e&&k?t=toFixedPoint(coeffToString((o=_(new w(o),c+i+1,l)).c),o.e,"0"):(intCheck(e,2,b.length,"Base"),t=n(toFixedPoint(coeffToString(o.c),i,"0"),10,e,r,!0)),r<0&&o.c[0]&&(t="-"+t)),t},a.valueOf=a.toJSON=function(){return A(this)},a._isBigNumber=!0,a[Symbol.toStringTag]="BigNumber",a[Symbol.for("nodejs.util.inspect.custom")]=a.valueOf,null!=e&&w.set(e),w}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,n,o=1,r=e.length,i=e[0]+"";o<r;){for(t=e[o++]+"",n=LOG_BASE-t.length;n--;t="0"+t);i+=t}for(r=i.length;48===i.charCodeAt(--r););return i.slice(0,r+1||1)}function compare(e,t){var n,o,r=e.c,i=t.c,a=e.s,s=t.s,c=e.e,l=t.e;if(!a||!s)return null;if(n=r&&!r[0],o=i&&!i[0],n||o)return n?o?0:-s:a;if(a!=s)return a;if(n=a<0,o=c==l,!r||!i)return o?0:!r^n?1:-1;if(!o)return c>l^n?1:-1;for(s=(c=r.length)<(l=i.length)?c:l,a=0;a<s;a++)if(r[a]!=i[a])return r[a]>i[a]^n?1:-1;return c==l?0:c>l^n?1:-1}function intCheck(e,t,n,o){if(e<t||e>n||e!==mathfloor(e))throw Error(bignumberError+(o||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,n){var o,r;if(t<0){for(r=n+".";++t;r+=n);e=r+e}else if(++t>(o=e.length)){for(r=n,t-=o;--t;r+=n);e+=r}else t<o&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber$1=clone(),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs$1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})})),n}var lib$1={},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var n=new Array(arguments.length-1),o=0,r=2,i=!0;for(;r<arguments.length;)n[o++]=arguments[r++];return new Promise((function(r,a){n[o]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];r.apply(null,t)}};try{e.apply(t||null,n)}catch(s){i&&(i=!1,a(s))}}))},aspromise}var base64={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(e){var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var n=new Array(64),o=new Array(123),r=0;r<64;)o[n[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;t.encode=function(e,t,o){for(var r,i=null,a=[],s=0,c=0;t<o;){var l=e[t++];switch(c){case 0:a[s++]=n[l>>2],r=(3&l)<<4,c=1;break;case 1:a[s++]=n[r|l>>4],r=(15&l)<<2,c=2;break;case 2:a[s++]=n[r|l>>6],a[s++]=n[63&l],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=n[r],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,n){for(var r,a=n,s=0,c=0;c<e.length;){var l=e.charCodeAt(c++);if(61===l&&s>1)break;if(void 0===(l=o[l]))throw Error(i);switch(s){case 0:r=l,s=1;break;case 1:t[n++]=r<<2|(48&l)>>4,r=l,s=2;break;case 2:t[n++]=(15&r)<<4|(60&l)>>2,r=l,s=3;break;case 3:t[n++]=(3&r)<<6|l,s=0}}if(1===s)throw Error(i);return n-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(base64)),base64}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],o=0;o<n.length;)n[o].fn===t?n.splice(o,1):++o;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],o=1;o<arguments.length;)n.push(arguments[o++]);for(o=0;o<t.length;)t[o].fn.apply(t[o++].ctx,n)}return this},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),o=128===n[3];function r(e,o,r){t[0]=e,o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2],o[r+3]=n[3]}function i(e,o,r){t[0]=e,o[r]=n[3],o[r+1]=n[2],o[r+2]=n[1],o[r+3]=n[0]}function a(e,o){return n[0]=e[o],n[1]=e[o+1],n[2]=e[o+2],n[3]=e[o+3],t[0]}function s(e,o){return n[3]=e[o],n[2]=e[o+1],n[1]=e[o+2],n[0]=e[o+3],t[0]}e.writeFloatLE=o?r:i,e.writeFloatBE=o?i:r,e.readFloatLE=o?a:s,e.readFloatBE=o?s:a}():function(){function i(e,t,n,o){var r=t<0?1:0;if(r&&(t=-t),0===t)e(1/t>0?0:2147483648,n,o);else if(isNaN(t))e(2143289344,n,o);else if(t>34028234663852886e22)e((r<<31|2139095040)>>>0,n,o);else if(t<11754943508222875e-54)e((r<<31|Math.round(t/1401298464324817e-60))>>>0,n,o);else{var i=Math.floor(Math.log(t)/Math.LN2);e((r<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,n,o)}}function a(e,t,n){var o=e(t,n),r=2*(o>>31)+1,i=o>>>23&255,a=8388607&o;return 255===i?a?NaN:r*(1/0):0===i?1401298464324817e-60*r*a:r*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,n),e.readFloatLE=a.bind(null,o),e.readFloatBE=a.bind(null,r)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),o=128===n[7];function r(e,o,r){t[0]=e,o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2],o[r+3]=n[3],o[r+4]=n[4],o[r+5]=n[5],o[r+6]=n[6],o[r+7]=n[7]}function i(e,o,r){t[0]=e,o[r]=n[7],o[r+1]=n[6],o[r+2]=n[5],o[r+3]=n[4],o[r+4]=n[3],o[r+5]=n[2],o[r+6]=n[1],o[r+7]=n[0]}function a(e,o){return n[0]=e[o],n[1]=e[o+1],n[2]=e[o+2],n[3]=e[o+3],n[4]=e[o+4],n[5]=e[o+5],n[6]=e[o+6],n[7]=e[o+7],t[0]}function s(e,o){return n[7]=e[o],n[6]=e[o+1],n[5]=e[o+2],n[4]=e[o+3],n[3]=e[o+4],n[2]=e[o+5],n[1]=e[o+6],n[0]=e[o+7],t[0]}e.writeDoubleLE=o?r:i,e.writeDoubleBE=o?i:r,e.readDoubleLE=o?a:s,e.readDoubleBE=o?s:a}():function(){function i(e,t,n,o,r,i){var a=o<0?1:0;if(a&&(o=-o),0===o)e(0,r,i+t),e(1/o>0?0:2147483648,r,i+n);else if(isNaN(o))e(0,r,i+t),e(2146959360,r,i+n);else if(o>17976931348623157e292)e(0,r,i+t),e((a<<31|2146435072)>>>0,r,i+n);else{var s;if(o<22250738585072014e-324)e((s=o/5e-324)>>>0,r,i+t),e((a<<31|s/4294967296)>>>0,r,i+n);else{var c=Math.floor(Math.log(o)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=o*Math.pow(2,-c))>>>0,r,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,r,i+n)}}}function a(e,t,n,o,r){var i=e(o,r+t),a=e(o,r+n),s=2*(a>>31)+1,c=a>>>20&2047,l=4294967296*(1048575&a)+i;return 2047===c?l?NaN:s*(1/0):0===c?5e-324*s*l:s*Math.pow(2,c-1075)*(l+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,n,4,0),e.readDoubleLE=a.bind(null,o,0,4),e.readDoubleBE=a.bind(null,r,4,0)}(),e}function t(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function n(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function r(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e2){}return null}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal$1,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(e=utf8).length=function(e){for(var t=0,n=0,o=0;o<e.length;++o)(n=e.charCodeAt(o))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(o+1))?(++o,t+=4):t+=3;return t},e.read=function(e,t,n){if(n-t<1)return"";for(var o,r=null,i=[],a=0;t<n;)(o=e[t++])<128?i[a++]=o:o>191&&o<224?i[a++]=(31&o)<<6|63&e[t++]:o>239&&o<365?(o=((7&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(o>>10),i[a++]=56320+(1023&o)):i[a++]=(15&o)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,i)),a=0);return r?(a&&r.push(String.fromCharCode.apply(String,i.slice(0,a))),r.join("")):String.fromCharCode.apply(String,i.slice(0,a))},e.write=function(e,t,n){for(var o,r,i=n,a=0;a<e.length;++a)(o=e.charCodeAt(a))<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=63&o|128):55296==(64512&o)&&56320==(64512&(r=e.charCodeAt(a+1)))?(o=65536+((1023&o)<<10)+(1023&r),++a,t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128);return n-i}),utf8;var e}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,n){var o=n||8192,r=o>>>1,i=null,a=o;return function(n){if(n<1||n>r)return e(n);a+n>o&&(i=e(o),a=0);var s=t.call(i,a,a+=n);return 7&a&&(a=1+(7|a)),s}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var o=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return n;var o=e<0;o&&(e=-e);var r=e>>>0,i=(e-r)/4294967296>>>0;return o&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new t(r,i)},t.from=function(o){if("number"==typeof o)return t.fromNumber(o);if(e.isString(o)){if(!e.Long)return t.fromNumber(parseInt(o,10));o=e.Long.fromString(o)}return o.low||o.high?new t(o.low>>>0,o.high>>>0):n},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var r=String.prototype.charCodeAt;return t.fromHash=function(e){return e===o?n:new t((r.call(e,0)|r.call(e,1)<<8|r.call(e,2)<<16|r.call(e,3)<<24)>>>0,(r.call(e,4)|r.call(e,5)<<8|r.call(e,6)<<16|r.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10},longbits}function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(e){var t=e;function n(e,t,n){for(var o=Object.keys(t),r=0;r<o.length;++r)void 0!==e[o[r]]&&n||(e[o[r]]=t[o[r]]);return e}function o(e){function t(e,o){if(!(this instanceof t))return new t(e,o);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),o&&n(this,o)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.asPromise=requireAspromise(),t.base64=requireBase64(),t.EventEmitter=requireEventemitter(),t.float=requireFloat(),t.inquire=requireInquire(),t.utf8=requireUtf8(),t.pool=requirePool(),t.LongBits=requireLongbits(),t.isNode=Boolean(void 0!==commonjsGlobal&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||minimal$1,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"==typeof e},t.isset=t.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(n){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var o=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(o.lo,o.hi,n):o.toNumber(Boolean(n))},t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},t.newError=o,t.ProtocolError=o("ProtocolError"),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;e?(t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):t._Buffer_from=t._Buffer_allocUnsafe=null}}(minimal$1)),minimal$1}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=c;var e,t=requireMinimal$1(),n=t.LongBits,o=t.base64,r=t.utf8;function i(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function a(){}function s(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function c(){this.len=0,this.head=new i(a,0,0),this.tail=this.head,this.states=null}var l=function(){return t.Buffer?function(){return(c.create=function(){return new e})()}:function(){return new c}};function u(e,t,n){t[n]=255&e}function d(e,t){this.len=e,this.next=void 0,this.val=t}function p(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function f(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}c.create=l(),c.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(c.alloc=t.pool(c.alloc,t.Array.prototype.subarray)),c.prototype._push=function(e,t,n){return this.tail=this.tail.next=new i(e,t,n),this.len+=t,this},d.prototype=Object.create(i.prototype),d.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},c.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new d((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},c.prototype.int32=function(e){return e<0?this._push(p,10,n.fromNumber(e)):this.uint32(e)},c.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},c.prototype.uint64=function(e){var t=n.from(e);return this._push(p,t.length(),t)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(e){var t=n.from(e).zzEncode();return this._push(p,t.length(),t)},c.prototype.bool=function(e){return this._push(u,1,e?1:0)},c.prototype.fixed32=function(e){return this._push(f,4,e>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(e){var t=n.from(e);return this._push(f,4,t.lo)._push(f,4,t.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},c.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var h=t.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var o=0;o<e.length;++o)t[n+o]=e[o]};return c.prototype.bytes=function(e){var n=e.length>>>0;if(!n)return this._push(u,1,0);if(t.isString(e)){var r=c.alloc(n=o.length(e));o.decode(e,r,0),e=r}return this.uint32(n)._push(h,n,e)},c.prototype.string=function(e){var t=r.length(e);return t?this.uint32(t)._push(r.write,t,e):this._push(u,1,0)},c.prototype.fork=function(){return this.states=new s(this),this.head=this.tail=new i(a,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(a,0,0),this.len=0),this},c.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},c.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},c._configure=function(t){e=t,c.create=l(),e._configure()},writer}function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=n;var e=requireWriter();(n.prototype=Object.create(e.prototype)).constructor=n;var t=requireMinimal$1();function n(){e.call(this)}function o(e,n,o){e.length<40?t.utf8.write(e,n,o):n.utf8Write?n.utf8Write(e,o):n.write(e,o)}return n._configure=function(){n.alloc=t._Buffer_allocUnsafe,n.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var o=0;o<e.length;)t[n++]=e[o++]}},n.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var o=e.length>>>0;return this.uint32(o),o&&this._push(n.writeBytesBuffer,o,e),this},n.prototype.string=function(e){var n=t.Buffer.byteLength(e);return this.uint32(n),n&&this._push(o,n,e),this},n._configure(),writer_buffer}function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=i;var e,t=requireMinimal$1(),n=t.LongBits,o=t.utf8;function r(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function i(e){this.buf=e,this.pos=0,this.len=e.length}var a="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new i(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new i(e);throw Error("illegal buffer")},s=function(){return t.Buffer?function(n){return(i.create=function(n){return t.Buffer.isBuffer(n)?new e(n):a(n)})(n)}:a};function c(){var e=new n(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw r(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw r(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function l(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function u(){if(this.pos+8>this.len)throw r(this,8);return new n(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}return i.create=s(),i.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,i.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,r(this,10);return e}}(),i.prototype.int32=function(){return 0|this.uint32()},i.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},i.prototype.bool=function(){return 0!==this.uint32()},i.prototype.fixed32=function(){if(this.pos+4>this.len)throw r(this,4);return l(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw r(this,4);return 0|l(this.buf,this.pos+=4)},i.prototype.float=function(){if(this.pos+4>this.len)throw r(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},i.prototype.double=function(){if(this.pos+8>this.len)throw r(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},i.prototype.bytes=function(){var e=this.uint32(),n=this.pos,o=this.pos+e;if(o>this.len)throw r(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(n,o);if(n===o){var i=t.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,n,o)},i.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},i.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw r(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw r(this)}while(128&this.buf[this.pos++]);return this},i.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},i._configure=function(n){e=n,i.create=s(),e._configure();var o=t.Long?"toLong":"toNumber";t.merge(i.prototype,{int64:function(){return c.call(this)[o](!1)},uint64:function(){return c.call(this)[o](!0)},sint64:function(){return c.call(this).zzDecode()[o](!1)},fixed64:function(){return u.call(this)[o](!0)},sfixed64:function(){return u.call(this)[o](!1)}})},reader}function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=n;var e=requireReader();(n.prototype=Object.create(e.prototype)).constructor=n;var t=requireMinimal$1();function n(t){e.call(this,t)}return n._configure=function(){t.Buffer&&(n.prototype._slice=t.Buffer.prototype.slice)},n.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},n._configure(),reader_buffer}var rpc={},service,hasRequiredService,hasRequiredRpc,roots,hasRequiredRoots,hasRequiredIndexMinimal,minimal,hasRequiredMinimal;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=t;var e=requireMinimal$1();function t(t,n,o){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(n),this.responseDelimited=Boolean(o)}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(n,o,r,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return e.asPromise(t,s,n,o,r,i);if(s.rpcImpl)try{return s.rpcImpl(n,o[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,t){if(e)return s.emit("error",e,n),a(e);if(null!==t){if(!(t instanceof r))try{t=r[s.responseDelimited?"decodeDelimited":"decode"](t)}catch(o){return s.emit("error",o,n),a(o)}return s.emit("data",t,n),a(null,t)}s.end(!0)}))}catch(c){return s.emit("error",c,n),void setTimeout((function(){a(c)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,rpc.Service=requireService()),rpc}function requireRoots(){return hasRequiredRoots?roots:(hasRequiredRoots=1,roots={})}function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(e){var t=e;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}t.build="minimal",t.Writer=requireWriter(),t.BufferWriter=requireWriter_buffer(),t.Reader=requireReader(),t.BufferReader=requireReader_buffer(),t.util=requireMinimal$1(),t.rpc=requireRpc(),t.roots=requireRoots(),t.configure=n,n()}(indexMinimal)),indexMinimal}function requireMinimal(){return hasRequiredMinimal?minimal:(hasRequiredMinimal=1,minimal=requireIndexMinimal())}var umd$1={exports:{}},umd=umd$1.exports,hasRequiredUmd;function requireUmd(){return hasRequiredUmd||(hasRequiredUmd=1,e=umd$1,t=umd$1.exports,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;
20
+ */var wasm=null;try{wasm=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Long(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function isLong(e){return!0===(e&&e.__isLong__)}function ctz32(e){var t=Math.clz32(e&-e);return e?31-t:t}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0}),Long.isLong=isLong;var INT_CACHE={},UINT_CACHE={};function fromInt(e,t){var n,o,r;return t?(r=0<=(e>>>=0)&&e<256)&&(o=UINT_CACHE[e])?o:(n=fromBits(e,0,!0),r&&(UINT_CACHE[e]=n),n):(r=-128<=(e|=0)&&e<128)&&(o=INT_CACHE[e])?o:(n=fromBits(e,e<0?-1:0,!1),r&&(INT_CACHE[e]=n),n)}function fromNumber(e,t){if(isNaN(e))return t?UZERO:ZERO;if(t){if(e<0)return UZERO;if(e>=TWO_PWR_64_DBL)return MAX_UNSIGNED_VALUE}else{if(e<=-0x8000000000000000)return MIN_VALUE;if(e+1>=TWO_PWR_63_DBL)return MAX_VALUE}return e<0?fromNumber(-e,t).neg():fromBits(e%TWO_PWR_32_DBL|0,e/TWO_PWR_32_DBL|0,t)}function fromBits(e,t,n){return new Long(e,t,n)}Long.fromInt=fromInt,Long.fromNumber=fromNumber,Long.fromBits=fromBits;var pow_dbl=Math.pow;function fromString(e,t,n){if(0===e.length)throw Error("empty string");if("number"==typeof t?(n=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?UZERO:ZERO;if((n=n||10)<2||36<n)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return fromString(e.substring(1),t,n).neg();for(var r=fromNumber(pow_dbl(n,8)),i=ZERO,a=0;a<e.length;a+=8){var s=Math.min(8,e.length-a),c=parseInt(e.substring(a,a+s),n);if(s<8){var l=fromNumber(pow_dbl(n,s));i=i.mul(l).add(fromNumber(c))}else i=(i=i.mul(r)).add(fromNumber(c))}return i.unsigned=t,i}function fromValue(e,t){return"number"==typeof e?fromNumber(e,t):"string"==typeof e?fromString(e,t):fromBits(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}Long.fromString=fromString,Long.fromValue=fromValue;var TWO_PWR_16_DBL=65536,TWO_PWR_24_DBL=1<<24,TWO_PWR_32_DBL=TWO_PWR_16_DBL*TWO_PWR_16_DBL,TWO_PWR_64_DBL=TWO_PWR_32_DBL*TWO_PWR_32_DBL,TWO_PWR_63_DBL=TWO_PWR_64_DBL/2,TWO_PWR_24=fromInt(TWO_PWR_24_DBL),ZERO=fromInt(0);Long.ZERO=ZERO;var UZERO=fromInt(0,!0);Long.UZERO=UZERO;var ONE=fromInt(1);Long.ONE=ONE;var UONE=fromInt(1,!0);Long.UONE=UONE;var NEG_ONE=fromInt(-1);Long.NEG_ONE=NEG_ONE;var MAX_VALUE=fromBits(-1,2147483647,!1);Long.MAX_VALUE=MAX_VALUE;var MAX_UNSIGNED_VALUE=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=MAX_UNSIGNED_VALUE;var MIN_VALUE=fromBits(0,-2147483648,!1);Long.MIN_VALUE=MIN_VALUE;var LongPrototype=Long.prototype;LongPrototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},LongPrototype.toNumber=function(){return this.unsigned?(this.high>>>0)*TWO_PWR_32_DBL+(this.low>>>0):this.high*TWO_PWR_32_DBL+(this.low>>>0)},LongPrototype.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(MIN_VALUE)){var t=fromNumber(e),n=this.div(t),o=n.mul(t).sub(this);return n.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var r=fromNumber(pow_dbl(e,6),this.unsigned),i=this,a="";;){var s=i.div(r),c=(i.sub(s.mul(r)).toInt()>>>0).toString(e);if((i=s).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},LongPrototype.getHighBits=function(){return this.high},LongPrototype.getHighBitsUnsigned=function(){return this.high>>>0},LongPrototype.getLowBits=function(){return this.low},LongPrototype.getLowBitsUnsigned=function(){return this.low>>>0},LongPrototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(MIN_VALUE)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},LongPrototype.isSafeInteger=function(){var e=this.high>>21;return!e||!this.unsigned&&(-1===e&&!(0===this.low&&-2097152===this.high))},LongPrototype.isZero=function(){return 0===this.high&&0===this.low},LongPrototype.eqz=LongPrototype.isZero,LongPrototype.isNegative=function(){return!this.unsigned&&this.high<0},LongPrototype.isPositive=function(){return this.unsigned||this.high>=0},LongPrototype.isOdd=function(){return!(1&~this.low)},LongPrototype.isEven=function(){return!(1&this.low)},LongPrototype.equals=function(e){return isLong(e)||(e=fromValue(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},LongPrototype.eq=LongPrototype.equals,LongPrototype.notEquals=function(e){return!this.eq(e)},LongPrototype.neq=LongPrototype.notEquals,LongPrototype.ne=LongPrototype.notEquals,LongPrototype.lessThan=function(e){return this.comp(e)<0},LongPrototype.lt=LongPrototype.lessThan,LongPrototype.lessThanOrEqual=function(e){return this.comp(e)<=0},LongPrototype.lte=LongPrototype.lessThanOrEqual,LongPrototype.le=LongPrototype.lessThanOrEqual,LongPrototype.greaterThan=function(e){return this.comp(e)>0},LongPrototype.gt=LongPrototype.greaterThan,LongPrototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},LongPrototype.gte=LongPrototype.greaterThanOrEqual,LongPrototype.ge=LongPrototype.greaterThanOrEqual,LongPrototype.compare=function(e){if(isLong(e)||(e=fromValue(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},LongPrototype.comp=LongPrototype.compare,LongPrototype.negate=function(){return!this.unsigned&&this.eq(MIN_VALUE)?MIN_VALUE:this.not().add(ONE)},LongPrototype.neg=LongPrototype.negate,LongPrototype.add=function(e){isLong(e)||(e=fromValue(e));var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,r=65535&this.low,i=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=0,l=0,u=0,d=0;return u+=(d+=r+(65535&e.low))>>>16,l+=(u+=o+s)>>>16,c+=(l+=n+a)>>>16,c+=t+i,fromBits((u&=65535)<<16|(d&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},LongPrototype.subtract=function(e){return isLong(e)||(e=fromValue(e)),this.add(e.neg())},LongPrototype.sub=LongPrototype.subtract,LongPrototype.multiply=function(e){if(this.isZero())return this;if(isLong(e)||(e=fromValue(e)),wasm)return fromBits(wasm.mul(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned);if(e.isZero())return this.unsigned?UZERO:ZERO;if(this.eq(MIN_VALUE))return e.isOdd()?MIN_VALUE:ZERO;if(e.eq(MIN_VALUE))return this.isOdd()?MIN_VALUE:ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(TWO_PWR_24)&&e.lt(TWO_PWR_24))return fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,r=65535&this.low,i=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=65535&e.low,l=0,u=0,d=0,p=0;return d+=(p+=r*c)>>>16,u+=(d+=o*c)>>>16,d&=65535,u+=(d+=r*s)>>>16,l+=(u+=n*c)>>>16,u&=65535,l+=(u+=o*s)>>>16,u&=65535,l+=(u+=r*a)>>>16,l+=t*c+n*s+o*a+r*i,fromBits((d&=65535)<<16|(p&=65535),(l&=65535)<<16|(u&=65535),this.unsigned)},LongPrototype.mul=LongPrototype.multiply,LongPrototype.divide=function(e){if(isLong(e)||(e=fromValue(e)),e.isZero())throw Error("division by zero");var t,n,o;if(wasm)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?fromBits((this.unsigned?wasm.div_u:wasm.div_s)(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?UZERO:ZERO;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return UZERO;if(e.gt(this.shru(1)))return UONE;o=UZERO}else{if(this.eq(MIN_VALUE))return e.eq(ONE)||e.eq(NEG_ONE)?MIN_VALUE:e.eq(MIN_VALUE)?ONE:(t=this.shr(1).div(e).shl(1)).eq(ZERO)?e.isNegative()?ONE:NEG_ONE:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(MIN_VALUE))return this.unsigned?UZERO:ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=ZERO}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var r=Math.ceil(Math.log(t)/Math.LN2),i=r<=48?1:pow_dbl(2,r-48),a=fromNumber(t),s=a.mul(e);s.isNegative()||s.gt(n);)s=(a=fromNumber(t-=i,this.unsigned)).mul(e);a.isZero()&&(a=ONE),o=o.add(a),n=n.sub(s)}return o},LongPrototype.div=LongPrototype.divide,LongPrototype.modulo=function(e){return isLong(e)||(e=fromValue(e)),wasm?fromBits((this.unsigned?wasm.rem_u:wasm.rem_s)(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},LongPrototype.mod=LongPrototype.modulo,LongPrototype.rem=LongPrototype.modulo,LongPrototype.not=function(){return fromBits(~this.low,~this.high,this.unsigned)},LongPrototype.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},LongPrototype.clz=LongPrototype.countLeadingZeros,LongPrototype.countTrailingZeros=function(){return this.low?ctz32(this.low):ctz32(this.high)+32},LongPrototype.ctz=LongPrototype.countTrailingZeros,LongPrototype.and=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low&e.low,this.high&e.high,this.unsigned)},LongPrototype.or=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low|e.low,this.high|e.high,this.unsigned)},LongPrototype.xor=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low^e.low,this.high^e.high,this.unsigned)},LongPrototype.shiftLeft=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):fromBits(0,this.low<<e-32,this.unsigned)},LongPrototype.shl=LongPrototype.shiftLeft,LongPrototype.shiftRight=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},LongPrototype.shr=LongPrototype.shiftRight,LongPrototype.shiftRightUnsigned=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):fromBits(32===e?this.high:this.high>>>e-32,0,this.unsigned)},LongPrototype.shru=LongPrototype.shiftRightUnsigned,LongPrototype.shr_u=LongPrototype.shiftRightUnsigned,LongPrototype.rotateLeft=function(e){var t;return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?fromBits(this.high,this.low,this.unsigned):e<32?(t=32-e,fromBits(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),fromBits(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},LongPrototype.rotl=LongPrototype.rotateLeft,LongPrototype.rotateRight=function(e){var t;return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?fromBits(this.high,this.low,this.unsigned):e<32?(t=32-e,fromBits(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),fromBits(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},LongPrototype.rotr=LongPrototype.rotateRight,LongPrototype.toSigned=function(){return this.unsigned?fromBits(this.low,this.high,!1):this},LongPrototype.toUnsigned=function(){return this.unsigned?this:fromBits(this.low,this.high,!0)},LongPrototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},LongPrototype.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},LongPrototype.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},Long.fromBytes=function(e,t,n){return n?Long.fromBytesLE(e,t):Long.fromBytesBE(e,t)},Long.fromBytesLE=function(e,t){return new Long(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},Long.fromBytesBE=function(e,t){return new Long(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},"function"==typeof BigInt&&(Long.fromBigInt=function(e,t){return fromBits(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},Long.fromValue=function(e,t){return"bigint"==typeof e?fromBigInt(e,t):fromValue(e,t)},LongPrototype.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e});var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$1=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,n,o,r,i,a=w.prototype={constructor:w,toString:null,valueOf:null},s=new w(1),c=20,l=4,u=-7,d=21,p=-1e7,f=1e7,h=!1,m=1,y=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},b="0123456789abcdefghijklmnopqrstuvwxyz",k=!0;function w(e,t){var r,i,a,s,u,d,h,m,y=this;if(!(y instanceof w))return new w(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>f?y.c=y.e=null:e.e<p?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,u=e;u>=10;u/=10,s++);return void(s>f?y.c=y.e=null:(y.e=s,y.c=[e]))}m=String(e)}else{if(!isNumeric.test(m=String(e)))return o(y,m,d);y.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(s=m.indexOf("."))>-1&&(m=m.replace(".","")),(u=m.search(/e/i))>0?(s<0&&(s=u),s+=+m.slice(u+1),m=m.substring(0,u)):s<0&&(s=m.length)}else{if(intCheck(t,2,b.length,"Base"),10==t&&k)return _(y=new w(e),c+y.e+1,l);if(m=String(e),d="number"==typeof e){if(0*e!=0)return o(y,m,d,t);if(y.s=1/e<0?(m=m.slice(1),-1):1,w.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else y.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=b.slice(0,t),s=u=0,h=m.length;u<h;u++)if(r.indexOf(i=m.charAt(u))<0){if("."==i){if(u>s){s=h;continue}}else if(!a&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){a=!0,u=-1,s=0;continue}return o(y,String(e),d,t)}d=!1,(s=(m=n(m,t,10,y.s)).indexOf("."))>-1?m=m.replace(".",""):s=m.length}for(u=0;48===m.charCodeAt(u);u++);for(h=m.length;48===m.charCodeAt(--h););if(m=m.slice(u,++h)){if(h-=u,d&&w.DEBUG&&h>15&&(e>MAX_SAFE_INTEGER$1||e!==mathfloor(e)))throw Error(tooManyDigits+y.s*e);if((s=s-u-1)>f)y.c=y.e=null;else if(s<p)y.c=[y.e=0];else{if(y.e=s,y.c=[],u=(s+1)%LOG_BASE,s<0&&(u+=LOG_BASE),u<h){for(u&&y.c.push(+m.slice(0,u)),h-=LOG_BASE;u<h;)y.c.push(+m.slice(u,u+=LOG_BASE));u=LOG_BASE-(m=m.slice(u)).length}else u-=h;for(;u--;m+="0");y.c.push(+m)}}else y.c=[y.e=0]}function v(e,t,n,o){var r,i,a,s,c;if(null==n?n=l:intCheck(n,0,8),!e.c)return e.toString();if(r=e.c[0],a=e.e,null==t)c=coeffToString(e.c),c=1==o||2==o&&(a<=u||a>=d)?toExponential(c,a):toFixedPoint(c,a,"0");else if(i=(e=_(new w(e),t,n)).e,s=(c=coeffToString(e.c)).length,1==o||2==o&&(t<=i||i<=u)){for(;s<t;c+="0",s++);c=toExponential(c,i)}else if(t-=a,c=toFixedPoint(c,i,"0"),i+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=i-s)>0)for(i+1==s&&(c+=".");t--;c+="0");return e.s<0&&r?"-"+c:c}function T(e,t){for(var n,o,r=1,i=new w(e[0]);r<e.length;r++)(!(o=new w(e[r])).s||(n=compare(i,o))===t||0===n&&i.s===t)&&(i=o);return i}function I(e,t,n){for(var o=1,r=t.length;!t[--r];t.pop());for(r=t[0];r>=10;r/=10,o++);return(n=o+n*LOG_BASE-1)>f?e.c=e.e=null:n<p?e.c=[e.e=0]:(e.e=n,e.c=t),e}function _(e,t,n,o){var r,i,a,s,c,l,u,d=e.c,h=POWS_TEN;if(d){e:{for(r=1,s=d[0];s>=10;s/=10,r++);if((i=t-r)<0)i+=LOG_BASE,a=t,c=d[l=0],u=mathfloor(c/h[r-a-1]%10);else if((l=mathceil((i+1)/LOG_BASE))>=d.length){if(!o)break e;for(;d.length<=l;d.push(0));c=u=0,r=1,a=(i%=LOG_BASE)-LOG_BASE+1}else{for(c=s=d[l],r=1;s>=10;s/=10,r++);u=(a=(i%=LOG_BASE)-LOG_BASE+r)<0?0:mathfloor(c/h[r-a-1]%10)}if(o=o||t<0||null!=d[l+1]||(a<0?c:c%h[r-a-1]),o=n<4?(u||o)&&(0==n||n==(e.s<0?3:2)):u>5||5==u&&(4==n||o||6==n&&(i>0?a>0?c/h[r-a]:0:d[l-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,o?(t-=e.e+1,d[0]=h[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):d[0]=e.e=0,e;if(0==i?(d.length=l,s=1,l--):(d.length=l+1,s=h[LOG_BASE-i],d[l]=a>0?mathfloor(c/h[r-a]%h[a])*s:0),o)for(;;){if(0==l){for(i=1,a=d[0];a>=10;a/=10,i++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,d[0]==BASE&&(d[0]=1));break}if(d[l]+=s,d[l]!=BASE)break;d[l--]=0,s=1}for(i=d.length;0===d[--i];d.pop());}e.e>f?e.c=e.e=null:e.e<p&&(e.c=[e.e=0])}return e}function A(e){var t,n=e.e;return null===n?e.toString():(t=coeffToString(e.c),t=n<=u||n>=d?toExponential(t,n):toFixedPoint(t,n,"0"),e.s<0?"-"+t:t)}return w.clone=clone,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(n=e[t],0,MAX,t),c=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(n=e[t],0,8,t),l=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(intCheck(n[0],-1e9,0,t),intCheck(n[1],0,MAX,t),u=n[0],d=n[1]):(intCheck(n,-1e9,MAX,t),u=-(d=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)intCheck(n[0],-1e9,-1,t),intCheck(n[1],1,MAX,t),p=n[0],f=n[1];else{if(intCheck(n,-1e9,MAX,t),!n)throw Error(bignumberError+t+" cannot be zero: "+n);p=-(f=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(bignumberError+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw h=!n,Error(bignumberError+"crypto unavailable");h=n}else h=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(n=e[t],0,9,t),m=n),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(n=e[t],0,MAX,t),y=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(bignumberError+t+" not an object: "+n);g=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(bignumberError+t+" invalid: "+n);k="0123456789"==n.slice(0,10),b=n}}return{DECIMAL_PLACES:c,ROUNDING_MODE:l,EXPONENTIAL_AT:[u,d],RANGE:[p,f],CRYPTO:h,MODULO_MODE:m,POW_PRECISION:y,FORMAT:g,ALPHABET:b}},w.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!w.DEBUG)return!0;var t,n,o=e.c,r=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(o)){if((1===i||-1===i)&&r>=-1e9&&r<=MAX&&r===mathfloor(r)){if(0===o[0]){if(0===r&&1===o.length)return!0;break e}if((t=(r+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(o[0]).length==t){for(t=0;t<o.length;t++)if((n=o[t])<0||n>=BASE||n!==mathfloor(n))break e;if(0!==n)return!0}}}else if(null===o&&null===r&&(null===i||1===i||-1===i))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},w.maximum=w.max=function(){return T(arguments,-1)},w.minimum=w.min=function(){return T(arguments,1)},w.random=(r=9007199254740992,i=Math.random()*r&2097151?function(){return mathfloor(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,o,r,a,l=0,u=[],d=new w(s);if(null==e?e=c:intCheck(e,0,MAX),r=mathceil(e/LOG_BASE),h)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(r*=2));l<r;)(a=131072*t[l]+(t[l+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[l]=n[0],t[l+1]=n[1]):(u.push(a%1e14),l+=2);l=r/2}else{if(!crypto.randomBytes)throw h=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(r*=7);l<r;)(a=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(u.push(a%1e14),l+=7);l=r/7}if(!h)for(;l<r;)(a=i())<9e15&&(u[l++]=a%1e14);for(r=u[--l],e%=LOG_BASE,r&&e&&(a=POWS_TEN[LOG_BASE-e],u[l]=mathfloor(r/a)*a);0===u[l];u.pop(),l--);if(l<0)u=[o=0];else{for(o=-1;0===u[0];u.splice(0,1),o-=LOG_BASE);for(l=1,a=u[0];a>=10;a/=10,l++);l<LOG_BASE&&(o-=LOG_BASE-l)}return d.e=o,d.c=u,d}),w.sum=function(){for(var e=1,t=arguments,n=new w(t[0]);e<t.length;)n=n.plus(t[e++]);return n},n=function(){var e="0123456789";function n(e,t,n,o){for(var r,i,a=[0],s=0,c=e.length;s<c;){for(i=a.length;i--;a[i]*=t);for(a[0]+=o.indexOf(e.charAt(s++)),r=0;r<a.length;r++)a[r]>n-1&&(null==a[r+1]&&(a[r+1]=0),a[r+1]+=a[r]/n|0,a[r]%=n)}return a.reverse()}return function(o,r,i,a,s){var u,d,p,f,h,m,g,k,v=o.indexOf("."),T=c,I=l;for(v>=0&&(f=y,y=0,o=o.replace(".",""),m=(k=new w(r)).pow(o.length-v),y=f,k.c=n(toFixedPoint(coeffToString(m.c),m.e,"0"),10,i,e),k.e=k.c.length),p=f=(g=n(o,r,i,s?(u=b,e):(u=e,b))).length;0==g[--f];g.pop());if(!g[0])return u.charAt(0);if(v<0?--p:(m.c=g,m.e=p,m.s=a,g=(m=t(m,k,T,I,i)).c,h=m.r,p=m.e),v=g[d=p+T+1],f=i/2,h=h||d<0||null!=g[d+1],h=I<4?(null!=v||h)&&(0==I||I==(m.s<0?3:2)):v>f||v==f&&(4==I||h||6==I&&1&g[d-1]||I==(m.s<0?8:7)),d<1||!g[0])o=h?toFixedPoint(u.charAt(1),-T,u.charAt(0)):u.charAt(0);else{if(g.length=d,h)for(--i;++g[--d]>i;)g[d]=0,d||(++p,g=[1].concat(g));for(f=g.length;!g[--f];);for(v=0,o="";v<=f;o+=u.charAt(g[v++]));o=toFixedPoint(o,p,u.charAt(0))}return o}}(),t=function(){function e(e,t,n){var o,r,i,a,s=0,c=e.length,l=t%SQRT_BASE,u=t/SQRT_BASE|0;for(e=e.slice();c--;)s=((r=l*(i=e[c]%SQRT_BASE)+(o=u*i+(a=e[c]/SQRT_BASE|0)*l)%SQRT_BASE*SQRT_BASE+s)/n|0)+(o/SQRT_BASE|0)+u*a,e[c]=r%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,o){var r,i;if(n!=o)i=n>o?1:-1;else for(r=i=0;r<n;r++)if(e[r]!=t[r]){i=e[r]>t[r]?1:-1;break}return i}function n(e,t,n,o){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=r*o+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(o,r,i,a,s){var c,l,u,d,p,f,h,m,y,g,b,k,v,T,I,A,O,E=o.s==r.s?1:-1,S=o.c,x=r.c;if(!(S&&S[0]&&x&&x[0]))return new w(o.s&&r.s&&(S?!x||S[0]!=x[0]:x)?S&&0==S[0]||!x?0*E:E/0:NaN);for(y=(m=new w(E)).c=[],E=i+(l=o.e-r.e)+1,s||(s=BASE,l=bitFloor(o.e/LOG_BASE)-bitFloor(r.e/LOG_BASE),E=E/LOG_BASE|0),u=0;x[u]==(S[u]||0);u++);if(x[u]>(S[u]||0)&&l--,E<0)y.push(1),d=!0;else{for(T=S.length,A=x.length,u=0,E+=2,(p=mathfloor(s/(x[0]+1)))>1&&(x=e(x,p,s),S=e(S,p,s),A=x.length,T=S.length),v=A,b=(g=S.slice(0,A)).length;b<A;g[b++]=0);O=x.slice(),O=[0].concat(O),I=x[0],x[1]>=s/2&&I++;do{if(p=0,(c=t(x,g,A,b))<0){if(k=g[0],A!=b&&(k=k*s+(g[1]||0)),(p=mathfloor(k/I))>1)for(p>=s&&(p=s-1),h=(f=e(x,p,s)).length,b=g.length;1==t(f,g,h,b);)p--,n(f,A<h?O:x,h,s),h=f.length,c=1;else 0==p&&(c=p=1),h=(f=x.slice()).length;if(h<b&&(f=[0].concat(f)),n(g,f,b,s),b=g.length,-1==c)for(;t(x,g,A,b)<1;)p++,n(g,A<b?O:x,b,s),b=g.length}else 0===c&&(p++,g=[0]);y[u++]=p,g[0]?g[b++]=S[v]||0:(g=[S[v]],b=1)}while((v++<T||null!=g[0])&&E--);d=null!=g[0],y[0]||y.splice(0,1)}if(s==BASE){for(u=1,E=y[0];E>=10;E/=10,u++);_(m,i+(m.e=u+l*LOG_BASE-1)+1,a,d)}else m.e=l,m.r=+d;return m}}(),o=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,o=/^-?(Infinity|NaN)$/,r=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(i,a,s,c){var l,u=s?a:a.replace(r,"");if(o.test(u))i.s=isNaN(u)?null:u<0?-1:1;else{if(!s&&(u=u.replace(e,(function(e,t,n){return l="x"==(n=n.toLowerCase())?16:"b"==n?2:8,c&&c!=l?e:t})),c&&(l=c,u=u.replace(t,"$1").replace(n,"0.$1")),a!=u))return new w(u,l);if(w.DEBUG)throw Error(bignumberError+"Not a"+(c?" base "+c:"")+" number: "+a);i.s=null}i.c=i.e=null}}(),a.absoluteValue=a.abs=function(){var e=new w(this);return e.s<0&&(e.s=1),e},a.comparedTo=function(e,t){return compare(this,new w(e,t))},a.decimalPlaces=a.dp=function(e,t){var n,o,r,i=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=l:intCheck(t,0,8),_(new w(i),e+i.e+1,t);if(!(n=i.c))return null;if(o=((r=n.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,r=n[r])for(;r%10==0;r/=10,o--);return o<0&&(o=0),o},a.dividedBy=a.div=function(e,n){return t(this,new w(e,n),c,l)},a.dividedToIntegerBy=a.idiv=function(e,n){return t(this,new w(e,n),0,1)},a.exponentiatedBy=a.pow=function(e,t){var n,o,r,i,a,c,u,d,p=this;if((e=new w(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+A(e));if(null!=t&&(t=new w(t)),a=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return d=new w(Math.pow(+A(p),a?e.s*(2-isOdd(e)):+A(e))),t?d.mod(t):d;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new w(NaN);(o=!c&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return i=p.s<0&&isOdd(e)?-0:0,p.e>-1&&(i=1/i),new w(c?1/i:i);y&&(i=mathceil(y/LOG_BASE+2))}for(a?(n=new w(.5),c&&(e.s=1),u=isOdd(e)):u=(r=Math.abs(+A(e)))%2,d=new w(s);;){if(u){if(!(d=d.times(p)).c)break;i?d.c.length>i&&(d.c.length=i):o&&(d=d.mod(t))}if(r){if(0===(r=mathfloor(r/2)))break;u=r%2}else if(_(e=e.times(n),e.e+1,1),e.e>14)u=isOdd(e);else{if(0===(r=+A(e)))break;u=r%2}p=p.times(p),i?p.c&&p.c.length>i&&(p.c.length=i):o&&(p=p.mod(t))}return o?d:(c&&(d=s.div(d)),t?d.mod(t):i?_(d,y,l,undefined):d)},a.integerValue=function(e){var t=new w(this);return null==e?e=l:intCheck(e,0,8),_(t,t.e+1,e)},a.isEqualTo=a.eq=function(e,t){return 0===compare(this,new w(e,t))},a.isFinite=function(){return!!this.c},a.isGreaterThan=a.gt=function(e,t){return compare(this,new w(e,t))>0},a.isGreaterThanOrEqualTo=a.gte=function(e,t){return 1===(t=compare(this,new w(e,t)))||0===t},a.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},a.isLessThan=a.lt=function(e,t){return compare(this,new w(e,t))<0},a.isLessThanOrEqualTo=a.lte=function(e,t){return-1===(t=compare(this,new w(e,t)))||0===t},a.isNaN=function(){return!this.s},a.isNegative=function(){return this.s<0},a.isPositive=function(){return this.s>0},a.isZero=function(){return!!this.c&&0==this.c[0]},a.minus=function(e,t){var n,o,r,i,a=this,s=a.s;if(t=(e=new w(e,t)).s,!s||!t)return new w(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/LOG_BASE,u=e.e/LOG_BASE,d=a.c,p=e.c;if(!c||!u){if(!d||!p)return d?(e.s=-t,e):new w(p?a:NaN);if(!d[0]||!p[0])return p[0]?(e.s=-t,e):new w(d[0]?a:3==l?-0:0)}if(c=bitFloor(c),u=bitFloor(u),d=d.slice(),s=c-u){for((i=s<0)?(s=-s,r=d):(u=c,r=p),r.reverse(),t=s;t--;r.push(0));r.reverse()}else for(o=(i=(s=d.length)<(t=p.length))?s:t,s=t=0;t<o;t++)if(d[t]!=p[t]){i=d[t]<p[t];break}if(i&&(r=d,d=p,p=r,e.s=-e.s),(t=(o=p.length)-(n=d.length))>0)for(;t--;d[n++]=0);for(t=BASE-1;o>s;){if(d[--o]<p[o]){for(n=o;n&&!d[--n];d[n]=t);--d[n],d[o]+=BASE}d[o]-=p[o]}for(;0==d[0];d.splice(0,1),--u);return d[0]?I(e,d,u):(e.s=3==l?-1:1,e.c=[e.e=0],e)},a.modulo=a.mod=function(e,n){var o,r,i=this;return e=new w(e,n),!i.c||!e.s||e.c&&!e.c[0]?new w(NaN):!e.c||i.c&&!i.c[0]?new w(i):(9==m?(r=e.s,e.s=1,o=t(i,e,0,3),e.s=r,o.s*=r):o=t(i,e,0,m),(e=i.minus(o.times(e))).c[0]||1!=m||(e.s=i.s),e)},a.multipliedBy=a.times=function(e,t){var n,o,r,i,a,s,c,l,u,d,p,f,h,m,y,g=this,b=g.c,k=(e=new w(e,t)).c;if(!(b&&k&&b[0]&&k[0]))return!g.s||!e.s||b&&!b[0]&&!k||k&&!k[0]&&!b?e.c=e.e=e.s=null:(e.s*=g.s,b&&k?(e.c=[0],e.e=0):e.c=e.e=null),e;for(o=bitFloor(g.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=g.s,(c=b.length)<(d=k.length)&&(h=b,b=k,k=h,r=c,c=d,d=r),r=c+d,h=[];r--;h.push(0));for(m=BASE,y=SQRT_BASE,r=d;--r>=0;){for(n=0,p=k[r]%y,f=k[r]/y|0,i=r+(a=c);i>r;)n=((l=p*(l=b[--a]%y)+(s=f*l+(u=b[a]/y|0)*p)%y*y+h[i]+n)/m|0)+(s/y|0)+f*u,h[i--]=l%m;h[i]=n}return n?++o:h.splice(0,1),I(e,h,o)},a.negated=function(){var e=new w(this);return e.s=-e.s||null,e},a.plus=function(e,t){var n,o=this,r=o.s;if(t=(e=new w(e,t)).s,!r||!t)return new w(NaN);if(r!=t)return e.s=-t,o.minus(e);var i=o.e/LOG_BASE,a=e.e/LOG_BASE,s=o.c,c=e.c;if(!i||!a){if(!s||!c)return new w(r/0);if(!s[0]||!c[0])return c[0]?e:new w(s[0]?o:0*r)}if(i=bitFloor(i),a=bitFloor(a),s=s.slice(),r=i-a){for(r>0?(a=i,n=c):(r=-r,n=s),n.reverse();r--;n.push(0));n.reverse()}for((r=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=r),r=0;t;)r=(s[--t]=s[t]+c[t]+r)/BASE|0,s[t]=BASE===s[t]?0:s[t]%BASE;return r&&(s=[r].concat(s),++a),I(e,s,a)},a.precision=a.sd=function(e,t){var n,o,r,i=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=l:intCheck(t,0,8),_(new w(i),e,t);if(!(n=i.c))return null;if(o=(r=n.length-1)*LOG_BASE+1,r=n[r]){for(;r%10==0;r/=10,o--);for(r=n[0];r>=10;r/=10,o++);}return e&&i.e+1>o&&(o=i.e+1),o},a.shiftedBy=function(e){return intCheck(e,-9007199254740991,MAX_SAFE_INTEGER$1),this.times("1e"+e)},a.squareRoot=a.sqrt=function(){var e,n,o,r,i,a=this,s=a.c,u=a.s,d=a.e,p=c+4,f=new w("0.5");if(1!==u||!s||!s[0])return new w(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+A(a)))||u==1/0?(((n=coeffToString(s)).length+d)%2==0&&(n+="0"),u=Math.sqrt(+n),d=bitFloor((d+1)/2)-(d<0||d%2),o=new w(n=u==1/0?"5e"+d:(n=u.toExponential()).slice(0,n.indexOf("e")+1)+d)):o=new w(u+""),o.c[0])for((u=(d=o.e)+p)<3&&(u=0);;)if(i=o,o=f.times(i.plus(t(a,i,p,1))),coeffToString(i.c).slice(0,u)===(n=coeffToString(o.c)).slice(0,u)){if(o.e<d&&--u,"9999"!=(n=n.slice(u-3,u+1))&&(r||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(_(o,o.e+c+2,1),e=!o.times(o).eq(a));break}if(!r&&(_(i,i.e+c+2,0),i.times(i).eq(a))){o=i;break}p+=4,u+=4,r=1}return _(o,o.e+c+1,l,e)},a.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),v(this,e,t,1)},a.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),v(this,e,t)},a.toFormat=function(e,t,n){var o,r=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=g;else if("object"!=typeof n)throw Error(bignumberError+"Argument not an object: "+n);if(o=r.toFixed(e,t),r.c){var i,a=o.split("."),s=+n.groupSize,c=+n.secondaryGroupSize,l=n.groupSeparator||"",u=a[0],d=a[1],p=r.s<0,f=p?u.slice(1):u,h=f.length;if(c&&(i=s,s=c,c=i,h-=i),s>0&&h>0){for(i=h%s||s,u=f.substr(0,i);i<h;i+=s)u+=l+f.substr(i,s);c>0&&(u+=l+f.slice(i)),p&&(u="-"+u)}o=d?u+(n.decimalSeparator||"")+((c=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):u}return(n.prefix||"")+o+(n.suffix||"")},a.toFraction=function(e){var n,o,r,i,a,c,u,d,p,h,m,y,g=this,b=g.c;if(null!=e&&(!(u=new w(e)).isInteger()&&(u.c||1!==u.s)||u.lt(s)))throw Error(bignumberError+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+A(u));if(!b)return new w(g);for(n=new w(s),p=o=new w(s),r=d=new w(s),y=coeffToString(b),a=n.e=y.length-g.e-1,n.c[0]=POWS_TEN[(c=a%LOG_BASE)<0?LOG_BASE+c:c],e=!e||u.comparedTo(n)>0?a>0?n:p:u,c=f,f=1/0,u=new w(y),d.c[0]=0;h=t(u,n,0,1),1!=(i=o.plus(h.times(r))).comparedTo(e);)o=r,r=i,p=d.plus(h.times(i=p)),d=i,n=u.minus(h.times(i=n)),u=i;return i=t(e.minus(o),r,0,1),d=d.plus(i.times(p)),o=o.plus(i.times(r)),d.s=p.s=g.s,m=t(p,r,a*=2,l).minus(g).abs().comparedTo(t(d,o,a,l).minus(g).abs())<1?[p,r]:[d,o],f=c,m},a.toNumber=function(){return+A(this)},a.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),v(this,e,t,2)},a.toString=function(e){var t,o=this,r=o.s,i=o.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=i<=u||i>=d?toExponential(coeffToString(o.c),i):toFixedPoint(coeffToString(o.c),i,"0"):10===e&&k?t=toFixedPoint(coeffToString((o=_(new w(o),c+i+1,l)).c),o.e,"0"):(intCheck(e,2,b.length,"Base"),t=n(toFixedPoint(coeffToString(o.c),i,"0"),10,e,r,!0)),r<0&&o.c[0]&&(t="-"+t)),t},a.valueOf=a.toJSON=function(){return A(this)},a._isBigNumber=!0,a[Symbol.toStringTag]="BigNumber",a[Symbol.for("nodejs.util.inspect.custom")]=a.valueOf,null!=e&&w.set(e),w}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,n,o=1,r=e.length,i=e[0]+"";o<r;){for(t=e[o++]+"",n=LOG_BASE-t.length;n--;t="0"+t);i+=t}for(r=i.length;48===i.charCodeAt(--r););return i.slice(0,r+1||1)}function compare(e,t){var n,o,r=e.c,i=t.c,a=e.s,s=t.s,c=e.e,l=t.e;if(!a||!s)return null;if(n=r&&!r[0],o=i&&!i[0],n||o)return n?o?0:-s:a;if(a!=s)return a;if(n=a<0,o=c==l,!r||!i)return o?0:!r^n?1:-1;if(!o)return c>l^n?1:-1;for(s=(c=r.length)<(l=i.length)?c:l,a=0;a<s;a++)if(r[a]!=i[a])return r[a]>i[a]^n?1:-1;return c==l?0:c>l^n?1:-1}function intCheck(e,t,n,o){if(e<t||e>n||e!==mathfloor(e))throw Error(bignumberError+(o||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,n){var o,r;if(t<0){for(r=n+".";++t;r+=n);e=r+e}else if(++t>(o=e.length)){for(r=n,t-=o;--t;r+=n);e+=r}else t<o&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber$1=clone(),lib$1={},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var n=new Array(arguments.length-1),o=0,r=2,i=!0;for(;r<arguments.length;)n[o++]=arguments[r++];return new Promise((function(r,a){n[o]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];r.apply(null,t)}};try{e.apply(t||null,n)}catch(s){i&&(i=!1,a(s))}}))},aspromise}var base64={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(e){var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var n=new Array(64),o=new Array(123),r=0;r<64;)o[n[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;t.encode=function(e,t,o){for(var r,i=null,a=[],s=0,c=0;t<o;){var l=e[t++];switch(c){case 0:a[s++]=n[l>>2],r=(3&l)<<4,c=1;break;case 1:a[s++]=n[r|l>>4],r=(15&l)<<2,c=2;break;case 2:a[s++]=n[r|l>>6],a[s++]=n[63&l],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=n[r],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,n){for(var r,a=n,s=0,c=0;c<e.length;){var l=e.charCodeAt(c++);if(61===l&&s>1)break;if(void 0===(l=o[l]))throw Error(i);switch(s){case 0:r=l,s=1;break;case 1:t[n++]=r<<2|(48&l)>>4,r=l,s=2;break;case 2:t[n++]=(15&r)<<4|(60&l)>>2,r=l,s=3;break;case 3:t[n++]=(3&r)<<6|l,s=0}}if(1===s)throw Error(i);return n-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(base64)),base64}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],o=0;o<n.length;)n[o].fn===t?n.splice(o,1):++o;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],o=1;o<arguments.length;)n.push(arguments[o++]);for(o=0;o<t.length;)t[o].fn.apply(t[o++].ctx,n)}return this},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),o=128===n[3];function r(e,o,r){t[0]=e,o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2],o[r+3]=n[3]}function i(e,o,r){t[0]=e,o[r]=n[3],o[r+1]=n[2],o[r+2]=n[1],o[r+3]=n[0]}function a(e,o){return n[0]=e[o],n[1]=e[o+1],n[2]=e[o+2],n[3]=e[o+3],t[0]}function s(e,o){return n[3]=e[o],n[2]=e[o+1],n[1]=e[o+2],n[0]=e[o+3],t[0]}e.writeFloatLE=o?r:i,e.writeFloatBE=o?i:r,e.readFloatLE=o?a:s,e.readFloatBE=o?s:a}():function(){function i(e,t,n,o){var r=t<0?1:0;if(r&&(t=-t),0===t)e(1/t>0?0:2147483648,n,o);else if(isNaN(t))e(2143289344,n,o);else if(t>34028234663852886e22)e((r<<31|2139095040)>>>0,n,o);else if(t<11754943508222875e-54)e((r<<31|Math.round(t/1401298464324817e-60))>>>0,n,o);else{var i=Math.floor(Math.log(t)/Math.LN2);e((r<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,n,o)}}function a(e,t,n){var o=e(t,n),r=2*(o>>31)+1,i=o>>>23&255,a=8388607&o;return 255===i?a?NaN:r*(1/0):0===i?1401298464324817e-60*r*a:r*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,n),e.readFloatLE=a.bind(null,o),e.readFloatBE=a.bind(null,r)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),o=128===n[7];function r(e,o,r){t[0]=e,o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2],o[r+3]=n[3],o[r+4]=n[4],o[r+5]=n[5],o[r+6]=n[6],o[r+7]=n[7]}function i(e,o,r){t[0]=e,o[r]=n[7],o[r+1]=n[6],o[r+2]=n[5],o[r+3]=n[4],o[r+4]=n[3],o[r+5]=n[2],o[r+6]=n[1],o[r+7]=n[0]}function a(e,o){return n[0]=e[o],n[1]=e[o+1],n[2]=e[o+2],n[3]=e[o+3],n[4]=e[o+4],n[5]=e[o+5],n[6]=e[o+6],n[7]=e[o+7],t[0]}function s(e,o){return n[7]=e[o],n[6]=e[o+1],n[5]=e[o+2],n[4]=e[o+3],n[3]=e[o+4],n[2]=e[o+5],n[1]=e[o+6],n[0]=e[o+7],t[0]}e.writeDoubleLE=o?r:i,e.writeDoubleBE=o?i:r,e.readDoubleLE=o?a:s,e.readDoubleBE=o?s:a}():function(){function i(e,t,n,o,r,i){var a=o<0?1:0;if(a&&(o=-o),0===o)e(0,r,i+t),e(1/o>0?0:2147483648,r,i+n);else if(isNaN(o))e(0,r,i+t),e(2146959360,r,i+n);else if(o>17976931348623157e292)e(0,r,i+t),e((a<<31|2146435072)>>>0,r,i+n);else{var s;if(o<22250738585072014e-324)e((s=o/5e-324)>>>0,r,i+t),e((a<<31|s/4294967296)>>>0,r,i+n);else{var c=Math.floor(Math.log(o)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=o*Math.pow(2,-c))>>>0,r,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,r,i+n)}}}function a(e,t,n,o,r){var i=e(o,r+t),a=e(o,r+n),s=2*(a>>31)+1,c=a>>>20&2047,l=4294967296*(1048575&a)+i;return 2047===c?l?NaN:s*(1/0):0===c?5e-324*s*l:s*Math.pow(2,c-1075)*(l+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,n,4,0),e.readDoubleLE=a.bind(null,o,0,4),e.readDoubleBE=a.bind(null,r,4,0)}(),e}function t(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function n(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function r(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e2){}return null}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal$1,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(e=utf8).length=function(e){for(var t=0,n=0,o=0;o<e.length;++o)(n=e.charCodeAt(o))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(o+1))?(++o,t+=4):t+=3;return t},e.read=function(e,t,n){if(n-t<1)return"";for(var o,r=null,i=[],a=0;t<n;)(o=e[t++])<128?i[a++]=o:o>191&&o<224?i[a++]=(31&o)<<6|63&e[t++]:o>239&&o<365?(o=((7&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(o>>10),i[a++]=56320+(1023&o)):i[a++]=(15&o)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,i)),a=0);return r?(a&&r.push(String.fromCharCode.apply(String,i.slice(0,a))),r.join("")):String.fromCharCode.apply(String,i.slice(0,a))},e.write=function(e,t,n){for(var o,r,i=n,a=0;a<e.length;++a)(o=e.charCodeAt(a))<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=63&o|128):55296==(64512&o)&&56320==(64512&(r=e.charCodeAt(a+1)))?(o=65536+((1023&o)<<10)+(1023&r),++a,t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128);return n-i}),utf8;var e}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,n){var o=n||8192,r=o>>>1,i=null,a=o;return function(n){if(n<1||n>r)return e(n);a+n>o&&(i=e(o),a=0);var s=t.call(i,a,a+=n);return 7&a&&(a=1+(7|a)),s}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var o=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return n;var o=e<0;o&&(e=-e);var r=e>>>0,i=(e-r)/4294967296>>>0;return o&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new t(r,i)},t.from=function(o){if("number"==typeof o)return t.fromNumber(o);if(e.isString(o)){if(!e.Long)return t.fromNumber(parseInt(o,10));o=e.Long.fromString(o)}return o.low||o.high?new t(o.low>>>0,o.high>>>0):n},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var r=String.prototype.charCodeAt;return t.fromHash=function(e){return e===o?n:new t((r.call(e,0)|r.call(e,1)<<8|r.call(e,2)<<16|r.call(e,3)<<24)>>>0,(r.call(e,4)|r.call(e,5)<<8|r.call(e,6)<<16|r.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10},longbits}function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(e){var t=e;function n(e,t,n){for(var o=Object.keys(t),r=0;r<o.length;++r)void 0!==e[o[r]]&&n||(e[o[r]]=t[o[r]]);return e}function o(e){function t(e,o){if(!(this instanceof t))return new t(e,o);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),o&&n(this,o)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.asPromise=requireAspromise(),t.base64=requireBase64(),t.EventEmitter=requireEventemitter(),t.float=requireFloat(),t.inquire=requireInquire(),t.utf8=requireUtf8(),t.pool=requirePool(),t.LongBits=requireLongbits(),t.isNode=Boolean(void 0!==commonjsGlobal&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||minimal$1,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"==typeof e},t.isset=t.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(n){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var o=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(o.lo,o.hi,n):o.toNumber(Boolean(n))},t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},t.newError=o,t.ProtocolError=o("ProtocolError"),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;e?(t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):t._Buffer_from=t._Buffer_allocUnsafe=null}}(minimal$1)),minimal$1}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=c;var e,t=requireMinimal$1(),n=t.LongBits,o=t.base64,r=t.utf8;function i(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function a(){}function s(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function c(){this.len=0,this.head=new i(a,0,0),this.tail=this.head,this.states=null}var l=function(){return t.Buffer?function(){return(c.create=function(){return new e})()}:function(){return new c}};function u(e,t,n){t[n]=255&e}function d(e,t){this.len=e,this.next=void 0,this.val=t}function p(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function f(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}c.create=l(),c.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(c.alloc=t.pool(c.alloc,t.Array.prototype.subarray)),c.prototype._push=function(e,t,n){return this.tail=this.tail.next=new i(e,t,n),this.len+=t,this},d.prototype=Object.create(i.prototype),d.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},c.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new d((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},c.prototype.int32=function(e){return e<0?this._push(p,10,n.fromNumber(e)):this.uint32(e)},c.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},c.prototype.uint64=function(e){var t=n.from(e);return this._push(p,t.length(),t)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(e){var t=n.from(e).zzEncode();return this._push(p,t.length(),t)},c.prototype.bool=function(e){return this._push(u,1,e?1:0)},c.prototype.fixed32=function(e){return this._push(f,4,e>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(e){var t=n.from(e);return this._push(f,4,t.lo)._push(f,4,t.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},c.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var h=t.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var o=0;o<e.length;++o)t[n+o]=e[o]};return c.prototype.bytes=function(e){var n=e.length>>>0;if(!n)return this._push(u,1,0);if(t.isString(e)){var r=c.alloc(n=o.length(e));o.decode(e,r,0),e=r}return this.uint32(n)._push(h,n,e)},c.prototype.string=function(e){var t=r.length(e);return t?this.uint32(t)._push(r.write,t,e):this._push(u,1,0)},c.prototype.fork=function(){return this.states=new s(this),this.head=this.tail=new i(a,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(a,0,0),this.len=0),this},c.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},c.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},c._configure=function(t){e=t,c.create=l(),e._configure()},writer}function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=n;var e=requireWriter();(n.prototype=Object.create(e.prototype)).constructor=n;var t=requireMinimal$1();function n(){e.call(this)}function o(e,n,o){e.length<40?t.utf8.write(e,n,o):n.utf8Write?n.utf8Write(e,o):n.write(e,o)}return n._configure=function(){n.alloc=t._Buffer_allocUnsafe,n.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var o=0;o<e.length;)t[n++]=e[o++]}},n.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var o=e.length>>>0;return this.uint32(o),o&&this._push(n.writeBytesBuffer,o,e),this},n.prototype.string=function(e){var n=t.Buffer.byteLength(e);return this.uint32(n),n&&this._push(o,n,e),this},n._configure(),writer_buffer}function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=i;var e,t=requireMinimal$1(),n=t.LongBits,o=t.utf8;function r(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function i(e){this.buf=e,this.pos=0,this.len=e.length}var a="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new i(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new i(e);throw Error("illegal buffer")},s=function(){return t.Buffer?function(n){return(i.create=function(n){return t.Buffer.isBuffer(n)?new e(n):a(n)})(n)}:a};function c(){var e=new n(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw r(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw r(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function l(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function u(){if(this.pos+8>this.len)throw r(this,8);return new n(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}return i.create=s(),i.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,i.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,r(this,10);return e}}(),i.prototype.int32=function(){return 0|this.uint32()},i.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},i.prototype.bool=function(){return 0!==this.uint32()},i.prototype.fixed32=function(){if(this.pos+4>this.len)throw r(this,4);return l(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw r(this,4);return 0|l(this.buf,this.pos+=4)},i.prototype.float=function(){if(this.pos+4>this.len)throw r(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},i.prototype.double=function(){if(this.pos+8>this.len)throw r(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},i.prototype.bytes=function(){var e=this.uint32(),n=this.pos,o=this.pos+e;if(o>this.len)throw r(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(n,o);if(n===o){var i=t.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,n,o)},i.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},i.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw r(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw r(this)}while(128&this.buf[this.pos++]);return this},i.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},i._configure=function(n){e=n,i.create=s(),e._configure();var o=t.Long?"toLong":"toNumber";t.merge(i.prototype,{int64:function(){return c.call(this)[o](!1)},uint64:function(){return c.call(this)[o](!0)},sint64:function(){return c.call(this).zzDecode()[o](!1)},fixed64:function(){return u.call(this)[o](!0)},sfixed64:function(){return u.call(this)[o](!1)}})},reader}function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=n;var e=requireReader();(n.prototype=Object.create(e.prototype)).constructor=n;var t=requireMinimal$1();function n(t){e.call(this,t)}return n._configure=function(){t.Buffer&&(n.prototype._slice=t.Buffer.prototype.slice)},n.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},n._configure(),reader_buffer}var rpc={},service,hasRequiredService,hasRequiredRpc,roots,hasRequiredRoots,hasRequiredIndexMinimal,minimal,hasRequiredMinimal;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=t;var e=requireMinimal$1();function t(t,n,o){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(n),this.responseDelimited=Boolean(o)}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(n,o,r,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return e.asPromise(t,s,n,o,r,i);if(s.rpcImpl)try{return s.rpcImpl(n,o[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,t){if(e)return s.emit("error",e,n),a(e);if(null!==t){if(!(t instanceof r))try{t=r[s.responseDelimited?"decodeDelimited":"decode"](t)}catch(o){return s.emit("error",o,n),a(o)}return s.emit("data",t,n),a(null,t)}s.end(!0)}))}catch(c){return s.emit("error",c,n),void setTimeout((function(){a(c)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,rpc.Service=requireService()),rpc}function requireRoots(){return hasRequiredRoots?roots:(hasRequiredRoots=1,roots={})}function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(e){var t=e;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}t.build="minimal",t.Writer=requireWriter(),t.BufferWriter=requireWriter_buffer(),t.Reader=requireReader(),t.BufferReader=requireReader_buffer(),t.util=requireMinimal$1(),t.rpc=requireRpc(),t.roots=requireRoots(),t.configure=n,n()}(indexMinimal)),indexMinimal}function requireMinimal(){return hasRequiredMinimal?minimal:(hasRequiredMinimal=1,minimal=requireIndexMinimal())}var umd$1={exports:{}},umd=umd$1.exports,hasRequiredUmd;function requireUmd(){return hasRequiredUmd||(hasRequiredUmd=1,e=umd$1,t=umd$1.exports,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;
21
21
  /**
22
22
  * @license
23
23
  * Copyright 2009 The Closure Library Authors
@@ -113,7 +113,7 @@ function utilFromBase(e,t){let n=0;if(1===e.length)return e[0];for(let o=e.lengt
113
113
  * @author Chen, Yi-Cyuan [emn178@gmail.com]
114
114
  * @copyright Chen, Yi-Cyuan 2015-2018
115
115
  * @license MIT
116
- */function requireSha3(){return hasRequiredSha3||(hasRequiredSha3=1,e=sha3$1,function(){var t="input is invalid type",n="object"==typeof window,o=n?window:{};o.JS_SHA3_NO_WINDOW&&(n=!1);var r=!n&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=commonjsGlobal:r&&(o=self);var i=!o.JS_SHA3_NO_COMMON_JS&&e.exports,a=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),c=[4,1024,262144,67108864],l=[0,8,16,24],u=[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],d=[224,256,384,512],p=[128,256],f=["hex","buffer","arrayBuffer","array","digest"],h={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var m=function(e,t,n){return function(o){return new C(e,t,e).update(o)[n]()}},y=function(e,t,n){return function(o,r){return new C(e,t,r).update(o)[n]()}},g=function(e,t,n){return function(t,o,r,i){return T["cshake"+e].update(t,o,r,i)[n]()}},b=function(e,t,n){return function(t,o,r,i){return T["kmac"+e].update(t,o,r,i)[n]()}},k=function(e,t,n,o){for(var r=0;r<f.length;++r){var i=f[r];e[i]=t(n,o,i)}return e},w=function(e,t){var n=m(e,t,"hex");return n.create=function(){return new C(e,t,e)},n.update=function(e){return n.create().update(e)},k(n,m,e,t)},v=[{name:"keccak",padding:[1,256,65536,16777216],bits:d,createMethod:w},{name:"sha3",padding:[6,1536,393216,100663296],bits:d,createMethod:w},{name:"shake",padding:[31,7936,2031616,520093696],bits:p,createMethod:function(e,t){var n=y(e,t,"hex");return n.create=function(n){return new C(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},k(n,y,e,t)}},{name:"cshake",padding:c,bits:p,createMethod:function(e,t){var n=h[e],o=g(e,0,"hex");return o.create=function(o,r,i){return r||i?new C(e,t,o).bytepad([r,i],n):T["shake"+e].create(o)},o.update=function(e,t,n,r){return o.create(t,n,r).update(e)},k(o,g,e,t)}},{name:"kmac",padding:c,bits:p,createMethod:function(e,t){var n=h[e],o=b(e,0,"hex");return o.create=function(o,r,i){return new N(e,t,r).bytepad(["KMAC",i],n).bytepad([o],n)},o.update=function(e,t,n,r){return o.create(e,n,r).update(t)},k(o,b,e,t)}}],T={},I=[],_=0;_<v.length;++_)for(var A=v[_],O=A.bits,E=0;E<O.length;++E){var S=A.name+"_"+O[E];if(I.push(S),T[S]=A.createMethod(O[E],A.padding),"sha3"!==A.name){var x=A.name+O[E];I.push(x),T[x]=T[S]}}function C(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var o=0;o<50;++o)this.s[o]=0}function N(e,t,n){C.call(this,e,t,n)}C.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,o=typeof e;if("string"!==o){if("object"!==o)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var r,i,s=this.blocks,c=this.byteCount,u=e.length,d=this.blockCount,p=0,f=this.s;p<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,r=1;r<d+1;++r)s[r]=0;if(n)for(r=this.start;p<u&&r<c;++p)s[r>>2]|=e[p]<<l[3&r++];else for(r=this.start;p<u&&r<c;++p)(i=e.charCodeAt(p))<128?s[r>>2]|=i<<l[3&r++]:i<2048?(s[r>>2]|=(192|i>>6)<<l[3&r++],s[r>>2]|=(128|63&i)<<l[3&r++]):i<55296||i>=57344?(s[r>>2]|=(224|i>>12)<<l[3&r++],s[r>>2]|=(128|i>>6&63)<<l[3&r++],s[r>>2]|=(128|63&i)<<l[3&r++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++p)),s[r>>2]|=(240|i>>18)<<l[3&r++],s[r>>2]|=(128|i>>12&63)<<l[3&r++],s[r>>2]|=(128|i>>6&63)<<l[3&r++],s[r>>2]|=(128|63&i)<<l[3&r++]);if(this.lastByteIndex=r,r>=c){for(this.start=r-c,this.block=s[d],r=0;r<d;++r)f[r]^=s[r];P(f),this.reset=!0}else this.start=r}return this},C.prototype.encode=function(e,t){var n=255&e,o=1,r=[n];for(n=255&(e>>=8);n>0;)r.unshift(n),n=255&(e>>=8),++o;return t?r.push(o):r.unshift(o),this.update(r),r.length},C.prototype.encodeString=function(e){var n,o=typeof e;if("string"!==o){if("object"!==o)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}var r=0,i=e.length;if(n)r=i;else for(var s=0;s<e.length;++s){var c=e.charCodeAt(s);c<128?r+=1:c<2048?r+=2:c<55296||c>=57344?r+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++s)),r+=4)}return r+=this.encode(8*r),this.update(e),r},C.prototype.bytepad=function(e,t){for(var n=this.encode(t),o=0;o<e.length;++o)n+=this.encodeString(e[o]);var r=t-n%t,i=[];return i.length=r,this.update(i),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,o=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)o[t]^=e[t];P(o)}},C.prototype.toString=C.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,o=this.outputBlocks,r=this.extraBytes,i=0,a=0,c="";a<o;){for(i=0;i<t&&a<o;++i,++a)e=n[i],c+=s[e>>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];a%t==0&&(P(n),i=0)}return r&&(e=n[i],c+=s[e>>4&15]+s[15&e],r>1&&(c+=s[e>>12&15]+s[e>>8&15]),r>2&&(c+=s[e>>20&15]+s[e>>16&15])),c},C.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,o=this.outputBlocks,r=this.extraBytes,i=0,a=0,s=this.outputBits>>3;e=r?new ArrayBuffer(o+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a<o;){for(i=0;i<t&&a<o;++i,++a)c[a]=n[i];a%t==0&&P(n)}return r&&(c[i]=n[i],e=e.slice(0,s)),e},C.prototype.buffer=C.prototype.arrayBuffer,C.prototype.digest=C.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,o=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,s=0,c=[];s<r;){for(a=0;a<n&&s<r;++a,++s)e=s<<2,t=o[a],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%n==0&&P(o)}return i&&(e=s<<2,t=o[a],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},N.prototype=new C,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var P=function(e){var t,n,o,r,i,a,s,c,l,d,p,f,h,m,y,g,b,k,w,v,T,I,_,A,O,E,S,x,C,N,P,R,D,B,L,j,$,F,U,M,K,G,H,V,z,q,Z,W,Q,Y,X,J,ee,te,ne,oe,re,ie,ae,se,ce,le,ue;for(o=0;o<48;o+=2)r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],p=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),n=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=r^(c<<1|l>>>31),n=i^(l<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(d<<1|p>>>31),n=s^(p<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(f<<1|h>>>31),n=l^(h<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(r<<1|i>>>31),n=p^(i<<1|r>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],y=e[1],q=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,x=e[20]<<3|e[21]>>>29,C=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,W=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,P=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,$=e[15]<<6|e[14]>>>26,k=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,D=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,O=e[7]<<28|e[6]>>>4,oe=e[17]<<23|e[16]>>>9,re=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,v=e[36]<<21|e[37]>>>11,T=e[37]<<21|e[36]>>>11,J=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,S=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,M=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,_=e[49]<<14|e[48]>>>18,e[0]=m^~g&k,e[1]=y^~b&w,e[10]=A^~E&x,e[11]=O^~S&C,e[20]=B^~j&F,e[21]=L^~$&U,e[30]=V^~q&W,e[31]=z^~Z&Q,e[40]=te^~oe&ie,e[41]=ne^~re&ae,e[2]=g^~k&v,e[3]=b^~w&T,e[12]=E^~x&N,e[13]=S^~C&P,e[22]=j^~F&M,e[23]=$^~U&K,e[32]=q^~W&Y,e[33]=Z^~Q&X,e[42]=oe^~ie&se,e[43]=re^~ae&ce,e[4]=k^~v&I,e[5]=w^~T&_,e[14]=x^~N&R,e[15]=C^~P&D,e[24]=F^~M&G,e[25]=U^~K&H,e[34]=W^~Y&J,e[35]=Q^~X&ee,e[44]=ie^~se&le,e[45]=ae^~ce&ue,e[6]=v^~I&m,e[7]=T^~_&y,e[16]=N^~R&A,e[17]=P^~D&O,e[26]=M^~G&B,e[27]=K^~H&L,e[36]=Y^~J&V,e[37]=X^~ee&z,e[46]=se^~le&te,e[47]=ce^~ue&ne,e[8]=I^~m&g,e[9]=_^~y&b,e[18]=R^~A&E,e[19]=D^~O&S,e[28]=G^~B&j,e[29]=H^~L&$,e[38]=J^~V&q,e[39]=ee^~z&Z,e[48]=le^~te&oe,e[49]=ue^~ne&re,e[0]^=u[o],e[1]^=u[o+1]};if(i)e.exports=T;else for(_=0;_<I.length;++_)o[I[_]]=T[I[_]]}()),sha3$1.exports;var e}var sha3Exports=requireSha3();const sha3=getDefaultExportFromCjs$1(sha3Exports);function keccak256$1(e){return"0x"+sha3.keccak_256(arrayify(e))}const version$2="address/5.8.0",logger$3=new Logger$1(version$2);function getChecksumAddress$1(e){isHexString$1(e,20)||logger$3.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let r=0;r<40;r++)n[r]=t[r].charCodeAt(0);const o=arrayify(keccak256$1(n));for(let r=0;r<40;r+=2)o[r>>1]>>4>=8&&(t[r]=t[r].toUpperCase()),(15&o[r>>1])>=8&&(t[r+1]=t[r+1].toUpperCase());return"0x"+t.join("")}const MAX_SAFE_INTEGER=9007199254740991;function log10(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}const ibanLookup$1={};for(let T=0;T<10;T++)ibanLookup$1[String(T)]=String(T);for(let T=0;T<26;T++)ibanLookup$1[String.fromCharCode(65+T)]=String(10+T);const safeDigits$1=Math.floor(log10(MAX_SAFE_INTEGER));function ibanChecksum$1(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>ibanLookup$1[e])).join("");for(;t.length>=safeDigits$1;){let e=t.substring(0,safeDigits$1);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}function getAddress$1(e){let t=null;if("string"!=typeof e&&logger$3.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=getChecksumAddress$1(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&logger$3.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==ibanChecksum$1(e)&&logger$3.throwArgumentError("bad icap checksum","address",e),t=_base36To16(e.substring(4));t.length<40;)t="0"+t;t=getChecksumAddress$1("0x"+t)}else logger$3.throwArgumentError("invalid address","address",e);return t}let AddressCoder$1=class extends Coder$1{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=getAddress$1(t)}catch(n){this._throwError(n.message,t)}return e.writeValue(t)}decode(e){return getAddress$1(hexZeroPad(e.readValue().toHexString(),20))}},AnonymousCoder$1=class extends Coder$1{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}};const logger$2=new Logger$1(version$3);function pack$1(e,t,n){let o=null;if(Array.isArray(n))o=n;else if(n&&"object"==typeof n){let e={};o=t.map((t=>{const o=t.localName;return o||logger$2.throwError("cannot encode object for signature with missing names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[o]&&logger$2.throwError("cannot encode object for signature with duplicate names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[o]=!0,n[o]}))}else logger$2.throwArgumentError("invalid tuple value","tuple",n);t.length!==o.length&&logger$2.throwArgumentError("types/value length mismatch","tuple",n);let r=new Writer$1(e.wordSize),i=new Writer$1(e.wordSize),a=[];t.forEach(((e,t)=>{let n=o[t];if(e.dynamic){let t=i.length;e.encode(i,n);let o=r.writeUpdatableValue();a.push((e=>{o(e+t)}))}else e.encode(r,n)})),a.forEach((e=>{e(r.length)}));let s=e.appendWriter(r);return s+=e.appendWriter(i),s}function unpack$1(e,t){let n=[],o=e.subReader(0);t.forEach((t=>{let r=null;if(t.dynamic){let n=e.readValue(),a=o.subReader(n.toNumber());try{r=t.decode(a)}catch(i){if(i.code===Logger$1.errors.BUFFER_OVERRUN)throw i;r=i,r.baseType=t.name,r.name=t.localName,r.type=t.type}}else try{r=t.decode(e)}catch(i){if(i.code===Logger$1.errors.BUFFER_OVERRUN)throw i;r=i,r.baseType=t.name,r.name=t.localName,r.type=t.type}null!=r&&n.push(r)}));const r=t.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach(((e,t)=>{let o=e.localName;if(!o||1!==r[o])return;if("length"===o&&(o="_length"),null!=n[o])return;const i=n[t];i instanceof Error?Object.defineProperty(n,o,{enumerable:!0,get:()=>{throw i}}):n[o]=i}));for(let i=0;i<n.length;i++){const e=n[i];e instanceof Error&&Object.defineProperty(n,i,{enumerable:!0,get:()=>{throw e}})}return Object.freeze(n)}let ArrayCoder$1=class extends Coder$1{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let n=this.length;-1===n&&(n=t.length,e.writeValue(t.length)),logger$2.checkArgumentCount(t.length,n,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let r=0;r<t.length;r++)o.push(this.coder);return pack$1(e,o,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&logger$2.throwError("insufficient data length",Logger$1.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let o=0;o<t;o++)n.push(new AnonymousCoder$1(this.coder));return e.coerce(this.name,unpack$1(e,n))}},BooleanCoder$1=class extends Coder$1{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}},DynamicBytesCoder$1=class extends Coder$1{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=arrayify(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}},BytesCoder$1=class extends DynamicBytesCoder$1{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,hexlify$1(super.decode(e)))}},FixedBytesCoder$1=class extends Coder$1{constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let n=arrayify(t);return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return e.coerce(this.name,hexlify$1(e.readBytes(this.size)))}},NullCoder$1=class extends Coder$1{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}};const NegativeOne=BigNumber.from(-1),Zero=BigNumber.from(0),One=BigNumber.from(1),MaxUint256=BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");let NumberCoder$1=class extends Coder$1{constructor(e,t,n){const o=(t?"int":"uint")+8*e;super(o,o,n,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let n=BigNumber.from(t),o=MaxUint256.mask(8*e.wordSize);if(this.signed){let e=o.mask(8*this.size-1);(n.gt(e)||n.lt(e.add(One).mul(NegativeOne)))&&this._throwError("value out-of-bounds",t)}else(n.lt(Zero)||n.gt(o.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return n=n.toTwos(8*this.size).mask(8*this.size),this.signed&&(n=n.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(n)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}};const version$1="strings/5.8.0",logger$1=new Logger$1(version$1);var UnicodeNormalizationForm,UnicodeNormalizationForm2,Utf8ErrorReason,Utf8ErrorReason2;function errorFunc$1(e,t,n,o,r){return logger$1.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)}function ignoreFunc$1(e,t,n,o,r){if(e===Utf8ErrorReason.BAD_PREFIX||e===Utf8ErrorReason.UNEXPECTED_CONTINUE){let e=0;for(let o=t+1;o<n.length&&n[o]>>6==2;o++)e++;return e}return e===Utf8ErrorReason.OVERRUN?n.length-t-1:0}function replaceFunc$1(e,t,n,o,r){return e===Utf8ErrorReason.OVERLONG?(o.push(r),0):(o.push(65533),ignoreFunc$1(e,t,n))}UnicodeNormalizationForm2=UnicodeNormalizationForm||(UnicodeNormalizationForm={}),UnicodeNormalizationForm2.current="",UnicodeNormalizationForm2.NFC="NFC",UnicodeNormalizationForm2.NFD="NFD",UnicodeNormalizationForm2.NFKC="NFKC",UnicodeNormalizationForm2.NFKD="NFKD",Utf8ErrorReason2=Utf8ErrorReason||(Utf8ErrorReason={}),Utf8ErrorReason2.UNEXPECTED_CONTINUE="unexpected continuation byte",Utf8ErrorReason2.BAD_PREFIX="bad codepoint prefix",Utf8ErrorReason2.OVERRUN="string overrun",Utf8ErrorReason2.MISSING_CONTINUE="missing continuation byte",Utf8ErrorReason2.OUT_OF_RANGE="out of UTF-8 range",Utf8ErrorReason2.UTF16_SURROGATE="UTF-16 surrogate",Utf8ErrorReason2.OVERLONG="overlong representation";const Utf8ErrorFuncs$1=Object.freeze({error:errorFunc$1,ignore:ignoreFunc$1,replace:replaceFunc$1});function getUtf8CodePoints$1(e,t){null==t&&(t=Utf8ErrorFuncs$1.error),e=arrayify(e);const n=[];let o=0;for(;o<e.length;){const r=e[o++];if(!(r>>7)){n.push(r);continue}let i=null,a=null;if(192==(224&r))i=1,a=127;else if(224==(240&r))i=2,a=2047;else{if(240!=(248&r)){o+=t(128==(192&r)?Utf8ErrorReason.UNEXPECTED_CONTINUE:Utf8ErrorReason.BAD_PREFIX,o-1,e,n);continue}i=3,a=65535}if(o-1+i>=e.length){o+=t(Utf8ErrorReason.OVERRUN,o-1,e,n);continue}let s=r&(1<<8-i-1)-1;for(let c=0;c<i;c++){let r=e[o];if(128!=(192&r)){o+=t(Utf8ErrorReason.MISSING_CONTINUE,o,e,n),s=null;break}s=s<<6|63&r,o++}null!==s&&(s>1114111?o+=t(Utf8ErrorReason.OUT_OF_RANGE,o-1-i,e,n,s):s>=55296&&s<=57343?o+=t(Utf8ErrorReason.UTF16_SURROGATE,o-1-i,e,n,s):s<=a?o+=t(Utf8ErrorReason.OVERLONG,o-1-i,e,n,s):n.push(s))}return n}function toUtf8Bytes$1(e,t=UnicodeNormalizationForm.current){t!=UnicodeNormalizationForm.current&&(logger$1.checkNormalize(),e=e.normalize(t));let n=[];for(let o=0;o<e.length;o++){const t=e.charCodeAt(o);if(t<128)n.push(t);else if(t<2048)n.push(t>>6|192),n.push(63&t|128);else if(55296==(64512&t)){o++;const r=e.charCodeAt(o);if(o>=e.length||56320!=(64512&r))throw new Error("invalid utf-8 string");const i=65536+((1023&t)<<10)+(1023&r);n.push(i>>18|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)}else n.push(t>>12|224),n.push(t>>6&63|128),n.push(63&t|128)}return arrayify(n)}function _toUtf8String$1(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function toUtf8String$1(e,t){return _toUtf8String$1(getUtf8CodePoints$1(e,t))}let StringCoder$1=class extends DynamicBytesCoder$1{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,toUtf8Bytes$1(t))}decode(e){return toUtf8String$1(super.decode(e))}},TupleCoder$1=class extends Coder$1{constructor(e,t){let n=!1;const o=[];e.forEach((e=>{e.dynamic&&(n=!0),o.push(e.type)}));super("tuple","tuple("+o.join(",")+")",t,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,o)=>{let r=n.localName;r&&1===t[r]&&("length"===r&&(r="_length"),null==e[r]&&(e[r]=e[o]))})),Object.freeze(e)}encode(e,t){return pack$1(e,this.coders,t)}decode(e){return e.coerce(this.name,unpack$1(e,this.coders))}};const logger=new Logger$1(version$3),paramTypeBytes$1=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber$1=new RegExp(/^(u?int)([0-9]*)$/);let AbiCoder$1=class{constructor(e){defineReadOnly(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new AddressCoder$1(e.name);case"bool":return new BooleanCoder$1(e.name);case"string":return new StringCoder$1(e.name);case"bytes":return new BytesCoder$1(e.name);case"array":return new ArrayCoder$1(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new TupleCoder$1((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new NullCoder$1(e.name)}let t=e.type.match(paramTypeNumber$1);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!=0)&&logger.throwArgumentError("invalid "+t[1]+" bit length","param",e),new NumberCoder$1(n/8,"int"===t[1],e.name)}if(t=e.type.match(paramTypeBytes$1),t){let n=parseInt(t[1]);return(0===n||n>32)&&logger.throwArgumentError("invalid bytes length","param",e),new FixedBytesCoder$1(n,e.name)}return logger.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new Reader$1(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Writer$1(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(ParamType$1.from(e))));return new TupleCoder$1(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&logger.throwError("types/values length mismatch",Logger$1.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(ParamType$1.from(e)))),o=new TupleCoder$1(n,"_"),r=this._getWriter();return o.encode(r,t),r.data}decode(e,t,n){const o=e.map((e=>this._getCoder(ParamType$1.from(e))));return new TupleCoder$1(o,"_").decode(this._getReader(arrayify(t),n))}};const defaultAbiCoder=new AbiCoder$1,{proto:r$5}=e$b;let c$1=class e{constructor(e){this.contractId=e.contractId,this.nonce=e.nonce,Object.freeze(this)}static _fromProtobuf(t){return new e({contractId:v._fromProtobuf(t.contractId),nonce:null!=t.nonce?t.nonce:Long.ZERO})}_toProtobuf(){return{contractId:this.contractId._toProtobuf(),nonce:this.nonce}}static fromBytes(t){return e._fromProtobuf(r$5.ContractNonceInfo.decode(t))}toBytes(){return r$5.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)}},l$3=class e{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,this.signerNonce=e.signerNonce}static _fromProtobuf(t,n){const o=t.contractID,r=t.gasUsed,i=t.gas?t.gas:-1,a=t.amount?t.amount:-1;return new e({_createResult:n,bytes:t.contractCallResult,contractId:null!=o?v._fromProtobuf(o):null,errorMessage:null!=t.errorMessage?t.errorMessage:null,bloom:t.bloom,gasUsed:r instanceof Long?r:Long.fromValue(r),logs:(null!=t.logInfo?t.logInfo:[]).map((e=>o$7._fromProtobuf(e))),createdContractIds:(null!=t.createdContractIDs?t.createdContractIDs:[]).map((e=>v._fromProtobuf(e))),evmAddress:null!=t.evmAddress&&Object.hasOwn(t.evmAddress,"value")&&null!=t.evmAddress.value?t.evmAddress.value:null,stateChanges:[],gas:i instanceof Long?i:Long.fromValue(i),amount:a instanceof Long?a:Long.fromValue(a),functionParameters:t.functionParameters,senderAccountId:null!=t.senderId?f._fromProtobuf(t.senderId):null,contractNonces:(null!=t.contractNonces?t.contractNonces:[]).map((e=>c$1._fromProtobuf(e))),signerNonce:null!=t.signerNonce&&Object.hasOwn(t.signerNonce,"value")&&t.signerNonce.value||null})}asBytes(){return this.bytes}getString(e){return e$3(this.getBytes(e))}getBytes(e){const t=this.getInt32(e),n=E$1(this.bytes).getInt32(t+28);return this.bytes.subarray(t+32,t+32+n)}getBytes32(e){return this.bytes.subarray(32*(null!=e?e:0),32*(null!=e?e:0)+32)}getBool(e){return 0!==this.bytes[32*(null!=e?e:0)+31]}getInt8(e){const t=32*(null!=e?e:0)+31;return E$1(this.bytes).getInt8(t)}getUint8(e){return this.bytes[32*(null!=e?e:0)+31]}getInt16(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getInt32(t)}getUint16(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getUint32(t)}getInt24(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getInt32(t)}getUint24(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getUint32(t)}getInt32(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getInt32(t)}getUint32(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getUint32(t)}getInt40(e){const t=defaultAbiCoder.decode(["int40"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint40(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(27,32)),16)}getInt48(e){const t=defaultAbiCoder.decode(["int48"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint48(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(26,32)),16)}getInt56(e){const t=defaultAbiCoder.decode(["int56"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint56(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(25,32)),16)}getInt64(e){const t=defaultAbiCoder.decode(["int64"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint64(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(24,32)),16)}getInt72(e){const t=defaultAbiCoder.decode(["int72"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint72(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(23,32)),16)}getInt80(e){const t=defaultAbiCoder.decode(["int80"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint80(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(22,32)),16)}getInt88(e){const t=defaultAbiCoder.decode(["int88"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint88(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(21,32)),16)}getInt96(e){const t=defaultAbiCoder.decode(["int96"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint96(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(20,32)),16)}getInt104(e){const t=defaultAbiCoder.decode(["int104"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint104(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(19,32)),16)}getInt112(e){const t=defaultAbiCoder.decode(["int112"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint112(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(18,32)),16)}getInt120(e){const t=defaultAbiCoder.decode(["int120"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint120(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(17,32)),16)}getInt128(e){const t=defaultAbiCoder.decode(["int128"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint128(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(16,32)),16)}getInt136(e){const t=defaultAbiCoder.decode(["int136"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint136(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(15,32)),16)}getInt144(e){const t=defaultAbiCoder.decode(["int144"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint144(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(14,32)),16)}getInt152(e){const t=defaultAbiCoder.decode(["int152"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint152(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(13,32)),16)}getInt160(e){const t=defaultAbiCoder.decode(["int160"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint160(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(12,32)),16)}getInt168(e){const t=defaultAbiCoder.decode(["int168"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint168(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(11,32)),16)}getInt176(e){const t=defaultAbiCoder.decode(["int176"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint176(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(10,32)),16)}getInt184(e){const t=defaultAbiCoder.decode(["int184"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint184(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(9,32)),16)}getInt192(e){const t=defaultAbiCoder.decode(["int192"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint192(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(8,32)),16)}getInt200(e){const t=defaultAbiCoder.decode(["int200"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint200(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(7,32)),16)}getInt208(e){const t=defaultAbiCoder.decode(["int208"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint208(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(6,32)),16)}getInt216(e){const t=defaultAbiCoder.decode(["int216"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint216(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(5,32)),16)}getInt224(e){const t=defaultAbiCoder.decode(["int224"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint224(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(4,32)),16)}getInt232(e){const t=defaultAbiCoder.decode(["int232"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint232(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(3,32)),16)}getInt240(e){const t=defaultAbiCoder.decode(["int240"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint240(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(2,32)),16)}getInt248(e){const t=defaultAbiCoder.decode(["int248"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint248(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(1,32)),16)}getInt256(e){const t=defaultAbiCoder.decode(["int256"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint256(e){return new BigNumber$1(n$e(this._getBytes32(e)),16)}getAddress(e){return n$e(this.bytes.subarray(32*(null!=e?e:0)+12,32*(null!=e?e:0)+32))}getResult(e){return defaultAbiCoder.decode(e,this.bytes)}_getBytes32(e){return this.bytes.subarray(32*(null!=e?e:0),32*(null!=e?e:0)+32)}_toProtobuf(){return{contractID:null!=this.contractId?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:null!=this.evmAddress?{value:this.evmAddress}:null,gas:this.gas,amount:this.amount,functionParameters:this.functionParameters,senderId:null!=this.senderAccountId?this.senderAccountId._toProtobuf():null,contractNonces:this.contractNonces.map((e=>e._toProtobuf())),signerNonce:null!=this.signerNonce?{value:this.signerNonce}:null}}},o$6=class extends t$h{constructor(){super((e=>f.fromString(e)))}toJSON(){const e={};return this._map.forEach(((t,n)=>{e[n]=t.toString()})),e}},n$7=class e extends t$h{constructor(){super((e=>u$3.fromString(e)))}__set(e,t,n){const o=e.toString();let r=this._map.get(o);null==r&&(r=new o$6,this._map.set(o,r),this.__map.set(e,r)),r._set(t,n)}static _fromProtobuf(t){const n=new e;for(const e of t){const t=u$3._fromProtobuf(e.token);for(const o of null!=e.transfers?e.transfers:[]){const e=f._fromProtobuf(o.accountID);n.__set(t,e,o.amount)}}return n}_toProtobuf(){const e=[];for(const[t,n]of this){const o=[];for(const[e,t]of n)o.push({accountID:e._toProtobuf(),amount:t});e.push({token:t._toProtobuf(),transfers:o})}return e}},s$6=class e extends t$h{constructor(){super((e=>u$3.fromString(e)))}__set(e,t){const n=e.toString();let o=this._map.get(n);null==o&&(o=[],this._map.set(n,o),this.__map.set(e,o)),o.push(t)}static _fromProtobuf(t){const n=new e;for(const e of t){const t=u$3._fromProtobuf(e.token);for(const o of null!=e.nftTransfers?e.nftTransfers:[]){const e=f._fromProtobuf(o.senderAccountID),r=f._fromProtobuf(o.receiverAccountID);n.__set(t,{sender:e,recipient:r,serial:Long.fromValue(o.serialNumber),isApproved:!1})}}return n}_toProtobuf(){const e=[];for(const[t,n]of this){const o=[];for(const e of n)o.push({senderAccountID:e.sender._toProtobuf(),receiverAccountID:e.recipient._toProtobuf(),serialNumber:e.serial});e.push({token:t._toProtobuf(),nftTransfers:o})}return e}toJSON(){const e={};return this._map.forEach(((t,n)=>{e[n]=t.map((e=>({sender:e.sender.toString(),recipient:e.recipient.toString(),serial:e.serial,isApproved:e.isApproved})))})),e}},n$6=class e{constructor(e={}){this._feeCollectorAccountId=null,null!=e.feeCollectorAccountId&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),this._tokenId=null,null!=e.tokenId&&this.setTokenId(e.tokenId),this._amount=null,null!=e.amount&&this.setAmount(e.amount),this._payerAccountIds=null,null!=e.payerAccountIds&&this.setPayerAccountIds(e.payerAccountIds)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId="string"==typeof e?f.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId="string"==typeof e?u$3.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount="number"==typeof e?Long.fromNumber(e):e,this}get payerAccountIds(){return this._payerAccountIds}setPayerAccountIds(e){return this._payerAccountIds=e,this}static _fromProtobuf(t){return new e({feeCollectorAccountId:null!=t.feeCollectorAccountId?f._fromProtobuf(t.feeCollectorAccountId):void 0,tokenId:null!=t.tokenId?u$3._fromProtobuf(t.tokenId):void 0,amount:null!=t.amount?t.amount:void 0,payerAccountIds:null!=t.effectivePayerAccountId?t.effectivePayerAccountId.map((e=>f._fromProtobuf(e))):void 0})}_toProtobuf(){return{feeCollectorAccountId:null!=this.feeCollectorAccountId?this.feeCollectorAccountId._toProtobuf():null,tokenId:null!=this._tokenId?this._tokenId._toProtobuf():null,amount:this._amount,effectivePayerAccountId:null!=this._payerAccountIds?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()))||[]}}},u$1=class e{constructor(e={}){this._accountId=null,null!=e.accountId&&this.setAccountId(e.accountId),this._tokenId=null,null!=e.tokenId&&this.setTokenId(e.tokenId),this._defaultMaxTransactionFee=new e$7(5)}get accountId(){return this._accountId}setAccountId(e){return this._accountId="string"==typeof e?f.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId="string"==typeof e?u$3.fromString(e):e,this}static _fromProtobuf(t){return new e({accountId:null!=t.accountId?f._fromProtobuf(t.accountId):void 0,tokenId:null!=t.tokenId?u$3._fromProtobuf(t.tokenId):void 0})}_toProtobuf(){return{accountId:null!=this._accountId?this._accountId._toProtobuf():void 0,tokenId:null!=this._tokenId?this._tokenId._toProtobuf():void 0}}toJSON(){return{accountId:this._accountId?.toString()||null,tokenId:this._tokenId?.toString()||null}}},n$5=class e{constructor(e){this.tokenId=e.tokenId instanceof u$3?e.tokenId:u$3.fromString(e.tokenId),this.accountId=e.accountId instanceof f?e.accountId:f.fromString(e.accountId),this.expectedDecimals=e.expectedDecimals,this.amount=Long.fromValue(e.amount),this.isApproved=e.isApproved}static _fromProtobuf(t){const n=[];for(const o of t){const t=u$3._fromProtobuf(o.token),r=null!=o.expectedDecimals&&Object.hasOwn(o.expectedDecimals,"value")?o.expectedDecimals.value:null;for(const i of null!=o.transfers?o.transfers:[])n.push(new e({tokenId:t,accountId:f._fromProtobuf(i.accountID),expectedDecimals:r||null,amount:null!=i.amount?i.amount:Long.ZERO,isApproved:1==i.isApproval}))}return n}_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())}},e$2=class e{constructor(e,t){this.tokenId=e,this.serial="number"==typeof t?Long.fromNumber(t):t,Object.freeze(this)}static fromString(t){const n=t.split("/").length>1?t.split("/"):t.split("@");for(const e of n)if(""===e)throw new Error("invalid format for NftId: use [token]/[serial] or [token]@[serial]");const o=u$3.fromString(n[0]),r=Long.fromString(n[1]);return new e(o,r)}static _fromProtobuf(t){return new e(u$3._fromProtobuf(t.token_ID),null!=t.serialNumber?t.serialNumber:Long.ZERO)}static fromBytes(t){return e._fromProtobuf(libExports$1.proto.NftID.decode(t))}_toProtobuf(){return{token_ID:this.tokenId._toProtobuf(),serialNumber:Long.fromValue(void 0!==this.serial?this.serial:0)}}toString(){return`${this.tokenId.toString()}/${this.serial.toString()}`}toBytes(){return libExports$1.proto.NftID.encode(this._toProtobuf()).finish()}},t$9=class e{constructor(e={}){this._senderId=null,this._receiverId=null,this._tokenId=null,this._nftId=null,e.receiverId&&(this._receiverId=e.receiverId),e.senderId&&(this._senderId=e.senderId),e.tokenId?this._tokenId=new u$3(e.tokenId):e.nftId&&(this._nftId=new e$2(e.nftId?.tokenId,e.nftId?.serial))}static fromBytes(t){if(null==t.senderId)throw new Error("senderId is required");if(null==t.receiverId)throw new Error("receiverId is required");if(null==t.fungibleTokenType&&null==t.nonFungibleToken)throw new Error("Either fungibleTokenType or nonFungibleToken is required");return new e({senderId:f._fromProtobuf(t.senderId),receiverId:f._fromProtobuf(t.receiverId),nftId:null!=t.nonFungibleToken?e$2._fromProtobuf(t.nonFungibleToken):null,tokenId:null!=t.fungibleTokenType?u$3._fromProtobuf(t.fungibleTokenType):null})}setSenderid(e){return this._senderId=e,this}setReceiverId(e){return this._receiverId=e,this}setTokenId(e){return this._nftId=null,this._tokenId=e,this}setNftId(e){return this._tokenId=null,this._nftId=e,this}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get tokenId(){return this._tokenId}get nftId(){return this._nftId}toBytes(){return{senderId:this.senderId?._toProtobuf(),receiverId:this._receiverId?._toProtobuf(),fungibleTokenType:this._tokenId?._toProtobuf(),nonFungibleToken:this._nftId?._toProtobuf()}}},d$2=class e{constructor(e){this.airdropId=e.airdropId,this.amount=e.amount}toBytes(){return{pendingAirdropId:this.airdropId.toBytes(),pendingAirdropValue:{amount:this.amount}}}static fromBytes(t){if(null==t.pendingAirdropId)throw new Error("pendingAirdropId is required");const n=t$9.fromBytes(t.pendingAirdropId),o=t.pendingAirdropValue?.amount;return new e({airdropId:n,amount:o||Long.ZERO})}},b$3=class e{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=null!=e.contractFunctionResult?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,this.newPendingAirdrops=e.newPendingAirdrops,Object.freeze(this)}_toProtobuf(){const e=this.tokenTransfers._toProtobuf(),t=this.nftTransfers._toProtobuf(),n=[];for(const o of e)for(const e of t)null!=o.token&&null!=e.token&&o.token.shardNum===e.token.shardNum&&o.token.realmNum===e.token.realmNum&&o.token.tokenNum===e.token.tokenNum?n.push({token:o.token,transfers:o.transfers,nftTransfers:o.nftTransfers}):(n.push(o),n.push(e));return{duplicateTransactionRecords:this.duplicates.map((e=>e._toProtobuf().transactionRecord)),childTransactionRecords:this.children.map((e=>e._toProtobuf().transactionRecord)),transactionRecord:{receipt:this.receipt._toProtobuf().receipt,transactionHash:null!=this.transactionHash?this.transactionHash:null,consensusTimestamp:null!=this.consensusTimestamp?this.consensusTimestamp._toProtobuf():null,transactionID:null!=this.transactionId?this.transactionId._toProtobuf():null,memo:null!=this.transactionMemo?this.transactionMemo:null,transactionFee:null!=this.transactionFee?this.transactionFee.toTinybars():null,contractCallResult:null==this.contractFunctionResult||this.contractFunctionResult._createResult?null:this.contractFunctionResult._toProtobuf(),contractCreateResult:null!=this.contractFunctionResult&&this.contractFunctionResult._createResult?this.contractFunctionResult._toProtobuf():null,transferList:null!=this.transfers?{accountAmounts:this.transfers.map((e=>e._toProtobuf()))}:null,tokenTransferLists:n,scheduleRef:null!=this.scheduleRef?this.scheduleRef._toProtobuf():null,assessedCustomFees:this.assessedCustomFees.map((e=>e._toProtobuf())),automaticTokenAssociations:this.automaticTokenAssociations.map((e=>e._toProtobuf())),parentConsensusTimestamp:null!=this.parentConsensusTimestamp?this.parentConsensusTimestamp._toProtobuf():null,alias:null!=this.aliasKey?libExports$1.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():null,ethereumHash:this.ethereumHash,paidStakingRewards:this.paidStakingRewards.map((e=>e._toProtobuf())),prngBytes:this.prngBytes,prngNumber:null!=this.prngNumber?this.prngNumber:null,evmAddress:null!=this.evmAddress?this.evmAddress.toBytes():null,newPendingAirdrops:this.newPendingAirdrops.map((e=>e.toBytes()))}}}static _fromProtobuf(t){const n=t.transactionRecord;let o=null!=n.alias&&n.alias.length>0?t$i._fromProtobufKey(libExports$1.proto.Key.decode(n.alias)):null;o instanceof i$7||(o=null);const r=null!=t.childTransactionRecords?t.childTransactionRecords.map((t=>e._fromProtobuf({transactionRecord:t}))):[],i=null!=t.duplicateTransactionRecords?t.duplicateTransactionRecords.map((t=>e._fromProtobuf({transactionRecord:t}))):[],a=null!=n.contractCallResult?l$3._fromProtobuf(n.contractCallResult,!1):null!=n.contractCreateResult?l$3._fromProtobuf(n.contractCreateResult,!0):void 0,s=null!=n.newPendingAirdrops?n.newPendingAirdrops.map((e=>d$2.fromBytes(e))):[];return new e({receipt:d$3._fromProtobuf({receipt:n.receipt}),transactionHash:null!=n.transactionHash?n.transactionHash:new Uint8Array,consensusTimestamp:s$8._fromProtobuf(n.consensusTimestamp),transactionId:i$6._fromProtobuf(n.transactionID),transactionMemo:null!=n.memo?n.memo:"",transactionFee:e$7.fromTinybars(null!=n.transactionFee?n.transactionFee:0),transfers:n$9._fromProtobuf(null!=n.transferList&&null!=n.transferList.accountAmounts?n.transferList.accountAmounts:[]),contractFunctionResult:a,tokenTransfers:n$7._fromProtobuf(null!=n.tokenTransferLists?n.tokenTransferLists:[]),tokenTransfersList:n$5._fromProtobuf(null!=n.tokenTransferLists?n.tokenTransferLists:[]),scheduleRef:null!=n.scheduleRef?o$8._fromProtobuf(n.scheduleRef):null,assessedCustomFees:null!=n.assessedCustomFees?n.assessedCustomFees.map((e=>n$6._fromProtobuf(e))):[],nftTransfers:s$6._fromProtobuf(null!=n.tokenTransferLists?n.tokenTransferLists:[]),automaticTokenAssociations:null!=n.automaticTokenAssociations?n.automaticTokenAssociations.map((e=>u$1._fromProtobuf(e))):[],parentConsensusTimestamp:null!=n.parentConsensusTimestamp?s$8._fromProtobuf(n.parentConsensusTimestamp):null,aliasKey:o,duplicates:i,children:r,hbarAllowanceAdjustments:[],tokenAllowanceAdjustments:[],nftAllowanceAdjustments:[],ethereumHash:null!=n.ethereumHash?n.ethereumHash:null,paidStakingRewards:null!=n.paidStakingRewards?n$9._fromProtobuf(n.paidStakingRewards):[],prngBytes:null!=n.prngBytes?n.prngBytes:null,prngNumber:null!=n.prngNumber?n.prngNumber:null,evmAddress:null!=n.evmAddress?o$a.fromBytes(n.evmAddress):null,newPendingAirdrops:s})}static fromBytes(t){return e._fromProtobuf(libExports$1.proto.TransactionGetRecordResponse.decode(t))}toBytes(){return libExports$1.proto.TransactionGetRecordResponse.encode(this._toProtobuf()).finish()}toJSON(){return{receipt:this.receipt.toJSON(),transactionHash:n$e(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:null!=this.ethereumHash?n$e(this.ethereumHash):null,paidStakingRewards:this.paidStakingRewards,prngBytes:null!=this.prngBytes?n$e(this.prngBytes):null,prngNumber:this.prngNumber,evmAddress:this.evmAddress?.toString()||null}}toString(){return JSON.stringify(this.toJSON())}},r$4=class extends t$c{constructor(e){super(e,`Record for transaction ${e.transactionId.toString()} contained error status ${e.status.toString()}`),this.transactionRecord=e.transactionRecord}};const{proto:l$2}=e$b;class h extends h$1{constructor(e={}){super(),this._transactionId=null,this._includeChildren=null,this._includeDuplicates=null,this._validateReceiptStatus=!0,null!=e.transactionId&&this.setTransactionId(e.transactionId),null!=e.includeChildren&&this.setIncludeChildren(e.includeChildren),null!=e.includeDuplicates&&this.setIncludeDuplicates(e.includeDuplicates),null!=e.validateReceiptStatus&&this.setValidateReceiptStatus(e.validateReceiptStatus)}get transactionId(){return this._transactionId}static _fromProtobuf(e){const t=e.transactionGetRecord;return new h({transactionId:t.transactionID?i$6._fromProtobuf(t.transactionID):void 0,includeChildren:null!=t.includeChildRecords?t.includeChildRecords:void 0,includeDuplicates:null!=t.includeDuplicates?t.includeDuplicates:void 0})}setTransactionId(e){return this._transactionId="string"==typeof e?i$6.fromString(e):e.clone(),this}setIncludeChildren(e){return this._includeChildren=e,this}get includeChildren(){return null!=this._includeChildren&&this._includeChildren}setIncludeDuplicates(e){return this._duplicates=e,this}get includeDuplicates(){return null!=this._duplicates&&this._duplicates}setValidateReceiptStatus(e){return this._validateReceiptStatus=e,this}get validateReceiptStatus(){return this._validateReceiptStatus}_shouldRetry(e,t){const{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t);let o=e$6._fromCode(null!=n?n:l$2.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received node precheck status ${o.toString()}`),o){case e$6.Busy:case e$6.Unknown:case e$6.ReceiptNotFound:case e$6.RecordNotFound:case e$6.PlatformNotActive:return[o,c$2.Retry];case e$6.Ok:break;default:return[o,c$2.Error]}const r=t.transactionGetRecord;if(r.header.responseType===libExports$1.proto.ResponseType.COST_ANSWER)return[o,c$2.Finished];const i=r.transactionRecord.receipt.status;switch(o=e$6._fromCode(i),this._logger&&this._logger.debug(`[${this._getLogId()}] received record's receipt ${o.toString()}`),o){case e$6.Ok:case e$6.Busy:case e$6.Unknown:case e$6.ReceiptNotFound:case e$6.RecordNotFound:return[o,c$2.Retry];case e$6.Success:return[o,c$2.Finished];default:return[o,this._validateReceiptStatus?c$2.Error:c$2.Finished]}}_mapStatusError(e,t,n){const{nodeTransactionPrecheckCode:o}=this._mapResponseHeader(t);let r=e$6._fromCode(null!=o?o:l$2.ResponseCodeEnum.OK);switch(r){case e$6.Ok:break;case e$6.ContractRevertExecuted:return new r$4({status:r,transactionId:this._getTransactionId(),transactionRecord:b$3._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})});default:return new n$a({nodeId:n,status:r,transactionId:this._getTransactionId(),contractFunctionResult:null})}const i=t.transactionGetRecord.transactionRecord.receipt,a=i.status;return r=e$6._fromCode(a),r===e$6.ContractRevertExecuted?new r$4({status:r,transactionId:this._getTransactionId(),transactionRecord:b$3._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})}):new r$8({status:r,transactionId:this._getTransactionId(),transactionReceipt:d$3._fromProtobuf({receipt:i})})}_validateChecksums(e){null!=this._transactionId&&null!=this._transactionId.accountId&&this._transactionId.accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getTxRecordByTxID(t)}_mapResponseHeader(e){return e.transactionGetRecord.header}_mapResponse(e,t,n){const o=e.transactionGetRecord;return Promise.resolve(b$3._fromProtobuf(o))}_onMakeRequest(e){return{transactionGetRecord:{header:e,transactionID:null!=this._transactionId?this._transactionId._toProtobuf():null,includeChildRecords:this._includeChildren,includeDuplicates:this._includeDuplicates}}}_getLogId(){return`TransactionRecordQuery:${(null!=this._paymentTransactionId&&null!=this._paymentTransactionId.validStart?this._paymentTransactionId.validStart:this._timestamp).toString()}`}}d$4.set("transactionGetRecord",h._fromProtobuf);let o$5=class e{constructor(e){this.nodeId=e.nodeId,this.transactionHash=e.transactionHash,this.transactionId=e.transactionId,Object.freeze(this)}static fromJSON(t){return new e({nodeId:f.fromString(t.nodeId),transactionHash:r$a(t.transactionHash),transactionId:i$6.fromString(t.transactionId)})}async getReceipt(e){const t=await this.getReceiptQuery().execute(e);if(t.status!==e$6.Success&&t.status!==e$6.FeeScheduleFilePartUploaded)throw new r$8({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(t){return this.getRecordQuery().execute(e)}}async getReceiptWithSigner(e){const t=await this.getReceiptQuery().executeWithSigner(e);if(t.status!==e$6.Success)throw new r$8({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 l$4).setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}getRecordQuery(){return(new h).setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}toJSON(){return{nodeId:this.nodeId.toString(),transactionHash:n$e(this.transactionHash),transactionId:this.transactionId.toString()}}toString(){return JSON.stringify(this.toJSON())}};async function t$8(e){return new Uint8Array(await window.crypto.subtle.digest("SHA-384",e))}let n$4=class e extends t$h{constructor(){super((e=>f.fromString(e)))}static async _fromTransaction(t){const n=new e;for(let e=0;e<t._nodeAccountIds.length;e++){const o=t._nodeAccountIds.list[e],r=t._transactions.get(e),i=await t$8(r.signedTransactionBytes);n._set(o,i)}return n}},e$1=class{constructor(e={}){this._feeCollectorAccountId=null,this._allCollectorsAreExempt=!1,null!=e.feeCollectorAccountId&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),null!=e.allCollectorsAreExempt&&this.setAllCollectorsAreExempt(e.allCollectorsAreExempt)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId="string"==typeof e?f.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")}},l$1=class e extends e$1{constructor(e={}){super(e),this._denominatingTokenId=null,null!=e.denominatingTokenId&&this.setDenominatingTokenId(e.denominatingTokenId),this._amount=null,null!=e.amount&&this.setAmount(e.amount)}setHbarAmount(e){return this._amount=e.toTinybars(),this._denominatingTokenId=null,this}get hbarAmount(){return null!=this._denominatingTokenId?null:e$7.fromTinybars(null!=this._amount?this._amount:0)}setDenominatingTokenToSameToken(){return this._denominatingTokenId=new u$3(0,0,0),this}get denominatingTokenId(){return this._denominatingTokenId}setDenominatingTokenId(e){return this._denominatingTokenId="string"==typeof e?u$3.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount="number"==typeof e?Long.fromNumber(e):e,this}static _fromProtobuf(t){const n=t.fixedFee;return new e({feeCollectorAccountId:null!=t.feeCollectorAccountId?f._fromProtobuf(t.feeCollectorAccountId):void 0,allCollectorsAreExempt:null!=t.allCollectorsAreExempt?t.allCollectorsAreExempt:void 0,denominatingTokenId:null!=n.denominatingTokenId?u$3._fromProtobuf(n.denominatingTokenId):void 0,amount:null!=n.amount?n.amount:void 0})}_toProtobuf(){return{feeCollectorAccountId:null!=this.feeCollectorAccountId?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fixedFee:{denominatingTokenId:null!=this._denominatingTokenId?this._denominatingTokenId._toProtobuf():null,amount:this._amount}}}_toTopicFeeProtobuf(){return{feeCollectorAccountId:null!=this.feeCollectorAccountId?this.feeCollectorAccountId._toProtobuf():null,fixedFee:{denominatingTokenId:null!=this._denominatingTokenId?this._denominatingTokenId._toProtobuf():null,amount:this._amount}}}},o$4=class e{constructor(e={}){this._accountId=null,e.accountId&&this.setAccountId(e.accountId),this._fees=null,e.fees&&this.setFees(e.fees)}static _fromProtobuf(t){return new e({accountId:null!=t.accountId?f._fromProtobuf(t.accountId):null,fees:null!=t.fees?t.fees.map((e=>l$1._fromProtobuf({fixedFee:e}))):null})}getAccountId(){return this._accountId}setAccountId(e){return this._accountId=e instanceof f?e:f.fromString(e),this}getFees(){return this._fees}setFees(e){return this._fees=e,this}_toProtobuf(){const e=[];return null!=this._fees&&this._fees.forEach((t=>{const n=t._toProtobuf();null!=n.fixedFee&&e.push(n.fixedFee)})),{accountId:null!=this._accountId?this._accountId._toProtobuf():null,fees:e}}};const y=Long.fromValue(7776e3),I=e$7.fromTinybars(Long.fromString("9223372036854775807")),b$2=1024,w$1=new Map;class S extends u$5{constructor(){super(),__publicField2(this,"_shouldRemoveSignature",((e,t)=>n$e(e?.pubKeyPrefix||new Uint8Array)===t)),this._transactions=new t$d,this._signedTransactions=new t$d,this._signerPublicKeys=new Set,this._transactionValidDuration=120,this._defaultMaxTransactionFee=new e$7(2),this._customFeeLimits=[],this._maxTransactionFee=null,this._transactionMemo="",this._transactionIds=new t$d,this._publicKeys=[],this._transactionSigners=[],this._regenerateTransactionId=null}static fromBytes(e){const t=[],n=[],o=[],r=[],i=[],a=[],s=libExports$1.proto.TransactionList.decode(e).transactionList;if(0===s.length){const t=libExports$1.proto.Transaction.decode(e);0!==t.signedTransactionBytes.length?s.push(t):s.push({signedTransactionBytes:libExports$1.proto.SignedTransaction.encode({sigMap:t.sigMap,bodyBytes:t.bodyBytes}).finish()})}for(const u of s){if(null==u.bodyBytes&&null==u.signedTransactionBytes)throw new Error("bodyBytes and signedTransactionBytes are null");if(u.bodyBytes&&0!=u.bodyBytes.length){const e=libExports$1.proto.TransactionBody.decode(u.bodyBytes);if(null!=e.transactionID){const t=i$6._fromProtobuf(e.transactionID);r.includes(t.toString())||(n.push(t),r.push(t.toString()))}if(null!=e.nodeAccountID){const t=f._fromProtobuf(e.nodeAccountID);i.includes(t.toString())||(o.push(t),i.push(t.toString()))}if(null==e.data)throw new Error("(BUG) body.data was not set in the protobuf");a.push(e)}if(u.signedTransactionBytes&&0!=u.signedTransactionBytes.length){const e=libExports$1.proto.SignedTransaction.decode(u.signedTransactionBytes);t.push(e);const s=libExports$1.proto.TransactionBody.decode(e.bodyBytes);if(null!=s.transactionID){const e=i$6._fromProtobuf(s.transactionID);r.includes(e.toString())||(n.push(e),r.push(e.toString()))}if(null!=s.nodeAccountID){const e=f._fromProtobuf(s.nodeAccountID);i.includes(e.toString())||(o.push(e),i.push(e.toString()))}if(null==s.data)throw new Error("(BUG) body.data was not set in the protobuf");a.push(s)}}const c=a[0];if(null==c||null==c.data)throw new Error("No transaction found in bytes or failed to decode TransactionBody");const l=w$1.get(c.data);if(null==l)throw new Error(`(BUG) Transaction.fromBytes() not implemented for type ${c.data}`);return l(s,t,n,o,a)}schedule(){if(this._requireNotFrozen(),1!=A.length)throw new Error("ScheduleCreateTransaction has not been loaded yet");return A[0]()._setScheduledTransaction(this)}static _fromProtobufTransactions(e,t,n,o,r,i){const a=i[0];for(let c=0;c<o.length;c++)for(let e=0;e<r.length-1;e++)if(!L(i[c*r.length+e],i[c*r.length+e+1],new Set(["nodeAccountID"])))throw new Error("failed to validate transaction bodies");const s=new f(0);for(let c=0;c<r.length;c++)r[c].equals(s)&&r.splice(c--,1);e._transactions.setList(t),e._signedTransactions.setList(n),e._transactionIds.setList(o),e._nodeAccountIds.setList(r),e._transactionValidDuration=null!=a.transactionValidDuration&&null!=a.transactionValidDuration.seconds?Long.fromValue(a.transactionValidDuration.seconds).toInt():120,e._maxTransactionFee=null!=a.transactionFee&&a.transactionFee>new Long(0,0,!0)?e$7.fromTinybars(a.transactionFee):null,e._customFeeLimits=null!=a.maxCustomFees?a.maxCustomFees?.map((e=>o$4._fromProtobuf(e))):[],e._transactionMemo=null!=a.memo?a.memo:"";for(let c=0;c<r.length;c++){const o=n[c]||t[c];if(null!=o.sigMap&&null!=o.sigMap.sigPair)for(const t of o.sigMap.sigPair)e._signerPublicKeys.add(n$e(t.pubKeyPrefix)),e._publicKeys.push(i$7.fromBytes(t.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 e$7?e:new e$7(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}getRequiredChunks(){return 1}sign(e){return this.signWith(e.publicKey,(t=>Promise.resolve(e.sign(t))))}async signWith(e,t){this._signOnDemand||this._requireFrozen();const n=n$e(e.toBytesRaw());if(this._signerPublicKeys.has(n))return this;if(this._transactions.clear(),this._signerPublicKeys.add(n),this._signOnDemand)return this._publicKeys.push(e),this._transactionSigners.push(t),this;this._transactionIds.setLocked(),this._nodeAccountIds.setLocked();for(const o of this._signedTransactions.list){const n=o.bodyBytes,r=await t(n);null==o.sigMap&&(o.sigMap={}),null==o.sigMap.sigPair&&(o.sigMap.sigPair=[]),o.sigMap.sigPair.push(e._toProtobufSignature(r))}return this}signWithOperator(e){const t=e._operator;if(null==t)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.isFrozen()||this.freeze();const n=n$e(e.toBytesRaw());if(this._signerPublicKeys.has(n))return this;this._transactions.clear(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._signedTransactions.setLocked();for(let o=0;o<this._signedTransactions.length;o++){const n=this._signedTransactions.get(o);if(null==n.sigMap&&(n.sigMap={}),null==n.sigMap.sigPair&&(n.sigMap.sigPair=[]),n.bodyBytes){const{transactionID:o,nodeAccountID:r}=libExports$1.proto.TransactionBody.decode(n.bodyBytes);if(!o||!r)throw new Error("Transaction ID or Node Account ID not found in the signed transaction");const i=i$6._fromProtobuf(o),a=f._fromProtobuf(r),s=t.get(a),c=s?.get(i),l=c?.get(e);if(!l)throw new Error("Signature not found for the transaction and public key");const u=e._toProtobufSignature(l);n.sigMap?.sigPair?.push(u)}}return this._signerPublicKeys.add(n),this._publicKeys.push(e),this._transactionSigners.push(null),this}removeSignature(e){this.isFrozen()||this.freeze();const t=n$e(e.toBytesRaw());if(!this._signerPublicKeys.has(t))throw new Error("The public key has not signed this transaction");const n=[];for(const o of this._signedTransactions.list){const e=this._removeSignaturesFromTransaction(o,t);n.push(...e)}return this._signerPublicKeys.delete(t),this._publicKeys=this._publicKeys.filter((t=>!t.equals(e))),this._transactionSigners.pop(),n}removeAllSignatures(){this.isFrozen()||this.freeze();const e=this._collectSignaturesByPublicKey();for(const t of this._signedTransactions.list)t.sigMap&&t.sigMap.sigPair&&(t.sigMap.sigPair=[]);return this._signerPublicKeys.clear(),this._publicKeys=[],this._transactionSigners=[],e}getSignatures(){return this._requireFrozen(),this._requireNotSignOnDemand(),this._buildAllTransactions(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),e$9._fromTransaction(this)}async getSignaturesAsync(){return this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),e$9._fromTransaction(this)}_setTransactionId(){if(null==this._operatorAccountId&&this._transactionIds.isEmpty)throw new Error("`transactionId` must be set or `client` must be provided with `freezeWith`")}_setNodeAccountIds(e){if(this._nodeAccountIds.isEmpty){if(null==e)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))))}_buildIncompleteTransactions(){0==this._nodeAccountIds.length?this._transactions.setList([this._makeSignedTransaction(null)]):this._transactions.setList(this._nodeAccountIds.list.map((e=>this._makeSignedTransaction(e))))}freeze(){return this.freezeWith(null)}_freezeWithAccountId(e){null==this._operatorAccountId&&(this._operatorAccountId=e)}freezeWith(e){if(this._signOnDemand=null!=e&&e.signOnDemand,this._operator=null!=e?e._operator:null,this._freezeWithAccountId(null!=e?e.operatorAccountId:null),this._maxTransactionFee=null==this._maxTransactionFee?null!=e&&null!=e.defaultMaxTransactionFee?e.defaultMaxTransactionFee:this._defaultMaxTransactionFee:this._maxTransactionFee,this._regenerateTransactionId=null!=e&&null==this._regenerateTransactionId?e.defaultRegenerateTransactionId:this._regenerateTransactionId,this._setNodeAccountIds(e),this._setTransactionId(),null!=e)for(const t of this._transactionIds.list)null!=t.accountId&&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._requireNotSignOnDemand(),this._isFrozen()?(this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._buildAllTransactions()):this._buildIncompleteTransactions(),libExports$1.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(),libExports$1.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(),t$8(this._transactions.get(0).signedTransactionBytes)}async getTransactionHashPerNode(){return this._requireFrozen(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),await n$4._fromTransaction(this)}isFrozen(){return this._signedTransactions.length>0}_getTransactionId(){const e=this.transactionId;if(null==e)throw new Error("transaction must have been frozen before getting the transaction ID, try calling `freeze`");return e}_validateChecksums(e){}async _beforeExecute(e){this.transactionNodeIds=Object.values(e.network).map((e=>e.toString())),this._logger&&this._logger.info(`Network used: ${e._network.networkName}`),this._isFrozen()||this.freezeWith(e),e.isAutoValidateChecksumsEnabled()&&this._validateChecksums(e),null!=this._operator&&null!=this._operator||(this._operator=null!=e?e._operator:null),null!=this._operatorAccountId&&null!=this._operatorAccountId||(this._operatorAccountId=null!=e&&null!=e._operator?e._operator.accountId:null),null!=this._operator&&await this.signWith(this._operator.publicKey,this._operator.transactionSigner)}async _makeRequestAsync(){const 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(){const e=this._makeSignedTransaction(this._nodeAccountIds.next),t=e.bodyBytes;for(let n=0;n<this._publicKeys.length;n++){const o=this._publicKeys[n],r=this._transactionSigners[n];if(null==r)continue;const i=await r(t);null==e.sigMap&&(e.sigMap={}),null==e.sigMap.sigPair&&(e.sigMap.sigPair=[]),e.sigMap.sigPair.push(o._toProtobufSignature(i))}return e}_buildNewTransactionIdList(){if(this._transactionIds.locked||null==this._operatorAccountId)return;const e=i$6.withValidStart(this._operatorAccountId,s$8.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){if(this._buildSignedTransactions(),!this._transactions.locked)for(let e=0;e<this._signedTransactions.length;e++)this._transactions.push(await this._buildTransactionAsync())}else this._buildAllTransactions()}_buildTransaction(e){if(this._transactions.length<e)for(let t=this._transactions.length;t<e;t++)this._transactions.push(null);null!=this._transactions.list[e]&&this._transactions.set(e,{signedTransactionBytes:libExports$1.proto.SignedTransaction.encode(this._signedTransactions.get(e)).finish()}),this._transactions.setIfAbsent(e,(()=>({signedTransactionBytes:libExports$1.proto.SignedTransaction.encode(this._signedTransactions.get(e)).finish()})))}async _buildTransactionAsync(){return{signedTransactionBytes:libExports$1.proto.SignedTransaction.encode(await this._signTransaction()).finish()}}_shouldRetry(e,t){const{nodeTransactionPrecheckCode:n}=t,o=e$6._fromCode(null!=n?n:libExports$1.proto.ResponseCodeEnum.OK);switch(this._logger&&(this._logger.debug(`[${this._getLogId()}] received status ${o.toString()}`),this._logger.info(`SDK Transaction Status Response: ${o.toString()}`)),o){case e$6.Busy:case e$6.Unknown:case e$6.PlatformTransactionNotCreated:case e$6.PlatformNotActive:return[o,c$2.Retry];case e$6.Ok:return[o,c$2.Finished];case e$6.TransactionExpired:return this._transactionIds.locked||null!=this._regenerateTransactionId&&!this._regenerateTransactionId?[o,c$2.Error]:(this._buildNewTransactionIdList(),[o,c$2.Retry]);default:return[o,c$2.Error]}}_mapStatusError(e,t,n){const{nodeTransactionPrecheckCode:o}=t,r=e$6._fromCode(null!=o?o:libExports$1.proto.ResponseCodeEnum.OK);return this._logger&&this._logger.info(`Transaction Error Info: ${r.toString()}, ${this.transactionId.toString()}`),new n$a({nodeId:n,status:r,transactionId:this._getTransactionId(),contractFunctionResult:null})}async _mapResponse(e,t,n){const o=await t$8(n.signedTransactionBytes),r=this._getTransactionId();return this._transactionIds.advance(),this._logger&&this._logger.info(`Transaction Info: ${JSON.stringify(new o$5({nodeId:t,transactionHash:o,transactionId:r}).toJSON())}`),new o$5({nodeId:t,transactionHash:o,transactionId:r})}_makeSignedTransaction(e){const t=this._makeTransactionBody(e);return this._logger&&this._logger.info(`Transaction Body: ${JSON.stringify(t)}`),{sigMap:{sigPair:[]},bodyBytes:libExports$1.proto.TransactionBody.encode(t).finish()}}_makeTransactionBody(e){return{[this._getTransactionDataCase()]:this._makeTransactionData(),transactionFee:null!=this._maxTransactionFee?this._maxTransactionFee.toTinybars():null,memo:this._transactionMemo,transactionID:null!=this._transactionIds.current?this._transactionIds.current._toProtobuf():null,nodeAccountID:null!=e?e._toProtobuf():null,transactionValidDuration:{seconds:Long.fromNumber(this._transactionValidDuration)},maxCustomFees:null!=this._customFeeLimits?this._customFeeLimits.map((e=>e._toProtobuf())):null}}_getTransactionDataCase(){throw new Error("not implemented")}_getScheduledTransactionBody(){return{memo:this.transactionMemo,transactionFee:null==this._maxTransactionFee?this._defaultMaxTransactionFee.toTinybars():this._maxTransactionFee.toTinybars(),[this._getTransactionDataCase()]:this._makeTransactionData()}}_makeTransactionData(){throw new Error("not implemented")}_isFrozen(){return this._signOnDemand||this._signedTransactions.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(1!=this._nodeAccountIds.length)throw"transaction did not have exactly one node ID set"}_requestToBytes(e){return libExports$1.proto.Transaction.encode(e).finish()}_responseToBytes(e){return libExports$1.proto.TransactionResponse.encode(e).finish()}_removeSignaturesFromTransaction(e,t){const n=[];return e.sigMap&&e.sigMap.sigPair?(e.sigMap.sigPair=e.sigMap.sigPair.filter((e=>{const o=this._shouldRemoveSignature(e,t),r=e.ed25519??e.ECDSASecp256k1;return o&&r&&n.push(r),!o})),n):[]}_collectSignaturesByPublicKey(){const e=new Map,t={};for(const n of this._signedTransactions.list){if(!n.sigMap||!n.sigMap.sigPair)return new Map;for(const o of n.sigMap.sigPair){const n=o.ed25519??o.ECDSASecp256k1;if(!n||!o.pubKeyPrefix)return new Map;const r=n$e(o.pubKeyPrefix);let i=t[r];i||(i=i$7.fromString(r),t[r]=i),e.has(i)||e.set(i,[]);const a=e.get(i);a&&a.push(n)}}return e}}const A=[];let t$7=class extends t$h{constructor(){super((e=>u$3.fromString(e)))}},t$6=class extends t$h{constructor(){super((e=>u$3.fromString(e)))}};class a{constructor(e){this.hbars=e.hbars,this.tokens=e.tokens,this.tokenDecimals=e.tokenDecimals,Object.freeze(this)}static fromBytes(e){return a._fromProtobuf(libExports$1.proto.CryptoGetAccountBalanceResponse.decode(e))}static _fromProtobuf(e){const t=new t$7,n=new t$6;if(null!=e.tokenBalances)for(const o of e.tokenBalances){const e=u$3._fromProtobuf(o.tokenId);n._set(e,null!=o.decimals?o.decimals:0),t._set(e,Long.fromValue(o.balance))}return new a({hbars:e$7.fromTinybars(e.balance),tokens:t,tokenDecimals:n})}_toProtobuf(){const e=[];for(const[t,n]of null!=this.tokens?this.tokens:[])e.push({tokenId:t._toProtobuf(),balance:n,decimals:null!=this.tokenDecimals?this.tokenDecimals.get(t):null});return{balance:this.hbars.toTinybars(),tokenBalances:e}}toBytes(){return libExports$1.proto.CryptoGetAccountBalanceResponse.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){const e=[];for(const[t,n]of null!=this.tokens?this.tokens:[]){const o=null!=this.tokenDecimals?this.tokenDecimals.get(t):null;e.push({tokenId:t.toString(),balance:n.toString(),decimals:null!=o?o:0})}return{hbars:this.hbars.toString(),tokens:e}}}class e extends h$1{constructor(e={}){super(),this._accountId=null,this._contractId=null,null!=e.accountId&&this.setAccountId(e.accountId),null!=e.contractId&&this.setContractId(e.contractId)}static _fromProtobuf(t){const n=t.cryptogetAccountBalance;return new e({accountId:null!=n.accountID?f._fromProtobuf(n.accountID):void 0,contractId:null!=n.contractID?v._fromProtobuf(n.contractID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId="string"==typeof e?f.fromString(e):e.clone(),this}get contractId(){return this._contractId}setContractId(e){return this._contractId="string"==typeof e?v.fromString(e):e.clone(),this}_isPaymentRequired(){return!1}_validateChecksums(e){null!=this._accountId&&this._accountId.validateChecksum(e),null!=this._contractId&&this._contractId.validateChecksum(e)}_execute(e,t){return e.crypto.cryptoGetBalance(t)}_mapResponseHeader(e){return e.cryptogetAccountBalance.header}_mapResponse(e,t,n){const o=e.cryptogetAccountBalance;return Promise.resolve(a._fromProtobuf(o))}_onMakeRequest(e){return{cryptogetAccountBalance:{header:e,accountID:null!=this._accountId?this._accountId._toProtobuf():null,contractID:null!=this._contractId?this._contractId._toProtobuf():null}}}_getLogId(){return`AccountBalanceQuery:${this._timestamp.toString()}`}}d$4.set("cryptogetAccountBalance",e._fromProtobuf);let s$5=class e{constructor(e){this.seconds=e instanceof Long?e:Long.fromNumber(e),Object.freeze(this)}_toProtobuf(){return{seconds:this.seconds}}static _fromProtobuf(t){return new e(t.seconds)}};class l extends S{constructor(e={}){super(),this._key=null,this._initialBalance=null,this._sendRecordThreshold=I,this._receiveRecordThreshold=I,this._receiverSignatureRequired=!1,this._proxyAccountId=null,this._autoRenewPeriod=new s$5(y),this._accountMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=!1,this._alias=null,null!=e.key&&this.setKeyWithoutAlias(e.key),null!=e.receiverSignatureRequired&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),null!=e.initialBalance&&this.setInitialBalance(e.initialBalance),null!=e.proxyAccountId&&this.setProxyAccountId(e.proxyAccountId),null!=e.autoRenewPeriod&&this.setAutoRenewPeriod(e.autoRenewPeriod),null!=e.accountMemo&&this.setAccountMemo(e.accountMemo),null!=e.maxAutomaticTokenAssociations&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),null!=e.stakedAccountId&&this.setStakedAccountId(e.stakedAccountId),null!=e.stakedNodeId&&this.setStakedNodeId(e.stakedNodeId),null!=e.declineStakingReward&&this.setDeclineStakingReward(e.declineStakingReward),null!=e.alias&&this.setAlias(e.alias)}static _fromProtobuf(e,t,n,o,r){const i=r[0].cryptoCreateAccount;let a;return null!=i.alias&&i.alias.length>0&&20===i.alias.length&&(a=o$a.fromBytes(i.alias)),S._fromProtobufTransactions(new l({key:null!=i.key?t$i._fromProtobufKey(i.key):void 0,initialBalance:null!=i.initialBalance?e$7.fromTinybars(i.initialBalance):void 0,receiverSignatureRequired:null!=i.receiverSigRequired?i.receiverSigRequired:void 0,proxyAccountId:null!=i.proxyAccountID?f._fromProtobuf(i.proxyAccountID):void 0,autoRenewPeriod:null!=i.autoRenewPeriod&&null!=i.autoRenewPeriod.seconds?i.autoRenewPeriod.seconds:void 0,accountMemo:null!=i.memo?i.memo:void 0,maxAutomaticTokenAssociations:null!=i.maxAutomaticTokenAssociations?i.maxAutomaticTokenAssociations:void 0,stakedAccountId:null!=i.stakedAccountId?f._fromProtobuf(i.stakedAccountId):void 0,stakedNodeId:null!=i.stakedNodeId?i.stakedNodeId:void 0,declineStakingReward:1==i.declineReward,alias:a}),e,t,n,o,r)}get key(){return this._key}setKey(e){return this._requireNotFrozen(),this._key=e,this}setECDSAKeyWithAlias(e){if(this.setKeyWithoutAlias(e),!(e instanceof y$2)||"secp256k1"!==e.type)throw new Error("'key' must be an ECDSA private key when 'aliasKey' is not provided.");return this.setAlias(e.publicKey.toEvmAddress()),this}setKeyWithAlias(e,t){if(this.setKeyWithoutAlias(e),!(t instanceof y$2)||"secp256k1"!==t.type)throw new Error("'aliasKey' must be an ECDSA private key when provided.");return this.setAlias(t.publicKey.toEvmAddress()),this}setKeyWithoutAlias(e){return this._requireNotFrozen(),this._key=e,this}get initialBalance(){return this._initialBalance}setInitialBalance(e){return this._requireNotFrozen(),this._initialBalance=e instanceof e$7?e:new e$7(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 s$5?e:new s$5(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="number"==typeof e?Long.fromNumber(e):e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId="string"==typeof e?f.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=Long.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("string"==typeof e){if(!(e.startsWith("0x")&&42==e.length||40==e.length))throw new Error('evmAddress must be a valid EVM address with or without "0x" prefix');this._alias=o$a.fromString(e)}else this._alias=e;return this}_validateChecksums(e){null!=this._proxyAccountId&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.createAccount(t)}_getTransactionDataCase(){return"cryptoCreateAccount"}_makeTransactionData(){let e=null;return null!=this._alias&&(e=this._alias.toBytes()),{key:null!=this._key?this._key._toProtobufKey():null,initialBalance:null!=this._initialBalance?this._initialBalance.toTinybars():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),proxyAccountID:null!=this._proxyAccountId?this._proxyAccountId._toProtobuf():null,receiveRecordThreshold:this._receiveRecordThreshold.toTinybars(),sendRecordThreshold:this._sendRecordThreshold.toTinybars(),receiverSigRequired:this._receiverSignatureRequired,memo:this._accountMemo,maxAutomaticTokenAssociations:null!=this._maxAutomaticTokenAssociations?this._maxAutomaticTokenAssociations.toInt():null,stakedAccountId:null!=this.stakedAccountId?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards,alias:e}}_getLogId(){return`AccountCreateTransaction:${this._transactionIds.current.validStart.toString()}`}}w$1.set("cryptoCreateAccount",l._fromProtobuf);let r$3=class e{constructor(e){this._ledgerId=e,Object.freeze(this)}static fromString(t){switch(t){case n$3[0]:case"0":return e.MAINNET;case n$3[1]:case"1":return e.TESTNET;case n$3[2]:case"2":return e.PREVIEWNET;case n$3[3]:case"3":return e.LOCAL_NODE;default:{let n=r$a(t);if(0==n.length&&0!=t.length)throw new Error("Default reached for fromString");return new e(n)}}}toString(){if(1!=this._ledgerId.length)return n$e(this._ledgerId);switch(this._ledgerId[0]){case 0:return n$3[0];case 1:return n$3[1];case 2:return n$3[2];case 3:return n$3[3];default:return n$e(this._ledgerId)}}static fromBytes(t){return new e(t)}toBytes(){return this._ledgerId}isMainnet(){return this.toString()==n$3[0]}isTestnet(){return this.toString()==n$3[1]}isPreviewnet(){return this.toString()==n$3[2]}isLocalNode(){return this.toString()==n$3[3]}};const n$3=["mainnet","testnet","previewnet","local-node"];r$3.MAINNET=new r$3(new Uint8Array([0])),r$3.TESTNET=new r$3(new Uint8Array([1])),r$3.PREVIEWNET=new r$3(new Uint8Array([2])),r$3.LOCAL_NODE=new r$3(new Uint8Array([3]));let s$4=class e extends S{constructor(e={}){super(),this._accountId=null,this._key=null,this._receiverSignatureRequired=null,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,null!=e.accountId&&this.setAccountId(e.accountId),null!=e.key&&this.setKey(e.key),null!=e.receiverSignatureRequired&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),null!=e.proxyAccountId&&this.setProxyAccountId(e.proxyAccountId),null!=e.autoRenewPeriod&&this.setAutoRenewPeriod(e.autoRenewPeriod),null!=e.expirationTime&&this.setExpirationTime(e.expirationTime),null!=e.accountMemo&&this.setAccountMemo(e.accountMemo),null!=e.maxAutomaticTokenAssociations&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),null!=e.stakedAccountId&&this.setStakedAccountId(e.stakedAccountId),null!=e.stakedNodeId&&this.setStakedNodeId(e.stakedNodeId),null!=e.declineStakingReward&&this.setDeclineStakingReward(e.declineStakingReward)}static _fromProtobuf(t,n,o,r,i){const a=i[0].cryptoUpdateAccount;return S._fromProtobufTransactions(new e({accountId:null!=a.accountIDToUpdate?f._fromProtobuf(a.accountIDToUpdate):void 0,key:null!=a.key?t$i._fromProtobufKey(a.key):void 0,receiverSignatureRequired:null!=a.receiverSigRequiredWrapper&&Object.hasOwn(a.receiverSigRequiredWrapper,"value")?a.receiverSigRequiredWrapper.value:void 0,proxyAccountId:null!=a.proxyAccountID?f._fromProtobuf(a.proxyAccountID):void 0,autoRenewPeriod:null!=a.autoRenewPeriod&&null!=a.autoRenewPeriod.seconds?a.autoRenewPeriod.seconds:void 0,expirationTime:null!=a.expirationTime?s$8._fromProtobuf(a.expirationTime):void 0,accountMemo:null!=a.memo&&Object.hasOwn(a.memo,"value")?a.memo.value:void 0,maxAutomaticTokenAssociations:null!=a.maxAutomaticTokenAssociations&&null!=a.maxAutomaticTokenAssociations.value&&Object.hasOwn(a.maxAutomaticTokenAssociations,"value")?Long.fromNumber(a.maxAutomaticTokenAssociations.value):void 0,stakedAccountId:null!=a.stakedAccountId?f._fromProtobuf(a.stakedAccountId):void 0,stakedNodeId:null!=a.stakedNodeId?a.stakedNodeId:void 0,declineStakingReward:null!=a.declineReward&&Object.hasOwn(a.declineReward,"value")?a.declineReward.value:void 0}),t,n,o,r,i)}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId="string"==typeof e?f.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 s$5?e:new s$5(e),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof Date?s$8.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="number"==typeof e?Long.fromNumber(e):e,this}get aliasKey(){return null}setAliasKey(e){return this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId="string"==typeof e?f.fromString(e):e,this}clearStakedAccountId(){return this._requireNotFrozen(),this._stakedAccountId=new f(0,0,0),this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=Long.fromValue(e),this}clearStakedNodeId(){return this._requireNotFrozen(),this._stakedNodeId=Long.fromNumber(-1),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}_validateChecksums(e){null!=this._accountId&&this._accountId.validateChecksum(e),null!=this._proxyAccountId&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.updateAccount(t)}_getTransactionDataCase(){return"cryptoUpdateAccount"}_makeTransactionData(){return{accountIDToUpdate:null!=this._accountId?this._accountId._toProtobuf():null,key:null!=this._key?this._key._toProtobufKey():null,expirationTime:null!=this._expirationTime?this._expirationTime._toProtobuf():null,proxyAccountID:null!=this._proxyAccountId?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:null!=this._autoRenewPeriod?this._autoRenewPeriod._toProtobuf():null,receiverSigRequiredWrapper:null==this._receiverSignatureRequired?null:{value:this._receiverSignatureRequired},memo:null!=this._accountMemo?{value:this._accountMemo}:null,maxAutomaticTokenAssociations:null!=this._maxAutomaticTokenAssociations?{value:this._maxAutomaticTokenAssociations.toInt()}:null,stakedAccountId:null!=this.stakedAccountId?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:null!=this.declineStakingRewards?{value:this.declineStakingRewards}:null}}_getLogId(){return`AccountUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};w$1.set("cryptoUpdateAccount",s$4._fromProtobuf);let t$5=class{constructor(e={}){this._left=null,null!=e.left&&this.setLeft(e.left),this._right=null,null!=e.right&&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 null!=this._left&&null!=this._right?`${this._left.toString()}.${this._right.toString()}`:""}},s$3=class e{constructor(e={}){this._network=null,null!=e.network&&this.setNetwork(e.network),this._host=null,null!=e.host&&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(t){return new e({network:(new t$5).setLeft(t[0]).setRight(t[1]),host:(new t$5).setLeft(t[2]).setRight(t[3])})}_toProtobuf(){return Uint8Array.of(null!=this._network&&null!=this._network._left?this._network._left:0,null!=this._network&&null!=this._network.right?this._network.right:0,null!=this._host&&null!=this._host.left?this._host.left:0,null!=this._host&&null!=this._host.right?this._host.right:0)}toString(){return null!=this._network&&null!=this._host?`${this._network.toString()}.${this._host.toString()}`:""}},s$2=class e{constructor(e={}){this._address=null,null!=e.address&&this.setAddress(e.address),this._port=null,null!=e.port&&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(t){return new e({address:null!=t.ipAddressV4?s$3._fromProtobuf(t.ipAddressV4):void 0,port:null!=t.port?t.port:void 0})}_toProtobuf(){return{ipAddressV4:null!=this._address?this._address._toProtobuf():null,port:this._port}}toString(){return`${null!=this._address?this._address.toString():""}:${null!=this._port?this._port.toString():""}`}toJSON(){return{address:null!=this._address?this._address.toString():null,port:null!=this._port?this._port.toString():null}}},i$4=class e{constructor(e={}){this._publicKey=null,null!=e.publicKey&&this.setPublicKey(e.publicKey),this._nodeId=null,null!=e.nodeId&&this.setNodeId(e.nodeId),this._accountId=null,null!=e.accountId&&this.setAccountId(e.accountId),this._certHash=null,null!=e.certHash&&this.setCertHash(e.certHash),this._addresses=[],null!=e.addresses&&this.setAddresses(e.addresses),this._description=null,null!=e.description&&this.setDescription(e.description),this._stake=null,null!=e.stake&&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="string"==typeof e?f.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(t){return new e({publicKey:null!=t.RSA_PubKey?t.RSA_PubKey:void 0,nodeId:null!=t.nodeId?t.nodeId:void 0,accountId:null!=t.nodeAccountId?f._fromProtobuf(t.nodeAccountId):void 0,certHash:null!=t.nodeCertHash?t.nodeCertHash:void 0,addresses:null!=t.serviceEndpoint?t.serviceEndpoint.map((e=>s$2._fromProtobuf(e))):void 0,description:null!=t.description?t.description:void 0,stake:null!=t.stake?t.stake:void 0})}_toProtobuf(){return{RSA_PubKey:this._publicKey,nodeId:this._nodeId,nodeAccountId:null!=this._accountId?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:null!=this._nodeId?this._nodeId.toString():null,accountId:null!=this._accountId?this._accountId.toString():null,certHash:null!=this._certHash?e$3(this._certHash):null,addresses:this._addresses.map((e=>e.toJSON())),description:this._description,stake:null!=this._stake?this._stake.toString():null}}},o$3=class e{constructor(e={}){this._nodeAddresses=[],null!=e.nodeAddresses&&this.setNodeAddresses(e.nodeAddresses)}get nodeAddresses(){return this._nodeAddresses}setNodeAddresses(e){return this._nodeAddresses=e,this}static fromBytes(t){return e._fromProtobuf(libExports$1.proto.NodeAddressBook.decode(t))}static _fromProtobuf(t){return new e({nodeAddresses:null!=t.nodeAddress?t.nodeAddress.map((e=>i$4._fromProtobuf(e))):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 libExports$1.proto.NodeAddressBook.encode(this._toProtobuf()).finish()}},m$1=class e extends S{constructor(e={}){super(),this._defaultMaxTransactionFee=new e$7(25),this._adminKey=null,this._submitKey=null,this._feeScheduleKey=null,this._feeExemptKeys=[],this._autoRenewAccountId=null,this._autoRenewPeriod=new s$5(y),this._customFees=[],this._topicMemo=null,null!=e.adminKey&&this.setAdminKey(e.adminKey),null!=e.submitKey&&this.setSubmitKey(e.submitKey),null!=e.feeScheduleKey&&this.setFeeScheduleKey(e.feeScheduleKey),null!=e.feeExemptKeys&&this.setFeeExemptKeys(e.feeExemptKeys),null!=e.autoRenewAccountId&&this.setAutoRenewAccountId(e.autoRenewAccountId),null!=e.autoRenewPeriod&&this.setAutoRenewPeriod(e.autoRenewPeriod),null!=e.customFees&&this.setCustomFees(e.customFees),null!=e.topicMemo&&this.setTopicMemo(e.topicMemo)}static _fromProtobuf(t,n,o,r,i){const a=i[0].consensusCreateTopic;return S._fromProtobufTransactions(new e({adminKey:null!=a.adminKey?t$i._fromProtobufKey(a.adminKey):void 0,submitKey:null!=a.submitKey?t$i._fromProtobufKey(a.submitKey):void 0,feeScheduleKey:null!=a.feeScheduleKey?t$i._fromProtobufKey(a.feeScheduleKey):void 0,feeExemptKeys:null!=a.feeExemptKeyList?a.feeExemptKeyList.map((e=>t$i._fromProtobufKey(e))):void 0,autoRenewAccountId:null!=a.autoRenewAccount?f._fromProtobuf(a.autoRenewAccount):void 0,autoRenewPeriod:null!=a.autoRenewPeriod&&null!=a.autoRenewPeriod.seconds?a.autoRenewPeriod.seconds:void 0,customFees:null!=a.customFees?a.customFees.map((e=>l$1._fromProtobuf(e))):void 0,topicMemo:null!=a.memo?a.memo:void 0}),t,n,o,r,i)}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}getFeeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}getFeeExemptKeys(){return this._feeExemptKeys}setFeeExemptKeys(e){return this._requireNotFrozen(),this._feeExemptKeys=e,this}addFeeExemptKey(e){return this._requireNotFrozen(),this._feeExemptKeys.push(e),this}clearFeeExemptKeys(){return this._requireNotFrozen(),this._feeExemptKeys=[],this}get autoRenewAccountId(){return this._autoRenewAccountId}getAutoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof f?e:f.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}getAutoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof s$5?e:new s$5(e),this}getCustomFees(){return this._customFees}setCustomFees(e){return this._requireNotFrozen(),this._customFees=e,this}addCustomFee(e){return this._requireNotFrozen(),this._customFees.push(e),this}clearCustomFees(){return this._requireNotFrozen(),this._customFees=[],this}_validateChecksums(e){null!=this._autoRenewAccountId&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.consensus.createTopic(t)}_getTransactionDataCase(){return"consensusCreateTopic"}_makeTransactionData(){return{adminKey:null!=this._adminKey?this._adminKey._toProtobufKey():null,submitKey:null!=this._submitKey?this._submitKey._toProtobufKey():null,feeScheduleKey:null!=this._feeScheduleKey?this._feeScheduleKey._toProtobufKey():null,feeExemptKeyList:this._feeExemptKeys.map((e=>e._toProtobufKey())),autoRenewAccount:null!=this._autoRenewAccountId?this._autoRenewAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),customFees:this._customFees.map((e=>e._toTopicFeeProtobuf())),memo:this._topicMemo}}_getLogId(){return`TopicCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};w$1.set("consensusCreateTopic",m$1._fromProtobuf);class u extends S{constructor(e={}){super(),this._topicId=null,null!=e.topicId&&this.setTopicId(e.topicId),this._message=null,null!=e.message&&this.setMessage(e.message),this._maxChunks=20,this._chunkSize=b$2,null!=e.maxChunks&&this.setMaxChunks(e.maxChunks),null!=e.chunkSize&&this.setChunkSize(e.chunkSize),this._chunkInfo=null}static _fromProtobuf(e,t,n,o,r){const i=r[0].consensusSubmitMessage;return S._fromProtobufTransactions(new u({topicId:null!=i.topicID?m$2._fromProtobuf(i.topicID):void 0,message:null!=i.message?i.message:void 0}),e,t,n,o,r)}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId="string"==typeof e?m$2.fromString(e):e.clone(),this}get message(){return this._message}getMessage(){return this._message}setMessage(e){return this._requireNotFrozen(),e=p(e),this._message=e instanceof Uint8Array?e:n$8(e),this}getCustomFeeLimits(){return this._customFeeLimits}setCustomFeeLimits(e){return this._requireNotFrozen(),this._customFeeLimits=e,this}addCustomFeeLimit(e){return this._requireNotFrozen(),this._customFeeLimits.push(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),null==this._message)return this;const 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`);const n=this._getTransactionId()._toProtobuf();let o=this._getTransactionId();this._transactionIds.locked=!1,this._transactions.clear(),this._transactionIds.clear(),this._signedTransactions.clear();for(let r=0;r<t;r++){this._chunkInfo={initialTransactionID:n,total:t,number:r+1},this._transactionIds.push(o),this._transactionIds.advance();for(const e of this._nodeAccountIds.list)this._signedTransactions.push(this._makeSignedTransaction(e));o=new i$6(o.accountId,new s$8(o.validStart.seconds,o.validStart.nanos.add(1)))}return this._transactionIds.advance(),this._chunkInfo=null,this}schedule(){if(this._requireNotFrozen(),null!=this._message&&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);const n=this._getTransactionId(),o=e.operatorAccountId;null!=o&&o.equals(n.accountId)&&await super.signWithOperator(e);const r=[];let i=t;for(let a=0;a<this._transactionIds.length;a++){const t=Date.now();r.push(await super.execute(e,i)),null!=i&&(i=Date.now()-t)}return r}_execute(e,t){return e.consensus.submitMessage(t)}_getTransactionDataCase(){return"consensusSubmitMessage"}_makeTransactionData(){if(null!=this._chunkInfo&&null!=this._message){const e=(this._chunkInfo.number-1)*this._chunkSize;let t=e+this._chunkSize;return t>this._message.length&&(t=this._message.length),{topicID:null!=this._topicId?this._topicId._toProtobuf():null,message:this._message.slice(e,t),chunkInfo:this._chunkInfo}}return{topicID:null!=this._topicId?this._topicId._toProtobuf():null,message:this._message}}_getLogId(){return`TopicMessageSubmitTransaction:${this._transactionIds.current.validStart.toString()}`}}w$1.set("consensusSubmitMessage",u._fromProtobuf);var browser$1={exports:{}},quickFormatUnescaped,hasRequiredQuickFormatUnescaped,hasRequiredBrowser$1;function requireQuickFormatUnescaped(){if(hasRequiredQuickFormatUnescaped)return quickFormatUnescaped;function e(e){try{return JSON.stringify(e)}catch(t){return'"[Circular]"'}}return hasRequiredQuickFormatUnescaped=1,quickFormatUnescaped=function(t,n,o){var r=o&&o.stringify||e;if("object"==typeof t&&null!==t){var i=n.length+1;if(1===i)return t;var a=new Array(i);a[0]=r(t);for(var s=1;s<i;s++)a[s]=r(n[s]);return a.join(" ")}if("string"!=typeof t)return t;var c=n.length;if(0===c)return t;for(var l="",u=0,d=-1,p=t&&t.length||0,f=0;f<p;){if(37===t.charCodeAt(f)&&f+1<p){switch(d=d>-1?d:0,t.charCodeAt(f+1)){case 100:case 102:if(u>=c)break;if(null==n[u])break;d<f&&(l+=t.slice(d,f)),l+=Number(n[u]),d=f+2,f++;break;case 105:if(u>=c)break;if(null==n[u])break;d<f&&(l+=t.slice(d,f)),l+=Math.floor(Number(n[u])),d=f+2,f++;break;case 79:case 111:case 106:if(u>=c)break;if(void 0===n[u])break;d<f&&(l+=t.slice(d,f));var h=typeof n[u];if("string"===h){l+="'"+n[u]+"'",d=f+2,f++;break}if("function"===h){l+=n[u].name||"<anonymous>",d=f+2,f++;break}l+=r(n[u]),d=f+2,f++;break;case 115:if(u>=c)break;d<f&&(l+=t.slice(d,f)),l+=String(n[u]),d=f+2,f++;break;case 37:d<f&&(l+=t.slice(d,f)),l+="%",d=f+2,f++,u--}++u}++f}if(-1===d)return t;d<p&&(l+=t.slice(d));return l}}function requireBrowser$1(){if(hasRequiredBrowser$1)return browser$1.exports;hasRequiredBrowser$1=1;const e=requireQuickFormatUnescaped();browser$1.exports=c;const t=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},n={mapHttpRequest:h,mapHttpResponse:h,wrapRequestSerializer:m,wrapResponseSerializer:m,wrapErrorSerializer:m,req:h,res:h,err:p,errWithCause:p};function o(e,t){return"silent"===e?1/0:t.levels.values[e]}const r=Symbol("pino.logFuncs"),i=Symbol("pino.hierarchy"),a={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function s(e,t){const n={logger:t,parent:e[i]};t[i]=n}function c(e){(e=e||{}).browser=e.browser||{};const n=e.browser.transmit;if(n&&"function"!=typeof n.send)throw Error("pino: transmit option must have a send function");const i=e.browser.write||t;e.browser.write&&(e.browser.asObject=!0);const p=e.serializers||{},h=function(e,t){if(Array.isArray(e))return e.filter((function(e){return"!stdSerializers.err"!==e}));return!0===e&&Object.keys(t)}(e.browser.serialize,p);let m=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(m=!1);const g=Object.keys(e.customLevels||{}),b=["error","fatal","warn","info","debug","trace"].concat(g);"function"==typeof i&&b.forEach((function(e){i[e]=i})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const k=e.level||"info",w=Object.create(i);w.log||(w.log=y),function(e,n,o){const i={};n.forEach((e=>{i[e]=o[e]?o[e]:t[e]||t[a[e]||"log"]||y})),e[r]=i}(w,b,i),s({},w),Object.defineProperty(w,"levelVal",{get:function(){return o(this.level,this)}}),Object.defineProperty(w,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,l(this,v,w,"error"),l(this,v,w,"fatal"),l(this,v,w,"warn"),l(this,v,w,"info"),l(this,v,w,"debug"),l(this,v,w,"trace"),g.forEach((e=>{l(this,v,w,e)}))}});const v={transmit:n,serialize:h,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:b,timestamp:f(e),messageKey:e.messageKey||"msg",onChild:e.onChild||y};function T(t,o,r){if(!o)throw new Error("missing bindings for child Pino");r=r||{},h&&o.serializers&&(r.serializers=o.serializers);const i=r.serializers;if(h&&i){var a=Object.assign({},p,i),c=!0===e.browser.serialize?Object.keys(a):h;delete o.serializers,u([o],c,a,this._stdErrSerialize)}function l(e){this._childLevel=1+(0|e._childLevel),this.bindings=o,a&&(this.serializers=a,this._serialize=c),n&&(this._logEvent=d([].concat(e._logEvent.bindings,o)))}l.prototype=this;const f=new l(this);return s(this,f),f.child=function(...e){return T.call(this,t,...e)},f.level=r.level||this.level,t.onChild(f),f}return w.levels=function(e){const t=e.customLevels||{},n=Object.assign({},c.levels.values,t),o=Object.assign({},c.levels.labels,function(e){const t={};return Object.keys(e).forEach((function(n){t[e[n]]=n})),t}(t));return{values:n,labels:o}}(e),w.level=k,w.setMaxListeners=w.getMaxListeners=w.emit=w.addListener=w.on=w.prependListener=w.once=w.prependOnceListener=w.removeListener=w.removeAllListeners=w.listeners=w.listenerCount=w.eventNames=w.write=w.flush=y,w.serializers=p,w._serialize=h,w._stdErrSerialize=m,w.child=function(...e){return T.call(this,v,...e)},n&&(w._logEvent=d()),w}function l(n,a,s,c){if(Object.defineProperty(n,c,{value:o(n.level,s)>o(c,s)?y:s[r][c],writable:!0,enumerable:!0,configurable:!0}),n[c]===y){if(!a.transmit)return;const e=o(a.transmit.level||n.level,s);if(o(c,s)<e)return}n[c]=function(n,i,a,s){return function(r){return function(){const c=i.timestamp(),l=new Array(arguments.length),p=Object.getPrototypeOf&&Object.getPrototypeOf(this)===t?t:this;for(var f=0;f<l.length;f++)l[f]=arguments[f];var h=!1;if(i.serialize&&(u(l,this._serialize,this.serializers,this._stdErrSerialize),h=!0),i.asObject||i.formatters?r.call(p,function(t,n,o,r,i){const{level:a,log:s=e=>e}=i.formatters||{},c=o.slice();let l=c[0];const u={};r&&(u.time=r);if(a){const e=a(n,t.levels.values[n]);Object.assign(u,e)}else u.level=t.levels.values[n];let d=1+(0|t._childLevel);d<1&&(d=1);if(null!==l&&"object"==typeof l){for(;d--&&"object"==typeof c[0];)Object.assign(u,c.shift());l=c.length?e(c.shift(),c):void 0}else"string"==typeof l&&(l=e(c.shift(),c));void 0!==l&&(u[i.messageKey]=l);return s(u)}(this,s,l,c,i)):r.apply(p,l),i.transmit){const e=o(i.transmit.level||n._level,a),t=o(s,a);if(t<e)return;!function(e,t,n,o=!1){const r=t.send,i=t.ts,a=t.methodLevel,s=t.methodValue,c=t.val,l=e._logEvent.bindings;o||u(n,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize);e._logEvent.ts=i,e._logEvent.messages=n.filter((function(e){return-1===l.indexOf(e)})),e._logEvent.level.label=a,e._logEvent.level.value=s,r(a,e._logEvent,c),e._logEvent=d(l)}(this,{ts:c,methodLevel:s,methodValue:t,transmitValue:a.levels.values[i.transmit.level||n._level],send:i.transmit.send,val:o(n._level,a)},l,h)}}}(n[r][s])}(n,a,s,c);const l=function(e){const t=[];e.bindings&&t.push(e.bindings);let n=e[i];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}(n);0!==l.length&&(n[c]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(l,n[c]))}function u(e,t,n,o){for(const r in e)if(o&&e[r]instanceof Error)e[r]=c.stdSerializers.err(e[r]);else if("object"==typeof e[r]&&!Array.isArray(e[r])&&t)for(const o in e[r])t.indexOf(o)>-1&&o in n&&(e[r][o]=n[o](e[r][o]))}function d(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function p(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)void 0===t[n]&&(t[n]=e[n]);return t}function f(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?g:b}function h(){return{}}function m(e){return e}function y(){}function g(){return!1}function b(){return Date.now()}return c.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},c.stdSerializers=n,c.stdTimeFunctions=Object.assign({},{nullTime:g,epochTime:b,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),browser$1.exports.default=c,browser$1.exports.pino=c,browser$1.exports}requireBrowser$1();const d$1=o$3._fromProtobuf(libExports$1.proto.NodeAddressBook.decode(r$a("0ad0070a0e33352e3233312e3230382e31343810a388031a05302e302e3322cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303039663166386131323163326664366337366664353038643365343239663063363462636234346338326137303537333535326161646361643037313536396537323139353866356135643039663935383766666166636662653533343161326630313134616361653334366566336339303231336433343336656262323766343335306339393063356338633366386531653336373037626330386434323536303832336533663234653039613033616430393535613530393830313936323964643034623237623235316463653035356633646463623061343164363666303934316230623837636466653334393864343630333861623564663036663632613561646530383539383537336138386338663538363064633134393261366531383634383561396231333235306536643137623830636433396335633831393130396537336361373332646232336566386261613737366563383563653030393162656362326564656662616135656433653564626662643166383835613466613838316166336631343461386135363538353335333364383933393335393230383662326431643336326534356266653166623435363833616261366336343039373961643662343638373731383437323663366562643538623265616538356337636665336662616265663566366363656438353030333462333834373230366332643637386333363138373630323662386433353165303032616635653066666536663562316632393566646332663436396361613264323338316561306234386361393837636332633865363335653862313963653565313732613933373631613864343930613961343531386437323535383830613134643737623762613737343839326239326134306262383133363265333466633664353137386439623330313132393334323035636237376662396132383234323733393435363461383535346561343732383661343766383632333965373563393437383963653938633939383434373832343632393434663631333136376437623530323033303130303031320218033a606666643661646137346133613334613930346265613437363033303836663862656633623662653138616265643434633464343065313266623133306239376264366238353561656335643062393062306238633733353464356633623065340acf070a0d332e3231312e3234382e31373210a388031a05302e302e3322cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303039663166386131323163326664366337366664353038643365343239663063363462636234346338326137303537333535326161646361643037313536396537323139353866356135643039663935383766666166636662653533343161326630313134616361653334366566336339303231336433343336656262323766343335306339393063356338633366386531653336373037626330386434323536303832336533663234653039613033616430393535613530393830313936323964643034623237623235316463653035356633646463623061343164363666303934316230623837636466653334393864343630333861623564663036663632613561646530383539383537336138386338663538363064633134393261366531383634383561396231333235306536643137623830636433396335633831393130396537336361373332646232336566386261613737366563383563653030393162656362326564656662616135656433653564626662643166383835613466613838316166336631343461386135363538353335333364383933393335393230383662326431643336326534356266653166623435363833616261366336343039373961643662343638373731383437323663366562643538623265616538356337636665336662616265663566366363656438353030333462333834373230366332643637386333363138373630323662386433353165303032616635653066666536663562316632393566646332663436396361613264323338316561306234386361393837636332633865363335653862313963653565313732613933373631613864343930613961343531386437323535383830613134643737623762613737343839326239326134306262383133363265333466633664353137386439623330313132393334323035636237376662396132383234323733393435363461383535346561343732383661343766383632333965373563393437383963653938633939383434373832343632393434663631333136376437623530323033303130303031320218033a606666643661646137346133613334613930346265613437363033303836663862656633623662653138616265643434633464343065313266623133306239376264366238353561656335643062393062306238633733353464356633623065340ace070a0c34302e3132312e36342e343810a388031a05302e302e3322cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303039663166386131323163326664366337366664353038643365343239663063363462636234346338326137303537333535326161646361643037313536396537323139353866356135643039663935383766666166636662653533343161326630313134616361653334366566336339303231336433343336656262323766343335306339393063356338633366386531653336373037626330386434323536303832336533663234653039613033616430393535613530393830313936323964643034623237623235316463653035356633646463623061343164363666303934316230623837636466653334393864343630333861623564663036663632613561646530383539383537336138386338663538363064633134393261366531383634383561396231333235306536643137623830636433396335633831393130396537336361373332646232336566386261613737366563383563653030393162656362326564656662616135656433653564626662643166383835613466613838316166336631343461386135363538353335333364383933393335393230383662326431643336326534356266653166623435363833616261366336343039373961643662343638373731383437323663366562643538623265616538356337636665336662616265663566366363656438353030333462333834373230366332643637386333363138373630323662386433353165303032616635653066666536663562316632393566646332663436396361613264323338316561306234386361393837636332633865363335653862313963653565313732613933373631613864343930613961343531386437323535383830613134643737623762613737343839326239326134306262383133363265333466633664353137386439623330313132393334323035636237376662396132383234323733393435363461383535346561343732383661343766383632333965373563393437383963653938633939383434373832343632393434663631333136376437623530323033303130303031320218033a606666643661646137346133613334613930346265613437363033303836663862656633623662653138616265643434633464343065313266623133306239376264366238353561656335643062393062306238633733353464356633623065340ad1070a0d33352e3139392e31352e31373710a388031a05302e302e3422cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633535376166353739666138333530316265383939623238393037373635626664666364353261623433326230313935613166316563643836666330306162366335353039623066646439376564643363623563656135366132393566333132616262353530383331646266393633663435303131386234666363366532326366343637363230306365396363386564666262663535386463363966303234323634616437643364616232336265643231333363323734653639333434383931353564623130383766393033373039303563363431383561363231316463373432666239613639303964383231383639343762323737343633646662336666306163643437656666313265616431663639373265663263313230333739336334356537373537356265346661313130633765343066613864623963363138376431313366343730343031343137393037316162663539626537643262306465383264653432313564633235353036623163396332366534393137343031633939373530366533373765366266303362363838373237653739343066616436396335653064613363643563626432626537373733353061656132643064343765393761343438633834626536636531333464363462656530393835633239313632663463316535363763636139336430366133633162653861626365333562353537666237376634666536373161363664656337393037353664306538383138313635663262616361613839316161653761633734333766633731373562366562366465623734373233373837353162623662663962306531343833663936363865396664626435363034633339623134643965326265646565633834366139383064373034643137316537626134623766636431613330643934356361313266343761333235643933393861613138663937303636303534643464313566633839393465326465626537336539323731643534383638336636316561343466623235303731653335313861373865643365623337653731613036393166323637303230333031303030312801320218043a606630643934616363663664666633373238373463396462643864373939326562333137616635303031636134313936616261323635383039636233643230306261393631613534333863336135656430356338336264663963643131356432320ad1070a0d332e3133332e3231332e31343610a388031a05302e302e3422cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633535376166353739666138333530316265383939623238393037373635626664666364353261623433326230313935613166316563643836666330306162366335353039623066646439376564643363623563656135366132393566333132616262353530383331646266393633663435303131386234666363366532326366343637363230306365396363386564666262663535386463363966303234323634616437643364616232336265643231333363323734653639333434383931353564623130383766393033373039303563363431383561363231316463373432666239613639303964383231383639343762323737343633646662336666306163643437656666313265616431663639373265663263313230333739336334356537373537356265346661313130633765343066613864623963363138376431313366343730343031343137393037316162663539626537643262306465383264653432313564633235353036623163396332366534393137343031633939373530366533373765366266303362363838373237653739343066616436396335653064613363643563626432626537373733353061656132643064343765393761343438633834626536636531333464363462656530393835633239313632663463316535363763636139336430366133633162653861626365333562353537666237376634666536373161363664656337393037353664306538383138313635663262616361613839316161653761633734333766633731373562366562366465623734373233373837353162623662663962306531343833663936363865396664626435363034633339623134643965326265646565633834366139383064373034643137316537626134623766636431613330643934356361313266343761333235643933393861613138663937303636303534643464313566633839393465326465626537336539323731643534383638336636316561343466623235303731653335313861373865643365623337653731613036393166323637303230333031303030312801320218043a606630643934616363663664666633373238373463396462643864373939326562333137616635303031636134313936616261323635383039636233643230306261393631613534333863336135656430356338336264663963643131356432320ad0070a0c34302e37302e31312e32303210a388031a05302e302e3422cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633535376166353739666138333530316265383939623238393037373635626664666364353261623433326230313935613166316563643836666330306162366335353039623066646439376564643363623563656135366132393566333132616262353530383331646266393633663435303131386234666363366532326366343637363230306365396363386564666262663535386463363966303234323634616437643364616232336265643231333363323734653639333434383931353564623130383766393033373039303563363431383561363231316463373432666239613639303964383231383639343762323737343633646662336666306163643437656666313265616431663639373265663263313230333739336334356537373537356265346661313130633765343066613864623963363138376431313366343730343031343137393037316162663539626537643262306465383264653432313564633235353036623163396332366534393137343031633939373530366533373765366266303362363838373237653739343066616436396335653064613363643563626432626537373733353061656132643064343765393761343438633834626536636531333464363462656530393835633239313632663463316535363763636139336430366133633162653861626365333562353537666237376634666536373161363664656337393037353664306538383138313635663262616361613839316161653761633734333766633731373562366562366465623734373233373837353162623662663962306531343833663936363865396664626435363034633339623134643965326265646565633834366139383064373034643137316537626134623766636431613330643934356361313266343761333235643933393861613138663937303636303534643464313566633839393465326465626537336539323731643534383638336636316561343466623235303731653335313861373865643365623337653731613036393166323637303230333031303030312801320218043a606630643934616363663664666633373238373463396462643864373939326562333137616635303031636134313936616261323635383039636233643230306261393631613534333863336135656430356338336264663963643131356432320ad2070a0e33352e3232352e3230312e31393510a388031a05302e302e3522cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030396261343537623733333035663034613931636334366231623936356334653834313735316162633862313431356130626164666431663332633234383233383661323237323565623765633734646561323165353036313764363438656135616333393337343161623031623865666233323132333962386434666462316466626562396533663339616134363538306464303435643138636134346430303263333764646235323763636534646463333262666337333431393637316634636134343634613366326138346663383563373161636630653561383936323664663639613831343734656431363532396638303161386166613937653433356334653034613936346133353735323732383838343365353866306130356366353135336565343530376232633638623364376662353461653661393561393539633837613132663633306539356337623162336333363935653835383636323431373932366437366331363938336661663631323235303338373435393037653963663133643637633261636435303363613435316338353933336163343131386163633237393830316362393638333439393033313435636564323736323964643038393136333137303933353837613737633232303563666135323534336235336333623665613135623834653364326333306331656437353261343633336333366232356239383933656130326164353632656239623738363862336234663437663461323565333536303634393632616337623235653538323934346630306433303739386132363266393231346438633565373464306138333736636332643662613634653138663565346134306166616336323530363264326361323363643238303037303833323164333833343331346630653538343438353932333236373361333265373061653064373131653331303538316263646231346538373133343639346336653039333066343662333762393664343961363435373339343733333165376535303764396535366465356536313436663266303230333031303030312802320218053a606361363738656263626433646338363438663765643033666235396630653231616636373531336561656535313331386536623534396265356163653930366564633166666132366439336135376163656339626537376634306561656564370ad1070a0d35322e31352e3130352e31333010a388031a05302e302e3522cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030396261343537623733333035663034613931636334366231623936356334653834313735316162633862313431356130626164666431663332633234383233383661323237323565623765633734646561323165353036313764363438656135616333393337343161623031623865666233323132333962386434666462316466626562396533663339616134363538306464303435643138636134346430303263333764646235323763636534646463333262666337333431393637316634636134343634613366326138346663383563373161636630653561383936323664663639613831343734656431363532396638303161386166613937653433356334653034613936346133353735323732383838343365353866306130356366353135336565343530376232633638623364376662353461653661393561393539633837613132663633306539356337623162336333363935653835383636323431373932366437366331363938336661663631323235303338373435393037653963663133643637633261636435303363613435316338353933336163343131386163633237393830316362393638333439393033313435636564323736323964643038393136333137303933353837613737633232303563666135323534336235336333623665613135623834653364326333306331656437353261343633336333366232356239383933656130326164353632656239623738363862336234663437663461323565333536303634393632616337623235653538323934346630306433303739386132363266393231346438633565373464306138333736636332643662613634653138663565346134306166616336323530363264326361323363643238303037303833323164333833343331346630653538343438353932333236373361333265373061653064373131653331303538316263646231346538373133343639346336653039333066343662333762393664343961363435373339343733333165376535303764396535366465356536313436663266303230333031303030312802320218053a606361363738656263626433646338363438663765643033666235396630653231616636373531336561656535313331386536623534396265356163653930366564633166666132366439336135376163656339626537376634306561656564370ad1070a0d3130342e34332e3234382e363310a388031a05302e302e3522cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030396261343537623733333035663034613931636334366231623936356334653834313735316162633862313431356130626164666431663332633234383233383661323237323565623765633734646561323165353036313764363438656135616333393337343161623031623865666233323132333962386434666462316466626562396533663339616134363538306464303435643138636134346430303263333764646235323763636534646463333262666337333431393637316634636134343634613366326138346663383563373161636630653561383936323664663639613831343734656431363532396638303161386166613937653433356334653034613936346133353735323732383838343365353866306130356366353135336565343530376232633638623364376662353461653661393561393539633837613132663633306539356337623162336333363935653835383636323431373932366437366331363938336661663631323235303338373435393037653963663133643637633261636435303363613435316338353933336163343131386163633237393830316362393638333439393033313435636564323736323964643038393136333137303933353837613737633232303563666135323534336235336333623665613135623834653364326333306331656437353261343633336333366232356239383933656130326164353632656239623738363862336234663437663461323565333536303634393632616337623235653538323934346630306433303739386132363266393231346438633565373464306138333736636332643662613634653138663565346134306166616336323530363264326361323363643238303037303833323164333833343331346630653538343438353932333236373361333265373061653064373131653331303538316263646231346538373133343639346336653039333066343662333762393664343961363435373339343733333165376535303764396535366465356536313436663266303230333031303030312802320218053a606361363738656263626433646338363438663765643033666235396630653231616636373531336561656535313331386536623534396265356163653930366564633166666132366439336135376163656339626537376634306561656564370ad2070a0e33352e3234372e3130392e31333510a388031a05302e302e3622cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633432636361633566626336393166626265626461383766666431653735626463643839323234393463663434666462636365653439373838353231633337386266373764623039333465633064323138336437633531646236366638363463313161623764653161633363346366646331663039336132643666333765326233346362653463383133316639363833616434323837386338336433353534633634356161313637626366623036346138336463343563356231313538343939663964393235383766666637616263643566323231636438313530353438343133303030666136653536353930383962316466643635373636656137386561656466636136623435343535666438616235393834646265333565353739356432633633356561373937346434336538656165346665626666653439326537303762343862316230666336343831616539653039643339313333303039623764323634303265366535326535653931623262333830643838663062653766623462333033653730323139373835303537616139346365393234633439323665393136353639323836653836623362613635316361326130613633646634663639303766656665333438336439336234636531643464303363373134323131313337356232633263353164346562383339653337616635333062326362643666353064346362333665323739333731373064396364646163306163653263633234623830346230613237333531636638333062373635323565323664666239646266343961303536363234613736383632343934653732363364306437306365626165393532393433653535383432663563616431336663663630613265366463663761316435333366336135626235346563323139313863373665353235626132393134363637353833316531376533366336316665383534393838323864303962373632303135343132623265353237383439626165633163666663373764653463323934633535303831316535393866663234646131356133343536396464303230333031303030312803320218063a603234373166336665383134303638316665393139313364326363303633663036356534343930616536326666356435343861356162653133316432616639366362653361633235626265323433363663613466386630653736636639343566330acf070a0b35342e3234312e33382e3110a388031a05302e302e3622cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633432636361633566626336393166626265626461383766666431653735626463643839323234393463663434666462636365653439373838353231633337386266373764623039333465633064323138336437633531646236366638363463313161623764653161633363346366646331663039336132643666333765326233346362653463383133316639363833616434323837386338336433353534633634356161313637626366623036346138336463343563356231313538343939663964393235383766666637616263643566323231636438313530353438343133303030666136653536353930383962316466643635373636656137386561656466636136623435343535666438616235393834646265333565353739356432633633356561373937346434336538656165346665626666653439326537303762343862316230666336343831616539653039643339313333303039623764323634303265366535326535653931623262333830643838663062653766623462333033653730323139373835303537616139346365393234633439323665393136353639323836653836623362613635316361326130613633646634663639303766656665333438336439336234636531643464303363373134323131313337356232633263353164346562383339653337616635333062326362643666353064346362333665323739333731373064396364646163306163653263633234623830346230613237333531636638333062373635323565323664666239646266343961303536363234613736383632343934653732363364306437306365626165393532393433653535383432663563616431336663663630613265366463663761316435333366336135626235346563323139313863373665353235626132393134363637353833316531376533366336316665383534393838323864303962373632303135343132623265353237383439626165633163666663373764653463323934633535303831316535393866663234646131356133343536396464303230333031303030312803320218063a603234373166336665383134303638316665393139313364326363303633663036356534343930616536326666356435343861356162653133316432616639366362653361633235626265323433363663613466386630653736636639343566330acf070a0b31332e38382e32322e343710a388031a05302e302e3622cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633432636361633566626336393166626265626461383766666431653735626463643839323234393463663434666462636365653439373838353231633337386266373764623039333465633064323138336437633531646236366638363463313161623764653161633363346366646331663039336132643666333765326233346362653463383133316639363833616434323837386338336433353534633634356161313637626366623036346138336463343563356231313538343939663964393235383766666637616263643566323231636438313530353438343133303030666136653536353930383962316466643635373636656137386561656466636136623435343535666438616235393834646265333565353739356432633633356561373937346434336538656165346665626666653439326537303762343862316230666336343831616539653039643339313333303039623764323634303265366535326535653931623262333830643838663062653766623462333033653730323139373835303537616139346365393234633439323665393136353639323836653836623362613635316361326130613633646634663639303766656665333438336439336234636531643464303363373134323131313337356232633263353164346562383339653337616635333062326362643666353064346362333665323739333731373064396364646163306163653263633234623830346230613237333531636638333062373635323565323664666239646266343961303536363234613736383632343934653732363364306437306365626165393532393433653535383432663563616431336663663630613265366463663761316435333366336135626235346563323139313863373665353235626132393134363637353833316531376533366336316665383534393838323864303962373632303135343132623265353237383439626165633163666663373764653463323934633535303831316535393866663234646131356133343536396464303230333031303030312803320218063a603234373166336665383134303638316665393139313364326363303633663036356534343930616536326666356435343861356162653133316432616639366362653361633235626265323433363663613466386630653736636639343566330ad0070a0c33352e3233352e36352e353110a388031a05302e302e3722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393032663034393061396237663564326364316330643936633661363939306635373362356630656235626462626133393636316566303233303932343139333434363639393639613638613463373037316433323939393066623137393265393030316362353539386561373163326436363736383234333230656534636162663164643335376165376632616462656463316231623061396439353632333737396234633463376234376334373837613136656537313838633732313731373736323461393236346162333963343166376666306234356138396264613430633461643037633464353936643566303964373035366263623561333566343466393561353963323636653039383932646362653436616435316632643262336539393161386636363538653166326362393463373733656234346334346538393264316535356331303736663136303833313965653635376534306631393239363735343361623432616232323233383664313735383665323533373438646162643032356535306235306165363035303732306532333964363465653666623435303763303631346464346265376166646231333330383930666633613665313736353237633331313661663132396139616335653333366439663630316537313237613664376438323061643266393032646163396232343836363861316261623038643130333432656136396137303937313332666637313230636336346663646537383430633635366261313733326261393565396333363735313137356534656333643834613765306432383834326234316262626264366632386534366333613636333365313832373936356335353832306435306461653262303436356363306434326531393562396431353332653632323565623939386436613439303739613861316364346430313735646533633837663937363134383437623363626231376161333462653832306237623361643938616333666165663939336136373738393734373832633063346165336661626263633433303230333031303030312804320218073a606633353738373364343131346131616566303361646336626136396566616632363930653232376162633136613666633665353034396136336662643936383830303462313465343633633230653338343336613361323464333138326464380ad1070a0d35342e3137372e35312e31323710a388031a05302e302e3722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393032663034393061396237663564326364316330643936633661363939306635373362356630656235626462626133393636316566303233303932343139333434363639393639613638613463373037316433323939393066623137393265393030316362353539386561373163326436363736383234333230656534636162663164643335376165376632616462656463316231623061396439353632333737396234633463376234376334373837613136656537313838633732313731373736323461393236346162333963343166376666306234356138396264613430633461643037633464353936643566303964373035366263623561333566343466393561353963323636653039383932646362653436616435316632643262336539393161386636363538653166326362393463373733656234346334346538393264316535356331303736663136303833313965653635376534306631393239363735343361623432616232323233383664313735383665323533373438646162643032356535306235306165363035303732306532333964363465653666623435303763303631346464346265376166646231333330383930666633613665313736353237633331313661663132396139616335653333366439663630316537313237613664376438323061643266393032646163396232343836363861316261623038643130333432656136396137303937313332666637313230636336346663646537383430633635366261313733326261393565396333363735313137356534656333643834613765306432383834326234316262626264366632386534366333613636333365313832373936356335353832306435306461653262303436356363306434326531393562396431353332653632323565623939386436613439303739613861316364346430313735646533633837663937363134383437623363626231376161333462653832306237623361643938616333666165663939336136373738393734373832633063346165336661626263633433303230333031303030312804320218073a606633353738373364343131346131616566303361646336626136396566616632363930653232376162633136613666633665353034396136336662643936383830303462313465343633633230653338343336613361323464333138326464380ad0070a0c31332e36342e3137302e343010a388031a05302e302e3722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393032663034393061396237663564326364316330643936633661363939306635373362356630656235626462626133393636316566303233303932343139333434363639393639613638613463373037316433323939393066623137393265393030316362353539386561373163326436363736383234333230656534636162663164643335376165376632616462656463316231623061396439353632333737396234633463376234376334373837613136656537313838633732313731373736323461393236346162333963343166376666306234356138396264613430633461643037633464353936643566303964373035366263623561333566343466393561353963323636653039383932646362653436616435316632643262336539393161386636363538653166326362393463373733656234346334346538393264316535356331303736663136303833313965653635376534306631393239363735343361623432616232323233383664313735383665323533373438646162643032356535306235306165363035303732306532333964363465653666623435303763303631346464346265376166646231333330383930666633613665313736353237633331313661663132396139616335653333366439663630316537313237613664376438323061643266393032646163396232343836363861316261623038643130333432656136396137303937313332666637313230636336346663646537383430633635366261313733326261393565396333363735313137356534656333643834613765306432383834326234316262626264366632386534366333613636333365313832373936356335353832306435306461653262303436356363306434326531393562396431353332653632323565623939386436613439303739613861316364346430313735646533633837663937363134383437623363626231376161333462653832306237623361643938616333666165663939336136373738393734373832633063346165336661626263633433303230333031303030312804320218073a606633353738373364343131346131616566303361646336626136396566616632363930653232376162633136613666633665353034396136336662643936383830303462313465343633633230653338343336613361323464333138326464380ad1070a0d33342e3130362e3234372e363510a388031a05302e302e3822cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393164376466666637386634656662653538393034353063356263396533353334626666616461643933666237616662313562633762636636376433643362343133626439393934306464383235363461646130346162326534656466306131633062386662376531613830393265393133386539363062653263633638623562393766353764323831633538373265393761343739666338343833363331363065333836336235376233336534383639623138356163653565333662643433616535666136373863396562363666316634303134373836383236623266386661376530303630663434303563306138663964613732303566663436383361323433666130663331356631616662623461346431343064303232333465343437336662393266636233386633656232386336306366376362666236346530363963313830383665346464363139333839323061653066643763313933653665313034653635623831376564393339386532333232333766646630383332326339636563303964343039393237326137633031356432326234646363393639663665613166353138393032313035646636303039326235356134316234663332623935376235376438346535623232333930356538363938393531373333656139663265323436316563306436353232656538313664353835306661636665623431326366663962393939343361383764633064303436343437636539336239376531366437336239366234323633393632663831666366393435386535373537376337383061366631363135616137613132333236373338653236396262373331663839653839313632326535373765613534343230626630636134366265366663346637316366323638316163303235326161383835653133626536373263643238343539303432376463643133376366333131363235653862656533623038666463616166343635623338376365376362333338313666326331346136623939616337643733343331386366633539623765643933396261666566383739303230333031303030312805320218083a603439333161373832303264353566313062333135373537383563336634333964623638313962643131303033646637626332636539326532396135313762376332313838306465623463303137393537343462353736636434336238343938640ad0070a0c33352e38332e38392e31373110a388031a05302e302e3822cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393164376466666637386634656662653538393034353063356263396533353334626666616461643933666237616662313562633762636636376433643362343133626439393934306464383235363461646130346162326534656466306131633062386662376531613830393265393133386539363062653263633638623562393766353764323831633538373265393761343739666338343833363331363065333836336235376233336534383639623138356163653565333662643433616535666136373863396562363666316634303134373836383236623266386661376530303630663434303563306138663964613732303566663436383361323433666130663331356631616662623461346431343064303232333465343437336662393266636233386633656232386336306366376362666236346530363963313830383665346464363139333839323061653066643763313933653665313034653635623831376564393339386532333232333766646630383332326339636563303964343039393237326137633031356432326234646363393639663665613166353138393032313035646636303039326235356134316234663332623935376235376438346535623232333930356538363938393531373333656139663265323436316563306436353232656538313664353835306661636665623431326366663962393939343361383764633064303436343437636539336239376531366437336239366234323633393632663831666366393435386535373537376337383061366631363135616137613132333236373338653236396262373331663839653839313632326535373765613534343230626630636134366265366663346637316366323638316163303235326161383835653133626536373263643238343539303432376463643133376366333131363235653862656533623038666463616166343635623338376365376362333338313666326331346136623939616337643733343331386366633539623765643933396261666566383739303230333031303030312805320218083a603439333161373832303264353566313062333135373537383563336634333964623638313962643131303033646637626332636539326532396135313762376332313838306465623463303137393537343462353736636434336238343938640ad1070a0d31332e37382e3233322e31393210a388031a05302e302e3822cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393164376466666637386634656662653538393034353063356263396533353334626666616461643933666237616662313562633762636636376433643362343133626439393934306464383235363461646130346162326534656466306131633062386662376531613830393265393133386539363062653263633638623562393766353764323831633538373265393761343739666338343833363331363065333836336235376233336534383639623138356163653565333662643433616535666136373863396562363666316634303134373836383236623266386661376530303630663434303563306138663964613732303566663436383361323433666130663331356631616662623461346431343064303232333465343437336662393266636233386633656232386336306366376362666236346530363963313830383665346464363139333839323061653066643763313933653665313034653635623831376564393339386532333232333766646630383332326339636563303964343039393237326137633031356432326234646363393639663665613166353138393032313035646636303039326235356134316234663332623935376235376438346535623232333930356538363938393531373333656139663265323436316563306436353232656538313664353835306661636665623431326366663962393939343361383764633064303436343437636539336239376531366437336239366234323633393632663831666366393435386535373537376337383061366631363135616137613132333236373338653236396262373331663839653839313632326535373765613534343230626630636134366265366663346637316366323638316163303235326161383835653133626536373263643238343539303432376463643133376366333131363235653862656533623038666463616166343635623338376365376362333338313666326331346136623939616337643733343331386366633539623765643933396261666566383739303230333031303030312805320218083a603439333161373832303264353566313062333135373537383563336634333964623638313962643131303033646637626332636539326532396135313762376332313838306465623463303137393537343462353736636434336238343938640ad0070a0c33342e3132352e32332e343910a388031a05302e302e3922cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633665313863386662663463643465623130343534326362323061616161323532643935663035326631303836643538316334346164373337626636363736633063336637383961663532363562386166623739623530393132646138346530616663663735343763623166666630386430353237303137656236646335636466383362353139363964343433333661363338376364373062393462663463396261663230323938343065356634663836336437303831663066613831653038363361646564623862383961356461633262623535326436653762396662613232326163323863353730373535333866633935373939323934326433343166613238373665366235303765396365376564353732653863666461356465666133363466646638643865323338323961346363626234373866313165656533623332616238356530373239353163356439343230313135666261333237303733343934663433623566366265626638343135326533353665376231366261373634623761336235326362323733343634303136336265313436356536643166613463366536663636363834613633356339613535366161373130306462653634356466386634633432336165343561303863623335623462633138373838366532323939623563303231306135666261336239343439663438336566393465643932326531653938633131336265313636623839633733353832323433313335643434323330366162653561373162373730313866663333356436646437393534323639376231363832333862393637323766643133333962356638326133623661353937643937363033376165323530363435366338623334653966626633626333323431303434316334626663386562613538353937323534656665626661613738383039613563383835343732396135626137386563653139666338343037646438383934613662633738343430333764383738636163653663313532633265383965386136346230363861366332333765303939393362653830363839303230333031303030312806320218093a603634653039383631356266343035663765643561343031333434366238396334383863666364366262323561346136373664633737656561313164333364373032363832663061363961383033306538633537373764306534323230333739390acf070a0b35302e31382e31372e393310a388031a05302e302e3922cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633665313863386662663463643465623130343534326362323061616161323532643935663035326631303836643538316334346164373337626636363736633063336637383961663532363562386166623739623530393132646138346530616663663735343763623166666630386430353237303137656236646335636466383362353139363964343433333661363338376364373062393462663463396261663230323938343065356634663836336437303831663066613831653038363361646564623862383961356461633262623535326436653762396662613232326163323863353730373535333866633935373939323934326433343166613238373665366235303765396365376564353732653863666461356465666133363466646638643865323338323961346363626234373866313165656533623332616238356530373239353163356439343230313135666261333237303733343934663433623566366265626638343135326533353665376231366261373634623761336235326362323733343634303136336265313436356536643166613463366536663636363834613633356339613535366161373130306462653634356466386634633432336165343561303863623335623462633138373838366532323939623563303231306135666261336239343439663438336566393465643932326531653938633131336265313636623839633733353832323433313335643434323330366162653561373162373730313866663333356436646437393534323639376231363832333862393637323766643133333962356638326133623661353937643937363033376165323530363435366338623334653966626633626333323431303434316334626663386562613538353937323534656665626661613738383039613563383835343732396135626137386563653139666338343037646438383934613662633738343430333764383738636163653663313532633265383965386136346230363861366332333765303939393362653830363839303230333031303030312806320218093a603634653039383631356266343035663765643561343031333434366238396334383863666364366262323561346136373664633737656561313164333364373032363832663061363961383033306538633537373764306534323230333739390ad1070a0d32302e3135302e3133362e383910a388031a05302e302e3922cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633665313863386662663463643465623130343534326362323061616161323532643935663035326631303836643538316334346164373337626636363736633063336637383961663532363562386166623739623530393132646138346530616663663735343763623166666630386430353237303137656236646335636466383362353139363964343433333661363338376364373062393462663463396261663230323938343065356634663836336437303831663066613831653038363361646564623862383961356461633262623535326436653762396662613232326163323863353730373535333866633935373939323934326433343166613238373665366235303765396365376564353732653863666461356465666133363466646638643865323338323961346363626234373866313165656533623332616238356530373239353163356439343230313135666261333237303733343934663433623566366265626638343135326533353665376231366261373634623761336235326362323733343634303136336265313436356536643166613463366536663636363834613633356339613535366161373130306462653634356466386634633432336165343561303863623335623462633138373838366532323939623563303231306135666261336239343439663438336566393465643932326531653938633131336265313636623839633733353832323433313335643434323330366162653561373162373730313866663333356436646437393534323639376231363832333862393637323766643133333962356638326133623661353937643937363033376165323530363435366338623334653966626633626333323431303434316334626663386562613538353937323534656665626661613738383039613563383835343732396135626137386563653139666338343037646438383934613662633738343430333764383738636163653663313532633265383965386136346230363861366332333765303939393362653830363839303230333031303030312806320218093a60363465303938363135626634303566376564356134303133343436623839633438386366636436626232356134613637366463373765656131316433336437303236383266306136396138303330653863353737376430653432323033373939"))),o$2=o$3._fromProtobuf(libExports$1.proto.NodeAddressBook.decode(r$a("0a7f0a0c33342e39342e3130362e363110a388031a05302e302e33320218033a606131373165336261383334373637343761656232653261633464306531313563616161623931383230336230646665316364656162343433343338666332383961626338626138613661666638336462356631623333343034366461383863380a80010a0d35302e31382e3133322e32313110a388031a05302e302e33320218033a606131373165336261383334373637343761656232653261633464306531313563616161623931383230336230646665316364656162343433343338666332383961626338626138613661666638336462356631623333343034366461383863380a81010a0e3133382e39312e3134322e32313910a388031a05302e302e33320218033a606131373165336261383334373637343761656232653261633464306531313563616161623931383230336230646665316364656162343433343338666332383961626338626138613661666638336462356631623333343034366461383863380a82010a0d33352e3233372e3131392e353510a388031a05302e302e342801320218043a603734303964656332653439346236323765653439633639623239346265316365616562636133666463616633363738396538386663376435623065656635353631663532623832643335313931613339633266626564363032373236373136360a7f0a0a332e3231322e362e313310a388031a05302e302e342801320218043a603734303964656332653439346236323765653439633639623239346265316365616562636133666463616633363738396538386663376435623065656635353631663532623832643335313931613339633266626564363032373236373136360a82010a0d35322e3136382e37362e32343110a388031a05302e302e342801320218043a603734303964656332653439346236323765653439633639623239346265316365616562636133666463616633363738396538386663376435623065656635353631663532623832643335313931613339633266626564363032373236373136360a82010a0d33352e3234352e32372e31393310a388031a05302e302e352802320218053a603962313431363538346134613338306262383661366337643732303764386165646462633362363365613330353939383235356263653833353162613462356463613532633932383261353461366265643630646536336365303361616132340a80010a0b35322e32302e31382e383610a388031a05302e302e352802320218053a603962313431363538346134613338306262383661366337643732303764386165646462633362363365613330353939383235356263653833353162613462356463613532633932383261353461366265643630646536336365303361616132340a81010a0c34302e37392e38332e31323410a388031a05302e302e352802320218053a603962313431363538346134613338306262383661366337643732303764386165646462633362363365613330353939383235356263653833353162613462356463613532633932383261353461366265643630646536336365303361616132340a82010a0d33342e38332e3131322e31313610a388031a05302e302e362803320218063a603634383636383562346536653063623936333437326330316665393939333166643965346334343838376261383334323361653766656564323264363438343834636638613362633563636361366133373338376266393664333836373238300a81010a0c35342e37302e3139322e333310a388031a05302e302e362803320218063a603634383636383562346536653063623936333437326330316665393939333166643965346334343838376261383334323361653766656564323264363438343834636638613362633563636361366133373338376266393664333836373238300a81010a0c35322e3138332e34352e363510a388031a05302e302e362803320218063a603634383636383562346536653063623936333437326330316665393939333166643965346334343838376261383334323361653766656564323264363438343834636638613362633563636361366133373338376266393664333836373238300a80010a0b33342e39342e3136302e3410a388031a05302e302e372804320218073a603339653930393931356138353238303330313534613663373730393530633762343737376261343031333537633065363138373635343231356363323061616363646438653566663239653963346439356366343130316661363862653435630a83010a0e35342e3137362e3139392e31303910a388031a05302e302e372804320218073a603339653930393931356138353238303330313534613663373730393530633762343737376261343031333537633065363138373635343231356363323061616363646438653566663239653963346439356366343130316661363862653435630a82010a0d31332e36342e3138312e31333610a388031a05302e302e372804320218073a603339653930393931356138353238303330313534613663373730393530633762343737376261343031333537633065363138373635343231356363323061616363646438653566663239653963346439356366343130316661363862653435630a83010a0e33342e3130362e3130322e32313810a388031a05302e302e382805320218083a606134343837346137616131623337373431613037316164616165373866623135326236393664316335386438646566626531643832333034353332613063303139656539366363313964373536383635373864333961316536633331613165650a82010a0d33352e3135352e34392e31343710a388031a05302e302e382805320218083a606134343837346137616131623337373431613037316164616165373866623135326236393664316335386438646566626531643832333034353332613063303139656539366363313964373536383635373864333961316536633331613165650a81010a0c31332e37382e3233382e333210a388031a05302e302e382805320218083a606134343837346137616131623337373431613037316164616165373866623135326236393664316335386438646566626531643832333034353332613063303139656539366363313964373536383635373864333961316536633331613165650a83010a0e33342e3133332e3139372e32333010a388031a05302e302e392806320218093a603639383332613733613336303265386431666265356164353864316332363337613162363732643731656538376166313064623634386562393161666232323832353362316634376535376433643461343466663534376233333934616132320a82010a0d35322e31342e3235322e32303710a388031a05302e302e392806320218093a603639383332613733613336303265386431666265356164353864316332363337613162363732643731656538376166313064623634386562393161666232323832353362316634376535376433643461343466663534376233333934616132320a82010a0d35322e3136352e31372e32333110a388031a05302e302e392806320218093a60363938333261373361333630326538643166626535616435386431633236333761316236373264373165653837616631306462363438656239316166623232383235336231663437653537643364346134346666353437623333393461613232"))),b$1=o$3._fromProtobuf(libExports$1.proto.NodeAddressBook.decode(r$a("0ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633435363165336332373863643635306538306334313363613434343233633163336331336366313437356636663639373664353937616534333262343961623432303836623739623834313332363035346238623364636635376438666364373962666330353831383363613234636434633163626335373465643131313765326635623762336336336365376230366439623465666366373337353633376234316665366635336338313162396465363134336633613532393537636466393536373735313230623333373033666635373632313430376162393537356263326433356330643434663039383366633165663633613466663532303966303730633932616631303632393536303163393662636564303634656331393031393730313963363831316334633864643830636234663461633731663961643736653761633839343536666266346630313166393061626432643930353336653832333436353166366265663932376533643564386237626634353930353039383362656361336162656632613964393761663334353737326137373430653936393932373562303138656130646632383661646436636539323365663930386662653736326137356632313131363836326462343464336463613164343462346432653864633130363663353030366262356137643935346164323535643462363033323733343735653531316165623438356430363961303637633061623563323435333863393333633036623561366165666139343030356332393135323133653463636461653663393432663632373266396464353238326436623839306631663230656664323339396364363734393234666135373034366163366461333265373339353161373331313365393166633262376666323965343835316238336666333966383362613965633666303863656664626236636262626666616266646661613931643933306637323030646134383133376333393463626431336537303165636463323631366664323162616436383161613466303031303230333031303030312804320218073a603665396138616263646364653665313134396133656265313766643538643839303538333961383664623732623036613365613230616131373666383638623235343838353261653432336437613963366237636666396537313436323961320ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030613163343037373135343330336363373263346662373639326333663934323531626465633132333961316637613839373261626539316133353332336662656361363235613766666165363430366338353564633261663231313039303062306466306536653664623736333634646661316666653835656461353637393336653239383562383536333461333261613532613635393964643663333062653166376136633562386635656563616632363231643861343539363832666364326462616164313536316431316633336663636237663535303061633536386431363564626561616365333238366432383934663634313239643738316436633732666437643539396339653164336166346161343333633233623931306661653463343834313634316636313532366164373837656265613533393837343136376539643361373363633066623135363432396431356563373633613664306630363131356137396239616637383364373762393864383330393661613437343366393734303864396531346263663464646666653435393137363838343762343063623864613763613337353235366432623933356430393566653235326661653831666636653337663834643761393064376535373061346638656633633764373636656564613437326630393230313939303135613839303832353961383733633534353466636262646361643265353238646538353435356234303833633764633461646335613938386530636464666463313539643564373132616264353434616137336563303239303839383134633938613434663236666330363434363539633138336533313834616132373266386431646330626661336530613536303438346362303535626134646262356363333339656338306264313164363432646333613730326538633730336162323139333038346439626436336630646665313261343333633235373665616637383163666164383637656637306264613631373638623262656631346635306336633362386230393666303230333031303030312805320218083a606464336233653763643361323537643832373665343635333533363162303138623730303931663438363635653832303031306538316563303539326236396264346265316662643765636435303964303730313364643034313238343266640ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030623263636163363561643066633736343561383137626661626334383761643765343133313165376133313938623337666238343264383463333935623366363764366264383438663130633666303363323930653866376461613864303031613834343164633335326131393136306133313933653638623832656466313961653637363933613961333364346362383765373839613130373037313535313565613737326361613862383661353639623931633534353038333564396333353466306461636563393766653737303931623435623134373639386237663836303134323264636432323631653932386465346461633963343264636261666466393663303732333362613330323730373666333763393639653865643330623662356438663530333462653764393263353936663862653836316535316663633361323432626639643862653965326139653865306631353565626366663233656666613763643537633130353432383131643830373736633935383535323666646230656161333465653139353564353131313933393066653837336534633034646564643239313635383834623938623436333038373838616537666334643461613461386663396263323637346261333231343933623632343435356164343130633164653731626339356431643931666130663230313431386137393565333039656166323937623639396266323763396661323736336364353963656230323165313662383230306331303630663238313766643833636663373637313833343839343631653335393932393162333830643665393339626161346231393233326136613237326464653635316638303436666463333464623237366137373764366662326265633332353562326363323434623461663536366231303566333063363530366464616530656233646564646366393437626362396336306530303039383466336234613863366334656434626639306263313933326237663934646333616536623336303030386562393032303430663962303230333031303030312802320218053a603561383634313561303861306138323566336232656237353031303135353230326533313234336665343161303333333834653738633138633131653565386632303964343933623062326664343565303662333734663262363964663564370ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030613365333762373663366364356636363232643639323434343464313263363737633339356632623539303266336262393862386138623530353561373037373036636130323863643735303630613264383730326432643862303439343762646366653061386331343161613238343462316530366536363139303031326538623633323661623066613331373937336263376362346432393439663231303861613034633462306339316261613537323866356235363232656337356162663537386131663762343165646532613637656264363963313865353831666466396336303230616330646539636132633331663063363436393030333331316662623563653764623439633738376531613764323761613432356565376238346461376536363933396639633830643065383266636535356530326466633862356337383431386132366161343336353036393837313962616663656366306264343930303061646463666134303537303862646265666262313937343964323264616230303765343464343565613233623130366638383334633135326532353036326434636632346666323533353663376562333732393130353339336662343962616239303461303266306630626234313763643931396433353238393031323865366262666634666163396639306465313138613937346632613664643031653033326137396231373866363066613166636262643032623537303466623436323935633135313930383136333733656464363633356338353639373866316239353033663166373362346230626538616261326564316665656164353939353362663832656664653933613334373161626435356364613362613861363733666262333739393734396662303036643030336630653633663636356333343631643261376232396463386232303462613539613635363638613436616532383738663030643166393439306466396532383066656266343331356561303465616135363861336139666434386336326336336236656364613639303230333031303030312803320218063a606434363430333938303337393230373965636364356134343331316361306463323262353065633839356235366535336431326232396637326463366462613363616665326535623831303466626461303338616635623434376430666231320ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393361323135636334613761373232636165396331336162643633366466393963636565633661663964623436623639666135313637313665663530636532343930613938316530396162303139636132636234363831316235623631396431626431643565653666343661343263373737636264656536343261313438346563646635646464333732393634326333386336643433613838353838373434373566353832343434333636346330346466656439623839303435666230383565323563336566636234383431373333656666376335323963313339653639333530633263643739623263386431393637396137313265346538636166643332363735343162383332623365313061303132353564656636396466316539643362386438656166303331316465363764356531326232366464303164626264396433653432643335643964653237313330326530663166363964383763626337616361396538383637653964343238643363616230363636656234393064356662616233306266663366373835643033663230373261343362623962356535343635366135393263623631656166643561356566323834633763616563363666376634373332356363306434633164323766363631643861373438636135303731633036656631333464666639366634303836363838333636643436386132343738303031376530623536616261376661623433623362376330623737393036666165353438326633323831316332393265366231343435346531346238393438303161383661303363633437373934646430643734353237613732653432346564336166613034383939656362396136336632613961653732626537666139383961646630643635613332633835316439383031666334313034386466333335363466633762333137303765633866623830313430666537623761316661313230626131636236363033323463656666623462636332643962623764653063663534633831396632646433626365616465633963323566356531396463396231303230333031303030312806320218093a603365303261363732306334343636353965383633303564353562666565383230623335653635306665636163633535333039373435356532633465303332636339646564313662316262343464336235393262626163623663326266663165360ab70722cc063330383230316132333030643036303932613836343838366637306430313031303130353030303338323031386630303330383230313861303238323031383130303930323539663465336439663066333934323536353438653963373330386231306237333430336363393039346439376164313531623737303631373062393737326365623634643636326563656639303161386437643135643331396135396338623731303731616363643839356237633933363130646336393736663637633465313732396261383337336162376535326133663363386632363534393164646536396436653039393934373065373434353938313133316264393663333665363836353230336662326562643564353065616461666237323633393664656331643931373438393862346539626530346337346433303466656164643963626433323334633362376633333036633939636230633333396663323539363962343164353861326237636663313833326532323664383163313936333939336532323535613038376431363938633033643432313062643634353830363434643039356361373661613137393465646434306331633837623566383261386533396636303365393731313662613034353738653765383033343634393564373835643465663763663737313462396562366635663965306239613934663462373338383436313962393237346434613935656631353735346138396439376566356331613838623664363933653061383065626435333766633963663063613931643163363264393135646537656438313862393532653634633230303239336565386532383461343136613732613365313266633764343233623135386639623439363630636263323436366662656430666564326532346531303266646539343265623463666439346265633436643364393066633038633339666563626130336530636132343634616536363462393739353135626132396531663730326333666537303262653739333739366438656462313761613438633039323930623032343534396630363131663561653233656437653136343432646637643164616432323836633262623039643535323264643365643639386332663032303330313030303128093202180c3a606339373462623938326338313931336237333236643561336639646363343836313261313566376161643032663230376230663130636432303137613666626666353830336537636139626662343730396162323862366230396435623133660ab70722cc063330383230316132333030643036303932613836343838366637306430313031303130353030303338323031386630303330383230313861303238323031383130303962646438653834666164616133353332666334636530316138613137643463336232333266353061393739306532363236383465646334383233653831356131626435623230656365613762663536653239663662623762383331666233626636656663643134373566306238656435666662306231333835623936643136366236323966303339366138666566356630366534626361323565653461313334306565323633613464396262303230643866343732333036663364383836313338646537613031396530353962643061666339303263636261316132313361653264616136306338613031333735356665306134386530333466356234303233613264616465616138386335343836383335336163376137613364663132623266623634313837373465396231346265366561623863633237623838303132616436313632646137346530656562313631333539303566343337333734646162383538366437353061323662626433616332346165643837386334643533653635313037326338373165393464376163633537356339363733383137333461353366656166346437626136626364643234316363363435386336303837643836333032616132353163303466366435366239633332643764393636323437353065643035353738356430373733663433646330393962323863393232383131343865366338316632393766663964313636653030306163303462333132343138363737356663656637356635656261306331303332626631333064663663643761343632313164306466336530353834643932656136373334396438343930353038656234656638386635346338633364343836646538373139663130666139366665623835636337393630373663613738313331386565326439656439303363613133333630343063353961643931613464326636393865393130386165306564623962316362393561643333623139376666623138626431626138623536636265653261616539353835656365323038613165313462343835363436333032303330313030303128083202180b3a603937303834333033333130373866353638326337663332343464383263336233653238316139313837393537386465656163646363326132656265353431616631383831313561643265383338363565356635643234376234613138633165650ab50722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303039303938383635646566326632616233373663376630663733386331643837613237616330316166643030383632306333356362366562666362623063333330303331393361333838633334366433303233313732373031323139336262373666643330303462383634333132633638396566353231336362623930313130313530396465616239346632366137333265363337393239646134633463623332353137653361646262333831316435306163346337376331666365386236353136303632313566333437303766336537323635353435653538633839343630396532383337366264623737373566653330343339653065313539326664636230633365653163333035373733643037326136623839353765616663653161313162653936356564616666333834333336366362366134346563323561383930313036653632343735363766373662353530666461343832626165633633303764363938656338383834316664363666323366323130653437623861396463626136626134653166613731366462333363383065333038313934393664636235653536303966623665376336313533373962646465643432376539323331623932353463326261663934333630386138366436393861653961336338363339646638383764366636623561373133383564323433333864393131613231326266373166316532616363386231383662393665633865363963383662366430353832313737373661303963396336383935336564623539313635373862356132363362326634363965336230633037656164613731613434376565613766386663316262383037343235353536376237663062643165366166623033353837313863393862343239653234623232393835393666633736636636616633393663613934333464373932366563376433376434623932616635366434356665666638313936303935323234613931366331666665366236363765323535666333616338636363656639323064633034346232353030333133326238373830363734326630323033303130303031320218033a603333373339306438666561313434616663313265383132353461323864616336656138323839333833366163303732656666643835653061373734383538306566323830393636343863356137663864626234636538313437363831353133370ab70722cc063330383230316132333030643036303932613836343838366637306430313031303130353030303338323031386630303330383230313861303238323031383130306335376564623966663237366530323362323830323163623164383763646631393636623639386366343865346561616137633639323037376365656538636362323339613463393231353937653865383966376363303564336633313331353738393736633465333134343035643461346530336137323431306335633039636135323761643561383562393938363337653732613332653166626330643535343662323436356539653830366332646435303965623035306162356662323730363366643932383135623164643236383965323131316361656236663534396539346139663030663038323164346361366336613631313766356135333363393236336266303734613330643563626566353064316338633233383762636139373265646564613039383362356430613662353764636230303230303036383238623430653430373662343837306232346261643834303536656535326235663432326538383430303238633235303036333832643865396336363132323566346637366561373265333430363037653966633666336332303433333037366131636138636231356564303361633839363664303530376263646536383165346530323331656539663837643131316537623438616338663934643264383432623532646637336635373363633534313439363437393763363236393638666661653734313866336236313039623561306630396533323233663461346435653335303964643235303133386636626331376266366365636531373539343433306466313830613338653930616466326166666266616430633662386331623837663137386130363164636662666638623932633931363664383734633166663561663466626364626665386539643039393337306464663630626537343736333364333665653465623563643531663665336333333965313531653431626462356135636532633863393761306134336233636434636330383138383463383739663964326633373438343238633835373366313763393066336362643032303330313030303128073202180a3a603734306166366266373339653838336338386633333434633961306638623330316533396463393831633531363365306465326133666634326239396534323665643765353662363766343231383530333834356466363266343963396662300ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393133316161333638663933343532323966393762363235396363636166666561323365303063643565616430326533663639366331653731346565333933396461643836306533386266393561323937346639656234386539333433663861616334303565613935356430353332336531313762336231633934383133613361663432666538303832633364343362616631626434643833363765393364623030616436393665363237613130333661653533346630313165616435653536663337613666666534346236623965303939343031313932616435363061303334366234316138313030393566356632643766643332643665656236353562613735386336623532366331323933383661663731393763376135336165363033643632323833323235343936316631366430656661383037396137363835363138383862653733333439323231373935366262636166616562623631333563356662623234383464356234613566646630333336616330326532366331363532633162643865616633306461653164366433656230306637623466616238643634373866653864393565623931316466393636613064656134653532326462373662383936363537306563633561663039353136343234663061663566386565363665333836643536353037313339393731363961633337353733626635326664303538646539356162326666363865363831313161623233343035656139363462326262383864303263306631636165643731656364643465346534303835393438373666646238353030626335356337626130323036366530356162393864396637653034363664393730326562353765653337323266386663633835613735353035666633323632313730323838623738383732336164623937653464653536323063633930656164313338326663643735373138383966656662313165363737316263336636663366656231396337616335343238373864303361393032373035323663336565643234393465666635346531353363613966363839303230333031303030312801320218043a603765616236393661623935343336363538626331346666366234626534643932356364353162323230646632613164356336656531363061646166323961353165363934646533656531383463653232656164386437646239333231383266330ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303038326465373330363566333466666332393334306435393439643232323062316534333636656435636637633665626436313663663934313661353365613030313766366262313136626664336633646566636331356237613464646630653434643032666536393536383830353365373961373730653230316263663731393333393030333965653866303836643466613734366337653035363931383330316639623565383465333932363238323830383561373962333232626361306235643835666539373232316132366262646532353863363230663064636561303261623165646431366363343961336632616239323838653364643166333764633462366136663731333366663932653534316337316237306432613266363664353537323561623138626638366430303965633364323466356431326530623565363830326431313531333732643462373634656265636234616638326636343934383565633537623561303164633637393538663561303363636161623763626139333534613137333732633133313662613437633935336161663934393031623366386332346536613361666436373538653766336231343363653264643363623037316232613734633932316365653934396134623561366265383739663163373930613662386436336231393264376565323961393439316664643638396139386330613763336436303332306631623461633264363232396466643934653432663361363034386137366265316562393538633861313837336265386433333861656339666335396162376633373632363738393430326331666435393566313930383735373565306265383237666334633061346662336433393361643734613934396363393836626662363463616264646165353339333566366463353630373464623933643737656133623831366264643662653533343439373237323238393835396666333463653531383630616666623632316431303438376463333834336631663836643534303334613633653438613161306430323033303130303031280a3202180d3a606132656363316232616539386264323862633161303864386633373161306434663734356337363864306337373339363235363265333433623235643833343235656565613765663865613134323935333432623865623738643332656333660ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303039383735356134303862353332316532363330353230303064366437643461326333613535346435653133383461396362356562663437346165383832633633623438366264303864313434646466316139346365396137643632353139363330303661666461616334353838343666313736343031393566653235333961363536393330656661383534663231343865363865633161303863316334396432303063336633303435666537313437663036643533346334626432363231303063623164643339373339643736306438316130626432306638336632353564323530376434636362313130366235333631386336613934343039633838376361653236326434636565396338363233323134376365633134303465306335376262613733313731333065653339363433383838616633643539386564643832623863363165363561653831613465316135366263303664333937313433613938643431636138376433656634333365663061656162363830313139316233653338343830393638663636623665383836363261663435613965323132393934663638623238386562393637626562393834373863323433653231333663316131353931663036316635626330346232316666326261343862323966313834333130383838373362646665393966386135326539343038393731383536653830346465613630326133313137383663393835363532393633633361333737303332396234303966373466646663373436623232613566383431383931323037316334636538343663396234623332306665646636653962363465326362653338346639613832623661616164346232303930373433316466316133336636393230376135363536303062653831303730643038333239303039393538353961343439386435623539333135626365626566656538303765623061336139343266316364663333363764643434343466646232393838366566636464306265346162653961313838383033393533383735656461333364623732393839663736336230323033303130303031280b3202180e3a603139366237623132303739376364623361396430303362393833643537646131303331303662313733306531376636376532633762616161646234333738396166313639366461313031316232353362636263383630333333383566303332380ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303061396462376638626161313236383938666162373839313135613362356438393734346631393765323830343161653039386633653838366336393837313732316531316262306164313166336365393132346161393631643661306463383435663439373635633366616231393935383430323637366635363434363262663238316462613535383837383066303365393035373938653138343236396161613630663761313437323333316532666231646561646438373763383463626362363431636139653563386164366534356263313539636230373966636230643434396364636438643932333963316130343765376234343864613063646361323636313061323566323936643936653734363962363736643461343434353136653761353965383532393361383038366638343063303532383534653032613863623230303264616433353832356265346438336235326661393165386337336666303439373436313438383632373837633131313866393234643331636261633162343466656666323264343336623339373965616466396234336134626661373265313562343735356663616232363065303661323739633362623733626337663136613036306434643532326664343930353830333838616135393564383034343733366535323266363432343931356637383033623735383365303935636466373863333235313936393764653831623839666235303035343735336231613137663961616662303634643834633939326639616231316363626338636231303831346463616635323634616134356632316264656661633832636361636161663335386533313337336565316261346537343032666438613730656130633238636135636337346463343235313063393639636432633435396231656333363838613031656133396139393237313063643232393763393861383462363334386135373738303466646332333464336665313930336532633231653137326461323862353961653665346337653865646438623731633439643730323033303130303031280c3202180f3a603538343661353366343437353239666439636462373830346364333136383865643665656265336236336461326635663231316666626337333731393763663366316366626664613631626537643135313066306539323339383131376637340ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303061386365616333363765623166316465356630643965663365616630646639623938343438666532303830383437363536326130363063353163323839373730623463616366653932636236353536393832336539363263326132633966656435336264333663613361313232646531633532356135383266323561346437643632386331613364356264623839333661656365373531306537353534656537303333303235633039326338323865656235373338626530326564393633646138316135393230353633346365393435343537376162383266343066313366316565353565306165373237653233633330323834623166343462393961636534646463356639616337616438386439666132323535393335623234646362613834303036343265313663663235333263306230643638393239303436303837313563343037366634366438346130653066656433366537366363646339363335356537613236313630393435633262353461653236636330306664303832333236333436656565656137646437356639313931316539396462636239396561346163366261303536633333323238643838316438353833316439636338373935393364613137343664643065653935646332623936666539336261666366663263643764393239353864373864663333663230356437313135656439666163346462366634636336306535366135343431646135623562353566613539393939303265393538613662366334346438313064646335363138313234316238376632326630353961363838306538303231373336643031383937646236353434396365383137613233373564303335353163623064653530376336303961306338303330656366346266646562323133633033646161373634613138323162373234333334663731663736386437616563623237373035326137303333373635663037323138303536633738663261383761663138333836643866363161356366636233663262613464643539393135663133643338363334643136393537353730323033303130303031280d320218103a603030306162636435396133306135333838633530306265363832663663613239343034363239356339323735383831633230643334626230643639306564613762333862366262643037613364643166646662366137303434626230396366660ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303061663062393134323537626637613436353563346135306430636164356530613165343538316564363632336630653837333066373936623866323963353831373862636363363933326331666333316633396566343462383264336334336233393837333733373366656362313239353232386130346664353061313466333634366438346665316634363763616562393864343633653239373565393935623864326531653339663362663661646463323561653335643635643032363038653033343535333739363665326162636534396238313462656164336331623735373137346165333063303062306334336539396238303439366237326433633133316631633665346663646130356632383131376566396532386334333033626534643863376530343264353862383363633132313934356132633635653739363263616139313835393338663337353764663763636139356366303262356533313934346133613631396130616333663165333462396230313364346332323463346631653730666439666433363938336566383661646535313833363263633833323263306637623631613961633735666238326537623836643638626330663039396130396131346361633561316438643338663961386137306363333766663563633362626432373432666664313436323535633137316536613137383038333237316463653066646536383165643439326362353962303739366432373031373538333864633539303831303765336136656133663961343036623364313133306363656333623437393165343962626332333136303362343661623264306639336434336265373561623961346437313065613934306532383561376231353362306361376364646565366439646365306164383335306334316439306332313562393538383531356166613061633333363561653037653831663362626233366264626561633462333162636231616134653832353635623937376639646164383564363236656566396161613965663864376533666230323033303130303031280e320218113a603933653238313031303462326231376230303935326235613431303264333365646230343363623136646533616433643364363832363066353562623065353837333765613539343463333338663763386362383863373833336663383630630ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303038633037626533303561643630623930626132646162333962306565373736306531613232663835373532323534306437306230336233663965343837356133613239616230383038386631343466353765623235326534366261353933383564306536643432373031313764613061626331623362383036393463396135303538623836643631646661303665373136373039633838653866656163376333613065316432356663306165626636613866373666636239396638343566653138313436316361623638353862393763336134303237666233373132623134653663303738396465313764343137363435373765353131343137656231363236393265623037616531653733353532333565396262343339303437623663303136313337383265376464366636303464616134363734363631643533393631663436633366616136623765373637363264333733623562353432623739656139363365666266333361633638313938626232623636316366663637363931366566333732616434633236633231366334626334373837633834656333326431383464373763373531383663303963663364396639313433336361393835333131396261623331666136616432366634353365353936643962646563613638613537363962633866656537613533356438306338633666336566623164666232383861623661393739383534623763653833313234656330643130326166663934633362373466396333373839353863323565623933336464353363316538303561313836353464366439313836393930663635373034323966393630663334653862346637666439393732646362666539323430653037346461326433353561356637656639633161663632656635393832613831373435373862396331356334396563353636626461636233306363666365663039636466653730386164343837343234653963316265363533663965653736363065376439343263316566613564613238366531616464616230366139613333663964653934363739356230323033303130303031280f320218123a603934383235313739643163333934303137306233356432363665346366613830643737386335653966356261653764653833666638636334373431663362653336616336336431653761653439373261656466366263316533636632303638390ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030626531376339393634376365633635613434343037623533353835366233633362616566356235346635363561663538623834353662613863376365353335643561633732633631633434633736623363353763386538363438343136333762653130613833636665333963303932343736643064626534643663646364636437323061333062356266656235316130316131386635383263343566366338363939336663663764663138323933356465316438363930363034346463663335313836393335643962643765656137393532333532626562623465663961653066373636316537306134323337616661393839393636383763613438666366633562303064333830376630353462653066613863336266613432353033386265366566323935313634663232663733623765383863393465613962653861613466336132343563383962396431666435313932663761353062393538623265663831303462333666316266386664326366623238633134323138303063316334376534656639386166313530303730636336643639643137653865623932663138613661613161363532363661343935323338643130336638663639356235376563663337333635306130353230303837343537323162656138313536323739363763383037363336356466386334633761376434646438663263333835306331386662613731656236306536653864666264313936653035333766643730623334346563626363353330646663383364613666656466343964353161393034313935303262613964373063643335663163663363303639346532333534663930363466646266353335656232336332376330613433643062373863316638363763363164393836393564386465663762633261313062623636373463323266363661616230613931383133646466323763646238353263353965663739653162396531613037356661366565323761376533373734646266346232363436353432376536643561623931666537663066336137313738346563613138326235303230333031303030312810320218133a603038393039376465663031623037633764393734613537353532353161366161613061666236623332613534353334336432393138653732626164303433323163313131633234643432373538306633626131653236616139643735653632360ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030613561643262373634336130346330353564326638636432353131623135313339666334353537353632313338386534396331313962326633393861636131313066363133393662306338363664653530363335323262623835343032373365313366366439346365316536303433386636616662303061616136343631326637313435653962636538626331613533623934313931336161373663396633613238333366616437636632383563376163326433376639396633633263646234396465346431353165363136373835363466323831663534313432346234316661376335316232613936303232383363376433326565303065623833386461313563333861666339366530363164393763656465323231363566663161613935396631633432373562326430393863343035383661353537396662623363623930303732373034313230613861363661353237306634666366643130383663393233363930613335653766643434356533336163303366313339633638363835353635373063646334616166323231303761366331613434323435366137633663373965653034303930653765356434663636626361363063613166343762366466623534336461633363626631396137373139613866353562366638336234613362386136366436303235366430613436353531666137303234626430353633316238613535383038373732353463326632663236386364633333643264626263666237333365396662653233336262396362353961623331613031343862323365386334323638306666313061663463373961346430383334366662373961393364393632393534386561663162623132343639386661656661346364643732343432633033613034623733333433326637343839303361333235633238336434353661623961653932316165376564333339316535643137383765666463323335343061376238356336393161653837306130376639306231316331336233326365343365616564313562333639363835636534393137376363393835303230333031303030312811320218143a603939666162633461646534653636326336653238323366346139366562323134343034383465356136643064333132623730633036386432326236323936333830376332333361343964626239383361376562623330653737303637373261340ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030386434356332316330633935656636356130323964353263393537666430663835663230313233646130333465363136373164646565353437356630373338326136366336366362346463353035303464646664333735383130383364663864313735373733306564386436663336346466346333366132363531353931393535646132303161323430376661386162396232333133383131323235613064613233306662653338306530393061613536656661346632303265633962343832336636353031643936616336393865626632366161636633656532643166333261373231633934376531303736636633356233373364613164383761333661313532653030653731303131373932323832653832356666313731633538333362383835373062666336646138343439653666393566386231323635616235353531393430333135353364316435373666393363343263306361363061616261633463386464313632643831313466326232313531313538336337323533396665353663343939613932396465336134306130643435633137633538396332643739383863653236656166633932613364333762376561303034326434336530336166613632373162323632353561366363636661653533373138323164383165306230356332353062353966306139303734316130653065383861303965643536633562393738306430393566303930366630623831643531323633393832616165303131333663303732643834346131316436646134623261363163363434653161623137663136666634386565323366656465383435326631653432653264333061303739306332356434323036306531643434613637316132656232336431313466363863373165333366313736646235386136386234333030353462633164323938336132336133326561366666393566613763346438653338306562323936653938623739363865636638343534643831376337333765656135646439323165623836633136633762323933303461346137656362653561336131303230333031303030312812320218153a606537396165396337313933643164326263393433383436346338616135663632323461653835323936366134336239383235383833663766373432633533393562643330393935383761393638363662393233396431656666336165353037610ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030623035616265326162303066646430366339353565383637313062306530366631613932363234613438616431636263386466633666323231323936326230633330666462643238346133376335613337363538623633633336656138313632353631613865346639343663626535373232633032383830316630663238316337306638643838633763303061326632653239663539376237393938363965643833353664663537633437626539393434613261616666363530663962346262613064626335336463383830666462623639656134353139303564323830323230326638653239633034613736643237616632656237633534383438356266336634363934633930633431383130383838383433373932383438383335663738313637303764336538643736663465363766353738306263663038383133633535656336333961396264363234313738663565623134376435303061663335316539656631623165333432343834636132363064623763636261653438366631336366323635623562316162363838303636303038303533623230633364656463653737316339613038613033323061613963653435316562396439383361376234396361613130393666386164633039383331386463333865306537636566306438653564353537613036373536383561316339653235366132626339646261333232623362623331373263663731343037376263333830663861306134333361386266613766626663353966366230393365633862663665393339376330396231386531383034306331623536363836343733376338666137653239373935663361343538386464613763326261623439353636356363346139623833366532656239306336326133666361663539316662356638313830346337363138306536323666613236343461376465333435313164366334363637643938393337653237373333663464316539313338383333353465353466643733353137323165373666376235366333343833333838663461366238376232386165626562303230333031303030312813320218163a603962343038383566313362366163316337353336393262613366313739303061333838333165363934613061663937343934623834333838323039636235656662646339386136646162623265316337313833393166633133356264616163330ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030396463643863306135336539306333353539353734663636323034313137643362353033653530613336643330393766616338343239653663656364333762623534303731383038663265653938323033356638353161306339626532313736333833613232653338633161626131363866333266393035373063623332333363666536323539383736363661663637623531346361656632316662386466366430666364333363663236303662393264646561353533366236303638643836373832653339626435633338343435393931643431396237643165633038353939343132633039343964316332343062333563313464633535323734646261373166666165393336313235613566383139663534313332653234333964346163353539373939366563653835653133646666333336316639313331663536636561633562396635353262343963663666396139616336653564636532646233363934363266393361663830653562353662366538626566613136326130363162346137363839326264633834363437333036633630303835386664643237303332373663326337303434303139386566643766653335343563663261623538306337346366643634343561616637626437663734356363323532656162643236356561626565383632343137313034653639343861353537353666646332323264663061313031353234646531633363303863636630343330313165633766653936346564643834353161313330313437633037333633613335663131666465656638663261326237363137353762343335386666383962373561343864363762646336303930363933653062623836373965636262393366666462336633656439366265633933656634363536653337313661623837636534366361386531323539633866656464653866326631656130663365623263343865393635353164653132333330333435373235663435656436396338353735623531363833616661343732363231383236646232326262326431633466316533363436346139303230333031303030312814320218173a60346630613033333466393737363738313632663830643936376637323139313431333630633062376637663033316233376336396536323137333933336564616434366263626139373636376565373262666435613933346261313532326330"))),s$1={"https://grpc-web.myhbarwallet.com:443":new f(3),"https://node00.swirldslabs.com:443":new f(3),"https://node01-00-grpc.swirlds.com:443":new f(4),"https://node02.swirldslabs.com:443":new f(5),"https://node03.swirldslabs.com:443":new f(6),"https://node04.swirldslabs.com:443":new f(7),"https://node05.swirldslabs.com:443":new f(8),"https://node06.swirldslabs.com:443":new f(9),"https://node07.swirldslabs.com:443":new f(10),"https://node09.swirldslabs.com:443":new f(12),"https://node10.swirldslabs.com:443":new f(13),"https://node11.swirldslabs.com:443":new f(14),"https://node12.swirldslabs.com:443":new f(15),"https://node14.swirldslabs.com:443":new f(17),"https://node15.swirldslabs.com:443":new f(18),"https://node16.swirldslabs.com:443":new f(19),"https://node17.swirldslabs.com:443":new f(20),"https://node18.swirldslabs.com:443":new f(21),"https://node19.swirldslabs.com:443":new f(22),"https://node20.swirldslabs.com:443":new f(23),"https://node21.swirldslabs.com:443":new f(24),"https://node22.swirldslabs.com:443":new f(25),"https://node24.swirldslabs.com:443":new f(27),"https://node25.swirldslabs.com:443":new f(28),"https://node26.swirldslabs.com:443":new f(29),"https://node27.swirldslabs.com:443":new f(30),"https://node28.swirldslabs.com:443":new f(31),"https://node29.swirldslabs.com:443":new f(32),"https://node30.swirldslabs.com:443":new f(33),"https://node31.swirldslabs.com:443":new f(34)},t$4={"https://testnet-node00-00-grpc.hedera.com:443":new f(3),"https://testnet-node01-00-grpc.hedera.com:443":new f(4),"https://testnet-node02-00-grpc.hedera.com:443":new f(5),"https://testnet-node03-00-grpc.hedera.com:443":new f(6),"https://testnet-node04-00-grpc.hedera.com:443":new f(7),"https://testnet-node05-00-grpc.hedera.com:443":new f(8),"https://testnet-node06-00-grpc.hedera.com:443":new f(9)},n$2={"https://previewnet-node00-00-grpc.hedera.com:443":new f(3),"https://previewnet-node01-00-grpc.hedera.com:443":new f(4),"https://previewnet-node02-00-grpc.hedera.com:443":new f(5),"https://previewnet-node03-00-grpc.hedera.com:443":new f(6),"https://previewnet-node04-00-grpc.hedera.com:443":new f(7),"https://previewnet-node05-00-grpc.hedera.com:443":new f(8),"https://previewnet-node06-00-grpc.hedera.com:443":new f(9)};new f(3),new f(3);const o$1={...s$1,...t$4,...n$2},t$3=/^(\S+):(\d+)$/;let r$2=class e{constructor(e={}){if(null!=e.address){const t=t$3.exec(e.address);if(null==t)throw new Error(`failed to parse address: ${e.address}`);this._address=t[1],this._port=null!=t[2]?parseInt(t[2]):null}else{if(null==e.host||null==e.port)throw new Error(`failed to create a managed node address: ${JSON.stringify(e)}`);this._address=e.host,this._port=e.port}Object.freeze(this)}static fromString(t){return new e({address:t})}toInsecure(){let t=50212===this.port?50211:this.port;return new e({host:this.address,port:t})}toSecure(){let t=50211===this.port?50212:this.port;return new e({host:this.address,port:t})}get address(){return this._address}get port(){return this._port}isTransportSecurity(){return 50212==this._port||443==this._port}toString(){return null==this.port?this.address:`${this.address}:${this.port}`}},t$2=class{constructor(e={}){if(null!=e.newNode)this._address="string"==typeof e.newNode.address?r$2.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=36e5,this._currentBackoff=this._minBackoff;else{if(null==e.cloneNode)throw new Error(`failed to create ManagedNode: ${JSON.stringify(e)}`);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}}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(),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(2*this._currentBackoff,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 0!=t?t:(t=this._currentBackoff-e._currentBackoff,0!=t?t:(t=this._badGrpcStatusCount-e._badGrpcStatusCount,0!=t?t:(t=this._useCount-e._useCount,0!=t?t:this._lastUsed-e._lastUsed)))}close(){null!=this._channel&&this._channel.close(),this._channel=null}};class d extends t$2{constructor(e={}){if(super(e),null!=e.newNode)this._accountId=e.newNode.accountId,this._nodeAddress=null;else{if(null==e.cloneNode)throw new Error(`failed to create node: ${JSON.stringify(e)}`);this._accountId=e.cloneNode.node._accountId,this._nodeAddress=e.cloneNode.node._nodeAddress}}getKey(){return this._accountId.toString()}toInsecure(){return new d({cloneNode:{node:this,address:this._address.toInsecure()}})}toSecure(){return new d({cloneNode:{node:this,address:this._address.toSecure()}})}get accountId(){return this._accountId}get nodeAddress(){return this._nodeAddress}setNodeAddress(e){return this._nodeAddress=e,this}}class o{constructor(e){this._network=new Map,this._nodes=[],this._healthyNodes=[],this._createNetworkChannel=e,this._ledgerId=null,this._minBackoff=8e3,this._maxBackoff=36e5,this._maxNodeAttempts=-1,this._nodeMinReadmitPeriod=this._minBackoff,this._nodeMaxReadmitPeriod=this._maxBackoff,this._earliestReadmitTime=Date.now()+this._nodeMinReadmitPeriod}setNetworkName(e){return console.warn("Deprecated: Use `setLedgerId` instead"),this.setLedgerId(e)}get networkName(){return console.warn("Deprecated: Use `ledgerId` instead"),null!=this.ledgerId?this.ledgerId.toString():null}setLedgerId(e){return this._ledgerId="string"==typeof e?r$3.fromString(e):e,this}get ledgerId(){return null!=this._ledgerId?this._ledgerId:null}_createNodeFromNetworkEntry(e){throw new Error("not implemented")}_getNodesToRemove(e){throw new Error("not implemented")}_removeDeadNodes(){if(this._maxNodeAttempts>0)for(let e=this._nodes.length-1;e>=0;e--)this._nodes[e]._badGrpcStatusCount<this._maxNodeAttempts||this._closeNode(e)}_readmitNodes(){const e=Date.now();if(this._earliestReadmitTime<=e){let t=Number.MAX_SAFE_INTEGER,n=!0;e:for(let o=0;o<this._nodes.length;o++){for(let r=0;r<this._healthyNodes.length;r++)if(n&&this._nodes[o]._readmitTime>e&&(t=Math.min(this._nodes[o]._readmitTime,t)),this._nodes[o]==this._healthyNodes[r])continue e;n=!1,this._nodes[o]._readmitTime<=e&&this._healthyNodes.push(this._nodes[o])}this._earliestReadmitTime=Math.min(Math.max(t,this._nodeMinReadmitPeriod),this._nodeMaxReadmitPeriod)}}_getNumberOfMostHealthyNodes(e){this._removeDeadNodes(),this._readmitNodes();const t=[];let n=this._healthyNodes.slice();e=Math.min(e,n.length);for(let o=0;o<e;o++){const e=n[Math.floor(Math.random()*n.length)];if(!e)break;t.push(e),n=n.filter((t=>t.getKey()!==e.getKey()))}return t}_closeNode(e){const t=this._nodes[e];t.close(),this._removeNodeFromNetwork(t),this._nodes.splice(e,1)}_removeNodeFromNetwork(e){const t=this._network.get(e.getKey());for(let n=0;n<t.length;n++)if(t[n]===e){t.splice(n,1);break}0===t.length&&this._network.delete(e.getKey())}_setNetwork(e){const t=[],n=new Set,o=new Set,r=[],i=new Map;for(const a of this._getNodesToRemove(e))this._closeNode(a);for(const a of this._nodes)t.push(a),n.add(a.getKey()),o.add(a.address.toString());for(const[a,s]of e)n.has(s.toString())&&o.has(a)||t.push(this._createNodeFromNetworkEntry([a,s]));j(t);for(const a of t){if(!a.isHealthy())continue;r.push(a);const e=i.has(a.getKey())?i.get(a.getKey()):[];e.push(a),i.set(a.getKey(),e)}return this._nodes=t,this._healthyNodes=r,this._network=i,this._ledgerId=null,this}get maxNodeAttempts(){return this._maxNodeAttempts}setMaxNodeAttempts(e){return this._maxNodeAttempts=e,this}get minBackoff(){return this._minBackoff}setMinBackoff(e){this._minBackoff=e;for(const t of this._nodes)t.setMinBackoff(e);return this}get maxBackoff(){return this._maxBackoff}setMaxBackoff(e){this._maxBackoff=e;for(const t of this._nodes)t.setMaxBackoff(e);return this}get nodeMinReadmitPeriod(){return this._nodeMinReadmitPeriod}setNodeMinReadmitPeriod(e){return this._nodeMinReadmitPeriod=e,this._earliestReadmitTime=Date.now()+this._nodeMinReadmitPeriod,this}get nodeMaxReadmitPeriod(){return this._nodeMaxReadmitPeriod}setNodeMaxReadmitPeriod(e){return this._nodeMaxReadmitPeriod=e,this}getNode(e){if(this._readmitNodes(),null!=e&&null!=e){const t=this._network.get(e.toString());if(t)return t[Math.floor(Math.random()*t.length)];{const e=Array.from(this._network.keys()),t=e[Math.floor(Math.random()*e.length)],n=this._network.get(t);return n[Math.floor(Math.random()*n.length)]}}if(0==this._healthyNodes.length)throw new Error("failed to find a healthy working node");return this._healthyNodes[Math.floor(Math.random()*this._healthyNodes.length)]}increaseBackoff(e){e.increaseBackoff();for(let t=0;t<this._healthyNodes.length;t++)this._healthyNodes[t]==e&&this._healthyNodes.splice(t,1)}decreaseBackoff(e){e.decreaseBackoff()}close(){for(const e of this._nodes)e.close();this._network.clear(),this._nodes=[]}}let i$3=class extends o{constructor(e){super(e),this._maxNodesPerTransaction=-1,this._addressBook=null,this._transportSecurity=!1}setNetwork(e){this._setNetwork(new Map(Object.entries(e).map((([e,t])=>[e,"string"==typeof t?f.fromString(t):t]))))}setNetworkFromAddressBook(e){const t={},n=this.isTransportSecurity()?50212:50211;for(const o of e.nodeAddresses)for(const e of o.addresses)e.port===n&&null!=o.accountId&&(t[e.toString()]=o.accountId);return this.setNetwork(t),this}get network(){var e={};for(const t of this._nodes)e[t.address.toString()]=t.accountId;return e}setNetworkName(e){switch(super.setLedgerId(e),e){case"mainnet":this._addressBook=b$1;break;case"testnet":this._addressBook=o$2;break;case"previewnet":this._addressBook=d$1}if(null!=this._addressBook)for(const t of this._nodes)for(const e of this._addressBook.nodeAddresses)null!=e.accountId&&e.accountId.toString()===t.accountId.toString()&&t.setNodeAddress(e);return this}get networkName(){return null!=this._ledgerId?this._ledgerId.toString():null}_createNodeFromNetworkEntry(e){const t="string"==typeof e[1]?f.fromString(e[1]):e[1];return new d({newNode:{address:e[0],accountId:t,channelInitFunction:this._createNetworkChannel}}).setMinBackoff(this._minBackoff)}_getNodesToRemove(e){const t=[];for(let n=this._nodes.length-1;n>=0;n--){const o=this._nodes[n],r=e.get(o.address.toString());null!=r&&r.toString()===o.accountId.toString()||t.push(n)}return t}_checkNetworkContainsEntry(e){for(const t of this._nodes)if(t.address.toString()===e[0])return!0;return!1}get maxNodesPerTransaction(){return this._maxNodesPerTransaction}setMaxNodesPerTransaction(e){return this._maxNodesPerTransaction=e,this}get maxNodeAttempts(){return this._maxNodeAttempts}setMaxNodeAttempts(e){return this._maxNodeAttempts=e,this}isTransportSecurity(){return this._transportSecurity}setTransportSecurity(e){if(this._transportSecurity==e)return this;this._network.clear();for(let t=0;t<this._nodes.length;t++){let n=this._nodes[t];n.close(),n=e?n.toSecure().setCert(null!=this._ledgerId?this._ledgerId.toString():""):n.toInsecure(),this._nodes[t]=n;const o=null!=this._network.get(n.getKey())?this._network.get(n.getKey()):[];o.push(n),this._network.set(n.getKey(),o)}return this._healthyNodes=[...this._nodes],this._transportSecurity=e,this}getNumberOfNodesForTransaction(){return this._maxNodesPerTransaction>0?this._maxNodesPerTransaction:this._nodes.length<=9?this._nodes.length:Math.floor((this._nodes.length+3-1)/3)}getNodeAccountIdsForExecute(){return this._getNumberOfMostHealthyNodes(this.getNumberOfNodesForTransaction()).map((e=>e.accountId))}},t$1=class extends t$2{constructor(e={}){super(e)}getKey(){return this._address.toString()}},r$1=class extends o{constructor(e){super(e)}setNetwork(e){this._setNetwork(new Map(e.map((e=>[e,e]))))}get network(){var e=[];for(const t of this._nodes)e.push(t.address.toString());return e}_createNodeFromNetworkEntry(e){return new t$1({newNode:{address:e[1],channelInitFunction:this._createNetworkChannel}}).setMinBackoff(this._minBackoff)}_getNodesToRemove(e){const t=[],n=Object.values(e);for(let o=this._nodes.length-1;o>=0;o--){const e=this._nodes[o];n.includes(e.address.toString())||t.push(o)}return t}getNextMirrorNode(){if(null==this._createNetworkChannel)throw new Error("mirror network not supported on browser");return this._getNumberOfMostHealthyNodes(1)[0]}};class m{constructor(e){this._mirrorNetwork=new r$1(this._createMirrorNetworkChannel()),this._network=new i$3(this._createNetworkChannel()),this._operator=null,this._defaultMaxTransactionFee=null,this._defaultMaxQueryPayment=new e$7(1),null!=e&&null!=e.operator&&this.setOperator(e.operator.accountId,e.operator.privateKey),this._maxAttempts=null,this._signOnDemand=!1,this._autoValidateChecksums=!1,this._minBackoff=250,this._maxBackoff=8e3,this._defaultRegenerateTransactionId=!0,this._requestTimeout=null,this._isUpdatingNetwork=!1,this._networkUpdatePeriod=864e5,this._isShutdown=!1,null!=e&&!1!==e.scheduleNetworkUpdate&&this._scheduleNetworkUpdate(),this._timer,this._logger=null}setNetworkName(e){return console.warn("Deprecated: Use `setLedgerId` instead"),this.setLedgerId(e)}get networkName(){return console.warn("Deprecated: Use `ledgerId` instead"),null!=this.ledgerId?this.ledgerId.toString():null}setLedgerId(e){return this._network.setLedgerId("string"==typeof e?r$3.fromString(e):e),this}get ledgerId(){return null!=this._network._ledgerId?this._network.ledgerId:null}setNetwork(e){throw new Error("not implemented")}setNetworkFromAddressBook(e){return this._network.setNetworkFromAddressBook(e),this}get network(){return this._network.network}setMirrorNetwork(e){throw new Error("not implemented")}get mirrorNetwork(){return this._mirrorNetwork.network}get signOnDemand(){return this._signOnDemand}setSignOnDemand(e){this._signOnDemand=e}isTransportSecurity(){return this._network.isTransportSecurity()}setTransportSecurity(e){return this._network.setTransportSecurity(e),this}setOperator(e,t){const n="string"==typeof t?y$2.fromStringDer(t):t;return this.setOperatorWith(e,n.publicKey,(e=>Promise.resolve(n.sign(e))))}getOperator(){return this._operator}setOperatorWith(e,t,n){const o=e instanceof f?e:f.fromString(e);return null!=this._network._ledgerId&&o.validateChecksum(this),this._operator={transactionSigner:n,accountId:o,publicKey:t instanceof i$7?t:i$7.fromString(t)},this}setAutoValidateChecksums(e){return this._autoValidateChecksums=e,this}isAutoValidateChecksumsEnabled(){return this._autoValidateChecksums}get operatorAccountId(){return null!=this._operator?this._operator.accountId:null}get operatorPublicKey(){return null!=this._operator?this._operator.publicKey:null}get defaultMaxTransactionFee(){return this._defaultMaxTransactionFee}get maxTransactionFee(){return this.defaultMaxTransactionFee}setDefaultMaxTransactionFee(e){if(e.toTinybars().toInt()<0)throw new Error("defaultMaxTransactionFee must be non-negative");return this._defaultMaxTransactionFee=e,this}setMaxTransactionFee(e){return this.setDefaultMaxTransactionFee(e)}get defaultRegenerateTransactionId(){return this._defaultRegenerateTransactionId}setDefaultRegenerateTransactionId(e){return this._defaultRegenerateTransactionId=e,this}get defaultMaxQueryPayment(){return this._defaultMaxQueryPayment}get maxQueryPayment(){return this.defaultMaxQueryPayment}setDefaultMaxQueryPayment(e){if(d$7(e.toTinybars())<0)throw new Error("defaultMaxQueryPayment must be non-negative");return this._defaultMaxQueryPayment=e,this}setMaxQueryPayment(e){return this.setDefaultMaxQueryPayment(e)}get maxAttempts(){return null!=this._maxAttempts?this._maxAttempts:10}setMaxAttempts(e){return this._maxAttempts=e,this}get maxNodeAttempts(){return this._network.maxNodeAttempts}setMaxNodeAttempts(e){return this._network.setMaxNodeAttempts(e),this}get nodeWaitTime(){return this._network.minBackoff}setNodeWaitTime(e){return this._network.setMinBackoff(e),this}get maxNodesPerTransaction(){return this._network.maxNodesPerTransaction}setMaxNodesPerTransaction(e){return this._network.setMaxNodesPerTransaction(e),this}setMinBackoff(e){if(null==e)throw new Error("minBackoff cannot be null.");if(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(null==e)throw new Error("maxBackoff cannot be null.");if(e<this._minBackoff)throw new Error("maxBackoff cannot be smaller than minBackoff.");return this._maxBackoff=e,this}get maxBackoff(){return this._maxBackoff}setNodeMinBackoff(e){return this._network.setMinBackoff(e),this}get nodeMinBackoff(){return this._network.minBackoff}setNodeMaxBackoff(e){return this._network.setMaxBackoff(e),this}get nodeMaxBackoff(){return this._network.maxBackoff}setNodeMinReadmitPeriod(e){return this._network.setNodeMinReadmitPeriod(e),this}get nodeMinReadmitPeriod(){return this._network.nodeMinReadmitPeriod}setNodeMaxReadmitPeriod(e){return this._network.setNodeMaxReadmitPeriod(e),this}get nodeMaxReadmitPeriod(){return this._network.nodeMaxReadmitPeriod}setRequestTimeout(e){return this._requestTimeout=e,this}get requestTimeout(){return this._requestTimeout}get networkUpdatePeriod(){return this._networkUpdatePeriod}setNetworkUpdatePeriod(e){return clearTimeout(this._timer),this._networkUpdatePeriod=e,this._scheduleNetworkUpdate(),this}setLogger(e){return this._logger=e,this}get logger(){return this._logger}async ping(t){await new e({accountId:t}).setNodeAccountIds([t instanceof f?t:f.fromString(t)]).execute(this)}async pingAll(){for(const e of Object.values(this._network.network))await this.ping(e)}async updateNetwork(){if(!this._isUpdatingNetwork){this._isUpdatingNetwork=!0;try{const e=await t$j.addressBookQueryConstructor().setFileId(u$4.ADDRESS_BOOK).execute(this);this.setNetworkFromAddressBook(e)}catch(e){this._logger&&this._logger.trace(`failed to update client address book: ${e.toString()}`)}finally{this._isUpdatingNetwork=!1}}}close(){this._network.close(),this._mirrorNetwork.close(),this._isShutdown=!0,clearTimeout(this._timer)}_createNetworkChannel(){throw new Error("not implemented")}_createMirrorNetworkChannel(){throw new Error("not implemented")}_scheduleNetworkUpdate(){this._timer=setTimeout((async()=>{await this.updateNetwork(),this._isShutdown||this._scheduleNetworkUpdate()}),this._networkUpdatePeriod)}get isClientShutDown(){return this._isShutdown}}class t{constructor(e){this._code=e,Object.freeze(this)}static _fromValue(e){return new t(e)}toString(){return this._code.toString()}valueOf(){return this._code}}const{proto:r}=e$b;let n$1=class{constructor(){this._crypto=null,this._smartContract=null,this._file=null,this._consensus=null,this._freeze=null,this._network=null,this._token=null,this._schedule=null,this._util=null,this._addressBook=null}close(){throw new Error("not implemented")}get crypto(){return null!=this._crypto||(this._crypto=r.CryptoService.create(this._createUnaryClient("CryptoService"))),this._crypto}get smartContract(){return null!=this._smartContract||(this._smartContract=r.SmartContractService.create(this._createUnaryClient("SmartContractService"))),this._smartContract}get file(){return null!=this._file||(this._file=r.FileService.create(this._createUnaryClient("FileService"))),this._file}get consensus(){return null!=this._consensus||(this._consensus=r.ConsensusService.create(this._createUnaryClient("ConsensusService"))),this._consensus}get freeze(){return null!=this._freeze||(this._freeze=r.FreezeService.create(this._createUnaryClient("FreezeService"))),this._freeze}get network(){return null!=this._network||(this._network=r.NetworkService.create(this._createUnaryClient("NetworkService"))),this._network}get token(){return null!=this._token||(this._token=r.TokenService.create(this._createUnaryClient("TokenService"))),this._token}get schedule(){return null!=this._schedule||(this._schedule=r.ScheduleService.create(this._createUnaryClient("ScheduleService"))),this._schedule}get util(){return null!=this._util||(this._util=r.UtilService.create(this._createUnaryClient("UtilService"))),this._util}get addressBook(){return null!=this._addressBook||(this._addressBook=r.AddressBookService.create(this._createUnaryClient("AddressBookService"))),this._addressBook}_createUnaryClient(e){throw new Error("not implemented")}};function s(e){const t=new ArrayBuffer(e.byteLength+5);return new DataView(t,1,4).setUint32(0,e.length),new Uint8Array(t,5).set(e),t}function i$2(e,t=0,n=e.byteLength){const o=new DataView(e,t,n);let r=0,i=null,a=0;for(;r<o.byteLength;){const t=o.getUint8(r+0)>>7,n=o.getUint32(r+1),s=r+5;if(s+n>o.byteLength)throw new Error("(BUG) unexpected frame length past the boundary");const c=new Uint8Array(e,o.byteOffset+s,n);if(0===t){if(null!=i)throw new Error("(BUG) unexpectedly received more than one data frame");i=c}else{if(1!==t)throw new Error(`(BUG) unexpected frame type: ${t}`);{const e=e$3(c),[t,n]=e.split(":");if("grpc-status"!==t)throw new Error(`(BUG) unhandled trailer, ${e}`);a=parseInt(n)}}r+=n+5}if(0!==a)throw new Error(`(BUG) unhandled grpc-status: ${a}`);if(null==i)throw new Error("(BUG) unexpectedly received no response");return i}class c extends n$1{constructor(e){super(),this._address=e}close(){}_createUnaryClient(e){return async(n,o,r)=>{try{const i=await fetch(`${this._address}/proto.${e}/${n.name}`,{method:"POST",headers:{"content-type":"application/grpc-web+proto","x-user-agent":"hedera-sdk-js/v2","x-grpc-web":"1"},body:s(o)});i.ok||r(new r$6(t._fromValue(i.status)),null);const a=i.headers.get("grpc-status"),c=i.headers.get("grpc-message");if(null!=a&&null!=c){const e=new r$7(e$5._fromValue(parseInt(a)),o$1[this._address].toString());e.message=c,r(e,null)}r(null,i$2(await i.arrayBuffer()))}catch(i){r(new r$7(e$5._fromValue(18),o$1[this._address].toString()),null)}}}}const w={MAINNET:s$1,TESTNET:t$4,PREVIEWNET:n$2};let i$1=class e extends m{constructor(e){if(super(e),null!=e)if("string"==typeof e.network)switch(e.network){case"mainnet":this.setNetwork(w.MAINNET),this.setLedgerId(r$3.MAINNET);break;case"testnet":this.setNetwork(w.TESTNET),this.setLedgerId(r$3.TESTNET);break;case"previewnet":this.setNetwork(w.PREVIEWNET),this.setLedgerId(r$3.PREVIEWNET);break;default:throw new Error(`unknown network: ${e.network}`)}else null!=e.network&&this.setNetwork(e.network)}static fromConfig(t){return new e("string"==typeof t?JSON.parse(t):t)}static forNetwork(t){return new e({network:t,scheduleNetworkUpdate:!1})}static forName(t){return new e({network:t,scheduleNetworkUpdate:!1})}static forMainnet(){return new e({network:"mainnet",scheduleNetworkUpdate:!1})}static forTestnet(){return new e({network:"testnet",scheduleNetworkUpdate:!1})}static forPreviewnet(){return new e({network:"previewnet",scheduleNetworkUpdate:!1})}setNetwork(e){if("string"==typeof e)switch(e){case"previewnet":this._network.setNetwork(w.PREVIEWNET);break;case"testnet":this._network.setNetwork(w.TESTNET);break;case"mainnet":this._network.setNetwork(w.MAINNET)}else this._network.setNetwork(e)}setMirrorNetwork(e){return"string"==typeof e?this._mirrorNetwork.setNetwork([]):this._mirrorNetwork.setNetwork(e),this}_createNetworkChannel(){return e=>new c(e)}_createMirrorNetworkChannel(){return()=>{throw new Error("mirror support is not supported in browsers")}}updateNetwork(){return Promise.reject(new Error("Update network is not supported in browsers"))}};const version="6.13.5";function checkType(e,t,n){const o=t.split("|").map((e=>e.trim()));for(let i=0;i<o.length;i++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const r=new Error(`invalid value for type ${t}`);throw r.code="INVALID_ARGUMENT",r.argument=`value.${n}`,r.value=e,r}function defineProperties(e,t,n){for(let o in t){let r=t[o];const i=n?n[o]:null;i&&checkType(r,i,o),Object.defineProperty(e,o,{enumerable:!0,value:r,writable:!1})}}function stringify(e){if(null==e)return"null";if(Array.isArray(e))return"[ "+e.map(stringify).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let o=0;o<e.length;o++)n+=t[e[o]>>4],n+=t[15&e[o]];return n}if("object"==typeof e&&"function"==typeof e.toJSON)return stringify(e.toJSON());switch(typeof e){case"boolean":case"symbol":case"number":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const t=Object.keys(e);return t.sort(),"{ "+t.map((t=>`${stringify(t)}: ${stringify(e[t])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function isError(e,t){return e&&e.code===t}function makeError(e,t,n){let o,r=e;{const o=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${stringify(n)}`);for(const e in n){if("shortMessage"===e)continue;const t=n[e];o.push(e+"="+stringify(t))}}o.push(`code=${t}`),o.push(`version=${version}`),o.length&&(e+=" ("+o.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":o=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":o=new RangeError(e);break;default:o=new Error(e)}return defineProperties(o,{code:t}),n&&Object.assign(o,n),null==o.shortMessage&&defineProperties(o,{shortMessage:r}),o}function assert(e,t,n,o){if(!e)throw makeError(t,n,o)}function assertArgument(e,t,n,o){assert(e,t,"INVALID_ARGUMENT",{argument:n,value:o})}function assertArgumentCount(e,t,n){null==n&&(n=""),n&&(n=": "+n),assert(e>=t,"missing argument"+n,"MISSING_ARGUMENT",{count:e,expectedCount:t}),assert(e<=t,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}function assertPrivate(e,t,n){if(null==n&&(n=""),e!==t){let e=n,t="new";n&&(e+=".",t+=" "+n),assert(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}function _getBytes(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let n=2;for(let o=0;o<t.length;o++)t[o]=parseInt(e.substring(n,n+2),16),n+=2;return t}assertArgument(!1,"invalid BytesLike value",t||"value",e)}function getBytes(e,t){return _getBytes(e,t,!1)}function getBytesCopy(e,t){return _getBytes(e,t,!0)}function isHexString(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(("number"!=typeof t||e.length===2+2*t)&&(!0!==t||e.length%2==0))}["NFD","NFC","NFKD","NFKC"].reduce(((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(n){}return e}),[]);const HexCharacters="0123456789abcdef";function hexlify(e){const t=getBytes(e);let n="0x";for(let o=0;o<t.length;o++){const e=t[o];n+=HexCharacters[(240&e)>>4]+HexCharacters[15&e]}return n}function concat(e){return"0x"+e.map((e=>hexlify(e).substring(2))).join("")}function dataSlice(e,t,n){const o=getBytes(e);return null!=n&&n>o.length&&assert(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:o,length:o.length,offset:n}),hexlify(o.slice(null==t?0:t,null==n?o.length:n))}function zeroPad(e,t,n){const o=getBytes(e);assert(t>=o.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(o),length:t,offset:t+1});const r=new Uint8Array(t);return r.fill(0),n?r.set(o,t-o.length):r.set(o,0),hexlify(r)}function zeroPadValue(e,t){return zeroPad(e,t,!0)}function zeroPadBytes(e,t){return zeroPad(e,t,!1)}const BN_0$2=BigInt(0),BN_1$1=BigInt(1),maxValue=9007199254740991;function fromTwos(e,t){const n=getUint(e,"value"),o=BigInt(getNumber(t,"width"));if(assert(n>>o===BN_0$2,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>o-BN_1$1){return-((~n&(BN_1$1<<o)-BN_1$1)+BN_1$1)}return n}function toTwos(e,t){let n=getBigInt(e,"value");const o=BigInt(getNumber(t,"width")),r=BN_1$1<<o-BN_1$1;if(n<BN_0$2){n=-n,assert(n<=r,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return(~n&(BN_1$1<<o)-BN_1$1)+BN_1$1}return assert(n<r,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e}),n}function mask(e,t){const n=getUint(e,"value"),o=BigInt(getNumber(t,"bits"));return n&(BN_1$1<<o)-BN_1$1}function getBigInt(e,t){switch(typeof e){case"bigint":return e;case"number":return assertArgument(Number.isInteger(e),"underflow",t||"value",e),assertArgument(e>=-9007199254740991&&e<=maxValue,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(n){assertArgument(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}assertArgument(!1,"invalid BigNumberish value",t||"value",e)}function getUint(e,t){const n=getBigInt(e,t);return assert(n>=BN_0$2,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const Nibbles="0123456789abcdef";function toBigInt(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=Nibbles[n>>4],t+=Nibbles[15&n];return BigInt(t)}return getBigInt(e)}function getNumber(e,t){switch(typeof e){case"bigint":return assertArgument(e>=-9007199254740991&&e<=maxValue,"overflow",t||"value",e),Number(e);case"number":return assertArgument(Number.isInteger(e),"underflow",t||"value",e),assertArgument(e>=-9007199254740991&&e<=maxValue,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return getNumber(BigInt(e),t)}catch(n){assertArgument(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}assertArgument(!1,"invalid numeric value",t||"value",e)}function toNumber(e){return getNumber(toBigInt(e))}function toBeHex(e,t){let n=getUint(e,"value").toString(16);if(null==t)n.length%2&&(n="0"+n);else{const o=getNumber(t,"width");for(assert(2*o>=n.length,`value exceeds width (${o} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});n.length<2*o;)n="0"+n}return"0x"+n}function toBeArray(e){const t=getUint(e,"value");if(t===BN_0$2)return new Uint8Array([]);let n=t.toString(16);n.length%2&&(n="0"+n);const o=new Uint8Array(n.length/2);for(let r=0;r<o.length;r++){const e=2*r;o[r]=parseInt(n.substring(e,e+2),16)}return o}function errorFunc(e,t,n,o,r){assertArgument(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",n)}function ignoreFunc(e,t,n,o,r){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let o=t+1;o<n.length&&n[o]>>6==2;o++)e++;return e}return"OVERRUN"===e?n.length-t-1:0}function replaceFunc(e,t,n,o,r){return"OVERLONG"===e?(assertArgument("number"==typeof r,"invalid bad code point for replacement","badCodepoint",r),o.push(r),0):(o.push(65533),ignoreFunc(e,t,n))}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(e,t){null==t&&(t=Utf8ErrorFuncs.error);const n=getBytes(e,"bytes"),o=[];let r=0;for(;r<n.length;){const e=n[r++];if(!(e>>7)){o.push(e);continue}let i=null,a=null;if(192==(224&e))i=1,a=127;else if(224==(240&e))i=2,a=2047;else{if(240!=(248&e)){r+=t(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",r-1,n,o);continue}i=3,a=65535}if(r-1+i>=n.length){r+=t("OVERRUN",r-1,n,o);continue}let s=e&(1<<8-i-1)-1;for(let c=0;c<i;c++){let e=n[r];if(128!=(192&e)){r+=t("MISSING_CONTINUE",r,n,o),s=null;break}s=s<<6|63&e,r++}null!==s&&(s>1114111?r+=t("OUT_OF_RANGE",r-1-i,n,o,s):s>=55296&&s<=57343?r+=t("UTF16_SURROGATE",r-1-i,n,o,s):s<=a?r+=t("OVERLONG",r-1-i,n,o,s):o.push(s))}return o}function toUtf8Bytes(e,t){assertArgument("string"==typeof e,"invalid string value","str",e);let n=[];for(let o=0;o<e.length;o++){const t=e.charCodeAt(o);if(t<128)n.push(t);else if(t<2048)n.push(t>>6|192),n.push(63&t|128);else if(55296==(64512&t)){o++;const r=e.charCodeAt(o);assertArgument(o<e.length&&56320==(64512&r),"invalid surrogate pair","str",e);const i=65536+((1023&t)<<10)+(1023&r);n.push(i>>18|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)}else n.push(t>>12|224),n.push(t>>6&63|128),n.push(63&t|128)}return new Uint8Array(n)}function _toUtf8String(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function toUtf8String(e,t){return _toUtf8String(getUtf8CodePoints(e,t))}const WordSize=32,Padding=new Uint8Array(WordSize),passProperties=["then"],_guard$1={},resultNames=new WeakMap;function getNames(e){return resultNames.get(e)}function setNames(e,t){resultNames.set(e,t)}function throwError(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw n.error=t,n}function toObject(e,t,n){return e.indexOf(null)>=0?t.map(((e,t)=>e instanceof Result?toObject(getNames(e),e,n):e)):e.reduce(((e,o,r)=>{let i=t.getValue(o);return o in e||(n&&i instanceof Result&&(i=toObject(getNames(i),i,n)),e[o]=i),e}),{})}const _Result=class e extends Array{constructor(...e){const t=e[0];let n=e[1],o=(e[2]||[]).slice(),r=!0;t!==_guard$1&&(n=e,o=[],r=!1),super(n.length),__privateAdd(this,_names),n.forEach(((e,t)=>{this[t]=e}));const i=o.reduce(((e,t)=>("string"==typeof t&&e.set(t,(e.get(t)||0)+1),e)),new Map);if(setNames(this,Object.freeze(n.map(((e,t)=>{const n=o[t];return null!=n&&1===i.get(n)?n:null})))),__privateSet(this,_names,[]),null==__privateGet(this,_names)&&__privateGet(this,_names),!r)return;Object.freeze(this);const a=new Proxy(this,{get:(e,t,n)=>{if("string"==typeof t){if(t.match(/^[0-9]+$/)){const n=getNumber(t,"%index");if(n<0||n>=this.length)throw new RangeError("out of result range");const o=e[n];return o instanceof Error&&throwError(`index ${n}`,o),o}if(passProperties.indexOf(t)>=0)return Reflect.get(e,t,n);const o=e[t];if(o instanceof Function)return function(...t){return o.apply(this===n?e:this,t)};if(!(t in e))return e.getValue.apply(this===n?e:this,[t])}return Reflect.get(e,t,n)}});return setNames(a,getNames(this)),a}toArray(t){const n=[];return this.forEach(((o,r)=>{o instanceof Error&&throwError(`index ${r}`,o),t&&o instanceof e&&(o=o.toArray(t)),n.push(o)})),n}toObject(e){const t=getNames(this);return t.reduce(((n,o,r)=>(assert(null!=o,`value at index ${r} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),toObject(t,this,e))),{})}slice(t,n){null==t&&(t=0),t<0&&(t+=this.length)<0&&(t=0),null==n&&(n=this.length),n<0&&(n+=this.length)<0&&(n=0),n>this.length&&(n=this.length);const o=getNames(this),r=[],i=[];for(let e=t;e<n;e++)r.push(this[e]),i.push(o[e]);return new e(_guard$1,r,i)}filter(t,n){const o=getNames(this),r=[],i=[];for(let e=0;e<this.length;e++){const a=this[e];a instanceof Error&&throwError(`index ${e}`,a),t.call(n,a,e,this)&&(r.push(a),i.push(o[e]))}return new e(_guard$1,r,i)}map(e,t){const n=[];for(let o=0;o<this.length;o++){const r=this[o];r instanceof Error&&throwError(`index ${o}`,r),n.push(e.call(t,r,o,this))}return n}getValue(e){const t=getNames(this).indexOf(e);if(-1===t)return;const n=this[t];return n instanceof Error&&throwError(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(t,n){return new e(_guard$1,t,n)}};_names=new WeakMap;let Result=_Result;function getValue(e){let t=toBeArray(e);return assert(t.length<=WordSize,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:WordSize,offset:t.length}),t.length!==WordSize&&(t=getBytesCopy(concat([Padding.slice(t.length%WordSize),t]))),t}class Coder{constructor(e,t,n,o){__publicField2(this,"name"),__publicField2(this,"type"),__publicField2(this,"localName"),__publicField2(this,"dynamic"),defineProperties(this,{name:e,type:t,localName:n,dynamic:o},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){assertArgument(!1,e,this.localName,t)}}class Writer{constructor(){__privateAdd(this,_Writer_instances),__privateAdd(this,_data),__privateAdd(this,_dataLength),__privateSet(this,_data,[]),__privateSet(this,_dataLength,0)}get data(){return concat(__privateGet(this,_data))}get length(){return __privateGet(this,_dataLength)}appendWriter(e){return __privateMethod(this,_Writer_instances,writeData_fn).call(this,getBytesCopy(e.data))}writeBytes(e){let t=getBytesCopy(e);const n=t.length%WordSize;return n&&(t=getBytesCopy(concat([t,Padding.slice(n)]))),__privateMethod(this,_Writer_instances,writeData_fn).call(this,t)}writeValue(e){return __privateMethod(this,_Writer_instances,writeData_fn).call(this,getValue(e))}writeUpdatableValue(){const e=__privateGet(this,_data).length;return __privateGet(this,_data).push(Padding),__privateSet(this,_dataLength,__privateGet(this,_dataLength)+WordSize),t=>{__privateGet(this,_data)[e]=getValue(t)}}}_data=new WeakMap,_dataLength=new WeakMap,_Writer_instances=new WeakSet,writeData_fn=function(e){return __privateGet(this,_data).push(e),__privateSet(this,_dataLength,__privateGet(this,_dataLength)+e.length),e.length};const _Reader=class e{constructor(e,t,n){__privateAdd(this,_Reader_instances),__publicField2(this,"allowLoose"),__privateAdd(this,_data2),__privateAdd(this,_offset),__privateAdd(this,_bytesRead),__privateAdd(this,_parent),__privateAdd(this,_maxInflation),defineProperties(this,{allowLoose:!!t}),__privateSet(this,_data2,getBytesCopy(e)),__privateSet(this,_bytesRead,0),__privateSet(this,_parent,null),__privateSet(this,_maxInflation,null!=n?n:1024),__privateSet(this,_offset,0)}get data(){return hexlify(__privateGet(this,_data2))}get dataLength(){return __privateGet(this,_data2).length}get consumed(){return __privateGet(this,_offset)}get bytes(){return new Uint8Array(__privateGet(this,_data2))}subReader(t){const n=new e(__privateGet(this,_data2).slice(__privateGet(this,_offset)+t),this.allowLoose,__privateGet(this,_maxInflation));return __privateSet(n,_parent,this),n}readBytes(e,t){let n=__privateMethod(this,_Reader_instances,peekBytes_fn).call(this,0,e,!!t);return __privateMethod(this,_Reader_instances,incrementBytesRead_fn).call(this,e),__privateSet(this,_offset,__privateGet(this,_offset)+n.length),n.slice(0,e)}readValue(){return toBigInt(this.readBytes(WordSize))}readIndex(){return toNumber(this.readBytes(WordSize))}};_data2=new WeakMap,_offset=new WeakMap,_bytesRead=new WeakMap,_parent=new WeakMap,_maxInflation=new WeakMap,_Reader_instances=new WeakSet,incrementBytesRead_fn=function(e){var t;if(__privateGet(this,_parent))return __privateMethod(t=__privateGet(this,_parent),_Reader_instances,incrementBytesRead_fn).call(t,e);__privateSet(this,_bytesRead,__privateGet(this,_bytesRead)+e),assert(__privateGet(this,_maxInflation)<1||__privateGet(this,_bytesRead)<=__privateGet(this,_maxInflation)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${__privateGet(this,_maxInflation)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:getBytesCopy(__privateGet(this,_data2)),offset:__privateGet(this,_offset),length:e,info:{bytesRead:__privateGet(this,_bytesRead),dataLength:this.dataLength}})},peekBytes_fn=function(e,t,n){let o=Math.ceil(t/WordSize)*WordSize;return __privateGet(this,_offset)+o>__privateGet(this,_data2).length&&(this.allowLoose&&n&&__privateGet(this,_offset)+t<=__privateGet(this,_data2).length?o=t:assert(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(__privateGet(this,_data2)),length:__privateGet(this,_data2).length,offset:__privateGet(this,_offset)+o})),__privateGet(this,_data2).slice(__privateGet(this,_offset),__privateGet(this,_offset)+o)};let Reader=_Reader;function number(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function bytes(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function exists(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function output(e,t){bytes(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}
116
+ */function requireSha3(){return hasRequiredSha3||(hasRequiredSha3=1,e=sha3$1,function(){var t="input is invalid type",n="object"==typeof window,o=n?window:{};o.JS_SHA3_NO_WINDOW&&(n=!1);var r=!n&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=commonjsGlobal:r&&(o=self);var i=!o.JS_SHA3_NO_COMMON_JS&&e.exports,a=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),c=[4,1024,262144,67108864],l=[0,8,16,24],u=[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],d=[224,256,384,512],p=[128,256],f=["hex","buffer","arrayBuffer","array","digest"],h={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var m=function(e,t,n){return function(o){return new C(e,t,e).update(o)[n]()}},y=function(e,t,n){return function(o,r){return new C(e,t,r).update(o)[n]()}},g=function(e,t,n){return function(t,o,r,i){return T["cshake"+e].update(t,o,r,i)[n]()}},b=function(e,t,n){return function(t,o,r,i){return T["kmac"+e].update(t,o,r,i)[n]()}},k=function(e,t,n,o){for(var r=0;r<f.length;++r){var i=f[r];e[i]=t(n,o,i)}return e},w=function(e,t){var n=m(e,t,"hex");return n.create=function(){return new C(e,t,e)},n.update=function(e){return n.create().update(e)},k(n,m,e,t)},v=[{name:"keccak",padding:[1,256,65536,16777216],bits:d,createMethod:w},{name:"sha3",padding:[6,1536,393216,100663296],bits:d,createMethod:w},{name:"shake",padding:[31,7936,2031616,520093696],bits:p,createMethod:function(e,t){var n=y(e,t,"hex");return n.create=function(n){return new C(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},k(n,y,e,t)}},{name:"cshake",padding:c,bits:p,createMethod:function(e,t){var n=h[e],o=g(e,0,"hex");return o.create=function(o,r,i){return r||i?new C(e,t,o).bytepad([r,i],n):T["shake"+e].create(o)},o.update=function(e,t,n,r){return o.create(t,n,r).update(e)},k(o,g,e,t)}},{name:"kmac",padding:c,bits:p,createMethod:function(e,t){var n=h[e],o=b(e,0,"hex");return o.create=function(o,r,i){return new N(e,t,r).bytepad(["KMAC",i],n).bytepad([o],n)},o.update=function(e,t,n,r){return o.create(e,n,r).update(t)},k(o,b,e,t)}}],T={},I=[],_=0;_<v.length;++_)for(var A=v[_],O=A.bits,E=0;E<O.length;++E){var S=A.name+"_"+O[E];if(I.push(S),T[S]=A.createMethod(O[E],A.padding),"sha3"!==A.name){var x=A.name+O[E];I.push(x),T[x]=T[S]}}function C(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var o=0;o<50;++o)this.s[o]=0}function N(e,t,n){C.call(this,e,t,n)}C.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,o=typeof e;if("string"!==o){if("object"!==o)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var r,i,s=this.blocks,c=this.byteCount,u=e.length,d=this.blockCount,p=0,f=this.s;p<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,r=1;r<d+1;++r)s[r]=0;if(n)for(r=this.start;p<u&&r<c;++p)s[r>>2]|=e[p]<<l[3&r++];else for(r=this.start;p<u&&r<c;++p)(i=e.charCodeAt(p))<128?s[r>>2]|=i<<l[3&r++]:i<2048?(s[r>>2]|=(192|i>>6)<<l[3&r++],s[r>>2]|=(128|63&i)<<l[3&r++]):i<55296||i>=57344?(s[r>>2]|=(224|i>>12)<<l[3&r++],s[r>>2]|=(128|i>>6&63)<<l[3&r++],s[r>>2]|=(128|63&i)<<l[3&r++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++p)),s[r>>2]|=(240|i>>18)<<l[3&r++],s[r>>2]|=(128|i>>12&63)<<l[3&r++],s[r>>2]|=(128|i>>6&63)<<l[3&r++],s[r>>2]|=(128|63&i)<<l[3&r++]);if(this.lastByteIndex=r,r>=c){for(this.start=r-c,this.block=s[d],r=0;r<d;++r)f[r]^=s[r];P(f),this.reset=!0}else this.start=r}return this},C.prototype.encode=function(e,t){var n=255&e,o=1,r=[n];for(n=255&(e>>=8);n>0;)r.unshift(n),n=255&(e>>=8),++o;return t?r.push(o):r.unshift(o),this.update(r),r.length},C.prototype.encodeString=function(e){var n,o=typeof e;if("string"!==o){if("object"!==o)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}var r=0,i=e.length;if(n)r=i;else for(var s=0;s<e.length;++s){var c=e.charCodeAt(s);c<128?r+=1:c<2048?r+=2:c<55296||c>=57344?r+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++s)),r+=4)}return r+=this.encode(8*r),this.update(e),r},C.prototype.bytepad=function(e,t){for(var n=this.encode(t),o=0;o<e.length;++o)n+=this.encodeString(e[o]);var r=t-n%t,i=[];return i.length=r,this.update(i),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,o=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)o[t]^=e[t];P(o)}},C.prototype.toString=C.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,o=this.outputBlocks,r=this.extraBytes,i=0,a=0,c="";a<o;){for(i=0;i<t&&a<o;++i,++a)e=n[i],c+=s[e>>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];a%t==0&&(P(n),i=0)}return r&&(e=n[i],c+=s[e>>4&15]+s[15&e],r>1&&(c+=s[e>>12&15]+s[e>>8&15]),r>2&&(c+=s[e>>20&15]+s[e>>16&15])),c},C.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,o=this.outputBlocks,r=this.extraBytes,i=0,a=0,s=this.outputBits>>3;e=r?new ArrayBuffer(o+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a<o;){for(i=0;i<t&&a<o;++i,++a)c[a]=n[i];a%t==0&&P(n)}return r&&(c[i]=n[i],e=e.slice(0,s)),e},C.prototype.buffer=C.prototype.arrayBuffer,C.prototype.digest=C.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,o=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,s=0,c=[];s<r;){for(a=0;a<n&&s<r;++a,++s)e=s<<2,t=o[a],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%n==0&&P(o)}return i&&(e=s<<2,t=o[a],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},N.prototype=new C,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var P=function(e){var t,n,o,r,i,a,s,c,l,d,p,f,h,m,y,g,b,k,w,v,T,I,_,A,O,E,S,x,C,N,P,R,D,B,L,j,$,F,U,M,K,G,H,V,z,q,Z,W,Q,Y,X,J,ee,te,ne,oe,re,ie,ae,se,ce,le,ue;for(o=0;o<48;o+=2)r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],p=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),n=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=r^(c<<1|l>>>31),n=i^(l<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(d<<1|p>>>31),n=s^(p<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(f<<1|h>>>31),n=l^(h<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(r<<1|i>>>31),n=p^(i<<1|r>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],y=e[1],q=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,x=e[20]<<3|e[21]>>>29,C=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,W=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,P=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,$=e[15]<<6|e[14]>>>26,k=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,D=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,O=e[7]<<28|e[6]>>>4,oe=e[17]<<23|e[16]>>>9,re=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,v=e[36]<<21|e[37]>>>11,T=e[37]<<21|e[36]>>>11,J=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,S=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,M=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,_=e[49]<<14|e[48]>>>18,e[0]=m^~g&k,e[1]=y^~b&w,e[10]=A^~E&x,e[11]=O^~S&C,e[20]=B^~j&F,e[21]=L^~$&U,e[30]=V^~q&W,e[31]=z^~Z&Q,e[40]=te^~oe&ie,e[41]=ne^~re&ae,e[2]=g^~k&v,e[3]=b^~w&T,e[12]=E^~x&N,e[13]=S^~C&P,e[22]=j^~F&M,e[23]=$^~U&K,e[32]=q^~W&Y,e[33]=Z^~Q&X,e[42]=oe^~ie&se,e[43]=re^~ae&ce,e[4]=k^~v&I,e[5]=w^~T&_,e[14]=x^~N&R,e[15]=C^~P&D,e[24]=F^~M&G,e[25]=U^~K&H,e[34]=W^~Y&J,e[35]=Q^~X&ee,e[44]=ie^~se&le,e[45]=ae^~ce&ue,e[6]=v^~I&m,e[7]=T^~_&y,e[16]=N^~R&A,e[17]=P^~D&O,e[26]=M^~G&B,e[27]=K^~H&L,e[36]=Y^~J&V,e[37]=X^~ee&z,e[46]=se^~le&te,e[47]=ce^~ue&ne,e[8]=I^~m&g,e[9]=_^~y&b,e[18]=R^~A&E,e[19]=D^~O&S,e[28]=G^~B&j,e[29]=H^~L&$,e[38]=J^~V&q,e[39]=ee^~z&Z,e[48]=le^~te&oe,e[49]=ue^~ne&re,e[0]^=u[o],e[1]^=u[o+1]};if(i)e.exports=T;else for(_=0;_<I.length;++_)o[I[_]]=T[I[_]]}()),sha3$1.exports;var e}var sha3Exports=requireSha3();const sha3=getDefaultExportFromCjs$1(sha3Exports);function keccak256$1(e){return"0x"+sha3.keccak_256(arrayify(e))}const version$2="address/5.8.0",logger$3=new Logger$1(version$2);function getChecksumAddress$1(e){isHexString$1(e,20)||logger$3.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let r=0;r<40;r++)n[r]=t[r].charCodeAt(0);const o=arrayify(keccak256$1(n));for(let r=0;r<40;r+=2)o[r>>1]>>4>=8&&(t[r]=t[r].toUpperCase()),(15&o[r>>1])>=8&&(t[r+1]=t[r+1].toUpperCase());return"0x"+t.join("")}const MAX_SAFE_INTEGER=9007199254740991;function log10(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}const ibanLookup$1={};for(let T=0;T<10;T++)ibanLookup$1[String(T)]=String(T);for(let T=0;T<26;T++)ibanLookup$1[String.fromCharCode(65+T)]=String(10+T);const safeDigits$1=Math.floor(log10(MAX_SAFE_INTEGER));function ibanChecksum$1(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>ibanLookup$1[e])).join("");for(;t.length>=safeDigits$1;){let e=t.substring(0,safeDigits$1);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}function getAddress$1(e){let t=null;if("string"!=typeof e&&logger$3.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=getChecksumAddress$1(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&logger$3.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==ibanChecksum$1(e)&&logger$3.throwArgumentError("bad icap checksum","address",e),t=_base36To16(e.substring(4));t.length<40;)t="0"+t;t=getChecksumAddress$1("0x"+t)}else logger$3.throwArgumentError("invalid address","address",e);return t}let AddressCoder$1=class extends Coder$1{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=getAddress$1(t)}catch(n){this._throwError(n.message,t)}return e.writeValue(t)}decode(e){return getAddress$1(hexZeroPad(e.readValue().toHexString(),20))}},AnonymousCoder$1=class extends Coder$1{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}};const logger$2=new Logger$1(version$3);function pack$1(e,t,n){let o=null;if(Array.isArray(n))o=n;else if(n&&"object"==typeof n){let e={};o=t.map((t=>{const o=t.localName;return o||logger$2.throwError("cannot encode object for signature with missing names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[o]&&logger$2.throwError("cannot encode object for signature with duplicate names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[o]=!0,n[o]}))}else logger$2.throwArgumentError("invalid tuple value","tuple",n);t.length!==o.length&&logger$2.throwArgumentError("types/value length mismatch","tuple",n);let r=new Writer$1(e.wordSize),i=new Writer$1(e.wordSize),a=[];t.forEach(((e,t)=>{let n=o[t];if(e.dynamic){let t=i.length;e.encode(i,n);let o=r.writeUpdatableValue();a.push((e=>{o(e+t)}))}else e.encode(r,n)})),a.forEach((e=>{e(r.length)}));let s=e.appendWriter(r);return s+=e.appendWriter(i),s}function unpack$1(e,t){let n=[],o=e.subReader(0);t.forEach((t=>{let r=null;if(t.dynamic){let n=e.readValue(),a=o.subReader(n.toNumber());try{r=t.decode(a)}catch(i){if(i.code===Logger$1.errors.BUFFER_OVERRUN)throw i;r=i,r.baseType=t.name,r.name=t.localName,r.type=t.type}}else try{r=t.decode(e)}catch(i){if(i.code===Logger$1.errors.BUFFER_OVERRUN)throw i;r=i,r.baseType=t.name,r.name=t.localName,r.type=t.type}null!=r&&n.push(r)}));const r=t.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach(((e,t)=>{let o=e.localName;if(!o||1!==r[o])return;if("length"===o&&(o="_length"),null!=n[o])return;const i=n[t];i instanceof Error?Object.defineProperty(n,o,{enumerable:!0,get:()=>{throw i}}):n[o]=i}));for(let i=0;i<n.length;i++){const e=n[i];e instanceof Error&&Object.defineProperty(n,i,{enumerable:!0,get:()=>{throw e}})}return Object.freeze(n)}let ArrayCoder$1=class extends Coder$1{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let n=this.length;-1===n&&(n=t.length,e.writeValue(t.length)),logger$2.checkArgumentCount(t.length,n,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let r=0;r<t.length;r++)o.push(this.coder);return pack$1(e,o,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&logger$2.throwError("insufficient data length",Logger$1.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let o=0;o<t;o++)n.push(new AnonymousCoder$1(this.coder));return e.coerce(this.name,unpack$1(e,n))}},BooleanCoder$1=class extends Coder$1{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}},DynamicBytesCoder$1=class extends Coder$1{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=arrayify(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}},BytesCoder$1=class extends DynamicBytesCoder$1{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,hexlify$1(super.decode(e)))}},FixedBytesCoder$1=class extends Coder$1{constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let n=arrayify(t);return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return e.coerce(this.name,hexlify$1(e.readBytes(this.size)))}},NullCoder$1=class extends Coder$1{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}};const NegativeOne=BigNumber.from(-1),Zero=BigNumber.from(0),One=BigNumber.from(1),MaxUint256=BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");let NumberCoder$1=class extends Coder$1{constructor(e,t,n){const o=(t?"int":"uint")+8*e;super(o,o,n,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let n=BigNumber.from(t),o=MaxUint256.mask(8*e.wordSize);if(this.signed){let e=o.mask(8*this.size-1);(n.gt(e)||n.lt(e.add(One).mul(NegativeOne)))&&this._throwError("value out-of-bounds",t)}else(n.lt(Zero)||n.gt(o.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return n=n.toTwos(8*this.size).mask(8*this.size),this.signed&&(n=n.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(n)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}};const version$1="strings/5.8.0",logger$1=new Logger$1(version$1);var UnicodeNormalizationForm,UnicodeNormalizationForm2,Utf8ErrorReason,Utf8ErrorReason2;function errorFunc$1(e,t,n,o,r){return logger$1.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)}function ignoreFunc$1(e,t,n,o,r){if(e===Utf8ErrorReason.BAD_PREFIX||e===Utf8ErrorReason.UNEXPECTED_CONTINUE){let e=0;for(let o=t+1;o<n.length&&n[o]>>6==2;o++)e++;return e}return e===Utf8ErrorReason.OVERRUN?n.length-t-1:0}function replaceFunc$1(e,t,n,o,r){return e===Utf8ErrorReason.OVERLONG?(o.push(r),0):(o.push(65533),ignoreFunc$1(e,t,n))}UnicodeNormalizationForm2=UnicodeNormalizationForm||(UnicodeNormalizationForm={}),UnicodeNormalizationForm2.current="",UnicodeNormalizationForm2.NFC="NFC",UnicodeNormalizationForm2.NFD="NFD",UnicodeNormalizationForm2.NFKC="NFKC",UnicodeNormalizationForm2.NFKD="NFKD",Utf8ErrorReason2=Utf8ErrorReason||(Utf8ErrorReason={}),Utf8ErrorReason2.UNEXPECTED_CONTINUE="unexpected continuation byte",Utf8ErrorReason2.BAD_PREFIX="bad codepoint prefix",Utf8ErrorReason2.OVERRUN="string overrun",Utf8ErrorReason2.MISSING_CONTINUE="missing continuation byte",Utf8ErrorReason2.OUT_OF_RANGE="out of UTF-8 range",Utf8ErrorReason2.UTF16_SURROGATE="UTF-16 surrogate",Utf8ErrorReason2.OVERLONG="overlong representation";const Utf8ErrorFuncs$1=Object.freeze({error:errorFunc$1,ignore:ignoreFunc$1,replace:replaceFunc$1});function getUtf8CodePoints$1(e,t){null==t&&(t=Utf8ErrorFuncs$1.error),e=arrayify(e);const n=[];let o=0;for(;o<e.length;){const r=e[o++];if(!(r>>7)){n.push(r);continue}let i=null,a=null;if(192==(224&r))i=1,a=127;else if(224==(240&r))i=2,a=2047;else{if(240!=(248&r)){o+=t(128==(192&r)?Utf8ErrorReason.UNEXPECTED_CONTINUE:Utf8ErrorReason.BAD_PREFIX,o-1,e,n);continue}i=3,a=65535}if(o-1+i>=e.length){o+=t(Utf8ErrorReason.OVERRUN,o-1,e,n);continue}let s=r&(1<<8-i-1)-1;for(let c=0;c<i;c++){let r=e[o];if(128!=(192&r)){o+=t(Utf8ErrorReason.MISSING_CONTINUE,o,e,n),s=null;break}s=s<<6|63&r,o++}null!==s&&(s>1114111?o+=t(Utf8ErrorReason.OUT_OF_RANGE,o-1-i,e,n,s):s>=55296&&s<=57343?o+=t(Utf8ErrorReason.UTF16_SURROGATE,o-1-i,e,n,s):s<=a?o+=t(Utf8ErrorReason.OVERLONG,o-1-i,e,n,s):n.push(s))}return n}function toUtf8Bytes$1(e,t=UnicodeNormalizationForm.current){t!=UnicodeNormalizationForm.current&&(logger$1.checkNormalize(),e=e.normalize(t));let n=[];for(let o=0;o<e.length;o++){const t=e.charCodeAt(o);if(t<128)n.push(t);else if(t<2048)n.push(t>>6|192),n.push(63&t|128);else if(55296==(64512&t)){o++;const r=e.charCodeAt(o);if(o>=e.length||56320!=(64512&r))throw new Error("invalid utf-8 string");const i=65536+((1023&t)<<10)+(1023&r);n.push(i>>18|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)}else n.push(t>>12|224),n.push(t>>6&63|128),n.push(63&t|128)}return arrayify(n)}function _toUtf8String$1(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function toUtf8String$1(e,t){return _toUtf8String$1(getUtf8CodePoints$1(e,t))}let StringCoder$1=class extends DynamicBytesCoder$1{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,toUtf8Bytes$1(t))}decode(e){return toUtf8String$1(super.decode(e))}},TupleCoder$1=class extends Coder$1{constructor(e,t){let n=!1;const o=[];e.forEach((e=>{e.dynamic&&(n=!0),o.push(e.type)}));super("tuple","tuple("+o.join(",")+")",t,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,o)=>{let r=n.localName;r&&1===t[r]&&("length"===r&&(r="_length"),null==e[r]&&(e[r]=e[o]))})),Object.freeze(e)}encode(e,t){return pack$1(e,this.coders,t)}decode(e){return e.coerce(this.name,unpack$1(e,this.coders))}};const logger=new Logger$1(version$3),paramTypeBytes$1=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber$1=new RegExp(/^(u?int)([0-9]*)$/);let AbiCoder$1=class{constructor(e){defineReadOnly(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new AddressCoder$1(e.name);case"bool":return new BooleanCoder$1(e.name);case"string":return new StringCoder$1(e.name);case"bytes":return new BytesCoder$1(e.name);case"array":return new ArrayCoder$1(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new TupleCoder$1((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new NullCoder$1(e.name)}let t=e.type.match(paramTypeNumber$1);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!=0)&&logger.throwArgumentError("invalid "+t[1]+" bit length","param",e),new NumberCoder$1(n/8,"int"===t[1],e.name)}if(t=e.type.match(paramTypeBytes$1),t){let n=parseInt(t[1]);return(0===n||n>32)&&logger.throwArgumentError("invalid bytes length","param",e),new FixedBytesCoder$1(n,e.name)}return logger.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new Reader$1(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Writer$1(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(ParamType$1.from(e))));return new TupleCoder$1(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&logger.throwError("types/values length mismatch",Logger$1.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(ParamType$1.from(e)))),o=new TupleCoder$1(n,"_"),r=this._getWriter();return o.encode(r,t),r.data}decode(e,t,n){const o=e.map((e=>this._getCoder(ParamType$1.from(e))));return new TupleCoder$1(o,"_").decode(this._getReader(arrayify(t),n))}};const defaultAbiCoder=new AbiCoder$1,{proto:r$5}=e$b;let c$1=class e{constructor(e){this.contractId=e.contractId,this.nonce=e.nonce,Object.freeze(this)}static _fromProtobuf(t){return new e({contractId:v._fromProtobuf(t.contractId),nonce:null!=t.nonce?t.nonce:Long.ZERO})}_toProtobuf(){return{contractId:this.contractId._toProtobuf(),nonce:this.nonce}}static fromBytes(t){return e._fromProtobuf(r$5.ContractNonceInfo.decode(t))}toBytes(){return r$5.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)}},l$3=class e{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,this.signerNonce=e.signerNonce}static _fromProtobuf(t,n){const o=t.contractID,r=t.gasUsed,i=t.gas?t.gas:-1,a=t.amount?t.amount:-1;return new e({_createResult:n,bytes:t.contractCallResult,contractId:null!=o?v._fromProtobuf(o):null,errorMessage:null!=t.errorMessage?t.errorMessage:null,bloom:t.bloom,gasUsed:r instanceof Long?r:Long.fromValue(r),logs:(null!=t.logInfo?t.logInfo:[]).map((e=>o$7._fromProtobuf(e))),createdContractIds:(null!=t.createdContractIDs?t.createdContractIDs:[]).map((e=>v._fromProtobuf(e))),evmAddress:null!=t.evmAddress&&Object.hasOwn(t.evmAddress,"value")&&null!=t.evmAddress.value?t.evmAddress.value:null,stateChanges:[],gas:i instanceof Long?i:Long.fromValue(i),amount:a instanceof Long?a:Long.fromValue(a),functionParameters:t.functionParameters,senderAccountId:null!=t.senderId?f._fromProtobuf(t.senderId):null,contractNonces:(null!=t.contractNonces?t.contractNonces:[]).map((e=>c$1._fromProtobuf(e))),signerNonce:null!=t.signerNonce&&Object.hasOwn(t.signerNonce,"value")&&t.signerNonce.value||null})}asBytes(){return this.bytes}getString(e){return e$3(this.getBytes(e))}getBytes(e){const t=this.getInt32(e),n=E$1(this.bytes).getInt32(t+28);return this.bytes.subarray(t+32,t+32+n)}getBytes32(e){return this.bytes.subarray(32*(null!=e?e:0),32*(null!=e?e:0)+32)}getBool(e){return 0!==this.bytes[32*(null!=e?e:0)+31]}getInt8(e){const t=32*(null!=e?e:0)+31;return E$1(this.bytes).getInt8(t)}getUint8(e){return this.bytes[32*(null!=e?e:0)+31]}getInt16(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getInt32(t)}getUint16(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getUint32(t)}getInt24(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getInt32(t)}getUint24(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getUint32(t)}getInt32(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getInt32(t)}getUint32(e){const t=32*(null!=e?e:0)+28;return E$1(this.bytes).getUint32(t)}getInt40(e){const t=defaultAbiCoder.decode(["int40"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint40(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(27,32)),16)}getInt48(e){const t=defaultAbiCoder.decode(["int48"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint48(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(26,32)),16)}getInt56(e){const t=defaultAbiCoder.decode(["int56"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint56(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(25,32)),16)}getInt64(e){const t=defaultAbiCoder.decode(["int64"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint64(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(24,32)),16)}getInt72(e){const t=defaultAbiCoder.decode(["int72"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint72(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(23,32)),16)}getInt80(e){const t=defaultAbiCoder.decode(["int80"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint80(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(22,32)),16)}getInt88(e){const t=defaultAbiCoder.decode(["int88"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint88(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(21,32)),16)}getInt96(e){const t=defaultAbiCoder.decode(["int96"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint96(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(20,32)),16)}getInt104(e){const t=defaultAbiCoder.decode(["int104"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint104(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(19,32)),16)}getInt112(e){const t=defaultAbiCoder.decode(["int112"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint112(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(18,32)),16)}getInt120(e){const t=defaultAbiCoder.decode(["int120"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint120(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(17,32)),16)}getInt128(e){const t=defaultAbiCoder.decode(["int128"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint128(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(16,32)),16)}getInt136(e){const t=defaultAbiCoder.decode(["int136"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint136(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(15,32)),16)}getInt144(e){const t=defaultAbiCoder.decode(["int144"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint144(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(14,32)),16)}getInt152(e){const t=defaultAbiCoder.decode(["int152"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint152(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(13,32)),16)}getInt160(e){const t=defaultAbiCoder.decode(["int160"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint160(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(12,32)),16)}getInt168(e){const t=defaultAbiCoder.decode(["int168"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint168(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(11,32)),16)}getInt176(e){const t=defaultAbiCoder.decode(["int176"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint176(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(10,32)),16)}getInt184(e){const t=defaultAbiCoder.decode(["int184"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint184(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(9,32)),16)}getInt192(e){const t=defaultAbiCoder.decode(["int192"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint192(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(8,32)),16)}getInt200(e){const t=defaultAbiCoder.decode(["int200"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint200(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(7,32)),16)}getInt208(e){const t=defaultAbiCoder.decode(["int208"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint208(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(6,32)),16)}getInt216(e){const t=defaultAbiCoder.decode(["int216"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint216(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(5,32)),16)}getInt224(e){const t=defaultAbiCoder.decode(["int224"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint224(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(4,32)),16)}getInt232(e){const t=defaultAbiCoder.decode(["int232"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint232(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(3,32)),16)}getInt240(e){const t=defaultAbiCoder.decode(["int240"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint240(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(2,32)),16)}getInt248(e){const t=defaultAbiCoder.decode(["int248"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint248(e){return new BigNumber$1(n$e(this._getBytes32(e).subarray(1,32)),16)}getInt256(e){const t=defaultAbiCoder.decode(["int256"],this._getBytes32(null!=e?e:0));return new BigNumber$1(t.toString())}getUint256(e){return new BigNumber$1(n$e(this._getBytes32(e)),16)}getAddress(e){return n$e(this.bytes.subarray(32*(null!=e?e:0)+12,32*(null!=e?e:0)+32))}getResult(e){return defaultAbiCoder.decode(e,this.bytes)}_getBytes32(e){return this.bytes.subarray(32*(null!=e?e:0),32*(null!=e?e:0)+32)}_toProtobuf(){return{contractID:null!=this.contractId?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:null!=this.evmAddress?{value:this.evmAddress}:null,gas:this.gas,amount:this.amount,functionParameters:this.functionParameters,senderId:null!=this.senderAccountId?this.senderAccountId._toProtobuf():null,contractNonces:this.contractNonces.map((e=>e._toProtobuf())),signerNonce:null!=this.signerNonce?{value:this.signerNonce}:null}}},o$6=class extends t$h{constructor(){super((e=>f.fromString(e)))}toJSON(){const e={};return this._map.forEach(((t,n)=>{e[n]=t.toString()})),e}},n$7=class e extends t$h{constructor(){super((e=>u$3.fromString(e)))}__set(e,t,n){const o=e.toString();let r=this._map.get(o);null==r&&(r=new o$6,this._map.set(o,r),this.__map.set(e,r)),r._set(t,n)}static _fromProtobuf(t){const n=new e;for(const e of t){const t=u$3._fromProtobuf(e.token);for(const o of null!=e.transfers?e.transfers:[]){const e=f._fromProtobuf(o.accountID);n.__set(t,e,o.amount)}}return n}_toProtobuf(){const e=[];for(const[t,n]of this){const o=[];for(const[e,t]of n)o.push({accountID:e._toProtobuf(),amount:t});e.push({token:t._toProtobuf(),transfers:o})}return e}},s$6=class e extends t$h{constructor(){super((e=>u$3.fromString(e)))}__set(e,t){const n=e.toString();let o=this._map.get(n);null==o&&(o=[],this._map.set(n,o),this.__map.set(e,o)),o.push(t)}static _fromProtobuf(t){const n=new e;for(const e of t){const t=u$3._fromProtobuf(e.token);for(const o of null!=e.nftTransfers?e.nftTransfers:[]){const e=f._fromProtobuf(o.senderAccountID),r=f._fromProtobuf(o.receiverAccountID);n.__set(t,{sender:e,recipient:r,serial:Long.fromValue(o.serialNumber),isApproved:!1})}}return n}_toProtobuf(){const e=[];for(const[t,n]of this){const o=[];for(const e of n)o.push({senderAccountID:e.sender._toProtobuf(),receiverAccountID:e.recipient._toProtobuf(),serialNumber:e.serial});e.push({token:t._toProtobuf(),nftTransfers:o})}return e}toJSON(){const e={};return this._map.forEach(((t,n)=>{e[n]=t.map((e=>({sender:e.sender.toString(),recipient:e.recipient.toString(),serial:e.serial,isApproved:e.isApproved})))})),e}},n$6=class e{constructor(e={}){this._feeCollectorAccountId=null,null!=e.feeCollectorAccountId&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),this._tokenId=null,null!=e.tokenId&&this.setTokenId(e.tokenId),this._amount=null,null!=e.amount&&this.setAmount(e.amount),this._payerAccountIds=null,null!=e.payerAccountIds&&this.setPayerAccountIds(e.payerAccountIds)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId="string"==typeof e?f.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId="string"==typeof e?u$3.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount="number"==typeof e?Long.fromNumber(e):e,this}get payerAccountIds(){return this._payerAccountIds}setPayerAccountIds(e){return this._payerAccountIds=e,this}static _fromProtobuf(t){return new e({feeCollectorAccountId:null!=t.feeCollectorAccountId?f._fromProtobuf(t.feeCollectorAccountId):void 0,tokenId:null!=t.tokenId?u$3._fromProtobuf(t.tokenId):void 0,amount:null!=t.amount?t.amount:void 0,payerAccountIds:null!=t.effectivePayerAccountId?t.effectivePayerAccountId.map((e=>f._fromProtobuf(e))):void 0})}_toProtobuf(){return{feeCollectorAccountId:null!=this.feeCollectorAccountId?this.feeCollectorAccountId._toProtobuf():null,tokenId:null!=this._tokenId?this._tokenId._toProtobuf():null,amount:this._amount,effectivePayerAccountId:null!=this._payerAccountIds?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()))||[]}}},u$1=class e{constructor(e={}){this._accountId=null,null!=e.accountId&&this.setAccountId(e.accountId),this._tokenId=null,null!=e.tokenId&&this.setTokenId(e.tokenId),this._defaultMaxTransactionFee=new e$7(5)}get accountId(){return this._accountId}setAccountId(e){return this._accountId="string"==typeof e?f.fromString(e):e,this}get tokenId(){return this._tokenId}setTokenId(e){return this._tokenId="string"==typeof e?u$3.fromString(e):e,this}static _fromProtobuf(t){return new e({accountId:null!=t.accountId?f._fromProtobuf(t.accountId):void 0,tokenId:null!=t.tokenId?u$3._fromProtobuf(t.tokenId):void 0})}_toProtobuf(){return{accountId:null!=this._accountId?this._accountId._toProtobuf():void 0,tokenId:null!=this._tokenId?this._tokenId._toProtobuf():void 0}}toJSON(){return{accountId:this._accountId?.toString()||null,tokenId:this._tokenId?.toString()||null}}},n$5=class e{constructor(e){this.tokenId=e.tokenId instanceof u$3?e.tokenId:u$3.fromString(e.tokenId),this.accountId=e.accountId instanceof f?e.accountId:f.fromString(e.accountId),this.expectedDecimals=e.expectedDecimals,this.amount=Long.fromValue(e.amount),this.isApproved=e.isApproved}static _fromProtobuf(t){const n=[];for(const o of t){const t=u$3._fromProtobuf(o.token),r=null!=o.expectedDecimals&&Object.hasOwn(o.expectedDecimals,"value")?o.expectedDecimals.value:null;for(const i of null!=o.transfers?o.transfers:[])n.push(new e({tokenId:t,accountId:f._fromProtobuf(i.accountID),expectedDecimals:r||null,amount:null!=i.amount?i.amount:Long.ZERO,isApproved:1==i.isApproval}))}return n}_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())}},e$2=class e{constructor(e,t){this.tokenId=e,this.serial="number"==typeof t?Long.fromNumber(t):t,Object.freeze(this)}static fromString(t){const n=t.split("/").length>1?t.split("/"):t.split("@");for(const e of n)if(""===e)throw new Error("invalid format for NftId: use [token]/[serial] or [token]@[serial]");const o=u$3.fromString(n[0]),r=Long.fromString(n[1]);return new e(o,r)}static _fromProtobuf(t){return new e(u$3._fromProtobuf(t.token_ID),null!=t.serialNumber?t.serialNumber:Long.ZERO)}static fromBytes(t){return e._fromProtobuf(libExports$1.proto.NftID.decode(t))}_toProtobuf(){return{token_ID:this.tokenId._toProtobuf(),serialNumber:Long.fromValue(void 0!==this.serial?this.serial:0)}}toString(){return`${this.tokenId.toString()}/${this.serial.toString()}`}toBytes(){return libExports$1.proto.NftID.encode(this._toProtobuf()).finish()}},t$9=class e{constructor(e={}){this._senderId=null,this._receiverId=null,this._tokenId=null,this._nftId=null,e.receiverId&&(this._receiverId=e.receiverId),e.senderId&&(this._senderId=e.senderId),e.tokenId?this._tokenId=new u$3(e.tokenId):e.nftId&&(this._nftId=new e$2(e.nftId?.tokenId,e.nftId?.serial))}static fromBytes(t){if(null==t.senderId)throw new Error("senderId is required");if(null==t.receiverId)throw new Error("receiverId is required");if(null==t.fungibleTokenType&&null==t.nonFungibleToken)throw new Error("Either fungibleTokenType or nonFungibleToken is required");return new e({senderId:f._fromProtobuf(t.senderId),receiverId:f._fromProtobuf(t.receiverId),nftId:null!=t.nonFungibleToken?e$2._fromProtobuf(t.nonFungibleToken):null,tokenId:null!=t.fungibleTokenType?u$3._fromProtobuf(t.fungibleTokenType):null})}setSenderid(e){return this._senderId=e,this}setReceiverId(e){return this._receiverId=e,this}setTokenId(e){return this._nftId=null,this._tokenId=e,this}setNftId(e){return this._tokenId=null,this._nftId=e,this}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get tokenId(){return this._tokenId}get nftId(){return this._nftId}toBytes(){return{senderId:this.senderId?._toProtobuf(),receiverId:this._receiverId?._toProtobuf(),fungibleTokenType:this._tokenId?._toProtobuf(),nonFungibleToken:this._nftId?._toProtobuf()}}},d$2=class e{constructor(e){this.airdropId=e.airdropId,this.amount=e.amount}toBytes(){return{pendingAirdropId:this.airdropId.toBytes(),pendingAirdropValue:{amount:this.amount}}}static fromBytes(t){if(null==t.pendingAirdropId)throw new Error("pendingAirdropId is required");const n=t$9.fromBytes(t.pendingAirdropId),o=t.pendingAirdropValue?.amount;return new e({airdropId:n,amount:o||Long.ZERO})}},b$3=class e{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=null!=e.contractFunctionResult?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,this.newPendingAirdrops=e.newPendingAirdrops,Object.freeze(this)}_toProtobuf(){const e=this.tokenTransfers._toProtobuf(),t=this.nftTransfers._toProtobuf(),n=[];for(const o of e)for(const e of t)null!=o.token&&null!=e.token&&o.token.shardNum===e.token.shardNum&&o.token.realmNum===e.token.realmNum&&o.token.tokenNum===e.token.tokenNum?n.push({token:o.token,transfers:o.transfers,nftTransfers:o.nftTransfers}):(n.push(o),n.push(e));return{duplicateTransactionRecords:this.duplicates.map((e=>e._toProtobuf().transactionRecord)),childTransactionRecords:this.children.map((e=>e._toProtobuf().transactionRecord)),transactionRecord:{receipt:this.receipt._toProtobuf().receipt,transactionHash:null!=this.transactionHash?this.transactionHash:null,consensusTimestamp:null!=this.consensusTimestamp?this.consensusTimestamp._toProtobuf():null,transactionID:null!=this.transactionId?this.transactionId._toProtobuf():null,memo:null!=this.transactionMemo?this.transactionMemo:null,transactionFee:null!=this.transactionFee?this.transactionFee.toTinybars():null,contractCallResult:null==this.contractFunctionResult||this.contractFunctionResult._createResult?null:this.contractFunctionResult._toProtobuf(),contractCreateResult:null!=this.contractFunctionResult&&this.contractFunctionResult._createResult?this.contractFunctionResult._toProtobuf():null,transferList:null!=this.transfers?{accountAmounts:this.transfers.map((e=>e._toProtobuf()))}:null,tokenTransferLists:n,scheduleRef:null!=this.scheduleRef?this.scheduleRef._toProtobuf():null,assessedCustomFees:this.assessedCustomFees.map((e=>e._toProtobuf())),automaticTokenAssociations:this.automaticTokenAssociations.map((e=>e._toProtobuf())),parentConsensusTimestamp:null!=this.parentConsensusTimestamp?this.parentConsensusTimestamp._toProtobuf():null,alias:null!=this.aliasKey?libExports$1.proto.Key.encode(this.aliasKey._toProtobufKey()).finish():null,ethereumHash:this.ethereumHash,paidStakingRewards:this.paidStakingRewards.map((e=>e._toProtobuf())),prngBytes:this.prngBytes,prngNumber:null!=this.prngNumber?this.prngNumber:null,evmAddress:null!=this.evmAddress?this.evmAddress.toBytes():null,newPendingAirdrops:this.newPendingAirdrops.map((e=>e.toBytes()))}}}static _fromProtobuf(t){const n=t.transactionRecord;let o=null!=n.alias&&n.alias.length>0?t$i._fromProtobufKey(libExports$1.proto.Key.decode(n.alias)):null;o instanceof i$7||(o=null);const r=null!=t.childTransactionRecords?t.childTransactionRecords.map((t=>e._fromProtobuf({transactionRecord:t}))):[],i=null!=t.duplicateTransactionRecords?t.duplicateTransactionRecords.map((t=>e._fromProtobuf({transactionRecord:t}))):[],a=null!=n.contractCallResult?l$3._fromProtobuf(n.contractCallResult,!1):null!=n.contractCreateResult?l$3._fromProtobuf(n.contractCreateResult,!0):void 0,s=null!=n.newPendingAirdrops?n.newPendingAirdrops.map((e=>d$2.fromBytes(e))):[];return new e({receipt:d$3._fromProtobuf({receipt:n.receipt}),transactionHash:null!=n.transactionHash?n.transactionHash:new Uint8Array,consensusTimestamp:s$8._fromProtobuf(n.consensusTimestamp),transactionId:i$6._fromProtobuf(n.transactionID),transactionMemo:null!=n.memo?n.memo:"",transactionFee:e$7.fromTinybars(null!=n.transactionFee?n.transactionFee:0),transfers:n$9._fromProtobuf(null!=n.transferList&&null!=n.transferList.accountAmounts?n.transferList.accountAmounts:[]),contractFunctionResult:a,tokenTransfers:n$7._fromProtobuf(null!=n.tokenTransferLists?n.tokenTransferLists:[]),tokenTransfersList:n$5._fromProtobuf(null!=n.tokenTransferLists?n.tokenTransferLists:[]),scheduleRef:null!=n.scheduleRef?o$8._fromProtobuf(n.scheduleRef):null,assessedCustomFees:null!=n.assessedCustomFees?n.assessedCustomFees.map((e=>n$6._fromProtobuf(e))):[],nftTransfers:s$6._fromProtobuf(null!=n.tokenTransferLists?n.tokenTransferLists:[]),automaticTokenAssociations:null!=n.automaticTokenAssociations?n.automaticTokenAssociations.map((e=>u$1._fromProtobuf(e))):[],parentConsensusTimestamp:null!=n.parentConsensusTimestamp?s$8._fromProtobuf(n.parentConsensusTimestamp):null,aliasKey:o,duplicates:i,children:r,hbarAllowanceAdjustments:[],tokenAllowanceAdjustments:[],nftAllowanceAdjustments:[],ethereumHash:null!=n.ethereumHash?n.ethereumHash:null,paidStakingRewards:null!=n.paidStakingRewards?n$9._fromProtobuf(n.paidStakingRewards):[],prngBytes:null!=n.prngBytes?n.prngBytes:null,prngNumber:null!=n.prngNumber?n.prngNumber:null,evmAddress:null!=n.evmAddress?o$a.fromBytes(n.evmAddress):null,newPendingAirdrops:s})}static fromBytes(t){return e._fromProtobuf(libExports$1.proto.TransactionGetRecordResponse.decode(t))}toBytes(){return libExports$1.proto.TransactionGetRecordResponse.encode(this._toProtobuf()).finish()}toJSON(){return{receipt:this.receipt.toJSON(),transactionHash:n$e(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:null!=this.ethereumHash?n$e(this.ethereumHash):null,paidStakingRewards:this.paidStakingRewards,prngBytes:null!=this.prngBytes?n$e(this.prngBytes):null,prngNumber:this.prngNumber,evmAddress:this.evmAddress?.toString()||null}}toString(){return JSON.stringify(this.toJSON())}},r$4=class extends t$c{constructor(e){super(e,`Record for transaction ${e.transactionId.toString()} contained error status ${e.status.toString()}`),this.transactionRecord=e.transactionRecord}};const{proto:l$2}=e$b;class h extends h$1{constructor(e={}){super(),this._transactionId=null,this._includeChildren=null,this._includeDuplicates=null,this._validateReceiptStatus=!0,null!=e.transactionId&&this.setTransactionId(e.transactionId),null!=e.includeChildren&&this.setIncludeChildren(e.includeChildren),null!=e.includeDuplicates&&this.setIncludeDuplicates(e.includeDuplicates),null!=e.validateReceiptStatus&&this.setValidateReceiptStatus(e.validateReceiptStatus)}get transactionId(){return this._transactionId}static _fromProtobuf(e){const t=e.transactionGetRecord;return new h({transactionId:t.transactionID?i$6._fromProtobuf(t.transactionID):void 0,includeChildren:null!=t.includeChildRecords?t.includeChildRecords:void 0,includeDuplicates:null!=t.includeDuplicates?t.includeDuplicates:void 0})}setTransactionId(e){return this._transactionId="string"==typeof e?i$6.fromString(e):e.clone(),this}setIncludeChildren(e){return this._includeChildren=e,this}get includeChildren(){return null!=this._includeChildren&&this._includeChildren}setIncludeDuplicates(e){return this._duplicates=e,this}get includeDuplicates(){return null!=this._duplicates&&this._duplicates}setValidateReceiptStatus(e){return this._validateReceiptStatus=e,this}get validateReceiptStatus(){return this._validateReceiptStatus}_shouldRetry(e,t){const{nodeTransactionPrecheckCode:n}=this._mapResponseHeader(t);let o=e$6._fromCode(null!=n?n:l$2.ResponseCodeEnum.OK);switch(this._logger&&this._logger.debug(`[${this._getLogId()}] received node precheck status ${o.toString()}`),o){case e$6.Busy:case e$6.Unknown:case e$6.ReceiptNotFound:case e$6.RecordNotFound:case e$6.PlatformNotActive:return[o,c$2.Retry];case e$6.Ok:break;default:return[o,c$2.Error]}const r=t.transactionGetRecord;if(r.header.responseType===libExports$1.proto.ResponseType.COST_ANSWER)return[o,c$2.Finished];const i=r.transactionRecord.receipt.status;switch(o=e$6._fromCode(i),this._logger&&this._logger.debug(`[${this._getLogId()}] received record's receipt ${o.toString()}`),o){case e$6.Ok:case e$6.Busy:case e$6.Unknown:case e$6.ReceiptNotFound:case e$6.RecordNotFound:return[o,c$2.Retry];case e$6.Success:return[o,c$2.Finished];default:return[o,this._validateReceiptStatus?c$2.Error:c$2.Finished]}}_mapStatusError(e,t,n){const{nodeTransactionPrecheckCode:o}=this._mapResponseHeader(t);let r=e$6._fromCode(null!=o?o:l$2.ResponseCodeEnum.OK);switch(r){case e$6.Ok:break;case e$6.ContractRevertExecuted:return new r$4({status:r,transactionId:this._getTransactionId(),transactionRecord:b$3._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})});default:return new n$a({nodeId:n,status:r,transactionId:this._getTransactionId(),contractFunctionResult:null})}const i=t.transactionGetRecord.transactionRecord.receipt,a=i.status;return r=e$6._fromCode(a),r===e$6.ContractRevertExecuted?new r$4({status:r,transactionId:this._getTransactionId(),transactionRecord:b$3._fromProtobuf({transactionRecord:t.transactionGetRecord.transactionRecord})}):new r$8({status:r,transactionId:this._getTransactionId(),transactionReceipt:d$3._fromProtobuf({receipt:i})})}_validateChecksums(e){null!=this._transactionId&&null!=this._transactionId.accountId&&this._transactionId.accountId.validateChecksum(e)}_execute(e,t){return e.crypto.getTxRecordByTxID(t)}_mapResponseHeader(e){return e.transactionGetRecord.header}_mapResponse(e,t,n){const o=e.transactionGetRecord;return Promise.resolve(b$3._fromProtobuf(o))}_onMakeRequest(e){return{transactionGetRecord:{header:e,transactionID:null!=this._transactionId?this._transactionId._toProtobuf():null,includeChildRecords:this._includeChildren,includeDuplicates:this._includeDuplicates}}}_getLogId(){return`TransactionRecordQuery:${(null!=this._paymentTransactionId&&null!=this._paymentTransactionId.validStart?this._paymentTransactionId.validStart:this._timestamp).toString()}`}}d$4.set("transactionGetRecord",h._fromProtobuf);let o$5=class e{constructor(e){this.nodeId=e.nodeId,this.transactionHash=e.transactionHash,this.transactionId=e.transactionId,Object.freeze(this)}static fromJSON(t){return new e({nodeId:f.fromString(t.nodeId),transactionHash:r$a(t.transactionHash),transactionId:i$6.fromString(t.transactionId)})}async getReceipt(e){const t=await this.getReceiptQuery().execute(e);if(t.status!==e$6.Success&&t.status!==e$6.FeeScheduleFilePartUploaded)throw new r$8({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(t){return this.getRecordQuery().execute(e)}}async getReceiptWithSigner(e){const t=await this.getReceiptQuery().executeWithSigner(e);if(t.status!==e$6.Success)throw new r$8({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 l$4).setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}getRecordQuery(){return(new h).setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}toJSON(){return{nodeId:this.nodeId.toString(),transactionHash:n$e(this.transactionHash),transactionId:this.transactionId.toString()}}toString(){return JSON.stringify(this.toJSON())}};async function t$8(e){return new Uint8Array(await window.crypto.subtle.digest("SHA-384",e))}let n$4=class e extends t$h{constructor(){super((e=>f.fromString(e)))}static async _fromTransaction(t){const n=new e;for(let e=0;e<t._nodeAccountIds.length;e++){const o=t._nodeAccountIds.list[e],r=t._transactions.get(e),i=await t$8(r.signedTransactionBytes);n._set(o,i)}return n}},e$1=class{constructor(e={}){this._feeCollectorAccountId=null,this._allCollectorsAreExempt=!1,null!=e.feeCollectorAccountId&&this.setFeeCollectorAccountId(e.feeCollectorAccountId),null!=e.allCollectorsAreExempt&&this.setAllCollectorsAreExempt(e.allCollectorsAreExempt)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(e){return this._feeCollectorAccountId="string"==typeof e?f.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")}},l$1=class e extends e$1{constructor(e={}){super(e),this._denominatingTokenId=null,null!=e.denominatingTokenId&&this.setDenominatingTokenId(e.denominatingTokenId),this._amount=null,null!=e.amount&&this.setAmount(e.amount)}setHbarAmount(e){return this._amount=e.toTinybars(),this._denominatingTokenId=null,this}get hbarAmount(){return null!=this._denominatingTokenId?null:e$7.fromTinybars(null!=this._amount?this._amount:0)}setDenominatingTokenToSameToken(){return this._denominatingTokenId=new u$3(0,0,0),this}get denominatingTokenId(){return this._denominatingTokenId}setDenominatingTokenId(e){return this._denominatingTokenId="string"==typeof e?u$3.fromString(e):e,this}get amount(){return this._amount}setAmount(e){return this._amount="number"==typeof e?Long.fromNumber(e):e,this}static _fromProtobuf(t){const n=t.fixedFee;return new e({feeCollectorAccountId:null!=t.feeCollectorAccountId?f._fromProtobuf(t.feeCollectorAccountId):void 0,allCollectorsAreExempt:null!=t.allCollectorsAreExempt?t.allCollectorsAreExempt:void 0,denominatingTokenId:null!=n.denominatingTokenId?u$3._fromProtobuf(n.denominatingTokenId):void 0,amount:null!=n.amount?n.amount:void 0})}_toProtobuf(){return{feeCollectorAccountId:null!=this.feeCollectorAccountId?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fixedFee:{denominatingTokenId:null!=this._denominatingTokenId?this._denominatingTokenId._toProtobuf():null,amount:this._amount}}}_toTopicFeeProtobuf(){return{feeCollectorAccountId:null!=this.feeCollectorAccountId?this.feeCollectorAccountId._toProtobuf():null,fixedFee:{denominatingTokenId:null!=this._denominatingTokenId?this._denominatingTokenId._toProtobuf():null,amount:this._amount}}}},o$4=class e{constructor(e={}){this._accountId=null,e.accountId&&this.setAccountId(e.accountId),this._fees=null,e.fees&&this.setFees(e.fees)}static _fromProtobuf(t){return new e({accountId:null!=t.accountId?f._fromProtobuf(t.accountId):null,fees:null!=t.fees?t.fees.map((e=>l$1._fromProtobuf({fixedFee:e}))):null})}getAccountId(){return this._accountId}setAccountId(e){return this._accountId=e instanceof f?e:f.fromString(e),this}getFees(){return this._fees}setFees(e){return this._fees=e,this}_toProtobuf(){const e=[];return null!=this._fees&&this._fees.forEach((t=>{const n=t._toProtobuf();null!=n.fixedFee&&e.push(n.fixedFee)})),{accountId:null!=this._accountId?this._accountId._toProtobuf():null,fees:e}}};const y=Long.fromValue(7776e3),I=e$7.fromTinybars(Long.fromString("9223372036854775807")),b$2=1024,w$1=new Map;class S extends u$5{constructor(){super(),__publicField2(this,"_shouldRemoveSignature",((e,t)=>n$e(e?.pubKeyPrefix||new Uint8Array)===t)),this._transactions=new t$d,this._signedTransactions=new t$d,this._signerPublicKeys=new Set,this._transactionValidDuration=120,this._defaultMaxTransactionFee=new e$7(2),this._customFeeLimits=[],this._maxTransactionFee=null,this._transactionMemo="",this._transactionIds=new t$d,this._publicKeys=[],this._transactionSigners=[],this._regenerateTransactionId=null}static fromBytes(e){const t=[],n=[],o=[],r=[],i=[],a=[],s=libExports$1.proto.TransactionList.decode(e).transactionList;if(0===s.length){const t=libExports$1.proto.Transaction.decode(e);0!==t.signedTransactionBytes.length?s.push(t):s.push({signedTransactionBytes:libExports$1.proto.SignedTransaction.encode({sigMap:t.sigMap,bodyBytes:t.bodyBytes}).finish()})}for(const u of s){if(null==u.bodyBytes&&null==u.signedTransactionBytes)throw new Error("bodyBytes and signedTransactionBytes are null");if(u.bodyBytes&&0!=u.bodyBytes.length){const e=libExports$1.proto.TransactionBody.decode(u.bodyBytes);if(null!=e.transactionID){const t=i$6._fromProtobuf(e.transactionID);r.includes(t.toString())||(n.push(t),r.push(t.toString()))}if(null!=e.nodeAccountID){const t=f._fromProtobuf(e.nodeAccountID);i.includes(t.toString())||(o.push(t),i.push(t.toString()))}if(null==e.data)throw new Error("(BUG) body.data was not set in the protobuf");a.push(e)}if(u.signedTransactionBytes&&0!=u.signedTransactionBytes.length){const e=libExports$1.proto.SignedTransaction.decode(u.signedTransactionBytes);t.push(e);const s=libExports$1.proto.TransactionBody.decode(e.bodyBytes);if(null!=s.transactionID){const e=i$6._fromProtobuf(s.transactionID);r.includes(e.toString())||(n.push(e),r.push(e.toString()))}if(null!=s.nodeAccountID){const e=f._fromProtobuf(s.nodeAccountID);i.includes(e.toString())||(o.push(e),i.push(e.toString()))}if(null==s.data)throw new Error("(BUG) body.data was not set in the protobuf");a.push(s)}}const c=a[0];if(null==c||null==c.data)throw new Error("No transaction found in bytes or failed to decode TransactionBody");const l=w$1.get(c.data);if(null==l)throw new Error(`(BUG) Transaction.fromBytes() not implemented for type ${c.data}`);return l(s,t,n,o,a)}schedule(){if(this._requireNotFrozen(),1!=A.length)throw new Error("ScheduleCreateTransaction has not been loaded yet");return A[0]()._setScheduledTransaction(this)}static _fromProtobufTransactions(e,t,n,o,r,i){const a=i[0];for(let c=0;c<o.length;c++)for(let e=0;e<r.length-1;e++)if(!L(i[c*r.length+e],i[c*r.length+e+1],new Set(["nodeAccountID"])))throw new Error("failed to validate transaction bodies");const s=new f(0);for(let c=0;c<r.length;c++)r[c].equals(s)&&r.splice(c--,1);e._transactions.setList(t),e._signedTransactions.setList(n),e._transactionIds.setList(o),e._nodeAccountIds.setList(r),e._transactionValidDuration=null!=a.transactionValidDuration&&null!=a.transactionValidDuration.seconds?Long.fromValue(a.transactionValidDuration.seconds).toInt():120,e._maxTransactionFee=null!=a.transactionFee&&a.transactionFee>new Long(0,0,!0)?e$7.fromTinybars(a.transactionFee):null,e._customFeeLimits=null!=a.maxCustomFees?a.maxCustomFees?.map((e=>o$4._fromProtobuf(e))):[],e._transactionMemo=null!=a.memo?a.memo:"";for(let c=0;c<r.length;c++){const o=n[c]||t[c];if(null!=o.sigMap&&null!=o.sigMap.sigPair)for(const t of o.sigMap.sigPair)e._signerPublicKeys.add(n$e(t.pubKeyPrefix)),e._publicKeys.push(i$7.fromBytes(t.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 e$7?e:new e$7(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}getRequiredChunks(){return 1}sign(e){return this.signWith(e.publicKey,(t=>Promise.resolve(e.sign(t))))}async signWith(e,t){this._signOnDemand||this._requireFrozen();const n=n$e(e.toBytesRaw());if(this._signerPublicKeys.has(n))return this;if(this._transactions.clear(),this._signerPublicKeys.add(n),this._signOnDemand)return this._publicKeys.push(e),this._transactionSigners.push(t),this;this._transactionIds.setLocked(),this._nodeAccountIds.setLocked();for(const o of this._signedTransactions.list){const n=o.bodyBytes,r=await t(n);null==o.sigMap&&(o.sigMap={}),null==o.sigMap.sigPair&&(o.sigMap.sigPair=[]),o.sigMap.sigPair.push(e._toProtobufSignature(r))}return this}signWithOperator(e){const t=e._operator;if(null==t)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.isFrozen()||this.freeze();const n=n$e(e.toBytesRaw());if(this._signerPublicKeys.has(n))return this;this._transactions.clear(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._signedTransactions.setLocked();for(let o=0;o<this._signedTransactions.length;o++){const n=this._signedTransactions.get(o);if(null==n.sigMap&&(n.sigMap={}),null==n.sigMap.sigPair&&(n.sigMap.sigPair=[]),n.bodyBytes){const{transactionID:o,nodeAccountID:r}=libExports$1.proto.TransactionBody.decode(n.bodyBytes);if(!o||!r)throw new Error("Transaction ID or Node Account ID not found in the signed transaction");const i=i$6._fromProtobuf(o),a=f._fromProtobuf(r),s=t.get(a),c=s?.get(i),l=c?.get(e);if(!l)throw new Error("Signature not found for the transaction and public key");const u=e._toProtobufSignature(l);n.sigMap?.sigPair?.push(u)}}return this._signerPublicKeys.add(n),this._publicKeys.push(e),this._transactionSigners.push(null),this}removeSignature(e){this.isFrozen()||this.freeze();const t=n$e(e.toBytesRaw());if(!this._signerPublicKeys.has(t))throw new Error("The public key has not signed this transaction");const n=[];for(const o of this._signedTransactions.list){const e=this._removeSignaturesFromTransaction(o,t);n.push(...e)}return this._signerPublicKeys.delete(t),this._publicKeys=this._publicKeys.filter((t=>!t.equals(e))),this._transactionSigners.pop(),n}removeAllSignatures(){this.isFrozen()||this.freeze();const e=this._collectSignaturesByPublicKey();for(const t of this._signedTransactions.list)t.sigMap&&t.sigMap.sigPair&&(t.sigMap.sigPair=[]);return this._signerPublicKeys.clear(),this._publicKeys=[],this._transactionSigners=[],e}getSignatures(){return this._requireFrozen(),this._requireNotSignOnDemand(),this._buildAllTransactions(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),e$9._fromTransaction(this)}async getSignaturesAsync(){return this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),this._transactions.setLocked(),this._signedTransactions.setLocked(),e$9._fromTransaction(this)}_setTransactionId(){if(null==this._operatorAccountId&&this._transactionIds.isEmpty)throw new Error("`transactionId` must be set or `client` must be provided with `freezeWith`")}_setNodeAccountIds(e){if(this._nodeAccountIds.isEmpty){if(null==e)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))))}_buildIncompleteTransactions(){0==this._nodeAccountIds.length?this._transactions.setList([this._makeSignedTransaction(null)]):this._transactions.setList(this._nodeAccountIds.list.map((e=>this._makeSignedTransaction(e))))}freeze(){return this.freezeWith(null)}_freezeWithAccountId(e){null==this._operatorAccountId&&(this._operatorAccountId=e)}freezeWith(e){if(this._signOnDemand=null!=e&&e.signOnDemand,this._operator=null!=e?e._operator:null,this._freezeWithAccountId(null!=e?e.operatorAccountId:null),this._maxTransactionFee=null==this._maxTransactionFee?null!=e&&null!=e.defaultMaxTransactionFee?e.defaultMaxTransactionFee:this._defaultMaxTransactionFee:this._maxTransactionFee,this._regenerateTransactionId=null!=e&&null==this._regenerateTransactionId?e.defaultRegenerateTransactionId:this._regenerateTransactionId,this._setNodeAccountIds(e),this._setTransactionId(),null!=e)for(const t of this._transactionIds.list)null!=t.accountId&&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._requireNotSignOnDemand(),this._isFrozen()?(this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),this._buildAllTransactions()):this._buildIncompleteTransactions(),libExports$1.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(),libExports$1.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(),t$8(this._transactions.get(0).signedTransactionBytes)}async getTransactionHashPerNode(){return this._requireFrozen(),this._transactionIds.setLocked(),this._nodeAccountIds.setLocked(),await this._buildAllTransactionsAsync(),await n$4._fromTransaction(this)}isFrozen(){return this._signedTransactions.length>0}_getTransactionId(){const e=this.transactionId;if(null==e)throw new Error("transaction must have been frozen before getting the transaction ID, try calling `freeze`");return e}_validateChecksums(e){}async _beforeExecute(e){this.transactionNodeIds=Object.values(e.network).map((e=>e.toString())),this._logger&&this._logger.info(`Network used: ${e._network.networkName}`),this._isFrozen()||this.freezeWith(e),e.isAutoValidateChecksumsEnabled()&&this._validateChecksums(e),null!=this._operator&&null!=this._operator||(this._operator=null!=e?e._operator:null),null!=this._operatorAccountId&&null!=this._operatorAccountId||(this._operatorAccountId=null!=e&&null!=e._operator?e._operator.accountId:null),null!=this._operator&&await this.signWith(this._operator.publicKey,this._operator.transactionSigner)}async _makeRequestAsync(){const 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(){const e=this._makeSignedTransaction(this._nodeAccountIds.next),t=e.bodyBytes;for(let n=0;n<this._publicKeys.length;n++){const o=this._publicKeys[n],r=this._transactionSigners[n];if(null==r)continue;const i=await r(t);null==e.sigMap&&(e.sigMap={}),null==e.sigMap.sigPair&&(e.sigMap.sigPair=[]),e.sigMap.sigPair.push(o._toProtobufSignature(i))}return e}_buildNewTransactionIdList(){if(this._transactionIds.locked||null==this._operatorAccountId)return;const e=i$6.withValidStart(this._operatorAccountId,s$8.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){if(this._buildSignedTransactions(),!this._transactions.locked)for(let e=0;e<this._signedTransactions.length;e++)this._transactions.push(await this._buildTransactionAsync())}else this._buildAllTransactions()}_buildTransaction(e){if(this._transactions.length<e)for(let t=this._transactions.length;t<e;t++)this._transactions.push(null);null!=this._transactions.list[e]&&this._transactions.set(e,{signedTransactionBytes:libExports$1.proto.SignedTransaction.encode(this._signedTransactions.get(e)).finish()}),this._transactions.setIfAbsent(e,(()=>({signedTransactionBytes:libExports$1.proto.SignedTransaction.encode(this._signedTransactions.get(e)).finish()})))}async _buildTransactionAsync(){return{signedTransactionBytes:libExports$1.proto.SignedTransaction.encode(await this._signTransaction()).finish()}}_shouldRetry(e,t){const{nodeTransactionPrecheckCode:n}=t,o=e$6._fromCode(null!=n?n:libExports$1.proto.ResponseCodeEnum.OK);switch(this._logger&&(this._logger.debug(`[${this._getLogId()}] received status ${o.toString()}`),this._logger.info(`SDK Transaction Status Response: ${o.toString()}`)),o){case e$6.Busy:case e$6.Unknown:case e$6.PlatformTransactionNotCreated:case e$6.PlatformNotActive:return[o,c$2.Retry];case e$6.Ok:return[o,c$2.Finished];case e$6.TransactionExpired:return this._transactionIds.locked||null!=this._regenerateTransactionId&&!this._regenerateTransactionId?[o,c$2.Error]:(this._buildNewTransactionIdList(),[o,c$2.Retry]);default:return[o,c$2.Error]}}_mapStatusError(e,t,n){const{nodeTransactionPrecheckCode:o}=t,r=e$6._fromCode(null!=o?o:libExports$1.proto.ResponseCodeEnum.OK);return this._logger&&this._logger.info(`Transaction Error Info: ${r.toString()}, ${this.transactionId.toString()}`),new n$a({nodeId:n,status:r,transactionId:this._getTransactionId(),contractFunctionResult:null})}async _mapResponse(e,t,n){const o=await t$8(n.signedTransactionBytes),r=this._getTransactionId();return this._transactionIds.advance(),this._logger&&this._logger.info(`Transaction Info: ${JSON.stringify(new o$5({nodeId:t,transactionHash:o,transactionId:r}).toJSON())}`),new o$5({nodeId:t,transactionHash:o,transactionId:r})}_makeSignedTransaction(e){const t=this._makeTransactionBody(e);return this._logger&&this._logger.info(`Transaction Body: ${JSON.stringify(t)}`),{sigMap:{sigPair:[]},bodyBytes:libExports$1.proto.TransactionBody.encode(t).finish()}}_makeTransactionBody(e){return{[this._getTransactionDataCase()]:this._makeTransactionData(),transactionFee:null!=this._maxTransactionFee?this._maxTransactionFee.toTinybars():null,memo:this._transactionMemo,transactionID:null!=this._transactionIds.current?this._transactionIds.current._toProtobuf():null,nodeAccountID:null!=e?e._toProtobuf():null,transactionValidDuration:{seconds:Long.fromNumber(this._transactionValidDuration)},maxCustomFees:null!=this._customFeeLimits?this._customFeeLimits.map((e=>e._toProtobuf())):null}}_getTransactionDataCase(){throw new Error("not implemented")}_getScheduledTransactionBody(){return{memo:this.transactionMemo,transactionFee:null==this._maxTransactionFee?this._defaultMaxTransactionFee.toTinybars():this._maxTransactionFee.toTinybars(),[this._getTransactionDataCase()]:this._makeTransactionData()}}_makeTransactionData(){throw new Error("not implemented")}_isFrozen(){return this._signOnDemand||this._signedTransactions.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(1!=this._nodeAccountIds.length)throw"transaction did not have exactly one node ID set"}_requestToBytes(e){return libExports$1.proto.Transaction.encode(e).finish()}_responseToBytes(e){return libExports$1.proto.TransactionResponse.encode(e).finish()}_removeSignaturesFromTransaction(e,t){const n=[];return e.sigMap&&e.sigMap.sigPair?(e.sigMap.sigPair=e.sigMap.sigPair.filter((e=>{const o=this._shouldRemoveSignature(e,t),r=e.ed25519??e.ECDSASecp256k1;return o&&r&&n.push(r),!o})),n):[]}_collectSignaturesByPublicKey(){const e=new Map,t={};for(const n of this._signedTransactions.list){if(!n.sigMap||!n.sigMap.sigPair)return new Map;for(const o of n.sigMap.sigPair){const n=o.ed25519??o.ECDSASecp256k1;if(!n||!o.pubKeyPrefix)return new Map;const r=n$e(o.pubKeyPrefix);let i=t[r];i||(i=i$7.fromString(r),t[r]=i),e.has(i)||e.set(i,[]);const a=e.get(i);a&&a.push(n)}}return e}}const A=[];let t$7=class extends t$h{constructor(){super((e=>u$3.fromString(e)))}},t$6=class extends t$h{constructor(){super((e=>u$3.fromString(e)))}};class a{constructor(e){this.hbars=e.hbars,this.tokens=e.tokens,this.tokenDecimals=e.tokenDecimals,Object.freeze(this)}static fromBytes(e){return a._fromProtobuf(libExports$1.proto.CryptoGetAccountBalanceResponse.decode(e))}static _fromProtobuf(e){const t=new t$7,n=new t$6;if(null!=e.tokenBalances)for(const o of e.tokenBalances){const e=u$3._fromProtobuf(o.tokenId);n._set(e,null!=o.decimals?o.decimals:0),t._set(e,Long.fromValue(o.balance))}return new a({hbars:e$7.fromTinybars(e.balance),tokens:t,tokenDecimals:n})}_toProtobuf(){const e=[];for(const[t,n]of null!=this.tokens?this.tokens:[])e.push({tokenId:t._toProtobuf(),balance:n,decimals:null!=this.tokenDecimals?this.tokenDecimals.get(t):null});return{balance:this.hbars.toTinybars(),tokenBalances:e}}toBytes(){return libExports$1.proto.CryptoGetAccountBalanceResponse.encode(this._toProtobuf()).finish()}toString(){return JSON.stringify(this.toJSON())}toJSON(){const e=[];for(const[t,n]of null!=this.tokens?this.tokens:[]){const o=null!=this.tokenDecimals?this.tokenDecimals.get(t):null;e.push({tokenId:t.toString(),balance:n.toString(),decimals:null!=o?o:0})}return{hbars:this.hbars.toString(),tokens:e}}}class e extends h$1{constructor(e={}){super(),this._accountId=null,this._contractId=null,null!=e.accountId&&this.setAccountId(e.accountId),null!=e.contractId&&this.setContractId(e.contractId)}static _fromProtobuf(t){const n=t.cryptogetAccountBalance;return new e({accountId:null!=n.accountID?f._fromProtobuf(n.accountID):void 0,contractId:null!=n.contractID?v._fromProtobuf(n.contractID):void 0})}get accountId(){return this._accountId}setAccountId(e){return this._accountId="string"==typeof e?f.fromString(e):e.clone(),this}get contractId(){return this._contractId}setContractId(e){return this._contractId="string"==typeof e?v.fromString(e):e.clone(),this}_isPaymentRequired(){return!1}_validateChecksums(e){null!=this._accountId&&this._accountId.validateChecksum(e),null!=this._contractId&&this._contractId.validateChecksum(e)}_execute(e,t){return e.crypto.cryptoGetBalance(t)}_mapResponseHeader(e){return e.cryptogetAccountBalance.header}_mapResponse(e,t,n){const o=e.cryptogetAccountBalance;return Promise.resolve(a._fromProtobuf(o))}_onMakeRequest(e){return{cryptogetAccountBalance:{header:e,accountID:null!=this._accountId?this._accountId._toProtobuf():null,contractID:null!=this._contractId?this._contractId._toProtobuf():null}}}_getLogId(){return`AccountBalanceQuery:${this._timestamp.toString()}`}}d$4.set("cryptogetAccountBalance",e._fromProtobuf);let s$5=class e{constructor(e){this.seconds=e instanceof Long?e:Long.fromNumber(e),Object.freeze(this)}_toProtobuf(){return{seconds:this.seconds}}static _fromProtobuf(t){return new e(t.seconds)}};class l extends S{constructor(e={}){super(),this._key=null,this._initialBalance=null,this._sendRecordThreshold=I,this._receiveRecordThreshold=I,this._receiverSignatureRequired=!1,this._proxyAccountId=null,this._autoRenewPeriod=new s$5(y),this._accountMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=!1,this._alias=null,null!=e.key&&this.setKeyWithoutAlias(e.key),null!=e.receiverSignatureRequired&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),null!=e.initialBalance&&this.setInitialBalance(e.initialBalance),null!=e.proxyAccountId&&this.setProxyAccountId(e.proxyAccountId),null!=e.autoRenewPeriod&&this.setAutoRenewPeriod(e.autoRenewPeriod),null!=e.accountMemo&&this.setAccountMemo(e.accountMemo),null!=e.maxAutomaticTokenAssociations&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),null!=e.stakedAccountId&&this.setStakedAccountId(e.stakedAccountId),null!=e.stakedNodeId&&this.setStakedNodeId(e.stakedNodeId),null!=e.declineStakingReward&&this.setDeclineStakingReward(e.declineStakingReward),null!=e.alias&&this.setAlias(e.alias)}static _fromProtobuf(e,t,n,o,r){const i=r[0].cryptoCreateAccount;let a;return null!=i.alias&&i.alias.length>0&&20===i.alias.length&&(a=o$a.fromBytes(i.alias)),S._fromProtobufTransactions(new l({key:null!=i.key?t$i._fromProtobufKey(i.key):void 0,initialBalance:null!=i.initialBalance?e$7.fromTinybars(i.initialBalance):void 0,receiverSignatureRequired:null!=i.receiverSigRequired?i.receiverSigRequired:void 0,proxyAccountId:null!=i.proxyAccountID?f._fromProtobuf(i.proxyAccountID):void 0,autoRenewPeriod:null!=i.autoRenewPeriod&&null!=i.autoRenewPeriod.seconds?i.autoRenewPeriod.seconds:void 0,accountMemo:null!=i.memo?i.memo:void 0,maxAutomaticTokenAssociations:null!=i.maxAutomaticTokenAssociations?i.maxAutomaticTokenAssociations:void 0,stakedAccountId:null!=i.stakedAccountId?f._fromProtobuf(i.stakedAccountId):void 0,stakedNodeId:null!=i.stakedNodeId?i.stakedNodeId:void 0,declineStakingReward:1==i.declineReward,alias:a}),e,t,n,o,r)}get key(){return this._key}setKey(e){return this._requireNotFrozen(),this._key=e,this}setECDSAKeyWithAlias(e){if(this.setKeyWithoutAlias(e),!(e instanceof y$2)||"secp256k1"!==e.type)throw new Error("'key' must be an ECDSA private key when 'aliasKey' is not provided.");return this.setAlias(e.publicKey.toEvmAddress()),this}setKeyWithAlias(e,t){if(this.setKeyWithoutAlias(e),!(t instanceof y$2)||"secp256k1"!==t.type)throw new Error("'aliasKey' must be an ECDSA private key when provided.");return this.setAlias(t.publicKey.toEvmAddress()),this}setKeyWithoutAlias(e){return this._requireNotFrozen(),this._key=e,this}get initialBalance(){return this._initialBalance}setInitialBalance(e){return this._requireNotFrozen(),this._initialBalance=e instanceof e$7?e:new e$7(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 s$5?e:new s$5(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="number"==typeof e?Long.fromNumber(e):e,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId="string"==typeof e?f.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=Long.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("string"==typeof e){if(!(e.startsWith("0x")&&42==e.length||40==e.length))throw new Error('evmAddress must be a valid EVM address with or without "0x" prefix');this._alias=o$a.fromString(e)}else this._alias=e;return this}_validateChecksums(e){null!=this._proxyAccountId&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.createAccount(t)}_getTransactionDataCase(){return"cryptoCreateAccount"}_makeTransactionData(){let e=null;return null!=this._alias&&(e=this._alias.toBytes()),{key:null!=this._key?this._key._toProtobufKey():null,initialBalance:null!=this._initialBalance?this._initialBalance.toTinybars():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),proxyAccountID:null!=this._proxyAccountId?this._proxyAccountId._toProtobuf():null,receiveRecordThreshold:this._receiveRecordThreshold.toTinybars(),sendRecordThreshold:this._sendRecordThreshold.toTinybars(),receiverSigRequired:this._receiverSignatureRequired,memo:this._accountMemo,maxAutomaticTokenAssociations:null!=this._maxAutomaticTokenAssociations?this._maxAutomaticTokenAssociations.toInt():null,stakedAccountId:null!=this.stakedAccountId?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:this.declineStakingRewards,alias:e}}_getLogId(){return`AccountCreateTransaction:${this._transactionIds.current.validStart.toString()}`}}w$1.set("cryptoCreateAccount",l._fromProtobuf);let r$3=class e{constructor(e){this._ledgerId=e,Object.freeze(this)}static fromString(t){switch(t){case n$3[0]:case"0":return e.MAINNET;case n$3[1]:case"1":return e.TESTNET;case n$3[2]:case"2":return e.PREVIEWNET;case n$3[3]:case"3":return e.LOCAL_NODE;default:{let n=r$a(t);if(0==n.length&&0!=t.length)throw new Error("Default reached for fromString");return new e(n)}}}toString(){if(1!=this._ledgerId.length)return n$e(this._ledgerId);switch(this._ledgerId[0]){case 0:return n$3[0];case 1:return n$3[1];case 2:return n$3[2];case 3:return n$3[3];default:return n$e(this._ledgerId)}}static fromBytes(t){return new e(t)}toBytes(){return this._ledgerId}isMainnet(){return this.toString()==n$3[0]}isTestnet(){return this.toString()==n$3[1]}isPreviewnet(){return this.toString()==n$3[2]}isLocalNode(){return this.toString()==n$3[3]}};const n$3=["mainnet","testnet","previewnet","local-node"];r$3.MAINNET=new r$3(new Uint8Array([0])),r$3.TESTNET=new r$3(new Uint8Array([1])),r$3.PREVIEWNET=new r$3(new Uint8Array([2])),r$3.LOCAL_NODE=new r$3(new Uint8Array([3]));let s$4=class e extends S{constructor(e={}){super(),this._accountId=null,this._key=null,this._receiverSignatureRequired=null,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,null!=e.accountId&&this.setAccountId(e.accountId),null!=e.key&&this.setKey(e.key),null!=e.receiverSignatureRequired&&this.setReceiverSignatureRequired(e.receiverSignatureRequired),null!=e.proxyAccountId&&this.setProxyAccountId(e.proxyAccountId),null!=e.autoRenewPeriod&&this.setAutoRenewPeriod(e.autoRenewPeriod),null!=e.expirationTime&&this.setExpirationTime(e.expirationTime),null!=e.accountMemo&&this.setAccountMemo(e.accountMemo),null!=e.maxAutomaticTokenAssociations&&this.setMaxAutomaticTokenAssociations(e.maxAutomaticTokenAssociations),null!=e.stakedAccountId&&this.setStakedAccountId(e.stakedAccountId),null!=e.stakedNodeId&&this.setStakedNodeId(e.stakedNodeId),null!=e.declineStakingReward&&this.setDeclineStakingReward(e.declineStakingReward)}static _fromProtobuf(t,n,o,r,i){const a=i[0].cryptoUpdateAccount;return S._fromProtobufTransactions(new e({accountId:null!=a.accountIDToUpdate?f._fromProtobuf(a.accountIDToUpdate):void 0,key:null!=a.key?t$i._fromProtobufKey(a.key):void 0,receiverSignatureRequired:null!=a.receiverSigRequiredWrapper&&Object.hasOwn(a.receiverSigRequiredWrapper,"value")?a.receiverSigRequiredWrapper.value:void 0,proxyAccountId:null!=a.proxyAccountID?f._fromProtobuf(a.proxyAccountID):void 0,autoRenewPeriod:null!=a.autoRenewPeriod&&null!=a.autoRenewPeriod.seconds?a.autoRenewPeriod.seconds:void 0,expirationTime:null!=a.expirationTime?s$8._fromProtobuf(a.expirationTime):void 0,accountMemo:null!=a.memo&&Object.hasOwn(a.memo,"value")?a.memo.value:void 0,maxAutomaticTokenAssociations:null!=a.maxAutomaticTokenAssociations&&null!=a.maxAutomaticTokenAssociations.value&&Object.hasOwn(a.maxAutomaticTokenAssociations,"value")?Long.fromNumber(a.maxAutomaticTokenAssociations.value):void 0,stakedAccountId:null!=a.stakedAccountId?f._fromProtobuf(a.stakedAccountId):void 0,stakedNodeId:null!=a.stakedNodeId?a.stakedNodeId:void 0,declineStakingReward:null!=a.declineReward&&Object.hasOwn(a.declineReward,"value")?a.declineReward.value:void 0}),t,n,o,r,i)}get accountId(){return this._accountId}setAccountId(e){return this._requireNotFrozen(),this._accountId="string"==typeof e?f.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 s$5?e:new s$5(e),this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof Date?s$8.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="number"==typeof e?Long.fromNumber(e):e,this}get aliasKey(){return null}setAliasKey(e){return this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId="string"==typeof e?f.fromString(e):e,this}clearStakedAccountId(){return this._requireNotFrozen(),this._stakedAccountId=new f(0,0,0),this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(e){return this._requireNotFrozen(),this._stakedNodeId=Long.fromValue(e),this}clearStakedNodeId(){return this._requireNotFrozen(),this._stakedNodeId=Long.fromNumber(-1),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(e){return this._requireNotFrozen(),this._declineStakingReward=e,this}_validateChecksums(e){null!=this._accountId&&this._accountId.validateChecksum(e),null!=this._proxyAccountId&&this._proxyAccountId.validateChecksum(e)}_execute(e,t){return e.crypto.updateAccount(t)}_getTransactionDataCase(){return"cryptoUpdateAccount"}_makeTransactionData(){return{accountIDToUpdate:null!=this._accountId?this._accountId._toProtobuf():null,key:null!=this._key?this._key._toProtobufKey():null,expirationTime:null!=this._expirationTime?this._expirationTime._toProtobuf():null,proxyAccountID:null!=this._proxyAccountId?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:null!=this._autoRenewPeriod?this._autoRenewPeriod._toProtobuf():null,receiverSigRequiredWrapper:null==this._receiverSignatureRequired?null:{value:this._receiverSignatureRequired},memo:null!=this._accountMemo?{value:this._accountMemo}:null,maxAutomaticTokenAssociations:null!=this._maxAutomaticTokenAssociations?{value:this._maxAutomaticTokenAssociations.toInt()}:null,stakedAccountId:null!=this.stakedAccountId?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:null!=this.declineStakingRewards?{value:this.declineStakingRewards}:null}}_getLogId(){return`AccountUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}};w$1.set("cryptoUpdateAccount",s$4._fromProtobuf);let t$5=class{constructor(e={}){this._left=null,null!=e.left&&this.setLeft(e.left),this._right=null,null!=e.right&&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 null!=this._left&&null!=this._right?`${this._left.toString()}.${this._right.toString()}`:""}},s$3=class e{constructor(e={}){this._network=null,null!=e.network&&this.setNetwork(e.network),this._host=null,null!=e.host&&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(t){return new e({network:(new t$5).setLeft(t[0]).setRight(t[1]),host:(new t$5).setLeft(t[2]).setRight(t[3])})}_toProtobuf(){return Uint8Array.of(null!=this._network&&null!=this._network._left?this._network._left:0,null!=this._network&&null!=this._network.right?this._network.right:0,null!=this._host&&null!=this._host.left?this._host.left:0,null!=this._host&&null!=this._host.right?this._host.right:0)}toString(){return null!=this._network&&null!=this._host?`${this._network.toString()}.${this._host.toString()}`:""}},s$2=class e{constructor(e={}){this._address=null,null!=e.address&&this.setAddress(e.address),this._port=null,null!=e.port&&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(t){return new e({address:null!=t.ipAddressV4?s$3._fromProtobuf(t.ipAddressV4):void 0,port:null!=t.port?t.port:void 0})}_toProtobuf(){return{ipAddressV4:null!=this._address?this._address._toProtobuf():null,port:this._port}}toString(){return`${null!=this._address?this._address.toString():""}:${null!=this._port?this._port.toString():""}`}toJSON(){return{address:null!=this._address?this._address.toString():null,port:null!=this._port?this._port.toString():null}}},i$4=class e{constructor(e={}){this._publicKey=null,null!=e.publicKey&&this.setPublicKey(e.publicKey),this._nodeId=null,null!=e.nodeId&&this.setNodeId(e.nodeId),this._accountId=null,null!=e.accountId&&this.setAccountId(e.accountId),this._certHash=null,null!=e.certHash&&this.setCertHash(e.certHash),this._addresses=[],null!=e.addresses&&this.setAddresses(e.addresses),this._description=null,null!=e.description&&this.setDescription(e.description),this._stake=null,null!=e.stake&&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="string"==typeof e?f.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(t){return new e({publicKey:null!=t.RSA_PubKey?t.RSA_PubKey:void 0,nodeId:null!=t.nodeId?t.nodeId:void 0,accountId:null!=t.nodeAccountId?f._fromProtobuf(t.nodeAccountId):void 0,certHash:null!=t.nodeCertHash?t.nodeCertHash:void 0,addresses:null!=t.serviceEndpoint?t.serviceEndpoint.map((e=>s$2._fromProtobuf(e))):void 0,description:null!=t.description?t.description:void 0,stake:null!=t.stake?t.stake:void 0})}_toProtobuf(){return{RSA_PubKey:this._publicKey,nodeId:this._nodeId,nodeAccountId:null!=this._accountId?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:null!=this._nodeId?this._nodeId.toString():null,accountId:null!=this._accountId?this._accountId.toString():null,certHash:null!=this._certHash?e$3(this._certHash):null,addresses:this._addresses.map((e=>e.toJSON())),description:this._description,stake:null!=this._stake?this._stake.toString():null}}},o$3=class e{constructor(e={}){this._nodeAddresses=[],null!=e.nodeAddresses&&this.setNodeAddresses(e.nodeAddresses)}get nodeAddresses(){return this._nodeAddresses}setNodeAddresses(e){return this._nodeAddresses=e,this}static fromBytes(t){return e._fromProtobuf(libExports$1.proto.NodeAddressBook.decode(t))}static _fromProtobuf(t){return new e({nodeAddresses:null!=t.nodeAddress?t.nodeAddress.map((e=>i$4._fromProtobuf(e))):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 libExports$1.proto.NodeAddressBook.encode(this._toProtobuf()).finish()}},m$1=class e extends S{constructor(e={}){super(),this._defaultMaxTransactionFee=new e$7(25),this._adminKey=null,this._submitKey=null,this._feeScheduleKey=null,this._feeExemptKeys=[],this._autoRenewAccountId=null,this._autoRenewPeriod=new s$5(y),this._customFees=[],this._topicMemo=null,null!=e.adminKey&&this.setAdminKey(e.adminKey),null!=e.submitKey&&this.setSubmitKey(e.submitKey),null!=e.feeScheduleKey&&this.setFeeScheduleKey(e.feeScheduleKey),null!=e.feeExemptKeys&&this.setFeeExemptKeys(e.feeExemptKeys),null!=e.autoRenewAccountId&&this.setAutoRenewAccountId(e.autoRenewAccountId),null!=e.autoRenewPeriod&&this.setAutoRenewPeriod(e.autoRenewPeriod),null!=e.customFees&&this.setCustomFees(e.customFees),null!=e.topicMemo&&this.setTopicMemo(e.topicMemo)}static _fromProtobuf(t,n,o,r,i){const a=i[0].consensusCreateTopic;return S._fromProtobufTransactions(new e({adminKey:null!=a.adminKey?t$i._fromProtobufKey(a.adminKey):void 0,submitKey:null!=a.submitKey?t$i._fromProtobufKey(a.submitKey):void 0,feeScheduleKey:null!=a.feeScheduleKey?t$i._fromProtobufKey(a.feeScheduleKey):void 0,feeExemptKeys:null!=a.feeExemptKeyList?a.feeExemptKeyList.map((e=>t$i._fromProtobufKey(e))):void 0,autoRenewAccountId:null!=a.autoRenewAccount?f._fromProtobuf(a.autoRenewAccount):void 0,autoRenewPeriod:null!=a.autoRenewPeriod&&null!=a.autoRenewPeriod.seconds?a.autoRenewPeriod.seconds:void 0,customFees:null!=a.customFees?a.customFees.map((e=>l$1._fromProtobuf(e))):void 0,topicMemo:null!=a.memo?a.memo:void 0}),t,n,o,r,i)}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}getFeeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}getFeeExemptKeys(){return this._feeExemptKeys}setFeeExemptKeys(e){return this._requireNotFrozen(),this._feeExemptKeys=e,this}addFeeExemptKey(e){return this._requireNotFrozen(),this._feeExemptKeys.push(e),this}clearFeeExemptKeys(){return this._requireNotFrozen(),this._feeExemptKeys=[],this}get autoRenewAccountId(){return this._autoRenewAccountId}getAutoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof f?e:f.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}getAutoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof s$5?e:new s$5(e),this}getCustomFees(){return this._customFees}setCustomFees(e){return this._requireNotFrozen(),this._customFees=e,this}addCustomFee(e){return this._requireNotFrozen(),this._customFees.push(e),this}clearCustomFees(){return this._requireNotFrozen(),this._customFees=[],this}_validateChecksums(e){null!=this._autoRenewAccountId&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.consensus.createTopic(t)}_getTransactionDataCase(){return"consensusCreateTopic"}_makeTransactionData(){return{adminKey:null!=this._adminKey?this._adminKey._toProtobufKey():null,submitKey:null!=this._submitKey?this._submitKey._toProtobufKey():null,feeScheduleKey:null!=this._feeScheduleKey?this._feeScheduleKey._toProtobufKey():null,feeExemptKeyList:this._feeExemptKeys.map((e=>e._toProtobufKey())),autoRenewAccount:null!=this._autoRenewAccountId?this._autoRenewAccountId._toProtobuf():null,autoRenewPeriod:this._autoRenewPeriod._toProtobuf(),customFees:this._customFees.map((e=>e._toTopicFeeProtobuf())),memo:this._topicMemo}}_getLogId(){return`TopicCreateTransaction:${this._transactionIds.current.validStart.toString()}`}};w$1.set("consensusCreateTopic",m$1._fromProtobuf);class u extends S{constructor(e={}){super(),this._topicId=null,null!=e.topicId&&this.setTopicId(e.topicId),this._message=null,null!=e.message&&this.setMessage(e.message),this._maxChunks=20,this._chunkSize=b$2,null!=e.maxChunks&&this.setMaxChunks(e.maxChunks),null!=e.chunkSize&&this.setChunkSize(e.chunkSize),this._chunkInfo=null}static _fromProtobuf(e,t,n,o,r){const i=r[0].consensusSubmitMessage;return S._fromProtobufTransactions(new u({topicId:null!=i.topicID?m$2._fromProtobuf(i.topicID):void 0,message:null!=i.message?i.message:void 0}),e,t,n,o,r)}get topicId(){return this._topicId}setTopicId(e){return this._requireNotFrozen(),this._topicId="string"==typeof e?m$2.fromString(e):e.clone(),this}get message(){return this._message}getMessage(){return this._message}setMessage(e){return this._requireNotFrozen(),e=p(e),this._message=e instanceof Uint8Array?e:n$8(e),this}getCustomFeeLimits(){return this._customFeeLimits}setCustomFeeLimits(e){return this._requireNotFrozen(),this._customFeeLimits=e,this}addCustomFeeLimit(e){return this._requireNotFrozen(),this._customFeeLimits.push(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),null==this._message)return this;const 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`);const n=this._getTransactionId()._toProtobuf();let o=this._getTransactionId();this._transactionIds.locked=!1,this._transactions.clear(),this._transactionIds.clear(),this._signedTransactions.clear();for(let r=0;r<t;r++){this._chunkInfo={initialTransactionID:n,total:t,number:r+1},this._transactionIds.push(o),this._transactionIds.advance();for(const e of this._nodeAccountIds.list)this._signedTransactions.push(this._makeSignedTransaction(e));o=new i$6(o.accountId,new s$8(o.validStart.seconds,o.validStart.nanos.add(1)))}return this._transactionIds.advance(),this._chunkInfo=null,this}schedule(){if(this._requireNotFrozen(),null!=this._message&&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);const n=this._getTransactionId(),o=e.operatorAccountId;null!=o&&o.equals(n.accountId)&&await super.signWithOperator(e);const r=[];let i=t;for(let a=0;a<this._transactionIds.length;a++){const t=Date.now();r.push(await super.execute(e,i)),null!=i&&(i=Date.now()-t)}return r}_execute(e,t){return e.consensus.submitMessage(t)}_getTransactionDataCase(){return"consensusSubmitMessage"}_makeTransactionData(){if(null!=this._chunkInfo&&null!=this._message){const e=(this._chunkInfo.number-1)*this._chunkSize;let t=e+this._chunkSize;return t>this._message.length&&(t=this._message.length),{topicID:null!=this._topicId?this._topicId._toProtobuf():null,message:this._message.slice(e,t),chunkInfo:this._chunkInfo}}return{topicID:null!=this._topicId?this._topicId._toProtobuf():null,message:this._message}}_getLogId(){return`TopicMessageSubmitTransaction:${this._transactionIds.current.validStart.toString()}`}}w$1.set("consensusSubmitMessage",u._fromProtobuf);const d$1=o$3._fromProtobuf(libExports$1.proto.NodeAddressBook.decode(r$a("0ad0070a0e33352e3233312e3230382e31343810a388031a05302e302e3322cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303039663166386131323163326664366337366664353038643365343239663063363462636234346338326137303537333535326161646361643037313536396537323139353866356135643039663935383766666166636662653533343161326630313134616361653334366566336339303231336433343336656262323766343335306339393063356338633366386531653336373037626330386434323536303832336533663234653039613033616430393535613530393830313936323964643034623237623235316463653035356633646463623061343164363666303934316230623837636466653334393864343630333861623564663036663632613561646530383539383537336138386338663538363064633134393261366531383634383561396231333235306536643137623830636433396335633831393130396537336361373332646232336566386261613737366563383563653030393162656362326564656662616135656433653564626662643166383835613466613838316166336631343461386135363538353335333364383933393335393230383662326431643336326534356266653166623435363833616261366336343039373961643662343638373731383437323663366562643538623265616538356337636665336662616265663566366363656438353030333462333834373230366332643637386333363138373630323662386433353165303032616635653066666536663562316632393566646332663436396361613264323338316561306234386361393837636332633865363335653862313963653565313732613933373631613864343930613961343531386437323535383830613134643737623762613737343839326239326134306262383133363265333466633664353137386439623330313132393334323035636237376662396132383234323733393435363461383535346561343732383661343766383632333965373563393437383963653938633939383434373832343632393434663631333136376437623530323033303130303031320218033a606666643661646137346133613334613930346265613437363033303836663862656633623662653138616265643434633464343065313266623133306239376264366238353561656335643062393062306238633733353464356633623065340acf070a0d332e3231312e3234382e31373210a388031a05302e302e3322cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303039663166386131323163326664366337366664353038643365343239663063363462636234346338326137303537333535326161646361643037313536396537323139353866356135643039663935383766666166636662653533343161326630313134616361653334366566336339303231336433343336656262323766343335306339393063356338633366386531653336373037626330386434323536303832336533663234653039613033616430393535613530393830313936323964643034623237623235316463653035356633646463623061343164363666303934316230623837636466653334393864343630333861623564663036663632613561646530383539383537336138386338663538363064633134393261366531383634383561396231333235306536643137623830636433396335633831393130396537336361373332646232336566386261613737366563383563653030393162656362326564656662616135656433653564626662643166383835613466613838316166336631343461386135363538353335333364383933393335393230383662326431643336326534356266653166623435363833616261366336343039373961643662343638373731383437323663366562643538623265616538356337636665336662616265663566366363656438353030333462333834373230366332643637386333363138373630323662386433353165303032616635653066666536663562316632393566646332663436396361613264323338316561306234386361393837636332633865363335653862313963653565313732613933373631613864343930613961343531386437323535383830613134643737623762613737343839326239326134306262383133363265333466633664353137386439623330313132393334323035636237376662396132383234323733393435363461383535346561343732383661343766383632333965373563393437383963653938633939383434373832343632393434663631333136376437623530323033303130303031320218033a606666643661646137346133613334613930346265613437363033303836663862656633623662653138616265643434633464343065313266623133306239376264366238353561656335643062393062306238633733353464356633623065340ace070a0c34302e3132312e36342e343810a388031a05302e302e3322cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303039663166386131323163326664366337366664353038643365343239663063363462636234346338326137303537333535326161646361643037313536396537323139353866356135643039663935383766666166636662653533343161326630313134616361653334366566336339303231336433343336656262323766343335306339393063356338633366386531653336373037626330386434323536303832336533663234653039613033616430393535613530393830313936323964643034623237623235316463653035356633646463623061343164363666303934316230623837636466653334393864343630333861623564663036663632613561646530383539383537336138386338663538363064633134393261366531383634383561396231333235306536643137623830636433396335633831393130396537336361373332646232336566386261613737366563383563653030393162656362326564656662616135656433653564626662643166383835613466613838316166336631343461386135363538353335333364383933393335393230383662326431643336326534356266653166623435363833616261366336343039373961643662343638373731383437323663366562643538623265616538356337636665336662616265663566366363656438353030333462333834373230366332643637386333363138373630323662386433353165303032616635653066666536663562316632393566646332663436396361613264323338316561306234386361393837636332633865363335653862313963653565313732613933373631613864343930613961343531386437323535383830613134643737623762613737343839326239326134306262383133363265333466633664353137386439623330313132393334323035636237376662396132383234323733393435363461383535346561343732383661343766383632333965373563393437383963653938633939383434373832343632393434663631333136376437623530323033303130303031320218033a606666643661646137346133613334613930346265613437363033303836663862656633623662653138616265643434633464343065313266623133306239376264366238353561656335643062393062306238633733353464356633623065340ad1070a0d33352e3139392e31352e31373710a388031a05302e302e3422cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633535376166353739666138333530316265383939623238393037373635626664666364353261623433326230313935613166316563643836666330306162366335353039623066646439376564643363623563656135366132393566333132616262353530383331646266393633663435303131386234666363366532326366343637363230306365396363386564666262663535386463363966303234323634616437643364616232336265643231333363323734653639333434383931353564623130383766393033373039303563363431383561363231316463373432666239613639303964383231383639343762323737343633646662336666306163643437656666313265616431663639373265663263313230333739336334356537373537356265346661313130633765343066613864623963363138376431313366343730343031343137393037316162663539626537643262306465383264653432313564633235353036623163396332366534393137343031633939373530366533373765366266303362363838373237653739343066616436396335653064613363643563626432626537373733353061656132643064343765393761343438633834626536636531333464363462656530393835633239313632663463316535363763636139336430366133633162653861626365333562353537666237376634666536373161363664656337393037353664306538383138313635663262616361613839316161653761633734333766633731373562366562366465623734373233373837353162623662663962306531343833663936363865396664626435363034633339623134643965326265646565633834366139383064373034643137316537626134623766636431613330643934356361313266343761333235643933393861613138663937303636303534643464313566633839393465326465626537336539323731643534383638336636316561343466623235303731653335313861373865643365623337653731613036393166323637303230333031303030312801320218043a606630643934616363663664666633373238373463396462643864373939326562333137616635303031636134313936616261323635383039636233643230306261393631613534333863336135656430356338336264663963643131356432320ad1070a0d332e3133332e3231332e31343610a388031a05302e302e3422cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633535376166353739666138333530316265383939623238393037373635626664666364353261623433326230313935613166316563643836666330306162366335353039623066646439376564643363623563656135366132393566333132616262353530383331646266393633663435303131386234666363366532326366343637363230306365396363386564666262663535386463363966303234323634616437643364616232336265643231333363323734653639333434383931353564623130383766393033373039303563363431383561363231316463373432666239613639303964383231383639343762323737343633646662336666306163643437656666313265616431663639373265663263313230333739336334356537373537356265346661313130633765343066613864623963363138376431313366343730343031343137393037316162663539626537643262306465383264653432313564633235353036623163396332366534393137343031633939373530366533373765366266303362363838373237653739343066616436396335653064613363643563626432626537373733353061656132643064343765393761343438633834626536636531333464363462656530393835633239313632663463316535363763636139336430366133633162653861626365333562353537666237376634666536373161363664656337393037353664306538383138313635663262616361613839316161653761633734333766633731373562366562366465623734373233373837353162623662663962306531343833663936363865396664626435363034633339623134643965326265646565633834366139383064373034643137316537626134623766636431613330643934356361313266343761333235643933393861613138663937303636303534643464313566633839393465326465626537336539323731643534383638336636316561343466623235303731653335313861373865643365623337653731613036393166323637303230333031303030312801320218043a606630643934616363663664666633373238373463396462643864373939326562333137616635303031636134313936616261323635383039636233643230306261393631613534333863336135656430356338336264663963643131356432320ad0070a0c34302e37302e31312e32303210a388031a05302e302e3422cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633535376166353739666138333530316265383939623238393037373635626664666364353261623433326230313935613166316563643836666330306162366335353039623066646439376564643363623563656135366132393566333132616262353530383331646266393633663435303131386234666363366532326366343637363230306365396363386564666262663535386463363966303234323634616437643364616232336265643231333363323734653639333434383931353564623130383766393033373039303563363431383561363231316463373432666239613639303964383231383639343762323737343633646662336666306163643437656666313265616431663639373265663263313230333739336334356537373537356265346661313130633765343066613864623963363138376431313366343730343031343137393037316162663539626537643262306465383264653432313564633235353036623163396332366534393137343031633939373530366533373765366266303362363838373237653739343066616436396335653064613363643563626432626537373733353061656132643064343765393761343438633834626536636531333464363462656530393835633239313632663463316535363763636139336430366133633162653861626365333562353537666237376634666536373161363664656337393037353664306538383138313635663262616361613839316161653761633734333766633731373562366562366465623734373233373837353162623662663962306531343833663936363865396664626435363034633339623134643965326265646565633834366139383064373034643137316537626134623766636431613330643934356361313266343761333235643933393861613138663937303636303534643464313566633839393465326465626537336539323731643534383638336636316561343466623235303731653335313861373865643365623337653731613036393166323637303230333031303030312801320218043a606630643934616363663664666633373238373463396462643864373939326562333137616635303031636134313936616261323635383039636233643230306261393631613534333863336135656430356338336264663963643131356432320ad2070a0e33352e3232352e3230312e31393510a388031a05302e302e3522cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030396261343537623733333035663034613931636334366231623936356334653834313735316162633862313431356130626164666431663332633234383233383661323237323565623765633734646561323165353036313764363438656135616333393337343161623031623865666233323132333962386434666462316466626562396533663339616134363538306464303435643138636134346430303263333764646235323763636534646463333262666337333431393637316634636134343634613366326138346663383563373161636630653561383936323664663639613831343734656431363532396638303161386166613937653433356334653034613936346133353735323732383838343365353866306130356366353135336565343530376232633638623364376662353461653661393561393539633837613132663633306539356337623162336333363935653835383636323431373932366437366331363938336661663631323235303338373435393037653963663133643637633261636435303363613435316338353933336163343131386163633237393830316362393638333439393033313435636564323736323964643038393136333137303933353837613737633232303563666135323534336235336333623665613135623834653364326333306331656437353261343633336333366232356239383933656130326164353632656239623738363862336234663437663461323565333536303634393632616337623235653538323934346630306433303739386132363266393231346438633565373464306138333736636332643662613634653138663565346134306166616336323530363264326361323363643238303037303833323164333833343331346630653538343438353932333236373361333265373061653064373131653331303538316263646231346538373133343639346336653039333066343662333762393664343961363435373339343733333165376535303764396535366465356536313436663266303230333031303030312802320218053a606361363738656263626433646338363438663765643033666235396630653231616636373531336561656535313331386536623534396265356163653930366564633166666132366439336135376163656339626537376634306561656564370ad1070a0d35322e31352e3130352e31333010a388031a05302e302e3522cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030396261343537623733333035663034613931636334366231623936356334653834313735316162633862313431356130626164666431663332633234383233383661323237323565623765633734646561323165353036313764363438656135616333393337343161623031623865666233323132333962386434666462316466626562396533663339616134363538306464303435643138636134346430303263333764646235323763636534646463333262666337333431393637316634636134343634613366326138346663383563373161636630653561383936323664663639613831343734656431363532396638303161386166613937653433356334653034613936346133353735323732383838343365353866306130356366353135336565343530376232633638623364376662353461653661393561393539633837613132663633306539356337623162336333363935653835383636323431373932366437366331363938336661663631323235303338373435393037653963663133643637633261636435303363613435316338353933336163343131386163633237393830316362393638333439393033313435636564323736323964643038393136333137303933353837613737633232303563666135323534336235336333623665613135623834653364326333306331656437353261343633336333366232356239383933656130326164353632656239623738363862336234663437663461323565333536303634393632616337623235653538323934346630306433303739386132363266393231346438633565373464306138333736636332643662613634653138663565346134306166616336323530363264326361323363643238303037303833323164333833343331346630653538343438353932333236373361333265373061653064373131653331303538316263646231346538373133343639346336653039333066343662333762393664343961363435373339343733333165376535303764396535366465356536313436663266303230333031303030312802320218053a606361363738656263626433646338363438663765643033666235396630653231616636373531336561656535313331386536623534396265356163653930366564633166666132366439336135376163656339626537376634306561656564370ad1070a0d3130342e34332e3234382e363310a388031a05302e302e3522cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030396261343537623733333035663034613931636334366231623936356334653834313735316162633862313431356130626164666431663332633234383233383661323237323565623765633734646561323165353036313764363438656135616333393337343161623031623865666233323132333962386434666462316466626562396533663339616134363538306464303435643138636134346430303263333764646235323763636534646463333262666337333431393637316634636134343634613366326138346663383563373161636630653561383936323664663639613831343734656431363532396638303161386166613937653433356334653034613936346133353735323732383838343365353866306130356366353135336565343530376232633638623364376662353461653661393561393539633837613132663633306539356337623162336333363935653835383636323431373932366437366331363938336661663631323235303338373435393037653963663133643637633261636435303363613435316338353933336163343131386163633237393830316362393638333439393033313435636564323736323964643038393136333137303933353837613737633232303563666135323534336235336333623665613135623834653364326333306331656437353261343633336333366232356239383933656130326164353632656239623738363862336234663437663461323565333536303634393632616337623235653538323934346630306433303739386132363266393231346438633565373464306138333736636332643662613634653138663565346134306166616336323530363264326361323363643238303037303833323164333833343331346630653538343438353932333236373361333265373061653064373131653331303538316263646231346538373133343639346336653039333066343662333762393664343961363435373339343733333165376535303764396535366465356536313436663266303230333031303030312802320218053a606361363738656263626433646338363438663765643033666235396630653231616636373531336561656535313331386536623534396265356163653930366564633166666132366439336135376163656339626537376634306561656564370ad2070a0e33352e3234372e3130392e31333510a388031a05302e302e3622cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633432636361633566626336393166626265626461383766666431653735626463643839323234393463663434666462636365653439373838353231633337386266373764623039333465633064323138336437633531646236366638363463313161623764653161633363346366646331663039336132643666333765326233346362653463383133316639363833616434323837386338336433353534633634356161313637626366623036346138336463343563356231313538343939663964393235383766666637616263643566323231636438313530353438343133303030666136653536353930383962316466643635373636656137386561656466636136623435343535666438616235393834646265333565353739356432633633356561373937346434336538656165346665626666653439326537303762343862316230666336343831616539653039643339313333303039623764323634303265366535326535653931623262333830643838663062653766623462333033653730323139373835303537616139346365393234633439323665393136353639323836653836623362613635316361326130613633646634663639303766656665333438336439336234636531643464303363373134323131313337356232633263353164346562383339653337616635333062326362643666353064346362333665323739333731373064396364646163306163653263633234623830346230613237333531636638333062373635323565323664666239646266343961303536363234613736383632343934653732363364306437306365626165393532393433653535383432663563616431336663663630613265366463663761316435333366336135626235346563323139313863373665353235626132393134363637353833316531376533366336316665383534393838323864303962373632303135343132623265353237383439626165633163666663373764653463323934633535303831316535393866663234646131356133343536396464303230333031303030312803320218063a603234373166336665383134303638316665393139313364326363303633663036356534343930616536326666356435343861356162653133316432616639366362653361633235626265323433363663613466386630653736636639343566330acf070a0b35342e3234312e33382e3110a388031a05302e302e3622cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633432636361633566626336393166626265626461383766666431653735626463643839323234393463663434666462636365653439373838353231633337386266373764623039333465633064323138336437633531646236366638363463313161623764653161633363346366646331663039336132643666333765326233346362653463383133316639363833616434323837386338336433353534633634356161313637626366623036346138336463343563356231313538343939663964393235383766666637616263643566323231636438313530353438343133303030666136653536353930383962316466643635373636656137386561656466636136623435343535666438616235393834646265333565353739356432633633356561373937346434336538656165346665626666653439326537303762343862316230666336343831616539653039643339313333303039623764323634303265366535326535653931623262333830643838663062653766623462333033653730323139373835303537616139346365393234633439323665393136353639323836653836623362613635316361326130613633646634663639303766656665333438336439336234636531643464303363373134323131313337356232633263353164346562383339653337616635333062326362643666353064346362333665323739333731373064396364646163306163653263633234623830346230613237333531636638333062373635323565323664666239646266343961303536363234613736383632343934653732363364306437306365626165393532393433653535383432663563616431336663663630613265366463663761316435333366336135626235346563323139313863373665353235626132393134363637353833316531376533366336316665383534393838323864303962373632303135343132623265353237383439626165633163666663373764653463323934633535303831316535393866663234646131356133343536396464303230333031303030312803320218063a603234373166336665383134303638316665393139313364326363303633663036356534343930616536326666356435343861356162653133316432616639366362653361633235626265323433363663613466386630653736636639343566330acf070a0b31332e38382e32322e343710a388031a05302e302e3622cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633432636361633566626336393166626265626461383766666431653735626463643839323234393463663434666462636365653439373838353231633337386266373764623039333465633064323138336437633531646236366638363463313161623764653161633363346366646331663039336132643666333765326233346362653463383133316639363833616434323837386338336433353534633634356161313637626366623036346138336463343563356231313538343939663964393235383766666637616263643566323231636438313530353438343133303030666136653536353930383962316466643635373636656137386561656466636136623435343535666438616235393834646265333565353739356432633633356561373937346434336538656165346665626666653439326537303762343862316230666336343831616539653039643339313333303039623764323634303265366535326535653931623262333830643838663062653766623462333033653730323139373835303537616139346365393234633439323665393136353639323836653836623362613635316361326130613633646634663639303766656665333438336439336234636531643464303363373134323131313337356232633263353164346562383339653337616635333062326362643666353064346362333665323739333731373064396364646163306163653263633234623830346230613237333531636638333062373635323565323664666239646266343961303536363234613736383632343934653732363364306437306365626165393532393433653535383432663563616431336663663630613265366463663761316435333366336135626235346563323139313863373665353235626132393134363637353833316531376533366336316665383534393838323864303962373632303135343132623265353237383439626165633163666663373764653463323934633535303831316535393866663234646131356133343536396464303230333031303030312803320218063a603234373166336665383134303638316665393139313364326363303633663036356534343930616536326666356435343861356162653133316432616639366362653361633235626265323433363663613466386630653736636639343566330ad0070a0c33352e3233352e36352e353110a388031a05302e302e3722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393032663034393061396237663564326364316330643936633661363939306635373362356630656235626462626133393636316566303233303932343139333434363639393639613638613463373037316433323939393066623137393265393030316362353539386561373163326436363736383234333230656534636162663164643335376165376632616462656463316231623061396439353632333737396234633463376234376334373837613136656537313838633732313731373736323461393236346162333963343166376666306234356138396264613430633461643037633464353936643566303964373035366263623561333566343466393561353963323636653039383932646362653436616435316632643262336539393161386636363538653166326362393463373733656234346334346538393264316535356331303736663136303833313965653635376534306631393239363735343361623432616232323233383664313735383665323533373438646162643032356535306235306165363035303732306532333964363465653666623435303763303631346464346265376166646231333330383930666633613665313736353237633331313661663132396139616335653333366439663630316537313237613664376438323061643266393032646163396232343836363861316261623038643130333432656136396137303937313332666637313230636336346663646537383430633635366261313733326261393565396333363735313137356534656333643834613765306432383834326234316262626264366632386534366333613636333365313832373936356335353832306435306461653262303436356363306434326531393562396431353332653632323565623939386436613439303739613861316364346430313735646533633837663937363134383437623363626231376161333462653832306237623361643938616333666165663939336136373738393734373832633063346165336661626263633433303230333031303030312804320218073a606633353738373364343131346131616566303361646336626136396566616632363930653232376162633136613666633665353034396136336662643936383830303462313465343633633230653338343336613361323464333138326464380ad1070a0d35342e3137372e35312e31323710a388031a05302e302e3722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393032663034393061396237663564326364316330643936633661363939306635373362356630656235626462626133393636316566303233303932343139333434363639393639613638613463373037316433323939393066623137393265393030316362353539386561373163326436363736383234333230656534636162663164643335376165376632616462656463316231623061396439353632333737396234633463376234376334373837613136656537313838633732313731373736323461393236346162333963343166376666306234356138396264613430633461643037633464353936643566303964373035366263623561333566343466393561353963323636653039383932646362653436616435316632643262336539393161386636363538653166326362393463373733656234346334346538393264316535356331303736663136303833313965653635376534306631393239363735343361623432616232323233383664313735383665323533373438646162643032356535306235306165363035303732306532333964363465653666623435303763303631346464346265376166646231333330383930666633613665313736353237633331313661663132396139616335653333366439663630316537313237613664376438323061643266393032646163396232343836363861316261623038643130333432656136396137303937313332666637313230636336346663646537383430633635366261313733326261393565396333363735313137356534656333643834613765306432383834326234316262626264366632386534366333613636333365313832373936356335353832306435306461653262303436356363306434326531393562396431353332653632323565623939386436613439303739613861316364346430313735646533633837663937363134383437623363626231376161333462653832306237623361643938616333666165663939336136373738393734373832633063346165336661626263633433303230333031303030312804320218073a606633353738373364343131346131616566303361646336626136396566616632363930653232376162633136613666633665353034396136336662643936383830303462313465343633633230653338343336613361323464333138326464380ad0070a0c31332e36342e3137302e343010a388031a05302e302e3722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393032663034393061396237663564326364316330643936633661363939306635373362356630656235626462626133393636316566303233303932343139333434363639393639613638613463373037316433323939393066623137393265393030316362353539386561373163326436363736383234333230656534636162663164643335376165376632616462656463316231623061396439353632333737396234633463376234376334373837613136656537313838633732313731373736323461393236346162333963343166376666306234356138396264613430633461643037633464353936643566303964373035366263623561333566343466393561353963323636653039383932646362653436616435316632643262336539393161386636363538653166326362393463373733656234346334346538393264316535356331303736663136303833313965653635376534306631393239363735343361623432616232323233383664313735383665323533373438646162643032356535306235306165363035303732306532333964363465653666623435303763303631346464346265376166646231333330383930666633613665313736353237633331313661663132396139616335653333366439663630316537313237613664376438323061643266393032646163396232343836363861316261623038643130333432656136396137303937313332666637313230636336346663646537383430633635366261313733326261393565396333363735313137356534656333643834613765306432383834326234316262626264366632386534366333613636333365313832373936356335353832306435306461653262303436356363306434326531393562396431353332653632323565623939386436613439303739613861316364346430313735646533633837663937363134383437623363626231376161333462653832306237623361643938616333666165663939336136373738393734373832633063346165336661626263633433303230333031303030312804320218073a606633353738373364343131346131616566303361646336626136396566616632363930653232376162633136613666633665353034396136336662643936383830303462313465343633633230653338343336613361323464333138326464380ad1070a0d33342e3130362e3234372e363510a388031a05302e302e3822cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393164376466666637386634656662653538393034353063356263396533353334626666616461643933666237616662313562633762636636376433643362343133626439393934306464383235363461646130346162326534656466306131633062386662376531613830393265393133386539363062653263633638623562393766353764323831633538373265393761343739666338343833363331363065333836336235376233336534383639623138356163653565333662643433616535666136373863396562363666316634303134373836383236623266386661376530303630663434303563306138663964613732303566663436383361323433666130663331356631616662623461346431343064303232333465343437336662393266636233386633656232386336306366376362666236346530363963313830383665346464363139333839323061653066643763313933653665313034653635623831376564393339386532333232333766646630383332326339636563303964343039393237326137633031356432326234646363393639663665613166353138393032313035646636303039326235356134316234663332623935376235376438346535623232333930356538363938393531373333656139663265323436316563306436353232656538313664353835306661636665623431326366663962393939343361383764633064303436343437636539336239376531366437336239366234323633393632663831666366393435386535373537376337383061366631363135616137613132333236373338653236396262373331663839653839313632326535373765613534343230626630636134366265366663346637316366323638316163303235326161383835653133626536373263643238343539303432376463643133376366333131363235653862656533623038666463616166343635623338376365376362333338313666326331346136623939616337643733343331386366633539623765643933396261666566383739303230333031303030312805320218083a603439333161373832303264353566313062333135373537383563336634333964623638313962643131303033646637626332636539326532396135313762376332313838306465623463303137393537343462353736636434336238343938640ad0070a0c33352e38332e38392e31373110a388031a05302e302e3822cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393164376466666637386634656662653538393034353063356263396533353334626666616461643933666237616662313562633762636636376433643362343133626439393934306464383235363461646130346162326534656466306131633062386662376531613830393265393133386539363062653263633638623562393766353764323831633538373265393761343739666338343833363331363065333836336235376233336534383639623138356163653565333662643433616535666136373863396562363666316634303134373836383236623266386661376530303630663434303563306138663964613732303566663436383361323433666130663331356631616662623461346431343064303232333465343437336662393266636233386633656232386336306366376362666236346530363963313830383665346464363139333839323061653066643763313933653665313034653635623831376564393339386532333232333766646630383332326339636563303964343039393237326137633031356432326234646363393639663665613166353138393032313035646636303039326235356134316234663332623935376235376438346535623232333930356538363938393531373333656139663265323436316563306436353232656538313664353835306661636665623431326366663962393939343361383764633064303436343437636539336239376531366437336239366234323633393632663831666366393435386535373537376337383061366631363135616137613132333236373338653236396262373331663839653839313632326535373765613534343230626630636134366265366663346637316366323638316163303235326161383835653133626536373263643238343539303432376463643133376366333131363235653862656533623038666463616166343635623338376365376362333338313666326331346136623939616337643733343331386366633539623765643933396261666566383739303230333031303030312805320218083a603439333161373832303264353566313062333135373537383563336634333964623638313962643131303033646637626332636539326532396135313762376332313838306465623463303137393537343462353736636434336238343938640ad1070a0d31332e37382e3233322e31393210a388031a05302e302e3822cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393164376466666637386634656662653538393034353063356263396533353334626666616461643933666237616662313562633762636636376433643362343133626439393934306464383235363461646130346162326534656466306131633062386662376531613830393265393133386539363062653263633638623562393766353764323831633538373265393761343739666338343833363331363065333836336235376233336534383639623138356163653565333662643433616535666136373863396562363666316634303134373836383236623266386661376530303630663434303563306138663964613732303566663436383361323433666130663331356631616662623461346431343064303232333465343437336662393266636233386633656232386336306366376362666236346530363963313830383665346464363139333839323061653066643763313933653665313034653635623831376564393339386532333232333766646630383332326339636563303964343039393237326137633031356432326234646363393639663665613166353138393032313035646636303039326235356134316234663332623935376235376438346535623232333930356538363938393531373333656139663265323436316563306436353232656538313664353835306661636665623431326366663962393939343361383764633064303436343437636539336239376531366437336239366234323633393632663831666366393435386535373537376337383061366631363135616137613132333236373338653236396262373331663839653839313632326535373765613534343230626630636134366265366663346637316366323638316163303235326161383835653133626536373263643238343539303432376463643133376366333131363235653862656533623038666463616166343635623338376365376362333338313666326331346136623939616337643733343331386366633539623765643933396261666566383739303230333031303030312805320218083a603439333161373832303264353566313062333135373537383563336634333964623638313962643131303033646637626332636539326532396135313762376332313838306465623463303137393537343462353736636434336238343938640ad0070a0c33342e3132352e32332e343910a388031a05302e302e3922cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633665313863386662663463643465623130343534326362323061616161323532643935663035326631303836643538316334346164373337626636363736633063336637383961663532363562386166623739623530393132646138346530616663663735343763623166666630386430353237303137656236646335636466383362353139363964343433333661363338376364373062393462663463396261663230323938343065356634663836336437303831663066613831653038363361646564623862383961356461633262623535326436653762396662613232326163323863353730373535333866633935373939323934326433343166613238373665366235303765396365376564353732653863666461356465666133363466646638643865323338323961346363626234373866313165656533623332616238356530373239353163356439343230313135666261333237303733343934663433623566366265626638343135326533353665376231366261373634623761336235326362323733343634303136336265313436356536643166613463366536663636363834613633356339613535366161373130306462653634356466386634633432336165343561303863623335623462633138373838366532323939623563303231306135666261336239343439663438336566393465643932326531653938633131336265313636623839633733353832323433313335643434323330366162653561373162373730313866663333356436646437393534323639376231363832333862393637323766643133333962356638326133623661353937643937363033376165323530363435366338623334653966626633626333323431303434316334626663386562613538353937323534656665626661613738383039613563383835343732396135626137386563653139666338343037646438383934613662633738343430333764383738636163653663313532633265383965386136346230363861366332333765303939393362653830363839303230333031303030312806320218093a603634653039383631356266343035663765643561343031333434366238396334383863666364366262323561346136373664633737656561313164333364373032363832663061363961383033306538633537373764306534323230333739390acf070a0b35302e31382e31372e393310a388031a05302e302e3922cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633665313863386662663463643465623130343534326362323061616161323532643935663035326631303836643538316334346164373337626636363736633063336637383961663532363562386166623739623530393132646138346530616663663735343763623166666630386430353237303137656236646335636466383362353139363964343433333661363338376364373062393462663463396261663230323938343065356634663836336437303831663066613831653038363361646564623862383961356461633262623535326436653762396662613232326163323863353730373535333866633935373939323934326433343166613238373665366235303765396365376564353732653863666461356465666133363466646638643865323338323961346363626234373866313165656533623332616238356530373239353163356439343230313135666261333237303733343934663433623566366265626638343135326533353665376231366261373634623761336235326362323733343634303136336265313436356536643166613463366536663636363834613633356339613535366161373130306462653634356466386634633432336165343561303863623335623462633138373838366532323939623563303231306135666261336239343439663438336566393465643932326531653938633131336265313636623839633733353832323433313335643434323330366162653561373162373730313866663333356436646437393534323639376231363832333862393637323766643133333962356638326133623661353937643937363033376165323530363435366338623334653966626633626333323431303434316334626663386562613538353937323534656665626661613738383039613563383835343732396135626137386563653139666338343037646438383934613662633738343430333764383738636163653663313532633265383965386136346230363861366332333765303939393362653830363839303230333031303030312806320218093a603634653039383631356266343035663765643561343031333434366238396334383863666364366262323561346136373664633737656561313164333364373032363832663061363961383033306538633537373764306534323230333739390ad1070a0d32302e3135302e3133362e383910a388031a05302e302e3922cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633665313863386662663463643465623130343534326362323061616161323532643935663035326631303836643538316334346164373337626636363736633063336637383961663532363562386166623739623530393132646138346530616663663735343763623166666630386430353237303137656236646335636466383362353139363964343433333661363338376364373062393462663463396261663230323938343065356634663836336437303831663066613831653038363361646564623862383961356461633262623535326436653762396662613232326163323863353730373535333866633935373939323934326433343166613238373665366235303765396365376564353732653863666461356465666133363466646638643865323338323961346363626234373866313165656533623332616238356530373239353163356439343230313135666261333237303733343934663433623566366265626638343135326533353665376231366261373634623761336235326362323733343634303136336265313436356536643166613463366536663636363834613633356339613535366161373130306462653634356466386634633432336165343561303863623335623462633138373838366532323939623563303231306135666261336239343439663438336566393465643932326531653938633131336265313636623839633733353832323433313335643434323330366162653561373162373730313866663333356436646437393534323639376231363832333862393637323766643133333962356638326133623661353937643937363033376165323530363435366338623334653966626633626333323431303434316334626663386562613538353937323534656665626661613738383039613563383835343732396135626137386563653139666338343037646438383934613662633738343430333764383738636163653663313532633265383965386136346230363861366332333765303939393362653830363839303230333031303030312806320218093a60363465303938363135626634303566376564356134303133343436623839633438386366636436626232356134613637366463373765656131316433336437303236383266306136396138303330653863353737376430653432323033373939"))),o$2=o$3._fromProtobuf(libExports$1.proto.NodeAddressBook.decode(r$a("0a7f0a0c33342e39342e3130362e363110a388031a05302e302e33320218033a606131373165336261383334373637343761656232653261633464306531313563616161623931383230336230646665316364656162343433343338666332383961626338626138613661666638336462356631623333343034366461383863380a80010a0d35302e31382e3133322e32313110a388031a05302e302e33320218033a606131373165336261383334373637343761656232653261633464306531313563616161623931383230336230646665316364656162343433343338666332383961626338626138613661666638336462356631623333343034366461383863380a81010a0e3133382e39312e3134322e32313910a388031a05302e302e33320218033a606131373165336261383334373637343761656232653261633464306531313563616161623931383230336230646665316364656162343433343338666332383961626338626138613661666638336462356631623333343034366461383863380a82010a0d33352e3233372e3131392e353510a388031a05302e302e342801320218043a603734303964656332653439346236323765653439633639623239346265316365616562636133666463616633363738396538386663376435623065656635353631663532623832643335313931613339633266626564363032373236373136360a7f0a0a332e3231322e362e313310a388031a05302e302e342801320218043a603734303964656332653439346236323765653439633639623239346265316365616562636133666463616633363738396538386663376435623065656635353631663532623832643335313931613339633266626564363032373236373136360a82010a0d35322e3136382e37362e32343110a388031a05302e302e342801320218043a603734303964656332653439346236323765653439633639623239346265316365616562636133666463616633363738396538386663376435623065656635353631663532623832643335313931613339633266626564363032373236373136360a82010a0d33352e3234352e32372e31393310a388031a05302e302e352802320218053a603962313431363538346134613338306262383661366337643732303764386165646462633362363365613330353939383235356263653833353162613462356463613532633932383261353461366265643630646536336365303361616132340a80010a0b35322e32302e31382e383610a388031a05302e302e352802320218053a603962313431363538346134613338306262383661366337643732303764386165646462633362363365613330353939383235356263653833353162613462356463613532633932383261353461366265643630646536336365303361616132340a81010a0c34302e37392e38332e31323410a388031a05302e302e352802320218053a603962313431363538346134613338306262383661366337643732303764386165646462633362363365613330353939383235356263653833353162613462356463613532633932383261353461366265643630646536336365303361616132340a82010a0d33342e38332e3131322e31313610a388031a05302e302e362803320218063a603634383636383562346536653063623936333437326330316665393939333166643965346334343838376261383334323361653766656564323264363438343834636638613362633563636361366133373338376266393664333836373238300a81010a0c35342e37302e3139322e333310a388031a05302e302e362803320218063a603634383636383562346536653063623936333437326330316665393939333166643965346334343838376261383334323361653766656564323264363438343834636638613362633563636361366133373338376266393664333836373238300a81010a0c35322e3138332e34352e363510a388031a05302e302e362803320218063a603634383636383562346536653063623936333437326330316665393939333166643965346334343838376261383334323361653766656564323264363438343834636638613362633563636361366133373338376266393664333836373238300a80010a0b33342e39342e3136302e3410a388031a05302e302e372804320218073a603339653930393931356138353238303330313534613663373730393530633762343737376261343031333537633065363138373635343231356363323061616363646438653566663239653963346439356366343130316661363862653435630a83010a0e35342e3137362e3139392e31303910a388031a05302e302e372804320218073a603339653930393931356138353238303330313534613663373730393530633762343737376261343031333537633065363138373635343231356363323061616363646438653566663239653963346439356366343130316661363862653435630a82010a0d31332e36342e3138312e31333610a388031a05302e302e372804320218073a603339653930393931356138353238303330313534613663373730393530633762343737376261343031333537633065363138373635343231356363323061616363646438653566663239653963346439356366343130316661363862653435630a83010a0e33342e3130362e3130322e32313810a388031a05302e302e382805320218083a606134343837346137616131623337373431613037316164616165373866623135326236393664316335386438646566626531643832333034353332613063303139656539366363313964373536383635373864333961316536633331613165650a82010a0d33352e3135352e34392e31343710a388031a05302e302e382805320218083a606134343837346137616131623337373431613037316164616165373866623135326236393664316335386438646566626531643832333034353332613063303139656539366363313964373536383635373864333961316536633331613165650a81010a0c31332e37382e3233382e333210a388031a05302e302e382805320218083a606134343837346137616131623337373431613037316164616165373866623135326236393664316335386438646566626531643832333034353332613063303139656539366363313964373536383635373864333961316536633331613165650a83010a0e33342e3133332e3139372e32333010a388031a05302e302e392806320218093a603639383332613733613336303265386431666265356164353864316332363337613162363732643731656538376166313064623634386562393161666232323832353362316634376535376433643461343466663534376233333934616132320a82010a0d35322e31342e3235322e32303710a388031a05302e302e392806320218093a603639383332613733613336303265386431666265356164353864316332363337613162363732643731656538376166313064623634386562393161666232323832353362316634376535376433643461343466663534376233333934616132320a82010a0d35322e3136352e31372e32333110a388031a05302e302e392806320218093a60363938333261373361333630326538643166626535616435386431633236333761316236373264373165653837616631306462363438656239316166623232383235336231663437653537643364346134346666353437623333393461613232"))),b$1=o$3._fromProtobuf(libExports$1.proto.NodeAddressBook.decode(r$a("0ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030633435363165336332373863643635306538306334313363613434343233633163336331336366313437356636663639373664353937616534333262343961623432303836623739623834313332363035346238623364636635376438666364373962666330353831383363613234636434633163626335373465643131313765326635623762336336336365376230366439623465666366373337353633376234316665366635336338313162396465363134336633613532393537636466393536373735313230623333373033666635373632313430376162393537356263326433356330643434663039383366633165663633613466663532303966303730633932616631303632393536303163393662636564303634656331393031393730313963363831316334633864643830636234663461633731663961643736653761633839343536666266346630313166393061626432643930353336653832333436353166366265663932376533643564386237626634353930353039383362656361336162656632613964393761663334353737326137373430653936393932373562303138656130646632383661646436636539323365663930386662653736326137356632313131363836326462343464336463613164343462346432653864633130363663353030366262356137643935346164323535643462363033323733343735653531316165623438356430363961303637633061623563323435333863393333633036623561366165666139343030356332393135323133653463636461653663393432663632373266396464353238326436623839306631663230656664323339396364363734393234666135373034366163366461333265373339353161373331313365393166633262376666323965343835316238336666333966383362613965633666303863656664626236636262626666616266646661613931643933306637323030646134383133376333393463626431336537303165636463323631366664323162616436383161613466303031303230333031303030312804320218073a603665396138616263646364653665313134396133656265313766643538643839303538333961383664623732623036613365613230616131373666383638623235343838353261653432336437613963366237636666396537313436323961320ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030613163343037373135343330336363373263346662373639326333663934323531626465633132333961316637613839373261626539316133353332336662656361363235613766666165363430366338353564633261663231313039303062306466306536653664623736333634646661316666653835656461353637393336653239383562383536333461333261613532613635393964643663333062653166376136633562386635656563616632363231643861343539363832666364326462616164313536316431316633336663636237663535303061633536386431363564626561616365333238366432383934663634313239643738316436633732666437643539396339653164336166346161343333633233623931306661653463343834313634316636313532366164373837656265613533393837343136376539643361373363633066623135363432396431356563373633613664306630363131356137396239616637383364373762393864383330393661613437343366393734303864396531346263663464646666653435393137363838343762343063623864613763613337353235366432623933356430393566653235326661653831666636653337663834643761393064376535373061346638656633633764373636656564613437326630393230313939303135613839303832353961383733633534353466636262646361643265353238646538353435356234303833633764633461646335613938386530636464666463313539643564373132616264353434616137336563303239303839383134633938613434663236666330363434363539633138336533313834616132373266386431646330626661336530613536303438346362303535626134646262356363333339656338306264313164363432646333613730326538633730336162323139333038346439626436336630646665313261343333633235373665616637383163666164383637656637306264613631373638623262656631346635306336633362386230393666303230333031303030312805320218083a606464336233653763643361323537643832373665343635333533363162303138623730303931663438363635653832303031306538316563303539326236396264346265316662643765636435303964303730313364643034313238343266640ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030623263636163363561643066633736343561383137626661626334383761643765343133313165376133313938623337666238343264383463333935623366363764366264383438663130633666303363323930653866376461613864303031613834343164633335326131393136306133313933653638623832656466313961653637363933613961333364346362383765373839613130373037313535313565613737326361613862383661353639623931633534353038333564396333353466306461636563393766653737303931623435623134373639386237663836303134323264636432323631653932386465346461633963343264636261666466393663303732333362613330323730373666333763393639653865643330623662356438663530333462653764393263353936663862653836316535316663633361323432626639643862653965326139653865306631353565626366663233656666613763643537633130353432383131643830373736633935383535323666646230656161333465653139353564353131313933393066653837336534633034646564643239313635383834623938623436333038373838616537666334643461613461386663396263323637346261333231343933623632343435356164343130633164653731626339356431643931666130663230313431386137393565333039656166323937623639396266323763396661323736336364353963656230323165313662383230306331303630663238313766643833636663373637313833343839343631653335393932393162333830643665393339626161346231393233326136613237326464653635316638303436666463333464623237366137373764366662326265633332353562326363323434623461663536366231303566333063363530366464616530656233646564646366393437626362396336306530303039383466336234613863366334656434626639306263313933326237663934646333616536623336303030386562393032303430663962303230333031303030312802320218053a603561383634313561303861306138323566336232656237353031303135353230326533313234336665343161303333333834653738633138633131653565386632303964343933623062326664343565303662333734663262363964663564370ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030613365333762373663366364356636363232643639323434343464313263363737633339356632623539303266336262393862386138623530353561373037373036636130323863643735303630613264383730326432643862303439343762646366653061386331343161613238343462316530366536363139303031326538623633323661623066613331373937336263376362346432393439663231303861613034633462306339316261613537323866356235363232656337356162663537386131663762343165646532613637656264363963313865353831666466396336303230616330646539636132633331663063363436393030333331316662623563653764623439633738376531613764323761613432356565376238346461376536363933396639633830643065383266636535356530326466633862356337383431386132366161343336353036393837313962616663656366306264343930303061646463666134303537303862646265666262313937343964323264616230303765343464343565613233623130366638383334633135326532353036326434636632346666323533353663376562333732393130353339336662343962616239303461303266306630626234313763643931396433353238393031323865366262666634666163396639306465313138613937346632613664643031653033326137396231373866363066613166636262643032623537303466623436323935633135313930383136333733656464363633356338353639373866316239353033663166373362346230626538616261326564316665656164353939353362663832656664653933613334373161626435356364613362613861363733666262333739393734396662303036643030336630653633663636356333343631643261376232396463386232303462613539613635363638613436616532383738663030643166393439306466396532383066656266343331356561303465616135363861336139666434386336326336336236656364613639303230333031303030312803320218063a606434363430333938303337393230373965636364356134343331316361306463323262353065633839356235366535336431326232396637326463366462613363616665326535623831303466626461303338616635623434376430666231320ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393361323135636334613761373232636165396331336162643633366466393963636565633661663964623436623639666135313637313665663530636532343930613938316530396162303139636132636234363831316235623631396431626431643565653666343661343263373737636264656536343261313438346563646635646464333732393634326333386336643433613838353838373434373566353832343434333636346330346466656439623839303435666230383565323563336566636234383431373333656666376335323963313339653639333530633263643739623263386431393637396137313265346538636166643332363735343162383332623365313061303132353564656636396466316539643362386438656166303331316465363764356531326232366464303164626264396433653432643335643964653237313330326530663166363964383763626337616361396538383637653964343238643363616230363636656234393064356662616233306266663366373835643033663230373261343362623962356535343635366135393263623631656166643561356566323834633763616563363666376634373332356363306434633164323766363631643861373438636135303731633036656631333464666639366634303836363838333636643436386132343738303031376530623536616261376661623433623362376330623737393036666165353438326633323831316332393265366231343435346531346238393438303161383661303363633437373934646430643734353237613732653432346564336166613034383939656362396136336632613961653732626537666139383961646630643635613332633835316439383031666334313034386466333335363466633762333137303765633866623830313430666537623761316661313230626131636236363033323463656666623462636332643962623764653063663534633831396632646433626365616465633963323566356531396463396231303230333031303030312806320218093a603365303261363732306334343636353965383633303564353562666565383230623335653635306665636163633535333039373435356532633465303332636339646564313662316262343464336235393262626163623663326266663165360ab70722cc063330383230316132333030643036303932613836343838366637306430313031303130353030303338323031386630303330383230313861303238323031383130303930323539663465336439663066333934323536353438653963373330386231306237333430336363393039346439376164313531623737303631373062393737326365623634643636326563656639303161386437643135643331396135396338623731303731616363643839356237633933363130646336393736663637633465313732396261383337336162376535326133663363386632363534393164646536396436653039393934373065373434353938313133316264393663333665363836353230336662326562643564353065616461666237323633393664656331643931373438393862346539626530346337346433303466656164643963626433323334633362376633333036633939636230633333396663323539363962343164353861326237636663313833326532323664383163313936333939336532323535613038376431363938633033643432313062643634353830363434643039356361373661613137393465646434306331633837623566383261386533396636303365393731313662613034353738653765383033343634393564373835643465663763663737313462396562366635663965306239613934663462373338383436313962393237346434613935656631353735346138396439376566356331613838623664363933653061383065626435333766633963663063613931643163363264393135646537656438313862393532653634633230303239336565386532383461343136613732613365313266633764343233623135386639623439363630636263323436366662656430666564326532346531303266646539343265623463666439346265633436643364393066633038633339666563626130336530636132343634616536363462393739353135626132396531663730326333666537303262653739333739366438656462313761613438633039323930623032343534396630363131663561653233656437653136343432646637643164616432323836633262623039643535323264643365643639386332663032303330313030303128093202180c3a606339373462623938326338313931336237333236643561336639646363343836313261313566376161643032663230376230663130636432303137613666626666353830336537636139626662343730396162323862366230396435623133660ab70722cc063330383230316132333030643036303932613836343838366637306430313031303130353030303338323031386630303330383230313861303238323031383130303962646438653834666164616133353332666334636530316138613137643463336232333266353061393739306532363236383465646334383233653831356131626435623230656365613762663536653239663662623762383331666233626636656663643134373566306238656435666662306231333835623936643136366236323966303339366138666566356630366534626361323565653461313334306565323633613464396262303230643866343732333036663364383836313338646537613031396530353962643061666339303263636261316132313361653264616136306338613031333735356665306134386530333466356234303233613264616465616138386335343836383335336163376137613364663132623266623634313837373465396231346265366561623863633237623838303132616436313632646137346530656562313631333539303566343337333734646162383538366437353061323662626433616332346165643837386334643533653635313037326338373165393464376163633537356339363733383137333461353366656166346437626136626364643234316363363435386336303837643836333032616132353163303466366435366239633332643764393636323437353065643035353738356430373733663433646330393962323863393232383131343865366338316632393766663964313636653030306163303462333132343138363737356663656637356635656261306331303332626631333064663663643761343632313164306466336530353834643932656136373334396438343930353038656234656638386635346338633364343836646538373139663130666139366665623835636337393630373663613738313331386565326439656439303363613133333630343063353961643931613464326636393865393130386165306564623962316362393561643333623139376666623138626431626138623536636265653261616539353835656365323038613165313462343835363436333032303330313030303128083202180b3a603937303834333033333130373866353638326337663332343464383263336233653238316139313837393537386465656163646363326132656265353431616631383831313561643265383338363565356635643234376234613138633165650ab50722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303039303938383635646566326632616233373663376630663733386331643837613237616330316166643030383632306333356362366562666362623063333330303331393361333838633334366433303233313732373031323139336262373666643330303462383634333132633638396566353231336362623930313130313530396465616239346632366137333265363337393239646134633463623332353137653361646262333831316435306163346337376331666365386236353136303632313566333437303766336537323635353435653538633839343630396532383337366264623737373566653330343339653065313539326664636230633365653163333035373733643037326136623839353765616663653161313162653936356564616666333834333336366362366134346563323561383930313036653632343735363766373662353530666461343832626165633633303764363938656338383834316664363666323366323130653437623861396463626136626134653166613731366462333363383065333038313934393664636235653536303966623665376336313533373962646465643432376539323331623932353463326261663934333630386138366436393861653961336338363339646638383764366636623561373133383564323433333864393131613231326266373166316532616363386231383662393665633865363963383662366430353832313737373661303963396336383935336564623539313635373862356132363362326634363965336230633037656164613731613434376565613766386663316262383037343235353536376237663062643165366166623033353837313863393862343239653234623232393835393666633736636636616633393663613934333464373932366563376433376434623932616635366434356665666638313936303935323234613931366331666665366236363765323535666333616338636363656639323064633034346232353030333133326238373830363734326630323033303130303031320218033a603333373339306438666561313434616663313265383132353461323864616336656138323839333833366163303732656666643835653061373734383538306566323830393636343863356137663864626234636538313437363831353133370ab70722cc063330383230316132333030643036303932613836343838366637306430313031303130353030303338323031386630303330383230313861303238323031383130306335376564623966663237366530323362323830323163623164383763646631393636623639386366343865346561616137633639323037376365656538636362323339613463393231353937653865383966376363303564336633313331353738393736633465333134343035643461346530336137323431306335633039636135323761643561383562393938363337653732613332653166626330643535343662323436356539653830366332646435303965623035306162356662323730363366643932383135623164643236383965323131316361656236663534396539346139663030663038323164346361366336613631313766356135333363393236336266303734613330643563626566353064316338633233383762636139373265646564613039383362356430613662353764636230303230303036383238623430653430373662343837306232346261643834303536656535326235663432326538383430303238633235303036333832643865396336363132323566346637366561373265333430363037653966633666336332303433333037366131636138636231356564303361633839363664303530376263646536383165346530323331656539663837643131316537623438616338663934643264383432623532646637336635373363633534313439363437393763363236393638666661653734313866336236313039623561306630396533323233663461346435653335303964643235303133386636626331376266366365636531373539343433306466313830613338653930616466326166666266616430633662386331623837663137386130363164636662666638623932633931363664383734633166663561663466626364626665386539643039393337306464663630626537343736333364333665653465623563643531663665336333333965313531653431626462356135636532633863393761306134336233636434636330383138383463383739663964326633373438343238633835373366313763393066336362643032303330313030303128073202180a3a603734306166366266373339653838336338386633333434633961306638623330316533396463393831633531363365306465326133666634326239396534323665643765353662363766343231383530333834356466363266343963396662300ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030393133316161333638663933343532323966393762363235396363636166666561323365303063643565616430326533663639366331653731346565333933396461643836306533386266393561323937346639656234386539333433663861616334303565613935356430353332336531313762336231633934383133613361663432666538303832633364343362616631626434643833363765393364623030616436393665363237613130333661653533346630313165616435653536663337613666666534346236623965303939343031313932616435363061303334366234316138313030393566356632643766643332643665656236353562613735386336623532366331323933383661663731393763376135336165363033643632323833323235343936316631366430656661383037396137363835363138383862653733333439323231373935366262636166616562623631333563356662623234383464356234613566646630333336616330326532366331363532633162643865616633306461653164366433656230306637623466616238643634373866653864393565623931316466393636613064656134653532326462373662383936363537306563633561663039353136343234663061663566386565363665333836643536353037313339393731363961633337353733626635326664303538646539356162326666363865363831313161623233343035656139363462326262383864303263306631636165643731656364643465346534303835393438373666646238353030626335356337626130323036366530356162393864396637653034363664393730326562353765653337323266386663633835613735353035666633323632313730323838623738383732336164623937653464653536323063633930656164313338326663643735373138383966656662313165363737316263336636663366656231396337616335343238373864303361393032373035323663336565643234393465666635346531353363613966363839303230333031303030312801320218043a603765616236393661623935343336363538626331346666366234626534643932356364353162323230646632613164356336656531363061646166323961353165363934646533656531383463653232656164386437646239333231383266330ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303038326465373330363566333466666332393334306435393439643232323062316534333636656435636637633665626436313663663934313661353365613030313766366262313136626664336633646566636331356237613464646630653434643032666536393536383830353365373961373730653230316263663731393333393030333965653866303836643466613734366337653035363931383330316639623565383465333932363238323830383561373962333232626361306235643835666539373232316132366262646532353863363230663064636561303261623165646431366363343961336632616239323838653364643166333764633462366136663731333366663932653534316337316237306432613266363664353537323561623138626638366430303965633364323466356431326530623565363830326431313531333732643462373634656265636234616638326636343934383565633537623561303164633637393538663561303363636161623763626139333534613137333732633133313662613437633935336161663934393031623366386332346536613361666436373538653766336231343363653264643363623037316232613734633932316365653934396134623561366265383739663163373930613662386436336231393264376565323961393439316664643638396139386330613763336436303332306631623461633264363232396466643934653432663361363034386137366265316562393538633861313837336265386433333861656339666335396162376633373632363738393430326331666435393566313930383735373565306265383237666334633061346662336433393361643734613934396363393836626662363463616264646165353339333566366463353630373464623933643737656133623831366264643662653533343439373237323238393835396666333463653531383630616666623632316431303438376463333834336631663836643534303334613633653438613161306430323033303130303031280a3202180d3a606132656363316232616539386264323862633161303864386633373161306434663734356337363864306337373339363235363265333433623235643833343235656565613765663865613134323935333432623865623738643332656333660ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303039383735356134303862353332316532363330353230303064366437643461326333613535346435653133383461396362356562663437346165383832633633623438366264303864313434646466316139346365396137643632353139363330303661666461616334353838343666313736343031393566653235333961363536393330656661383534663231343865363865633161303863316334396432303063336633303435666537313437663036643533346334626432363231303063623164643339373339643736306438316130626432306638336632353564323530376434636362313130366235333631386336613934343039633838376361653236326434636565396338363233323134376365633134303465306335376262613733313731333065653339363433383838616633643539386564643832623863363165363561653831613465316135366263303664333937313433613938643431636138376433656634333365663061656162363830313139316233653338343830393638663636623665383836363261663435613965323132393934663638623238386562393637626562393834373863323433653231333663316131353931663036316635626330346232316666326261343862323966313834333130383838373362646665393966386135326539343038393731383536653830346465613630326133313137383663393835363532393633633361333737303332396234303966373466646663373436623232613566383431383931323037316334636538343663396234623332306665646636653962363465326362653338346639613832623661616164346232303930373433316466316133336636393230376135363536303062653831303730643038333239303039393538353961343439386435623539333135626365626566656538303765623061336139343266316364663333363764643434343466646232393838366566636464306265346162653961313838383033393533383735656461333364623732393839663736336230323033303130303031280b3202180e3a603139366237623132303739376364623361396430303362393833643537646131303331303662313733306531376636376532633762616161646234333738396166313639366461313031316232353362636263383630333333383566303332380ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303061396462376638626161313236383938666162373839313135613362356438393734346631393765323830343161653039386633653838366336393837313732316531316262306164313166336365393132346161393631643661306463383435663439373635633366616231393935383430323637366635363434363262663238316462613535383837383066303365393035373938653138343236396161613630663761313437323333316532666231646561646438373763383463626362363431636139653563386164366534356263313539636230373966636230643434396364636438643932333963316130343765376234343864613063646361323636313061323566323936643936653734363962363736643461343434353136653761353965383532393361383038366638343063303532383534653032613863623230303264616433353832356265346438336235326661393165386337336666303439373436313438383632373837633131313866393234643331636261633162343466656666323264343336623339373965616466396234336134626661373265313562343735356663616232363065303661323739633362623733626337663136613036306434643532326664343930353830333838616135393564383034343733366535323266363432343931356637383033623735383365303935636466373863333235313936393764653831623839666235303035343735336231613137663961616662303634643834633939326639616231316363626338636231303831346463616635323634616134356632316264656661633832636361636161663335386533313337336565316261346537343032666438613730656130633238636135636337346463343235313063393639636432633435396231656333363838613031656133396139393237313063643232393763393861383462363334386135373738303466646332333464336665313930336532633231653137326461323862353961653665346337653865646438623731633439643730323033303130303031280c3202180f3a603538343661353366343437353239666439636462373830346364333136383865643665656265336236336461326635663231316666626337333731393763663366316366626664613631626537643135313066306539323339383131376637340ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303061386365616333363765623166316465356630643965663365616630646639623938343438666532303830383437363536326130363063353163323839373730623463616366653932636236353536393832336539363263326132633966656435336264333663613361313232646531633532356135383266323561346437643632386331613364356264623839333661656365373531306537353534656537303333303235633039326338323865656235373338626530326564393633646138316135393230353633346365393435343537376162383266343066313366316565353565306165373237653233633330323834623166343462393961636534646463356639616337616438386439666132323535393335623234646362613834303036343265313663663235333263306230643638393239303436303837313563343037366634366438346130653066656433366537366363646339363335356537613236313630393435633262353461653236636330306664303832333236333436656565656137646437356639313931316539396462636239396561346163366261303536633333323238643838316438353833316439636338373935393364613137343664643065653935646332623936666539336261666366663263643764393239353864373864663333663230356437313135656439666163346462366634636336306535366135343431646135623562353566613539393939303265393538613662366334346438313064646335363138313234316238376632326630353961363838306538303231373336643031383937646236353434396365383137613233373564303335353163623064653530376336303961306338303330656366346266646562323133633033646161373634613138323162373234333334663731663736386437616563623237373035326137303333373635663037323138303536633738663261383761663138333836643866363161356366636233663262613464643539393135663133643338363334643136393537353730323033303130303031280d320218103a603030306162636435396133306135333838633530306265363832663663613239343034363239356339323735383831633230643334626230643639306564613762333862366262643037613364643166646662366137303434626230396366660ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303061663062393134323537626637613436353563346135306430636164356530613165343538316564363632336630653837333066373936623866323963353831373862636363363933326331666333316633396566343462383264336334336233393837333733373366656362313239353232386130346664353061313466333634366438346665316634363763616562393864343633653239373565393935623864326531653339663362663661646463323561653335643635643032363038653033343535333739363665326162636534396238313462656164336331623735373137346165333063303062306334336539396238303439366237326433633133316631633665346663646130356632383131376566396532386334333033626534643863376530343264353862383363633132313934356132633635653739363263616139313835393338663337353764663763636139356366303262356533313934346133613631396130616333663165333462396230313364346332323463346631653730666439666433363938336566383661646535313833363263633833323263306637623631613961633735666238326537623836643638626330663039396130396131346361633561316438643338663961386137306363333766663563633362626432373432666664313436323535633137316536613137383038333237316463653066646536383165643439326362353962303739366432373031373538333864633539303831303765336136656133663961343036623364313133306363656333623437393165343962626332333136303362343661623264306639336434336265373561623961346437313065613934306532383561376231353362306361376364646565366439646365306164383335306334316439306332313562393538383531356166613061633333363561653037653831663362626233366264626561633462333162636231616134653832353635623937376639646164383564363236656566396161613965663864376533666230323033303130303031280e320218113a603933653238313031303462326231376230303935326235613431303264333365646230343363623136646533616433643364363832363066353562623065353837333765613539343463333338663763386362383863373833336663383630630ab70722cc0633303832303161323330306430363039326138363438383666373064303130313031303530303033383230313866303033303832303138613032383230313831303038633037626533303561643630623930626132646162333962306565373736306531613232663835373532323534306437306230336233663965343837356133613239616230383038386631343466353765623235326534366261353933383564306536643432373031313764613061626331623362383036393463396135303538623836643631646661303665373136373039633838653866656163376333613065316432356663306165626636613866373666636239396638343566653138313436316361623638353862393763336134303237666233373132623134653663303738396465313764343137363435373765353131343137656231363236393265623037616531653733353532333565396262343339303437623663303136313337383265376464366636303464616134363734363631643533393631663436633366616136623765373637363264333733623562353432623739656139363365666266333361633638313938626232623636316366663637363931366566333732616434633236633231366334626334373837633834656333326431383464373763373531383663303963663364396639313433336361393835333131396261623331666136616432366634353365353936643962646563613638613537363962633866656537613533356438306338633666336566623164666232383861623661393739383534623763653833313234656330643130326166663934633362373466396333373839353863323565623933336464353363316538303561313836353464366439313836393930663635373034323966393630663334653862346637666439393732646362666539323430653037346461326433353561356637656639633161663632656635393832613831373435373862396331356334396563353636626461636233306363666365663039636466653730386164343837343234653963316265363533663965653736363065376439343263316566613564613238366531616464616230366139613333663964653934363739356230323033303130303031280f320218123a603934383235313739643163333934303137306233356432363665346366613830643737386335653966356261653764653833666638636334373431663362653336616336336431653761653439373261656466366263316533636632303638390ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030626531376339393634376365633635613434343037623533353835366233633362616566356235346635363561663538623834353662613863376365353335643561633732633631633434633736623363353763386538363438343136333762653130613833636665333963303932343736643064626534643663646364636437323061333062356266656235316130316131386635383263343566366338363939336663663764663138323933356465316438363930363034346463663335313836393335643962643765656137393532333532626562623465663961653066373636316537306134323337616661393839393636383763613438666366633562303064333830376630353462653066613863336266613432353033386265366566323935313634663232663733623765383863393465613962653861613466336132343563383962396431666435313932663761353062393538623265663831303462333666316266386664326366623238633134323138303063316334376534656639386166313530303730636336643639643137653865623932663138613661613161363532363661343935323338643130336638663639356235376563663337333635306130353230303837343537323162656138313536323739363763383037363336356466386334633761376434646438663263333835306331386662613731656236306536653864666264313936653035333766643730623334346563626363353330646663383364613666656466343964353161393034313935303262613964373063643335663163663363303639346532333534663930363466646266353335656232336332376330613433643062373863316638363763363164393836393564386465663762633261313062623636373463323266363661616230613931383133646466323763646238353263353965663739653162396531613037356661366565323761376533373734646266346232363436353432376536643561623931666537663066336137313738346563613138326235303230333031303030312810320218133a603038393039376465663031623037633764393734613537353532353161366161613061666236623332613534353334336432393138653732626164303433323163313131633234643432373538306633626131653236616139643735653632360ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030613561643262373634336130346330353564326638636432353131623135313339666334353537353632313338386534396331313962326633393861636131313066363133393662306338363664653530363335323262623835343032373365313366366439346365316536303433386636616662303061616136343631326637313435653962636538626331613533623934313931336161373663396633613238333366616437636632383563376163326433376639396633633263646234396465346431353165363136373835363466323831663534313432346234316661376335316232613936303232383363376433326565303065623833386461313563333861666339366530363164393763656465323231363566663161613935396631633432373562326430393863343035383661353537396662623363623930303732373034313230613861363661353237306634666366643130383663393233363930613335653766643434356533336163303366313339633638363835353635373063646334616166323231303761366331613434323435366137633663373965653034303930653765356434663636626361363063613166343762366466623534336461633363626631396137373139613866353562366638336234613362386136366436303235366430613436353531666137303234626430353633316238613535383038373732353463326632663236386364633333643264626263666237333365396662653233336262396362353961623331613031343862323365386334323638306666313061663463373961346430383334366662373961393364393632393534386561663162623132343639386661656661346364643732343432633033613034623733333433326637343839303361333235633238336434353661623961653932316165376564333339316535643137383765666463323335343061376238356336393161653837306130376639306231316331336233326365343365616564313562333639363835636534393137376363393835303230333031303030312811320218143a603939666162633461646534653636326336653238323366346139366562323134343034383465356136643064333132623730633036386432326236323936333830376332333361343964626239383361376562623330653737303637373261340ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030386434356332316330633935656636356130323964353263393537666430663835663230313233646130333465363136373164646565353437356630373338326136366336366362346463353035303464646664333735383130383364663864313735373733306564386436663336346466346333366132363531353931393535646132303161323430376661386162396232333133383131323235613064613233306662653338306530393061613536656661346632303265633962343832336636353031643936616336393865626632366161636633656532643166333261373231633934376531303736636633356233373364613164383761333661313532653030653731303131373932323832653832356666313731633538333362383835373062666336646138343439653666393566386231323635616235353531393430333135353364316435373666393363343263306361363061616261633463386464313632643831313466326232313531313538336337323533396665353663343939613932396465336134306130643435633137633538396332643739383863653236656166633932613364333762376561303034326434336530336166613632373162323632353561366363636661653533373138323164383165306230356332353062353966306139303734316130653065383861303965643536633562393738306430393566303930366630623831643531323633393832616165303131333663303732643834346131316436646134623261363163363434653161623137663136666634386565323366656465383435326631653432653264333061303739306332356434323036306531643434613637316132656232336431313466363863373165333366313736646235386136386234333030353462633164323938336132336133326561366666393566613763346438653338306562323936653938623739363865636638343534643831376337333765656135646439323165623836633136633762323933303461346137656362653561336131303230333031303030312812320218153a606537396165396337313933643164326263393433383436346338616135663632323461653835323936366134336239383235383833663766373432633533393562643330393935383761393638363662393233396431656666336165353037610ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030623035616265326162303066646430366339353565383637313062306530366631613932363234613438616431636263386466633666323231323936326230633330666462643238346133376335613337363538623633633336656138313632353631613865346639343663626535373232633032383830316630663238316337306638643838633763303061326632653239663539376237393938363965643833353664663537633437626539393434613261616666363530663962346262613064626335336463383830666462623639656134353139303564323830323230326638653239633034613736643237616632656237633534383438356266336634363934633930633431383130383838383433373932383438383335663738313637303764336538643736663465363766353738306263663038383133633535656336333961396264363234313738663565623134376435303061663335316539656631623165333432343834636132363064623763636261653438366631336366323635623562316162363838303636303038303533623230633364656463653737316339613038613033323061613963653435316562396439383361376234396361613130393666386164633039383331386463333865306537636566306438653564353537613036373536383561316339653235366132626339646261333232623362623331373263663731343037376263333830663861306134333361386266613766626663353966366230393365633862663665393339376330396231386531383034306331623536363836343733376338666137653239373935663361343538386464613763326261623439353636356363346139623833366532656239306336326133666361663539316662356638313830346337363138306536323666613236343461376465333435313164366334363637643938393337653237373333663464316539313338383333353465353466643733353137323165373666376235366333343833333838663461366238376232386165626562303230333031303030312813320218163a603962343038383566313362366163316337353336393262613366313739303061333838333165363934613061663937343934623834333838323039636235656662646339386136646162623265316337313833393166633133356264616163330ab70722cc06333038323031613233303064303630393261383634383836663730643031303130313035303030333832303138663030333038323031386130323832303138313030396463643863306135336539306333353539353734663636323034313137643362353033653530613336643330393766616338343239653663656364333762623534303731383038663265653938323033356638353161306339626532313736333833613232653338633161626131363866333266393035373063623332333363666536323539383736363661663637623531346361656632316662386466366430666364333363663236303662393264646561353533366236303638643836373832653339626435633338343435393931643431396237643165633038353939343132633039343964316332343062333563313464633535323734646261373166666165393336313235613566383139663534313332653234333964346163353539373939366563653835653133646666333336316639313331663536636561633562396635353262343963663666396139616336653564636532646233363934363266393361663830653562353662366538626566613136326130363162346137363839326264633834363437333036633630303835386664643237303332373663326337303434303139386566643766653335343563663261623538306337346366643634343561616637626437663734356363323532656162643236356561626565383632343137313034653639343861353537353666646332323264663061313031353234646531633363303863636630343330313165633766653936346564643834353161313330313437633037333633613335663131666465656638663261326237363137353762343335386666383962373561343864363762646336303930363933653062623836373965636262393366666462336633656439366265633933656634363536653337313661623837636534366361386531323539633866656464653866326631656130663365623263343865393635353164653132333330333435373235663435656436396338353735623531363833616661343732363231383236646232326262326431633466316533363436346139303230333031303030312814320218173a60346630613033333466393737363738313632663830643936376637323139313431333630633062376637663033316233376336396536323137333933336564616434366263626139373636376565373262666435613933346261313532326330"))),s$1={"https://grpc-web.myhbarwallet.com:443":new f(3),"https://node00.swirldslabs.com:443":new f(3),"https://node01-00-grpc.swirlds.com:443":new f(4),"https://node02.swirldslabs.com:443":new f(5),"https://node03.swirldslabs.com:443":new f(6),"https://node04.swirldslabs.com:443":new f(7),"https://node05.swirldslabs.com:443":new f(8),"https://node06.swirldslabs.com:443":new f(9),"https://node07.swirldslabs.com:443":new f(10),"https://node09.swirldslabs.com:443":new f(12),"https://node10.swirldslabs.com:443":new f(13),"https://node11.swirldslabs.com:443":new f(14),"https://node12.swirldslabs.com:443":new f(15),"https://node14.swirldslabs.com:443":new f(17),"https://node15.swirldslabs.com:443":new f(18),"https://node16.swirldslabs.com:443":new f(19),"https://node17.swirldslabs.com:443":new f(20),"https://node18.swirldslabs.com:443":new f(21),"https://node19.swirldslabs.com:443":new f(22),"https://node20.swirldslabs.com:443":new f(23),"https://node21.swirldslabs.com:443":new f(24),"https://node22.swirldslabs.com:443":new f(25),"https://node24.swirldslabs.com:443":new f(27),"https://node25.swirldslabs.com:443":new f(28),"https://node26.swirldslabs.com:443":new f(29),"https://node27.swirldslabs.com:443":new f(30),"https://node28.swirldslabs.com:443":new f(31),"https://node29.swirldslabs.com:443":new f(32),"https://node30.swirldslabs.com:443":new f(33),"https://node31.swirldslabs.com:443":new f(34)},t$4={"https://testnet-node00-00-grpc.hedera.com:443":new f(3),"https://testnet-node01-00-grpc.hedera.com:443":new f(4),"https://testnet-node02-00-grpc.hedera.com:443":new f(5),"https://testnet-node03-00-grpc.hedera.com:443":new f(6),"https://testnet-node04-00-grpc.hedera.com:443":new f(7),"https://testnet-node05-00-grpc.hedera.com:443":new f(8),"https://testnet-node06-00-grpc.hedera.com:443":new f(9)},n$2={"https://previewnet-node00-00-grpc.hedera.com:443":new f(3),"https://previewnet-node01-00-grpc.hedera.com:443":new f(4),"https://previewnet-node02-00-grpc.hedera.com:443":new f(5),"https://previewnet-node03-00-grpc.hedera.com:443":new f(6),"https://previewnet-node04-00-grpc.hedera.com:443":new f(7),"https://previewnet-node05-00-grpc.hedera.com:443":new f(8),"https://previewnet-node06-00-grpc.hedera.com:443":new f(9)};new f(3),new f(3);const o$1={...s$1,...t$4,...n$2},t$3=/^(\S+):(\d+)$/;let r$2=class e{constructor(e={}){if(null!=e.address){const t=t$3.exec(e.address);if(null==t)throw new Error(`failed to parse address: ${e.address}`);this._address=t[1],this._port=null!=t[2]?parseInt(t[2]):null}else{if(null==e.host||null==e.port)throw new Error(`failed to create a managed node address: ${JSON.stringify(e)}`);this._address=e.host,this._port=e.port}Object.freeze(this)}static fromString(t){return new e({address:t})}toInsecure(){let t=50212===this.port?50211:this.port;return new e({host:this.address,port:t})}toSecure(){let t=50211===this.port?50212:this.port;return new e({host:this.address,port:t})}get address(){return this._address}get port(){return this._port}isTransportSecurity(){return 50212==this._port||443==this._port}toString(){return null==this.port?this.address:`${this.address}:${this.port}`}},t$2=class{constructor(e={}){if(null!=e.newNode)this._address="string"==typeof e.newNode.address?r$2.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=36e5,this._currentBackoff=this._minBackoff;else{if(null==e.cloneNode)throw new Error(`failed to create ManagedNode: ${JSON.stringify(e)}`);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}}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(),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(2*this._currentBackoff,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 0!=t?t:(t=this._currentBackoff-e._currentBackoff,0!=t?t:(t=this._badGrpcStatusCount-e._badGrpcStatusCount,0!=t?t:(t=this._useCount-e._useCount,0!=t?t:this._lastUsed-e._lastUsed)))}close(){null!=this._channel&&this._channel.close(),this._channel=null}};class d extends t$2{constructor(e={}){if(super(e),null!=e.newNode)this._accountId=e.newNode.accountId,this._nodeAddress=null;else{if(null==e.cloneNode)throw new Error(`failed to create node: ${JSON.stringify(e)}`);this._accountId=e.cloneNode.node._accountId,this._nodeAddress=e.cloneNode.node._nodeAddress}}getKey(){return this._accountId.toString()}toInsecure(){return new d({cloneNode:{node:this,address:this._address.toInsecure()}})}toSecure(){return new d({cloneNode:{node:this,address:this._address.toSecure()}})}get accountId(){return this._accountId}get nodeAddress(){return this._nodeAddress}setNodeAddress(e){return this._nodeAddress=e,this}}class o{constructor(e){this._network=new Map,this._nodes=[],this._healthyNodes=[],this._createNetworkChannel=e,this._ledgerId=null,this._minBackoff=8e3,this._maxBackoff=36e5,this._maxNodeAttempts=-1,this._nodeMinReadmitPeriod=this._minBackoff,this._nodeMaxReadmitPeriod=this._maxBackoff,this._earliestReadmitTime=Date.now()+this._nodeMinReadmitPeriod}setNetworkName(e){return console.warn("Deprecated: Use `setLedgerId` instead"),this.setLedgerId(e)}get networkName(){return console.warn("Deprecated: Use `ledgerId` instead"),null!=this.ledgerId?this.ledgerId.toString():null}setLedgerId(e){return this._ledgerId="string"==typeof e?r$3.fromString(e):e,this}get ledgerId(){return null!=this._ledgerId?this._ledgerId:null}_createNodeFromNetworkEntry(e){throw new Error("not implemented")}_getNodesToRemove(e){throw new Error("not implemented")}_removeDeadNodes(){if(this._maxNodeAttempts>0)for(let e=this._nodes.length-1;e>=0;e--)this._nodes[e]._badGrpcStatusCount<this._maxNodeAttempts||this._closeNode(e)}_readmitNodes(){const e=Date.now();if(this._earliestReadmitTime<=e){let t=Number.MAX_SAFE_INTEGER,n=!0;e:for(let o=0;o<this._nodes.length;o++){for(let r=0;r<this._healthyNodes.length;r++)if(n&&this._nodes[o]._readmitTime>e&&(t=Math.min(this._nodes[o]._readmitTime,t)),this._nodes[o]==this._healthyNodes[r])continue e;n=!1,this._nodes[o]._readmitTime<=e&&this._healthyNodes.push(this._nodes[o])}this._earliestReadmitTime=Math.min(Math.max(t,this._nodeMinReadmitPeriod),this._nodeMaxReadmitPeriod)}}_getNumberOfMostHealthyNodes(e){this._removeDeadNodes(),this._readmitNodes();const t=[];let n=this._healthyNodes.slice();e=Math.min(e,n.length);for(let o=0;o<e;o++){const e=n[Math.floor(Math.random()*n.length)];if(!e)break;t.push(e),n=n.filter((t=>t.getKey()!==e.getKey()))}return t}_closeNode(e){const t=this._nodes[e];t.close(),this._removeNodeFromNetwork(t),this._nodes.splice(e,1)}_removeNodeFromNetwork(e){const t=this._network.get(e.getKey());for(let n=0;n<t.length;n++)if(t[n]===e){t.splice(n,1);break}0===t.length&&this._network.delete(e.getKey())}_setNetwork(e){const t=[],n=new Set,o=new Set,r=[],i=new Map;for(const a of this._getNodesToRemove(e))this._closeNode(a);for(const a of this._nodes)t.push(a),n.add(a.getKey()),o.add(a.address.toString());for(const[a,s]of e)n.has(s.toString())&&o.has(a)||t.push(this._createNodeFromNetworkEntry([a,s]));j(t);for(const a of t){if(!a.isHealthy())continue;r.push(a);const e=i.has(a.getKey())?i.get(a.getKey()):[];e.push(a),i.set(a.getKey(),e)}return this._nodes=t,this._healthyNodes=r,this._network=i,this._ledgerId=null,this}get maxNodeAttempts(){return this._maxNodeAttempts}setMaxNodeAttempts(e){return this._maxNodeAttempts=e,this}get minBackoff(){return this._minBackoff}setMinBackoff(e){this._minBackoff=e;for(const t of this._nodes)t.setMinBackoff(e);return this}get maxBackoff(){return this._maxBackoff}setMaxBackoff(e){this._maxBackoff=e;for(const t of this._nodes)t.setMaxBackoff(e);return this}get nodeMinReadmitPeriod(){return this._nodeMinReadmitPeriod}setNodeMinReadmitPeriod(e){return this._nodeMinReadmitPeriod=e,this._earliestReadmitTime=Date.now()+this._nodeMinReadmitPeriod,this}get nodeMaxReadmitPeriod(){return this._nodeMaxReadmitPeriod}setNodeMaxReadmitPeriod(e){return this._nodeMaxReadmitPeriod=e,this}getNode(e){if(this._readmitNodes(),null!=e&&null!=e){const t=this._network.get(e.toString());if(t)return t[Math.floor(Math.random()*t.length)];{const e=Array.from(this._network.keys()),t=e[Math.floor(Math.random()*e.length)],n=this._network.get(t);return n[Math.floor(Math.random()*n.length)]}}if(0==this._healthyNodes.length)throw new Error("failed to find a healthy working node");return this._healthyNodes[Math.floor(Math.random()*this._healthyNodes.length)]}increaseBackoff(e){e.increaseBackoff();for(let t=0;t<this._healthyNodes.length;t++)this._healthyNodes[t]==e&&this._healthyNodes.splice(t,1)}decreaseBackoff(e){e.decreaseBackoff()}close(){for(const e of this._nodes)e.close();this._network.clear(),this._nodes=[]}}let i$3=class extends o{constructor(e){super(e),this._maxNodesPerTransaction=-1,this._addressBook=null,this._transportSecurity=!1}setNetwork(e){this._setNetwork(new Map(Object.entries(e).map((([e,t])=>[e,"string"==typeof t?f.fromString(t):t]))))}setNetworkFromAddressBook(e){const t={},n=this.isTransportSecurity()?50212:50211;for(const o of e.nodeAddresses)for(const e of o.addresses)e.port===n&&null!=o.accountId&&(t[e.toString()]=o.accountId);return this.setNetwork(t),this}get network(){var e={};for(const t of this._nodes)e[t.address.toString()]=t.accountId;return e}setNetworkName(e){switch(super.setLedgerId(e),e){case"mainnet":this._addressBook=b$1;break;case"testnet":this._addressBook=o$2;break;case"previewnet":this._addressBook=d$1}if(null!=this._addressBook)for(const t of this._nodes)for(const e of this._addressBook.nodeAddresses)null!=e.accountId&&e.accountId.toString()===t.accountId.toString()&&t.setNodeAddress(e);return this}get networkName(){return null!=this._ledgerId?this._ledgerId.toString():null}_createNodeFromNetworkEntry(e){const t="string"==typeof e[1]?f.fromString(e[1]):e[1];return new d({newNode:{address:e[0],accountId:t,channelInitFunction:this._createNetworkChannel}}).setMinBackoff(this._minBackoff)}_getNodesToRemove(e){const t=[];for(let n=this._nodes.length-1;n>=0;n--){const o=this._nodes[n],r=e.get(o.address.toString());null!=r&&r.toString()===o.accountId.toString()||t.push(n)}return t}_checkNetworkContainsEntry(e){for(const t of this._nodes)if(t.address.toString()===e[0])return!0;return!1}get maxNodesPerTransaction(){return this._maxNodesPerTransaction}setMaxNodesPerTransaction(e){return this._maxNodesPerTransaction=e,this}get maxNodeAttempts(){return this._maxNodeAttempts}setMaxNodeAttempts(e){return this._maxNodeAttempts=e,this}isTransportSecurity(){return this._transportSecurity}setTransportSecurity(e){if(this._transportSecurity==e)return this;this._network.clear();for(let t=0;t<this._nodes.length;t++){let n=this._nodes[t];n.close(),n=e?n.toSecure().setCert(null!=this._ledgerId?this._ledgerId.toString():""):n.toInsecure(),this._nodes[t]=n;const o=null!=this._network.get(n.getKey())?this._network.get(n.getKey()):[];o.push(n),this._network.set(n.getKey(),o)}return this._healthyNodes=[...this._nodes],this._transportSecurity=e,this}getNumberOfNodesForTransaction(){return this._maxNodesPerTransaction>0?this._maxNodesPerTransaction:this._nodes.length<=9?this._nodes.length:Math.floor((this._nodes.length+3-1)/3)}getNodeAccountIdsForExecute(){return this._getNumberOfMostHealthyNodes(this.getNumberOfNodesForTransaction()).map((e=>e.accountId))}},t$1=class extends t$2{constructor(e={}){super(e)}getKey(){return this._address.toString()}},r$1=class extends o{constructor(e){super(e)}setNetwork(e){this._setNetwork(new Map(e.map((e=>[e,e]))))}get network(){var e=[];for(const t of this._nodes)e.push(t.address.toString());return e}_createNodeFromNetworkEntry(e){return new t$1({newNode:{address:e[1],channelInitFunction:this._createNetworkChannel}}).setMinBackoff(this._minBackoff)}_getNodesToRemove(e){const t=[],n=Object.values(e);for(let o=this._nodes.length-1;o>=0;o--){const e=this._nodes[o];n.includes(e.address.toString())||t.push(o)}return t}getNextMirrorNode(){if(null==this._createNetworkChannel)throw new Error("mirror network not supported on browser");return this._getNumberOfMostHealthyNodes(1)[0]}};class m{constructor(e){this._mirrorNetwork=new r$1(this._createMirrorNetworkChannel()),this._network=new i$3(this._createNetworkChannel()),this._operator=null,this._defaultMaxTransactionFee=null,this._defaultMaxQueryPayment=new e$7(1),null!=e&&null!=e.operator&&this.setOperator(e.operator.accountId,e.operator.privateKey),this._maxAttempts=null,this._signOnDemand=!1,this._autoValidateChecksums=!1,this._minBackoff=250,this._maxBackoff=8e3,this._defaultRegenerateTransactionId=!0,this._requestTimeout=null,this._isUpdatingNetwork=!1,this._networkUpdatePeriod=864e5,this._isShutdown=!1,null!=e&&!1!==e.scheduleNetworkUpdate&&this._scheduleNetworkUpdate(),this._timer,this._logger=null}setNetworkName(e){return console.warn("Deprecated: Use `setLedgerId` instead"),this.setLedgerId(e)}get networkName(){return console.warn("Deprecated: Use `ledgerId` instead"),null!=this.ledgerId?this.ledgerId.toString():null}setLedgerId(e){return this._network.setLedgerId("string"==typeof e?r$3.fromString(e):e),this}get ledgerId(){return null!=this._network._ledgerId?this._network.ledgerId:null}setNetwork(e){throw new Error("not implemented")}setNetworkFromAddressBook(e){return this._network.setNetworkFromAddressBook(e),this}get network(){return this._network.network}setMirrorNetwork(e){throw new Error("not implemented")}get mirrorNetwork(){return this._mirrorNetwork.network}get signOnDemand(){return this._signOnDemand}setSignOnDemand(e){this._signOnDemand=e}isTransportSecurity(){return this._network.isTransportSecurity()}setTransportSecurity(e){return this._network.setTransportSecurity(e),this}setOperator(e,t){const n="string"==typeof t?y$2.fromStringDer(t):t;return this.setOperatorWith(e,n.publicKey,(e=>Promise.resolve(n.sign(e))))}getOperator(){return this._operator}setOperatorWith(e,t,n){const o=e instanceof f?e:f.fromString(e);return null!=this._network._ledgerId&&o.validateChecksum(this),this._operator={transactionSigner:n,accountId:o,publicKey:t instanceof i$7?t:i$7.fromString(t)},this}setAutoValidateChecksums(e){return this._autoValidateChecksums=e,this}isAutoValidateChecksumsEnabled(){return this._autoValidateChecksums}get operatorAccountId(){return null!=this._operator?this._operator.accountId:null}get operatorPublicKey(){return null!=this._operator?this._operator.publicKey:null}get defaultMaxTransactionFee(){return this._defaultMaxTransactionFee}get maxTransactionFee(){return this.defaultMaxTransactionFee}setDefaultMaxTransactionFee(e){if(e.toTinybars().toInt()<0)throw new Error("defaultMaxTransactionFee must be non-negative");return this._defaultMaxTransactionFee=e,this}setMaxTransactionFee(e){return this.setDefaultMaxTransactionFee(e)}get defaultRegenerateTransactionId(){return this._defaultRegenerateTransactionId}setDefaultRegenerateTransactionId(e){return this._defaultRegenerateTransactionId=e,this}get defaultMaxQueryPayment(){return this._defaultMaxQueryPayment}get maxQueryPayment(){return this.defaultMaxQueryPayment}setDefaultMaxQueryPayment(e){if(d$7(e.toTinybars())<0)throw new Error("defaultMaxQueryPayment must be non-negative");return this._defaultMaxQueryPayment=e,this}setMaxQueryPayment(e){return this.setDefaultMaxQueryPayment(e)}get maxAttempts(){return null!=this._maxAttempts?this._maxAttempts:10}setMaxAttempts(e){return this._maxAttempts=e,this}get maxNodeAttempts(){return this._network.maxNodeAttempts}setMaxNodeAttempts(e){return this._network.setMaxNodeAttempts(e),this}get nodeWaitTime(){return this._network.minBackoff}setNodeWaitTime(e){return this._network.setMinBackoff(e),this}get maxNodesPerTransaction(){return this._network.maxNodesPerTransaction}setMaxNodesPerTransaction(e){return this._network.setMaxNodesPerTransaction(e),this}setMinBackoff(e){if(null==e)throw new Error("minBackoff cannot be null.");if(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(null==e)throw new Error("maxBackoff cannot be null.");if(e<this._minBackoff)throw new Error("maxBackoff cannot be smaller than minBackoff.");return this._maxBackoff=e,this}get maxBackoff(){return this._maxBackoff}setNodeMinBackoff(e){return this._network.setMinBackoff(e),this}get nodeMinBackoff(){return this._network.minBackoff}setNodeMaxBackoff(e){return this._network.setMaxBackoff(e),this}get nodeMaxBackoff(){return this._network.maxBackoff}setNodeMinReadmitPeriod(e){return this._network.setNodeMinReadmitPeriod(e),this}get nodeMinReadmitPeriod(){return this._network.nodeMinReadmitPeriod}setNodeMaxReadmitPeriod(e){return this._network.setNodeMaxReadmitPeriod(e),this}get nodeMaxReadmitPeriod(){return this._network.nodeMaxReadmitPeriod}setRequestTimeout(e){return this._requestTimeout=e,this}get requestTimeout(){return this._requestTimeout}get networkUpdatePeriod(){return this._networkUpdatePeriod}setNetworkUpdatePeriod(e){return clearTimeout(this._timer),this._networkUpdatePeriod=e,this._scheduleNetworkUpdate(),this}setLogger(e){return this._logger=e,this}get logger(){return this._logger}async ping(t){await new e({accountId:t}).setNodeAccountIds([t instanceof f?t:f.fromString(t)]).execute(this)}async pingAll(){for(const e of Object.values(this._network.network))await this.ping(e)}async updateNetwork(){if(!this._isUpdatingNetwork){this._isUpdatingNetwork=!0;try{const e=await t$j.addressBookQueryConstructor().setFileId(u$4.ADDRESS_BOOK).execute(this);this.setNetworkFromAddressBook(e)}catch(e){this._logger&&this._logger.trace(`failed to update client address book: ${e.toString()}`)}finally{this._isUpdatingNetwork=!1}}}close(){this._network.close(),this._mirrorNetwork.close(),this._isShutdown=!0,clearTimeout(this._timer)}_createNetworkChannel(){throw new Error("not implemented")}_createMirrorNetworkChannel(){throw new Error("not implemented")}_scheduleNetworkUpdate(){this._timer=setTimeout((async()=>{await this.updateNetwork(),this._isShutdown||this._scheduleNetworkUpdate()}),this._networkUpdatePeriod)}get isClientShutDown(){return this._isShutdown}}class t{constructor(e){this._code=e,Object.freeze(this)}static _fromValue(e){return new t(e)}toString(){return this._code.toString()}valueOf(){return this._code}}const{proto:r}=e$b;let n$1=class{constructor(){this._crypto=null,this._smartContract=null,this._file=null,this._consensus=null,this._freeze=null,this._network=null,this._token=null,this._schedule=null,this._util=null,this._addressBook=null}close(){throw new Error("not implemented")}get crypto(){return null!=this._crypto||(this._crypto=r.CryptoService.create(this._createUnaryClient("CryptoService"))),this._crypto}get smartContract(){return null!=this._smartContract||(this._smartContract=r.SmartContractService.create(this._createUnaryClient("SmartContractService"))),this._smartContract}get file(){return null!=this._file||(this._file=r.FileService.create(this._createUnaryClient("FileService"))),this._file}get consensus(){return null!=this._consensus||(this._consensus=r.ConsensusService.create(this._createUnaryClient("ConsensusService"))),this._consensus}get freeze(){return null!=this._freeze||(this._freeze=r.FreezeService.create(this._createUnaryClient("FreezeService"))),this._freeze}get network(){return null!=this._network||(this._network=r.NetworkService.create(this._createUnaryClient("NetworkService"))),this._network}get token(){return null!=this._token||(this._token=r.TokenService.create(this._createUnaryClient("TokenService"))),this._token}get schedule(){return null!=this._schedule||(this._schedule=r.ScheduleService.create(this._createUnaryClient("ScheduleService"))),this._schedule}get util(){return null!=this._util||(this._util=r.UtilService.create(this._createUnaryClient("UtilService"))),this._util}get addressBook(){return null!=this._addressBook||(this._addressBook=r.AddressBookService.create(this._createUnaryClient("AddressBookService"))),this._addressBook}_createUnaryClient(e){throw new Error("not implemented")}};function s(e){const t=new ArrayBuffer(e.byteLength+5);return new DataView(t,1,4).setUint32(0,e.length),new Uint8Array(t,5).set(e),t}function i$2(e,t=0,n=e.byteLength){const o=new DataView(e,t,n);let r=0,i=null,a=0;for(;r<o.byteLength;){const t=o.getUint8(r+0)>>7,n=o.getUint32(r+1),s=r+5;if(s+n>o.byteLength)throw new Error("(BUG) unexpected frame length past the boundary");const c=new Uint8Array(e,o.byteOffset+s,n);if(0===t){if(null!=i)throw new Error("(BUG) unexpectedly received more than one data frame");i=c}else{if(1!==t)throw new Error(`(BUG) unexpected frame type: ${t}`);{const e=e$3(c),[t,n]=e.split(":");if("grpc-status"!==t)throw new Error(`(BUG) unhandled trailer, ${e}`);a=parseInt(n)}}r+=n+5}if(0!==a)throw new Error(`(BUG) unhandled grpc-status: ${a}`);if(null==i)throw new Error("(BUG) unexpectedly received no response");return i}class c extends n$1{constructor(e){super(),this._address=e}close(){}_createUnaryClient(e){return async(n,o,r)=>{try{const i=await fetch(`${this._address}/proto.${e}/${n.name}`,{method:"POST",headers:{"content-type":"application/grpc-web+proto","x-user-agent":"hedera-sdk-js/v2","x-grpc-web":"1"},body:s(o)});i.ok||r(new r$6(t._fromValue(i.status)),null);const a=i.headers.get("grpc-status"),c=i.headers.get("grpc-message");if(null!=a&&null!=c){const e=new r$7(e$5._fromValue(parseInt(a)),o$1[this._address].toString());e.message=c,r(e,null)}r(null,i$2(await i.arrayBuffer()))}catch(i){r(new r$7(e$5._fromValue(18),o$1[this._address].toString()),null)}}}}const w={MAINNET:s$1,TESTNET:t$4,PREVIEWNET:n$2};let i$1=class e extends m{constructor(e){if(super(e),null!=e)if("string"==typeof e.network)switch(e.network){case"mainnet":this.setNetwork(w.MAINNET),this.setLedgerId(r$3.MAINNET);break;case"testnet":this.setNetwork(w.TESTNET),this.setLedgerId(r$3.TESTNET);break;case"previewnet":this.setNetwork(w.PREVIEWNET),this.setLedgerId(r$3.PREVIEWNET);break;default:throw new Error(`unknown network: ${e.network}`)}else null!=e.network&&this.setNetwork(e.network)}static fromConfig(t){return new e("string"==typeof t?JSON.parse(t):t)}static forNetwork(t){return new e({network:t,scheduleNetworkUpdate:!1})}static forName(t){return new e({network:t,scheduleNetworkUpdate:!1})}static forMainnet(){return new e({network:"mainnet",scheduleNetworkUpdate:!1})}static forTestnet(){return new e({network:"testnet",scheduleNetworkUpdate:!1})}static forPreviewnet(){return new e({network:"previewnet",scheduleNetworkUpdate:!1})}setNetwork(e){if("string"==typeof e)switch(e){case"previewnet":this._network.setNetwork(w.PREVIEWNET);break;case"testnet":this._network.setNetwork(w.TESTNET);break;case"mainnet":this._network.setNetwork(w.MAINNET)}else this._network.setNetwork(e)}setMirrorNetwork(e){return"string"==typeof e?this._mirrorNetwork.setNetwork([]):this._mirrorNetwork.setNetwork(e),this}_createNetworkChannel(){return e=>new c(e)}_createMirrorNetworkChannel(){return()=>{throw new Error("mirror support is not supported in browsers")}}updateNetwork(){return Promise.reject(new Error("Update network is not supported in browsers"))}};const version="6.13.5";function checkType(e,t,n){const o=t.split("|").map((e=>e.trim()));for(let i=0;i<o.length;i++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const r=new Error(`invalid value for type ${t}`);throw r.code="INVALID_ARGUMENT",r.argument=`value.${n}`,r.value=e,r}function defineProperties(e,t,n){for(let o in t){let r=t[o];const i=n?n[o]:null;i&&checkType(r,i,o),Object.defineProperty(e,o,{enumerable:!0,value:r,writable:!1})}}function stringify(e){if(null==e)return"null";if(Array.isArray(e))return"[ "+e.map(stringify).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let o=0;o<e.length;o++)n+=t[e[o]>>4],n+=t[15&e[o]];return n}if("object"==typeof e&&"function"==typeof e.toJSON)return stringify(e.toJSON());switch(typeof e){case"boolean":case"symbol":case"number":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const t=Object.keys(e);return t.sort(),"{ "+t.map((t=>`${stringify(t)}: ${stringify(e[t])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function isError(e,t){return e&&e.code===t}function makeError(e,t,n){let o,r=e;{const o=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${stringify(n)}`);for(const e in n){if("shortMessage"===e)continue;const t=n[e];o.push(e+"="+stringify(t))}}o.push(`code=${t}`),o.push(`version=${version}`),o.length&&(e+=" ("+o.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":o=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":o=new RangeError(e);break;default:o=new Error(e)}return defineProperties(o,{code:t}),n&&Object.assign(o,n),null==o.shortMessage&&defineProperties(o,{shortMessage:r}),o}function assert(e,t,n,o){if(!e)throw makeError(t,n,o)}function assertArgument(e,t,n,o){assert(e,t,"INVALID_ARGUMENT",{argument:n,value:o})}function assertArgumentCount(e,t,n){null==n&&(n=""),n&&(n=": "+n),assert(e>=t,"missing argument"+n,"MISSING_ARGUMENT",{count:e,expectedCount:t}),assert(e<=t,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}function assertPrivate(e,t,n){if(null==n&&(n=""),e!==t){let e=n,t="new";n&&(e+=".",t+=" "+n),assert(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}function _getBytes(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let n=2;for(let o=0;o<t.length;o++)t[o]=parseInt(e.substring(n,n+2),16),n+=2;return t}assertArgument(!1,"invalid BytesLike value",t||"value",e)}function getBytes(e,t){return _getBytes(e,t,!1)}function getBytesCopy(e,t){return _getBytes(e,t,!0)}function isHexString(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(("number"!=typeof t||e.length===2+2*t)&&(!0!==t||e.length%2==0))}["NFD","NFC","NFKD","NFKC"].reduce(((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(n){}return e}),[]);const HexCharacters="0123456789abcdef";function hexlify(e){const t=getBytes(e);let n="0x";for(let o=0;o<t.length;o++){const e=t[o];n+=HexCharacters[(240&e)>>4]+HexCharacters[15&e]}return n}function concat(e){return"0x"+e.map((e=>hexlify(e).substring(2))).join("")}function dataSlice(e,t,n){const o=getBytes(e);return null!=n&&n>o.length&&assert(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:o,length:o.length,offset:n}),hexlify(o.slice(null==t?0:t,null==n?o.length:n))}function zeroPad(e,t,n){const o=getBytes(e);assert(t>=o.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(o),length:t,offset:t+1});const r=new Uint8Array(t);return r.fill(0),n?r.set(o,t-o.length):r.set(o,0),hexlify(r)}function zeroPadValue(e,t){return zeroPad(e,t,!0)}function zeroPadBytes(e,t){return zeroPad(e,t,!1)}const BN_0$2=BigInt(0),BN_1$1=BigInt(1),maxValue=9007199254740991;function fromTwos(e,t){const n=getUint(e,"value"),o=BigInt(getNumber(t,"width"));if(assert(n>>o===BN_0$2,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>o-BN_1$1){return-((~n&(BN_1$1<<o)-BN_1$1)+BN_1$1)}return n}function toTwos(e,t){let n=getBigInt(e,"value");const o=BigInt(getNumber(t,"width")),r=BN_1$1<<o-BN_1$1;if(n<BN_0$2){n=-n,assert(n<=r,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return(~n&(BN_1$1<<o)-BN_1$1)+BN_1$1}return assert(n<r,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e}),n}function mask(e,t){const n=getUint(e,"value"),o=BigInt(getNumber(t,"bits"));return n&(BN_1$1<<o)-BN_1$1}function getBigInt(e,t){switch(typeof e){case"bigint":return e;case"number":return assertArgument(Number.isInteger(e),"underflow",t||"value",e),assertArgument(e>=-9007199254740991&&e<=maxValue,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(n){assertArgument(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}assertArgument(!1,"invalid BigNumberish value",t||"value",e)}function getUint(e,t){const n=getBigInt(e,t);return assert(n>=BN_0$2,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const Nibbles="0123456789abcdef";function toBigInt(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=Nibbles[n>>4],t+=Nibbles[15&n];return BigInt(t)}return getBigInt(e)}function getNumber(e,t){switch(typeof e){case"bigint":return assertArgument(e>=-9007199254740991&&e<=maxValue,"overflow",t||"value",e),Number(e);case"number":return assertArgument(Number.isInteger(e),"underflow",t||"value",e),assertArgument(e>=-9007199254740991&&e<=maxValue,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return getNumber(BigInt(e),t)}catch(n){assertArgument(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}assertArgument(!1,"invalid numeric value",t||"value",e)}function toNumber(e){return getNumber(toBigInt(e))}function toBeHex(e,t){let n=getUint(e,"value").toString(16);if(null==t)n.length%2&&(n="0"+n);else{const o=getNumber(t,"width");for(assert(2*o>=n.length,`value exceeds width (${o} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});n.length<2*o;)n="0"+n}return"0x"+n}function toBeArray(e){const t=getUint(e,"value");if(t===BN_0$2)return new Uint8Array([]);let n=t.toString(16);n.length%2&&(n="0"+n);const o=new Uint8Array(n.length/2);for(let r=0;r<o.length;r++){const e=2*r;o[r]=parseInt(n.substring(e,e+2),16)}return o}function errorFunc(e,t,n,o,r){assertArgument(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",n)}function ignoreFunc(e,t,n,o,r){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let o=t+1;o<n.length&&n[o]>>6==2;o++)e++;return e}return"OVERRUN"===e?n.length-t-1:0}function replaceFunc(e,t,n,o,r){return"OVERLONG"===e?(assertArgument("number"==typeof r,"invalid bad code point for replacement","badCodepoint",r),o.push(r),0):(o.push(65533),ignoreFunc(e,t,n))}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(e,t){null==t&&(t=Utf8ErrorFuncs.error);const n=getBytes(e,"bytes"),o=[];let r=0;for(;r<n.length;){const e=n[r++];if(!(e>>7)){o.push(e);continue}let i=null,a=null;if(192==(224&e))i=1,a=127;else if(224==(240&e))i=2,a=2047;else{if(240!=(248&e)){r+=t(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",r-1,n,o);continue}i=3,a=65535}if(r-1+i>=n.length){r+=t("OVERRUN",r-1,n,o);continue}let s=e&(1<<8-i-1)-1;for(let c=0;c<i;c++){let e=n[r];if(128!=(192&e)){r+=t("MISSING_CONTINUE",r,n,o),s=null;break}s=s<<6|63&e,r++}null!==s&&(s>1114111?r+=t("OUT_OF_RANGE",r-1-i,n,o,s):s>=55296&&s<=57343?r+=t("UTF16_SURROGATE",r-1-i,n,o,s):s<=a?r+=t("OVERLONG",r-1-i,n,o,s):o.push(s))}return o}function toUtf8Bytes(e,t){assertArgument("string"==typeof e,"invalid string value","str",e);let n=[];for(let o=0;o<e.length;o++){const t=e.charCodeAt(o);if(t<128)n.push(t);else if(t<2048)n.push(t>>6|192),n.push(63&t|128);else if(55296==(64512&t)){o++;const r=e.charCodeAt(o);assertArgument(o<e.length&&56320==(64512&r),"invalid surrogate pair","str",e);const i=65536+((1023&t)<<10)+(1023&r);n.push(i>>18|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)}else n.push(t>>12|224),n.push(t>>6&63|128),n.push(63&t|128)}return new Uint8Array(n)}function _toUtf8String(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function toUtf8String(e,t){return _toUtf8String(getUtf8CodePoints(e,t))}const WordSize=32,Padding=new Uint8Array(WordSize),passProperties=["then"],_guard$1={},resultNames=new WeakMap;function getNames(e){return resultNames.get(e)}function setNames(e,t){resultNames.set(e,t)}function throwError(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw n.error=t,n}function toObject(e,t,n){return e.indexOf(null)>=0?t.map(((e,t)=>e instanceof Result?toObject(getNames(e),e,n):e)):e.reduce(((e,o,r)=>{let i=t.getValue(o);return o in e||(n&&i instanceof Result&&(i=toObject(getNames(i),i,n)),e[o]=i),e}),{})}const _Result=class e extends Array{constructor(...e){const t=e[0];let n=e[1],o=(e[2]||[]).slice(),r=!0;t!==_guard$1&&(n=e,o=[],r=!1),super(n.length),__privateAdd(this,_names),n.forEach(((e,t)=>{this[t]=e}));const i=o.reduce(((e,t)=>("string"==typeof t&&e.set(t,(e.get(t)||0)+1),e)),new Map);if(setNames(this,Object.freeze(n.map(((e,t)=>{const n=o[t];return null!=n&&1===i.get(n)?n:null})))),__privateSet(this,_names,[]),null==__privateGet(this,_names)&&__privateGet(this,_names),!r)return;Object.freeze(this);const a=new Proxy(this,{get:(e,t,n)=>{if("string"==typeof t){if(t.match(/^[0-9]+$/)){const n=getNumber(t,"%index");if(n<0||n>=this.length)throw new RangeError("out of result range");const o=e[n];return o instanceof Error&&throwError(`index ${n}`,o),o}if(passProperties.indexOf(t)>=0)return Reflect.get(e,t,n);const o=e[t];if(o instanceof Function)return function(...t){return o.apply(this===n?e:this,t)};if(!(t in e))return e.getValue.apply(this===n?e:this,[t])}return Reflect.get(e,t,n)}});return setNames(a,getNames(this)),a}toArray(t){const n=[];return this.forEach(((o,r)=>{o instanceof Error&&throwError(`index ${r}`,o),t&&o instanceof e&&(o=o.toArray(t)),n.push(o)})),n}toObject(e){const t=getNames(this);return t.reduce(((n,o,r)=>(assert(null!=o,`value at index ${r} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),toObject(t,this,e))),{})}slice(t,n){null==t&&(t=0),t<0&&(t+=this.length)<0&&(t=0),null==n&&(n=this.length),n<0&&(n+=this.length)<0&&(n=0),n>this.length&&(n=this.length);const o=getNames(this),r=[],i=[];for(let e=t;e<n;e++)r.push(this[e]),i.push(o[e]);return new e(_guard$1,r,i)}filter(t,n){const o=getNames(this),r=[],i=[];for(let e=0;e<this.length;e++){const a=this[e];a instanceof Error&&throwError(`index ${e}`,a),t.call(n,a,e,this)&&(r.push(a),i.push(o[e]))}return new e(_guard$1,r,i)}map(e,t){const n=[];for(let o=0;o<this.length;o++){const r=this[o];r instanceof Error&&throwError(`index ${o}`,r),n.push(e.call(t,r,o,this))}return n}getValue(e){const t=getNames(this).indexOf(e);if(-1===t)return;const n=this[t];return n instanceof Error&&throwError(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(t,n){return new e(_guard$1,t,n)}};_names=new WeakMap;let Result=_Result;function getValue(e){let t=toBeArray(e);return assert(t.length<=WordSize,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:WordSize,offset:t.length}),t.length!==WordSize&&(t=getBytesCopy(concat([Padding.slice(t.length%WordSize),t]))),t}class Coder{constructor(e,t,n,o){__publicField2(this,"name"),__publicField2(this,"type"),__publicField2(this,"localName"),__publicField2(this,"dynamic"),defineProperties(this,{name:e,type:t,localName:n,dynamic:o},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){assertArgument(!1,e,this.localName,t)}}class Writer{constructor(){__privateAdd(this,_Writer_instances),__privateAdd(this,_data),__privateAdd(this,_dataLength),__privateSet(this,_data,[]),__privateSet(this,_dataLength,0)}get data(){return concat(__privateGet(this,_data))}get length(){return __privateGet(this,_dataLength)}appendWriter(e){return __privateMethod(this,_Writer_instances,writeData_fn).call(this,getBytesCopy(e.data))}writeBytes(e){let t=getBytesCopy(e);const n=t.length%WordSize;return n&&(t=getBytesCopy(concat([t,Padding.slice(n)]))),__privateMethod(this,_Writer_instances,writeData_fn).call(this,t)}writeValue(e){return __privateMethod(this,_Writer_instances,writeData_fn).call(this,getValue(e))}writeUpdatableValue(){const e=__privateGet(this,_data).length;return __privateGet(this,_data).push(Padding),__privateSet(this,_dataLength,__privateGet(this,_dataLength)+WordSize),t=>{__privateGet(this,_data)[e]=getValue(t)}}}_data=new WeakMap,_dataLength=new WeakMap,_Writer_instances=new WeakSet,writeData_fn=function(e){return __privateGet(this,_data).push(e),__privateSet(this,_dataLength,__privateGet(this,_dataLength)+e.length),e.length};const _Reader=class e{constructor(e,t,n){__privateAdd(this,_Reader_instances),__publicField2(this,"allowLoose"),__privateAdd(this,_data2),__privateAdd(this,_offset),__privateAdd(this,_bytesRead),__privateAdd(this,_parent),__privateAdd(this,_maxInflation),defineProperties(this,{allowLoose:!!t}),__privateSet(this,_data2,getBytesCopy(e)),__privateSet(this,_bytesRead,0),__privateSet(this,_parent,null),__privateSet(this,_maxInflation,null!=n?n:1024),__privateSet(this,_offset,0)}get data(){return hexlify(__privateGet(this,_data2))}get dataLength(){return __privateGet(this,_data2).length}get consumed(){return __privateGet(this,_offset)}get bytes(){return new Uint8Array(__privateGet(this,_data2))}subReader(t){const n=new e(__privateGet(this,_data2).slice(__privateGet(this,_offset)+t),this.allowLoose,__privateGet(this,_maxInflation));return __privateSet(n,_parent,this),n}readBytes(e,t){let n=__privateMethod(this,_Reader_instances,peekBytes_fn).call(this,0,e,!!t);return __privateMethod(this,_Reader_instances,incrementBytesRead_fn).call(this,e),__privateSet(this,_offset,__privateGet(this,_offset)+n.length),n.slice(0,e)}readValue(){return toBigInt(this.readBytes(WordSize))}readIndex(){return toNumber(this.readBytes(WordSize))}};_data2=new WeakMap,_offset=new WeakMap,_bytesRead=new WeakMap,_parent=new WeakMap,_maxInflation=new WeakMap,_Reader_instances=new WeakSet,incrementBytesRead_fn=function(e){var t;if(__privateGet(this,_parent))return __privateMethod(t=__privateGet(this,_parent),_Reader_instances,incrementBytesRead_fn).call(t,e);__privateSet(this,_bytesRead,__privateGet(this,_bytesRead)+e),assert(__privateGet(this,_maxInflation)<1||__privateGet(this,_bytesRead)<=__privateGet(this,_maxInflation)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${__privateGet(this,_maxInflation)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:getBytesCopy(__privateGet(this,_data2)),offset:__privateGet(this,_offset),length:e,info:{bytesRead:__privateGet(this,_bytesRead),dataLength:this.dataLength}})},peekBytes_fn=function(e,t,n){let o=Math.ceil(t/WordSize)*WordSize;return __privateGet(this,_offset)+o>__privateGet(this,_data2).length&&(this.allowLoose&&n&&__privateGet(this,_offset)+t<=__privateGet(this,_data2).length?o=t:assert(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(__privateGet(this,_data2)),length:__privateGet(this,_data2).length,offset:__privateGet(this,_offset)+o})),__privateGet(this,_data2).slice(__privateGet(this,_offset),__privateGet(this,_offset)+o)};let Reader=_Reader;function number(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function bytes(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function exists(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function output(e,t){bytes(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}
117
117
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u8a=e=>e instanceof Uint8Array,u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];if(!isLE)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function toBytes(e){if("string"==typeof e&&(e=utf8ToBytes(e)),!u8a(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(e){const t=t=>e().update(toBytes(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(e,t=!1){return t?{h:Number(e&U32_MASK64),l:Number(e>>_32n&U32_MASK64)}:{h:0|Number(e>>_32n&U32_MASK64),l:0|Number(e&U32_MASK64)}}function split(e,t=!1){let n=new Uint32Array(e.length),o=new Uint32Array(e.length);for(let r=0;r<e.length;r++){const{h:i,l:a}=fromBig(e[r],t);[n[r],o[r]]=[i,a]}return[n,o]}const rotlSH=(e,t,n)=>e<<n|t>>>32-n,rotlSL=(e,t,n)=>t<<n|e>>>32-n,rotlBH=(e,t,n)=>t<<n-32|e>>>64-n,rotlBL=(e,t,n)=>e<<n-32|t>>>64-n,[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]],_0n=BigInt(0),_1n=BigInt(1),_2n=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let T=0,_=_1n,O=1,C=0;T<24;T++){[O,C]=[C,(2*O+3*C)%5],SHA3_PI.push(2*(5*C+O)),SHA3_ROTL.push((T+1)*(T+2)/2%64);let e=_0n;for(let t=0;t<7;t++)_=(_<<_1n^(_>>_7n)*_0x71n)%_256n,_&_2n&&(e^=_1n<<(_1n<<BigInt(t))-_1n);_SHA3_IOTA.push(e)}const[SHA3_IOTA_H,SHA3_IOTA_L]=split(_SHA3_IOTA,!0),rotlH=(e,t,n)=>n>32?rotlBH(e,t,n):rotlSH(e,t,n),rotlL=(e,t,n)=>n>32?rotlBL(e,t,n):rotlSL(e,t,n);function keccakP(e,t=24){const n=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const t=(o+8)%10,r=(o+2)%10,i=n[r],a=n[r+1],s=rotlH(i,a,1)^n[t],c=rotlL(i,a,1)^n[t+1];for(let n=0;n<50;n+=10)e[o+n]^=s,e[o+n+1]^=c}let t=e[2],r=e[3];for(let n=0;n<24;n++){const o=SHA3_ROTL[n],i=rotlH(t,r,o),a=rotlL(t,r,o),s=SHA3_PI[n];t=e[s],r=e[s+1],e[s]=i,e[s+1]=a}for(let o=0;o<50;o+=10){for(let t=0;t<10;t++)n[t]=e[o+t];for(let t=0;t<10;t++)e[o+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=SHA3_IOTA_H[o],e[1]^=SHA3_IOTA_L[o]}n.fill(0)}class Keccak extends Hash{constructor(e,t,n,o=!1,r=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=o,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){exists(this);const{blockLen:t,state:n}=this,o=(e=toBytes(e)).length;for(let r=0;r<o;){const i=Math.min(t-this.pos,o-r);for(let t=0;t<i;t++)n[this.pos++]^=e[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:o}=this;e[n]^=t,128&t&&n===o-1&&this.keccak(),e[o-1]^=128,this.keccak()}writeInto(e){exists(this,!1),bytes(e),this.finish();const t=this.state,{blockLen:n}=this;for(let o=0,r=e.length;o<r;){this.posOut>=n&&this.keccak();const i=Math.min(n-this.posOut,r-o);e.set(t.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:o,rounds:r,enableXOF:i}=this;return e||(e=new Keccak(t,n,o,i,r)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=r,e.suffix=n,e.outputLen=o,e.enableXOF=i,e.destroyed=this.destroyed,e}}const gen=(e,t,n)=>wrapConstructor((()=>new Keccak(t,e,n))),keccak_256=gen(1,136,32);let locked=!1;const _keccak256=function(e){return keccak_256(e)};let __keccak256=_keccak256;function keccak256(e){const t=getBytes(e,"data");return hexlify(__keccak256(t))}keccak256._=_keccak256,keccak256.lock=function(){locked=!0},keccak256.register=function(e){if(locked)throw new TypeError("keccak256 is locked");__keccak256=e},Object.freeze(keccak256);const BN_0$1=BigInt(0),BN_36=BigInt(36);function getChecksumAddress(e){const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let r=0;r<40;r++)n[r]=t[r].charCodeAt(0);const o=getBytes(keccak256(n));for(let r=0;r<40;r+=2)o[r>>1]>>4>=8&&(t[r]=t[r].toUpperCase()),(15&o[r>>1])>=8&&(t[r+1]=t[r+1].toUpperCase());return"0x"+t.join("")}const ibanLookup={};for(let T=0;T<10;T++)ibanLookup[String(T)]=String(T);for(let T=0;T<26;T++)ibanLookup[String.fromCharCode(65+T)]=String(10+T);const safeDigits=15;function ibanChecksum(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>ibanLookup[e])).join("");for(;t.length>=safeDigits;){let e=t.substring(0,safeDigits);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}const Base36=function(){const e={};for(let t=0;t<36;t++){e["0123456789abcdefghijklmnopqrstuvwxyz"[t]]=BigInt(t)}return e}();function fromBase36(e){e=e.toLowerCase();let t=BN_0$1;for(let n=0;n<e.length;n++)t=t*BN_36+Base36[e[n]];return t}function getAddress(e){if(assertArgument("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=getChecksumAddress(e);return assertArgument(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){assertArgument(e.substring(2,4)===ibanChecksum(e),"bad icap checksum","address",e);let t=fromBase36(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return getChecksumAddress("0x"+t)}assertArgument(!1,"invalid address","address",e)}const _gaurd={};function n(e,t){let n=!1;return t<0&&(n=!0,t*=-1),new Typed(_gaurd,`${n?"":"u"}int${t}`,e,{signed:n,width:t})}function b(e,t){return new Typed(_gaurd,`bytes${t||""}`,e,{size:t})}const _typedSymbol=Symbol.for("_ethers_typed"),_Typed=class e{constructor(e,t,n,o){__publicField2(this,"type"),__publicField2(this,"value"),__privateAdd(this,_options),__publicField2(this,"_typedSymbol"),null==o&&(o=null),assertPrivate(_gaurd,e,"Typed"),defineProperties(this,{_typedSymbol:_typedSymbol,type:t,value:n}),__privateSet(this,_options,o),this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((e=>e.format())).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return __privateGet(this,_options)}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===__privateGet(this,_options)?-1:!1===__privateGet(this,_options)?this.value.length:null}static from(t,n){return new e(_gaurd,t,n)}static uint8(e){return n(e,8)}static uint16(e){return n(e,16)}static uint24(e){return n(e,24)}static uint32(e){return n(e,32)}static uint40(e){return n(e,40)}static uint48(e){return n(e,48)}static uint56(e){return n(e,56)}static uint64(e){return n(e,64)}static uint72(e){return n(e,72)}static uint80(e){return n(e,80)}static uint88(e){return n(e,88)}static uint96(e){return n(e,96)}static uint104(e){return n(e,104)}static uint112(e){return n(e,112)}static uint120(e){return n(e,120)}static uint128(e){return n(e,128)}static uint136(e){return n(e,136)}static uint144(e){return n(e,144)}static uint152(e){return n(e,152)}static uint160(e){return n(e,160)}static uint168(e){return n(e,168)}static uint176(e){return n(e,176)}static uint184(e){return n(e,184)}static uint192(e){return n(e,192)}static uint200(e){return n(e,200)}static uint208(e){return n(e,208)}static uint216(e){return n(e,216)}static uint224(e){return n(e,224)}static uint232(e){return n(e,232)}static uint240(e){return n(e,240)}static uint248(e){return n(e,248)}static uint256(e){return n(e,256)}static uint(e){return n(e,256)}static int8(e){return n(e,-8)}static int16(e){return n(e,-16)}static int24(e){return n(e,-24)}static int32(e){return n(e,-32)}static int40(e){return n(e,-40)}static int48(e){return n(e,-48)}static int56(e){return n(e,-56)}static int64(e){return n(e,-64)}static int72(e){return n(e,-72)}static int80(e){return n(e,-80)}static int88(e){return n(e,-88)}static int96(e){return n(e,-96)}static int104(e){return n(e,-104)}static int112(e){return n(e,-112)}static int120(e){return n(e,-120)}static int128(e){return n(e,-128)}static int136(e){return n(e,-136)}static int144(e){return n(e,-144)}static int152(e){return n(e,-152)}static int160(e){return n(e,-160)}static int168(e){return n(e,-168)}static int176(e){return n(e,-176)}static int184(e){return n(e,-184)}static int192(e){return n(e,-192)}static int200(e){return n(e,-200)}static int208(e){return n(e,-208)}static int216(e){return n(e,-216)}static int224(e){return n(e,-224)}static int232(e){return n(e,-232)}static int240(e){return n(e,-240)}static int248(e){return n(e,-248)}static int256(e){return n(e,-256)}static int(e){return n(e,-256)}static bytes1(e){return b(e,1)}static bytes2(e){return b(e,2)}static bytes3(e){return b(e,3)}static bytes4(e){return b(e,4)}static bytes5(e){return b(e,5)}static bytes6(e){return b(e,6)}static bytes7(e){return b(e,7)}static bytes8(e){return b(e,8)}static bytes9(e){return b(e,9)}static bytes10(e){return b(e,10)}static bytes11(e){return b(e,11)}static bytes12(e){return b(e,12)}static bytes13(e){return b(e,13)}static bytes14(e){return b(e,14)}static bytes15(e){return b(e,15)}static bytes16(e){return b(e,16)}static bytes17(e){return b(e,17)}static bytes18(e){return b(e,18)}static bytes19(e){return b(e,19)}static bytes20(e){return b(e,20)}static bytes21(e){return b(e,21)}static bytes22(e){return b(e,22)}static bytes23(e){return b(e,23)}static bytes24(e){return b(e,24)}static bytes25(e){return b(e,25)}static bytes26(e){return b(e,26)}static bytes27(e){return b(e,27)}static bytes28(e){return b(e,28)}static bytes29(e){return b(e,29)}static bytes30(e){return b(e,30)}static bytes31(e){return b(e,31)}static bytes32(e){return b(e,32)}static address(t){return new e(_gaurd,"address",t)}static bool(t){return new e(_gaurd,"bool",!!t)}static bytes(t){return new e(_gaurd,"bytes",t)}static string(t){return new e(_gaurd,"string",t)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(t){return new e(_gaurd,"overrides",Object.assign({},t))}static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===_typedSymbol}static dereference(t,n){if(e.isTyped(t)){if(t.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${t.type}`);return t.value}return t}};_options=new WeakMap;let Typed=_Typed;class AddressCoder extends Coder{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=Typed.dereference(t,"string");try{n=getAddress(n)}catch(o){return this._throwError(o.message,t)}return e.writeValue(n)}decode(e){return getAddress(toBeHex(e.readValue(),20))}}class AnonymousCoder extends Coder{constructor(e){super(e.name,e.type,"_",e.dynamic),__publicField2(this,"coder"),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}function pack(e,t,n){let o=[];if(Array.isArray(n))o=n;else if(n&&"object"==typeof n){let e={};o=t.map((t=>{const o=t.localName;return assert(o,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:n}),assert(!e[o],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:n}),e[o]=!0,n[o]}))}else assertArgument(!1,"invalid tuple value","tuple",n);assertArgument(t.length===o.length,"types/value length mismatch","tuple",n);let r=new Writer,i=new Writer,a=[];t.forEach(((e,t)=>{let n=o[t];if(e.dynamic){let t=i.length;e.encode(i,n);let o=r.writeUpdatableValue();a.push((e=>{o(e+t)}))}else e.encode(r,n)})),a.forEach((e=>{e(r.length)}));let s=e.appendWriter(r);return s+=e.appendWriter(i),s}function unpack(e,t){let n=[],o=[],r=e.subReader(0);return t.forEach((t=>{let i=null;if(t.dynamic){let n=e.readIndex(),o=r.subReader(n);try{i=t.decode(o)}catch(a){if(isError(a,"BUFFER_OVERRUN"))throw a;i=a,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(a){if(isError(a,"BUFFER_OVERRUN"))throw a;i=a,i.baseType=t.name,i.name=t.localName,i.type=t.type}if(null==i)throw new Error("investigate");n.push(i),o.push(t.localName||null)})),Result.fromItems(n,o)}class ArrayCoder extends Coder{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),__publicField2(this,"coder"),__publicField2(this,"length"),defineProperties(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){const n=Typed.dereference(t,"array");Array.isArray(n)||this._throwError("expected array value",n);let o=this.length;-1===o&&(o=n.length,e.writeValue(n.length)),assertArgumentCount(n.length,o,"coder array"+(this.localName?" "+this.localName:""));let r=[];for(let i=0;i<n.length;i++)r.push(this.coder);return pack(e,r,n)}decode(e){let t=this.length;-1===t&&(t=e.readIndex(),assert(t*WordSize<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*WordSize,length:e.dataLength}));let n=[];for(let o=0;o<t;o++)n.push(new AnonymousCoder(this.coder));return unpack(e,n)}}class BooleanCoder extends Coder{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const n=Typed.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class DynamicBytesCoder extends Coder{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=getBytesCopy(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class BytesCoder extends DynamicBytesCoder{constructor(e){super("bytes",e)}decode(e){return hexlify(super.decode(e))}}class FixedBytesCoder extends Coder{constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),__publicField2(this,"size"),defineProperties(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let n=getBytesCopy(Typed.dereference(t,this.type));return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return hexlify(e.readBytes(this.size))}}const Empty=new Uint8Array([]);class NullCoder extends Coder{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes(Empty)}decode(e){return e.readBytes(0),null}}const BN_0=BigInt(0),BN_1=BigInt(1),BN_MAX_UINT256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class NumberCoder extends Coder{constructor(e,t,n){const o=(t?"int":"uint")+8*e;super(o,o,n,!1),__publicField2(this,"size"),__publicField2(this,"signed"),defineProperties(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let n=getBigInt(Typed.dereference(t,this.type)),o=mask(BN_MAX_UINT256,8*WordSize);if(this.signed){let e=mask(o,8*this.size-1);(n>e||n<-(e+BN_1))&&this._throwError("value out-of-bounds",t),n=toTwos(n,8*WordSize)}else(n<BN_0||n>mask(o,8*this.size))&&this._throwError("value out-of-bounds",t);return e.writeValue(n)}decode(e){let t=mask(e.readValue(),8*this.size);return this.signed&&(t=fromTwos(t,8*this.size)),t}}class StringCoder extends DynamicBytesCoder{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,toUtf8Bytes(Typed.dereference(t,"string")))}decode(e){return toUtf8String(super.decode(e))}}class TupleCoder extends Coder{constructor(e,t){let n=!1;const o=[];e.forEach((e=>{e.dynamic&&(n=!0),o.push(e.type)}));super("tuple","tuple("+o.join(",")+")",t,n),__publicField2(this,"coders"),defineProperties(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,o)=>{let r=n.localName;r&&1===t[r]&&("length"===r&&(r="_length"),null==e[r]&&(e[r]=e[o]))})),Object.freeze(e)}encode(e,t){const n=Typed.dereference(t,"tuple");return pack(e,this.coders,n)}decode(e){return unpack(e,this.coders)}}function id(e){return keccak256(toUtf8Bytes(e))}function setify(e){const t=new Set;return e.forEach((e=>t.add(e))),Object.freeze(t)}const _kwVisibDeploy="external public payable override",KwVisibDeploy=setify(_kwVisibDeploy.split(" ")),_kwVisib="constant external internal payable private public pure view override",KwVisib=setify(_kwVisib.split(" ")),_kwTypes="constructor error event fallback function receive struct",KwTypes=setify(_kwTypes.split(" ")),_kwModifiers="calldata memory storage payable indexed",KwModifiers=setify(_kwModifiers.split(" ")),_kwOther="tuple returns",_keywords=[_kwTypes,_kwModifiers,_kwOther,_kwVisib].join(" "),Keywords=setify(_keywords.split(" ")),SimpleTokens={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},regexWhitespacePrefix=new RegExp("^(\\s*)"),regexNumberPrefix=new RegExp("^([0-9]+)"),regexIdPrefix=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),regexId=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),regexType=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),_TokenString=class e{constructor(e){__privateAdd(this,_TokenString_instances),__privateAdd(this,_offset2),__privateAdd(this,_tokens),__privateSet(this,_offset2,0),__privateSet(this,_tokens,e.slice())}get offset(){return __privateGet(this,_offset2)}get length(){return __privateGet(this,_tokens).length-__privateGet(this,_offset2)}clone(){return new e(__privateGet(this,_tokens))}reset(){__privateSet(this,_offset2,0)}popKeyword(e){const t=this.peek();if("KEYWORD"!==t.type||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=__privateMethod(this,_TokenString_instances,subTokenString_fn).call(this,__privateGet(this,_offset2)+1,e.match+1);return __privateSet(this,_offset2,e.match+1),t}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=[];for(;__privateGet(this,_offset2)<e.match-1;){const e=this.peek().linkNext;t.push(__privateMethod(this,_TokenString_instances,subTokenString_fn).call(this,__privateGet(this,_offset2)+1,e)),__privateSet(this,_offset2,e)}return __privateSet(this,_offset2,e.match+1),t}peek(){if(__privateGet(this,_offset2)>=__privateGet(this,_tokens).length)throw new Error("out-of-bounds");return __privateGet(this,_tokens)[__privateGet(this,_offset2)]}peekKeyword(e){const t=this.peekType("KEYWORD");return null!=t&&e.has(t)?t:null}peekType(e){if(0===this.length)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return __privateWrapper(this,_offset2)._++,e}toString(){const e=[];for(let t=__privateGet(this,_offset2);t<__privateGet(this,_tokens).length;t++){const n=__privateGet(this,_tokens)[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};_offset2=new WeakMap,_tokens=new WeakMap,_TokenString_instances=new WeakSet,subTokenString_fn=function(e=0,t=0){return new _TokenString(__privateGet(this,_tokens).slice(e,t).map((t=>Object.freeze(Object.assign({},t,{match:t.match-e,linkBack:t.linkBack-e,linkNext:t.linkNext-e})))))};let TokenString=_TokenString;function lex(e){const t=[],n=t=>{const n=i<e.length?JSON.stringify(e[i]):"$EOI";throw new Error(`invalid token ${n} at ${i}: ${t}`)};let o=[],r=[],i=0;for(;i<e.length;){let a=e.substring(i),s=a.match(regexWhitespacePrefix);s&&(i+=s[1].length,a=e.substring(i));const c={depth:o.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};t.push(c);let l=SimpleTokens[a[0]]||"";if(l){if(c.type=l,c.text=a[0],i++,"OPEN_PAREN"===l)o.push(t.length-1),r.push(t.length-1);else if("CLOSE_PAREN"==l)0===o.length&&n("no matching open bracket"),c.match=o.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=r.pop(),t[c.linkBack].linkNext=t.length-1;else if("COMMA"===l)c.linkBack=r.pop(),t[c.linkBack].linkNext=t.length-1,r.push(t.length-1);else if("OPEN_BRACKET"===l)c.type="BRACKET";else if("CLOSE_BRACKET"===l){let e=t.pop().text;if(t.length>0&&"NUMBER"===t[t.length-1].type){const n=t.pop().text;e=n+e,t[t.length-1].value=getNumber(n)}if(0===t.length||"BRACKET"!==t[t.length-1].type)throw new Error("missing opening bracket");t[t.length-1].text+=e}}else if(s=a.match(regexIdPrefix),s){if(c.text=s[1],i+=c.text.length,Keywords.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(regexType)){c.type="TYPE";continue}c.type="ID"}else{if(s=a.match(regexNumberPrefix),!s)throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${i}`);c.text=s[1],c.type="NUMBER",i+=c.text.length}}return new TokenString(t.map((e=>Object.freeze(e))))}function allowSingle(e,t){let n=[];for(const o in t.keys())e.has(o)&&n.push(o);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function consumeName(e,t){if(t.peekKeyword(KwTypes)){const n=t.pop().text;if(n!==e)throw new Error(`expected ${e}, got ${n}`)}return t.popType("ID")}function consumeKeywords(e,t){const n=new Set;for(;;){const o=e.peekType("KEYWORD");if(null==o||t&&!t.has(o))break;if(e.pop(),n.has(o))throw new Error(`duplicate keywords: ${JSON.stringify(o)}`);n.add(o)}return Object.freeze(n)}function consumeMutability(e){let t=consumeKeywords(e,KwVisib);return allowSingle(t,setify("constant payable nonpayable".split(" "))),allowSingle(t,setify("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function consumeParams(e,t){return e.popParams().map((e=>ParamType.from(e,t)))}function consumeGas(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return getBigInt(e.pop().text);throw new Error("invalid gas")}return null}function consumeEoi(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const regexArrayType=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(e){const t=e.match(regexType);if(assertArgument(t,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(t[2]){const n=parseInt(t[2]);assertArgument(0!==n&&n<=32,"invalid bytes length","type",e)}else if(t[3]){const n=parseInt(t[3]);assertArgument(0!==n&&n<=256&&n%8==0,"invalid numeric width","type",e)}return e}const _guard={},internal=Symbol.for("_ethers_internal"),ParamTypeInternal="_ParamTypeInternal",ErrorFragmentInternal="_ErrorInternal",EventFragmentInternal="_EventInternal",ConstructorFragmentInternal="_ConstructorInternal",FallbackFragmentInternal="_FallbackInternal",FunctionFragmentInternal="_FunctionInternal",StructFragmentInternal="_StructInternal",_ParamType=class e{constructor(e,t,n,o,r,i,a,s){if(__privateAdd(this,_ParamType_instances),__publicField2(this,"name"),__publicField2(this,"type"),__publicField2(this,"baseType"),__publicField2(this,"indexed"),__publicField2(this,"components"),__publicField2(this,"arrayLength"),__publicField2(this,"arrayChildren"),assertPrivate(e,_guard,"ParamType"),Object.defineProperty(this,internal,{value:ParamTypeInternal}),i&&(i=Object.freeze(i.slice())),"array"===o){if(null==a||null==s)throw new Error("")}else if(null!=a||null!=s)throw new Error("");if("tuple"===o){if(null==i)throw new Error("")}else if(null!=i)throw new Error("");defineProperties(this,{name:t,type:n,baseType:o,indexed:r,components:i,arrayLength:a,arrayChildren:s})}format(e){if(null==e&&(e="sighash"),"json"===e){const t=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=t,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const n={type:"tuple"===this.baseType?"tuple":this.type,name:t};return"boolean"==typeof this.indexed&&(n.indexed=this.indexed),this.isTuple()&&(n.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(n)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map((t=>t.format(e))).join("full"===e?", ":",")+")":t+=this.type,"sighash"!==e&&(!0===this.indexed&&(t+=" indexed"),"full"===e&&this.name&&(t+=" "+this.name)),t}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map((e=>n.arrayChildren.walk(e,t)))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map(((e,o)=>n.components[o].walk(e,t)))}return t(this.type,e)}async walkAsync(e,t){const n=[],o=[e];return __privateMethod(this,_ParamType_instances,walkAsync_fn).call(this,n,e,t,(e=>{o[0]=e})),n.length&&await Promise.all(n),o[0]}static from(t,n){if(e.isParamType(t))return t;if("string"==typeof t)try{return e.from(lex(t),n)}catch(s){assertArgument(!1,"invalid param type","obj",t)}else if(t instanceof TokenString){let o="",r="",i=null;consumeKeywords(t,setify(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(r="tuple",i=t.popParams().map((t=>e.from(t))),o=`tuple(${i.map((e=>e.format())).join(",")})`):(o=verifyBasicType(t.popType("TYPE")),r=o);let a=null,s=null;for(;t.length&&t.peekType("BRACKET");){const n=t.pop();a=new e(_guard,"",o,r,null,i,s,a),s=n.value,o+=n.text,r="array",i=null}let c=null;if(consumeKeywords(t,KwModifiers).has("indexed")){if(!n)throw new Error("");c=!0}const l=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new e(_guard,l,o,r,c,i,s,a)}const o=t.name;assertArgument(!o||"string"==typeof o&&o.match(regexId),"invalid name","obj.name",o);let r=t.indexed;null!=r&&(assertArgument(n,"parameter cannot be indexed","obj.indexed",t.indexed),r=!!r);let i=t.type,a=i.match(regexArrayType);if(a){const n=parseInt(a[2]||"-1"),s=e.from({type:a[1],components:t.components});return new e(_guard,o||"",i,"array",r,null,n,s)}if("tuple"===i||i.startsWith("tuple(")||i.startsWith("(")){const n=null!=t.components?t.components.map((t=>e.from(t))):null;return new e(_guard,o||"",i,"tuple",r,n,null,null)}return i=verifyBasicType(t.type),new e(_guard,o||"",i,i,r,null,null,null)}static isParamType(e){return e&&e[internal]===ParamTypeInternal}};_ParamType_instances=new WeakSet,walkAsync_fn=function(e,t,n,o){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const r=this.arrayChildren,i=t.slice();return i.forEach(((t,o)=>{var a;__privateMethod(a=r,_ParamType_instances,walkAsync_fn).call(a,e,t,n,(e=>{i[o]=e}))})),void o(i)}if(this.isTuple()){const r=this.components;let i;if(Array.isArray(t))i=t.slice();else{if(null==t||"object"!=typeof t)throw new Error("invalid tuple value");i=r.map((e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in t))throw new Error(`missing value for component ${e.name}`);return t[e.name]}))}if(i.length!==this.components.length)throw new Error("array is wrong length");return i.forEach(((t,o)=>{var a;__privateMethod(a=r[o],_ParamType_instances,walkAsync_fn).call(a,e,t,n,(e=>{i[o]=e}))})),void o(i)}const r=n(this.type,t);r.then?e.push(async function(){o(await r)}()):o(r)};let ParamType=_ParamType;class Fragment{constructor(e,t,n){__publicField2(this,"type"),__publicField2(this,"inputs"),assertPrivate(e,_guard,"Fragment"),defineProperties(this,{type:t,inputs:n=Object.freeze(n.slice())})}static from(e){if("string"==typeof e){try{Fragment.from(JSON.parse(e))}catch(t){}return Fragment.from(lex(e))}if(e instanceof TokenString){switch(e.peekKeyword(KwTypes)){case"constructor":return ConstructorFragment.from(e);case"error":return ErrorFragment.from(e);case"event":return EventFragment.from(e);case"fallback":case"receive":return FallbackFragment.from(e);case"function":return FunctionFragment.from(e);case"struct":return StructFragment.from(e)}}else if("object"==typeof e){switch(e.type){case"constructor":return ConstructorFragment.from(e);case"error":return ErrorFragment.from(e);case"event":return EventFragment.from(e);case"fallback":case"receive":return FallbackFragment.from(e);case"function":return FunctionFragment.from(e);case"struct":return StructFragment.from(e)}assert(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}assertArgument(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return ConstructorFragment.isFragment(e)}static isError(e){return ErrorFragment.isFragment(e)}static isEvent(e){return EventFragment.isFragment(e)}static isFunction(e){return FunctionFragment.isFragment(e)}static isStruct(e){return StructFragment.isFragment(e)}}class NamedFragment extends Fragment{constructor(e,t,n,o){super(e,t,o),__publicField2(this,"name"),assertArgument("string"==typeof n&&n.match(regexId),"invalid identifier","name",n),o=Object.freeze(o.slice()),defineProperties(this,{name:n})}}function joinParams(e,t){return"("+t.map((t=>t.format(e))).join("full"===e?", ":",")+")"}class ErrorFragment extends NamedFragment{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,internal,{value:ErrorFragmentInternal})}get selector(){return id(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("error"),t.push(this.name+joinParams(e,this.inputs)),t.join(" ")}static from(e){if(ErrorFragment.isFragment(e))return e;if("string"==typeof e)return ErrorFragment.from(lex(e));if(e instanceof TokenString){const t=consumeName("error",e),n=consumeParams(e);return consumeEoi(e),new ErrorFragment(_guard,t,n)}return new ErrorFragment(_guard,e.name,e.inputs?e.inputs.map(ParamType.from):[])}static isFragment(e){return e&&e[internal]===ErrorFragmentInternal}}class EventFragment extends NamedFragment{constructor(e,t,n,o){super(e,"event",t,n),__publicField2(this,"anonymous"),Object.defineProperty(this,internal,{value:EventFragmentInternal}),defineProperties(this,{anonymous:o})}get topicHash(){return id(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("event"),t.push(this.name+joinParams(e,this.inputs)),"sighash"!==e&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){t=(t||[]).map((e=>ParamType.from(e)));return new EventFragment(_guard,e,t,!1).topicHash}static from(e){if(EventFragment.isFragment(e))return e;if("string"==typeof e)try{return EventFragment.from(lex(e))}catch(t){assertArgument(!1,"invalid event fragment","obj",e)}else if(e instanceof TokenString){const t=consumeName("event",e),n=consumeParams(e,!0),o=!!consumeKeywords(e,setify(["anonymous"])).has("anonymous");return consumeEoi(e),new EventFragment(_guard,t,n,o)}return new EventFragment(_guard,e.name,e.inputs?e.inputs.map((e=>ParamType.from(e,!0))):[],!!e.anonymous)}static isFragment(e){return e&&e[internal]===EventFragmentInternal}}class ConstructorFragment extends Fragment{constructor(e,t,n,o,r){super(e,t,n),__publicField2(this,"payable"),__publicField2(this,"gas"),Object.defineProperty(this,internal,{value:ConstructorFragmentInternal}),defineProperties(this,{payable:o,gas:r})}format(e){if(assert(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[`constructor${joinParams(e,this.inputs)}`];return this.payable&&t.push("payable"),null!=this.gas&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(ConstructorFragment.isFragment(e))return e;if("string"==typeof e)try{return ConstructorFragment.from(lex(e))}catch(t){assertArgument(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof TokenString){consumeKeywords(e,setify(["constructor"]));const t=consumeParams(e),n=!!consumeKeywords(e,KwVisibDeploy).has("payable"),o=consumeGas(e);return consumeEoi(e),new ConstructorFragment(_guard,"constructor",t,n,o)}return new ConstructorFragment(_guard,"constructor",e.inputs?e.inputs.map(ParamType.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[internal]===ConstructorFragmentInternal}}class FallbackFragment extends Fragment{constructor(e,t,n){super(e,"fallback",t),__publicField2(this,"payable"),Object.defineProperty(this,internal,{value:FallbackFragmentInternal}),defineProperties(this,{payable:n})}format(e){const t=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:e})}return`${t}()${this.payable?" payable":""}`}static from(e){if(FallbackFragment.isFragment(e))return e;if("string"==typeof e)try{return FallbackFragment.from(lex(e))}catch(t){assertArgument(!1,"invalid fallback fragment","obj",e)}else if(e instanceof TokenString){const t=e.toString();assertArgument(e.peekKeyword(setify(["fallback","receive"])),"type must be fallback or receive","obj",t);if("receive"===e.popKeyword(setify(["fallback","receive"]))){const t=consumeParams(e);return assertArgument(0===t.length,"receive cannot have arguments","obj.inputs",t),consumeKeywords(e,setify(["payable"])),consumeEoi(e),new FallbackFragment(_guard,[],!0)}let n=consumeParams(e);n.length?assertArgument(1===n.length&&"bytes"===n[0].type,"invalid fallback inputs","obj.inputs",n.map((e=>e.format("minimal"))).join(", ")):n=[ParamType.from("bytes")];const o=consumeMutability(e);if(assertArgument("nonpayable"===o||"payable"===o,"fallback cannot be constants","obj.stateMutability",o),consumeKeywords(e,setify(["returns"])).has("returns")){const t=consumeParams(e);assertArgument(1===t.length&&"bytes"===t[0].type,"invalid fallback outputs","obj.outputs",t.map((e=>e.format("minimal"))).join(", "))}return consumeEoi(e),new FallbackFragment(_guard,n,"payable"===o)}if("receive"===e.type)return new FallbackFragment(_guard,[],!0);if("fallback"===e.type){const t=[ParamType.from("bytes")],n="payable"===e.stateMutability;return new FallbackFragment(_guard,t,n)}assertArgument(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[internal]===FallbackFragmentInternal}}class FunctionFragment extends NamedFragment{constructor(e,t,n,o,r,i){super(e,"function",t,o),__publicField2(this,"constant"),__publicField2(this,"outputs"),__publicField2(this,"stateMutability"),__publicField2(this,"payable"),__publicField2(this,"gas"),Object.defineProperty(this,internal,{value:FunctionFragmentInternal});defineProperties(this,{constant:"view"===n||"pure"===n,gas:i,outputs:r=Object.freeze(r.slice()),payable:"payable"===n,stateMutability:n})}get selector(){return id(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("function"),t.push(this.name+joinParams(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(joinParams(e,this.outputs))),null!=this.gas&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){t=(t||[]).map((e=>ParamType.from(e)));return new FunctionFragment(_guard,e,"view",t,[],null).selector}static from(e){if(FunctionFragment.isFragment(e))return e;if("string"==typeof e)try{return FunctionFragment.from(lex(e))}catch(n){assertArgument(!1,"invalid function fragment","obj",e)}else if(e instanceof TokenString){const t=consumeName("function",e),n=consumeParams(e),o=consumeMutability(e);let r=[];consumeKeywords(e,setify(["returns"])).has("returns")&&(r=consumeParams(e));const i=consumeGas(e);return consumeEoi(e),new FunctionFragment(_guard,t,o,n,r,i)}let t=e.stateMutability;return null==t&&(t="payable","boolean"==typeof e.constant?(t="view",e.constant||(t="payable","boolean"!=typeof e.payable||e.payable||(t="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(t="nonpayable")),new FunctionFragment(_guard,e.name,t,e.inputs?e.inputs.map(ParamType.from):[],e.outputs?e.outputs.map(ParamType.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[internal]===FunctionFragmentInternal}}class StructFragment extends NamedFragment{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,internal,{value:StructFragmentInternal})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)try{return StructFragment.from(lex(e))}catch(t){assertArgument(!1,"invalid struct fragment","obj",e)}else if(e instanceof TokenString){const t=consumeName("struct",e),n=consumeParams(e);return consumeEoi(e),new StructFragment(_guard,t,n)}return new StructFragment(_guard,e.name,e.inputs?e.inputs.map(ParamType.from):[])}static isFragment(e){return e&&e[internal]===StructFragmentInternal}}const PanicReasons$1=new Map;PanicReasons$1.set(0,"GENERIC_PANIC"),PanicReasons$1.set(1,"ASSERT_FALSE"),PanicReasons$1.set(17,"OVERFLOW"),PanicReasons$1.set(18,"DIVIDE_BY_ZERO"),PanicReasons$1.set(33,"ENUM_RANGE_ERROR"),PanicReasons$1.set(34,"BAD_STORAGE_DATA"),PanicReasons$1.set(49,"STACK_UNDERFLOW"),PanicReasons$1.set(50,"ARRAY_RANGE_ERROR"),PanicReasons$1.set(65,"OUT_OF_MEMORY"),PanicReasons$1.set(81,"UNINITIALIZED_FUNCTION_CALL");const paramTypeBytes=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);let defaultCoder=null,defaultMaxInflation=1024;function getBuiltinCallException(e,t,n,o){let r="missing revert data",i=null;let a=null;if(n){r="execution reverted";const e=getBytes(n);if(n=hexlify(n),0===e.length)r+=" (no data present; likely require(false) occurred",i="require(false)";else if(e.length%32!=4)r+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===hexlify(e.slice(0,4)))try{i=o.decode(["string"],e.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[i]},r+=`: ${JSON.stringify(i)}`}catch(c){r+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===hexlify(e.slice(0,4)))try{const t=Number(o.decode(["uint256"],e.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[t]},i=`Panic due to ${PanicReasons$1.get(t)||"UNKNOWN"}(${t})`,r+=`: ${i}`}catch(c){r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const s={to:t.to?getAddress(t.to):null,data:t.data||"0x"};return t.from&&(s.from=getAddress(t.from)),makeError(r,"CALL_EXCEPTION",{action:e,data:n,reason:i,transaction:s,invocation:null,revert:a})}const _AbiCoder=class e{constructor(){__privateAdd(this,_AbiCoder_instances)}getDefaultValue(e){const t=e.map((e=>__privateMethod(this,_AbiCoder_instances,getCoder_fn).call(this,ParamType.from(e))));return new TupleCoder(t,"_").defaultValue()}encode(e,t){assertArgumentCount(t.length,e.length,"types/values length mismatch");const n=e.map((e=>__privateMethod(this,_AbiCoder_instances,getCoder_fn).call(this,ParamType.from(e)))),o=new TupleCoder(n,"_"),r=new Writer;return o.encode(r,t),r.data}decode(e,t,n){const o=e.map((e=>__privateMethod(this,_AbiCoder_instances,getCoder_fn).call(this,ParamType.from(e))));return new TupleCoder(o,"_").decode(new Reader(t,n,defaultMaxInflation))}static _setDefaultMaxInflation(e){assertArgument("number"==typeof e&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),defaultMaxInflation=e}static defaultAbiCoder(){return null==defaultCoder&&(defaultCoder=new e),defaultCoder}static getBuiltinCallException(t,n,o){return getBuiltinCallException(t,n,o,e.defaultAbiCoder())}};_AbiCoder_instances=new WeakSet,getCoder_fn=function(e){if(e.isArray())return new ArrayCoder(__privateMethod(this,_AbiCoder_instances,getCoder_fn).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new TupleCoder(e.components.map((e=>__privateMethod(this,_AbiCoder_instances,getCoder_fn).call(this,e))),e.name);switch(e.baseType){case"address":return new AddressCoder(e.name);case"bool":return new BooleanCoder(e.name);case"string":return new StringCoder(e.name);case"bytes":return new BytesCoder(e.name);case"":return new NullCoder(e.name)}let t=e.type.match(paramTypeNumber);if(t){let n=parseInt(t[2]||"256");return assertArgument(0!==n&&n<=256&&n%8==0,"invalid "+t[1]+" bit length","param",e),new NumberCoder(n/8,"int"===t[1],e.name)}if(t=e.type.match(paramTypeBytes),t){let n=parseInt(t[1]);return assertArgument(0!==n&&n<=32,"invalid bytes length","param",e),new FixedBytesCoder(n,e.name)}assertArgument(!1,"invalid type","type",e.type)};let AbiCoder=_AbiCoder;class LogDescription{constructor(e,t,n){__publicField2(this,"fragment"),__publicField2(this,"name"),__publicField2(this,"signature"),__publicField2(this,"topic"),__publicField2(this,"args");const o=e.name,r=e.format();defineProperties(this,{fragment:e,name:o,signature:r,topic:t,args:n})}}class TransactionDescription{constructor(e,t,n,o){__publicField2(this,"fragment"),__publicField2(this,"name"),__publicField2(this,"args"),__publicField2(this,"signature"),__publicField2(this,"selector"),__publicField2(this,"value");const r=e.name,i=e.format();defineProperties(this,{fragment:e,name:r,args:n,signature:i,selector:t,value:o})}}class ErrorDescription{constructor(e,t,n){__publicField2(this,"fragment"),__publicField2(this,"name"),__publicField2(this,"args"),__publicField2(this,"signature"),__publicField2(this,"selector");const o=e.name,r=e.format();defineProperties(this,{fragment:e,name:o,args:n,signature:r,selector:t})}}class Indexed{constructor(e){__publicField2(this,"hash"),__publicField2(this,"_isIndexed"),defineProperties(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!(!e||!e._isIndexed)}}const PanicReasons={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&PanicReasons[e.toString()]&&(t=PanicReasons[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}},_Interface=class e{constructor(e){__privateAdd(this,_Interface_instances),__publicField2(this,"fragments"),__publicField2(this,"deploy"),__publicField2(this,"fallback"),__publicField2(this,"receive"),__privateAdd(this,_errors),__privateAdd(this,_events),__privateAdd(this,_functions),__privateAdd(this,_abiCoder);let t=[];t="string"==typeof e?JSON.parse(e):e,__privateSet(this,_functions,new Map),__privateSet(this,_errors,new Map),__privateSet(this,_events,new Map);const n=[];for(const a of t)try{n.push(Fragment.from(a))}catch(i){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,i.message)}defineProperties(this,{fragments:Object.freeze(n)});let o=null,r=!1;__privateSet(this,_abiCoder,this.getAbiCoder()),this.fragments.forEach(((e,t)=>{let n;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void defineProperties(this,{deploy:e});case"fallback":return void(0===e.inputs.length?r=!0:(assertArgument(!o||e.payable!==o.payable,"conflicting fallback fragments",`fragments[${t}]`,e),o=e,r=o.payable));case"function":n=__privateGet(this,_functions);break;case"event":n=__privateGet(this,_events);break;case"error":n=__privateGet(this,_errors);break;default:return}const i=e.format();n.has(i)||n.set(i,e)})),this.deploy||defineProperties(this,{deploy:ConstructorFragment.from("constructor()")}),defineProperties(this,{fallback:o,receive:r})}format(e){const t=e?"minimal":"full";return this.fragments.map((e=>e.format(t)))}formatJson(){const e=this.fragments.map((e=>e.format("json")));return JSON.stringify(e.map((e=>JSON.parse(e))))}getAbiCoder(){return AbiCoder.defaultAbiCoder()}getFunctionName(e){const t=__privateMethod(this,_Interface_instances,getFunction_fn).call(this,e,null,!1);return assertArgument(t,"no matching function","key",e),t.name}hasFunction(e){return!!__privateMethod(this,_Interface_instances,getFunction_fn).call(this,e,null,!1)}getFunction(e,t){return __privateMethod(this,_Interface_instances,getFunction_fn).call(this,e,t||null,!0)}forEachFunction(e){const t=Array.from(__privateGet(this,_functions).keys());t.sort(((e,t)=>e.localeCompare(t)));for(let n=0;n<t.length;n++){const o=t[n];e(__privateGet(this,_functions).get(o),n)}}getEventName(e){const t=__privateMethod(this,_Interface_instances,getEvent_fn).call(this,e,null,!1);return assertArgument(t,"no matching event","key",e),t.name}hasEvent(e){return!!__privateMethod(this,_Interface_instances,getEvent_fn).call(this,e,null,!1)}getEvent(e,t){return __privateMethod(this,_Interface_instances,getEvent_fn).call(this,e,t||null,!0)}forEachEvent(e){const t=Array.from(__privateGet(this,_events).keys());t.sort(((e,t)=>e.localeCompare(t)));for(let n=0;n<t.length;n++){const o=t[n];e(__privateGet(this,_events).get(o),n)}}getError(e,t){if(isHexString(e)){const t=e.toLowerCase();if(BuiltinErrors[t])return ErrorFragment.from(BuiltinErrors[t].signature);for(const e of __privateGet(this,_errors).values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const t=[];for(const[n,o]of __privateGet(this,_errors))n.split("(")[0]===e&&t.push(o);if(0===t.length)return"Error"===e?ErrorFragment.from("error Error(string)"):"Panic"===e?ErrorFragment.from("error Panic(uint256)"):null;if(t.length>1){assertArgument(!1,`ambiguous error description (i.e. ${t.map((e=>JSON.stringify(e.format()))).join(", ")})`,"name",e)}return t[0]}if("Error(string)"===(e=ErrorFragment.from(e).format()))return ErrorFragment.from("error Error(string)");if("Panic(uint256)"===e)return ErrorFragment.from("error Panic(uint256)");const n=__privateGet(this,_errors).get(e);return n||null}forEachError(e){const t=Array.from(__privateGet(this,_errors).keys());t.sort(((e,t)=>e.localeCompare(t)));for(let n=0;n<t.length;n++){const o=t[n];e(__privateGet(this,_errors).get(o),n)}}_decodeParams(e,t){return __privateGet(this,_abiCoder).decode(e,t)}_encodeParams(e,t){return __privateGet(this,_abiCoder).encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);assertArgument(t,"unknown error","fragment",e),e=t}return assertArgument(dataSlice(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,dataSlice(t,4))}encodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);assertArgument(t,"unknown error","fragment",e),e=t}return concat([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);assertArgument(t,"unknown function","fragment",e),e=t}return assertArgument(dataSlice(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,dataSlice(t,4))}encodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);assertArgument(t,"unknown function","fragment",e),e=t}return concat([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);assertArgument(t,"unknown function","fragment",e),e=t}let n="invalid length for result data";const o=getBytesCopy(t);if(o.length%32==0)try{return __privateGet(this,_abiCoder).decode(e.outputs,o)}catch(r){n="could not decode result data"}assert(!1,n,"BAD_DATA",{value:hexlify(o),info:{method:e.name,signature:e.format()}})}makeError(e,t){const n=getBytes(e,"data"),o=AbiCoder.getBuiltinCallException("call",t,n);if(o.message.startsWith("execution reverted (unknown custom error)")){const e=hexlify(n.slice(0,4)),t=this.getError(e);if(t)try{const e=__privateGet(this,_abiCoder).decode(t.inputs,n.slice(4));o.revert={name:t.name,signature:t.format(),args:e},o.reason=o.revert.signature,o.message=`execution reverted: ${o.reason}`}catch(i){o.message="execution reverted (coult not decode custom error)"}}const r=this.parseTransaction(t);return r&&(o.invocation={method:r.name,signature:r.signature,args:r.args}),o}encodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);assertArgument(t,"unknown function","fragment",e),e=t}return hexlify(__privateGet(this,_abiCoder).encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if("string"==typeof e){const t=this.getEvent(e);assertArgument(t,"unknown event","eventFragment",e),e=t}assert(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const o=(e,t)=>"string"===e.type?id(t):"bytes"===e.type?keccak256(hexlify(t)):("bool"===e.type&&"boolean"==typeof t?t=t?"0x01":"0x00":e.type.match(/^u?int/)?t=toBeHex(t):e.type.match(/^bytes/)?t=zeroPadBytes(t,32):"address"===e.type&&__privateGet(this,_abiCoder).encode(["address"],[t]),zeroPadValue(hexlify(t),32));for(t.forEach(((t,r)=>{const i=e.inputs[r];i.indexed?null==t?n.push(null):"array"===i.baseType||"tuple"===i.baseType?assertArgument(!1,"filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?n.push(t.map((e=>o(i,e)))):n.push(o(i,t)):assertArgument(null==t,"cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(e,t){if("string"==typeof e){const t=this.getEvent(e);assertArgument(t,"unknown event","eventFragment",e),e=t}const n=[],o=[],r=[];return e.anonymous||n.push(e.topicHash),assertArgument(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach(((e,i)=>{const a=t[i];if(e.indexed)if("string"===e.type)n.push(id(a));else if("bytes"===e.type)n.push(keccak256(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(__privateGet(this,_abiCoder).encode([e.type],[a]))}else o.push(e),r.push(a)})),{data:__privateGet(this,_abiCoder).encode(o,r),topics:n}}decodeEventLog(e,t,n){if("string"==typeof e){const t=this.getEvent(e);assertArgument(t,"unknown event","eventFragment",e),e=t}if(null!=n&&!e.anonymous){const t=e.topicHash;assertArgument(isHexString(n[0],32)&&n[0].toLowerCase()===t,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const o=[],r=[],i=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(o.push(ParamType.from({type:"bytes32",name:e.name})),i.push(!0)):(o.push(e),i.push(!1)):(r.push(e),i.push(!1))}));const a=null!=n?__privateGet(this,_abiCoder).decode(o,concat(n)):null,s=__privateGet(this,_abiCoder).decode(r,t,!0),c=[],l=[];let u=0,d=0;return e.inputs.forEach(((e,t)=>{let n=null;if(e.indexed)if(null==a)n=new Indexed(null);else if(i[t])n=new Indexed(a[d++]);else try{n=a[d++]}catch(o){n=o}else try{n=s[u++]}catch(o){n=o}c.push(n),l.push(e.name||null)})),Result.fromItems(c,l)}parseTransaction(e){const t=getBytes(e.data,"tx.data"),n=getBigInt(null!=e.value?e.value:0,"tx.value"),o=this.getFunction(hexlify(t.slice(0,4)));if(!o)return null;const r=__privateGet(this,_abiCoder).decode(o.inputs,t.slice(4));return new TransactionDescription(o,o.selector,r,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new LogDescription(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=hexlify(e),n=this.getError(dataSlice(t,0,4));if(!n)return null;const o=__privateGet(this,_abiCoder).decode(n.inputs,dataSlice(t,4));return new ErrorDescription(n,n.selector,o)}static from(t){return t instanceof e?t:"string"==typeof t?new e(JSON.parse(t)):"function"==typeof t.formatJson?new e(t.formatJson()):"function"==typeof t.format?new e(t.format("json")):new e(t)}};_errors=new WeakMap,_events=new WeakMap,_functions=new WeakMap,_abiCoder=new WeakMap,_Interface_instances=new WeakSet,getFunction_fn=function(e,t,n){if(isHexString(e)){const t=e.toLowerCase();for(const e of __privateGet(this,_functions).values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const o=[];for(const[t,n]of __privateGet(this,_functions))t.split("(")[0]===e&&o.push(n);if(t){const e=t.length>0?t[t.length-1]:null;let n=t.length,r=!0;Typed.isTyped(e)&&"overrides"===e.type&&(r=!1,n--);for(let t=o.length-1;t>=0;t--){const e=o[t].inputs.length;e===n||r&&e===n-1||o.splice(t,1)}for(let i=o.length-1;i>=0;i--){const e=o[i].inputs;for(let n=0;n<t.length;n++)if(Typed.isTyped(t[n])){if(n>=e.length){if("overrides"===t[n].type)continue;o.splice(i,1);break}if(t[n].type!==e[n].baseType){o.splice(i,1);break}}}}if(1===o.length&&t&&t.length!==o[0].inputs.length){const e=t[t.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&o.splice(0,1)}if(0===o.length)return null;if(o.length>1&&n){assertArgument(!1,`ambiguous function description (i.e. matches ${o.map((e=>JSON.stringify(e.format()))).join(", ")})`,"key",e)}return o[0]}const o=__privateGet(this,_functions).get(FunctionFragment.from(e).format());return o||null},getEvent_fn=function(e,t,n){if(isHexString(e)){const t=e.toLowerCase();for(const e of __privateGet(this,_events).values())if(t===e.topicHash)return e;return null}if(-1===e.indexOf("(")){const o=[];for(const[t,n]of __privateGet(this,_events))t.split("(")[0]===e&&o.push(n);if(t){for(let e=o.length-1;e>=0;e--)o[e].inputs.length<t.length&&o.splice(e,1);for(let e=o.length-1;e>=0;e--){const n=o[e].inputs;for(let r=0;r<t.length;r++)if(Typed.isTyped(t[r])&&t[r].type!==n[r].baseType){o.splice(e,1);break}}}if(0===o.length)return null;if(o.length>1&&n){assertArgument(!1,`ambiguous event description (i.e. matches ${o.map((e=>JSON.stringify(e.format()))).join(", ")})`,"key",e)}return o[0]}const o=__privateGet(this,_events).get(EventFragment.from(e).format());return o||null};let Interface=_Interface;class MapCache{constructor(){this.cache=new Map}get(e){return this.cache.get(e)}set(e,t){this.cache.set(e,t)}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}}class EVMBridge{constructor(e="mainnet-public",t="mirrornode.hedera.com/api/v1/contracts/call",n){this.network=e,this.mirrorNodeUrl=t,this.cache=n||new MapCache,this.logger=Logger$2.getInstance({module:"EVMBridge"})}async executeCommands(e,t={}){let n={...t};const o={};for(const i of e){const e=`${i.c.contractAddress}-${i.c.abi.name}`,t=await this.cache.get(e);if(t)o[i.c.abi.name]=JSON.parse(t),Object.assign(n,o[i.c.abi.name]);else try{const t=new Interface([{...i.c.abi}]),r=t.encodeFunctionData(i.c.abi.name),a=v.fromSolidityAddress(i.c.contractAddress),s=await this.readFromMirrorNode(r,f.fromString("0.0.800"),a);if(this.logger.info(`Result for ${i.c.contractAddress}:`,s?.result),!s?.result){this.logger.warn(`Failed to get result from mirror node for ${i.c.contractAddress}`),o[i.c.abi.name]="0",Object.assign(n,o[i.c.abi.name]);continue}const c=t?.decodeFunctionResult(i.c.abi.name,s.result);let l={values:[]};c&&i.c.abi.outputs?.forEach(((e,t)=>{const n=formatValue(c[t],e.type);l.values.push(n),e.name&&(l[e.name]=n)})),await this.cache.set(e,JSON.stringify(l)),o[i.c.abi.name]=l,n[i.c.abi.name]=l}catch(r){this.logger.error(`Error executing command for ${i.c.contractAddress}:`,r),o[i.c.abi.name]="0",Object.assign(n,o[i.c.abi.name])}}return{results:o,stateData:n}}async executeCommand(e,t={}){const{results:n,stateData:o}=await this.executeCommands([e],t);return{result:n[e.c.abi.name],stateData:o}}async readFromMirrorNode(e,t,n){try{const o=n.toSolidityAddress(),r=t.toSolidityAddress(),i=await fetch(`https://${this.network}.${this.mirrorNodeUrl}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({block:"latest",data:e,estimate:!1,gas:3e5,gasPrice:1e8,from:r.startsWith("0x")?r:`0x${r}`,to:o?.startsWith("0x")?o:`0x${o}`,value:0})});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return await i.json()}catch(o){return this.logger.error("Error reading from mirror node:",o),null}}async clearCache(){await this.cache.clear()}async clearCacheForContract(e,t){await this.cache.delete(`${e}-${t}`)}setLogLevel(e){this.logger.setLogLevel(e)}}function formatValue(e,t){return null==e?"0":e._isBigNumber?e.toString():t.startsWith("uint")||t.startsWith("int")?String(e):"bool"===t?e?"true":"false":"string"===t?e:"address"===t?String(e).toLowerCase():t.endsWith("[]")?Array.isArray(e)?e.map((e=>String(e))):[]:String(e)}class PayloadSizeError extends Error{constructor(e,t){super(e),this.payloadSize=t,this.name="PayloadSizeError"}}class AccountCreationError extends Error{constructor(e){super(e),this.name="AccountCreationError"}}class TopicCreationError extends Error{constructor(e){super(e),this.name="TopicCreationError"}}class ConnectionConfirmationError extends Error{constructor(e){super(e),this.name="ConnectionConfirmationError"}}var __defProp=Object.defineProperty,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__publicField=(e,t,n)=>__defNormalProp(e,"symbol"!=typeof t?t+"":t,n);function bind$1(e,t){return function(){return e.apply(t,arguments)}}const{toString:toString$1}=Object.prototype,{getPrototypeOf:getPrototypeOf$1}=Object,kindOf$1=(e=>t=>{const n=toString$1.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest$1=e=>(e=e.toLowerCase(),t=>kindOf$1(t)===e),typeOfTest$1=e=>t=>typeof t===e,{isArray:isArray$1}=Array,isUndefined$1=typeOfTest$1("undefined");function isBuffer$1(e){return null!==e&&!isUndefined$1(e)&&null!==e.constructor&&!isUndefined$1(e.constructor)&&isFunction$1(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer$1=kindOfTest$1("ArrayBuffer");function isArrayBufferView$1(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&isArrayBuffer$1(e.buffer),t}const isString$1=typeOfTest$1("string"),isFunction$1=typeOfTest$1("function"),isNumber$1=typeOfTest$1("number"),isObject$1=e=>null!==e&&"object"==typeof e,isBoolean$1=e=>!0===e||!1===e,isPlainObject$1=e=>{if("object"!==kindOf$1(e))return!1;const t=getPrototypeOf$1(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},isDate$1=kindOfTest$1("Date"),isFile$1=kindOfTest$1("File"),isBlob$1=kindOfTest$1("Blob"),isFileList$1=kindOfTest$1("FileList"),isStream$1=e=>isObject$1(e)&&isFunction$1(e.pipe),isFormData$1=e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||isFunction$1(e.append)&&("formdata"===(t=kindOf$1(e))||"object"===t&&isFunction$1(e.toString)&&"[object FormData]"===e.toString()))},isURLSearchParams$1=kindOfTest$1("URLSearchParams"),[isReadableStream$1,isRequest$1,isResponse$1,isHeaders$1]=["ReadableStream","Request","Response","Headers"].map(kindOfTest$1),trim$1=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach$1(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,r;if("object"!=typeof e&&(e=[e]),isArray$1(e))for(o=0,r=e.length;o<r;o++)t.call(null,e[o],o,e);else{const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(o=0;o<i;o++)a=r[o],t.call(null,e[a],a,e)}}function findKey$1(e,t){t=t.toLowerCase();const n=Object.keys(e);let o,r=n.length;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const _global$1="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,isContextDefined$1=e=>!isUndefined$1(e)&&e!==_global$1;function merge$1(){const{caseless:e}=isContextDefined$1(this)&&this||{},t={},n=(n,o)=>{const r=e&&findKey$1(t,o)||o;isPlainObject$1(t[r])&&isPlainObject$1(n)?t[r]=merge$1(t[r],n):isPlainObject$1(n)?t[r]=merge$1({},n):isArray$1(n)?t[r]=n.slice():t[r]=n};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&forEach$1(arguments[o],n);return t}const extend$1=(e,t,n,{allOwnKeys:o}={})=>(forEach$1(t,((t,o)=>{n&&isFunction$1(t)?e[o]=bind$1(t,n):e[o]=t}),{allOwnKeys:o}),e),stripBOM$1=e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits$1=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject$1=(e,t,n,o)=>{let r,i,a;const s={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)a=r[i],o&&!o(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&getPrototypeOf$1(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},endsWith$1=(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return-1!==o&&o===n},toArray$1=e=>{if(!e)return null;if(isArray$1(e))return e;let t=e.length;if(!isNumber$1(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},isTypedArray$1=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&getPrototypeOf$1(Uint8Array)),forEachEntry$1=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll$1=(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm$1=kindOfTest$1("HTMLFormElement"),toCamelCase$1=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),hasOwnProperty$1=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),isRegExp$1=kindOfTest$1("RegExp"),reduceDescriptors$1=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};forEach$1(n,((n,r)=>{let i;!1!==(i=t(n,r,e))&&(o[r]=i||n)})),Object.defineProperties(e,o)},freezeMethods$1=e=>{reduceDescriptors$1(e,((t,n)=>{if(isFunction$1(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const o=e[n];isFunction$1(o)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet$1=(e,t)=>{const n={},o=e=>{e.forEach((e=>{n[e]=!0}))};return isArray$1(e)?o(e):o(String(e).split(t)),n},noop$1=()=>{},toFiniteNumber$1=(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t;function isSpecCompliantForm$1(e){return!!(e&&isFunction$1(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])}const toJSONObject$1=e=>{const t=new Array(10),n=(e,o)=>{if(isObject$1(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[o]=e;const r=isArray$1(e)?[]:{};return forEach$1(e,((e,t)=>{const i=n(e,o+1);!isUndefined$1(i)&&(r[t]=i)})),t[o]=void 0,r}}return e};return n(e,0)},isAsyncFn$1=kindOfTest$1("AsyncFunction"),isThenable$1=e=>e&&(isObject$1(e)||isFunction$1(e))&&isFunction$1(e.then)&&isFunction$1(e.catch),_setImmediate$1=(setImmediateSupported="function"==typeof setImmediate,postMessageSupported=isFunction$1(_global$1.postMessage),setImmediateSupported?setImmediate:postMessageSupported?(token=`axios@${Math.random()}`,callbacks=[],_global$1.addEventListener("message",(({source:e,data:t})=>{e===_global$1&&t===token&&callbacks.length&&callbacks.shift()()}),!1),e=>{callbacks.push(e),_global$1.postMessage(token,"*")}):e=>setTimeout(e));var setImmediateSupported,postMessageSupported,token,callbacks;const asap$1="undefined"!=typeof queueMicrotask?queueMicrotask.bind(_global$1):"undefined"!=typeof process&&process.nextTick||_setImmediate$1,utils$1$1={isArray:isArray$1,isArrayBuffer:isArrayBuffer$1,isBuffer:isBuffer$1,isFormData:isFormData$1,isArrayBufferView:isArrayBufferView$1,isString:isString$1,isNumber:isNumber$1,isBoolean:isBoolean$1,isObject:isObject$1,isPlainObject:isPlainObject$1,isReadableStream:isReadableStream$1,isRequest:isRequest$1,isResponse:isResponse$1,isHeaders:isHeaders$1,isUndefined:isUndefined$1,isDate:isDate$1,isFile:isFile$1,isBlob:isBlob$1,isRegExp:isRegExp$1,isFunction:isFunction$1,isStream:isStream$1,isURLSearchParams:isURLSearchParams$1,isTypedArray:isTypedArray$1,isFileList:isFileList$1,forEach:forEach$1,merge:merge$1,extend:extend$1,trim:trim$1,stripBOM:stripBOM$1,inherits:inherits$1,toFlatObject:toFlatObject$1,kindOf:kindOf$1,kindOfTest:kindOfTest$1,endsWith:endsWith$1,toArray:toArray$1,forEachEntry:forEachEntry$1,matchAll:matchAll$1,isHTMLForm:isHTMLForm$1,hasOwnProperty:hasOwnProperty$1,hasOwnProp:hasOwnProperty$1,reduceDescriptors:reduceDescriptors$1,freezeMethods:freezeMethods$1,toObjectSet:toObjectSet$1,toCamelCase:toCamelCase$1,noop:noop$1,toFiniteNumber:toFiniteNumber$1,findKey:findKey$1,global:_global$1,isContextDefined:isContextDefined$1,isSpecCompliantForm:isSpecCompliantForm$1,toJSONObject:toJSONObject$1,isAsyncFn:isAsyncFn$1,isThenable:isThenable$1,setImmediate:_setImmediate$1,asap:asap$1};function AxiosError$2(e,t,n,o,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r,this.status=r.status?r.status:null)}utils$1$1.inherits(AxiosError$2,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:utils$1$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1$1=AxiosError$2.prototype,descriptors$1={};["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((e=>{descriptors$1[e]={value:e}})),Object.defineProperties(AxiosError$2,descriptors$1),Object.defineProperty(prototype$1$1,"isAxiosError",{value:!0}),AxiosError$2.from=(e,t,n,o,r,i)=>{const a=Object.create(prototype$1$1);return utils$1$1.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),AxiosError$2.call(a,e.message,t,n,o,r),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const httpAdapter$1=null;function isVisitable$1(e){return utils$1$1.isPlainObject(e)||utils$1$1.isArray(e)}function removeBrackets$1(e){return utils$1$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey$1(e,t,n){return e?e.concat(t).map((function(e,t){return e=removeBrackets$1(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}function isFlatArray$1(e){return utils$1$1.isArray(e)&&!e.some(isVisitable$1)}const predicates$1=utils$1$1.toFlatObject(utils$1$1,{},null,(function(e){return/^is[A-Z]/.test(e)}));function toFormData$2(e,t,n){if(!utils$1$1.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(n=utils$1$1.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!utils$1$1.isUndefined(t[e])}))).metaTokens,r=n.visitor||l,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&utils$1$1.isSpecCompliantForm(t);if(!utils$1$1.isFunction(r))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(utils$1$1.isDate(e))return e.toISOString();if(!s&&utils$1$1.isBlob(e))throw new AxiosError$2("Blob is not supported. Use a Buffer instead.");return utils$1$1.isArrayBuffer(e)||utils$1$1.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,r){let s=e;if(e&&!r&&"object"==typeof e)if(utils$1$1.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=JSON.stringify(e);else if(utils$1$1.isArray(e)&&isFlatArray$1(e)||(utils$1$1.isFileList(e)||utils$1$1.endsWith(n,"[]"))&&(s=utils$1$1.toArray(e)))return n=removeBrackets$1(n),s.forEach((function(e,o){!utils$1$1.isUndefined(e)&&null!==e&&t.append(!0===a?renderKey$1([n],o,i):null===a?n:n+"[]",c(e))})),!1;return!!isVisitable$1(e)||(t.append(renderKey$1(r,n,i),c(e)),!1)}const u=[],d=Object.assign(predicates$1,{defaultVisitor:l,convertValue:c,isVisitable:isVisitable$1});if(!utils$1$1.isObject(e))throw new TypeError("data must be an object");return function e(n,o){if(!utils$1$1.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+o.join("."));u.push(n),utils$1$1.forEach(n,(function(n,i){!0===(!(utils$1$1.isUndefined(n)||null===n)&&r.call(t,n,utils$1$1.isString(i)?i.trim():i,o,d))&&e(n,o?o.concat(i):[i])})),u.pop()}}(e),t}function encode$1$1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function AxiosURLSearchParams$1(e,t){this._pairs=[],e&&toFormData$2(e,this,t)}const prototype$2=AxiosURLSearchParams$1.prototype;function encode$2(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL$1(e,t,n){if(!t)return e;const o=n&&n.encode||encode$2;utils$1$1.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let i;if(i=r?r(t,n):utils$1$1.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams$1(t,n).toString(o),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}prototype$2.append=function(e,t){this._pairs.push([e,t])},prototype$2.toString=function(e){const t=e?function(t){return e.call(this,t,encode$1$1)}:encode$1$1;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};let InterceptorManager$1=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,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){utils$1$1.forEach(this.handlers,(function(t){null!==t&&e(t)}))}};const transitionalDefaults$1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1$1="undefined"!=typeof URLSearchParams?URLSearchParams:AxiosURLSearchParams$1,FormData$1$1="undefined"!=typeof FormData?FormData:null,Blob$1$1="undefined"!=typeof Blob?Blob:null,platform$1$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1$1,FormData:FormData$1$1,Blob:Blob$1$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv$1="undefined"!=typeof window&&"undefined"!=typeof document,_navigator$1="object"==typeof navigator&&navigator||void 0,hasStandardBrowserEnv$1=hasBrowserEnv$1&&(!_navigator$1||["ReactNative","NativeScript","NS"].indexOf(_navigator$1.product)<0),hasStandardBrowserWebWorkerEnv$1="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,origin$1=hasBrowserEnv$1&&window.location.href||"http://localhost",utils$2=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:hasBrowserEnv$1,hasStandardBrowserEnv:hasStandardBrowserEnv$1,hasStandardBrowserWebWorkerEnv:hasStandardBrowserWebWorkerEnv$1,navigator:_navigator$1,origin:origin$1},Symbol.toStringTag,{value:"Module"})),platform$2={...utils$2,...platform$1$1};function toURLEncodedForm$1(e,t){return toFormData$2(e,new platform$2.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,o){return platform$2.isNode&&utils$1$1.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath$1(e){return utils$1$1.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}function arrayToObject$1(e){const t={},n=Object.keys(e);let o;const r=n.length;let i;for(o=0;o<r;o++)i=n[o],t[i]=e[i];return t}function formDataToJSON$1(e){function t(e,n,o,r){let i=e[r++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=r>=e.length;if(i=!i&&utils$1$1.isArray(o)?o.length:i,s)return utils$1$1.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!a;o[i]&&utils$1$1.isObject(o[i])||(o[i]=[]);return t(e,n,o[i],r)&&utils$1$1.isArray(o[i])&&(o[i]=arrayToObject$1(o[i])),!a}if(utils$1$1.isFormData(e)&&utils$1$1.isFunction(e.entries)){const n={};return utils$1$1.forEachEntry(e,((e,o)=>{t(parsePropPath$1(e),o,n,0)})),n}return null}function stringifySafely$1(e,t,n){if(utils$1$1.isString(e))try{return(t||JSON.parse)(e),utils$1$1.trim(e)}catch(o){if("SyntaxError"!==o.name)throw o}return(0,JSON.stringify)(e)}const defaults$1={transitional:transitionalDefaults$1,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",o=n.indexOf("application/json")>-1,r=utils$1$1.isObject(e);r&&utils$1$1.isHTMLForm(e)&&(e=new FormData(e));if(utils$1$1.isFormData(e))return o?JSON.stringify(formDataToJSON$1(e)):e;if(utils$1$1.isArrayBuffer(e)||utils$1$1.isBuffer(e)||utils$1$1.isStream(e)||utils$1$1.isFile(e)||utils$1$1.isBlob(e)||utils$1$1.isReadableStream(e))return e;if(utils$1$1.isArrayBufferView(e))return e.buffer;if(utils$1$1.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm$1(e,this.formSerializer).toString();if((i=utils$1$1.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return toFormData$2(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||o?(t.setContentType("application/json",!1),stringifySafely$1(e)):e}],transformResponse:[function(e){const t=this.transitional||defaults$1.transitional,n=t&&t.forcedJSONParsing,o="json"===this.responseType;if(utils$1$1.isResponse(e)||utils$1$1.isReadableStream(e))return e;if(e&&utils$1$1.isString(e)&&(n&&!this.responseType||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(r){if(n){if("SyntaxError"===r.name)throw AxiosError$2.from(r,AxiosError$2.ERR_BAD_RESPONSE,this,null,this.response);throw r}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform$2.classes.FormData,Blob:platform$2.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1$1.forEach(["delete","get","head","post","put","patch"],(e=>{defaults$1.headers[e]={}}));const ignoreDuplicateOf$1=utils$1$1.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"]),parseHeaders$1=e=>{const t={};let n,o,r;return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),o=e.substring(r+1).trim(),!n||t[n]&&ignoreDuplicateOf$1[n]||("set-cookie"===n?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)})),t},$internals$1=Symbol("internals");function normalizeHeader$1(e){return e&&String(e).trim().toLowerCase()}function normalizeValue$1(e){return!1===e||null==e?e:utils$1$1.isArray(e)?e.map(normalizeValue$1):String(e)}function parseTokens$1(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}const isValidHeaderName$1=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function matchHeaderValue$1(e,t,n,o,r){return utils$1$1.isFunction(o)?o.call(this,t,n):(r&&(t=n),utils$1$1.isString(t)?utils$1$1.isString(o)?-1!==t.indexOf(o):utils$1$1.isRegExp(o)?o.test(t):void 0:void 0)}function formatHeader$1(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}function buildAccessors$1(e,t){const n=utils$1$1.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+n,{value:function(e,n,r){return this[o].call(this,t,e,n,r)},configurable:!0})}))}let AxiosHeaders$2=class{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function r(e,t,n){const r=normalizeHeader$1(t);if(!r)throw new Error("header name must be a non-empty string");const i=utils$1$1.findKey(o,r);(!i||void 0===o[i]||!0===n||void 0===n&&!1!==o[i])&&(o[i||t]=normalizeValue$1(e))}const i=(e,t)=>utils$1$1.forEach(e,((e,n)=>r(e,n,t)));if(utils$1$1.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(utils$1$1.isString(e)&&(e=e.trim())&&!isValidHeaderName$1(e))i(parseHeaders$1(e),t);else if(utils$1$1.isHeaders(e))for(const[a,s]of e.entries())r(s,a,n);else null!=e&&r(t,e,n);return this}get(e,t){if(e=normalizeHeader$1(e)){const n=utils$1$1.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return parseTokens$1(e);if(utils$1$1.isFunction(t))return t.call(this,e,n);if(utils$1$1.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=normalizeHeader$1(e)){const n=utils$1$1.findKey(this,e);return!(!n||void 0===this[n]||t&&!matchHeaderValue$1(this,this[n],n,t))}return!1}delete(e,t){const n=this;let o=!1;function r(e){if(e=normalizeHeader$1(e)){const r=utils$1$1.findKey(n,e);!r||t&&!matchHeaderValue$1(n,n[r],r,t)||(delete n[r],o=!0)}}return utils$1$1.isArray(e)?e.forEach(r):r(e),o}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const r=t[n];e&&!matchHeaderValue$1(this,this[r],r,e,!0)||(delete this[r],o=!0)}return o}normalize(e){const t=this,n={};return utils$1$1.forEach(this,((o,r)=>{const i=utils$1$1.findKey(n,r);if(i)return t[i]=normalizeValue$1(o),void delete t[r];const a=e?formatHeader$1(r):String(r).trim();a!==r&&delete t[r],t[a]=normalizeValue$1(o),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return utils$1$1.forEach(this,((n,o)=>{null!=n&&!1!==n&&(t[o]=e&&utils$1$1.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("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[$internals$1]=this[$internals$1]={accessors:{}}).accessors,n=this.prototype;function o(e){const o=normalizeHeader$1(e);t[o]||(buildAccessors$1(n,e),t[o]=!0)}return utils$1$1.isArray(e)?e.forEach(o):o(e),this}};function transformData$1(e,t){const n=this||defaults$1,o=t||n,r=AxiosHeaders$2.from(o.headers);let i=o.data;return utils$1$1.forEach(e,(function(e){i=e.call(n,i,r.normalize(),t?t.status:void 0)})),r.normalize(),i}function isCancel$2(e){return!(!e||!e.__CANCEL__)}function CanceledError$2(e,t,n){AxiosError$2.call(this,null==e?"canceled":e,AxiosError$2.ERR_CANCELED,t,n),this.name="CanceledError"}function settle$1(e,t,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new AxiosError$2("Request failed with status code "+n.status,[AxiosError$2.ERR_BAD_REQUEST,AxiosError$2.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}function parseProtocol$1(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer$1(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),l=o[a];r||(r=c),n[i]=s,o[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-r<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}function throttle$1(e,t){let n,o,r=0,i=1e3/t;const a=(t,i=Date.now())=>{r=i,n=null,o&&(clearTimeout(o),o=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),s=t-r;s>=i?a(e,t):(n=e,o||(o=setTimeout((()=>{o=null,a(n)}),i-s)))},()=>n&&a(n)]}AxiosHeaders$2.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1$1.reduceDescriptors(AxiosHeaders$2.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),utils$1$1.freezeMethods(AxiosHeaders$2),utils$1$1.inherits(CanceledError$2,AxiosError$2,{__CANCEL__:!0});const progressEventReducer$1=(e,t,n=3)=>{let o=0;const r=speedometer$1(50,250);return throttle$1((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-o,c=r(s);o=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},progressEventDecorator$1=(e,t)=>{const n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},asyncDecorator$1=e=>(...t)=>utils$1$1.asap((()=>e(...t))),isURLSameOrigin$1=platform$2.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,platform$2.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(platform$2.origin),platform$2.navigator&&/(msie|trident)/i.test(platform$2.navigator.userAgent)):()=>!0,cookies$1=platform$2.hasStandardBrowserEnv?{write(e,t,n,o,r,i){const a=[e+"="+encodeURIComponent(t)];utils$1$1.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),utils$1$1.isString(o)&&a.push("path="+o),utils$1$1.isString(r)&&a.push("domain="+r),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function isAbsoluteURL$1(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs$1(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath$1(e,t,n){let o=!isAbsoluteURL$1(t);return e&&(o||0==n)?combineURLs$1(e,t):t}const headersToObject$1=e=>e instanceof AxiosHeaders$2?{...e}:e;function mergeConfig$2(e,t){t=t||{};const n={};function o(e,t,n,o){return utils$1$1.isPlainObject(e)&&utils$1$1.isPlainObject(t)?utils$1$1.merge.call({caseless:o},e,t):utils$1$1.isPlainObject(t)?utils$1$1.merge({},t):utils$1$1.isArray(t)?t.slice():t}function r(e,t,n,r){return utils$1$1.isUndefined(t)?utils$1$1.isUndefined(e)?void 0:o(void 0,e,0,r):o(e,t,0,r)}function i(e,t){if(!utils$1$1.isUndefined(t))return o(void 0,t)}function a(e,t){return utils$1$1.isUndefined(t)?utils$1$1.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function s(n,r,i){return i in t?o(n,r):i in e?o(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>r(headersToObject$1(e),headersToObject$1(t),0,!0)};return utils$1$1.forEach(Object.keys(Object.assign({},e,t)),(function(o){const i=c[o]||r,a=i(e[o],t[o],o);utils$1$1.isUndefined(a)&&i!==s||(n[o]=a)})),n}const resolveConfig$1=e=>{const t=mergeConfig$2({},e);let n,{data:o,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=t;if(t.headers=s=AxiosHeaders$2.from(s),t.url=buildURL$1(buildFullPath$1(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),utils$1$1.isFormData(o))if(platform$2.hasStandardBrowserEnv||platform$2.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(platform$2.hasStandardBrowserEnv&&(r&&utils$1$1.isFunction(r)&&(r=r(t)),r||!1!==r&&isURLSameOrigin$1(t.url))){const e=i&&a&&cookies$1.read(a);e&&s.set(i,e)}return t},isXHRAdapterSupported$1="undefined"!=typeof XMLHttpRequest,xhrAdapter$1=isXHRAdapterSupported$1&&function(e){return new Promise((function(t,n){const o=resolveConfig$1(e);let r=o.data;const i=AxiosHeaders$2.from(o.headers).normalize();let a,s,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=o;function h(){l&&l(),u&&u(),o.cancelToken&&o.cancelToken.unsubscribe(a),o.signal&&o.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function y(){if(!m)return;const o=AxiosHeaders$2.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());settle$1((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:o,config:e,request:m}),m=null}m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(y)},m.onabort=function(){m&&(n(new AxiosError$2("Request aborted",AxiosError$2.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new AxiosError$2("Network Error",AxiosError$2.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const r=o.transitional||transitionalDefaults$1;o.timeoutErrorMessage&&(t=o.timeoutErrorMessage),n(new AxiosError$2(t,r.clarifyTimeoutError?AxiosError$2.ETIMEDOUT:AxiosError$2.ECONNABORTED,e,m)),m=null},void 0===r&&i.setContentType(null),"setRequestHeader"in m&&utils$1$1.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),utils$1$1.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),d&&"json"!==d&&(m.responseType=o.responseType),f&&([c,u]=progressEventReducer$1(f,!0),m.addEventListener("progress",c)),p&&m.upload&&([s,l]=progressEventReducer$1(p),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",l)),(o.cancelToken||o.signal)&&(a=t=>{m&&(n(!t||t.type?new CanceledError$2(null,e,m):t),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(a),o.signal&&(o.signal.aborted?a():o.signal.addEventListener("abort",a)));const g=parseProtocol$1(o.url);g&&-1===platform$2.protocols.indexOf(g)?n(new AxiosError$2("Unsupported protocol "+g+":",AxiosError$2.ERR_BAD_REQUEST,e)):m.send(r||null)}))},composeSignals$1=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,o=new AbortController;const r=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;o.abort(t instanceof AxiosError$2?t:new CanceledError$2(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,r(new AxiosError$2(`timeout ${t} of ms exceeded`,AxiosError$2.ETIMEDOUT))}),t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)})),e=null)};e.forEach((e=>e.addEventListener("abort",r)));const{signal:s}=o;return s.unsubscribe=()=>utils$1$1.asap(a),s}},streamChunk$1=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let o,r=0;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},readBytes$1=async function*(e,t){for await(const n of readStream$1(e))yield*streamChunk$1(n,t)},readStream$1=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},trackStream$1=(e,t,n,o)=>{const r=readBytes$1(e,t);let i,a=0,s=e=>{i||(i=!0,o&&o(e))};return new ReadableStream({async pull(e){try{const{done:t,value:o}=await r.next();if(t)return s(),void e.close();let i=o.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(o))}catch(t){throw s(t),t}},cancel:e=>(s(e),r.return())},{highWaterMark:2})},isFetchSupported$1="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,isReadableStreamSupported$1=isFetchSupported$1&&"function"==typeof ReadableStream,encodeText$1=isFetchSupported$1&&("function"==typeof TextEncoder?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),test$1=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},supportsRequestStream$1=isReadableStreamSupported$1&&test$1((()=>{let e=!1;const t=new Request(platform$2.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),DEFAULT_CHUNK_SIZE$1=65536,supportsResponseStream$1=isReadableStreamSupported$1&&test$1((()=>utils$1$1.isReadableStream(new Response("").body))),resolvers$1={stream:supportsResponseStream$1&&(e=>e.body)};var res;isFetchSupported$1&&(res=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!resolvers$1[e]&&(resolvers$1[e]=utils$1$1.isFunction(res[e])?t=>t[e]():(t,n)=>{throw new AxiosError$2(`Response type '${e}' is not supported`,AxiosError$2.ERR_NOT_SUPPORT,n)})})));const getBodyLength$1=async e=>{if(null==e)return 0;if(utils$1$1.isBlob(e))return e.size;if(utils$1$1.isSpecCompliantForm(e)){const t=new Request(platform$2.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return utils$1$1.isArrayBufferView(e)||utils$1$1.isArrayBuffer(e)?e.byteLength:(utils$1$1.isURLSearchParams(e)&&(e+=""),utils$1$1.isString(e)?(await encodeText$1(e)).byteLength:void 0)},resolveBodyLength$1=async(e,t)=>{const n=utils$1$1.toFiniteNumber(e.getContentLength());return null==n?getBodyLength$1(t):n},fetchAdapter$1=isFetchSupported$1&&(async e=>{let{url:t,method:n,data:o,signal:r,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:p}=resolveConfig$1(e);l=l?(l+"").toLowerCase():"text";let f,h=composeSignals$1([r,i&&i.toAbortSignal()],a);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let y;try{if(c&&supportsRequestStream$1&&"get"!==n&&"head"!==n&&0!==(y=await resolveBodyLength$1(u,o))){let e,n=new Request(t,{method:"POST",body:o,duplex:"half"});if(utils$1$1.isFormData(o)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=progressEventDecorator$1(y,progressEventReducer$1(asyncDecorator$1(c)));o=trackStream$1(n.body,DEFAULT_CHUNK_SIZE$1,e,t)}}utils$1$1.isString(d)||(d=d?"include":"omit");const r="credentials"in Request.prototype;f=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:o,duplex:"half",credentials:r?d:void 0});let i=await fetch(f);const a=supportsResponseStream$1&&("stream"===l||"response"===l);if(supportsResponseStream$1&&(s||a&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=utils$1$1.toFiniteNumber(i.headers.get("content-length")),[n,o]=s&&progressEventDecorator$1(t,progressEventReducer$1(asyncDecorator$1(s),!0))||[];i=new Response(trackStream$1(i.body,DEFAULT_CHUNK_SIZE$1,n,(()=>{o&&o(),m&&m()})),e)}l=l||"text";let g=await resolvers$1[utils$1$1.findKey(resolvers$1,l)||"text"](i,e);return!a&&m&&m(),await new Promise(((t,n)=>{settle$1(t,n,{data:g,headers:AxiosHeaders$2.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})}))}catch(g){if(m&&m(),g&&"TypeError"===g.name&&/fetch/i.test(g.message))throw Object.assign(new AxiosError$2("Network Error",AxiosError$2.ERR_NETWORK,e,f),{cause:g.cause||g});throw AxiosError$2.from(g,g&&g.code,e,f)}}),knownAdapters$1={http:httpAdapter$1,xhr:xhrAdapter$1,fetch:fetchAdapter$1};utils$1$1.forEach(knownAdapters$1,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}}));const renderReason$1=e=>`- ${e}`,isResolvedHandle$1=e=>utils$1$1.isFunction(e)||null===e||!1===e,adapters$1={getAdapter:e=>{e=utils$1$1.isArray(e)?e:[e];const{length:t}=e;let n,o;const r={};for(let i=0;i<t;i++){let t;if(n=e[i],o=n,!isResolvedHandle$1(n)&&(o=knownAdapters$1[(t=String(n)).toLowerCase()],void 0===o))throw new AxiosError$2(`Unknown adapter '${t}'`);if(o)break;r[t||"#"+i]=o}if(!o){const e=Object.entries(r).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new AxiosError$2("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(renderReason$1).join("\n"):" "+renderReason$1(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o},adapters:knownAdapters$1};function throwIfCancellationRequested$1(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError$2(null,e)}function dispatchRequest$1(e){throwIfCancellationRequested$1(e),e.headers=AxiosHeaders$2.from(e.headers),e.data=transformData$1.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return adapters$1.getAdapter(e.adapter||defaults$1.adapter)(e).then((function(t){return throwIfCancellationRequested$1(e),t.data=transformData$1.call(e,e.transformResponse,t),t.headers=AxiosHeaders$2.from(t.headers),t}),(function(t){return isCancel$2(t)||(throwIfCancellationRequested$1(e),t&&t.response&&(t.response.data=transformData$1.call(e,e.transformResponse,t.response),t.response.headers=AxiosHeaders$2.from(t.response.headers))),Promise.reject(t)}))}const VERSION$2="1.8.4",validators$1$1={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{validators$1$1[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const deprecatedWarnings$1={};function assertOptions$1(e,t,n){if("object"!=typeof e)throw new AxiosError$2("options must be an object",AxiosError$2.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const i=o[r],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new AxiosError$2("option "+i+" must be "+n,AxiosError$2.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new AxiosError$2("Unknown option "+i,AxiosError$2.ERR_BAD_OPTION)}}validators$1$1.transitional=function(e,t,n){function o(e,t){return"[Axios v"+VERSION$2+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,i)=>{if(!1===e)throw new AxiosError$2(o(r," has been removed"+(t?" in "+t:"")),AxiosError$2.ERR_DEPRECATED);return t&&!deprecatedWarnings$1[r]&&(deprecatedWarnings$1[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,i)}},validators$1$1.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const validator$1={assertOptions:assertOptions$1,validators:validators$1$1},validators$2=validator$1.validators;let Axios$2=class{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager$1,response:new InterceptorManager$1}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(o){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=mergeConfig$2(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:r}=t;void 0!==n&&validator$1.assertOptions(n,{silentJSONParsing:validators$2.transitional(validators$2.boolean),forcedJSONParsing:validators$2.transitional(validators$2.boolean),clarifyTimeoutError:validators$2.transitional(validators$2.boolean)},!1),null!=o&&(utils$1$1.isFunction(o)?t.paramsSerializer={serialize:o}:validator$1.assertOptions(o,{encode:validators$2.function,serialize:validators$2.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),validator$1.assertOptions(t,{baseUrl:validators$2.spelling("baseURL"),withXsrfToken:validators$2.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=r&&utils$1$1.merge(r.common,r[t.method]);r&&utils$1$1.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete r[e]})),t.headers=AxiosHeaders$2.concat(i,r);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!s){const e=[dispatchRequest$1.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=a.length;let p=t;for(d=0;d<u;){const e=a[d++],t=a[d++];try{p=e(p)}catch(f){t.call(this,f);break}}try{l=dispatchRequest$1.call(this,p)}catch(f){return Promise.reject(f)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return buildURL$1(buildFullPath$1((e=mergeConfig$2(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};utils$1$1.forEach(["delete","get","head","options"],(function(e){Axios$2.prototype[e]=function(t,n){return this.request(mergeConfig$2(n||{},{method:e,url:t,data:(n||{}).data}))}})),utils$1$1.forEach(["post","put","patch"],(function(e){function t(t){return function(n,o,r){return this.request(mergeConfig$2(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}Axios$2.prototype[e]=t(),Axios$2.prototype[e+"Form"]=t(!0)}));let CancelToken$2=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const o=new Promise((e=>{n.subscribe(e),t=e})).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e((function(e,o,r){n.reason||(n.reason=new CanceledError$2(e,o,r),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}};function spread$2(e){return function(t){return e.apply(null,t)}}function isAxiosError$2(e){return utils$1$1.isObject(e)&&!0===e.isAxiosError}const HttpStatusCode$2={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};function createInstance$1(e){const t=new Axios$2(e),n=bind$1(Axios$2.prototype.request,t);return utils$1$1.extend(n,Axios$2.prototype,t,{allOwnKeys:!0}),utils$1$1.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return createInstance$1(mergeConfig$2(e,t))},n}Object.entries(HttpStatusCode$2).forEach((([e,t])=>{HttpStatusCode$2[t]=e}));const axios$1=createInstance$1(defaults$1);axios$1.Axios=Axios$2,axios$1.CanceledError=CanceledError$2,axios$1.CancelToken=CancelToken$2,axios$1.isCancel=isCancel$2,axios$1.VERSION=VERSION$2,axios$1.toFormData=toFormData$2,axios$1.AxiosError=AxiosError$2,axios$1.Cancel=axios$1.CanceledError,axios$1.all=function(e){return Promise.all(e)},axios$1.spread=spread$2,axios$1.isAxiosError=isAxiosError$2,axios$1.mergeConfig=mergeConfig$2,axios$1.AxiosHeaders=AxiosHeaders$2,axios$1.formToJSON=e=>formDataToJSON$1(utils$1$1.isHTMLForm(e)?new FormData(e):e),axios$1.getAdapter=adapters$1.getAdapter,axios$1.HttpStatusCode=HttpStatusCode$2,axios$1.default=axios$1;const _Logger=class e{constructor(){__publicField(this,"isProduction"),this.isProduction="production"===process.env.NODE_ENV}static getInstance(){return e.instance||(e.instance=new e),e.instance}debug(e,...t){this.isProduction||console.debug(e,...t)}info(e,...t){this.isProduction||console.info(e,...t)}warn(e,...t){console.warn(e,...t)}error(e,...t){console.error(e,...t)}};__publicField(_Logger,"instance");let Logger=_Logger;class ValidationError extends Error{constructor(e){super(e),this.name="ValidationError"}}class Auth{constructor(e){__publicField(this,"accountId"),__publicField(this,"privateKey"),__publicField(this,"baseUrl"),__publicField(this,"network"),this.accountId=e.accountId,this.privateKey=y$2.fromStringED25519(e.privateKey),this.network=e.network||"mainnet",this.baseUrl=e.baseUrl||"https://kiloscribe.com"}async authenticate(){var e,t,n;const o=await axios$1.get(`${this.baseUrl}/api/auth/request-signature`,{headers:{"x-session":this.accountId}});if(!(null==(e=o.data)?void 0:e.message))throw new Error("Failed to get signature message");const r=o.data.message,i=await this.signMessage(r),a=await axios$1.post(`${this.baseUrl}/api/auth/authenticate`,{authData:{id:this.accountId,signature:i,data:r,network:this.network},include:"apiKey"});if(!(null==(n=null==(t=a.data)?void 0:t.user)?void 0:n.sessionToken))throw new Error("Authentication failed");return{apiKey:a.data.apiKey}}async signMessage(e){const t=(new TextEncoder).encode(e),n=await this.privateKey.sign(t);return Buffer.from(n).toString("hex")}}class ClientAuth{constructor(e){__publicField(this,"accountId"),__publicField(this,"signer"),__publicField(this,"baseUrl"),__publicField(this,"network"),__publicField(this,"logger"),this.accountId=e.accountId,this.signer=e.signer,this.network=e.network||"mainnet",this.baseUrl=e.baseUrl||"https://kiloscribe.com",this.logger=e.logger}async authenticate(){var e,t,n;const o=await axios$1.get(`${this.baseUrl}/api/auth/request-signature`,{headers:{"x-session":this.accountId}});if(!(null==(e=o.data)?void 0:e.message))throw new Error("Failed to get signature message");const r=o.data.message,i=await this.signMessage(JSON.stringify(r)),a=await axios$1.post(`${this.baseUrl}/api/auth/authenticate`,{authData:{id:this.accountId,signature:i,data:r,network:this.network},include:"apiKey"});if(!(null==(n=null==(t=a.data)?void 0:t.user)?void 0:n.sessionToken))throw new Error("Authentication failed");return{apiKey:a.data.apiKey}}async signMessage(e){try{const t=(new TextEncoder).encode(e);this.logger.debug("signing message");const n=await this.signer.sign([t],{encoding:"utf-8"});return Buffer.from(null==n?void 0:n[0].signature).toString("hex")}catch(t){throw this.logger.error("Failed to sign message",t),new Error("Failed to sign message")}}}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function dv(e){return new DataView(e.buffer,e.byteOffset)}const UINT8={len:1,get:(e,t)=>dv(e).getUint8(t),put:(e,t,n)=>(dv(e).setUint8(t,n),t+1)},UINT16_LE={len:2,get:(e,t)=>dv(e).getUint16(t,!0),put:(e,t,n)=>(dv(e).setUint16(t,n,!0),t+2)},UINT16_BE={len:2,get:(e,t)=>dv(e).getUint16(t),put:(e,t,n)=>(dv(e).setUint16(t,n),t+2)},UINT32_LE={len:4,get:(e,t)=>dv(e).getUint32(t,!0),put:(e,t,n)=>(dv(e).setUint32(t,n,!0),t+4)},UINT32_BE={len:4,get:(e,t)=>dv(e).getUint32(t),put:(e,t,n)=>(dv(e).setUint32(t,n),t+4)},INT32_BE={len:4,get:(e,t)=>dv(e).getInt32(t),put:(e,t,n)=>(dv(e).setInt32(t,n),t+4)},UINT64_LE={len:8,get:(e,t)=>dv(e).getBigUint64(t,!0),put:(e,t,n)=>(dv(e).setBigUint64(t,n,!0),t+8)};class StringType{constructor(e,t){this.len=e,this.encoding=t,this.textDecoder=new TextDecoder(t)}get(e,t){return this.textDecoder.decode(e.subarray(t,t+this.len))}}const defaultMessages="End-Of-Stream";class EndOfStreamError extends Error{constructor(){super(defaultMessages),this.name="EndOfStreamError"}}class AbortError extends Error{constructor(e="The operation was aborted"){super(e),this.name="AbortError"}}class AbstractStreamReader{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,t=!1){const n=await this.read(e,t);return this.peekQueue.push(e.subarray(0,n)),n}async read(e,t=!1){if(0===e.length)return 0;let n=this.readFromPeekBuffer(e);if(this.endOfStream||(n+=await this.readRemainderFromStream(e.subarray(n),t)),0===n)throw new EndOfStreamError;return n}readFromPeekBuffer(e){let t=e.length,n=0;for(;this.peekQueue.length>0&&t>0;){const o=this.peekQueue.pop();if(!o)throw new Error("peekData should be defined");const r=Math.min(o.length,t);e.set(o.subarray(0,r),n),n+=r,t-=r,r<o.length&&this.peekQueue.push(o.subarray(r))}return n}async readRemainderFromStream(e,t){let n=0;for(;n<e.length&&!this.endOfStream;){if(this.interrupted)throw new AbortError;const o=await this.readFromStream(e.subarray(n),t);if(0===o)break;n+=o}if(!t&&n<e.length)throw new EndOfStreamError;return n}}class WebStreamReader extends AbstractStreamReader{constructor(e){super(),this.reader=e}async abort(){return this.close()}async close(){this.reader.releaseLock()}}class WebStreamByobReader extends WebStreamReader{async readFromStream(e,t){if(0===e.length)return 0;const n=await this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length});return n.done&&(this.endOfStream=n.done),n.value?(e.set(n.value),n.value.length):0}}class WebStreamDefaultReader extends AbstractStreamReader{constructor(e){super(),this.reader=e,this.buffer=null}writeChunk(e,t){const n=Math.min(t.length,e.length);return e.set(t.subarray(0,n)),n<t.length?this.buffer=t.subarray(n):this.buffer=null,n}async readFromStream(e,t){if(0===e.length)return 0;let n=0;for(this.buffer&&(n+=this.writeChunk(e,this.buffer));n<e.length&&!this.endOfStream;){const t=await this.reader.read();if(t.done){this.endOfStream=!0;break}t.value&&(n+=this.writeChunk(e.subarray(n),t.value))}if(0===n&&this.endOfStream)throw new EndOfStreamError;return n}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}function makeWebStreamReader(e){try{const t=e.getReader({mode:"byob"});return t instanceof ReadableStreamDefaultReader?new WebStreamDefaultReader(t):new WebStreamByobReader(t)}catch(t){if(t instanceof TypeError)return new WebStreamDefaultReader(e.getReader());throw t}}class AbstractTokenizer{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=null==e?void 0:e.onClose,(null==e?void 0:e.abortSignal)&&e.abortSignal.addEventListener("abort",(()=>{this.abort()}))}async readToken(e,t=this.position){const n=new Uint8Array(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new EndOfStreamError;return e.get(n,0)}async peekToken(e,t=this.position){const n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new EndOfStreamError;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){var e;await this.abort(),await(null==(e=this.onClose)?void 0:e.call(this))}normalizeOptions(e,t){if(!this.supportsRandomAccess()&&t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:e.length,position:this.position,...t}}abort(){return Promise.resolve()}}const maxBufferSize=256e3;class ReadStreamTokenizer extends AbstractTokenizer{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=(null==t?void 0:t.fileInfo)??{}}async readBuffer(e,t){const n=this.normalizeOptions(e,t),o=n.position-this.position;if(o>0)return await this.ignore(o),this.readBuffer(e,t);if(o<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===n.length)return 0;const r=await this.streamReader.read(e.subarray(0,n.length),n.mayBeLess);if(this.position+=r,(!t||!t.mayBeLess)&&r<n.length)throw new EndOfStreamError;return r}async peekBuffer(e,t){const n=this.normalizeOptions(e,t);let o=0;if(n.position){const t=n.position-this.position;if(t>0){const r=new Uint8Array(n.length+t);return o=await this.peekBuffer(r,{mayBeLess:n.mayBeLess}),e.set(r.subarray(t)),o-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(n.length>0){try{o=await this.streamReader.peek(e.subarray(0,n.length),n.mayBeLess)}catch(r){if((null==t?void 0:t.mayBeLess)&&r instanceof EndOfStreamError)return 0;throw r}if(!n.mayBeLess&&o<n.length)throw new EndOfStreamError}return o}async ignore(e){const t=Math.min(maxBufferSize,e),n=new Uint8Array(t);let o=0;for(;o<e;){const r=e-o,i=await this.readBuffer(n,{length:Math.min(t,r)});if(i<0)return i;o+=i}return o}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}}class BufferTokenizer extends AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...(null==t?void 0:t.fileInfo)??{},size:e.length}}async readBuffer(e,t){(null==t?void 0:t.position)&&(this.position=t.position);const n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){const n=this.normalizeOptions(e,t),o=Math.min(this.uint8Array.length-n.position,n.length);if(!n.mayBeLess&&o<n.length)throw new EndOfStreamError;return e.set(this.uint8Array.subarray(n.position,n.position+o)),o}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}function fromWebStream(e,t){const n=makeWebStreamReader(e),o=t??{},r=o.onClose;return o.onClose=async()=>{if(await n.close(),r)return r()},new ReadStreamTokenizer(n,o)}function fromBuffer(e,t){return new BufferTokenizer(e,t)}var u8=Uint8Array,u16=Uint16Array,i32=Int32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(e,t){for(var n=new u16(31),o=0;o<31;++o)n[o]=t+=1<<e[o-1];var r=new i32(n[30]);for(o=1;o<30;++o)for(var i=n[o];i<n[o+1];++i)r[i]=i-n[o]<<5|o;return{b:n,r:r}},_a=freb(fleb,2),fl=_a.b,revfl=_a.r;fl[28]=258,revfl[258]=28;for(var _b=freb(fdeb,0),fd=_b.b,rev=new u16(32768),i=0;i<32768;++i){var x=(43690&i)>>1|(21845&i)<<1;x=(52428&x)>>2|(13107&x)<<2,x=(61680&x)>>4|(3855&x)<<4,rev[i]=((65280&x)>>8|(255&x)<<8)>>1}for(var hMap=function(e,t,n){for(var o=e.length,r=0,i=new u16(t);r<o;++r)e[r]&&++i[e[r]-1];var a,s=new u16(t);for(r=1;r<t;++r)s[r]=s[r-1]+i[r-1]<<1;a=new u16(1<<t);var c=15-t;for(r=0;r<o;++r)if(e[r])for(var l=r<<4|e[r],u=t-e[r],d=s[e[r]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)a[rev[d]>>c]=l;return a},flt=new u8(288),i=0;i<144;++i)flt[i]=8;for(var i=144;i<256;++i)flt[i]=9;for(var i=256;i<280;++i)flt[i]=7;for(var i=280;i<288;++i)flt[i]=8;for(var fdt=new u8(32),i=0;i<32;++i)fdt[i]=5;var flrm=hMap(flt,9),fdrm=hMap(fdt,5),max=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},bits=function(e,t,n){var o=t/8|0;return(e[o]|e[o+1]<<8)>>(7&t)&n},bits16=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},shft=function(e){return(e+7)/8|0},slc=function(e,t,n){return(null==n||n>e.length)&&(n=e.length),new u8(e.subarray(t,n))},ec=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err=function(e,t,n){var o=new Error(t||ec[e]);if(o.code=e,Error.captureStackTrace&&Error.captureStackTrace(o,err),!n)throw o;return o},inflt=function(e,t,n,o){var r=e.length;if(!r||t.f&&!t.l)return n||new u8(0);var i=!n,a=i||2!=t.i,s=t.i;i&&(n=new u8(3*r));var c=function(e){var t=n.length;if(e>t){var o=new u8(Math.max(2*t,e));o.set(n),n=o}},l=t.f||0,u=t.p||0,d=t.b||0,p=t.l,f=t.d,h=t.m,m=t.n,y=8*r;do{if(!p){l=bits(e,u,1);var g=bits(e,u+1,3);if(u+=3,!g){var b=e[(x=shft(u)+4)-4]|e[x-3]<<8,k=x+b;if(k>r){s&&err(0);break}a&&c(d+b),n.set(e.subarray(x,k),d),t.b=d+=b,t.p=u=8*k,t.f=l;continue}if(1==g)p=flrm,f=fdrm,h=9,m=5;else if(2==g){var w=bits(e,u,31)+257,v=bits(e,u+10,15)+4,T=w+bits(e,u+5,31)+1;u+=14;for(var I=new u8(T),_=new u8(19),A=0;A<v;++A)_[clim[A]]=bits(e,u+3*A,7);u+=3*v;var O=max(_),E=(1<<O)-1,S=hMap(_,O);for(A=0;A<T;){var x,C=S[bits(e,u,E)];if(u+=15&C,(x=C>>4)<16)I[A++]=x;else{var N=0,P=0;for(16==x?(P=3+bits(e,u,3),u+=2,N=I[A-1]):17==x?(P=3+bits(e,u,7),u+=3):18==x&&(P=11+bits(e,u,127),u+=7);P--;)I[A++]=N}}var R=I.subarray(0,w),D=I.subarray(w);h=max(R),m=max(D),p=hMap(R,h),f=hMap(D,m)}else err(1);if(u>y){s&&err(0);break}}a&&c(d+131072);for(var B=(1<<h)-1,L=(1<<m)-1,j=u;;j=u){var $=(N=p[bits16(e,u)&B])>>4;if((u+=15&N)>y){s&&err(0);break}if(N||err(2),$<256)n[d++]=$;else{if(256==$){j=u,p=null;break}var F=$-254;if($>264){var U=fleb[A=$-257];F=bits(e,u,(1<<U)-1)+fl[A],u+=U}var M=f[bits16(e,u)&L],K=M>>4;M||err(3),u+=15&M;D=fd[K];if(K>3){U=fdeb[K];D+=bits16(e,u)&(1<<U)-1,u+=U}if(u>y){s&&err(0);break}a&&c(d+131072);var G=d+F;if(d<D){var H=0-D,V=Math.min(D,G);for(H+d<0&&err(3);d<V;++d)n[d]=o[H+d]}for(;d<G;++d)n[d]=n[d-D]}}t.l=p,t.p=j,t.b=d,t.f=l,p&&(l=1,t.m=h,t.d=f,t.n=m)}while(!l);return d!=n.length&&i?slc(n,0,d):n.subarray(0,d)},et=new u8(0),gzs=function(e){31==e[0]&&139==e[1]&&8==e[2]||err(6,"invalid gzip data");var t=e[3],n=10;4&t&&(n+=2+(e[10]|e[11]<<8));for(var o=(t>>3&1)+(t>>4&1);o>0;o-=!e[n++]);return n+(2&t)},gzl=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},zls=function(e,t){return(8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31)&&err(6,"invalid zlib data"),1==(e[1]>>5&1)&&err(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),2+(e[1]>>3&4)};function inflateSync(e,t){return inflt(e,{i:2},t,t)}function gunzipSync(e,t){var n=gzs(e);return n+8>e.length&&err(6,"invalid gzip data"),inflt(e.subarray(n,-8),{i:2},new u8(gzl(e)),t)}function unzlibSync(e,t){return inflt(e.subarray(zls(e),-4),{i:2},t,t)}function decompressSync(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?gunzipSync(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?inflateSync(e,t):unzlibSync(e,t)}var td="undefined"!=typeof TextDecoder&&new TextDecoder,tds=0;try{td.decode(et,{stream:!0}),tds=1}catch(e2){}var browser={exports:{}},ms,hasRequiredMs,common,hasRequiredCommon,hasRequiredBrowser;function requireMs(){if(hasRequiredMs)return ms;hasRequiredMs=1;var e=1e3,t=6e4,n=60*t,o=24*n,r=7*o,i=365.25*o;function a(e,t,n,o){var r=t>=1.5*n;return Math.round(e/n)+" "+o+(r?"s":"")}return ms=function(s,c){c=c||{};var l=typeof s;if("string"===l&&s.length>0)return function(a){if((a=String(a)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*r;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===l&&isFinite(s))return c.long?function(r){var i=Math.abs(r);if(i>=o)return a(r,i,o,"day");if(i>=n)return a(r,i,n,"hour");if(i>=t)return a(r,i,t,"minute");if(i>=e)return a(r,i,e,"second");return r+" ms"}(s):function(r){var i=Math.abs(r);if(i>=o)return Math.round(r/o)+"d";if(i>=n)return Math.round(r/n)+"h";if(i>=t)return Math.round(r/t)+"m";if(i>=e)return Math.round(r/e)+"s";return r+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function requireCommon(){if(hasRequiredCommon)return common;return hasRequiredCommon=1,common=function(e){function t(e){let o,r,i,a=null;function s(...e){if(!s.enabled)return;const n=s,r=Number(new Date),i=r-(o||r);n.diff=i,n.prev=o,n.curr=r,o=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((o,r)=>{if("%%"===o)return"%";a++;const i=t.formatters[r];if("function"==typeof i){const t=e[a];o=i.call(n,t),e.splice(a,1),a--}return o})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(r!==t.namespaces&&(r=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const o=t(this.namespace+(void 0===n?":":n)+e);return o.log=this.log,o}function o(e,t){let n=0,o=0,r=-1,i=0;for(;n<e.length;)if(o<t.length&&(t[o]===e[n]||"*"===t[o]))"*"===t[o]?(r=o,i=n,o++):(n++,o++);else{if(-1===r)return!1;o=r+1,i++,n=i}for(;o<t.length&&"*"===t[o];)o++;return o===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const o of n)"-"===o[0]?t.skips.push(o.slice(1)):t.names.push(o)},t.enabled=function(e){for(const n of t.skips)if(o(e,n))return!1;for(const n of t.names)if(o(e,n))return!0;return!1},t.humanize=requireMs(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}}function requireBrowser(){return hasRequiredBrowser||(hasRequiredBrowser=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let o=0,r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(o++,"%c"===e&&(r=o))})),t.splice(r,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(n){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=requireCommon()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(browser,browser.exports)),browser.exports}var browserExports=requireBrowser();const initDebug=getDefaultExportFromCjs(browserExports),Signature={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},DataDescriptor={get:e=>(UINT16_LE.get(e,6),{signature:UINT32_LE.get(e,0),compressedSize:UINT32_LE.get(e,8),uncompressedSize:UINT32_LE.get(e,12)}),len:16},LocalFileHeaderToken={get(e){const t=UINT16_LE.get(e,6);return{signature:UINT32_LE.get(e,0),minVersion:UINT16_LE.get(e,4),dataDescriptor:!!(8&t),compressedMethod:UINT16_LE.get(e,8),compressedSize:UINT32_LE.get(e,18),uncompressedSize:UINT32_LE.get(e,22),filenameLength:UINT16_LE.get(e,26),extraFieldLength:UINT16_LE.get(e,28),filename:null}},len:30},EndOfCentralDirectoryRecordToken={get:e=>({signature:UINT32_LE.get(e,0),nrOfThisDisk:UINT16_LE.get(e,4),nrOfThisDiskWithTheStart:UINT16_LE.get(e,6),nrOfEntriesOnThisDisk:UINT16_LE.get(e,8),nrOfEntriesOfSize:UINT16_LE.get(e,10),sizeOfCd:UINT32_LE.get(e,12),offsetOfStartOfCd:UINT32_LE.get(e,16),zipFileCommentLength:UINT16_LE.get(e,20)}),len:22},FileHeader={get(e){const t=UINT16_LE.get(e,8);return{signature:UINT32_LE.get(e,0),minVersion:UINT16_LE.get(e,6),dataDescriptor:!!(8&t),compressedMethod:UINT16_LE.get(e,10),compressedSize:UINT32_LE.get(e,20),uncompressedSize:UINT32_LE.get(e,24),filenameLength:UINT16_LE.get(e,28),extraFieldLength:UINT16_LE.get(e,30),fileCommentLength:UINT16_LE.get(e,32),relativeOffsetOfLocalHeader:UINT32_LE.get(e,42),filename:null}},len:46};function signatureToArray(e){const t=new Uint8Array(UINT32_LE.len);return UINT32_LE.put(t,0,e),t}const debug=initDebug("tokenizer:inflate"),syncBufferSize=262144,ddSignatureArray=signatureToArray(Signature.DataDescriptor),eocdSignatureBytes=signatureToArray(Signature.EndOfCentralDirectory);class ZipHandler{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(syncBufferSize)}async isZip(){return await this.peekSignature()===Signature.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(UINT32_LE)}async findEndOfCentralDirectoryLocator(){const e=this.tokenizer,t=Math.min(16384,e.fileInfo.size),n=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(n,{position:e.fileInfo.size-t});for(let o=n.length-4;o>=0;o--)if(n[o]===eocdSignatureBytes[0]&&n[o+1]===eocdSignatureBytes[1]&&n[o+2]===eocdSignatureBytes[2]&&n[o+3]===eocdSignatureBytes[3])return e.fileInfo.size-t+o;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess())return void debug("Cannot reading central-directory without random-read support");debug("Reading central-directory...");const e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){debug("Central-directory 32-bit signature found");const n=await this.tokenizer.readToken(EndOfCentralDirectoryRecordToken,t),o=[];this.tokenizer.setPosition(n.offsetOfStartOfCd);for(let e=0;e<n.nrOfEntriesOfSize;++e){const t=await this.tokenizer.readToken(FileHeader);if(t.signature!==Signature.CentralFileHeader)throw new Error("Expected Central-File-Header signature");t.filename=await this.tokenizer.readToken(new StringType(t.filenameLength,"utf-8")),await this.tokenizer.ignore(t.extraFieldLength),await this.tokenizer.ignore(t.fileCommentLength),o.push(t),debug(`Add central-directory file-entry: n=${e+1}/${o.length}: filename=${o[e].filename}`)}return this.tokenizer.setPosition(e),o}this.tokenizer.setPosition(e)}async unzip(e){const t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let n=!1;do{const t=await this.readLocalFileHeader();if(!t)break;const o=e(t);let r;if(n=!!o.stop,await this.tokenizer.ignore(t.extraFieldLength),t.dataDescriptor&&0===t.compressedSize){const e=[];let n=syncBufferSize;debug("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let r=-1;for(;r<0&&n===syncBufferSize;){n=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),r=indexOf$1(this.syncBuffer.subarray(0,n),ddSignatureArray);const t=r>=0?r:n;if(o.handler){const n=new Uint8Array(t);await this.tokenizer.readBuffer(n),e.push(n)}else await this.tokenizer.ignore(t)}debug(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),o.handler&&await this.inflate(t,mergeArrays(e),o.handler)}else o.handler?(debug(`Reading compressed-file-data: ${t.compressedSize} bytes`),r=new Uint8Array(t.compressedSize),await this.tokenizer.readBuffer(r),await this.inflate(t,r,o.handler)):(debug(`Ignoring compressed-file-data: ${t.compressedSize} bytes`),await this.tokenizer.ignore(t.compressedSize));if(debug(`Reading data-descriptor at pos=${this.tokenizer.position}`),t.dataDescriptor){if(134695760!==(await this.tokenizer.readToken(DataDescriptor)).signature)throw new Error("Expected data-descriptor-signature at position "+(this.tokenizer.position-DataDescriptor.len))}}while(!n)}async iterateOverCentralDirectory(e,t){for(const n of e){const e=t(n);if(e.handler){this.tokenizer.setPosition(n.relativeOffsetOfLocalHeader);const t=await this.readLocalFileHeader();if(t){await this.tokenizer.ignore(t.extraFieldLength);const o=new Uint8Array(n.compressedSize);await this.tokenizer.readBuffer(o),await this.inflate(t,o,e.handler)}}if(e.stop)break}}inflate(e,t,n){if(0===e.compressedMethod)return n(t);debug(`Decompress filename=${e.filename}, compressed-size=${t.length}`);return n(decompressSync(t))}async readLocalFileHeader(){const e=await this.tokenizer.peekToken(UINT32_LE);if(e===Signature.LocalFileHeader){const e=await this.tokenizer.readToken(LocalFileHeaderToken);return e.filename=await this.tokenizer.readToken(new StringType(e.filenameLength,"utf-8")),e}if(e===Signature.CentralFileHeader)return!1;if(3759263696===e)throw new Error("Encrypted ZIP");throw new Error("Unexpected signature")}}function indexOf$1(e,t){const n=e.length,o=t.length;if(o>n)return-1;for(let r=0;r<=n-o;r++){let n=!0;for(let i=0;i<o;i++)if(e[r+i]!==t[i]){n=!1;break}if(n)return r}return-1}function mergeArrays(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let o=0;for(const r of e)n.set(r,o),o+=r.length;return n}function getUintBE(e){const{byteLength:t}=e;return 6===t?e.getUint16(0)*2**32+e.getUint32(2):5===t?e.getUint8(0)*2**32+e.getUint32(1):4===t?e.getUint32(0):3===t?65536*e.getUint8(0)+e.getUint16(1):2===t?e.getUint16(0):1===t?e.getUint8(0):void 0}function indexOf(e,t){const n=e.length,o=t.length;if(0===o)return-1;if(o>n)return-1;const r=n-o;for(let i=0;i<=r;i++){let n=!0;for(let r=0;r<o;r++)if(e[i+r]!==t[r]){n=!1;break}if(n)return i}return-1}function includes(e,t){return-1!==indexOf(e,t)}function stringToBytes(e){return[...e].map((e=>e.charCodeAt(0)))}function tarHeaderChecksumMatches(e,t=0){const n=Number.parseInt(new StringType(6).get(e,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(n))return!1;let o=256;for(let r=t;r<t+148;r++)o+=e[r];for(let r=t+156;r<t+512;r++)o+=e[r];return n===o}new globalThis.TextDecoder("utf8"),new globalThis.TextEncoder,Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const uint32SyncSafeToken={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},extensions=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","rm"],mimeTypes$1=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/x-parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroEnabled.12","application/vnd.ms-word.document.macroEnabled.12","application/vnd.ms-word.template.macroEnabled.12","application/vnd.ms-powerpoint.template.macroEnabled.12","application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/java-archive","application/vnd.rn-realmedia"],reasonableDetectionSizeInBytes=4100;async function fileTypeFromBuffer(e){return(new FileTypeParser).fromBuffer(e)}function getFileTypeFromMimeType(e){switch(e){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:"application/vnd.oasis.opendocument.text-template"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:"application/vnd.oasis.opendocument.spreadsheet-template"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:"application/vnd.oasis.opendocument.presentation-template"};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:"application/vnd.oasis.opendocument.graphics"};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:"application/vnd.oasis.opendocument.graphics-template"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};case"application/vnd.ms-excel.sheet.macroEnabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroEnabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.template"};case"application/vnd.ms-excel.template.macroEnabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"application/vnd.ms-word.document.macroEnabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroEnabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.template"};case"application/vnd.ms-word.template.macroEnabledTemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroEnabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:"application/vnd.openxmlformats-officedocument.presentationml.template"};case"application/vnd.ms-powerpoint.template.macroEnabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroEnabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"application/vnd.ms-powerpoint.presentation.macroEnabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroEnabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"}}}function _check(e,t,n){n={offset:0,...n};for(const[o,r]of t.entries())if(n.mask){if(r!==(n.mask[o]&e[o+n.offset]))return!1}else if(r!==e[o+n.offset])return!1;return!0}class FileTypeParser{constructor(e){__publicField(this,"detectConfident",(async e=>{if(this.buffer=new Uint8Array(reasonableDetectionSizeInBytes),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.detectConfident(e);if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const n=await e.readToken(uint32SyncSafeToken);return e.position+n>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(n),this.fromTokenizer(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let o;return await new ZipHandler(e).unzip((e=>{switch(e.filename){case"META-INF/mozilla.rsa":return o={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return o={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return{async handler(e){const t=new TextDecoder("utf-8").decode(e).trim();o=getFileTypeFromMimeType(t)},stop:!0};case"[Content_Types].xml":return{async handler(e){let t=new TextDecoder("utf-8").decode(e);const n=t.indexOf('.main+xml"');if(-1===n){const e="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";t.includes(`ContentType="${e}"`)&&(o=getFileTypeFromMimeType(e))}else{t=t.slice(0,Math.max(0,n));const e=t.lastIndexOf('"'),r=t.slice(Math.max(0,e+1));o=getFileTypeFromMimeType(r)}},stop:!0};default:return/classes\d*\.dex/.test(e.filename)?(o={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})),o??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const r=new Uint8Array(8);return await e.readBuffer(r),_check(r,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:_check(r,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(r,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(r,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(r,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(r,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){try{const i=1350;if(i===await e.ignore(i)){const a=10485760,s=new Uint8Array(Math.min(a,e.fileInfo.size-i));if(await e.readBuffer(s,{mayBeLess:!0}),includes(s,(new TextEncoder).encode("AIPrivateData")))return{ext:"ai",mime:"application/postscript"}}}catch(t){if(!(t instanceof EndOfStreamError))throw t}return{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const c=await this.readTiffHeader(!1);if(c)return c}if(this.check([77,77])){const l=await this.readTiffHeader(!0);if(l)return l}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function u(){const t=await e.peekNumber(UINT8);let n=128,o=0;for(;!(t&n)&&0!==n;)++o,n>>=1;const r=new Uint8Array(o+1);return await e.readBuffer(r),r}async function d(){const e=await u(),t=await u();t[0]^=128>>t.length-1;const n=Math.min(6,t.length),o=new DataView(e.buffer),r=new DataView(t.buffer,t.length-n,n);return{id:getUintBE(o),len:getUintBE(r)}}async function p(t){for(;t>0;){const n=await d();if(17026===n.id){return(await e.readToken(new StringType(n.len))).replaceAll(/\00.*$/g,"")}await e.ignore(n.len),--t}}const f=await d();switch(await p(f.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1"))return{ext:"parquet",mime:"application/x-parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190]))return{ext:"class",mime:"application/java-vm"};if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){const h=new StringType(4,"latin1").get(this.buffer,2);if(h.match("^d*")&&h>=1e3&&h<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){await e.ignore(8);return"debian-binary"===await e.readToken(new StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}}if(this.checkString("WEBVTT")&&["\n","\r","\t"," ","\0"].some((e=>this.checkString(e,{offset:6}))))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){async function m(){return{length:await e.readToken(INT32_BE),type:await e.readToken(new StringType(4,"latin1"))}}await e.ignore(8);do{const y=await m();if(y.length<0)return;switch(y.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(y.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&96&this.buffer[8]){const g=new StringType(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(g){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return g.startsWith("3g")?g.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function b(){const t=new Uint8Array(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const k=await b();let w=k.size-24;if(_check(k.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const v=new Uint8Array(16);if(w-=await e.readBuffer(v),_check(v,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(_check(v,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(w)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10])){await e.ignore(20);switch(await e.readToken(new StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.check([0,60,0,63,0,120,0,109,0,108],{offset:2})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const T=new DataView(this.buffer.buffer).getUint32(12,!0);if(T>12&&this.buffer.length>=T+16)try{const I=(new TextDecoder).decode(this.buffer.slice(16,T+16));if(JSON.parse(I).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}return this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2])?{ext:"mxf",mime:"application/mxf"}:this.checkString("SCRM",{offset:44})?{ext:"s3m",mime:"audio/x-s3m"}:this.check([71])&&this.check([71],{offset:188})||this.check([71],{offset:4})&&this.check([71],{offset:196})?{ext:"mts",mime:"video/mp2t"}:this.check([66,79,79,75,77,79,66,73],{offset:60})?{ext:"mobi",mime:"application/x-mobipocket-ebook"}:this.check([68,73,67,77],{offset:128})?{ext:"dcm",mime:"application/dicom"}:this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70])?{ext:"lnk",mime:"application/x.ms.shortcut"}:this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0])?{ext:"alias",mime:"application/x.apple.alias"}:this.checkString("Kaydara FBX Binary \0")?{ext:"fbx",mime:"application/x.autodesk.fbx"}:this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8}))?{ext:"eot",mime:"application/vnd.ms-fontobject"}:this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29])?{ext:"indd",mime:"application/x-indesign"}:(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),tarHeaderChecksumMatches(this.buffer)?{ext:"tar",mime:"application/x-tar"}:this.check([255,254])?this.check([60,0,63,0,120,0,109,0,108,0],{offset:2})?{ext:"xml",mime:"application/xml"}:this.check([255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0],{offset:2})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:void 0:this.checkString("-----BEGIN PGP MESSAGE-----")?{ext:"pgp",mime:"application/pgp-encrypted"}:void 0)})),__publicField(this,"detectImprecise",(async e=>{if(this.buffer=new Uint8Array(reasonableDetectionSizeInBytes),await e.peekBuffer(this.buffer,{length:Math.min(8,e.fileInfo.size),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}})),this.detectors=[...(null==e?void 0:e.customDetectors)??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:null==e?void 0:e.signal}}async fromTokenizer(e){const t=e.position;for(const n of this.detectors){const o=await n.detect(e);if(o)return o;if(t!==e.position)return}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Uint8Array?e:new Uint8Array(e);if((null==t?void 0:t.length)>1)return this.fromTokenizer(fromBuffer(t,this.tokenizerOptions))}async fromBlob(e){return this.fromStream(e.stream())}async fromStream(e){const t=await fromWebStream(e,this.tokenizerOptions);try{return await this.fromTokenizer(t)}finally{await t.close()}}async toDetectionStream(e,t){const{sampleSize:n=reasonableDetectionSizeInBytes}=t;let o,r;const i=e.getReader({mode:"byob"});try{const{value:e,done:t}=await i.read(new Uint8Array(n));if(r=e,!t&&e)try{o=await this.fromBuffer(e.slice(0,n))}catch(c){if(!(c instanceof EndOfStreamError))throw c;o=void 0}r=e}finally{i.releaseLock()}const a=new TransformStream({async start(e){e.enqueue(r)},transform(e,t){t.enqueue(e)}}),s=e.pipeThrough(a);return s.fileType=o,s}check(e,t){return _check(this.buffer,e,t)}checkString(e,t){return this.check(stringToBytes(e),t)}async readTiffTag(e){const t=await this.tokenizer.readToken(e?UINT16_BE:UINT16_LE);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"}}}async readTiffIFD(e){const t=await this.tokenizer.readToken(e?UINT16_BE:UINT16_LE);for(let n=0;n<t;++n){const t=await this.readTiffTag(e);if(t)return t}}async readTiffHeader(e){const t=(e?UINT16_BE:UINT16_LE).get(this.buffer,2),n=(e?UINT32_BE:UINT32_LE).get(this.buffer,4);if(42===t){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8){const t=(e?UINT16_BE:UINT16_LE).get(this.buffer,8),n=(e?UINT16_BE:UINT16_LE).get(this.buffer,10);if(28===t&&254===n||31===t&&11===n)return{ext:"nef",mime:"image/x-nikon-nef"}}}await this.tokenizer.ignore(n);return await this.readTiffIFD(e)??{ext:"tif",mime:"image/tiff"}}if(43===t)return{ext:"tif",mime:"image/tiff"}}}new Set(extensions),new Set(mimeTypes$1);const _InscriptionSDK=class e{constructor(e){if(__publicField(this,"client"),__publicField(this,"config"),__publicField(this,"logger",Logger.getInstance()),this.config=e,!e.apiKey)throw new ValidationError("API key is required");if(!e.network)throw new ValidationError("Network is required");const t={"x-api-key":e.apiKey,"Content-Type":"application/json"};this.client=axios$1.create({baseURL:"https://v2-api.tier.bot/api",headers:t}),this.logger=Logger.getInstance()}async getFileMetadata(e){try{const t=await axios$1.get(e),n=t.headers["content-type"]||"";return{size:parseInt(t.headers["content-length"]||"0",10),mimeType:n}}catch(t){throw this.logger.error("Error fetching file metadata:",t),new ValidationError("Unable to fetch file metadata")}}getMimeType(t){const n=t.toLowerCase().split(".").pop();if(!n)throw new ValidationError("File must have an extension");const o=e.VALID_MIME_TYPES[n];if(!o)throw new ValidationError(`Unsupported file type: ${n}`);return o}validateRequest(t){if(this.logger.debug("Validating request:",t),!t.holderId||""===t.holderId.trim())throw this.logger.warn("holderId is missing or empty"),new ValidationError("holderId is required");if(!e.VALID_MODES.includes(t.mode))throw new ValidationError(`Invalid mode: ${t.mode}. Must be one of: ${e.VALID_MODES.join(", ")}`);if("hashinal"===t.mode&&!t.jsonFileURL&&!t.metadataObject)throw new ValidationError("Hashinal mode requires either jsonFileURL or metadataObject");if(t.onlyJSONCollection&&"hashinal-collection"!==t.mode)throw new ValidationError("onlyJSONCollection can only be used with hashinal-collection mode");this.validateFileInput(t.file)}normalizeMimeType(e){return"image/vnd.microsoft.icon"===e?(this.logger.debug("Normalizing MIME type from image/vnd.microsoft.icon to image/x-icon"),"image/x-icon"):e}validateMimeType(t){return!!Object.values(e.VALID_MIME_TYPES).includes(t)||"image/vnd.microsoft.icon"===t&&(this.logger.debug("Accepting alternative MIME type for ICO: image/vnd.microsoft.icon"),!0)}validateFileInput(t){if("base64"===t.type){if(!t.base64)throw new ValidationError("Base64 data is required");const n=t.base64.replace(/^data:.*?;base64,/,"");if(Math.ceil(.75*n.length)>e.MAX_BASE64_SIZE)throw new ValidationError(`File size exceeds maximum limit of ${e.MAX_BASE64_SIZE/1024/1024}MB`);const o=t.mimeType||this.getMimeType(t.fileName);if(!this.validateMimeType(o))throw new ValidationError("File must have one of the supported MIME types");"image/vnd.microsoft.icon"===t.mimeType&&(t.mimeType=this.normalizeMimeType(t.mimeType))}else if("url"===t.type&&!t.url)throw new ValidationError("URL is required")}async detectMimeTypeFromBase64(e){if(e.startsWith("data:")){const t=e.match(/^data:([^;]+);base64,/);if(t&&t.length>1)return t[1]}try{const t=e.replace(/\s/g,""),n=Buffer.from(t,"base64"),o=await fileTypeFromBuffer(n);return(null==o?void 0:o.mime)||"application/octet-stream"}catch(t){return this.logger.warn("Failed to detect MIME type from buffer"),"application/octet-stream"}}async startInscription(t){var n,o;try{this.validateRequest(t);let n=t.file.mimeType;if("url"===t.file.type){const o=await this.getFileMetadata(t.file.url);if(n=o.mimeType||n,o.size>e.MAX_URL_FILE_SIZE)throw new ValidationError(`File size exceeds maximum URL file limit of ${e.MAX_URL_FILE_SIZE/1024/1024}MB`)}else"base64"===t.file.type&&(n=await this.detectMimeTypeFromBase64(t.file.base64));if("image/vnd.microsoft.icon"===n&&(n=this.normalizeMimeType(n)),t.jsonFileURL){if("application/json"!==(await this.getFileMetadata(t.jsonFileURL)).mimeType)throw new ValidationError("JSON file must be of type application/json")}const o={holderId:t.holderId,mode:t.mode,network:this.config.network,onlyJSONCollection:t.onlyJSONCollection?1:0,creator:t.creator,description:t.description,fileStandard:t.fileStandard,metadataObject:t.metadataObject,jsonFileURL:t.jsonFileURL};let r;return r="url"===t.file.type?await this.client.post("/inscriptions/start-inscription",{...o,fileURL:t.file.url}):await this.client.post("/inscriptions/start-inscription",{...o,fileBase64:t.file.base64,fileName:t.file.fileName,fileMimeType:n||this.getMimeType(t.file.fileName)}),r.data}catch(r){if(r instanceof ValidationError)throw r;if(axios$1.isAxiosError(r))throw new Error((null==(o=null==(n=r.response)?void 0:n.data)?void 0:o.message)||"Failed to start inscription");throw r}}async executeTransaction(e,t){try{const n="mainnet"===t.network?i$1.forMainnet():i$1.forTestnet(),o=y$2.fromString(t.privateKey);n.setOperator(t.accountId,o);const r=S.fromBytes(Buffer.from(e,"base64")),i=await r.sign(o),a=await i.execute(n),s=(await a.getReceipt(n)).status.toString();if("SUCCESS"!==s)throw new Error(`Transaction failed with status: ${s}`);return a.transactionId.toString()}catch(n){throw new Error(`Failed to execute transaction: ${n instanceof Error?n.message:"Unknown error"}`)}}async executeTransactionWithSigner(e,t){try{const n=S.fromBytes(Buffer.from(e,"base64")),o=await n.executeWithSigner(t),r=(await o.getReceiptWithSigner(t)).status.toString();if("SUCCESS"!==r)throw new Error(`Transaction failed with status: ${r}`);return o.transactionId.toString()}catch(n){throw new Error(`Failed to execute transaction: ${n instanceof Error?n.message:"Unknown error"}`)}}async inscribeAndExecute(e,t){const n=await this.startInscription(e);if(!n.transactionBytes)throw this.logger.error("No transaction bytes returned from inscription request",n),new Error("No transaction bytes returned from inscription request");this.logger.info("executing transaction");const o=await this.executeTransaction(n.transactionBytes,t);return{jobId:n.tx_id,transactionId:o}}async inscribe(e,t){const n=await this.startInscription(e);if(!n.transactionBytes)throw this.logger.error("No transaction bytes returned from inscription request",n),new Error("No transaction bytes returned from inscription request");this.logger.info("executing transaction");const o=await this.executeTransactionWithSigner(n.transactionBytes,t);return{jobId:n.tx_id,transactionId:o}}async retryWithBackoff(e,t=3,n=1e3){for(let r=0;r<t;r++)try{return await e()}catch(o){if(r===t-1)throw o;const e=n*Math.pow(2,r);await new Promise((t=>setTimeout(t,e))),this.logger.debug(`Retry attempt ${r+1}/${t} after ${e}ms delay`)}throw new Error("Retry operation failed")}async retrieveInscription(e){if(!e)throw new ValidationError("Transaction ID is required");try{return await this.retryWithBackoff((async()=>{const t=(await this.client.get(`/inscriptions/retrieve-inscription?id=${e}`)).data;return{...t,jobId:t.id}}))}catch(t){throw this.logger.error("Failed to retrieve inscription:",t),t}}async getInscriptionNumbers(e={}){try{return(await this.client.get("/inscriptions/numbers",{params:e})).data}catch(t){throw this.logger.error("Failed to fetch inscription numbers:",t),t}}static async authenticate(e){return new Auth(e).authenticate()}static async createWithAuth(t){const n="client"===t.type?new ClientAuth({...t,logger:Logger.getInstance()}):new Auth(t),{apiKey:o}=await n.authenticate();return new e({apiKey:o,network:t.network||"mainnet"})}async waitForInscription(e,t=30,n=4e3,o=!1,r){var i;let a=0,s=0;const c=(n,o,i,c)=>{if(r)try{s=Math.max(s,i),r({stage:n,message:o,progressPercent:s,details:{...c,txId:e,currentAttempt:a,maxAttempts:t}})}catch(l){this.logger.warn(`Error in progress callback: ${l}`)}};for(c("confirming","Starting inscription verification",0);a<t;){c("confirming",`Verifying inscription status (attempt ${a+1}/${t})`,5,{attempt:a+1});const r=await this.retrieveInscription(e);if(r.error)throw c("verifying",`Error: ${r.error}`,100,{error:r.error}),new Error(r.error);let s=5;void 0!==r.messages&&void 0!==r.maxMessages&&r.maxMessages>0?(s=Math.min(95,5+r.messages/r.maxMessages*90),r.completed&&(s=100)):"processing"===r.status?s=10:r.completed&&(s=100),c(r.completed?"completed":"confirming",r.completed?"Inscription completed successfully":`Processing inscription (${r.status})`,s,{status:r.status,messagesProcessed:r.messages,maxMessages:r.maxMessages,messageCount:r.messages,completed:r.completed,confirmedMessages:r.confirmedMessages,result:r});const l="hashinal"===r.mode,u="6"===(null==(i=r.fileStandard)?void 0:i.toString());if(l&&r.topic_id&&r.jsonTopicId&&(!o||r.completed))return c("completed","Inscription verification complete",100,{result:r}),r;if(!l&&!u&&r.topic_id&&(!o||r.completed))return c("completed","Inscription verification complete",100,{result:r}),r;if(u&&r.topic_id&&r.jsonTopicId&&r.registryTopicId&&(!o||r.completed))return c("completed","Inscription verification complete",100,{result:r}),r;await new Promise((e=>setTimeout(e,n))),a++}throw c("verifying",`Inscription ${e} did not complete within ${t} attempts`,100,{timedOut:!0}),new Error(`Inscription ${e} did not complete within ${t} attempts`)}};__publicField(_InscriptionSDK,"VALID_MODES",["file","upload","hashinal","hashinal-collection"]),__publicField(_InscriptionSDK,"MAX_BASE64_SIZE",2097152),__publicField(_InscriptionSDK,"MAX_URL_FILE_SIZE",104857600),__publicField(_InscriptionSDK,"VALID_MIME_TYPES",{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",ico:"image/x-icon",heic:"image/heic",heif:"image/heif",bmp:"image/bmp",webp:"image/webp",tiff:"image/tiff",tif:"image/tiff",svg:"image/svg+xml",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",html:"text/html",htm:"text/html",css:"text/css",php:"application/x-httpd-php",java:"text/x-java-source",js:"application/javascript",mjs:"application/javascript",csv:"text/csv",json:"application/json",txt:"text/plain",glb:"model/gltf-binary",wav:"audio/wav",ogg:"audio/ogg",oga:"audio/ogg",flac:"audio/flac",aac:"audio/aac",m4a:"audio/mp4",avi:"video/x-msvideo",mov:"video/quicktime",mkv:"video/x-matroska",m4v:"video/mp4",mpg:"video/mpeg",mpeg:"video/mpeg",ts:"application/typescript",zip:"application/zip",rar:"application/vnd.rar",tar:"application/x-tar",gz:"application/gzip","7z":"application/x-7z-compressed",xml:"application/xml",yaml:"application/yaml",yml:"application/yaml",md:"text/markdown",markdown:"text/markdown",rtf:"application/rtf",gltf:"model/gltf+json",usdz:"model/vnd.usdz+zip",obj:"model/obj",stl:"model/stl",fbx:"application/octet-stream",ttf:"font/ttf",otf:"font/otf",woff:"font/woff",woff2:"font/woff2",eot:"application/vnd.ms-fontobject",psd:"application/vnd.adobe.photoshop",ai:"application/postscript",eps:"application/postscript",ps:"application/postscript",sqlite:"application/x-sqlite3",db:"application/x-sqlite3",apk:"application/vnd.android.package-archive",ics:"text/calendar",vcf:"text/vcard",py:"text/x-python",rb:"text/x-ruby",go:"text/x-go",rs:"text/x-rust",typescript:"application/typescript",jsx:"text/jsx",tsx:"text/tsx",sql:"application/sql",toml:"application/toml",avif:"image/avif",jxl:"image/jxl",weba:"audio/webm"});let InscriptionSDK=_InscriptionSDK;function bind(e,t){return function(){return e.apply(t,arguments)}}const{toString:toString}=Object.prototype,{getPrototypeOf:getPrototypeOf}=Object,kindOf=(e=>t=>{const n=toString.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),t=>kindOf(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray:isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(e){return null!==e&&!isUndefined(e)&&null!==e.constructor&&!isUndefined(e.constructor)&&isFunction(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&isArrayBuffer(e.buffer),t}const isString=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=e=>null!==e&&"object"==typeof e,isBoolean=e=>!0===e||!1===e,isPlainObject=e=>{if("object"!==kindOf(e))return!1;const t=getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject(e)&&isFunction(e.pipe),isFormData=e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||isFunction(e.append)&&("formdata"===(t=kindOf(e))||"object"===t&&isFunction(e.toString)&&"[object FormData]"===e.toString()))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,r;if("object"!=typeof e&&(e=[e]),isArray(e))for(o=0,r=e.length;o<r;o++)t.call(null,e[o],o,e);else{const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(o=0;o<i;o++)a=r[o],t.call(null,e[a],a,e)}}function findKey(e,t){t=t.toLowerCase();const n=Object.keys(e);let o,r=n.length;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const _global="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,isContextDefined=e=>!isUndefined(e)&&e!==_global;function merge(){const{caseless:e}=isContextDefined(this)&&this||{},t={},n=(n,o)=>{const r=e&&findKey(t,o)||o;isPlainObject(t[r])&&isPlainObject(n)?t[r]=merge(t[r],n):isPlainObject(n)?t[r]=merge({},n):isArray(n)?t[r]=n.slice():t[r]=n};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&forEach(arguments[o],n);return t}const extend=(e,t,n,{allOwnKeys:o}={})=>(forEach(t,((t,o)=>{n&&isFunction(t)?e[o]=bind(t,n):e[o]=t}),{allOwnKeys:o}),e),stripBOM=e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject=(e,t,n,o)=>{let r,i,a;const s={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)a=r[i],o&&!o(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},endsWith=(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return-1!==o&&o===n},toArray=e=>{if(!e)return null;if(isArray(e))return e;let t=e.length;if(!isNumber(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},isTypedArray=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&getPrototypeOf(Uint8Array)),forEachEntry=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll=(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),hasOwnProperty=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};forEach(n,((n,r)=>{let i;!1!==(i=t(n,r,e))&&(o[r]=i||n)})),Object.defineProperties(e,o)},freezeMethods=e=>{reduceDescriptors(e,((t,n)=>{if(isFunction(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const o=e[n];isFunction(o)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet=(e,t)=>{const n={},o=e=>{e.forEach((e=>{n[e]=!0}))};return isArray(e)?o(e):o(String(e).split(t)),n},noop=()=>{},toFiniteNumber=(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t;function isSpecCompliantForm(e){return!!(e&&isFunction(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])}const toJSONObject=e=>{const t=new Array(10),n=(e,o)=>{if(isObject(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[o]=e;const r=isArray(e)?[]:{};return forEach(e,((e,t)=>{const i=n(e,o+1);!isUndefined(i)&&(r[t]=i)})),t[o]=void 0,r}}return e};return n(e,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=e=>e&&(isObject(e)||isFunction(e))&&isFunction(e.then)&&isFunction(e.catch),_setImmediate=((e,t)=>e?setImmediate:t?((e,t)=>(_global.addEventListener("message",(({source:n,data:o})=>{n===_global&&o===e&&t.length&&t.shift()()}),!1),n=>{t.push(n),_global.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))("function"==typeof setImmediate,isFunction(_global.postMessage)),asap="undefined"!=typeof queueMicrotask?queueMicrotask.bind(_global):"undefined"!=typeof process&&process.nextTick||_setImmediate,utils$1={isArray:isArray,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString,isNumber:isNumber,isBoolean:isBoolean,isObject:isObject,isPlainObject:isPlainObject,isReadableStream:isReadableStream,isRequest:isRequest,isResponse:isResponse,isHeaders:isHeaders,isUndefined:isUndefined,isDate:isDate,isFile:isFile,isBlob:isBlob,isRegExp:isRegExp,isFunction:isFunction,isStream:isStream,isURLSearchParams:isURLSearchParams,isTypedArray:isTypedArray,isFileList:isFileList,forEach:forEach,merge:merge,extend:extend,trim:trim,stripBOM:stripBOM,inherits:inherits,toFlatObject:toFlatObject,kindOf:kindOf,kindOfTest:kindOfTest,endsWith:endsWith,toArray:toArray,forEachEntry:forEachEntry,matchAll:matchAll,isHTMLForm:isHTMLForm,hasOwnProperty:hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors:reduceDescriptors,freezeMethods:freezeMethods,toObjectSet:toObjectSet,toCamelCase:toCamelCase,noop:noop,toFiniteNumber:toFiniteNumber,findKey:findKey,global:_global,isContextDefined:isContextDefined,isSpecCompliantForm:isSpecCompliantForm,toJSONObject:toJSONObject,isAsyncFn:isAsyncFn,isThenable:isThenable,setImmediate:_setImmediate,asap:asap};function AxiosError$1(e,t,n,o,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r,this.status=r.status?r.status:null)}utils$1.inherits(AxiosError$1,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:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["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((e=>{descriptors[e]={value:e}})),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(e,t,n,o,r,i)=>{const a=Object.create(prototype$1);return utils$1.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),AxiosError$1.call(a,e.message,t,n,o,r),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const httpAdapter=null;function isVisitable(e){return utils$1.isPlainObject(e)||utils$1.isArray(e)}function removeBrackets(e){return utils$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,n){return e?e.concat(t).map((function(e,t){return e=removeBrackets(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}function isFlatArray(e){return utils$1.isArray(e)&&!e.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,(function(e){return/^is[A-Z]/.test(e)}));function toFormData$1(e,t,n){if(!utils$1.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(n=utils$1.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!utils$1.isUndefined(t[e])}))).metaTokens,r=n.visitor||l,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&utils$1.isSpecCompliantForm(t);if(!utils$1.isFunction(r))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(utils$1.isDate(e))return e.toISOString();if(!s&&utils$1.isBlob(e))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(e)||utils$1.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,r){let s=e;if(e&&!r&&"object"==typeof e)if(utils$1.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=JSON.stringify(e);else if(utils$1.isArray(e)&&isFlatArray(e)||(utils$1.isFileList(e)||utils$1.endsWith(n,"[]"))&&(s=utils$1.toArray(e)))return n=removeBrackets(n),s.forEach((function(e,o){!utils$1.isUndefined(e)&&null!==e&&t.append(!0===a?renderKey([n],o,i):null===a?n:n+"[]",c(e))})),!1;return!!isVisitable(e)||(t.append(renderKey(r,n,i),c(e)),!1)}const u=[],d=Object.assign(predicates,{defaultVisitor:l,convertValue:c,isVisitable:isVisitable});if(!utils$1.isObject(e))throw new TypeError("data must be an object");return function e(n,o){if(!utils$1.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+o.join("."));u.push(n),utils$1.forEach(n,(function(n,i){!0===(!(utils$1.isUndefined(n)||null===n)&&r.call(t,n,utils$1.isString(i)?i.trim():i,o,d))&&e(n,o?o.concat(i):[i])})),u.pop()}}(e),t}function encode$1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function AxiosURLSearchParams(e,t){this._pairs=[],e&&toFormData$1(e,this,t)}const prototype=AxiosURLSearchParams.prototype;function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,n){if(!t)return e;const o=n&&n.encode||encode;utils$1.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let i;if(i=r?r(t,n):utils$1.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,n).toString(o),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}prototype.append=function(e,t){this._pairs.push([e,t])},prototype.toString=function(e){const t=e?function(t){return e.call(this,t,encode$1)}:encode$1;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class InterceptorManager{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,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){utils$1.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1="undefined"!=typeof URLSearchParams?URLSearchParams:AxiosURLSearchParams,FormData$1="undefined"!=typeof FormData?FormData:null,Blob$1="undefined"!=typeof Blob?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv="undefined"!=typeof window&&"undefined"!=typeof document,_navigator="object"==typeof navigator&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:hasBrowserEnv,hasStandardBrowserEnv:hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv:hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin:origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(e,t){return toFormData$1(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,o){return platform.isNode&&utils$1.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath(e){return utils$1.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}function arrayToObject(e){const t={},n=Object.keys(e);let o;const r=n.length;let i;for(o=0;o<r;o++)i=n[o],t[i]=e[i];return t}function formDataToJSON(e){function t(e,n,o,r){let i=e[r++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=r>=e.length;if(i=!i&&utils$1.isArray(o)?o.length:i,s)return utils$1.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!a;o[i]&&utils$1.isObject(o[i])||(o[i]=[]);return t(e,n,o[i],r)&&utils$1.isArray(o[i])&&(o[i]=arrayToObject(o[i])),!a}if(utils$1.isFormData(e)&&utils$1.isFunction(e.entries)){const n={};return utils$1.forEachEntry(e,((e,o)=>{t(parsePropPath(e),o,n,0)})),n}return null}function stringifySafely(e,t,n){if(utils$1.isString(e))try{return(t||JSON.parse)(e),utils$1.trim(e)}catch(e2){if("SyntaxError"!==e2.name)throw e2}return(n||JSON.stringify)(e)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",o=n.indexOf("application/json")>-1,r=utils$1.isObject(e);r&&utils$1.isHTMLForm(e)&&(e=new FormData(e));if(utils$1.isFormData(e))return o?JSON.stringify(formDataToJSON(e)):e;if(utils$1.isArrayBuffer(e)||utils$1.isBuffer(e)||utils$1.isStream(e)||utils$1.isFile(e)||utils$1.isBlob(e)||utils$1.isReadableStream(e))return e;if(utils$1.isArrayBufferView(e))return e.buffer;if(utils$1.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(e,this.formSerializer).toString();if((i=utils$1.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return toFormData$1(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||o?(t.setContentType("application/json",!1),stringifySafely(e)):e}],transformResponse:[function(e){const t=this.transitional||defaults.transitional,n=t&&t.forcedJSONParsing,o="json"===this.responseType;if(utils$1.isResponse(e)||utils$1.isReadableStream(e))return e;if(e&&utils$1.isString(e)&&(n&&!this.responseType||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e2){if(n){if("SyntaxError"===e2.name)throw AxiosError$1.from(e2,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response);throw e2}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],(e=>{defaults.headers[e]={}}));const ignoreDuplicateOf=utils$1.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"]),parseHeaders=e=>{const t={};let n,o,r;return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),o=e.substring(r+1).trim(),!n||t[n]&&ignoreDuplicateOf[n]||("set-cookie"===n?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)})),t},$internals=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){return!1===e||null==e?e:utils$1.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}const isValidHeaderName=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function matchHeaderValue(e,t,n,o,r){return utils$1.isFunction(o)?o.call(this,t,n):(r&&(t=n),utils$1.isString(t)?utils$1.isString(o)?-1!==t.indexOf(o):utils$1.isRegExp(o)?o.test(t):void 0:void 0)}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}function buildAccessors(e,t){const n=utils$1.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+n,{value:function(e,n,r){return this[o].call(this,t,e,n,r)},configurable:!0})}))}let AxiosHeaders$1=class{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function r(e,t,n){const r=normalizeHeader(t);if(!r)throw new Error("header name must be a non-empty string");const i=utils$1.findKey(o,r);(!i||void 0===o[i]||!0===n||void 0===n&&!1!==o[i])&&(o[i||t]=normalizeValue(e))}const i=(e,t)=>utils$1.forEach(e,((e,n)=>r(e,n,t)));if(utils$1.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(utils$1.isString(e)&&(e=e.trim())&&!isValidHeaderName(e))i(parseHeaders(e),t);else if(utils$1.isHeaders(e))for(const[a,s]of e.entries())r(s,a,n);else null!=e&&r(t,e,n);return this}get(e,t){if(e=normalizeHeader(e)){const n=utils$1.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return parseTokens(e);if(utils$1.isFunction(t))return t.call(this,e,n);if(utils$1.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=normalizeHeader(e)){const n=utils$1.findKey(this,e);return!(!n||void 0===this[n]||t&&!matchHeaderValue(this,this[n],n,t))}return!1}delete(e,t){const n=this;let o=!1;function r(e){if(e=normalizeHeader(e)){const r=utils$1.findKey(n,e);!r||t&&!matchHeaderValue(n,n[r],r,t)||(delete n[r],o=!0)}}return utils$1.isArray(e)?e.forEach(r):r(e),o}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const r=t[n];e&&!matchHeaderValue(this,this[r],r,e,!0)||(delete this[r],o=!0)}return o}normalize(e){const t=this,n={};return utils$1.forEach(this,((o,r)=>{const i=utils$1.findKey(n,r);if(i)return t[i]=normalizeValue(o),void delete t[r];const a=e?formatHeader(r):String(r).trim();a!==r&&delete t[r],t[a]=normalizeValue(o),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return utils$1.forEach(this,((n,o)=>{null!=n&&!1!==n&&(t[o]=e&&utils$1.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("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[$internals]=this[$internals]={accessors:{}}).accessors,n=this.prototype;function o(e){const o=normalizeHeader(e);t[o]||(buildAccessors(n,e),t[o]=!0)}return utils$1.isArray(e)?e.forEach(o):o(e),this}};function transformData(e,t){const n=this||defaults,o=t||n,r=AxiosHeaders$1.from(o.headers);let i=o.data;return utils$1.forEach(e,(function(e){i=e.call(n,i,r.normalize(),t?t.status:void 0)})),r.normalize(),i}function isCancel$1(e){return!(!e||!e.__CANCEL__)}function CanceledError$1(e,t,n){AxiosError$1.call(this,null==e?"canceled":e,AxiosError$1.ERR_CANCELED,t,n),this.name="CanceledError"}function settle(e,t,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new AxiosError$1("Request failed with status code "+n.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}function parseProtocol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),l=o[a];r||(r=c),n[i]=s,o[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-r<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}function throttle(e,t){let n,o,r=0,i=1e3/t;const a=(t,i=Date.now())=>{r=i,n=null,o&&(clearTimeout(o),o=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),s=t-r;s>=i?a(e,t):(n=e,o||(o=setTimeout((()=>{o=null,a(n)}),i-s)))},()=>n&&a(n)]}AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders$1.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),utils$1.freezeMethods(AxiosHeaders$1),utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});const progressEventReducer=(e,t,n=3)=>{let o=0;const r=speedometer(50,250);return throttle((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-o,c=r(s);o=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},progressEventDecorator=(e,t)=>{const n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},asyncDecorator=e=>(...t)=>utils$1.asap((()=>e(...t))),isURLSameOrigin=platform.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,platform.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(e,t,n,o,r,i){const a=[e+"="+encodeURIComponent(t)];utils$1.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),utils$1.isString(o)&&a.push("path="+o),utils$1.isString(r)&&a.push("domain="+r),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t,n){let o=!isAbsoluteURL(t);return e&&(o||0==n)?combineURLs(e,t):t}const headersToObject=e=>e instanceof AxiosHeaders$1?{...e}:e;function mergeConfig$1(e,t){t=t||{};const n={};function o(e,t,n,o){return utils$1.isPlainObject(e)&&utils$1.isPlainObject(t)?utils$1.merge.call({caseless:o},e,t):utils$1.isPlainObject(t)?utils$1.merge({},t):utils$1.isArray(t)?t.slice():t}function r(e,t,n,r){return utils$1.isUndefined(t)?utils$1.isUndefined(e)?void 0:o(void 0,e,0,r):o(e,t,0,r)}function i(e,t){if(!utils$1.isUndefined(t))return o(void 0,t)}function a(e,t){return utils$1.isUndefined(t)?utils$1.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function s(n,r,i){return i in t?o(n,r):i in e?o(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>r(headersToObject(e),headersToObject(t),0,!0)};return utils$1.forEach(Object.keys(Object.assign({},e,t)),(function(o){const i=c[o]||r,a=i(e[o],t[o],o);utils$1.isUndefined(a)&&i!==s||(n[o]=a)})),n}const resolveConfig=e=>{const t=mergeConfig$1({},e);let n,{data:o,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=t;if(t.headers=s=AxiosHeaders$1.from(s),t.url=buildURL(buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),utils$1.isFormData(o))if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(platform.hasStandardBrowserEnv&&(r&&utils$1.isFunction(r)&&(r=r(t)),r||!1!==r&&isURLSameOrigin(t.url))){const e=i&&a&&cookies.read(a);e&&s.set(i,e)}return t},isXHRAdapterSupported="undefined"!=typeof XMLHttpRequest,xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise((function(t,n){const o=resolveConfig(e);let r=o.data;const i=AxiosHeaders$1.from(o.headers).normalize();let a,s,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=o;function h(){l&&l(),u&&u(),o.cancelToken&&o.cancelToken.unsubscribe(a),o.signal&&o.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function y(){if(!m)return;const o=AxiosHeaders$1.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());settle((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:o,config:e,request:m}),m=null}m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(y)},m.onabort=function(){m&&(n(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const r=o.transitional||transitionalDefaults;o.timeoutErrorMessage&&(t=o.timeoutErrorMessage),n(new AxiosError$1(t,r.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,e,m)),m=null},void 0===r&&i.setContentType(null),"setRequestHeader"in m&&utils$1.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),utils$1.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),d&&"json"!==d&&(m.responseType=o.responseType),f&&([c,u]=progressEventReducer(f,!0),m.addEventListener("progress",c)),p&&m.upload&&([s,l]=progressEventReducer(p),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",l)),(o.cancelToken||o.signal)&&(a=t=>{m&&(n(!t||t.type?new CanceledError$1(null,e,m):t),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(a),o.signal&&(o.signal.aborted?a():o.signal.addEventListener("abort",a)));const g=parseProtocol(o.url);g&&-1===platform.protocols.indexOf(g)?n(new AxiosError$1("Unsupported protocol "+g+":",AxiosError$1.ERR_BAD_REQUEST,e)):m.send(r||null)}))},composeSignals=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,o=new AbortController;const r=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;o.abort(t instanceof AxiosError$1?t:new CanceledError$1(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,r(new AxiosError$1(`timeout ${t} of ms exceeded`,AxiosError$1.ETIMEDOUT))}),t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)})),e=null)};e.forEach((e=>e.addEventListener("abort",r)));const{signal:s}=o;return s.unsubscribe=()=>utils$1.asap(a),s}},streamChunk=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let o,r=0;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},readBytes=async function*(e,t){for await(const n of readStream(e))yield*streamChunk(n,t)},readStream=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},trackStream=(e,t,n,o)=>{const r=readBytes(e,t);let i,a=0,s=e=>{i||(i=!0,o&&o(e))};return new ReadableStream({async pull(e){try{const{done:t,value:o}=await r.next();if(t)return s(),void e.close();let i=o.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(o))}catch(t){throw s(t),t}},cancel:e=>(s(e),r.return())},{highWaterMark:2})},isFetchSupported="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,isReadableStreamSupported=isFetchSupported&&"function"==typeof ReadableStream,encodeText=isFetchSupported&&("function"==typeof TextEncoder?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),test=(e,...t)=>{try{return!!e(...t)}catch(e2){return!1}},supportsRequestStream=isReadableStreamSupported&&test((()=>{let e=!1;const t=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),DEFAULT_CHUNK_SIZE=65536,supportsResponseStream=isReadableStreamSupported&&test((()=>utils$1.isReadableStream(new Response("").body))),resolvers={stream:supportsResponseStream&&(e=>e.body)};isFetchSupported&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!resolvers[t]&&(resolvers[t]=utils$1.isFunction(e[t])?e=>e[t]():(e,n)=>{throw new AxiosError$1(`Response type '${t}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,n)})}))})(new Response);const getBodyLength=async e=>{if(null==e)return 0;if(utils$1.isBlob(e))return e.size;if(utils$1.isSpecCompliantForm(e)){const t=new Request(platform.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return utils$1.isArrayBufferView(e)||utils$1.isArrayBuffer(e)?e.byteLength:(utils$1.isURLSearchParams(e)&&(e+=""),utils$1.isString(e)?(await encodeText(e)).byteLength:void 0)},resolveBodyLength=async(e,t)=>{const n=utils$1.toFiniteNumber(e.getContentLength());return null==n?getBodyLength(t):n},fetchAdapter=isFetchSupported&&(async e=>{let{url:t,method:n,data:o,signal:r,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:p}=resolveConfig(e);l=l?(l+"").toLowerCase():"text";let f,h=composeSignals([r,i&&i.toAbortSignal()],a);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let y;try{if(c&&supportsRequestStream&&"get"!==n&&"head"!==n&&0!==(y=await resolveBodyLength(u,o))){let e,n=new Request(t,{method:"POST",body:o,duplex:"half"});if(utils$1.isFormData(o)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=progressEventDecorator(y,progressEventReducer(asyncDecorator(c)));o=trackStream(n.body,DEFAULT_CHUNK_SIZE,e,t)}}utils$1.isString(d)||(d=d?"include":"omit");const r="credentials"in Request.prototype;f=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:o,duplex:"half",credentials:r?d:void 0});let i=await fetch(f);const a=supportsResponseStream&&("stream"===l||"response"===l);if(supportsResponseStream&&(s||a&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=utils$1.toFiniteNumber(i.headers.get("content-length")),[n,o]=s&&progressEventDecorator(t,progressEventReducer(asyncDecorator(s),!0))||[];i=new Response(trackStream(i.body,DEFAULT_CHUNK_SIZE,n,(()=>{o&&o(),m&&m()})),e)}l=l||"text";let g=await resolvers[utils$1.findKey(resolvers,l)||"text"](i,e);return!a&&m&&m(),await new Promise(((t,n)=>{settle(t,n,{data:g,headers:AxiosHeaders$1.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})}))}catch(g){if(m&&m(),g&&"TypeError"===g.name&&/fetch/i.test(g.message))throw Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,f),{cause:g.cause||g});throw AxiosError$1.from(g,g&&g.code,e,f)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e2){}Object.defineProperty(e,"adapterName",{value:t})}}));const renderReason=e=>`- ${e}`,isResolvedHandle=e=>utils$1.isFunction(e)||null===e||!1===e,adapters={getAdapter:e=>{e=utils$1.isArray(e)?e:[e];const{length:t}=e;let n,o;const r={};for(let i=0;i<t;i++){let t;if(n=e[i],o=n,!isResolvedHandle(n)&&(o=knownAdapters[(t=String(n)).toLowerCase()],void 0===o))throw new AxiosError$1(`Unknown adapter '${t}'`);if(o)break;r[t||"#"+i]=o}if(!o){const e=Object.entries(r).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new AxiosError$1("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(renderReason).join("\n"):" "+renderReason(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o},adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError$1(null,e)}function dispatchRequest(e){throwIfCancellationRequested(e),e.headers=AxiosHeaders$1.from(e.headers),e.data=transformData.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return adapters.getAdapter(e.adapter||defaults.adapter)(e).then((function(t){return throwIfCancellationRequested(e),t.data=transformData.call(e,e.transformResponse,t),t.headers=AxiosHeaders$1.from(t.headers),t}),(function(t){return isCancel$1(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=transformData.call(e,e.transformResponse,t.response),t.response.headers=AxiosHeaders$1.from(t.response.headers))),Promise.reject(t)}))}const VERSION$1="1.8.4",validators$1={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{validators$1[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const deprecatedWarnings={};function assertOptions(e,t,n){if("object"!=typeof e)throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const i=o[r],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new AxiosError$1("option "+i+" must be "+n,AxiosError$1.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new AxiosError$1("Unknown option "+i,AxiosError$1.ERR_BAD_OPTION)}}validators$1.transitional=function(e,t,n){function o(e,t){return"[Axios v"+VERSION$1+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,i)=>{if(!1===e)throw new AxiosError$1(o(r," has been removed"+(t?" in "+t:"")),AxiosError$1.ERR_DEPRECATED);return t&&!deprecatedWarnings[r]&&(deprecatedWarnings[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,i)}},validators$1.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const validator={assertOptions:assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(e2){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=mergeConfig$1(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:r}=t;void 0!==n&&validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),null!=o&&(utils$1.isFunction(o)?t.paramsSerializer={serialize:o}:validator.assertOptions(o,{encode:validators.function,serialize:validators.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),validator.assertOptions(t,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=r&&utils$1.merge(r.common,r[t.method]);r&&utils$1.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete r[e]})),t.headers=AxiosHeaders$1.concat(i,r);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!s){const e=[dispatchRequest.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=a.length;let p=t;for(d=0;d<u;){const e=a[d++],t=a[d++];try{p=e(p)}catch(f){t.call(this,f);break}}try{l=dispatchRequest.call(this,p)}catch(f){return Promise.reject(f)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return buildURL(buildFullPath((e=mergeConfig$1(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],(function(e){Axios$1.prototype[e]=function(t,n){return this.request(mergeConfig$1(n||{},{method:e,url:t,data:(n||{}).data}))}})),utils$1.forEach(["post","put","patch"],(function(e){function t(t){return function(n,o,r){return this.request(mergeConfig$1(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}Axios$1.prototype[e]=t(),Axios$1.prototype[e+"Form"]=t(!0)}));let CancelToken$1=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const o=new Promise((e=>{n.subscribe(e),t=e})).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e((function(e,o,r){n.reason||(n.reason=new CanceledError$1(e,o,r),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}};function spread$1(e){return function(t){return e.apply(null,t)}}function isAxiosError$1(e){return utils$1.isObject(e)&&!0===e.isAxiosError}const HttpStatusCode$1={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};function createInstance(e){const t=new Axios$1(e),n=bind(Axios$1.prototype.request,t);return utils$1.extend(n,Axios$1.prototype,t,{allOwnKeys:!0}),utils$1.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return createInstance(mergeConfig$1(e,t))},n}Object.entries(HttpStatusCode$1).forEach((([e,t])=>{HttpStatusCode$1[t]=e}));const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function(e){return Promise.all(e)},axios.spread=spread$1,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=e=>formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios:Axios,AxiosError:AxiosError,CanceledError:CanceledError,isCancel:isCancel,CancelToken:CancelToken,VERSION:VERSION,all:all,Cancel:Cancel,isAxiosError:isAxiosError,spread:spread,toFormData:toFormData,AxiosHeaders:AxiosHeaders,HttpStatusCode:HttpStatusCode,formToJSON:formToJSON,getAdapter:getAdapter,mergeConfig:mergeConfig}=axios;var lib={},proto={},hasRequiredProto,hasRequiredLib;function requireProto(){if(hasRequiredProto)return proto;hasRequiredProto=1,Object.defineProperty(proto,"__esModule",{value:!0}),proto.proto=proto.google=proto.default=proto.com=void 0;var e=function(e,n){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=t(n);if(o&&o.has(e))return o.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,o&&o.set(e,r),r}(requireMinimal());function t(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(t=function(e){return e?o:n})(e)}const n=e.Reader,o=e.Writer,r=e.util,i=proto.default=e.roots.hashgraph||(e.roots.hashgraph={});return proto.com=i.com=(()=>{const t={};return t.hedera=function(){const t={};return t.mirror=function(){const t={};return t.api=function(){const t={};return t.proto=function(){const t={};return t.ConsensusTopicQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.topicID=null,e.prototype.consensusStartTime=null,e.prototype.consensusEndTime=null,e.prototype.limit=r.Long?r.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&i.proto.TopicID.encode(e.topicID,t.uint32(10).fork()).ldelim(),null!=e.consensusStartTime&&Object.hasOwnProperty.call(e,"consensusStartTime")&&i.proto.Timestamp.encode(e.consensusStartTime,t.uint32(18).fork()).ldelim(),null!=e.consensusEndTime&&Object.hasOwnProperty.call(e,"consensusEndTime")&&i.proto.Timestamp.encode(e.consensusEndTime,t.uint32(26).fork()).ldelim(),null!=e.limit&&Object.hasOwnProperty.call(e,"limit")&&t.uint32(32).uint64(e.limit),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.mirror.api.proto.ConsensusTopicQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.topicID=i.proto.TopicID.decode(e,e.uint32());break;case 2:r.consensusStartTime=i.proto.Timestamp.decode(e,e.uint32());break;case 3:r.consensusEndTime=i.proto.Timestamp.decode(e,e.uint32());break;case 4:r.limit=e.uint64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.mirror.api.proto.ConsensusTopicQuery"},e}(),t.ConsensusTopicResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.consensusTimestamp=null,e.prototype.message=r.newBuffer([]),e.prototype.runningHash=r.newBuffer([]),e.prototype.sequenceNumber=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.runningHashVersion=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.chunkInfo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.consensusTimestamp&&Object.hasOwnProperty.call(e,"consensusTimestamp")&&i.proto.Timestamp.encode(e.consensusTimestamp,t.uint32(10).fork()).ldelim(),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(18).bytes(e.message),null!=e.runningHash&&Object.hasOwnProperty.call(e,"runningHash")&&t.uint32(26).bytes(e.runningHash),null!=e.sequenceNumber&&Object.hasOwnProperty.call(e,"sequenceNumber")&&t.uint32(32).uint64(e.sequenceNumber),null!=e.runningHashVersion&&Object.hasOwnProperty.call(e,"runningHashVersion")&&t.uint32(40).uint64(e.runningHashVersion),null!=e.chunkInfo&&Object.hasOwnProperty.call(e,"chunkInfo")&&i.proto.ConsensusMessageChunkInfo.encode(e.chunkInfo,t.uint32(50).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.mirror.api.proto.ConsensusTopicResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.consensusTimestamp=i.proto.Timestamp.decode(e,e.uint32());break;case 2:r.message=e.bytes();break;case 3:r.runningHash=e.bytes();break;case 4:r.sequenceNumber=e.uint64();break;case 5:r.runningHashVersion=e.uint64();break;case 6:r.chunkInfo=i.proto.ConsensusMessageChunkInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.mirror.api.proto.ConsensusTopicResponse"},e}(),t.ConsensusService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.subscribeTopic=function e(t,n){return this.rpcCall(e,i.com.hedera.mirror.api.proto.ConsensusTopicQuery,i.com.hedera.mirror.api.proto.ConsensusTopicResponse,t,n)},"name",{value:"subscribeTopic"}),t}(),t.AddressBookQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.fileId=null,e.prototype.limit=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fileId&&Object.hasOwnProperty.call(e,"fileId")&&i.proto.FileID.encode(e.fileId,t.uint32(10).fork()).ldelim(),null!=e.limit&&Object.hasOwnProperty.call(e,"limit")&&t.uint32(16).int32(e.limit),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.mirror.api.proto.AddressBookQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fileId=i.proto.FileID.decode(e,e.uint32());break;case 2:r.limit=e.int32();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.mirror.api.proto.AddressBookQuery"},e}(),t.NetworkService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.getNodes=function e(t,n){return this.rpcCall(e,i.com.hedera.mirror.api.proto.AddressBookQuery,i.proto.NodeAddress,t,n)},"name",{value:"getNodes"}),t}(),t}(),t}(),t}(),t.hapi=function(){const e={};return e.node=function(){const e={};return e.addressbook=function(){const e={};return e.NodeCreateTransactionBody=function(){function e(e){if(this.gossipEndpoint=[],this.serviceEndpoint=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountId=null,e.prototype.description="",e.prototype.gossipEndpoint=r.emptyArray,e.prototype.serviceEndpoint=r.emptyArray,e.prototype.gossipCaCertificate=r.newBuffer([]),e.prototype.grpcCertificateHash=r.newBuffer([]),e.prototype.adminKey=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.accountId&&Object.hasOwnProperty.call(e,"accountId")&&i.proto.AccountID.encode(e.accountId,t.uint32(10).fork()).ldelim(),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(18).string(e.description),null!=e.gossipEndpoint&&e.gossipEndpoint.length)for(var n=0;n<e.gossipEndpoint.length;++n)i.proto.ServiceEndpoint.encode(e.gossipEndpoint[n],t.uint32(26).fork()).ldelim();if(null!=e.serviceEndpoint&&e.serviceEndpoint.length)for(n=0;n<e.serviceEndpoint.length;++n)i.proto.ServiceEndpoint.encode(e.serviceEndpoint[n],t.uint32(34).fork()).ldelim();return null!=e.gossipCaCertificate&&Object.hasOwnProperty.call(e,"gossipCaCertificate")&&t.uint32(42).bytes(e.gossipCaCertificate),null!=e.grpcCertificateHash&&Object.hasOwnProperty.call(e,"grpcCertificateHash")&&t.uint32(50).bytes(e.grpcCertificateHash),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(58).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.addressbook.NodeCreateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountId=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.description=e.string();break;case 3:r.gossipEndpoint&&r.gossipEndpoint.length||(r.gossipEndpoint=[]),r.gossipEndpoint.push(i.proto.ServiceEndpoint.decode(e,e.uint32()));break;case 4:r.serviceEndpoint&&r.serviceEndpoint.length||(r.serviceEndpoint=[]),r.serviceEndpoint.push(i.proto.ServiceEndpoint.decode(e,e.uint32()));break;case 5:r.gossipCaCertificate=e.bytes();break;case 6:r.grpcCertificateHash=e.bytes();break;case 7:r.adminKey=i.proto.Key.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.addressbook.NodeCreateTransactionBody"},e}(),e.NodeUpdateTransactionBody=function(){function e(e){if(this.gossipEndpoint=[],this.serviceEndpoint=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.nodeId=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.accountId=null,e.prototype.description=null,e.prototype.gossipEndpoint=r.emptyArray,e.prototype.serviceEndpoint=r.emptyArray,e.prototype.gossipCaCertificate=null,e.prototype.grpcCertificateHash=null,e.prototype.adminKey=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.nodeId&&Object.hasOwnProperty.call(e,"nodeId")&&t.uint32(8).uint64(e.nodeId),null!=e.accountId&&Object.hasOwnProperty.call(e,"accountId")&&i.proto.AccountID.encode(e.accountId,t.uint32(18).fork()).ldelim(),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&i.google.protobuf.StringValue.encode(e.description,t.uint32(26).fork()).ldelim(),null!=e.gossipEndpoint&&e.gossipEndpoint.length)for(var n=0;n<e.gossipEndpoint.length;++n)i.proto.ServiceEndpoint.encode(e.gossipEndpoint[n],t.uint32(34).fork()).ldelim();if(null!=e.serviceEndpoint&&e.serviceEndpoint.length)for(n=0;n<e.serviceEndpoint.length;++n)i.proto.ServiceEndpoint.encode(e.serviceEndpoint[n],t.uint32(42).fork()).ldelim();return null!=e.gossipCaCertificate&&Object.hasOwnProperty.call(e,"gossipCaCertificate")&&i.google.protobuf.BytesValue.encode(e.gossipCaCertificate,t.uint32(50).fork()).ldelim(),null!=e.grpcCertificateHash&&Object.hasOwnProperty.call(e,"grpcCertificateHash")&&i.google.protobuf.BytesValue.encode(e.grpcCertificateHash,t.uint32(58).fork()).ldelim(),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(66).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.addressbook.NodeUpdateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.nodeId=e.uint64();break;case 2:r.accountId=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.description=i.google.protobuf.StringValue.decode(e,e.uint32());break;case 4:r.gossipEndpoint&&r.gossipEndpoint.length||(r.gossipEndpoint=[]),r.gossipEndpoint.push(i.proto.ServiceEndpoint.decode(e,e.uint32()));break;case 5:r.serviceEndpoint&&r.serviceEndpoint.length||(r.serviceEndpoint=[]),r.serviceEndpoint.push(i.proto.ServiceEndpoint.decode(e,e.uint32()));break;case 6:r.gossipCaCertificate=i.google.protobuf.BytesValue.decode(e,e.uint32());break;case 7:r.grpcCertificateHash=i.google.protobuf.BytesValue.decode(e,e.uint32());break;case 8:r.adminKey=i.proto.Key.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.addressbook.NodeUpdateTransactionBody"},e}(),e.NodeDeleteTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.nodeId=r.Long?r.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.nodeId&&Object.hasOwnProperty.call(e,"nodeId")&&t.uint32(8).uint64(e.nodeId),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.addressbook.NodeDeleteTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.nodeId=e.uint64();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.addressbook.NodeDeleteTransactionBody"},e}(),e}(),e.state=function(){const e={};return e.history=function(){const e={};return e.ProofKeySet=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.adoptionTime=null,e.prototype.key=r.newBuffer([]),e.prototype.nextKey=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.adoptionTime&&Object.hasOwnProperty.call(e,"adoptionTime")&&i.proto.Timestamp.encode(e.adoptionTime,t.uint32(18).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(26).bytes(e.key),null!=e.nextKey&&Object.hasOwnProperty.call(e,"nextKey")&&t.uint32(34).bytes(e.nextKey),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.state.history.ProofKeySet;e.pos<o;){var a=e.uint32();switch(a>>>3){case 2:r.adoptionTime=i.proto.Timestamp.decode(e,e.uint32());break;case 3:r.key=e.bytes();break;case 4:r.nextKey=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.state.history.ProofKeySet"},e}(),e.ProofKey=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.nodeId=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.key=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.nodeId&&Object.hasOwnProperty.call(e,"nodeId")&&t.uint32(8).uint64(e.nodeId),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).bytes(e.key),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.state.history.ProofKey;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.nodeId=e.uint64();break;case 2:r.key=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.state.history.ProofKey"},e}(),e.History=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.addressBookHash=r.newBuffer([]),e.prototype.metadata=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.addressBookHash&&Object.hasOwnProperty.call(e,"addressBookHash")&&t.uint32(10).bytes(e.addressBookHash),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&t.uint32(18).bytes(e.metadata),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.state.history.History;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.addressBookHash=e.bytes();break;case 2:r.metadata=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.state.history.History"},e}(),e.HistoryProof=function(){function e(e){if(this.targetProofKeys=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourceAddressBookHash=r.newBuffer([]),e.prototype.targetProofKeys=r.emptyArray,e.prototype.targetHistory=null,e.prototype.proof=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.sourceAddressBookHash&&Object.hasOwnProperty.call(e,"sourceAddressBookHash")&&t.uint32(10).bytes(e.sourceAddressBookHash),null!=e.targetProofKeys&&e.targetProofKeys.length)for(var n=0;n<e.targetProofKeys.length;++n)i.com.hedera.hapi.node.state.history.ProofKey.encode(e.targetProofKeys[n],t.uint32(18).fork()).ldelim();return null!=e.targetHistory&&Object.hasOwnProperty.call(e,"targetHistory")&&i.com.hedera.hapi.node.state.history.History.encode(e.targetHistory,t.uint32(26).fork()).ldelim(),null!=e.proof&&Object.hasOwnProperty.call(e,"proof")&&t.uint32(34).bytes(e.proof),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.state.history.HistoryProof;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.sourceAddressBookHash=e.bytes();break;case 2:r.targetProofKeys&&r.targetProofKeys.length||(r.targetProofKeys=[]),r.targetProofKeys.push(i.com.hedera.hapi.node.state.history.ProofKey.decode(e,e.uint32()));break;case 3:r.targetHistory=i.com.hedera.hapi.node.state.history.History.decode(e,e.uint32());break;case 4:r.proof=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.state.history.HistoryProof"},e}(),e.HistoryProofConstruction=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.constructionId=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.sourceRosterHash=r.newBuffer([]),e.prototype.sourceProof=null,e.prototype.targetRosterHash=r.newBuffer([]),e.prototype.gracePeriodEndTime=null,e.prototype.assemblyStartTime=null,e.prototype.targetProof=null,Object.defineProperty(e.prototype,"proofState",{get:r.oneOfGetter(t=["gracePeriodEndTime","assemblyStartTime","targetProof"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.constructionId&&Object.hasOwnProperty.call(e,"constructionId")&&t.uint32(8).uint64(e.constructionId),null!=e.sourceRosterHash&&Object.hasOwnProperty.call(e,"sourceRosterHash")&&t.uint32(18).bytes(e.sourceRosterHash),null!=e.sourceProof&&Object.hasOwnProperty.call(e,"sourceProof")&&i.com.hedera.hapi.node.state.history.HistoryProof.encode(e.sourceProof,t.uint32(26).fork()).ldelim(),null!=e.targetRosterHash&&Object.hasOwnProperty.call(e,"targetRosterHash")&&t.uint32(34).bytes(e.targetRosterHash),null!=e.gracePeriodEndTime&&Object.hasOwnProperty.call(e,"gracePeriodEndTime")&&i.proto.Timestamp.encode(e.gracePeriodEndTime,t.uint32(42).fork()).ldelim(),null!=e.assemblyStartTime&&Object.hasOwnProperty.call(e,"assemblyStartTime")&&i.proto.Timestamp.encode(e.assemblyStartTime,t.uint32(50).fork()).ldelim(),null!=e.targetProof&&Object.hasOwnProperty.call(e,"targetProof")&&i.com.hedera.hapi.node.state.history.HistoryProof.encode(e.targetProof,t.uint32(58).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.state.history.HistoryProofConstruction;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.constructionId=e.uint64();break;case 2:r.sourceRosterHash=e.bytes();break;case 3:r.sourceProof=i.com.hedera.hapi.node.state.history.HistoryProof.decode(e,e.uint32());break;case 4:r.targetRosterHash=e.bytes();break;case 5:r.gracePeriodEndTime=i.proto.Timestamp.decode(e,e.uint32());break;case 6:r.assemblyStartTime=i.proto.Timestamp.decode(e,e.uint32());break;case 7:r.targetProof=i.com.hedera.hapi.node.state.history.HistoryProof.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.state.history.HistoryProofConstruction"},e}(),e.ConstructionNodeId=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.constructionId=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.nodeId=r.Long?r.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.constructionId&&Object.hasOwnProperty.call(e,"constructionId")&&t.uint32(8).uint64(e.constructionId),null!=e.nodeId&&Object.hasOwnProperty.call(e,"nodeId")&&t.uint32(16).uint64(e.nodeId),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.state.history.ConstructionNodeId;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.constructionId=e.uint64();break;case 2:r.nodeId=e.uint64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.state.history.ConstructionNodeId"},e}(),e.HistoryProofVote=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.proof=null,e.prototype.congruentNodeId=null,Object.defineProperty(e.prototype,"vote",{get:r.oneOfGetter(t=["proof","congruentNodeId"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.proof&&Object.hasOwnProperty.call(e,"proof")&&i.com.hedera.hapi.node.state.history.HistoryProof.encode(e.proof,t.uint32(10).fork()).ldelim(),null!=e.congruentNodeId&&Object.hasOwnProperty.call(e,"congruentNodeId")&&t.uint32(16).uint64(e.congruentNodeId),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.state.history.HistoryProofVote;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.proof=i.com.hedera.hapi.node.state.history.HistoryProof.decode(e,e.uint32());break;case 2:r.congruentNodeId=e.uint64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.state.history.HistoryProofVote"},e}(),e.HistorySignature=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.history=null,e.prototype.signature=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.history&&Object.hasOwnProperty.call(e,"history")&&i.com.hedera.hapi.node.state.history.History.encode(e.history,t.uint32(10).fork()).ldelim(),null!=e.signature&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(18).bytes(e.signature),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.state.history.HistorySignature;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.history=i.com.hedera.hapi.node.state.history.History.decode(e,e.uint32());break;case 2:r.signature=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.state.history.HistorySignature"},e}(),e.RecordedHistorySignature=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.signingTime=null,e.prototype.historySignature=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.signingTime&&Object.hasOwnProperty.call(e,"signingTime")&&i.proto.Timestamp.encode(e.signingTime,t.uint32(10).fork()).ldelim(),null!=e.historySignature&&Object.hasOwnProperty.call(e,"historySignature")&&i.com.hedera.hapi.node.state.history.HistorySignature.encode(e.historySignature,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.node.state.history.RecordedHistorySignature;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.signingTime=i.proto.Timestamp.decode(e,e.uint32());break;case 2:r.historySignature=i.com.hedera.hapi.node.state.history.HistorySignature.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.node.state.history.RecordedHistorySignature"},e}(),e}(),e}(),e}(),e.platform=function(){const e={};return e.event=function(){const e={};return e.EventConsensusData=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.consensusTimestamp=null,e.prototype.consensusOrder=r.Long?r.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.consensusTimestamp&&Object.hasOwnProperty.call(e,"consensusTimestamp")&&i.proto.Timestamp.encode(e.consensusTimestamp,t.uint32(10).fork()).ldelim(),null!=e.consensusOrder&&Object.hasOwnProperty.call(e,"consensusOrder")&&t.uint32(16).uint64(e.consensusOrder),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.platform.event.EventConsensusData;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.consensusTimestamp=i.proto.Timestamp.decode(e,e.uint32());break;case 2:r.consensusOrder=e.uint64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.platform.event.EventConsensusData"},e}(),e.EventCore=function(){function e(e){if(this.parents=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.creatorNodeId=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.birthRound=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.timeCreated=null,e.prototype.parents=r.emptyArray,e.prototype.version=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.creatorNodeId&&Object.hasOwnProperty.call(e,"creatorNodeId")&&t.uint32(8).int64(e.creatorNodeId),null!=e.birthRound&&Object.hasOwnProperty.call(e,"birthRound")&&t.uint32(16).int64(e.birthRound),null!=e.timeCreated&&Object.hasOwnProperty.call(e,"timeCreated")&&i.proto.Timestamp.encode(e.timeCreated,t.uint32(26).fork()).ldelim(),null!=e.parents&&e.parents.length)for(var n=0;n<e.parents.length;++n)i.com.hedera.hapi.platform.event.EventDescriptor.encode(e.parents[n],t.uint32(34).fork()).ldelim();return null!=e.version&&Object.hasOwnProperty.call(e,"version")&&i.proto.SemanticVersion.encode(e.version,t.uint32(138).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.platform.event.EventCore;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.creatorNodeId=e.int64();break;case 2:r.birthRound=e.int64();break;case 3:r.timeCreated=i.proto.Timestamp.decode(e,e.uint32());break;case 4:r.parents&&r.parents.length||(r.parents=[]),r.parents.push(i.com.hedera.hapi.platform.event.EventDescriptor.decode(e,e.uint32()));break;case 17:r.version=i.proto.SemanticVersion.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.platform.event.EventCore"},e}(),e.EventDescriptor=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.hash=r.newBuffer([]),e.prototype.creatorNodeId=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.birthRound=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.generation=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.hash&&Object.hasOwnProperty.call(e,"hash")&&t.uint32(10).bytes(e.hash),null!=e.creatorNodeId&&Object.hasOwnProperty.call(e,"creatorNodeId")&&t.uint32(16).int64(e.creatorNodeId),null!=e.birthRound&&Object.hasOwnProperty.call(e,"birthRound")&&t.uint32(24).int64(e.birthRound),null!=e.generation&&Object.hasOwnProperty.call(e,"generation")&&t.uint32(136).int64(e.generation),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.platform.event.EventDescriptor;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.hash=e.bytes();break;case 2:r.creatorNodeId=e.int64();break;case 3:r.birthRound=e.int64();break;case 17:r.generation=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.platform.event.EventDescriptor"},e}(),e.EventTransaction=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.applicationTransaction=null,e.prototype.stateSignatureTransaction=null,Object.defineProperty(e.prototype,"transaction",{get:r.oneOfGetter(t=["applicationTransaction","stateSignatureTransaction"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.applicationTransaction&&Object.hasOwnProperty.call(e,"applicationTransaction")&&t.uint32(10).bytes(e.applicationTransaction),null!=e.stateSignatureTransaction&&Object.hasOwnProperty.call(e,"stateSignatureTransaction")&&i.com.hedera.hapi.platform.event.StateSignatureTransaction.encode(e.stateSignatureTransaction,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.platform.event.EventTransaction;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.applicationTransaction=e.bytes();break;case 2:r.stateSignatureTransaction=i.com.hedera.hapi.platform.event.StateSignatureTransaction.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.platform.event.EventTransaction"},e}(),e.GossipEvent=function(){function e(e){if(this.eventTransaction=[],this.transactions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.eventCore=null,e.prototype.signature=r.newBuffer([]),e.prototype.eventTransaction=r.emptyArray,e.prototype.transactions=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.eventCore&&Object.hasOwnProperty.call(e,"eventCore")&&i.com.hedera.hapi.platform.event.EventCore.encode(e.eventCore,t.uint32(10).fork()).ldelim(),null!=e.signature&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(18).bytes(e.signature),null!=e.eventTransaction&&e.eventTransaction.length)for(var n=0;n<e.eventTransaction.length;++n)i.com.hedera.hapi.platform.event.EventTransaction.encode(e.eventTransaction[n],t.uint32(26).fork()).ldelim();if(null!=e.transactions&&e.transactions.length)for(n=0;n<e.transactions.length;++n)t.uint32(34).bytes(e.transactions[n]);return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.platform.event.GossipEvent;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.eventCore=i.com.hedera.hapi.platform.event.EventCore.decode(e,e.uint32());break;case 2:r.signature=e.bytes();break;case 3:r.eventTransaction&&r.eventTransaction.length||(r.eventTransaction=[]),r.eventTransaction.push(i.com.hedera.hapi.platform.event.EventTransaction.decode(e,e.uint32()));break;case 4:r.transactions&&r.transactions.length||(r.transactions=[]),r.transactions.push(e.bytes());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.platform.event.GossipEvent"},e}(),e.StateSignatureTransaction=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.round=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.signature=r.newBuffer([]),e.prototype.hash=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.round&&Object.hasOwnProperty.call(e,"round")&&t.uint32(8).int64(e.round),null!=e.signature&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(18).bytes(e.signature),null!=e.hash&&Object.hasOwnProperty.call(e,"hash")&&t.uint32(26).bytes(e.hash),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.platform.event.StateSignatureTransaction;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.round=e.int64();break;case 2:r.signature=e.bytes();break;case 3:r.hash=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.platform.event.StateSignatureTransaction"},e}(),e}(),e}(),e.services=function(){const e={};return e.auxiliary=function(){const e={};return e.history=function(){const e={};return e.HistoryProofKeyPublicationTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.proofKey=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.proofKey&&Object.hasOwnProperty.call(e,"proofKey")&&t.uint32(10).bytes(e.proofKey),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.services.auxiliary.history.HistoryProofKeyPublicationTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.proofKey=e.bytes();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.services.auxiliary.history.HistoryProofKeyPublicationTransactionBody"},e}(),e.HistoryProofSignatureTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.constructionId=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.signature=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.constructionId&&Object.hasOwnProperty.call(e,"constructionId")&&t.uint32(8).uint64(e.constructionId),null!=e.signature&&Object.hasOwnProperty.call(e,"signature")&&i.com.hedera.hapi.node.state.history.HistorySignature.encode(e.signature,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.services.auxiliary.history.HistoryProofSignatureTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.constructionId=e.uint64();break;case 2:r.signature=i.com.hedera.hapi.node.state.history.HistorySignature.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.services.auxiliary.history.HistoryProofSignatureTransactionBody"},e}(),e.HistoryProofVoteTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.constructionId=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.vote=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.constructionId&&Object.hasOwnProperty.call(e,"constructionId")&&t.uint32(8).uint64(e.constructionId),null!=e.vote&&Object.hasOwnProperty.call(e,"vote")&&i.com.hedera.hapi.node.state.history.HistoryProofVote.encode(e.vote,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.com.hedera.hapi.services.auxiliary.history.HistoryProofVoteTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.constructionId=e.uint64();break;case 2:r.vote=i.com.hedera.hapi.node.state.history.HistoryProofVote.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.hedera.hapi.services.auxiliary.history.HistoryProofVoteTransactionBody"},e}(),e}(),e}(),e}(),e}(),t}(),t})(),proto.proto=i.proto=(()=>{const t={};return t.TransactionList=function(){function e(e){if(this.transactionList=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.transactionList=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.transactionList&&e.transactionList.length)for(var n=0;n<e.transactionList.length;++n)i.proto.Transaction.encode(e.transactionList[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionList;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.transactionList&&r.transactionList.length||(r.transactionList=[]),r.transactionList.push(i.proto.Transaction.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionList"},e}(),t.AddressBookService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.createNode=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"createNode"}),Object.defineProperty(t.prototype.deleteNode=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"deleteNode"}),Object.defineProperty(t.prototype.updateNode=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"updateNode"}),t}(),t.TransactionResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.nodeTransactionPrecheckCode=0,e.prototype.cost=r.Long?r.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.nodeTransactionPrecheckCode&&Object.hasOwnProperty.call(e,"nodeTransactionPrecheckCode")&&t.uint32(8).int32(e.nodeTransactionPrecheckCode),null!=e.cost&&Object.hasOwnProperty.call(e,"cost")&&t.uint32(16).uint64(e.cost),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.nodeTransactionPrecheckCode=e.int32();break;case 2:r.cost=e.uint64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionResponse"},e}(),t.ResponseCodeEnum=function(){const e={},t=Object.create(e);return t[e[0]="OK"]=0,t[e[1]="INVALID_TRANSACTION"]=1,t[e[2]="PAYER_ACCOUNT_NOT_FOUND"]=2,t[e[3]="INVALID_NODE_ACCOUNT"]=3,t[e[4]="TRANSACTION_EXPIRED"]=4,t[e[5]="INVALID_TRANSACTION_START"]=5,t[e[6]="INVALID_TRANSACTION_DURATION"]=6,t[e[7]="INVALID_SIGNATURE"]=7,t[e[8]="MEMO_TOO_LONG"]=8,t[e[9]="INSUFFICIENT_TX_FEE"]=9,t[e[10]="INSUFFICIENT_PAYER_BALANCE"]=10,t[e[11]="DUPLICATE_TRANSACTION"]=11,t[e[12]="BUSY"]=12,t[e[13]="NOT_SUPPORTED"]=13,t[e[14]="INVALID_FILE_ID"]=14,t[e[15]="INVALID_ACCOUNT_ID"]=15,t[e[16]="INVALID_CONTRACT_ID"]=16,t[e[17]="INVALID_TRANSACTION_ID"]=17,t[e[18]="RECEIPT_NOT_FOUND"]=18,t[e[19]="RECORD_NOT_FOUND"]=19,t[e[20]="INVALID_SOLIDITY_ID"]=20,t[e[21]="UNKNOWN"]=21,t[e[22]="SUCCESS"]=22,t[e[23]="FAIL_INVALID"]=23,t[e[24]="FAIL_FEE"]=24,t[e[25]="FAIL_BALANCE"]=25,t[e[26]="KEY_REQUIRED"]=26,t[e[27]="BAD_ENCODING"]=27,t[e[28]="INSUFFICIENT_ACCOUNT_BALANCE"]=28,t[e[29]="INVALID_SOLIDITY_ADDRESS"]=29,t[e[30]="INSUFFICIENT_GAS"]=30,t[e[31]="CONTRACT_SIZE_LIMIT_EXCEEDED"]=31,t[e[32]="LOCAL_CALL_MODIFICATION_EXCEPTION"]=32,t[e[33]="CONTRACT_REVERT_EXECUTED"]=33,t[e[34]="CONTRACT_EXECUTION_EXCEPTION"]=34,t[e[35]="INVALID_RECEIVING_NODE_ACCOUNT"]=35,t[e[36]="MISSING_QUERY_HEADER"]=36,t[e[37]="ACCOUNT_UPDATE_FAILED"]=37,t[e[38]="INVALID_KEY_ENCODING"]=38,t[e[39]="NULL_SOLIDITY_ADDRESS"]=39,t[e[40]="CONTRACT_UPDATE_FAILED"]=40,t[e[41]="INVALID_QUERY_HEADER"]=41,t[e[42]="INVALID_FEE_SUBMITTED"]=42,t[e[43]="INVALID_PAYER_SIGNATURE"]=43,t[e[44]="KEY_NOT_PROVIDED"]=44,t[e[45]="INVALID_EXPIRATION_TIME"]=45,t[e[46]="NO_WACL_KEY"]=46,t[e[47]="FILE_CONTENT_EMPTY"]=47,t[e[48]="INVALID_ACCOUNT_AMOUNTS"]=48,t[e[49]="EMPTY_TRANSACTION_BODY"]=49,t[e[50]="INVALID_TRANSACTION_BODY"]=50,t[e[51]="INVALID_SIGNATURE_TYPE_MISMATCHING_KEY"]=51,t[e[52]="INVALID_SIGNATURE_COUNT_MISMATCHING_KEY"]=52,t[e[53]="EMPTY_LIVE_HASH_BODY"]=53,t[e[54]="EMPTY_LIVE_HASH"]=54,t[e[55]="EMPTY_LIVE_HASH_KEYS"]=55,t[e[56]="INVALID_LIVE_HASH_SIZE"]=56,t[e[57]="EMPTY_QUERY_BODY"]=57,t[e[58]="EMPTY_LIVE_HASH_QUERY"]=58,t[e[59]="LIVE_HASH_NOT_FOUND"]=59,t[e[60]="ACCOUNT_ID_DOES_NOT_EXIST"]=60,t[e[61]="LIVE_HASH_ALREADY_EXISTS"]=61,t[e[62]="INVALID_FILE_WACL"]=62,t[e[63]="SERIALIZATION_FAILED"]=63,t[e[64]="TRANSACTION_OVERSIZE"]=64,t[e[65]="TRANSACTION_TOO_MANY_LAYERS"]=65,t[e[66]="CONTRACT_DELETED"]=66,t[e[67]="PLATFORM_NOT_ACTIVE"]=67,t[e[68]="KEY_PREFIX_MISMATCH"]=68,t[e[69]="PLATFORM_TRANSACTION_NOT_CREATED"]=69,t[e[70]="INVALID_RENEWAL_PERIOD"]=70,t[e[71]="INVALID_PAYER_ACCOUNT_ID"]=71,t[e[72]="ACCOUNT_DELETED"]=72,t[e[73]="FILE_DELETED"]=73,t[e[74]="ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS"]=74,t[e[75]="SETTING_NEGATIVE_ACCOUNT_BALANCE"]=75,t[e[76]="OBTAINER_REQUIRED"]=76,t[e[77]="OBTAINER_SAME_CONTRACT_ID"]=77,t[e[78]="OBTAINER_DOES_NOT_EXIST"]=78,t[e[79]="MODIFYING_IMMUTABLE_CONTRACT"]=79,t[e[80]="FILE_SYSTEM_EXCEPTION"]=80,t[e[81]="AUTORENEW_DURATION_NOT_IN_RANGE"]=81,t[e[82]="ERROR_DECODING_BYTESTRING"]=82,t[e[83]="CONTRACT_FILE_EMPTY"]=83,t[e[84]="CONTRACT_BYTECODE_EMPTY"]=84,t[e[85]="INVALID_INITIAL_BALANCE"]=85,t[e[86]="INVALID_RECEIVE_RECORD_THRESHOLD"]=86,t[e[87]="INVALID_SEND_RECORD_THRESHOLD"]=87,t[e[88]="ACCOUNT_IS_NOT_GENESIS_ACCOUNT"]=88,t[e[89]="PAYER_ACCOUNT_UNAUTHORIZED"]=89,t[e[90]="INVALID_FREEZE_TRANSACTION_BODY"]=90,t[e[91]="FREEZE_TRANSACTION_BODY_NOT_FOUND"]=91,t[e[92]="TRANSFER_LIST_SIZE_LIMIT_EXCEEDED"]=92,t[e[93]="RESULT_SIZE_LIMIT_EXCEEDED"]=93,t[e[94]="NOT_SPECIAL_ACCOUNT"]=94,t[e[95]="CONTRACT_NEGATIVE_GAS"]=95,t[e[96]="CONTRACT_NEGATIVE_VALUE"]=96,t[e[97]="INVALID_FEE_FILE"]=97,t[e[98]="INVALID_EXCHANGE_RATE_FILE"]=98,t[e[99]="INSUFFICIENT_LOCAL_CALL_GAS"]=99,t[e[100]="ENTITY_NOT_ALLOWED_TO_DELETE"]=100,t[e[101]="AUTHORIZATION_FAILED"]=101,t[e[102]="FILE_UPLOADED_PROTO_INVALID"]=102,t[e[103]="FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK"]=103,t[e[104]="FEE_SCHEDULE_FILE_PART_UPLOADED"]=104,t[e[105]="EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED"]=105,t[e[106]="MAX_CONTRACT_STORAGE_EXCEEDED"]=106,t[e[107]="TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT"]=107,t[e[108]="TOTAL_LEDGER_BALANCE_INVALID"]=108,t[e[110]="EXPIRATION_REDUCTION_NOT_ALLOWED"]=110,t[e[111]="MAX_GAS_LIMIT_EXCEEDED"]=111,t[e[112]="MAX_FILE_SIZE_EXCEEDED"]=112,t[e[113]="RECEIVER_SIG_REQUIRED"]=113,t[e[150]="INVALID_TOPIC_ID"]=150,t[e[155]="INVALID_ADMIN_KEY"]=155,t[e[156]="INVALID_SUBMIT_KEY"]=156,t[e[157]="UNAUTHORIZED"]=157,t[e[158]="INVALID_TOPIC_MESSAGE"]=158,t[e[159]="INVALID_AUTORENEW_ACCOUNT"]=159,t[e[160]="AUTORENEW_ACCOUNT_NOT_ALLOWED"]=160,t[e[162]="TOPIC_EXPIRED"]=162,t[e[163]="INVALID_CHUNK_NUMBER"]=163,t[e[164]="INVALID_CHUNK_TRANSACTION_ID"]=164,t[e[165]="ACCOUNT_FROZEN_FOR_TOKEN"]=165,t[e[166]="TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED"]=166,t[e[167]="INVALID_TOKEN_ID"]=167,t[e[168]="INVALID_TOKEN_DECIMALS"]=168,t[e[169]="INVALID_TOKEN_INITIAL_SUPPLY"]=169,t[e[170]="INVALID_TREASURY_ACCOUNT_FOR_TOKEN"]=170,t[e[171]="INVALID_TOKEN_SYMBOL"]=171,t[e[172]="TOKEN_HAS_NO_FREEZE_KEY"]=172,t[e[173]="TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN"]=173,t[e[174]="MISSING_TOKEN_SYMBOL"]=174,t[e[175]="TOKEN_SYMBOL_TOO_LONG"]=175,t[e[176]="ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN"]=176,t[e[177]="TOKEN_HAS_NO_KYC_KEY"]=177,t[e[178]="INSUFFICIENT_TOKEN_BALANCE"]=178,t[e[179]="TOKEN_WAS_DELETED"]=179,t[e[180]="TOKEN_HAS_NO_SUPPLY_KEY"]=180,t[e[181]="TOKEN_HAS_NO_WIPE_KEY"]=181,t[e[182]="INVALID_TOKEN_MINT_AMOUNT"]=182,t[e[183]="INVALID_TOKEN_BURN_AMOUNT"]=183,t[e[184]="TOKEN_NOT_ASSOCIATED_TO_ACCOUNT"]=184,t[e[185]="CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT"]=185,t[e[186]="INVALID_KYC_KEY"]=186,t[e[187]="INVALID_WIPE_KEY"]=187,t[e[188]="INVALID_FREEZE_KEY"]=188,t[e[189]="INVALID_SUPPLY_KEY"]=189,t[e[190]="MISSING_TOKEN_NAME"]=190,t[e[191]="TOKEN_NAME_TOO_LONG"]=191,t[e[192]="INVALID_WIPING_AMOUNT"]=192,t[e[193]="TOKEN_IS_IMMUTABLE"]=193,t[e[194]="TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT"]=194,t[e[195]="TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES"]=195,t[e[196]="ACCOUNT_IS_TREASURY"]=196,t[e[197]="TOKEN_ID_REPEATED_IN_TOKEN_LIST"]=197,t[e[198]="TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED"]=198,t[e[199]="EMPTY_TOKEN_TRANSFER_BODY"]=199,t[e[200]="EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS"]=200,t[e[201]="INVALID_SCHEDULE_ID"]=201,t[e[202]="SCHEDULE_IS_IMMUTABLE"]=202,t[e[203]="INVALID_SCHEDULE_PAYER_ID"]=203,t[e[204]="INVALID_SCHEDULE_ACCOUNT_ID"]=204,t[e[205]="NO_NEW_VALID_SIGNATURES"]=205,t[e[206]="UNRESOLVABLE_REQUIRED_SIGNERS"]=206,t[e[207]="SCHEDULED_TRANSACTION_NOT_IN_WHITELIST"]=207,t[e[208]="SOME_SIGNATURES_WERE_INVALID"]=208,t[e[209]="TRANSACTION_ID_FIELD_NOT_ALLOWED"]=209,t[e[210]="IDENTICAL_SCHEDULE_ALREADY_CREATED"]=210,t[e[211]="INVALID_ZERO_BYTE_IN_STRING"]=211,t[e[212]="SCHEDULE_ALREADY_DELETED"]=212,t[e[213]="SCHEDULE_ALREADY_EXECUTED"]=213,t[e[214]="MESSAGE_SIZE_TOO_LARGE"]=214,t[e[215]="OPERATION_REPEATED_IN_BUCKET_GROUPS"]=215,t[e[216]="BUCKET_CAPACITY_OVERFLOW"]=216,t[e[217]="NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION"]=217,t[e[218]="BUCKET_HAS_NO_THROTTLE_GROUPS"]=218,t[e[219]="THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC"]=219,t[e[220]="SUCCESS_BUT_MISSING_EXPECTED_OPERATION"]=220,t[e[221]="UNPARSEABLE_THROTTLE_DEFINITIONS"]=221,t[e[222]="INVALID_THROTTLE_DEFINITIONS"]=222,t[e[223]="ACCOUNT_EXPIRED_AND_PENDING_REMOVAL"]=223,t[e[224]="INVALID_TOKEN_MAX_SUPPLY"]=224,t[e[225]="INVALID_TOKEN_NFT_SERIAL_NUMBER"]=225,t[e[226]="INVALID_NFT_ID"]=226,t[e[227]="METADATA_TOO_LONG"]=227,t[e[228]="BATCH_SIZE_LIMIT_EXCEEDED"]=228,t[e[229]="INVALID_QUERY_RANGE"]=229,t[e[230]="FRACTION_DIVIDES_BY_ZERO"]=230,t[e[231]="INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE"]=231,t[e[232]="CUSTOM_FEES_LIST_TOO_LONG"]=232,t[e[233]="INVALID_CUSTOM_FEE_COLLECTOR"]=233,t[e[234]="INVALID_TOKEN_ID_IN_CUSTOM_FEES"]=234,t[e[235]="TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR"]=235,t[e[236]="TOKEN_MAX_SUPPLY_REACHED"]=236,t[e[237]="SENDER_DOES_NOT_OWN_NFT_SERIAL_NO"]=237,t[e[238]="CUSTOM_FEE_NOT_FULLY_SPECIFIED"]=238,t[e[239]="CUSTOM_FEE_MUST_BE_POSITIVE"]=239,t[e[240]="TOKEN_HAS_NO_FEE_SCHEDULE_KEY"]=240,t[e[241]="CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE"]=241,t[e[242]="ROYALTY_FRACTION_CANNOT_EXCEED_ONE"]=242,t[e[243]="FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT"]=243,t[e[244]="CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES"]=244,t[e[245]="CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON"]=245,t[e[246]="CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON"]=246,t[e[247]="INVALID_CUSTOM_FEE_SCHEDULE_KEY"]=247,t[e[248]="INVALID_TOKEN_MINT_METADATA"]=248,t[e[249]="INVALID_TOKEN_BURN_METADATA"]=249,t[e[250]="CURRENT_TREASURY_STILL_OWNS_NFTS"]=250,t[e[251]="ACCOUNT_STILL_OWNS_NFTS"]=251,t[e[252]="TREASURY_MUST_OWN_BURNED_NFT"]=252,t[e[253]="ACCOUNT_DOES_NOT_OWN_WIPED_NFT"]=253,t[e[254]="ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON"]=254,t[e[255]="MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED"]=255,t[e[256]="PAYER_ACCOUNT_DELETED"]=256,t[e[257]="CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH"]=257,t[e[258]="CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS"]=258,t[e[259]="INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE"]=259,t[e[260]="SERIAL_NUMBER_LIMIT_REACHED"]=260,t[e[261]="CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE"]=261,t[e[262]="NO_REMAINING_AUTOMATIC_ASSOCIATIONS"]=262,t[e[263]="EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT"]=263,t[e[264]="REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT"]=264,t[e[265]="TOKEN_IS_PAUSED"]=265,t[e[266]="TOKEN_HAS_NO_PAUSE_KEY"]=266,t[e[267]="INVALID_PAUSE_KEY"]=267,t[e[268]="FREEZE_UPDATE_FILE_DOES_NOT_EXIST"]=268,t[e[269]="FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH"]=269,t[e[270]="NO_UPGRADE_HAS_BEEN_PREPARED"]=270,t[e[271]="NO_FREEZE_IS_SCHEDULED"]=271,t[e[272]="UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE"]=272,t[e[273]="FREEZE_START_TIME_MUST_BE_FUTURE"]=273,t[e[274]="PREPARED_UPDATE_FILE_IS_IMMUTABLE"]=274,t[e[275]="FREEZE_ALREADY_SCHEDULED"]=275,t[e[276]="FREEZE_UPGRADE_IN_PROGRESS"]=276,t[e[277]="UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED"]=277,t[e[278]="UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED"]=278,t[e[279]="CONSENSUS_GAS_EXHAUSTED"]=279,t[e[280]="REVERTED_SUCCESS"]=280,t[e[281]="MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED"]=281,t[e[282]="INVALID_ALIAS_KEY"]=282,t[e[283]="UNEXPECTED_TOKEN_DECIMALS"]=283,t[e[284]="INVALID_PROXY_ACCOUNT_ID"]=284,t[e[285]="INVALID_TRANSFER_ACCOUNT_ID"]=285,t[e[286]="INVALID_FEE_COLLECTOR_ACCOUNT_ID"]=286,t[e[287]="ALIAS_IS_IMMUTABLE"]=287,t[e[288]="SPENDER_ACCOUNT_SAME_AS_OWNER"]=288,t[e[289]="AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY"]=289,t[e[290]="NEGATIVE_ALLOWANCE_AMOUNT"]=290,t[e[291]="CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON"]=291,t[e[292]="SPENDER_DOES_NOT_HAVE_ALLOWANCE"]=292,t[e[293]="AMOUNT_EXCEEDS_ALLOWANCE"]=293,t[e[294]="MAX_ALLOWANCES_EXCEEDED"]=294,t[e[295]="EMPTY_ALLOWANCES"]=295,t[e[296]="SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES"]=296,t[e[297]="REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES"]=297,t[e[298]="FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES"]=298,t[e[299]="NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES"]=299,t[e[300]="INVALID_ALLOWANCE_OWNER_ID"]=300,t[e[301]="INVALID_ALLOWANCE_SPENDER_ID"]=301,t[e[302]="REPEATED_ALLOWANCES_TO_DELETE"]=302,t[e[303]="INVALID_DELEGATING_SPENDER"]=303,t[e[304]="DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL"]=304,t[e[305]="DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL"]=305,t[e[306]="SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE"]=306,t[e[307]="SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME"]=307,t[e[308]="SCHEDULE_FUTURE_THROTTLE_EXCEEDED"]=308,t[e[309]="SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED"]=309,t[e[310]="INVALID_ETHEREUM_TRANSACTION"]=310,t[e[311]="WRONG_CHAIN_ID"]=311,t[e[312]="WRONG_NONCE"]=312,t[e[313]="ACCESS_LIST_UNSUPPORTED"]=313,t[e[314]="SCHEDULE_PENDING_EXPIRATION"]=314,t[e[315]="CONTRACT_IS_TOKEN_TREASURY"]=315,t[e[316]="CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES"]=316,t[e[317]="CONTRACT_EXPIRED_AND_PENDING_REMOVAL"]=317,t[e[318]="CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT"]=318,t[e[319]="PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION"]=319,t[e[320]="PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED"]=320,t[e[321]="SELF_STAKING_IS_NOT_ALLOWED"]=321,t[e[322]="INVALID_STAKING_ID"]=322,t[e[323]="STAKING_NOT_ENABLED"]=323,t[e[324]="INVALID_PRNG_RANGE"]=324,t[e[325]="MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED"]=325,t[e[326]="INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE"]=326,t[e[327]="INSUFFICIENT_BALANCES_FOR_STORAGE_RENT"]=327,t[e[328]="MAX_CHILD_RECORDS_EXCEEDED"]=328,t[e[329]="INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES"]=329,t[e[330]="TRANSACTION_HAS_UNKNOWN_FIELDS"]=330,t[e[331]="ACCOUNT_IS_IMMUTABLE"]=331,t[e[332]="ALIAS_ALREADY_ASSIGNED"]=332,t[e[333]="INVALID_METADATA_KEY"]=333,t[e[334]="TOKEN_HAS_NO_METADATA_KEY"]=334,t[e[335]="MISSING_TOKEN_METADATA"]=335,t[e[336]="MISSING_SERIAL_NUMBERS"]=336,t[e[337]="TOKEN_HAS_NO_ADMIN_KEY"]=337,t[e[338]="NODE_DELETED"]=338,t[e[339]="INVALID_NODE_ID"]=339,t[e[340]="INVALID_GOSSIP_ENDPOINT"]=340,t[e[341]="INVALID_NODE_ACCOUNT_ID"]=341,t[e[342]="INVALID_NODE_DESCRIPTION"]=342,t[e[343]="INVALID_SERVICE_ENDPOINT"]=343,t[e[344]="INVALID_GOSSIP_CA_CERTIFICATE"]=344,t[e[345]="INVALID_GRPC_CERTIFICATE"]=345,t[e[346]="INVALID_MAX_AUTO_ASSOCIATIONS"]=346,t[e[347]="MAX_NODES_CREATED"]=347,t[e[348]="IP_FQDN_CANNOT_BE_SET_FOR_SAME_ENDPOINT"]=348,t[e[349]="GOSSIP_ENDPOINT_CANNOT_HAVE_FQDN"]=349,t[e[350]="FQDN_SIZE_TOO_LARGE"]=350,t[e[351]="INVALID_ENDPOINT"]=351,t[e[352]="GOSSIP_ENDPOINTS_EXCEEDED_LIMIT"]=352,t[e[353]="TOKEN_REFERENCE_REPEATED"]=353,t[e[354]="INVALID_OWNER_ID"]=354,t[e[355]="TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED"]=355,t[e[356]="SERVICE_ENDPOINTS_EXCEEDED_LIMIT"]=356,t[e[357]="INVALID_IPV4_ADDRESS"]=357,t[e[358]="EMPTY_TOKEN_REFERENCE_LIST"]=358,t[e[359]="UPDATE_NODE_ACCOUNT_NOT_ALLOWED"]=359,t[e[360]="TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY"]=360,t[e[361]="EMPTY_PENDING_AIRDROP_ID_LIST"]=361,t[e[362]="PENDING_AIRDROP_ID_REPEATED"]=362,t[e[363]="PENDING_AIRDROP_ID_LIST_TOO_LONG"]=363,t[e[364]="PENDING_NFT_AIRDROP_ALREADY_EXISTS"]=364,t[e[365]="ACCOUNT_HAS_PENDING_AIRDROPS"]=365,t[e[366]="THROTTLED_AT_CONSENSUS"]=366,t[e[367]="INVALID_PENDING_AIRDROP_ID"]=367,t[e[368]="TOKEN_AIRDROP_WITH_FALLBACK_ROYALTY"]=368,t[e[369]="INVALID_TOKEN_IN_PENDING_AIRDROP"]=369,t[e[370]="SCHEDULE_EXPIRY_IS_BUSY"]=370,t[e[371]="INVALID_GRPC_CERTIFICATE_HASH"]=371,t[e[372]="MISSING_EXPIRY_TIME"]=372,t[e[373]="NO_SCHEDULING_ALLOWED_AFTER_SCHEDULED_RECURSION"]=373,t[e[374]="RECURSIVE_SCHEDULING_LIMIT_REACHED"]=374,t[e[375]="WAITING_FOR_LEDGER_ID"]=375,t[e[376]="MAX_ENTRIES_FOR_FEE_EXEMPT_KEY_LIST_EXCEEDED"]=376,t[e[377]="FEE_EXEMPT_KEY_LIST_CONTAINS_DUPLICATED_KEYS"]=377,t[e[378]="INVALID_KEY_IN_FEE_EXEMPT_KEY_LIST"]=378,t[e[379]="INVALID_FEE_SCHEDULE_KEY"]=379,t[e[380]="FEE_SCHEDULE_KEY_CANNOT_BE_UPDATED"]=380,t[e[381]="FEE_SCHEDULE_KEY_NOT_SET"]=381,t[e[382]="MAX_CUSTOM_FEE_LIMIT_EXCEEDED"]=382,t[e[383]="NO_VALID_MAX_CUSTOM_FEE"]=383,t[e[384]="INVALID_MAX_CUSTOM_FEES"]=384,t[e[385]="DUPLICATE_DENOMINATION_IN_MAX_CUSTOM_FEE_LIST"]=385,t[e[386]="DUPLICATE_ACCOUNT_ID_IN_MAX_CUSTOM_FEE_LIST"]=386,t[e[387]="MAX_CUSTOM_FEES_IS_NOT_SUPPORTED"]=387,t}(),t.Transaction=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.body=null,e.prototype.sigs=null,e.prototype.sigMap=null,e.prototype.bodyBytes=r.newBuffer([]),e.prototype.signedTransactionBytes=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.body&&Object.hasOwnProperty.call(e,"body")&&i.proto.TransactionBody.encode(e.body,t.uint32(10).fork()).ldelim(),null!=e.sigs&&Object.hasOwnProperty.call(e,"sigs")&&i.proto.SignatureList.encode(e.sigs,t.uint32(18).fork()).ldelim(),null!=e.sigMap&&Object.hasOwnProperty.call(e,"sigMap")&&i.proto.SignatureMap.encode(e.sigMap,t.uint32(26).fork()).ldelim(),null!=e.bodyBytes&&Object.hasOwnProperty.call(e,"bodyBytes")&&t.uint32(34).bytes(e.bodyBytes),null!=e.signedTransactionBytes&&Object.hasOwnProperty.call(e,"signedTransactionBytes")&&t.uint32(42).bytes(e.signedTransactionBytes),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.Transaction;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.body=i.proto.TransactionBody.decode(e,e.uint32());break;case 2:r.sigs=i.proto.SignatureList.decode(e,e.uint32());break;case 3:r.sigMap=i.proto.SignatureMap.decode(e,e.uint32());break;case 4:r.bodyBytes=e.bytes();break;case 5:r.signedTransactionBytes=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Transaction"},e}(),t.TransactionBody=function(){function e(e){if(this.maxCustomFees=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.transactionID=null,e.prototype.nodeAccountID=null,e.prototype.transactionFee=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.transactionValidDuration=null,e.prototype.generateRecord=!1,e.prototype.memo="",e.prototype.contractCall=null,e.prototype.contractCreateInstance=null,e.prototype.contractUpdateInstance=null,e.prototype.cryptoAddLiveHash=null,e.prototype.cryptoCreateAccount=null,e.prototype.cryptoDelete=null,e.prototype.cryptoDeleteLiveHash=null,e.prototype.cryptoTransfer=null,e.prototype.cryptoUpdateAccount=null,e.prototype.fileAppend=null,e.prototype.fileCreate=null,e.prototype.fileDelete=null,e.prototype.fileUpdate=null,e.prototype.systemDelete=null,e.prototype.systemUndelete=null,e.prototype.contractDeleteInstance=null,e.prototype.freeze=null,e.prototype.consensusCreateTopic=null,e.prototype.consensusUpdateTopic=null,e.prototype.consensusDeleteTopic=null,e.prototype.consensusSubmitMessage=null,e.prototype.uncheckedSubmit=null,e.prototype.tokenCreation=null,e.prototype.tokenFreeze=null,e.prototype.tokenUnfreeze=null,e.prototype.tokenGrantKyc=null,e.prototype.tokenRevokeKyc=null,e.prototype.tokenDeletion=null,e.prototype.tokenUpdate=null,e.prototype.tokenMint=null,e.prototype.tokenBurn=null,e.prototype.tokenWipe=null,e.prototype.tokenAssociate=null,e.prototype.tokenDissociate=null,e.prototype.scheduleCreate=null,e.prototype.scheduleDelete=null,e.prototype.scheduleSign=null,e.prototype.tokenFeeScheduleUpdate=null,e.prototype.tokenPause=null,e.prototype.tokenUnpause=null,e.prototype.cryptoApproveAllowance=null,e.prototype.cryptoDeleteAllowance=null,e.prototype.ethereumTransaction=null,e.prototype.nodeStakeUpdate=null,e.prototype.utilPrng=null,e.prototype.tokenUpdateNfts=null,e.prototype.nodeCreate=null,e.prototype.nodeUpdate=null,e.prototype.nodeDelete=null,e.prototype.tokenReject=null,e.prototype.tokenAirdrop=null,e.prototype.tokenCancelAirdrop=null,e.prototype.tokenClaimAirdrop=null,e.prototype.stateSignatureTransaction=null,e.prototype.historyProofSignature=null,e.prototype.historyProofKeyPublication=null,e.prototype.historyProofVote=null,e.prototype.maxCustomFees=r.emptyArray,Object.defineProperty(e.prototype,"data",{get:r.oneOfGetter(t=["contractCall","contractCreateInstance","contractUpdateInstance","cryptoAddLiveHash","cryptoCreateAccount","cryptoDelete","cryptoDeleteLiveHash","cryptoTransfer","cryptoUpdateAccount","fileAppend","fileCreate","fileDelete","fileUpdate","systemDelete","systemUndelete","contractDeleteInstance","freeze","consensusCreateTopic","consensusUpdateTopic","consensusDeleteTopic","consensusSubmitMessage","uncheckedSubmit","tokenCreation","tokenFreeze","tokenUnfreeze","tokenGrantKyc","tokenRevokeKyc","tokenDeletion","tokenUpdate","tokenMint","tokenBurn","tokenWipe","tokenAssociate","tokenDissociate","scheduleCreate","scheduleDelete","scheduleSign","tokenFeeScheduleUpdate","tokenPause","tokenUnpause","cryptoApproveAllowance","cryptoDeleteAllowance","ethereumTransaction","nodeStakeUpdate","utilPrng","tokenUpdateNfts","nodeCreate","nodeUpdate","nodeDelete","tokenReject","tokenAirdrop","tokenCancelAirdrop","tokenClaimAirdrop","stateSignatureTransaction","historyProofSignature","historyProofKeyPublication","historyProofVote"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.transactionID&&Object.hasOwnProperty.call(e,"transactionID")&&i.proto.TransactionID.encode(e.transactionID,t.uint32(10).fork()).ldelim(),null!=e.nodeAccountID&&Object.hasOwnProperty.call(e,"nodeAccountID")&&i.proto.AccountID.encode(e.nodeAccountID,t.uint32(18).fork()).ldelim(),null!=e.transactionFee&&Object.hasOwnProperty.call(e,"transactionFee")&&t.uint32(24).uint64(e.transactionFee),null!=e.transactionValidDuration&&Object.hasOwnProperty.call(e,"transactionValidDuration")&&i.proto.Duration.encode(e.transactionValidDuration,t.uint32(34).fork()).ldelim(),null!=e.generateRecord&&Object.hasOwnProperty.call(e,"generateRecord")&&t.uint32(40).bool(e.generateRecord),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(50).string(e.memo),null!=e.contractCall&&Object.hasOwnProperty.call(e,"contractCall")&&i.proto.ContractCallTransactionBody.encode(e.contractCall,t.uint32(58).fork()).ldelim(),null!=e.contractCreateInstance&&Object.hasOwnProperty.call(e,"contractCreateInstance")&&i.proto.ContractCreateTransactionBody.encode(e.contractCreateInstance,t.uint32(66).fork()).ldelim(),null!=e.contractUpdateInstance&&Object.hasOwnProperty.call(e,"contractUpdateInstance")&&i.proto.ContractUpdateTransactionBody.encode(e.contractUpdateInstance,t.uint32(74).fork()).ldelim(),null!=e.cryptoAddLiveHash&&Object.hasOwnProperty.call(e,"cryptoAddLiveHash")&&i.proto.CryptoAddLiveHashTransactionBody.encode(e.cryptoAddLiveHash,t.uint32(82).fork()).ldelim(),null!=e.cryptoCreateAccount&&Object.hasOwnProperty.call(e,"cryptoCreateAccount")&&i.proto.CryptoCreateTransactionBody.encode(e.cryptoCreateAccount,t.uint32(90).fork()).ldelim(),null!=e.cryptoDelete&&Object.hasOwnProperty.call(e,"cryptoDelete")&&i.proto.CryptoDeleteTransactionBody.encode(e.cryptoDelete,t.uint32(98).fork()).ldelim(),null!=e.cryptoDeleteLiveHash&&Object.hasOwnProperty.call(e,"cryptoDeleteLiveHash")&&i.proto.CryptoDeleteLiveHashTransactionBody.encode(e.cryptoDeleteLiveHash,t.uint32(106).fork()).ldelim(),null!=e.cryptoTransfer&&Object.hasOwnProperty.call(e,"cryptoTransfer")&&i.proto.CryptoTransferTransactionBody.encode(e.cryptoTransfer,t.uint32(114).fork()).ldelim(),null!=e.cryptoUpdateAccount&&Object.hasOwnProperty.call(e,"cryptoUpdateAccount")&&i.proto.CryptoUpdateTransactionBody.encode(e.cryptoUpdateAccount,t.uint32(122).fork()).ldelim(),null!=e.fileAppend&&Object.hasOwnProperty.call(e,"fileAppend")&&i.proto.FileAppendTransactionBody.encode(e.fileAppend,t.uint32(130).fork()).ldelim(),null!=e.fileCreate&&Object.hasOwnProperty.call(e,"fileCreate")&&i.proto.FileCreateTransactionBody.encode(e.fileCreate,t.uint32(138).fork()).ldelim(),null!=e.fileDelete&&Object.hasOwnProperty.call(e,"fileDelete")&&i.proto.FileDeleteTransactionBody.encode(e.fileDelete,t.uint32(146).fork()).ldelim(),null!=e.fileUpdate&&Object.hasOwnProperty.call(e,"fileUpdate")&&i.proto.FileUpdateTransactionBody.encode(e.fileUpdate,t.uint32(154).fork()).ldelim(),null!=e.systemDelete&&Object.hasOwnProperty.call(e,"systemDelete")&&i.proto.SystemDeleteTransactionBody.encode(e.systemDelete,t.uint32(162).fork()).ldelim(),null!=e.systemUndelete&&Object.hasOwnProperty.call(e,"systemUndelete")&&i.proto.SystemUndeleteTransactionBody.encode(e.systemUndelete,t.uint32(170).fork()).ldelim(),null!=e.contractDeleteInstance&&Object.hasOwnProperty.call(e,"contractDeleteInstance")&&i.proto.ContractDeleteTransactionBody.encode(e.contractDeleteInstance,t.uint32(178).fork()).ldelim(),null!=e.freeze&&Object.hasOwnProperty.call(e,"freeze")&&i.proto.FreezeTransactionBody.encode(e.freeze,t.uint32(186).fork()).ldelim(),null!=e.consensusCreateTopic&&Object.hasOwnProperty.call(e,"consensusCreateTopic")&&i.proto.ConsensusCreateTopicTransactionBody.encode(e.consensusCreateTopic,t.uint32(194).fork()).ldelim(),null!=e.consensusUpdateTopic&&Object.hasOwnProperty.call(e,"consensusUpdateTopic")&&i.proto.ConsensusUpdateTopicTransactionBody.encode(e.consensusUpdateTopic,t.uint32(202).fork()).ldelim(),null!=e.consensusDeleteTopic&&Object.hasOwnProperty.call(e,"consensusDeleteTopic")&&i.proto.ConsensusDeleteTopicTransactionBody.encode(e.consensusDeleteTopic,t.uint32(210).fork()).ldelim(),null!=e.consensusSubmitMessage&&Object.hasOwnProperty.call(e,"consensusSubmitMessage")&&i.proto.ConsensusSubmitMessageTransactionBody.encode(e.consensusSubmitMessage,t.uint32(218).fork()).ldelim(),null!=e.uncheckedSubmit&&Object.hasOwnProperty.call(e,"uncheckedSubmit")&&i.proto.UncheckedSubmitBody.encode(e.uncheckedSubmit,t.uint32(226).fork()).ldelim(),null!=e.tokenCreation&&Object.hasOwnProperty.call(e,"tokenCreation")&&i.proto.TokenCreateTransactionBody.encode(e.tokenCreation,t.uint32(234).fork()).ldelim(),null!=e.tokenFreeze&&Object.hasOwnProperty.call(e,"tokenFreeze")&&i.proto.TokenFreezeAccountTransactionBody.encode(e.tokenFreeze,t.uint32(250).fork()).ldelim(),null!=e.tokenUnfreeze&&Object.hasOwnProperty.call(e,"tokenUnfreeze")&&i.proto.TokenUnfreezeAccountTransactionBody.encode(e.tokenUnfreeze,t.uint32(258).fork()).ldelim(),null!=e.tokenGrantKyc&&Object.hasOwnProperty.call(e,"tokenGrantKyc")&&i.proto.TokenGrantKycTransactionBody.encode(e.tokenGrantKyc,t.uint32(266).fork()).ldelim(),null!=e.tokenRevokeKyc&&Object.hasOwnProperty.call(e,"tokenRevokeKyc")&&i.proto.TokenRevokeKycTransactionBody.encode(e.tokenRevokeKyc,t.uint32(274).fork()).ldelim(),null!=e.tokenDeletion&&Object.hasOwnProperty.call(e,"tokenDeletion")&&i.proto.TokenDeleteTransactionBody.encode(e.tokenDeletion,t.uint32(282).fork()).ldelim(),null!=e.tokenUpdate&&Object.hasOwnProperty.call(e,"tokenUpdate")&&i.proto.TokenUpdateTransactionBody.encode(e.tokenUpdate,t.uint32(290).fork()).ldelim(),null!=e.tokenMint&&Object.hasOwnProperty.call(e,"tokenMint")&&i.proto.TokenMintTransactionBody.encode(e.tokenMint,t.uint32(298).fork()).ldelim(),null!=e.tokenBurn&&Object.hasOwnProperty.call(e,"tokenBurn")&&i.proto.TokenBurnTransactionBody.encode(e.tokenBurn,t.uint32(306).fork()).ldelim(),null!=e.tokenWipe&&Object.hasOwnProperty.call(e,"tokenWipe")&&i.proto.TokenWipeAccountTransactionBody.encode(e.tokenWipe,t.uint32(314).fork()).ldelim(),null!=e.tokenAssociate&&Object.hasOwnProperty.call(e,"tokenAssociate")&&i.proto.TokenAssociateTransactionBody.encode(e.tokenAssociate,t.uint32(322).fork()).ldelim(),null!=e.tokenDissociate&&Object.hasOwnProperty.call(e,"tokenDissociate")&&i.proto.TokenDissociateTransactionBody.encode(e.tokenDissociate,t.uint32(330).fork()).ldelim(),null!=e.scheduleCreate&&Object.hasOwnProperty.call(e,"scheduleCreate")&&i.proto.ScheduleCreateTransactionBody.encode(e.scheduleCreate,t.uint32(338).fork()).ldelim(),null!=e.scheduleDelete&&Object.hasOwnProperty.call(e,"scheduleDelete")&&i.proto.ScheduleDeleteTransactionBody.encode(e.scheduleDelete,t.uint32(346).fork()).ldelim(),null!=e.scheduleSign&&Object.hasOwnProperty.call(e,"scheduleSign")&&i.proto.ScheduleSignTransactionBody.encode(e.scheduleSign,t.uint32(354).fork()).ldelim(),null!=e.tokenFeeScheduleUpdate&&Object.hasOwnProperty.call(e,"tokenFeeScheduleUpdate")&&i.proto.TokenFeeScheduleUpdateTransactionBody.encode(e.tokenFeeScheduleUpdate,t.uint32(362).fork()).ldelim(),null!=e.tokenPause&&Object.hasOwnProperty.call(e,"tokenPause")&&i.proto.TokenPauseTransactionBody.encode(e.tokenPause,t.uint32(370).fork()).ldelim(),null!=e.tokenUnpause&&Object.hasOwnProperty.call(e,"tokenUnpause")&&i.proto.TokenUnpauseTransactionBody.encode(e.tokenUnpause,t.uint32(378).fork()).ldelim(),null!=e.cryptoApproveAllowance&&Object.hasOwnProperty.call(e,"cryptoApproveAllowance")&&i.proto.CryptoApproveAllowanceTransactionBody.encode(e.cryptoApproveAllowance,t.uint32(386).fork()).ldelim(),null!=e.cryptoDeleteAllowance&&Object.hasOwnProperty.call(e,"cryptoDeleteAllowance")&&i.proto.CryptoDeleteAllowanceTransactionBody.encode(e.cryptoDeleteAllowance,t.uint32(394).fork()).ldelim(),null!=e.ethereumTransaction&&Object.hasOwnProperty.call(e,"ethereumTransaction")&&i.proto.EthereumTransactionBody.encode(e.ethereumTransaction,t.uint32(402).fork()).ldelim(),null!=e.nodeStakeUpdate&&Object.hasOwnProperty.call(e,"nodeStakeUpdate")&&i.proto.NodeStakeUpdateTransactionBody.encode(e.nodeStakeUpdate,t.uint32(410).fork()).ldelim(),null!=e.utilPrng&&Object.hasOwnProperty.call(e,"utilPrng")&&i.proto.UtilPrngTransactionBody.encode(e.utilPrng,t.uint32(418).fork()).ldelim(),null!=e.tokenUpdateNfts&&Object.hasOwnProperty.call(e,"tokenUpdateNfts")&&i.proto.TokenUpdateNftsTransactionBody.encode(e.tokenUpdateNfts,t.uint32(426).fork()).ldelim(),null!=e.nodeCreate&&Object.hasOwnProperty.call(e,"nodeCreate")&&i.com.hedera.hapi.node.addressbook.NodeCreateTransactionBody.encode(e.nodeCreate,t.uint32(434).fork()).ldelim(),null!=e.nodeUpdate&&Object.hasOwnProperty.call(e,"nodeUpdate")&&i.com.hedera.hapi.node.addressbook.NodeUpdateTransactionBody.encode(e.nodeUpdate,t.uint32(442).fork()).ldelim(),null!=e.nodeDelete&&Object.hasOwnProperty.call(e,"nodeDelete")&&i.com.hedera.hapi.node.addressbook.NodeDeleteTransactionBody.encode(e.nodeDelete,t.uint32(450).fork()).ldelim(),null!=e.tokenReject&&Object.hasOwnProperty.call(e,"tokenReject")&&i.proto.TokenRejectTransactionBody.encode(e.tokenReject,t.uint32(458).fork()).ldelim(),null!=e.tokenAirdrop&&Object.hasOwnProperty.call(e,"tokenAirdrop")&&i.proto.TokenAirdropTransactionBody.encode(e.tokenAirdrop,t.uint32(466).fork()).ldelim(),null!=e.tokenCancelAirdrop&&Object.hasOwnProperty.call(e,"tokenCancelAirdrop")&&i.proto.TokenCancelAirdropTransactionBody.encode(e.tokenCancelAirdrop,t.uint32(474).fork()).ldelim(),null!=e.tokenClaimAirdrop&&Object.hasOwnProperty.call(e,"tokenClaimAirdrop")&&i.proto.TokenClaimAirdropTransactionBody.encode(e.tokenClaimAirdrop,t.uint32(482).fork()).ldelim(),null!=e.stateSignatureTransaction&&Object.hasOwnProperty.call(e,"stateSignatureTransaction")&&i.com.hedera.hapi.platform.event.StateSignatureTransaction.encode(e.stateSignatureTransaction,t.uint32(522).fork()).ldelim(),null!=e.historyProofSignature&&Object.hasOwnProperty.call(e,"historyProofSignature")&&i.com.hedera.hapi.services.auxiliary.history.HistoryProofSignatureTransactionBody.encode(e.historyProofSignature,t.uint32(554).fork()).ldelim(),null!=e.historyProofKeyPublication&&Object.hasOwnProperty.call(e,"historyProofKeyPublication")&&i.com.hedera.hapi.services.auxiliary.history.HistoryProofKeyPublicationTransactionBody.encode(e.historyProofKeyPublication,t.uint32(562).fork()).ldelim(),null!=e.historyProofVote&&Object.hasOwnProperty.call(e,"historyProofVote")&&i.com.hedera.hapi.services.auxiliary.history.HistoryProofVoteTransactionBody.encode(e.historyProofVote,t.uint32(570).fork()).ldelim(),null!=e.maxCustomFees&&e.maxCustomFees.length)for(var n=0;n<e.maxCustomFees.length;++n)i.proto.CustomFeeLimit.encode(e.maxCustomFees[n],t.uint32(8010).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.transactionID=i.proto.TransactionID.decode(e,e.uint32());break;case 2:r.nodeAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.transactionFee=e.uint64();break;case 4:r.transactionValidDuration=i.proto.Duration.decode(e,e.uint32());break;case 5:r.generateRecord=e.bool();break;case 6:r.memo=e.string();break;case 7:r.contractCall=i.proto.ContractCallTransactionBody.decode(e,e.uint32());break;case 8:r.contractCreateInstance=i.proto.ContractCreateTransactionBody.decode(e,e.uint32());break;case 9:r.contractUpdateInstance=i.proto.ContractUpdateTransactionBody.decode(e,e.uint32());break;case 10:r.cryptoAddLiveHash=i.proto.CryptoAddLiveHashTransactionBody.decode(e,e.uint32());break;case 11:r.cryptoCreateAccount=i.proto.CryptoCreateTransactionBody.decode(e,e.uint32());break;case 12:r.cryptoDelete=i.proto.CryptoDeleteTransactionBody.decode(e,e.uint32());break;case 13:r.cryptoDeleteLiveHash=i.proto.CryptoDeleteLiveHashTransactionBody.decode(e,e.uint32());break;case 14:r.cryptoTransfer=i.proto.CryptoTransferTransactionBody.decode(e,e.uint32());break;case 15:r.cryptoUpdateAccount=i.proto.CryptoUpdateTransactionBody.decode(e,e.uint32());break;case 16:r.fileAppend=i.proto.FileAppendTransactionBody.decode(e,e.uint32());break;case 17:r.fileCreate=i.proto.FileCreateTransactionBody.decode(e,e.uint32());break;case 18:r.fileDelete=i.proto.FileDeleteTransactionBody.decode(e,e.uint32());break;case 19:r.fileUpdate=i.proto.FileUpdateTransactionBody.decode(e,e.uint32());break;case 20:r.systemDelete=i.proto.SystemDeleteTransactionBody.decode(e,e.uint32());break;case 21:r.systemUndelete=i.proto.SystemUndeleteTransactionBody.decode(e,e.uint32());break;case 22:r.contractDeleteInstance=i.proto.ContractDeleteTransactionBody.decode(e,e.uint32());break;case 23:r.freeze=i.proto.FreezeTransactionBody.decode(e,e.uint32());break;case 24:r.consensusCreateTopic=i.proto.ConsensusCreateTopicTransactionBody.decode(e,e.uint32());break;case 25:r.consensusUpdateTopic=i.proto.ConsensusUpdateTopicTransactionBody.decode(e,e.uint32());break;case 26:r.consensusDeleteTopic=i.proto.ConsensusDeleteTopicTransactionBody.decode(e,e.uint32());break;case 27:r.consensusSubmitMessage=i.proto.ConsensusSubmitMessageTransactionBody.decode(e,e.uint32());break;case 28:r.uncheckedSubmit=i.proto.UncheckedSubmitBody.decode(e,e.uint32());break;case 29:r.tokenCreation=i.proto.TokenCreateTransactionBody.decode(e,e.uint32());break;case 31:r.tokenFreeze=i.proto.TokenFreezeAccountTransactionBody.decode(e,e.uint32());break;case 32:r.tokenUnfreeze=i.proto.TokenUnfreezeAccountTransactionBody.decode(e,e.uint32());break;case 33:r.tokenGrantKyc=i.proto.TokenGrantKycTransactionBody.decode(e,e.uint32());break;case 34:r.tokenRevokeKyc=i.proto.TokenRevokeKycTransactionBody.decode(e,e.uint32());break;case 35:r.tokenDeletion=i.proto.TokenDeleteTransactionBody.decode(e,e.uint32());break;case 36:r.tokenUpdate=i.proto.TokenUpdateTransactionBody.decode(e,e.uint32());break;case 37:r.tokenMint=i.proto.TokenMintTransactionBody.decode(e,e.uint32());break;case 38:r.tokenBurn=i.proto.TokenBurnTransactionBody.decode(e,e.uint32());break;case 39:r.tokenWipe=i.proto.TokenWipeAccountTransactionBody.decode(e,e.uint32());break;case 40:r.tokenAssociate=i.proto.TokenAssociateTransactionBody.decode(e,e.uint32());break;case 41:r.tokenDissociate=i.proto.TokenDissociateTransactionBody.decode(e,e.uint32());break;case 42:r.scheduleCreate=i.proto.ScheduleCreateTransactionBody.decode(e,e.uint32());break;case 43:r.scheduleDelete=i.proto.ScheduleDeleteTransactionBody.decode(e,e.uint32());break;case 44:r.scheduleSign=i.proto.ScheduleSignTransactionBody.decode(e,e.uint32());break;case 45:r.tokenFeeScheduleUpdate=i.proto.TokenFeeScheduleUpdateTransactionBody.decode(e,e.uint32());break;case 46:r.tokenPause=i.proto.TokenPauseTransactionBody.decode(e,e.uint32());break;case 47:r.tokenUnpause=i.proto.TokenUnpauseTransactionBody.decode(e,e.uint32());break;case 48:r.cryptoApproveAllowance=i.proto.CryptoApproveAllowanceTransactionBody.decode(e,e.uint32());break;case 49:r.cryptoDeleteAllowance=i.proto.CryptoDeleteAllowanceTransactionBody.decode(e,e.uint32());break;case 50:r.ethereumTransaction=i.proto.EthereumTransactionBody.decode(e,e.uint32());break;case 51:r.nodeStakeUpdate=i.proto.NodeStakeUpdateTransactionBody.decode(e,e.uint32());break;case 52:r.utilPrng=i.proto.UtilPrngTransactionBody.decode(e,e.uint32());break;case 53:r.tokenUpdateNfts=i.proto.TokenUpdateNftsTransactionBody.decode(e,e.uint32());break;case 54:r.nodeCreate=i.com.hedera.hapi.node.addressbook.NodeCreateTransactionBody.decode(e,e.uint32());break;case 55:r.nodeUpdate=i.com.hedera.hapi.node.addressbook.NodeUpdateTransactionBody.decode(e,e.uint32());break;case 56:r.nodeDelete=i.com.hedera.hapi.node.addressbook.NodeDeleteTransactionBody.decode(e,e.uint32());break;case 57:r.tokenReject=i.proto.TokenRejectTransactionBody.decode(e,e.uint32());break;case 58:r.tokenAirdrop=i.proto.TokenAirdropTransactionBody.decode(e,e.uint32());break;case 59:r.tokenCancelAirdrop=i.proto.TokenCancelAirdropTransactionBody.decode(e,e.uint32());break;case 60:r.tokenClaimAirdrop=i.proto.TokenClaimAirdropTransactionBody.decode(e,e.uint32());break;case 65:r.stateSignatureTransaction=i.com.hedera.hapi.platform.event.StateSignatureTransaction.decode(e,e.uint32());break;case 69:r.historyProofSignature=i.com.hedera.hapi.services.auxiliary.history.HistoryProofSignatureTransactionBody.decode(e,e.uint32());break;case 70:r.historyProofKeyPublication=i.com.hedera.hapi.services.auxiliary.history.HistoryProofKeyPublicationTransactionBody.decode(e,e.uint32());break;case 71:r.historyProofVote=i.com.hedera.hapi.services.auxiliary.history.HistoryProofVoteTransactionBody.decode(e,e.uint32());break;case 1001:r.maxCustomFees&&r.maxCustomFees.length||(r.maxCustomFees=[]),r.maxCustomFees.push(i.proto.CustomFeeLimit.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionBody"},e}(),t.ShardID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.shardNum=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.shardNum&&Object.hasOwnProperty.call(e,"shardNum")&&t.uint32(8).int64(e.shardNum),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ShardID;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.shardNum=e.int64();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ShardID"},e}(),t.RealmID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.shardNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.realmNum=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.shardNum&&Object.hasOwnProperty.call(e,"shardNum")&&t.uint32(8).int64(e.shardNum),null!=e.realmNum&&Object.hasOwnProperty.call(e,"realmNum")&&t.uint32(16).int64(e.realmNum),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.RealmID;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.shardNum=e.int64();break;case 2:r.realmNum=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.RealmID"},e}(),t.TokenID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.shardNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.realmNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.tokenNum=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.shardNum&&Object.hasOwnProperty.call(e,"shardNum")&&t.uint32(8).int64(e.shardNum),null!=e.realmNum&&Object.hasOwnProperty.call(e,"realmNum")&&t.uint32(16).int64(e.realmNum),null!=e.tokenNum&&Object.hasOwnProperty.call(e,"tokenNum")&&t.uint32(24).int64(e.tokenNum),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenID;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.shardNum=e.int64();break;case 2:r.realmNum=e.int64();break;case 3:r.tokenNum=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenID"},e}(),t.BlockHashAlgorithm=function(){const e={},t=Object.create(e);return t[e[0]="SHA2_384"]=0,t}(),t.AccountID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.shardNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.realmNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.accountNum=null,e.prototype.alias=null,Object.defineProperty(e.prototype,"account",{get:r.oneOfGetter(t=["accountNum","alias"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.shardNum&&Object.hasOwnProperty.call(e,"shardNum")&&t.uint32(8).int64(e.shardNum),null!=e.realmNum&&Object.hasOwnProperty.call(e,"realmNum")&&t.uint32(16).int64(e.realmNum),null!=e.accountNum&&Object.hasOwnProperty.call(e,"accountNum")&&t.uint32(24).int64(e.accountNum),null!=e.alias&&Object.hasOwnProperty.call(e,"alias")&&t.uint32(34).bytes(e.alias),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.AccountID;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.shardNum=e.int64();break;case 2:r.realmNum=e.int64();break;case 3:r.accountNum=e.int64();break;case 4:r.alias=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.AccountID"},e}(),t.NftID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token_ID=null,e.prototype.serialNumber=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.token_ID&&Object.hasOwnProperty.call(e,"token_ID")&&i.proto.TokenID.encode(e.token_ID,t.uint32(10).fork()).ldelim(),null!=e.serialNumber&&Object.hasOwnProperty.call(e,"serialNumber")&&t.uint32(16).int64(e.serialNumber),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NftID;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token_ID=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.serialNumber=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NftID"},e}(),t.FileID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.shardNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.realmNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.fileNum=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.shardNum&&Object.hasOwnProperty.call(e,"shardNum")&&t.uint32(8).int64(e.shardNum),null!=e.realmNum&&Object.hasOwnProperty.call(e,"realmNum")&&t.uint32(16).int64(e.realmNum),null!=e.fileNum&&Object.hasOwnProperty.call(e,"fileNum")&&t.uint32(24).int64(e.fileNum),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileID;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.shardNum=e.int64();break;case 2:r.realmNum=e.int64();break;case 3:r.fileNum=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileID"},e}(),t.ContractID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.shardNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.realmNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.contractNum=null,e.prototype.evmAddress=null,Object.defineProperty(e.prototype,"contract",{get:r.oneOfGetter(t=["contractNum","evmAddress"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.shardNum&&Object.hasOwnProperty.call(e,"shardNum")&&t.uint32(8).int64(e.shardNum),null!=e.realmNum&&Object.hasOwnProperty.call(e,"realmNum")&&t.uint32(16).int64(e.realmNum),null!=e.contractNum&&Object.hasOwnProperty.call(e,"contractNum")&&t.uint32(24).int64(e.contractNum),null!=e.evmAddress&&Object.hasOwnProperty.call(e,"evmAddress")&&t.uint32(34).bytes(e.evmAddress),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractID;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.shardNum=e.int64();break;case 2:r.realmNum=e.int64();break;case 3:r.contractNum=e.int64();break;case 4:r.evmAddress=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractID"},e}(),t.TopicID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.shardNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.realmNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.topicNum=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.shardNum&&Object.hasOwnProperty.call(e,"shardNum")&&t.uint32(8).int64(e.shardNum),null!=e.realmNum&&Object.hasOwnProperty.call(e,"realmNum")&&t.uint32(16).int64(e.realmNum),null!=e.topicNum&&Object.hasOwnProperty.call(e,"topicNum")&&t.uint32(24).int64(e.topicNum),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TopicID;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.shardNum=e.int64();break;case 2:r.realmNum=e.int64();break;case 3:r.topicNum=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TopicID"},e}(),t.ScheduleID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.shardNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.realmNum=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.scheduleNum=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.shardNum&&Object.hasOwnProperty.call(e,"shardNum")&&t.uint32(8).int64(e.shardNum),null!=e.realmNum&&Object.hasOwnProperty.call(e,"realmNum")&&t.uint32(16).int64(e.realmNum),null!=e.scheduleNum&&Object.hasOwnProperty.call(e,"scheduleNum")&&t.uint32(24).int64(e.scheduleNum),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ScheduleID;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.shardNum=e.int64();break;case 2:r.realmNum=e.int64();break;case 3:r.scheduleNum=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ScheduleID"},e}(),t.TransactionID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.transactionValidStart=null,e.prototype.accountID=null,e.prototype.scheduled=!1,e.prototype.nonce=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.transactionValidStart&&Object.hasOwnProperty.call(e,"transactionValidStart")&&i.proto.Timestamp.encode(e.transactionValidStart,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),null!=e.scheduled&&Object.hasOwnProperty.call(e,"scheduled")&&t.uint32(24).bool(e.scheduled),null!=e.nonce&&Object.hasOwnProperty.call(e,"nonce")&&t.uint32(32).int32(e.nonce),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionID;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.transactionValidStart=i.proto.Timestamp.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.scheduled=e.bool();break;case 4:r.nonce=e.int32();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionID"},e}(),t.AccountAmount=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountID=null,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.isApproval=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(10).fork()).ldelim(),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(16).sint64(e.amount),null!=e.isApproval&&Object.hasOwnProperty.call(e,"isApproval")&&t.uint32(24).bool(e.isApproval),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.AccountAmount;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.amount=e.sint64();break;case 3:r.isApproval=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.AccountAmount"},e}(),t.TransferList=function(){function e(e){if(this.accountAmounts=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountAmounts=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.accountAmounts&&e.accountAmounts.length)for(var n=0;n<e.accountAmounts.length;++n)i.proto.AccountAmount.encode(e.accountAmounts[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransferList;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.accountAmounts&&r.accountAmounts.length||(r.accountAmounts=[]),r.accountAmounts.push(i.proto.AccountAmount.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransferList"},e}(),t.NftTransfer=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.senderAccountID=null,e.prototype.receiverAccountID=null,e.prototype.serialNumber=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.isApproval=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.senderAccountID&&Object.hasOwnProperty.call(e,"senderAccountID")&&i.proto.AccountID.encode(e.senderAccountID,t.uint32(10).fork()).ldelim(),null!=e.receiverAccountID&&Object.hasOwnProperty.call(e,"receiverAccountID")&&i.proto.AccountID.encode(e.receiverAccountID,t.uint32(18).fork()).ldelim(),null!=e.serialNumber&&Object.hasOwnProperty.call(e,"serialNumber")&&t.uint32(24).int64(e.serialNumber),null!=e.isApproval&&Object.hasOwnProperty.call(e,"isApproval")&&t.uint32(32).bool(e.isApproval),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NftTransfer;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.senderAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.receiverAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.serialNumber=e.int64();break;case 4:r.isApproval=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NftTransfer"},e}(),t.TokenTransferList=function(){function e(e){if(this.transfers=[],this.nftTransfers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.prototype.transfers=r.emptyArray,e.prototype.nftTransfers=r.emptyArray,e.prototype.expectedDecimals=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),null!=e.transfers&&e.transfers.length)for(var n=0;n<e.transfers.length;++n)i.proto.AccountAmount.encode(e.transfers[n],t.uint32(18).fork()).ldelim();if(null!=e.nftTransfers&&e.nftTransfers.length)for(n=0;n<e.nftTransfers.length;++n)i.proto.NftTransfer.encode(e.nftTransfers[n],t.uint32(26).fork()).ldelim();return null!=e.expectedDecimals&&Object.hasOwnProperty.call(e,"expectedDecimals")&&i.google.protobuf.UInt32Value.encode(e.expectedDecimals,t.uint32(34).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenTransferList;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.transfers&&r.transfers.length||(r.transfers=[]),r.transfers.push(i.proto.AccountAmount.decode(e,e.uint32()));break;case 3:r.nftTransfers&&r.nftTransfers.length||(r.nftTransfers=[]),r.nftTransfers.push(i.proto.NftTransfer.decode(e,e.uint32()));break;case 4:r.expectedDecimals=i.google.protobuf.UInt32Value.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenTransferList"},e}(),t.Fraction=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.numerator=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.denominator=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.numerator&&Object.hasOwnProperty.call(e,"numerator")&&t.uint32(8).int64(e.numerator),null!=e.denominator&&Object.hasOwnProperty.call(e,"denominator")&&t.uint32(16).int64(e.denominator),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.Fraction;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.numerator=e.int64();break;case 2:r.denominator=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Fraction"},e}(),t.TokenType=function(){const e={},t=Object.create(e);return t[e[0]="FUNGIBLE_COMMON"]=0,t[e[1]="NON_FUNGIBLE_UNIQUE"]=1,t}(),t.SubType=function(){const e={},t=Object.create(e);return t[e[0]="DEFAULT"]=0,t[e[1]="TOKEN_FUNGIBLE_COMMON"]=1,t[e[2]="TOKEN_NON_FUNGIBLE_UNIQUE"]=2,t[e[3]="TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"]=3,t[e[4]="TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"]=4,t[e[5]="SCHEDULE_CREATE_CONTRACT_CALL"]=5,t[e[6]="TOPIC_CREATE_WITH_CUSTOM_FEES"]=6,t}(),t.TokenSupplyType=function(){const e={},t=Object.create(e);return t[e[0]="INFINITE"]=0,t[e[1]="FINITE"]=1,t}(),t.TokenKeyValidation=function(){const e={},t=Object.create(e);return t[e[0]="FULL_VALIDATION"]=0,t[e[1]="NO_VALIDATION"]=1,t}(),t.TokenFreezeStatus=function(){const e={},t=Object.create(e);return t[e[0]="FreezeNotApplicable"]=0,t[e[1]="Frozen"]=1,t[e[2]="Unfrozen"]=2,t}(),t.TokenKycStatus=function(){const e={},t=Object.create(e);return t[e[0]="KycNotApplicable"]=0,t[e[1]="Granted"]=1,t[e[2]="Revoked"]=2,t}(),t.TokenPauseStatus=function(){const e={},t=Object.create(e);return t[e[0]="PauseNotApplicable"]=0,t[e[1]="Paused"]=1,t[e[2]="Unpaused"]=2,t}(),t.Key=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.contractID=null,e.prototype.ed25519=null,e.prototype.RSA_3072=null,e.prototype.ECDSA_384=null,e.prototype.thresholdKey=null,e.prototype.keyList=null,e.prototype.ECDSASecp256k1=null,e.prototype.delegatableContractId=null,Object.defineProperty(e.prototype,"key",{get:r.oneOfGetter(t=["contractID","ed25519","RSA_3072","ECDSA_384","thresholdKey","keyList","ECDSASecp256k1","delegatableContractId"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(10).fork()).ldelim(),null!=e.ed25519&&Object.hasOwnProperty.call(e,"ed25519")&&t.uint32(18).bytes(e.ed25519),null!=e.RSA_3072&&Object.hasOwnProperty.call(e,"RSA_3072")&&t.uint32(26).bytes(e.RSA_3072),null!=e.ECDSA_384&&Object.hasOwnProperty.call(e,"ECDSA_384")&&t.uint32(34).bytes(e.ECDSA_384),null!=e.thresholdKey&&Object.hasOwnProperty.call(e,"thresholdKey")&&i.proto.ThresholdKey.encode(e.thresholdKey,t.uint32(42).fork()).ldelim(),null!=e.keyList&&Object.hasOwnProperty.call(e,"keyList")&&i.proto.KeyList.encode(e.keyList,t.uint32(50).fork()).ldelim(),null!=e.ECDSASecp256k1&&Object.hasOwnProperty.call(e,"ECDSASecp256k1")&&t.uint32(58).bytes(e.ECDSASecp256k1),null!=e.delegatableContractId&&Object.hasOwnProperty.call(e,"delegatableContractId")&&i.proto.ContractID.encode(e.delegatableContractId,t.uint32(66).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.Key;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 2:r.ed25519=e.bytes();break;case 3:r.RSA_3072=e.bytes();break;case 4:r.ECDSA_384=e.bytes();break;case 5:r.thresholdKey=i.proto.ThresholdKey.decode(e,e.uint32());break;case 6:r.keyList=i.proto.KeyList.decode(e,e.uint32());break;case 7:r.ECDSASecp256k1=e.bytes();break;case 8:r.delegatableContractId=i.proto.ContractID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Key"},e}(),t.ThresholdKey=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.threshold=0,e.prototype.keys=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.threshold&&Object.hasOwnProperty.call(e,"threshold")&&t.uint32(8).uint32(e.threshold),null!=e.keys&&Object.hasOwnProperty.call(e,"keys")&&i.proto.KeyList.encode(e.keys,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ThresholdKey;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.threshold=e.uint32();break;case 2:r.keys=i.proto.KeyList.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ThresholdKey"},e}(),t.KeyList=function(){function e(e){if(this.keys=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.keys=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.keys&&e.keys.length)for(var n=0;n<e.keys.length;++n)i.proto.Key.encode(e.keys[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.KeyList;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.keys&&r.keys.length||(r.keys=[]),r.keys.push(i.proto.Key.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.KeyList"},e}(),t.Signature=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.contract=null,e.prototype.ed25519=null,e.prototype.RSA_3072=null,e.prototype.ECDSA_384=null,e.prototype.thresholdSignature=null,e.prototype.signatureList=null,Object.defineProperty(e.prototype,"signature",{get:r.oneOfGetter(t=["contract","ed25519","RSA_3072","ECDSA_384","thresholdSignature","signatureList"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.contract&&Object.hasOwnProperty.call(e,"contract")&&t.uint32(10).bytes(e.contract),null!=e.ed25519&&Object.hasOwnProperty.call(e,"ed25519")&&t.uint32(18).bytes(e.ed25519),null!=e.RSA_3072&&Object.hasOwnProperty.call(e,"RSA_3072")&&t.uint32(26).bytes(e.RSA_3072),null!=e.ECDSA_384&&Object.hasOwnProperty.call(e,"ECDSA_384")&&t.uint32(34).bytes(e.ECDSA_384),null!=e.thresholdSignature&&Object.hasOwnProperty.call(e,"thresholdSignature")&&i.proto.ThresholdSignature.encode(e.thresholdSignature,t.uint32(42).fork()).ldelim(),null!=e.signatureList&&Object.hasOwnProperty.call(e,"signatureList")&&i.proto.SignatureList.encode(e.signatureList,t.uint32(50).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.Signature;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contract=e.bytes();break;case 2:r.ed25519=e.bytes();break;case 3:r.RSA_3072=e.bytes();break;case 4:r.ECDSA_384=e.bytes();break;case 5:r.thresholdSignature=i.proto.ThresholdSignature.decode(e,e.uint32());break;case 6:r.signatureList=i.proto.SignatureList.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Signature"},e}(),t.ThresholdSignature=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sigs=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.sigs&&Object.hasOwnProperty.call(e,"sigs")&&i.proto.SignatureList.encode(e.sigs,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ThresholdSignature;e.pos<o;){var a=e.uint32();if(a>>>3==2)r.sigs=i.proto.SignatureList.decode(e,e.uint32());else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ThresholdSignature"},e}(),t.SignatureList=function(){function e(e){if(this.sigs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sigs=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.sigs&&e.sigs.length)for(var n=0;n<e.sigs.length;++n)i.proto.Signature.encode(e.sigs[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SignatureList;e.pos<o;){var a=e.uint32();if(a>>>3==2)r.sigs&&r.sigs.length||(r.sigs=[]),r.sigs.push(i.proto.Signature.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SignatureList"},e}(),t.SignaturePair=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.pubKeyPrefix=r.newBuffer([]),e.prototype.contract=null,e.prototype.ed25519=null,e.prototype.RSA_3072=null,e.prototype.ECDSA_384=null,e.prototype.ECDSASecp256k1=null,Object.defineProperty(e.prototype,"signature",{get:r.oneOfGetter(t=["contract","ed25519","RSA_3072","ECDSA_384","ECDSASecp256k1"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.pubKeyPrefix&&Object.hasOwnProperty.call(e,"pubKeyPrefix")&&t.uint32(10).bytes(e.pubKeyPrefix),null!=e.contract&&Object.hasOwnProperty.call(e,"contract")&&t.uint32(18).bytes(e.contract),null!=e.ed25519&&Object.hasOwnProperty.call(e,"ed25519")&&t.uint32(26).bytes(e.ed25519),null!=e.RSA_3072&&Object.hasOwnProperty.call(e,"RSA_3072")&&t.uint32(34).bytes(e.RSA_3072),null!=e.ECDSA_384&&Object.hasOwnProperty.call(e,"ECDSA_384")&&t.uint32(42).bytes(e.ECDSA_384),null!=e.ECDSASecp256k1&&Object.hasOwnProperty.call(e,"ECDSASecp256k1")&&t.uint32(50).bytes(e.ECDSASecp256k1),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SignaturePair;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.pubKeyPrefix=e.bytes();break;case 2:r.contract=e.bytes();break;case 3:r.ed25519=e.bytes();break;case 4:r.RSA_3072=e.bytes();break;case 5:r.ECDSA_384=e.bytes();break;case 6:r.ECDSASecp256k1=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SignaturePair"},e}(),t.SignatureMap=function(){function e(e){if(this.sigPair=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sigPair=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.sigPair&&e.sigPair.length)for(var n=0;n<e.sigPair.length;++n)i.proto.SignaturePair.encode(e.sigPair[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SignatureMap;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.sigPair&&r.sigPair.length||(r.sigPair=[]),r.sigPair.push(i.proto.SignaturePair.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SignatureMap"},e}(),t.HederaFunctionality=function(){const e={},t=Object.create(e);return t[e[0]="NONE"]=0,t[e[1]="CryptoTransfer"]=1,t[e[2]="CryptoUpdate"]=2,t[e[3]="CryptoDelete"]=3,t[e[4]="CryptoAddLiveHash"]=4,t[e[5]="CryptoDeleteLiveHash"]=5,t[e[6]="ContractCall"]=6,t[e[7]="ContractCreate"]=7,t[e[8]="ContractUpdate"]=8,t[e[9]="FileCreate"]=9,t[e[10]="FileAppend"]=10,t[e[11]="FileUpdate"]=11,t[e[12]="FileDelete"]=12,t[e[13]="CryptoGetAccountBalance"]=13,t[e[14]="CryptoGetAccountRecords"]=14,t[e[15]="CryptoGetInfo"]=15,t[e[16]="ContractCallLocal"]=16,t[e[17]="ContractGetInfo"]=17,t[e[18]="ContractGetBytecode"]=18,t[e[19]="GetBySolidityID"]=19,t[e[20]="GetByKey"]=20,t[e[21]="CryptoGetLiveHash"]=21,t[e[22]="CryptoGetStakers"]=22,t[e[23]="FileGetContents"]=23,t[e[24]="FileGetInfo"]=24,t[e[25]="TransactionGetRecord"]=25,t[e[26]="ContractGetRecords"]=26,t[e[27]="CryptoCreate"]=27,t[e[28]="SystemDelete"]=28,t[e[29]="SystemUndelete"]=29,t[e[30]="ContractDelete"]=30,t[e[31]="Freeze"]=31,t[e[32]="CreateTransactionRecord"]=32,t[e[33]="CryptoAccountAutoRenew"]=33,t[e[34]="ContractAutoRenew"]=34,t[e[35]="GetVersionInfo"]=35,t[e[36]="TransactionGetReceipt"]=36,t[e[50]="ConsensusCreateTopic"]=50,t[e[51]="ConsensusUpdateTopic"]=51,t[e[52]="ConsensusDeleteTopic"]=52,t[e[53]="ConsensusGetTopicInfo"]=53,t[e[54]="ConsensusSubmitMessage"]=54,t[e[55]="UncheckedSubmit"]=55,t[e[56]="TokenCreate"]=56,t[e[58]="TokenGetInfo"]=58,t[e[59]="TokenFreezeAccount"]=59,t[e[60]="TokenUnfreezeAccount"]=60,t[e[61]="TokenGrantKycToAccount"]=61,t[e[62]="TokenRevokeKycFromAccount"]=62,t[e[63]="TokenDelete"]=63,t[e[64]="TokenUpdate"]=64,t[e[65]="TokenMint"]=65,t[e[66]="TokenBurn"]=66,t[e[67]="TokenAccountWipe"]=67,t[e[68]="TokenAssociateToAccount"]=68,t[e[69]="TokenDissociateFromAccount"]=69,t[e[70]="ScheduleCreate"]=70,t[e[71]="ScheduleDelete"]=71,t[e[72]="ScheduleSign"]=72,t[e[73]="ScheduleGetInfo"]=73,t[e[74]="TokenGetAccountNftInfos"]=74,t[e[75]="TokenGetNftInfo"]=75,t[e[76]="TokenGetNftInfos"]=76,t[e[77]="TokenFeeScheduleUpdate"]=77,t[e[78]="NetworkGetExecutionTime"]=78,t[e[79]="TokenPause"]=79,t[e[80]="TokenUnpause"]=80,t[e[81]="CryptoApproveAllowance"]=81,t[e[82]="CryptoDeleteAllowance"]=82,t[e[83]="GetAccountDetails"]=83,t[e[84]="EthereumTransaction"]=84,t[e[85]="NodeStakeUpdate"]=85,t[e[86]="UtilPrng"]=86,t[e[87]="TransactionGetFastRecord"]=87,t[e[88]="TokenUpdateNfts"]=88,t[e[89]="NodeCreate"]=89,t[e[90]="NodeUpdate"]=90,t[e[91]="NodeDelete"]=91,t[e[92]="TokenReject"]=92,t[e[93]="TokenAirdrop"]=93,t[e[94]="TokenCancelAirdrop"]=94,t[e[95]="TokenClaimAirdrop"]=95,t[e[100]="StateSignatureTransaction"]=100,t[e[104]="HistoryAssemblySignature"]=104,t[e[105]="HistoryProofKeyPublication"]=105,t[e[106]="HistoryProofVote"]=106,t}(),t.FeeComponents=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.min=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.max=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.constant=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.bpt=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.vpt=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.rbh=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.sbh=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.gas=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.tv=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.bpr=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.sbpr=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.min&&Object.hasOwnProperty.call(e,"min")&&t.uint32(8).int64(e.min),null!=e.max&&Object.hasOwnProperty.call(e,"max")&&t.uint32(16).int64(e.max),null!=e.constant&&Object.hasOwnProperty.call(e,"constant")&&t.uint32(24).int64(e.constant),null!=e.bpt&&Object.hasOwnProperty.call(e,"bpt")&&t.uint32(32).int64(e.bpt),null!=e.vpt&&Object.hasOwnProperty.call(e,"vpt")&&t.uint32(40).int64(e.vpt),null!=e.rbh&&Object.hasOwnProperty.call(e,"rbh")&&t.uint32(48).int64(e.rbh),null!=e.sbh&&Object.hasOwnProperty.call(e,"sbh")&&t.uint32(56).int64(e.sbh),null!=e.gas&&Object.hasOwnProperty.call(e,"gas")&&t.uint32(64).int64(e.gas),null!=e.tv&&Object.hasOwnProperty.call(e,"tv")&&t.uint32(72).int64(e.tv),null!=e.bpr&&Object.hasOwnProperty.call(e,"bpr")&&t.uint32(80).int64(e.bpr),null!=e.sbpr&&Object.hasOwnProperty.call(e,"sbpr")&&t.uint32(88).int64(e.sbpr),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FeeComponents;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.min=e.int64();break;case 2:r.max=e.int64();break;case 3:r.constant=e.int64();break;case 4:r.bpt=e.int64();break;case 5:r.vpt=e.int64();break;case 6:r.rbh=e.int64();break;case 7:r.sbh=e.int64();break;case 8:r.gas=e.int64();break;case 9:r.tv=e.int64();break;case 10:r.bpr=e.int64();break;case 11:r.sbpr=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FeeComponents"},e}(),t.TransactionFeeSchedule=function(){function e(e){if(this.fees=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.hederaFunctionality=0,e.prototype.feeData=null,e.prototype.fees=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.hederaFunctionality&&Object.hasOwnProperty.call(e,"hederaFunctionality")&&t.uint32(8).int32(e.hederaFunctionality),null!=e.feeData&&Object.hasOwnProperty.call(e,"feeData")&&i.proto.FeeData.encode(e.feeData,t.uint32(18).fork()).ldelim(),null!=e.fees&&e.fees.length)for(var n=0;n<e.fees.length;++n)i.proto.FeeData.encode(e.fees[n],t.uint32(26).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionFeeSchedule;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.hederaFunctionality=e.int32();break;case 2:r.feeData=i.proto.FeeData.decode(e,e.uint32());break;case 3:r.fees&&r.fees.length||(r.fees=[]),r.fees.push(i.proto.FeeData.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionFeeSchedule"},e}(),t.FeeData=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.nodedata=null,e.prototype.networkdata=null,e.prototype.servicedata=null,e.prototype.subType=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.nodedata&&Object.hasOwnProperty.call(e,"nodedata")&&i.proto.FeeComponents.encode(e.nodedata,t.uint32(10).fork()).ldelim(),null!=e.networkdata&&Object.hasOwnProperty.call(e,"networkdata")&&i.proto.FeeComponents.encode(e.networkdata,t.uint32(18).fork()).ldelim(),null!=e.servicedata&&Object.hasOwnProperty.call(e,"servicedata")&&i.proto.FeeComponents.encode(e.servicedata,t.uint32(26).fork()).ldelim(),null!=e.subType&&Object.hasOwnProperty.call(e,"subType")&&t.uint32(32).int32(e.subType),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FeeData;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.nodedata=i.proto.FeeComponents.decode(e,e.uint32());break;case 2:r.networkdata=i.proto.FeeComponents.decode(e,e.uint32());break;case 3:r.servicedata=i.proto.FeeComponents.decode(e,e.uint32());break;case 4:r.subType=e.int32();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FeeData"},e}(),t.FeeSchedule=function(){function e(e){if(this.transactionFeeSchedule=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.transactionFeeSchedule=r.emptyArray,e.prototype.expiryTime=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.transactionFeeSchedule&&e.transactionFeeSchedule.length)for(var n=0;n<e.transactionFeeSchedule.length;++n)i.proto.TransactionFeeSchedule.encode(e.transactionFeeSchedule[n],t.uint32(10).fork()).ldelim();return null!=e.expiryTime&&Object.hasOwnProperty.call(e,"expiryTime")&&i.proto.TimestampSeconds.encode(e.expiryTime,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FeeSchedule;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.transactionFeeSchedule&&r.transactionFeeSchedule.length||(r.transactionFeeSchedule=[]),r.transactionFeeSchedule.push(i.proto.TransactionFeeSchedule.decode(e,e.uint32()));break;case 2:r.expiryTime=i.proto.TimestampSeconds.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FeeSchedule"},e}(),t.CurrentAndNextFeeSchedule=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.currentFeeSchedule=null,e.prototype.nextFeeSchedule=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.currentFeeSchedule&&Object.hasOwnProperty.call(e,"currentFeeSchedule")&&i.proto.FeeSchedule.encode(e.currentFeeSchedule,t.uint32(10).fork()).ldelim(),null!=e.nextFeeSchedule&&Object.hasOwnProperty.call(e,"nextFeeSchedule")&&i.proto.FeeSchedule.encode(e.nextFeeSchedule,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CurrentAndNextFeeSchedule;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.currentFeeSchedule=i.proto.FeeSchedule.decode(e,e.uint32());break;case 2:r.nextFeeSchedule=i.proto.FeeSchedule.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CurrentAndNextFeeSchedule"},e}(),t.ServiceEndpoint=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ipAddressV4=r.newBuffer([]),e.prototype.port=0,e.prototype.domainName="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.ipAddressV4&&Object.hasOwnProperty.call(e,"ipAddressV4")&&t.uint32(10).bytes(e.ipAddressV4),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(16).int32(e.port),null!=e.domainName&&Object.hasOwnProperty.call(e,"domainName")&&t.uint32(26).string(e.domainName),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ServiceEndpoint;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.ipAddressV4=e.bytes();break;case 2:r.port=e.int32();break;case 3:r.domainName=e.string();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ServiceEndpoint"},e}(),t.NodeAddress=function(){function e(e){if(this.serviceEndpoint=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ipAddress=r.newBuffer([]),e.prototype.portno=0,e.prototype.memo=r.newBuffer([]),e.prototype.RSA_PubKey="",e.prototype.nodeId=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.nodeAccountId=null,e.prototype.nodeCertHash=r.newBuffer([]),e.prototype.serviceEndpoint=r.emptyArray,e.prototype.description="",e.prototype.stake=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.ipAddress&&Object.hasOwnProperty.call(e,"ipAddress")&&t.uint32(10).bytes(e.ipAddress),null!=e.portno&&Object.hasOwnProperty.call(e,"portno")&&t.uint32(16).int32(e.portno),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(26).bytes(e.memo),null!=e.RSA_PubKey&&Object.hasOwnProperty.call(e,"RSA_PubKey")&&t.uint32(34).string(e.RSA_PubKey),null!=e.nodeId&&Object.hasOwnProperty.call(e,"nodeId")&&t.uint32(40).int64(e.nodeId),null!=e.nodeAccountId&&Object.hasOwnProperty.call(e,"nodeAccountId")&&i.proto.AccountID.encode(e.nodeAccountId,t.uint32(50).fork()).ldelim(),null!=e.nodeCertHash&&Object.hasOwnProperty.call(e,"nodeCertHash")&&t.uint32(58).bytes(e.nodeCertHash),null!=e.serviceEndpoint&&e.serviceEndpoint.length)for(var n=0;n<e.serviceEndpoint.length;++n)i.proto.ServiceEndpoint.encode(e.serviceEndpoint[n],t.uint32(66).fork()).ldelim();return null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(74).string(e.description),null!=e.stake&&Object.hasOwnProperty.call(e,"stake")&&t.uint32(80).int64(e.stake),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NodeAddress;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.ipAddress=e.bytes();break;case 2:r.portno=e.int32();break;case 3:r.memo=e.bytes();break;case 4:r.RSA_PubKey=e.string();break;case 5:r.nodeId=e.int64();break;case 6:r.nodeAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 7:r.nodeCertHash=e.bytes();break;case 8:r.serviceEndpoint&&r.serviceEndpoint.length||(r.serviceEndpoint=[]),r.serviceEndpoint.push(i.proto.ServiceEndpoint.decode(e,e.uint32()));break;case 9:r.description=e.string();break;case 10:r.stake=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NodeAddress"},e}(),t.NodeAddressBook=function(){function e(e){if(this.nodeAddress=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.nodeAddress=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.nodeAddress&&e.nodeAddress.length)for(var n=0;n<e.nodeAddress.length;++n)i.proto.NodeAddress.encode(e.nodeAddress[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NodeAddressBook;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.nodeAddress&&r.nodeAddress.length||(r.nodeAddress=[]),r.nodeAddress.push(i.proto.NodeAddress.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NodeAddressBook"},e}(),t.SemanticVersion=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.major=0,e.prototype.minor=0,e.prototype.patch=0,e.prototype.pre="",e.prototype.build="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.major&&Object.hasOwnProperty.call(e,"major")&&t.uint32(8).int32(e.major),null!=e.minor&&Object.hasOwnProperty.call(e,"minor")&&t.uint32(16).int32(e.minor),null!=e.patch&&Object.hasOwnProperty.call(e,"patch")&&t.uint32(24).int32(e.patch),null!=e.pre&&Object.hasOwnProperty.call(e,"pre")&&t.uint32(34).string(e.pre),null!=e.build&&Object.hasOwnProperty.call(e,"build")&&t.uint32(42).string(e.build),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SemanticVersion;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.major=e.int32();break;case 2:r.minor=e.int32();break;case 3:r.patch=e.int32();break;case 4:r.pre=e.string();break;case 5:r.build=e.string();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SemanticVersion"},e}(),t.Setting=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.value="",e.prototype.data=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.Setting;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.name=e.string();break;case 2:r.value=e.string();break;case 3:r.data=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Setting"},e}(),t.ServicesConfigurationList=function(){function e(e){if(this.nameValue=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.nameValue=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.nameValue&&e.nameValue.length)for(var n=0;n<e.nameValue.length;++n)i.proto.Setting.encode(e.nameValue[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ServicesConfigurationList;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.nameValue&&r.nameValue.length||(r.nameValue=[]),r.nameValue.push(i.proto.Setting.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ServicesConfigurationList"},e}(),t.TokenRelationship=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.symbol="",e.prototype.balance=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.kycStatus=0,e.prototype.freezeStatus=0,e.prototype.decimals=0,e.prototype.automaticAssociation=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.symbol&&Object.hasOwnProperty.call(e,"symbol")&&t.uint32(18).string(e.symbol),null!=e.balance&&Object.hasOwnProperty.call(e,"balance")&&t.uint32(24).uint64(e.balance),null!=e.kycStatus&&Object.hasOwnProperty.call(e,"kycStatus")&&t.uint32(32).int32(e.kycStatus),null!=e.freezeStatus&&Object.hasOwnProperty.call(e,"freezeStatus")&&t.uint32(40).int32(e.freezeStatus),null!=e.decimals&&Object.hasOwnProperty.call(e,"decimals")&&t.uint32(48).uint32(e.decimals),null!=e.automaticAssociation&&Object.hasOwnProperty.call(e,"automaticAssociation")&&t.uint32(56).bool(e.automaticAssociation),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenRelationship;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.symbol=e.string();break;case 3:r.balance=e.uint64();break;case 4:r.kycStatus=e.int32();break;case 5:r.freezeStatus=e.int32();break;case 6:r.decimals=e.uint32();break;case 7:r.automaticAssociation=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenRelationship"},e}(),t.TokenBalance=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.balance=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.decimals=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.balance&&Object.hasOwnProperty.call(e,"balance")&&t.uint32(16).uint64(e.balance),null!=e.decimals&&Object.hasOwnProperty.call(e,"decimals")&&t.uint32(24).uint32(e.decimals),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenBalance;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.balance=e.uint64();break;case 3:r.decimals=e.uint32();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenBalance"},e}(),t.TokenBalances=function(){function e(e){if(this.tokenBalances=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenBalances=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.tokenBalances&&e.tokenBalances.length)for(var n=0;n<e.tokenBalances.length;++n)i.proto.TokenBalance.encode(e.tokenBalances[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenBalances;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.tokenBalances&&r.tokenBalances.length||(r.tokenBalances=[]),r.tokenBalances.push(i.proto.TokenBalance.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenBalances"},e}(),t.TokenAssociation=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.accountId=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.accountId&&Object.hasOwnProperty.call(e,"accountId")&&i.proto.AccountID.encode(e.accountId,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenAssociation;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.accountId=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenAssociation"},e}(),t.StakingInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.declineReward=!1,e.prototype.stakePeriodStart=null,e.prototype.pendingReward=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.stakedToMe=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.stakedAccountId=null,e.prototype.stakedNodeId=null,Object.defineProperty(e.prototype,"stakedId",{get:r.oneOfGetter(t=["stakedAccountId","stakedNodeId"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.declineReward&&Object.hasOwnProperty.call(e,"declineReward")&&t.uint32(8).bool(e.declineReward),null!=e.stakePeriodStart&&Object.hasOwnProperty.call(e,"stakePeriodStart")&&i.proto.Timestamp.encode(e.stakePeriodStart,t.uint32(18).fork()).ldelim(),null!=e.pendingReward&&Object.hasOwnProperty.call(e,"pendingReward")&&t.uint32(24).int64(e.pendingReward),null!=e.stakedToMe&&Object.hasOwnProperty.call(e,"stakedToMe")&&t.uint32(32).int64(e.stakedToMe),null!=e.stakedAccountId&&Object.hasOwnProperty.call(e,"stakedAccountId")&&i.proto.AccountID.encode(e.stakedAccountId,t.uint32(42).fork()).ldelim(),null!=e.stakedNodeId&&Object.hasOwnProperty.call(e,"stakedNodeId")&&t.uint32(48).int64(e.stakedNodeId),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.StakingInfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.declineReward=e.bool();break;case 2:r.stakePeriodStart=i.proto.Timestamp.decode(e,e.uint32());break;case 3:r.pendingReward=e.int64();break;case 4:r.stakedToMe=e.int64();break;case 5:r.stakedAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 6:r.stakedNodeId=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.StakingInfo"},e}(),t.PendingAirdropId=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.senderId=null,e.prototype.receiverId=null,e.prototype.fungibleTokenType=null,e.prototype.nonFungibleToken=null,Object.defineProperty(e.prototype,"tokenReference",{get:r.oneOfGetter(t=["fungibleTokenType","nonFungibleToken"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.senderId&&Object.hasOwnProperty.call(e,"senderId")&&i.proto.AccountID.encode(e.senderId,t.uint32(10).fork()).ldelim(),null!=e.receiverId&&Object.hasOwnProperty.call(e,"receiverId")&&i.proto.AccountID.encode(e.receiverId,t.uint32(18).fork()).ldelim(),null!=e.fungibleTokenType&&Object.hasOwnProperty.call(e,"fungibleTokenType")&&i.proto.TokenID.encode(e.fungibleTokenType,t.uint32(26).fork()).ldelim(),null!=e.nonFungibleToken&&Object.hasOwnProperty.call(e,"nonFungibleToken")&&i.proto.NftID.encode(e.nonFungibleToken,t.uint32(34).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.PendingAirdropId;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.senderId=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.receiverId=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.fungibleTokenType=i.proto.TokenID.decode(e,e.uint32());break;case 4:r.nonFungibleToken=i.proto.NftID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.PendingAirdropId"},e}(),t.PendingAirdropValue=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.amount=r.Long?r.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(8).uint64(e.amount),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.PendingAirdropValue;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.amount=e.uint64();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.PendingAirdropValue"},e}(),t.Timestamp=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seconds=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.nanos=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.seconds&&Object.hasOwnProperty.call(e,"seconds")&&t.uint32(8).int64(e.seconds),null!=e.nanos&&Object.hasOwnProperty.call(e,"nanos")&&t.uint32(16).int32(e.nanos),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.Timestamp;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.seconds=e.int64();break;case 2:r.nanos=e.int32();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Timestamp"},e}(),t.TimestampSeconds=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seconds=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.seconds&&Object.hasOwnProperty.call(e,"seconds")&&t.uint32(8).int64(e.seconds),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TimestampSeconds;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.seconds=e.int64();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TimestampSeconds"},e}(),t.SystemDeleteTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.fileID=null,e.prototype.contractID=null,e.prototype.expirationTime=null,Object.defineProperty(e.prototype,"id",{get:r.oneOfGetter(t=["fileID","contractID"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(10).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(18).fork()).ldelim(),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.TimestampSeconds.encode(e.expirationTime,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SystemDeleteTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 2:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 3:r.expirationTime=i.proto.TimestampSeconds.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SystemDeleteTransactionBody"},e}(),t.SystemUndeleteTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.fileID=null,e.prototype.contractID=null,Object.defineProperty(e.prototype,"id",{get:r.oneOfGetter(t=["fileID","contractID"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(10).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SystemUndeleteTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 2:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SystemUndeleteTransactionBody"},e}(),t.FreezeTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.startHour=0,e.prototype.startMin=0,e.prototype.endHour=0,e.prototype.endMin=0,e.prototype.updateFile=null,e.prototype.fileHash=r.newBuffer([]),e.prototype.startTime=null,e.prototype.freezeType=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.startHour&&Object.hasOwnProperty.call(e,"startHour")&&t.uint32(8).int32(e.startHour),null!=e.startMin&&Object.hasOwnProperty.call(e,"startMin")&&t.uint32(16).int32(e.startMin),null!=e.endHour&&Object.hasOwnProperty.call(e,"endHour")&&t.uint32(24).int32(e.endHour),null!=e.endMin&&Object.hasOwnProperty.call(e,"endMin")&&t.uint32(32).int32(e.endMin),null!=e.updateFile&&Object.hasOwnProperty.call(e,"updateFile")&&i.proto.FileID.encode(e.updateFile,t.uint32(42).fork()).ldelim(),null!=e.fileHash&&Object.hasOwnProperty.call(e,"fileHash")&&t.uint32(50).bytes(e.fileHash),null!=e.startTime&&Object.hasOwnProperty.call(e,"startTime")&&i.proto.Timestamp.encode(e.startTime,t.uint32(58).fork()).ldelim(),null!=e.freezeType&&Object.hasOwnProperty.call(e,"freezeType")&&t.uint32(64).int32(e.freezeType),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FreezeTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.startHour=e.int32();break;case 2:r.startMin=e.int32();break;case 3:r.endHour=e.int32();break;case 4:r.endMin=e.int32();break;case 5:r.updateFile=i.proto.FileID.decode(e,e.uint32());break;case 6:r.fileHash=e.bytes();break;case 7:r.startTime=i.proto.Timestamp.decode(e,e.uint32());break;case 8:r.freezeType=e.int32();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FreezeTransactionBody"},e}(),t.FreezeType=function(){const e={},t=Object.create(e);return t[e[0]="UNKNOWN_FREEZE_TYPE"]=0,t[e[1]="FREEZE_ONLY"]=1,t[e[2]="PREPARE_UPGRADE"]=2,t[e[3]="FREEZE_UPGRADE"]=3,t[e[4]="FREEZE_ABORT"]=4,t[e[5]="TELEMETRY_UPGRADE"]=5,t}(),t.ContractCallTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.contractID=null,e.prototype.gas=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.functionParameters=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(10).fork()).ldelim(),null!=e.gas&&Object.hasOwnProperty.call(e,"gas")&&t.uint32(16).int64(e.gas),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(24).int64(e.amount),null!=e.functionParameters&&Object.hasOwnProperty.call(e,"functionParameters")&&t.uint32(34).bytes(e.functionParameters),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractCallTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 2:r.gas=e.int64();break;case 3:r.amount=e.int64();break;case 4:r.functionParameters=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractCallTransactionBody"},e}(),t.ContractCreateTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.fileID=null,e.prototype.initcode=null,e.prototype.adminKey=null,e.prototype.gas=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.initialBalance=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.proxyAccountID=null,e.prototype.autoRenewPeriod=null,e.prototype.constructorParameters=r.newBuffer([]),e.prototype.shardID=null,e.prototype.realmID=null,e.prototype.newRealmAdminKey=null,e.prototype.memo="",e.prototype.maxAutomaticTokenAssociations=0,e.prototype.autoRenewAccountId=null,e.prototype.stakedAccountId=null,e.prototype.stakedNodeId=null,e.prototype.declineReward=!1,Object.defineProperty(e.prototype,"initcodeSource",{get:r.oneOfGetter(t=["fileID","initcode"]),set:r.oneOfSetter(t)}),Object.defineProperty(e.prototype,"stakedId",{get:r.oneOfGetter(t=["stakedAccountId","stakedNodeId"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(10).fork()).ldelim(),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(26).fork()).ldelim(),null!=e.gas&&Object.hasOwnProperty.call(e,"gas")&&t.uint32(32).int64(e.gas),null!=e.initialBalance&&Object.hasOwnProperty.call(e,"initialBalance")&&t.uint32(40).int64(e.initialBalance),null!=e.proxyAccountID&&Object.hasOwnProperty.call(e,"proxyAccountID")&&i.proto.AccountID.encode(e.proxyAccountID,t.uint32(50).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(66).fork()).ldelim(),null!=e.constructorParameters&&Object.hasOwnProperty.call(e,"constructorParameters")&&t.uint32(74).bytes(e.constructorParameters),null!=e.shardID&&Object.hasOwnProperty.call(e,"shardID")&&i.proto.ShardID.encode(e.shardID,t.uint32(82).fork()).ldelim(),null!=e.realmID&&Object.hasOwnProperty.call(e,"realmID")&&i.proto.RealmID.encode(e.realmID,t.uint32(90).fork()).ldelim(),null!=e.newRealmAdminKey&&Object.hasOwnProperty.call(e,"newRealmAdminKey")&&i.proto.Key.encode(e.newRealmAdminKey,t.uint32(98).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(106).string(e.memo),null!=e.maxAutomaticTokenAssociations&&Object.hasOwnProperty.call(e,"maxAutomaticTokenAssociations")&&t.uint32(112).int32(e.maxAutomaticTokenAssociations),null!=e.autoRenewAccountId&&Object.hasOwnProperty.call(e,"autoRenewAccountId")&&i.proto.AccountID.encode(e.autoRenewAccountId,t.uint32(122).fork()).ldelim(),null!=e.initcode&&Object.hasOwnProperty.call(e,"initcode")&&t.uint32(130).bytes(e.initcode),null!=e.stakedAccountId&&Object.hasOwnProperty.call(e,"stakedAccountId")&&i.proto.AccountID.encode(e.stakedAccountId,t.uint32(138).fork()).ldelim(),null!=e.stakedNodeId&&Object.hasOwnProperty.call(e,"stakedNodeId")&&t.uint32(144).int64(e.stakedNodeId),null!=e.declineReward&&Object.hasOwnProperty.call(e,"declineReward")&&t.uint32(152).bool(e.declineReward),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractCreateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 16:r.initcode=e.bytes();break;case 3:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 4:r.gas=e.int64();break;case 5:r.initialBalance=e.int64();break;case 6:r.proxyAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 8:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 9:r.constructorParameters=e.bytes();break;case 10:r.shardID=i.proto.ShardID.decode(e,e.uint32());break;case 11:r.realmID=i.proto.RealmID.decode(e,e.uint32());break;case 12:r.newRealmAdminKey=i.proto.Key.decode(e,e.uint32());break;case 13:r.memo=e.string();break;case 14:r.maxAutomaticTokenAssociations=e.int32();break;case 15:r.autoRenewAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 17:r.stakedAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 18:r.stakedNodeId=e.int64();break;case 19:r.declineReward=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractCreateTransactionBody"},e}(),t.Duration=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seconds=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.seconds&&Object.hasOwnProperty.call(e,"seconds")&&t.uint32(8).int64(e.seconds),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.Duration;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.seconds=e.int64();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Duration"},e}(),t.ContractUpdateTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.contractID=null,e.prototype.expirationTime=null,e.prototype.adminKey=null,e.prototype.proxyAccountID=null,e.prototype.autoRenewPeriod=null,e.prototype.fileID=null,e.prototype.memo=null,e.prototype.memoWrapper=null,e.prototype.maxAutomaticTokenAssociations=null,e.prototype.autoRenewAccountId=null,e.prototype.stakedAccountId=null,e.prototype.stakedNodeId=null,e.prototype.declineReward=null,Object.defineProperty(e.prototype,"memoField",{get:r.oneOfGetter(t=["memo","memoWrapper"]),set:r.oneOfSetter(t)}),Object.defineProperty(e.prototype,"stakedId",{get:r.oneOfGetter(t=["stakedAccountId","stakedNodeId"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(10).fork()).ldelim(),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(18).fork()).ldelim(),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(26).fork()).ldelim(),null!=e.proxyAccountID&&Object.hasOwnProperty.call(e,"proxyAccountID")&&i.proto.AccountID.encode(e.proxyAccountID,t.uint32(50).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(58).fork()).ldelim(),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(66).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(74).string(e.memo),null!=e.memoWrapper&&Object.hasOwnProperty.call(e,"memoWrapper")&&i.google.protobuf.StringValue.encode(e.memoWrapper,t.uint32(82).fork()).ldelim(),null!=e.maxAutomaticTokenAssociations&&Object.hasOwnProperty.call(e,"maxAutomaticTokenAssociations")&&i.google.protobuf.Int32Value.encode(e.maxAutomaticTokenAssociations,t.uint32(90).fork()).ldelim(),null!=e.autoRenewAccountId&&Object.hasOwnProperty.call(e,"autoRenewAccountId")&&i.proto.AccountID.encode(e.autoRenewAccountId,t.uint32(98).fork()).ldelim(),null!=e.stakedAccountId&&Object.hasOwnProperty.call(e,"stakedAccountId")&&i.proto.AccountID.encode(e.stakedAccountId,t.uint32(106).fork()).ldelim(),null!=e.stakedNodeId&&Object.hasOwnProperty.call(e,"stakedNodeId")&&t.uint32(112).int64(e.stakedNodeId),null!=e.declineReward&&Object.hasOwnProperty.call(e,"declineReward")&&i.google.protobuf.BoolValue.encode(e.declineReward,t.uint32(122).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractUpdateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 2:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 3:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 6:r.proxyAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 7:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 8:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 9:r.memo=e.string();break;case 10:r.memoWrapper=i.google.protobuf.StringValue.decode(e,e.uint32());break;case 11:r.maxAutomaticTokenAssociations=i.google.protobuf.Int32Value.decode(e,e.uint32());break;case 12:r.autoRenewAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 13:r.stakedAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 14:r.stakedNodeId=e.int64();break;case 15:r.declineReward=i.google.protobuf.BoolValue.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractUpdateTransactionBody"},e}(),t.LiveHash=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountId=null,e.prototype.hash=r.newBuffer([]),e.prototype.keys=null,e.prototype.duration=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.accountId&&Object.hasOwnProperty.call(e,"accountId")&&i.proto.AccountID.encode(e.accountId,t.uint32(10).fork()).ldelim(),null!=e.hash&&Object.hasOwnProperty.call(e,"hash")&&t.uint32(18).bytes(e.hash),null!=e.keys&&Object.hasOwnProperty.call(e,"keys")&&i.proto.KeyList.encode(e.keys,t.uint32(26).fork()).ldelim(),null!=e.duration&&Object.hasOwnProperty.call(e,"duration")&&i.proto.Duration.encode(e.duration,t.uint32(42).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.LiveHash;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountId=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.hash=e.bytes();break;case 3:r.keys=i.proto.KeyList.decode(e,e.uint32());break;case 5:r.duration=i.proto.Duration.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.LiveHash"},e}(),t.CryptoAddLiveHashTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.liveHash=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.liveHash&&Object.hasOwnProperty.call(e,"liveHash")&&i.proto.LiveHash.encode(e.liveHash,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoAddLiveHashTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==3)r.liveHash=i.proto.LiveHash.decode(e,e.uint32());else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoAddLiveHashTransactionBody"},e}(),t.CryptoCreateTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.key=null,e.prototype.initialBalance=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.proxyAccountID=null,e.prototype.sendRecordThreshold=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.receiveRecordThreshold=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.receiverSigRequired=!1,e.prototype.autoRenewPeriod=null,e.prototype.shardID=null,e.prototype.realmID=null,e.prototype.newRealmAdminKey=null,e.prototype.memo="",e.prototype.maxAutomaticTokenAssociations=0,e.prototype.stakedAccountId=null,e.prototype.stakedNodeId=null,e.prototype.declineReward=!1,e.prototype.alias=r.newBuffer([]),Object.defineProperty(e.prototype,"stakedId",{get:r.oneOfGetter(t=["stakedAccountId","stakedNodeId"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&i.proto.Key.encode(e.key,t.uint32(10).fork()).ldelim(),null!=e.initialBalance&&Object.hasOwnProperty.call(e,"initialBalance")&&t.uint32(16).uint64(e.initialBalance),null!=e.proxyAccountID&&Object.hasOwnProperty.call(e,"proxyAccountID")&&i.proto.AccountID.encode(e.proxyAccountID,t.uint32(26).fork()).ldelim(),null!=e.sendRecordThreshold&&Object.hasOwnProperty.call(e,"sendRecordThreshold")&&t.uint32(48).uint64(e.sendRecordThreshold),null!=e.receiveRecordThreshold&&Object.hasOwnProperty.call(e,"receiveRecordThreshold")&&t.uint32(56).uint64(e.receiveRecordThreshold),null!=e.receiverSigRequired&&Object.hasOwnProperty.call(e,"receiverSigRequired")&&t.uint32(64).bool(e.receiverSigRequired),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(74).fork()).ldelim(),null!=e.shardID&&Object.hasOwnProperty.call(e,"shardID")&&i.proto.ShardID.encode(e.shardID,t.uint32(82).fork()).ldelim(),null!=e.realmID&&Object.hasOwnProperty.call(e,"realmID")&&i.proto.RealmID.encode(e.realmID,t.uint32(90).fork()).ldelim(),null!=e.newRealmAdminKey&&Object.hasOwnProperty.call(e,"newRealmAdminKey")&&i.proto.Key.encode(e.newRealmAdminKey,t.uint32(98).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(106).string(e.memo),null!=e.maxAutomaticTokenAssociations&&Object.hasOwnProperty.call(e,"maxAutomaticTokenAssociations")&&t.uint32(112).int32(e.maxAutomaticTokenAssociations),null!=e.stakedAccountId&&Object.hasOwnProperty.call(e,"stakedAccountId")&&i.proto.AccountID.encode(e.stakedAccountId,t.uint32(122).fork()).ldelim(),null!=e.stakedNodeId&&Object.hasOwnProperty.call(e,"stakedNodeId")&&t.uint32(128).int64(e.stakedNodeId),null!=e.declineReward&&Object.hasOwnProperty.call(e,"declineReward")&&t.uint32(136).bool(e.declineReward),null!=e.alias&&Object.hasOwnProperty.call(e,"alias")&&t.uint32(146).bytes(e.alias),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoCreateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.key=i.proto.Key.decode(e,e.uint32());break;case 2:r.initialBalance=e.uint64();break;case 3:r.proxyAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 6:r.sendRecordThreshold=e.uint64();break;case 7:r.receiveRecordThreshold=e.uint64();break;case 8:r.receiverSigRequired=e.bool();break;case 9:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 10:r.shardID=i.proto.ShardID.decode(e,e.uint32());break;case 11:r.realmID=i.proto.RealmID.decode(e,e.uint32());break;case 12:r.newRealmAdminKey=i.proto.Key.decode(e,e.uint32());break;case 13:r.memo=e.string();break;case 14:r.maxAutomaticTokenAssociations=e.int32();break;case 15:r.stakedAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 16:r.stakedNodeId=e.int64();break;case 17:r.declineReward=e.bool();break;case 18:r.alias=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoCreateTransactionBody"},e}(),t.CryptoDeleteTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.transferAccountID=null,e.prototype.deleteAccountID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.transferAccountID&&Object.hasOwnProperty.call(e,"transferAccountID")&&i.proto.AccountID.encode(e.transferAccountID,t.uint32(10).fork()).ldelim(),null!=e.deleteAccountID&&Object.hasOwnProperty.call(e,"deleteAccountID")&&i.proto.AccountID.encode(e.deleteAccountID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoDeleteTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.transferAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.deleteAccountID=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoDeleteTransactionBody"},e}(),t.CryptoDeleteLiveHashTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountOfLiveHash=null,e.prototype.liveHashToDelete=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.accountOfLiveHash&&Object.hasOwnProperty.call(e,"accountOfLiveHash")&&i.proto.AccountID.encode(e.accountOfLiveHash,t.uint32(10).fork()).ldelim(),null!=e.liveHashToDelete&&Object.hasOwnProperty.call(e,"liveHashToDelete")&&t.uint32(18).bytes(e.liveHashToDelete),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoDeleteLiveHashTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountOfLiveHash=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.liveHashToDelete=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoDeleteLiveHashTransactionBody"},e}(),t.CryptoTransferTransactionBody=function(){function e(e){if(this.tokenTransfers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.transfers=null,e.prototype.tokenTransfers=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.transfers&&Object.hasOwnProperty.call(e,"transfers")&&i.proto.TransferList.encode(e.transfers,t.uint32(10).fork()).ldelim(),null!=e.tokenTransfers&&e.tokenTransfers.length)for(var n=0;n<e.tokenTransfers.length;++n)i.proto.TokenTransferList.encode(e.tokenTransfers[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoTransferTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.transfers=i.proto.TransferList.decode(e,e.uint32());break;case 2:r.tokenTransfers&&r.tokenTransfers.length||(r.tokenTransfers=[]),r.tokenTransfers.push(i.proto.TokenTransferList.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoTransferTransactionBody"},e}(),t.CryptoUpdateTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.accountIDToUpdate=null,e.prototype.key=null,e.prototype.proxyAccountID=null,e.prototype.proxyFraction=0,e.prototype.sendRecordThreshold=null,e.prototype.sendRecordThresholdWrapper=null,e.prototype.receiveRecordThreshold=null,e.prototype.receiveRecordThresholdWrapper=null,e.prototype.autoRenewPeriod=null,e.prototype.expirationTime=null,e.prototype.receiverSigRequired=null,e.prototype.receiverSigRequiredWrapper=null,e.prototype.memo=null,e.prototype.maxAutomaticTokenAssociations=null,e.prototype.stakedAccountId=null,e.prototype.stakedNodeId=null,e.prototype.declineReward=null,Object.defineProperty(e.prototype,"sendRecordThresholdField",{get:r.oneOfGetter(t=["sendRecordThreshold","sendRecordThresholdWrapper"]),set:r.oneOfSetter(t)}),Object.defineProperty(e.prototype,"receiveRecordThresholdField",{get:r.oneOfGetter(t=["receiveRecordThreshold","receiveRecordThresholdWrapper"]),set:r.oneOfSetter(t)}),Object.defineProperty(e.prototype,"receiverSigRequiredField",{get:r.oneOfGetter(t=["receiverSigRequired","receiverSigRequiredWrapper"]),set:r.oneOfSetter(t)}),Object.defineProperty(e.prototype,"stakedId",{get:r.oneOfGetter(t=["stakedAccountId","stakedNodeId"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.accountIDToUpdate&&Object.hasOwnProperty.call(e,"accountIDToUpdate")&&i.proto.AccountID.encode(e.accountIDToUpdate,t.uint32(18).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&i.proto.Key.encode(e.key,t.uint32(26).fork()).ldelim(),null!=e.proxyAccountID&&Object.hasOwnProperty.call(e,"proxyAccountID")&&i.proto.AccountID.encode(e.proxyAccountID,t.uint32(34).fork()).ldelim(),null!=e.proxyFraction&&Object.hasOwnProperty.call(e,"proxyFraction")&&t.uint32(40).int32(e.proxyFraction),null!=e.sendRecordThreshold&&Object.hasOwnProperty.call(e,"sendRecordThreshold")&&t.uint32(48).uint64(e.sendRecordThreshold),null!=e.receiveRecordThreshold&&Object.hasOwnProperty.call(e,"receiveRecordThreshold")&&t.uint32(56).uint64(e.receiveRecordThreshold),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(66).fork()).ldelim(),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(74).fork()).ldelim(),null!=e.receiverSigRequired&&Object.hasOwnProperty.call(e,"receiverSigRequired")&&t.uint32(80).bool(e.receiverSigRequired),null!=e.sendRecordThresholdWrapper&&Object.hasOwnProperty.call(e,"sendRecordThresholdWrapper")&&i.google.protobuf.UInt64Value.encode(e.sendRecordThresholdWrapper,t.uint32(90).fork()).ldelim(),null!=e.receiveRecordThresholdWrapper&&Object.hasOwnProperty.call(e,"receiveRecordThresholdWrapper")&&i.google.protobuf.UInt64Value.encode(e.receiveRecordThresholdWrapper,t.uint32(98).fork()).ldelim(),null!=e.receiverSigRequiredWrapper&&Object.hasOwnProperty.call(e,"receiverSigRequiredWrapper")&&i.google.protobuf.BoolValue.encode(e.receiverSigRequiredWrapper,t.uint32(106).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&i.google.protobuf.StringValue.encode(e.memo,t.uint32(114).fork()).ldelim(),null!=e.maxAutomaticTokenAssociations&&Object.hasOwnProperty.call(e,"maxAutomaticTokenAssociations")&&i.google.protobuf.Int32Value.encode(e.maxAutomaticTokenAssociations,t.uint32(122).fork()).ldelim(),null!=e.stakedAccountId&&Object.hasOwnProperty.call(e,"stakedAccountId")&&i.proto.AccountID.encode(e.stakedAccountId,t.uint32(130).fork()).ldelim(),null!=e.stakedNodeId&&Object.hasOwnProperty.call(e,"stakedNodeId")&&t.uint32(136).int64(e.stakedNodeId),null!=e.declineReward&&Object.hasOwnProperty.call(e,"declineReward")&&i.google.protobuf.BoolValue.encode(e.declineReward,t.uint32(146).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoUpdateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 2:r.accountIDToUpdate=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.key=i.proto.Key.decode(e,e.uint32());break;case 4:r.proxyAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 5:r.proxyFraction=e.int32();break;case 6:r.sendRecordThreshold=e.uint64();break;case 11:r.sendRecordThresholdWrapper=i.google.protobuf.UInt64Value.decode(e,e.uint32());break;case 7:r.receiveRecordThreshold=e.uint64();break;case 12:r.receiveRecordThresholdWrapper=i.google.protobuf.UInt64Value.decode(e,e.uint32());break;case 8:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 9:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 10:r.receiverSigRequired=e.bool();break;case 13:r.receiverSigRequiredWrapper=i.google.protobuf.BoolValue.decode(e,e.uint32());break;case 14:r.memo=i.google.protobuf.StringValue.decode(e,e.uint32());break;case 15:r.maxAutomaticTokenAssociations=i.google.protobuf.Int32Value.decode(e,e.uint32());break;case 16:r.stakedAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 17:r.stakedNodeId=e.int64();break;case 18:r.declineReward=i.google.protobuf.BoolValue.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoUpdateTransactionBody"},e}(),t.CryptoApproveAllowanceTransactionBody=function(){function e(e){if(this.cryptoAllowances=[],this.nftAllowances=[],this.tokenAllowances=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.cryptoAllowances=r.emptyArray,e.prototype.nftAllowances=r.emptyArray,e.prototype.tokenAllowances=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.cryptoAllowances&&e.cryptoAllowances.length)for(var n=0;n<e.cryptoAllowances.length;++n)i.proto.CryptoAllowance.encode(e.cryptoAllowances[n],t.uint32(10).fork()).ldelim();if(null!=e.nftAllowances&&e.nftAllowances.length)for(n=0;n<e.nftAllowances.length;++n)i.proto.NftAllowance.encode(e.nftAllowances[n],t.uint32(18).fork()).ldelim();if(null!=e.tokenAllowances&&e.tokenAllowances.length)for(n=0;n<e.tokenAllowances.length;++n)i.proto.TokenAllowance.encode(e.tokenAllowances[n],t.uint32(26).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoApproveAllowanceTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.cryptoAllowances&&r.cryptoAllowances.length||(r.cryptoAllowances=[]),r.cryptoAllowances.push(i.proto.CryptoAllowance.decode(e,e.uint32()));break;case 2:r.nftAllowances&&r.nftAllowances.length||(r.nftAllowances=[]),r.nftAllowances.push(i.proto.NftAllowance.decode(e,e.uint32()));break;case 3:r.tokenAllowances&&r.tokenAllowances.length||(r.tokenAllowances=[]),r.tokenAllowances.push(i.proto.TokenAllowance.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoApproveAllowanceTransactionBody"},e}(),t.CryptoAllowance=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.owner=null,e.prototype.spender=null,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.owner&&Object.hasOwnProperty.call(e,"owner")&&i.proto.AccountID.encode(e.owner,t.uint32(10).fork()).ldelim(),null!=e.spender&&Object.hasOwnProperty.call(e,"spender")&&i.proto.AccountID.encode(e.spender,t.uint32(18).fork()).ldelim(),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(24).int64(e.amount),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoAllowance;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.owner=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.spender=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.amount=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoAllowance"},e}(),t.NftAllowance=function(){function e(e){if(this.serialNumbers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.owner=null,e.prototype.spender=null,e.prototype.serialNumbers=r.emptyArray,e.prototype.approvedForAll=null,e.prototype.delegatingSpender=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.owner&&Object.hasOwnProperty.call(e,"owner")&&i.proto.AccountID.encode(e.owner,t.uint32(18).fork()).ldelim(),null!=e.spender&&Object.hasOwnProperty.call(e,"spender")&&i.proto.AccountID.encode(e.spender,t.uint32(26).fork()).ldelim(),null!=e.serialNumbers&&e.serialNumbers.length){t.uint32(34).fork();for(var n=0;n<e.serialNumbers.length;++n)t.int64(e.serialNumbers[n]);t.ldelim()}return null!=e.approvedForAll&&Object.hasOwnProperty.call(e,"approvedForAll")&&i.google.protobuf.BoolValue.encode(e.approvedForAll,t.uint32(42).fork()).ldelim(),null!=e.delegatingSpender&&Object.hasOwnProperty.call(e,"delegatingSpender")&&i.proto.AccountID.encode(e.delegatingSpender,t.uint32(50).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NftAllowance;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.owner=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.spender=i.proto.AccountID.decode(e,e.uint32());break;case 4:if(r.serialNumbers&&r.serialNumbers.length||(r.serialNumbers=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)r.serialNumbers.push(e.int64());else r.serialNumbers.push(e.int64());break;case 5:r.approvedForAll=i.google.protobuf.BoolValue.decode(e,e.uint32());break;case 6:r.delegatingSpender=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NftAllowance"},e}(),t.TokenAllowance=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.owner=null,e.prototype.spender=null,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.owner&&Object.hasOwnProperty.call(e,"owner")&&i.proto.AccountID.encode(e.owner,t.uint32(18).fork()).ldelim(),null!=e.spender&&Object.hasOwnProperty.call(e,"spender")&&i.proto.AccountID.encode(e.spender,t.uint32(26).fork()).ldelim(),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(32).int64(e.amount),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenAllowance;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.owner=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.spender=i.proto.AccountID.decode(e,e.uint32());break;case 4:r.amount=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenAllowance"},e}(),t.CryptoDeleteAllowanceTransactionBody=function(){function e(e){if(this.nftAllowances=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.nftAllowances=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.nftAllowances&&e.nftAllowances.length)for(var n=0;n<e.nftAllowances.length;++n)i.proto.NftRemoveAllowance.encode(e.nftAllowances[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoDeleteAllowanceTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==2)r.nftAllowances&&r.nftAllowances.length||(r.nftAllowances=[]),r.nftAllowances.push(i.proto.NftRemoveAllowance.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoDeleteAllowanceTransactionBody"},e}(),t.NftRemoveAllowance=function(){function e(e){if(this.serialNumbers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.owner=null,e.prototype.serialNumbers=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.owner&&Object.hasOwnProperty.call(e,"owner")&&i.proto.AccountID.encode(e.owner,t.uint32(18).fork()).ldelim(),null!=e.serialNumbers&&e.serialNumbers.length){t.uint32(26).fork();for(var n=0;n<e.serialNumbers.length;++n)t.int64(e.serialNumbers[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NftRemoveAllowance;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.owner=i.proto.AccountID.decode(e,e.uint32());break;case 3:if(r.serialNumbers&&r.serialNumbers.length||(r.serialNumbers=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)r.serialNumbers.push(e.int64());else r.serialNumbers.push(e.int64());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NftRemoveAllowance"},e}(),t.EthereumTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ethereumData=r.newBuffer([]),e.prototype.callData=null,e.prototype.maxGasAllowance=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.ethereumData&&Object.hasOwnProperty.call(e,"ethereumData")&&t.uint32(10).bytes(e.ethereumData),null!=e.callData&&Object.hasOwnProperty.call(e,"callData")&&i.proto.FileID.encode(e.callData,t.uint32(18).fork()).ldelim(),null!=e.maxGasAllowance&&Object.hasOwnProperty.call(e,"maxGasAllowance")&&t.uint32(24).int64(e.maxGasAllowance),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.EthereumTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.ethereumData=e.bytes();break;case 2:r.callData=i.proto.FileID.decode(e,e.uint32());break;case 3:r.maxGasAllowance=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.EthereumTransactionBody"},e}(),t.FileAppendTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.fileID=null,e.prototype.contents=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(18).fork()).ldelim(),null!=e.contents&&Object.hasOwnProperty.call(e,"contents")&&t.uint32(34).bytes(e.contents),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileAppendTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 2:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 4:r.contents=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileAppendTransactionBody"},e}(),t.FileCreateTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.expirationTime=null,e.prototype.keys=null,e.prototype.contents=r.newBuffer([]),e.prototype.shardID=null,e.prototype.realmID=null,e.prototype.newRealmAdminKey=null,e.prototype.memo="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(18).fork()).ldelim(),null!=e.keys&&Object.hasOwnProperty.call(e,"keys")&&i.proto.KeyList.encode(e.keys,t.uint32(26).fork()).ldelim(),null!=e.contents&&Object.hasOwnProperty.call(e,"contents")&&t.uint32(34).bytes(e.contents),null!=e.shardID&&Object.hasOwnProperty.call(e,"shardID")&&i.proto.ShardID.encode(e.shardID,t.uint32(42).fork()).ldelim(),null!=e.realmID&&Object.hasOwnProperty.call(e,"realmID")&&i.proto.RealmID.encode(e.realmID,t.uint32(50).fork()).ldelim(),null!=e.newRealmAdminKey&&Object.hasOwnProperty.call(e,"newRealmAdminKey")&&i.proto.Key.encode(e.newRealmAdminKey,t.uint32(58).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(66).string(e.memo),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileCreateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 2:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 3:r.keys=i.proto.KeyList.decode(e,e.uint32());break;case 4:r.contents=e.bytes();break;case 5:r.shardID=i.proto.ShardID.decode(e,e.uint32());break;case 6:r.realmID=i.proto.RealmID.decode(e,e.uint32());break;case 7:r.newRealmAdminKey=i.proto.Key.decode(e,e.uint32());break;case 8:r.memo=e.string();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileCreateTransactionBody"},e}(),t.FileDeleteTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.fileID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileDeleteTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==2)r.fileID=i.proto.FileID.decode(e,e.uint32());else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileDeleteTransactionBody"},e}(),t.FileUpdateTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.fileID=null,e.prototype.expirationTime=null,e.prototype.keys=null,e.prototype.contents=r.newBuffer([]),e.prototype.memo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(10).fork()).ldelim(),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(18).fork()).ldelim(),null!=e.keys&&Object.hasOwnProperty.call(e,"keys")&&i.proto.KeyList.encode(e.keys,t.uint32(26).fork()).ldelim(),null!=e.contents&&Object.hasOwnProperty.call(e,"contents")&&t.uint32(34).bytes(e.contents),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&i.google.protobuf.StringValue.encode(e.memo,t.uint32(42).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileUpdateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 2:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 3:r.keys=i.proto.KeyList.decode(e,e.uint32());break;case 4:r.contents=e.bytes();break;case 5:r.memo=i.google.protobuf.StringValue.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileUpdateTransactionBody"},e}(),t.ContractDeleteTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.contractID=null,e.prototype.transferAccountID=null,e.prototype.transferContractID=null,e.prototype.permanentRemoval=!1,Object.defineProperty(e.prototype,"obtainers",{get:r.oneOfGetter(t=["transferAccountID","transferContractID"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(10).fork()).ldelim(),null!=e.transferAccountID&&Object.hasOwnProperty.call(e,"transferAccountID")&&i.proto.AccountID.encode(e.transferAccountID,t.uint32(18).fork()).ldelim(),null!=e.transferContractID&&Object.hasOwnProperty.call(e,"transferContractID")&&i.proto.ContractID.encode(e.transferContractID,t.uint32(26).fork()).ldelim(),null!=e.permanentRemoval&&Object.hasOwnProperty.call(e,"permanentRemoval")&&t.uint32(32).bool(e.permanentRemoval),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractDeleteTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 2:r.transferAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.transferContractID=i.proto.ContractID.decode(e,e.uint32());break;case 4:r.permanentRemoval=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractDeleteTransactionBody"},e}(),t.ConsensusCreateTopicTransactionBody=function(){function e(e){if(this.feeExemptKeyList=[],this.customFees=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.memo="",e.prototype.adminKey=null,e.prototype.submitKey=null,e.prototype.autoRenewPeriod=null,e.prototype.autoRenewAccount=null,e.prototype.feeScheduleKey=null,e.prototype.feeExemptKeyList=r.emptyArray,e.prototype.customFees=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(10).string(e.memo),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(18).fork()).ldelim(),null!=e.submitKey&&Object.hasOwnProperty.call(e,"submitKey")&&i.proto.Key.encode(e.submitKey,t.uint32(26).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(50).fork()).ldelim(),null!=e.autoRenewAccount&&Object.hasOwnProperty.call(e,"autoRenewAccount")&&i.proto.AccountID.encode(e.autoRenewAccount,t.uint32(58).fork()).ldelim(),null!=e.feeScheduleKey&&Object.hasOwnProperty.call(e,"feeScheduleKey")&&i.proto.Key.encode(e.feeScheduleKey,t.uint32(66).fork()).ldelim(),null!=e.feeExemptKeyList&&e.feeExemptKeyList.length)for(var n=0;n<e.feeExemptKeyList.length;++n)i.proto.Key.encode(e.feeExemptKeyList[n],t.uint32(74).fork()).ldelim();if(null!=e.customFees&&e.customFees.length)for(n=0;n<e.customFees.length;++n)i.proto.FixedCustomFee.encode(e.customFees[n],t.uint32(82).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ConsensusCreateTopicTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.memo=e.string();break;case 2:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 3:r.submitKey=i.proto.Key.decode(e,e.uint32());break;case 6:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 7:r.autoRenewAccount=i.proto.AccountID.decode(e,e.uint32());break;case 8:r.feeScheduleKey=i.proto.Key.decode(e,e.uint32());break;case 9:r.feeExemptKeyList&&r.feeExemptKeyList.length||(r.feeExemptKeyList=[]),r.feeExemptKeyList.push(i.proto.Key.decode(e,e.uint32()));break;case 10:r.customFees&&r.customFees.length||(r.customFees=[]),r.customFees.push(i.proto.FixedCustomFee.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ConsensusCreateTopicTransactionBody"},e}(),t.FractionalFee=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.fractionalAmount=null,e.prototype.minimumAmount=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.maximumAmount=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.netOfTransfers=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fractionalAmount&&Object.hasOwnProperty.call(e,"fractionalAmount")&&i.proto.Fraction.encode(e.fractionalAmount,t.uint32(10).fork()).ldelim(),null!=e.minimumAmount&&Object.hasOwnProperty.call(e,"minimumAmount")&&t.uint32(16).int64(e.minimumAmount),null!=e.maximumAmount&&Object.hasOwnProperty.call(e,"maximumAmount")&&t.uint32(24).int64(e.maximumAmount),null!=e.netOfTransfers&&Object.hasOwnProperty.call(e,"netOfTransfers")&&t.uint32(32).bool(e.netOfTransfers),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FractionalFee;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fractionalAmount=i.proto.Fraction.decode(e,e.uint32());break;case 2:r.minimumAmount=e.int64();break;case 3:r.maximumAmount=e.int64();break;case 4:r.netOfTransfers=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FractionalFee"},e}(),t.FixedFee=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.amount=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.denominatingTokenId=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(8).int64(e.amount),null!=e.denominatingTokenId&&Object.hasOwnProperty.call(e,"denominatingTokenId")&&i.proto.TokenID.encode(e.denominatingTokenId,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FixedFee;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.amount=e.int64();break;case 2:r.denominatingTokenId=i.proto.TokenID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FixedFee"},e}(),t.RoyaltyFee=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.exchangeValueFraction=null,e.prototype.fallbackFee=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.exchangeValueFraction&&Object.hasOwnProperty.call(e,"exchangeValueFraction")&&i.proto.Fraction.encode(e.exchangeValueFraction,t.uint32(10).fork()).ldelim(),null!=e.fallbackFee&&Object.hasOwnProperty.call(e,"fallbackFee")&&i.proto.FixedFee.encode(e.fallbackFee,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.RoyaltyFee;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.exchangeValueFraction=i.proto.Fraction.decode(e,e.uint32());break;case 2:r.fallbackFee=i.proto.FixedFee.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.RoyaltyFee"},e}(),t.CustomFee=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.fixedFee=null,e.prototype.fractionalFee=null,e.prototype.royaltyFee=null,e.prototype.feeCollectorAccountId=null,e.prototype.allCollectorsAreExempt=!1,Object.defineProperty(e.prototype,"fee",{get:r.oneOfGetter(t=["fixedFee","fractionalFee","royaltyFee"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fixedFee&&Object.hasOwnProperty.call(e,"fixedFee")&&i.proto.FixedFee.encode(e.fixedFee,t.uint32(10).fork()).ldelim(),null!=e.fractionalFee&&Object.hasOwnProperty.call(e,"fractionalFee")&&i.proto.FractionalFee.encode(e.fractionalFee,t.uint32(18).fork()).ldelim(),null!=e.feeCollectorAccountId&&Object.hasOwnProperty.call(e,"feeCollectorAccountId")&&i.proto.AccountID.encode(e.feeCollectorAccountId,t.uint32(26).fork()).ldelim(),null!=e.royaltyFee&&Object.hasOwnProperty.call(e,"royaltyFee")&&i.proto.RoyaltyFee.encode(e.royaltyFee,t.uint32(34).fork()).ldelim(),null!=e.allCollectorsAreExempt&&Object.hasOwnProperty.call(e,"allCollectorsAreExempt")&&t.uint32(40).bool(e.allCollectorsAreExempt),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CustomFee;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fixedFee=i.proto.FixedFee.decode(e,e.uint32());break;case 2:r.fractionalFee=i.proto.FractionalFee.decode(e,e.uint32());break;case 4:r.royaltyFee=i.proto.RoyaltyFee.decode(e,e.uint32());break;case 3:r.feeCollectorAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 5:r.allCollectorsAreExempt=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CustomFee"},e}(),t.AssessedCustomFee=function(){function e(e){if(this.effectivePayerAccountId=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.amount=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.tokenId=null,e.prototype.feeCollectorAccountId=null,e.prototype.effectivePayerAccountId=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(8).int64(e.amount),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(18).fork()).ldelim(),null!=e.feeCollectorAccountId&&Object.hasOwnProperty.call(e,"feeCollectorAccountId")&&i.proto.AccountID.encode(e.feeCollectorAccountId,t.uint32(26).fork()).ldelim(),null!=e.effectivePayerAccountId&&e.effectivePayerAccountId.length)for(var n=0;n<e.effectivePayerAccountId.length;++n)i.proto.AccountID.encode(e.effectivePayerAccountId[n],t.uint32(34).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.AssessedCustomFee;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.amount=e.int64();break;case 2:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 3:r.feeCollectorAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 4:r.effectivePayerAccountId&&r.effectivePayerAccountId.length||(r.effectivePayerAccountId=[]),r.effectivePayerAccountId.push(i.proto.AccountID.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.AssessedCustomFee"},e}(),t.FixedCustomFee=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.fixedFee=null,e.prototype.feeCollectorAccountId=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fixedFee&&Object.hasOwnProperty.call(e,"fixedFee")&&i.proto.FixedFee.encode(e.fixedFee,t.uint32(10).fork()).ldelim(),null!=e.feeCollectorAccountId&&Object.hasOwnProperty.call(e,"feeCollectorAccountId")&&i.proto.AccountID.encode(e.feeCollectorAccountId,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FixedCustomFee;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fixedFee=i.proto.FixedFee.decode(e,e.uint32());break;case 2:r.feeCollectorAccountId=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FixedCustomFee"},e}(),t.FixedCustomFeeList=function(){function e(e){if(this.fees=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.fees=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.fees&&e.fees.length)for(var n=0;n<e.fees.length;++n)i.proto.FixedCustomFee.encode(e.fees[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FixedCustomFeeList;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.fees&&r.fees.length||(r.fees=[]),r.fees.push(i.proto.FixedCustomFee.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FixedCustomFeeList"},e}(),t.FeeExemptKeyList=function(){function e(e){if(this.keys=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.keys=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.keys&&e.keys.length)for(var n=0;n<e.keys.length;++n)i.proto.Key.encode(e.keys[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FeeExemptKeyList;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.keys&&r.keys.length||(r.keys=[]),r.keys.push(i.proto.Key.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FeeExemptKeyList"},e}(),t.CustomFeeLimit=function(){function e(e){if(this.fees=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountId=null,e.prototype.fees=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.accountId&&Object.hasOwnProperty.call(e,"accountId")&&i.proto.AccountID.encode(e.accountId,t.uint32(10).fork()).ldelim(),null!=e.fees&&e.fees.length)for(var n=0;n<e.fees.length;++n)i.proto.FixedFee.encode(e.fees[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CustomFeeLimit;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountId=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.fees&&r.fees.length||(r.fees=[]),r.fees.push(i.proto.FixedFee.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CustomFeeLimit"},e}(),t.ConsensusUpdateTopicTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.topicID=null,e.prototype.memo=null,e.prototype.expirationTime=null,e.prototype.adminKey=null,e.prototype.submitKey=null,e.prototype.autoRenewPeriod=null,e.prototype.autoRenewAccount=null,e.prototype.feeScheduleKey=null,e.prototype.feeExemptKeyList=null,e.prototype.customFees=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&i.proto.TopicID.encode(e.topicID,t.uint32(10).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&i.google.protobuf.StringValue.encode(e.memo,t.uint32(18).fork()).ldelim(),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(34).fork()).ldelim(),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(50).fork()).ldelim(),null!=e.submitKey&&Object.hasOwnProperty.call(e,"submitKey")&&i.proto.Key.encode(e.submitKey,t.uint32(58).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(66).fork()).ldelim(),null!=e.autoRenewAccount&&Object.hasOwnProperty.call(e,"autoRenewAccount")&&i.proto.AccountID.encode(e.autoRenewAccount,t.uint32(74).fork()).ldelim(),null!=e.feeScheduleKey&&Object.hasOwnProperty.call(e,"feeScheduleKey")&&i.proto.Key.encode(e.feeScheduleKey,t.uint32(82).fork()).ldelim(),null!=e.feeExemptKeyList&&Object.hasOwnProperty.call(e,"feeExemptKeyList")&&i.proto.FeeExemptKeyList.encode(e.feeExemptKeyList,t.uint32(90).fork()).ldelim(),null!=e.customFees&&Object.hasOwnProperty.call(e,"customFees")&&i.proto.FixedCustomFeeList.encode(e.customFees,t.uint32(98).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ConsensusUpdateTopicTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.topicID=i.proto.TopicID.decode(e,e.uint32());break;case 2:r.memo=i.google.protobuf.StringValue.decode(e,e.uint32());break;case 4:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 6:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 7:r.submitKey=i.proto.Key.decode(e,e.uint32());break;case 8:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 9:r.autoRenewAccount=i.proto.AccountID.decode(e,e.uint32());break;case 10:r.feeScheduleKey=i.proto.Key.decode(e,e.uint32());break;case 11:r.feeExemptKeyList=i.proto.FeeExemptKeyList.decode(e,e.uint32());break;case 12:r.customFees=i.proto.FixedCustomFeeList.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ConsensusUpdateTopicTransactionBody"},e}(),t.ConsensusDeleteTopicTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.topicID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&i.proto.TopicID.encode(e.topicID,t.uint32(10).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ConsensusDeleteTopicTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.topicID=i.proto.TopicID.decode(e,e.uint32());else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ConsensusDeleteTopicTransactionBody"},e}(),t.ConsensusMessageChunkInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.initialTransactionID=null,e.prototype.total=0,e.prototype.number=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.initialTransactionID&&Object.hasOwnProperty.call(e,"initialTransactionID")&&i.proto.TransactionID.encode(e.initialTransactionID,t.uint32(10).fork()).ldelim(),null!=e.total&&Object.hasOwnProperty.call(e,"total")&&t.uint32(16).int32(e.total),null!=e.number&&Object.hasOwnProperty.call(e,"number")&&t.uint32(24).int32(e.number),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ConsensusMessageChunkInfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.initialTransactionID=i.proto.TransactionID.decode(e,e.uint32());break;case 2:r.total=e.int32();break;case 3:r.number=e.int32();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ConsensusMessageChunkInfo"},e}(),t.ConsensusSubmitMessageTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.topicID=null,e.prototype.message=r.newBuffer([]),e.prototype.chunkInfo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&i.proto.TopicID.encode(e.topicID,t.uint32(10).fork()).ldelim(),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(18).bytes(e.message),null!=e.chunkInfo&&Object.hasOwnProperty.call(e,"chunkInfo")&&i.proto.ConsensusMessageChunkInfo.encode(e.chunkInfo,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ConsensusSubmitMessageTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.topicID=i.proto.TopicID.decode(e,e.uint32());break;case 2:r.message=e.bytes();break;case 3:r.chunkInfo=i.proto.ConsensusMessageChunkInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ConsensusSubmitMessageTransactionBody"},e}(),t.UncheckedSubmitBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.transactionBytes=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.transactionBytes&&Object.hasOwnProperty.call(e,"transactionBytes")&&t.uint32(10).bytes(e.transactionBytes),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.UncheckedSubmitBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.transactionBytes=e.bytes();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.UncheckedSubmitBody"},e}(),t.TokenCreateTransactionBody=function(){function e(e){if(this.customFees=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.symbol="",e.prototype.decimals=0,e.prototype.initialSupply=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.treasury=null,e.prototype.adminKey=null,e.prototype.kycKey=null,e.prototype.freezeKey=null,e.prototype.wipeKey=null,e.prototype.supplyKey=null,e.prototype.freezeDefault=!1,e.prototype.expiry=null,e.prototype.autoRenewAccount=null,e.prototype.autoRenewPeriod=null,e.prototype.memo="",e.prototype.tokenType=0,e.prototype.supplyType=0,e.prototype.maxSupply=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.feeScheduleKey=null,e.prototype.customFees=r.emptyArray,e.prototype.pauseKey=null,e.prototype.metadata=r.newBuffer([]),e.prototype.metadataKey=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.symbol&&Object.hasOwnProperty.call(e,"symbol")&&t.uint32(18).string(e.symbol),null!=e.decimals&&Object.hasOwnProperty.call(e,"decimals")&&t.uint32(24).uint32(e.decimals),null!=e.initialSupply&&Object.hasOwnProperty.call(e,"initialSupply")&&t.uint32(32).uint64(e.initialSupply),null!=e.treasury&&Object.hasOwnProperty.call(e,"treasury")&&i.proto.AccountID.encode(e.treasury,t.uint32(42).fork()).ldelim(),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(50).fork()).ldelim(),null!=e.kycKey&&Object.hasOwnProperty.call(e,"kycKey")&&i.proto.Key.encode(e.kycKey,t.uint32(58).fork()).ldelim(),null!=e.freezeKey&&Object.hasOwnProperty.call(e,"freezeKey")&&i.proto.Key.encode(e.freezeKey,t.uint32(66).fork()).ldelim(),null!=e.wipeKey&&Object.hasOwnProperty.call(e,"wipeKey")&&i.proto.Key.encode(e.wipeKey,t.uint32(74).fork()).ldelim(),null!=e.supplyKey&&Object.hasOwnProperty.call(e,"supplyKey")&&i.proto.Key.encode(e.supplyKey,t.uint32(82).fork()).ldelim(),null!=e.freezeDefault&&Object.hasOwnProperty.call(e,"freezeDefault")&&t.uint32(88).bool(e.freezeDefault),null!=e.expiry&&Object.hasOwnProperty.call(e,"expiry")&&i.proto.Timestamp.encode(e.expiry,t.uint32(106).fork()).ldelim(),null!=e.autoRenewAccount&&Object.hasOwnProperty.call(e,"autoRenewAccount")&&i.proto.AccountID.encode(e.autoRenewAccount,t.uint32(114).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(122).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(130).string(e.memo),null!=e.tokenType&&Object.hasOwnProperty.call(e,"tokenType")&&t.uint32(136).int32(e.tokenType),null!=e.supplyType&&Object.hasOwnProperty.call(e,"supplyType")&&t.uint32(144).int32(e.supplyType),null!=e.maxSupply&&Object.hasOwnProperty.call(e,"maxSupply")&&t.uint32(152).int64(e.maxSupply),null!=e.feeScheduleKey&&Object.hasOwnProperty.call(e,"feeScheduleKey")&&i.proto.Key.encode(e.feeScheduleKey,t.uint32(162).fork()).ldelim(),null!=e.customFees&&e.customFees.length)for(var n=0;n<e.customFees.length;++n)i.proto.CustomFee.encode(e.customFees[n],t.uint32(170).fork()).ldelim();return null!=e.pauseKey&&Object.hasOwnProperty.call(e,"pauseKey")&&i.proto.Key.encode(e.pauseKey,t.uint32(178).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&t.uint32(186).bytes(e.metadata),null!=e.metadataKey&&Object.hasOwnProperty.call(e,"metadataKey")&&i.proto.Key.encode(e.metadataKey,t.uint32(194).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenCreateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.name=e.string();break;case 2:r.symbol=e.string();break;case 3:r.decimals=e.uint32();break;case 4:r.initialSupply=e.uint64();break;case 5:r.treasury=i.proto.AccountID.decode(e,e.uint32());break;case 6:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 7:r.kycKey=i.proto.Key.decode(e,e.uint32());break;case 8:r.freezeKey=i.proto.Key.decode(e,e.uint32());break;case 9:r.wipeKey=i.proto.Key.decode(e,e.uint32());break;case 10:r.supplyKey=i.proto.Key.decode(e,e.uint32());break;case 11:r.freezeDefault=e.bool();break;case 13:r.expiry=i.proto.Timestamp.decode(e,e.uint32());break;case 14:r.autoRenewAccount=i.proto.AccountID.decode(e,e.uint32());break;case 15:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 16:r.memo=e.string();break;case 17:r.tokenType=e.int32();break;case 18:r.supplyType=e.int32();break;case 19:r.maxSupply=e.int64();break;case 20:r.feeScheduleKey=i.proto.Key.decode(e,e.uint32());break;case 21:r.customFees&&r.customFees.length||(r.customFees=[]),r.customFees.push(i.proto.CustomFee.decode(e,e.uint32()));break;case 22:r.pauseKey=i.proto.Key.decode(e,e.uint32());break;case 23:r.metadata=e.bytes();break;case 24:r.metadataKey=i.proto.Key.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenCreateTransactionBody"},e}(),t.TokenFreezeAccountTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.prototype.account=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&i.proto.AccountID.encode(e.account,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenFreezeAccountTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.account=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenFreezeAccountTransactionBody"},e}(),t.TokenUnfreezeAccountTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.prototype.account=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&i.proto.AccountID.encode(e.account,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenUnfreezeAccountTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.account=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenUnfreezeAccountTransactionBody"},e}(),t.TokenGrantKycTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.prototype.account=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&i.proto.AccountID.encode(e.account,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenGrantKycTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.account=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenGrantKycTransactionBody"},e}(),t.TokenRevokeKycTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.prototype.account=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&i.proto.AccountID.encode(e.account,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenRevokeKycTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.account=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenRevokeKycTransactionBody"},e}(),t.TokenDeleteTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenDeleteTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.token=i.proto.TokenID.decode(e,e.uint32());else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenDeleteTransactionBody"},e}(),t.TokenUpdateTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.prototype.symbol="",e.prototype.name="",e.prototype.treasury=null,e.prototype.adminKey=null,e.prototype.kycKey=null,e.prototype.freezeKey=null,e.prototype.wipeKey=null,e.prototype.supplyKey=null,e.prototype.autoRenewAccount=null,e.prototype.autoRenewPeriod=null,e.prototype.expiry=null,e.prototype.memo=null,e.prototype.feeScheduleKey=null,e.prototype.pauseKey=null,e.prototype.metadata=null,e.prototype.metadataKey=null,e.prototype.keyVerificationMode=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),null!=e.symbol&&Object.hasOwnProperty.call(e,"symbol")&&t.uint32(18).string(e.symbol),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(26).string(e.name),null!=e.treasury&&Object.hasOwnProperty.call(e,"treasury")&&i.proto.AccountID.encode(e.treasury,t.uint32(34).fork()).ldelim(),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(42).fork()).ldelim(),null!=e.kycKey&&Object.hasOwnProperty.call(e,"kycKey")&&i.proto.Key.encode(e.kycKey,t.uint32(50).fork()).ldelim(),null!=e.freezeKey&&Object.hasOwnProperty.call(e,"freezeKey")&&i.proto.Key.encode(e.freezeKey,t.uint32(58).fork()).ldelim(),null!=e.wipeKey&&Object.hasOwnProperty.call(e,"wipeKey")&&i.proto.Key.encode(e.wipeKey,t.uint32(66).fork()).ldelim(),null!=e.supplyKey&&Object.hasOwnProperty.call(e,"supplyKey")&&i.proto.Key.encode(e.supplyKey,t.uint32(74).fork()).ldelim(),null!=e.autoRenewAccount&&Object.hasOwnProperty.call(e,"autoRenewAccount")&&i.proto.AccountID.encode(e.autoRenewAccount,t.uint32(82).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(90).fork()).ldelim(),null!=e.expiry&&Object.hasOwnProperty.call(e,"expiry")&&i.proto.Timestamp.encode(e.expiry,t.uint32(98).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&i.google.protobuf.StringValue.encode(e.memo,t.uint32(106).fork()).ldelim(),null!=e.feeScheduleKey&&Object.hasOwnProperty.call(e,"feeScheduleKey")&&i.proto.Key.encode(e.feeScheduleKey,t.uint32(114).fork()).ldelim(),null!=e.pauseKey&&Object.hasOwnProperty.call(e,"pauseKey")&&i.proto.Key.encode(e.pauseKey,t.uint32(122).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&i.google.protobuf.BytesValue.encode(e.metadata,t.uint32(130).fork()).ldelim(),null!=e.metadataKey&&Object.hasOwnProperty.call(e,"metadataKey")&&i.proto.Key.encode(e.metadataKey,t.uint32(138).fork()).ldelim(),null!=e.keyVerificationMode&&Object.hasOwnProperty.call(e,"keyVerificationMode")&&t.uint32(144).int32(e.keyVerificationMode),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenUpdateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.symbol=e.string();break;case 3:r.name=e.string();break;case 4:r.treasury=i.proto.AccountID.decode(e,e.uint32());break;case 5:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 6:r.kycKey=i.proto.Key.decode(e,e.uint32());break;case 7:r.freezeKey=i.proto.Key.decode(e,e.uint32());break;case 8:r.wipeKey=i.proto.Key.decode(e,e.uint32());break;case 9:r.supplyKey=i.proto.Key.decode(e,e.uint32());break;case 10:r.autoRenewAccount=i.proto.AccountID.decode(e,e.uint32());break;case 11:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 12:r.expiry=i.proto.Timestamp.decode(e,e.uint32());break;case 13:r.memo=i.google.protobuf.StringValue.decode(e,e.uint32());break;case 14:r.feeScheduleKey=i.proto.Key.decode(e,e.uint32());break;case 15:r.pauseKey=i.proto.Key.decode(e,e.uint32());break;case 16:r.metadata=i.google.protobuf.BytesValue.decode(e,e.uint32());break;case 17:r.metadataKey=i.proto.Key.decode(e,e.uint32());break;case 18:r.keyVerificationMode=e.int32();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenUpdateTransactionBody"},e}(),t.TokenMintTransactionBody=function(){function e(e){if(this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.metadata=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(16).uint64(e.amount),null!=e.metadata&&e.metadata.length)for(var n=0;n<e.metadata.length;++n)t.uint32(26).bytes(e.metadata[n]);return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenMintTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.amount=e.uint64();break;case 3:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(e.bytes());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenMintTransactionBody"},e}(),t.TokenBurnTransactionBody=function(){function e(e){if(this.serialNumbers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.serialNumbers=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(16).uint64(e.amount),null!=e.serialNumbers&&e.serialNumbers.length){t.uint32(26).fork();for(var n=0;n<e.serialNumbers.length;++n)t.int64(e.serialNumbers[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenBurnTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.amount=e.uint64();break;case 3:if(r.serialNumbers&&r.serialNumbers.length||(r.serialNumbers=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)r.serialNumbers.push(e.int64());else r.serialNumbers.push(e.int64());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenBurnTransactionBody"},e}(),t.TokenWipeAccountTransactionBody=function(){function e(e){if(this.serialNumbers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.prototype.account=null,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.serialNumbers=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&i.proto.AccountID.encode(e.account,t.uint32(18).fork()).ldelim(),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(24).uint64(e.amount),null!=e.serialNumbers&&e.serialNumbers.length){t.uint32(34).fork();for(var n=0;n<e.serialNumbers.length;++n)t.int64(e.serialNumbers[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenWipeAccountTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.account=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.amount=e.uint64();break;case 4:if(r.serialNumbers&&r.serialNumbers.length||(r.serialNumbers=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)r.serialNumbers.push(e.int64());else r.serialNumbers.push(e.int64());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenWipeAccountTransactionBody"},e}(),t.TokenAssociateTransactionBody=function(){function e(e){if(this.tokens=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.account=null,e.prototype.tokens=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&i.proto.AccountID.encode(e.account,t.uint32(10).fork()).ldelim(),null!=e.tokens&&e.tokens.length)for(var n=0;n<e.tokens.length;++n)i.proto.TokenID.encode(e.tokens[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenAssociateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.account=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.tokens&&r.tokens.length||(r.tokens=[]),r.tokens.push(i.proto.TokenID.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenAssociateTransactionBody"},e}(),t.TokenDissociateTransactionBody=function(){function e(e){if(this.tokens=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.account=null,e.prototype.tokens=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&i.proto.AccountID.encode(e.account,t.uint32(10).fork()).ldelim(),null!=e.tokens&&e.tokens.length)for(var n=0;n<e.tokens.length;++n)i.proto.TokenID.encode(e.tokens[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenDissociateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.account=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.tokens&&r.tokens.length||(r.tokens=[]),r.tokens.push(i.proto.TokenID.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenDissociateTransactionBody"},e}(),t.TokenFeeScheduleUpdateTransactionBody=function(){function e(e){if(this.customFees=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.customFees=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.customFees&&e.customFees.length)for(var n=0;n<e.customFees.length;++n)i.proto.CustomFee.encode(e.customFees[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenFeeScheduleUpdateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.customFees&&r.customFees.length||(r.customFees=[]),r.customFees.push(i.proto.CustomFee.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenFeeScheduleUpdateTransactionBody"},e}(),t.TokenPauseTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenPauseTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.token=i.proto.TokenID.decode(e,e.uint32());else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenPauseTransactionBody"},e}(),t.TokenUnpauseTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenUnpauseTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.token=i.proto.TokenID.decode(e,e.uint32());else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenUnpauseTransactionBody"},e}(),t.TokenUpdateNftsTransactionBody=function(){function e(e){if(this.serialNumbers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.token=null,e.prototype.serialNumbers=r.emptyArray,e.prototype.metadata=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(10).fork()).ldelim(),null!=e.serialNumbers&&e.serialNumbers.length){t.uint32(18).fork();for(var n=0;n<e.serialNumbers.length;++n)t.int64(e.serialNumbers[n]);t.ldelim()}return null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&i.google.protobuf.BytesValue.encode(e.metadata,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenUpdateNftsTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.token=i.proto.TokenID.decode(e,e.uint32());break;case 2:if(r.serialNumbers&&r.serialNumbers.length||(r.serialNumbers=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)r.serialNumbers.push(e.int64());else r.serialNumbers.push(e.int64());break;case 3:r.metadata=i.google.protobuf.BytesValue.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenUpdateNftsTransactionBody"},e}(),t.TokenRejectTransactionBody=function(){function e(e){if(this.rejections=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.owner=null,e.prototype.rejections=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.owner&&Object.hasOwnProperty.call(e,"owner")&&i.proto.AccountID.encode(e.owner,t.uint32(10).fork()).ldelim(),null!=e.rejections&&e.rejections.length)for(var n=0;n<e.rejections.length;++n)i.proto.TokenReference.encode(e.rejections[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenRejectTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.owner=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.rejections&&r.rejections.length||(r.rejections=[]),r.rejections.push(i.proto.TokenReference.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenRejectTransactionBody"},e}(),t.TokenReference=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.fungibleToken=null,e.prototype.nft=null,Object.defineProperty(e.prototype,"tokenIdentifier",{get:r.oneOfGetter(t=["fungibleToken","nft"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fungibleToken&&Object.hasOwnProperty.call(e,"fungibleToken")&&i.proto.TokenID.encode(e.fungibleToken,t.uint32(10).fork()).ldelim(),null!=e.nft&&Object.hasOwnProperty.call(e,"nft")&&i.proto.NftID.encode(e.nft,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenReference;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fungibleToken=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.nft=i.proto.NftID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenReference"},e}(),t.TokenAirdropTransactionBody=function(){function e(e){if(this.tokenTransfers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenTransfers=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.tokenTransfers&&e.tokenTransfers.length)for(var n=0;n<e.tokenTransfers.length;++n)i.proto.TokenTransferList.encode(e.tokenTransfers[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenAirdropTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.tokenTransfers&&r.tokenTransfers.length||(r.tokenTransfers=[]),r.tokenTransfers.push(i.proto.TokenTransferList.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenAirdropTransactionBody"},e}(),t.TokenCancelAirdropTransactionBody=function(){function e(e){if(this.pendingAirdrops=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.pendingAirdrops=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.pendingAirdrops&&e.pendingAirdrops.length)for(var n=0;n<e.pendingAirdrops.length;++n)i.proto.PendingAirdropId.encode(e.pendingAirdrops[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenCancelAirdropTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.pendingAirdrops&&r.pendingAirdrops.length||(r.pendingAirdrops=[]),r.pendingAirdrops.push(i.proto.PendingAirdropId.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenCancelAirdropTransactionBody"},e}(),t.TokenClaimAirdropTransactionBody=function(){function e(e){if(this.pendingAirdrops=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.pendingAirdrops=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.pendingAirdrops&&e.pendingAirdrops.length)for(var n=0;n<e.pendingAirdrops.length;++n)i.proto.PendingAirdropId.encode(e.pendingAirdrops[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenClaimAirdropTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.pendingAirdrops&&r.pendingAirdrops.length||(r.pendingAirdrops=[]),r.pendingAirdrops.push(i.proto.PendingAirdropId.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenClaimAirdropTransactionBody"},e}(),t.ScheduleCreateTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.scheduledTransactionBody=null,e.prototype.memo="",e.prototype.adminKey=null,e.prototype.payerAccountID=null,e.prototype.expirationTime=null,e.prototype.waitForExpiry=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.scheduledTransactionBody&&Object.hasOwnProperty.call(e,"scheduledTransactionBody")&&i.proto.SchedulableTransactionBody.encode(e.scheduledTransactionBody,t.uint32(10).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(18).string(e.memo),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(26).fork()).ldelim(),null!=e.payerAccountID&&Object.hasOwnProperty.call(e,"payerAccountID")&&i.proto.AccountID.encode(e.payerAccountID,t.uint32(34).fork()).ldelim(),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(42).fork()).ldelim(),null!=e.waitForExpiry&&Object.hasOwnProperty.call(e,"waitForExpiry")&&t.uint32(104).bool(e.waitForExpiry),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ScheduleCreateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.scheduledTransactionBody=i.proto.SchedulableTransactionBody.decode(e,e.uint32());break;case 2:r.memo=e.string();break;case 3:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 4:r.payerAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 5:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 13:r.waitForExpiry=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ScheduleCreateTransactionBody"},e}(),t.SchedulableTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.transactionFee=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.memo="",e.prototype.contractCall=null,e.prototype.contractCreateInstance=null,e.prototype.contractUpdateInstance=null,e.prototype.contractDeleteInstance=null,e.prototype.cryptoCreateAccount=null,e.prototype.cryptoDelete=null,e.prototype.cryptoTransfer=null,e.prototype.cryptoUpdateAccount=null,e.prototype.fileAppend=null,e.prototype.fileCreate=null,e.prototype.fileDelete=null,e.prototype.fileUpdate=null,e.prototype.systemDelete=null,e.prototype.systemUndelete=null,e.prototype.freeze=null,e.prototype.consensusCreateTopic=null,e.prototype.consensusUpdateTopic=null,e.prototype.consensusDeleteTopic=null,e.prototype.consensusSubmitMessage=null,e.prototype.tokenCreation=null,e.prototype.tokenFreeze=null,e.prototype.tokenUnfreeze=null,e.prototype.tokenGrantKyc=null,e.prototype.tokenRevokeKyc=null,e.prototype.tokenDeletion=null,e.prototype.tokenUpdate=null,e.prototype.tokenMint=null,e.prototype.tokenBurn=null,e.prototype.tokenWipe=null,e.prototype.tokenAssociate=null,e.prototype.tokenDissociate=null,e.prototype.scheduleDelete=null,e.prototype.tokenPause=null,e.prototype.tokenUnpause=null,e.prototype.cryptoApproveAllowance=null,e.prototype.cryptoDeleteAllowance=null,e.prototype.tokenFeeScheduleUpdate=null,e.prototype.utilPrng=null,e.prototype.tokenUpdateNfts=null,e.prototype.nodeCreate=null,e.prototype.nodeUpdate=null,e.prototype.nodeDelete=null,e.prototype.tokenReject=null,e.prototype.tokenCancelAirdrop=null,e.prototype.tokenClaimAirdrop=null,e.prototype.tokenAirdrop=null,Object.defineProperty(e.prototype,"data",{get:r.oneOfGetter(t=["contractCall","contractCreateInstance","contractUpdateInstance","contractDeleteInstance","cryptoCreateAccount","cryptoDelete","cryptoTransfer","cryptoUpdateAccount","fileAppend","fileCreate","fileDelete","fileUpdate","systemDelete","systemUndelete","freeze","consensusCreateTopic","consensusUpdateTopic","consensusDeleteTopic","consensusSubmitMessage","tokenCreation","tokenFreeze","tokenUnfreeze","tokenGrantKyc","tokenRevokeKyc","tokenDeletion","tokenUpdate","tokenMint","tokenBurn","tokenWipe","tokenAssociate","tokenDissociate","scheduleDelete","tokenPause","tokenUnpause","cryptoApproveAllowance","cryptoDeleteAllowance","tokenFeeScheduleUpdate","utilPrng","tokenUpdateNfts","nodeCreate","nodeUpdate","nodeDelete","tokenReject","tokenCancelAirdrop","tokenClaimAirdrop","tokenAirdrop"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.transactionFee&&Object.hasOwnProperty.call(e,"transactionFee")&&t.uint32(8).uint64(e.transactionFee),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(18).string(e.memo),null!=e.contractCall&&Object.hasOwnProperty.call(e,"contractCall")&&i.proto.ContractCallTransactionBody.encode(e.contractCall,t.uint32(26).fork()).ldelim(),null!=e.contractCreateInstance&&Object.hasOwnProperty.call(e,"contractCreateInstance")&&i.proto.ContractCreateTransactionBody.encode(e.contractCreateInstance,t.uint32(34).fork()).ldelim(),null!=e.contractUpdateInstance&&Object.hasOwnProperty.call(e,"contractUpdateInstance")&&i.proto.ContractUpdateTransactionBody.encode(e.contractUpdateInstance,t.uint32(42).fork()).ldelim(),null!=e.contractDeleteInstance&&Object.hasOwnProperty.call(e,"contractDeleteInstance")&&i.proto.ContractDeleteTransactionBody.encode(e.contractDeleteInstance,t.uint32(50).fork()).ldelim(),null!=e.cryptoCreateAccount&&Object.hasOwnProperty.call(e,"cryptoCreateAccount")&&i.proto.CryptoCreateTransactionBody.encode(e.cryptoCreateAccount,t.uint32(58).fork()).ldelim(),null!=e.cryptoDelete&&Object.hasOwnProperty.call(e,"cryptoDelete")&&i.proto.CryptoDeleteTransactionBody.encode(e.cryptoDelete,t.uint32(66).fork()).ldelim(),null!=e.cryptoTransfer&&Object.hasOwnProperty.call(e,"cryptoTransfer")&&i.proto.CryptoTransferTransactionBody.encode(e.cryptoTransfer,t.uint32(74).fork()).ldelim(),null!=e.cryptoUpdateAccount&&Object.hasOwnProperty.call(e,"cryptoUpdateAccount")&&i.proto.CryptoUpdateTransactionBody.encode(e.cryptoUpdateAccount,t.uint32(82).fork()).ldelim(),null!=e.fileAppend&&Object.hasOwnProperty.call(e,"fileAppend")&&i.proto.FileAppendTransactionBody.encode(e.fileAppend,t.uint32(90).fork()).ldelim(),null!=e.fileCreate&&Object.hasOwnProperty.call(e,"fileCreate")&&i.proto.FileCreateTransactionBody.encode(e.fileCreate,t.uint32(98).fork()).ldelim(),null!=e.fileDelete&&Object.hasOwnProperty.call(e,"fileDelete")&&i.proto.FileDeleteTransactionBody.encode(e.fileDelete,t.uint32(106).fork()).ldelim(),null!=e.fileUpdate&&Object.hasOwnProperty.call(e,"fileUpdate")&&i.proto.FileUpdateTransactionBody.encode(e.fileUpdate,t.uint32(114).fork()).ldelim(),null!=e.systemDelete&&Object.hasOwnProperty.call(e,"systemDelete")&&i.proto.SystemDeleteTransactionBody.encode(e.systemDelete,t.uint32(122).fork()).ldelim(),null!=e.systemUndelete&&Object.hasOwnProperty.call(e,"systemUndelete")&&i.proto.SystemUndeleteTransactionBody.encode(e.systemUndelete,t.uint32(130).fork()).ldelim(),null!=e.freeze&&Object.hasOwnProperty.call(e,"freeze")&&i.proto.FreezeTransactionBody.encode(e.freeze,t.uint32(138).fork()).ldelim(),null!=e.consensusCreateTopic&&Object.hasOwnProperty.call(e,"consensusCreateTopic")&&i.proto.ConsensusCreateTopicTransactionBody.encode(e.consensusCreateTopic,t.uint32(146).fork()).ldelim(),null!=e.consensusUpdateTopic&&Object.hasOwnProperty.call(e,"consensusUpdateTopic")&&i.proto.ConsensusUpdateTopicTransactionBody.encode(e.consensusUpdateTopic,t.uint32(154).fork()).ldelim(),null!=e.consensusDeleteTopic&&Object.hasOwnProperty.call(e,"consensusDeleteTopic")&&i.proto.ConsensusDeleteTopicTransactionBody.encode(e.consensusDeleteTopic,t.uint32(162).fork()).ldelim(),null!=e.consensusSubmitMessage&&Object.hasOwnProperty.call(e,"consensusSubmitMessage")&&i.proto.ConsensusSubmitMessageTransactionBody.encode(e.consensusSubmitMessage,t.uint32(170).fork()).ldelim(),null!=e.tokenCreation&&Object.hasOwnProperty.call(e,"tokenCreation")&&i.proto.TokenCreateTransactionBody.encode(e.tokenCreation,t.uint32(178).fork()).ldelim(),null!=e.tokenFreeze&&Object.hasOwnProperty.call(e,"tokenFreeze")&&i.proto.TokenFreezeAccountTransactionBody.encode(e.tokenFreeze,t.uint32(186).fork()).ldelim(),null!=e.tokenUnfreeze&&Object.hasOwnProperty.call(e,"tokenUnfreeze")&&i.proto.TokenUnfreezeAccountTransactionBody.encode(e.tokenUnfreeze,t.uint32(194).fork()).ldelim(),null!=e.tokenGrantKyc&&Object.hasOwnProperty.call(e,"tokenGrantKyc")&&i.proto.TokenGrantKycTransactionBody.encode(e.tokenGrantKyc,t.uint32(202).fork()).ldelim(),null!=e.tokenRevokeKyc&&Object.hasOwnProperty.call(e,"tokenRevokeKyc")&&i.proto.TokenRevokeKycTransactionBody.encode(e.tokenRevokeKyc,t.uint32(210).fork()).ldelim(),null!=e.tokenDeletion&&Object.hasOwnProperty.call(e,"tokenDeletion")&&i.proto.TokenDeleteTransactionBody.encode(e.tokenDeletion,t.uint32(218).fork()).ldelim(),null!=e.tokenUpdate&&Object.hasOwnProperty.call(e,"tokenUpdate")&&i.proto.TokenUpdateTransactionBody.encode(e.tokenUpdate,t.uint32(226).fork()).ldelim(),null!=e.tokenMint&&Object.hasOwnProperty.call(e,"tokenMint")&&i.proto.TokenMintTransactionBody.encode(e.tokenMint,t.uint32(234).fork()).ldelim(),null!=e.tokenBurn&&Object.hasOwnProperty.call(e,"tokenBurn")&&i.proto.TokenBurnTransactionBody.encode(e.tokenBurn,t.uint32(242).fork()).ldelim(),null!=e.tokenWipe&&Object.hasOwnProperty.call(e,"tokenWipe")&&i.proto.TokenWipeAccountTransactionBody.encode(e.tokenWipe,t.uint32(250).fork()).ldelim(),null!=e.tokenAssociate&&Object.hasOwnProperty.call(e,"tokenAssociate")&&i.proto.TokenAssociateTransactionBody.encode(e.tokenAssociate,t.uint32(258).fork()).ldelim(),null!=e.tokenDissociate&&Object.hasOwnProperty.call(e,"tokenDissociate")&&i.proto.TokenDissociateTransactionBody.encode(e.tokenDissociate,t.uint32(266).fork()).ldelim(),null!=e.scheduleDelete&&Object.hasOwnProperty.call(e,"scheduleDelete")&&i.proto.ScheduleDeleteTransactionBody.encode(e.scheduleDelete,t.uint32(274).fork()).ldelim(),null!=e.tokenPause&&Object.hasOwnProperty.call(e,"tokenPause")&&i.proto.TokenPauseTransactionBody.encode(e.tokenPause,t.uint32(282).fork()).ldelim(),null!=e.tokenUnpause&&Object.hasOwnProperty.call(e,"tokenUnpause")&&i.proto.TokenUnpauseTransactionBody.encode(e.tokenUnpause,t.uint32(290).fork()).ldelim(),null!=e.cryptoApproveAllowance&&Object.hasOwnProperty.call(e,"cryptoApproveAllowance")&&i.proto.CryptoApproveAllowanceTransactionBody.encode(e.cryptoApproveAllowance,t.uint32(298).fork()).ldelim(),null!=e.cryptoDeleteAllowance&&Object.hasOwnProperty.call(e,"cryptoDeleteAllowance")&&i.proto.CryptoDeleteAllowanceTransactionBody.encode(e.cryptoDeleteAllowance,t.uint32(306).fork()).ldelim(),null!=e.tokenFeeScheduleUpdate&&Object.hasOwnProperty.call(e,"tokenFeeScheduleUpdate")&&i.proto.TokenFeeScheduleUpdateTransactionBody.encode(e.tokenFeeScheduleUpdate,t.uint32(314).fork()).ldelim(),null!=e.utilPrng&&Object.hasOwnProperty.call(e,"utilPrng")&&i.proto.UtilPrngTransactionBody.encode(e.utilPrng,t.uint32(322).fork()).ldelim(),null!=e.tokenUpdateNfts&&Object.hasOwnProperty.call(e,"tokenUpdateNfts")&&i.proto.TokenUpdateNftsTransactionBody.encode(e.tokenUpdateNfts,t.uint32(330).fork()).ldelim(),null!=e.nodeCreate&&Object.hasOwnProperty.call(e,"nodeCreate")&&i.com.hedera.hapi.node.addressbook.NodeCreateTransactionBody.encode(e.nodeCreate,t.uint32(338).fork()).ldelim(),null!=e.nodeUpdate&&Object.hasOwnProperty.call(e,"nodeUpdate")&&i.com.hedera.hapi.node.addressbook.NodeUpdateTransactionBody.encode(e.nodeUpdate,t.uint32(346).fork()).ldelim(),null!=e.nodeDelete&&Object.hasOwnProperty.call(e,"nodeDelete")&&i.com.hedera.hapi.node.addressbook.NodeDeleteTransactionBody.encode(e.nodeDelete,t.uint32(354).fork()).ldelim(),null!=e.tokenReject&&Object.hasOwnProperty.call(e,"tokenReject")&&i.proto.TokenRejectTransactionBody.encode(e.tokenReject,t.uint32(362).fork()).ldelim(),null!=e.tokenCancelAirdrop&&Object.hasOwnProperty.call(e,"tokenCancelAirdrop")&&i.proto.TokenCancelAirdropTransactionBody.encode(e.tokenCancelAirdrop,t.uint32(370).fork()).ldelim(),null!=e.tokenClaimAirdrop&&Object.hasOwnProperty.call(e,"tokenClaimAirdrop")&&i.proto.TokenClaimAirdropTransactionBody.encode(e.tokenClaimAirdrop,t.uint32(378).fork()).ldelim(),null!=e.tokenAirdrop&&Object.hasOwnProperty.call(e,"tokenAirdrop")&&i.proto.TokenAirdropTransactionBody.encode(e.tokenAirdrop,t.uint32(386).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SchedulableTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.transactionFee=e.uint64();break;case 2:r.memo=e.string();break;case 3:r.contractCall=i.proto.ContractCallTransactionBody.decode(e,e.uint32());break;case 4:r.contractCreateInstance=i.proto.ContractCreateTransactionBody.decode(e,e.uint32());break;case 5:r.contractUpdateInstance=i.proto.ContractUpdateTransactionBody.decode(e,e.uint32());break;case 6:r.contractDeleteInstance=i.proto.ContractDeleteTransactionBody.decode(e,e.uint32());break;case 7:r.cryptoCreateAccount=i.proto.CryptoCreateTransactionBody.decode(e,e.uint32());break;case 8:r.cryptoDelete=i.proto.CryptoDeleteTransactionBody.decode(e,e.uint32());break;case 9:r.cryptoTransfer=i.proto.CryptoTransferTransactionBody.decode(e,e.uint32());break;case 10:r.cryptoUpdateAccount=i.proto.CryptoUpdateTransactionBody.decode(e,e.uint32());break;case 11:r.fileAppend=i.proto.FileAppendTransactionBody.decode(e,e.uint32());break;case 12:r.fileCreate=i.proto.FileCreateTransactionBody.decode(e,e.uint32());break;case 13:r.fileDelete=i.proto.FileDeleteTransactionBody.decode(e,e.uint32());break;case 14:r.fileUpdate=i.proto.FileUpdateTransactionBody.decode(e,e.uint32());break;case 15:r.systemDelete=i.proto.SystemDeleteTransactionBody.decode(e,e.uint32());break;case 16:r.systemUndelete=i.proto.SystemUndeleteTransactionBody.decode(e,e.uint32());break;case 17:r.freeze=i.proto.FreezeTransactionBody.decode(e,e.uint32());break;case 18:r.consensusCreateTopic=i.proto.ConsensusCreateTopicTransactionBody.decode(e,e.uint32());break;case 19:r.consensusUpdateTopic=i.proto.ConsensusUpdateTopicTransactionBody.decode(e,e.uint32());break;case 20:r.consensusDeleteTopic=i.proto.ConsensusDeleteTopicTransactionBody.decode(e,e.uint32());break;case 21:r.consensusSubmitMessage=i.proto.ConsensusSubmitMessageTransactionBody.decode(e,e.uint32());break;case 22:r.tokenCreation=i.proto.TokenCreateTransactionBody.decode(e,e.uint32());break;case 23:r.tokenFreeze=i.proto.TokenFreezeAccountTransactionBody.decode(e,e.uint32());break;case 24:r.tokenUnfreeze=i.proto.TokenUnfreezeAccountTransactionBody.decode(e,e.uint32());break;case 25:r.tokenGrantKyc=i.proto.TokenGrantKycTransactionBody.decode(e,e.uint32());break;case 26:r.tokenRevokeKyc=i.proto.TokenRevokeKycTransactionBody.decode(e,e.uint32());break;case 27:r.tokenDeletion=i.proto.TokenDeleteTransactionBody.decode(e,e.uint32());break;case 28:r.tokenUpdate=i.proto.TokenUpdateTransactionBody.decode(e,e.uint32());break;case 29:r.tokenMint=i.proto.TokenMintTransactionBody.decode(e,e.uint32());break;case 30:r.tokenBurn=i.proto.TokenBurnTransactionBody.decode(e,e.uint32());break;case 31:r.tokenWipe=i.proto.TokenWipeAccountTransactionBody.decode(e,e.uint32());break;case 32:r.tokenAssociate=i.proto.TokenAssociateTransactionBody.decode(e,e.uint32());break;case 33:r.tokenDissociate=i.proto.TokenDissociateTransactionBody.decode(e,e.uint32());break;case 34:r.scheduleDelete=i.proto.ScheduleDeleteTransactionBody.decode(e,e.uint32());break;case 35:r.tokenPause=i.proto.TokenPauseTransactionBody.decode(e,e.uint32());break;case 36:r.tokenUnpause=i.proto.TokenUnpauseTransactionBody.decode(e,e.uint32());break;case 37:r.cryptoApproveAllowance=i.proto.CryptoApproveAllowanceTransactionBody.decode(e,e.uint32());break;case 38:r.cryptoDeleteAllowance=i.proto.CryptoDeleteAllowanceTransactionBody.decode(e,e.uint32());break;case 39:r.tokenFeeScheduleUpdate=i.proto.TokenFeeScheduleUpdateTransactionBody.decode(e,e.uint32());break;case 40:r.utilPrng=i.proto.UtilPrngTransactionBody.decode(e,e.uint32());break;case 41:r.tokenUpdateNfts=i.proto.TokenUpdateNftsTransactionBody.decode(e,e.uint32());break;case 42:r.nodeCreate=i.com.hedera.hapi.node.addressbook.NodeCreateTransactionBody.decode(e,e.uint32());break;case 43:r.nodeUpdate=i.com.hedera.hapi.node.addressbook.NodeUpdateTransactionBody.decode(e,e.uint32());break;case 44:r.nodeDelete=i.com.hedera.hapi.node.addressbook.NodeDeleteTransactionBody.decode(e,e.uint32());break;case 45:r.tokenReject=i.proto.TokenRejectTransactionBody.decode(e,e.uint32());break;case 46:r.tokenCancelAirdrop=i.proto.TokenCancelAirdropTransactionBody.decode(e,e.uint32());break;case 47:r.tokenClaimAirdrop=i.proto.TokenClaimAirdropTransactionBody.decode(e,e.uint32());break;case 48:r.tokenAirdrop=i.proto.TokenAirdropTransactionBody.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SchedulableTransactionBody"},e}(),t.ScheduleDeleteTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.scheduleID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.scheduleID&&Object.hasOwnProperty.call(e,"scheduleID")&&i.proto.ScheduleID.encode(e.scheduleID,t.uint32(10).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ScheduleDeleteTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.scheduleID=i.proto.ScheduleID.decode(e,e.uint32());else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ScheduleDeleteTransactionBody"},e}(),t.UtilPrngTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.range=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.range&&Object.hasOwnProperty.call(e,"range")&&t.uint32(8).int32(e.range),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.UtilPrngTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.range=e.int32();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.UtilPrngTransactionBody"},e}(),t.ScheduleSignTransactionBody=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.scheduleID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.scheduleID&&Object.hasOwnProperty.call(e,"scheduleID")&&i.proto.ScheduleID.encode(e.scheduleID,t.uint32(10).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ScheduleSignTransactionBody;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.scheduleID=i.proto.ScheduleID.decode(e,e.uint32());else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ScheduleSignTransactionBody"},e}(),t.NodeStakeUpdateTransactionBody=function(){function e(e){if(this.nodeStake=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.endOfStakingPeriod=null,e.prototype.nodeStake=r.emptyArray,e.prototype.maxStakingRewardRatePerHbar=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.nodeRewardFeeFraction=null,e.prototype.stakingPeriodsStored=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.stakingPeriod=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.stakingRewardFeeFraction=null,e.prototype.stakingStartThreshold=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.stakingRewardRate=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.reservedStakingRewards=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.unreservedStakingRewardBalance=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.rewardBalanceThreshold=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.maxStakeRewarded=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.maxTotalReward=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.endOfStakingPeriod&&Object.hasOwnProperty.call(e,"endOfStakingPeriod")&&i.proto.Timestamp.encode(e.endOfStakingPeriod,t.uint32(10).fork()).ldelim(),null!=e.nodeStake&&e.nodeStake.length)for(var n=0;n<e.nodeStake.length;++n)i.proto.NodeStake.encode(e.nodeStake[n],t.uint32(18).fork()).ldelim();return null!=e.maxStakingRewardRatePerHbar&&Object.hasOwnProperty.call(e,"maxStakingRewardRatePerHbar")&&t.uint32(24).int64(e.maxStakingRewardRatePerHbar),null!=e.nodeRewardFeeFraction&&Object.hasOwnProperty.call(e,"nodeRewardFeeFraction")&&i.proto.Fraction.encode(e.nodeRewardFeeFraction,t.uint32(34).fork()).ldelim(),null!=e.stakingPeriodsStored&&Object.hasOwnProperty.call(e,"stakingPeriodsStored")&&t.uint32(40).int64(e.stakingPeriodsStored),null!=e.stakingPeriod&&Object.hasOwnProperty.call(e,"stakingPeriod")&&t.uint32(48).int64(e.stakingPeriod),null!=e.stakingRewardFeeFraction&&Object.hasOwnProperty.call(e,"stakingRewardFeeFraction")&&i.proto.Fraction.encode(e.stakingRewardFeeFraction,t.uint32(58).fork()).ldelim(),null!=e.stakingStartThreshold&&Object.hasOwnProperty.call(e,"stakingStartThreshold")&&t.uint32(64).int64(e.stakingStartThreshold),null!=e.stakingRewardRate&&Object.hasOwnProperty.call(e,"stakingRewardRate")&&t.uint32(72).int64(e.stakingRewardRate),null!=e.reservedStakingRewards&&Object.hasOwnProperty.call(e,"reservedStakingRewards")&&t.uint32(80).int64(e.reservedStakingRewards),null!=e.unreservedStakingRewardBalance&&Object.hasOwnProperty.call(e,"unreservedStakingRewardBalance")&&t.uint32(88).int64(e.unreservedStakingRewardBalance),null!=e.rewardBalanceThreshold&&Object.hasOwnProperty.call(e,"rewardBalanceThreshold")&&t.uint32(96).int64(e.rewardBalanceThreshold),null!=e.maxStakeRewarded&&Object.hasOwnProperty.call(e,"maxStakeRewarded")&&t.uint32(104).int64(e.maxStakeRewarded),null!=e.maxTotalReward&&Object.hasOwnProperty.call(e,"maxTotalReward")&&t.uint32(112).int64(e.maxTotalReward),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NodeStakeUpdateTransactionBody;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.endOfStakingPeriod=i.proto.Timestamp.decode(e,e.uint32());break;case 2:r.nodeStake&&r.nodeStake.length||(r.nodeStake=[]),r.nodeStake.push(i.proto.NodeStake.decode(e,e.uint32()));break;case 3:r.maxStakingRewardRatePerHbar=e.int64();break;case 4:r.nodeRewardFeeFraction=i.proto.Fraction.decode(e,e.uint32());break;case 5:r.stakingPeriodsStored=e.int64();break;case 6:r.stakingPeriod=e.int64();break;case 7:r.stakingRewardFeeFraction=i.proto.Fraction.decode(e,e.uint32());break;case 8:r.stakingStartThreshold=e.int64();break;case 9:r.stakingRewardRate=e.int64();break;case 10:r.reservedStakingRewards=e.int64();break;case 11:r.unreservedStakingRewardBalance=e.int64();break;case 12:r.rewardBalanceThreshold=e.int64();break;case 13:r.maxStakeRewarded=e.int64();break;case 14:r.maxTotalReward=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NodeStakeUpdateTransactionBody"},e}(),t.NodeStake=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.maxStake=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.minStake=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.nodeId=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.rewardRate=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.stake=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.stakeNotRewarded=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.stakeRewarded=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.maxStake&&Object.hasOwnProperty.call(e,"maxStake")&&t.uint32(8).int64(e.maxStake),null!=e.minStake&&Object.hasOwnProperty.call(e,"minStake")&&t.uint32(16).int64(e.minStake),null!=e.nodeId&&Object.hasOwnProperty.call(e,"nodeId")&&t.uint32(24).int64(e.nodeId),null!=e.rewardRate&&Object.hasOwnProperty.call(e,"rewardRate")&&t.uint32(32).int64(e.rewardRate),null!=e.stake&&Object.hasOwnProperty.call(e,"stake")&&t.uint32(40).int64(e.stake),null!=e.stakeNotRewarded&&Object.hasOwnProperty.call(e,"stakeNotRewarded")&&t.uint32(48).int64(e.stakeNotRewarded),null!=e.stakeRewarded&&Object.hasOwnProperty.call(e,"stakeRewarded")&&t.uint32(56).int64(e.stakeRewarded),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NodeStake;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.maxStake=e.int64();break;case 2:r.minStake=e.int64();break;case 3:r.nodeId=e.int64();break;case 4:r.rewardRate=e.int64();break;case 5:r.stake=e.int64();break;case 6:r.stakeNotRewarded=e.int64();break;case 7:r.stakeRewarded=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NodeStake"},e}(),t.ConsensusGetTopicInfoQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.topicID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&i.proto.TopicID.encode(e.topicID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ConsensusGetTopicInfoQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.topicID=i.proto.TopicID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ConsensusGetTopicInfoQuery"},e}(),t.ConsensusGetTopicInfoResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.topicID=null,e.prototype.topicInfo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&i.proto.TopicID.encode(e.topicID,t.uint32(18).fork()).ldelim(),null!=e.topicInfo&&Object.hasOwnProperty.call(e,"topicInfo")&&i.proto.ConsensusTopicInfo.encode(e.topicInfo,t.uint32(42).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ConsensusGetTopicInfoResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.topicID=i.proto.TopicID.decode(e,e.uint32());break;case 5:r.topicInfo=i.proto.ConsensusTopicInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ConsensusGetTopicInfoResponse"},e}(),t.ResponseType=function(){const e={},t=Object.create(e);return t[e[0]="ANSWER_ONLY"]=0,t[e[1]="ANSWER_STATE_PROOF"]=1,t[e[2]="COST_ANSWER"]=2,t[e[3]="COST_ANSWER_STATE_PROOF"]=3,t}(),t.QueryHeader=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.payment=null,e.prototype.responseType=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.payment&&Object.hasOwnProperty.call(e,"payment")&&i.proto.Transaction.encode(e.payment,t.uint32(10).fork()).ldelim(),null!=e.responseType&&Object.hasOwnProperty.call(e,"responseType")&&t.uint32(16).int32(e.responseType),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.QueryHeader;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.payment=i.proto.Transaction.decode(e,e.uint32());break;case 2:r.responseType=e.int32();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.QueryHeader"},e}(),t.ResponseHeader=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.nodeTransactionPrecheckCode=0,e.prototype.responseType=0,e.prototype.cost=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.stateProof=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.nodeTransactionPrecheckCode&&Object.hasOwnProperty.call(e,"nodeTransactionPrecheckCode")&&t.uint32(8).int32(e.nodeTransactionPrecheckCode),null!=e.responseType&&Object.hasOwnProperty.call(e,"responseType")&&t.uint32(16).int32(e.responseType),null!=e.cost&&Object.hasOwnProperty.call(e,"cost")&&t.uint32(24).uint64(e.cost),null!=e.stateProof&&Object.hasOwnProperty.call(e,"stateProof")&&t.uint32(34).bytes(e.stateProof),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ResponseHeader;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.nodeTransactionPrecheckCode=e.int32();break;case 2:r.responseType=e.int32();break;case 3:r.cost=e.uint64();break;case 4:r.stateProof=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ResponseHeader"},e}(),t.ConsensusTopicInfo=function(){function e(e){if(this.feeExemptKeyList=[],this.customFees=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.memo="",e.prototype.runningHash=r.newBuffer([]),e.prototype.sequenceNumber=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.expirationTime=null,e.prototype.adminKey=null,e.prototype.submitKey=null,e.prototype.autoRenewPeriod=null,e.prototype.autoRenewAccount=null,e.prototype.ledgerId=r.newBuffer([]),e.prototype.feeScheduleKey=null,e.prototype.feeExemptKeyList=r.emptyArray,e.prototype.customFees=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(10).string(e.memo),null!=e.runningHash&&Object.hasOwnProperty.call(e,"runningHash")&&t.uint32(18).bytes(e.runningHash),null!=e.sequenceNumber&&Object.hasOwnProperty.call(e,"sequenceNumber")&&t.uint32(24).uint64(e.sequenceNumber),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(34).fork()).ldelim(),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(42).fork()).ldelim(),null!=e.submitKey&&Object.hasOwnProperty.call(e,"submitKey")&&i.proto.Key.encode(e.submitKey,t.uint32(50).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(58).fork()).ldelim(),null!=e.autoRenewAccount&&Object.hasOwnProperty.call(e,"autoRenewAccount")&&i.proto.AccountID.encode(e.autoRenewAccount,t.uint32(66).fork()).ldelim(),null!=e.ledgerId&&Object.hasOwnProperty.call(e,"ledgerId")&&t.uint32(74).bytes(e.ledgerId),null!=e.feeScheduleKey&&Object.hasOwnProperty.call(e,"feeScheduleKey")&&i.proto.Key.encode(e.feeScheduleKey,t.uint32(82).fork()).ldelim(),null!=e.feeExemptKeyList&&e.feeExemptKeyList.length)for(var n=0;n<e.feeExemptKeyList.length;++n)i.proto.Key.encode(e.feeExemptKeyList[n],t.uint32(90).fork()).ldelim();if(null!=e.customFees&&e.customFees.length)for(n=0;n<e.customFees.length;++n)i.proto.FixedCustomFee.encode(e.customFees[n],t.uint32(98).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ConsensusTopicInfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.memo=e.string();break;case 2:r.runningHash=e.bytes();break;case 3:r.sequenceNumber=e.uint64();break;case 4:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 5:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 6:r.submitKey=i.proto.Key.decode(e,e.uint32());break;case 7:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 8:r.autoRenewAccount=i.proto.AccountID.decode(e,e.uint32());break;case 9:r.ledgerId=e.bytes();break;case 10:r.feeScheduleKey=i.proto.Key.decode(e,e.uint32());break;case 11:r.feeExemptKeyList&&r.feeExemptKeyList.length||(r.feeExemptKeyList=[]),r.feeExemptKeyList.push(i.proto.Key.decode(e,e.uint32()));break;case 12:r.customFees&&r.customFees.length||(r.customFees=[]),r.customFees.push(i.proto.FixedCustomFee.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ConsensusTopicInfo"},e}(),t.ConsensusService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.createTopic=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"createTopic"}),Object.defineProperty(t.prototype.updateTopic=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"updateTopic"}),Object.defineProperty(t.prototype.deleteTopic=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"deleteTopic"}),Object.defineProperty(t.prototype.submitMessage=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"submitMessage"}),Object.defineProperty(t.prototype.getTopicInfo=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getTopicInfo"}),t}(),t.Query=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.getByKey=null,e.prototype.getBySolidityID=null,e.prototype.contractCallLocal=null,e.prototype.contractGetInfo=null,e.prototype.contractGetBytecode=null,e.prototype.ContractGetRecords=null,e.prototype.cryptogetAccountBalance=null,e.prototype.cryptoGetAccountRecords=null,e.prototype.cryptoGetInfo=null,e.prototype.cryptoGetLiveHash=null,e.prototype.cryptoGetProxyStakers=null,e.prototype.fileGetContents=null,e.prototype.fileGetInfo=null,e.prototype.transactionGetReceipt=null,e.prototype.transactionGetRecord=null,e.prototype.transactionGetFastRecord=null,e.prototype.consensusGetTopicInfo=null,e.prototype.networkGetVersionInfo=null,e.prototype.tokenGetInfo=null,e.prototype.scheduleGetInfo=null,e.prototype.tokenGetAccountNftInfos=null,e.prototype.tokenGetNftInfo=null,e.prototype.tokenGetNftInfos=null,e.prototype.networkGetExecutionTime=null,e.prototype.accountDetails=null,Object.defineProperty(e.prototype,"query",{get:r.oneOfGetter(t=["getByKey","getBySolidityID","contractCallLocal","contractGetInfo","contractGetBytecode","ContractGetRecords","cryptogetAccountBalance","cryptoGetAccountRecords","cryptoGetInfo","cryptoGetLiveHash","cryptoGetProxyStakers","fileGetContents","fileGetInfo","transactionGetReceipt","transactionGetRecord","transactionGetFastRecord","consensusGetTopicInfo","networkGetVersionInfo","tokenGetInfo","scheduleGetInfo","tokenGetAccountNftInfos","tokenGetNftInfo","tokenGetNftInfos","networkGetExecutionTime","accountDetails"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.getByKey&&Object.hasOwnProperty.call(e,"getByKey")&&i.proto.GetByKeyQuery.encode(e.getByKey,t.uint32(10).fork()).ldelim(),null!=e.getBySolidityID&&Object.hasOwnProperty.call(e,"getBySolidityID")&&i.proto.GetBySolidityIDQuery.encode(e.getBySolidityID,t.uint32(18).fork()).ldelim(),null!=e.contractCallLocal&&Object.hasOwnProperty.call(e,"contractCallLocal")&&i.proto.ContractCallLocalQuery.encode(e.contractCallLocal,t.uint32(26).fork()).ldelim(),null!=e.contractGetInfo&&Object.hasOwnProperty.call(e,"contractGetInfo")&&i.proto.ContractGetInfoQuery.encode(e.contractGetInfo,t.uint32(34).fork()).ldelim(),null!=e.contractGetBytecode&&Object.hasOwnProperty.call(e,"contractGetBytecode")&&i.proto.ContractGetBytecodeQuery.encode(e.contractGetBytecode,t.uint32(42).fork()).ldelim(),null!=e.ContractGetRecords&&Object.hasOwnProperty.call(e,"ContractGetRecords")&&i.proto.ContractGetRecordsQuery.encode(e.ContractGetRecords,t.uint32(50).fork()).ldelim(),null!=e.cryptogetAccountBalance&&Object.hasOwnProperty.call(e,"cryptogetAccountBalance")&&i.proto.CryptoGetAccountBalanceQuery.encode(e.cryptogetAccountBalance,t.uint32(58).fork()).ldelim(),null!=e.cryptoGetAccountRecords&&Object.hasOwnProperty.call(e,"cryptoGetAccountRecords")&&i.proto.CryptoGetAccountRecordsQuery.encode(e.cryptoGetAccountRecords,t.uint32(66).fork()).ldelim(),null!=e.cryptoGetInfo&&Object.hasOwnProperty.call(e,"cryptoGetInfo")&&i.proto.CryptoGetInfoQuery.encode(e.cryptoGetInfo,t.uint32(74).fork()).ldelim(),null!=e.cryptoGetLiveHash&&Object.hasOwnProperty.call(e,"cryptoGetLiveHash")&&i.proto.CryptoGetLiveHashQuery.encode(e.cryptoGetLiveHash,t.uint32(82).fork()).ldelim(),null!=e.cryptoGetProxyStakers&&Object.hasOwnProperty.call(e,"cryptoGetProxyStakers")&&i.proto.CryptoGetStakersQuery.encode(e.cryptoGetProxyStakers,t.uint32(90).fork()).ldelim(),null!=e.fileGetContents&&Object.hasOwnProperty.call(e,"fileGetContents")&&i.proto.FileGetContentsQuery.encode(e.fileGetContents,t.uint32(98).fork()).ldelim(),null!=e.fileGetInfo&&Object.hasOwnProperty.call(e,"fileGetInfo")&&i.proto.FileGetInfoQuery.encode(e.fileGetInfo,t.uint32(106).fork()).ldelim(),null!=e.transactionGetReceipt&&Object.hasOwnProperty.call(e,"transactionGetReceipt")&&i.proto.TransactionGetReceiptQuery.encode(e.transactionGetReceipt,t.uint32(114).fork()).ldelim(),null!=e.transactionGetRecord&&Object.hasOwnProperty.call(e,"transactionGetRecord")&&i.proto.TransactionGetRecordQuery.encode(e.transactionGetRecord,t.uint32(122).fork()).ldelim(),null!=e.transactionGetFastRecord&&Object.hasOwnProperty.call(e,"transactionGetFastRecord")&&i.proto.TransactionGetFastRecordQuery.encode(e.transactionGetFastRecord,t.uint32(130).fork()).ldelim(),null!=e.consensusGetTopicInfo&&Object.hasOwnProperty.call(e,"consensusGetTopicInfo")&&i.proto.ConsensusGetTopicInfoQuery.encode(e.consensusGetTopicInfo,t.uint32(402).fork()).ldelim(),null!=e.networkGetVersionInfo&&Object.hasOwnProperty.call(e,"networkGetVersionInfo")&&i.proto.NetworkGetVersionInfoQuery.encode(e.networkGetVersionInfo,t.uint32(410).fork()).ldelim(),null!=e.tokenGetInfo&&Object.hasOwnProperty.call(e,"tokenGetInfo")&&i.proto.TokenGetInfoQuery.encode(e.tokenGetInfo,t.uint32(418).fork()).ldelim(),null!=e.scheduleGetInfo&&Object.hasOwnProperty.call(e,"scheduleGetInfo")&&i.proto.ScheduleGetInfoQuery.encode(e.scheduleGetInfo,t.uint32(426).fork()).ldelim(),null!=e.tokenGetAccountNftInfos&&Object.hasOwnProperty.call(e,"tokenGetAccountNftInfos")&&i.proto.TokenGetAccountNftInfosQuery.encode(e.tokenGetAccountNftInfos,t.uint32(434).fork()).ldelim(),null!=e.tokenGetNftInfo&&Object.hasOwnProperty.call(e,"tokenGetNftInfo")&&i.proto.TokenGetNftInfoQuery.encode(e.tokenGetNftInfo,t.uint32(442).fork()).ldelim(),null!=e.tokenGetNftInfos&&Object.hasOwnProperty.call(e,"tokenGetNftInfos")&&i.proto.TokenGetNftInfosQuery.encode(e.tokenGetNftInfos,t.uint32(450).fork()).ldelim(),null!=e.networkGetExecutionTime&&Object.hasOwnProperty.call(e,"networkGetExecutionTime")&&i.proto.NetworkGetExecutionTimeQuery.encode(e.networkGetExecutionTime,t.uint32(458).fork()).ldelim(),null!=e.accountDetails&&Object.hasOwnProperty.call(e,"accountDetails")&&i.proto.GetAccountDetailsQuery.encode(e.accountDetails,t.uint32(466).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.Query;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.getByKey=i.proto.GetByKeyQuery.decode(e,e.uint32());break;case 2:r.getBySolidityID=i.proto.GetBySolidityIDQuery.decode(e,e.uint32());break;case 3:r.contractCallLocal=i.proto.ContractCallLocalQuery.decode(e,e.uint32());break;case 4:r.contractGetInfo=i.proto.ContractGetInfoQuery.decode(e,e.uint32());break;case 5:r.contractGetBytecode=i.proto.ContractGetBytecodeQuery.decode(e,e.uint32());break;case 6:r.ContractGetRecords=i.proto.ContractGetRecordsQuery.decode(e,e.uint32());break;case 7:r.cryptogetAccountBalance=i.proto.CryptoGetAccountBalanceQuery.decode(e,e.uint32());break;case 8:r.cryptoGetAccountRecords=i.proto.CryptoGetAccountRecordsQuery.decode(e,e.uint32());break;case 9:r.cryptoGetInfo=i.proto.CryptoGetInfoQuery.decode(e,e.uint32());break;case 10:r.cryptoGetLiveHash=i.proto.CryptoGetLiveHashQuery.decode(e,e.uint32());break;case 11:r.cryptoGetProxyStakers=i.proto.CryptoGetStakersQuery.decode(e,e.uint32());break;case 12:r.fileGetContents=i.proto.FileGetContentsQuery.decode(e,e.uint32());break;case 13:r.fileGetInfo=i.proto.FileGetInfoQuery.decode(e,e.uint32());break;case 14:r.transactionGetReceipt=i.proto.TransactionGetReceiptQuery.decode(e,e.uint32());break;case 15:r.transactionGetRecord=i.proto.TransactionGetRecordQuery.decode(e,e.uint32());break;case 16:r.transactionGetFastRecord=i.proto.TransactionGetFastRecordQuery.decode(e,e.uint32());break;case 50:r.consensusGetTopicInfo=i.proto.ConsensusGetTopicInfoQuery.decode(e,e.uint32());break;case 51:r.networkGetVersionInfo=i.proto.NetworkGetVersionInfoQuery.decode(e,e.uint32());break;case 52:r.tokenGetInfo=i.proto.TokenGetInfoQuery.decode(e,e.uint32());break;case 53:r.scheduleGetInfo=i.proto.ScheduleGetInfoQuery.decode(e,e.uint32());break;case 54:r.tokenGetAccountNftInfos=i.proto.TokenGetAccountNftInfosQuery.decode(e,e.uint32());break;case 55:r.tokenGetNftInfo=i.proto.TokenGetNftInfoQuery.decode(e,e.uint32());break;case 56:r.tokenGetNftInfos=i.proto.TokenGetNftInfosQuery.decode(e,e.uint32());break;case 57:r.networkGetExecutionTime=i.proto.NetworkGetExecutionTimeQuery.decode(e,e.uint32());break;case 58:r.accountDetails=i.proto.GetAccountDetailsQuery.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Query"},e}(),t.GetByKeyQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.key=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&i.proto.Key.encode(e.key,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.GetByKeyQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.key=i.proto.Key.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.GetByKeyQuery"},e}(),t.EntityID=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.accountID=null,e.prototype.liveHash=null,e.prototype.fileID=null,e.prototype.contractID=null,Object.defineProperty(e.prototype,"entity",{get:r.oneOfGetter(t=["accountID","liveHash","fileID","contractID"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(10).fork()).ldelim(),null!=e.liveHash&&Object.hasOwnProperty.call(e,"liveHash")&&i.proto.LiveHash.encode(e.liveHash,t.uint32(18).fork()).ldelim(),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(26).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(34).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.EntityID;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.liveHash=i.proto.LiveHash.decode(e,e.uint32());break;case 3:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 4:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.EntityID"},e}(),t.GetByKeyResponse=function(){function e(e){if(this.entities=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.entities=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.entities&&e.entities.length)for(var n=0;n<e.entities.length;++n)i.proto.EntityID.encode(e.entities[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.GetByKeyResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.entities&&r.entities.length||(r.entities=[]),r.entities.push(i.proto.EntityID.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.GetByKeyResponse"},e}(),t.GetBySolidityIDQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.solidityID="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.solidityID&&Object.hasOwnProperty.call(e,"solidityID")&&t.uint32(18).string(e.solidityID),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.GetBySolidityIDQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.solidityID=e.string();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.GetBySolidityIDQuery"},e}(),t.GetBySolidityIDResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountID=null,e.prototype.fileID=null,e.prototype.contractID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(26).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(34).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.GetBySolidityIDResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 4:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.GetBySolidityIDResponse"},e}(),t.ContractCallLocalQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.contractID=null,e.prototype.gas=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.functionParameters=r.newBuffer([]),e.prototype.maxResultSize=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.senderId=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(18).fork()).ldelim(),null!=e.gas&&Object.hasOwnProperty.call(e,"gas")&&t.uint32(24).int64(e.gas),null!=e.functionParameters&&Object.hasOwnProperty.call(e,"functionParameters")&&t.uint32(34).bytes(e.functionParameters),null!=e.maxResultSize&&Object.hasOwnProperty.call(e,"maxResultSize")&&t.uint32(40).int64(e.maxResultSize),null!=e.senderId&&Object.hasOwnProperty.call(e,"senderId")&&i.proto.AccountID.encode(e.senderId,t.uint32(50).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractCallLocalQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 3:r.gas=e.int64();break;case 4:r.functionParameters=e.bytes();break;case 5:r.maxResultSize=e.int64();break;case 6:r.senderId=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractCallLocalQuery"},e}(),t.ContractCallLocalResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.functionResult=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.functionResult&&Object.hasOwnProperty.call(e,"functionResult")&&i.proto.ContractFunctionResult.encode(e.functionResult,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractCallLocalResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.functionResult=i.proto.ContractFunctionResult.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractCallLocalResponse"},e}(),t.ContractNonceInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.contractId=null,e.prototype.nonce=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.contractId&&Object.hasOwnProperty.call(e,"contractId")&&i.proto.ContractID.encode(e.contractId,t.uint32(10).fork()).ldelim(),null!=e.nonce&&Object.hasOwnProperty.call(e,"nonce")&&t.uint32(16).int64(e.nonce),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractNonceInfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contractId=i.proto.ContractID.decode(e,e.uint32());break;case 2:r.nonce=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractNonceInfo"},e}(),t.ContractLoginfo=function(){function e(e){if(this.topic=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.contractID=null,e.prototype.bloom=r.newBuffer([]),e.prototype.topic=r.emptyArray,e.prototype.data=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(10).fork()).ldelim(),null!=e.bloom&&Object.hasOwnProperty.call(e,"bloom")&&t.uint32(18).bytes(e.bloom),null!=e.topic&&e.topic.length)for(var n=0;n<e.topic.length;++n)t.uint32(26).bytes(e.topic[n]);return null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractLoginfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 2:r.bloom=e.bytes();break;case 3:r.topic&&r.topic.length||(r.topic=[]),r.topic.push(e.bytes());break;case 4:r.data=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractLoginfo"},e}(),t.ContractFunctionResult=function(){function e(e){if(this.logInfo=[],this.createdContractIDs=[],this.contractNonces=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.contractID=null,e.prototype.contractCallResult=r.newBuffer([]),e.prototype.errorMessage="",e.prototype.bloom=r.newBuffer([]),e.prototype.gasUsed=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.logInfo=r.emptyArray,e.prototype.createdContractIDs=r.emptyArray,e.prototype.evmAddress=null,e.prototype.gas=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.functionParameters=r.newBuffer([]),e.prototype.senderId=null,e.prototype.contractNonces=r.emptyArray,e.prototype.signerNonce=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(10).fork()).ldelim(),null!=e.contractCallResult&&Object.hasOwnProperty.call(e,"contractCallResult")&&t.uint32(18).bytes(e.contractCallResult),null!=e.errorMessage&&Object.hasOwnProperty.call(e,"errorMessage")&&t.uint32(26).string(e.errorMessage),null!=e.bloom&&Object.hasOwnProperty.call(e,"bloom")&&t.uint32(34).bytes(e.bloom),null!=e.gasUsed&&Object.hasOwnProperty.call(e,"gasUsed")&&t.uint32(40).uint64(e.gasUsed),null!=e.logInfo&&e.logInfo.length)for(var n=0;n<e.logInfo.length;++n)i.proto.ContractLoginfo.encode(e.logInfo[n],t.uint32(50).fork()).ldelim();if(null!=e.createdContractIDs&&e.createdContractIDs.length)for(n=0;n<e.createdContractIDs.length;++n)i.proto.ContractID.encode(e.createdContractIDs[n],t.uint32(58).fork()).ldelim();if(null!=e.evmAddress&&Object.hasOwnProperty.call(e,"evmAddress")&&i.google.protobuf.BytesValue.encode(e.evmAddress,t.uint32(74).fork()).ldelim(),null!=e.gas&&Object.hasOwnProperty.call(e,"gas")&&t.uint32(80).int64(e.gas),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(88).int64(e.amount),null!=e.functionParameters&&Object.hasOwnProperty.call(e,"functionParameters")&&t.uint32(98).bytes(e.functionParameters),null!=e.senderId&&Object.hasOwnProperty.call(e,"senderId")&&i.proto.AccountID.encode(e.senderId,t.uint32(106).fork()).ldelim(),null!=e.contractNonces&&e.contractNonces.length)for(n=0;n<e.contractNonces.length;++n)i.proto.ContractNonceInfo.encode(e.contractNonces[n],t.uint32(114).fork()).ldelim();return null!=e.signerNonce&&Object.hasOwnProperty.call(e,"signerNonce")&&i.google.protobuf.Int64Value.encode(e.signerNonce,t.uint32(122).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractFunctionResult;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 2:r.contractCallResult=e.bytes();break;case 3:r.errorMessage=e.string();break;case 4:r.bloom=e.bytes();break;case 5:r.gasUsed=e.uint64();break;case 6:r.logInfo&&r.logInfo.length||(r.logInfo=[]),r.logInfo.push(i.proto.ContractLoginfo.decode(e,e.uint32()));break;case 7:r.createdContractIDs&&r.createdContractIDs.length||(r.createdContractIDs=[]),r.createdContractIDs.push(i.proto.ContractID.decode(e,e.uint32()));break;case 9:r.evmAddress=i.google.protobuf.BytesValue.decode(e,e.uint32());break;case 10:r.gas=e.int64();break;case 11:r.amount=e.int64();break;case 12:r.functionParameters=e.bytes();break;case 13:r.senderId=i.proto.AccountID.decode(e,e.uint32());break;case 14:r.contractNonces&&r.contractNonces.length||(r.contractNonces=[]),r.contractNonces.push(i.proto.ContractNonceInfo.decode(e,e.uint32()));break;case 15:r.signerNonce=i.google.protobuf.Int64Value.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractFunctionResult"},e}(),t.ContractGetInfoQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.contractID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractGetInfoQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractGetInfoQuery"},e}(),t.ContractGetInfoResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.contractInfo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.contractInfo&&Object.hasOwnProperty.call(e,"contractInfo")&&i.proto.ContractGetInfoResponse.ContractInfo.encode(e.contractInfo,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractGetInfoResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.contractInfo=i.proto.ContractGetInfoResponse.ContractInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractGetInfoResponse"},e.ContractInfo=function(){function e(e){if(this.tokenRelationships=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.contractID=null,e.prototype.accountID=null,e.prototype.contractAccountID="",e.prototype.adminKey=null,e.prototype.expirationTime=null,e.prototype.autoRenewPeriod=null,e.prototype.storage=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.memo="",e.prototype.balance=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.deleted=!1,e.prototype.tokenRelationships=r.emptyArray,e.prototype.ledgerId=r.newBuffer([]),e.prototype.autoRenewAccountId=null,e.prototype.maxAutomaticTokenAssociations=0,e.prototype.stakingInfo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),null!=e.contractAccountID&&Object.hasOwnProperty.call(e,"contractAccountID")&&t.uint32(26).string(e.contractAccountID),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(34).fork()).ldelim(),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(42).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(50).fork()).ldelim(),null!=e.storage&&Object.hasOwnProperty.call(e,"storage")&&t.uint32(56).int64(e.storage),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(66).string(e.memo),null!=e.balance&&Object.hasOwnProperty.call(e,"balance")&&t.uint32(72).uint64(e.balance),null!=e.deleted&&Object.hasOwnProperty.call(e,"deleted")&&t.uint32(80).bool(e.deleted),null!=e.tokenRelationships&&e.tokenRelationships.length)for(var n=0;n<e.tokenRelationships.length;++n)i.proto.TokenRelationship.encode(e.tokenRelationships[n],t.uint32(90).fork()).ldelim();return null!=e.ledgerId&&Object.hasOwnProperty.call(e,"ledgerId")&&t.uint32(98).bytes(e.ledgerId),null!=e.autoRenewAccountId&&Object.hasOwnProperty.call(e,"autoRenewAccountId")&&i.proto.AccountID.encode(e.autoRenewAccountId,t.uint32(106).fork()).ldelim(),null!=e.maxAutomaticTokenAssociations&&Object.hasOwnProperty.call(e,"maxAutomaticTokenAssociations")&&t.uint32(112).int32(e.maxAutomaticTokenAssociations),null!=e.stakingInfo&&Object.hasOwnProperty.call(e,"stakingInfo")&&i.proto.StakingInfo.encode(e.stakingInfo,t.uint32(122).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractGetInfoResponse.ContractInfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.contractAccountID=e.string();break;case 4:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 5:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 6:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 7:r.storage=e.int64();break;case 8:r.memo=e.string();break;case 9:r.balance=e.uint64();break;case 10:r.deleted=e.bool();break;case 11:r.tokenRelationships&&r.tokenRelationships.length||(r.tokenRelationships=[]),r.tokenRelationships.push(i.proto.TokenRelationship.decode(e,e.uint32()));break;case 12:r.ledgerId=e.bytes();break;case 13:r.autoRenewAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 14:r.maxAutomaticTokenAssociations=e.int32();break;case 15:r.stakingInfo=i.proto.StakingInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractGetInfoResponse.ContractInfo"},e}(),e}(),t.ContractGetBytecodeQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.contractID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractGetBytecodeQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractGetBytecodeQuery"},e}(),t.ContractGetBytecodeResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.bytecode=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.bytecode&&Object.hasOwnProperty.call(e,"bytecode")&&t.uint32(50).bytes(e.bytecode),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractGetBytecodeResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 6:r.bytecode=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractGetBytecodeResponse"},e}(),t.ContractGetRecordsQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.contractID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractGetRecordsQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractGetRecordsQuery"},e}(),t.ContractGetRecordsResponse=function(){function e(e){if(this.records=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.contractID=null,e.prototype.records=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(18).fork()).ldelim(),null!=e.records&&e.records.length)for(var n=0;n<e.records.length;++n)i.proto.TransactionRecord.encode(e.records[n],t.uint32(26).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractGetRecordsResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 3:r.records&&r.records.length||(r.records=[]),r.records.push(i.proto.TransactionRecord.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractGetRecordsResponse"},e}(),t.TransactionRecord=function(){function e(e){if(this.tokenTransferLists=[],this.assessedCustomFees=[],this.automaticTokenAssociations=[],this.paidStakingRewards=[],this.newPendingAirdrops=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.receipt=null,e.prototype.transactionHash=r.newBuffer([]),e.prototype.consensusTimestamp=null,e.prototype.transactionID=null,e.prototype.memo="",e.prototype.transactionFee=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.contractCallResult=null,e.prototype.contractCreateResult=null,e.prototype.transferList=null,e.prototype.tokenTransferLists=r.emptyArray,e.prototype.scheduleRef=null,e.prototype.assessedCustomFees=r.emptyArray,e.prototype.automaticTokenAssociations=r.emptyArray,e.prototype.parentConsensusTimestamp=null,e.prototype.alias=r.newBuffer([]),e.prototype.ethereumHash=r.newBuffer([]),e.prototype.paidStakingRewards=r.emptyArray,e.prototype.prngBytes=null,e.prototype.prngNumber=null,e.prototype.evmAddress=r.newBuffer([]),e.prototype.newPendingAirdrops=r.emptyArray,Object.defineProperty(e.prototype,"body",{get:r.oneOfGetter(t=["contractCallResult","contractCreateResult"]),set:r.oneOfSetter(t)}),Object.defineProperty(e.prototype,"entropy",{get:r.oneOfGetter(t=["prngBytes","prngNumber"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.receipt&&Object.hasOwnProperty.call(e,"receipt")&&i.proto.TransactionReceipt.encode(e.receipt,t.uint32(10).fork()).ldelim(),null!=e.transactionHash&&Object.hasOwnProperty.call(e,"transactionHash")&&t.uint32(18).bytes(e.transactionHash),null!=e.consensusTimestamp&&Object.hasOwnProperty.call(e,"consensusTimestamp")&&i.proto.Timestamp.encode(e.consensusTimestamp,t.uint32(26).fork()).ldelim(),null!=e.transactionID&&Object.hasOwnProperty.call(e,"transactionID")&&i.proto.TransactionID.encode(e.transactionID,t.uint32(34).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(42).string(e.memo),null!=e.transactionFee&&Object.hasOwnProperty.call(e,"transactionFee")&&t.uint32(48).uint64(e.transactionFee),null!=e.contractCallResult&&Object.hasOwnProperty.call(e,"contractCallResult")&&i.proto.ContractFunctionResult.encode(e.contractCallResult,t.uint32(58).fork()).ldelim(),null!=e.contractCreateResult&&Object.hasOwnProperty.call(e,"contractCreateResult")&&i.proto.ContractFunctionResult.encode(e.contractCreateResult,t.uint32(66).fork()).ldelim(),null!=e.transferList&&Object.hasOwnProperty.call(e,"transferList")&&i.proto.TransferList.encode(e.transferList,t.uint32(82).fork()).ldelim(),null!=e.tokenTransferLists&&e.tokenTransferLists.length)for(var n=0;n<e.tokenTransferLists.length;++n)i.proto.TokenTransferList.encode(e.tokenTransferLists[n],t.uint32(90).fork()).ldelim();if(null!=e.scheduleRef&&Object.hasOwnProperty.call(e,"scheduleRef")&&i.proto.ScheduleID.encode(e.scheduleRef,t.uint32(98).fork()).ldelim(),null!=e.assessedCustomFees&&e.assessedCustomFees.length)for(n=0;n<e.assessedCustomFees.length;++n)i.proto.AssessedCustomFee.encode(e.assessedCustomFees[n],t.uint32(106).fork()).ldelim();if(null!=e.automaticTokenAssociations&&e.automaticTokenAssociations.length)for(n=0;n<e.automaticTokenAssociations.length;++n)i.proto.TokenAssociation.encode(e.automaticTokenAssociations[n],t.uint32(114).fork()).ldelim();if(null!=e.parentConsensusTimestamp&&Object.hasOwnProperty.call(e,"parentConsensusTimestamp")&&i.proto.Timestamp.encode(e.parentConsensusTimestamp,t.uint32(122).fork()).ldelim(),null!=e.alias&&Object.hasOwnProperty.call(e,"alias")&&t.uint32(130).bytes(e.alias),null!=e.ethereumHash&&Object.hasOwnProperty.call(e,"ethereumHash")&&t.uint32(138).bytes(e.ethereumHash),null!=e.paidStakingRewards&&e.paidStakingRewards.length)for(n=0;n<e.paidStakingRewards.length;++n)i.proto.AccountAmount.encode(e.paidStakingRewards[n],t.uint32(146).fork()).ldelim();if(null!=e.prngBytes&&Object.hasOwnProperty.call(e,"prngBytes")&&t.uint32(154).bytes(e.prngBytes),null!=e.prngNumber&&Object.hasOwnProperty.call(e,"prngNumber")&&t.uint32(160).int32(e.prngNumber),null!=e.evmAddress&&Object.hasOwnProperty.call(e,"evmAddress")&&t.uint32(170).bytes(e.evmAddress),null!=e.newPendingAirdrops&&e.newPendingAirdrops.length)for(n=0;n<e.newPendingAirdrops.length;++n)i.proto.PendingAirdropRecord.encode(e.newPendingAirdrops[n],t.uint32(178).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionRecord;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.receipt=i.proto.TransactionReceipt.decode(e,e.uint32());break;case 2:r.transactionHash=e.bytes();break;case 3:r.consensusTimestamp=i.proto.Timestamp.decode(e,e.uint32());break;case 4:r.transactionID=i.proto.TransactionID.decode(e,e.uint32());break;case 5:r.memo=e.string();break;case 6:r.transactionFee=e.uint64();break;case 7:r.contractCallResult=i.proto.ContractFunctionResult.decode(e,e.uint32());break;case 8:r.contractCreateResult=i.proto.ContractFunctionResult.decode(e,e.uint32());break;case 10:r.transferList=i.proto.TransferList.decode(e,e.uint32());break;case 11:r.tokenTransferLists&&r.tokenTransferLists.length||(r.tokenTransferLists=[]),r.tokenTransferLists.push(i.proto.TokenTransferList.decode(e,e.uint32()));break;case 12:r.scheduleRef=i.proto.ScheduleID.decode(e,e.uint32());break;case 13:r.assessedCustomFees&&r.assessedCustomFees.length||(r.assessedCustomFees=[]),r.assessedCustomFees.push(i.proto.AssessedCustomFee.decode(e,e.uint32()));break;case 14:r.automaticTokenAssociations&&r.automaticTokenAssociations.length||(r.automaticTokenAssociations=[]),r.automaticTokenAssociations.push(i.proto.TokenAssociation.decode(e,e.uint32()));break;case 15:r.parentConsensusTimestamp=i.proto.Timestamp.decode(e,e.uint32());break;case 16:r.alias=e.bytes();break;case 17:r.ethereumHash=e.bytes();break;case 18:r.paidStakingRewards&&r.paidStakingRewards.length||(r.paidStakingRewards=[]),r.paidStakingRewards.push(i.proto.AccountAmount.decode(e,e.uint32()));break;case 19:r.prngBytes=e.bytes();break;case 20:r.prngNumber=e.int32();break;case 21:r.evmAddress=e.bytes();break;case 22:r.newPendingAirdrops&&r.newPendingAirdrops.length||(r.newPendingAirdrops=[]),r.newPendingAirdrops.push(i.proto.PendingAirdropRecord.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionRecord"},e}(),t.PendingAirdropRecord=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.pendingAirdropId=null,e.prototype.pendingAirdropValue=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.pendingAirdropId&&Object.hasOwnProperty.call(e,"pendingAirdropId")&&i.proto.PendingAirdropId.encode(e.pendingAirdropId,t.uint32(10).fork()).ldelim(),null!=e.pendingAirdropValue&&Object.hasOwnProperty.call(e,"pendingAirdropValue")&&i.proto.PendingAirdropValue.encode(e.pendingAirdropValue,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.PendingAirdropRecord;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.pendingAirdropId=i.proto.PendingAirdropId.decode(e,e.uint32());break;case 2:r.pendingAirdropValue=i.proto.PendingAirdropValue.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.PendingAirdropRecord"},e}(),t.TransactionReceipt=function(){function e(e){if(this.serialNumbers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.status=0,e.prototype.accountID=null,e.prototype.fileID=null,e.prototype.contractID=null,e.prototype.exchangeRate=null,e.prototype.topicID=null,e.prototype.topicSequenceNumber=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.topicRunningHash=r.newBuffer([]),e.prototype.topicRunningHashVersion=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.tokenID=null,e.prototype.newTotalSupply=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.scheduleID=null,e.prototype.scheduledTransactionID=null,e.prototype.serialNumbers=r.emptyArray,e.prototype.nodeId=r.Long?r.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(26).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(34).fork()).ldelim(),null!=e.exchangeRate&&Object.hasOwnProperty.call(e,"exchangeRate")&&i.proto.ExchangeRateSet.encode(e.exchangeRate,t.uint32(42).fork()).ldelim(),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&i.proto.TopicID.encode(e.topicID,t.uint32(50).fork()).ldelim(),null!=e.topicSequenceNumber&&Object.hasOwnProperty.call(e,"topicSequenceNumber")&&t.uint32(56).uint64(e.topicSequenceNumber),null!=e.topicRunningHash&&Object.hasOwnProperty.call(e,"topicRunningHash")&&t.uint32(66).bytes(e.topicRunningHash),null!=e.topicRunningHashVersion&&Object.hasOwnProperty.call(e,"topicRunningHashVersion")&&t.uint32(72).uint64(e.topicRunningHashVersion),null!=e.tokenID&&Object.hasOwnProperty.call(e,"tokenID")&&i.proto.TokenID.encode(e.tokenID,t.uint32(82).fork()).ldelim(),null!=e.newTotalSupply&&Object.hasOwnProperty.call(e,"newTotalSupply")&&t.uint32(88).uint64(e.newTotalSupply),null!=e.scheduleID&&Object.hasOwnProperty.call(e,"scheduleID")&&i.proto.ScheduleID.encode(e.scheduleID,t.uint32(98).fork()).ldelim(),null!=e.scheduledTransactionID&&Object.hasOwnProperty.call(e,"scheduledTransactionID")&&i.proto.TransactionID.encode(e.scheduledTransactionID,t.uint32(106).fork()).ldelim(),null!=e.serialNumbers&&e.serialNumbers.length){t.uint32(114).fork();for(var n=0;n<e.serialNumbers.length;++n)t.int64(e.serialNumbers[n]);t.ldelim()}return null!=e.nodeId&&Object.hasOwnProperty.call(e,"nodeId")&&t.uint32(120).uint64(e.nodeId),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionReceipt;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.status=e.int32();break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 4:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;case 5:r.exchangeRate=i.proto.ExchangeRateSet.decode(e,e.uint32());break;case 6:r.topicID=i.proto.TopicID.decode(e,e.uint32());break;case 7:r.topicSequenceNumber=e.uint64();break;case 8:r.topicRunningHash=e.bytes();break;case 9:r.topicRunningHashVersion=e.uint64();break;case 10:r.tokenID=i.proto.TokenID.decode(e,e.uint32());break;case 11:r.newTotalSupply=e.uint64();break;case 12:r.scheduleID=i.proto.ScheduleID.decode(e,e.uint32());break;case 13:r.scheduledTransactionID=i.proto.TransactionID.decode(e,e.uint32());break;case 14:if(r.serialNumbers&&r.serialNumbers.length||(r.serialNumbers=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)r.serialNumbers.push(e.int64());else r.serialNumbers.push(e.int64());break;case 15:r.nodeId=e.uint64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionReceipt"},e}(),t.ExchangeRate=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.hbarEquiv=0,e.prototype.centEquiv=0,e.prototype.expirationTime=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.hbarEquiv&&Object.hasOwnProperty.call(e,"hbarEquiv")&&t.uint32(8).int32(e.hbarEquiv),null!=e.centEquiv&&Object.hasOwnProperty.call(e,"centEquiv")&&t.uint32(16).int32(e.centEquiv),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.TimestampSeconds.encode(e.expirationTime,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ExchangeRate;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.hbarEquiv=e.int32();break;case 2:r.centEquiv=e.int32();break;case 3:r.expirationTime=i.proto.TimestampSeconds.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ExchangeRate"},e}(),t.ExchangeRateSet=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.currentRate=null,e.prototype.nextRate=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.currentRate&&Object.hasOwnProperty.call(e,"currentRate")&&i.proto.ExchangeRate.encode(e.currentRate,t.uint32(10).fork()).ldelim(),null!=e.nextRate&&Object.hasOwnProperty.call(e,"nextRate")&&i.proto.ExchangeRate.encode(e.nextRate,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ExchangeRateSet;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.currentRate=i.proto.ExchangeRate.decode(e,e.uint32());break;case 2:r.nextRate=i.proto.ExchangeRate.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ExchangeRateSet"},e}(),t.CryptoGetAccountBalanceQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.header=null,e.prototype.accountID=null,e.prototype.contractID=null,Object.defineProperty(e.prototype,"balanceSource",{get:r.oneOfGetter(t=["accountID","contractID"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),null!=e.contractID&&Object.hasOwnProperty.call(e,"contractID")&&i.proto.ContractID.encode(e.contractID,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetAccountBalanceQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.contractID=i.proto.ContractID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetAccountBalanceQuery"},e}(),t.CryptoGetAccountBalanceResponse=function(){function e(e){if(this.tokenBalances=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountID=null,e.prototype.balance=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.tokenBalances=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),null!=e.balance&&Object.hasOwnProperty.call(e,"balance")&&t.uint32(24).uint64(e.balance),null!=e.tokenBalances&&e.tokenBalances.length)for(var n=0;n<e.tokenBalances.length;++n)i.proto.TokenBalance.encode(e.tokenBalances[n],t.uint32(34).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetAccountBalanceResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.balance=e.uint64();break;case 4:r.tokenBalances&&r.tokenBalances.length||(r.tokenBalances=[]),r.tokenBalances.push(i.proto.TokenBalance.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetAccountBalanceResponse"},e}(),t.CryptoGetAccountRecordsQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetAccountRecordsQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetAccountRecordsQuery"},e}(),t.CryptoGetAccountRecordsResponse=function(){function e(e){if(this.records=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountID=null,e.prototype.records=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),null!=e.records&&e.records.length)for(var n=0;n<e.records.length;++n)i.proto.TransactionRecord.encode(e.records[n],t.uint32(26).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetAccountRecordsResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.records&&r.records.length||(r.records=[]),r.records.push(i.proto.TransactionRecord.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetAccountRecordsResponse"},e}(),t.CryptoGetInfoQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetInfoQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetInfoQuery"},e}(),t.CryptoGetInfoResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountInfo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountInfo&&Object.hasOwnProperty.call(e,"accountInfo")&&i.proto.CryptoGetInfoResponse.AccountInfo.encode(e.accountInfo,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetInfoResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.accountInfo=i.proto.CryptoGetInfoResponse.AccountInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetInfoResponse"},e.AccountInfo=function(){function e(e){if(this.liveHashes=[],this.tokenRelationships=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountID=null,e.prototype.contractAccountID="",e.prototype.deleted=!1,e.prototype.proxyAccountID=null,e.prototype.proxyReceived=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.key=null,e.prototype.balance=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.generateSendRecordThreshold=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.generateReceiveRecordThreshold=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.receiverSigRequired=!1,e.prototype.expirationTime=null,e.prototype.autoRenewPeriod=null,e.prototype.liveHashes=r.emptyArray,e.prototype.tokenRelationships=r.emptyArray,e.prototype.memo="",e.prototype.ownedNfts=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.maxAutomaticTokenAssociations=0,e.prototype.alias=r.newBuffer([]),e.prototype.ledgerId=r.newBuffer([]),e.prototype.ethereumNonce=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.stakingInfo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(10).fork()).ldelim(),null!=e.contractAccountID&&Object.hasOwnProperty.call(e,"contractAccountID")&&t.uint32(18).string(e.contractAccountID),null!=e.deleted&&Object.hasOwnProperty.call(e,"deleted")&&t.uint32(24).bool(e.deleted),null!=e.proxyAccountID&&Object.hasOwnProperty.call(e,"proxyAccountID")&&i.proto.AccountID.encode(e.proxyAccountID,t.uint32(34).fork()).ldelim(),null!=e.proxyReceived&&Object.hasOwnProperty.call(e,"proxyReceived")&&t.uint32(48).int64(e.proxyReceived),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&i.proto.Key.encode(e.key,t.uint32(58).fork()).ldelim(),null!=e.balance&&Object.hasOwnProperty.call(e,"balance")&&t.uint32(64).uint64(e.balance),null!=e.generateSendRecordThreshold&&Object.hasOwnProperty.call(e,"generateSendRecordThreshold")&&t.uint32(72).uint64(e.generateSendRecordThreshold),null!=e.generateReceiveRecordThreshold&&Object.hasOwnProperty.call(e,"generateReceiveRecordThreshold")&&t.uint32(80).uint64(e.generateReceiveRecordThreshold),null!=e.receiverSigRequired&&Object.hasOwnProperty.call(e,"receiverSigRequired")&&t.uint32(88).bool(e.receiverSigRequired),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(98).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(106).fork()).ldelim(),null!=e.liveHashes&&e.liveHashes.length)for(var n=0;n<e.liveHashes.length;++n)i.proto.LiveHash.encode(e.liveHashes[n],t.uint32(114).fork()).ldelim();if(null!=e.tokenRelationships&&e.tokenRelationships.length)for(n=0;n<e.tokenRelationships.length;++n)i.proto.TokenRelationship.encode(e.tokenRelationships[n],t.uint32(122).fork()).ldelim();return null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(130).string(e.memo),null!=e.ownedNfts&&Object.hasOwnProperty.call(e,"ownedNfts")&&t.uint32(136).int64(e.ownedNfts),null!=e.maxAutomaticTokenAssociations&&Object.hasOwnProperty.call(e,"maxAutomaticTokenAssociations")&&t.uint32(144).int32(e.maxAutomaticTokenAssociations),null!=e.alias&&Object.hasOwnProperty.call(e,"alias")&&t.uint32(154).bytes(e.alias),null!=e.ledgerId&&Object.hasOwnProperty.call(e,"ledgerId")&&t.uint32(162).bytes(e.ledgerId),null!=e.ethereumNonce&&Object.hasOwnProperty.call(e,"ethereumNonce")&&t.uint32(168).int64(e.ethereumNonce),null!=e.stakingInfo&&Object.hasOwnProperty.call(e,"stakingInfo")&&i.proto.StakingInfo.encode(e.stakingInfo,t.uint32(178).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetInfoResponse.AccountInfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.contractAccountID=e.string();break;case 3:r.deleted=e.bool();break;case 4:r.proxyAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 6:r.proxyReceived=e.int64();break;case 7:r.key=i.proto.Key.decode(e,e.uint32());break;case 8:r.balance=e.uint64();break;case 9:r.generateSendRecordThreshold=e.uint64();break;case 10:r.generateReceiveRecordThreshold=e.uint64();break;case 11:r.receiverSigRequired=e.bool();break;case 12:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 13:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 14:r.liveHashes&&r.liveHashes.length||(r.liveHashes=[]),r.liveHashes.push(i.proto.LiveHash.decode(e,e.uint32()));break;case 15:r.tokenRelationships&&r.tokenRelationships.length||(r.tokenRelationships=[]),r.tokenRelationships.push(i.proto.TokenRelationship.decode(e,e.uint32()));break;case 16:r.memo=e.string();break;case 17:r.ownedNfts=e.int64();break;case 18:r.maxAutomaticTokenAssociations=e.int32();break;case 19:r.alias=e.bytes();break;case 20:r.ledgerId=e.bytes();break;case 21:r.ethereumNonce=e.int64();break;case 22:r.stakingInfo=i.proto.StakingInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetInfoResponse.AccountInfo"},e}(),e}(),t.CryptoGetLiveHashQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountID=null,e.prototype.hash=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),null!=e.hash&&Object.hasOwnProperty.call(e,"hash")&&t.uint32(26).bytes(e.hash),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetLiveHashQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.hash=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetLiveHashQuery"},e}(),t.CryptoGetLiveHashResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.liveHash=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.liveHash&&Object.hasOwnProperty.call(e,"liveHash")&&i.proto.LiveHash.encode(e.liveHash,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetLiveHashResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.liveHash=i.proto.LiveHash.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetLiveHashResponse"},e}(),t.CryptoGetStakersQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetStakersQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetStakersQuery"},e}(),t.ProxyStaker=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountID=null,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(10).fork()).ldelim(),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(16).int64(e.amount),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ProxyStaker;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.amount=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ProxyStaker"},e}(),t.AllProxyStakers=function(){function e(e){if(this.proxyStaker=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountID=null,e.prototype.proxyStaker=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(10).fork()).ldelim(),null!=e.proxyStaker&&e.proxyStaker.length)for(var n=0;n<e.proxyStaker.length;++n)i.proto.ProxyStaker.encode(e.proxyStaker[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.AllProxyStakers;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.proxyStaker&&r.proxyStaker.length||(r.proxyStaker=[]),r.proxyStaker.push(i.proto.ProxyStaker.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.AllProxyStakers"},e}(),t.CryptoGetStakersResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.stakers=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.stakers&&Object.hasOwnProperty.call(e,"stakers")&&i.proto.AllProxyStakers.encode(e.stakers,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.CryptoGetStakersResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 3:r.stakers=i.proto.AllProxyStakers.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.CryptoGetStakersResponse"},e}(),t.FileGetContentsQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.fileID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileGetContentsQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.fileID=i.proto.FileID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileGetContentsQuery"},e}(),t.FileGetContentsResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.fileContents=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.fileContents&&Object.hasOwnProperty.call(e,"fileContents")&&i.proto.FileGetContentsResponse.FileContents.encode(e.fileContents,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileGetContentsResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.fileContents=i.proto.FileGetContentsResponse.FileContents.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileGetContentsResponse"},e.FileContents=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.fileID=null,e.prototype.contents=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(10).fork()).ldelim(),null!=e.contents&&Object.hasOwnProperty.call(e,"contents")&&t.uint32(18).bytes(e.contents),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileGetContentsResponse.FileContents;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 2:r.contents=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileGetContentsResponse.FileContents"},e}(),e}(),t.FileGetInfoQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.fileID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileGetInfoQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.fileID=i.proto.FileID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileGetInfoQuery"},e}(),t.FileGetInfoResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.fileInfo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.fileInfo&&Object.hasOwnProperty.call(e,"fileInfo")&&i.proto.FileGetInfoResponse.FileInfo.encode(e.fileInfo,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileGetInfoResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.fileInfo=i.proto.FileGetInfoResponse.FileInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileGetInfoResponse"},e.FileInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.fileID=null,e.prototype.size=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.expirationTime=null,e.prototype.deleted=!1,e.prototype.keys=null,e.prototype.memo="",e.prototype.ledgerId=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fileID&&Object.hasOwnProperty.call(e,"fileID")&&i.proto.FileID.encode(e.fileID,t.uint32(10).fork()).ldelim(),null!=e.size&&Object.hasOwnProperty.call(e,"size")&&t.uint32(16).int64(e.size),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(26).fork()).ldelim(),null!=e.deleted&&Object.hasOwnProperty.call(e,"deleted")&&t.uint32(32).bool(e.deleted),null!=e.keys&&Object.hasOwnProperty.call(e,"keys")&&i.proto.KeyList.encode(e.keys,t.uint32(42).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(50).string(e.memo),null!=e.ledgerId&&Object.hasOwnProperty.call(e,"ledgerId")&&t.uint32(58).bytes(e.ledgerId),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.FileGetInfoResponse.FileInfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fileID=i.proto.FileID.decode(e,e.uint32());break;case 2:r.size=e.int64();break;case 3:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 4:r.deleted=e.bool();break;case 5:r.keys=i.proto.KeyList.decode(e,e.uint32());break;case 6:r.memo=e.string();break;case 7:r.ledgerId=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.FileGetInfoResponse.FileInfo"},e}(),e}(),t.TransactionGetReceiptQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.transactionID=null,e.prototype.includeDuplicates=!1,e.prototype.includeChildReceipts=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.transactionID&&Object.hasOwnProperty.call(e,"transactionID")&&i.proto.TransactionID.encode(e.transactionID,t.uint32(18).fork()).ldelim(),null!=e.includeDuplicates&&Object.hasOwnProperty.call(e,"includeDuplicates")&&t.uint32(24).bool(e.includeDuplicates),null!=e.includeChildReceipts&&Object.hasOwnProperty.call(e,"includeChildReceipts")&&t.uint32(32).bool(e.includeChildReceipts),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionGetReceiptQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.transactionID=i.proto.TransactionID.decode(e,e.uint32());break;case 3:r.includeDuplicates=e.bool();break;case 4:r.includeChildReceipts=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionGetReceiptQuery"},e}(),t.TransactionGetReceiptResponse=function(){function e(e){if(this.duplicateTransactionReceipts=[],this.childTransactionReceipts=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.receipt=null,e.prototype.duplicateTransactionReceipts=r.emptyArray,e.prototype.childTransactionReceipts=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.receipt&&Object.hasOwnProperty.call(e,"receipt")&&i.proto.TransactionReceipt.encode(e.receipt,t.uint32(18).fork()).ldelim(),null!=e.duplicateTransactionReceipts&&e.duplicateTransactionReceipts.length)for(var n=0;n<e.duplicateTransactionReceipts.length;++n)i.proto.TransactionReceipt.encode(e.duplicateTransactionReceipts[n],t.uint32(34).fork()).ldelim();if(null!=e.childTransactionReceipts&&e.childTransactionReceipts.length)for(n=0;n<e.childTransactionReceipts.length;++n)i.proto.TransactionReceipt.encode(e.childTransactionReceipts[n],t.uint32(42).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionGetReceiptResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.receipt=i.proto.TransactionReceipt.decode(e,e.uint32());break;case 4:r.duplicateTransactionReceipts&&r.duplicateTransactionReceipts.length||(r.duplicateTransactionReceipts=[]),r.duplicateTransactionReceipts.push(i.proto.TransactionReceipt.decode(e,e.uint32()));break;case 5:r.childTransactionReceipts&&r.childTransactionReceipts.length||(r.childTransactionReceipts=[]),r.childTransactionReceipts.push(i.proto.TransactionReceipt.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionGetReceiptResponse"},e}(),t.TransactionGetRecordQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.transactionID=null,e.prototype.includeDuplicates=!1,e.prototype.includeChildRecords=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.transactionID&&Object.hasOwnProperty.call(e,"transactionID")&&i.proto.TransactionID.encode(e.transactionID,t.uint32(18).fork()).ldelim(),null!=e.includeDuplicates&&Object.hasOwnProperty.call(e,"includeDuplicates")&&t.uint32(24).bool(e.includeDuplicates),null!=e.includeChildRecords&&Object.hasOwnProperty.call(e,"includeChildRecords")&&t.uint32(32).bool(e.includeChildRecords),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionGetRecordQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.transactionID=i.proto.TransactionID.decode(e,e.uint32());break;case 3:r.includeDuplicates=e.bool();break;case 4:r.includeChildRecords=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionGetRecordQuery"},e}(),t.TransactionGetRecordResponse=function(){function e(e){if(this.duplicateTransactionRecords=[],this.childTransactionRecords=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.transactionRecord=null,e.prototype.duplicateTransactionRecords=r.emptyArray,e.prototype.childTransactionRecords=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.transactionRecord&&Object.hasOwnProperty.call(e,"transactionRecord")&&i.proto.TransactionRecord.encode(e.transactionRecord,t.uint32(26).fork()).ldelim(),null!=e.duplicateTransactionRecords&&e.duplicateTransactionRecords.length)for(var n=0;n<e.duplicateTransactionRecords.length;++n)i.proto.TransactionRecord.encode(e.duplicateTransactionRecords[n],t.uint32(34).fork()).ldelim();if(null!=e.childTransactionRecords&&e.childTransactionRecords.length)for(n=0;n<e.childTransactionRecords.length;++n)i.proto.TransactionRecord.encode(e.childTransactionRecords[n],t.uint32(42).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionGetRecordResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 3:r.transactionRecord=i.proto.TransactionRecord.decode(e,e.uint32());break;case 4:r.duplicateTransactionRecords&&r.duplicateTransactionRecords.length||(r.duplicateTransactionRecords=[]),r.duplicateTransactionRecords.push(i.proto.TransactionRecord.decode(e,e.uint32()));break;case 5:r.childTransactionRecords&&r.childTransactionRecords.length||(r.childTransactionRecords=[]),r.childTransactionRecords.push(i.proto.TransactionRecord.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionGetRecordResponse"},e}(),t.TransactionGetFastRecordQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.transactionID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.transactionID&&Object.hasOwnProperty.call(e,"transactionID")&&i.proto.TransactionID.encode(e.transactionID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionGetFastRecordQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.transactionID=i.proto.TransactionID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionGetFastRecordQuery"},e}(),t.TransactionGetFastRecordResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.transactionRecord=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.transactionRecord&&Object.hasOwnProperty.call(e,"transactionRecord")&&i.proto.TransactionRecord.encode(e.transactionRecord,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionGetFastRecordResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.transactionRecord=i.proto.TransactionRecord.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionGetFastRecordResponse"},e}(),t.NetworkGetVersionInfoQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NetworkGetVersionInfoQuery;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.header=i.proto.QueryHeader.decode(e,e.uint32());else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NetworkGetVersionInfoQuery"},e}(),t.NetworkGetVersionInfoResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.hapiProtoVersion=null,e.prototype.hederaServicesVersion=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.hapiProtoVersion&&Object.hasOwnProperty.call(e,"hapiProtoVersion")&&i.proto.SemanticVersion.encode(e.hapiProtoVersion,t.uint32(18).fork()).ldelim(),null!=e.hederaServicesVersion&&Object.hasOwnProperty.call(e,"hederaServicesVersion")&&i.proto.SemanticVersion.encode(e.hederaServicesVersion,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NetworkGetVersionInfoResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.hapiProtoVersion=i.proto.SemanticVersion.decode(e,e.uint32());break;case 3:r.hederaServicesVersion=i.proto.SemanticVersion.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NetworkGetVersionInfoResponse"},e}(),t.NetworkGetExecutionTimeQuery=function(){function e(e){if(this.transactionIds=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.transactionIds=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.transactionIds&&e.transactionIds.length)for(var n=0;n<e.transactionIds.length;++n)i.proto.TransactionID.encode(e.transactionIds[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NetworkGetExecutionTimeQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.transactionIds&&r.transactionIds.length||(r.transactionIds=[]),r.transactionIds.push(i.proto.TransactionID.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NetworkGetExecutionTimeQuery"},e}(),t.NetworkGetExecutionTimeResponse=function(){function e(e){if(this.executionTimes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.executionTimes=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.executionTimes&&e.executionTimes.length){t.uint32(18).fork();for(var n=0;n<e.executionTimes.length;++n)t.uint64(e.executionTimes[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.NetworkGetExecutionTimeResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:if(r.executionTimes&&r.executionTimes.length||(r.executionTimes=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)r.executionTimes.push(e.uint64());else r.executionTimes.push(e.uint64());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.NetworkGetExecutionTimeResponse"},e}(),t.TokenGetInfoQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.token=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&i.proto.TokenID.encode(e.token,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenGetInfoQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.token=i.proto.TokenID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenGetInfoQuery"},e}(),t.TokenInfo=function(){function e(e){if(this.customFees=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.name="",e.prototype.symbol="",e.prototype.decimals=0,e.prototype.totalSupply=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.treasury=null,e.prototype.adminKey=null,e.prototype.kycKey=null,e.prototype.freezeKey=null,e.prototype.wipeKey=null,e.prototype.supplyKey=null,e.prototype.defaultFreezeStatus=0,e.prototype.defaultKycStatus=0,e.prototype.deleted=!1,e.prototype.autoRenewAccount=null,e.prototype.autoRenewPeriod=null,e.prototype.expiry=null,e.prototype.memo="",e.prototype.tokenType=0,e.prototype.supplyType=0,e.prototype.maxSupply=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.feeScheduleKey=null,e.prototype.customFees=r.emptyArray,e.prototype.pauseKey=null,e.prototype.pauseStatus=0,e.prototype.ledgerId=r.newBuffer([]),e.prototype.metadata=r.newBuffer([]),e.prototype.metadataKey=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.symbol&&Object.hasOwnProperty.call(e,"symbol")&&t.uint32(26).string(e.symbol),null!=e.decimals&&Object.hasOwnProperty.call(e,"decimals")&&t.uint32(32).uint32(e.decimals),null!=e.totalSupply&&Object.hasOwnProperty.call(e,"totalSupply")&&t.uint32(40).uint64(e.totalSupply),null!=e.treasury&&Object.hasOwnProperty.call(e,"treasury")&&i.proto.AccountID.encode(e.treasury,t.uint32(50).fork()).ldelim(),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(58).fork()).ldelim(),null!=e.kycKey&&Object.hasOwnProperty.call(e,"kycKey")&&i.proto.Key.encode(e.kycKey,t.uint32(66).fork()).ldelim(),null!=e.freezeKey&&Object.hasOwnProperty.call(e,"freezeKey")&&i.proto.Key.encode(e.freezeKey,t.uint32(74).fork()).ldelim(),null!=e.wipeKey&&Object.hasOwnProperty.call(e,"wipeKey")&&i.proto.Key.encode(e.wipeKey,t.uint32(82).fork()).ldelim(),null!=e.supplyKey&&Object.hasOwnProperty.call(e,"supplyKey")&&i.proto.Key.encode(e.supplyKey,t.uint32(90).fork()).ldelim(),null!=e.defaultFreezeStatus&&Object.hasOwnProperty.call(e,"defaultFreezeStatus")&&t.uint32(96).int32(e.defaultFreezeStatus),null!=e.defaultKycStatus&&Object.hasOwnProperty.call(e,"defaultKycStatus")&&t.uint32(104).int32(e.defaultKycStatus),null!=e.deleted&&Object.hasOwnProperty.call(e,"deleted")&&t.uint32(112).bool(e.deleted),null!=e.autoRenewAccount&&Object.hasOwnProperty.call(e,"autoRenewAccount")&&i.proto.AccountID.encode(e.autoRenewAccount,t.uint32(122).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(130).fork()).ldelim(),null!=e.expiry&&Object.hasOwnProperty.call(e,"expiry")&&i.proto.Timestamp.encode(e.expiry,t.uint32(138).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(146).string(e.memo),null!=e.tokenType&&Object.hasOwnProperty.call(e,"tokenType")&&t.uint32(152).int32(e.tokenType),null!=e.supplyType&&Object.hasOwnProperty.call(e,"supplyType")&&t.uint32(160).int32(e.supplyType),null!=e.maxSupply&&Object.hasOwnProperty.call(e,"maxSupply")&&t.uint32(168).int64(e.maxSupply),null!=e.feeScheduleKey&&Object.hasOwnProperty.call(e,"feeScheduleKey")&&i.proto.Key.encode(e.feeScheduleKey,t.uint32(178).fork()).ldelim(),null!=e.customFees&&e.customFees.length)for(var n=0;n<e.customFees.length;++n)i.proto.CustomFee.encode(e.customFees[n],t.uint32(186).fork()).ldelim();return null!=e.pauseKey&&Object.hasOwnProperty.call(e,"pauseKey")&&i.proto.Key.encode(e.pauseKey,t.uint32(194).fork()).ldelim(),null!=e.pauseStatus&&Object.hasOwnProperty.call(e,"pauseStatus")&&t.uint32(200).int32(e.pauseStatus),null!=e.ledgerId&&Object.hasOwnProperty.call(e,"ledgerId")&&t.uint32(210).bytes(e.ledgerId),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&t.uint32(218).bytes(e.metadata),null!=e.metadataKey&&Object.hasOwnProperty.call(e,"metadataKey")&&i.proto.Key.encode(e.metadataKey,t.uint32(226).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenInfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.name=e.string();break;case 3:r.symbol=e.string();break;case 4:r.decimals=e.uint32();break;case 5:r.totalSupply=e.uint64();break;case 6:r.treasury=i.proto.AccountID.decode(e,e.uint32());break;case 7:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 8:r.kycKey=i.proto.Key.decode(e,e.uint32());break;case 9:r.freezeKey=i.proto.Key.decode(e,e.uint32());break;case 10:r.wipeKey=i.proto.Key.decode(e,e.uint32());break;case 11:r.supplyKey=i.proto.Key.decode(e,e.uint32());break;case 12:r.defaultFreezeStatus=e.int32();break;case 13:r.defaultKycStatus=e.int32();break;case 14:r.deleted=e.bool();break;case 15:r.autoRenewAccount=i.proto.AccountID.decode(e,e.uint32());break;case 16:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 17:r.expiry=i.proto.Timestamp.decode(e,e.uint32());break;case 18:r.memo=e.string();break;case 19:r.tokenType=e.int32();break;case 20:r.supplyType=e.int32();break;case 21:r.maxSupply=e.int64();break;case 22:r.feeScheduleKey=i.proto.Key.decode(e,e.uint32());break;case 23:r.customFees&&r.customFees.length||(r.customFees=[]),r.customFees.push(i.proto.CustomFee.decode(e,e.uint32()));break;case 24:r.pauseKey=i.proto.Key.decode(e,e.uint32());break;case 25:r.pauseStatus=e.int32();break;case 26:r.ledgerId=e.bytes();break;case 27:r.metadata=e.bytes();break;case 28:r.metadataKey=i.proto.Key.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenInfo"},e}(),t.TokenGetInfoResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.tokenInfo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.tokenInfo&&Object.hasOwnProperty.call(e,"tokenInfo")&&i.proto.TokenInfo.encode(e.tokenInfo,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenGetInfoResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.tokenInfo=i.proto.TokenInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenGetInfoResponse"},e}(),t.ScheduleGetInfoQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.scheduleID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.scheduleID&&Object.hasOwnProperty.call(e,"scheduleID")&&i.proto.ScheduleID.encode(e.scheduleID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ScheduleGetInfoQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.scheduleID=i.proto.ScheduleID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ScheduleGetInfoQuery"},e}(),t.ScheduleInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.scheduleID=null,e.prototype.deletionTime=null,e.prototype.executionTime=null,e.prototype.expirationTime=null,e.prototype.scheduledTransactionBody=null,e.prototype.memo="",e.prototype.adminKey=null,e.prototype.signers=null,e.prototype.creatorAccountID=null,e.prototype.payerAccountID=null,e.prototype.scheduledTransactionID=null,e.prototype.ledgerId=r.newBuffer([]),e.prototype.waitForExpiry=!1,Object.defineProperty(e.prototype,"data",{get:r.oneOfGetter(t=["deletionTime","executionTime"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.scheduleID&&Object.hasOwnProperty.call(e,"scheduleID")&&i.proto.ScheduleID.encode(e.scheduleID,t.uint32(10).fork()).ldelim(),null!=e.deletionTime&&Object.hasOwnProperty.call(e,"deletionTime")&&i.proto.Timestamp.encode(e.deletionTime,t.uint32(18).fork()).ldelim(),null!=e.executionTime&&Object.hasOwnProperty.call(e,"executionTime")&&i.proto.Timestamp.encode(e.executionTime,t.uint32(26).fork()).ldelim(),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(34).fork()).ldelim(),null!=e.scheduledTransactionBody&&Object.hasOwnProperty.call(e,"scheduledTransactionBody")&&i.proto.SchedulableTransactionBody.encode(e.scheduledTransactionBody,t.uint32(42).fork()).ldelim(),null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(50).string(e.memo),null!=e.adminKey&&Object.hasOwnProperty.call(e,"adminKey")&&i.proto.Key.encode(e.adminKey,t.uint32(58).fork()).ldelim(),null!=e.signers&&Object.hasOwnProperty.call(e,"signers")&&i.proto.KeyList.encode(e.signers,t.uint32(66).fork()).ldelim(),null!=e.creatorAccountID&&Object.hasOwnProperty.call(e,"creatorAccountID")&&i.proto.AccountID.encode(e.creatorAccountID,t.uint32(74).fork()).ldelim(),null!=e.payerAccountID&&Object.hasOwnProperty.call(e,"payerAccountID")&&i.proto.AccountID.encode(e.payerAccountID,t.uint32(82).fork()).ldelim(),null!=e.scheduledTransactionID&&Object.hasOwnProperty.call(e,"scheduledTransactionID")&&i.proto.TransactionID.encode(e.scheduledTransactionID,t.uint32(90).fork()).ldelim(),null!=e.ledgerId&&Object.hasOwnProperty.call(e,"ledgerId")&&t.uint32(98).bytes(e.ledgerId),null!=e.waitForExpiry&&Object.hasOwnProperty.call(e,"waitForExpiry")&&t.uint32(104).bool(e.waitForExpiry),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ScheduleInfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.scheduleID=i.proto.ScheduleID.decode(e,e.uint32());break;case 2:r.deletionTime=i.proto.Timestamp.decode(e,e.uint32());break;case 3:r.executionTime=i.proto.Timestamp.decode(e,e.uint32());break;case 4:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 5:r.scheduledTransactionBody=i.proto.SchedulableTransactionBody.decode(e,e.uint32());break;case 6:r.memo=e.string();break;case 7:r.adminKey=i.proto.Key.decode(e,e.uint32());break;case 8:r.signers=i.proto.KeyList.decode(e,e.uint32());break;case 9:r.creatorAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 10:r.payerAccountID=i.proto.AccountID.decode(e,e.uint32());break;case 11:r.scheduledTransactionID=i.proto.TransactionID.decode(e,e.uint32());break;case 12:r.ledgerId=e.bytes();break;case 13:r.waitForExpiry=e.bool();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ScheduleInfo"},e}(),t.ScheduleGetInfoResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.scheduleInfo=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.scheduleInfo&&Object.hasOwnProperty.call(e,"scheduleInfo")&&i.proto.ScheduleInfo.encode(e.scheduleInfo,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ScheduleGetInfoResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.scheduleInfo=i.proto.ScheduleInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ScheduleGetInfoResponse"},e}(),t.TokenGetAccountNftInfosQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountID=null,e.prototype.start=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.end=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&t.uint32(24).int64(e.start),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&t.uint32(32).int64(e.end),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenGetAccountNftInfosQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.start=e.int64();break;case 4:r.end=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenGetAccountNftInfosQuery"},e}(),t.TokenGetAccountNftInfosResponse=function(){function e(e){if(this.nfts=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.nfts=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.nfts&&e.nfts.length)for(var n=0;n<e.nfts.length;++n)i.proto.TokenNftInfo.encode(e.nfts[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenGetAccountNftInfosResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.nfts&&r.nfts.length||(r.nfts=[]),r.nfts.push(i.proto.TokenNftInfo.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenGetAccountNftInfosResponse"},e}(),t.TokenGetNftInfoQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.nftID=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.nftID&&Object.hasOwnProperty.call(e,"nftID")&&i.proto.NftID.encode(e.nftID,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenGetNftInfoQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.nftID=i.proto.NftID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenGetNftInfoQuery"},e}(),t.TokenNftInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.nftID=null,e.prototype.accountID=null,e.prototype.creationTime=null,e.prototype.metadata=r.newBuffer([]),e.prototype.ledgerId=r.newBuffer([]),e.prototype.spenderId=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.nftID&&Object.hasOwnProperty.call(e,"nftID")&&i.proto.NftID.encode(e.nftID,t.uint32(10).fork()).ldelim(),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(18).fork()).ldelim(),null!=e.creationTime&&Object.hasOwnProperty.call(e,"creationTime")&&i.proto.Timestamp.encode(e.creationTime,t.uint32(26).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&t.uint32(34).bytes(e.metadata),null!=e.ledgerId&&Object.hasOwnProperty.call(e,"ledgerId")&&t.uint32(42).bytes(e.ledgerId),null!=e.spenderId&&Object.hasOwnProperty.call(e,"spenderId")&&i.proto.AccountID.encode(e.spenderId,t.uint32(50).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenNftInfo;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.nftID=i.proto.NftID.decode(e,e.uint32());break;case 2:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.creationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 4:r.metadata=e.bytes();break;case 5:r.ledgerId=e.bytes();break;case 6:r.spenderId=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenNftInfo"},e}(),t.TokenGetNftInfoResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.nft=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.nft&&Object.hasOwnProperty.call(e,"nft")&&i.proto.TokenNftInfo.encode(e.nft,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenGetNftInfoResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.nft=i.proto.TokenNftInfo.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenGetNftInfoResponse"},e}(),t.TokenGetNftInfosQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.tokenID=null,e.prototype.start=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.end=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.tokenID&&Object.hasOwnProperty.call(e,"tokenID")&&i.proto.TokenID.encode(e.tokenID,t.uint32(18).fork()).ldelim(),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&t.uint32(24).int64(e.start),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&t.uint32(32).int64(e.end),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenGetNftInfosQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.tokenID=i.proto.TokenID.decode(e,e.uint32());break;case 3:r.start=e.int64();break;case 4:r.end=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenGetNftInfosQuery"},e}(),t.TokenGetNftInfosResponse=function(){function e(e){if(this.nfts=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.tokenID=null,e.prototype.nfts=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.tokenID&&Object.hasOwnProperty.call(e,"tokenID")&&i.proto.TokenID.encode(e.tokenID,t.uint32(18).fork()).ldelim(),null!=e.nfts&&e.nfts.length)for(var n=0;n<e.nfts.length;++n)i.proto.TokenNftInfo.encode(e.nfts[n],t.uint32(26).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenGetNftInfosResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.tokenID=i.proto.TokenID.decode(e,e.uint32());break;case 3:r.nfts&&r.nfts.length||(r.nfts=[]),r.nfts.push(i.proto.TokenNftInfo.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenGetNftInfosResponse"},e}(),t.GetAccountDetailsQuery=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountId=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.QueryHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountId&&Object.hasOwnProperty.call(e,"accountId")&&i.proto.AccountID.encode(e.accountId,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.GetAccountDetailsQuery;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.QueryHeader.decode(e,e.uint32());break;case 2:r.accountId=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.GetAccountDetailsQuery"},e}(),t.GetAccountDetailsResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.header=null,e.prototype.accountDetails=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&i.proto.ResponseHeader.encode(e.header,t.uint32(10).fork()).ldelim(),null!=e.accountDetails&&Object.hasOwnProperty.call(e,"accountDetails")&&i.proto.GetAccountDetailsResponse.AccountDetails.encode(e.accountDetails,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.GetAccountDetailsResponse;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.header=i.proto.ResponseHeader.decode(e,e.uint32());break;case 2:r.accountDetails=i.proto.GetAccountDetailsResponse.AccountDetails.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.GetAccountDetailsResponse"},e.AccountDetails=function(){function e(e){if(this.tokenRelationships=[],this.grantedCryptoAllowances=[],this.grantedNftAllowances=[],this.grantedTokenAllowances=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountId=null,e.prototype.contractAccountId="",e.prototype.deleted=!1,e.prototype.proxyAccountId=null,e.prototype.proxyReceived=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.key=null,e.prototype.balance=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.receiverSigRequired=!1,e.prototype.expirationTime=null,e.prototype.autoRenewPeriod=null,e.prototype.tokenRelationships=r.emptyArray,e.prototype.memo="",e.prototype.ownedNfts=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.maxAutomaticTokenAssociations=0,e.prototype.alias=r.newBuffer([]),e.prototype.ledgerId=r.newBuffer([]),e.prototype.grantedCryptoAllowances=r.emptyArray,e.prototype.grantedNftAllowances=r.emptyArray,e.prototype.grantedTokenAllowances=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.accountId&&Object.hasOwnProperty.call(e,"accountId")&&i.proto.AccountID.encode(e.accountId,t.uint32(10).fork()).ldelim(),null!=e.contractAccountId&&Object.hasOwnProperty.call(e,"contractAccountId")&&t.uint32(18).string(e.contractAccountId),null!=e.deleted&&Object.hasOwnProperty.call(e,"deleted")&&t.uint32(24).bool(e.deleted),null!=e.proxyAccountId&&Object.hasOwnProperty.call(e,"proxyAccountId")&&i.proto.AccountID.encode(e.proxyAccountId,t.uint32(34).fork()).ldelim(),null!=e.proxyReceived&&Object.hasOwnProperty.call(e,"proxyReceived")&&t.uint32(40).int64(e.proxyReceived),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&i.proto.Key.encode(e.key,t.uint32(50).fork()).ldelim(),null!=e.balance&&Object.hasOwnProperty.call(e,"balance")&&t.uint32(56).uint64(e.balance),null!=e.receiverSigRequired&&Object.hasOwnProperty.call(e,"receiverSigRequired")&&t.uint32(64).bool(e.receiverSigRequired),null!=e.expirationTime&&Object.hasOwnProperty.call(e,"expirationTime")&&i.proto.Timestamp.encode(e.expirationTime,t.uint32(74).fork()).ldelim(),null!=e.autoRenewPeriod&&Object.hasOwnProperty.call(e,"autoRenewPeriod")&&i.proto.Duration.encode(e.autoRenewPeriod,t.uint32(82).fork()).ldelim(),null!=e.tokenRelationships&&e.tokenRelationships.length)for(var n=0;n<e.tokenRelationships.length;++n)i.proto.TokenRelationship.encode(e.tokenRelationships[n],t.uint32(90).fork()).ldelim();if(null!=e.memo&&Object.hasOwnProperty.call(e,"memo")&&t.uint32(98).string(e.memo),null!=e.ownedNfts&&Object.hasOwnProperty.call(e,"ownedNfts")&&t.uint32(104).int64(e.ownedNfts),null!=e.maxAutomaticTokenAssociations&&Object.hasOwnProperty.call(e,"maxAutomaticTokenAssociations")&&t.uint32(112).int32(e.maxAutomaticTokenAssociations),null!=e.alias&&Object.hasOwnProperty.call(e,"alias")&&t.uint32(122).bytes(e.alias),null!=e.ledgerId&&Object.hasOwnProperty.call(e,"ledgerId")&&t.uint32(130).bytes(e.ledgerId),null!=e.grantedCryptoAllowances&&e.grantedCryptoAllowances.length)for(n=0;n<e.grantedCryptoAllowances.length;++n)i.proto.GrantedCryptoAllowance.encode(e.grantedCryptoAllowances[n],t.uint32(138).fork()).ldelim();if(null!=e.grantedNftAllowances&&e.grantedNftAllowances.length)for(n=0;n<e.grantedNftAllowances.length;++n)i.proto.GrantedNftAllowance.encode(e.grantedNftAllowances[n],t.uint32(146).fork()).ldelim();if(null!=e.grantedTokenAllowances&&e.grantedTokenAllowances.length)for(n=0;n<e.grantedTokenAllowances.length;++n)i.proto.GrantedTokenAllowance.encode(e.grantedTokenAllowances[n],t.uint32(154).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.GetAccountDetailsResponse.AccountDetails;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountId=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.contractAccountId=e.string();break;case 3:r.deleted=e.bool();break;case 4:r.proxyAccountId=i.proto.AccountID.decode(e,e.uint32());break;case 5:r.proxyReceived=e.int64();break;case 6:r.key=i.proto.Key.decode(e,e.uint32());break;case 7:r.balance=e.uint64();break;case 8:r.receiverSigRequired=e.bool();break;case 9:r.expirationTime=i.proto.Timestamp.decode(e,e.uint32());break;case 10:r.autoRenewPeriod=i.proto.Duration.decode(e,e.uint32());break;case 11:r.tokenRelationships&&r.tokenRelationships.length||(r.tokenRelationships=[]),r.tokenRelationships.push(i.proto.TokenRelationship.decode(e,e.uint32()));break;case 12:r.memo=e.string();break;case 13:r.ownedNfts=e.int64();break;case 14:r.maxAutomaticTokenAssociations=e.int32();break;case 15:r.alias=e.bytes();break;case 16:r.ledgerId=e.bytes();break;case 17:r.grantedCryptoAllowances&&r.grantedCryptoAllowances.length||(r.grantedCryptoAllowances=[]),r.grantedCryptoAllowances.push(i.proto.GrantedCryptoAllowance.decode(e,e.uint32()));break;case 18:r.grantedNftAllowances&&r.grantedNftAllowances.length||(r.grantedNftAllowances=[]),r.grantedNftAllowances.push(i.proto.GrantedNftAllowance.decode(e,e.uint32()));break;case 19:r.grantedTokenAllowances&&r.grantedTokenAllowances.length||(r.grantedTokenAllowances=[]),r.grantedTokenAllowances.push(i.proto.GrantedTokenAllowance.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.GetAccountDetailsResponse.AccountDetails"},e}(),e}(),t.GrantedCryptoAllowance=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.spender=null,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.spender&&Object.hasOwnProperty.call(e,"spender")&&i.proto.AccountID.encode(e.spender,t.uint32(10).fork()).ldelim(),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(16).int64(e.amount),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.GrantedCryptoAllowance;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.spender=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.amount=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.GrantedCryptoAllowance"},e}(),t.GrantedNftAllowance=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.spender=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.spender&&Object.hasOwnProperty.call(e,"spender")&&i.proto.AccountID.encode(e.spender,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.GrantedNftAllowance;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.spender=i.proto.AccountID.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.GrantedNftAllowance"},e}(),t.GrantedTokenAllowance=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.spender=null,e.prototype.amount=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.spender&&Object.hasOwnProperty.call(e,"spender")&&i.proto.AccountID.encode(e.spender,t.uint32(18).fork()).ldelim(),null!=e.amount&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(24).int64(e.amount),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.GrantedTokenAllowance;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.spender=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.amount=e.int64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.GrantedTokenAllowance"},e}(),t.Response=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.getByKey=null,e.prototype.getBySolidityID=null,e.prototype.contractCallLocal=null,e.prototype.contractGetBytecodeResponse=null,e.prototype.contractGetInfo=null,e.prototype.contractGetRecordsResponse=null,e.prototype.cryptogetAccountBalance=null,e.prototype.cryptoGetAccountRecords=null,e.prototype.cryptoGetInfo=null,e.prototype.cryptoGetLiveHash=null,e.prototype.cryptoGetProxyStakers=null,e.prototype.fileGetContents=null,e.prototype.fileGetInfo=null,e.prototype.transactionGetReceipt=null,e.prototype.transactionGetRecord=null,e.prototype.transactionGetFastRecord=null,e.prototype.consensusGetTopicInfo=null,e.prototype.networkGetVersionInfo=null,e.prototype.tokenGetInfo=null,e.prototype.scheduleGetInfo=null,e.prototype.tokenGetAccountNftInfos=null,e.prototype.tokenGetNftInfo=null,e.prototype.tokenGetNftInfos=null,e.prototype.networkGetExecutionTime=null,e.prototype.accountDetails=null,Object.defineProperty(e.prototype,"response",{get:r.oneOfGetter(t=["getByKey","getBySolidityID","contractCallLocal","contractGetBytecodeResponse","contractGetInfo","contractGetRecordsResponse","cryptogetAccountBalance","cryptoGetAccountRecords","cryptoGetInfo","cryptoGetLiveHash","cryptoGetProxyStakers","fileGetContents","fileGetInfo","transactionGetReceipt","transactionGetRecord","transactionGetFastRecord","consensusGetTopicInfo","networkGetVersionInfo","tokenGetInfo","scheduleGetInfo","tokenGetAccountNftInfos","tokenGetNftInfo","tokenGetNftInfos","networkGetExecutionTime","accountDetails"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.getByKey&&Object.hasOwnProperty.call(e,"getByKey")&&i.proto.GetByKeyResponse.encode(e.getByKey,t.uint32(10).fork()).ldelim(),null!=e.getBySolidityID&&Object.hasOwnProperty.call(e,"getBySolidityID")&&i.proto.GetBySolidityIDResponse.encode(e.getBySolidityID,t.uint32(18).fork()).ldelim(),null!=e.contractCallLocal&&Object.hasOwnProperty.call(e,"contractCallLocal")&&i.proto.ContractCallLocalResponse.encode(e.contractCallLocal,t.uint32(26).fork()).ldelim(),null!=e.contractGetInfo&&Object.hasOwnProperty.call(e,"contractGetInfo")&&i.proto.ContractGetInfoResponse.encode(e.contractGetInfo,t.uint32(34).fork()).ldelim(),null!=e.contractGetBytecodeResponse&&Object.hasOwnProperty.call(e,"contractGetBytecodeResponse")&&i.proto.ContractGetBytecodeResponse.encode(e.contractGetBytecodeResponse,t.uint32(42).fork()).ldelim(),null!=e.contractGetRecordsResponse&&Object.hasOwnProperty.call(e,"contractGetRecordsResponse")&&i.proto.ContractGetRecordsResponse.encode(e.contractGetRecordsResponse,t.uint32(50).fork()).ldelim(),null!=e.cryptogetAccountBalance&&Object.hasOwnProperty.call(e,"cryptogetAccountBalance")&&i.proto.CryptoGetAccountBalanceResponse.encode(e.cryptogetAccountBalance,t.uint32(58).fork()).ldelim(),null!=e.cryptoGetAccountRecords&&Object.hasOwnProperty.call(e,"cryptoGetAccountRecords")&&i.proto.CryptoGetAccountRecordsResponse.encode(e.cryptoGetAccountRecords,t.uint32(66).fork()).ldelim(),null!=e.cryptoGetInfo&&Object.hasOwnProperty.call(e,"cryptoGetInfo")&&i.proto.CryptoGetInfoResponse.encode(e.cryptoGetInfo,t.uint32(74).fork()).ldelim(),null!=e.cryptoGetLiveHash&&Object.hasOwnProperty.call(e,"cryptoGetLiveHash")&&i.proto.CryptoGetLiveHashResponse.encode(e.cryptoGetLiveHash,t.uint32(82).fork()).ldelim(),null!=e.cryptoGetProxyStakers&&Object.hasOwnProperty.call(e,"cryptoGetProxyStakers")&&i.proto.CryptoGetStakersResponse.encode(e.cryptoGetProxyStakers,t.uint32(90).fork()).ldelim(),null!=e.fileGetContents&&Object.hasOwnProperty.call(e,"fileGetContents")&&i.proto.FileGetContentsResponse.encode(e.fileGetContents,t.uint32(98).fork()).ldelim(),null!=e.fileGetInfo&&Object.hasOwnProperty.call(e,"fileGetInfo")&&i.proto.FileGetInfoResponse.encode(e.fileGetInfo,t.uint32(106).fork()).ldelim(),null!=e.transactionGetReceipt&&Object.hasOwnProperty.call(e,"transactionGetReceipt")&&i.proto.TransactionGetReceiptResponse.encode(e.transactionGetReceipt,t.uint32(114).fork()).ldelim(),null!=e.transactionGetRecord&&Object.hasOwnProperty.call(e,"transactionGetRecord")&&i.proto.TransactionGetRecordResponse.encode(e.transactionGetRecord,t.uint32(122).fork()).ldelim(),null!=e.transactionGetFastRecord&&Object.hasOwnProperty.call(e,"transactionGetFastRecord")&&i.proto.TransactionGetFastRecordResponse.encode(e.transactionGetFastRecord,t.uint32(130).fork()).ldelim(),null!=e.consensusGetTopicInfo&&Object.hasOwnProperty.call(e,"consensusGetTopicInfo")&&i.proto.ConsensusGetTopicInfoResponse.encode(e.consensusGetTopicInfo,t.uint32(1202).fork()).ldelim(),null!=e.networkGetVersionInfo&&Object.hasOwnProperty.call(e,"networkGetVersionInfo")&&i.proto.NetworkGetVersionInfoResponse.encode(e.networkGetVersionInfo,t.uint32(1210).fork()).ldelim(),null!=e.tokenGetInfo&&Object.hasOwnProperty.call(e,"tokenGetInfo")&&i.proto.TokenGetInfoResponse.encode(e.tokenGetInfo,t.uint32(1218).fork()).ldelim(),null!=e.scheduleGetInfo&&Object.hasOwnProperty.call(e,"scheduleGetInfo")&&i.proto.ScheduleGetInfoResponse.encode(e.scheduleGetInfo,t.uint32(1226).fork()).ldelim(),null!=e.tokenGetAccountNftInfos&&Object.hasOwnProperty.call(e,"tokenGetAccountNftInfos")&&i.proto.TokenGetAccountNftInfosResponse.encode(e.tokenGetAccountNftInfos,t.uint32(1234).fork()).ldelim(),null!=e.tokenGetNftInfo&&Object.hasOwnProperty.call(e,"tokenGetNftInfo")&&i.proto.TokenGetNftInfoResponse.encode(e.tokenGetNftInfo,t.uint32(1242).fork()).ldelim(),null!=e.tokenGetNftInfos&&Object.hasOwnProperty.call(e,"tokenGetNftInfos")&&i.proto.TokenGetNftInfosResponse.encode(e.tokenGetNftInfos,t.uint32(1250).fork()).ldelim(),null!=e.networkGetExecutionTime&&Object.hasOwnProperty.call(e,"networkGetExecutionTime")&&i.proto.NetworkGetExecutionTimeResponse.encode(e.networkGetExecutionTime,t.uint32(1258).fork()).ldelim(),null!=e.accountDetails&&Object.hasOwnProperty.call(e,"accountDetails")&&i.proto.GetAccountDetailsResponse.encode(e.accountDetails,t.uint32(1266).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.Response;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.getByKey=i.proto.GetByKeyResponse.decode(e,e.uint32());break;case 2:r.getBySolidityID=i.proto.GetBySolidityIDResponse.decode(e,e.uint32());break;case 3:r.contractCallLocal=i.proto.ContractCallLocalResponse.decode(e,e.uint32());break;case 5:r.contractGetBytecodeResponse=i.proto.ContractGetBytecodeResponse.decode(e,e.uint32());break;case 4:r.contractGetInfo=i.proto.ContractGetInfoResponse.decode(e,e.uint32());break;case 6:r.contractGetRecordsResponse=i.proto.ContractGetRecordsResponse.decode(e,e.uint32());break;case 7:r.cryptogetAccountBalance=i.proto.CryptoGetAccountBalanceResponse.decode(e,e.uint32());break;case 8:r.cryptoGetAccountRecords=i.proto.CryptoGetAccountRecordsResponse.decode(e,e.uint32());break;case 9:r.cryptoGetInfo=i.proto.CryptoGetInfoResponse.decode(e,e.uint32());break;case 10:r.cryptoGetLiveHash=i.proto.CryptoGetLiveHashResponse.decode(e,e.uint32());break;case 11:r.cryptoGetProxyStakers=i.proto.CryptoGetStakersResponse.decode(e,e.uint32());break;case 12:r.fileGetContents=i.proto.FileGetContentsResponse.decode(e,e.uint32());break;case 13:r.fileGetInfo=i.proto.FileGetInfoResponse.decode(e,e.uint32());break;case 14:r.transactionGetReceipt=i.proto.TransactionGetReceiptResponse.decode(e,e.uint32());break;case 15:r.transactionGetRecord=i.proto.TransactionGetRecordResponse.decode(e,e.uint32());break;case 16:r.transactionGetFastRecord=i.proto.TransactionGetFastRecordResponse.decode(e,e.uint32());break;case 150:r.consensusGetTopicInfo=i.proto.ConsensusGetTopicInfoResponse.decode(e,e.uint32());break;case 151:r.networkGetVersionInfo=i.proto.NetworkGetVersionInfoResponse.decode(e,e.uint32());break;case 152:r.tokenGetInfo=i.proto.TokenGetInfoResponse.decode(e,e.uint32());break;case 153:r.scheduleGetInfo=i.proto.ScheduleGetInfoResponse.decode(e,e.uint32());break;case 154:r.tokenGetAccountNftInfos=i.proto.TokenGetAccountNftInfosResponse.decode(e,e.uint32());break;case 155:r.tokenGetNftInfo=i.proto.TokenGetNftInfoResponse.decode(e,e.uint32());break;case 156:r.tokenGetNftInfos=i.proto.TokenGetNftInfosResponse.decode(e,e.uint32());break;case 157:r.networkGetExecutionTime=i.proto.NetworkGetExecutionTimeResponse.decode(e,e.uint32());break;case 158:r.accountDetails=i.proto.GetAccountDetailsResponse.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Response"},e}(),t.CryptoService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.createAccount=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"createAccount"}),Object.defineProperty(t.prototype.updateAccount=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"updateAccount"}),Object.defineProperty(t.prototype.cryptoTransfer=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"cryptoTransfer"}),Object.defineProperty(t.prototype.cryptoDelete=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"cryptoDelete"}),Object.defineProperty(t.prototype.approveAllowances=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"approveAllowances"}),Object.defineProperty(t.prototype.deleteAllowances=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"deleteAllowances"}),Object.defineProperty(t.prototype.addLiveHash=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"addLiveHash"}),Object.defineProperty(t.prototype.deleteLiveHash=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"deleteLiveHash"}),Object.defineProperty(t.prototype.getLiveHash=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getLiveHash"}),Object.defineProperty(t.prototype.getAccountRecords=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getAccountRecords"}),Object.defineProperty(t.prototype.cryptoGetBalance=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"cryptoGetBalance"}),Object.defineProperty(t.prototype.getAccountInfo=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getAccountInfo"}),Object.defineProperty(t.prototype.getTransactionReceipts=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getTransactionReceipts"}),Object.defineProperty(t.prototype.getTxRecordByTxID=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getTxRecordByTxID"}),t}(),t.FileService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.createFile=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"createFile"}),Object.defineProperty(t.prototype.updateFile=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"updateFile"}),Object.defineProperty(t.prototype.deleteFile=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"deleteFile"}),Object.defineProperty(t.prototype.appendContent=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"appendContent"}),Object.defineProperty(t.prototype.getFileContent=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getFileContent"}),Object.defineProperty(t.prototype.getFileInfo=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getFileInfo"}),Object.defineProperty(t.prototype.systemDelete=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"systemDelete"}),Object.defineProperty(t.prototype.systemUndelete=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"systemUndelete"}),t}(),t.FreezeService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.freeze=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"freeze"}),t}(),t.NetworkService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.getVersionInfo=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getVersionInfo"}),Object.defineProperty(t.prototype.getAccountDetails=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getAccountDetails"}),Object.defineProperty(t.prototype.getExecutionTime=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getExecutionTime"}),Object.defineProperty(t.prototype.uncheckedSubmit=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"uncheckedSubmit"}),t}(),t.ScheduleService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.createSchedule=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"createSchedule"}),Object.defineProperty(t.prototype.signSchedule=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"signSchedule"}),Object.defineProperty(t.prototype.deleteSchedule=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"deleteSchedule"}),Object.defineProperty(t.prototype.getScheduleInfo=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getScheduleInfo"}),t}(),t.SmartContractService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.createContract=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"createContract"}),Object.defineProperty(t.prototype.updateContract=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"updateContract"}),Object.defineProperty(t.prototype.contractCallMethod=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"contractCallMethod"}),Object.defineProperty(t.prototype.contractCallLocalMethod=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"contractCallLocalMethod"}),Object.defineProperty(t.prototype.getContractInfo=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getContractInfo"}),Object.defineProperty(t.prototype.contractGetBytecode=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"ContractGetBytecode"}),Object.defineProperty(t.prototype.getBySolidityID=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getBySolidityID"}),Object.defineProperty(t.prototype.getTxRecordByContractID=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getTxRecordByContractID"}),Object.defineProperty(t.prototype.deleteContract=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"deleteContract"}),Object.defineProperty(t.prototype.systemDelete=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"systemDelete"}),Object.defineProperty(t.prototype.systemUndelete=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"systemUndelete"}),Object.defineProperty(t.prototype.callEthereum=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"callEthereum"}),t}(),t.ThrottleGroup=function(){function e(e){if(this.operations=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.operations=r.emptyArray,e.prototype.milliOpsPerSec=r.Long?r.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.operations&&e.operations.length){t.uint32(10).fork();for(var n=0;n<e.operations.length;++n)t.int32(e.operations[n]);t.ldelim()}return null!=e.milliOpsPerSec&&Object.hasOwnProperty.call(e,"milliOpsPerSec")&&t.uint32(16).uint64(e.milliOpsPerSec),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ThrottleGroup;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:if(r.operations&&r.operations.length||(r.operations=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)r.operations.push(e.int32());else r.operations.push(e.int32());break;case 2:r.milliOpsPerSec=e.uint64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ThrottleGroup"},e}(),t.ThrottleBucket=function(){function e(e){if(this.throttleGroups=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.burstPeriodMs=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.throttleGroups=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.burstPeriodMs&&Object.hasOwnProperty.call(e,"burstPeriodMs")&&t.uint32(16).uint64(e.burstPeriodMs),null!=e.throttleGroups&&e.throttleGroups.length)for(var n=0;n<e.throttleGroups.length;++n)i.proto.ThrottleGroup.encode(e.throttleGroups[n],t.uint32(26).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ThrottleBucket;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.name=e.string();break;case 2:r.burstPeriodMs=e.uint64();break;case 3:r.throttleGroups&&r.throttleGroups.length||(r.throttleGroups=[]),r.throttleGroups.push(i.proto.ThrottleGroup.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ThrottleBucket"},e}(),t.ThrottleDefinitions=function(){function e(e){if(this.throttleBuckets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.throttleBuckets=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.throttleBuckets&&e.throttleBuckets.length)for(var n=0;n<e.throttleBuckets.length;++n)i.proto.ThrottleBucket.encode(e.throttleBuckets[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ThrottleDefinitions;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.throttleBuckets&&r.throttleBuckets.length||(r.throttleBuckets=[]),r.throttleBuckets.push(i.proto.ThrottleBucket.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ThrottleDefinitions"},e}(),t.TokenService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.createToken=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"createToken"}),Object.defineProperty(t.prototype.updateToken=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"updateToken"}),Object.defineProperty(t.prototype.mintToken=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"mintToken"}),Object.defineProperty(t.prototype.burnToken=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"burnToken"}),Object.defineProperty(t.prototype.deleteToken=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"deleteToken"}),Object.defineProperty(t.prototype.wipeTokenAccount=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"wipeTokenAccount"}),Object.defineProperty(t.prototype.freezeTokenAccount=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"freezeTokenAccount"}),Object.defineProperty(t.prototype.unfreezeTokenAccount=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"unfreezeTokenAccount"}),Object.defineProperty(t.prototype.grantKycToTokenAccount=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"grantKycToTokenAccount"}),Object.defineProperty(t.prototype.revokeKycFromTokenAccount=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"revokeKycFromTokenAccount"}),Object.defineProperty(t.prototype.associateTokens=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"associateTokens"}),Object.defineProperty(t.prototype.dissociateTokens=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"dissociateTokens"}),Object.defineProperty(t.prototype.updateTokenFeeSchedule=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"updateTokenFeeSchedule"}),Object.defineProperty(t.prototype.getTokenInfo=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getTokenInfo"}),Object.defineProperty(t.prototype.getTokenNftInfo=function e(t,n){return this.rpcCall(e,i.proto.Query,i.proto.Response,t,n)},"name",{value:"getTokenNftInfo"}),Object.defineProperty(t.prototype.pauseToken=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"pauseToken"}),Object.defineProperty(t.prototype.unpauseToken=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"unpauseToken"}),Object.defineProperty(t.prototype.updateNfts=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"updateNfts"}),Object.defineProperty(t.prototype.rejectToken=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"rejectToken"}),Object.defineProperty(t.prototype.airdropTokens=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"airdropTokens"}),Object.defineProperty(t.prototype.cancelAirdrop=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"cancelAirdrop"}),Object.defineProperty(t.prototype.claimAirdrop=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"claimAirdrop"}),t}(),t.SignedTransaction=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.bodyBytes=r.newBuffer([]),e.prototype.sigMap=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.bodyBytes&&Object.hasOwnProperty.call(e,"bodyBytes")&&t.uint32(10).bytes(e.bodyBytes),null!=e.sigMap&&Object.hasOwnProperty.call(e,"sigMap")&&i.proto.SignatureMap.encode(e.sigMap,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SignedTransaction;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.bodyBytes=e.bytes();break;case 2:r.sigMap=i.proto.SignatureMap.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SignedTransaction"},e}(),t.UtilService=function(){function t(t,n,o){e.rpc.Service.call(this,t,n,o)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.prng=function e(t,n){return this.rpcCall(e,i.proto.Transaction,i.proto.TransactionResponse,t,n)},"name",{value:"prng"}),t}(),t.TokenUnitBalance=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tokenId=null,e.prototype.balance=r.Long?r.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.tokenId&&Object.hasOwnProperty.call(e,"tokenId")&&i.proto.TokenID.encode(e.tokenId,t.uint32(10).fork()).ldelim(),null!=e.balance&&Object.hasOwnProperty.call(e,"balance")&&t.uint32(16).uint64(e.balance),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TokenUnitBalance;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.tokenId=i.proto.TokenID.decode(e,e.uint32());break;case 2:r.balance=e.uint64();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TokenUnitBalance"},e}(),t.SingleAccountBalances=function(){function e(e){if(this.tokenUnitBalances=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.accountID=null,e.prototype.hbarBalance=r.Long?r.Long.fromBits(0,0,!0):0,e.prototype.tokenUnitBalances=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.accountID&&Object.hasOwnProperty.call(e,"accountID")&&i.proto.AccountID.encode(e.accountID,t.uint32(10).fork()).ldelim(),null!=e.hbarBalance&&Object.hasOwnProperty.call(e,"hbarBalance")&&t.uint32(16).uint64(e.hbarBalance),null!=e.tokenUnitBalances&&e.tokenUnitBalances.length)for(var n=0;n<e.tokenUnitBalances.length;++n)i.proto.TokenUnitBalance.encode(e.tokenUnitBalances[n],t.uint32(26).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SingleAccountBalances;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.accountID=i.proto.AccountID.decode(e,e.uint32());break;case 2:r.hbarBalance=e.uint64();break;case 3:r.tokenUnitBalances&&r.tokenUnitBalances.length||(r.tokenUnitBalances=[]),r.tokenUnitBalances.push(i.proto.TokenUnitBalance.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SingleAccountBalances"},e}(),t.AllAccountBalances=function(){function e(e){if(this.allAccounts=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.consensusTimestamp=null,e.prototype.allAccounts=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.consensusTimestamp&&Object.hasOwnProperty.call(e,"consensusTimestamp")&&i.proto.Timestamp.encode(e.consensusTimestamp,t.uint32(10).fork()).ldelim(),null!=e.allAccounts&&e.allAccounts.length)for(var n=0;n<e.allAccounts.length;++n)i.proto.SingleAccountBalances.encode(e.allAccounts[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.AllAccountBalances;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.consensusTimestamp=i.proto.Timestamp.decode(e,e.uint32());break;case 2:r.allAccounts&&r.allAccounts.length||(r.allAccounts=[]),r.allAccounts.push(i.proto.SingleAccountBalances.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.AllAccountBalances"},e}(),t.ContractActions=function(){function e(e){if(this.contractActions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.contractActions=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.contractActions&&e.contractActions.length)for(var n=0;n<e.contractActions.length;++n)i.proto.ContractAction.encode(e.contractActions[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractActions;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.contractActions&&r.contractActions.length||(r.contractActions=[]),r.contractActions.push(i.proto.ContractAction.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractActions"},e}(),t.ContractActionType=function(){const e={},t=Object.create(e);return t[e[0]="NO_ACTION"]=0,t[e[1]="CALL"]=1,t[e[2]="CREATE"]=2,t[e[3]="PRECOMPILE"]=3,t[e[4]="SYSTEM"]=4,t}(),t.CallOperationType=function(){const e={},t=Object.create(e);return t[e[0]="OP_UNKNOWN"]=0,t[e[1]="OP_CALL"]=1,t[e[2]="OP_CALLCODE"]=2,t[e[3]="OP_DELEGATECALL"]=3,t[e[4]="OP_STATICCALL"]=4,t[e[5]="OP_CREATE"]=5,t[e[6]="OP_CREATE2"]=6,t}(),t.ContractAction=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.callType=0,e.prototype.callingAccount=null,e.prototype.callingContract=null,e.prototype.gas=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.input=r.newBuffer([]),e.prototype.recipientAccount=null,e.prototype.recipientContract=null,e.prototype.targetedAddress=null,e.prototype.value=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.gasUsed=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.output=null,e.prototype.revertReason=null,e.prototype.error=null,e.prototype.callDepth=0,e.prototype.callOperationType=0,Object.defineProperty(e.prototype,"caller",{get:r.oneOfGetter(t=["callingAccount","callingContract"]),set:r.oneOfSetter(t)}),Object.defineProperty(e.prototype,"recipient",{get:r.oneOfGetter(t=["recipientAccount","recipientContract","targetedAddress"]),set:r.oneOfSetter(t)}),Object.defineProperty(e.prototype,"resultData",{get:r.oneOfGetter(t=["output","revertReason","error"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.callType&&Object.hasOwnProperty.call(e,"callType")&&t.uint32(8).int32(e.callType),null!=e.callingAccount&&Object.hasOwnProperty.call(e,"callingAccount")&&i.proto.AccountID.encode(e.callingAccount,t.uint32(18).fork()).ldelim(),null!=e.callingContract&&Object.hasOwnProperty.call(e,"callingContract")&&i.proto.ContractID.encode(e.callingContract,t.uint32(26).fork()).ldelim(),null!=e.gas&&Object.hasOwnProperty.call(e,"gas")&&t.uint32(32).int64(e.gas),null!=e.input&&Object.hasOwnProperty.call(e,"input")&&t.uint32(42).bytes(e.input),null!=e.recipientAccount&&Object.hasOwnProperty.call(e,"recipientAccount")&&i.proto.AccountID.encode(e.recipientAccount,t.uint32(50).fork()).ldelim(),null!=e.recipientContract&&Object.hasOwnProperty.call(e,"recipientContract")&&i.proto.ContractID.encode(e.recipientContract,t.uint32(58).fork()).ldelim(),null!=e.targetedAddress&&Object.hasOwnProperty.call(e,"targetedAddress")&&t.uint32(66).bytes(e.targetedAddress),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(72).int64(e.value),null!=e.gasUsed&&Object.hasOwnProperty.call(e,"gasUsed")&&t.uint32(80).int64(e.gasUsed),null!=e.output&&Object.hasOwnProperty.call(e,"output")&&t.uint32(90).bytes(e.output),null!=e.revertReason&&Object.hasOwnProperty.call(e,"revertReason")&&t.uint32(98).bytes(e.revertReason),null!=e.error&&Object.hasOwnProperty.call(e,"error")&&t.uint32(106).bytes(e.error),null!=e.callDepth&&Object.hasOwnProperty.call(e,"callDepth")&&t.uint32(112).int32(e.callDepth),null!=e.callOperationType&&Object.hasOwnProperty.call(e,"callOperationType")&&t.uint32(120).int32(e.callOperationType),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractAction;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.callType=e.int32();break;case 2:r.callingAccount=i.proto.AccountID.decode(e,e.uint32());break;case 3:r.callingContract=i.proto.ContractID.decode(e,e.uint32());break;case 4:r.gas=e.int64();break;case 5:r.input=e.bytes();break;case 6:r.recipientAccount=i.proto.AccountID.decode(e,e.uint32());break;case 7:r.recipientContract=i.proto.ContractID.decode(e,e.uint32());break;case 8:r.targetedAddress=e.bytes();break;case 9:r.value=e.int64();break;case 10:r.gasUsed=e.int64();break;case 11:r.output=e.bytes();break;case 12:r.revertReason=e.bytes();break;case 13:r.error=e.bytes();break;case 14:r.callDepth=e.int32();break;case 15:r.callOperationType=e.int32();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractAction"},e}(),t.ContractBytecode=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.contractId=null,e.prototype.initcode=r.newBuffer([]),e.prototype.runtimeBytecode=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.contractId&&Object.hasOwnProperty.call(e,"contractId")&&i.proto.ContractID.encode(e.contractId,t.uint32(10).fork()).ldelim(),null!=e.initcode&&Object.hasOwnProperty.call(e,"initcode")&&t.uint32(18).bytes(e.initcode),null!=e.runtimeBytecode&&Object.hasOwnProperty.call(e,"runtimeBytecode")&&t.uint32(26).bytes(e.runtimeBytecode),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractBytecode;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contractId=i.proto.ContractID.decode(e,e.uint32());break;case 2:r.initcode=e.bytes();break;case 3:r.runtimeBytecode=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractBytecode"},e}(),t.ContractStateChanges=function(){function e(e){if(this.contractStateChanges=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.contractStateChanges=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.contractStateChanges&&e.contractStateChanges.length)for(var n=0;n<e.contractStateChanges.length;++n)i.proto.ContractStateChange.encode(e.contractStateChanges[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractStateChanges;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.contractStateChanges&&r.contractStateChanges.length||(r.contractStateChanges=[]),r.contractStateChanges.push(i.proto.ContractStateChange.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractStateChanges"},e}(),t.ContractStateChange=function(){function e(e){if(this.storageChanges=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.contractId=null,e.prototype.storageChanges=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.contractId&&Object.hasOwnProperty.call(e,"contractId")&&i.proto.ContractID.encode(e.contractId,t.uint32(10).fork()).ldelim(),null!=e.storageChanges&&e.storageChanges.length)for(var n=0;n<e.storageChanges.length;++n)i.proto.StorageChange.encode(e.storageChanges[n],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.ContractStateChange;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.contractId=i.proto.ContractID.decode(e,e.uint32());break;case 2:r.storageChanges&&r.storageChanges.length||(r.storageChanges=[]),r.storageChanges.push(i.proto.StorageChange.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.ContractStateChange"},e}(),t.StorageChange=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.slot=r.newBuffer([]),e.prototype.valueRead=r.newBuffer([]),e.prototype.valueWritten=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.slot&&Object.hasOwnProperty.call(e,"slot")&&t.uint32(10).bytes(e.slot),null!=e.valueRead&&Object.hasOwnProperty.call(e,"valueRead")&&t.uint32(18).bytes(e.valueRead),null!=e.valueWritten&&Object.hasOwnProperty.call(e,"valueWritten")&&i.google.protobuf.BytesValue.encode(e.valueWritten,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.StorageChange;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.slot=e.bytes();break;case 2:r.valueRead=e.bytes();break;case 3:r.valueWritten=i.google.protobuf.BytesValue.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.StorageChange"},e}(),t.HashAlgorithm=function(){const e={},t=Object.create(e);return t[e[0]="HASH_ALGORITHM_UNKNOWN"]=0,t[e[1]="SHA_384"]=1,t}(),t.HashObject=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.algorithm=0,e.prototype.length=0,e.prototype.hash=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.algorithm&&Object.hasOwnProperty.call(e,"algorithm")&&t.uint32(8).int32(e.algorithm),null!=e.length&&Object.hasOwnProperty.call(e,"length")&&t.uint32(16).int32(e.length),null!=e.hash&&Object.hasOwnProperty.call(e,"hash")&&t.uint32(26).bytes(e.hash),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.HashObject;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.algorithm=e.int32();break;case 2:r.length=e.int32();break;case 3:r.hash=e.bytes();break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.HashObject"},e}(),t.RecordStreamFile=function(){function e(e){if(this.recordStreamItems=[],this.sidecars=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.hapiProtoVersion=null,e.prototype.startObjectRunningHash=null,e.prototype.recordStreamItems=r.emptyArray,e.prototype.endObjectRunningHash=null,e.prototype.blockNumber=r.Long?r.Long.fromBits(0,0,!1):0,e.prototype.sidecars=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.hapiProtoVersion&&Object.hasOwnProperty.call(e,"hapiProtoVersion")&&i.proto.SemanticVersion.encode(e.hapiProtoVersion,t.uint32(10).fork()).ldelim(),null!=e.startObjectRunningHash&&Object.hasOwnProperty.call(e,"startObjectRunningHash")&&i.proto.HashObject.encode(e.startObjectRunningHash,t.uint32(18).fork()).ldelim(),null!=e.recordStreamItems&&e.recordStreamItems.length)for(var n=0;n<e.recordStreamItems.length;++n)i.proto.RecordStreamItem.encode(e.recordStreamItems[n],t.uint32(26).fork()).ldelim();if(null!=e.endObjectRunningHash&&Object.hasOwnProperty.call(e,"endObjectRunningHash")&&i.proto.HashObject.encode(e.endObjectRunningHash,t.uint32(34).fork()).ldelim(),null!=e.blockNumber&&Object.hasOwnProperty.call(e,"blockNumber")&&t.uint32(40).int64(e.blockNumber),null!=e.sidecars&&e.sidecars.length)for(n=0;n<e.sidecars.length;++n)i.proto.SidecarMetadata.encode(e.sidecars[n],t.uint32(50).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.RecordStreamFile;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.hapiProtoVersion=i.proto.SemanticVersion.decode(e,e.uint32());break;case 2:r.startObjectRunningHash=i.proto.HashObject.decode(e,e.uint32());break;case 3:r.recordStreamItems&&r.recordStreamItems.length||(r.recordStreamItems=[]),r.recordStreamItems.push(i.proto.RecordStreamItem.decode(e,e.uint32()));break;case 4:r.endObjectRunningHash=i.proto.HashObject.decode(e,e.uint32());break;case 5:r.blockNumber=e.int64();break;case 6:r.sidecars&&r.sidecars.length||(r.sidecars=[]),r.sidecars.push(i.proto.SidecarMetadata.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.RecordStreamFile"},e}(),t.RecordStreamItem=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.transaction=null,e.prototype.record=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.transaction&&Object.hasOwnProperty.call(e,"transaction")&&i.proto.Transaction.encode(e.transaction,t.uint32(10).fork()).ldelim(),null!=e.record&&Object.hasOwnProperty.call(e,"record")&&i.proto.TransactionRecord.encode(e.record,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.RecordStreamItem;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.transaction=i.proto.Transaction.decode(e,e.uint32());break;case 2:r.record=i.proto.TransactionRecord.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.RecordStreamItem"},e}(),t.SidecarMetadata=function(){function e(e){if(this.types=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.hash=null,e.prototype.id=0,e.prototype.types=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.hash&&Object.hasOwnProperty.call(e,"hash")&&i.proto.HashObject.encode(e.hash,t.uint32(10).fork()).ldelim(),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(16).int32(e.id),null!=e.types&&e.types.length){t.uint32(26).fork();for(var n=0;n<e.types.length;++n)t.int32(e.types[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SidecarMetadata;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.hash=i.proto.HashObject.decode(e,e.uint32());break;case 2:r.id=e.int32();break;case 3:if(r.types&&r.types.length||(r.types=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)r.types.push(e.int32());else r.types.push(e.int32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SidecarMetadata"},e}(),t.SidecarType=function(){const e={},t=Object.create(e);return t[e[0]="SIDECAR_TYPE_UNKNOWN"]=0,t[e[1]="CONTRACT_STATE_CHANGE"]=1,t[e[2]="CONTRACT_ACTION"]=2,t[e[3]="CONTRACT_BYTECODE"]=3,t}(),t.SidecarFile=function(){function e(e){if(this.sidecarRecords=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sidecarRecords=r.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.sidecarRecords&&e.sidecarRecords.length)for(var n=0;n<e.sidecarRecords.length;++n)i.proto.TransactionSidecarRecord.encode(e.sidecarRecords[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SidecarFile;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.sidecarRecords&&r.sidecarRecords.length||(r.sidecarRecords=[]),r.sidecarRecords.push(i.proto.TransactionSidecarRecord.decode(e,e.uint32()));else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SidecarFile"},e}(),t.TransactionSidecarRecord=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.consensusTimestamp=null,e.prototype.migration=!1,e.prototype.stateChanges=null,e.prototype.actions=null,e.prototype.bytecode=null,Object.defineProperty(e.prototype,"sidecarRecords",{get:r.oneOfGetter(t=["stateChanges","actions","bytecode"]),set:r.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.consensusTimestamp&&Object.hasOwnProperty.call(e,"consensusTimestamp")&&i.proto.Timestamp.encode(e.consensusTimestamp,t.uint32(10).fork()).ldelim(),null!=e.migration&&Object.hasOwnProperty.call(e,"migration")&&t.uint32(16).bool(e.migration),null!=e.stateChanges&&Object.hasOwnProperty.call(e,"stateChanges")&&i.proto.ContractStateChanges.encode(e.stateChanges,t.uint32(26).fork()).ldelim(),null!=e.actions&&Object.hasOwnProperty.call(e,"actions")&&i.proto.ContractActions.encode(e.actions,t.uint32(34).fork()).ldelim(),null!=e.bytecode&&Object.hasOwnProperty.call(e,"bytecode")&&i.proto.ContractBytecode.encode(e.bytecode,t.uint32(42).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.TransactionSidecarRecord;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.consensusTimestamp=i.proto.Timestamp.decode(e,e.uint32());break;case 2:r.migration=e.bool();break;case 3:r.stateChanges=i.proto.ContractStateChanges.decode(e,e.uint32());break;case 4:r.actions=i.proto.ContractActions.decode(e,e.uint32());break;case 5:r.bytecode=i.proto.ContractBytecode.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.TransactionSidecarRecord"},e}(),t.SignatureFile=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.fileSignature=null,e.prototype.metadataSignature=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.fileSignature&&Object.hasOwnProperty.call(e,"fileSignature")&&i.proto.SignatureObject.encode(e.fileSignature,t.uint32(10).fork()).ldelim(),null!=e.metadataSignature&&Object.hasOwnProperty.call(e,"metadataSignature")&&i.proto.SignatureObject.encode(e.metadataSignature,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SignatureFile;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.fileSignature=i.proto.SignatureObject.decode(e,e.uint32());break;case 2:r.metadataSignature=i.proto.SignatureObject.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SignatureFile"},e}(),t.SignatureObject=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.type=0,e.prototype.length=0,e.prototype.checksum=0,e.prototype.signature=r.newBuffer([]),e.prototype.hashObject=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).int32(e.type),null!=e.length&&Object.hasOwnProperty.call(e,"length")&&t.uint32(16).int32(e.length),null!=e.checksum&&Object.hasOwnProperty.call(e,"checksum")&&t.uint32(24).int32(e.checksum),null!=e.signature&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(34).bytes(e.signature),null!=e.hashObject&&Object.hasOwnProperty.call(e,"hashObject")&&i.proto.HashObject.encode(e.hashObject,t.uint32(42).fork()).ldelim(),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.proto.SignatureObject;e.pos<o;){var a=e.uint32();switch(a>>>3){case 1:r.type=e.int32();break;case 2:r.length=e.int32();break;case 3:r.checksum=e.int32();break;case 4:r.signature=e.bytes();break;case 5:r.hashObject=i.proto.HashObject.decode(e,e.uint32());break;default:e.skipType(7&a)}}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.SignatureObject"},e}(),t.SignatureType=function(){const e={},t=Object.create(e);return t[e[0]="SIGNATURE_TYPE_UNKNOWN"]=0,t[e[1]="SHA_384_WITH_RSA"]=1,t}(),t})(),proto.google=i.google=(()=>{const e={};return e.protobuf=function(){const e={};return e.DoubleValue=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.value=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(9).double(e.value),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.google.protobuf.DoubleValue;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.value=e.double();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.DoubleValue"},e}(),e.FloatValue=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.value=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(13).float(e.value),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.google.protobuf.FloatValue;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.value=e.float();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.FloatValue"},e}(),e.Int64Value=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.value=r.Long?r.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(8).int64(e.value),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.google.protobuf.Int64Value;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.value=e.int64();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Int64Value"},e}(),e.UInt64Value=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.value=r.Long?r.Long.fromBits(0,0,!0):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(8).uint64(e.value),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.google.protobuf.UInt64Value;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.value=e.uint64();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.UInt64Value"},e}(),e.Int32Value=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.value=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(8).int32(e.value),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.google.protobuf.Int32Value;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.value=e.int32();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Int32Value"},e}(),e.UInt32Value=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.value=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(8).uint32(e.value),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.google.protobuf.UInt32Value;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.value=e.uint32();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.UInt32Value"},e}(),e.BoolValue=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.value=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(8).bool(e.value),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.google.protobuf.BoolValue;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.value=e.bool();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.BoolValue"},e}(),e.StringValue=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.value="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(10).string(e.value),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.google.protobuf.StringValue;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.value=e.string();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.StringValue"},e}(),e.BytesValue=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.value=r.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(10).bytes(e.value),t},e.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,r=new i.google.protobuf.BytesValue;e.pos<o;){var a=e.uint32();if(a>>>3==1)r.value=e.bytes();else e.skipType(7&a)}return r},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.BytesValue"},e}(),e}(),e})(),proto}function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1,Object.defineProperty(lib,"__esModule",{value:!0}),lib.proto=lib.google=lib.com=lib.Writer=lib.Reader=void 0;var e,t,n=a(requireMinimal()),o=(e=requireUmd())&&e.__esModule?e:{default:e},r=a(requireProto());function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function a(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}return null==(t=n.util).Long&&(console.log("Patching Protobuf Long.js instance..."),t.Long=o.default,null!=n.Reader._configure&&n.Reader._configure(n.BufferReader)),lib.Reader=n.Reader,lib.Writer=n.Writer,lib.proto=r.proto,lib.com=r.com,lib.google=r.google,lib}var libExports=requireLib();class HederaMirrorNode{constructor(e,t){this.network=e,this.baseUrl=this.getMirrorNodeUrl(),this.logger=t,this.isServerEnvironment="undefined"==typeof window}getMirrorNodeUrl(){return"mainnet"===this.network?"https://mainnet-public.mirrornode.hedera.com":"https://testnet.mirrornode.hedera.com"}getBaseUrl(){return this.baseUrl}async getPublicKey(e){this.logger.info(`Getting public key for account ${e}`);const t=await this.requestAccount(e);try{if(!t||!t.key)throw new Error(`Failed to retrieve public key for account ID: ${e}`);return i$7.fromString(t.key.key)}catch(n){throw new Error(`Error fetching public key from Mirror Node: ${n.message}`)}}async getAccountMemo(e){for(let n=0;n<3;n++)try{const t=`${this.baseUrl}/api/v1/accounts/${e}`,o=(await axios.get(t)).data;if(o&&o.memo)return o.memo;this.logger.error(`No memo found for account ${e}`),n<2&&await new Promise((e=>setTimeout(e,2e3)))}catch(t){this.logger.error(`Error getting account memo (attempt ${n+1}): ${t.message}`),n<2&&await new Promise((e=>setTimeout(e,2e3)))}return null}async getTopicInfo(e){try{const t=`${this.baseUrl}/api/v1/topics/${e}`;return(await axios.get(t)).data}catch(t){throw this.logger.error(`Error retrieving topic information: ${t.message}`),new Error(`Failed to retrieve topic information: ${t.message}`)}}async getTopicFees(e){try{return(await this.getTopicInfo(e)).custom_fees}catch(t){return this.logger.error(`Error retrieving topic fees: ${t.message}`),null}}async getHBARPrice(e){try{const t=s$8.fromDate(e).toString(),n=await fetch(`https://mainnet-public.mirrornode.hedera.com/api/v1/network/exchangerate?timestamp=${t}`),o=await n.json();return Number(o?.current_rate?.cent_equivalent)/Number(o?.current_rate?.hbar_equivalent)/100}catch(e2){return null}}async getTopicMessages(e){this.logger.info(`Querying messages for topic ${e}`);let t=`${this.baseUrl}/api/v1/topics/${e}/messages`;const n=[];for(;t;)try{const e=(await axios.get(t)).data;if(e.messages&&e.messages.length>0)for(const t of e.messages)try{if(!t.message)continue;let e,r;try{e=this.isServerEnvironment?Buffer.from(t.message,"base64").toString("utf-8"):(new TextDecoder).decode(Uint8Array.from(atob(t.message),(e=>e.charCodeAt(0))))}catch(o){this.logger.error(`Error decoding message: ${o}`);continue}try{r=JSON.parse(e)}catch(o){return void this.logger.error(`Invalid JSON message content: ${e}`)}r.sequence_number=t.sequence_number,n.push(r)}catch(o){this.logger.error(`Error processing message: ${o.message}`)}t=e.links?.next?`${this.baseUrl}${e.links.next}`:""}catch(o){throw this.logger.error(`Error querying topic messages: ${o.message}`),new Error(`Failed to query topic messages: ${o.message}`)}return n}async requestAccount(e){try{const t=`${this.baseUrl}/api/v1/accounts/${e}`,n=await axios.get(t);if(!n.data)throw new Error(`Failed to make request to mirror node for account: ${e}`);return n.data}catch(t){throw this.logger.error(`Failed to fetch account: ${t.message}`),new Error(`Failed to fetch account: ${t.message}`)}}async checkKeyListAccess(e,t){try{const n=libExports.proto.Key.decode(e);return this.evaluateKeyAccess(n,t)}catch(n){return this.logger.error(`Error decoding protobuf key: ${n instanceof Error?n.message:String(n)}`),!1}}async evaluateKeyAccess(e,t){return e.ed25519?this.compareEd25519Key(e.ed25519,t):e.keyList?this.evaluateKeyList(e.keyList,t):!(!e.thresholdKey||!e.thresholdKey.keys)&&this.evaluateKeyList(e.thresholdKey.keys,t)}async evaluateKeyList(e,t){const n=e.keys||[];for(const r of n)if(r)if(r.ed25519){if(this.compareEd25519Key(r.ed25519,t))return!0}else if(r.keyList||r.thresholdKey)try{const e=libExports.proto.Key.encode({...r.keyList?{keyList:r.keyList}:{},...r.thresholdKey?{thresholdKey:r.thresholdKey}:{}}).finish();if(await this.checkKeyListAccess(Buffer.from(e),t))return!0}catch(o){this.logger.debug(`Error in nested key: ${o instanceof Error?o.message:String(o)}`)}return!1}compareEd25519Key(e,t){try{return i$7.fromBytes(Buffer.from(e)).toString()===t.toString()}catch(n){return!1}}}class ProgressReporter{constructor(e={}){this.module=e.module||"Progress",this.callback=e.callback,this.logger=e.logger||new Logger$2({level:"info",module:"ProgressReporter"}),this.logProgress=e.logProgress??!0,this.minPercent=e.minPercent??0,this.maxPercent=e.maxPercent??100,this.lastReportedPercent=-1,this.lastReportedTime=0,this.throttleMs=100}static getInstance(e={}){return ProgressReporter.instance?(e.callback&&ProgressReporter.instance.setCallback(e.callback),e.module&&ProgressReporter.instance.setModule(e.module),e.logger&&ProgressReporter.instance.setLogger(e.logger),void 0!==e.minPercent&&ProgressReporter.instance.setMinPercent(e.minPercent),void 0!==e.maxPercent&&ProgressReporter.instance.setMaxPercent(e.maxPercent)):ProgressReporter.instance=new ProgressReporter(e),ProgressReporter.instance}setCallback(e){this.callback=e}setModule(e){this.module=e}setLogger(e){this.logger=e}setMinPercent(e){this.minPercent=e}setMaxPercent(e){this.maxPercent=e}createSubProgress(e){const t=new ProgressReporter({module:this.module,logger:this.logger,logProgress:this.logProgress,minPercent:e.minPercent,maxPercent:e.maxPercent}),n=e.logPrefix||"";return t.setCallback((t=>{const o=this.scalePercent(t.progressPercent,e.minPercent,e.maxPercent);let r=t.message;n&&!r.startsWith(n)&&(r=`${n}: ${r}`),this.report({stage:t.stage,message:r,progressPercent:o,details:t.details})})),t}report(e){const t=e.progressPercent,n=Math.max(0,Math.min(100,t)),o=this.scalePercent(n,0,100),r=Date.now();if(o===this.lastReportedPercent&&r-this.lastReportedTime<this.throttleMs&&"completed"!==e.stage&&"failed"!==e.stage)return;this.lastReportedPercent=o,this.lastReportedTime=r;const i={...e,progressPercent:o};if(this.logProgress&&this.logger.debug(`[${this.module}] [${e.stage.toUpperCase()}] ${e.message} (${o.toFixed(1)}%)`,e.details),this.callback)try{this.callback(i)}catch(a){this.logger.warn(`Error in progress callback: ${a}`)}}scalePercent(e,t,n){const o=(this.maxPercent-this.minPercent)/(n-t);return this.minPercent+(e-t)*o}preparing(e,t,n){this.report({stage:"preparing",message:e,progressPercent:t,details:n})}submitting(e,t,n){this.report({stage:"submitting",message:e,progressPercent:t,details:n})}confirming(e,t,n){this.report({stage:"confirming",message:e,progressPercent:t,details:n})}verifying(e,t,n){this.report({stage:"verifying",message:e,progressPercent:t,details:n})}completed(e,t){this.report({stage:"completed",message:e,progressPercent:100,details:t})}failed(e,t){this.report({stage:"failed",message:e,progressPercent:this.lastReportedPercent,details:t})}}async function inscribe(e,t,n,o){const r=Logger$2.getInstance({module:"Inscriber",...n.logging});r.info("Starting inscription process",{type:e.type,mode:n.mode||"file",..."url"===e.type?{url:e.url}:{},..."file"===e.type?{path:e.path}:{},..."buffer"===e.type?{fileName:e.fileName,bufferSize:e.buffer.byteLength}:{}});try{let i;"hashinal"===n.mode&&n.metadata&&validateHashinalMetadata(n.metadata,r),o?(r.debug("Using existing InscriptionSDK instance"),i=o):n.apiKey?(r.debug("Initializing InscriptionSDK with API key"),i=new InscriptionSDK({apiKey:n.apiKey,network:t.network||"mainnet"})):(r.debug("Initializing InscriptionSDK with server auth"),i=await InscriptionSDK.createWithAuth({type:"server",accountId:t.accountId,privateKey:t.privateKey,network:t.network||"mainnet"}));const a={holderId:t.accountId,metadata:n.metadata||{},tags:n.tags||[],mode:n.mode||"file",chunkSize:n.chunkSize};let s;switch(e.type){case"url":s={...a,file:{type:"url",url:e.url}};break;case"file":s={...a,file:{type:"path",path:e.path}};break;case"buffer":s={...a,file:{type:"base64",base64:Buffer.from(e.buffer).toString("base64"),fileName:e.fileName,mimeType:e.mimeType}}}"hashinal"===n.mode&&(s.metadataObject=n.metadata,s.creator=n.metadata?.creator||t.accountId,s.description=n.metadata?.description,n.jsonFileURL&&(s.jsonFileURL=n.jsonFileURL)),r.debug("Preparing to inscribe content",{type:e.type,mode:n.mode||"file",holderId:t.accountId});const c=await i.inscribeAndExecute(s,t);if(r.info("Starting to inscribe.",{type:e.type,mode:n.mode||"file",transactionId:c.jobId}),n.waitForConfirmation){r.debug("Waiting for inscription confirmation",{transactionId:c.jobId,maxAttempts:n.waitMaxAttempts,intervalMs:n.waitIntervalMs});const e=await waitForInscriptionConfirmation(i,c.jobId,n.waitMaxAttempts,n.waitIntervalMs,n.progressCallback);return r.info("Inscription confirmation received",{transactionId:c.jobId}),{confirmed:!0,result:c,inscription:e,sdk:i}}return{confirmed:!1,result:c,sdk:i}}catch(i){throw r.error("Error during inscription process",i),i}}async function inscribeWithSigner(e,t,n,o){const r=Logger$2.getInstance({module:"Inscriber",...n.logging});r.info("Starting inscription process with signer",{type:e.type,mode:n.mode||"file",..."url"===e.type?{url:e.url}:{},..."file"===e.type?{path:e.path}:{},..."buffer"===e.type?{fileName:e.fileName,bufferSize:e.buffer.byteLength}:{}});try{"hashinal"===n.mode&&n.metadata&&validateHashinalMetadata(n.metadata,r);const i=t.getAccountId().toString();let a;r.debug("Using account ID from signer",{accountId:i}),o?(r.debug("Using existing InscriptionSDK instance"),a=o):n.apiKey?(r.debug("Initializing InscriptionSDK with API key"),a=new InscriptionSDK({apiKey:n.apiKey,network:n.network||"mainnet"})):(r.debug("Initializing InscriptionSDK with client auth"),a=await InscriptionSDK.createWithAuth({type:"client",accountId:i,signer:t,network:n.network||"mainnet"}));const s={holderId:i,metadata:n.metadata||{},tags:n.tags||[],mode:n.mode||"file",chunkSize:n.chunkSize};let c;switch(e.type){case"url":c={...s,file:{type:"url",url:e.url}};break;case"file":c={...s,file:{type:"path",path:e.path}};break;case"buffer":c={...s,file:{type:"base64",base64:Buffer.from(e.buffer).toString("base64"),fileName:e.fileName,mimeType:e.mimeType}}}"hashinal"===n.mode&&(c.metadataObject=n.metadata,c.creator=n.metadata?.creator||i,c.description=n.metadata?.description,n.jsonFileURL&&(c.jsonFileURL=n.jsonFileURL)),r.debug("Preparing to inscribe content with signer",{type:e.type,mode:n.mode||"file",holderId:i});const l=await a.inscribe({...c,holderId:i},t);if(r.info("Inscription started",{type:e.type,mode:n.mode||"file",transactionId:l.jobId}),n.waitForConfirmation){r.debug("Waiting for inscription confirmation",{transactionId:l.jobId,maxAttempts:n.waitMaxAttempts,intervalMs:n.waitIntervalMs});const e=await waitForInscriptionConfirmation(a,l.jobId,n.waitMaxAttempts,n.waitIntervalMs,n.progressCallback);return r.info("Inscription confirmation received",{transactionId:l.jobId}),{confirmed:!0,result:l,inscription:e,sdk:a}}return{confirmed:!1,result:l,sdk:a}}catch(i){throw r.error("Error during inscription process",i),i}}async function retrieveInscription(e,t){const n=Logger$2.getInstance({module:"Inscriber",...t.logging}),o=e.includes("@")?`${e.split("@")[0]}-${e.split("@")[1].replace(/\./g,"-")}`:e;n.info("Retrieving inscription",{originalTransactionId:e,formattedTransactionId:o});try{let e;if(t.apiKey)n.debug("Initializing InscriptionSDK with API key"),e=new InscriptionSDK({apiKey:t.apiKey,network:t.network||"mainnet"});else{if(!t.accountId||!t.privateKey){const e=new Error("Either API key or account ID and private key are required for retrieving inscriptions");throw n.error("Missing authentication credentials",{hasApiKey:!!t.apiKey,hasAccountId:!!t.accountId,hasPrivateKey:!!t.privateKey}),e}n.debug("Initializing InscriptionSDK with server auth"),e=await InscriptionSDK.createWithAuth({type:"server",accountId:t.accountId,privateKey:t.privateKey,network:t.network||"mainnet"})}n.debug("Initialized SDK for inscription retrieval",{formattedTransactionId:o,network:t.network||"mainnet"});const r=await e.retrieveInscription(o);return n.info("Successfully retrieved inscription",{formattedTransactionId:o}),r}catch(r){throw n.error("Error retrieving inscription",{formattedTransactionId:o,error:r}),r}}function validateHashinalMetadata(e,t){const n=["name","creator","description","type"].filter((t=>!e[t]));if(n.length>0){const e=new Error(`Missing required Hashinal metadata fields: ${n.join(", ")}`);throw t.error("Hashinal metadata validation failed",{missingFields:n}),e}t.debug("Hashinal metadata validation passed",{name:e.name,creator:e.creator,description:e.description,type:e.type,hasAttributes:!!e.attributes,hasProperties:!!e.properties})}async function waitForInscriptionConfirmation(e,t,n=30,o=4e3,r){const i=Logger$2.getInstance({module:"Inscriber"}),a=new ProgressReporter({module:"Inscriber",logger:i,callback:r});try{i.debug("Waiting for inscription confirmation",{transactionId:t,maxAttempts:n,intervalMs:o}),a.preparing("Preparing for inscription confirmation",5,{transactionId:t,maxAttempts:n,intervalMs:o});try{const r=e.waitForInscription,i=e=>{const t=e.stage||"confirming",n=e.message||"Processing inscription",o=e.progressPercent||50;a.report({stage:t,message:n,progressPercent:o,details:e.details})};return await r(t,n,o,!0,i)}catch(e2){return i.debug("Falling back to standard waitForInscription method",{error:e2}),a.verifying("Verifying inscription status",50,{error:e2}),await e.waitForInscription(t,n,o,!0)}}catch(s){throw i.error("Error waiting for inscription confirmation",{transactionId:t,maxAttempts:n,intervalMs:o,error:s}),a.failed("Inscription confirmation failed",{transactionId:t,error:s}),s}}var mimeTypes={};const require$$0={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}};
118
118
  /*!
119
119
  * mime-db
@@ -126,5 +126,5 @@ function utilFromBase(e,t){let n=0;if(1===e.length)return e[0];for(let o=e.lengt
126
126
  * Copyright(c) 2014 Jonathan Ong
127
127
  * Copyright(c) 2015 Douglas Christopher Wilson
128
128
  * MIT Licensed
129
- */function requireMimeTypes(){return hasRequiredMimeTypes||(hasRequiredMimeTypes=1,function(e){var t,n,o,r=requireMimeDb(),i=require$$1.extname,a=/^\s*([^;\s]*)(?:;|\s|$)/,s=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var t=a.exec(e),n=t&&r[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!s.test(t[1]))&&"UTF-8"}e.charset=c,e.charsets={lookup:c},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var n=-1===t.indexOf("/")?e.lookup(t):t;if(!n)return!1;if(-1===n.indexOf("charset")){var o=e.charset(n);o&&(n+="; charset="+o.toLowerCase())}return n},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var n=a.exec(t),o=n&&e.extensions[n[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var n=i("x."+t).toLowerCase().substr(1);if(!n)return!1;return e.types[n]||!1},e.types=Object.create(null),t=e.extensions,n=e.types,o=["nginx","apache",void 0,"iana"],Object.keys(r).forEach((function(e){var i=r[e],a=i.extensions;if(a&&a.length){t[e]=a;for(var s=0;s<a.length;s++){var c=a[s];if(n[c]){var l=o.indexOf(r[n[c]].source),u=o.indexOf(i.source);if("application/octet-stream"!==n[c]&&(l>u||l===u&&"application/"===n[c].substr(0,12)))continue}n[c]=e}}}))}(mimeTypes)),mimeTypes}var mimeTypesExports=requireMimeTypes(),util,util2,objectUtil,objectUtil2;util2=util||(util={}),util2.assertEqual=e=>e,util2.assertIs=function(e){},util2.assertNever=function(e){throw new Error},util2.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},util2.getValidEnumValues=e=>{const t=util2.objectKeys(e).filter((t=>"number"!=typeof e[e[t]])),n={};for(const o of t)n[o]=e[o];return util2.objectValues(n)},util2.objectValues=e=>util2.objectKeys(e).map((function(t){return e[t]})),util2.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},util2.find=(e,t)=>{for(const n of e)if(t(n))return n},util2.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,util2.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},util2.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,objectUtil2=objectUtil||(objectUtil={}),objectUtil2.mergeShapes=(e,t)=>({...e,...t});const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:null===e?ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},o=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(o);else if("invalid_return_type"===r.code)o(r.returnTypeError);else if("invalid_arguments"===r.code)o(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,o=0;for(;o<r.path.length;){const n=r.path[o];o===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],o++}}};return o(this),n}static assert(e){if(!(e instanceof ZodError))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const o of this.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let n;switch(e.code){case ZodIssueCode.invalid_type:n=e.received===ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${util.joinValues(e.keys,", ")}`;break;case ZodIssueCode.invalid_union:n="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${util.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${util.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case ZodIssueCode.invalid_date:n="Invalid date";break;case ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:util.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ZodIssueCode.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ZodIssueCode.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ZodIssueCode.custom:n="Invalid input";break;case ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:n="Number must be finite";break;default:n=t.defaultError,util.assertNever(e)}return{message:n}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],a={...r,path:i};if(void 0!==r.message)return{...r,path:i,message:r.message};let s="";const c=o.filter((e=>!!e)).slice().reverse();for(const l of c)s=l(a,{data:t,defaultError:s}).message;return{...r,path:i,message:s}},EMPTY_PATH=[];function addIssueToContext(e,t){const n=getErrorMap(),o=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===errorMap?void 0:errorMap].filter((e=>!!e))});e.common.issues.push(o)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const o of t){if("aborted"===o.status)return INVALID;"dirty"===o.status&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const o of t){const e=await o.key,t=await o.value;n.push({key:e,value:t})}return ParseStatus.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const o of t){const{key:t,value:r}=o;if("aborted"===t.status)return INVALID;if("aborted"===r.status)return INVALID;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!o.alwaysSet||(n[t.value]=r.value)}return{status:e.value,value:n}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>"aborted"===e.status,isDirty=e=>"dirty"===e.status,isValid=e=>"valid"===e.status,isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise;function __classPrivateFieldGet(e,t,n,o){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function __classPrivateFieldSet(e,t,n,o,r){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var errorUtil,errorUtil2,_ZodEnum_cache,_ZodNativeEnum_cache;"function"==typeof SuppressedError&&SuppressedError,errorUtil2=errorUtil||(errorUtil={}),errorUtil2.errToObj=e=>"string"==typeof e?{message:e}:e||{},errorUtil2.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class ParseInputLazyPath{constructor(e,t,n,o){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ZodError(e.common.issues);return this._error=t,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:r};return{errorMap:(t,r)=>{var i,a;const{message:s}=e;return"invalid_enum_value"===t.code?{message:null!=s?s:r.defaultError}:void 0===r.data?{message:null!==(i=null!=s?s:o)&&void 0!==i?i:r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:null!==(a=null!=s?s:n)&&void 0!==a?a:r.defaultError}},description:r}}class ZodType{get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const o={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},r=this._parseSync({data:e,path:o.path,parent:o});return handleResult(o,r)}"~validate"(e){var t,n;const o={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:o});return isValid(t)?{value:t.value}:{issues:o.common.issues}}catch(r){(null===(n=null===(t=null==r?void 0:r.message)||void 0===t?void 0:t.toLowerCase())||void 0===n?void 0:n.includes("encountered"))&&(this["~standard"].async=!0),o.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:o}).then((e=>isValid(e)?{value:e.value}:{issues:o.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},o=this._parse({data:e,path:n.path,parent:n}),r=await(isAsync(o)?o:Promise.resolve(o));return handleResult(n,r)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,o)=>{const r=e(t),i=()=>o.addIssue({code:ZodIssueCode.custom,...n(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then((e=>!!e||(i(),!1))):!!r||(i(),!1)}))}refinement(e,t){return this._refinement(((n,o)=>!!e(n)||(o.addIssue("function"==typeof t?t(n,o):t),!1)))}_refinement(e){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function timeRegex(e){return new RegExp(`^${timeRegexSource(e)}$`)}function datetimeRegex(e){let t=`${dateRegexSource}T${timeRegexSource(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function isValidIP(e,t){return!("v4"!==t&&t||!ipv4Regex.test(e))||!("v6"!==t&&t||!ipv6Regex.test(e))}function isValidJWT(e,t){if(!jwtRegex.test(e))return!1;try{const[n]=e.split("."),o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return"object"==typeof r&&null!==r&&(!(!r.typ||!r.alg)&&(!t||r.alg===t))}catch(n){return!1}}function isValidCidr(e,t){return!("v4"!==t&&t||!ipv4CidrRegex.test(e))||!("v6"!==t&&t||!ipv6CidrRegex.test(e))}class ZodString extends ZodType{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==ZodParsedType.string){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:t.parsedType}),INVALID}const t=new ParseStatus;let n;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const o=e.data.length>r.value,i=e.data.length<r.value;(o||i)&&(n=this._getOrReturnCtx(e,n),o?addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):i&&addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)emailRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"email",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"emoji",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)uuidRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"uuid",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)nanoidRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)cuidRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"cuid",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)cuid2Regex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)ulidRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"ulid",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(o){n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"url",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"regex",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){datetimeRegex(r).test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else if("date"===r.kind){dateRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:"date",message:r.message}),t.dirty())}else if("time"===r.kind){timeRegex(r).test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:"time",message:r.message}),t.dirty())}else"duration"===r.kind?durationRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"duration",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?isValidIP(e.data,r.version)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"ip",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):"jwt"===r.kind?isValidJWT(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"jwt",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):"cidr"===r.kind?isValidCidr(e.data,r.version)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"cidr",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):"base64"===r.kind?base64Regex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"base64",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):"base64url"===r.kind?base64urlRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"base64url",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):util.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(n)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...errorUtil.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...errorUtil.errToObj(t)})}nonempty(e){return this.min(1,errorUtil.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function floatSafeRemainder(e,t){const n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o;return parseInt(e.toFixed(r).replace(".",""))%parseInt(t.toFixed(r).replace(".",""))/Math.pow(10,r)}ZodString.create=e=>{var t;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==ZodParsedType.number){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:t.parsedType}),INVALID}let t;const n=new ParseStatus;for(const o of this._def.checks)if("int"===o.kind)util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty());else if("min"===o.kind){(o.inclusive?e.data<o.value:e.data<=o.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty())}else if("max"===o.kind){(o.inclusive?e.data>o.value:e.data>=o.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty())}else"multipleOf"===o.kind?0!==floatSafeRemainder(e.data,o.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):"finite"===o.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_finite,message:o.message}),n.dirty()):util.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,n,o){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:errorUtil.toString(o)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(o){return this._getInvalidInput(e)}if(this._getType(e)!==ZodParsedType.bigint)return this._getInvalidInput(e);let t;const n=new ParseStatus;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty())}else"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):util.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:t.parsedType}),INVALID}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,n,o){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:errorUtil.toString(o)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ZodBigInt.create=e=>{var t;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:t.parsedType}),INVALID}return OK(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==ZodParsedType.date){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:t.parsedType}),INVALID}if(isNaN(e.data.getTime())){return addIssueToContext(this._getOrReturnCtx(e),{code:ZodIssueCode.invalid_date}),INVALID}const t=new ParseStatus;let n;for(const o of this._def.checks)"min"===o.kind?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),t.dirty()):"max"===o.kind?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),t.dirty()):util.assertNever(o);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:t.parsedType}),INVALID}return OK(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:t.parsedType}),INVALID}return OK(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.null){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:t.parsedType}),INVALID}return OK(e.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return OK(e.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OK(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:t.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:t.parsedType}),INVALID}return OK(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),o=this._def;if(t.parsedType!==ZodParsedType.array)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:t.parsedType}),INVALID;if(null!==o.exactLength){const e=t.data.length>o.exactLength.value,r=t.data.length<o.exactLength.value;(e||r)&&(addIssueToContext(t,{code:e?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:r?o.exactLength.value:void 0,maximum:e?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(null!==o.minLength&&t.data.length<o.minLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),null!==o.maxLength&&t.data.length>o.maxLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>o.type._parseAsync(new ParseInputLazyPath(t,e,t.path,n))))).then((e=>ParseStatus.mergeArray(n,e)));const r=[...t.data].map(((e,n)=>o.type._parseSync(new ParseInputLazyPath(t,e,t.path,n))));return ParseStatus.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:errorUtil.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const n in e.shape){const o=e.shape[n];t[n]=ZodOptional.create(deepPartialify(o))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map((e=>deepPartialify(e)))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ZodParsedType.object){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID}const{status:t,ctx:n}=this._processInputParams(e),{shape:o,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const s in n.data)r.includes(s)||i.push(s);const a=[];for(const s of r){const e=o[s],t=n.data[s];a.push({key:{status:"valid",value:s},value:e._parse(new ParseInputLazyPath(n,t,n.path,s)),alwaysSet:s in n.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of i)a.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===e)i.length>0&&(addIssueToContext(n,{code:ZodIssueCode.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const o=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(n,o,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key,o=await t.value;e.push({key:n,value:o,alwaysSet:t.alwaysSet})}return e})).then((e=>ParseStatus.mergeObjectSync(t,e))):ParseStatus.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var o,r,i,a;const s=null!==(i=null===(r=(o=this._def).errorMap)||void 0===r?void 0:r.call(o,t,n).message)&&void 0!==i?i:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=errorUtil.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const t={};return util.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new ZodObject({...this._def,shape:()=>t})}omit(e){const t={};return util.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){const t={};return util.objectKeys(this.shape).forEach((n=>{const o=this.shape[n];e&&!e[n]?t[n]=o:t[n]=o.optional()})),new ZodObject({...this._def,shape:()=>t})}required(e){const t={};return util.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ZodOptional;)e=e._def.innerType;t[n]=e}})),new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const o of e)if("dirty"===o.result.status)return t.common.issues.push(...o.ctx.common.issues),o.result;const n=e.map((e=>new ZodError(e.ctx.common.issues)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:n}),INVALID}));{let e;const o=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},r=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:n}),n.common.issues.length&&o.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=o.map((e=>new ZodError(e)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:r}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?util.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.object)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID;const n=this.discriminator,o=t.data[n],r=this.optionsMap.get(o);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(addIssueToContext(t,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const o=new Map;for(const r of t){const t=getDiscriminator(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(o.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);o.set(n,r)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:o,...processCreateParams(n)})}}function mergeValues(e,t){const n=getParsedType(e),o=getParsedType(t);if(e===t)return{valid:!0,data:e};if(n===ZodParsedType.object&&o===ZodParsedType.object){const n=util.objectKeys(t),o=util.objectKeys(e).filter((e=>-1!==n.indexOf(e))),r={...e,...t};for(const i of o){const n=mergeValues(e[i],t[i]);if(!n.valid)return{valid:!1};r[i]=n.data}return{valid:!0,data:r}}if(n===ZodParsedType.array&&o===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let o=0;o<e.length;o++){const r=mergeValues(e[o],t[o]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===ZodParsedType.date&&o===ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),o=(e,o)=>{if(isAborted(e)||isAborted(o))return INVALID;const r=mergeValues(e.value,o.value);return r.valid?((isDirty(e)||isDirty(o))&&t.dirty(),{status:t.value,value:r.data}):(addIssueToContext(n,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>o(e,t))):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ZodIntersection.create=(e,t,n)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(n)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.array)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:n.parsedType}),INVALID;if(n.data.length<this._def.items.length)return addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&n.data.length>this._def.items.length&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...n.data].map(((e,t)=>{const o=this._def.items[t]||this._def.rest;return o?o._parse(new ParseInputLazyPath(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(o).then((e=>ParseStatus.mergeArray(t,e))):ParseStatus.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.object)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType}),INVALID;const o=[],r=this._def.keyType,i=this._def.valueType;for(const a in n.data)o.push({key:r._parse(new ParseInputLazyPath(n,a,n.path,a)),value:i._parse(new ParseInputLazyPath(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?ParseStatus.mergeObjectAsync(t,o):ParseStatus.mergeObjectSync(t,o)}get element(){return this._def.valueType}static create(e,t,n){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(n)}:{keyType:ZodString.create(),valueType:e,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.map)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:n.parsedType}),INVALID;const o=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map((([e,t],i)=>({key:o._parse(new ParseInputLazyPath(n,e,n.path,[i,"key"])),value:r._parse(new ParseInputLazyPath(n,t,n.path,[i,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of i){const o=await n.key,r=await n.value;if("aborted"===o.status||"aborted"===r.status)return INVALID;"dirty"!==o.status&&"dirty"!==r.status||t.dirty(),e.set(o.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of i){const o=n.key,r=n.value;if("aborted"===o.status||"aborted"===r.status)return INVALID;"dirty"!==o.status&&"dirty"!==r.status||t.dirty(),e.set(o.value,r.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,n)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(n)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.set)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:n.parsedType}),INVALID;const o=this._def;null!==o.minSize&&n.data.size<o.minSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),t.dirty()),null!==o.maxSize&&n.data.size>o.maxSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const n=new Set;for(const o of e){if("aborted"===o.status)return INVALID;"dirty"===o.status&&t.dirty(),n.add(o.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>r._parse(new ParseInputLazyPath(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>i(e))):i(a)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.function)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:t.parsedType}),INVALID;function n(e,n){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:n}})}function o(e,n){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:n}})}const r={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return OK((async function(...t){const a=new ZodError([]),s=await e._def.args.parseAsync(t,r).catch((e=>{throw a.addIssue(n(t,e)),a})),c=await Reflect.apply(i,this,s);return await e._def.returns._def.type.parseAsync(c,r).catch((e=>{throw a.addIssue(o(c,e)),a}))}))}{const e=this;return OK((function(...t){const a=e._def.args.safeParse(t,r);if(!a.success)throw new ZodError([n(t,a.error)]);const s=Reflect.apply(i,this,a.data),c=e._def.returns.safeParse(s,r);if(!c.success)throw new ZodError([o(s,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(n)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return addIssueToContext(t,{expected:util.joinValues(n),received:t.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_enum_value,options:n}),INVALID}return OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ZodEnum.create(e,{...this._def,...t})}exclude(e,t=this._def){return ZodEnum.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}_ZodEnum_cache=new WeakMap,ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(e){const t=util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ZodParsedType.string&&n.parsedType!==ZodParsedType.number){const e=util.objectValues(t);return addIssueToContext(n,{expected:util.joinValues(e),received:n.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(e.data)){const e=util.objectValues(t);return addIssueToContext(n,{received:n.data,code:ZodIssueCode.invalid_enum_value,options:e}),INVALID}return OK(e.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap,ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.promise&&!1===t.common.async)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:t.parsedType}),INVALID;const n=t.parsedType===ZodParsedType.promise?t.data:Promise.resolve(t.data);return OK(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:e=>{addIssueToContext(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===o.type){const e=o.transform(n.data,r);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return INVALID;const o=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===o.status?INVALID:"dirty"===o.status||"dirty"===t.value?DIRTY(o.value):o}));{if("aborted"===t.value)return INVALID;const o=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===o.status?INVALID:"dirty"===o.status||"dirty"===t.value?DIRTY(o.value):o}}if("refinement"===o.type){const e=e=>{const t=o.refinement(e,r);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===o.status?INVALID:("dirty"===o.status&&t.dirty(),e(o.value),{status:t.value,value:o.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?INVALID:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===o.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!isValid(e))return e;const i=o.transform(e.value,r);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>isValid(e)?Promise.resolve(o.transform(e.value,r)).then((e=>({status:t.value,value:e}))):e))}util.assertNever(o)}}ZodEffects.create=(e,t,n)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(n)}),ZodEffects.createWithPreprocess=(e,t,n)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(n)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.null?OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return isAsync(o)?o.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===o.status?o.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.nan){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:t.parsedType}),INVALID}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),DIRTY(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e),n=e=>(isValid(e)&&(e.value=Object.freeze(e.value)),e);return isAsync(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function cleanParams(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function custom(e,t={},n){return e?ZodAny.create().superRefine(((o,r)=>{var i,a;const s=e(o);if(s instanceof Promise)return s.then((e=>{var i,a;if(!e){const e=cleanParams(t,o),s=null===(a=null!==(i=e.fatal)&&void 0!==i?i:n)||void 0===a||a;r.addIssue({code:"custom",...e,fatal:s})}}));if(!s){const e=cleanParams(t,o),s=null===(a=null!==(i=e.fatal)&&void 0!==i?i:n)||void 0===a||a;r.addIssue({code:"custom",...e,fatal:s})}})):ZodAny.create()}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind,ZodFirstPartyTypeKind2;ZodFirstPartyTypeKind2=ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}),ZodFirstPartyTypeKind2.ZodString="ZodString",ZodFirstPartyTypeKind2.ZodNumber="ZodNumber",ZodFirstPartyTypeKind2.ZodNaN="ZodNaN",ZodFirstPartyTypeKind2.ZodBigInt="ZodBigInt",ZodFirstPartyTypeKind2.ZodBoolean="ZodBoolean",ZodFirstPartyTypeKind2.ZodDate="ZodDate",ZodFirstPartyTypeKind2.ZodSymbol="ZodSymbol",ZodFirstPartyTypeKind2.ZodUndefined="ZodUndefined",ZodFirstPartyTypeKind2.ZodNull="ZodNull",ZodFirstPartyTypeKind2.ZodAny="ZodAny",ZodFirstPartyTypeKind2.ZodUnknown="ZodUnknown",ZodFirstPartyTypeKind2.ZodNever="ZodNever",ZodFirstPartyTypeKind2.ZodVoid="ZodVoid",ZodFirstPartyTypeKind2.ZodArray="ZodArray",ZodFirstPartyTypeKind2.ZodObject="ZodObject",ZodFirstPartyTypeKind2.ZodUnion="ZodUnion",ZodFirstPartyTypeKind2.ZodDiscriminatedUnion="ZodDiscriminatedUnion",ZodFirstPartyTypeKind2.ZodIntersection="ZodIntersection",ZodFirstPartyTypeKind2.ZodTuple="ZodTuple",ZodFirstPartyTypeKind2.ZodRecord="ZodRecord",ZodFirstPartyTypeKind2.ZodMap="ZodMap",ZodFirstPartyTypeKind2.ZodSet="ZodSet",ZodFirstPartyTypeKind2.ZodFunction="ZodFunction",ZodFirstPartyTypeKind2.ZodLazy="ZodLazy",ZodFirstPartyTypeKind2.ZodLiteral="ZodLiteral",ZodFirstPartyTypeKind2.ZodEnum="ZodEnum",ZodFirstPartyTypeKind2.ZodEffects="ZodEffects",ZodFirstPartyTypeKind2.ZodNativeEnum="ZodNativeEnum",ZodFirstPartyTypeKind2.ZodOptional="ZodOptional",ZodFirstPartyTypeKind2.ZodNullable="ZodNullable",ZodFirstPartyTypeKind2.ZodDefault="ZodDefault",ZodFirstPartyTypeKind2.ZodCatch="ZodCatch",ZodFirstPartyTypeKind2.ZodPromise="ZodPromise",ZodFirstPartyTypeKind2.ZodBranded="ZodBranded",ZodFirstPartyTypeKind2.ZodPipeline="ZodPipeline",ZodFirstPartyTypeKind2.ZodReadonly="ZodReadonly";const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom((t=>t instanceof e),t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap:setErrorMap,getErrorMap:getErrorMap,makeIssue:makeIssue,EMPTY_PATH:EMPTY_PATH,addIssueToContext:addIssueToContext,ParseStatus:ParseStatus,INVALID:INVALID,DIRTY:DIRTY,OK:OK,isAborted:isAborted,isDirty:isDirty,isValid:isValid,isAsync:isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType:ZodParsedType,getParsedType:getParsedType,ZodType:ZodType,datetimeRegex:datetimeRegex,ZodString:ZodString,ZodNumber:ZodNumber,ZodBigInt:ZodBigInt,ZodBoolean:ZodBoolean,ZodDate:ZodDate,ZodSymbol:ZodSymbol,ZodUndefined:ZodUndefined,ZodNull:ZodNull,ZodAny:ZodAny,ZodUnknown:ZodUnknown,ZodNever:ZodNever,ZodVoid:ZodVoid,ZodArray:ZodArray,ZodObject:ZodObject,ZodUnion:ZodUnion,ZodDiscriminatedUnion:ZodDiscriminatedUnion,ZodIntersection:ZodIntersection,ZodTuple:ZodTuple,ZodRecord:ZodRecord,ZodMap:ZodMap,ZodSet:ZodSet,ZodFunction:ZodFunction,ZodLazy:ZodLazy,ZodLiteral:ZodLiteral,ZodEnum:ZodEnum,ZodNativeEnum:ZodNativeEnum,ZodPromise:ZodPromise,ZodEffects:ZodEffects,ZodTransformer:ZodEffects,ZodOptional:ZodOptional,ZodNullable:ZodNullable,ZodDefault:ZodDefault,ZodCatch:ZodCatch,ZodNaN:ZodNaN,BRAND:BRAND,ZodBranded:ZodBranded,ZodPipeline:ZodPipeline,ZodReadonly:ZodReadonly,custom:custom,Schema:ZodType,ZodSchema:ZodType,late:late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce:coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean:oboolean,onumber:onumber,optional:optionalType,ostring:ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER:NEVER,ZodIssueCode:ZodIssueCode,quotelessJson:quotelessJson,ZodError:ZodError}),ProfileType=(e=>(e[e.PERSONAL=0]="PERSONAL",e[e.AI_AGENT=1]="AI_AGENT",e))(ProfileType||{}),AIAgentType=(e=>(e[e.MANUAL=0]="MANUAL",e[e.AUTONOMOUS=1]="AUTONOMOUS",e))(AIAgentType||{}),EndpointType=(e=>(e[e.REST=0]="REST",e[e.WEBSOCKET=1]="WEBSOCKET",e[e.GRPC=2]="GRPC",e))(EndpointType||{}),AIAgentCapability=(e=>(e[e.TEXT_GENERATION=0]="TEXT_GENERATION",e[e.IMAGE_GENERATION=1]="IMAGE_GENERATION",e[e.AUDIO_GENERATION=2]="AUDIO_GENERATION",e[e.VIDEO_GENERATION=3]="VIDEO_GENERATION",e[e.CODE_GENERATION=4]="CODE_GENERATION",e[e.LANGUAGE_TRANSLATION=5]="LANGUAGE_TRANSLATION",e[e.SUMMARIZATION_EXTRACTION=6]="SUMMARIZATION_EXTRACTION",e[e.KNOWLEDGE_RETRIEVAL=7]="KNOWLEDGE_RETRIEVAL",e[e.DATA_INTEGRATION=8]="DATA_INTEGRATION",e[e.MARKET_INTELLIGENCE=9]="MARKET_INTELLIGENCE",e[e.TRANSACTION_ANALYTICS=10]="TRANSACTION_ANALYTICS",e[e.SMART_CONTRACT_AUDIT=11]="SMART_CONTRACT_AUDIT",e[e.GOVERNANCE_FACILITATION=12]="GOVERNANCE_FACILITATION",e[e.SECURITY_MONITORING=13]="SECURITY_MONITORING",e[e.COMPLIANCE_ANALYSIS=14]="COMPLIANCE_ANALYSIS",e[e.FRAUD_DETECTION=15]="FRAUD_DETECTION",e[e.MULTI_AGENT_COORDINATION=16]="MULTI_AGENT_COORDINATION",e[e.API_INTEGRATION=17]="API_INTEGRATION",e[e.WORKFLOW_AUTOMATION=18]="WORKFLOW_AUTOMATION",e))(AIAgentCapability||{});const SUPPORTED_SOCIAL_PLATFORMS=["twitter","github","discord","telegram","linkedin","youtube"],SocialLinkSchema=z.object({platform:z.string().min(1),handle:z.string().min(1)}),AIAgentDetailsSchema=z.object({type:z.nativeEnum(AIAgentType),capabilities:z.array(z.nativeEnum(AIAgentCapability)).min(1),model:z.string().min(1),creator:z.string().optional()}),BaseProfileSchema=z.object({version:z.string().min(1),type:z.nativeEnum(ProfileType),display_name:z.string().min(1),alias:z.string().optional(),bio:z.string().optional(),socials:z.array(SocialLinkSchema).optional(),profileImage:z.string().optional(),properties:z.record(z.any()).optional(),inboundTopicId:z.string().optional(),outboundTopicId:z.string().optional()}),PersonalProfileSchema=BaseProfileSchema.extend({type:z.literal(0),language:z.string().optional(),timezone:z.string().optional()}),AIAgentProfileSchema=BaseProfileSchema.extend({type:z.literal(1),aiAgent:AIAgentDetailsSchema}),HCS11ProfileSchema=z.union([PersonalProfileSchema,AIAgentProfileSchema]),capabilityNameToCapabilityMap={text_generation:0,image_generation:1,audio_generation:2,video_generation:3,code_generation:4,language_translation:5,summarization:6,extraction:6,knowledge_retrieval:7,data_integration:8,data_visualization:8,market_intelligence:9,transaction_analytics:10,smart_contract_audit:11,governance:12,security_monitoring:13,compliance_analysis:14,fraud_detection:15,multi_agent:16,api_integration:17,workflow_automation:18};class HCS11Client{constructor(e){if(this.client="mainnet"===e.network?i$1.forMainnet():i$1.forTestnet(),this.auth=e.auth,this.network=e.network,this.mirrorNode=new HederaMirrorNode(this.network,this.logger),this.auth.privateKey){const e=y$2.fromString(this.auth.privateKey);this.client.setOperator(this.auth.operatorId,e)}this.logger=Logger$2.getInstance({level:e.logLevel||"info",module:"HCS-11"})}getClient(){return this.client}getOperatorId(){return this.auth.operatorId}createPersonalProfile(e,t){return{version:"1.0",type:0,display_name:e,alias:t?.alias,bio:t?.bio,socials:t?.socials,profileImage:t?.profileImage,language:t?.language,timezone:t?.timezone,properties:t?.properties,inboundTopicId:t?.inboundTopicId,outboundTopicId:t?.outboundTopicId}}createAIAgentProfile(e,t,n,o,r){const i=this.validateProfile({version:"1.0",type:1,display_name:e,alias:r?.alias,bio:r?.bio,socials:r?.socials,profileImage:r?.profileImage,properties:r?.properties,inboundTopicId:r?.inboundTopicId,outboundTopicId:r?.outboundTopicId,aiAgent:{type:t,capabilities:n,model:o,creator:r?.creator}});if(!i.valid)throw new Error(`Invalid AI Agent Profile: ${i.errors.join(", ")}`);return{version:"1.0",type:1,display_name:e,alias:r?.alias,bio:r?.bio,socials:r?.socials,profileImage:r?.profileImage,properties:r?.properties,inboundTopicId:r?.inboundTopicId,outboundTopicId:r?.outboundTopicId,aiAgent:{type:t,capabilities:n,model:o,creator:r?.creator}}}validateProfile(e){const t=HCS11ProfileSchema.safeParse(e);if(t.success)return{valid:!0,errors:[]};return{valid:!1,errors:t.error.errors.map((e=>{const t=e.path.join(".");let n=e.message;if("invalid_type"===e.code)n=`Expected ${e.expected}, got ${e.received}`;else if("invalid_enum_value"===e.code){const t=e.options?.join(", ");n=`Invalid value. Valid options are: ${t}`}else"too_small"===e.code&&"string"===e.type&&(n="Cannot be empty");return`${t}: ${n}`}))}}profileToJSONString(e){return JSON.stringify(e)}parseProfileFromString(e){try{const t=JSON.parse(e),n=this.validateProfile(t);return n.valid?t:(this.logger.error("Invalid profile format:",n.errors),null)}catch(t){return this.logger.error("Error parsing profile:",t),null}}setProfileForAccountMemo(e,t=1){return`hcs-11:hcs://${t}/${e}`}async executeTransaction(e){try{if(this.auth.privateKey){const t=await e.signWithOperator(this.client),n=await t.execute(this.client),o=await n.getReceipt(this.client);return o.status!==e$6.Success?{success:!1,error:`Transaction failed: ${o.status.toString()}`}:{success:!0,result:o}}if(!this.auth.signer)throw new Error("No valid authentication method provided");const t=this.auth.signer,n=await e.freezeWithSigner(t),o=await n.executeWithSigner(t),r=await o.getReceiptWithSigner(t);return r.status!==e$6.Success?{success:!1,error:`Transaction failed: ${r.status.toString()}`}:{success:!0,result:r}}catch(t){return{success:!1,error:t instanceof Error?t.message:"Unknown error during transaction execution"}}}async inscribeImage(e,t,n){try{const o=n?.progressCallback,r=new ProgressReporter({module:"HCS11-Image",logger:this.logger,callback:o});r.preparing("Preparing to inscribe image",0);const i=mimeTypesExports.lookup(t)||"application/octet-stream",a=n?.waitForConfirmation??!0;let s;if(this.auth.signer){if(!("accountId"in this.auth.signer))throw r.failed("Signer must be a DAppSigner for inscription"),new Error("Signer must be a DAppSigner for inscription");r.preparing("Using signer for inscription",10),s=await inscribeWithSigner({type:"buffer",buffer:e,fileName:t,mimeType:i},this.auth.signer,{network:this.network,waitForConfirmation:a,waitMaxAttempts:60,waitIntervalMs:2e3,logging:{level:"debug"},progressCallback:e=>{const t=10+.8*(e.progressPercent||0);r.report({stage:e.stage,message:e.message,progressPercent:t,details:e.details})}})}else{if(!this.auth.privateKey)throw r.failed("Private key is required for inscription"),this.logger.error("Private key is required for inscription"),new Error("Private key is required for inscription");r.preparing("Using private key for inscription",10),s=await inscribe({type:"buffer",buffer:e,fileName:t,mimeType:i},{accountId:this.auth.operatorId,privateKey:this.auth.privateKey,network:this.network},{waitForConfirmation:a,waitMaxAttempts:60,waitIntervalMs:2e3,logging:{level:"debug"},progressCallback:e=>{const t=10+.8*(e.progressPercent||0);r.report({stage:e.stage,message:e.message,progressPercent:t,details:e.details})}})}return s.confirmed?(r.completed("Image inscription completed",{topic_id:s.inscription.topic_id}),{imageTopicId:s.inscription.topic_id||"",transactionId:s.result.jobId,success:!0}):(r.verifying("Waiting for inscription confirmation",50,{jobId:s.result.jobId}),{imageTopicId:"",transactionId:s.result.jobId,success:!1,error:"Inscription not confirmed"})}catch(o){return this.logger.error("Error inscribing image:",o),{imageTopicId:"",transactionId:"",success:!1,error:o.message||"Error inscribing image"}}}async inscribeProfile(e,t){this.logger.info("Inscribing HCS-11 profile");const n=t?.progressCallback,o=new ProgressReporter({module:"HCS11-Profile",logger:this.logger,callback:n});o.preparing("Validating profile data",5);const r=this.validateProfile(e);if(!r.valid)return o.failed(`Invalid profile: ${r.errors.join(", ")}`),{profileTopicId:"",transactionId:"",success:!1,error:`Invalid profile: ${r.errors.join(", ")}`};o.preparing("Formatting profile for inscription",15);const i=this.profileToJSONString(e),a=`profile-${e.display_name.toLowerCase().replace(/\s+/g,"-")}.json`;try{const e=Buffer.from(i,"utf-8"),t="application/json";o.preparing("Preparing profile for inscription",20);const n={type:"buffer",buffer:e,fileName:a,mimeType:t},r={waitForConfirmation:!0,mode:"file",network:this.network,waitMaxAttempts:100,waitIntervalMs:2e3,progressCallback:e=>{const t=20+.75*(e.progressPercent||0);o.report({stage:e.stage,message:e.message,progressPercent:t,details:e.details})}};o.submitting("Submitting profile to Hedera network",30);const s=this.auth.privateKey?await inscribe(n,{accountId:this.auth.operatorId,privateKey:this.auth.privateKey,network:this.network},r):await inscribeWithSigner(n,this.auth.signer,r);if(!s.confirmed||!s.inscription.topic_id)return o.failed("Failed to inscribe profile content"),{profileTopicId:"",transactionId:"",success:!1,error:"Failed to inscribe profile content"};const c=s.inscription.topic_id;return o.completed("Profile inscription completed",{topicId:c,transactionId:s.result.transactionId}),{profileTopicId:c,transactionId:s.result.transactionId,success:!0}}catch(s){return o.failed(`Error inscribing profile: ${s.message||"Unknown error"}`),{profileTopicId:"",transactionId:"",success:!1,error:s.message||"Unknown error during inscription"}}}async updateAccountMemoWithProfile(e,t){try{this.logger.info(`Updating account memo for ${e} with profile ${t}`);const n=this.setProfileForAccountMemo(t),o=(new s$4).setAccountMemo(n).setAccountId(e);return this.executeTransaction(o)}catch(n){return this.logger.error(`Error updating account memo: ${n instanceof Error?n.message:"Unknown error"}`),{success:!1,error:n instanceof Error?n.message:"Unknown error updating account memo"}}}async createAndInscribeProfile(e,t=!0,n){const o=n?.progressCallback,r=new ProgressReporter({module:"HCS11-ProfileCreation",logger:this.logger,callback:o});r.preparing("Starting profile creation process",0);const i=r.createSubProgress({minPercent:0,maxPercent:80,logPrefix:"Inscription"}),a=await this.inscribeProfile(e,{...n,progressCallback:e=>{i.report({stage:e.stage,message:e.message,progressPercent:e.progressPercent,details:e.details})}});if(!a.success)return r.failed("Profile inscription failed",{error:a.error}),a;if(r.confirming("Profile inscribed, updating account memo",85),t){const e=await this.updateAccountMemoWithProfile(this.auth.operatorId,a.profileTopicId);if(!e.success)return r.failed("Failed to update account memo",{error:e.error}),{...a,success:!1,error:e.error}}return r.completed("Profile creation completed successfully",{profileTopicId:a.profileTopicId,transactionId:a.transactionId}),a}async getCapabilitiesFromTags(e){const t=[];if(0===e.length)return[0];for(const n of e){const e=capabilityNameToCapabilityMap[n.toLowerCase()];void 0===e||t.includes(e)||t.push(e)}return 0===t.length&&t.push(0),t}getAgentTypeFromMetadata(e){return"autonomous"===e.type?1:0}async fetchProfileByAccountId(e,t){try{this.logger.info(`Fetching profile for account ${e.toString()} on ${this.network}`);const o=await this.mirrorNode.getAccountMemo(e.toString());if(this.logger.info(`Got account memo: ${o}`),!o?.startsWith("hcs-11:"))return{success:!1,error:`Account ${e.toString()} does not have a valid HCS-11 memo`};this.logger.info(`Found HCS-11 memo: ${o}`);const r=o.substring(7);if(!r?.startsWith("hcs://")){if(r.startsWith("ipfs://")){this.logger.warn("IPFS protocol references are not fully supported");const e=await fetch(`https://ipfs.io/ipfs/${r.replace("ipfs://","")}`),t=await e.json();return{success:!0,profile:t,topicInfo:{inboundTopic:t.inboundTopicId,outboundTopic:t.outboundTopicId,profileTopicId:t.profileTopicId}}}if(r.startsWith("ar://")){const e=r.replace("ar://",""),t=await fetch(`https://arweave.net/${e}`);if(!t.ok)return{success:!1,error:`Failed to fetch profile from Arweave ${e}: ${t.statusText}`};const n=await t.json();return{success:!0,profile:n,topicInfo:{inboundTopic:n.inboundTopicId,outboundTopic:n.outboundTopicId,profileTopicId:n.profileTopicId}}}return{success:!1,error:`Invalid protocol reference format: ${r}`}}{const e=r.match(/hcs:\/\/(\d+)\/(.+)/);if(!e)return{success:!1,error:`Invalid HCS protocol reference format: ${r}`};const[o,i,a]=e,s=t||this.network||"mainnet";this.logger.info(`Retrieving profile from Kiloscribe CDN: ${a}`);const c=`https://kiloscribe.com/api/inscription-cdn/${a}?network=${s}`;try{const e=await fetch(c);if(!e.ok)return{success:!1,error:`Failed to fetch profile from Kiloscribe CDN: ${e.statusText}`};const t=await e.json();return t?{success:!0,profile:t,topicInfo:{inboundTopic:t.inboundTopicId,outboundTopic:t.outboundTopicId,profileTopicId:a}}:{success:!1,error:`No profile data found for topic ${a}`}}catch(n){return this.logger.error(`Error retrieving from Kiloscribe CDN: ${n.message}`),{success:!1,error:`Error retrieving from Kiloscribe CDN: ${n.message}`}}}}catch(o){return this.logger.error(`Error fetching profile: ${o.message}`),{success:!1,error:`Error fetching profile: ${o.message}`}}}}class Registration{async checkRegistrationStatus(e,t,n,o){try{const r=await fetch(`${n}/api/request-confirm`,{method:"POST",headers:{"Content-Type":"application/json","X-Network":t},body:JSON.stringify({transaction_id:e})});if(!r.ok){const e=`Failed to confirm registration: ${r.statusText}`;throw o&&o.error(e),new Error(e)}return await r.json()}catch(r){throw o&&o.error(`Error checking registration status: ${r.message}`),r}}async waitForRegistrationConfirmation(e,t,n,o=60,r=2e3,i){let a=0;for(;a<o;){i&&i.info(`Checking registration status. Attempt ${a+1}/${o}`);const s=await this.checkRegistrationStatus(e,t,n,i);if("success"===s.status)return i&&i.info("Registration confirmed successfully"),!0;if("failed"===s.status)throw i&&i.error("Registration confirmation failed"),new Error("Registration confirmation failed");i&&i.info(`Registration still pending. Waiting ${r}ms before next attempt`),await new Promise((e=>setTimeout(e,r))),a++}return i&&i.warn(`Registration not confirmed after ${o} attempts`),!1}async executeRegistration(e,t="mainnet",n="https://moonscape.tech",o){try{o&&o.info("Registering agent with guarded registry");try{const n=new HCS11Client({network:t,auth:{operatorId:"0.0.0"}});o?.info("Fetching profile by account ID",`${e}-${t}`);const r=await n.fetchProfileByAccountId(e,t);if(o?.info("Profile fetched",r),r.error)return o?.error("Error fetching profile",r.error),{error:r.error,success:!1};if(!r.success||!r.profile)return o&&o.error("Profile not found for agent registration"),{error:"Profile not found for the provided account ID",success:!1};if(!r.profile.inboundTopicId)return o&&o.error("Missing inbound topic ID in profile"),{error:"Profile is missing required inbound topic ID",success:!1};if(!r.profile.outboundTopicId)return o&&o.error("Missing outbound topic ID in profile"),{error:"Profile is missing required outbound topic ID",success:!1};o&&o.info(`Profile validation successful. Inbound topic: ${r.profile.inboundTopicId}, Outbound topic: ${r.profile.outboundTopicId}`)}catch(r){return o&&o.error(`Error validating profile: ${r.message}`),{error:`Error validating profile: ${r.message}`,success:!1}}const i=await fetch(`${n}/api/request-register`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"*/*","Accept-Language":"en;q=0.5",Origin:n,Referer:`${n}/`,"X-Network":t},body:JSON.stringify({accountId:e})}),a=await i.json();return i.ok?(o&&o.info(`Created new registration request. Transaction ID: ${a.transaction_id}`),{transactionId:a.transaction_id,transaction:a.transaction,success:!0}):a.details?.length>0?{validationErrors:a.details,error:a.error||"Validation failed",success:!1}:{error:a.error||"Failed to register agent",success:!1}}catch(i){return{error:`Error during registration request: ${i.message}`,success:!1}}}async findRegistrations(e={},t="https://moonscape.tech"){try{const n=new URLSearchParams;e.tags?.forEach((e=>n.append("tags",e))),e.accountId&&n.append("accountId",e.accountId),e.network&&n.append("network",e.network);const o=await fetch(`${t}/api/registrations?${n}`,{headers:{Accept:"*/*","Accept-Language":"en;q=0.5",Origin:t,Referer:`${t}/`}});if(!o.ok){return{registrations:[],error:await o.text()||"Failed to fetch registrations",success:!1}}const r=await o.json();return r.error?{registrations:[],error:r.error,success:!1}:{registrations:r.registrations||[],success:!0}}catch(e2){return{registrations:[],error:`Error fetching registrations: ${e2.message}`,success:!1}}}}class HCS10BaseClient extends Registration{constructor(e){super(),this.network=e.network,this.logger=Logger$2.getInstance({level:e.logLevel||"info",module:"HCS10-BaseClient"}),this.mirrorNode=new HederaMirrorNode(e.network,this.logger)}async getMessages(e){try{return{messages:await this.mirrorNode.getTopicMessages(e)}}catch(t){return this.logger&&this.logger.error(`Error fetching messages: ${t.message}`),{messages:[]}}}async checkRegistrationStatus(e,t,n){try{const o=await fetch(`${n}/api/request-confirm`,{method:"POST",headers:{"Content-Type":"application/json","X-Network":t},body:JSON.stringify({transaction_id:e})});if(!o.ok)throw new Error(`Failed to confirm registration: ${o.statusText}`);return await o.json()}catch(o){throw this.logger.error(`Error checking registration status: ${o}`),o}}async requestAccount(e){try{return await this.mirrorNode.requestAccount(e)}catch(e2){throw this.logger.error("Failed to fetch account",e2),e2}}async getAccountMemo(e){return await this.mirrorNode.getAccountMemo(e)}async retrieveProfile(e){this.logger.info(`Retrieving profile for account: ${e}`);try{const t=new HCS11Client({network:this.network,auth:{operatorId:"0.0.0"},logLevel:"info"}),n=await t.fetchProfileByAccountId(e,this.network);if(!n?.success)return this.logger.error(`Failed to retrieve profile for account ID: ${e}`,n?.error),{profile:null,success:!1,error:n?.error||`Failed to retrieve profile for account ID: ${e}`};const o=n.profile;let r=null;if(n.topicInfo?.inboundTopicId&&n.topicInfo?.outboundTopicId&&n.topicInfo?.profileTopicId){r={inboundTopic:n.topicInfo.inboundTopicId,outboundTopic:n.topicInfo.outboundTopicId,profileTopicId:n.topicInfo.profileTopicId};const t=`${e}-${this.network}`;HCS10Cache.getInstance().set(t,r)}return{profile:o,topicInfo:r,success:!0}}catch(t){return this.logger.error("Failed to retrieve profile:",t),{profile:null,success:!1,error:t instanceof Error?t.message:String(t)}}}async retrieveOutboundConnectTopic(e){this.logger.info(`Retrieving topics for account: ${e}`);try{const t=await this.retrieveProfile(e);if(!t?.success)throw new Error(t.error||"Failed to retrieve profile");const n=t.profile;if(!n.inboundTopicId||!n.outboundTopicId)throw new Error("Invalid HCS-11 profile for HCS-10 agent: missing inboundTopicId or outboundTopicId");const o={inboundTopic:n.inboundTopicId,outboundTopic:n.outboundTopicId,profileTopicId:n.profileTopicId},r=`${e}-${this.network}`;return HCS10Cache.getInstance().set(r,o),o}catch(t){throw this.logger.error("Failed to retrieve topic info:",t),t}}async retrieveOutboundMessages(e){try{const t=await this.retrieveOutboundConnectTopic(e);if(!t)return this.logger.warn(`No outbound connect topic found for agentAccountId: ${e}`),[];return(await this.getMessages(t.outboundTopic)).messages.filter((e=>"hcs-10"===e.p&&("connection_request"===e.op||"connection_created"===e.op||"message"===e.op)))}catch(t){return this.logger.error("Failed to retrieve outbound messages:",t),[]}}async hasConnectionCreated(e,t){try{const n=await this.retrieveOutboundConnectTopic(e);return(await this.retrieveOutboundMessages(n.outboundTopic)).some((e=>"connection_created"===e.op&&e.connection_id===t))}catch(n){return this.logger.error("Failed to check connection created:",n),!1}}clearCache(){HCS10Cache.getInstance().clear()}async getMessageContent(e){const t=e.match(/^hcs:\/\/(\d+)\/([0-9.]+)$/);if(!t)return e;const[n,o,r]=t;this.logger.info(`Resolving HRL reference: standard=${o}, topicId=${r}`);try{const e=`https://kiloscribe.com/api/inscription-cdn/${r}?network=${this.network}`,t=await axios.get(e);if(!t.data)throw new Error(`Failed to fetch content from topic: ${r}`);return t.data.content||t.data.text||JSON.stringify(t.data)}catch(i){throw this.logger.error(`Error resolving HRL reference: ${i instanceof Error?i.message:"Unknown error"}`),new Error(`Failed to resolve HRL reference: ${i instanceof Error?i.message:"Unknown error"}`)}}}class HCS10Cache{constructor(){this.CACHE_TTL=36e5,this.cache=new Map,this.cacheExpiry=new Map}static getInstance(){return HCS10Cache.instance||(HCS10Cache.instance=new HCS10Cache),HCS10Cache.instance}set(e,t){this.cache.set(e,t),this.cacheExpiry.set(e,Date.now()+this.CACHE_TTL)}get(e){const t=this.cacheExpiry.get(e);if(t&&t>Date.now())return this.cache.get(e);t&&(this.cache.delete(e),this.cacheExpiry.delete(e))}clear(){this.cache.clear(),this.cacheExpiry.clear()}}var InboundTopicType=(e=>(e.PUBLIC="PUBLIC",e.CONTROLLED="CONTROLLED",e.FEE_BASED="FEE_BASED",e))(InboundTopicType||{});async function accountIdsToExemptKeys(e,t,n){const o=new HederaMirrorNode(t,n),r=[];for(const a of e)try{const e=await o.getPublicKey(a);r.push(e)}catch(i){n&&n.warn(`Could not get public key for account ${a}: ${i}`)}return r}class FeeConfigBuilder{constructor(){this.feeAmount=0,this.decimals=0,this.feeCollectorAccountId="",this.exemptAccountIds=[]}static forHbar(e,t,n=[]){return(new FeeConfigBuilder).setHbarAmount(e).setFeeCollector(t).addExemptAccounts(n)}setHbarAmount(e){if(e<=0)throw new Error("HBAR amount must be greater than zero");return this.feeAmount=1e8*e,this.decimals=0,this}setFeeAmount(e,t=0){return this.feeAmount=e,this.decimals=t,this}setFeeCollector(e){return this.feeCollectorAccountId=e,this}addExemptAccount(e){return this.exemptAccountIds.includes(e)||this.exemptAccountIds.push(e),this}addExemptAccounts(e){for(const t of e)this.addExemptAccount(t);return this}build(){if(!this.feeCollectorAccountId)throw new Error("Fee collector account ID is required");if(this.feeAmount<=0)throw new Error("Fee amount must be greater than zero");return{feeAmount:{amount:this.feeAmount,decimals:this.decimals},feeCollectorAccountId:this.feeCollectorAccountId,exemptAccounts:this.exemptAccountIds}}}class HCS10Client extends HCS10BaseClient{constructor(e){super({network:e.network,logLevel:e.logLevel}),this.client="mainnet"===e.network?i$1.forMainnet():i$1.forTestnet(),this.operatorPrivateKey=y$2.fromString(e.operatorPrivateKey),this.network=e.network,this.client.setOperator(e.operatorId,this.operatorPrivateKey.toString()),this.logger=Logger$2.getInstance({level:e.logLevel||"info",module:"HCS-SDK"}),this.guardedRegistryBaseUrl=e.guardedRegistryBaseUrl||"https://moonscape.tech",this.feeAmount=e.feeAmount||5,this.hcs11Client=new HCS11Client({network:e.network,auth:{operatorId:e.operatorId,privateKey:e.operatorPrivateKey},logLevel:e.logLevel})}getClient(){return this.client}async createAccount(){this.logger.info("Creating new account");const e=y$2.generate(),t=(new l).setKey(e.publicKey).setInitialBalance(new e$7(10));this.logger.debug("Executing account creation transaction");const n=await t.execute(this.client),o=(await n.getReceipt(this.client)).accountId;if(!o)throw this.logger.error("Account creation failed: accountId is null"),new AccountCreationError("Failed to create account: accountId is null");return this.logger.info(`Account created successfully: ${o.toString()}`),{accountId:o.toString(),privateKey:e.toString()}}async createInboundTopic(e,t,n){this.logger.info(`Creating ${t} inbound topic`);const o=`hcs-10:0:60:0:${e}`;switch(t){case InboundTopicType.PUBLIC:return this.createTopic(o,!0,!1);case InboundTopicType.CONTROLLED:return this.createTopic(o,!0,!0);case InboundTopicType.FEE_BASED:if(!n)throw new Error("Fee configuration is required for fee-based topics");return this.createTopic(o,!0,!0,n.build());default:throw new Error(`Unsupported inbound topic type: ${t}`)}}async createAgent(e){const t=e.build(),n=await this.createTopic("hcs-10:0:60:1",!0,!0);this.logger.info(`Created new outbound topic ID: ${n}`);const o=this.client.operatorAccountId?.toString();if(!o)throw new Error("Failed to retrieve operator account ID");const r=await this.createInboundTopic(o,t.inboundTopicType,t.inboundTopicType===InboundTopicType.FEE_BASED?t.feeConfig:void 0);this.logger.info(`Created new inbound topic ID: ${r}`);let i=t.existingPfpTopicId||"";if(!i&&t.pfpBuffer&&t.pfpBuffer.length>0){this.logger.info("Inscribing new profile picture");i=(await this.inscribePfp(t.pfpBuffer,t.pfpFileName)).pfpTopicId,this.logger.info(`Profile picture inscribed with topic ID: ${i}`)}else t.existingPfpTopicId&&this.logger.info(`Using existing profile picture with topic ID: ${t.existingPfpTopicId}`);const a=(await this.storeHCS11Profile(t.name,t.description,r,n,t.capabilities,t.metadata,t.pfpBuffer&&t.pfpBuffer.length>0?t.pfpBuffer:void 0,t.pfpFileName,t.existingPfpTopicId)).profileTopicId;return this.logger.info(`Profile stored with topic ID: ${a}`),{outboundTopicId:n,inboundTopicId:r,pfpTopicId:i,profileTopicId:a}}async inscribePfp(e,t){try{this.logger.info("Inscribing profile picture using HCS-11 client");const n=await this.hcs11Client.inscribeImage(e,t);if(!n.success)throw this.logger.error(`Failed to inscribe profile picture: ${n.error}`),new Error(n.error||"Failed to inscribe profile picture");return this.logger.info(`Successfully inscribed profile picture with topic ID: ${n.imageTopicId}`),{pfpTopicId:n.imageTopicId,transactionId:n.transactionId,success:!0}}catch(n){return this.logger.error(`Error inscribing profile picture: ${n.message}`),{pfpTopicId:"",transactionId:"",success:!1,error:n.message}}}async storeHCS11Profile(e,t,n,o,r=[],i,a,s,c){try{let l=c||"";if(!l&&a&&s){this.logger.info("Inscribing profile picture for HCS-11 profile");const e=await this.inscribePfp(a,s);e.success?l=e.pfpTopicId:this.logger.error("Failed to inscribe profile picture, continuing without PFP")}else c&&this.logger.info(`Using existing profile picture with topic ID: ${c} for HCS-11 profile`);const u=this.hcs11Client.getAgentTypeFromMetadata({type:i.type||"autonomous"}),d=i.socials?Object.entries(i.socials).filter((([e,t])=>t)).map((([e,t])=>({platform:"x"===e?"twitter":e,handle:t}))):void 0,p=this.hcs11Client.createAIAgentProfile(e,u,r,i.model||"unknown",{alias:e.toLowerCase().replace(/\s+/g,"_"),bio:t,profileImage:l?`hcs://1/${l}`:void 0,socials:d,properties:i.properties,inboundTopicId:n,outboundTopicId:o,creator:i.creator}),f=await this.hcs11Client.createAndInscribeProfile(p,!0);if(!f.success)throw this.logger.error(`Failed to inscribe profile: ${f.error}`),new Error(f.error||"Failed to inscribe profile");return this.logger.info(`Profile inscribed with topic ID: ${f.profileTopicId}, transaction ID: ${f.transactionId}`),{profileTopicId:f.profileTopicId,pfpTopicId:l,transactionId:f.transactionId,success:!0}}catch(l){return this.logger.error(`Error storing HCS-11 profile: ${l.message}`),{profileTopicId:"",pfpTopicId:"",transactionId:"",success:!1,error:l.message}}}async setupFees(e,t,n=[]){if(!this.client.operatorPublicKey)return;this.logger.info("Setting up topic with custom fees");const o=(new l$1).setAmount(Number(t.feeAmount.amount)).setFeeCollectorAccountId(f.fromString(t.feeCollectorAccountId));let r=[...t.exemptAccounts||[],...n];if(console.log("exemptAccountIds",r),r.length>0){const t=Array.from(new Set(r)).filter((e=>e!==this.client.operatorAccountId?.toString()));let n=[];if(t.length>0)try{n=await accountIdsToExemptKeys(t,this.network,this.logger)}catch(i){this.logger.warn(`Error getting exempt keys: ${i}, continuing without exempt keys`)}n.length>0&&e.setFeeExemptKeys(n)}e.setFeeScheduleKey(this.client.operatorPublicKey).setCustomFees([o])}async handleConnectionRequest(e,t,n,o){const r=`hcs-10:${e}:${n}`;this.logger.info(`Handling connection request ${n} from ${t}`);const i=this.getClient().operatorAccountId?.toString();if(!i)throw new Error("Failed to retrieve operator account ID");let a=await this.mirrorNode.getPublicKey(t);const s=await this.mirrorNode.getPublicKey(i);if(!s)throw new Error("Failed to retrieve public key");const c=new s$7([s,a],1);let l;try{if(o){const e=o.build(),t={...e,exemptAccounts:[...e.exemptAccounts||[]]};l=await this.createTopic(r,c,c,t)}else l=await this.createTopic(r,c,c);this.logger.info(`Created new connection topic ID: ${l}`)}catch(d){throw this.logger.error(`Failed to create connection topic: ${d}`),new TopicCreationError(`Failed to create connection topic: ${d}`)}const u=`${e}@${i}`;return{connectionTopicId:l,confirmedConnectionSequenceNumber:await this.confirmConnection(e,l,t,n,u,"Connection accepted. Looking forward to collaborating!"),operatorId:u}}async confirmConnection(e,t,n,o,r,i,a){this.logger.info(`Confirming connection with ID ${o}`);const s={p:"hcs-10",op:"connection_created",connection_topic_id:t,connected_account_id:n,operator_id:r,connection_id:o,m:i},c=await this.submitPayload(e,s,a),l=c.topicSequenceNumber?.toNumber();if(!l)throw new ConnectionConfirmationError("Failed to confirm connection: sequence number is null");return l}async sendMessage(e,t,n,o,r){const i=await this.canSubmitToInboundTopic(e,this.client.operatorAccountId?.toString()||""),a={p:"hcs-10",op:"message",operator_id:t,data:n,m:o},s=JSON.stringify(a);if(Buffer.from(s).length>1e3){this.logger.info("Message payload exceeds 1000 bytes, storing via inscription");try{const e=Buffer.from(n),t=`message-${Date.now()}.json`,o=await this.inscribeFile(e,t);if(!o?.topic_id)throw new Error("Failed to inscribe large message content");a.data=`hcs://1/${o.topic_id}`,this.logger.info(`Large message inscribed with topic ID: ${o.topic_id}`)}catch(c){throw this.logger.error("Error inscribing large message:",c),new Error(`Failed to handle large message: ${c instanceof Error?c.message:"Unknown error"}`)}}this.logger.info("Submitting message to connection topic",a),await this.submitPayload(e,a,r,i.requiresFee)}async createTopic(e,t,n,o){this.logger.info("Creating topic");const r=(new m$1).setTopicMemo(e);t&&("boolean"==typeof t&&t&&this.client.operatorPublicKey?(r.setAdminKey(this.client.operatorPublicKey),r.setAutoRenewAccountId(this.client.operatorAccountId)):(t instanceof i$7||t instanceof s$7)&&(r.setAdminKey(t),this.client.operatorAccountId&&r.setAutoRenewAccountId(this.client.operatorAccountId))),n&&("boolean"==typeof n&&n&&this.client.operatorPublicKey?r.setSubmitKey(this.client.operatorPublicKey):(n instanceof i$7||n instanceof s$7)&&r.setSubmitKey(n)),o&&await this.setupFees(r,o),this.logger.debug("Executing topic creation transaction");const i=await r.execute(this.client),a=await i.getReceipt(this.client);if(!a.topicId)throw this.logger.error("Failed to create topic: topicId is null"),new Error("Failed to create topic: topicId is null");return a.topicId.toString()}async submitMessage(e,t,n){const o=await this.canSubmitToInboundTopic(e,this.client.operatorAccountId?.toString()||"");return this.submitPayload(e,t,n,o.requiresFee)}async submitPayload(e,t,n,o=!1){const r="string"==typeof t?t:JSON.stringify(t),i=Buffer.byteLength(r,"utf8");if(i>1e3)throw new PayloadSizeError("Payload size exceeds 1000 bytes limit",i);const a=(new u).setTopicId(m$2.fromString(e)).setMessage(r);let s;if(o&&(this.logger.info("Topic requires fee payment, setting max transaction fee"),a.setMaxTransactionFee(new e$7(this.feeAmount)),a.setTransactionMemo("HIP-991 Fee Payment")),n){a.freezeWith(this.client);const e=await a.sign(n);s=await e.execute(this.client)}else s=await a.execute(this.client);const c=await s.getReceipt(this.client);if(!c)throw this.logger.error("Failed to submit message: receipt is null"),new Error("Failed to submit message: receipt is null");return this.logger.info("Message submitted successfully"),c}async submitConnectionRequest(e,t,n,o){const r=await this.canSubmitToInboundTopic(e,t);if(!r.canSubmit)throw new Error(`Cannot submit to topic: ${r.reason}`);const i={p:"hcs-10",op:"connection_request",operator_id:n,memo:o},a=r.requiresFee,s=await this.submitPayload(e,i,void 0,a);this.logger.info(`Submitted connection request to topic ID: ${e}`);const c=await this.retrieveOutboundConnectTopic(t),l=s.topicSequenceNumber?.toNumber();if(!l)throw new Error("Failed to get response sequence number");return await this.submitPayload(c.outboundTopic,{...i,outbound_topic_id:c.outboundTopic,connection_request_id:l},this.operatorPrivateKey),s}async recordOutboundConnectionConfirmation({outboundTopicId:e,connectionRequestId:t,confirmedRequestId:n,connectionTopicId:o,operatorId:r,memo:i}){const a={p:"hcs-10",op:"connection_created",connection_topic_id:o,outbound_topic_id:e,confirmed_request_id:n,connection_request_id:t,operator_id:r,m:i};return await this.submitPayload(e,a)}async inscribeFile(e,t){if(this.logger.info("Inscribing file"),!this.client.operatorAccountId)throw this.logger.error("Operator account ID is not set"),new Error("Operator account ID is not set");if(!this.operatorPrivateKey)throw this.logger.error("Operator private key is not set"),new Error("Operator private key is not set");const n=mimeTypesExports.lookup(t)||"application/octet-stream",o=await InscriptionSDK.createWithAuth({type:"server",accountId:this.client.operatorAccountId.toString(),privateKey:this.operatorPrivateKey.toString(),network:this.network}),r=await o.inscribeAndExecute({file:{type:"base64",base64:e.toString("base64"),fileName:t,mimeType:n},holderId:this.client.operatorAccountId.toString(),mode:"file",network:this.network},{accountId:this.client.operatorAccountId.toString(),privateKey:this.operatorPrivateKey.toString(),network:this.network});if(!r.transactionId||!r.jobId)throw this.logger.error("Failed to inscribe, no transaction ID or job ID."),new Error("Failed to inscribe, no transaction ID or job ID.");r.transactionId&&r.jobId&&this.logger.info(`Transaction ID: ${r.transactionId}, Job ID: ${r.jobId}`);return await o.waitForInscription(r.jobId,30,4e3,!0)}async waitForConnectionConfirmation(e,t,n=60,o=2e3){this.logger.info(`Waiting for connection confirmation on inbound topic ${e} for request ID ${t}`);for(let r=0;r<n;r++){this.logger.info(`Attempt ${r+1}/${n} to find connection confirmation`);const i=(await this.mirrorNode.getTopicMessages(e)).filter((e=>"connection_created"===e.op));if(this.logger.info(`Found ${i.length} connection_created messages`),i.length>0)for(const e of i)if(Number(e.connection_id)===Number(t))return this.logger.info("Connection confirmation found"),{connectionTopicId:e.connection_topic_id,sequence_number:Number(e.sequence_number),confirmedBy:e.operator_id,memo:e.m};r<n-1&&(this.logger.info(`No matching confirmation found, waiting ${o}ms before retrying...`),await new Promise((e=>setTimeout(e,o))))}throw new Error(`Connection confirmation not found after ${n} attempts for request ID ${t}`)}getAccountAndSigner(){return{accountId:this.client.operatorAccountId.toString(),signer:this.operatorPrivateKey}}async canSubmitToInboundTopic(e,t){try{const o=await this.mirrorNode.getTopicInfo(e);if(!o)return{canSubmit:!1,requiresFee:!1,reason:"Topic does not exist"};if(!o.submit_key?.key)return{canSubmit:!0,requiresFee:!1};try{const e=await this.mirrorNode.getPublicKey(t);if("ProtobufEncoded"===o.submit_key._type){const t=Buffer.from(o.submit_key.key,"hex");if(await this.mirrorNode.checkKeyListAccess(t,e))return{canSubmit:!0,requiresFee:!1}}else{const t=i$7.fromString(o.submit_key.key);if(e.toString()===t.toString())return{canSubmit:!0,requiresFee:!1}}}catch(n){this.logger.error(`Key validation error: ${n instanceof Error?n.message:String(n)}`)}return o.fee_schedule_key?.key&&o.custom_fees?.fixed_fees?.length>0?{canSubmit:!0,requiresFee:!0,reason:"Requires fee payment via HIP-991"}:{canSubmit:!1,requiresFee:!1,reason:"User does not have submit permission for this topic"}}catch(n){const e=n instanceof Error?n.message:String(n);return this.logger.error(`Topic submission validation error: ${e}`),{canSubmit:!1,requiresFee:!1,reason:`Error: ${e}`}}}async createAndRegisterAgent(e,t){try{const n=e.build(),o=t?.progressCallback,r=t?.baseUrl||this.guardedRegistryBaseUrl;let i=t?.existingState||void 0;o&&o({stage:"preparing",message:"Preparing agent registration",progressPercent:10,details:{state:i}});const a=n.existingAccount||await this.createAccount();o&&o({stage:"preparing",message:"Created account or using existing account",progressPercent:20,details:{state:i,account:a}});const s=new HCS10Client({network:n.network,operatorId:a.accountId,operatorPrivateKey:a.privateKey,operatorPublicKey:y$2.fromString(a.privateKey).publicKey.toString(),logLevel:"info",guardedRegistryBaseUrl:r});o&&o({stage:"preparing",message:"Initialized agent client",progressPercent:30,details:{state:i}});const{outboundTopicId:c,inboundTopicId:l,pfpTopicId:u,profileTopicId:d}=await s.createAgent(e);o&&o({stage:"submitting",message:"Created agent with topics and profile",progressPercent:60,details:{state:i,outboundTopicId:c,inboundTopicId:l,pfpTopicId:u,profileTopicId:d}});const p=`${l}@${a.accountId}`,f=await s.registerAgentWithGuardedRegistry(a.accountId,n.network,{progressCallback:e=>{const t=60+.4*(e.progressPercent||0);o&&o({stage:e.stage,message:e.message,progressPercent:t,details:{...e.details,outboundTopicId:c,inboundTopicId:l,pfpTopicId:u,profileTopicId:d,operatorId:p,state:e.details?.state||i}})},existingState:i});return f.success?(o&&o({stage:"completed",message:"Agent creation and registration complete",progressPercent:100,details:{outboundTopicId:c,inboundTopicId:l,pfpTopicId:u,profileTopicId:d,operatorId:p,state:f.state}}),{...f,metadata:{accountId:a.accountId,privateKey:a.privateKey,operatorId:p,inboundTopicId:l,outboundTopicId:c,profileTopicId:d,pfpTopicId:u}}):f}catch(n){return this.logger.error(`Failed to create and register agent: ${n.message}`),{error:n.message,success:!1}}}async registerAgentWithGuardedRegistry(e,t=this.network,n){try{this.logger.info("Registering agent with guarded registry");const o=n?.maxAttempts??60,r=n?.delayMs??2e3,i=n?.progressCallback;let a=n?.existingState||{currentStage:"registration",completedPercentage:0,createdResources:[]};i&&i({stage:"preparing",message:"Preparing agent registration",progressPercent:10,details:{state:a}});const s=await this.executeRegistration(e,t,this.guardedRegistryBaseUrl,this.logger);if(!s.success)return{...s,state:a};if(i&&i({stage:"submitting",message:"Submitting registration to registry",progressPercent:30,details:{transactionId:s.transactionId,state:a}}),s.transaction){const e=S.fromBytes(Buffer.from(s.transaction,"base64"));this.logger.info("Processing registration transaction"),await e.execute(this.client),this.logger.info("Successfully processed registration transaction")}i&&i({stage:"confirming",message:"Confirming registration transaction",progressPercent:60,details:{accountId:e,transactionId:s.transactionId,state:a}});const c=await this.waitForRegistrationConfirmation(s.transactionId,t,this.guardedRegistryBaseUrl,o,r,this.logger);return a.currentStage="complete",a.completedPercentage=100,a.createdResources||(a.createdResources=[]),s.transactionId&&a.createdResources.push(`registration:${s.transactionId}`),i&&i({stage:"completed",message:"Agent registration complete",progressPercent:100,details:{confirmed:c,transactionId:s.transactionId,state:a}}),{...s,confirmed:c,state:a}}catch(o){return this.logger.error(`Failed to register agent: ${o.message}`),{error:o.message,success:!1}}}async registerAgent(e,t,n,o,r){this.logger.info("Registering agent");const i={p:"hcs-10",op:"register",account_id:t,inbound_topic_id:n,m:o};await this.submitPayload(e,i,r)}async getInboundTopicType(e){try{const t=await this.mirrorNode.getTopicInfo(e);if(!t)throw new Error("Topic does not exist");if(!(t.submit_key&&t.submit_key.key))return InboundTopicType.PUBLIC;if(t.fee_schedule_key&&t.fee_schedule_key.key&&t.custom_fees){const n=t.custom_fees;if(n&&n.fixed_fees&&n.fixed_fees.length>0)return this.logger.info(`Topic ${e} is fee-based with ${n.fixed_fees.length} custom fees`),InboundTopicType.FEE_BASED}return InboundTopicType.CONTROLLED}catch(t){throw this.logger.error(`Error determining topic type: ${t.message}`),new Error(`Failed to determine topic type: ${t.message}`)}}getNetwork(){return this.network}getLogger(){return this.logger}}class AgentBuilder{constructor(){this.config={}}setName(e){return this.config.name=e,this}setDescription(e){return this.config.description=e,this}setCapabilities(e){return this.config.capabilities=e,this}setAgentType(e){return this.config.metadata?this.config.metadata.type=e:this.config.metadata={type:e},this}setModel(e){return this.config.metadata?this.config.metadata.model=e:this.config.metadata={type:"autonomous",model:e},this}setCreator(e){return this.config.metadata?this.config.metadata.creator=e:this.config.metadata={type:"autonomous",creator:e},this}addSocial(e,t){return this.config.metadata?this.config.metadata.socials||(this.config.metadata.socials={}):this.config.metadata={type:"autonomous",socials:{}},this.config.metadata.socials[e]=t,this}addProperty(e,t){return this.config.metadata?this.config.metadata.properties||(this.config.metadata.properties={}):this.config.metadata={type:"autonomous",properties:{}},this.config.metadata.properties[e]=t,this}setMetadata(e){return this.config.metadata=e,this}setProfilePicture(e,t){return this.config.pfpBuffer=e,this.config.pfpFileName=t,this}setExistingProfilePicture(e){return this.config.existingPfpTopicId=e,this}setNetwork(e){return this.config.network=e,this}setInboundTopicType(e){return this.config.inboundTopicType=e,this}setFeeConfig(e){return this.config.feeConfig=e,this}setConnectionFeeConfig(e){return this.config.connectionFeeConfig=e,this}setExistingAccount(e,t){return this.config.existingAccount={accountId:e,privateKey:t},this}build(){if(!this.config.name)throw new Error("Agent name is required");if(!this.config.description)throw new Error("Agent description is required");if(!this.config.pfpBuffer||!this.config.pfpFileName)throw new Error("Profile picture is required");if(!this.config.network)throw new Error("Network is required");if(this.config.inboundTopicType||(this.config.inboundTopicType=InboundTopicType.PUBLIC),this.config.capabilities||(this.config.capabilities=[]),this.config.metadata||(this.config.metadata={type:"autonomous"}),this.config.inboundTopicType===InboundTopicType.FEE_BASED&&!this.config.feeConfig)throw new Error("Fee configuration is required for fee-based topics");return this.config}}const isBrowser="undefined"!=typeof window;class BrowserHCSClient extends HCS10BaseClient{constructor(e){if(super({network:e.network,logLevel:e.logLevel}),this.hcs11Client=null,this.hwc=e.hwc,this.guardedRegistryBaseUrl=e.guardedRegistryBaseUrl||"https://moonscape.tech",this.logger=Logger$2.getInstance({level:e.logLevel||"info",module:"HCS-Browser"}),isBrowser)try{const{accountId:t,signer:n}=this.getAccountAndSigner();this.hcs11Client=new HCS11Client({network:e.network,auth:{operatorId:t,signer:n},logLevel:e.logLevel})}catch(t){this.logger.warn(`Failed to initialize HCS11Client: ${t}`)}else this.logger.error("BrowserHCSClient initialized in server environment - browser-specific features will not be available. Use HCS10Client instead.")}async sendMessage(e,t,n,o){this.logger.info("Sending message");const r={p:"hcs-10",op:"message",operator_id:t,data:n,m:o},i=JSON.stringify(r);if(Buffer.from(i).length>1e3){this.logger.info("Message payload exceeds 1000 bytes, storing via inscription");try{const e=Buffer.from(n),t=`message-${Date.now()}.json`,o=await this.inscribeFile(e,t);if(!o?.topic_id)throw new Error("Failed to inscribe large message content");r.data=`hcs://1/${o.topic_id}`,this.logger.info(`Large message inscribed with topic ID: ${o.topic_id}`)}catch(a){throw this.logger.error("Error inscribing large message:",a),new Error(`Failed to handle large message: ${a instanceof Error?a.message:"Unknown error"}`)}}await this.submitPayload(e,r)}async submitConnectionRequest(e,t,n,o){this.logger.info("Submitting connection request");const r={p:"hcs-10",op:"connection_request",requesting_account_id:t,operator_id:n,m:o},i=await this.submitPayload(e,r);this.logger.info(`Submitted connection request to topic ID: ${e}`);const a=await this.retrieveOutboundConnectTopic(t);if(!a?.outboundTopic)throw this.logger.error(`Failed to retrieve outbound topic for account ID: ${t}`),new Error(`Failed to retrieve outbound topic for account ID: ${t}`);this.logger.info(`Retrieved outbound topic ID: ${a.outboundTopic} for account ID: ${t}`);const s=i?.result?.topicSequenceNumber?.toNumber();if(!s)throw new Error("Failed to get response sequence number");return await this.submitPayload(a.outboundTopic,{...r,outbound_topic_id:e,connection_request_id:s}),i.result}async recordOutboundConnectionConfirmation({outboundTopicId:e,connectionRequestId:t,confirmedRequestId:n,connectionTopicId:o,operatorId:r,memo:i}){const a={p:"hcs-10",op:"connection_created",connection_topic_id:o,outbound_topic_id:e,confirmed_request_id:n,connection_request_id:t,operator_id:r,m:i};return await this.submitPayload(e,a)}async getPublicKey(e){return await this.mirrorNode.getPublicKey(e)}async handleConnectionRequest(e,t,n,o="Connection accepted. Looking forward to collaborating!"){this.logger.info("Handling connection request");const r=this.hwc.getAccountInfo().accountId;if(!r)throw new Error("Failed to retrieve user account ID");const i=await this.mirrorNode.getPublicKey(t),a=await this.mirrorNode.getPublicKey(r);if(!a)throw new Error("Failed to retrieve public key");const s=new s$7([a,i],1),c=`hcs-10:${e}:${n}`,l=(new m$1).setTopicMemo(c).setAdminKey(s).setSubmitKey(s);this.logger.debug("Executing topic creation transaction");const u=await this.hwc.executeTransactionWithErrorHandling(l,!1);if(u.error)throw this.logger.error(u.error),new Error(u.error);const d=u.result;if(!d?.topicId)throw this.logger.error("Failed to create topic: topicId is null"),new Error("Failed to create topic: topicId is null");const p=d.topicId.toString(),f=`${e}@${r}`;return{connectionTopicId:p,confirmedConnectionSequenceNumber:await this.confirmConnection(e,p,t,n,f,o),operatorId:f}}async confirmConnection(e,t,n,o,r,i){this.logger.info("Confirming connection");const a={p:"hcs-10",op:"connection_created",connection_topic_id:t,connected_account_id:n,operator_id:r,connection_id:o,m:i},s=await this.submitPayload(e,a);if(!s?.result?.topicSequenceNumber)throw this.logger.error("Failed to confirm connection: sequence number is null"),new Error("Failed to confirm connection: sequence number is null");return s.result.topicSequenceNumber.toNumber()}async submitMessage(e,t,n={},o=""){this.logger.info("Submitting message");const r={p:"hcs-10",op:"message",data:{content:t,metadata:n},m:o};return await this.submitPayload(e,r)}async createAgent(e,t,n,o,r,i,a,s){try{const c=s?.progressCallback,l=new ProgressReporter({module:"AgentCreate",logger:this.logger,callback:c});let u=s?.existingState||{currentStage:"init",completedPercentage:0,createdResources:[]};if(u.outboundTopicId)l.preparing("Using existing outbound topic",20,{state:u});else{u.currentStage="topics",l.preparing("Creating agent outbound topic",0,{state:u});const e=await this.createTopic("hcs-10:0:60:1",!0,!0);if(!e.success||!e.topicId)return u.error=e.error||"Failed to create outbound topic",l.failed(`Failed to create outbound topic: ${u.error}`,{state:u}),{outboundTopicId:"",inboundTopicId:"",pfpTopicId:"",profileTopicId:"",success:!1,error:u.error,state:u};u.outboundTopicId=e.topicId,u.createdResources&&u.createdResources.push(`outbound:${u.outboundTopicId}`),l.preparing("Outbound topic created",20,{state:u})}const d=this.hwc.getAccountInfo().accountId;if(!d)throw new Error("Failed to retrieve user account ID");if(u.inboundTopicId)l.preparing("Using existing inbound topic",40,{state:u});else{const e=`hcs-10:0:60:0:${d}`,t=await this.createTopic(e,!0,!0);if(!t.success||!t.topicId)return u.error=t.error||"Failed to create inbound topic",l.failed(`Failed to create inbound topic: ${u.error}`,{state:u}),{outboundTopicId:u.outboundTopicId||"",inboundTopicId:"",pfpTopicId:"",profileTopicId:"",success:!1,error:u.error,state:u};u.inboundTopicId=t.topicId,u.createdResources&&u.createdResources.push(`inbound:${u.inboundTopicId}`),l.preparing("Inbound topic created",40,{state:u})}if(u.pfpTopicId||a)u.pfpTopicId=a||u.pfpTopicId,l.preparing(`Using existing profile picture: ${u.pfpTopicId}`,60,{state:u});else{u.currentStage="pfp",l.preparing("Creating agent profile picture",40,{state:u});const n=l.createSubProgress({minPercent:40,maxPercent:60,logPrefix:"PFP"}),o=await this.inscribePfp(e,t,{progressCallback:e=>{n.report({stage:e.stage,message:e.message,progressPercent:e.progressPercent||0,details:{...e.details,state:u}})}});if(!o.success)return u.error=o.error||"Failed to inscribe profile picture",l.failed(`Failed to inscribe profile picture: ${u.error}`,{state:u}),{outboundTopicId:u.outboundTopicId||"",inboundTopicId:u.inboundTopicId||"",pfpTopicId:"",profileTopicId:"",success:!1,error:u.error,state:u};u.pfpTopicId=o.pfpTopicId,u.completedPercentage=60,u.createdResources&&u.createdResources.push(`pfp:${u.pfpTopicId}`),l.preparing("Profile picture created",60,{state:u})}if(u.profileTopicId)l.preparing("Using existing agent profile",100,{state:u}),"complete"!==u.currentStage&&(u.currentStage="complete",u.completedPercentage=100);else{u.currentStage="profile",l.preparing("Creating agent profile",60,{state:u});const e=l.createSubProgress({minPercent:60,maxPercent:100,logPrefix:"Profile"});if(!this.hcs11Client)return u.error="HCS11Client is not available in this environment",l.failed(u.error,{state:u}),{outboundTopicId:u.outboundTopicId||"",inboundTopicId:u.inboundTopicId||"",pfpTopicId:u.pfpTopicId||"",profileTopicId:"",success:!1,error:u.error,state:u};const t=await this.storeHCS11Profile(n,o,u.inboundTopicId,u.outboundTopicId,r,i,void 0,void 0,u.pfpTopicId,{progressCallback:t=>{e.report({stage:t.stage,message:t.message,progressPercent:t.progressPercent||0,details:{...t.details,state:u}})}});if(!t.success)return u.error=t.error||"Failed to store agent profile",l.failed(`Failed to store agent profile: ${u.error}`,{state:u}),{outboundTopicId:u.outboundTopicId||"",inboundTopicId:u.inboundTopicId||"",pfpTopicId:u.pfpTopicId||"",profileTopicId:"",success:!1,error:u.error,state:u};u.profileTopicId=t.profileTopicId,u.createdResources&&u.createdResources.push(`profile:${u.profileTopicId}`),u.currentStage="complete",u.completedPercentage=100}return l.completed("Agent successfully created",{inboundTopicId:u.inboundTopicId,outboundTopicId:u.outboundTopicId,pfpTopicId:u.pfpTopicId,profileTopicId:u.profileTopicId,state:u}),{outboundTopicId:u.outboundTopicId||"",inboundTopicId:u.inboundTopicId||"",pfpTopicId:u.pfpTopicId||"",profileTopicId:u.profileTopicId||"",success:!0,state:u}}catch(c){return this.logger.error(`Error creating agent: ${c.message}`),{outboundTopicId:"",inboundTopicId:"",pfpTopicId:"",profileTopicId:"",success:!1,error:`Error creating agent: ${c.message}`,state:{currentStage:"init",completedPercentage:0,error:c.message}}}}initializeRegistrationState(e,t){const n=t||{inboundTopicId:e,currentStage:"registration",completedPercentage:0,createdResources:[]};return"registration"!==n.currentStage&&"complete"!==n.currentStage&&(n.currentStage="registration"),n}updateStateForCompletedRegistration(e,t){e.currentStage="complete",e.completedPercentage=100,e.createdResources&&e.createdResources.push(`registration:${t}`)}async registerAgentWithGuardedRegistry(e,t=this.network,n){try{this.logger.info("Registering agent with guarded registry");const o=(await this.retrieveProfile(e)).topicInfo.inboundTopic,r=this.initializeRegistrationState(o,n?.existingState),i=new ProgressReporter({module:"AgentRegistration",logger:this.logger,callback:n?.progressCallback});i.preparing("Preparing agent registration",10,{inboundTopicId:o,accountId:e});const a=await this.executeRegistration(e,t,this.guardedRegistryBaseUrl,this.logger);if(!a.success)return{...a,state:r};if(i.submitting("Submitting registration to registry",30,{transactionId:a.transactionId}),a.transaction){const e=S.fromBytes(Buffer.from(a.transaction,"base64"));this.logger.info("Processing registration transaction");const t=await this.hwc.executeTransactionWithErrorHandling(e,!0);if(t.error)return{...a,error:t.error,success:!1,state:r};this.logger.info("Successfully processed registration transaction")}i.confirming("Confirming registration transaction",60,{accountId:e,inboundTopicId:o,transactionId:a.transactionId});const s=n?.maxAttempts??60,c=n?.delayMs??2e3,l=await this.waitForRegistrationConfirmation(a.transactionId,t,this.guardedRegistryBaseUrl,s,c,this.logger);return this.updateStateForCompletedRegistration(r,o),i.completed("Agent registration complete",{transactionId:a.transactionId,inboundTopicId:o,state:r,confirmed:l}),{...a,confirmed:l,state:r}}catch(o){return this.logger.error(`Registration error: ${o.message}`),{error:`Error during registration: ${o.message}`,success:!1,state:{currentStage:"registration",completedPercentage:0,error:o.message}}}}async createAndRegisterAgent(e,t){try{const n=e.build(),o=t?.progressCallback,r=new ProgressReporter({module:"AgentCreateRegister",logger:this.logger,callback:o});let i=t?.existingState||{currentStage:"init",completedPercentage:0,createdResources:[]};if(i.agentMetadata=n.metadata,r.preparing("Starting agent creation process",0,{state:i}),"complete"!==i.currentStage||!i.inboundTopicId||!i.outboundTopicId||!i.profileTopicId){const e=await this.createAgent(n.pfpBuffer||Buffer.from([]),n.pfpFileName||"default.png",n.name,n.description,n.capabilities,n.metadata,n.existingPfpTopicId,{progressCallback:e=>{const t=.3*(e.progressPercent||0);r.report({stage:e.stage,message:e.message,progressPercent:t,details:{...e.details,state:e.details?.state||i}})},existingState:i});if(!e.success)throw new Error(e.error||"Failed to create agent with topics");i=e.state,i.agentMetadata=n.metadata}r.preparing(`Agent creation status: ${i.currentStage}, ${i.completedPercentage}%`,30,{state:i});const{accountId:a}=this.getAccountAndSigner();if("complete"!==i.currentStage||!i.createdResources?.includes(`registration:${i.inboundTopicId}`)){t?.baseUrl&&(this.guardedRegistryBaseUrl=t.baseUrl);const e=await this.registerAgentWithGuardedRegistry(a,n.network,{progressCallback:e=>{const t=30+.7*(e.progressPercent||0);r.report({stage:e.stage,message:e.message,progressPercent:t,details:{...e.details,state:e.details?.state||i}})},maxAttempts:t?.maxAttempts,delayMs:t?.delayMs,existingState:i});if(!e.success)throw new Error(e.error||"Failed to register agent with registry");i=e.state}return r.completed("Agent creation and registration complete",{state:i}),{success:!0,state:i,metadata:{accountId:a,operatorId:`${i.inboundTopicId}@${a}`,inboundTopicId:i.inboundTopicId,outboundTopicId:i.outboundTopicId,profileTopicId:i.profileTopicId,pfpTopicId:i.pfpTopicId,privateKey:null,...i.agentMetadata}}}catch(n){throw new Error(`Failed to create and register agent: ${n.message}`)}}async storeHCS11Profile(e,t,n,o,r=[],i={},a,s,c,l){try{const u=l?.progressCallback,d=new ProgressReporter({module:"StoreHCS11Profile",logger:this.logger,callback:u});d.preparing("Preparing agent profile data",0);let p=c;if(!p&&a&&s){const e=d.createSubProgress({minPercent:0,maxPercent:60,logPrefix:"PFP"}),t=await this.inscribePfp(a,s,{progressCallback:t=>{e.report({stage:t.stage,message:t.message,progressPercent:t.progressPercent||0,details:t.details})}});t.success?p=t.pfpTopicId:d.failed("Failed to inscribe profile picture, continuing without PFP")}else c?d.preparing(`Using existing profile picture: ${c}`,30):d.preparing("No profile picture provided",30);const f=this.hcs11Client?.getAgentTypeFromMetadata({type:i.type||"autonomous"});d.preparing("Building agent profile",65);const h=[];if(i.socials&&(i.socials.twitter&&h.push({platform:"twitter",handle:i.socials.twitter}),i.socials.discord&&h.push({platform:"discord",handle:i.socials.discord}),i.socials.github&&h.push({platform:"github",handle:i.socials.github}),i.socials.website&&h.push({platform:"website",handle:i.socials.website}),i.socials.x&&h.push({platform:"twitter",handle:i.socials.x}),i.socials.linkedin&&h.push({platform:"linkedin",handle:i.socials.linkedin}),i.socials.youtube&&h.push({platform:"youtube",handle:i.socials.youtube}),i.socials.telegram&&h.push({platform:"telegram",handle:i.socials.telegram})),!this.hcs11Client)return d.failed("HCS11Client is not available in this environment"),{profileTopicId:"",success:!1,error:"HCS11Client is not available in this environment",transactionId:""};const m=this.hcs11Client.createAIAgentProfile(e,f,r,i.model||"unknown",{alias:e.toLowerCase().replace(/\s+/g,"_"),bio:t,profileImage:p?`hcs://1/${p}`:void 0,socials:h.length>0?h:void 0,properties:{description:t,version:i.version||"1.0.0",creator:i.creator||"Unknown",supported_languages:i.supported_languages||["en"],permissions:i.permissions||[],model_details:i.model_details,training:i.training,capabilities_description:i.capabilities_description,...i},inboundTopicId:n,outboundTopicId:o,creator:i.creator}),y=d.createSubProgress({minPercent:65,maxPercent:100,logPrefix:"Profile"}),g=await this.hcs11Client.createAndInscribeProfile(m,!0,{progressCallback:e=>{y.report({stage:e.stage,message:e.message,progressPercent:e.progressPercent||0,details:e.details})}});return g.success?(d.completed("Profile stored successfully",{profileTopicId:g.profileTopicId}),{profileTopicId:g.profileTopicId,pfpTopicId:p,success:!0,transactionId:g.transactionId||""}):(d.failed("Failed to inscribe profile"),{profileTopicId:"",success:!1,error:g.error||"Failed to inscribe profile",transactionId:g.transactionId||""})}catch(u){return this.logger.error(`Error storing HCS11 profile: ${u.message}`),{profileTopicId:"",success:!1,error:u.message,transactionId:""}}}async createTopic(e,t,n){this.logger.info("Creating topic");const{accountId:o,signer:r}=this.getAccountAndSigner(),i=(new m$1).setTopicMemo(e),a=await this.mirrorNode.getPublicKey(o);t&&a&&(i.setAdminKey(a),i.setAutoRenewAccountId(o)),n&&a&&i.setSubmitKey(a);const s=await this.hwc.executeTransactionWithErrorHandling(i,!1),c=s.error;if(c)return this.logger.error(c),{success:!1,error:c};const l=s.result;return l?.topicId?{success:!0,topicId:l.topicId.toString()}:(this.logger.error("Failed to create topic: topicId is null"),{success:!1,error:"Failed to create topic: topicId is null"})}async submitPayload(e,t){this.logger.debug("Submitting payload");const n=(new u).setTopicId(e).setMessage(JSON.stringify(t));return await this.hwc.executeTransactionWithErrorHandling(n,!1)}async inscribeFile(e,t){const{accountId:n,signer:o}=this.getAccountAndSigner(),r=mimeTypesExports.lookup(t)||"application/octet-stream",i=await InscriptionSDK.createWithAuth({type:"client",accountId:n,signer:o,network:this.network}),a=await i.inscribe({file:{type:"base64",base64:e.toString("base64"),fileName:t,mimeType:r},holderId:n.toString(),mode:"file",network:this.network},o);if(!a.transactionId||!a.jobId)throw this.logger.error("Failed to inscribe, no transaction ID or job ID."),new Error("Failed to inscribe, no transaction ID or job ID.");a.transactionId&&a.jobId&&this.logger.info(`Transaction ID: ${a.transactionId}, Job ID: ${a.jobId}`);return await i.waitForInscription(a.jobId,30,4e3,!0)}getAccountAndSigner(){const e=this.hwc.getAccountInfo().accountId.toString(),t=this.hwc.dAppConnector.signers.find((t=>t.getAccountId().toString()===e));if(!t)throw this.logger.error("Failed to find signer"),new Error("Failed to find signer");return{accountId:e,signer:t}}async inscribePfp(e,t,n){try{const o=n?.progressCallback,r=new ProgressReporter({module:"PFP-Inscription",logger:this.logger,callback:o});if(!this.hcs11Client)return r.failed("HCS11Client is not available in this environment"),{pfpTopicId:"",success:!1,error:"HCS11Client is not available in this environment",transactionId:""};r.preparing("Preparing to inscribe profile picture",10),this.logger.info("Inscribing profile picture using HCS-11 client");const i=e=>{r.report({stage:e.stage||"confirming",message:e.message||"Processing PFP inscription",progressPercent:e.progressPercent||50,details:e.details})},a=await this.hcs11Client.inscribeImage(e,t,{progressCallback:i});return a.success?(r.completed("Successfully inscribed profile picture",{pfpTopicId:a.imageTopicId}),this.logger.info(`Successfully inscribed profile picture with topic ID: ${a.imageTopicId}`),{pfpTopicId:a.imageTopicId,success:!0,transactionId:a.transactionId||""}):(r.failed(`Failed to inscribe profile picture: ${a.error}`),this.logger.error(`Failed to inscribe profile picture: ${a.error}`),{pfpTopicId:"",success:!1,error:a.error||"Failed to inscribe profile picture",transactionId:a.transactionId||""})}catch(o){return this.logger.error(`Error inscribing profile picture: ${o.message}`),{pfpTopicId:"",success:!1,error:o.message,transactionId:""}}}}exports.AIAgentCapability=AIAgentCapability,exports.AIAgentType=AIAgentType,exports.AccountCreationError=AccountCreationError,exports.AgentBuilder=AgentBuilder,exports.BrowserHCSClient=BrowserHCSClient,exports.ConnectionConfirmationError=ConnectionConfirmationError,exports.EVMBridge=EVMBridge,exports.EndpointType=EndpointType,exports.FeeConfigBuilder=FeeConfigBuilder,exports.HCS=HCS,exports.HCS10BaseClient=HCS10BaseClient,exports.HCS10Cache=HCS10Cache,exports.HCS10Client=HCS10Client,exports.HCS11Client=HCS11Client,exports.HederaMirrorNode=HederaMirrorNode,exports.InboundTopicType=InboundTopicType,exports.Logger=Logger$2,exports.PayloadSizeError=PayloadSizeError,exports.ProfileType=ProfileType,exports.ProgressReporter=ProgressReporter,exports.Registration=Registration,exports.SUPPORTED_SOCIAL_PLATFORMS=SUPPORTED_SOCIAL_PLATFORMS,exports.TopicCreationError=TopicCreationError,exports.WasmBridge=WasmBridge,exports.accountIdsToExemptKeys=accountIdsToExemptKeys,exports.capabilityNameToCapabilityMap=capabilityNameToCapabilityMap,exports.inscribe=inscribe,exports.inscribeWithSigner=inscribeWithSigner,exports.retrieveInscription=retrieveInscription,exports.sleep=sleep,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
129
+ */function requireMimeTypes(){return hasRequiredMimeTypes||(hasRequiredMimeTypes=1,function(e){var t,n,o,r=requireMimeDb(),i=require$$1.extname,a=/^\s*([^;\s]*)(?:;|\s|$)/,s=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var t=a.exec(e),n=t&&r[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!s.test(t[1]))&&"UTF-8"}e.charset=c,e.charsets={lookup:c},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var n=-1===t.indexOf("/")?e.lookup(t):t;if(!n)return!1;if(-1===n.indexOf("charset")){var o=e.charset(n);o&&(n+="; charset="+o.toLowerCase())}return n},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var n=a.exec(t),o=n&&e.extensions[n[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var n=i("x."+t).toLowerCase().substr(1);if(!n)return!1;return e.types[n]||!1},e.types=Object.create(null),t=e.extensions,n=e.types,o=["nginx","apache",void 0,"iana"],Object.keys(r).forEach((function(e){var i=r[e],a=i.extensions;if(a&&a.length){t[e]=a;for(var s=0;s<a.length;s++){var c=a[s];if(n[c]){var l=o.indexOf(r[n[c]].source),u=o.indexOf(i.source);if("application/octet-stream"!==n[c]&&(l>u||l===u&&"application/"===n[c].substr(0,12)))continue}n[c]=e}}}))}(mimeTypes)),mimeTypes}var mimeTypesExports=requireMimeTypes(),util,util2,objectUtil,objectUtil2;util2=util||(util={}),util2.assertEqual=e=>e,util2.assertIs=function(e){},util2.assertNever=function(e){throw new Error},util2.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},util2.getValidEnumValues=e=>{const t=util2.objectKeys(e).filter((t=>"number"!=typeof e[e[t]])),n={};for(const o of t)n[o]=e[o];return util2.objectValues(n)},util2.objectValues=e=>util2.objectKeys(e).map((function(t){return e[t]})),util2.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},util2.find=(e,t)=>{for(const n of e)if(t(n))return n},util2.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,util2.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},util2.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,objectUtil2=objectUtil||(objectUtil={}),objectUtil2.mergeShapes=(e,t)=>({...e,...t});const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:null===e?ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},o=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(o);else if("invalid_return_type"===r.code)o(r.returnTypeError);else if("invalid_arguments"===r.code)o(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,o=0;for(;o<r.path.length;){const n=r.path[o];o===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],o++}}};return o(this),n}static assert(e){if(!(e instanceof ZodError))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const o of this.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let n;switch(e.code){case ZodIssueCode.invalid_type:n=e.received===ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${util.joinValues(e.keys,", ")}`;break;case ZodIssueCode.invalid_union:n="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${util.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${util.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case ZodIssueCode.invalid_date:n="Invalid date";break;case ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:util.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ZodIssueCode.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ZodIssueCode.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ZodIssueCode.custom:n="Invalid input";break;case ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:n="Number must be finite";break;default:n=t.defaultError,util.assertNever(e)}return{message:n}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],a={...r,path:i};if(void 0!==r.message)return{...r,path:i,message:r.message};let s="";const c=o.filter((e=>!!e)).slice().reverse();for(const l of c)s=l(a,{data:t,defaultError:s}).message;return{...r,path:i,message:s}},EMPTY_PATH=[];function addIssueToContext(e,t){const n=getErrorMap(),o=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===errorMap?void 0:errorMap].filter((e=>!!e))});e.common.issues.push(o)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const o of t){if("aborted"===o.status)return INVALID;"dirty"===o.status&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const o of t){const e=await o.key,t=await o.value;n.push({key:e,value:t})}return ParseStatus.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const o of t){const{key:t,value:r}=o;if("aborted"===t.status)return INVALID;if("aborted"===r.status)return INVALID;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!o.alwaysSet||(n[t.value]=r.value)}return{status:e.value,value:n}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>"aborted"===e.status,isDirty=e=>"dirty"===e.status,isValid=e=>"valid"===e.status,isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise;function __classPrivateFieldGet(e,t,n,o){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function __classPrivateFieldSet(e,t,n,o,r){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var errorUtil,errorUtil2,_ZodEnum_cache,_ZodNativeEnum_cache;"function"==typeof SuppressedError&&SuppressedError,errorUtil2=errorUtil||(errorUtil={}),errorUtil2.errToObj=e=>"string"==typeof e?{message:e}:e||{},errorUtil2.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class ParseInputLazyPath{constructor(e,t,n,o){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ZodError(e.common.issues);return this._error=t,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:r};return{errorMap:(t,r)=>{var i,a;const{message:s}=e;return"invalid_enum_value"===t.code?{message:null!=s?s:r.defaultError}:void 0===r.data?{message:null!==(i=null!=s?s:o)&&void 0!==i?i:r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:null!==(a=null!=s?s:n)&&void 0!==a?a:r.defaultError}},description:r}}class ZodType{get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const o={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},r=this._parseSync({data:e,path:o.path,parent:o});return handleResult(o,r)}"~validate"(e){var t,n;const o={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:o});return isValid(t)?{value:t.value}:{issues:o.common.issues}}catch(r){(null===(n=null===(t=null==r?void 0:r.message)||void 0===t?void 0:t.toLowerCase())||void 0===n?void 0:n.includes("encountered"))&&(this["~standard"].async=!0),o.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:o}).then((e=>isValid(e)?{value:e.value}:{issues:o.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},o=this._parse({data:e,path:n.path,parent:n}),r=await(isAsync(o)?o:Promise.resolve(o));return handleResult(n,r)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,o)=>{const r=e(t),i=()=>o.addIssue({code:ZodIssueCode.custom,...n(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then((e=>!!e||(i(),!1))):!!r||(i(),!1)}))}refinement(e,t){return this._refinement(((n,o)=>!!e(n)||(o.addIssue("function"==typeof t?t(n,o):t),!1)))}_refinement(e){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function timeRegex(e){return new RegExp(`^${timeRegexSource(e)}$`)}function datetimeRegex(e){let t=`${dateRegexSource}T${timeRegexSource(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function isValidIP(e,t){return!("v4"!==t&&t||!ipv4Regex.test(e))||!("v6"!==t&&t||!ipv6Regex.test(e))}function isValidJWT(e,t){if(!jwtRegex.test(e))return!1;try{const[n]=e.split("."),o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return"object"==typeof r&&null!==r&&(!(!r.typ||!r.alg)&&(!t||r.alg===t))}catch(n){return!1}}function isValidCidr(e,t){return!("v4"!==t&&t||!ipv4CidrRegex.test(e))||!("v6"!==t&&t||!ipv6CidrRegex.test(e))}class ZodString extends ZodType{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==ZodParsedType.string){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:t.parsedType}),INVALID}const t=new ParseStatus;let n;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const o=e.data.length>r.value,i=e.data.length<r.value;(o||i)&&(n=this._getOrReturnCtx(e,n),o?addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):i&&addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)emailRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"email",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"emoji",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)uuidRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"uuid",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)nanoidRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)cuidRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"cuid",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)cuid2Regex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)ulidRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"ulid",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(o){n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"url",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"regex",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){datetimeRegex(r).test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else if("date"===r.kind){dateRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:"date",message:r.message}),t.dirty())}else if("time"===r.kind){timeRegex(r).test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.invalid_string,validation:"time",message:r.message}),t.dirty())}else"duration"===r.kind?durationRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"duration",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?isValidIP(e.data,r.version)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"ip",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):"jwt"===r.kind?isValidJWT(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"jwt",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):"cidr"===r.kind?isValidCidr(e.data,r.version)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"cidr",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):"base64"===r.kind?base64Regex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"base64",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):"base64url"===r.kind?base64urlRegex.test(e.data)||(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{validation:"base64url",code:ZodIssueCode.invalid_string,message:r.message}),t.dirty()):util.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(n)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...errorUtil.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...errorUtil.errToObj(t)})}nonempty(e){return this.min(1,errorUtil.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function floatSafeRemainder(e,t){const n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o;return parseInt(e.toFixed(r).replace(".",""))%parseInt(t.toFixed(r).replace(".",""))/Math.pow(10,r)}ZodString.create=e=>{var t;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==ZodParsedType.number){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:t.parsedType}),INVALID}let t;const n=new ParseStatus;for(const o of this._def.checks)if("int"===o.kind)util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty());else if("min"===o.kind){(o.inclusive?e.data<o.value:e.data<=o.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty())}else if("max"===o.kind){(o.inclusive?e.data>o.value:e.data>=o.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty())}else"multipleOf"===o.kind?0!==floatSafeRemainder(e.data,o.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):"finite"===o.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_finite,message:o.message}),n.dirty()):util.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,n,o){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:errorUtil.toString(o)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(o){return this._getInvalidInput(e)}if(this._getType(e)!==ZodParsedType.bigint)return this._getInvalidInput(e);let t;const n=new ParseStatus;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty())}else"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):util.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:t.parsedType}),INVALID}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,n,o){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:errorUtil.toString(o)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ZodBigInt.create=e=>{var t;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:t.parsedType}),INVALID}return OK(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==ZodParsedType.date){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:t.parsedType}),INVALID}if(isNaN(e.data.getTime())){return addIssueToContext(this._getOrReturnCtx(e),{code:ZodIssueCode.invalid_date}),INVALID}const t=new ParseStatus;let n;for(const o of this._def.checks)"min"===o.kind?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),t.dirty()):"max"===o.kind?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),t.dirty()):util.assertNever(o);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:t.parsedType}),INVALID}return OK(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:t.parsedType}),INVALID}return OK(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.null){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:t.parsedType}),INVALID}return OK(e.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return OK(e.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OK(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:t.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:t.parsedType}),INVALID}return OK(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),o=this._def;if(t.parsedType!==ZodParsedType.array)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:t.parsedType}),INVALID;if(null!==o.exactLength){const e=t.data.length>o.exactLength.value,r=t.data.length<o.exactLength.value;(e||r)&&(addIssueToContext(t,{code:e?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:r?o.exactLength.value:void 0,maximum:e?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(null!==o.minLength&&t.data.length<o.minLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),null!==o.maxLength&&t.data.length>o.maxLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>o.type._parseAsync(new ParseInputLazyPath(t,e,t.path,n))))).then((e=>ParseStatus.mergeArray(n,e)));const r=[...t.data].map(((e,n)=>o.type._parseSync(new ParseInputLazyPath(t,e,t.path,n))));return ParseStatus.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:errorUtil.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const n in e.shape){const o=e.shape[n];t[n]=ZodOptional.create(deepPartialify(o))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map((e=>deepPartialify(e)))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ZodParsedType.object){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID}const{status:t,ctx:n}=this._processInputParams(e),{shape:o,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const s in n.data)r.includes(s)||i.push(s);const a=[];for(const s of r){const e=o[s],t=n.data[s];a.push({key:{status:"valid",value:s},value:e._parse(new ParseInputLazyPath(n,t,n.path,s)),alwaysSet:s in n.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of i)a.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===e)i.length>0&&(addIssueToContext(n,{code:ZodIssueCode.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const o=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(n,o,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key,o=await t.value;e.push({key:n,value:o,alwaysSet:t.alwaysSet})}return e})).then((e=>ParseStatus.mergeObjectSync(t,e))):ParseStatus.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var o,r,i,a;const s=null!==(i=null===(r=(o=this._def).errorMap)||void 0===r?void 0:r.call(o,t,n).message)&&void 0!==i?i:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=errorUtil.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const t={};return util.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new ZodObject({...this._def,shape:()=>t})}omit(e){const t={};return util.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){const t={};return util.objectKeys(this.shape).forEach((n=>{const o=this.shape[n];e&&!e[n]?t[n]=o:t[n]=o.optional()})),new ZodObject({...this._def,shape:()=>t})}required(e){const t={};return util.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ZodOptional;)e=e._def.innerType;t[n]=e}})),new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const o of e)if("dirty"===o.result.status)return t.common.issues.push(...o.ctx.common.issues),o.result;const n=e.map((e=>new ZodError(e.ctx.common.issues)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:n}),INVALID}));{let e;const o=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},r=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:n}),n.common.issues.length&&o.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=o.map((e=>new ZodError(e)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:r}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?util.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.object)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID;const n=this.discriminator,o=t.data[n],r=this.optionsMap.get(o);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(addIssueToContext(t,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const o=new Map;for(const r of t){const t=getDiscriminator(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(o.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);o.set(n,r)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:o,...processCreateParams(n)})}}function mergeValues(e,t){const n=getParsedType(e),o=getParsedType(t);if(e===t)return{valid:!0,data:e};if(n===ZodParsedType.object&&o===ZodParsedType.object){const n=util.objectKeys(t),o=util.objectKeys(e).filter((e=>-1!==n.indexOf(e))),r={...e,...t};for(const i of o){const n=mergeValues(e[i],t[i]);if(!n.valid)return{valid:!1};r[i]=n.data}return{valid:!0,data:r}}if(n===ZodParsedType.array&&o===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let o=0;o<e.length;o++){const r=mergeValues(e[o],t[o]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===ZodParsedType.date&&o===ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),o=(e,o)=>{if(isAborted(e)||isAborted(o))return INVALID;const r=mergeValues(e.value,o.value);return r.valid?((isDirty(e)||isDirty(o))&&t.dirty(),{status:t.value,value:r.data}):(addIssueToContext(n,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>o(e,t))):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ZodIntersection.create=(e,t,n)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(n)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.array)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:n.parsedType}),INVALID;if(n.data.length<this._def.items.length)return addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&n.data.length>this._def.items.length&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...n.data].map(((e,t)=>{const o=this._def.items[t]||this._def.rest;return o?o._parse(new ParseInputLazyPath(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(o).then((e=>ParseStatus.mergeArray(t,e))):ParseStatus.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.object)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType}),INVALID;const o=[],r=this._def.keyType,i=this._def.valueType;for(const a in n.data)o.push({key:r._parse(new ParseInputLazyPath(n,a,n.path,a)),value:i._parse(new ParseInputLazyPath(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?ParseStatus.mergeObjectAsync(t,o):ParseStatus.mergeObjectSync(t,o)}get element(){return this._def.valueType}static create(e,t,n){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(n)}:{keyType:ZodString.create(),valueType:e,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.map)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:n.parsedType}),INVALID;const o=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map((([e,t],i)=>({key:o._parse(new ParseInputLazyPath(n,e,n.path,[i,"key"])),value:r._parse(new ParseInputLazyPath(n,t,n.path,[i,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of i){const o=await n.key,r=await n.value;if("aborted"===o.status||"aborted"===r.status)return INVALID;"dirty"!==o.status&&"dirty"!==r.status||t.dirty(),e.set(o.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of i){const o=n.key,r=n.value;if("aborted"===o.status||"aborted"===r.status)return INVALID;"dirty"!==o.status&&"dirty"!==r.status||t.dirty(),e.set(o.value,r.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,n)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(n)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.set)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:n.parsedType}),INVALID;const o=this._def;null!==o.minSize&&n.data.size<o.minSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),t.dirty()),null!==o.maxSize&&n.data.size>o.maxSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const n=new Set;for(const o of e){if("aborted"===o.status)return INVALID;"dirty"===o.status&&t.dirty(),n.add(o.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>r._parse(new ParseInputLazyPath(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>i(e))):i(a)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.function)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:t.parsedType}),INVALID;function n(e,n){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:n}})}function o(e,n){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:n}})}const r={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return OK((async function(...t){const a=new ZodError([]),s=await e._def.args.parseAsync(t,r).catch((e=>{throw a.addIssue(n(t,e)),a})),c=await Reflect.apply(i,this,s);return await e._def.returns._def.type.parseAsync(c,r).catch((e=>{throw a.addIssue(o(c,e)),a}))}))}{const e=this;return OK((function(...t){const a=e._def.args.safeParse(t,r);if(!a.success)throw new ZodError([n(t,a.error)]);const s=Reflect.apply(i,this,a.data),c=e._def.returns.safeParse(s,r);if(!c.success)throw new ZodError([o(s,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(n)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return addIssueToContext(t,{expected:util.joinValues(n),received:t.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_enum_value,options:n}),INVALID}return OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ZodEnum.create(e,{...this._def,...t})}exclude(e,t=this._def){return ZodEnum.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}_ZodEnum_cache=new WeakMap,ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(e){const t=util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ZodParsedType.string&&n.parsedType!==ZodParsedType.number){const e=util.objectValues(t);return addIssueToContext(n,{expected:util.joinValues(e),received:n.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(e.data)){const e=util.objectValues(t);return addIssueToContext(n,{received:n.data,code:ZodIssueCode.invalid_enum_value,options:e}),INVALID}return OK(e.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap,ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.promise&&!1===t.common.async)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:t.parsedType}),INVALID;const n=t.parsedType===ZodParsedType.promise?t.data:Promise.resolve(t.data);return OK(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:e=>{addIssueToContext(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===o.type){const e=o.transform(n.data,r);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return INVALID;const o=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===o.status?INVALID:"dirty"===o.status||"dirty"===t.value?DIRTY(o.value):o}));{if("aborted"===t.value)return INVALID;const o=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===o.status?INVALID:"dirty"===o.status||"dirty"===t.value?DIRTY(o.value):o}}if("refinement"===o.type){const e=e=>{const t=o.refinement(e,r);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===o.status?INVALID:("dirty"===o.status&&t.dirty(),e(o.value),{status:t.value,value:o.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?INVALID:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===o.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!isValid(e))return e;const i=o.transform(e.value,r);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>isValid(e)?Promise.resolve(o.transform(e.value,r)).then((e=>({status:t.value,value:e}))):e))}util.assertNever(o)}}ZodEffects.create=(e,t,n)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(n)}),ZodEffects.createWithPreprocess=(e,t,n)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(n)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.null?OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return isAsync(o)?o.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===o.status?o.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.nan){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:t.parsedType}),INVALID}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),DIRTY(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e),n=e=>(isValid(e)&&(e.value=Object.freeze(e.value)),e);return isAsync(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function cleanParams(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function custom(e,t={},n){return e?ZodAny.create().superRefine(((o,r)=>{var i,a;const s=e(o);if(s instanceof Promise)return s.then((e=>{var i,a;if(!e){const e=cleanParams(t,o),s=null===(a=null!==(i=e.fatal)&&void 0!==i?i:n)||void 0===a||a;r.addIssue({code:"custom",...e,fatal:s})}}));if(!s){const e=cleanParams(t,o),s=null===(a=null!==(i=e.fatal)&&void 0!==i?i:n)||void 0===a||a;r.addIssue({code:"custom",...e,fatal:s})}})):ZodAny.create()}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind,ZodFirstPartyTypeKind2;ZodFirstPartyTypeKind2=ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}),ZodFirstPartyTypeKind2.ZodString="ZodString",ZodFirstPartyTypeKind2.ZodNumber="ZodNumber",ZodFirstPartyTypeKind2.ZodNaN="ZodNaN",ZodFirstPartyTypeKind2.ZodBigInt="ZodBigInt",ZodFirstPartyTypeKind2.ZodBoolean="ZodBoolean",ZodFirstPartyTypeKind2.ZodDate="ZodDate",ZodFirstPartyTypeKind2.ZodSymbol="ZodSymbol",ZodFirstPartyTypeKind2.ZodUndefined="ZodUndefined",ZodFirstPartyTypeKind2.ZodNull="ZodNull",ZodFirstPartyTypeKind2.ZodAny="ZodAny",ZodFirstPartyTypeKind2.ZodUnknown="ZodUnknown",ZodFirstPartyTypeKind2.ZodNever="ZodNever",ZodFirstPartyTypeKind2.ZodVoid="ZodVoid",ZodFirstPartyTypeKind2.ZodArray="ZodArray",ZodFirstPartyTypeKind2.ZodObject="ZodObject",ZodFirstPartyTypeKind2.ZodUnion="ZodUnion",ZodFirstPartyTypeKind2.ZodDiscriminatedUnion="ZodDiscriminatedUnion",ZodFirstPartyTypeKind2.ZodIntersection="ZodIntersection",ZodFirstPartyTypeKind2.ZodTuple="ZodTuple",ZodFirstPartyTypeKind2.ZodRecord="ZodRecord",ZodFirstPartyTypeKind2.ZodMap="ZodMap",ZodFirstPartyTypeKind2.ZodSet="ZodSet",ZodFirstPartyTypeKind2.ZodFunction="ZodFunction",ZodFirstPartyTypeKind2.ZodLazy="ZodLazy",ZodFirstPartyTypeKind2.ZodLiteral="ZodLiteral",ZodFirstPartyTypeKind2.ZodEnum="ZodEnum",ZodFirstPartyTypeKind2.ZodEffects="ZodEffects",ZodFirstPartyTypeKind2.ZodNativeEnum="ZodNativeEnum",ZodFirstPartyTypeKind2.ZodOptional="ZodOptional",ZodFirstPartyTypeKind2.ZodNullable="ZodNullable",ZodFirstPartyTypeKind2.ZodDefault="ZodDefault",ZodFirstPartyTypeKind2.ZodCatch="ZodCatch",ZodFirstPartyTypeKind2.ZodPromise="ZodPromise",ZodFirstPartyTypeKind2.ZodBranded="ZodBranded",ZodFirstPartyTypeKind2.ZodPipeline="ZodPipeline",ZodFirstPartyTypeKind2.ZodReadonly="ZodReadonly";const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom((t=>t instanceof e),t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap:setErrorMap,getErrorMap:getErrorMap,makeIssue:makeIssue,EMPTY_PATH:EMPTY_PATH,addIssueToContext:addIssueToContext,ParseStatus:ParseStatus,INVALID:INVALID,DIRTY:DIRTY,OK:OK,isAborted:isAborted,isDirty:isDirty,isValid:isValid,isAsync:isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType:ZodParsedType,getParsedType:getParsedType,ZodType:ZodType,datetimeRegex:datetimeRegex,ZodString:ZodString,ZodNumber:ZodNumber,ZodBigInt:ZodBigInt,ZodBoolean:ZodBoolean,ZodDate:ZodDate,ZodSymbol:ZodSymbol,ZodUndefined:ZodUndefined,ZodNull:ZodNull,ZodAny:ZodAny,ZodUnknown:ZodUnknown,ZodNever:ZodNever,ZodVoid:ZodVoid,ZodArray:ZodArray,ZodObject:ZodObject,ZodUnion:ZodUnion,ZodDiscriminatedUnion:ZodDiscriminatedUnion,ZodIntersection:ZodIntersection,ZodTuple:ZodTuple,ZodRecord:ZodRecord,ZodMap:ZodMap,ZodSet:ZodSet,ZodFunction:ZodFunction,ZodLazy:ZodLazy,ZodLiteral:ZodLiteral,ZodEnum:ZodEnum,ZodNativeEnum:ZodNativeEnum,ZodPromise:ZodPromise,ZodEffects:ZodEffects,ZodTransformer:ZodEffects,ZodOptional:ZodOptional,ZodNullable:ZodNullable,ZodDefault:ZodDefault,ZodCatch:ZodCatch,ZodNaN:ZodNaN,BRAND:BRAND,ZodBranded:ZodBranded,ZodPipeline:ZodPipeline,ZodReadonly:ZodReadonly,custom:custom,Schema:ZodType,ZodSchema:ZodType,late:late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce:coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean:oboolean,onumber:onumber,optional:optionalType,ostring:ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER:NEVER,ZodIssueCode:ZodIssueCode,quotelessJson:quotelessJson,ZodError:ZodError}),ProfileType=(e=>(e[e.PERSONAL=0]="PERSONAL",e[e.AI_AGENT=1]="AI_AGENT",e))(ProfileType||{}),AIAgentType=(e=>(e[e.MANUAL=0]="MANUAL",e[e.AUTONOMOUS=1]="AUTONOMOUS",e))(AIAgentType||{}),EndpointType=(e=>(e[e.REST=0]="REST",e[e.WEBSOCKET=1]="WEBSOCKET",e[e.GRPC=2]="GRPC",e))(EndpointType||{}),AIAgentCapability=(e=>(e[e.TEXT_GENERATION=0]="TEXT_GENERATION",e[e.IMAGE_GENERATION=1]="IMAGE_GENERATION",e[e.AUDIO_GENERATION=2]="AUDIO_GENERATION",e[e.VIDEO_GENERATION=3]="VIDEO_GENERATION",e[e.CODE_GENERATION=4]="CODE_GENERATION",e[e.LANGUAGE_TRANSLATION=5]="LANGUAGE_TRANSLATION",e[e.SUMMARIZATION_EXTRACTION=6]="SUMMARIZATION_EXTRACTION",e[e.KNOWLEDGE_RETRIEVAL=7]="KNOWLEDGE_RETRIEVAL",e[e.DATA_INTEGRATION=8]="DATA_INTEGRATION",e[e.MARKET_INTELLIGENCE=9]="MARKET_INTELLIGENCE",e[e.TRANSACTION_ANALYTICS=10]="TRANSACTION_ANALYTICS",e[e.SMART_CONTRACT_AUDIT=11]="SMART_CONTRACT_AUDIT",e[e.GOVERNANCE_FACILITATION=12]="GOVERNANCE_FACILITATION",e[e.SECURITY_MONITORING=13]="SECURITY_MONITORING",e[e.COMPLIANCE_ANALYSIS=14]="COMPLIANCE_ANALYSIS",e[e.FRAUD_DETECTION=15]="FRAUD_DETECTION",e[e.MULTI_AGENT_COORDINATION=16]="MULTI_AGENT_COORDINATION",e[e.API_INTEGRATION=17]="API_INTEGRATION",e[e.WORKFLOW_AUTOMATION=18]="WORKFLOW_AUTOMATION",e))(AIAgentCapability||{});const SUPPORTED_SOCIAL_PLATFORMS=["twitter","github","discord","telegram","linkedin","youtube"],SocialLinkSchema=z.object({platform:z.string().min(1),handle:z.string().min(1)}),AIAgentDetailsSchema=z.object({type:z.nativeEnum(AIAgentType),capabilities:z.array(z.nativeEnum(AIAgentCapability)).min(1),model:z.string().min(1),creator:z.string().optional()}),BaseProfileSchema=z.object({version:z.string().min(1),type:z.nativeEnum(ProfileType),display_name:z.string().min(1),alias:z.string().optional(),bio:z.string().optional(),socials:z.array(SocialLinkSchema).optional(),profileImage:z.string().optional(),properties:z.record(z.any()).optional(),inboundTopicId:z.string().optional(),outboundTopicId:z.string().optional()}),PersonalProfileSchema=BaseProfileSchema.extend({type:z.literal(0),language:z.string().optional(),timezone:z.string().optional()}),AIAgentProfileSchema=BaseProfileSchema.extend({type:z.literal(1),aiAgent:AIAgentDetailsSchema}),HCS11ProfileSchema=z.union([PersonalProfileSchema,AIAgentProfileSchema]),capabilityNameToCapabilityMap={text_generation:0,image_generation:1,audio_generation:2,video_generation:3,code_generation:4,language_translation:5,summarization:6,extraction:6,knowledge_retrieval:7,data_integration:8,data_visualization:8,market_intelligence:9,transaction_analytics:10,smart_contract_audit:11,governance:12,security_monitoring:13,compliance_analysis:14,fraud_detection:15,multi_agent:16,api_integration:17,workflow_automation:18};class HCS11Client{constructor(e){if(this.client="mainnet"===e.network?i$1.forMainnet():i$1.forTestnet(),this.auth=e.auth,this.network=e.network,this.mirrorNode=new HederaMirrorNode(this.network,this.logger),this.auth.privateKey){const e=y$2.fromString(this.auth.privateKey);this.client.setOperator(this.auth.operatorId,e)}this.logger=Logger$2.getInstance({level:e.logLevel||"info",module:"HCS-11"})}getClient(){return this.client}getOperatorId(){return this.auth.operatorId}createPersonalProfile(e,t){return{version:"1.0",type:0,display_name:e,alias:t?.alias,bio:t?.bio,socials:t?.socials,profileImage:t?.profileImage,language:t?.language,timezone:t?.timezone,properties:t?.properties,inboundTopicId:t?.inboundTopicId,outboundTopicId:t?.outboundTopicId}}createAIAgentProfile(e,t,n,o,r){const i=this.validateProfile({version:"1.0",type:1,display_name:e,alias:r?.alias,bio:r?.bio,socials:r?.socials,profileImage:r?.profileImage,properties:r?.properties,inboundTopicId:r?.inboundTopicId,outboundTopicId:r?.outboundTopicId,aiAgent:{type:t,capabilities:n,model:o,creator:r?.creator}});if(!i.valid)throw new Error(`Invalid AI Agent Profile: ${i.errors.join(", ")}`);return{version:"1.0",type:1,display_name:e,alias:r?.alias,bio:r?.bio,socials:r?.socials,profileImage:r?.profileImage,properties:r?.properties,inboundTopicId:r?.inboundTopicId,outboundTopicId:r?.outboundTopicId,aiAgent:{type:t,capabilities:n,model:o,creator:r?.creator}}}validateProfile(e){const t=HCS11ProfileSchema.safeParse(e);if(t.success)return{valid:!0,errors:[]};return{valid:!1,errors:t.error.errors.map((e=>{const t=e.path.join(".");let n=e.message;if("invalid_type"===e.code)n=`Expected ${e.expected}, got ${e.received}`;else if("invalid_enum_value"===e.code){const t=e.options?.join(", ");n=`Invalid value. Valid options are: ${t}`}else"too_small"===e.code&&"string"===e.type&&(n="Cannot be empty");return`${t}: ${n}`}))}}profileToJSONString(e){return JSON.stringify(e)}parseProfileFromString(e){try{const t=JSON.parse(e),n=this.validateProfile(t);return n.valid?t:(this.logger.error("Invalid profile format:",n.errors),null)}catch(t){return this.logger.error("Error parsing profile:",t),null}}setProfileForAccountMemo(e,t=1){return`hcs-11:hcs://${t}/${e}`}async executeTransaction(e){try{if(this.auth.privateKey){const t=await e.signWithOperator(this.client),n=await t.execute(this.client),o=await n.getReceipt(this.client);return o.status!==e$6.Success?{success:!1,error:`Transaction failed: ${o.status.toString()}`}:{success:!0,result:o}}if(!this.auth.signer)throw new Error("No valid authentication method provided");const t=this.auth.signer,n=await e.freezeWithSigner(t),o=await n.executeWithSigner(t),r=await o.getReceiptWithSigner(t);return r.status!==e$6.Success?{success:!1,error:`Transaction failed: ${r.status.toString()}`}:{success:!0,result:r}}catch(t){return{success:!1,error:t instanceof Error?t.message:"Unknown error during transaction execution"}}}async inscribeImage(e,t,n){try{const o=n?.progressCallback,r=new ProgressReporter({module:"HCS11-Image",logger:this.logger,callback:o});r.preparing("Preparing to inscribe image",0);const i=mimeTypesExports.lookup(t)||"application/octet-stream",a=n?.waitForConfirmation??!0;let s;if(this.auth.signer){if(!("accountId"in this.auth.signer))throw r.failed("Signer must be a DAppSigner for inscription"),new Error("Signer must be a DAppSigner for inscription");r.preparing("Using signer for inscription",10),s=await inscribeWithSigner({type:"buffer",buffer:e,fileName:t,mimeType:i},this.auth.signer,{network:this.network,waitForConfirmation:a,waitMaxAttempts:60,waitIntervalMs:2e3,logging:{level:"debug"},progressCallback:e=>{const t=10+.8*(e.progressPercent||0);r.report({stage:e.stage,message:e.message,progressPercent:t,details:e.details})}})}else{if(!this.auth.privateKey)throw r.failed("Private key is required for inscription"),this.logger.error("Private key is required for inscription"),new Error("Private key is required for inscription");r.preparing("Using private key for inscription",10),s=await inscribe({type:"buffer",buffer:e,fileName:t,mimeType:i},{accountId:this.auth.operatorId,privateKey:this.auth.privateKey,network:this.network},{waitForConfirmation:a,waitMaxAttempts:60,waitIntervalMs:2e3,logging:{level:"debug"},progressCallback:e=>{const t=10+.8*(e.progressPercent||0);r.report({stage:e.stage,message:e.message,progressPercent:t,details:e.details})}})}return s.confirmed?(r.completed("Image inscription completed",{topic_id:s.inscription.topic_id}),{imageTopicId:s.inscription.topic_id||"",transactionId:s.result.jobId,success:!0}):(r.verifying("Waiting for inscription confirmation",50,{jobId:s.result.jobId}),{imageTopicId:"",transactionId:s.result.jobId,success:!1,error:"Inscription not confirmed"})}catch(o){return this.logger.error("Error inscribing image:",o),{imageTopicId:"",transactionId:"",success:!1,error:o.message||"Error inscribing image"}}}async inscribeProfile(e,t){this.logger.info("Inscribing HCS-11 profile");const n=t?.progressCallback,o=new ProgressReporter({module:"HCS11-Profile",logger:this.logger,callback:n});o.preparing("Validating profile data",5);const r=this.validateProfile(e);if(!r.valid)return o.failed(`Invalid profile: ${r.errors.join(", ")}`),{profileTopicId:"",transactionId:"",success:!1,error:`Invalid profile: ${r.errors.join(", ")}`};o.preparing("Formatting profile for inscription",15);const i=this.profileToJSONString(e),a=`profile-${e.display_name.toLowerCase().replace(/\s+/g,"-")}.json`;try{const e=Buffer.from(i,"utf-8"),t="application/json";o.preparing("Preparing profile for inscription",20);const n={type:"buffer",buffer:e,fileName:a,mimeType:t},r={waitForConfirmation:!0,mode:"file",network:this.network,waitMaxAttempts:100,waitIntervalMs:2e3,progressCallback:e=>{const t=20+.75*(e.progressPercent||0);o.report({stage:e.stage,message:e.message,progressPercent:t,details:e.details})}};o.submitting("Submitting profile to Hedera network",30);const s=this.auth.privateKey?await inscribe(n,{accountId:this.auth.operatorId,privateKey:this.auth.privateKey,network:this.network},r):await inscribeWithSigner(n,this.auth.signer,r);if(!s.confirmed||!s.inscription.topic_id)return o.failed("Failed to inscribe profile content"),{profileTopicId:"",transactionId:"",success:!1,error:"Failed to inscribe profile content"};const c=s.inscription.topic_id;return o.completed("Profile inscription completed",{topicId:c,transactionId:s.result.transactionId}),{profileTopicId:c,transactionId:s.result.transactionId,success:!0}}catch(s){return o.failed(`Error inscribing profile: ${s.message||"Unknown error"}`),{profileTopicId:"",transactionId:"",success:!1,error:s.message||"Unknown error during inscription"}}}async updateAccountMemoWithProfile(e,t){try{this.logger.info(`Updating account memo for ${e} with profile ${t}`);const n=this.setProfileForAccountMemo(t),o=(new s$4).setAccountMemo(n).setAccountId(e);return this.executeTransaction(o)}catch(n){return this.logger.error(`Error updating account memo: ${n instanceof Error?n.message:"Unknown error"}`),{success:!1,error:n instanceof Error?n.message:"Unknown error updating account memo"}}}async createAndInscribeProfile(e,t=!0,n){const o=n?.progressCallback,r=new ProgressReporter({module:"HCS11-ProfileCreation",logger:this.logger,callback:o});r.preparing("Starting profile creation process",0);const i=r.createSubProgress({minPercent:0,maxPercent:80,logPrefix:"Inscription"}),a=await this.inscribeProfile(e,{...n,progressCallback:e=>{i.report({stage:e.stage,message:e.message,progressPercent:e.progressPercent,details:e.details})}});if(!a.success)return r.failed("Profile inscription failed",{error:a.error}),a;if(r.confirming("Profile inscribed, updating account memo",85),t){const e=await this.updateAccountMemoWithProfile(this.auth.operatorId,a.profileTopicId);if(!e.success)return r.failed("Failed to update account memo",{error:e.error}),{...a,success:!1,error:e.error}}return r.completed("Profile creation completed successfully",{profileTopicId:a.profileTopicId,transactionId:a.transactionId}),a}async getCapabilitiesFromTags(e){const t=[];if(0===e.length)return[0];for(const n of e){const e=capabilityNameToCapabilityMap[n.toLowerCase()];void 0===e||t.includes(e)||t.push(e)}return 0===t.length&&t.push(0),t}getAgentTypeFromMetadata(e){return"autonomous"===e.type?1:0}async fetchProfileByAccountId(e,t){try{this.logger.info(`Fetching profile for account ${e.toString()} on ${this.network}`);const o=await this.mirrorNode.getAccountMemo(e.toString());if(this.logger.info(`Got account memo: ${o}`),!o?.startsWith("hcs-11:"))return{success:!1,error:`Account ${e.toString()} does not have a valid HCS-11 memo`};this.logger.info(`Found HCS-11 memo: ${o}`);const r=o.substring(7);if(!r?.startsWith("hcs://")){if(r.startsWith("ipfs://")){this.logger.warn("IPFS protocol references are not fully supported");const e=await fetch(`https://ipfs.io/ipfs/${r.replace("ipfs://","")}`),t=await e.json();return{success:!0,profile:t,topicInfo:{inboundTopic:t.inboundTopicId,outboundTopic:t.outboundTopicId,profileTopicId:t.profileTopicId}}}if(r.startsWith("ar://")){const e=r.replace("ar://",""),t=await fetch(`https://arweave.net/${e}`);if(!t.ok)return{success:!1,error:`Failed to fetch profile from Arweave ${e}: ${t.statusText}`};const n=await t.json();return{success:!0,profile:n,topicInfo:{inboundTopic:n.inboundTopicId,outboundTopic:n.outboundTopicId,profileTopicId:n.profileTopicId}}}return{success:!1,error:`Invalid protocol reference format: ${r}`}}{const e=r.match(/hcs:\/\/(\d+)\/(.+)/);if(!e)return{success:!1,error:`Invalid HCS protocol reference format: ${r}`};const[o,i,a]=e,s=t||this.network||"mainnet";this.logger.info(`Retrieving profile from Kiloscribe CDN: ${a}`);const c=`https://kiloscribe.com/api/inscription-cdn/${a}?network=${s}`;try{const e=await fetch(c);if(!e.ok)return{success:!1,error:`Failed to fetch profile from Kiloscribe CDN: ${e.statusText}`};const t=await e.json();return t?{success:!0,profile:t,topicInfo:{inboundTopic:t.inboundTopicId,outboundTopic:t.outboundTopicId,profileTopicId:a}}:{success:!1,error:`No profile data found for topic ${a}`}}catch(n){return this.logger.error(`Error retrieving from Kiloscribe CDN: ${n.message}`),{success:!1,error:`Error retrieving from Kiloscribe CDN: ${n.message}`}}}}catch(o){return this.logger.error(`Error fetching profile: ${o.message}`),{success:!1,error:`Error fetching profile: ${o.message}`}}}}class Registration{async checkRegistrationStatus(e,t,n,o){try{const r=await fetch(`${n}/api/request-confirm`,{method:"POST",headers:{"Content-Type":"application/json","X-Network":t},body:JSON.stringify({transaction_id:e})});if(!r.ok){const e=`Failed to confirm registration: ${r.statusText}`;throw o&&o.error(e),new Error(e)}return await r.json()}catch(r){throw o&&o.error(`Error checking registration status: ${r.message}`),r}}async waitForRegistrationConfirmation(e,t,n,o=60,r=2e3,i){let a=0;for(;a<o;){i&&i.info(`Checking registration status. Attempt ${a+1}/${o}`);const s=await this.checkRegistrationStatus(e,t,n,i);if("success"===s.status)return i&&i.info("Registration confirmed successfully"),!0;if("failed"===s.status)throw i&&i.error("Registration confirmation failed"),new Error("Registration confirmation failed");i&&i.info(`Registration still pending. Waiting ${r}ms before next attempt`),await new Promise((e=>setTimeout(e,r))),a++}return i&&i.warn(`Registration not confirmed after ${o} attempts`),!1}async executeRegistration(e,t="mainnet",n="https://moonscape.tech",o){try{o&&o.info("Registering agent with guarded registry");try{const n=new HCS11Client({network:t,auth:{operatorId:"0.0.0"}});o?.info("Fetching profile by account ID",`${e}-${t}`);const r=await n.fetchProfileByAccountId(e,t);if(o?.info("Profile fetched",r),r.error)return o?.error("Error fetching profile",r.error),{error:r.error,success:!1};if(!r.success||!r.profile)return o&&o.error("Profile not found for agent registration"),{error:"Profile not found for the provided account ID",success:!1};if(!r.profile.inboundTopicId)return o&&o.error("Missing inbound topic ID in profile"),{error:"Profile is missing required inbound topic ID",success:!1};if(!r.profile.outboundTopicId)return o&&o.error("Missing outbound topic ID in profile"),{error:"Profile is missing required outbound topic ID",success:!1};o&&o.info(`Profile validation successful. Inbound topic: ${r.profile.inboundTopicId}, Outbound topic: ${r.profile.outboundTopicId}`)}catch(r){return o&&o.error(`Error validating profile: ${r.message}`),{error:`Error validating profile: ${r.message}`,success:!1}}const i=await fetch(`${n}/api/request-register`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"*/*","Accept-Language":"en;q=0.5",Origin:n,Referer:`${n}/`,"X-Network":t},body:JSON.stringify({accountId:e})}),a=await i.json();return i.ok?(o&&o.info(`Created new registration request. Transaction ID: ${a.transaction_id}`),{transactionId:a.transaction_id,transaction:a.transaction,success:!0}):a.details?.length>0?{validationErrors:a.details,error:a.error||"Validation failed",success:!1}:{error:a.error||"Failed to register agent",success:!1}}catch(i){return{error:`Error during registration request: ${i.message}`,success:!1}}}async findRegistrations(e={},t="https://moonscape.tech"){try{const n=new URLSearchParams;e.tags?.forEach((e=>n.append("tags",e))),e.accountId&&n.append("accountId",e.accountId),e.network&&n.append("network",e.network);const o=await fetch(`${t}/api/registrations?${n}`,{headers:{Accept:"*/*","Accept-Language":"en;q=0.5",Origin:t,Referer:`${t}/`}});if(!o.ok){return{registrations:[],error:await o.text()||"Failed to fetch registrations",success:!1}}const r=await o.json();return r.error?{registrations:[],error:r.error,success:!1}:{registrations:r.registrations||[],success:!0}}catch(e2){return{registrations:[],error:`Error fetching registrations: ${e2.message}`,success:!1}}}}class HCS10BaseClient extends Registration{constructor(e){super(),this.network=e.network,this.logger=Logger$2.getInstance({level:e.logLevel||"info",module:"HCS10-BaseClient",prettyPrint:e.prettyPrint}),this.mirrorNode=new HederaMirrorNode(e.network,this.logger)}async getMessages(e){try{return{messages:await this.mirrorNode.getTopicMessages(e)}}catch(t){return this.logger&&this.logger.error(`Error fetching messages: ${t.message}`),{messages:[]}}}async checkRegistrationStatus(e,t,n){try{const o=await fetch(`${n}/api/request-confirm`,{method:"POST",headers:{"Content-Type":"application/json","X-Network":t},body:JSON.stringify({transaction_id:e})});if(!o.ok)throw new Error(`Failed to confirm registration: ${o.statusText}`);return await o.json()}catch(o){throw this.logger.error(`Error checking registration status: ${o}`),o}}async requestAccount(e){try{return await this.mirrorNode.requestAccount(e)}catch(e2){throw this.logger.error("Failed to fetch account",e2),e2}}async getAccountMemo(e){return await this.mirrorNode.getAccountMemo(e)}async retrieveProfile(e){this.logger.info(`Retrieving profile for account: ${e}`);try{const t=new HCS11Client({network:this.network,auth:{operatorId:"0.0.0"},logLevel:"info"}),n=await t.fetchProfileByAccountId(e,this.network);if(!n?.success)return this.logger.error(`Failed to retrieve profile for account ID: ${e}`,n?.error),{profile:null,success:!1,error:n?.error||`Failed to retrieve profile for account ID: ${e}`};const o=n.profile;let r=null;if(n.topicInfo?.inboundTopic&&n.topicInfo?.outboundTopic&&n.topicInfo?.profileTopicId){r={inboundTopic:n.topicInfo.inboundTopic,outboundTopic:n.topicInfo.outboundTopic,profileTopicId:n.topicInfo.profileTopicId};const t=`${e}-${this.network}`;HCS10Cache.getInstance().set(t,r)}return{profile:o,topicInfo:r,success:!0}}catch(t){return this.logger.error("Failed to retrieve profile:",t),{profile:null,success:!1,error:t instanceof Error?t.message:String(t)}}}async retrieveOutboundConnectTopic(e){this.logger.info(`Retrieving topics for account: ${e}`);try{const t=await this.retrieveProfile(e);if(!t?.success)throw new Error(t.error||"Failed to retrieve profile");const n=t.profile;if(!n.inboundTopicId||!n.outboundTopicId)throw new Error("Invalid HCS-11 profile for HCS-10 agent: missing inboundTopicId or outboundTopicId");const o={inboundTopic:n.inboundTopicId,outboundTopic:n.outboundTopicId,profileTopicId:n.profileTopicId},r=`${e}-${this.network}`;return HCS10Cache.getInstance().set(r,o),o}catch(t){throw this.logger.error("Failed to retrieve topic info:",t),t}}async retrieveOutboundMessages(e){try{const t=await this.retrieveOutboundConnectTopic(e);if(!t)return this.logger.warn(`No outbound connect topic found for agentAccountId: ${e}`),[];return(await this.getMessages(t.outboundTopic)).messages.filter((e=>"hcs-10"===e.p&&("connection_request"===e.op||"connection_created"===e.op||"message"===e.op)))}catch(t){return this.logger.error("Failed to retrieve outbound messages:",t),[]}}async hasConnectionCreated(e,t){try{const n=await this.retrieveOutboundConnectTopic(e);return(await this.retrieveOutboundMessages(n.outboundTopic)).some((e=>"connection_created"===e.op&&e.connection_id===t))}catch(n){return this.logger.error("Failed to check connection created:",n),!1}}clearCache(){HCS10Cache.getInstance().clear()}async getMessageContent(e){const t=e.match(/^hcs:\/\/(\d+)\/([0-9.]+)$/);if(!t)return e;const[n,o,r]=t;this.logger.info(`Resolving HRL reference: standard=${o}, topicId=${r}`);try{const e=`https://kiloscribe.com/api/inscription-cdn/${r}?network=${this.network}`,t=await axios.get(e);if(!t.data)throw new Error(`Failed to fetch content from topic: ${r}`);return t.data.content||t.data.text||JSON.stringify(t.data)}catch(i){throw this.logger.error(`Error resolving HRL reference: ${i instanceof Error?i.message:"Unknown error"}`),new Error(`Failed to resolve HRL reference: ${i instanceof Error?i.message:"Unknown error"}`)}}}class HCS10Cache{constructor(){this.CACHE_TTL=36e5,this.cache=new Map,this.cacheExpiry=new Map}static getInstance(){return HCS10Cache.instance||(HCS10Cache.instance=new HCS10Cache),HCS10Cache.instance}set(e,t){this.cache.set(e,t),this.cacheExpiry.set(e,Date.now()+this.CACHE_TTL)}get(e){const t=this.cacheExpiry.get(e);if(t&&t>Date.now())return this.cache.get(e);t&&(this.cache.delete(e),this.cacheExpiry.delete(e))}clear(){this.cache.clear(),this.cacheExpiry.clear()}}var InboundTopicType=(e=>(e.PUBLIC="PUBLIC",e.CONTROLLED="CONTROLLED",e.FEE_BASED="FEE_BASED",e))(InboundTopicType||{});async function accountIdsToExemptKeys(e,t,n){const o=new HederaMirrorNode(t,n),r=[];for(const a of e)try{const e=await o.getPublicKey(a);r.push(e)}catch(i){n&&n.warn(`Could not get public key for account ${a}: ${i}`)}return r}class FeeConfigBuilder{constructor(){this.feeAmount=0,this.decimals=0,this.feeCollectorAccountId="",this.exemptAccountIds=[]}static forHbar(e,t,n=[]){return(new FeeConfigBuilder).setHbarAmount(e).setFeeCollector(t).addExemptAccounts(n)}setHbarAmount(e){if(e<=0)throw new Error("HBAR amount must be greater than zero");return this.feeAmount=1e8*e,this.decimals=0,this}setFeeAmount(e,t=0){return this.feeAmount=e,this.decimals=t,this}setFeeCollector(e){return this.feeCollectorAccountId=e,this}addExemptAccount(e){return this.exemptAccountIds.includes(e)||this.exemptAccountIds.push(e),this}addExemptAccounts(e){for(const t of e)this.addExemptAccount(t);return this}build(){if(!this.feeCollectorAccountId)throw new Error("Fee collector account ID is required");if(this.feeAmount<=0)throw new Error("Fee amount must be greater than zero");return{feeAmount:{amount:this.feeAmount,decimals:this.decimals},feeCollectorAccountId:this.feeCollectorAccountId,exemptAccounts:this.exemptAccountIds}}}class HCS10Client extends HCS10BaseClient{constructor(e){super({network:e.network,logLevel:e.logLevel,prettyPrint:e.prettyPrint}),this.client="mainnet"===e.network?i$1.forMainnet():i$1.forTestnet(),this.operatorPrivateKey=y$2.fromString(e.operatorPrivateKey),this.network=e.network,this.client.setOperator(e.operatorId,this.operatorPrivateKey.toString()),this.logger=Logger$2.getInstance({level:e.logLevel||"info",module:"HCS-SDK"}),this.guardedRegistryBaseUrl=e.guardedRegistryBaseUrl||"https://moonscape.tech",this.feeAmount=e.feeAmount||5,this.hcs11Client=new HCS11Client({network:e.network,auth:{operatorId:e.operatorId,privateKey:e.operatorPrivateKey},logLevel:e.logLevel})}getClient(){return this.client}async createAccount(){this.logger.info("Creating new account");const e=y$2.generate(),t=(new l).setKey(e.publicKey).setInitialBalance(new e$7(10));this.logger.debug("Executing account creation transaction");const n=await t.execute(this.client),o=(await n.getReceipt(this.client)).accountId;if(!o)throw this.logger.error("Account creation failed: accountId is null"),new AccountCreationError("Failed to create account: accountId is null");return this.logger.info(`Account created successfully: ${o.toString()}`),{accountId:o.toString(),privateKey:e.toString()}}async createInboundTopic(e,t,n){this.logger.info(`Creating ${t} inbound topic`);const o=`hcs-10:0:60:0:${e}`;switch(t){case InboundTopicType.PUBLIC:return this.createTopic(o,!0,!1);case InboundTopicType.CONTROLLED:return this.createTopic(o,!0,!0);case InboundTopicType.FEE_BASED:if(!n)throw new Error("Fee configuration is required for fee-based topics");return this.createTopic(o,!0,!0,n.build());default:throw new Error(`Unsupported inbound topic type: ${t}`)}}async createAgent(e){const t=e.build(),n=await this.createTopic("hcs-10:0:60:1",!0,!0);this.logger.info(`Created new outbound topic ID: ${n}`);const o=this.client.operatorAccountId?.toString();if(!o)throw new Error("Failed to retrieve operator account ID");const r=await this.createInboundTopic(o,t.inboundTopicType,t.inboundTopicType===InboundTopicType.FEE_BASED?t.feeConfig:void 0);this.logger.info(`Created new inbound topic ID: ${r}`);let i=t.existingPfpTopicId||"";if(!i&&t.pfpBuffer&&t.pfpBuffer.length>0){this.logger.info("Inscribing new profile picture");i=(await this.inscribePfp(t.pfpBuffer,t.pfpFileName)).pfpTopicId,this.logger.info(`Profile picture inscribed with topic ID: ${i}`)}else t.existingPfpTopicId&&this.logger.info(`Using existing profile picture with topic ID: ${t.existingPfpTopicId}`);const a=(await this.storeHCS11Profile(t.name,t.description,r,n,t.capabilities,t.metadata,t.pfpBuffer&&t.pfpBuffer.length>0?t.pfpBuffer:void 0,t.pfpFileName,t.existingPfpTopicId)).profileTopicId;return this.logger.info(`Profile stored with topic ID: ${a}`),{outboundTopicId:n,inboundTopicId:r,pfpTopicId:i,profileTopicId:a}}async inscribePfp(e,t){try{this.logger.info("Inscribing profile picture using HCS-11 client");const n=await this.hcs11Client.inscribeImage(e,t);if(!n.success)throw this.logger.error(`Failed to inscribe profile picture: ${n.error}`),new Error(n.error||"Failed to inscribe profile picture");return this.logger.info(`Successfully inscribed profile picture with topic ID: ${n.imageTopicId}`),{pfpTopicId:n.imageTopicId,transactionId:n.transactionId,success:!0}}catch(n){return this.logger.error(`Error inscribing profile picture: ${n.message}`),{pfpTopicId:"",transactionId:"",success:!1,error:n.message}}}async storeHCS11Profile(e,t,n,o,r=[],i,a,s,c){try{let l=c||"";if(!l&&a&&s){this.logger.info("Inscribing profile picture for HCS-11 profile");const e=await this.inscribePfp(a,s);e.success?l=e.pfpTopicId:this.logger.error("Failed to inscribe profile picture, continuing without PFP")}else c&&this.logger.info(`Using existing profile picture with topic ID: ${c} for HCS-11 profile`);const u=this.hcs11Client.getAgentTypeFromMetadata({type:i.type||"autonomous"}),d=i.socials?Object.entries(i.socials).filter((([e,t])=>t)).map((([e,t])=>({platform:"x"===e?"twitter":e,handle:t}))):void 0,p=this.hcs11Client.createAIAgentProfile(e,u,r,i.model||"unknown",{alias:e.toLowerCase().replace(/\s+/g,"_"),bio:t,profileImage:l?`hcs://1/${l}`:void 0,socials:d,properties:i.properties,inboundTopicId:n,outboundTopicId:o,creator:i.creator}),f=await this.hcs11Client.createAndInscribeProfile(p,!0);if(!f.success)throw this.logger.error(`Failed to inscribe profile: ${f.error}`),new Error(f.error||"Failed to inscribe profile");return this.logger.info(`Profile inscribed with topic ID: ${f.profileTopicId}, transaction ID: ${f.transactionId}`),{profileTopicId:f.profileTopicId,pfpTopicId:l,transactionId:f.transactionId,success:!0}}catch(l){return this.logger.error(`Error storing HCS-11 profile: ${l.message}`),{profileTopicId:"",pfpTopicId:"",transactionId:"",success:!1,error:l.message}}}async setupFees(e,t,n=[]){if(!this.client.operatorPublicKey)return;this.logger.info("Setting up topic with custom fees");const o=(new l$1).setAmount(Number(t.feeAmount.amount)).setFeeCollectorAccountId(f.fromString(t.feeCollectorAccountId));let r=[...t.exemptAccounts||[],...n];if(console.log("exemptAccountIds",r),r.length>0){const t=Array.from(new Set(r)).filter((e=>e!==this.client.operatorAccountId?.toString()));let n=[];if(t.length>0)try{n=await accountIdsToExemptKeys(t,this.network,this.logger)}catch(i){this.logger.warn(`Error getting exempt keys: ${i}, continuing without exempt keys`)}n.length>0&&e.setFeeExemptKeys(n)}e.setFeeScheduleKey(this.client.operatorPublicKey).setCustomFees([o])}async handleConnectionRequest(e,t,n,o){const r=`hcs-10:${e}:${n}`;this.logger.info(`Handling connection request ${n} from ${t}`);const i=this.getClient().operatorAccountId?.toString();if(!i)throw new Error("Failed to retrieve operator account ID");let a=await this.mirrorNode.getPublicKey(t);const s=await this.mirrorNode.getPublicKey(i);if(!s)throw new Error("Failed to retrieve public key");const c=new s$7([s,a],1);let l;try{if(o){const e=o.build(),t={...e,exemptAccounts:[...e.exemptAccounts||[]]};l=await this.createTopic(r,c,c,t)}else l=await this.createTopic(r,c,c);this.logger.info(`Created new connection topic ID: ${l}`)}catch(d){throw this.logger.error(`Failed to create connection topic: ${d}`),new TopicCreationError(`Failed to create connection topic: ${d}`)}const u=`${e}@${i}`;return{connectionTopicId:l,confirmedConnectionSequenceNumber:await this.confirmConnection(e,l,t,n,u,"Connection accepted. Looking forward to collaborating!"),operatorId:u}}async confirmConnection(e,t,n,o,r,i,a){this.logger.info(`Confirming connection with ID ${o}`);const s={p:"hcs-10",op:"connection_created",connection_topic_id:t,connected_account_id:n,operator_id:r,connection_id:o,m:i},c=await this.submitPayload(e,s,a),l=c.topicSequenceNumber?.toNumber();if(!l)throw new ConnectionConfirmationError("Failed to confirm connection: sequence number is null");return l}async sendMessage(e,t,n,o,r){const i=await this.canSubmitToInboundTopic(e,this.client.operatorAccountId?.toString()||""),a={p:"hcs-10",op:"message",operator_id:t,data:n,m:o},s=JSON.stringify(a);if(Buffer.from(s).length>1e3){this.logger.info("Message payload exceeds 1000 bytes, storing via inscription");try{const e=Buffer.from(n),t=`message-${Date.now()}.json`,o=await this.inscribeFile(e,t);if(!o?.topic_id)throw new Error("Failed to inscribe large message content");a.data=`hcs://1/${o.topic_id}`,this.logger.info(`Large message inscribed with topic ID: ${o.topic_id}`)}catch(c){throw this.logger.error("Error inscribing large message:",c),new Error(`Failed to handle large message: ${c instanceof Error?c.message:"Unknown error"}`)}}this.logger.info("Submitting message to connection topic",a),await this.submitPayload(e,a,r,i.requiresFee)}async createTopic(e,t,n,o){this.logger.info("Creating topic");const r=(new m$1).setTopicMemo(e);t&&("boolean"==typeof t&&t&&this.client.operatorPublicKey?(r.setAdminKey(this.client.operatorPublicKey),r.setAutoRenewAccountId(this.client.operatorAccountId)):(t instanceof i$7||t instanceof s$7)&&(r.setAdminKey(t),this.client.operatorAccountId&&r.setAutoRenewAccountId(this.client.operatorAccountId))),n&&("boolean"==typeof n&&n&&this.client.operatorPublicKey?r.setSubmitKey(this.client.operatorPublicKey):(n instanceof i$7||n instanceof s$7)&&r.setSubmitKey(n)),o&&await this.setupFees(r,o),this.logger.debug("Executing topic creation transaction");const i=await r.execute(this.client),a=await i.getReceipt(this.client);if(!a.topicId)throw this.logger.error("Failed to create topic: topicId is null"),new Error("Failed to create topic: topicId is null");return a.topicId.toString()}async submitMessage(e,t,n){const o=await this.canSubmitToInboundTopic(e,this.client.operatorAccountId?.toString()||"");return this.submitPayload(e,t,n,o.requiresFee)}async submitPayload(e,t,n,o=!1){const r="string"==typeof t?t:JSON.stringify(t),i=Buffer.byteLength(r,"utf8");if(i>1e3)throw new PayloadSizeError("Payload size exceeds 1000 bytes limit",i);const a=(new u).setTopicId(m$2.fromString(e)).setMessage(r);let s;if(o&&(this.logger.info("Topic requires fee payment, setting max transaction fee"),a.setMaxTransactionFee(new e$7(this.feeAmount)),a.setTransactionMemo("HIP-991 Fee Payment")),n){a.freezeWith(this.client);const e=await a.sign(n);s=await e.execute(this.client)}else s=await a.execute(this.client);const c=await s.getReceipt(this.client);if(!c)throw this.logger.error("Failed to submit message: receipt is null"),new Error("Failed to submit message: receipt is null");return this.logger.info("Message submitted successfully"),c}async submitConnectionRequest(e,t,n,o){const r=await this.canSubmitToInboundTopic(e,t);if(!r.canSubmit)throw new Error(`Cannot submit to topic: ${r.reason}`);const i={p:"hcs-10",op:"connection_request",operator_id:n,memo:o},a=r.requiresFee,s=await this.submitPayload(e,i,void 0,a);this.logger.info(`Submitted connection request to topic ID: ${e}`);const c=await this.retrieveOutboundConnectTopic(t),l=s.topicSequenceNumber?.toNumber();if(!l)throw new Error("Failed to get response sequence number");return await this.submitPayload(c.outboundTopic,{...i,outbound_topic_id:c.outboundTopic,connection_request_id:l},this.operatorPrivateKey),s}async recordOutboundConnectionConfirmation({outboundTopicId:e,connectionRequestId:t,confirmedRequestId:n,connectionTopicId:o,operatorId:r,memo:i}){const a={p:"hcs-10",op:"connection_created",connection_topic_id:o,outbound_topic_id:e,confirmed_request_id:n,connection_request_id:t,operator_id:r,m:i};return await this.submitPayload(e,a)}async inscribeFile(e,t){if(this.logger.info("Inscribing file"),!this.client.operatorAccountId)throw this.logger.error("Operator account ID is not set"),new Error("Operator account ID is not set");if(!this.operatorPrivateKey)throw this.logger.error("Operator private key is not set"),new Error("Operator private key is not set");const n=mimeTypesExports.lookup(t)||"application/octet-stream",o=await InscriptionSDK.createWithAuth({type:"server",accountId:this.client.operatorAccountId.toString(),privateKey:this.operatorPrivateKey.toString(),network:this.network}),r=await o.inscribeAndExecute({file:{type:"base64",base64:e.toString("base64"),fileName:t,mimeType:n},holderId:this.client.operatorAccountId.toString(),mode:"file",network:this.network},{accountId:this.client.operatorAccountId.toString(),privateKey:this.operatorPrivateKey.toString(),network:this.network});if(!r.transactionId||!r.jobId)throw this.logger.error("Failed to inscribe, no transaction ID or job ID."),new Error("Failed to inscribe, no transaction ID or job ID.");r.transactionId&&r.jobId&&this.logger.info(`Transaction ID: ${r.transactionId}, Job ID: ${r.jobId}`);return await o.waitForInscription(r.jobId,30,4e3,!0)}async waitForConnectionConfirmation(e,t,n=60,o=2e3){this.logger.info(`Waiting for connection confirmation on inbound topic ${e} for request ID ${t}`);for(let r=0;r<n;r++){this.logger.info(`Attempt ${r+1}/${n} to find connection confirmation`);const i=(await this.mirrorNode.getTopicMessages(e)).filter((e=>"connection_created"===e.op));if(this.logger.info(`Found ${i.length} connection_created messages`),i.length>0)for(const e of i)if(Number(e.connection_id)===Number(t))return this.logger.info("Connection confirmation found"),{connectionTopicId:e.connection_topic_id,sequence_number:Number(e.sequence_number),confirmedBy:e.operator_id,memo:e.m};r<n-1&&(this.logger.info(`No matching confirmation found, waiting ${o}ms before retrying...`),await new Promise((e=>setTimeout(e,o))))}throw new Error(`Connection confirmation not found after ${n} attempts for request ID ${t}`)}getAccountAndSigner(){return{accountId:this.client.operatorAccountId.toString(),signer:this.operatorPrivateKey}}async canSubmitToInboundTopic(e,t){try{const o=await this.mirrorNode.getTopicInfo(e);if(!o)return{canSubmit:!1,requiresFee:!1,reason:"Topic does not exist"};if(!o.submit_key?.key)return{canSubmit:!0,requiresFee:!1};try{const e=await this.mirrorNode.getPublicKey(t);if("ProtobufEncoded"===o.submit_key._type){const t=Buffer.from(o.submit_key.key,"hex");if(await this.mirrorNode.checkKeyListAccess(t,e))return{canSubmit:!0,requiresFee:!1}}else{const t=i$7.fromString(o.submit_key.key);if(e.toString()===t.toString())return{canSubmit:!0,requiresFee:!1}}}catch(n){this.logger.error(`Key validation error: ${n instanceof Error?n.message:String(n)}`)}return o.fee_schedule_key?.key&&o.custom_fees?.fixed_fees?.length>0?{canSubmit:!0,requiresFee:!0,reason:"Requires fee payment via HIP-991"}:{canSubmit:!1,requiresFee:!1,reason:"User does not have submit permission for this topic"}}catch(n){const e=n instanceof Error?n.message:String(n);return this.logger.error(`Topic submission validation error: ${e}`),{canSubmit:!1,requiresFee:!1,reason:`Error: ${e}`}}}async createAndRegisterAgent(e,t){try{const n=e.build(),o=t?.progressCallback,r=t?.baseUrl||this.guardedRegistryBaseUrl;let i=t?.existingState||void 0;o&&o({stage:"preparing",message:"Preparing agent registration",progressPercent:10,details:{state:i}});const a=n.existingAccount||await this.createAccount();o&&o({stage:"preparing",message:"Created account or using existing account",progressPercent:20,details:{state:i,account:a}});const s=new HCS10Client({network:n.network,operatorId:a.accountId,operatorPrivateKey:a.privateKey,operatorPublicKey:y$2.fromString(a.privateKey).publicKey.toString(),logLevel:"info",guardedRegistryBaseUrl:r});o&&o({stage:"preparing",message:"Initialized agent client",progressPercent:30,details:{state:i}});const{outboundTopicId:c,inboundTopicId:l,pfpTopicId:u,profileTopicId:d}=await s.createAgent(e);o&&o({stage:"submitting",message:"Created agent with topics and profile",progressPercent:60,details:{state:i,outboundTopicId:c,inboundTopicId:l,pfpTopicId:u,profileTopicId:d}});const p=`${l}@${a.accountId}`,f=await s.registerAgentWithGuardedRegistry(a.accountId,n.network,{progressCallback:e=>{const t=60+.4*(e.progressPercent||0);o&&o({stage:e.stage,message:e.message,progressPercent:t,details:{...e.details,outboundTopicId:c,inboundTopicId:l,pfpTopicId:u,profileTopicId:d,operatorId:p,state:e.details?.state||i}})},existingState:i});return f.success?(o&&o({stage:"completed",message:"Agent creation and registration complete",progressPercent:100,details:{outboundTopicId:c,inboundTopicId:l,pfpTopicId:u,profileTopicId:d,operatorId:p,state:f.state}}),{...f,metadata:{accountId:a.accountId,privateKey:a.privateKey,operatorId:p,inboundTopicId:l,outboundTopicId:c,profileTopicId:d,pfpTopicId:u}}):f}catch(n){return this.logger.error(`Failed to create and register agent: ${n.message}`),{error:n.message,success:!1}}}async registerAgentWithGuardedRegistry(e,t=this.network,n){try{this.logger.info("Registering agent with guarded registry");const o=n?.maxAttempts??60,r=n?.delayMs??2e3,i=n?.progressCallback;let a=n?.existingState||{currentStage:"registration",completedPercentage:0,createdResources:[]};i&&i({stage:"preparing",message:"Preparing agent registration",progressPercent:10,details:{state:a}});const s=await this.executeRegistration(e,t,this.guardedRegistryBaseUrl,this.logger);if(!s.success)return{...s,state:a};if(i&&i({stage:"submitting",message:"Submitting registration to registry",progressPercent:30,details:{transactionId:s.transactionId,state:a}}),s.transaction){const e=S.fromBytes(Buffer.from(s.transaction,"base64"));this.logger.info("Processing registration transaction"),await e.execute(this.client),this.logger.info("Successfully processed registration transaction")}i&&i({stage:"confirming",message:"Confirming registration transaction",progressPercent:60,details:{accountId:e,transactionId:s.transactionId,state:a}});const c=await this.waitForRegistrationConfirmation(s.transactionId,t,this.guardedRegistryBaseUrl,o,r,this.logger);return a.currentStage="complete",a.completedPercentage=100,a.createdResources||(a.createdResources=[]),s.transactionId&&a.createdResources.push(`registration:${s.transactionId}`),i&&i({stage:"completed",message:"Agent registration complete",progressPercent:100,details:{confirmed:c,transactionId:s.transactionId,state:a}}),{...s,confirmed:c,state:a}}catch(o){return this.logger.error(`Failed to register agent: ${o.message}`),{error:o.message,success:!1}}}async registerAgent(e,t,n,o,r){this.logger.info("Registering agent");const i={p:"hcs-10",op:"register",account_id:t,inbound_topic_id:n,m:o};await this.submitPayload(e,i,r)}async getInboundTopicType(e){try{const t=await this.mirrorNode.getTopicInfo(e);if(!t)throw new Error("Topic does not exist");if(!(t.submit_key&&t.submit_key.key))return InboundTopicType.PUBLIC;if(t.fee_schedule_key&&t.fee_schedule_key.key&&t.custom_fees){const n=t.custom_fees;if(n&&n.fixed_fees&&n.fixed_fees.length>0)return this.logger.info(`Topic ${e} is fee-based with ${n.fixed_fees.length} custom fees`),InboundTopicType.FEE_BASED}return InboundTopicType.CONTROLLED}catch(t){throw this.logger.error(`Error determining topic type: ${t.message}`),new Error(`Failed to determine topic type: ${t.message}`)}}getNetwork(){return this.network}getLogger(){return this.logger}}class AgentBuilder{constructor(){this.config={}}setName(e){return this.config.name=e,this}setDescription(e){return this.config.description=e,this}setCapabilities(e){return this.config.capabilities=e,this}setAgentType(e){return this.config.metadata?this.config.metadata.type=e:this.config.metadata={type:e},this}setModel(e){return this.config.metadata?this.config.metadata.model=e:this.config.metadata={type:"autonomous",model:e},this}setCreator(e){return this.config.metadata?this.config.metadata.creator=e:this.config.metadata={type:"autonomous",creator:e},this}addSocial(e,t){return this.config.metadata?this.config.metadata.socials||(this.config.metadata.socials={}):this.config.metadata={type:"autonomous",socials:{}},this.config.metadata.socials[e]=t,this}addProperty(e,t){return this.config.metadata?this.config.metadata.properties||(this.config.metadata.properties={}):this.config.metadata={type:"autonomous",properties:{}},this.config.metadata.properties[e]=t,this}setMetadata(e){return this.config.metadata=e,this}setProfilePicture(e,t){return this.config.pfpBuffer=e,this.config.pfpFileName=t,this}setExistingProfilePicture(e){return this.config.existingPfpTopicId=e,this}setNetwork(e){return this.config.network=e,this}setInboundTopicType(e){return this.config.inboundTopicType=e,this}setFeeConfig(e){return this.config.feeConfig=e,this}setConnectionFeeConfig(e){return this.config.connectionFeeConfig=e,this}setExistingAccount(e,t){return this.config.existingAccount={accountId:e,privateKey:t},this}build(){if(!this.config.name)throw new Error("Agent name is required");if(!this.config.description)throw new Error("Agent description is required");if(!this.config.pfpBuffer||!this.config.pfpFileName)throw new Error("Profile picture is required");if(!this.config.network)throw new Error("Network is required");if(this.config.inboundTopicType||(this.config.inboundTopicType=InboundTopicType.PUBLIC),this.config.capabilities||(this.config.capabilities=[]),this.config.metadata||(this.config.metadata={type:"autonomous"}),this.config.inboundTopicType===InboundTopicType.FEE_BASED&&!this.config.feeConfig)throw new Error("Fee configuration is required for fee-based topics");return this.config}}const isBrowser="undefined"!=typeof window;class BrowserHCSClient extends HCS10BaseClient{constructor(e){if(super({network:e.network,logLevel:e.logLevel,prettyPrint:e.prettyPrint}),this.hcs11Client=null,this.hwc=e.hwc,this.guardedRegistryBaseUrl=e.guardedRegistryBaseUrl||"https://moonscape.tech",this.logger=Logger$2.getInstance({level:e.logLevel||"info",module:"HCS-Browser",prettyPrint:e.prettyPrint}),isBrowser)try{const{accountId:t,signer:n}=this.getAccountAndSigner();this.hcs11Client=new HCS11Client({network:e.network,auth:{operatorId:t,signer:n},logLevel:e.logLevel})}catch(t){this.logger.warn(`Failed to initialize HCS11Client: ${t}`)}else this.logger.error("BrowserHCSClient initialized in server environment - browser-specific features will not be available. Use HCS10Client instead.")}async sendMessage(e,t,n,o){this.logger.info("Sending message");const r={p:"hcs-10",op:"message",operator_id:t,data:n,m:o},i=JSON.stringify(r);if(Buffer.from(i).length>1e3){this.logger.info("Message payload exceeds 1000 bytes, storing via inscription");try{const e=Buffer.from(n),t=`message-${Date.now()}.json`,o=await this.inscribeFile(e,t);if(!o?.topic_id)throw new Error("Failed to inscribe large message content");r.data=`hcs://1/${o.topic_id}`,this.logger.info(`Large message inscribed with topic ID: ${o.topic_id}`)}catch(a){throw this.logger.error("Error inscribing large message:",a),new Error(`Failed to handle large message: ${a instanceof Error?a.message:"Unknown error"}`)}}await this.submitPayload(e,r)}async submitConnectionRequest(e,t,n,o){this.logger.info("Submitting connection request");const r={p:"hcs-10",op:"connection_request",requesting_account_id:t,operator_id:n,m:o},i=await this.submitPayload(e,r);this.logger.info(`Submitted connection request to topic ID: ${e}`);const a=await this.retrieveOutboundConnectTopic(t);if(!a?.outboundTopic)throw this.logger.error(`Failed to retrieve outbound topic for account ID: ${t}`),new Error(`Failed to retrieve outbound topic for account ID: ${t}`);this.logger.info(`Retrieved outbound topic ID: ${a.outboundTopic} for account ID: ${t}`);const s=i?.result?.topicSequenceNumber?.toNumber();if(!s)throw new Error("Failed to get response sequence number");return await this.submitPayload(a.outboundTopic,{...r,outbound_topic_id:e,connection_request_id:s}),i.result}async recordOutboundConnectionConfirmation({outboundTopicId:e,connectionRequestId:t,confirmedRequestId:n,connectionTopicId:o,operatorId:r,memo:i}){const a={p:"hcs-10",op:"connection_created",connection_topic_id:o,outbound_topic_id:e,confirmed_request_id:n,connection_request_id:t,operator_id:r,m:i};return await this.submitPayload(e,a)}async getPublicKey(e){return await this.mirrorNode.getPublicKey(e)}async handleConnectionRequest(e,t,n,o="Connection accepted. Looking forward to collaborating!"){this.logger.info("Handling connection request");const r=this.hwc.getAccountInfo().accountId;if(!r)throw new Error("Failed to retrieve user account ID");const i=await this.mirrorNode.getPublicKey(t),a=await this.mirrorNode.getPublicKey(r);if(!a)throw new Error("Failed to retrieve public key");const s=new s$7([a,i],1),c=`hcs-10:${e}:${n}`,l=(new m$1).setTopicMemo(c).setAdminKey(s).setSubmitKey(s);this.logger.debug("Executing topic creation transaction");const u=await this.hwc.executeTransactionWithErrorHandling(l,!1);if(u.error)throw this.logger.error(u.error),new Error(u.error);const d=u.result;if(!d?.topicId)throw this.logger.error("Failed to create topic: topicId is null"),new Error("Failed to create topic: topicId is null");const p=d.topicId.toString(),f=`${e}@${r}`;return{connectionTopicId:p,confirmedConnectionSequenceNumber:await this.confirmConnection(e,p,t,n,f,o),operatorId:f}}async confirmConnection(e,t,n,o,r,i){this.logger.info("Confirming connection");const a={p:"hcs-10",op:"connection_created",connection_topic_id:t,connected_account_id:n,operator_id:r,connection_id:o,m:i},s=await this.submitPayload(e,a);if(!s?.result?.topicSequenceNumber)throw this.logger.error("Failed to confirm connection: sequence number is null"),new Error("Failed to confirm connection: sequence number is null");return s.result.topicSequenceNumber.toNumber()}async submitMessage(e,t,n={},o=""){this.logger.info("Submitting message");const r={p:"hcs-10",op:"message",data:{content:t,metadata:n},m:o};return await this.submitPayload(e,r)}async createAgent(e,t,n,o,r,i,a,s){try{const c=s?.progressCallback,l=new ProgressReporter({module:"AgentCreate",logger:this.logger,callback:c});let u=s?.existingState||{currentStage:"init",completedPercentage:0,createdResources:[]};if(u.outboundTopicId)l.preparing("Using existing outbound topic",20,{state:u});else{u.currentStage="topics",l.preparing("Creating agent outbound topic",0,{state:u});const e=await this.createTopic("hcs-10:0:60:1",!0,!0);if(!e.success||!e.topicId)return u.error=e.error||"Failed to create outbound topic",l.failed(`Failed to create outbound topic: ${u.error}`,{state:u}),{outboundTopicId:"",inboundTopicId:"",pfpTopicId:"",profileTopicId:"",success:!1,error:u.error,state:u};u.outboundTopicId=e.topicId,u.createdResources&&u.createdResources.push(`outbound:${u.outboundTopicId}`),l.preparing("Outbound topic created",20,{state:u})}const d=this.hwc.getAccountInfo().accountId;if(!d)throw new Error("Failed to retrieve user account ID");if(u.inboundTopicId)l.preparing("Using existing inbound topic",40,{state:u});else{const e=`hcs-10:0:60:0:${d}`,t=await this.createTopic(e,!0,!0);if(!t.success||!t.topicId)return u.error=t.error||"Failed to create inbound topic",l.failed(`Failed to create inbound topic: ${u.error}`,{state:u}),{outboundTopicId:u.outboundTopicId||"",inboundTopicId:"",pfpTopicId:"",profileTopicId:"",success:!1,error:u.error,state:u};u.inboundTopicId=t.topicId,u.createdResources&&u.createdResources.push(`inbound:${u.inboundTopicId}`),l.preparing("Inbound topic created",40,{state:u})}if(u.pfpTopicId||a)u.pfpTopicId=a||u.pfpTopicId,l.preparing(`Using existing profile picture: ${u.pfpTopicId}`,60,{state:u});else{u.currentStage="pfp",l.preparing("Creating agent profile picture",40,{state:u});const n=l.createSubProgress({minPercent:40,maxPercent:60,logPrefix:"PFP"}),o=await this.inscribePfp(e,t,{progressCallback:e=>{n.report({stage:e.stage,message:e.message,progressPercent:e.progressPercent||0,details:{...e.details,state:u}})}});if(!o.success)return u.error=o.error||"Failed to inscribe profile picture",l.failed(`Failed to inscribe profile picture: ${u.error}`,{state:u}),{outboundTopicId:u.outboundTopicId||"",inboundTopicId:u.inboundTopicId||"",pfpTopicId:"",profileTopicId:"",success:!1,error:u.error,state:u};u.pfpTopicId=o.pfpTopicId,u.completedPercentage=60,u.createdResources&&u.createdResources.push(`pfp:${u.pfpTopicId}`),l.preparing("Profile picture created",60,{state:u})}if(u.profileTopicId)l.preparing("Using existing agent profile",100,{state:u}),"complete"!==u.currentStage&&(u.currentStage="complete",u.completedPercentage=100);else{u.currentStage="profile",l.preparing("Creating agent profile",60,{state:u});const e=l.createSubProgress({minPercent:60,maxPercent:100,logPrefix:"Profile"});if(!this.hcs11Client)return u.error="HCS11Client is not available in this environment",l.failed(u.error,{state:u}),{outboundTopicId:u.outboundTopicId||"",inboundTopicId:u.inboundTopicId||"",pfpTopicId:u.pfpTopicId||"",profileTopicId:"",success:!1,error:u.error,state:u};const t=await this.storeHCS11Profile(n,o,u.inboundTopicId,u.outboundTopicId,r,i,void 0,void 0,u.pfpTopicId,{progressCallback:t=>{e.report({stage:t.stage,message:t.message,progressPercent:t.progressPercent||0,details:{...t.details,state:u}})}});if(!t.success)return u.error=t.error||"Failed to store agent profile",l.failed(`Failed to store agent profile: ${u.error}`,{state:u}),{outboundTopicId:u.outboundTopicId||"",inboundTopicId:u.inboundTopicId||"",pfpTopicId:u.pfpTopicId||"",profileTopicId:"",success:!1,error:u.error,state:u};u.profileTopicId=t.profileTopicId,u.createdResources&&u.createdResources.push(`profile:${u.profileTopicId}`),u.currentStage="complete",u.completedPercentage=100}return l.completed("Agent successfully created",{inboundTopicId:u.inboundTopicId,outboundTopicId:u.outboundTopicId,pfpTopicId:u.pfpTopicId,profileTopicId:u.profileTopicId,state:u}),{outboundTopicId:u.outboundTopicId||"",inboundTopicId:u.inboundTopicId||"",pfpTopicId:u.pfpTopicId||"",profileTopicId:u.profileTopicId||"",success:!0,state:u}}catch(c){return this.logger.error(`Error creating agent: ${c.message}`),{outboundTopicId:"",inboundTopicId:"",pfpTopicId:"",profileTopicId:"",success:!1,error:`Error creating agent: ${c.message}`,state:{currentStage:"init",completedPercentage:0,error:c.message}}}}initializeRegistrationState(e,t){const n=t||{inboundTopicId:e,currentStage:"registration",completedPercentage:0,createdResources:[]};return"registration"!==n.currentStage&&"complete"!==n.currentStage&&(n.currentStage="registration"),n}updateStateForCompletedRegistration(e,t){e.currentStage="complete",e.completedPercentage=100,e.createdResources&&e.createdResources.push(`registration:${t}`)}async registerAgentWithGuardedRegistry(e,t=this.network,n){try{this.logger.info("Registering agent with guarded registry");const o=(await this.retrieveProfile(e)).topicInfo.inboundTopic,r=this.initializeRegistrationState(o,n?.existingState),i=new ProgressReporter({module:"AgentRegistration",logger:this.logger,callback:n?.progressCallback});i.preparing("Preparing agent registration",10,{inboundTopicId:o,accountId:e});const a=await this.executeRegistration(e,t,this.guardedRegistryBaseUrl,this.logger);if(!a.success)return{...a,state:r};if(i.submitting("Submitting registration to registry",30,{transactionId:a.transactionId}),a.transaction){const e=S.fromBytes(Buffer.from(a.transaction,"base64"));this.logger.info("Processing registration transaction");const t=await this.hwc.executeTransactionWithErrorHandling(e,!0);if(t.error)return{...a,error:t.error,success:!1,state:r};this.logger.info("Successfully processed registration transaction")}i.confirming("Confirming registration transaction",60,{accountId:e,inboundTopicId:o,transactionId:a.transactionId});const s=n?.maxAttempts??60,c=n?.delayMs??2e3,l=await this.waitForRegistrationConfirmation(a.transactionId,t,this.guardedRegistryBaseUrl,s,c,this.logger);return this.updateStateForCompletedRegistration(r,o),i.completed("Agent registration complete",{transactionId:a.transactionId,inboundTopicId:o,state:r,confirmed:l}),{...a,confirmed:l,state:r}}catch(o){return this.logger.error(`Registration error: ${o.message}`),{error:`Error during registration: ${o.message}`,success:!1,state:{currentStage:"registration",completedPercentage:0,error:o.message}}}}async createAndRegisterAgent(e,t){try{const n=e.build(),o=t?.progressCallback,r=new ProgressReporter({module:"AgentCreateRegister",logger:this.logger,callback:o});let i=t?.existingState||{currentStage:"init",completedPercentage:0,createdResources:[]};if(i.agentMetadata=n.metadata,r.preparing("Starting agent creation process",0,{state:i}),"complete"!==i.currentStage||!i.inboundTopicId||!i.outboundTopicId||!i.profileTopicId){const e=await this.createAgent(n.pfpBuffer||Buffer.from([]),n.pfpFileName||"default.png",n.name,n.description,n.capabilities,n.metadata,n.existingPfpTopicId,{progressCallback:e=>{const t=.3*(e.progressPercent||0);r.report({stage:e.stage,message:e.message,progressPercent:t,details:{...e.details,state:e.details?.state||i}})},existingState:i});if(!e.success)throw new Error(e.error||"Failed to create agent with topics");i=e.state,i.agentMetadata=n.metadata}r.preparing(`Agent creation status: ${i.currentStage}, ${i.completedPercentage}%`,30,{state:i});const{accountId:a}=this.getAccountAndSigner();if("complete"!==i.currentStage||!i.createdResources?.includes(`registration:${i.inboundTopicId}`)){t?.baseUrl&&(this.guardedRegistryBaseUrl=t.baseUrl);const e=await this.registerAgentWithGuardedRegistry(a,n.network,{progressCallback:e=>{const t=30+.7*(e.progressPercent||0);r.report({stage:e.stage,message:e.message,progressPercent:t,details:{...e.details,state:e.details?.state||i}})},maxAttempts:t?.maxAttempts,delayMs:t?.delayMs,existingState:i});if(!e.success)throw new Error(e.error||"Failed to register agent with registry");i=e.state}return r.completed("Agent creation and registration complete",{state:i}),{success:!0,state:i,metadata:{accountId:a,operatorId:`${i.inboundTopicId}@${a}`,inboundTopicId:i.inboundTopicId,outboundTopicId:i.outboundTopicId,profileTopicId:i.profileTopicId,pfpTopicId:i.pfpTopicId,privateKey:null,...i.agentMetadata}}}catch(n){throw new Error(`Failed to create and register agent: ${n.message}`)}}async storeHCS11Profile(e,t,n,o,r=[],i={},a,s,c,l){try{const u=l?.progressCallback,d=new ProgressReporter({module:"StoreHCS11Profile",logger:this.logger,callback:u});d.preparing("Preparing agent profile data",0);let p=c;if(!p&&a&&s){const e=d.createSubProgress({minPercent:0,maxPercent:60,logPrefix:"PFP"}),t=await this.inscribePfp(a,s,{progressCallback:t=>{e.report({stage:t.stage,message:t.message,progressPercent:t.progressPercent||0,details:t.details})}});t.success?p=t.pfpTopicId:d.failed("Failed to inscribe profile picture, continuing without PFP")}else c?d.preparing(`Using existing profile picture: ${c}`,30):d.preparing("No profile picture provided",30);const f=this.hcs11Client?.getAgentTypeFromMetadata({type:i.type||"autonomous"});d.preparing("Building agent profile",65);const h=[];if(i.socials&&(i.socials.twitter&&h.push({platform:"twitter",handle:i.socials.twitter}),i.socials.discord&&h.push({platform:"discord",handle:i.socials.discord}),i.socials.github&&h.push({platform:"github",handle:i.socials.github}),i.socials.website&&h.push({platform:"website",handle:i.socials.website}),i.socials.x&&h.push({platform:"twitter",handle:i.socials.x}),i.socials.linkedin&&h.push({platform:"linkedin",handle:i.socials.linkedin}),i.socials.youtube&&h.push({platform:"youtube",handle:i.socials.youtube}),i.socials.telegram&&h.push({platform:"telegram",handle:i.socials.telegram})),!this.hcs11Client)return d.failed("HCS11Client is not available in this environment"),{profileTopicId:"",success:!1,error:"HCS11Client is not available in this environment",transactionId:""};const m=this.hcs11Client.createAIAgentProfile(e,f,r,i.model||"unknown",{alias:e.toLowerCase().replace(/\s+/g,"_"),bio:t,profileImage:p?`hcs://1/${p}`:void 0,socials:h.length>0?h:void 0,properties:{description:t,version:i.version||"1.0.0",creator:i.creator||"Unknown",supported_languages:i.supported_languages||["en"],permissions:i.permissions||[],model_details:i.model_details,training:i.training,capabilities_description:i.capabilities_description,...i},inboundTopicId:n,outboundTopicId:o,creator:i.creator}),y=d.createSubProgress({minPercent:65,maxPercent:100,logPrefix:"Profile"}),g=await this.hcs11Client.createAndInscribeProfile(m,!0,{progressCallback:e=>{y.report({stage:e.stage,message:e.message,progressPercent:e.progressPercent||0,details:e.details})}});return g.success?(d.completed("Profile stored successfully",{profileTopicId:g.profileTopicId}),{profileTopicId:g.profileTopicId,pfpTopicId:p,success:!0,transactionId:g.transactionId||""}):(d.failed("Failed to inscribe profile"),{profileTopicId:"",success:!1,error:g.error||"Failed to inscribe profile",transactionId:g.transactionId||""})}catch(u){return this.logger.error(`Error storing HCS11 profile: ${u.message}`),{profileTopicId:"",success:!1,error:u.message,transactionId:""}}}async createTopic(e,t,n){this.logger.info("Creating topic");const{accountId:o,signer:r}=this.getAccountAndSigner(),i=(new m$1).setTopicMemo(e),a=await this.mirrorNode.getPublicKey(o);t&&a&&(i.setAdminKey(a),i.setAutoRenewAccountId(o)),n&&a&&i.setSubmitKey(a);const s=await this.hwc.executeTransactionWithErrorHandling(i,!1),c=s.error;if(c)return this.logger.error(c),{success:!1,error:c};const l=s.result;return l?.topicId?{success:!0,topicId:l.topicId.toString()}:(this.logger.error("Failed to create topic: topicId is null"),{success:!1,error:"Failed to create topic: topicId is null"})}async submitPayload(e,t){this.logger.debug("Submitting payload");const n=(new u).setTopicId(e).setMessage(JSON.stringify(t));return await this.hwc.executeTransactionWithErrorHandling(n,!1)}async inscribeFile(e,t){const{accountId:n,signer:o}=this.getAccountAndSigner(),r=mimeTypesExports.lookup(t)||"application/octet-stream",i=await InscriptionSDK.createWithAuth({type:"client",accountId:n,signer:o,network:this.network}),a=await i.inscribe({file:{type:"base64",base64:e.toString("base64"),fileName:t,mimeType:r},holderId:n.toString(),mode:"file",network:this.network},o);if(!a.transactionId||!a.jobId)throw this.logger.error("Failed to inscribe, no transaction ID or job ID."),new Error("Failed to inscribe, no transaction ID or job ID.");a.transactionId&&a.jobId&&this.logger.info(`Transaction ID: ${a.transactionId}, Job ID: ${a.jobId}`);return await i.waitForInscription(a.jobId,30,4e3,!0)}getAccountAndSigner(){const e=this.hwc.getAccountInfo().accountId.toString(),t=this.hwc.dAppConnector.signers.find((t=>t.getAccountId().toString()===e));if(!t)throw this.logger.error("Failed to find signer"),new Error("Failed to find signer");return{accountId:e,signer:t}}async inscribePfp(e,t,n){try{const o=n?.progressCallback,r=new ProgressReporter({module:"PFP-Inscription",logger:this.logger,callback:o});if(!this.hcs11Client)return r.failed("HCS11Client is not available in this environment"),{pfpTopicId:"",success:!1,error:"HCS11Client is not available in this environment",transactionId:""};r.preparing("Preparing to inscribe profile picture",10),this.logger.info("Inscribing profile picture using HCS-11 client");const i=e=>{r.report({stage:e.stage||"confirming",message:e.message||"Processing PFP inscription",progressPercent:e.progressPercent||50,details:e.details})},a=await this.hcs11Client.inscribeImage(e,t,{progressCallback:i});return a.success?(r.completed("Successfully inscribed profile picture",{pfpTopicId:a.imageTopicId}),this.logger.info(`Successfully inscribed profile picture with topic ID: ${a.imageTopicId}`),{pfpTopicId:a.imageTopicId,success:!0,transactionId:a.transactionId||""}):(r.failed(`Failed to inscribe profile picture: ${a.error}`),this.logger.error(`Failed to inscribe profile picture: ${a.error}`),{pfpTopicId:"",success:!1,error:a.error||"Failed to inscribe profile picture",transactionId:a.transactionId||""})}catch(o){return this.logger.error(`Error inscribing profile picture: ${o.message}`),{pfpTopicId:"",success:!1,error:o.message,transactionId:""}}}}exports.AIAgentCapability=AIAgentCapability,exports.AIAgentType=AIAgentType,exports.AccountCreationError=AccountCreationError,exports.AgentBuilder=AgentBuilder,exports.BrowserHCSClient=BrowserHCSClient,exports.ConnectionConfirmationError=ConnectionConfirmationError,exports.EVMBridge=EVMBridge,exports.EndpointType=EndpointType,exports.FeeConfigBuilder=FeeConfigBuilder,exports.HCS=HCS,exports.HCS10BaseClient=HCS10BaseClient,exports.HCS10Cache=HCS10Cache,exports.HCS10Client=HCS10Client,exports.HCS11Client=HCS11Client,exports.HederaMirrorNode=HederaMirrorNode,exports.InboundTopicType=InboundTopicType,exports.Logger=Logger$2,exports.PayloadSizeError=PayloadSizeError,exports.ProfileType=ProfileType,exports.ProgressReporter=ProgressReporter,exports.Registration=Registration,exports.SUPPORTED_SOCIAL_PLATFORMS=SUPPORTED_SOCIAL_PLATFORMS,exports.TopicCreationError=TopicCreationError,exports.WasmBridge=WasmBridge,exports.accountIdsToExemptKeys=accountIdsToExemptKeys,exports.capabilityNameToCapabilityMap=capabilityNameToCapabilityMap,exports.inscribe=inscribe,exports.inscribeWithSigner=inscribeWithSigner,exports.retrieveInscription=retrieveInscription,exports.sleep=sleep,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
130
130
  //# sourceMappingURL=standards-sdk.umd.js.map