@bluxcc/react 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Networks as e,Transaction as t,Horizon as r,rpc as n,TransactionBuilder as i,Operation as o,Asset as a,Memo as c,StrKey as s}from"@stellar/stellar-sdk";import l,{useState as u,useEffect as d,useRef as f,useMemo as h,useContext as b,createContext as p}from"react";import m from"@lobstrco/signer-extension-api";import g from"@albedo-link/intent";import y,{signTransaction as w}from"@stellar/freighter-api";!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--bluxcc-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--bluxcc-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bluxcc-color-gray-600:#666;--bluxcc-color-gray-700:#4d4d4d;--bluxcc-color-gray-800:#333;--bluxcc-color-black:#000;--bluxcc-spacing:0.25rem;--bluxcc-text-xs:0.75rem;--bluxcc-text-xs--line-height:1.33333;--bluxcc-text-sm:0.875rem;--bluxcc-text-sm--line-height:1.42857;--bluxcc-text-base:1rem;--bluxcc-text-base--line-height:1.5;--bluxcc-text-lg:1.125rem;--bluxcc-text-lg--line-height:1.55556;--bluxcc-text-xl:1.25rem;--bluxcc-text-xl--line-height:1.4;--bluxcc-font-weight-normal:400;--bluxcc-font-weight-medium:500;--bluxcc-font-weight-semibold:600;--bluxcc-animate-spin:spin 1s linear infinite;--bluxcc-default-transition-duration:150ms;--bluxcc-default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--bluxcc-default-font-family:var(--bluxcc-font-sans);--bluxcc-default-mono-font-family:var(--bluxcc-font-mono);--bluxcc-color-alert-error:#ec2929}}@layer base{*,::backdrop,::file-selector-button,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:var(--bluxcc-default-font-feature-settings,normal);-webkit-tap-highlight-color:transparent;font-family:var(--bluxcc-default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-variation-settings:var(--bluxcc-default-font-variation-settings,normal);line-height:1.5;tab-size:4}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:var(--bluxcc-default-mono-font-feature-settings,normal);font-family:var(--bluxcc-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-size:1em;font-variation-settings:var(--bluxcc-default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::file-selector-button,button,input,optgroup,select,textarea{font-feature-settings:inherit;background-color:transparent;border-radius:0;color:inherit;font:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::placeholder{color:currentcolor;@supports (color:color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}::file-selector-button,button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.bluxcc\\:absolute{position:absolute}.bluxcc\\:fixed{position:fixed}.bluxcc\\:relative{position:relative}.bluxcc\\:inset-0{inset:calc(var(--bluxcc-spacing)*0)}.bluxcc\\:right-0{right:calc(var(--bluxcc-spacing)*0)}.bluxcc\\:bottom-0{bottom:calc(var(--bluxcc-spacing)*0)}.bluxcc\\:bottom-4{bottom:calc(var(--bluxcc-spacing)*4)}.bluxcc\\:left-0{left:calc(var(--bluxcc-spacing)*0)}.bluxcc\\:left-1\\/2{left:50%}.bluxcc\\:z-10{z-index:10}.bluxcc\\:z-20{z-index:20}.bluxcc\\:z-40{z-index:40}.bluxcc\\:z-9999{z-index:9999}.bluxcc\\:mx-3{margin-inline:calc(var(--bluxcc-spacing)*3)}.bluxcc\\:\\!my-2{margin-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:my-1{margin-block:calc(var(--bluxcc-spacing)*1)}.bluxcc\\:my-4{margin-block:calc(var(--bluxcc-spacing)*4)}.bluxcc\\:my-6{margin-block:calc(var(--bluxcc-spacing)*6)}.bluxcc\\:\\!mt-4{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:\\!mt-6{margin-top:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mt-0\\.5{margin-top:calc(var(--bluxcc-spacing)*.5)}.bluxcc\\:mt-1{margin-top:calc(var(--bluxcc-spacing)*1)}.bluxcc\\:mt-2{margin-top:calc(var(--bluxcc-spacing)*2)}.bluxcc\\:mt-4{margin-top:calc(var(--bluxcc-spacing)*4)}.bluxcc\\:mt-6{margin-top:calc(var(--bluxcc-spacing)*6)}.bluxcc\\:mt-6\\!{margin-top:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mt-\\[16px\\]{margin-top:16px}.bluxcc\\:\\!mr-2{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mr-1{margin-right:calc(var(--bluxcc-spacing)*1)}.bluxcc\\:mr-2{margin-right:calc(var(--bluxcc-spacing)*2)}.bluxcc\\:\\!mb-4{margin-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mb-1{margin-bottom:calc(var(--bluxcc-spacing)*1)}.bluxcc\\:mb-4{margin-bottom:calc(var(--bluxcc-spacing)*4)}.bluxcc\\:mb-6{margin-bottom:calc(var(--bluxcc-spacing)*6)}.bluxcc\\:ml-2{margin-left:calc(var(--bluxcc-spacing)*2)}.bluxcc\\:ml-4{margin-left:calc(var(--bluxcc-spacing)*4)}.bluxcc\\:ml-auto{margin-left:auto}.bluxcc\\:box-border{box-sizing:border-box}.bluxcc\\:flex{display:flex}.bluxcc\\:inline-flex{display:inline-flex}.bluxcc\\:size-5{height:calc(var(--bluxcc-spacing)*5);width:calc(var(--bluxcc-spacing)*5)}.bluxcc\\:size-8{height:calc(var(--bluxcc-spacing)*8);width:calc(var(--bluxcc-spacing)*8)}.bluxcc\\:size-10{height:calc(var(--bluxcc-spacing)*10);width:calc(var(--bluxcc-spacing)*10)}.bluxcc\\:size-20{height:calc(var(--bluxcc-spacing)*20);width:calc(var(--bluxcc-spacing)*20)}.bluxcc\\:size-\\[68px\\]{height:68px;width:68px}.bluxcc\\:size-\\[73px\\]{height:73px;width:73px}.bluxcc\\:h-4{height:calc(var(--bluxcc-spacing)*4)}.bluxcc\\:h-8{height:calc(var(--bluxcc-spacing)*8)}.bluxcc\\:h-10{height:calc(var(--bluxcc-spacing)*10)}.bluxcc\\:h-12{height:calc(var(--bluxcc-spacing)*12)}.bluxcc\\:h-14{height:calc(var(--bluxcc-spacing)*14)}.bluxcc\\:h-14\\!{height:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:h-20{height:calc(var(--bluxcc-spacing)*20)}.bluxcc\\:h-\\[52px\\]{height:52px}.bluxcc\\:h-\\[60px\\]{height:60px}.bluxcc\\:h-\\[335px\\]{height:335px}.bluxcc\\:h-\\[348px\\]{height:348px}.bluxcc\\:h-full{height:100%}.bluxcc\\:max-h-\\[80px\\]{max-height:80px}.bluxcc\\:max-h-\\[90vh\\]{max-height:90vh}.bluxcc\\:\\!w-\\[360px\\]{width:360px!important}.bluxcc\\:w-12{width:calc(var(--bluxcc-spacing)*12)}.bluxcc\\:w-20{width:calc(var(--bluxcc-spacing)*20)}.bluxcc\\:w-\\[68px\\]\\!{width:68px!important}.bluxcc\\:w-\\[100px\\]{width:100px}.bluxcc\\:w-\\[calc\\(100\\%-3rem\\)\\]{width:calc(100% - 3rem)}.bluxcc\\:w-auto{width:auto}.bluxcc\\:w-full{width:100%}.bluxcc\\:max-w-\\[90px\\]{max-width:90px}.bluxcc\\:max-w-\\[180px\\]{max-width:180px}.bluxcc\\:flex-1{flex:1}.bluxcc\\:shrink-0{flex-shrink:0}.bluxcc\\:grow{flex-grow:1}.bluxcc\\:-translate-x-1\\/2{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.bluxcc\\:transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.bluxcc\\:animate-spin{animation:var(--bluxcc-animate-spin)}.bluxcc\\:cursor-default\\!{cursor:default!important}.bluxcc\\:cursor-pointer{cursor:pointer}.bluxcc\\:cursor-text{cursor:text}.bluxcc\\:flex-col{flex-direction:column}.bluxcc\\:items-center{align-items:center}.bluxcc\\:justify-between{justify-content:space-between}.bluxcc\\:justify-center{justify-content:center}.bluxcc\\:justify-start{justify-content:flex-start}.bluxcc\\:\\!gap-1{gap:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:gap-1{gap:calc(var(--bluxcc-spacing)*1)}.bluxcc\\:gap-2{gap:calc(var(--bluxcc-spacing)*2)}.bluxcc\\:gap-3{gap:calc(var(--bluxcc-spacing)*3)}.bluxcc\\:gap-\\[10px\\]{gap:10px}.bluxcc\\:space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse:0;margin-block-end:calc(var(--bluxcc-spacing)*1*(1 - var(--tw-space-y-reverse)));margin-block-start:calc(var(--bluxcc-spacing)*1*var(--tw-space-y-reverse))}}.bluxcc\\:space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse:0;margin-block-end:calc(var(--bluxcc-spacing)*2*(1 - var(--tw-space-y-reverse)));margin-block-start:calc(var(--bluxcc-spacing)*2*var(--tw-space-y-reverse))}}.bluxcc\\:overflow-hidden{overflow:hidden}.bluxcc\\:overflow-y-auto{overflow-y:auto}.bluxcc\\:rounded-full{border-radius:calc(infinity * 1px)}.bluxcc\\:\\!rounded-b-none{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.bluxcc\\:border{border-style:var(--tw-border-style);border-width:1px}.bluxcc\\:border-2{border-style:var(--tw-border-style);border-width:2px}.bluxcc\\:bg-black\\/10{background-color:var(--bluxcc-color-black);@supports (color:color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--bluxcc-color-black) 10%,transparent)}}.bluxcc\\:bg-transparent{background-color:transparent}.bluxcc\\:p-2{padding:calc(var(--bluxcc-spacing)*2)}.bluxcc\\:p-4{padding:calc(var(--bluxcc-spacing)*4)}.bluxcc\\:\\!px-3{padding-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:px-2{padding-inline:calc(var(--bluxcc-spacing)*2)}.bluxcc\\:px-4{padding-inline:calc(var(--bluxcc-spacing)*4)}.bluxcc\\:px-6{padding-inline:calc(var(--bluxcc-spacing)*6)}.bluxcc\\:px-\\[10px\\]{padding-inline:10px}.bluxcc\\:\\!py-1{padding-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:py-1{padding-block:calc(var(--bluxcc-spacing)*1)}.bluxcc\\:py-2{padding-block:calc(var(--bluxcc-spacing)*2)}.bluxcc\\:py-3{padding-block:calc(var(--bluxcc-spacing)*3)}.bluxcc\\:pt-\\[17px\\]{padding-top:17px}.bluxcc\\:pr-3\\.5{padding-right:calc(var(--bluxcc-spacing)*3.5)}.bluxcc\\:pb-4{padding-bottom:calc(var(--bluxcc-spacing)*4)}.bluxcc\\:pl-\\[10px\\]{padding-left:10px}.bluxcc\\:text-center{text-align:center}.bluxcc\\:text-start{text-align:start}.bluxcc\\:\\!text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:\\!text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:\\!text-xs{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:text-base{font-size:var(--bluxcc-text-base);line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))}.bluxcc\\:text-lg{font-size:var(--bluxcc-text-lg);line-height:var(--tw-leading,var(--bluxcc-text-lg--line-height))}.bluxcc\\:text-sm{font-size:var(--bluxcc-text-sm);line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))}.bluxcc\\:text-xl{font-size:var(--bluxcc-text-xl);line-height:var(--tw-leading,var(--bluxcc-text-xl--line-height))}.bluxcc\\:text-xs{font-size:var(--bluxcc-text-xs);line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))}.bluxcc\\:leading-5{--tw-leading:calc(var(--bluxcc-spacing)*5);line-height:calc(var(--bluxcc-spacing)*5)}.bluxcc\\:leading-\\[28px\\]{--tw-leading:28px;line-height:28px}.bluxcc\\:font-medium{--tw-font-weight:var(--bluxcc-font-weight-medium);font-weight:var(--bluxcc-font-weight-medium)}.bluxcc\\:font-normal{--tw-font-weight:var(--bluxcc-font-weight-normal);font-weight:var(--bluxcc-font-weight-normal)}.bluxcc\\:font-semibold{--tw-font-weight:var(--bluxcc-font-weight-semibold);font-weight:var(--bluxcc-font-weight-semibold)}.bluxcc\\:whitespace-nowrap{white-space:nowrap}.bluxcc\\:text-alert-error{color:var(--bluxcc-color-alert-error)}.bluxcc\\:text-gray-600{color:var(--bluxcc-color-gray-600)}.bluxcc\\:text-gray-700{color:var(--bluxcc-color-gray-700)}.bluxcc\\:text-gray-800{color:var(--bluxcc-color-gray-800)}.bluxcc\\:capitalize{text-transform:capitalize}.bluxcc\\:\\!shadow-\\[0px_4px_80px_0px_\\#00000008\\]{--tw-shadow:0px 4px 80px 0px var(--tw-shadow-color,#00000008)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.bluxcc\\:outline-hidden{--tw-outline-style:none;outline-style:none;@media (forced-colors:active){outline:2px solid transparent;outline-offset:2px}}.bluxcc\\:\\!backdrop-blur-\\[1px\\]{--tw-backdrop-blur:blur(1px)!important;-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)!important;backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)!important}.bluxcc\\:transition-\\[border-radius\\,background\\,border-color\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration));transition-property:border-radius,background,border-color;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))}.bluxcc\\:transition-\\[border-radius\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration));transition-property:border-radius;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))}.bluxcc\\:transition-all{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration));transition-property:all;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))}.bluxcc\\:duration-150{--tw-duration:150ms;transition-duration:.15s}.bluxcc\\:duration-300{--tw-duration:300ms;transition-duration:.3s}.bluxcc\\:select-none{-webkit-user-select:none;user-select:none}.bluxcc\\:focus\\:ring-1{&:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.bluxcc\\:focus\\:outline-hidden{&:focus{--tw-outline-style:none;outline-style:none;@media (forced-colors:active){outline:2px solid transparent;outline-offset:2px}}}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.bluxcc\\:animate-fadeIn{animation:fadeIn .5s ease-in-out}.bluxcc\\:animate-fadeOut{animation:fadeOut .5s ease-in-out}#bluxcc-input[type=number]::-webkit-inner-spin-button,#bluxcc-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0}#bluxcc-input[type=number]{-moz-appearance:textfield!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(1turn)}}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}');const v={mainnet:e.PUBLIC,testnet:e.TESTNET,sandbox:e.SANDBOX,futurenet:e.FUTURENET,standalone:e.STANDALONE},x=({fill:e="#5F6367"})=>l.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_117_204",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20"},l.createElement("rect",{width:"20",height:"20",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_117_204)"},l.createElement("path",{d:"M6.67929 18.0448L5.49658 16.862L12.3587 9.99996L5.49658 3.13788L6.67929 1.95517L14.7241 9.99996L6.67929 18.0448Z",fill:e}))),E=({fill:e="#5F6367"})=>l.createElement("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_170_30135",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"25"},l.createElement("rect",{y:"0.5",width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_170_30135)"},l.createElement("path",{d:"M16 22.5L6 12.5L16 2.5L17.775 4.275L9.55 12.5L17.775 20.725L16 22.5Z",fill:e}))),C=({fill:e="#5F6367"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2032_3674",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2032_3674)"},l.createElement("path",{d:"M5.26689 20L3.99994 18.7331L10.733 12L3.99994 5.26696L5.26689 4L11.9999 10.733L18.733 4L19.9999 5.26696L13.2669 12L19.9999 18.7331L18.733 20L11.9999 13.267L5.26689 20Z",fill:e}))),_=({fill:e="#0C1083"})=>l.createElement("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"bluxcc:animate-spin"},l.createElement("mask",{id:"mask0_2054_770",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"25",height:"24"},l.createElement("rect",{x:"0.5",width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2054_770)"},l.createElement("path",{d:"M12.497 21.5C11.1965 21.5 9.96875 21.2508 8.81375 20.7525C7.65892 20.2542 6.65042 19.5739 5.78825 18.7118C4.92608 17.8496 4.24583 16.8411 3.7475 15.6863C3.24917 14.5313 3 13.3035 3 12.003C3 10.6867 3.24967 9.45358 3.749 8.30375C4.24833 7.15375 4.92817 6.14867 5.7885 5.2885C6.64867 4.42817 7.65733 3.74833 8.8145 3.249C9.97167 2.74967 11.2002 2.5 12.5 2.5V4C10.2833 4 8.39583 4.77917 6.8375 6.3375C5.27917 7.89583 4.5 9.78333 4.5 12C4.5 14.2167 5.27917 16.1042 6.8375 17.6625C8.39583 19.2208 10.2833 20 12.5 20C14.7167 20 16.6042 19.2208 18.1625 17.6625C19.7208 16.1042 20.5 14.2167 20.5 12H22C22 13.2998 21.7503 14.5283 21.251 15.6855C20.7517 16.8427 20.0718 17.8513 19.2115 18.7115C18.3513 19.5718 17.3462 20.2517 16.1962 20.751C15.0464 21.2503 13.8133 21.5 12.497 21.5Z",fill:e}))),M=({fill:e="#0C1083"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_1027_16479",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_1027_16479)"},l.createElement("path",{d:"M19.5421 20.577L13.2613 14.296C12.7613 14.7088 12.1863 15.0319 11.5363 15.2653C10.8863 15.4986 10.2139 15.6153 9.51906 15.6153C7.80989 15.6153 6.36339 15.0235 5.17956 13.84C3.99573 12.6565 3.40381 11.2103 3.40381 9.50152C3.40381 7.79285 3.99556 6.34618 5.17906 5.16152C6.36256 3.97702 7.80873 3.38477 9.51756 3.38477C11.2262 3.38477 12.6729 3.97668 13.8576 5.16051C15.0421 6.34435 15.6343 7.79085 15.6343 9.50002C15.6343 10.2142 15.5145 10.8963 15.2748 11.5463C15.035 12.1963 14.7151 12.7616 14.3151 13.2423L20.5958 19.523L19.5421 20.577ZM9.51906 14.1155C10.8076 14.1155 11.8989 13.6683 12.7931 12.774C13.6874 11.8798 14.1346 10.7885 14.1346 9.50002C14.1346 8.21152 13.6874 7.12018 12.7931 6.22601C11.8989 5.33168 10.8076 4.88452 9.51906 4.88452C8.23056 4.88452 7.13923 5.33168 6.24506 6.22601C5.35073 7.12018 4.90356 8.21152 4.90356 9.50002C4.90356 10.7885 5.35073 11.8798 6.24506 12.774C7.13923 13.6683 8.23056 14.1155 9.51906 14.1155Z",fill:e}))),A=()=>l.createElement("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("circle",{cx:"34",cy:"34",r:"34",fill:"#DCEFE9"}),l.createElement("rect",{width:"40",height:"40",transform:"translate(14 14)",fill:"#DCEFE9"}),l.createElement("mask",{id:"mask0_2519_3056",maskUnits:"userSpaceOnUse",x:"14",y:"14",width:"40",height:"40"},l.createElement("rect",{x:"14",y:"14",width:"40",height:"40",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2519_3056)"},l.createElement("path",{d:"M31.6347 41.0894L42.8397 29.8844L41.0834 28.1282L31.6347 37.5769L26.8847 32.8269L25.1284 34.5832L31.6347 41.0894ZM34.003 49.8332C31.813 49.8332 29.7545 49.4176 27.8276 48.5865C25.9006 47.7554 24.2245 46.6275 22.7992 45.2028C21.374 43.778 20.2455 42.1026 19.4138 40.1765C18.5824 38.2504 18.1667 36.1925 18.1667 34.0028C18.1667 31.8128 18.5823 29.7543 19.4134 27.8273C20.2445 25.9004 21.3724 24.2243 22.7972 22.799C24.2219 21.3737 25.8973 20.2453 27.8234 19.4136C29.7495 18.5822 31.8074 18.1665 33.9972 18.1665C36.1872 18.1665 38.2456 18.5821 40.1726 19.4132C42.0995 20.2443 43.7756 21.3722 45.2009 22.7969C46.6262 24.2216 47.7547 25.8971 48.5863 27.8232C49.4177 29.7493 49.8334 31.8072 49.8334 33.9969C49.8334 36.1869 49.4179 38.2454 48.5867 40.1723C47.7556 42.0993 46.6277 43.7754 45.203 45.2007C43.7783 46.6259 42.1029 47.7544 40.1767 48.5861C38.2506 49.4175 36.1927 49.8332 34.003 49.8332Z",fill:"#00BD81"}))),S=({fill:e="#666666"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2054_469",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2054_469)"},l.createElement("path",{d:"M20.3713 12.75H8.577V11.25H20.3713L18.552 9.43075L19.6057 8.34625L23.2595 12L19.6057 15.6538L18.552 14.5693L20.3713 12.75ZM15.202 8.86525V5H5V19H15.202V15.1348H16.702V20.5H3.5V3.5H16.702V8.86525H15.202Z",fill:e}))),k=({fill:e="#4D4D4D"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2054_791",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2054_791)"},l.createElement("path",{d:"M7.25 17.5V2.5H19.25V17.5H7.25ZM8.75 16H17.75V4H8.75V16ZM3.75 21V6.30775H5.25V19.5H15.4423V21H3.75Z",fill:e}))),I=({fill:e="#0C1083"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2054_838",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2054_838)"},l.createElement("path",{d:"M12 21.5C9.54899 21.5 7.42215 20.6913 5.61949 19.074C3.81682 17.4567 2.79365 15.432 2.54999 13H4.07499C4.31865 15.0167 5.19557 16.6875 6.70574 18.0125C8.21607 19.3375 9.98082 20 12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C10.4962 4 9.11249 4.38625 7.84899 5.15875C6.58549 5.93108 5.61149 6.99033 4.92699 8.3365H7.88449V9.8365H2.75774C3.26024 7.68267 4.37207 5.9215 6.09324 4.553C7.8144 3.18433 9.78332 2.5 12 2.5C13.3142 2.5 14.5492 2.74933 15.705 3.248C16.8608 3.74667 17.8662 4.42342 18.7212 5.27825C19.5762 6.13308 20.2531 7.13833 20.7517 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9983C21.5 13.3123 21.2506 14.5473 20.7517 15.7035C20.2531 16.8597 19.5762 17.8653 18.7212 18.7205C17.8662 19.5757 16.8608 20.2528 15.705 20.7518C14.5492 21.2506 13.3142 21.5 12 21.5ZM14.723 15.777L11.25 12.3025V7.3655H12.75V11.6962L15.7672 14.723L14.723 15.777Z",fill:e}))),B=({fill:e="#0C1083"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2054_817",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2054_817)"},l.createElement("path",{d:"M3.5 19.25V4.75L20.7115 12L3.5 19.25ZM5 17L16.85 12L5 7V10.6923L10.423 12L5 13.3077V17Z",fill:e}))),N=({fill:e="#0C1083"})=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2204_971",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16"},l.createElement("rect",{width:"16",height:"16",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2204_971)"},l.createElement("path",{d:"M5.06372 11.8333L7.99955 8.89746L10.9354 11.8333H5.06372Z",fill:e}))),L=()=>l.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{x:"0.5",y:"0.5",width:"39",height:"39",rx:"19.5",fill:"transparent",stroke:"#00BD81"}),l.createElement("mask",{id:"mask0_2212_3318",maskUnits:"userSpaceOnUse",x:"8",y:"8",width:"24",height:"24"},l.createElement("rect",{x:"8",y:"8",width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2212_3318)"},l.createElement("path",{d:"M19.25 23.6923H20.7595V19.1365L22.6095 20.9865L23.6538 19.9423L20.0095 16.298L16.3558 19.9423L17.4 20.9865L19.25 19.1365V23.6923ZM20.0017 29.5C18.6877 29.5 17.4527 29.2507 16.2965 28.752C15.1403 28.2533 14.1347 27.5766 13.2795 26.7218C12.4243 25.8669 11.7472 24.8617 11.2482 23.706C10.7494 22.5503 10.5 21.3156 10.5 20.0017C10.5 18.6877 10.7493 17.4527 11.248 16.2965C11.7467 15.1403 12.4234 14.1347 13.2783 13.2795C14.1331 12.4243 15.1383 11.7472 16.294 11.2482C17.4497 10.7494 18.6844 10.5 19.9983 10.5C21.3123 10.5 22.5473 10.7493 23.7035 11.248C24.8597 11.7467 25.8653 12.4234 26.7205 13.2783C27.5757 14.1331 28.2528 15.1383 28.7518 16.294C29.2506 17.4497 29.5 18.6844 29.5 19.9983C29.5 21.3123 29.2507 22.5473 28.752 23.7035C28.2533 24.8597 27.5766 25.8653 26.7218 26.7205C25.8669 27.5757 24.8617 28.2528 23.706 28.7518C22.5503 29.2506 21.3156 29.5 20.0017 29.5ZM20 28C22.2333 28 24.125 27.225 25.675 25.675C27.225 24.125 28 22.2333 28 20C28 17.7667 27.225 15.875 25.675 14.325C24.125 12.775 22.2333 12 20 12C17.7667 12 15.875 12.775 14.325 14.325C12.775 15.875 12 17.7667 12 20C12 22.2333 12.775 24.125 14.325 25.675C15.875 27.225 17.7667 28 20 28Z",fill:"#00BD81"}))),T=()=>l.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{x:"0.5",y:"0.5",width:"39",height:"39",rx:"19.5",fill:"transparent",stroke:"#00BD81"}),l.createElement("mask",{id:"mask0_2494_9033",maskUnits:"userSpaceOnUse",x:"8",y:"8",width:"24",height:"24"},l.createElement("rect",{x:"8",y:"8",width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2494_9033)"},l.createElement("path",{d:"M12.577 25.9728C12.0142 25.255 11.5587 24.4749 11.2105 23.6326C10.8625 22.7902 10.6321 21.9126 10.5193 20.9998H12.05C12.15 21.7165 12.3334 22.404 12.6 23.0623C12.8667 23.7206 13.2167 24.3331 13.65 24.8998L12.577 25.9728ZM10.5193 18.9998C10.6398 18.087 10.8722 17.2094 11.2165 16.3671C11.5607 15.5247 12.0206 14.7511 12.5963 14.0461L13.65 15.0998C13.2167 15.6665 12.8667 16.279 12.6 16.9373C12.3334 17.5956 12.15 18.2831 12.05 18.9998H10.5193ZM18.95 29.4498C18.0372 29.3433 17.1638 29.1154 16.3298 28.7661C15.4958 28.4167 14.718 27.9626 13.9963 27.4036L15.05 26.2998C15.6334 26.7331 16.25 27.0915 16.9 27.3748C17.55 27.6581 18.2334 27.8498 18.95 27.9498V29.4498ZM15.1 13.6806L13.9963 12.5961C14.7346 12.0306 15.525 11.5764 16.3673 11.2336C17.2096 10.8906 18.0872 10.6626 19 10.5498V12.0498C18.2834 12.1498 17.5959 12.3366 16.9375 12.6103C16.2792 12.8841 15.6667 13.2409 15.1 13.6806ZM20.95 29.4498V27.9498C21.677 27.8498 22.3729 27.6655 23.0375 27.3968C23.7022 27.1283 24.323 26.7691 24.9 26.3191L26.0038 27.4036C25.2655 27.9792 24.471 28.436 23.6203 28.7738C22.7696 29.1116 21.8795 29.337 20.95 29.4498ZM24.95 13.6998C24.3667 13.2665 23.7417 12.9081 23.075 12.6248C22.4084 12.3415 21.7167 12.1498 21 12.0498V10.5498C21.9129 10.6563 22.793 10.8826 23.6403 11.2288C24.4878 11.5748 25.2756 12.0306 26.0038 12.5961L24.95 13.6998ZM27.4038 25.9536L26.35 24.8998C26.7834 24.3331 27.1334 23.7206 27.4 23.0623C27.6667 22.404 27.85 21.7165 27.95 20.9998H29.4808C29.3603 21.9126 29.1279 22.7902 28.7835 23.6326C28.4394 24.4749 27.9795 25.2486 27.4038 25.9536ZM27.95 18.9998C27.85 18.2831 27.6667 17.5956 27.4 16.9373C27.1334 16.279 26.7834 15.6665 26.35 15.0998L27.423 14.0268C27.9859 14.7446 28.4414 15.5247 28.7895 16.3671C29.1375 17.2094 29.368 18.087 29.4808 18.9998H27.95Z",fill:"#00BD81"}),l.createElement("circle",{cx:"20",cy:"20",r:"3",fill:"#00BD81"}))),O=()=>l.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{x:"0.5",y:"0.5",width:"39",height:"39",rx:"19.5",fill:"transparent",stroke:"#00BD81"}),l.createElement("mask",{id:"mask0_2214_3828",maskUnits:"userSpaceOnUse",x:"8",y:"8",width:"24",height:"24"},l.createElement("rect",{x:"8",y:"8",width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2214_3828)"},l.createElement("path",{d:"M20.0095 23.6923L23.6538 20.048L22.6095 19.004L20.7595 20.854V16.298H19.25V20.854L17.4 19.004L16.3558 20.048L20.0095 23.6923ZM20.0017 29.5C18.6877 29.5 17.4527 29.2507 16.2965 28.752C15.1403 28.2533 14.1347 27.5766 13.2795 26.7218C12.4243 25.8669 11.7472 24.8617 11.2482 23.706C10.7494 22.5503 10.5 21.3156 10.5 20.0017C10.5 18.6877 10.7493 17.4527 11.248 16.2965C11.7467 15.1403 12.4234 14.1347 13.2783 13.2795C14.1331 12.4243 15.1383 11.7472 16.294 11.2482C17.4497 10.7494 18.6844 10.5 19.9983 10.5C21.3123 10.5 22.5473 10.7493 23.7035 11.248C24.8597 11.7467 25.8653 12.4234 26.7205 13.2783C27.5757 14.1331 28.2528 15.1383 28.7518 16.294C29.2506 17.4497 29.5 18.6844 29.5 19.9983C29.5 21.3123 29.2507 22.5473 28.752 23.7035C28.2533 24.8597 27.5766 25.8653 26.7218 26.7205C25.8669 27.5757 24.8617 28.2528 23.706 28.7518C22.5503 29.2506 21.3156 29.5 20.0017 29.5ZM20 28C22.2333 28 24.125 27.225 25.675 25.675C27.225 24.125 28 22.2333 28 20C28 17.7667 27.225 15.875 25.675 14.325C24.125 12.775 22.2333 12 20 12C17.7667 12 15.875 12.775 14.325 14.325C12.775 15.875 12 17.7667 12 20C12 22.2333 12.775 24.125 14.325 25.675C15.875 27.225 17.7667 28 20 28Z",fill:"#00BD81"}))),R=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2265_983",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2265_983)"},l.createElement("path",{d:"M8.00081 14.3337C7.13248 14.3337 6.31304 14.1672 5.54248 13.8343C4.77193 13.5014 4.09993 13.0482 3.52648 12.4747C2.95293 11.9012 2.4997 11.2292 2.16681 10.4587C1.83393 9.6881 1.66748 8.86866 1.66748 8.00033C1.66748 7.1251 1.83393 6.30394 2.16681 5.53683C2.4997 4.76972 2.95293 4.09944 3.52648 3.52599C4.09993 2.95244 4.77193 2.49921 5.54248 2.16633C6.31304 1.83344 7.13248 1.66699 8.00081 1.66699C8.87604 1.66699 9.6972 1.83344 10.4643 2.16633C11.2314 2.49921 11.9017 2.95244 12.4751 3.52599C13.0487 4.09944 13.5019 4.76972 13.8348 5.53683C14.1677 6.30394 14.3341 7.1251 14.3341 8.00033C14.3341 8.86866 14.1677 9.6881 13.8348 10.4587C13.5019 11.2292 13.0487 11.9012 12.4751 12.4747C11.9017 13.0482 11.2314 13.5014 10.4643 13.8343C9.6972 14.1672 8.87604 14.3337 8.00081 14.3337ZM8.00081 13.3195C8.34104 12.8683 8.62737 12.4132 8.85982 11.9542C9.09226 11.4952 9.28159 10.9934 9.42782 10.449H6.57381C6.72859 11.0106 6.92009 11.5208 7.14832 11.9798C7.37643 12.4388 7.66059 12.8854 8.00081 13.3195ZM6.70982 13.1362C6.45426 12.7695 6.22476 12.3527 6.02132 11.8857C5.81787 11.4185 5.65976 10.9397 5.54698 10.449H3.28548C3.63759 11.1413 4.10981 11.723 4.70215 12.194C5.29448 12.6649 5.9637 12.9789 6.70982 13.1362ZM9.29182 13.1362C10.0379 12.9789 10.7071 12.6649 11.2995 12.194C11.8918 11.723 12.364 11.1413 12.7161 10.449H10.4546C10.3204 10.9439 10.1516 11.4249 9.94815 11.892C9.74482 12.3591 9.52604 12.7738 9.29182 13.1362ZM2.86615 9.44899H5.34448C5.30259 9.20122 5.2722 8.95827 5.25331 8.72016C5.23454 8.48216 5.22515 8.24222 5.22515 8.00033C5.22515 7.75844 5.23454 7.51849 5.25331 7.28049C5.2722 7.04238 5.30259 6.79944 5.34448 6.55166H2.86615C2.80204 6.7781 2.75293 7.01355 2.71881 7.25799C2.68459 7.50244 2.66748 7.74988 2.66748 8.00033C2.66748 8.25077 2.68459 8.49822 2.71881 8.74266C2.75293 8.98711 2.80204 9.22255 2.86615 9.44899ZM6.34431 9.44899H9.65732C9.69909 9.20122 9.72943 8.96044 9.74831 8.72666C9.76709 8.49288 9.77648 8.25077 9.77648 8.00033C9.77648 7.74988 9.76709 7.50777 9.74831 7.27399C9.72943 7.04022 9.69909 6.79944 9.65732 6.55166H6.34431C6.30254 6.79944 6.2722 7.04022 6.25331 7.27399C6.23454 7.50777 6.22515 7.74988 6.22515 8.00033C6.22515 8.25077 6.23454 8.49288 6.25331 8.72666C6.2722 8.96044 6.30254 9.20122 6.34431 9.44899ZM10.6571 9.44899H13.1355C13.1996 9.22255 13.2487 8.98711 13.2828 8.74266C13.317 8.49822 13.3341 8.25077 13.3341 8.00033C13.3341 7.74988 13.317 7.50244 13.2828 7.25799C13.2487 7.01355 13.1996 6.7781 13.1355 6.55166H10.6571C10.699 6.79944 10.7294 7.04238 10.7483 7.28049C10.7671 7.51849 10.7765 7.75844 10.7765 8.00033C10.7765 8.24222 10.7671 8.48216 10.7483 8.72016C10.7294 8.95827 10.699 9.20122 10.6571 9.44899ZM10.4546 5.55166H12.7161C12.3598 4.85077 11.8908 4.2691 11.3091 3.80666C10.7275 3.34433 10.055 3.0281 9.29182 2.85799C9.54737 3.24599 9.7747 3.67038 9.97382 4.13116C10.173 4.59183 10.3333 5.06533 10.4546 5.55166ZM6.57381 5.55166H9.42782C9.27304 4.99433 9.07837 4.48083 8.84382 4.01116C8.60915 3.54149 8.32815 3.09816 8.00081 2.68116C7.67348 3.09816 7.39248 3.54149 7.15781 4.01116C6.92326 4.48083 6.72859 4.99433 6.57381 5.55166ZM3.28548 5.55166H5.54698C5.66831 5.06533 5.82859 4.59183 6.02781 4.13116C6.22693 3.67038 6.45426 3.24599 6.70982 2.85799C5.94226 3.0281 5.26876 3.34544 4.68931 3.80999C4.10976 4.27444 3.64181 4.85499 3.28548 5.55166Z",fill:"#666666"}))),P=({fill:e="#0C1083"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2324_772",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2324_772)"},l.createElement("path",{d:"M12 1.59619L21.5 7.25369V20.4999H2.5V7.25369L12 1.59619ZM12 12.6499L19.8 7.99994L12 3.34994L4.2 7.99994L12 12.6499ZM12 14.4037L4 9.62294V18.9999H20V9.62294L12 14.4037Z",fill:e}))),U=({fill:e="#0C1083"})=>l.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2097_3575",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},l.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2097_3575)"},l.createElement("path",{d:"M20 2.66113L35.8334 12.0903V34.1674H4.16669V12.0903L20 2.66113ZM20 21.0841L33 13.3341L20 5.58405L7.00002 13.3341L20 21.0841ZM20 24.007L6.66669 16.0391V31.6674H33.3334V16.0391L20 24.007Z",fill:e}))),z=()=>l.createElement("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("circle",{cx:"34",cy:"34",r:"34",fill:"#FFDEDE"}),l.createElement("mask",{id:"mask0_2497_9140",maskUnits:"userSpaceOnUse",x:"14",y:"14",width:"40",height:"40"},l.createElement("rect",{x:"14",y:"14",width:"40",height:"40",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2497_9140)"},l.createElement("path",{d:"M33.9995 41.1662C34.2356 41.1662 34.4335 41.0863 34.5933 40.9266C34.753 40.7669 34.8328 40.569 34.8328 40.3328C34.8328 40.0967 34.753 39.8988 34.5933 39.7391C34.4335 39.5794 34.2356 39.4995 33.9995 39.4995C33.7634 39.4995 33.5655 39.5794 33.4058 39.7391C33.246 39.8988 33.1662 40.0967 33.1662 40.3328C33.1662 40.569 33.246 40.7669 33.4058 40.9266C33.5655 41.0863 33.7634 41.1662 33.9995 41.1662ZM33.4162 35.9995H34.5828V25.9995H33.4162V35.9995ZM34.0066 48.4995C32.0019 48.4995 30.1167 48.1191 28.3512 47.3583C26.5856 46.5974 25.0499 45.5648 23.7441 44.2603C22.438 42.9559 21.4041 41.4221 20.6424 39.6591C19.8805 37.8958 19.4995 36.0116 19.4995 34.0066C19.4995 32.0019 19.8799 30.1167 20.6408 28.3512C21.4016 26.5856 22.4342 25.0499 23.7387 23.7441C25.0431 22.438 26.5769 21.4041 28.3399 20.6424C30.1033 19.8805 31.9874 19.4995 33.9924 19.4995C35.9972 19.4995 37.8823 19.8799 39.6478 20.6408C41.4134 21.4016 42.9491 22.4342 44.2549 23.7387C45.561 25.0431 46.5949 26.5769 47.3566 28.3399C48.1185 30.1033 48.4995 31.9874 48.4995 33.9924C48.4995 35.9972 48.1191 37.8823 47.3583 39.6478C46.5974 41.4134 45.5648 42.9491 44.2603 44.2549C42.9559 45.561 41.4222 46.5949 39.6591 47.3566C37.8958 48.1185 36.0116 48.4995 34.0066 48.4995Z",fill:"#EC2929"}))),j=({icon:e,onInfo:t,onBack:r,title:n,closeButton:i=!1,onClose:o})=>{const a=Yo();return l.createElement("div",{className:"bluxcc:flex bluxcc:h-[60px] bluxcc:w-full bluxcc:items-center bluxcc:justify-between"},"info"===e?l.createElement("div",{onClick:t,className:"bluxcc:flex bluxcc:size-5 bluxcc:items-center bluxcc:justify-center"}):"back"===e?l.createElement("div",{onClick:r,className:"bluxcc:flex bluxcc:size-5 bluxcc:cursor-pointer bluxcc:items-center bluxcc:justify-center"},l.createElement(E,{fill:a.value.config.appearance.textColor})):l.createElement("div",{className:"bluxcc:size-5"}),l.createElement("p",{className:"bluxcc:grow bluxcc:select-none bluxcc:text-center bluxcc:text-base bluxcc:font-medium"},n),i?l.createElement("div",{onClick:o,className:"bluxcc:size-5 bluxcc:cursor-pointer"},l.createElement(C,{fill:a.value.config.appearance.textColor})):l.createElement("div",{className:"bluxcc:size-5"}))},F=({isClosing:e,onClose:t,isSticky:r=!1})=>l.createElement("div",{className:"bluxcc:fixed bluxcc:inset-0 bluxcc:z-40 bluxcc:bg-black/10 bluxcc:!backdrop-blur-[1px] "+(e&&!r?"bluxcc:animate-fadeOut":"bluxcc:animate-fadeIn"),onClick:t}),D=({isOpen:e,onClose:t=()=>{},onBack:r,onInfo:n,children:i,title:o,icon:a,isSticky:c=!1,closeButton:s=!0})=>{const[h,b]=u("auto"),[p,m]=u(!1),[g,y]=u(!1),w=f(null),v=Yo(),{isOpening:x,isClosing:E,handleClose:C}=(e=>{const[t,r]=u({isOpening:!0,isClosing:!1,hasTransition:!1});return d((()=>{if(e&&t.isOpening){const e=setTimeout((()=>{r((e=>({...e,isOpening:!1})))}),300);return()=>clearTimeout(e)}}),[e,t.isOpening]),{...t,setHasTransition:e=>r((t=>({...t,hasTransition:e}))),handleClose:e=>{r((e=>({...e,isClosing:!0}))),setTimeout((()=>{r((e=>({...e,isClosing:!1}))),e()}),300)}}})(e),{appearance:_}=v.value.config;return d((()=>{const e=()=>m(window.innerWidth<760);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),d((()=>{if(!e||!w.current)return;b(w.current.offsetHeight),y(!0);const t=new ResizeObserver((()=>{w.current&&b(w.current.offsetHeight)}));return t.observe(w.current),()=>t.disconnect()}),[e,i]),e?l.createElement(l.Fragment,null,!v.value.isDemo&&l.createElement(F,{isClosing:E,isSticky:c,onClose:()=>C(t)}),l.createElement("div",{className:`bluxcc:absolute bluxcc:inset-0 bluxcc:z-9999 bluxcc:flex bluxcc:items-center bluxcc:justify-center ${E&&!c&&"bluxcc:animate-fadeOut"}`,onClick:e=>e.target===e.currentTarget&&C(t)},l.createElement("div",{className:"bluxcc:box-border bluxcc:overflow-hidden bluxcc:!shadow-[0px_4px_80px_0px_#00000008] bluxcc:transition-all "+(p?"bluxcc:fixed bluxcc:bottom-0 bluxcc:left-0 bluxcc:max-h-[90vh] bluxcc:w-full bluxcc:!rounded-b-none":"bluxcc:relative bluxcc:!w-[360px]"),style:{height:"number"==typeof h?`${p?h+40:h}px`:h,transition:g?"height 300ms ease-in-out, border-radius 300ms, opacity 300ms ease-out"+(p?", transform 300ms ease-out":""):"border-radius 300ms, opacity 300ms ease-out"+(p?", transform 300ms ease-out":""),transform:p?x||E?"translateY(100%)":"translateY(0%)":"none",backgroundColor:_.background,opacity:E&&!c?"0":"1",color:_.textColor,fontFamily:_.font,letterSpacing:"-0.04px",outlineStyle:"solid",outlineColor:_.borderColor,outlineWidth:_.borderWidth,borderRadius:_.borderRadius}},l.createElement("div",{ref:w,className:"bluxcc:px-6 bluxcc:pb-4"},l.createElement(j,{icon:a,onInfo:n,onBack:r,title:o,closeButton:s,onClose:()=>C(t)}),i)))):null};var H,K,q;function V(e,t=!1){const r="number"==typeof e?e:parseFloat(e);if(isNaN(r)||0===r)return"0";if(r<1e-6)return e.toString();if(t){if(r>=1e6)return`${(r/1e6).toFixed(2)}m`;if(r>=1e3)return`${(r/1e3).toFixed(2)}k`}return function(e){const[t,r]=e.split(".");return r?`${t.replace(/\B(?=(\d{3})+(?!\d))/g,",")}.${r}`:t.replace(/\B(?=(\d{3})+(?!\d))/g,",")}(function(e){var t;const r=e.toString(),[n,i=""]=r.split(".");if(!i)return n;const o=null!==(t={0:8,1:7,2:6,3:5,4:4,5:3,6:2}[n.length])&&void 0!==t?t:0;if(o>0){const e=`${n}.${i.slice(0,o)}`,t=parseFloat(e);return Number.isInteger(t)?n:t.toFixed(2)}return n}(r))}!function(e){e.Rabet="Rabet",e.Albedo="Albedo",e.Freighter="Freighter",e.Xbull="xBull",e.Lobstr="LOBSTR",e.Hana="Hana",e.Hot="Hot"}(H||(H={})),function(e){e.PUBLIC="Public Global Stellar Network ; September 2015",e.TESTNET="Test SDF Network ; September 2015",e.FUTURENET="Test SDF Future Network ; October 2022",e.SANDBOX="Local Sandbox Stellar Network ; September 2022",e.STANDALONE="Standalone Network ; February 2017"}(K||(K={})),function(e){e.ONBOARDING="ONBOARDING",e.WRONG_NETWORK="WRONG_NETWORK",e.WAITING="WAITING",e.SUCCESSFUL="SUCCESSFUL",e.PROFILE="PROFILE",e.SIGN_TRANSACTION="SIGN_TRANSACTION",e.SEND="SEND",e.ACTIVITY="ACTIVITY",e.OTP="OTP"}(q||(q={}));const W=({assets:e,setSelectedAsset:t,setShowSelectAssetPage:r})=>{const n=Yo(),i=n.value.config.appearance,[o,a]=u(!1),[c,s]=u(""),[d,f]=u(null),h=()=>o?i.accent:i.borderColor;return n.value.account.loading?l.createElement("div",null,"Loading"):l.createElement("div",{className:"bluxcc:h-[348px]"},l.createElement("div",null,l.createElement("div",{onFocus:()=>a(!0),onBlur:()=>a(!1),onMouseEnter:e=>{o||(e.currentTarget.style.borderColor=i.accent,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:e=>{o||(e.currentTarget.style.borderColor=i.borderColor)},className:"bluxcc:flex bluxcc:h-14 bluxcc:items-center bluxcc:gap-2 bluxcc:p-4",style:{background:i.bgField,borderWidth:i.includeBorders?i.borderWidth:"1px","--tw-ring-color":h(),borderRadius:i.borderRadius,borderColor:h(),color:i.textColor}},l.createElement(M,{fill:i.textColor}),l.createElement("input",{autoFocus:!0,type:"text",placeholder:"Search",value:c,onChange:e=>s(e.target.value),className:"bluxcc:bg-transparent bluxcc:outline-hidden",style:{color:i.textColor}}))),l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:mt-4 bluxcc:gap-2 bluxcc:overflow-y-auto"},e.map(((n,o)=>l.createElement("div",{key:n.assetType+n.assetIssuer,onClick:()=>{(e=>{t(e),r(!1)})(n)},onMouseEnter:()=>f(o),onMouseLeave:()=>f(null),className:"bluxcc:flex bluxcc:cursor-pointer bluxcc:items-center bluxcc:justify-between bluxcc:px-4 bluxcc:py-3",style:{background:d===o?i.bgField:"transparent",color:i.textColor,borderBottomStyle:"dashed",borderBottomWidth:o<e.length-1?i.includeBorders?i.borderWidth:"1px":"0px",borderBottomColor:i.borderColor,transition:"all 0.2s ease-in-out"}},l.createElement("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-[10px]"},l.createElement("span",{className:"bluxcc:font-medium"},n.logo),l.createElement("div",{className:"bluxcc:flex bluxcc:flex-col"},l.createElement("span",{className:"bluxcc:text-xs bluxcc:font-medium"},n.assetCode),l.createElement("span",{className:"bluxcc:text-xs"},n.assetCode))),l.createElement("span",{className:"bluxcc:font-medium"},V(n.balance))))),0===e.length&&l.createElement("div",{style:{color:i.textColor},className:"bluxcc:mt-2 bluxcc:text-center"},"No assets found")))},Z=e=>{const t=e.replace("#","");return(.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5?"#000000":"#FFFFFF"},$={small:"bluxcc:h-8 bluxcc:!text-sm bluxcc:gap-1",medium:"bluxcc:h-10 bluxcc:!text-sm bluxcc:gap-2",large:"bluxcc:h-[52px] bluxcc:!text-base bluxcc:gap-2"},G=({size:e="large",variant:t="outline",state:r="enabled",children:n,startIcon:i,endIcon:o,onClick:a,style:c,className:s})=>{const u=Yo().value.config.appearance,d={borderRadius:u.borderRadius,cursor:"disabled"===r?"not-allowed":"pointer",opacity:"disabled"===r?.5:1,pointerEvents:"disabled"===r?"none":void 0,...c};return"outline"===t?Object.assign(d,{border:`1px solid ${u.borderColor}`,color:u.accent,backgroundColor:u.background,borderWidth:u.includeBorders?u.borderWidth:"1px"}):"fill"===t?Object.assign(d,{backgroundColor:u.accent,fontWeight:"500",color:Z(u.accent)}):"text"===t&&Object.assign(d,{color:u.accent,backgroundColor:"transparent"}),"selected"===r&&(d.boxShadow=`0 0 0 2px ${u.accent}`),l.createElement("button",{onClick:a,disabled:"disabled"===r,className:`bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:px-[10px] bluxcc:transition-all bluxcc:w-full ${$[e]} ${null!=s?s:""} bluxcc:transition-all bluxcc:duration-300`,style:d},i&&l.createElement("span",null,i),l.createElement("span",null,n),o&&l.createElement("span",null,o))},X=(e,r)=>{try{const n=new t(e,r),i=n.operations[0];let o=null;return"payment"===i.type&&(o=i.destination),{action:i.type,operations:n.operations.length,sender:n.source,receiver:o,estimatedFee:Number(n.fee)/1e7}}catch(e){return null}},J=(e,t)=>({url:e,...t}),Y={[v.mainnet]:{name:"Mainnet",horizon:J("https://horizon.stellar.org"),soroban:J("https://mainnet.sorobanrpc.com")},[v.testnet]:{name:"Testnet",horizon:J("https://horizon-testnet.stellar.org"),soroban:J("https://soroban-testnet.stellar.org")},[v.futurenet]:{name:"Futurenet",horizon:J("https://horizon-futurenet.stellar.org"),soroban:J("https://rpc-futurenet.stellar.org")}},Q=(e,t)=>{let r=Y[e];const n=t[e];if(!r&&!n)throw new Error("Custom network has no transports.");return!r&&n&&(r={name:"Custom Network",horizon:J(""),soroban:J("")}),n&&(n.horizon&&(r.horizon=n.horizon),n.soroban&&(r.soroban=n.soroban)),r},ee=e=>new Promise((t=>setTimeout(t,e)));async function te(e,i,o){const{horizon:a,soroban:c}=Q(i.network,o);if(!a)throw new Error("Horizon RPC was not found.");const s=new r.Server(a.url),l=new t(e,i.network);if(i.isSoroban){const e=new n.Server(c.url),t=await e.sendTransaction(l),r=await(async(e,t)=>{for(let r=0;r<15;++r){const r=await t.getTransaction(e);if("SUCCESS"===r.status)return r;if("FAILED"===r.status)break;await ee(1e3)}return null})(t.hash,e);return r}return await s.submitTransaction(l)}const re=async(e,t,r,n,i)=>{const o=await(async(e,t,r,n)=>{if(!(null==e?void 0:e.signTransaction))throw new Error("Wallet does not support transaction signing.");return await e.signTransaction(t,{networkPassphrase:n,address:r})})(e,t,r,n.network);return await te(o,n,i||{})},ne=()=>{var e;const t=Yo();if(!t)throw new Error("useBlux must be used within a ProviderContext.");const{value:r,setValue:n,setRoute:i}=t,{isReady:o,user:a,isAuthenticated:c}=r;return{login:()=>{if(!o)throw new Error("Cannot connect when isReady is false.");if(c)throw new Error("Already connected.");n((e=>e.isModalOpen?e:{...e,isModalOpen:!0}))},logout:()=>{n((e=>({...e,isModalOpen:!1,user:{...e.user,wallet:null},isAuthenticated:!1,waitingStatus:"connecting"}))),i(q.ONBOARDING)},profile:()=>{if(!c)throw new Error("User is not authenticated.");i(q.PROFILE),n((e=>({...e,isModalOpen:!0})))},sendTransaction:function(e,t){return new Promise(((o,s)=>{var l,u;let d=r.activeNetwork;if(t&&t.network&&(d=t.network),c||s(new Error("User is not authenticated.")),!X(e,d))return void s("Invalid XDR");const f={network:d,isSoroban:!0===(null==t?void 0:t.isSoroban)},h={xdr:e,options:f,resolver:o,rejecter:s,result:null},b={xdr:e,options:f,resolver:o,rejecter:s,result:null},p=null===(l=r.availableWallets.find((({wallet:e})=>{var t;return e.name===(null===(t=null==a?void 0:a.wallet)||void 0===t?void 0:t.name)})))||void 0===l?void 0:l.wallet;if(!p)throw new Error("Could not find the connected wallet.");r.config.showWalletUIs?(i(q.SIGN_TRANSACTION),n((e=>({...e,isModalOpen:!0,signTransaction:!0===(null==t?void 0:t.isSoroban)?b:h})))):re(p,e,null===(u=r.user.wallet)||void 0===u?void 0:u.address,f,r.config.transports||{}).then((e=>{o(e)})).catch((e=>{s(e)}))}))},user:null!=a?a:null,isReady:null!==(e=r.isReady)&&void 0!==e&&e,isAuthenticated:null!=c&&c}},ie=({button:e,onButtonClick:t,appearance:r})=>l.createElement("button",{onClick:t,style:{borderRadius:r.borderRadius,color:r.textColor,borderColor:r.borderColor,backgroundColor:r.background,borderWidth:r.includeBorders?r.borderWidth:"1px"},className:"bluxcc:border bluxcc:!px-3 bluxcc:!py-1 bluxcc:!text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300"},e),oe=({label:e,autoFocus:t,type:r="text",placeholder:n="Input",error:i,iconRight:o,iconLeft:a,button:c,onButtonClick:s,customLabel:d,value:f,className:h,onChange:b})=>{const p=Yo().value.config.appearance,[m,g]=u(!1),y=()=>i?"#ec2929":m?p.accent:p.borderColor;return l.createElement("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col"},e&&l.createElement("label",{style:{color:i?"#ec2929":p.textColor},className:"bluxcc:mb-1 bluxcc:ml-2 bluxcc:flex bluxcc:justify-between bluxcc:text-sm"},l.createElement("span",null,e),l.createElement("span",null,d)),l.createElement("div",{className:`bluxcc:flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:border bluxcc:px-4 bluxcc:py-2 bluxcc:transition-all ${h}`,onFocus:()=>g(!0),onBlur:()=>g(!1),onMouseEnter:e=>{m||i||(e.currentTarget.style.borderColor=p.accent,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:e=>{m||(e.currentTarget.style.borderColor=i?"#ec2929":p.borderColor)},style:{"--tw-ring-color":y(),borderRadius:p.borderRadius,borderColor:y(),backgroundColor:p.bgField,borderWidth:p.includeBorders?p.borderWidth:"1px"}},a&&l.createElement("div",{className:"bluxcc:mr-2"},a),l.createElement("input",{id:"bluxcc-input",autoComplete:"off",min:"number"===r?1:void 0,type:r,autoFocus:t,value:f,placeholder:n,className:"bluxcc:!mr-2 bluxcc:bg-transparent bluxcc:outline-hidden",style:{color:p.textColor,width:c?"90%":"100%"},onChange:b}),c&&l.createElement(ie,{button:c,onButtonClick:s,appearance:p}),o&&l.createElement("div",{className:"bluxcc:ml-2"},o)),i&&l.createElement("p",{className:"bluxcc:mt-1 bluxcc:ml-2 bluxcc:text-xs bluxcc:text-alert-error"},i))},ae=()=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("g",{clipPath:"url(#clip0_238_2232)"},l.createElement("path",{d:"M41.06 12.5H38.94L17.5 63.18L17.565 63.205H23.285L27.5775 53.065C36.4925 56.07 46.155 56.02 55.04 52.9225L59.39 63.205H62.435L62.5 63.18L41.06 12.5ZM41.1025 53.3675C36.76 53.3675 32.445 52.665 28.3275 51.2925L41.3375 20.5325L54.2925 51.1525C50.05 52.6175 45.5925 53.3675 41.1025 53.3675Z",fill:"#0691B7"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_238_2232"},l.createElement("rect",{width:"45",height:"52.5",fill:"white",transform:"translate(17.5 12.5)"})))),ce=({fill:e="#221542"})=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M24 32.6489C24 32.4316 24.177 32.2562 24.3941 32.2493C30.8491 32.0454 36.0454 26.8491 36.2494 20.3941C36.2562 20.177 36.4317 20 36.6489 20H55.6067C55.8239 20 56 20.176 56 20.3932V43.0339C56 43.2512 55.8239 43.4272 55.6067 43.4272H44.7877C44.5705 43.4272 44.3944 43.2511 44.3944 43.0339V33.7948C44.3944 33.3973 43.8568 33.2414 43.6304 33.5683C39.3932 39.6869 32.369 43.7288 24.3941 43.8579C24.1769 43.8615 24 43.6851 24 43.4679V32.6489Z",fill:e}),l.createElement("path",{d:"M56 48.7019C56 48.4846 55.8239 48.3086 55.6067 48.3086H24.3933C24.1761 48.3086 24 48.4846 24 48.7019V59.5209C24 59.7381 24.1761 59.9141 24.3933 59.9141H55.6067C55.8239 59.9141 56 59.7381 56 59.5209V48.7019Z",fill:e})),se=()=>l.createElement("svg",{width:"80",height:"82",viewBox:"0 0 80 82",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M35.3956 22.5711C35.3861 22.3324 35.6417 22.1832 35.8491 22.3053C36.0382 22.4165 36.2205 22.5257 36.4099 22.6313C37.4552 23.198 38.4402 23.8684 39.3497 24.6324C40.7641 25.8554 41.9528 27.3151 42.8621 28.9455C43.8192 30.6016 44.5515 32.3765 45.0399 34.224C45.3754 35.475 45.5109 36.7708 45.4414 38.0637C45.4231 38.2364 45.4614 38.4102 45.5506 38.5595C45.6395 38.7088 45.7746 38.8255 45.9357 38.8923C46.0974 38.9554 46.275 38.9655 46.4431 38.9209C46.6109 38.8763 46.76 38.7794 46.8686 38.6444C47.9575 37.49 49.2774 34.882 49.72 33.9747C49.8026 33.8053 50.0113 33.7465 50.1619 33.8612C50.8686 34.4006 52.7431 36.0635 54.3348 39.5289C54.8774 40.6445 55.2013 41.8521 55.4406 43.0659C55.6754 44.1598 55.7118 45.2684 55.6845 46.3866C55.5946 50.0708 54.0887 53.6243 51.5016 56.404C49.2163 58.8592 46.2232 60.5283 42.9103 61.1014C40.0638 61.638 37.1237 61.3821 34.4141 60.3617C33.5021 59.9866 32.622 59.5388 31.7826 59.0225C30.5229 58.3338 29.4357 57.3655 28.4361 56.3377C26.8193 54.5515 25.6161 52.5121 24.9068 50.178C24.5955 49.0177 24.4013 47.8294 24.3271 46.6307C24.2318 44.6775 24.4841 42.6145 25.143 40.8279C26.148 38.1032 27.8486 35.4733 30.1752 33.7232C32.312 32.1263 34.0955 30.2591 34.9939 27.7544C35.3492 26.6941 35.5128 25.5795 35.477 24.4623C35.477 23.8311 35.4204 23.2014 35.3956 22.5711Z",fill:"#1D1F20"}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M34.5092 22.014C34.4771 21.2324 35.3603 20.746 36.0555 21.1393C36.0946 21.1614 36.1328 21.183 36.1703 21.2043C36.3258 21.2925 36.47 21.3743 36.6196 21.4546C37.7453 22.0415 38.8061 22.7356 39.7859 23.5265L39.7898 23.5297L39.7936 23.5329C41.3229 24.8038 42.6081 26.3202 43.5916 28.0139C44.6147 29.7161 45.3976 31.5403 45.92 33.439C46.2872 34.7551 46.4354 36.1183 46.3591 37.4784L46.3582 37.4956L46.3563 37.5128C46.3533 37.5404 46.3597 37.5682 46.3745 37.5919C46.3878 37.6134 46.4071 37.63 46.4292 37.6404C46.4532 37.6479 46.4787 37.6486 46.503 37.6424C46.5296 37.6356 46.554 37.6206 46.5722 37.599L46.5896 37.5781L46.6089 37.5585C47.1119 37.0459 47.7023 36.169 48.2413 35.2651C48.7715 34.3758 49.2213 33.5139 49.4475 33.0683C49.7105 32.5499 50.4333 32.3104 50.9821 32.7128C51.7957 33.3096 53.8186 35.0512 55.5239 38.6163C56.1217 39.8002 56.4715 41.0643 56.7246 42.2971C56.9837 43.4612 57.0205 44.6257 56.9918 45.7613C56.8942 49.6099 55.258 53.3101 52.4616 56.1977C49.9898 58.7499 46.7462 60.4917 43.1488 61.0911C40.0664 61.6486 36.8829 61.3818 33.9491 60.3197L33.9391 60.3162L33.9292 60.3122C32.9525 59.9264 32.0099 59.4658 31.1106 58.9353C29.7188 58.2008 28.5375 57.1829 27.4844 56.1423L27.4756 56.1335L27.467 56.1244C25.7243 54.2739 24.4206 52.1531 23.6522 49.7227L23.6488 49.712L23.6458 49.7015C23.3106 48.5005 23.1015 47.2705 23.0215 46.03L23.0212 46.0255L23.021 46.0211C22.9183 43.999 23.1884 41.8485 23.9103 39.9671C24.9876 37.1598 26.8221 34.4156 29.3717 32.5723L29.3726 32.5716L29.3735 32.571C31.5326 31.0201 33.2623 29.2581 34.1303 26.9378C34.4711 25.9579 34.628 24.9279 34.5935 23.8956L34.5932 23.8848V23.8741C34.5932 23.4867 34.5711 23.1205 34.5477 22.7336C34.5338 22.5039 34.5195 22.267 34.5092 22.014ZM35.9708 22.6629C35.9941 23.0563 36.0174 23.4692 36.0178 23.8633C36.0562 25.054 35.8741 26.2417 35.48 27.3719L35.4777 27.3786L35.4752 27.3852C34.4776 30.0585 32.5064 32.0197 30.2323 33.6533C27.9527 35.3018 26.2572 37.804 25.2485 40.4326C24.6032 42.1142 24.3492 44.0779 24.4438 45.9513C24.5179 47.0971 24.7108 48.233 25.0197 49.3423C25.7228 51.5602 26.9127 53.5016 28.5193 55.21C29.5346 56.2124 30.6026 57.1191 31.8152 57.7561L31.8312 57.7647L31.8467 57.7738C32.6822 58.2677 33.5579 58.6964 34.4653 59.0555C37.1519 60.026 40.0661 60.2688 42.8877 59.7576L42.8929 59.7567L42.8983 59.7558C46.1757 59.2108 49.1436 57.6227 51.4143 55.2782C53.9889 52.6198 55.4787 49.2303 55.5675 45.7286C55.5953 44.6352 55.5567 43.5894 55.3298 42.5735L55.3287 42.5679L55.3275 42.5624C55.0844 41.3775 54.7625 40.2368 54.237 39.1983L54.2336 39.1917L54.2304 39.1849C52.883 36.3656 51.3452 34.8042 50.5043 34.0966C50.2497 34.5829 49.8889 35.2495 49.4801 35.9349C48.9416 36.8378 48.2887 37.8277 47.6667 38.4674C47.4611 38.703 47.1839 38.8729 46.8721 38.9525C46.5502 39.0347 46.2094 39.0161 45.8996 38.8997L45.8928 38.8972L45.8861 38.8945C45.5767 38.7713 45.3182 38.5562 45.1479 38.282C44.9813 38.0136 44.9077 37.7022 44.9373 37.3919C45.0038 36.1777 44.8706 34.9609 44.5427 33.7862L44.5426 33.785L44.5422 33.7839C44.0511 31.9985 43.3146 30.2834 42.3526 28.6833L42.3498 28.6789L42.3472 28.6743C41.4443 27.1183 40.2643 25.7253 38.8606 24.558C37.9655 23.8358 36.9975 23.201 35.9708 22.6629Z",fill:"#FABA0D"}),l.createElement("path",{d:"M38.1531 41.1875C38.3545 41.2919 38.5256 41.3944 38.7087 41.4911C39.2749 41.7821 39.8084 42.1261 40.3012 42.5182C41.0673 43.146 41.7112 43.895 42.2037 44.7317C42.722 45.5816 43.1188 46.4927 43.3834 47.4408C43.565 48.0827 43.6384 48.7478 43.6008 49.4113C43.591 49.4999 43.6117 49.5891 43.6599 49.6658C43.7082 49.7424 43.7813 49.8023 43.8685 49.8366C43.9562 49.8691 44.0524 49.8743 44.1434 49.8513C44.2342 49.8283 44.3151 49.7786 44.3738 49.7094C45.0942 48.9858 45.5615 48.0501 45.9462 47.158C47.0249 47.9768 47.8597 48.9885 48.418 50.1634C48.7119 50.7359 48.8874 51.3555 49.017 51.9786C49.1442 52.5398 49.1639 53.1089 49.1491 53.6828C49.1004 55.5736 48.2847 57.3973 46.8835 58.8238C45.6456 60.0838 44.0243 60.9405 42.2297 61.2347C40.688 61.51 39.0953 61.3786 37.6277 60.8549C37.1336 60.6625 36.6569 60.4327 36.2023 60.1678C35.52 59.8142 34.931 59.3173 34.3896 58.7899C33.5138 57.873 32.8621 56.8264 32.4779 55.6287C32.3093 55.0331 32.2041 54.4232 32.1639 53.8081C32.1122 52.8056 32.249 51.7468 32.6059 50.8299C33.1502 49.4316 34.0714 48.082 35.3316 47.1838C36.4891 46.3642 37.4551 45.4059 37.9417 44.1204C38.1342 43.5763 38.2229 43.0044 38.2034 42.431C38.2034 42.0159 38.1531 41.6021 38.1531 41.1875Z",fill:"#FABA0D"})),le=({fill:e="#B8BAC4"})=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("g",{clipPath:"url(#clip0_54_32)"},l.createElement("path",{d:"M39.898 61.6041C38.776 62.2821 37.324 62.3741 36.07 61.6801L32.782 59.8601C29.404 57.9961 28.194 53.7401 30.088 50.3761L33.282 44.6981L38.256 59.5521C38.556 60.4561 39.156 61.1621 39.896 61.6061L39.898 61.6041ZM50.746 32.0461L46.51 44.6961L39.898 32.9501L49.154 16.4981C49.614 15.6801 50.854 15.9381 50.95 16.8681L51.664 23.5781C51.972 26.4341 51.656 29.3221 50.744 32.0461H50.746Z",fill:e}),l.createElement("path",{d:"M46.5099 44.6961L41.5399 59.5501C41.2379 60.4501 40.6399 61.1541 39.8999 61.6021C39.1579 61.1581 38.5539 60.4521 38.2579 59.5501L33.2839 44.6961L39.8979 32.9501L46.5099 44.6961Z",fill:"black"}),l.createElement("path",{d:"M39.8979 32.9499L33.2799 44.6959L29.0459 32.0459C28.1339 29.3199 27.8179 26.4339 28.1259 23.5779L28.8399 16.8679C28.9399 15.9359 30.1759 15.6779 30.6339 16.4979L39.8979 32.9499ZM47.0099 59.8599L43.7239 61.6799C42.4639 62.3739 41.0179 62.2799 39.8979 61.6019C40.6399 61.1539 41.2379 60.4499 41.5379 59.5499L46.5079 44.6959L49.7019 50.3739C51.5959 53.7379 50.3859 57.9939 47.0099 59.8599Z",fill:e})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_54_32"},l.createElement("rect",{width:"24",height:"48",fill:"white",transform:"translate(28.0001 16)"})))),ue=({fill:e="#310CCC"})=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.1224 25.6667C34.9877 21.2577 30.9854 18 26.2222 18C20.5766 18 16 22.5766 16 28.2222C16 33.8678 20.5766 38.4444 26.2222 38.4444C30.9854 38.4444 34.9877 35.1868 36.1224 30.7778H44.963V39.2963H50.0741V30.7778H53.4814V39.2963H58.5926V30.7778H62V25.6667H36.1224ZM31.3333 28.2222C31.3333 31.045 29.045 33.3333 26.2222 33.3333C23.3995 33.3333 21.1111 31.045 21.1111 28.2222C21.1111 25.3995 23.3995 23.1111 26.2222 23.1111C29.045 23.1111 31.3333 25.3995 31.3333 28.2222Z",fill:e}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M41.8776 56.3333C43.0123 60.7423 47.0146 64 51.7778 64C57.4234 64 62 59.4233 62 53.7777C62 48.1321 57.4234 43.5555 51.7778 43.5555C47.0146 43.5555 43.0123 46.8132 41.8776 51.2222H33.037V42.7036H27.9259V51.2222H24.5186V42.7036H19.4075V51.2222H16V56.3333H41.8776ZM46.6667 53.7777C46.6667 50.955 48.955 48.6666 51.7778 48.6666C54.6005 48.6666 56.8889 50.955 56.8889 53.7777C56.8889 56.6005 54.6005 58.8888 51.7778 58.8888C48.955 58.8888 46.6667 56.6005 46.6667 53.7777Z",fill:e})),de=({fill:e="#C19CFC"})=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{width:"80",height:"80",fill:"#14142B"}),l.createElement("path",{d:"M31.4709 25.298C32.4989 23.5176 33.6931 22.7759 34.9056 22.7037C37.3649 22.5412 42.8633 26.5906 41.1236 28.9951L44.3825 34.6802C46.4644 36.425 48.5728 37.7992 50.7331 38.7119C50.3293 40.4023 51.2694 41.0081 52.2177 41.6045C50.9529 39.3902 53.4296 38.1604 54.7645 40.3573C56.1435 42.2914 56.5128 44.2986 55.6869 45.862C54.4658 48.2032 51.1897 49.9382 49.7051 52.1168C52.7276 49.3783 56.7936 49.6856 58.4012 46.5034C59.4023 44.5328 56.8993 38.6941 55.7311 36.7234C53.9213 33.6954 51.6641 34.5719 51.4091 35.5484C49.0112 34.2374 46.8769 32.1586 44.6984 30.4227C45.7173 29.5283 46.2973 28.2356 45.1824 27.5394C42.8983 26.0936 40.2459 21.7728 36.8026 20.9318C36.4598 20.847 36.1106 20.8011 35.7638 20.8011C33.9691 20.8011 32.2139 22.0183 31.4709 25.298Z",fill:"#4E4B66"}),l.createElement("path",{d:"M37.3473 76.875C40.0511 76.875 42.6867 76.5119 45.1848 75.8381C29.8061 79.9719 20.4061 62.3648 32.0948 49.9836C27.7906 48.8179 25.0244 44.4789 25.2962 39.2993C2.07278 56.3288 13.0876 76.875 37.3473 76.875ZM45.1893 75.8369C45.2134 75.83 45.2371 75.8244 45.2613 75.8175C45.2376 75.8238 45.213 75.8306 45.1893 75.8369Z",fill:e}),l.createElement("path",{d:"M40.2192 20.5976C41.2212 21.2484 42.1605 22.1161 43.0301 22.9927C51.1726 21.2124 46.0253 13.3299 50.2589 10.2479C44.9099 12.1098 48.2739 20.8412 40.2192 20.5976Z",fill:e}),l.createElement("path",{d:"M26.8951 26.9884L31.4711 25.2979C30.3556 16.0778 43.0391 12.3357 38.7527 3.125C38.5683 13.5557 25.8671 13.791 26.8951 26.9884Z",fill:e}),l.createElement("path",{d:"M38.4804 47.0009C40.7549 45.9524 43.0213 44.5328 45.2963 45.2018C42.8014 43.5662 39.7365 44.3524 36.6443 44.5693C32.4899 44.8584 28.2741 44.4967 25.2961 39.2994C26.5614 45.8709 32.4198 49.7938 38.4804 47.0009Z",fill:e}),l.createElement("path",{d:"M36.8114 13.5378C34.22 17.0091 30.8738 20.3717 31.4711 25.2978C32.358 21.3837 34.6862 20.4074 36.8028 20.9316C40.246 21.7726 42.8984 26.0934 45.1825 27.5392C46.2975 28.2354 45.7175 29.5281 44.6985 30.4225C46.877 32.1584 49.0113 34.2372 51.4092 35.5482C51.6642 34.5717 53.9215 33.6952 55.7311 36.7232C56.8994 38.6939 59.4025 44.5326 58.4013 46.5032C56.7937 49.6854 52.7277 49.3781 49.7051 52.1166C47.8608 48.7001 44.1722 47.8319 40.439 47.2809C41.9587 46.1148 43.5043 45.0662 45.2963 45.2017C43.0213 44.5326 40.755 45.9522 38.4804 47.0008C32.4198 49.7937 26.5614 45.8707 25.2962 39.2992C25.0244 44.4787 27.7906 48.8178 32.0948 49.9834C20.3866 62.3852 29.8376 80.03 45.2613 75.8175C58.4191 72.2194 68.125 59.8815 68.125 45.2017C68.125 32.1856 60.4915 21.0042 49.5827 16.1321C50.0835 19.0154 50.7158 21.7993 45.6651 25.6141C44.0753 24.2399 42.3011 21.9446 40.2191 20.5976C44.9184 20.7423 45.7265 17.8314 46.6576 15.0113C43.6573 14.0307 40.5251 13.5327 37.3768 13.5327C37.1884 13.5327 36.9999 13.5346 36.8114 13.5378ZM36.592 29.1214C37.1715 29.2386 37.7602 29.7267 38.296 30.2782C39.1656 31.1731 39.9915 31.3272 41.045 30.3869L44.3826 34.68L41.1237 28.9949C41.08 29.4471 40.7199 29.5552 40.281 29.5281C39.5171 29.4799 38.5533 28.9317 37.5421 28.9312C37.2284 28.9312 36.9102 28.9841 36.592 29.1214ZM52.2178 41.6043C52.7536 40.6734 53.4821 40.0676 54.7646 40.3571C54.272 39.5461 53.6237 39.2022 53.0655 39.2022C52.1108 39.2022 51.4197 40.2072 52.2178 41.6043Z",fill:e}),l.createElement("path",{d:"M34.4399 16.6296C32.5865 19.1329 31.0581 21.8274 31.4711 25.2982C32.358 21.3841 34.6862 20.4077 36.8028 20.932C40.246 21.773 42.8984 26.0937 45.1825 27.5396C46.2975 28.2358 45.7175 29.5285 44.6985 30.4229C46.877 32.1588 49.0113 34.2376 51.4093 35.5486C51.6642 34.5722 53.9215 33.6956 55.7311 36.7236C56.8994 38.6942 59.4025 44.533 58.4013 46.5036C56.7938 49.6858 52.7277 49.3785 49.7051 52.117C47.8608 48.7006 44.1722 47.8324 40.439 47.2814C41.9587 46.1152 43.5043 45.0666 45.2963 45.2021C43.0213 44.533 40.755 45.9526 38.4805 47.0012C32.4198 49.7941 26.5614 45.8711 25.2962 39.2996C25.0244 44.4791 27.7906 48.8181 32.0948 49.9838C24.4708 58.056 25.8148 68.3512 31.9363 73.395C49.0996 76.8656 65.2613 63.3887 65.2613 45.2021C65.2613 33.9757 59.0073 24.2586 49.8813 19.5311C49.7143 21.3481 48.7482 23.2915 45.6651 25.6144C44.0753 24.2402 42.3011 21.945 40.2191 20.5979C43.3373 20.6884 44.7513 19.4412 45.6123 17.7592C42.9339 16.9055 40.134 16.4768 37.3318 16.4768C36.3666 16.4768 35.401 16.5274 34.4399 16.6296Z",fill:"#14142B"}),l.createElement("path",{d:"M32.0948 49.9834C20.3866 62.3853 29.8376 80.03 45.2613 75.8175C27.6154 76.6125 29.3631 55.9857 40.5533 50.1193C44.5761 50.6797 48.7213 51.3942 50.7158 55.0814C53.7284 52.3523 57.7949 52.6503 59.4111 49.4681C60.0612 48.1941 59.2358 45.2926 58.2606 42.8694C58.6471 44.3616 58.796 45.7353 58.4013 46.5033C56.7937 49.6854 52.7277 49.3781 49.7051 52.1166C47.8608 48.7001 44.1722 47.8319 40.439 47.2809C41.9587 46.1148 43.5043 45.0663 45.2963 45.2017C43.0213 44.5326 40.755 45.9523 38.4804 47.0008C32.4198 49.7937 26.5614 45.8708 25.2962 39.2992C25.0244 44.4788 27.7906 48.8178 32.0948 49.9834Z",fill:"#262338"}),l.createElement("path",{d:"M29.1416 26.4583L33.7175 25.6012C32.6021 16.3811 43.9749 14.1667 39.6486 5.625C39.6486 14.1667 27.6402 14.0533 29.1416 26.4583Z",fill:"#14142B"})),fe=({fill:e="black"})=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M22.7898 38.3729C29.1931 21.8198 42.7306 18 42.7306 18C42.7306 18 38.3401 22.7294 35.2299 28.5503C32.12 34.3711 30.4735 44.9214 32.3029 47.832C41.267 46.0129 48.5848 35.8263 49.3165 26.9131C52.8484 29.4202 57.9147 33.2796 58.8296 44.7394C58.8296 44.7394 59.308 49.8328 56.2685 54.7441C53.2287 59.6554 46.7554 61.1106 46.7554 61.1106C46.7554 61.1106 40.3524 63.1116 33.4007 61.1106C26.7728 59.2032 17.2916 52.5875 22.7898 38.3729Z",fill:e})),he=({fill:e="black"})=>l.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("g",{clipPath:"url(#clip0_44_35)"},l.createElement("path",{d:"M27.8949 12.4346L25.2459 13.7842L12.4541 20.2997C12.4109 19.9698 12.3891 19.6374 12.389 19.3047C12.3907 17.9771 12.7393 16.673 13.4001 15.5216C14.0609 14.3702 15.0111 13.4113 16.1565 12.7401C17.3019 12.0689 18.6028 11.7086 19.9303 11.6948C21.2578 11.6811 22.5659 12.0144 23.725 12.6617L25.2412 11.8891L25.4674 11.7737C24.0784 10.7656 22.4378 10.1611 20.7267 10.0271C19.0157 9.8931 17.3009 10.2348 15.7719 11.0144C14.2429 11.794 12.9593 12.9812 12.0628 14.4448C11.1663 15.9083 10.692 17.5912 10.6922 19.3075C10.6922 19.5445 10.7012 19.7806 10.7192 20.0158C10.7444 20.3489 10.6705 20.6819 10.5069 20.9731C10.3432 21.2642 10.0971 21.5005 9.79954 21.6521L9 22.0598V23.9614L11.354 22.7616L12.1163 22.3726L12.8674 21.99L26.3526 15.119L27.8679 14.3473L31 12.751V10.8504L27.8949 12.4346Z",fill:e}),l.createElement("path",{d:"M31 14.6539L13.6334 23.4963L12.1181 24.2698L9 25.8586V27.7584L12.0967 26.1807L14.7457 24.8311L27.5505 18.3063C27.5938 18.6384 27.6156 18.9729 27.6157 19.3078C27.6148 20.6369 27.2664 21.9427 26.6049 23.0955C25.9435 24.2484 24.992 25.2081 23.8449 25.8796C22.6978 26.551 21.3951 26.9107 20.066 26.9231C18.737 26.9354 17.4278 26.5999 16.2685 25.9499L16.1754 25.9992L14.5316 26.8369C15.9203 27.8451 17.5606 28.4497 19.2714 28.584C20.9822 28.7184 22.6968 28.3771 24.2258 27.5981C25.7548 26.819 27.0386 25.6324 27.9355 24.1693C28.8323 22.7063 29.3073 21.0238 29.3078 19.3078C29.3078 19.0686 29.2985 18.8294 29.2808 18.5929C29.2557 18.26 29.3295 17.9271 29.4929 17.636C29.6564 17.3448 29.9022 17.1085 30.1995 16.9566L31 16.5489V14.6539Z",fill:e})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_44_35"},l.createElement("rect",{width:"22",height:"18.6157",fill:"white",transform:"translate(9 10)"})))),be=({fill:e="black"})=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M12.7847 3.8762L11.1792 4.69416L3.42667 8.64294C3.40045 8.443 3.38726 8.24156 3.38718 8.03991C3.38824 7.23531 3.59948 6.44495 3.99999 5.74711C4.40049 5.04928 4.97635 4.46818 5.67054 4.06138C6.36472 3.65458 7.15314 3.4362 7.9577 3.42786C8.76225 3.41952 9.55503 3.62152 10.2575 4.01385L11.1764 3.54563L11.3135 3.47568C10.4717 2.86469 9.47736 2.49834 8.44036 2.41713C7.40337 2.33591 6.36411 2.543 5.43745 3.01549C4.51079 3.48799 3.73281 4.20749 3.1895 5.09449C2.64619 5.98149 2.3587 7.00143 2.35881 8.0416C2.35881 8.18526 2.36426 8.32836 2.37517 8.47089C2.39044 8.67273 2.34567 8.87458 2.2465 9.05105C2.14733 9.22751 1.99818 9.3707 1.81782 9.4626L1.33325 9.70968V10.8622L2.75989 10.135L3.2219 9.89922L3.67713 9.66737L11.85 5.5031L12.7684 5.03545L14.6666 4.068V2.91608L12.7847 3.8762ZM14.6666 5.22104L4.1414 10.5801L3.22302 11.0489L1.33325 12.0118V13.1632L3.21005 12.207L4.81551 11.389L12.576 7.43462C12.6022 7.63588 12.6154 7.83863 12.6155 8.0416C12.615 8.84713 12.4038 9.63852 12.0029 10.3372C11.602 11.0359 11.0253 11.6176 10.3302 12.0245C9.63497 12.4314 8.84544 12.6494 8.03995 12.6569C7.23446 12.6644 6.44101 12.4611 5.7384 12.0671L5.68199 12.097L4.68577 12.6047C5.52738 13.2157 6.52152 13.5822 7.55835 13.6636C8.59519 13.745 9.63434 13.5382 10.561 13.066C11.4877 12.5938 12.2658 11.8747 12.8093 10.988C13.3528 10.1013 13.6407 9.08162 13.641 8.0416C13.641 7.89662 13.6354 7.75165 13.6247 7.60836C13.6094 7.40659 13.6541 7.20481 13.7532 7.02837C13.8523 6.85193 14.0012 6.70869 14.1814 6.61665L14.6666 6.36957V5.22104Z",fill:e})),pe=()=>{var e;const{value:t,setValue:r}=Yo(),{sendTransaction:n}=ne(),[d,f]=u({}),[h,b]=u(!1),[p,m]=u({memo:"",amount:"",address:""}),{appearance:g}=t.config,y=((null===(e=t.account.account)||void 0===e?void 0:e.balances)||[]).filter((e=>"liquidity_pool_shares"!==e.asset_type)).filter((e=>"0.0000000"!==e.balance)).map((e=>"native"===e.asset_type?{assetIssuer:"",assetCode:"XLM",balance:e.balance,assetType:e.asset_type}:{balance:e.balance,assetCode:e.asset_code,assetType:e.asset_type,assetIssuer:e.asset_issuer})),[w,v]=u(y[0]),x=e=>t=>{m((r=>({...r,[e]:t.target.value}))),f((t=>({...t,[e]:""})))};return h?l.createElement(W,{assets:y,setSelectedAsset:v,setShowSelectAssetPage:b}):l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"bluxcc:relative bluxcc:mb-4"},l.createElement(oe,{autoFocus:!0,type:"number",label:"Amount",placeholder:"0.00",value:p.amount,onChange:x("amount"),error:d.amount,customLabel:l.createElement("span",{onClick:()=>{if(!w)return;const e=Number(w.balance).toString();m((t=>({...t,amount:e})))},style:{color:g.accent},className:"bluxcc:mr-2 bluxcc:inline-flex bluxcc:cursor-pointer"},"Max ",l.createElement(N,{fill:g.accent})),onButtonClick:()=>{b(!0)},button:l.createElement("span",{className:"bluxcc:flex bluxcc:justify-between bluxcc:!gap-1"},l.createElement("span",{className:"bluxcc:flex bluxcc:items-center"},l.createElement(be,{fill:Z(g.background)})),w?w.assetCode:"XLM")})),l.createElement("div",{className:"bluxcc:mb-4"},l.createElement(oe,{label:"To",placeholder:"Enter address",value:p.address,onChange:x("address"),error:d.address,button:"Paste",onButtonClick:async()=>{const e=await navigator.clipboard.readText();m((t=>({...t,address:e})))}})),l.createElement("div",null,l.createElement(oe,{label:"Memo",placeholder:"Enter Memo (optional)",value:p.memo,onChange:x("memo")})),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:g.includeBorders?g.borderWidth:"1px",borderTopColor:g.borderColor}})),l.createElement(G,{size:"large",variant:"outline",state:"enabled",onClick:async()=>{var e;const l={};if(p.amount?Number(p.amount)>Number(w.balance)&&(l.amount="Amount is greater than max balance"):l.amount="Amount is required",p.address?s.isValidEd25519PublicKey(p.address)||(l.address="Address is invalid"):l.address="Address is required",f(l),0===Object.keys(l).length)try{const s=await(async(e,t,r,n,s,l,u)=>{let d=null,f=null;try{f=await l.loadAccount(r)}catch{}try{d=await l.loadAccount(s)}catch{}if(!d)throw new Error("Inactive account cannot send a transaction.");if(!f&&"native"!==n.assetType)throw new Error("Cannot send non-native asset to an inactive account.");let h=new i(d,{fee:"50000",networkPassphrase:u});if(f){let e=a.native();"native"!==n.assetType&&(e=new a(n.assetCode,n.assetIssuer)),h=h.addOperation(o.payment({amount:t,destination:r,asset:e}))}else h=h.addOperation(o.createAccount({startingBalance:t,destination:r}));return e&&(h=h.addMemo(c.text(e))),h.setTimeout(180).build().toXDR()})(p.memo,p.amount,p.address,w,null===(e=t.user.wallet)||void 0===e?void 0:e.address,t.servers.horizon,t.activeNetwork);r((e=>({...e,isModalOpen:!1}))),setTimeout((()=>{n(s)}),250)}catch(e){l.address=e.message,f(l)}}},"Send")))},me=e=>navigator.clipboard.writeText(e),ge=(e,t)=>{const r=parseInt(e.replace("#",""),16);return`rgba(${r>>16&255}, ${r>>8&255}, ${255&r}, ${t})`},ye=({variant:e="default",startIcon:t,endArrow:r,isRecent:n,label:i,onClick:o,onChange:a,onEnter:c,onSubmit:s,inputType:d="text"})=>{const f=Yo(),{appearance:h}=f.value.config,[b,p]=u(i||""),[m,g]=u(!1),[y,w]=u(!1),v=e=>"email"===d?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e):""!==e.trim();return l.createElement("div",{onClick:"input"===e?void 0:o,className:"bluxcc:flex bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:border bluxcc:py-2 bluxcc:pr-3.5 bluxcc:pl-[10px] "+("input"===e?"bluxcc:cursor-text":"bluxcc:cursor-pointer"),style:{borderRadius:h.borderRadius,color:h.textColor,borderColor:y?h.accent:h.borderColor,backgroundColor:h.bgField,borderWidth:h.includeBorders?h.borderWidth:"1px"},onMouseEnter:t=>{"social"===e||y||(t.currentTarget.style.borderColor=h.accent,t.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:t=>{"social"===e||y||(t.currentTarget.style.borderColor=h.borderColor)}},l.createElement("span",{style:{backgroundColor:h.background,borderRadius:h.borderRadius,borderColor:h.borderColor,borderWidth:h.includeBorders?h.borderWidth:"1px"},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:border bluxcc:transition-[border-radius] bluxcc:duration-300"},t),l.createElement("div",{className:"bluxcc:relative bluxcc:ml-4 bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center"},"input"===e?l.createElement(l.Fragment,null,l.createElement("input",{type:d,value:b,onChange:e=>{const t=e.target.value;p(t),g(v(t)),null==a||a(t)},onKeyDown:e=>{"Enter"===e.key&&m&&(null==c||c(b))},placeholder:"Email",className:"bluxcc:mr-1 bluxcc:h-full bluxcc:w-full bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:focus:outline-hidden",style:{color:h.textColor},onFocus:()=>w(!0),onBlur:()=>{w(!1),v(b)||g(!1)}}),l.createElement("div",{className:"bluxcc:flex bluxcc:h-10 bluxcc:w-[100px] bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent"},l.createElement("button",{disabled:!m,onClick:()=>null==s?void 0:s(b),className:"bluxcc:absolute bluxcc:right-0 bluxcc:flex bluxcc:h-8 bluxcc:w-[68px]! bluxcc:items-center bluxcc:justify-center bluxcc:border bluxcc:bg-transparent bluxcc:!text-sm bluxcc:font-medium bluxcc:transition-[border-radius,background,border-color] bluxcc:duration-150",style:{borderRadius:h.borderRadius,borderColor:m?h.accent:h.borderColor,color:m?h.accent:"#999999",borderWidth:h.includeBorders?h.borderWidth:"1px"}},"Submit"))):l.createElement("span",{className:"bluxcc:font-medium bluxcc:select-none"},i)),n&&l.createElement("div",{className:"bluxcc:px-2 bluxcc:py-1 bluxcc:text-xs bluxcc:font-normal",style:{color:h.accent,borderRadius:h.borderRadius,backgroundColor:`${ge(h.accent,.1)}`}},"Recent"),r&&l.createElement("span",{className:"bluxcc:ml-auto bluxcc:flex bluxcc:items-center"},l.createElement(x,{fill:h.textColor})))},we=(e,t=8)=>e.slice(0,t)+"..."+e.slice(-t),ve=(e,t)=>{switch(e){case"Rabet":return l.createElement(le,{fill:t?"#ffffff":"#B8BAC4"});case"Freighter":return l.createElement(ue,{fill:t?"#7863FF":"#310CCC"});case"Albedo":return l.createElement(ae,null);case"LOBSTR":return l.createElement(fe,{fill:t?"#ffffff":"#1a8da0"});case"xBull":return l.createElement(de,{fill:t?"#FFFFFF":"#C19CFC"});case"Hana":return l.createElement(ce,{fill:t?"#E6E0F7":"#221542"});case"Hot":return l.createElement(se,null);default:return null}},xe=async e=>{try{const{passphrase:t}=await e.getNetwork();return t}catch(e){return""}},Ee=e=>{const t=e.replace("#","");return!((.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5)},Ce="__BLUX__RECENT_CONNECTION_METHODS",_e=()=>{const e=localStorage.getItem(Ce);if(!e)return[];try{return JSON.parse(e)}catch(e){return[]}},Me={steexp:{[v.mainnet]:"https://steexp.com",[v.testnet]:"https://testnet.steexp.com",ledgerUrl:"ledger",transactionUrl:"tx",accountUrl:"account"},stellarexpert:{[v.mainnet]:"https://stellar.expert/explorer/public",[v.testnet]:"https://stellar.expert/explorer/testnet",ledgerUrl:"ledger",accountUrl:"account",transactionUrl:"tx"},lumenscan:{[v.mainnet]:"https://lumenscan.io",[v.testnet]:"https://testnet.lumenscan.io",ledgerUrl:"ledgers",accountUrl:"account",operationUrl:"ops",transactionUrl:"txns"},stellarchain:{[v.mainnet]:"https://stellarchain.io",[v.testnet]:"https://testnet.stellarchain.io",[v.futurenet]:"https://futurenet.stellarchain.io",ledgerUrl:"ledgers",accountUrl:"accounts",operationUrl:"operations",transactionUrl:"transactions"}},Ae=(e,t,r,n)=>{let i=Me[t];i||(i=Me.stellarchain);let o=i[e];return o?`${o}/${i[r]}/${n}`:null};var Se=l.memo((({tx:e})=>{const t=Yo(),r=Ae(t.value.activeNetwork,t.value.config.explorer,"transactionUrl",e.hash);return l.createElement("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between"},l.createElement("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-start bluxcc:gap-3"},l.createElement("div",{className:"bluxcc:flex bluxcc:size-10 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",style:{backgroundColor:t.value.config.appearance.background}},(e=>{switch(e){case"Receive":return l.createElement(O,null);case"Send":return l.createElement(L,null);default:return l.createElement(T,null)}})(e.title)),l.createElement("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start"},l.createElement("p",{className:"bluxcc:text-start bluxcc:text-xs bluxcc:font-medium",style:{color:t.value.config.appearance.textColor}},e.title),l.createElement("p",{className:"bluxcc:text-sm bluxcc:font-medium"},e.description))),l.createElement("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:text-xs bluxcc:text-gray-600"},(e=>{const t=new Date(e);return`${t.getUTCDate()} ${t.toLocaleString("en-US",{month:"long"})}`})(e.date),l.createElement("div",{className:"bluxcc:flex bluxcc:size-8 bluxcc:cursor-pointer bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",title:"View transaction details",onClick:()=>{r&&window.open(r,"_blank","noopener,noreferrer")},style:{backgroundColor:t.value.config.appearance.bgField}},l.createElement("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center"},l.createElement(R,null)))))}));const ke=e=>"native"===e.asset_type?"XLM":e.asset_code||"Pool",Ie=e=>{var t;return`${null===(t=e[0])||void 0===t?void 0:t.toUpperCase()}${e.slice(1)}`},Be=({otp:e,setOtp:t,error:r})=>{const n=e.length,i=Yo(),{appearance:o}=i.value.config,a=f([]);d((()=>{r&&setTimeout((()=>{var e;return null===(e=a.current[0])||void 0===e?void 0:e.focus()}),1001)}),[r]);const c=e=>{e.preventDefault();const r=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,n);if(!r)return;const i=[...r.split(""),...Array(n-r.length).fill("")];t(i),setTimeout((()=>{var e;return null===(e=a.current[n-1])||void 0===e?void 0:e.focus()}),0)},s=e=>({borderRadius:o.borderRadius,color:o.accent,background:o.bgField,"--tw-ring-color":r?"#FF6666":o.accent,borderColor:r?"#FF6666":e?o.accent:o.borderColor,borderWidth:o.includeBorders?o.borderWidth:"1px"});return l.createElement("div",{className:"bluxcc:flex bluxcc:gap-1"},e.map(((r,i)=>l.createElement("input",{autoFocus:0===i,key:i,ref:e=>{a.current[i]=e},type:"text",inputMode:"numeric",maxLength:1,value:r,onChange:r=>((r,i)=>{var o;const c=i.target.value.replace(/\D/g,"");if(!c)return;const s=[...e];s[r]=c[0],t(s),r<n-1&&c&&(null===(o=a.current[r+1])||void 0===o||o.focus())})(i,r),onPaste:c,onKeyDown:r=>((r,n)=>{var i;if("Backspace"===n.key){const n=[...e];n[r]?(n[r]="",t(n)):r>0&&(null===(i=a.current[r-1])||void 0===i||i.focus(),n[r-1]="",t(n))}})(i,r),className:"bluxcc:h-14 bluxcc:w-12 bluxcc:border bluxcc:text-center bluxcc:text-lg bluxcc:outline-hidden bluxcc:focus:ring-1",style:s(r)}))))},Ne=({operationsCount:e,sender:t,receiver:r,network:n,estimatedFee:i,action:o})=>{const a=Yo().value.config.appearance,c=[{label:"Action",value:Ie(o)},{label:"Operations",value:e.toString()},{label:"Sender",value:we(t,5),isHighlighted:!0,isCopyable:!0,copyValue:t},{label:"Network",value:Y[n].name},{label:"Estimated Fee",value:`${i} XLM`}];return r&&c.splice(3,0,{label:"To",value:we(r,5),isHighlighted:!0,isCopyable:!0,copyValue:r}),l.createElement("div",{className:"bluxcc:w-full bluxcc:text-sm bluxcc:text-gray-800"},c.map((({label:e,value:t,isHighlighted:r,isCopyable:n,copyValue:i},o)=>l.createElement("div",{key:o,className:"bluxcc:flex bluxcc:justify-between bluxcc:px-4 bluxcc:py-2",style:o===c.length-1?{}:{borderBottomColor:a.borderColor,borderBottomStyle:"dashed",borderBottomWidth:a.includeBorders?a.borderWidth:"1px"}},l.createElement("span",{style:{color:a.textColor}},e),l.createElement("span",{className:""+(n?"bluxcc:cursor-pointer":""),style:{color:r?a.accent:a.textColor},onClick:()=>n&&i&&me(i)},t)))))},Le={[q.ONBOARDING]:{title:"Log in or Signup",Component:l.createElement((()=>{const{value:e,setValue:t,setRoute:r}=Yo(),[n,i]=u(""),o=e.availableWallets,{appearance:a}=e.config,c=e.config.loginMethods||[],s=c.includes("passkey"),d=h((()=>[...[...c].filter((e=>"passkey"!==e)),...s?["passkey"]:[]]),[c,s]),f=h((()=>o.length>3?o.slice(2):[]),[o]),b=h((()=>o.length<=3?o:e.showAllWallets?o.slice(2,o.length):o.slice(0,2)),[o,e.showAllWallets]),p=()=>{t((e=>({...e,user:{...e.user,email:n}}))),r(q.OTP)},m=()=>l.createElement("div",{className:"bluxcc:my-1 bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:z-10",style:{borderTopWidth:a.includeBorders?a.borderWidth:"1px",borderTopStyle:"dashed",borderTopColor:a.borderColor}}),l.createElement("span",{className:"bluxcc:z-20 bluxcc:w-auto bluxcc:px-2 bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",style:{backgroundColor:a.background,color:a.borderColor}},"or"));return l.createElement("div",{className:"bluxcc:w-full"},e.config.appearance.logo&&l.createElement("div",{className:"bluxcc:my-6 bluxcc:flex bluxcc:max-h-[80px] bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden"},l.createElement("img",{src:e.config.appearance.logo,alt:e.config.appName,width:152,height:60,className:"bluxcc:max-h-[80px] bluxcc:max-w-[180px]",loading:"eager",decoding:"async",draggable:"false",style:{contentVisibility:"auto"}})),l.createElement("div",{className:"bluxcc:space-y-2"},d.map(((n,o)=>{const c=d[o+1],s=d[o-1],u=d.includes("wallet"),h=u&&!e.showAllWallets&&"wallet"===n&&"email"===c||u&&"email"===n&&"wallet"!==s;return"wallet"===n?l.createElement(l.Fragment,{key:"wallet"},b.map((e=>l.createElement(ye,{key:e.wallet.name,...e,label:e.wallet.name,isRecent:e.isRecent,startIcon:ve(e.wallet.name,Ee(a.background)),onClick:()=>{return n=e.wallet,t((e=>({...e,user:{...e.user,wallet:{address:null,passphrase:"",name:n.name},waitingStatus:"connecting"}}))),void r(q.WAITING);var n}}))),f.length>0&&!e.showAllWallets&&l.createElement(ye,{endArrow:!0,label:"All Stellar wallets",isRecent:!1,startIcon:l.createElement(he,{fill:Z(a.bgField)}),onClick:()=>t((e=>({...e,showAllWallets:!0})))}),h&&m()):e.showAllWallets||"email"!==n?e.showAllWallets||"passkey"!==n?null:l.createElement("div",{key:"passkey",className:"bluxcc:mt-6! bluxcc:flex bluxcc:h-4 bluxcc:cursor-pointer bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:leading-[28px] bluxcc:font-medium",style:{color:a.accent}},"Log in with Passkey"):l.createElement(l.Fragment,{key:"email"},l.createElement(l.Fragment,null,l.createElement(ye,{inputType:"email",variant:"input",isRecent:!1,startIcon:l.createElement(P,{fill:a.textColor}),onChange:e=>i(e),onEnter:p,onSubmit:p}),h&&m()))}))),l.createElement("footer",{className:"bluxcc:w-full bluxcc:cursor-pointer bluxcc:pt-[17px] bluxcc:text-center bluxcc:text-xs bluxcc:font-medium",style:{color:a.textColor}},l.createElement("a",{"aria-label":"blux website",href:"https://blux.cc",target:"_blank",rel:"noreferrer"},"Powered by Blux.cc")))}),null)},[q.PROFILE]:{title:"Profile",Component:l.createElement((()=>{var e,t;const{logout:r}=ne(),n=Yo(),[i,o]=u(!1),a=n.value.config.appearance,c=null===(e=n.value.user.wallet)||void 0===e?void 0:e.address,s=n.value.account.account?null===(t=n.value.account.account.balances.find((e=>"native"===e.asset_type)))||void 0===t?void 0:t.balance:"0";return l.createElement("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:mt-4 bluxcc:size-[73px] bluxcc:rounded-full",style:{background:a.accent}}),l.createElement("p",{className:"bluxcc:!mt-6 bluxcc:!mb-4 bluxcc:inline-flex bluxcc:cursor-pointer bluxcc:text-base",onClick:()=>{me(c).then((()=>{o(!0),setTimeout((()=>{o(!1)}),1e3)})).catch((()=>{}))},style:{color:a.textColor}},i?"Copied!":l.createElement("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1"},c?we(c,5):"",l.createElement(k,{fill:a.textColor}))),l.createElement("p",{className:"bluxcc:text-center bluxcc:text-base",style:{color:a.accent}},s?`${V(s)} XLM`:"Loading..."),l.createElement("div",{className:"bluxcc:mt-[16px] bluxcc:w-full bluxcc:space-y-2"},l.createElement(ye,{endArrow:!0,label:"Send",startIcon:l.createElement(B,{fill:a.textColor}),onClick:()=>{n.setRoute(q.SEND)}}),l.createElement(ye,{endArrow:!0,label:"Activity",startIcon:l.createElement(I,{fill:a.textColor}),onClick:()=>{n.setRoute(q.ACTIVITY)}})),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:a.includeBorders?a.borderWidth:"1px",borderTopColor:a.borderColor}})),l.createElement("div",{style:{color:a.textColor},onClick:()=>{r()},className:"bluxcc:flex bluxcc:h-12 bluxcc:w-full bluxcc:cursor-pointer bluxcc:items-center bluxcc:justify-center bluxcc:gap-2"},l.createElement(S,{fill:a.textColor}),"Logout"))}),null)},[q.WAITING]:{title:"",Component:l.createElement((()=>{var e,t,r,n;const i=Yo(),o=f(!1),[a,c]=u(!1),[s,h]=u(null),b=i.value.availableWallets,{user:p,config:m}=i.value,g=i.value.waitingStatus,y=i.value.config.appearance,{xdr:w,options:v}=i.value.signTransaction;d((()=>{var e,t;if(!(null===(e=null==p?void 0:p.wallet)||void 0===e?void 0:e.name))return;const r=null===(t=b.find((({wallet:e})=>{var t;return e.name===(null===(t=null==p?void 0:p.wallet)||void 0===t?void 0:t.name)})))||void 0===t?void 0:t.wallet;r&&h(r)}),[b,null==p?void 0:p.wallet]),d((()=>{!o.current&&s&&(o.current=!0,x(s))}),[s]);const x=async e=>{var t;if("signing"===g)try{const r=await re(e,w,null===(t=i.value.user.wallet)||void 0===t?void 0:t.address,v,m.transports||{});i.setValue((e=>({...e,signTransaction:{...e.signTransaction,result:r}}))),i.setRoute(q.SUCCESSFUL)}catch(e){throw c(!0),e}else try{const{publicKey:t}=await e.connect();if(t&&""!==t.trim()){const r=await xe(e);i.setValue((n=>({...n,user:{...n.user,wallet:{passphrase:r,name:e.name,address:t}}}))),(e=>{const t=_e(),r=[e,...t.filter((t=>t!==e))];localStorage.setItem(Ce,JSON.stringify(r))})(e.name),setTimeout((()=>{i.setRoute(q.SUCCESSFUL)}),400)}}catch(e){throw c(!0),e}};return l.createElement("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:select-none bluxcc:flex-col bluxcc:items-center bluxcc:justify-center"},a?l.createElement("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center"},l.createElement(z,null)):l.createElement("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:border",style:{borderColor:y.borderColor,borderWidth:y.includeBorders?y.borderWidth:"1px"}},ve(null!==(t=null===(e=null==p?void 0:p.wallet)||void 0===e?void 0:e.name)&&void 0!==t?t:"",Ee(y.background))),l.createElement("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium"},l.createElement("p",{className:"bluxcc:text-xl"},a?""+("connecting"===g?"Login failed":`Signing with ${null===(r=null==p?void 0:p.wallet)||void 0===r?void 0:r.name} failed`):`${"connecting"===g?"Waiting for":"Signing with"} ${null===(n=null==p?void 0:p.wallet)||void 0===n?void 0:n.name}`),l.createElement("p",{className:"bluxcc:text-sm"},a?`Please try ${"connecting"===g?"logging in":"signing"} again.`:("connecting"===g?"Accept connection":"Sign the")+" request in your wallet")),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:left-0 bluxcc:right-0",style:{borderTopWidth:y.includeBorders?y.borderWidth:"1px",borderTopColor:y.borderColor}})),a?l.createElement(G,{onClick:()=>{c(!1),s&&x(s)},state:"enabled",variant:"outline"},"Try again"):l.createElement(G,{state:"enabled",variant:"outline",className:"bluxcc:cursor-default!",startIcon:l.createElement(_,{fill:y.accent})},"connecting"===g?"Connecting":"Signing"))}),null)},[q.SUCCESSFUL]:{title:"",Component:l.createElement((()=>{const e=Yo(),t=e.value.waitingStatus,r=e.value.config.appearance,{result:n,options:i}=e.value.signTransaction;let o;if(n)if(i.isSoroban){o=n.txHash}else{o=n.hash}const a=o?Ae(i.network,e.value.config.explorer,"transactionUrl",o):null;d((()=>{"connecting"===t&&setTimeout((()=>{e.setValue((e=>({...e,isModalOpen:!1,showAllWallets:!1,isAuthenticated:!0})))}),1e3)}),[]);return l.createElement("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:select-none bluxcc:flex-col bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-[68px] bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden"},l.createElement(A,null)),l.createElement("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium"},l.createElement("p",{className:"bluxcc:text-xl"},"connecting"===t?"Connection":"Transaction"," ","Successful"),l.createElement("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5"},"connecting"===t?`Your account has been successfully connected to ${Ie(e.value.config.appName)}`:"Your transaction was successfully completed")),"signing"===t&&o&&"string"==typeof a&&l.createElement(G,{state:"enabled",variant:"outline",size:"small",className:"mt-4",onClick:()=>{a&&window.open(a,"_blank","noopener,noreferrer")}},"See in explorer"),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:left-0 bluxcc:right-0",style:{borderTopWidth:r.includeBorders?r.borderWidth:"1px",borderTopColor:r.borderColor}})),"connecting"===t?l.createElement(G,{state:"enabled",variant:"outline",className:"bluxcc:cursor-default!"},"Logging In"):l.createElement(G,{state:"enabled",variant:"fill",size:"large",onClick:()=>{if(e.setValue((e=>({...e,isModalOpen:!1}))),"signing"===t){const{resolver:t,result:r}=e.value.signTransaction;t&&r&&t(r)}}},"Done"))}),null)},[q.SIGN_TRANSACTION]:{title:"Confirmation",Component:l.createElement((()=>{var e,t;const r=Yo(),{balance:n}=na({asset:"native"}),i=r.value.config.appearance,{xdr:o,options:a}=r.value.signTransaction,c=X(o,a.network);if(!c)return l.createElement("div",null,l.createElement("p",null,"Invalid XDR"));const s=(e=>{const t=Object.entries(v).find((t=>t[1]===e));let r="";return r=t?t[0].toUpperCase():"MAINNET",r})(r.value.activeNetwork),u=(null===(e=r.value.user.wallet)||void 0===e?void 0:e.name)===H.Lobstr;return l.createElement("div",{className:"bluxcc:w-full"},l.createElement("p",{className:"bluxcc:mx-3 bluxcc:my-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none"},l.createElement("span",{className:"bluxcc:font-semibold bluxcc:capitalize"},r.value.config.appName," "),"wants your permission to approve the following transaction."),l.createElement(Ne,{operationsCount:c.operations,sender:c.sender,receiver:c.receiver,network:a.network,estimatedFee:c.estimatedFee.toString(),action:c.action}),u&&l.createElement("p",{className:"bluxcc:!my-2 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:!text-xs bluxcc:text-alert-error"},"Ensure that your LOBSTR wallet is set to the ",s," network. Otherwise, the transaction will definitely fail."),l.createElement("div",{className:"bluxcc:inline-flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{marginTop:u?"0px":"16px",borderRadius:i.borderRadius,borderColor:i.borderColor}},l.createElement("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap"},l.createElement("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap"},"Your wallet"),l.createElement("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:`${ge(i.textColor,.8)}`}},(null===(t=r.value.user.wallet)||void 0===t?void 0:t.address)?we(r.value.user.wallet.address,5):"No address found")),l.createElement("div",{className:"bluxcc:overflow-hidden bluxcc:px-[10px] bluxcc:py-2",style:{borderRadius:i.borderRadius,backgroundColor:i.bgField,color:i.textColor}},l.createElement("p",{className:"bluxcc:max-w-[90px] bluxcc:text-xs bluxcc:font-normal"},n?V(n):"0"," XLM"))),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:i.includeBorders?i.borderWidth:"1px",borderTopColor:i.borderColor}})),l.createElement(G,{size:"large",state:"enabled",variant:"fill",onClick:async()=>{r.setValue((e=>({...e,isModalOpen:!0,waitingStatus:"signing"}))),r.setRoute(q.WAITING)}},"Approve"))}),null)},[q.SEND]:{title:"Send",Component:l.createElement((()=>{const{value:e}=Yo(),{account:t,loading:r}=e.account;return r?l.createElement("p",null,"Loading"):t?l.createElement(pe,null):l.createElement("p",null,"Account is inactive")}),null)},[q.ACTIVITY]:{title:"Activity",Component:l.createElement((()=>{var e;const[t,n]=u([]),{transactions:i,loading:o}=oa({includeOperations:!0}),{value:a}=Yo(),c=null===(e=a.user.wallet)||void 0===e?void 0:e.address,s=Ae(a.activeNetwork,a.config.explorer,"accountUrl",c);d((()=>{if(!i)return;const e=[];for(const n of i){const i=n.operations[0],o={hash:n.hash,description:"",date:n.created_at,title:(t=i.type,t.replace(/([A-Z])/g," $1").replace(/_/g," ").trim().replace(/\b\w/g,(e=>e.toUpperCase())))};if(n.operations.length>1)o.title="Multi Operation";else if("payment"===i.type){let e="Send";i.to.toLowerCase()===c.toLowerCase()&&(e="Receive"),o.title=e,o.description=`${V(i.amount)} ${ke(i)}`}else i.type!==r.HorizonApi.OperationResponseType.pathPaymentStrictSend&&i.type!==r.HorizonApi.OperationResponseType.pathPayment||(o.title="Swap",o.description=`Path payment of ${i.amount} ${ke(i)}`);e.push(o)}var t;n(e)}),[i]);const f=!o&&0===t.length;return l.createElement("div",{className:"bluxcc:flex bluxcc:h-[335px] bluxcc:flex-col"},o?l.createElement("div",{className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:text-gray-700"},"Loading activity..."):f?l.createElement("div",{className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:text-gray-700"},"No activity found"):t.map(((e,r)=>l.createElement("div",{key:r,style:{borderBottomStyle:"dashed",borderBottomWidth:r<t.length-1?a.config.appearance.includeBorders?a.config.appearance.borderWidth:"1px":"0px",borderBottomColor:a.config.appearance.borderColor},className:"bluxcc:p-2"},l.createElement(Se,{tx:e})))),t.length>0&&s&&l.createElement("div",{className:"bluxcc:absolute bluxcc:bottom-4 bluxcc:left-1/2 bluxcc:!mt-4 bluxcc:w-[calc(100%-3rem)] bluxcc:-translate-x-1/2 bluxcc:transform"},l.createElement(G,{state:"enabled",variant:"outline",size:"medium",onClick:()=>{s&&window.open(s,"_blank","noopener,noreferrer")}},"See all in explorer")))}),null)},[q.OTP]:{title:"",Component:l.createElement((()=>{const{value:e}=Yo(),t=e.config.appearance,r=e.user.email,[n,i]=u(Array(6).fill("")),[o,a]=u(!1);return d((()=>{const e=n.join("");6===e.length&&(async e=>{a(!1),await new Promise((t=>{setTimeout((()=>{t("123456"===e)}),200)}))||(a(!0),setTimeout((()=>i(Array(6).fill(""))),1e3))})(e)}),[n,r]),l.createElement("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:select-none bluxcc:flex-col bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{style:{borderColor:t.borderColor,borderWidth:t.includeBorders?t.borderWidth:"1px"},className:"bluxcc:mb-6 bluxcc:flex bluxcc:h-20 bluxcc:w-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:border-2"},l.createElement(U,{fill:t.textColor})),l.createElement("div",{className:"bluxcc:flex-col bluxcc:space-y-1 bluxcc:text-center"},l.createElement("p",{className:"bluxcc:text-xl bluxcc:font-medium"},"Enter confirmation code"),o?l.createElement("p",{className:"bluxcc:flex bluxcc:h-10 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:text-alert-error"},"Invalid code, please try again."):l.createElement("p",{className:"bluxcc:h-10 bluxcc:text-sm"},"Please check your email and enter confirmation code below")),l.createElement("div",{className:"bluxcc:mt-6 bluxcc:text-center"},l.createElement(Be,{otp:n,setOtp:i,error:o})),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:left-0 bluxcc:right-0",style:{borderTopWidth:t.includeBorders?t.borderWidth:"1px",borderTopColor:t.borderColor}})),l.createElement(G,{size:"medium",state:"enabled",variant:"text",onClick:()=>{},style:{color:t.accent}},"Resend code"))}),null)},[q.WRONG_NETWORK]:{isSticky:!0,title:"Wrong Network",Component:l.createElement((()=>l.createElement("div",null,l.createElement("p",null,"You are on a wrong network."))),null)}};function Te({isOpen:e,closeModal:t}){const{route:r,setRoute:n,value:i,setValue:o}=Yo();let a;r===q.WAITING&&"signing"!==i.waitingStatus||r===q.ONBOARDING&&i.showAllWallets||r===q.ACTIVITY||r===q.SEND||r===q.OTP?a="back":r===q.ONBOARDING&&(a="info");const{title:c,Component:s,isSticky:u}=Le[r],d=r===q.WRONG_NETWORK||r===q.WAITING||r===q.SUCCESSFUL;return l.createElement(D,{isOpen:e,onBack:()=>{r===q.WAITING||r===q.OTP&&!i.isAuthenticated?n(q.ONBOARDING):i.showAllWallets?o((e=>({...e,showAllWallets:!1}))):r!==q.SEND&&r!==q.ACTIVITY||n(q.PROFILE)},onClose:u?()=>{}:()=>{t();const e=i.waitingStatus,{resolver:n,rejecter:o,result:a}=i.signTransaction;r===q.SUCCESSFUL&&"signing"===e?n&&a&&n(a):r===q.SIGN_TRANSACTION&&o&&o({code:4001,message:"User rejected the transaction"})},title:c,isSticky:u,icon:a,closeButton:!d},s)}const Oe={theme:"light",logo:"",font:"Manrope",accent:"#0c1083",borderWidth:"1px",bgField:"#ffffff",borderRadius:"32px",textColor:"#000000",background:"#ffffff",includeBorders:!0,borderColor:"#cdceee"},Re={theme:"dark",logo:"",font:"Manrope",accent:"#ffffff",borderWidth:"1px",bgField:"#1a1a1a",borderRadius:"32px",textColor:"#ffffff",background:"#000000",includeBorders:!0,borderColor:"#333333"};var Pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ue(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var ze,je={},Fe={},De={},He={},Ke={};function qe(){return ze||(ze=1,Ke.__esModule=!0,Ke.integers=void 0,Ke.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]),Ke}var Ve,We={};function Ze(){if(Ve)return We;Ve=1,We.__esModule=!0,We.DecodeBuffer=We.EncodeBuffer=void 0;var e=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();We.EncodeBuffer=e;var t=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();return We.DecodeBuffer=t,We}var $e,Ge,Xe={};function Je(){if($e)return Xe;$e=1;var e,t=Xe&&Xe.__extends||(e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)});Xe.__esModule=!0,Xe.validate_schema=Xe.ErrorSchema=Xe.expect_enum=Xe.expect_same_size=Xe.expect_bigint=Xe.expect_type=Xe.isArrayLike=void 0;var r=qe();Xe.isArrayLike=function(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)},Xe.expect_type=function(e,t,r){if(typeof e!==t)throw new Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))},Xe.expect_bigint=function(e,t){if(!["number","string","bigint","boolean"].includes(typeof e)&&!("object"==typeof e&&null!==e&&"toString"in e))throw new Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))},Xe.expect_same_size=function(e,t,r){if(e!==t)throw new Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))},Xe.expect_enum=function(e,t){if("object"!=typeof e||null===e)throw new Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))};var n=r.integers.concat(["bool","string"]),i=["option","enum","array","set","map","struct"],o=function(e){function r(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return t(r,e),r}(Error);function a(e){if("string"!=typeof e||!n.includes(e)){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&i.includes(t[0])){var r=t[0];if("option"===r)return a(e[r]);if("enum"===r)return function(e){if(!Array.isArray(e))throw new o(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw new Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw new Error('The "struct" in each enum must have a single key');a({struct:n.struct})}}(e[r]);if("array"===r)return function(e){if("object"!=typeof e)throw new o(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw new Error("Invalid schema: ".concat(e));if("type"in e)return a(e.type);throw new o(e,"{ type, len? }")}(e[r]);if("set"===r)return a(e[r]);if("map"===r)return function(e){if("object"!=typeof e||!("key"in e)||!("value"in e))throw new o(e,"{ key, value }");a(e.key),a(e.value)}(e[r]);if("struct"===r)return function(e){if("object"!=typeof e)throw new o(e,"object");for(var t in e)a(e[t])}(e[r])}}throw new o(e,i.join(", ")+" or "+n.join(", "))}}return Xe.ErrorSchema=o,Xe.validate_schema=a,Xe}var Ye,Qe,et={};var tt,rt={exports:{}},nt=Ue(Object.freeze({__proto__:null,default:{}}));var it,ot={},at={};function ct(){return it||(it=1,Object.defineProperty(at,"__esModule",{value:!0}),at.KeySize=at.KeyType=void 0,function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1"}(e||(at.KeyType=e={})),at.KeySize={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64}),at;var e}var st,lt={},ut={};function dt(){if(st)return ut;st=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.KeyPairBase=void 0;return ut.KeyPairBase=class{},ut}var ft,ht={},bt={},pt={};var mt,gt={},yt={},wt={GasLimitExceeded:"Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName:"Method name is empty",WasmerCompileError:"Wasmer compilation error: {{msg}}",GuestPanic:"Smart contract panicked: {{panic_msg}}",Memory:"Error creating Wasm memory",GasExceeded:"Exceeded the prepaid gas",MethodUTF8Error:"Method name is not valid UTF8 string",BadUTF16:"String encoding is bad UTF-16 sequence",WasmTrap:"WebAssembly trap: {{msg}}",GasInstrumentation:"Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex:"{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex:"Accessed invalid promise result index: {{result_idx}}",Deserialization:"Error happened while deserializing the module",MethodNotFound:"Contract method is not found",InvalidRegisterId:"Accessed invalid register id: {{register_id}}",InvalidReceiptIndex:"VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName:"Method name is empty in contract call",CannotReturnJointPromise:"Returning joint promise is currently prohibited",StackHeightInstrumentation:"Stack instrumentation failed",CodeDoesNotExist:"Cannot find contract code for account {{account_id}}",MethodInvalidSignature:"Invalid method signature",IntegerOverflow:"Integer overflow happened during contract execution",MemoryAccessViolation:"MemoryAccessViolation",InvalidIteratorIndex:"Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated:"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId:"VM Logic returned an invalid account id",Serialization:"Error happened while serializing the module",CannotAppendActionToJointPromise:"Actions can only be appended to non-joint promise.",InternalMemoryDeclared:"Internal memory declaration has been found in the module",Instantiate:"Error happened during instantiation",ProhibitedInView:"{{method_name}} is not allowed in view calls",InvalidMethodName:"VM Logic returned an invalid method name",BadUTF8:"String encoding is bad UTF-8 sequence",BalanceExceeded:"Exceeded the account balance",LinkError:"Wasm contract link error: {{msg}}",InvalidPublicKey:"VM Logic provided an invalid public key",ActorNoPermission:"Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState:"The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch:"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow:"Transaction gas or balance cost is too high",InvalidSignature:"Transaction is not signed with the given public key",AccessKeyNotFound:'Signer "{{account_id}}" doesn\'t have access key with the given public_key {{public_key}}',NotEnoughBalance:"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance:"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired:"Transaction has expired",DeleteAccountStaking:"Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist:"Signer {{signer_id}} does not exist",TriesToStake:"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists:"The public key {{public_key}} is already used for an existing access key",InvalidSigner:"Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed:"The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess:"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake:"Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce:"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists:"Can't create a new account {{account_id}}, because it already exists",InvalidChain:"Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist:"Can't complete the action because account {{account_id}} doesn't exist",AccessKeyDoesNotExist:"Can't complete the action because access key {{public_key}} doesn't exist",MethodNameMismatch:"Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver:"Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist:"Account {{account_id}} tries to remove an access key that doesn't exist",Timeout:"Timeout exceeded",Closed:"Connection closed",ShardCongested:"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later",ShardStuck:"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"};function vt(){if(mt)return yt;mt=1;var e=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yt,"__esModule",{value:!0}),yt.ErrorMessages=void 0;const t=e(wt);return yt.ErrorMessages=t.default,yt}var xt,Et={},Ct={},_t={};var Mt,At={};var St,kt={};var It,Bt={},Nt={};var Lt,Tt,Ot,Rt={};function Pt(){return Tt||(Tt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FinalExecutionStatusBasic=e.ExecutionStatusBasic=e.IdType=void 0;var t,r=(It||(It=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(t||(Nt.IdType=t={}))),Nt);Object.defineProperty(e,"IdType",{enumerable:!0,get:function(){return r.IdType}});var n,i,o=(Lt||(Lt=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.FinalExecutionStatusBasic=Rt.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(n||(Rt.ExecutionStatusBasic=n={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(i||(Rt.FinalExecutionStatusBasic=i={}))),Rt);Object.defineProperty(e,"ExecutionStatusBasic",{enumerable:!0,get:function(){return o.ExecutionStatusBasic}}),Object.defineProperty(e,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return o.FinalExecutionStatusBasic}})}(Bt)),Bt}function Ut(){return Ot||(Ot=1,e=Ct,t=Ct&&Ct.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=Ct&&Ct.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)},Object.defineProperty(e,"__esModule",{value:!0}),r((xt||(xt=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.Assignable=void 0,_t.Assignable=class{constructor(e){Object.keys(e).map((t=>{this[t]=e[t]}))}}),_t),e),r((Mt||(Mt=1,Object.defineProperty(At,"__esModule",{value:!0}),At.Enum=void 0,At.Enum=class{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map((t=>{this[t]=e[t]}))}}),At),e),r(function(){if(St)return kt;St=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.ErrorContext=kt.TypedError=kt.ArgumentTypeError=kt.PositionalArgsError=void 0;class e extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}kt.PositionalArgsError=e;class t extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}kt.ArgumentTypeError=t;class r extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}return kt.TypedError=r,kt.ErrorContext=class{transactionHash;constructor(e){this.transactionHash=e}},kt}(),e),r(Pt(),e)),Ct;var e,t,r}var zt,jt={exports:{}};function Ft(){return zt||(zt=1,jt.exports=function(){var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function r(e){return"function"==typeof e}function n(e){return t(e)?"array":typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function a(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var c=RegExp.prototype.test;function s(e,t){return c.call(e,t)}var l=/\S/;function u(e){return!s(l,e)}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function f(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return d[e]}))}var h=/\s*/,b=/\s+/,p=/\s*=/,m=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function y(e,r){if(!e)return[];var n,o,a,c=!1,s=[],l=[],d=[],f=!1,y=!1,E="",C=0;function M(){if(f&&!y)for(;d.length;)delete l[d.pop()];else d=[];f=!1,y=!1}function A(e){if("string"==typeof e&&(e=e.split(b,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);n=new RegExp(i(e[0])+"\\s*"),o=new RegExp("\\s*"+i(e[1])),a=new RegExp("\\s*"+i("}"+e[1]))}A(r||_.tags);for(var S,k,I,B,N,L,T=new x(e);!T.eos();){if(S=T.pos,I=T.scanUntil(n))for(var O=0,R=I.length;O<R;++O)u(B=I.charAt(O))?(d.push(l.length),E+=B):(y=!0,c=!0,E+=" "),l.push(["text",B,S,S+1]),S+=1,"\n"===B&&(M(),E="",C=0,c=!1);if(!T.scan(n))break;if(f=!0,k=T.scan(g)||"name",T.scan(h),"="===k?(I=T.scanUntil(p),T.scan(p),T.scanUntil(o)):"{"===k?(I=T.scanUntil(a),T.scan(m),T.scanUntil(o),k="&"):I=T.scanUntil(o),!T.scan(o))throw new Error("Unclosed tag at "+T.pos);if(N=">"==k?[k,I,S,T.pos,E,C,c]:[k,I,S,T.pos],C++,l.push(N),"#"===k||"^"===k)s.push(N);else if("/"===k){if(!(L=s.pop()))throw new Error('Unopened section "'+I+'" at '+S);if(L[1]!==I)throw new Error('Unclosed section "'+L[1]+'" at '+S)}else"name"===k||"{"===k||"&"===k?y=!0:"="===k&&A(I)}if(M(),L=s.pop())throw new Error('Unclosed section "'+L[1]+'" at '+T.pos);return v(w(l))}function w(e){for(var t,r,n=[],i=0,o=e.length;i<o;++i)(t=e[i])&&("text"===t[0]&&r&&"text"===r[0]?(r[1]+=t[1],r[3]=t[3]):(n.push(t),r=t));return n}function v(e){for(var t,r=[],n=r,i=[],o=0,a=e.length;o<a;++o)switch((t=e[o])[0]){case"#":case"^":n.push(t),i.push(t),n=t[4]=[];break;case"/":i.pop()[5]=t[2],n=i.length>0?i[i.length-1][4]:r;break;default:n.push(t)}return r}function x(e){this.string=e,this.tail=e,this.pos=0}function E(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function C(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}x.prototype.eos=function(){return""===this.tail},x.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},x.prototype.scanUntil=function(e){var t,r=this.tail.search(e);switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t},E.prototype.push=function(e){return new E(e,this)},E.prototype.lookup=function(e){var t,n=this.cache;if(n.hasOwnProperty(e))t=n[e];else{for(var i,c,s,l=this,u=!1;l;){if(e.indexOf(".")>0)for(i=l.view,c=e.split("."),s=0;null!=i&&s<c.length;)s===c.length-1&&(u=o(i,c[s])||a(i,c[s])),i=i[c[s++]];else i=l.view[e],u=o(l.view,e);if(u){t=i;break}l=l.parent}n[e]=t}return r(t)&&(t=t.call(this.view)),t},C.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},C.prototype.parse=function(e,t){var r=this.templateCache,n=e+":"+(t||_.tags).join(":"),i=void 0!==r,o=i?r.get(n):void 0;return null==o&&(o=y(e,t),i&&r.set(n,o)),o},C.prototype.render=function(e,t,r,n){var i=this.parse(e,n),o=t instanceof E?t:new E(t,void 0);return this.renderTokens(i,o,r,e,n)},C.prototype.renderTokens=function(e,t,r,n,i){for(var o,a,c,s="",l=0,u=e.length;l<u;++l)c=void 0,"#"===(a=(o=e[l])[0])?c=this.renderSection(o,t,r,n):"^"===a?c=this.renderInverted(o,t,r,n):">"===a?c=this.renderPartial(o,t,r,i):"&"===a?c=this.unescapedValue(o,t):"name"===a?c=this.escapedValue(o,t):"text"===a&&(c=this.rawValue(o)),void 0!==c&&(s+=c);return s},C.prototype.renderSection=function(e,n,i,o){var a=this,c="",s=n.lookup(e[1]);function l(e){return a.render(e,n,i)}if(s){if(t(s))for(var u=0,d=s.length;u<d;++u)c+=this.renderTokens(e[4],n.push(s[u]),i,o);else if("object"==typeof s||"string"==typeof s||"number"==typeof s)c+=this.renderTokens(e[4],n.push(s),i,o);else if(r(s)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(s=s.call(n.view,o.slice(e[3],e[5]),l))&&(c+=s)}else c+=this.renderTokens(e[4],n,i,o);return c}},C.prototype.renderInverted=function(e,r,n,i){var o=r.lookup(e[1]);if(!o||t(o)&&0===o.length)return this.renderTokens(e[4],r,n,i)},C.prototype.indentPartial=function(e,t,r){for(var n=t.replace(/[^ \t]/g,""),i=e.split("\n"),o=0;o<i.length;o++)i[o].length&&(o>0||!r)&&(i[o]=n+i[o]);return i.join("\n")},C.prototype.renderPartial=function(e,t,n,i){if(n){var o=r(n)?n(e[1]):n[e[1]];if(null!=o){var a=e[6],c=e[5],s=e[4],l=o;return 0==c&&s&&(l=this.indentPartial(o,s,a)),this.renderTokens(this.parse(l,i),t,n,l)}}},C.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(null!=r)return r},C.prototype.escapedValue=function(e,t){var r=t.lookup(e[1]);if(null!=r)return _.escape(r)},C.prototype.rawValue=function(e){return e[1]};var _={name:"mustache.js",version:"4.0.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){M.templateCache=e},get templateCache(){return M.templateCache}},M=new C;return _.clearCache=function(){return M.clearCache()},_.parse=function(e,t){return M.parse(e,t)},_.render=function(e,t,r,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return M.render(e,t,r,i)},_.escape=f,_.Scanner=x,_.Context=E,_.Writer=C,_}()),jt.exports}var Dt,Ht,Kt={},qt={};function Vt(){return Dt||(Dt=1,function(e){function t(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function r(e,...r){if(!t(e))throw new Error("Uint8Array expected");if(r.length>0&&!r.includes(e.length))throw new Error("Uint8Array expected of length "+r+", got length="+e.length)}function n(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every((e=>"string"==typeof e)):t.every((e=>Number.isSafeInteger(e)))))}function i(e){if("function"!=typeof e)throw new Error("function expected");return!0}function o(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function a(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function c(e){if(!Array.isArray(e))throw new Error("array expected")}function s(e,t){if(!n(!0,t))throw new Error(`${e}: array of strings expected`)}function l(e,t){if(!n(!1,t))throw new Error(`${e}: array of numbers expected`)}function u(...e){const t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map((e=>e.encode)).reduceRight(r,t),decode:e.map((e=>e.decode)).reduce(r,t)}}function d(e){const t="string"==typeof e?e.split(""):e,r=t.length;s("alphabet",t);const n=new Map(t.map(((e,t)=>[e,t])));return{encode:n=>(c(n),n.map((n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]}))),decode:t=>(c(t),t.map((t=>{o("alphabet.decode",t);const r=n.get(t);if(void 0===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r})))}}function f(e=""){return o("join",e),{encode:t=>(s("join.decode",t),t.join(e)),decode:t=>(o("join.decode",t),t.split(e))}}function h(e,t="="){return a(e),o("padding",t),{encode(r){for(s("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){s("padding.decode",r);let n=r.length;if(n*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--){if((n-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return r.slice(0,n)}}}function b(e){return i(e),{encode:e=>e,decode:t=>e(t)}}function p(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(c(e),!e.length)return[];let n=0;const i=[],o=Array.from(e,(e=>{if(a(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e})),s=o.length;for(;;){let e=0,a=!0;for(let i=n;i<s;i++){const c=o[i],s=t*e,l=s+c;if(!Number.isSafeInteger(l)||s/t!==e||l-c!==s)throw new Error("convertRadix: carry overflow");const u=l/r;e=l%r;const d=Math.floor(u);if(o[i]=d,!Number.isSafeInteger(d)||d*r+e!==l)throw new Error("convertRadix: carry overflow");a&&(d?a=!1:n=i)}if(i.push(e),a)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.createBase58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64urlnopad=e.base64url=e.base64nopad=e.base64=e.base32crockford=e.base32hexnopad=e.base32hex=e.base32nopad=e.base32=e.base16=e.utils=void 0;const m=(e,t)=>0===t?e:m(t,e%t),g=(e,t)=>e+(t-m(e,t)),y=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function w(e,t,r,n){if(c(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(g(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${g(t,r)}`);let i=0,o=0;const s=y[t],l=y[r]-1,u=[];for(const n of e){if(a(n),n>=s)throw new Error(`convertRadix2: invalid data word=${n} from=${t}`);if(i=i<<t|n,o+t>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)u.push((i>>o-r&l)>>>0);const e=y[o];if(void 0===e)throw new Error("invalid carry");i&=e-1}if(i=i<<r-o&l,!n&&o>=t)throw new Error("Excess padding");if(!n&&i>0)throw new Error(`Non-zero padding: ${i}`);return n&&o>0&&u.push(i>>>0),u}function v(e){a(e);return{encode:r=>{if(!t(r))throw new Error("radix.encode input should be Uint8Array");return p(Array.from(r),256,e)},decode:t=>(l("radix.decode",t),Uint8Array.from(p(t,e,256)))}}function x(e,r=!1){if(a(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(g(8,e)>32||g(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!t(n))throw new Error("radix2.encode input should be Uint8Array");return w(Array.from(n),8,e,!r)},decode:t=>(l("radix2.decode",t),Uint8Array.from(w(t,e,8,r)))}}function E(e){return i(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function C(e,r){return a(e),i(r),{encode(n){if(!t(n))throw new Error("checksum.encode: input should be Uint8Array");const i=r(n).slice(0,e),o=new Uint8Array(n.length+e);return o.set(n),o.set(i,n.length),o},decode(n){if(!t(n))throw new Error("checksum.decode: input should be Uint8Array");const i=n.slice(0,-e),o=n.slice(-e),a=r(i).slice(0,e);for(let t=0;t<e;t++)if(a[t]!==o[t])throw new Error("Invalid checksum");return i}}}e.utils={alphabet:d,chain:u,checksum:C,convertRadix:p,convertRadix2:w,radix:v,radix2:x,join:f,padding:h},e.base16=u(x(4),d("0123456789ABCDEF"),f("")),e.base32=u(x(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),h(5),f("")),e.base32nopad=u(x(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),f("")),e.base32hex=u(x(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),h(5),f("")),e.base32hexnopad=u(x(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),f("")),e.base32crockford=u(x(5),d("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),f(""),b((e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))));const _=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)(),M=(e,t)=>{o("base64",e);const r=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,n=t?"base64url":"base64";if(e.length>0&&!r.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:n,lastChunkHandling:"strict"})};e.base64=_?{encode:e=>(r(e),e.toBase64()),decode:e=>M(e,!1)}:u(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),h(6),f("")),e.base64nopad=u(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),f("")),e.base64url=_?{encode:e=>(r(e),e.toBase64({alphabet:"base64url"})),decode:e=>M(e,!0)}:u(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),h(6),f("")),e.base64urlnopad=u(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),f(""));const A=e=>u(v(58),d(e),f(""));e.base58=A("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=A("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=A("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const S=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(t){let r="";for(let n=0;n<t.length;n+=8){const i=t.subarray(n,n+8);r+=e.base58.encode(i).padStart(S[i.length],"1")}return r},decode(t){let r=[];for(let n=0;n<t.length;n+=11){const i=t.slice(n,n+11),o=S.indexOf(i.length),a=e.base58.decode(i);for(let e=0;e<a.length-o;e++)if(0!==a[e])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(a.slice(a.length-o)))}return Uint8Array.from(r)}};e.createBase58check=t=>u(C(4,(e=>t(t(e)))),e.base58),e.base58check=e.createBase58check;const k=u(d("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),f("")),I=[996825010,642813549,513874426,1027748829,705979059];function B(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<I.length;e++)1==(t>>e&1)&&(r^=I[e]);return r}function N(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=B(i)^r>>5}i=B(i);for(let t=0;t<n;t++)i=B(i)^31&e.charCodeAt(t);for(let e of t)i=B(i)^e;for(let e=0;e<6;e++)i=B(i);return i^=r,k.encode(w([i%y[30]],30,5,!1))}function L(e){const r="bech32"===e?1:734539939,n=x(5),i=n.decode,a=n.encode,c=E(i);function s(e,n,i=90){o("bech32.encode prefix",e),t(n)&&(n=Array.from(n)),l("bech32.encode",n);const a=e.length;if(0===a)throw new TypeError(`Invalid prefix length ${a}`);const c=a+7+n.length;if(!1!==i&&c>i)throw new TypeError(`Length ${c} exceeds limit ${i}`);const s=e.toLowerCase(),u=N(s,n,r);return`${s}1${k.encode(n)}${u}`}function u(e,t=90){o("bech32.decode input",e);const n=e.length;if(n<8||!1!==t&&n>t)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${t})`);const i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const a=i.lastIndexOf("1");if(0===a||-1===a)throw new Error('Letter "1" must be present between prefix and data only');const c=i.slice(0,a),s=i.slice(a+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const l=k.decode(s).slice(0,-6),u=N(c,l,r);if(!s.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected "${u}"`);return{prefix:c,words:l}}return{encode:s,decode:u,encodeFromBytes:function(e,t){return s(e,a(t))},decodeToBytes:function(e){const{prefix:t,words:r}=u(e,!1);return{prefix:t,words:r,bytes:i(r)}},decodeUnsafe:E(u),fromWords:i,fromWordsUnsafe:c,toWords:a}}e.bech32=L("bech32"),e.bech32m=L("bech32m"),e.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)};const T=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),O={encode:e=>(r(e),e.toHex()),decode:e=>(o("hex",e),Uint8Array.fromHex(e))};e.hex=T?O:u(x(4),d("0123456789abcdef"),f(""),b((e=>{if("string"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const R={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},P="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";e.bytesToString=(e,r)=>{if("string"!=typeof e||!R.hasOwnProperty(e))throw new TypeError(P);if(!t(r))throw new TypeError("bytesToString() expects Uint8Array");return R[e].encode(r)},e.str=e.bytesToString;e.stringToBytes=(e,t)=>{if(!R.hasOwnProperty(e))throw new TypeError(P);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return R[e].decode(t)},e.bytes=e.stringToBytes}(qt)),qt}function Wt(){return Ht||(Ht=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.baseDecode=e.baseEncode=e.parseNearAmount=e.formatNearAmount=e.NEAR_NOMINATION=e.NEAR_NOMINATION_EXP=void 0;const t=Vt();e.NEAR_NOMINATION_EXP=24,e.NEAR_NOMINATION=10n**BigInt(e.NEAR_NOMINATION_EXP);const r=[];for(let t=0,n=5n;t<e.NEAR_NOMINATION_EXP;t++,n*=10n)r[t]=n;e.formatNearAmount=function(t,n=e.NEAR_NOMINATION_EXP){let i=BigInt(t);if(n!==e.NEAR_NOMINATION_EXP){const t=e.NEAR_NOMINATION_EXP-n-1;t>0&&(i+=r[t])}const o=(t=i.toString()).substring(0,t.length-e.NEAR_NOMINATION_EXP)||"0",a=t.substring(t.length-e.NEAR_NOMINATION_EXP).padStart(e.NEAR_NOMINATION_EXP,"0").substring(0,n);return`${function(e){const t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}(o)}.${a}`.replace(/\.?0*$/,"")},e.parseNearAmount=function(t){if(!t)return null;const r=(t=t.replace(/,/g,"").trim()).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>e.NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${t}' as NEAR amount`);return function(e){if(""===(e=e.replace(/^0+/,"")))return"0";return e}(n+i.padEnd(e.NEAR_NOMINATION_EXP,"0"))},e.baseEncode=function(e){if("string"==typeof e){const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return t.base58.encode(e)},e.baseDecode=function(e){return t.base58.decode(e)}}(Kt)),Kt}var Zt,$t,Gt={schema:{AccessKeyNotFound:{name:"AccessKeyNotFound",subtypes:[],props:{account_id:"",public_key:""}},AccountAlreadyExists:{name:"AccountAlreadyExists",subtypes:[],props:{account_id:""}},AccountDoesNotExist:{name:"AccountDoesNotExist",subtypes:[],props:{account_id:""}},ActionError:{name:"ActionError",subtypes:["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],props:{index:""}},ActionsValidationError:{name:"ActionsValidationError",subtypes:["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],props:{}},ActorNoPermission:{name:"ActorNoPermission",subtypes:[],props:{account_id:"",actor_id:""}},AddKeyAlreadyExists:{name:"AddKeyAlreadyExists",subtypes:[],props:{account_id:"",public_key:""}},AddKeyMethodNameLengthExceeded:{name:"AddKeyMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},AddKeyMethodNamesNumberOfBytesExceeded:{name:"AddKeyMethodNamesNumberOfBytesExceeded",subtypes:[],props:{limit:"",total_number_of_bytes:""}},AltBn128InvalidInput:{name:"AltBn128InvalidInput",subtypes:[],props:{msg:""}},BadUTF16:{name:"BadUTF16",subtypes:[],props:{}},BadUTF8:{name:"BadUTF8",subtypes:[],props:{}},BalanceExceeded:{name:"BalanceExceeded",subtypes:[],props:{}},BalanceMismatchError:{name:"BalanceMismatchError",subtypes:[],props:{final_accounts_balance:"",final_postponed_receipts_balance:"",forwarded_buffered_receipts_balance:"",incoming_receipts_balance:"",incoming_validator_rewards:"",initial_accounts_balance:"",initial_postponed_receipts_balance:"",new_buffered_receipts_balance:"",new_delayed_receipts_balance:"",other_burnt_amount:"",outgoing_receipts_balance:"",processed_delayed_receipts_balance:"",slashed_burnt_amount:"",tx_burnt_amount:""}},CallIndirectOOB:{name:"CallIndirectOOB",subtypes:[],props:{}},CannotAppendActionToJointPromise:{name:"CannotAppendActionToJointPromise",subtypes:[],props:{}},CannotReturnJointPromise:{name:"CannotReturnJointPromise",subtypes:[],props:{}},CodeDoesNotExist:{name:"CodeDoesNotExist",subtypes:[],props:{account_id:""}},CompilationError:{name:"CompilationError",subtypes:["CodeDoesNotExist","PrepareError","WasmerCompileError"],props:{}},ContractSizeExceeded:{name:"ContractSizeExceeded",subtypes:[],props:{limit:"",size:""}},CostOverflow:{name:"CostOverflow",subtypes:[],props:{}},CreateAccountNotAllowed:{name:"CreateAccountNotAllowed",subtypes:[],props:{account_id:"",predecessor_id:""}},CreateAccountOnlyByRegistrar:{name:"CreateAccountOnlyByRegistrar",subtypes:[],props:{account_id:"",predecessor_id:"",registrar_account_id:""}},DelegateActionExpired:{name:"DelegateActionExpired",subtypes:[],props:{}},DelegateActionInvalidNonce:{name:"DelegateActionInvalidNonce",subtypes:[],props:{ak_nonce:"",delegate_nonce:""}},DelegateActionInvalidSignature:{name:"DelegateActionInvalidSignature",subtypes:[],props:{}},DelegateActionMustBeOnlyOne:{name:"DelegateActionMustBeOnlyOne",subtypes:[],props:{}},DelegateActionNonceTooLarge:{name:"DelegateActionNonceTooLarge",subtypes:[],props:{delegate_nonce:"",upper_bound:""}},DelegateActionSenderDoesNotMatchTxReceiver:{name:"DelegateActionSenderDoesNotMatchTxReceiver",subtypes:[],props:{receiver_id:"",sender_id:""}},DeleteAccountStaking:{name:"DeleteAccountStaking",subtypes:[],props:{account_id:""}},DeleteAccountWithLargeState:{name:"DeleteAccountWithLargeState",subtypes:[],props:{account_id:""}},DeleteActionMustBeFinal:{name:"DeleteActionMustBeFinal",subtypes:[],props:{}},DeleteKeyDoesNotExist:{name:"DeleteKeyDoesNotExist",subtypes:[],props:{account_id:"",public_key:""}},DepositWithFunctionCall:{name:"DepositWithFunctionCall",subtypes:[],props:{}},Deprecated:{name:"Deprecated",subtypes:[],props:{method_name:""}},Deserialization:{name:"Deserialization",subtypes:[],props:{}},ECRecoverError:{name:"ECRecoverError",subtypes:[],props:{msg:""}},Ed25519VerifyInvalidInput:{name:"Ed25519VerifyInvalidInput",subtypes:[],props:{msg:""}},EmptyMethodName:{name:"EmptyMethodName",subtypes:[],props:{}},Expired:{name:"Expired",subtypes:[],props:{}},FunctionCallArgumentsLengthExceeded:{name:"FunctionCallArgumentsLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallMethodNameLengthExceeded:{name:"FunctionCallMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallZeroAttachedGas:{name:"FunctionCallZeroAttachedGas",subtypes:[],props:{}},GasExceeded:{name:"GasExceeded",subtypes:[],props:{}},GasInstrumentation:{name:"GasInstrumentation",subtypes:[],props:{}},GasLimitExceeded:{name:"GasLimitExceeded",subtypes:[],props:{}},GenericTrap:{name:"GenericTrap",subtypes:[],props:{}},GuestPanic:{name:"GuestPanic",subtypes:[],props:{panic_msg:""}},HostError:{name:"HostError",subtypes:["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],props:{}},IllegalArithmetic:{name:"IllegalArithmetic",subtypes:[],props:{}},IncorrectCallIndirectSignature:{name:"IncorrectCallIndirectSignature",subtypes:[],props:{}},IndirectCallToNull:{name:"IndirectCallToNull",subtypes:[],props:{}},Instantiate:{name:"Instantiate",subtypes:[],props:{}},InsufficientStake:{name:"InsufficientStake",subtypes:[],props:{account_id:"",minimum_stake:"",stake:""}},IntegerOverflow:{name:"IntegerOverflow",subtypes:[],props:{}},InternalMemoryDeclared:{name:"InternalMemoryDeclared",subtypes:[],props:{}},InvalidAccessKeyError:{name:"InvalidAccessKeyError",subtypes:["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],props:{}},InvalidAccountId:{name:"InvalidAccountId",subtypes:[],props:{}},InvalidChain:{name:"InvalidChain",subtypes:[],props:{}},InvalidDataReceiverId:{name:"InvalidDataReceiverId",subtypes:[],props:{account_id:""}},InvalidIteratorIndex:{name:"InvalidIteratorIndex",subtypes:[],props:{iterator_index:""}},InvalidMethodName:{name:"InvalidMethodName",subtypes:[],props:{}},InvalidNonce:{name:"InvalidNonce",subtypes:[],props:{ak_nonce:"",tx_nonce:""}},InvalidPredecessorId:{name:"InvalidPredecessorId",subtypes:[],props:{account_id:""}},InvalidPromiseIndex:{name:"InvalidPromiseIndex",subtypes:[],props:{promise_idx:""}},InvalidPromiseResultIndex:{name:"InvalidPromiseResultIndex",subtypes:[],props:{result_idx:""}},InvalidPublicKey:{name:"InvalidPublicKey",subtypes:[],props:{}},InvalidReceiptIndex:{name:"InvalidReceiptIndex",subtypes:[],props:{receipt_index:""}},InvalidReceiverId:{name:"InvalidReceiverId",subtypes:[],props:{account_id:""}},InvalidRegisterId:{name:"InvalidRegisterId",subtypes:[],props:{register_id:""}},InvalidSignature:{name:"InvalidSignature",subtypes:[],props:{}},InvalidSignerId:{name:"InvalidSignerId",subtypes:[],props:{account_id:""}},InvalidTxError:{name:"InvalidTxError",subtypes:["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],props:{}},IteratorWasInvalidated:{name:"IteratorWasInvalidated",subtypes:[],props:{iterator_index:""}},KeyLengthExceeded:{name:"KeyLengthExceeded",subtypes:[],props:{length:"",limit:""}},LackBalanceForState:{name:"LackBalanceForState",subtypes:[],props:{account_id:"",amount:""}},Memory:{name:"Memory",subtypes:[],props:{}},MemoryAccessViolation:{name:"MemoryAccessViolation",subtypes:[],props:{}},MemoryOutOfBounds:{name:"MemoryOutOfBounds",subtypes:[],props:{}},MethodEmptyName:{name:"MethodEmptyName",subtypes:[],props:{}},MethodInvalidSignature:{name:"MethodInvalidSignature",subtypes:[],props:{}},MethodNameMismatch:{name:"MethodNameMismatch",subtypes:[],props:{method_name:""}},MethodNotFound:{name:"MethodNotFound",subtypes:[],props:{}},MethodResolveError:{name:"MethodResolveError",subtypes:["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],props:{}},MisalignedAtomicAccess:{name:"MisalignedAtomicAccess",subtypes:[],props:{}},NonceTooLarge:{name:"NonceTooLarge",subtypes:[],props:{tx_nonce:"",upper_bound:""}},NotEnoughAllowance:{name:"NotEnoughAllowance",subtypes:[],props:{account_id:"",allowance:"",cost:"",public_key:""}},NotEnoughBalance:{name:"NotEnoughBalance",subtypes:[],props:{balance:"",cost:"",signer_id:""}},NumberInputDataDependenciesExceeded:{name:"NumberInputDataDependenciesExceeded",subtypes:[],props:{limit:"",number_of_input_data_dependencies:""}},NumberOfLogsExceeded:{name:"NumberOfLogsExceeded",subtypes:[],props:{limit:""}},NumberPromisesExceeded:{name:"NumberPromisesExceeded",subtypes:[],props:{limit:"",number_of_promises:""}},OnlyImplicitAccountCreationAllowed:{name:"OnlyImplicitAccountCreationAllowed",subtypes:[],props:{account_id:""}},PrepareError:{name:"PrepareError",subtypes:["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],props:{}},ProhibitedInView:{name:"ProhibitedInView",subtypes:[],props:{method_name:""}},ReceiptSizeExceeded:{name:"ReceiptSizeExceeded",subtypes:[],props:{limit:"",size:""}},ReceiptValidationError:{name:"ReceiptValidationError",subtypes:["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],props:{}},ReceiverMismatch:{name:"ReceiverMismatch",subtypes:[],props:{ak_receiver:"",tx_receiver:""}},RequiresFullAccess:{name:"RequiresFullAccess",subtypes:[],props:{}},ReturnedValueLengthExceeded:{name:"ReturnedValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},Serialization:{name:"Serialization",subtypes:[],props:{}},ShardCongested:{name:"ShardCongested",subtypes:[],props:{congestion_level:"",shard_id:""}},ShardStuck:{name:"ShardStuck",subtypes:[],props:{missed_chunks:"",shard_id:""}},SignerDoesNotExist:{name:"SignerDoesNotExist",subtypes:[],props:{signer_id:""}},StackHeightInstrumentation:{name:"StackHeightInstrumentation",subtypes:[],props:{}},StackOverflow:{name:"StackOverflow",subtypes:[],props:{}},TooManyFunctions:{name:"TooManyFunctions",subtypes:[],props:{}},TooManyLocals:{name:"TooManyLocals",subtypes:[],props:{}},TotalLogLengthExceeded:{name:"TotalLogLengthExceeded",subtypes:[],props:{length:"",limit:""}},TotalNumberOfActionsExceeded:{name:"TotalNumberOfActionsExceeded",subtypes:[],props:{limit:"",total_number_of_actions:""}},TotalPrepaidGasExceeded:{name:"TotalPrepaidGasExceeded",subtypes:[],props:{limit:"",total_prepaid_gas:""}},TransactionSizeExceeded:{name:"TransactionSizeExceeded",subtypes:[],props:{limit:"",size:""}},TriesToStake:{name:"TriesToStake",subtypes:[],props:{account_id:"",balance:"",locked:"",stake:""}},TriesToUnstake:{name:"TriesToUnstake",subtypes:[],props:{account_id:""}},TxExecutionError:{name:"TxExecutionError",subtypes:["ActionError","InvalidTxError"],props:{}},Unreachable:{name:"Unreachable",subtypes:[],props:{}},UnsuitableStakingKey:{name:"UnsuitableStakingKey",subtypes:[],props:{public_key:""}},UnsupportedProtocolFeature:{name:"UnsupportedProtocolFeature",subtypes:[],props:{protocol_feature:"",version:""}},ValueLengthExceeded:{name:"ValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},WasmTrap:{name:"WasmTrap",subtypes:["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],props:{}},WasmerCompileError:{name:"WasmerCompileError",subtypes:[],props:{msg:""}},Closed:{name:"Closed",subtypes:[],props:{}},ServerError:{name:"ServerError",subtypes:["TxExecutionError","Timeout","Closed"],props:{}},Timeout:{name:"Timeout",subtypes:[],props:{}}}};function Xt(){if(Zt)return Et;Zt=1;var e=Et&&Et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Et,"__esModule",{value:!0}),Et.getErrorTypeFromErrorMessage=Et.formatError=Et.parseResultError=Et.parseRpcError=Et.ServerError=void 0;const t=Ut(),r=e(Ft()),n=Wt(),i=vt(),o=e(Gt),a={formatNear:()=>(e,t)=>(0,n.formatNearAmount)(t(e))};class c extends t.TypedError{}Et.ServerError=c;class s extends c{transaction_outcome}function l(e){const t={},r=d(e,o.default.schema,t,""),n=new c(u(r,t),r);return Object.assign(n,t),n}function u(e,t){return"string"==typeof i.ErrorMessages[e]?r.default.render(i.ErrorMessages[e],{...t,...a}):JSON.stringify(t)}function d(e,t,r,n){let i,o,a;for(const r in t){if(c=e[r],"[object String]"===Object.prototype.toString.call(c))return e[r];if(f(e[r]))i=e[r],o=t[r],a=r;else{if(!f(e.kind)||!f(e.kind[r]))continue;i=e.kind[r],o=t[r],a=r}}var c;if(i&&o){for(const e of Object.keys(o.props))r[e]=i[e];return d(i,t,r,a)}return r.kind=e,n}function f(e){return"[object Object]"===Object.prototype.toString.call(e)}return Et.parseRpcError=l,Et.parseResultError=function(e){const t=l(e.status.Failure),r=new s;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r},Et.formatError=u,Et.getErrorTypeFromErrorMessage=function(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}},Et}function Jt(){return $t||($t=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseRpcError=e.parseResultError=e.getErrorTypeFromErrorMessage=e.formatError=e.ServerError=e.ErrorMessages=void 0;var t=vt();Object.defineProperty(e,"ErrorMessages",{enumerable:!0,get:function(){return t.ErrorMessages}});var r=Xt();Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return r.ServerError}}),Object.defineProperty(e,"formatError",{enumerable:!0,get:function(){return r.formatError}}),Object.defineProperty(e,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return r.getErrorTypeFromErrorMessage}}),Object.defineProperty(e,"parseResultError",{enumerable:!0,get:function(){return r.parseResultError}}),Object.defineProperty(e,"parseRpcError",{enumerable:!0,get:function(){return r.parseRpcError}})}(gt)),gt}var Yt,Qt={},er={},tr={};function rr(){if(Yt)return tr;Yt=1,Object.defineProperty(tr,"__esModule",{value:!0}),tr.ConsoleLogger=void 0;return tr.ConsoleLogger=class{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":case"warn":case"log":case"debug":case"verbose":return}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}},tr}var nr,ir,or,ar={};function cr(){return ir||(ir=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Logger=e.ConsoleLogger=void 0;var t=rr();Object.defineProperty(e,"ConsoleLogger",{enumerable:!0,get:function(){return t.ConsoleLogger}});var r=function(){if(nr)return ar;nr=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.Logger=void 0;const e=new(rr().ConsoleLogger)(["verbose","debug","log","warn","error","fatal"]);return ar.Logger=class{static instanceRef=e;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}},ar}();Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return r.Logger}})}(er)),er}var sr,lr={};var ur,dr,fr={};var hr,br,pr,mr={};function gr(){if(hr)return mr;return hr=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.sortBigIntAsc=void 0,mr.sortBigIntAsc=function(e,t){return e<t?-1:e>t?1:0},mr}function yr(){if(br)return fr;br=1;var e=fr&&fr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fr,"__esModule",{value:!0}),fr.diffEpochValidators=fr.findSeatPrice=void 0;const t=e(function(){if(dr)return ur;function e(e,t){if("function"!=typeof e)throw new TypeError("argument fn must be a function");return e}function t(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable")}return dr=1,ur=function(r){if(!r)throw new TypeError("argument namespace is required");function n(e){}return n._file=void 0,n._ignored=!0,n._namespace=r,n._traced=!1,n._warned=Object.create(null),n.function=e,n.property=t,n}}()),r=gr();return fr.findSeatPrice=function(e,n,i,o){if(o&&o<49)return function(e,t){const n=e.map((e=>BigInt(e.stake))).sort(r.sortBigIntAsc),i=BigInt(t),o=n.reduce(((e,t)=>e+t));if(o<i)throw new Error("Stakes are below seats");let a=1n,c=o+1n;for(;a!==c-1n;){const e=(a+c)/2n;let t=!1,r=0n;for(let o=0;o<n.length;++o)if(r+=n[o]/e,r>=i){a=e,t=!0;break}t||(c=e)}return a}(e,n);if(!i){(0,t.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),i=[1,6250]}return function(e,t,n){if(2!=n.length)throw Error("minimumStakeRatio should have 2 elements");const i=e.map((e=>BigInt(e.stake))).sort(r.sortBigIntAsc),o=i.reduce(((e,t)=>e+t));return e.length<t?o*BigInt(n[0])/BigInt(n[1]):i[0]+1n}(e,n,i)},fr.diffEpochValidators=function(e,t){const r=new Map;e.forEach((e=>r.set(e.account_id,e)));const n=new Set(t.map((e=>e.account_id)));return{newValidators:t.filter((e=>!r.has(e.account_id))),removedValidators:e.filter((e=>!n.has(e.account_id))),changedValidators:t.filter((e=>r.has(e.account_id)&&r.get(e.account_id).stake!=e.stake)).map((e=>({current:r.get(e.account_id),next:e})))}},fr}function wr(){return pr||(pr=1,e=bt,t=bt&&bt.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=bt&&bt.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)},Object.defineProperty(e,"__esModule",{value:!0}),r((ft||(ft=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.DEFAULT_FUNCTION_CALL_GAS=void 0,pt.DEFAULT_FUNCTION_CALL_GAS=30000000000000n),pt),e),r(Jt(),e),r(Wt(),e),r(function(){if(or)return Qt;or=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.printTxOutcomeLogs=Qt.printTxOutcomeLogsAndFailures=void 0;const e=Jt(),t=cr();function r({contractId:e,logs:r,prefix:n=""}){for(const i of r)t.Logger.log(`${n}Log [${e}]: ${i}`)}return Qt.printTxOutcomeLogsAndFailures=function({contractId:n,outcome:i}){const o=[i.transaction_outcome,...i.receipts_outcome].reduce(((t,r)=>{const n="object"==typeof r.outcome.status&&"object"==typeof r.outcome.status.Failure;return r.outcome.logs.length||n?t.concat({receiptIds:r.outcome.receipt_ids,logs:r.outcome.logs,failure:"object"==typeof r.outcome.status&&void 0!==r.outcome.status.Failure?(0,e.parseRpcError)(r.outcome.status.Failure):null}):t}),[]);for(const e of o)t.Logger.log(`Receipt${e.receiptIds.length>1?"s":""}: ${e.receiptIds.join(", ")}`),r({contractId:n,logs:e.logs,prefix:"\t"}),e.failure&&t.Logger.warn(`\tFailure [${n}]: ${e.failure}`)},Qt.printTxOutcomeLogs=r,Qt}(),e),r((sr||(sr=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.getTransactionLastResult=void 0,lr.getTransactionLastResult=function(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){const t=Buffer.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}),lr),e),r(yr(),e),r(cr(),e),r(gr(),e)),bt;var e,t,r}var vr,xr={},Er={},Cr={},_r={};function Mr(){if(vr)return _r;function e(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function t(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}return vr=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.anumber=e,_r.abytes=t,_r.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");e(t.outputLen),e(t.blockLen)},_r.aexists=function(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")},_r.aoutput=function(e,r){t(e);const n=r.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)},_r}var Ar,Sr,kr,Ir={},Br={};function Nr(){return Sr||(Sr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.isLE=void 0,e.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},e.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},e.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},e.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},e.rotr=function(e,t){return e<<32-t|e>>>t},e.rotl=function(e,t){return e<<t|e>>>32-t>>>0},e.byteSwap=n,e.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=n(e[t])},e.bytesToHex=function(e){(0,r.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},e.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=a(e.charCodeAt(i)),o=a(e.charCodeAt(i+1));if(void 0===r||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+o}return n},e.asyncLoop=async function(t,r,n){let i=Date.now();for(let o=0;o<t;o++){n(o);const t=Date.now()-i;t>=0&&t<r||(await(0,e.nextTick)(),i+=t)}},e.utf8ToBytes=c,e.toBytes=s,e.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const i=e[n];(0,r.abytes)(i),t+=i.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n},e.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},e.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},e.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.randomBytes=function(e=32){if(t.crypto&&"function"==typeof t.crypto.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&"function"==typeof t.crypto.randomBytes)return t.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const t=(Ar||(Ar=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.crypto=void 0,Br.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0),Br),r=Mr();function n(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.byteSwapIfBE=e.isLE?e=>e:e=>n(e);const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const o={_0:48,_9:57,A:65,F:70,a:97,f:102};function a(e){return e>=o._0&&e<=o._9?e-o._0:e>=o.A&&e<=o.F?e-(o.A-10):e>=o.a&&e<=o.f?e-(o.a-10):void 0}function c(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function s(e){return"string"==typeof e&&(e=c(e)),(0,r.abytes)(e),e}e.nextTick=async()=>{};e.Hash=class{clone(){return this._cloneInto()}}}(Ir)),Ir}function Lr(){if(kr)return Cr;kr=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.HashMD=void 0,Cr.setBigUint64=r,Cr.Chi=function(e,t,r){return e&t^~e&r},Cr.Maj=function(e,t,r){return e&t^e&r^t&r};const e=Mr(),t=Nr();function r(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),c=Number(r&o),s=n?4:0,l=n?0:4;e.setUint32(t+s,a,n),e.setUint32(t+l,c,n)}class n extends t.Hash{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,t.createView)(this.buffer)}update(r){(0,e.aexists)(this);const{view:n,buffer:i,blockLen:o}=this,a=(r=(0,t.toBytes)(r)).length;for(let e=0;e<a;){const c=Math.min(o-this.pos,a-e);if(c!==o)i.set(r.subarray(e,e+c),this.pos),this.pos+=c,e+=c,this.pos===o&&(this.process(n,0),this.pos=0);else{const n=(0,t.createView)(r);for(;o<=a-e;e+=o)this.process(n,e)}}return this.length+=r.length,this.roundClean(),this}digestInto(n){(0,e.aexists)(this),(0,e.aoutput)(n,this),this.finished=!0;const{buffer:i,view:o,blockLen:a,isLE:c}=this;let{pos:s}=this;i[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>a-s&&(this.process(o,0),s=0);for(let e=s;e<a;e++)i[e]=0;r(o,a-8,BigInt(8*this.length),c),this.process(o,0);const l=(0,t.createView)(n),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=u/4,f=this.get();if(d>f.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)l.setUint32(4*e,f[e],c)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}return Cr.HashMD=n,Cr}var Tr,Or,Rr={};function Pr(){if(Tr)return Rr;Tr=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.add5L=Rr.add5H=Rr.add4H=Rr.add4L=Rr.add3H=Rr.add3L=Rr.rotlBL=Rr.rotlBH=Rr.rotlSL=Rr.rotlSH=Rr.rotr32L=Rr.rotr32H=Rr.rotrBL=Rr.rotrBH=Rr.rotrSL=Rr.rotrSH=Rr.shrSL=Rr.shrSH=Rr.toBig=void 0,Rr.fromBig=r,Rr.split=n,Rr.add=g;const e=BigInt(2**32-1),t=BigInt(32);function r(r,n=!1){return n?{h:Number(r&e),l:Number(r>>t&e)}:{h:0|Number(r>>t&e),l:0|Number(r&e)}}function n(e,t=!1){let n=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:a,l:c}=r(e[o],t);[n[o],i[o]]=[a,c]}return[n,i]}const i=(e,r)=>BigInt(e>>>0)<<t|BigInt(r>>>0);Rr.toBig=i;const o=(e,t,r)=>e>>>r;Rr.shrSH=o;const a=(e,t,r)=>e<<32-r|t>>>r;Rr.shrSL=a;const c=(e,t,r)=>e>>>r|t<<32-r;Rr.rotrSH=c;const s=(e,t,r)=>e<<32-r|t>>>r;Rr.rotrSL=s;const l=(e,t,r)=>e<<64-r|t>>>r-32;Rr.rotrBH=l;const u=(e,t,r)=>e>>>r-32|t<<64-r;Rr.rotrBL=u;const d=(e,t)=>t;Rr.rotr32H=d;const f=(e,t)=>e;Rr.rotr32L=f;const h=(e,t,r)=>e<<r|t>>>32-r;Rr.rotlSH=h;const b=(e,t,r)=>t<<r|e>>>32-r;Rr.rotlSL=b;const p=(e,t,r)=>t<<r-32|e>>>64-r;Rr.rotlBH=p;const m=(e,t,r)=>e<<r-32|t>>>64-r;function g(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}Rr.rotlBL=m;const y=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);Rr.add3L=y;const w=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;Rr.add3H=w;const v=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);Rr.add4L=v;const x=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;Rr.add4H=x;const E=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);Rr.add5L=E;const C=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;Rr.add5H=C;const _={fromBig:r,split:n,toBig:i,shrSH:o,shrSL:a,rotrSH:c,rotrSL:s,rotrBH:l,rotrBL:u,rotr32H:d,rotr32L:f,rotlSH:h,rotlSL:b,rotlBH:p,rotlBL:m,add:g,add3L:y,add3H:w,add4L:v,add4H:x,add5H:C,add5L:E};return Rr.default=_,Rr}function Ur(){if(Or)return Er;Or=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.sha384=Er.sha512_256=Er.sha512_224=Er.sha512=Er.SHA384=Er.SHA512_256=Er.SHA512_224=Er.SHA512=void 0;const e=Lr(),t=Pr(),r=Nr(),[n,i]=(()=>t.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),o=new Uint32Array(80),a=new Uint32Array(80);class c extends e.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:a,Dl:c,Eh:s,El:l,Fh:u,Fl:d,Gh:f,Gl:h,Hh:b,Hl:p}=this;return[e,t,r,n,i,o,a,c,s,l,u,d,f,h,b,p]}set(e,t,r,n,i,o,a,c,s,l,u,d,f,h,b,p){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|c,this.Eh=0|s,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|b,this.Hl=0|p}process(e,r){for(let t=0;t<16;t++,r+=4)o[t]=e.getUint32(r),a[t]=e.getUint32(r+=4);for(let e=16;e<80;e++){const r=0|o[e-15],n=0|a[e-15],i=t.default.rotrSH(r,n,1)^t.default.rotrSH(r,n,8)^t.default.shrSH(r,n,7),c=t.default.rotrSL(r,n,1)^t.default.rotrSL(r,n,8)^t.default.shrSL(r,n,7),s=0|o[e-2],l=0|a[e-2],u=t.default.rotrSH(s,l,19)^t.default.rotrBH(s,l,61)^t.default.shrSH(s,l,6),d=t.default.rotrSL(s,l,19)^t.default.rotrBL(s,l,61)^t.default.shrSL(s,l,6),f=t.default.add4L(c,d,a[e-7],a[e-16]),h=t.default.add4H(f,i,u,o[e-7],o[e-16]);o[e]=0|h,a[e]=0|f}let{Ah:c,Al:s,Bh:l,Bl:u,Ch:d,Cl:f,Dh:h,Dl:b,Eh:p,El:m,Fh:g,Fl:y,Gh:w,Gl:v,Hh:x,Hl:E}=this;for(let e=0;e<80;e++){const r=t.default.rotrSH(p,m,14)^t.default.rotrSH(p,m,18)^t.default.rotrBH(p,m,41),C=t.default.rotrSL(p,m,14)^t.default.rotrSL(p,m,18)^t.default.rotrBL(p,m,41),_=p&g^~p&w,M=m&y^~m&v,A=t.default.add5L(E,C,M,i[e],a[e]),S=t.default.add5H(A,x,r,_,n[e],o[e]),k=0|A,I=t.default.rotrSH(c,s,28)^t.default.rotrBH(c,s,34)^t.default.rotrBH(c,s,39),B=t.default.rotrSL(c,s,28)^t.default.rotrBL(c,s,34)^t.default.rotrBL(c,s,39),N=c&l^c&d^l&d,L=s&u^s&f^u&f;x=0|w,E=0|v,w=0|g,v=0|y,g=0|p,y=0|m,({h:p,l:m}=t.default.add(0|h,0|b,0|S,0|k)),h=0|d,b=0|f,d=0|l,f=0|u,l=0|c,u=0|s;const T=t.default.add3L(k,B,L);c=t.default.add3H(T,S,I,N),s=0|T}({h:c,l:s}=t.default.add(0|this.Ah,0|this.Al,0|c,0|s)),({h:l,l:u}=t.default.add(0|this.Bh,0|this.Bl,0|l,0|u)),({h:d,l:f}=t.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h:h,l:b}=t.default.add(0|this.Dh,0|this.Dl,0|h,0|b)),({h:p,l:m}=t.default.add(0|this.Eh,0|this.El,0|p,0|m)),({h:g,l:y}=t.default.add(0|this.Fh,0|this.Fl,0|g,0|y)),({h:w,l:v}=t.default.add(0|this.Gh,0|this.Gl,0|w,0|v)),({h:x,l:E}=t.default.add(0|this.Hh,0|this.Hl,0|x,0|E)),this.set(c,s,l,u,d,f,h,b,p,m,g,y,w,v,x,E)}roundClean(){o.fill(0),a.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Er.SHA512=c;class s extends c{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}Er.SHA512_224=s;class l extends c{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}Er.SHA512_256=l;class u extends c{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}return Er.SHA384=u,Er.sha512=(0,r.wrapConstructor)((()=>new c)),Er.sha512_224=(0,r.wrapConstructor)((()=>new s)),Er.sha512_256=(0,r.wrapConstructor)((()=>new l)),Er.sha384=(0,r.wrapConstructor)((()=>new u)),Er}var zr,jr,Fr,Dr={},Hr={},Kr={};function qr(){if(zr)return Kr;zr=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.notImplemented=Kr.bitMask=void 0,Kr.isBytes=n,Kr.abytes=i,Kr.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},Kr.bytesToHex=a,Kr.numberToHexUnpadded=c,Kr.hexToNumber=s,Kr.hexToBytes=d,Kr.bytesToNumberBE=function(e){return s(a(e))},Kr.bytesToNumberLE=function(e){return i(e),s(a(Uint8Array.from(e).reverse()))},Kr.numberToBytesBE=f,Kr.numberToBytesLE=function(e,t){return f(e,t).reverse()},Kr.numberToVarBytesBE=function(e){return d(c(e))},Kr.ensureBytes=function(e,t,r){let i;if("string"==typeof t)try{i=d(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!n(t))throw new Error(e+" must be hex string or Uint8Array");i=Uint8Array.from(t)}const o=i.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return i},Kr.concatBytes=h,Kr.equalBytes=function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r},Kr.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))},Kr.inRange=p,Kr.aInRange=function(e,t,r,n){if(!p(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)},Kr.bitLen=function(r){let n;for(n=0;r>e;r>>=t,n+=1);return n},Kr.bitGet=function(e,r){return e>>BigInt(r)&t},Kr.bitSet=function(r,n,i){return r|(i?t:e)<<BigInt(n)},Kr.createHmacDrbg=function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=m(e),i=m(e),o=0;const a=()=>{n.fill(1),i.fill(0),o=0},c=(...e)=>r(i,n,...e),s=(e=m())=>{i=c(g([0]),e),n=c(),0!==e.length&&(i=c(g([1]),e),n=c())},l=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=c();const t=n.slice();r.push(t),e+=n.length}return h(...r)};return(e,t)=>{let r;for(a(),s(e);!(r=t(l()));)s();return a(),r}},Kr.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const i=y[r];if("function"!=typeof i)throw new Error("invalid validator function");const o=e[t];if(!(n&&void 0===o||i(o,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+o)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e},Kr.memoized=function(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(void 0!==i)return i;const o=e(r,...n);return t.set(r,o),o}};const e=BigInt(0),t=BigInt(1),r=BigInt(2);function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e){if(!n(e))throw new Error("Uint8Array expected")}const o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function a(e){i(e);let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t}function c(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function s(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?e:BigInt("0x"+t)}const l={_0:48,_9:57,A:65,F:70,a:97,f:102};function u(e){return e>=l._0&&e<=l._9?e-l._0:e>=l.A&&e<=l.F?e-(l.A-10):e>=l.a&&e<=l.f?e-(l.a-10):void 0}function d(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=u(e.charCodeAt(i)),o=u(e.charCodeAt(i+1));if(void 0===r||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+o}return n}function f(e,t){return d(e.toString(16).padStart(2*t,"0"))}function h(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];i(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const b=t=>"bigint"==typeof t&&e<=t;function p(e,t,r){return b(e)&&b(t)&&b(r)&&t<=e&&e<r}Kr.bitMask=e=>(r<<BigInt(e-1))-t;const m=e=>new Uint8Array(e),g=e=>Uint8Array.from(e);const y={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||n(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};return Kr.notImplemented=()=>{throw new Error("not implemented")},Kr}function Vr(){if(jr)return Hr;jr=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.isNegativeLE=void 0,Hr.mod=s,Hr.pow=l,Hr.pow2=function(e,r,n){let i=e;for(;r-- >t;)i*=i,i%=n;return i},Hr.invert=u,Hr.tonelliShanks=d,Hr.FpSqrt=f,Hr.validateField=function(t){const r=h.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,e.validateObject)(t,r)},Hr.FpPow=b,Hr.FpInvertBatch=p,Hr.FpDiv=function(e,t,r){return e.mul(t,"bigint"==typeof r?u(r,e.ORDER):e.inv(r))},Hr.FpLegendre=m,Hr.FpIsSquare=function(e){const t=m(e.ORDER);return r=>{const n=t(e,r);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}},Hr.nLength=g,Hr.Field=function(n,i,o=!1,a={}){if(n<=t)throw new Error("invalid field: expected ORDER > 0, got "+n);const{nBitLength:c,nByteLength:l}=g(n,i);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let d;const h=Object.freeze({ORDER:n,isLE:o,BITS:c,BYTES:l,MASK:(0,e.bitMask)(c),ZERO:t,ONE:r,create:e=>s(e,n),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return t<=e&&e<n},is0:e=>e===t,isOdd:e=>(e&r)===r,neg:e=>s(-e,n),eql:(e,t)=>e===t,sqr:e=>s(e*e,n),add:(e,t)=>s(e+t,n),sub:(e,t)=>s(e-t,n),mul:(e,t)=>s(e*t,n),pow:(e,t)=>b(h,e,t),div:(e,t)=>s(e*u(t,n),n),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:e=>u(e,n),sqrt:a.sqrt||(e=>(d||(d=f(n)),d(h,e))),invertBatch:e=>p(h,e),cmov:(e,t,r)=>r?t:e,toBytes:t=>o?(0,e.numberToBytesLE)(t,l):(0,e.numberToBytesBE)(t,l),fromBytes:t=>{if(t.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+t.length);return o?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t)}});return Object.freeze(h)},Hr.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)},Hr.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r},Hr.hashToPrivateScalar=function(t,n,i=!1){t=(0,e.ensureBytes)("privateHash",t);const o=t.length,a=g(n).nByteLength+8;if(a<24||o<a||o>1024)throw new Error("hashToPrivateScalar: expected "+a+"-1024 bytes of input, got "+o);const c=i?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t);return s(c,n-r)+r},Hr.getFieldBytesLength=y,Hr.getMinHashLength=w,Hr.mapHashToField=function(t,n,i=!1){const o=t.length,a=y(n),c=w(n);if(o<16||o<c||o>1024)throw new Error("expected "+c+"-1024 bytes of input, got "+o);const l=i?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t),u=s(l,n-r)+r;return i?(0,e.numberToBytesLE)(u,a):(0,e.numberToBytesBE)(u,a)};const e=qr(),t=BigInt(0),r=BigInt(1),n=BigInt(2),i=BigInt(3),o=BigInt(4),a=BigInt(5),c=BigInt(8);function s(e,r){const n=e%r;return n>=t?n:r+n}function l(e,n,i){if(n<t)throw new Error("invalid exponent, negatives unsupported");if(i<=t)throw new Error("invalid modulus");if(i===r)return t;let o=r;for(;n>t;)n&r&&(o=o*e%i),e=e*e%i,n>>=r;return o}function u(e,n){if(e===t)throw new Error("invert: expected non-zero number");if(n<=t)throw new Error("invert: expected positive modulus, got "+n);let i=s(e,n),o=n,a=t,c=r;for(;i!==t;){const e=o%i,t=a-c*(o/i);o=i,i=e,a=c,c=t}if(o!==r)throw new Error("invert: does not exist");return s(a,n)}function d(e){const i=(e-r)/n;let a,c,s;for(a=e-r,c=0;a%n===t;a/=n,c++);for(s=n;s<e&&l(s,i,e)!==e-r;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===c){const t=(e+r)/o;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const u=(a+r)/n;return function(e,t){if(e.pow(t,i)===e.neg(e.ONE))throw new Error("Cannot find square root");let n=c,o=e.pow(e.mul(e.ONE,s),a),l=e.pow(t,u),d=e.pow(t,a);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(d);t<n&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const i=e.pow(o,r<<BigInt(n-t-1));o=e.sqr(i),l=e.mul(l,i),d=e.mul(d,o),n=t}return l}}function f(e){if(e%o===i){const t=(e+r)/o;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%c===a){const t=(e-a)/c;return function(e,r){const i=e.mul(r,n),o=e.pow(i,t),a=e.mul(r,o),c=e.mul(e.mul(a,n),o),s=e.mul(a,e.sub(c,e.ONE));if(!e.eql(e.sqr(s),r))throw new Error("Cannot find square root");return s}}return d(e)}Hr.isNegativeLE=(e,t)=>(s(e,t)&r)===r;const h=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function b(e,n,i){if(i<t)throw new Error("invalid exponent, negatives unsupported");if(i===t)return e.ONE;if(i===r)return n;let o=e.ONE,a=n;for(;i>t;)i&r&&(o=e.mul(o,a)),a=e.sqr(a),i>>=r;return o}function p(e,t){const r=new Array(t.length),n=t.reduce(((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n))),e.ONE),i=e.inv(n);return t.reduceRight(((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n))),i),r}function m(e){const t=(e-r)/n;return(e,r)=>e.pow(r,t)}function g(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function y(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function w(e){const t=y(e);return t+Math.ceil(t/2)}return Hr}function Wr(){if(Fr)return Dr;Fr=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.wNAF=function(e,t){return{constTimeNegate:i,hasPrecomputes:e=>1!==d(e),unsafeLadder(t,i,o=e.ZERO){let a=t;for(;i>r;)i&n&&(o=o.add(a)),a=a.double(),i>>=n;return o},precomputeWindow(e,r){const{windows:n,windowSize:i}=a(r,t),o=[];let c=e,s=c;for(let e=0;e<n;e++){s=c,o.push(s);for(let e=1;e<i;e++)s=s.add(c),o.push(s);c=s.double()}return o},wNAF(r,o,c){const{windows:s,windowSize:l}=a(r,t);let u=e.ZERO,d=e.BASE;const f=BigInt(2**r-1),h=2**r,b=BigInt(r);for(let e=0;e<s;e++){const t=e*l;let r=Number(c&f);c>>=b,r>l&&(r-=h,c+=n);const a=t,s=t+Math.abs(r)-1,p=e%2!=0,m=r<0;0===r?d=d.add(i(p,o[a])):u=u.add(i(m,o[s]))}return{p:u,f:d}},wNAFUnsafe(i,o,c,s=e.ZERO){const{windows:l,windowSize:u}=a(i,t),d=BigInt(2**i-1),f=2**i,h=BigInt(i);for(let e=0;e<l;e++){const t=e*u;if(c===r)break;let i=Number(c&d);if(c>>=h,i>u&&(i-=f,c+=n),0===i)continue;let a=o[t+Math.abs(i)-1];i<0&&(a=a.negate()),s=s.add(a)}return s},getPrecomputes(e,t,r){let n=l.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&l.set(t,r(n))),n},wNAFCached(e,t,r){const n=d(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){const i=d(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){o(r,t),u.set(e,r),l.delete(e)}}},Dr.pippenger=function(e,r,n,i){if(c(n,e),s(i,r),n.length!==i.length)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,a=(0,t.bitLen)(BigInt(n.length)),l=a>12?a-3:a>4?a-2:a?2:1,u=(1<<l)-1,d=new Array(u+1).fill(o),f=Math.floor((r.BITS-1)/l)*l;let h=o;for(let e=f;e>=0;e-=l){d.fill(o);for(let t=0;t<i.length;t++){const r=i[t],o=Number(r>>BigInt(e)&BigInt(u));d[o]=d[o].add(n[t])}let t=o;for(let e=d.length-1,r=o;e>0;e--)r=r.add(d[e]),t=t.add(r);if(h=h.add(t),0!==e)for(let e=0;e<l;e++)h=h.double()}return h},Dr.precomputeMSMUnsafe=function(e,t,r,n){o(n,t.BITS),c(r,e);const i=e.ZERO,a=2**n-1,l=Math.ceil(t.BITS/n),u=BigInt((1<<n)-1),d=r.map((e=>{const t=[];for(let r=0,n=e;r<a;r++)t.push(n),n=n.add(e);return t}));return e=>{if(s(e,t),e.length>r.length)throw new Error("array of scalars must be smaller than array of points");let o=i;for(let t=0;t<l;t++){if(o!==i)for(let e=0;e<n;e++)o=o.double();const r=BigInt(l*n-(t+1)*n);for(let t=0;t<e.length;t++){const n=e[t],i=Number(n>>r&u);i&&(o=o.add(d[t][i-1]))}}return o}},Dr.validateBasic=function(r){return(0,e.validateField)(r.Fp),(0,t.validateObject)(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(r.n,r.nBitLength),...r,p:r.Fp.ORDER})};const e=Vr(),t=qr(),r=BigInt(0),n=BigInt(1);function i(e,t){const r=t.negate();return e?r:t}function o(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function a(e,t){o(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function c(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach(((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)}))}function s(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach(((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)}))}const l=new WeakMap,u=new WeakMap;function d(e){return u.get(e)||1}return Dr}var Zr,$r={};function Gr(){if(Zr)return $r;Zr=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.twistedEdwards=function(l){const u=function(t){const n=(0,e.validateBasic)(t);return r.validateObject(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...n})}(l),{Fp:d,n:f,prehash:h,hash:b,randomBytes:p,nByteLength:m,h:g}=u,y=a<<BigInt(8*m)-o,w=d.create,v=(0,t.Field)(u.n,u.nBitLength),x=u.uvRatio||((e,t)=>{try{return{isValid:!0,value:d.sqrt(e*d.inv(t))}}catch(e){return{isValid:!1,value:i}}}),E=u.adjustScalarBytes||(e=>e),C=u.domain||((e,t,r)=>{if((0,n.abool)("phflag",r),t.length||r)throw new Error("Contexts/pre-hash are not supported");return e});function _(e,t){r.aInRange("coordinate "+e,t,i,y)}function M(e){if(!(e instanceof k))throw new Error("ExtendedPoint expected")}const A=(0,n.memoized)(((e,t)=>{const{ex:r,ey:n,ez:a}=e,s=e.is0();null==t&&(t=s?c:d.inv(a));const l=w(r*t),u=w(n*t),f=w(a*t);if(s)return{x:i,y:o};if(f!==o)throw new Error("invZ was invalid");return{x:l,y:u}})),S=(0,n.memoized)((e=>{const{a:t,d:r}=u;if(e.is0())throw new Error("bad point: ZERO");const{ex:n,ey:i,ez:o,et:a}=e,c=w(n*n),s=w(i*i),l=w(o*o),d=w(l*l),f=w(c*t);if(w(l*w(f+s))!==w(d+w(r*w(c*s))))throw new Error("bad point: equation left != right (1)");if(w(n*i)!==w(o*a))throw new Error("bad point: equation left != right (2)");return!0}));class k{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,_("x",e),_("y",t),_("z",r),_("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof k)throw new Error("extended point not allowed");const{x:t,y:r}=e||{};return _("x",t),_("y",r),new k(t,r,o,w(t*r))}static normalizeZ(e){const t=d.invertBatch(e.map((e=>e.ez)));return e.map(((e,r)=>e.toAffine(t[r]))).map(k.fromAffine)}static msm(t,r){return(0,e.pippenger)(k,v,t,r)}_setWindowSize(e){N.setWindowSize(this,e)}assertValidity(){S(this)}equals(e){M(e);const{ex:t,ey:r,ez:n}=this,{ex:i,ey:o,ez:a}=e,c=w(t*a),s=w(i*n),l=w(r*a),u=w(o*n);return c===s&&l===u}is0(){return this.equals(k.ZERO)}negate(){return new k(w(-this.ex),this.ey,this.ez,w(-this.et))}double(){const{a:e}=u,{ex:t,ey:r,ez:n}=this,i=w(t*t),o=w(r*r),c=w(a*w(n*n)),s=w(e*i),l=t+r,d=w(w(l*l)-i-o),f=s+o,h=f-c,b=s-o,p=w(d*h),m=w(f*b),g=w(d*b),y=w(h*f);return new k(p,m,y,g)}add(e){M(e);const{a:t,d:r}=u,{ex:n,ey:o,ez:c,et:s}=this,{ex:l,ey:d,ez:f,et:h}=e;if(t===BigInt(-1)){const e=w((o-n)*(d+l)),t=w((o+n)*(d-l)),r=w(t-e);if(r===i)return this.double();const u=w(c*a*h),b=w(s*a*f),p=b+u,m=t+e,g=b-u,y=w(p*r),v=w(m*g),x=w(p*g),E=w(r*m);return new k(y,v,E,x)}const b=w(n*l),p=w(o*d),m=w(s*r*h),g=w(c*f),y=w((n+o)*(l+d)-b-p),v=g-m,x=g+m,E=w(p-t*b),C=w(y*v),_=w(x*E),A=w(y*E),S=w(v*x);return new k(C,_,S,A)}subtract(e){return this.add(e.negate())}wNAF(e){return N.wNAFCached(this,e,k.normalizeZ)}multiply(e){const t=e;r.aInRange("scalar",t,o,f);const{p:n,f:i}=this.wNAF(t);return k.normalizeZ([n,i])[0]}multiplyUnsafe(e,t=k.ZERO){const n=e;return r.aInRange("scalar",n,i,f),n===i?B:this.is0()||n===o?this:N.wNAFCachedUnsafe(this,n,k.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(g).is0()}isTorsionFree(){return N.unsafeLadder(this,f).is0()}toAffine(e){return A(this,e)}clearCofactor(){const{h:e}=u;return e===o?this:this.multiplyUnsafe(e)}static fromHex(e,t=!1){const{d:a,a:c}=u,s=d.BYTES;e=(0,n.ensureBytes)("pointHex",e,s),(0,n.abool)("zip215",t);const l=e.slice(),f=e[s-1];l[s-1]=-129&f;const h=r.bytesToNumberLE(l),b=t?y:d.ORDER;r.aInRange("pointHex.y",h,i,b);const p=w(h*h),m=w(p-o),g=w(a*p-c);let{isValid:v,value:E}=x(m,g);if(!v)throw new Error("Point.fromHex: invalid y coordinate");const C=(E&o)===o,_=!!(128&f);if(!t&&E===i&&_)throw new Error("Point.fromHex: x=0 and x_0=1");return _!==C&&(E=w(-E)),k.fromAffine({x:E,y:h})}static fromPrivateKey(e){return O(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),n=r.numberToBytesLE(t,d.BYTES);return n[n.length-1]|=e&o?128:0,n}toHex(){return r.bytesToHex(this.toRawBytes())}}k.BASE=new k(u.Gx,u.Gy,o,w(u.Gx*u.Gy)),k.ZERO=new k(i,o,o,i);const{BASE:I,ZERO:B}=k,N=(0,e.wNAF)(k,8*m);function L(e){return(0,t.mod)(e,f)}function T(e){return L(r.bytesToNumberLE(e))}function O(e){const t=d.BYTES;e=(0,n.ensureBytes)("private key",e,t);const r=(0,n.ensureBytes)("hashed private key",b(e),2*t),i=E(r.slice(0,t)),o=r.slice(t,2*t),a=T(i),c=I.multiply(a),s=c.toRawBytes();return{head:i,prefix:o,scalar:a,point:c,pointBytes:s}}function R(e=new Uint8Array,...t){const i=r.concatBytes(...t);return T(b(C(i,(0,n.ensureBytes)("context",e),!!h)))}const P=s;I._setWindowSize(8);const U={getExtendedPublicKey:O,randomPrivateKey:()=>p(d.BYTES),precompute:(e=8,t=k.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};return{CURVE:u,getPublicKey:function(e){return O(e).pointBytes},sign:function(e,t,o={}){e=(0,n.ensureBytes)("message",e),h&&(e=h(e));const{prefix:a,scalar:c,pointBytes:s}=O(t),l=R(o.context,a,e),u=I.multiply(l).toRawBytes(),b=L(l+R(o.context,u,s,e)*c);r.aInRange("signature.s",b,i,f);const p=r.concatBytes(u,r.numberToBytesLE(b,d.BYTES));return(0,n.ensureBytes)("result",p,2*d.BYTES)},verify:function(e,t,i,o=P){const{context:a,zip215:c}=o,s=d.BYTES;e=(0,n.ensureBytes)("signature",e,2*s),t=(0,n.ensureBytes)("message",t),i=(0,n.ensureBytes)("publicKey",i,s),void 0!==c&&(0,n.abool)("zip215",c),h&&(t=h(t));const l=r.bytesToNumberLE(e.slice(s,2*s));let u,f,b;try{u=k.fromHex(i,c),f=k.fromHex(e.slice(0,s),c),b=I.multiplyUnsafe(l)}catch(e){return!1}if(!c&&u.isSmallOrder())return!1;const p=R(a,f.toRawBytes(),u.toRawBytes(),t);return f.add(u.multiplyUnsafe(p)).subtract(b).clearCofactor().equals(k.ZERO)},ExtendedPoint:k,utils:U}};const e=Wr(),t=Vr(),r=qr(),n=qr(),i=BigInt(0),o=BigInt(1),a=BigInt(2),c=BigInt(8),s={zip215:!0};return $r}var Xr,Jr={};function Yr(){if(Xr)return Jr;Xr=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.expand_message_xmd=a,Jr.expand_message_xof=c,Jr.hash_to_field=s,Jr.isogenyMap=function(e,t){const r=t.map((e=>Array.from(e).reverse()));return(t,n)=>{const[i,o,a,c]=r.map((r=>r.reduce(((r,n)=>e.add(e.mul(r,t),n)))));return t=e.div(i,o),n=e.mul(n,e.div(a,c)),{x:t,y:n}}},Jr.createHasher=function(e,t,r){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const o=s(n,2,{...r,DST:r.DST,...i}),a=e.fromAffine(t(o[0])),c=e.fromAffine(t(o[1])),l=a.add(c).clearCofactor();return l.assertValidity(),l},encodeToCurve(n,i){const o=s(n,1,{...r,DST:r.encodeDST,...i}),a=e.fromAffine(t(o[0])).clearCofactor();return a.assertValidity(),a},mapToCurve(r){if(!Array.isArray(r))throw new Error("mapToCurve: expected array of bigints");for(const e of r)if("bigint"!=typeof e)throw new Error("mapToCurve: expected array of bigints");const n=e.fromAffine(t(r)).clearCofactor();return n.assertValidity(),n}}};const e=Vr(),t=qr(),r=t.bytesToNumberBE;function n(e,t){if(o(e),o(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function i(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function o(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function a(e,r,a,c){(0,t.abytes)(e),(0,t.abytes)(r),o(a),r.length>255&&(r=c((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),r)));const{outputLen:s,blockLen:l}=c,u=Math.ceil(a/s);if(a>65535||u>255)throw new Error("expand_message_xmd: invalid lenInBytes");const d=(0,t.concatBytes)(r,n(r.length,1)),f=n(0,l),h=n(a,2),b=new Array(u),p=c((0,t.concatBytes)(f,e,h,n(0,1),d));b[0]=c((0,t.concatBytes)(p,n(1,1),d));for(let e=1;e<=u;e++){const r=[i(p,b[e-1]),n(e+1,1),d];b[e]=c((0,t.concatBytes)(...r))}return(0,t.concatBytes)(...b).slice(0,a)}function c(e,r,i,a,c){if((0,t.abytes)(e),(0,t.abytes)(r),o(i),r.length>255){const e=Math.ceil(2*a/8);r=c.create({dkLen:e}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(r).digest()}if(i>65535||r.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return c.create({dkLen:i}).update(e).update(n(i,2)).update(r).update(n(r.length,1)).digest()}function s(n,i,s){(0,t.validateObject)(s,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:l,k:u,m:d,hash:f,expand:h,DST:b}=s;(0,t.abytes)(n),o(i);const p="string"==typeof b?(0,t.utf8ToBytes)(b):b,m=l.toString(2).length,g=Math.ceil((m+u)/8),y=i*d*g;let w;if("xmd"===h)w=a(n,p,y,f);else if("xof"===h)w=c(n,p,y,u,f);else{if("_internal_pass"!==h)throw new Error('expand must be "xmd" or "xof"');w=n}const v=new Array(i);for(let t=0;t<i;t++){const n=new Array(d);for(let i=0;i<d;i++){const o=g*(i+t*d),a=w.subarray(o,o+g);n[i]=(0,e.mod)(r(a),l)}v[t]=n}return v}return Jr}var Qr,en,tn={};function rn(){if(Qr)return tn;Qr=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.montgomery=function(i){const o=function(e){return(0,t.validateObject)(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}(i),{P:a}=o,c=t=>(0,e.mod)(t,a),s=o.montgomeryBits,l=Math.ceil(s/8),u=o.nByteLength,d=o.adjustScalarBytes||(e=>e),f=o.powPminus2||(t=>(0,e.pow)(t,a-BigInt(2),a));function h(e,t,r){const n=c(e*(t-r));return[t=c(t-n),r=c(r+n)]}const b=(o.a-BigInt(2))/BigInt(4);function p(e){return(0,t.numberToBytesLE)(c(e),l)}function m(e,i){const o=function(e){const r=(0,t.ensureBytes)("u coordinate",e,l);return 32===u&&(r[31]&=127),(0,t.bytesToNumberLE)(r)}(i),m=function(e,i){(0,t.aInRange)("u",e,r,a),(0,t.aInRange)("scalar",i,r,a);const o=i,l=e;let u,d=n,p=r,m=e,g=n,y=r;for(let e=BigInt(s-1);e>=r;e--){const t=o>>e&n;y^=t,u=h(y,d,m),d=u[0],m=u[1],u=h(y,p,g),p=u[0],g=u[1],y=t;const r=d+p,i=c(r*r),a=d-p,s=c(a*a),f=i-s,w=m+g,v=c((m-g)*r),x=c(w*a),E=v+x,C=v-x;m=c(E*E),g=c(l*c(C*C)),d=c(i*s),p=c(f*(i+c(b*f)))}u=h(y,d,m),d=u[0],m=u[1],u=h(y,p,g),p=u[0],g=u[1];const w=f(p);return c(d*w)}(o,function(e){const r=(0,t.ensureBytes)("scalar",e),n=r.length;if(n!==l&&n!==u)throw new Error("invalid scalar, expected "+l+" or "+u+" bytes, got "+n);return(0,t.bytesToNumberLE)(d(r))}(e));if(m===r)throw new Error("invalid private or public key received");return p(m)}const g=p(o.Gu);function y(e){return m(e,g)}return{scalarMult:m,scalarMultBase:y,getSharedSecret:(e,t)=>m(e,t),getPublicKey:e=>y(e),utils:{randomPrivateKey:()=>o.randomBytes(o.nByteLength)},GuBytes:g}};const e=Vr(),t=qr(),r=BigInt(0),n=BigInt(1);return tn}function nn(){return en||(en=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hash_to_ristretto255=e.hashToRistretto255=e.RistrettoPoint=e.encodeToCurve=e.hashToCurve=e.edwardsToMontgomery=e.x25519=e.ed25519ph=e.ed25519ctx=e.ed25519=e.ED25519_TORSION_SUBGROUP=void 0,e.edwardsToMontgomeryPub=C,e.edwardsToMontgomeryPriv=function(e){const t=x.hash(e.subarray(0,32));return x.adjustScalarBytes(t).subarray(0,32)};const t=Ur(),r=Nr(),n=Wr(),i=Gr(),o=Yr(),a=Vr(),c=rn(),s=qr(),l=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),u=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),d=BigInt(0),f=BigInt(1),h=BigInt(2),b=BigInt(3),p=BigInt(5),m=BigInt(8);function g(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=l,c=e*e%o*e%o,s=(0,a.pow2)(c,h,o)*c%o,u=(0,a.pow2)(s,f,o)*e%o,d=(0,a.pow2)(u,p,o)*u%o,b=(0,a.pow2)(d,t,o)*d%o,m=(0,a.pow2)(b,r,o)*b%o,g=(0,a.pow2)(m,n,o)*m%o,y=(0,a.pow2)(g,i,o)*g%o,w=(0,a.pow2)(y,i,o)*g%o,v=(0,a.pow2)(w,t,o)*d%o;return{pow_p_5_8:(0,a.pow2)(v,h,o)*e%o,b2:c}}function y(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function w(e,t){const r=l,n=(0,a.mod)(t*t*t,r),i=g(e*(0,a.mod)(n*n*t,r)).pow_p_5_8;let o=(0,a.mod)(e*n*i,r);const c=(0,a.mod)(t*o*o,r),s=o,d=(0,a.mod)(o*u,r),f=c===e,h=c===(0,a.mod)(-e,r),b=c===(0,a.mod)(-e*u,r);return f&&(o=s),(h||b)&&(o=d),(0,a.isNegativeLE)(o,r)&&(o=(0,a.mod)(-o,r)),{isValid:f||h,value:o}}e.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const v=(()=>(0,a.Field)(l,void 0,!0))(),x=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:v,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:m,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:t.sha512,randomBytes:r.randomBytes,adjustScalarBytes:y,uvRatio:w}))();function E(e,t,n){if(t.length>255)throw new Error("Context is too big");return(0,r.concatBytes)((0,r.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,t.length]),t,e)}function C(t){const{y:r}=e.ed25519.ExtendedPoint.fromHex(t),n=BigInt(1);return v.toBytes(v.create((n+r)*v.inv(n-r)))}e.ed25519=(0,i.twistedEdwards)(x),e.ed25519ctx=(0,i.twistedEdwards)({...x,domain:E}),e.ed25519ph=(0,i.twistedEdwards)(Object.assign({},x,{domain:E,prehash:t.sha512})),e.x25519=(0,c.montgomery)({P:l,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{const t=l,{pow_p_5_8:r,b2:n}=g(e);return(0,a.mod)((0,a.pow2)(r,b,t)*n,t)},adjustScalarBytes:y,randomBytes:r.randomBytes}),e.edwardsToMontgomery=C;const _=(()=>(v.ORDER+b)/m)(),M=(()=>v.pow(h,_))(),A=(()=>v.sqrt(v.neg(v.ONE)))();const S=(()=>(0,a.FpSqrtEven)(v,v.neg(BigInt(486664))))();function k(e){const{xMn:t,xMd:r,yMn:n,yMd:i}=function(e){const t=(v.ORDER-p)/m,r=BigInt(486662);let n=v.sqr(e);n=v.mul(n,h);let i=v.add(n,v.ONE),o=v.neg(r),a=v.sqr(i),c=v.mul(a,i),s=v.mul(n,r);s=v.mul(s,o),s=v.add(s,a),s=v.mul(s,o);let l=v.sqr(c);a=v.sqr(l),l=v.mul(l,c),l=v.mul(l,s),a=v.mul(a,l);let u=v.pow(a,t);u=v.mul(u,l);let d=v.mul(u,A);a=v.sqr(u),a=v.mul(a,c);let b=v.eql(a,s),g=v.cmov(d,u,b),y=v.mul(o,n),w=v.mul(u,e);w=v.mul(w,M);let x=v.mul(w,A),E=v.mul(s,n);a=v.sqr(w),a=v.mul(a,c);let C=v.eql(a,E),_=v.cmov(x,w,C);a=v.sqr(g),a=v.mul(a,c);let S=v.eql(a,s),k=v.cmov(y,o,S),I=v.cmov(_,g,S),B=v.isOdd(I);return I=v.cmov(I,v.neg(I),S!==B),{xMn:k,xMd:i,yMn:I,yMd:f}}(e);let o=v.mul(t,i);o=v.mul(o,S);let a=v.mul(r,n),c=v.sub(t,r),s=v.add(t,r),l=v.mul(a,s),u=v.eql(l,v.ZERO);o=v.cmov(o,v.ZERO,u),a=v.cmov(a,v.ONE,u),c=v.cmov(c,v.ONE,u),s=v.cmov(s,v.ONE,u);const d=v.invertBatch([a,s]);return{x:v.mul(o,d[0]),y:v.mul(c,d[1])}}const I=(()=>(0,o.createHasher)(e.ed25519.ExtendedPoint,(e=>k(e[0])),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:v.ORDER,m:1,k:128,expand:"xmd",hash:t.sha512}))();function B(e){if(!(e instanceof F))throw new Error("RistrettoPoint expected")}e.hashToCurve=I.hashToCurve,e.encodeToCurve=I.encodeToCurve;const N=u,L=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),T=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),O=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),R=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),P=e=>w(f,e),U=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),z=t=>e.ed25519.CURVE.Fp.create((0,s.bytesToNumberLE)(t)&U);function j(t){const{d:r}=e.ed25519.CURVE,n=e.ed25519.CURVE.Fp.ORDER,i=e.ed25519.CURVE.Fp.create,o=i(N*t*t),c=i((o+f)*O);let s=BigInt(-1);const l=i((s-r*o)*i(o+r));let{isValid:u,value:d}=w(c,l),h=i(d*t);(0,a.isNegativeLE)(h,n)||(h=i(-h)),u||(d=h),u||(s=o);const b=i(s*(o-f)*R-l),p=d*d,m=i((d+d)*l),g=i(b*L),y=i(f-p),v=i(f+p);return new e.ed25519.ExtendedPoint(i(m*v),i(y*g),i(g*v),i(m*y))}class F{constructor(e){this.ep=e}static fromAffine(t){return new F(e.ed25519.ExtendedPoint.fromAffine(t))}static hashToCurve(e){e=(0,s.ensureBytes)("ristrettoHash",e,64);const t=j(z(e.slice(0,32))),r=j(z(e.slice(32,64)));return new F(t.add(r))}static fromHex(t){t=(0,s.ensureBytes)("ristrettoHex",t,32);const{a:r,d:n}=e.ed25519.CURVE,i=e.ed25519.CURVE.Fp.ORDER,o=e.ed25519.CURVE.Fp.create,c="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",l=z(t);if(!(0,s.equalBytes)((0,s.numberToBytesLE)(l,32),t)||(0,a.isNegativeLE)(l,i))throw new Error(c);const u=o(l*l),h=o(f+r*u),b=o(f-r*u),p=o(h*h),m=o(b*b),g=o(r*n*p-m),{isValid:y,value:w}=P(o(g*m)),v=o(w*b),x=o(w*v*g);let E=o((l+l)*v);(0,a.isNegativeLE)(E,i)&&(E=o(-E));const C=o(h*x),_=o(E*C);if(!y||(0,a.isNegativeLE)(_,i)||C===d)throw new Error(c);return new F(new e.ed25519.ExtendedPoint(E,C,f,_))}static msm(t,r){const i=(0,a.Field)(e.ed25519.CURVE.n,e.ed25519.CURVE.nBitLength);return(0,n.pippenger)(F,i,t,r)}toRawBytes(){let{ex:t,ey:r,ez:n,et:i}=this.ep;const o=e.ed25519.CURVE.Fp.ORDER,c=e.ed25519.CURVE.Fp.create,l=c(c(n+r)*c(n-r)),u=c(t*r),d=c(u*u),{value:f}=P(c(l*d)),h=c(f*l),b=c(f*u),p=c(h*b*i);let m;if((0,a.isNegativeLE)(i*p,o)){let e=c(r*N),n=c(t*N);t=e,r=n,m=c(h*T)}else m=b;(0,a.isNegativeLE)(t*p,o)&&(r=c(-r));let g=c((n-r)*m);return(0,a.isNegativeLE)(g,o)&&(g=c(-g)),(0,s.numberToBytesLE)(g,32)}toHex(){return(0,s.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(t){B(t);const{ex:r,ey:n}=this.ep,{ex:i,ey:o}=t.ep,a=e.ed25519.CURVE.Fp.create,c=a(r*o)===a(n*i),s=a(n*o)===a(r*i);return c||s}add(e){return B(e),new F(this.ep.add(e.ep))}subtract(e){return B(e),new F(this.ep.subtract(e.ep))}multiply(e){return new F(this.ep.multiply(e))}multiplyUnsafe(e){return new F(this.ep.multiplyUnsafe(e))}double(){return new F(this.ep.double())}negate(){return new F(this.ep.negate())}}e.RistrettoPoint=(F.BASE||(F.BASE=new F(e.ed25519.ExtendedPoint.BASE)),F.ZERO||(F.ZERO=new F(e.ed25519.ExtendedPoint.ZERO)),F);e.hashToRistretto255=(e,n)=>{const i=n.DST,a="string"==typeof i?(0,r.utf8ToBytes)(i):i,c=(0,o.expand_message_xmd)(e,a,64,t.sha512);return F.hashToCurve(c)},e.hash_to_ristretto255=e.hashToRistretto255}(xr)),xr}var on,an={exports:{}},cn={exports:{}},sn={},ln={};var un,dn,fn,hn,bn={};function pn(){return un||(un=1,bn.read=function(e,t,r,n,i){var o,a,c=8*i-n-1,s=(1<<c)-1,l=s>>1,u=-7,d=r?i-1:0,f=r?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-u)-1,h>>=-u,u+=c;u>0;o=256*o+e[t+d],d+=f,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+d],d+=f,u-=8);if(0===o)o=1-l;else{if(o===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=l}return(h?-1:1)*a*Math.pow(2,o-n)},bn.write=function(e,t,r,n,i,o){var a,c,s,l=8*o-i-1,u=(1<<l)-1,d=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,b=n?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+d>=1?f/s:f*Math.pow(2,1-d))*s>=2&&(a++,s/=2),a+d>=u?(c=0,a=u):a+d>=1?(c=(t*s-1)*Math.pow(2,i),a+=d):(c=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&c,h+=b,c/=256,i-=8);for(a=a<<i|c,l+=i;l>0;e[r+h]=255&a,h+=b,a/=256,l-=8);e[r+h-b]|=128*p}),bn}function mn(){return dn||(dn=1,function(e){const t=function(){if(on)return ln;on=1,ln.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},ln.toByteArray=function(e){var n,i,a=o(e),c=a[0],s=a[1],l=new r(function(e,t,r){return 3*(t+r)/4-r}(0,c,s)),u=0,d=s>0?c-4:c;for(i=0;i<d;i+=4)n=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],l[u++]=n>>16&255,l[u++]=n>>8&255,l[u++]=255&n;return 2===s&&(n=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,l[u++]=255&n),1===s&&(n=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,l[u++]=n>>8&255,l[u++]=255&n),l},ln.fromByteArray=function(t){for(var r,n=t.length,i=n%3,o=[],c=16383,s=0,l=n-i;s<l;s+=c)o.push(a(t,s,s+c>l?l:s+c));return 1===i?(r=t[n-1],o.push(e[r>>2]+e[r<<4&63]+"==")):2===i&&(r=(t[n-2]<<8)+t[n-1],o.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"=")),o.join("")};for(var e=[],t=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=n[i],t[n.charCodeAt(i)]=i;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function a(t,r,n){for(var i,o,a=[],c=r;c<n;c+=3)i=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(255&t[c+2]),a.push(e[(o=i)>>18&63]+e[o>>12&63]+e[o>>6&63]+e[63&o]);return a.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,ln}(),r=pn(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;const i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|h(e,t);let n=o(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);const i=function(e){if(a.isBuffer(e)){const t=0|f(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||$(e.length)?o(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return s(e),o(e<0?0:0|f(e))}function u(e){const t=e.length<0?0:0|f(e.length),r=o(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,a.prototype),n}function f(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function h(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(i)return n?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function b(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function p(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){let o,a=1,c=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,c/=2,s/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<c;o++)if(l(e,o)===l(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===s)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+s>c&&(r=c-s),o=r;o>=0;o--){let r=!0;for(let n=0;n<s;n++)if(l(e,o+n)!==l(t,n)){r=!1;break}if(r)return o}return-1}function y(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if($(n))return a;e[r+a]=n}return a}function w(e,t,r,n){return W(q(t,e.length-r),e,r,n)}function v(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function x(e,t,r,n){return W(V(t),e,r,n)}function E(e,t,r,n){return W(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function C(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function _(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,c,s;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(s=(31&t)<<6|63&r,s>127&&(o=s));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(s=(15&t)<<12|(63&r)<<6|63&n,s>2047&&(s<55296||s>57343)&&(o=s));break;case 4:r=e[i+1],n=e[i+2],c=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&c)&&(s=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&c,s>65535&&s<1114112&&(o=s))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=M)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=M));return r}(n)}e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"undefined"!=typeof console&&console.error,Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return function(e,t,r){return s(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},a.allocUnsafe=function(e){return l(e)},a.allocUnsafeSlow=function(e){return l(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(Z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=a.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))i+t.length>n.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!a.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},a.byteLength=h,a.prototype._isBuffer=!0,a.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)p(this,t,t+1);return this},a.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},a.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},a.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):b.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),c=(r>>>=0)-(t>>>=0);const s=Math.min(o,c),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<s;++e)if(l[e]!==u[e]){o=l[e],c=u[e];break}return o<c?-1:c<o?1:0},a.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return v(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const M=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function S(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function k(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=G[e[n]];return i}function I(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function B(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function T(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function O(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,n,i,o){return t=+t,n>>>=0,o||O(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function P(e,t,n,i,o){return t=+t,n>>>=0,o||O(e,0,n,8),r.write(e,t,n,i,52,8),n+8}a.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=X((function(e){D(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),a.prototype.readBigUInt64BE=X((function(e){D(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=X((function(e){D(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),a.prototype.readBigInt64BE=X((function(e){D(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),a.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){N(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){N(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=X((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeBigUInt64BE=X((function(e,t=0){return T(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=X((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeBigInt64BE=X((function(e,t=0){return T(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=a.isBuffer(e)?e:a.from(e,n),c=o.length;if(0===c)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%c]}return this};const U={};function z(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function j(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,i,o){if(e>r||e<t){const r="bigint"==typeof t?"n":"";let n;throw n=0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`,new U.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){D(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function D(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw D(e,r),new U.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),z("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=j(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function q(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}const G=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}}(sn)),sn}function gn(){if(hn)return an.exports;hn=1;var e=65536,t=4294967295;var r=(fn||(fn=1,function(e,t){var r=mn(),n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(cn,cn.exports)),cn.exports).Buffer,n=Pe.crypto||Pe.msCrypto;return n&&n.getRandomValues?an.exports=function(i,o){if(i>t)throw new RangeError("requested too many random bytes");var a=r.allocUnsafe(i);if(i>0)if(i>e)for(var c=0;c<i;c+=e)n.getRandomValues(a.slice(c,c+e));else n.getRandomValues(a);if("function"==typeof o)return process.nextTick((function(){o(null,a)}));return a}:an.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},an.exports}var yn,wn,vn={};var xn,En,Cn,_n={},Mn="6.6.1",An={},Sn={exports:{}},kn=Sn.exports;function In(){return xn||(xn=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:nt.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function s(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a<o;a++){var c=e.charCodeAt(a)-48;i*=n,i+=c>=49?c-49+10:c>=17?c-17+10:c}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,c=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<c&67108863,this.words[o+1]=a>>>26-c&67108863,(c+=24)>=26&&(c-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<c&67108863,this.words[o+1]=a>>>26-c&67108863,(c+=24)>=26&&(c-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,c=Math.min(o,o-a)+r,l=0,u=r;u<c;u+=n)l=s(e,u,u+n,t),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var d=1;for(l=s(e,u,e.length,t),u=0;u<a;u++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,c=67108863&a,s=a/67108864|0;r.words[0]=c;for(var l=1;l<n;l++){for(var u=s>>>26,d=67108863&s,f=Math.min(l,t.length-1),h=Math.max(0,l-e.length+1);h<=f;h++){var b=l-h|0;u+=(a=(i=0|e.words[b])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[l]=0|d,s=0|u}return 0!==s?r.words[l]=0|s:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a<this.length;a++){var c=this.words[a],s=(16777215&(c<<i|o)).toString(16);o=c>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?l[6-s.length]+s+n:s+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=u[e],h=d[e];n="";var b=this.clone();for(b.negative=0;!b.isZero();){var p=b.modn(h).toString(e);n=(b=b.idivn(h)).isZero()?p+n:l[f-p.length]+p+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,c,s="le"===t,l=new e(o),u=this.clone();if(s){for(c=0;!u.isZero();c++)a=u.andln(255),u.iushrn(8),l[c]=a;for(;c<o;c++)l[c]=0}else{for(c=0;c<o-i;c++)l[c]=0;for(c=0;!u.isZero();c++)a=u.andln(255),u.iushrn(8),l[o-c-1]=a}return l},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,r){var n,i,o,a=e.words,c=t.words,s=r.words,l=0,u=0|a[0],d=8191&u,f=u>>>13,h=0|a[1],b=8191&h,p=h>>>13,m=0|a[2],g=8191&m,y=m>>>13,w=0|a[3],v=8191&w,x=w>>>13,E=0|a[4],C=8191&E,_=E>>>13,M=0|a[5],A=8191&M,S=M>>>13,k=0|a[6],I=8191&k,B=k>>>13,N=0|a[7],L=8191&N,T=N>>>13,O=0|a[8],R=8191&O,P=O>>>13,U=0|a[9],z=8191&U,j=U>>>13,F=0|c[0],D=8191&F,H=F>>>13,K=0|c[1],q=8191&K,V=K>>>13,W=0|c[2],Z=8191&W,$=W>>>13,G=0|c[3],X=8191&G,J=G>>>13,Y=0|c[4],Q=8191&Y,ee=Y>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ie=0|c[6],oe=8191&ie,ae=ie>>>13,ce=0|c[7],se=8191&ce,le=ce>>>13,ue=0|c[8],de=8191&ue,fe=ue>>>13,he=0|c[9],be=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(n=Math.imul(d,D))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,D)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(b,D),i=(i=Math.imul(b,H))+Math.imul(p,D)|0,o=Math.imul(p,H);var ge=(l+(n=n+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,q)|0))<<13)|0;l=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,D),i=(i=Math.imul(g,H))+Math.imul(y,D)|0,o=Math.imul(y,H),n=n+Math.imul(b,q)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(p,q)|0,o=o+Math.imul(p,V)|0;var ye=(l+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,Z)|0))<<13)|0;l=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(v,D),i=(i=Math.imul(v,H))+Math.imul(x,D)|0,o=Math.imul(x,H),n=n+Math.imul(g,q)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(p,Z)|0,o=o+Math.imul(p,$)|0;var we=(l+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(C,D),i=(i=Math.imul(C,H))+Math.imul(_,D)|0,o=Math.imul(_,H),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(p,X)|0,o=o+Math.imul(p,J)|0;var ve=(l+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;l=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,H))+Math.imul(S,D)|0,o=Math.imul(S,H),n=n+Math.imul(C,q)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(p,Q)|0,o=o+Math.imul(p,ee)|0;var xe=(l+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;l=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(I,D),i=(i=Math.imul(I,H))+Math.imul(B,D)|0,o=Math.imul(B,H),n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(v,X)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(p,re)|0,o=o+Math.imul(p,ne)|0;var Ee=(l+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(f,oe)|0))<<13)|0;l=((o=o+Math.imul(f,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,D),i=(i=Math.imul(L,H))+Math.imul(T,D)|0,o=Math.imul(T,H),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(B,q)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(p,oe)|0,o=o+Math.imul(p,ae)|0;var Ce=(l+(n=n+Math.imul(d,se)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(f,se)|0))<<13)|0;l=((o=o+Math.imul(f,le)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(R,D),i=(i=Math.imul(R,H))+Math.imul(P,D)|0,o=Math.imul(P,H),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,n=n+Math.imul(b,se)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(p,se)|0,o=o+Math.imul(p,le)|0;var _e=(l+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;l=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(z,D),i=(i=Math.imul(z,H))+Math.imul(j,D)|0,o=Math.imul(j,H),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,n=n+Math.imul(g,se)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(y,se)|0,o=o+Math.imul(y,le)|0,n=n+Math.imul(b,de)|0,i=(i=i+Math.imul(b,fe)|0)+Math.imul(p,de)|0,o=o+Math.imul(p,fe)|0;var Me=(l+(n=n+Math.imul(d,be)|0)|0)+((8191&(i=(i=i+Math.imul(d,pe)|0)+Math.imul(f,be)|0))<<13)|0;l=((o=o+Math.imul(f,pe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(z,q),i=(i=Math.imul(z,V))+Math.imul(j,q)|0,o=Math.imul(j,V),n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(v,se)|0,i=(i=i+Math.imul(v,le)|0)+Math.imul(x,se)|0,o=o+Math.imul(x,le)|0,n=n+Math.imul(g,de)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,fe)|0;var Ae=(l+(n=n+Math.imul(b,be)|0)|0)+((8191&(i=(i=i+Math.imul(b,pe)|0)+Math.imul(p,be)|0))<<13)|0;l=((o=o+Math.imul(p,pe)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(z,Z),i=(i=Math.imul(z,$))+Math.imul(j,Z)|0,o=Math.imul(j,$),n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(C,se)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(_,se)|0,o=o+Math.imul(_,le)|0,n=n+Math.imul(v,de)|0,i=(i=i+Math.imul(v,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Se=(l+(n=n+Math.imul(g,be)|0)|0)+((8191&(i=(i=i+Math.imul(g,pe)|0)+Math.imul(y,be)|0))<<13)|0;l=((o=o+Math.imul(y,pe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(z,X),i=(i=Math.imul(z,J))+Math.imul(j,X)|0,o=Math.imul(j,J),n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(A,se)|0,i=(i=i+Math.imul(A,le)|0)+Math.imul(S,se)|0,o=o+Math.imul(S,le)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var ke=(l+(n=n+Math.imul(v,be)|0)|0)+((8191&(i=(i=i+Math.imul(v,pe)|0)+Math.imul(x,be)|0))<<13)|0;l=((o=o+Math.imul(x,pe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(I,se)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(B,se)|0,o=o+Math.imul(B,le)|0,n=n+Math.imul(A,de)|0,i=(i=i+Math.imul(A,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ie=(l+(n=n+Math.imul(C,be)|0)|0)+((8191&(i=(i=i+Math.imul(C,pe)|0)+Math.imul(_,be)|0))<<13)|0;l=((o=o+Math.imul(_,pe)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(z,re),i=(i=Math.imul(z,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(L,se)|0,i=(i=i+Math.imul(L,le)|0)+Math.imul(T,se)|0,o=o+Math.imul(T,le)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,fe)|0;var Be=(l+(n=n+Math.imul(A,be)|0)|0)+((8191&(i=(i=i+Math.imul(A,pe)|0)+Math.imul(S,be)|0))<<13)|0;l=((o=o+Math.imul(S,pe)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(z,oe),i=(i=Math.imul(z,ae))+Math.imul(j,oe)|0,o=Math.imul(j,ae),n=n+Math.imul(R,se)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(P,se)|0,o=o+Math.imul(P,le)|0,n=n+Math.imul(L,de)|0,i=(i=i+Math.imul(L,fe)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,fe)|0;var Ne=(l+(n=n+Math.imul(I,be)|0)|0)+((8191&(i=(i=i+Math.imul(I,pe)|0)+Math.imul(B,be)|0))<<13)|0;l=((o=o+Math.imul(B,pe)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(z,se),i=(i=Math.imul(z,le))+Math.imul(j,se)|0,o=Math.imul(j,le),n=n+Math.imul(R,de)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Le=(l+(n=n+Math.imul(L,be)|0)|0)+((8191&(i=(i=i+Math.imul(L,pe)|0)+Math.imul(T,be)|0))<<13)|0;l=((o=o+Math.imul(T,pe)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(z,de),i=(i=Math.imul(z,fe))+Math.imul(j,de)|0,o=Math.imul(j,fe);var Te=(l+(n=n+Math.imul(R,be)|0)|0)+((8191&(i=(i=i+Math.imul(R,pe)|0)+Math.imul(P,be)|0))<<13)|0;l=((o=o+Math.imul(P,pe)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Oe=(l+(n=Math.imul(z,be))|0)+((8191&(i=(i=Math.imul(z,pe))+Math.imul(j,be)|0))<<13)|0;return l=((o=Math.imul(j,pe))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,s[0]=me,s[1]=ge,s[2]=ye,s[3]=we,s[4]=ve,s[5]=xe,s[6]=Ee,s[7]=Ce,s[8]=_e,s[9]=Me,s[10]=Ae,s[11]=Se,s[12]=ke,s[13]=Ie,s[14]=Be,s[15]=Ne,s[16]=Le,s[17]=Te,s[18]=Oe,0!==l&&(s[19]=l,r.length++),r};function b(e,t,r){return(new p).mulp(e,t,r)}function p(e,t){this.x=e,this.y=t}Math.imul||(h=f),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var c=67108863&n,s=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=s;l++){var u=o-l,d=(0|e.words[u])*(0|t.words[l]),f=67108863&d;c=67108863&(f=f+c|0),i+=(a=(a=a+(d/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}r.words[o]=c,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):b(this,e,t),r},p.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},p.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},p.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},p.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var c=a<<1,s=Math.cos(2*Math.PI/c),l=Math.sin(2*Math.PI/c),u=0;u<i;u+=c)for(var d=s,f=l,h=0;h<a;h++){var b=r[u+h],p=n[u+h],m=r[u+h+a],g=n[u+h+a],y=d*m-f*g;g=d*g+f*m,m=y,r[u+h]=b+m,n[u+h]=p+g,r[u+h+a]=b-m,n[u+h+a]=p-g,h!==c&&(y=s*d-l*f,f=s*f+l*d,d=y)}},p.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},p.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},p.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},p.prototype.convert13b=function(e,t,n,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],n[2*a]=8191&o,o>>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)n[a]=0;r(0===o),r(!(-8192&o))},p.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},p.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),c=new Array(n),s=new Array(n),l=new Array(n),u=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,l,n),this.transform(a,o,c,s,n,i),this.transform(l,o,u,d,n,i);for(var h=0;h<n;h++){var b=c[h]*u[h]-s[h]*d[h];s[h]=c[h]*d[h]+s[h]*u[h],c[h]=b}return this.conjugate(c,s,n),this.transform(c,s,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),b(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this.length=0===e?1:this.length,this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var c=this.words[t]&o,s=(0|this.words[t])-c<<n;this.words[t]=s|a,a=c>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),c=67108863^67108863>>>o<<o,s=n;if(i-=a,i=Math.max(0,i),s){for(var l=0;l<a;l++)s.words[l]=this.words[l];s.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var u=0;for(l=this.length-1;l>=0&&(0!==u||l>=i);l--){var d=0|this.words[l];this.words[l]=u<<26-o|d>>>o,u=d&c}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,o,a=e.length+n;this._expand(a);var c=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+c;var s=(0|e.words[i])*t;c=((o-=67108863&s)>>26)-(s/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)c=(o=(0|this.words[i+n])+c)>>26,this.words[i+n]=67108863&o;if(0===c)return this.strip();for(r(-1===c),c=0,i=0;i<this.length;i++)c=(o=-(0|this.words[i])+c)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var c,s=n.length-o.length;if("mod"!==t){(c=new i(null)).length=s+1,c.words=new Array(c.length);for(var l=0;l<c.length;l++)c.words[l]=0}var u=n.clone()._ishlnsubmul(o,1,s);0===u.negative&&(n=u,c&&(c.words[s]=1));for(var d=s-1;d>=0;d--){var f=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(f=Math.min(f/a|0,67108863),n._ishlnsubmul(o,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);c&&(c.words[d]=f)}return c&&c.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(o=c.div.neg()),"div"!==t&&(a=c.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(o=c.div.neg()),{div:o,mod:c.mod}):0!==(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(a=c.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:c.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,c},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),c=new i(0),s=new i(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var u=n.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0===(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(u),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var b=0,p=1;0===(n.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(n.iushrn(b);b-- >0;)(c.isOdd()||s.isOdd())&&(c.iadd(u),s.isub(d)),c.iushrn(1),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(c),a.isub(s)):(n.isub(t),c.isub(o),s.isub(a))}return{a:c,b:s,gcd:n.iushln(l)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),c=new i(0),s=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;0===(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)c.isOdd()&&c.iadd(s),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(c)):(n.isub(t),c.isub(a))}return(o=0===t.cmpn(1)?a:c).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,a=n;0!==o&&a<this.length;a++){var c=0|this.words[a];o=(c+=o)>>>26,c&=67108863,this.words[a]=c}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function C(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(w,g),n(v,g),n(x,g),x.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new w;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return m[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var c=new i(1).toRed(this),s=c.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,l).cmp(s);)u.redIAdd(s);for(var d=this.pow(u,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),b=a;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();r(m<b);var g=this.pow(d,new i(1).iushln(b-m-1));f=f.redMul(g),d=g.redSqr(),h=h.redMul(d),b=m}return f},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],a=0,c=0,s=t.bitLength()%26;for(0===s&&(s=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],u=s-1;u>=0;u--){var d=l>>u&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++c||0===n&&0===u)&&(o=this.mul(o,r[a]),c=0,a=0)):c=0}s=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new C(e)},n(C,E),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(Sn,kn)),Sn.exports}function Bn(){if(Cn)return En;function e(e,t){if(!e)throw new Error(t||"Assertion failed")}return Cn=1,En=e,e.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)},En}var Nn,Ln,Tn={};function On(){return Nn||(Nn=1,function(){var e=Tn;function t(e){return 1===e.length?"0"+e:e}function r(e){for(var r="",n=0;n<e.length;n++)r+=t(e[n].toString(16));return r}e.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},e.zero2=t,e.toHex=r,e.encode=function(e,t){return"hex"===t?r(e):e}}()),Tn}function Rn(){return Ln||(Ln=1,function(){var e=An,t=In(),r=Bn(),n=On();e.assert=r,e.toArray=n.toArray,e.zero2=n.zero2,e.toHex=n.toHex,e.encode=n.encode,e.getNAF=function(e,t,r){var n,i=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,a=e.clone();for(n=0;n<i.length;n++){var c,s=a.andln(o-1);a.isOdd()?(c=s>(o>>1)-1?(o>>1)-s:s,a.isubn(c)):c=0,i[n]=c,a.iushrn(1)}return i},e.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,c,s=e.andln(3)+i&3,l=t.andln(3)+o&3;3===s&&(s=-1),3===l&&(l=-1),a=1&s?3!==(n=e.andln(7)+i&7)&&5!==n||2!==l?s:-s:0,r[0].push(a),c=1&l?3!==(n=t.andln(7)+o&7)&&5!==n||2!==s?l:-l:0,r[1].push(c),2*i===a+1&&(i=1-i),2*o===c+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},e.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(e){return new t(e,"hex","le")}}()),An}var Pn,Un={exports:{}};function zn(){if(Pn)return Un.exports;var e;function t(e){this.rand=e}if(Pn=1,Un.exports=function(r){return e||(e=new t(null)),e.generate(r)},Un.exports.Rand=t,t.prototype.generate=function(e){return this._rand(e)},t.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=nt;if("function"!=typeof r.randomBytes)throw new Error("Not supported");t.prototype._rand=function(e){return r.randomBytes(e)}}catch(e){}return Un.exports}var jn,Fn,Dn={};function Hn(){if(Fn)return jn;Fn=1;var e=In(),t=Rn(),r=t.getNAF,n=t.getJSF,i=t.assert;function o(t,r){this.type=t,this.p=new e(r.p,16),this.red=r.prime?e.red(r.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=r.n&&new e(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function a(e,t){this.curve=e,this.type=t,this.precomputed=null}return jn=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){i(e.precomputed);var n=e._getDoubles(),o=r(t,1,this._bitLength),a=(1<<n.step+1)-(n.step%2==0?2:1);a/=3;var c,s,l=[];for(c=0;c<o.length;c+=n.step){s=0;for(var u=c+n.step-1;u>=c;u--)s=(s<<1)+o[u];l.push(s)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(c=0;c<l.length;c++)(s=l[c])===h?f=f.mixedAdd(n.points[c]):s===-h&&(f=f.mixedAdd(n.points[c].neg()));d=d.add(f)}return d.toP()},o.prototype._wnafMul=function(e,t){var n=4,o=e._getNAFPoints(n);n=o.wnd;for(var a=o.points,c=r(t,n,this._bitLength),s=this.jpoint(null,null,null),l=c.length-1;l>=0;l--){for(var u=0;l>=0&&0===c[l];l--)u++;if(l>=0&&u++,s=s.dblp(u),l<0)break;var d=c[l];i(0!==d),s="affine"===e.type?d>0?s.mixedAdd(a[d-1>>1]):s.mixedAdd(a[-d-1>>1].neg()):d>0?s.add(a[d-1>>1]):s.add(a[-d-1>>1].neg())}return"affine"===e.type?s.toP():s},o.prototype._wnafMulAdd=function(e,t,i,o,a){var c,s,l,u=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(c=0;c<o;c++){var b=(l=t[c])._getNAFPoints(e);u[c]=b.wnd,d[c]=b.points}for(c=o-1;c>=1;c-=2){var p=c-1,m=c;if(1===u[p]&&1===u[m]){var g=[t[p],null,null,t[m]];0===t[p].y.cmp(t[m].y)?(g[1]=t[p].add(t[m]),g[2]=t[p].toJ().mixedAdd(t[m].neg())):0===t[p].y.cmp(t[m].y.redNeg())?(g[1]=t[p].toJ().mixedAdd(t[m]),g[2]=t[p].add(t[m].neg())):(g[1]=t[p].toJ().mixedAdd(t[m]),g[2]=t[p].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],w=n(i[p],i[m]);for(h=Math.max(w[0].length,h),f[p]=new Array(h),f[m]=new Array(h),s=0;s<h;s++){var v=0|w[0][s],x=0|w[1][s];f[p][s]=y[3*(v+1)+(x+1)],f[m][s]=0,d[p]=g}}else f[p]=r(i[p],u[p],this._bitLength),f[m]=r(i[m],u[m],this._bitLength),h=Math.max(f[p].length,h),h=Math.max(f[m].length,h)}var E=this.jpoint(null,null,null),C=this._wnafT4;for(c=h;c>=0;c--){for(var _=0;c>=0;){var M=!0;for(s=0;s<o;s++)C[s]=0|f[s][c],0!==C[s]&&(M=!1);if(!M)break;_++,c--}if(c>=0&&_++,E=E.dblp(_),c<0)break;for(s=0;s<o;s++){var A=C[s];0!==A&&(A>0?l=d[s][A-1>>1]:A<0&&(l=d[s][-A-1>>1].neg()),E="affine"===l.type?E.mixedAdd(l):E.add(l))}}for(c=0;c<o;c++)d[c]=null;return a?E:E.toP()},o.BasePoint=a,a.prototype.eq=function(){throw new Error("Not implemented")},a.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,r){e=t.toArray(e,r);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*n)return 6===e[0]?i(e[e.length-1]%2==0):7===e[0]&&i(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},a.prototype.encodeCompressed=function(e){return this.encode(e,!0)},a.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},a.prototype.encode=function(e,r){return t.encode(this._encode(r),e)},a.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},a.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},a.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},a.prototype._getBeta=function(){return null},a.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t},jn}var Kn,qn,Vn,Wn,Zn,$n,Gn,Xn,Jn={exports:{}};function Yn(){return Kn||(Kn=1,"function"==typeof Object.create?Jn.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Jn.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),Jn.exports}function Qn(){return Xn||(Xn=1,function(e){var t=e;t.base=Hn(),t.short=function(){if(Vn)return qn;Vn=1;var e=Rn(),t=In(),r=Yn(),n=Hn(),i=e.assert;function o(e){n.call(this,"short",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function a(e,r,i,o){n.BasePoint.call(this,e,"affine"),null===r&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(r,16),this.y=new t(i,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(e,r,i,o){n.BasePoint.call(this,e,"jacobian"),null===r&&null===i&&null===o?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(r,16),this.y=new t(i,16),this.z=new t(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(o,n),qn=o,o.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,n;if(e.beta)r=new t(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);r=(r=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(e.lambda)n=new t(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(r))?n=a[0]:(n=a[1],i(0===this.g.mul(n).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:n,basis:e.basis?e.basis.map((function(e){return{a:new t(e.a,16),b:new t(e.b,16)}})):this._getEndoBasis(n)}}},o.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:t.mont(e),n=new t(2).toRed(r).redInvm(),i=n.redNeg(),o=new t(3).toRed(r).redNeg().redSqrt().redMul(n);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},o.prototype._getEndoBasis=function(e){for(var r,n,i,o,a,c,s,l,u,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),b=new t(1),p=new t(0),m=new t(0),g=new t(1),y=0;0!==f.cmpn(0);){var w=h.div(f);l=h.sub(w.mul(f)),u=m.sub(w.mul(b));var v=g.sub(w.mul(p));if(!i&&l.cmp(d)<0)r=s.neg(),n=b,i=l.neg(),o=u;else if(i&&2===++y)break;s=l,h=f,f=l,m=b,b=u,g=p,p=v}a=l.neg(),c=u;var x=i.sqr().add(o.sqr());return a.sqr().add(c.sqr()).cmp(x)>=0&&(a=r,c=n),i.negative&&(i=i.neg(),o=o.neg()),a.negative&&(a=a.neg(),c=c.neg()),[{a:i,b:o},{a:a,b:c}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),c=o.mul(n.a),s=i.mul(r.b),l=o.mul(n.b);return{k1:e.sub(a).sub(c),k2:s.add(l).neg()}},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(0!==i.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(e,i)},o.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),c=e[o],s=c._getBeta();a.k1.negative&&(a.k1.ineg(),c=c.neg(!0)),a.k2.negative&&(a.k2.ineg(),s=s.neg(!0)),n[2*o]=c,n[2*o+1]=s,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var l=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return l},r(a,n.BasePoint),o.prototype.point=function(e,t,r){return new a(this,e,t,r)},o.prototype.pointFromJSON=function(e,t){return a.fromJSON(this,e,t)},a.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},a.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},a.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return this.inf},a.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},a.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},a.prototype.getX=function(){return this.x.fromRed()},a.prototype.getY=function(){return this.y.fromRed()},a.prototype.mul=function(e){return e=new t(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},a.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},a.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},a.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},a.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(c,n.BasePoint),o.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),c=n.redSub(i),s=o.redSub(a);if(0===c.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=c.redSqr(),u=l.redMul(c),d=n.redMul(l),f=s.redSqr().redIAdd(u).redISub(d).redISub(d),h=s.redMul(d.redISub(f)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(f,h,b)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),c=i.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),l=s.redMul(a),u=r.redMul(s),d=c.redSqr().redIAdd(l).redISub(u).redISub(u),f=c.redMul(u.redISub(d)).redISub(i.redMul(l)),h=this.z.redMul(a);return this.curve.jpoint(d,f,h)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,c=this.z,s=c.redSqr().redSqr(),l=a.redAdd(a);for(t=0;t<e;t++){var u=o.redSqr(),d=l.redSqr(),f=d.redSqr(),h=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(s)),b=o.redMul(d),p=h.redSqr().redISub(b.redAdd(b)),m=b.redISub(p),g=h.redMul(m);g=g.redIAdd(g).redISub(f);var y=l.redMul(c);t+1<e&&(s=s.redMul(f)),o=p,c=y,l=g}return this.curve.jpoint(o,l.redMul(i),c)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var c=n.redAdd(n).redIAdd(n),s=c.redSqr().redISub(a).redISub(a),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=s,t=c.redMul(a.redISub(s)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(u).redISub(f);h=h.redIAdd(h);var b=u.redAdd(u).redIAdd(u),p=b.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),e=p.redISub(h).redISub(h),t=b.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},c.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var c=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),s=c.redSqr().redISub(a).redISub(a);e=s;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=c.redMul(a.redISub(s)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(u).redMul(this.x.redAdd(u));h=h.redAdd(h).redIAdd(h);var b=f.redIAdd(f),p=(b=b.redIAdd(b)).redAdd(b);e=h.redSqr().redISub(p),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(u);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(b.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},c.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),c=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),s=t.redAdd(t),l=(s=s.redIAdd(s)).redMul(a),u=c.redSqr().redISub(l.redAdd(l)),d=l.redISub(u),f=a.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=c.redMul(d).redISub(f),b=r.redAdd(r).redMul(n);return this.curve.jpoint(u,h,b)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),c=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),s=n.redIAdd(n);s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);var l=i.redIAdd(a).redSqr().redISub(o).redISub(c).redISub(s),u=t.redMul(l);u=(u=u.redIAdd(u)).redIAdd(u);var d=this.x.redMul(c).redISub(u);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(l.redMul(s.redISub(l)).redISub(a.redMul(c)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(c);return this.curve.jpoint(d,f,h)},c.prototype.mul=function(e,r){return e=new t(e,r),this.curve._wnafMul(this,e)},c.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},qn}(),t.mont=function(){if(Zn)return Wn;Zn=1;var e=In(),t=Yn(),r=Hn(),n=Rn();function i(t){r.call(this,"mont",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(t,n,i){r.BasePoint.call(this,t,"projective"),null===n&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(n,16),this.z=new e(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(i,r),Wn=i,i.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},t(o,r.BasePoint),i.prototype.decodePoint=function(e,t){return this.point(n.toArray(e,t),1)},i.prototype.point=function(e,t){return new o(this,e,t)},i.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),c=t.z.redMul(o.redAdd(a).redSqr()),s=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(c,s)},o.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Wn}(),t.edwards=function(){if(Gn)return $n;Gn=1;var e=Rn(),t=In(),r=Yn(),n=Hn(),i=e.assert;function o(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,n.call(this,"edwards",e),this.a=new t(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),i(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function a(e,r,i,o,a){n.BasePoint.call(this,e,"projective"),null===r&&null===i&&null===o?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(r,16),this.y=new t(i,16),this.z=o?new t(o,16):this.curve.one,this.t=a&&new t(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(o,n),$n=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(o.redInvm()),c=a.redSqrt();if(0!==c.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var s=c.fromRed().isOdd();return(r&&!s||!r&&s)&&(c=c.redNeg()),this.point(e,c)},o.prototype.pointFromY=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var c=a.redSqrt();if(0!==c.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return c.fromRed().isOdd()!==r&&(c=c.redNeg()),this.point(c,e)},o.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},r(a,n.BasePoint),o.prototype.pointFromJSON=function(e){return a.fromJSON(this,e)},o.prototype.point=function(e,t,r,n){return new a(this,e,t,r,n)},a.fromJSON=function(e,t){return new a(e,t[0],t[1],t[2])},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},a.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),c=n.redSub(t),s=i.redMul(a),l=o.redMul(c),u=i.redMul(c),d=a.redMul(o);return this.curve.point(s,l,d,u)},a.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var l=(n=this.curve._mulA(c)).redAdd(s);this.zOne?(e=a.redSub(c).redSub(s).redMul(l.redSub(this.curve.two)),t=l.redMul(n.redSub(s)),r=l.redSqr().redSub(l).redSub(l)):(i=this.z.redSqr(),o=l.redSub(i).redISub(i),e=a.redSub(c).redISub(s).redMul(o),t=l.redMul(n.redSub(s)),r=l.redMul(o))}else n=c.redAdd(s),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(c.redISub(s)),r=n.redMul(o);return this.curve.point(e,t,r)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},a.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),c=i.redAdd(n),s=r.redAdd(t),l=o.redMul(a),u=c.redMul(s),d=o.redMul(s),f=a.redMul(c);return this.curve.point(l,u,f,d)},a.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),c=this.curve.d.redMul(o).redMul(a),s=i.redSub(c),l=i.redAdd(c),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(s).redMul(u);return this.curve.twisted?(t=n.redMul(l).redMul(a.redSub(this.curve._mulA(o))),r=s.redMul(l)):(t=n.redMul(l).redMul(a.redSub(o)),r=this.curve._mulC(s).redMul(l)),this.curve.point(d,t,r)},a.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},a.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},a.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},a.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},a.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},a.prototype.getY=function(){return this.normalize(),this.y.fromRed()},a.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},a.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},a.prototype.toP=a.prototype.normalize,a.prototype.mixedAdd=a.prototype.add,$n}()}(Dn)),Dn}var ei,ti,ri={},ni={},ii={},oi={exports:{}};function ai(){if(ti)return ii;ti=1;var e=Bn(),t=(ei||(ei=1,"function"==typeof Object.create?oi.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:oi.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}),oi.exports);function r(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function n(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}return ii.inherits=t,ii.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var i=0,o=0;o<e.length;o++){var a=e.charCodeAt(o);a<128?n[i++]=a:a<2048?(n[i++]=a>>6|192,n[i++]=63&a|128):r(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),n[i++]=a>>18|240,n[i++]=a>>12&63|128,n[i++]=a>>6&63|128,n[i++]=63&a|128):(n[i++]=a>>12|224,n[i++]=a>>6&63|128,n[i++]=63&a|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},ii.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t},ii.htonl=n,ii.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var a=e[i];"little"===t&&(a=n(a)),r+=o(a.toString(16))}return r},ii.zero2=i,ii.zero8=o,ii.join32=function(t,r,n,i){var o=n-r;e(o%4==0);for(var a=new Array(o/4),c=0,s=r;c<a.length;c++,s+=4){var l;l="big"===i?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],a[c]=l>>>0}return a},ii.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},ii.rotr32=function(e,t){return e>>>t|e<<32-t},ii.rotl32=function(e,t){return e<<t|e>>>32-t},ii.sum32=function(e,t){return e+t>>>0},ii.sum32_3=function(e,t,r){return e+t+r>>>0},ii.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},ii.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},ii.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},ii.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},ii.sum64_lo=function(e,t,r,n){return t+n>>>0},ii.sum64_4_hi=function(e,t,r,n,i,o,a,c){var s=0,l=t;return s+=(l=l+n>>>0)<t?1:0,s+=(l=l+o>>>0)<o?1:0,e+r+i+a+(s+=(l=l+c>>>0)<c?1:0)>>>0},ii.sum64_4_lo=function(e,t,r,n,i,o,a,c){return t+n+o+c>>>0},ii.sum64_5_hi=function(e,t,r,n,i,o,a,c,s,l){var u=0,d=t;return u+=(d=d+n>>>0)<t?1:0,u+=(d=d+o>>>0)<o?1:0,u+=(d=d+c>>>0)<c?1:0,e+r+i+a+s+(u+=(d=d+l>>>0)<l?1:0)>>>0},ii.sum64_5_lo=function(e,t,r,n,i,o,a,c,s,l){return t+n+o+c+l>>>0},ii.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},ii.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},ii.shr64_hi=function(e,t,r){return e>>>r},ii.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},ii}var ci,si={};function li(){if(ci)return si;ci=1;var e=ai(),t=Bn();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return si.BlockHash=r,r.prototype.update=function(t,r){if(t=e.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=e.join32(t,0,t.length-n,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},r.prototype.digest=function(e){return this.update(this._pad()),t(null===this.pending),this._digest(e)},r.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n},si}var ui,di,fi,hi,bi,pi,mi,gi,yi,wi,vi,xi,Ei={},Ci={};function _i(){if(ui)return Ci;ui=1;var e=ai().rotr32;function t(e,t,r){return e&t^~e&r}function r(e,t,r){return e&t^e&r^t&r}function n(e,t,r){return e^t^r}return Ci.ft_1=function(e,i,o,a){return 0===e?t(i,o,a):1===e||3===e?n(i,o,a):2===e?r(i,o,a):void 0},Ci.ch32=t,Ci.maj32=r,Ci.p32=n,Ci.s0_256=function(t){return e(t,2)^e(t,13)^e(t,22)},Ci.s1_256=function(t){return e(t,6)^e(t,11)^e(t,25)},Ci.g0_256=function(t){return e(t,7)^e(t,18)^t>>>3},Ci.g1_256=function(t){return e(t,17)^e(t,19)^t>>>10},Ci}function Mi(){if(bi)return hi;bi=1;var e=ai(),t=li(),r=_i(),n=Bn(),i=e.sum32,o=e.sum32_4,a=e.sum32_5,c=r.ch32,s=r.maj32,l=r.s0_256,u=r.s1_256,d=r.g0_256,f=r.g1_256,h=t.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function p(){if(!(this instanceof p))return new p;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}return e.inherits(p,h),hi=p,p.blockSize=512,p.outSize=256,p.hmacStrength=192,p.padLength=64,p.prototype._update=function(e,t){for(var r=this.W,h=0;h<16;h++)r[h]=e[t+h];for(;h<r.length;h++)r[h]=o(f(r[h-2]),r[h-7],d(r[h-15]),r[h-16]);var b=this.h[0],p=this.h[1],m=this.h[2],g=this.h[3],y=this.h[4],w=this.h[5],v=this.h[6],x=this.h[7];for(n(this.k.length===r.length),h=0;h<r.length;h++){var E=a(x,u(y),c(y,w,v),this.k[h],r[h]),C=i(l(b),s(b,p,m));x=v,v=w,w=y,y=i(g,E),g=m,m=p,p=b,b=i(E,C)}this.h[0]=i(this.h[0],b),this.h[1]=i(this.h[1],p),this.h[2]=i(this.h[2],m),this.h[3]=i(this.h[3],g),this.h[4]=i(this.h[4],y),this.h[5]=i(this.h[5],w),this.h[6]=i(this.h[6],v),this.h[7]=i(this.h[7],x)},p.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},hi}function Ai(){if(yi)return gi;yi=1;var e=ai(),t=li(),r=Bn(),n=e.rotr64_hi,i=e.rotr64_lo,o=e.shr64_hi,a=e.shr64_lo,c=e.sum64,s=e.sum64_hi,l=e.sum64_lo,u=e.sum64_4_hi,d=e.sum64_4_lo,f=e.sum64_5_hi,h=e.sum64_5_lo,b=t.BlockHash,p=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function m(){if(!(this instanceof m))return new m;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=p,this.W=new Array(160)}function g(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function y(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function w(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function v(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function x(e,t){var r=n(e,t,28)^n(t,e,2)^n(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=i(e,t,28)^i(t,e,2)^i(t,e,7);return r<0&&(r+=4294967296),r}function C(e,t){var r=n(e,t,14)^n(e,t,18)^n(t,e,9);return r<0&&(r+=4294967296),r}function _(e,t){var r=i(e,t,14)^i(e,t,18)^i(t,e,9);return r<0&&(r+=4294967296),r}function M(e,t){var r=n(e,t,1)^n(e,t,8)^o(e,t,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=i(e,t,1)^i(e,t,8)^a(e,t,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=n(e,t,19)^n(t,e,29)^o(e,t,6);return r<0&&(r+=4294967296),r}function k(e,t){var r=i(e,t,19)^i(t,e,29)^a(e,t,6);return r<0&&(r+=4294967296),r}return e.inherits(m,b),gi=m,m.blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=S(r[n-4],r[n-3]),o=k(r[n-4],r[n-3]),a=r[n-14],c=r[n-13],s=M(r[n-30],r[n-29]),l=A(r[n-30],r[n-29]),f=r[n-32],h=r[n-31];r[n]=u(i,o,a,c,s,l,f,h),r[n+1]=d(i,o,a,c,s,l,f,h)}},m.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],o=this.h[1],a=this.h[2],u=this.h[3],d=this.h[4],b=this.h[5],p=this.h[6],m=this.h[7],M=this.h[8],A=this.h[9],S=this.h[10],k=this.h[11],I=this.h[12],B=this.h[13],N=this.h[14],L=this.h[15];r(this.k.length===n.length);for(var T=0;T<n.length;T+=2){var O=N,R=L,P=C(M,A),U=_(M,A),z=g(M,A,S,k,I),j=y(M,A,S,k,I,B),F=this.k[T],D=this.k[T+1],H=n[T],K=n[T+1],q=f(O,R,P,U,z,j,F,D,H,K),V=h(O,R,P,U,z,j,F,D,H,K);O=x(i,o),R=E(i,o),P=w(i,o,a,u,d),U=v(i,o,a,u,d,b);var W=s(O,R,P,U),Z=l(O,R,P,U);N=I,L=B,I=S,B=k,S=M,k=A,M=s(p,m,q,V),A=l(m,m,q,V),p=d,m=b,d=a,b=u,a=i,u=o,i=s(q,V,W,Z),o=l(q,V,W,Z)}c(this.h,0,i,o),c(this.h,2,a,u),c(this.h,4,d,b),c(this.h,6,p,m),c(this.h,8,M,A),c(this.h,10,S,k),c(this.h,12,I,B),c(this.h,14,N,L)},m.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},gi}function Si(){return xi||(xi=1,Ei.sha1=function(){if(fi)return di;fi=1;var e=ai(),t=li(),r=_i(),n=e.rotl32,i=e.sum32,o=e.sum32_5,a=r.ft_1,c=t.BlockHash,s=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(l,c),di=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.W,c=0;c<16;c++)r[c]=e[t+c];for(;c<r.length;c++)r[c]=n(r[c-3]^r[c-8]^r[c-14]^r[c-16],1);var l=this.h[0],u=this.h[1],d=this.h[2],f=this.h[3],h=this.h[4];for(c=0;c<r.length;c++){var b=~~(c/20),p=o(n(l,5),a(b,u,d,f),h,r[c],s[b]);h=f,f=d,d=n(u,30),u=l,l=p}this.h[0]=i(this.h[0],l),this.h[1]=i(this.h[1],u),this.h[2]=i(this.h[2],d),this.h[3]=i(this.h[3],f),this.h[4]=i(this.h[4],h)},l.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},di}(),Ei.sha224=function(){if(mi)return pi;mi=1;var e=ai(),t=Mi();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return e.inherits(r,t),pi=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,7),"big"):e.split32(this.h.slice(0,7),"big")},pi}(),Ei.sha256=Mi(),Ei.sha384=function(){if(vi)return wi;vi=1;var e=ai(),t=Ai();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return e.inherits(r,t),wi=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,12),"big"):e.split32(this.h.slice(0,12),"big")},wi}(),Ei.sha512=Ai()),Ei}var ki,Ii,Bi,Ni,Li,Ti,Oi,Ri,Pi,Ui,zi,ji,Fi,Di,Hi,Ki,qi,Vi,Wi,Zi,$i,Gi,Xi,Ji,Yi,Qi,eo,to,ro={};function no(){return Ni||(Ni=1,function(e){var t=e;t.utils=ai(),t.common=li(),t.sha=Si(),t.ripemd=function(){if(ki)return ro;ki=1;var e=ai(),t=li(),r=e.rotl32,n=e.sum32,i=e.sum32_3,o=e.sum32_4,a=t.BlockHash;function c(){if(!(this instanceof c))return new c;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function s(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function u(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}e.inherits(c,a),ro.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(e,t){for(var a=this.h[0],c=this.h[1],p=this.h[2],m=this.h[3],g=this.h[4],y=a,w=c,v=p,x=m,E=g,C=0;C<80;C++){var _=n(r(o(a,s(C,c,p,m),e[d[C]+t],l(C)),h[C]),g);a=g,g=m,m=r(p,10),p=c,c=_,_=n(r(o(y,s(79-C,w,v,x),e[f[C]+t],u(C)),b[C]),E),y=E,E=x,x=r(v,10),v=w,w=_}_=i(this.h[1],p,x),this.h[1]=i(this.h[2],m,E),this.h[2]=i(this.h[3],g,y),this.h[3]=i(this.h[4],a,w),this.h[4]=i(this.h[0],c,v),this.h[0]=_},c.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"little"):e.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],b=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return ro}(),t.hmac=function(){if(Bi)return Ii;Bi=1;var e=ai(),t=Bn();function r(t,n,i){if(!(this instanceof r))return new r(t,n,i);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(e.toArray(n,i))}return Ii=r,r.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),t(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=(new this.Hash).update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=(new this.Hash).update(e)},r.prototype.update=function(e,t){return this.inner.update(e,t),this},r.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},Ii}(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(ni)),ni}function io(){return Oi||(Oi=1,function(e){var t,r=e,n=no(),i=Qn(),o=Rn().assert;function a(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new a(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=a,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=Ti?Li:(Ti=1,Li={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(ri)),ri}function oo(){if(Hi)return Di;Hi=1;var e=In(),t=function(){if(Pi)return Ri;Pi=1;var e=no(),t=On(),r=Bn();function n(e){if(!(this instanceof n))return new n(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var i=t.toArray(e.entropy,e.entropyEnc||"hex"),o=t.toArray(e.nonce,e.nonceEnc||"hex"),a=t.toArray(e.pers,e.persEnc||"hex");r(i.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(i,o,a)}return Ri=n,n.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},n.prototype._hmac=function(){return new e.hmac(this.hash,this.K)},n.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},n.prototype.reseed=function(e,n,i,o){"string"!=typeof n&&(o=i,i=n,n=null),e=t.toArray(e,n),i=t.toArray(i,o),r(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},n.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(i=n,n=r,r=null),n&&(n=t.toArray(n,i||"hex"),this._update(n));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(n),this._reseed++,t.encode(a,r)},Ri}(),r=Rn(),n=io(),i=zn(),o=r.assert,a=function(){if(zi)return Ui;zi=1;var e=In(),t=Rn().assert;function r(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}return Ui=r,r.fromPublic=function(e,t,n){return t instanceof r?t:new r(e,{pub:t,pubEnc:n})},r.fromPrivate=function(e,t,n){return t instanceof r?t:new r(e,{priv:t,privEnc:n})},r.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},r.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(t,r){this.priv=new e(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(e,r){if(e.x||e.y)return"mont"===this.ec.curve.type?t(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||t(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,r)},r.prototype.derive=function(e){return e.validate()||t(e.validate(),"public point not validated"),e.mul(this.priv).getX()},r.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},r.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Ui}(),c=function(){if(Fi)return ji;Fi=1;var e=In(),t=Rn(),r=t.assert;function n(t,i){if(t instanceof n)return t;this._importDER(t,i)||(r(t.r&&t.s,"Signature without r or s"),this.r=new e(t.r,16),this.s=new e(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function i(){this.place=0}function o(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function a(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function c(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}return ji=n,n.prototype._importDER=function(r,n){r=t.toArray(r,n);var a=new i;if(48!==r[a.place++])return!1;var c=o(r,a);if(!1===c)return!1;if(c+a.place!==r.length)return!1;if(2!==r[a.place++])return!1;var s=o(r,a);if(!1===s)return!1;if(128&r[a.place])return!1;var l=r.slice(a.place,s+a.place);if(a.place+=s,2!==r[a.place++])return!1;var u=o(r,a);if(!1===u)return!1;if(r.length!==u+a.place)return!1;if(128&r[a.place])return!1;var d=r.slice(a.place,u+a.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new e(l),this.s=new e(d),this.recoveryParam=null,!0},n.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&n[0]&&(n=[0].concat(n)),r=a(r),n=a(n);!(n[0]||128&n[1]);)n=n.slice(1);var i=[2];c(i,r.length),(i=i.concat(r)).push(2),c(i,n.length);var o=i.concat(n),s=[48];return c(s,o.length),s=s.concat(o),t.encode(s,e)},ji}();function s(e){if(!(this instanceof s))return new s(e);"string"==typeof e&&(o(Object.prototype.hasOwnProperty.call(n,e),"Unknown curve "+e),e=n[e]),e instanceof n.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}return Di=s,s.prototype.keyPair=function(e){return new a(this,e)},s.prototype.keyFromPrivate=function(e,t){return a.fromPrivate(this,e,t)},s.prototype.keyFromPublic=function(e,t){return a.fromPublic(this,e,t)},s.prototype.genKeyPair=function(r){r||(r={});for(var n=new t({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||i(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),a=this.n.sub(new e(2));;){var c=new e(n.generate(o));if(!(c.cmp(a)>0))return c.iaddn(1),this.keyFromPrivate(c)}},s.prototype._truncateToN=function(t,r,n){var i;if(e.isBN(t)||"number"==typeof t)i=(t=new e(t,16)).byteLength();else if("object"==typeof t)i=t.length,t=new e(t,16);else{var o=t.toString();i=o.length+1>>>1,t=new e(o,16)}"number"!=typeof n&&(n=8*i);var a=n-this.n.bitLength();return a>0&&(t=t.ushrn(a)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},s.prototype.sign=function(r,n,i,a){if("object"==typeof i&&(a=i,i=null),a||(a={}),"string"!=typeof r&&"number"!=typeof r&&!e.isBN(r)){o("object"==typeof r&&r&&"number"==typeof r.length,"Expected message to be an array-like, a hex string, or a BN instance"),o(r.length>>>0===r.length);for(var s=0;s<r.length;s++)o((255&r[s])===r[s])}n=this.keyFromPrivate(n,i),r=this._truncateToN(r,!1,a.msgBitLength),o(!r.isNeg(),"Can not sign a negative message");var l=this.n.byteLength(),u=n.getPrivate().toArray("be",l),d=r.toArray("be",l);o(new e(d).eq(r),"Can not sign message");for(var f=new t({hash:this.hash,entropy:u,nonce:d,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new e(1)),b=0;;b++){var p=a.k?a.k(b):new e(f.generate(this.n.byteLength()));if(!((p=this._truncateToN(p,!0)).cmpn(1)<=0||p.cmp(h)>=0)){var m=this.g.mul(p);if(!m.isInfinity()){var g=m.getX(),y=g.umod(this.n);if(0!==y.cmpn(0)){var w=p.invm(this.n).mul(y.mul(n.getPrivate()).iadd(r));if(0!==(w=w.umod(this.n)).cmpn(0)){var v=(m.getY().isOdd()?1:0)|(0!==g.cmp(y)?2:0);return a.canonical&&w.cmp(this.nh)>0&&(w=this.n.sub(w),v^=1),new c({r:y,s:w,recoveryParam:v})}}}}}},s.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o=(t=new c(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,l=a.invm(this.n),u=l.mul(e).umod(this.n),d=l.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),d)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(u,r.getPublic(),d)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},s.prototype.recoverPubKey=function(t,r,n,i){o((3&n)===n,"The recovery param is more than two bits"),r=new c(r,i);var a=this.n,s=new e(t),l=r.r,u=r.s,d=1&n,f=n>>1;if(l.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");l=f?this.curve.pointFromX(l.add(this.curve.n),d):this.curve.pointFromX(l,d);var h=r.r.invm(a),b=a.sub(s).mul(h).umod(a),p=u.mul(h).umod(a);return this.g.mulAdd(b,l,p)},s.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")},Di}function ao(){if($i)return Zi;$i=1;var e=no(),t=io(),r=Rn(),n=r.assert,i=r.parseBytes,o=function(){if(qi)return Ki;qi=1;var e=Rn(),t=e.assert,r=e.parseBytes,n=e.cachedProperty;function i(e,t){this.eddsa=e,this._secret=r(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=r(t.pub)}return i.fromPublic=function(e,t){return t instanceof i?t:new i(e,{pub:t})},i.fromSecret=function(e,t){return t instanceof i?t:new i(e,{secret:t})},i.prototype.secret=function(){return this._secret},n(i,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),n(i,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),n(i,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),n(i,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),n(i,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),n(i,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),i.prototype.sign=function(e){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},i.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},i.prototype.getSecret=function(r){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),r)},i.prototype.getPublic=function(t){return e.encode(this.pubBytes(),t)},Ki=i}(),a=function(){if(Wi)return Vi;Wi=1;var e=In(),t=Rn(),r=t.assert,n=t.cachedProperty,i=t.parseBytes;function o(t,n){this.eddsa=t,"object"!=typeof n&&(n=i(n)),Array.isArray(n)&&(r(n.length===2*t.encodingLength,"Signature has invalid size"),n={R:n.slice(0,t.encodingLength),S:n.slice(t.encodingLength)}),r(n.R&&n.S,"Signature without R or S"),t.isPoint(n.R)&&(this._R=n.R),n.S instanceof e&&(this._S=n.S),this._Rencoded=Array.isArray(n.R)?n.R:n.Rencoded,this._Sencoded=Array.isArray(n.S)?n.S:n.Sencoded}return n(o,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),n(o,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),n(o,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),n(o,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},Vi=o}();function c(r){if(n("ed25519"===r,"only tested with ed25519 so far"),!(this instanceof c))return new c(r);r=t[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=e.sha512}return Zi=c,c.prototype.sign=function(e,t){e=i(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),o=this.g.mul(n),a=this.encodePoint(o),c=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=n.add(c).umod(this.curve.n);return this.makeSignature({R:o,S:s,Rencoded:a})},c.prototype.verify=function(e,t,r){if(e=i(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(o)).eq(a)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return r.intFromLE(e.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(e){return o.fromPublic(this,e)},c.prototype.keyFromSecret=function(e){return o.fromSecret(this,e)},c.prototype.makeSignature=function(e){return e instanceof a?e:new a(this,e)},c.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},c.prototype.decodePoint=function(e){var t=(e=r.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),i=!!(128&e[t]),o=r.intFromLE(n);return this.curve.pointFromY(o,i)},c.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(e){return r.intFromLE(e)},c.prototype.isPoint=function(e){return e instanceof this.pointClass},Zi}function co(){if(Ji)return Xi;Ji=1;const e=(Gi||(Gi=1,function(){var e=_n;e.version=Mn,e.utils=Rn(),e.rand=zn(),e.curve=Qn(),e.curves=io(),e.ec=oo(),e.eddsa=ao()}()),_n).ec,t=new e("secp256k1"),r=t.curve,n=r.n.constructor;function i(e){const i=e[0];switch(i){case 2:case 3:return 33!==e.length?null:function(e,i){let o=new n(i);if(o.cmp(r.p)>=0)return null;o=o.toRed(r.red);let a=o.redSqr().redIMul(o).redIAdd(r.b).redSqrt();3===e!==a.isOdd()&&(a=a.redNeg());const c=o.redSqr().redIMul(o);return a.redSqr().redISub(c.redIAdd(r.b)).isZero()?t.keyPair({pub:{x:o,y:a}}):null}(i,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,i,o){let a=new n(i),c=new n(o);if(a.cmp(r.p)>=0||c.cmp(r.p)>=0)return null;if(a=a.toRed(r.red),c=c.toRed(r.red),(6===e||7===e)&&c.isOdd()!==(7===e))return null;const s=a.redSqr().redIMul(a);return c.redSqr().redISub(s.redIAdd(r.b)).isZero()?t.keyPair({pub:{x:a,y:c}}):null}(i,e.subarray(1,33),e.subarray(33,65));default:return null}}function o(e,t){const r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}return Xi={contextRandomize:()=>0,privateKeyVerify(e){const t=new n(e);return t.cmp(r.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new n(e),i=r.n.sub(t).umod(r.n).toArrayLike(Uint8Array,"be",32);return e.set(i),0},privateKeyTweakAdd(e,t){const i=new n(t);if(i.cmp(r.n)>=0)return 1;if(i.iadd(new n(e)),i.cmp(r.n)>=0&&i.isub(r.n),i.isZero())return 1;const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},privateKeyTweakMul(e,t){let i=new n(t);if(i.cmp(r.n)>=0||i.isZero())return 1;i.imul(new n(e)),i.cmp(r.n)>=0&&(i=i.umod(r.n));const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},publicKeyVerify:e=>null===i(e)?1:0,publicKeyCreate(e,i){const a=new n(i);if(a.cmp(r.n)>=0||a.isZero())return 1;return o(e,t.keyFromPrivate(i).getPublic()),0},publicKeyConvert(e,t){const r=i(t);if(null===r)return 1;return o(e,r.getPublic()),0},publicKeyNegate(e,t){const r=i(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),o(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=i(t[e]),null===r[e])return 1;let n=r[0].getPublic();for(let e=1;e<r.length;++e)n=n.add(r[e].pub);return n.isInfinity()?2:(o(e,n),0)},publicKeyTweakAdd(e,t,a){const c=i(t);if(null===c)return 1;if((a=new n(a)).cmp(r.n)>=0)return 2;const s=c.getPublic().add(r.g.mul(a));return s.isInfinity()?2:(o(e,s),0)},publicKeyTweakMul(e,t,a){const c=i(t);if(null===c)return 1;if((a=new n(a)).cmp(r.n)>=0||a.isZero())return 2;return o(e,c.getPublic().mul(a)),0},signatureNormalize(e){const i=new n(e.subarray(0,32)),o=new n(e.subarray(32,64));return i.cmp(r.n)>=0||o.cmp(r.n)>=0?1:(1===o.cmp(t.nh)&&e.set(r.n.sub(o).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const i=t.subarray(0,32),o=t.subarray(32,64);if(new n(i).cmp(r.n)>=0)return 1;if(new n(o).cmp(r.n)>=0)return 1;const{output:a}=e;let c=a.subarray(4,37);c[0]=0,c.set(i,1);let s=33,l=0;for(;s>1&&0===c[l]&&!(128&c[l+1]);--s,++l);if(c=c.subarray(l),128&c[0])return 1;if(s>1&&0===c[0]&&!(128&c[1]))return 1;let u=a.subarray(39,72);u[0]=0,u.set(o,1);let d=33,f=0;for(;d>1&&0===u[f]&&!(128&u[f+1]);--d,++f);return u=u.subarray(f),128&u[0]||d>1&&0===u[0]&&!(128&u[1])?1:(e.outputlen=6+s+d,a[0]=48,a[1]=e.outputlen-2,a[2]=2,a[3]=c.length,a.set(c,4),a[4+s]=2,a[5+s]=u.length,a.set(u,6+s),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const i=t[3];if(0===i)return 1;if(5+i>=t.length)return 1;if(2!==t[4+i])return 1;const o=t[5+i];if(0===o)return 1;if(6+i+o!==t.length)return 1;if(128&t[4])return 1;if(i>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[i+6])return 1;if(o>1&&0===t[i+6]&&!(128&t[i+7]))return 1;let a=t.subarray(4,4+i);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1;let c=t.subarray(6+i);if(33===c.length&&0===c[0]&&(c=c.slice(1)),c.length>32)throw new Error("S length is too long");let s=new n(a);s.cmp(r.n)>=0&&(s=new n(0));let l=new n(t.subarray(6+i));return l.cmp(r.n)>=0&&(l=new n(0)),e.set(s.toArrayLike(Uint8Array,"be",32),0),e.set(l.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,i,o,a,c){if(c){const e=c;c=t=>{const r=e(i,o,null,a,t);if(!(r instanceof Uint8Array&&32===r.length))throw new Error("This is the way");return new n(r)}}const s=new n(o);if(s.cmp(r.n)>=0||s.isZero())return 1;let l;try{l=t.sign(i,o,{canonical:!0,k:c,pers:a})}catch(e){return 1}return e.signature.set(l.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(l.s.toArrayLike(Uint8Array,"be",32),32),e.recid=l.recoveryParam,0},ecdsaVerify(e,o,a){const c={r:e.subarray(0,32),s:e.subarray(32,64)},s=new n(c.r),l=new n(c.s);if(s.cmp(r.n)>=0||l.cmp(r.n)>=0)return 1;if(1===l.cmp(t.nh)||s.isZero()||l.isZero())return 3;const u=i(a);if(null===u)return 2;const d=u.getPublic();return t.verify(o,c,d)?0:3},ecdsaRecover(e,i,a,c){const s={r:i.slice(0,32),s:i.slice(32,64)},l=new n(s.r),u=new n(s.s);if(l.cmp(r.n)>=0||u.cmp(r.n)>=0)return 1;if(l.isZero()||u.isZero())return 2;let d;try{d=t.recoverPubKey(c,s,a)}catch(e){return 2}return o(e,d),0},ecdh(e,o,a,c,s,l,u){const d=i(o);if(null===d)return 1;const f=new n(a);if(f.cmp(r.n)>=0||f.isZero())return 2;const h=d.getPublic().mul(f);if(void 0===s){const r=h.encode(null,!0),n=t.hash().update(r).digest();for(let t=0;t<32;++t)e[t]=n[t]}else{l||(l=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)l[e]=t[e];u||(u=new Uint8Array(32));const r=h.getY().toArray("be",32);for(let e=0;e<32;++e)u[e]=r[e];const n=s(l,u,c);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}},Xi}function so(){return Qi||(Qi=1,Yi=function(){if(wn)return yn;wn=1;const e="Impossible case. Please create issue.",t="The tweak was out of range or the resulted private key is invalid",r="The tweak was out of range or equal to zero",n="Unknow error on context randomization",i="Private Key is invalid",o="Public Key could not be parsed",a="Public Key serialization error",c="The sum of the public keys is not valid",s="Signature could not be parsed",l="The nonce generation function failed, or the private key was invalid",u="Public key could not be recover",d="Scalar was invalid (zero or overflow)";function f(e,t){if(!e)throw new Error(t)}function h(e,t,r){if(f(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;f(r.includes(t.length),n)}else{const n=`Expected ${e} to be an Uint8Array with length ${r}`;f(t.length===r,n)}}function b(e){f("Boolean"===m(e),"Expected compressed to be a Boolean")}function p(e=e=>new Uint8Array(e),t){return"function"==typeof e&&(e=e(t)),h("output",e,t),e}function m(e){return Object.prototype.toString.call(e).slice(8,-1)}return yn=g=>({contextRandomize(e){if(f(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&h("seed",e,32),1===g.contextRandomize(e))throw new Error(n)},privateKeyVerify:e=>(h("private key",e,32),0===g.privateKeyVerify(e)),privateKeyNegate(t){switch(h("private key",t,32),g.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(e)}},privateKeyTweakAdd(e,r){switch(h("private key",e,32),h("tweak",r,32),g.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(t)}},privateKeyTweakMul(e,t){switch(h("private key",e,32),h("tweak",t,32),g.privateKeyTweakMul(e,t)){case 0:return e;case 1:throw new Error(r)}},publicKeyVerify:e=>(h("public key",e,[33,65]),0===g.publicKeyVerify(e)),publicKeyCreate(e,t=!0,r){switch(h("private key",e,32),b(t),r=p(r,t?33:65),g.publicKeyCreate(r,e)){case 0:return r;case 1:throw new Error(i);case 2:throw new Error(a)}},publicKeyConvert(e,t=!0,r){switch(h("public key",e,[33,65]),b(t),r=p(r,t?33:65),g.publicKeyConvert(r,e)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(a)}},publicKeyNegate(t,r=!0,n){switch(h("public key",t,[33,65]),b(r),n=p(n,r?33:65),g.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(e);case 3:throw new Error(a)}},publicKeyCombine(e,t=!0,r){f(Array.isArray(e),"Expected public keys to be an Array"),f(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)h("public key",t,[33,65]);switch(b(t),r=p(r,t?33:65),g.publicKeyCombine(r,e)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(c);case 3:throw new Error(a)}},publicKeyTweakAdd(e,r,n=!0,i){switch(h("public key",e,[33,65]),h("tweak",r,32),b(n),i=p(i,n?33:65),g.publicKeyTweakAdd(i,e,r)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(t)}},publicKeyTweakMul(e,t,n=!0,i){switch(h("public key",e,[33,65]),h("tweak",t,32),b(n),i=p(i,n?33:65),g.publicKeyTweakMul(i,e,t)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(r)}},signatureNormalize(e){switch(h("signature",e,64),g.signatureNormalize(e)){case 0:return e;case 1:throw new Error(s)}},signatureExport(t,r){h("signature",t,64);const n={output:r=p(r,72),outputlen:72};switch(g.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(s);case 2:throw new Error(e)}},signatureImport(t,r){switch(h("signature",t),r=p(r,64),g.signatureImport(r,t)){case 0:return r;case 1:throw new Error(s);case 2:throw new Error(e)}},ecdsaSign(t,r,n={},i){h("message",t,32),h("private key",r,32),f("Object"===m(n),"Expected options to be an Object"),void 0!==n.data&&h("options.data",n.data),void 0!==n.noncefn&&f("Function"===m(n.noncefn),"Expected options.noncefn to be a Function");const o={signature:i=p(i,64),recid:null};switch(g.ecdsaSign(o,t,r,n.data,n.noncefn)){case 0:return o;case 1:throw new Error(l);case 2:throw new Error(e)}},ecdsaVerify(e,t,r){switch(h("signature",e,64),h("message",t,32),h("public key",r,[33,65]),g.ecdsaVerify(e,t,r)){case 0:return!0;case 3:return!1;case 1:throw new Error(s);case 2:throw new Error(o)}},ecdsaRecover(t,r,n,i=!0,o){switch(h("signature",t,64),f("Number"===m(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),h("message",n,32),b(i),o=p(o,i?33:65),g.ecdsaRecover(o,t,r,n)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(u);case 3:throw new Error(e)}},ecdh(e,t,r={},n){switch(h("public key",e,[33,65]),h("private key",t,32),f("Object"===m(r),"Expected options to be an Object"),void 0!==r.data&&h("options.data",r.data),void 0!==r.hashfn?(f("Function"===m(r.hashfn),"Expected options.hashfn to be a Function"),void 0!==r.xbuf&&h("options.xbuf",r.xbuf,32),void 0!==r.ybuf&&h("options.ybuf",r.ybuf,32),h("output",n)):n=p(n,32),g.ecdh(n,e,t,r.data,r.hashfn,r.xbuf,r.ybuf)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(d)}}}),yn}()(co())),Yi}function lo(){if(eo)return vn;eo=1;var e=vn&&vn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vn,"__esModule",{value:!0}),vn.PublicKey=void 0;const t=wr(),r=nn(),n=e(so()),i=ct();class o{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map((t=>{this[t]=e[t]}))}}class a extends o{enum;ed25519Key;secp256k1Key;constructor(e){const t=function(e){switch(e){case i.KeyType.ED25519:return"ed25519Key";case i.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?a.fromString(e):e}static fromString(e){const r=e.split(":");let n,o;if(1===r.length)n=r[0];else{if(2!==r.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");n=r[1],o=function(e){switch(e.toLowerCase()){case"ed25519":return i.KeyType.ED25519;case"secp256k1":return i.KeyType.SECP256K1;default:throw new Error(`Unknown key type ${e}`)}}(r[0])}const c=(0,t.baseDecode)(n);o||(o=c.length===i.KeySize.SECP256k1_PUBLIC_KEY?i.KeyType.SECP256K1:i.KeyType.ED25519);const s=o===i.KeyType.ED25519?i.KeySize.ED25519_PUBLIC_KEY:i.KeySize.SECP256k1_PUBLIC_KEY;if(c.length!==s)throw new Error(`Invalid public key size (${c.length}), must be ${s}`);return new a({keyType:o,data:c})}toString(){const e=(0,t.baseEncode)(this.data);return`${function(e){switch(e){case i.KeyType.ED25519:return"ed25519";case i.KeyType.SECP256K1:return"secp256k1";default:throw new Error(`Unknown key type ${e}`)}}(this.keyType)}:${e}`}verify(e,t){const o=this.keyType,a=this.data;switch(o){case i.KeyType.ED25519:return r.ed25519.verify(t,e,a);case i.KeyType.SECP256K1:return n.default.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...a]));default:throw new Error(`Unknown key type: ${o}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}return vn.PublicKey=a,vn}function uo(){if(to)return ht;to=1;var e=ht&&ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ht,"__esModule",{value:!0}),ht.KeyPairEd25519=void 0;const t=wr(),r=nn(),n=e(gn()),i=ct(),o=dt(),a=lo();class c extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const n=(0,t.baseDecode)(e),o=new Uint8Array(n.slice(0,i.KeySize.SECRET_KEY)),c=r.ed25519.getPublicKey(new Uint8Array(o));this.publicKey=new a.PublicKey({keyType:i.KeyType.ED25519,data:c}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,n.default)(i.KeySize.SECRET_KEY),o=r.ed25519.getPublicKey(new Uint8Array(e)),a=new Uint8Array([...e,...o]);return new c((0,t.baseEncode)(a))}sign(e){return{signature:r.ed25519.sign(e,(0,t.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return ht.KeyPairEd25519=c,ht}var fo,ho,bo,po,mo={};function go(){if(fo)return mo;fo=1;var e=mo&&mo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mo,"__esModule",{value:!0}),mo.KeyPairSecp256k1=void 0;const t=wr(),r=e(gn()),n=e(so()),i=ct(),o=dt(),a=lo();class c extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const r=(0,t.baseDecode)(e),o=new Uint8Array(r.slice(0,i.KeySize.SECRET_KEY)),c=n.default.publicKeyCreate(new Uint8Array(o),!1),s=c.subarray(1,c.length);this.publicKey=new a.PublicKey({keyType:i.KeyType.SECP256K1,data:s}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,r.default)(i.KeySize.SECRET_KEY),o=n.default.publicKeyCreate(new Uint8Array(e),!1),a=o.subarray(1,o.length),s=new Uint8Array([...e,...a]);return new c((0,t.baseEncode)(s))}sign(e){const{signature:r,recid:i}=n.default.ecdsaSign(e,(0,t.baseDecode)(this.secretKey));return{signature:new Uint8Array([...r,i]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return mo.KeyPairSecp256k1=c,mo}function yo(){return bo||(bo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.KeyPairSecp256k1=e.KeyPairEd25519=e.KeyPair=e.KeyType=void 0;var t=ct();Object.defineProperty(e,"KeyType",{enumerable:!0,get:function(){return t.KeyType}});var r=function(){if(ho)return lt;ho=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.KeyPair=void 0;const e=dt(),t=uo(),r=go();class n extends e.KeyPairBase{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return t.KeyPairEd25519.fromRandom();case"SECP256K1":return r.KeyPairSecp256k1.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const n=e.split(":");if(2!==n.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");switch(n[0].toUpperCase()){case"ED25519":return new t.KeyPairEd25519(n[1]);case"SECP256K1":return new r.KeyPairSecp256k1(n[1]);default:throw new Error(`Unknown curve: ${n[0]}`)}}}return lt.KeyPair=n,lt}();Object.defineProperty(e,"KeyPair",{enumerable:!0,get:function(){return r.KeyPair}});var n=uo();Object.defineProperty(e,"KeyPairEd25519",{enumerable:!0,get:function(){return n.KeyPairEd25519}});var i=go();Object.defineProperty(e,"KeyPairSecp256k1",{enumerable:!0,get:function(){return i.KeyPairSecp256k1}});var o=lo();Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return o.PublicKey}})}(ot)),ot}function wo(){return po||(po=1,function(e){var t=Fe&&Fe.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=Fe&&Fe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Fe&&Fe.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=Fe&&Fe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.authPayloadSchema=e.AuthPayload=void 0,e.verifySignature=function(t,r){const n=new l(t),i=o.serialize(e.authPayloadSchema,n),c=Uint8Array.from(a.default.sha256.array(i));let u=new Uint8Array(Buffer.from(r.signature,"base64"));return s.PublicKey.from(r.publicKey).verify(c,u)};const o=n(function(){if(Qe)return De;Qe=1;var e=De&&De.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=De&&De.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=De&&De.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var i in r)"default"!==i&&Object.prototype.hasOwnProperty.call(r,i)&&e(n,r,i);return t(n,r),n};De.__esModule=!0,De.deserialize=De.serialize=void 0;var n=function(){if(Ge)return He;Ge=1;var e=He&&He.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=He&&He.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=He&&He.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var i in r)"default"!==i&&Object.prototype.hasOwnProperty.call(r,i)&&e(n,r,i);return t(n,r),n};He.__esModule=!0,He.BorshSerializer=void 0;var n=qe(),i=Ze(),o=r(Je()),a=function(){function e(e){this.encoded=new i.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(n.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&o.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&o.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&o.expect_type(e,"string",this.fieldPath);for(var t=e,r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?r.push(i):i<2048?r.push(192|i>>6,128|63&i):i<55296||i>=57344?r.push(224|i>>12,128|i>>6&63,128|63&i):(n++,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}this.encoded.store_value(r.length,"u32"),this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_boolean=function(e){this.checkTypes&&o.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&o.expect_enum(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw new Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(o.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw new Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?o.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?o.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var a=i[n];this.encode_value(a,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,a=n;i<a.length;i++){var c=a[i];this.encode_value(c,t.map.key),this.encode_value(r?e.get(c):e[c],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();return He.BorshSerializer=a,He}(),i=function(){if(Ye)return et;Ye=1,et.__esModule=!0,et.BorshDeserializer=void 0;var e=qe(),t=Ze(),r=function(){function r(e){this.buffer=new t.DecodeBuffer(e)}return r.prototype.decode=function(e){return this.decode_value(e)},r.prototype.decode_value=function(t){if("string"==typeof t){if(e.integers.includes(t))return this.decode_integer(t);if("string"===t)return this.decode_string();if("bool"===t)return this.decode_boolean()}if("object"==typeof t){if("option"in t)return this.decode_option(t);if("enum"in t)return this.decode_enum(t);if("array"in t)return this.decode_array(t);if("set"in t)return this.decode_set(t);if("map"in t)return this.decode_map(t);if("struct"in t)return this.decode_struct(t)}throw new Error("Unsupported type: ".concat(t))},r.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},r.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight((function(e,t){return e+t.toString(16).padStart(2,"0")}),"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},r.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e)),r=[],n=0;n<e;++n){var i=t[n];if(i<128)r.push(i);else if(i<224)r.push((31&i)<<6|63&t[++n]);else if(i<240)r.push((15&i)<<12|(63&t[++n])<<6|63&t[++n]);else{var o=(7&i)<<18|(63&t[++n])<<12|(63&t[++n])<<6|63&t[++n];r.push(o)}}return String.fromCodePoint.apply(String,r)},r.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},r.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw new Error("Invalid option ".concat(t));return null},r.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw new Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},r.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},r.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},r.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},r.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},r}();return et.BorshDeserializer=r,et}(),o=r(Je());return De.serialize=function(e,t,r){return void 0===r&&(r=!0),r&&o.validate_schema(e),new n.BorshSerializer(r).encode(t,e)},De.deserialize=function(e,t,r){return void 0===r&&(r=!0),r&&o.validate_schema(e),new i.BorshDeserializer(t).decode(e)},De}()),a=i((tt||(tt=1,c=rt,function(){var e="input is invalid type",t="object"==typeof window,r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var n=!t&&"object"==typeof self,i=!r.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&"renderer"!=process.type;i?r=Pe:n&&(r=self);var o=!r.JS_SHA256_NO_COMMON_JS&&c.exports,a=!r.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),l=[-2147483648,8388608,32768,128],u=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],h=[];!r.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var b=function(e,t){return function(r){return new w(t,!0).update(r)[e]()}},p=function(e){var t=b("hex",e);i&&(t=m(t,e)),t.create=function(){return new w(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=b(n,e)}return t},m=function(t,n){var i,o=nt,a=nt.Buffer,c=n?"sha224":"sha256";return i=a.from&&!r.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(r){if("string"==typeof r)return o.createHash(c).update(r,"utf8").digest("hex");if(null==r)throw new Error(e);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===a?o.createHash(c).update(i(r)).digest("hex"):t(r)}},g=function(e,t){return function(r,n){return new v(r,t,!0).update(n)[e]()}},y=function(e){var t=g("hex",e);t.create=function(t){return new v(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=g(n,e)}return t};function w(e,t){t?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function v(t,r,n){var i,o=typeof t;if("string"===o){var c,s=[],l=t.length,u=0;for(i=0;i<l;++i)(c=t.charCodeAt(i))<128?s[u++]=c:c<2048?(s[u++]=192|c>>>6,s[u++]=128|63&c):c<55296||c>=57344?(s[u++]=224|c>>>12,s[u++]=128|c>>>6&63,s[u++]=128|63&c):(c=65536+((1023&c)<<10|1023&t.charCodeAt(++i)),s[u++]=240|c>>>18,s[u++]=128|c>>>12&63,s[u++]=128|c>>>6&63,s[u++]=128|63&c);t=s}else{if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e)}t.length>64&&(t=new w(r,!0).update(t).array());var d=[],f=[];for(i=0;i<64;++i){var h=t[i]||0;d[i]=92^h,f[i]=54^h}w.call(this,r,n),this.update(f),this.oKeyPad=d,this.inner=!0,this.sharedMemory=n}w.prototype.update=function(t){if(!this.finalized){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,o,c=0,s=t.length,l=this.blocks;c<s;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,this.block=l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),r)for(o=this.start;c<s&&o<64;++c)l[o>>>2]|=t[c]<<u[3&o++];else for(o=this.start;c<s&&o<64;++c)(i=t.charCodeAt(c))<128?l[o>>>2]|=i<<u[3&o++]:i<2048?(l[o>>>2]|=(192|i>>>6)<<u[3&o++],l[o>>>2]|=(128|63&i)<<u[3&o++]):i<55296||i>=57344?(l[o>>>2]|=(224|i>>>12)<<u[3&o++],l[o>>>2]|=(128|i>>>6&63)<<u[3&o++],l[o>>>2]|=(128|63&i)<<u[3&o++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++c)),l[o>>>2]|=(240|i>>>18)<<u[3&o++],l[o>>>2]|=(128|i>>>12&63)<<u[3&o++],l[o>>>2]|=(128|i>>>6&63)<<u[3&o++],l[o>>>2]|=(128|63&i)<<u[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=l[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=l[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var e,t,r,n,i,o,a,c,s,l=this.h0,u=this.h1,f=this.h2,h=this.h3,b=this.h4,p=this.h5,m=this.h6,g=this.h7,y=this.blocks;for(e=16;e<64;++e)t=((i=y[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=y[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,y[e]=y[e-16]+t+y[e-7]+r|0;for(s=u&f,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,g=(i=y[0]-1413257819)-150054599|0,h=i+24177077|0):(o=704751109,g=(i=y[0]-210244248)-1521486534|0,h=i+143694565|0),this.first=!1):(t=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(o=l&u)^l&f^s,g=h+(i=g+(r=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&p^~b&m)+d[e]+y[e])|0,h=i+(t+n)|0),t=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(a=h&l)^h&u^o,m=f+(i=m+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&b^~g&p)+d[e+1]+y[e+1])|0,t=((f=i+(t+n)|0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(c=f&h)^f&l^a,p=u+(i=p+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&b)+d[e+2]+y[e+2])|0,t=((u=i+(t+n)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(s=u&f)^u&h^c,b=l+(i=b+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&g)+d[e+3]+y[e+3])|0,l=i+(t+n)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+l|0,this.h1=this.h1+u|0,this.h2=this.h2+f|0,this.h3=this.h3+h|0,this.h4=this.h4+b|0,this.h5=this.h5+p|0,this.h6=this.h6+m|0,this.h7=this.h7+g|0},w.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,c=this.h7,l=s[e>>>28&15]+s[e>>>24&15]+s[e>>>20&15]+s[e>>>16&15]+s[e>>>12&15]+s[e>>>8&15]+s[e>>>4&15]+s[15&e]+s[t>>>28&15]+s[t>>>24&15]+s[t>>>20&15]+s[t>>>16&15]+s[t>>>12&15]+s[t>>>8&15]+s[t>>>4&15]+s[15&t]+s[r>>>28&15]+s[r>>>24&15]+s[r>>>20&15]+s[r>>>16&15]+s[r>>>12&15]+s[r>>>8&15]+s[r>>>4&15]+s[15&r]+s[n>>>28&15]+s[n>>>24&15]+s[n>>>20&15]+s[n>>>16&15]+s[n>>>12&15]+s[n>>>8&15]+s[n>>>4&15]+s[15&n]+s[i>>>28&15]+s[i>>>24&15]+s[i>>>20&15]+s[i>>>16&15]+s[i>>>12&15]+s[i>>>8&15]+s[i>>>4&15]+s[15&i]+s[o>>>28&15]+s[o>>>24&15]+s[o>>>20&15]+s[o>>>16&15]+s[o>>>12&15]+s[o>>>8&15]+s[o>>>4&15]+s[15&o]+s[a>>>28&15]+s[a>>>24&15]+s[a>>>20&15]+s[a>>>16&15]+s[a>>>12&15]+s[a>>>8&15]+s[a>>>4&15]+s[15&a];return this.is224||(l+=s[c>>>28&15]+s[c>>>24&15]+s[c>>>20&15]+s[c>>>16&15]+s[c>>>12&15]+s[c>>>8&15]+s[c>>>4&15]+s[15&c]),l},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,c=this.h7,s=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,a>>>24&255,a>>>16&255,a>>>8&255,255&a];return this.is224||s.push(c>>>24&255,c>>>16&255,c>>>8&255,255&c),s},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},v.prototype=new w,v.prototype.finalize=function(){if(w.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();w.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),w.prototype.finalize.call(this)}};var x=p();x.sha256=x,x.sha224=p(!0),x.sha256.hmac=y(),x.sha224.hmac=y(!0),o?c.exports=x:(r.sha256=x.sha256,r.sha224=x.sha224)}()),rt.exports));var c;const s=yo();class l{message;recipient;nonce;callbackUrl;tag;constructor({message:e,nonce:t,recipient:r}){this.tag=2147484061,this.message=e,this.nonce=t,this.recipient=r}}e.AuthPayload=l,e.authPayloadSchema={struct:{tag:"u32",message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}}}(Fe)),Fe}var vo={};const xo=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Eo(e){return xo.test(e)}function Co(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.split(/[:\/]/g).pop().toLowerCase()}Co.valid=Eo;var _o,Mo,Ao,So,ko,Io,Bo,No=Ue(Object.freeze({__proto__:null,default:Co,uuid4:Co,valid:Eo})),Lo={},To={exports:{}},Oo={exports:{}};function Ro(){return _o||(_o=1,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&t.rotl(e,8)|4278255360&t.rotl(e,24);for(var r=0;r<e.length;r++)e[r]=t.endian(e[r]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],o=0;o<4;o++)8*n+6*o<=8*t.length?r.push(e.charAt(i>>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(n))>>>6-2*i);return r}},Oo.exports=t),Oo.exports;var e,t}function Po(){if(Ao)return Mo;Ao=1;var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};return Mo=e}function Uo(){return So||(So=1,function(){var e=Ro(),t=Po().utf8,r=Po().bin,n=function(n,i){var o=e.wordsToBytes(function(r){r.constructor==String?r=t.stringToBytes(r):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(r)?r=Array.prototype.slice.call(r,0):Array.isArray(r)||(r=r.toString());var n=e.bytesToWords(r),i=8*r.length,o=[],a=1732584193,c=-271733879,s=-1732584194,l=271733878,u=-1009589776;n[i>>5]|=128<<24-i%32,n[15+(i+64>>>9<<4)]=i;for(var d=0;d<n.length;d+=16){for(var f=a,h=c,b=s,p=l,m=u,g=0;g<80;g++){if(g<16)o[g]=n[d+g];else{var y=o[g-3]^o[g-8]^o[g-14]^o[g-16];o[g]=y<<1|y>>>31}var w=(a<<5|a>>>27)+u+(o[g]>>>0)+(g<20?1518500249+(c&s|~c&l):g<40?1859775393+(c^s^l):g<60?(c&s|c&l|s&l)-1894007588:(c^s^l)-899497514);u=l,l=s,s=c<<30|c>>>2,c=a,a=w}a+=f,c+=h,s+=b,l+=p,u+=m}return[a,c,s,l,u]}(n));return i&&i.asBytes?o:i&&i.asString?r.bytesToString(o):e.bytesToHex(o)};n._blocksize=16,n._digestsize=20,To.exports=n}()),To.exports}function zo(){return Io||(Io=1,function(e){var t=vo&&vo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getExtension=e.RequestFailed=e.wait=void 0;const r=t(No),n=wr(),i=(ko||(ko=1,function(e){var t=Lo&&Lo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createRequest=e.computeRequestId=e.deleteRequest=e.getResponse=e.proxyApi=void 0;const r=t(Uo()),n=t(No),i=wr();e.proxyApi="https://h4n.app",e.getResponse=async t=>{const r=await fetch(`${e.proxyApi}/${t}/response`,{headers:{"content-type":"application/json"},method:"GET"});if(!1===r.ok)throw Error(await r.text());const{data:n}=await r.json();return JSON.parse(n)},e.deleteRequest=async t=>{const r=await fetch(`${e.proxyApi}/${t}`,{headers:{"content-type":"application/json"},method:"DELETE"});if(!1===r.ok)throw Error(await r.text())},e.computeRequestId=async e=>{const t=(0,i.baseEncode)(JSON.stringify({...e,_id:(0,n.default)()})),o=(0,r.default)(t);return{requestId:Buffer.from(o,"hex").toString("base64").replaceAll("/","_").replaceAll("-","+").slice(0,13),query:t}},e.createRequest=async(t,r)=>{const{query:n,requestId:i}=await(0,e.computeRequestId)(t),o=await fetch(`${e.proxyApi}/${i}/request`,{body:JSON.stringify({data:n}),headers:{"content-type":"application/json"},method:"POST",signal:r});if(!1===o.ok)throw Error(await o.text());return i}}(Lo)),Lo);e.wait=e=>new Promise((t=>setTimeout(t,e)));class o extends Error{payload;name="RequestFailed";constructor(e){super(),this.payload=e}}e.RequestFailed=o;let a;e.getExtension=()=>"undefined"==typeof window?null:window.hotExtension,"undefined"!=typeof window&&window.addEventListener("message",(e=>{"hot-close"===e.data&&(a?.remove(),a=void 0)}));e.default=new class{walletId="https://t.me/herewalletbot/app";ancestorOrigins=["http://localhost:1234","https://my.herewallet.app","https://tgapp-dev.herewallet.app","https://tgapp.herewallet.app","https://beta.herewallet.app"];connection=new Promise((e=>"undefined"==typeof window||window?.self===window?.top?e(null):void this.injectedRequest("initialized",{}).then(e).catch((()=>e(null)))));get isInjected(){return"undefined"!=typeof window&&(null!=window.hotExtension?window.hotExtension.autoRun:this.ancestorOrigins.includes(window.location.ancestorOrigins?.[0]))}openInHotBrowserUrl=null;toggleOpenInHotBrowser(e){this.openInHotBrowserUrl=e}customProvider;setupEthProvider(e){this.customProvider=e}async injectedRequest(e,t){const n=(0,r.default)();return new Promise(((r,i)=>{const o=e=>{if(e.data.id===n)return window?.removeEventListener("message",o),e.data.success?r(e.data.payload):i(e.data.payload)};window?.parent.postMessage({$hot:!0,method:e,request:t,id:n},"*"),window?.addEventListener("message",o)}))}subscribe(e,t){return window.hotExtension?window.hotExtension.subscribe(e,t):()=>{}}async request(t,c){if(null!=window.hotExtension)return window.hotExtension.request(t,c);if(this.isInjected)return this.injectedRequest(t,c);const s=(0,r.default)(),l=window?.Telegram?.WebApp,u=await(0,i.createRequest)({inside:!!this.openInHotBrowserUrl||"ethereum"===t&&null==this.customProvider,origin:"string"==typeof this.openInHotBrowserUrl?this.openInHotBrowserUrl:location.href,$hot:!0,method:t,request:c,id:s}),d=`${this.walletId}?startapp=hotconnect-${(0,n.baseEncode)(u)}`;if(l)l?.openTelegramLink(d);else{(e=>{a?.remove(),a=document.createElement("div");const t=document.createElement("iframe");a?.appendChild(t),t.src=e,t.allow="usb",t.style.border="none",t.style.borderRadius="16px",t.style.background="#fff",t.style.overflow="hidden",t.style.background="#1D1F20",t.style.border="1px solid #2C3034",t.style.width="375px",t.style.height="560px",t.onclick=e=>e.stopPropagation(),a.style.padding="16px",a.style.zIndex="100000000000000",a.style.position="fixed",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",a.style.top="0",a.style.left="0",a.style.width="100%",a.style.height="100%",a.style.background="rgba(0, 0, 0, 0.1)",a.style.backdropFilter="blur(24px)",a.onclick=()=>{a?.remove(),a=void 0},document.body.appendChild(a)})(`${"https://hot-labs.org/hot-widget/index.html"}?hotconnect-${(0,n.baseEncode)(u)}`)}const f=async()=>{await(0,e.wait)(3e3);const t=await(0,i.getResponse)(u).catch((()=>null));if(null==t)return await f();if(t.success)return t.payload;throw new o(t.payload)},h=await f();return a?.remove(),h}}}(vo)),vo}var jo=(Bo||(Bo=1,function(e){var t=je&&je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.RequestFailed=e.HOT=e.authPayloadSchema=e.AuthPayload=e.verifySignature=void 0;var r=wo();Object.defineProperty(e,"verifySignature",{enumerable:!0,get:function(){return r.verifySignature}}),Object.defineProperty(e,"AuthPayload",{enumerable:!0,get:function(){return r.AuthPayload}}),Object.defineProperty(e,"authPayloadSchema",{enumerable:!0,get:function(){return r.authPayloadSchema}});var n=zo();Object.defineProperty(e,"HOT",{enumerable:!0,get:function(){return t(n).default}}),Object.defineProperty(e,"RequestFailed",{enumerable:!0,get:function(){return n.RequestFailed}})}(je)),je);const Fo={name:H.Hot,website:"https://hot-labs.org/",isAvailable:()=>"undefined"!=typeof window&&!!window.hotExtension,connect:async()=>{try{return{publicKey:(await jo.HOT.request("stellar:getAddress",{})).address}}catch{throw new Error("Failed to connect to Hana wallet.")}},signTransaction:async(e,t={})=>{try{return(await jo.HOT.request("stellar:signTransaction",{xdr:e,accountToSign:t.address})).signedTxXdr}catch{throw new Error("Failed to sign the transaction with Hana wallet.")}},getNetwork:async()=>{throw new Error("Failed to get network from HOT")}},Do={name:H.Hana,website:"https://www.hanawallet.io/",isAvailable:()=>{var e;return"undefined"!=typeof window&&!!(null===(e=window.hanaWallet)||void 0===e?void 0:e.stellar)},connect:async()=>{try{if(!await window.hanaWallet.stellar.getPublicKey())throw new Error("Hana Wallet is not installed or connected.");return{publicKey:await window.hanaWallet.stellar.getPublicKey()}}catch(e){throw new Error("Failed to connect to Hana wallet.")}},signTransaction:async(e,t={})=>{var r,n;try{const i=null===(n=null===(r=null===window||void 0===window?void 0:window.hanaWallet)||void 0===r?void 0:r.stellar)||void 0===n?void 0:n.signTransaction;if("function"!=typeof i)throw new Error("Hana Wallet does not support signing transactions.");return await i({xdr:e,address:t.address,networkPassphrase:t.networkPassphrase})}catch(e){throw new Error("Failed to sign the transaction with Hana wallet.")}},getNetwork:async()=>{var e;try{if(!(null===(e=window.hanaWallet)||void 0===e?void 0:e.stellar))throw new Error("Hana Wallet is not installed.");const t=await window.hanaWallet.stellar.getNetworkDetails();return{network:t.network,passphrase:t.networkPassphrase}}catch{throw new Error("Error getting network from Rabet:")}}},Ho={name:H.Rabet,website:"https://rabet.io",isAvailable:()=>new Promise((e=>{setTimeout((()=>e("undefined"!=typeof window&&!!window.rabet)),250)})),connect:async()=>{try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");return{publicKey:(await window.rabet.connect()).publicKey}}catch(e){throw new Error("Failed to connect to Rabet.")}},signTransaction:async(e,t={})=>{try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");return(await window.rabet.sign(e,t.networkPassphrase===K.PUBLIC?"mainnet":"testnet")).xdr}catch(e){throw new Error("Failed to sign the transaction with Rabet.")}},disconnect:async()=>{try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");window.rabet.disconnect()}catch(e){throw new Error("Failed to disconnect from Rabet.")}},getNetwork:async()=>{try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");return await window.rabet.getNetwork()}catch(e){throw new Error("Error getting network from Rabet:")}}},Ko={name:H.Xbull,website:"https://xbull.app",isAvailable:()=>new Promise((e=>{setTimeout((()=>{e("undefined"!=typeof window&&!!window.xBullSDK)}),250)})),connect:async()=>{try{if(!window.xBullSDK)throw new Error("xBull Wallet is not installed.");await window.xBullSDK.connect({canRequestPublicKey:!0,canRequestSign:!0});return{publicKey:await window.xBullSDK.getPublicKey()}}catch{throw new Error("Failed to connect to xBull.")}},signTransaction:async(e,t={})=>{try{if(!window.xBullSDK)throw new Error("xBull Wallet is not installed.");return await window.xBullSDK.signXDR(e,{network:t.networkPassphrase,publicKey:t.address})}catch{throw new Error("Failed to sign the transaction with xBull.")}},getNetwork:async()=>{try{if(!window.xBullSDK)throw new Error("xBull Wallet is not installed.");const e=await window.xBullSDK.getNetwork();return{network:e.network,passphrase:e.networkPassphrase}}catch{throw new Error("Error getting network from Rabet:")}}},qo={name:H.Lobstr,website:"https://lobstr.co",isAvailable:async()=>await m.isConnected(),connect:async()=>{try{if(!await m.isConnected())throw new Error("LOBSTR Wallet is not installed or connected.");return{publicKey:await m.getPublicKey()}}catch{throw new Error("Failed to connect to LOBSTR.")}},signTransaction:async e=>{try{if(!m.signTransaction)throw new Error("LOBSTR Wallet does not support signing transactions.");return await m.signTransaction(e)}catch{throw new Error("Failed to sign the transaction with LOBSTR.")}},getNetwork:async()=>{throw new Error("Failed to get network from LOBSTR")}},Vo=e=>{const t=Object.entries(K).find((([,t])=>t===e));if(!t)throw new Error(`Unknown network passphrase: ${e}`);return t[0].toLowerCase()},Wo={name:H.Albedo,website:"https://albedo.link",isAvailable:()=>!0,connect:async()=>{try{return{publicKey:(await g.publicKey({token:"Connect to Albedo"})).pubkey}}catch(e){throw new Error("Failed to connect to Albedo.")}},signTransaction:async(e,t={})=>{try{const{address:r,submit:n}=t;return(await g.tx({xdr:e,pubkey:r,network:(null==t?void 0:t.networkPassphrase)&&Vo(null==t?void 0:t.networkPassphrase),submit:n})).signed_envelope_xdr}catch(e){throw new Error("Failed to sign the transaction with Albedo.")}},getNetwork:async()=>{throw new Error("Failed to get network from albedo")}},Zo={name:H.Freighter,website:"https://freighter.app",isAvailable:()=>new Promise((e=>{const t=setTimeout((()=>{e(!1)}),1500);setTimeout((()=>{y.isConnected().then((({isConnected:r,error:n})=>{clearTimeout(t),e(!n&&r)})).catch((()=>{clearTimeout(t),e(!1)}))}),500)})),connect:async()=>{try{if(!await y.isConnected())throw new Error("Freighter Wallet is not installed or connected.");const e=await y.requestAccess();if(e.error&&"The user rejected this request."===e.error.message)throw new Error("Failed to connect to Freighter");if(""===e.address.trim())throw new Error("Failed to connect to Freighter.");return{publicKey:e.address}}catch(e){if("Failed to connect to Freighter."===e.message){return await Zo.connect()}throw new Error("Failed to connect to Freighter.")}},signTransaction:async(e,t={})=>{try{if(!await y.isConnected())throw new Error("Freighter Wallet is not installed or connected.");return(await w(e,{address:null==t?void 0:t.address,networkPassphrase:null==t?void 0:t.networkPassphrase})).signedTxXdr}catch(e){throw new Error("Failed to sign the transaction with Freighter.")}},getNetwork:async()=>{try{if(!await y.isConnected())throw new Error("Freighter Wallet is not installed or connected.");const e=await y.getNetwork();if(e.error)throw new Error("Failed to get network from Freighter");return{network:e.network,passphrase:e.networkPassphrase}}catch(e){throw new Error("Failed to disconnect from Rabet.")}}},$o={[H.Rabet]:Ho,[H.Freighter]:Zo,[H.Hana]:Do,[H.Lobstr]:qo,[H.Albedo]:Wo,[H.Xbull]:Ko,[H.Hot]:Fo},Go=p(null),Xo=()=>{const e=Yo(),t=ra();return d((()=>{e.setValue((e=>({...e,account:t}))),t.account}),[t]),l.createElement(l.Fragment,null)},Jo=({config:e,isDemo:t,children:i})=>{var o;if(0===e.networks.length)throw new Error("no network is set in config.networks");if(!e.networks.includes(e.defaultNetwork))throw new Error("default network is not listed in networks");for(const t of e.networks)if(!Y[t]){if(!e.transports)throw new Error("Must set transports for custom networks");if(!e.transports[t])throw new Error("Must set transports for custom networks")}const{horizon:a,soroban:c}=Q(e.defaultNetwork,null!==(o=e.transports)&&void 0!==o?o:{}),[s,f]=u(q.ONBOARDING),[h,b]=u({config:{...e,explorer:e.explorer||"stellarchain",appearance:{...Oe,...e.appearance},showWalletUIs:!1!==e.showWalletUIs},activeNetwork:e.defaultNetwork,account:null,isDemo:null!=t&&t,user:{wallet:null,phoneNumber:null,email:null},isModalOpen:!1,isReady:!1,isAuthenticated:!1,waitingStatus:"connecting",signTransaction:{xdr:"",options:{network:"",isSoroban:!1},result:null,rejecter:null,resolver:null},availableWallets:[],showAllWallets:!1,servers:{horizon:new r.Server(a.url),soroban:new n.Server(c.url)}});((e,t,r)=>{const[n,i]=u(!1);d((()=>{const t=setInterval((()=>{e.isAuthenticated&&e.user.wallet&&xe($o[e.user.wallet.name]).then((t=>{t&&!e.config.networks.includes(t)?i(!0):i(!1)}))}),500);return()=>{clearInterval(t),i(!1)}}),[e.isAuthenticated,e.config.networks,e.user.wallet]),d((()=>{n?(r(q.WRONG_NETWORK),t((e=>({...e,isModalOpen:!0})))):t((e=>({...e,isModalOpen:!1})))}),[n])})(h,b,f),d((()=>{b((t=>({...t,config:{...t.config,appearance:{...Oe,...e.appearance},loginMethods:e.loginMethods||[]}})))}),[e]),d((()=>{var e;const{horizon:t,soroban:i}=Q(h.activeNetwork,null!==(e=h.config.transports)&&void 0!==e?e:{});b((e=>({...e,servers:{horizon:new r.Server(t.url),soroban:new n.Server(i.url)}})))}),[h.config.transports,h.config.networks,h.activeNetwork]);const p=()=>{(()=>{const e=t=>{"https://mobile.rabet.io"===t.origin&&"RABET/INSTALL"===t.data.type&&(new Function(t.data.message)(),window.removeEventListener("message",e))};window.addEventListener("message",e)})(),setTimeout((()=>{(async()=>Promise.all(Object.values($o).map((async e=>{try{const t=await e.isAvailable();return{wallet:e,isAvailable:t}}catch(t){return{wallet:e,isAvailable:!1}}}))))().then((e=>{const t=(e=>{const t=_e(),r=new Map(e.map((e=>[e.wallet.name,e]))),n=[],i=new Set;for(const e of t){const t=r.get(e);t&&(n.push(t),i.add(e))}const o=e.filter((e=>!i.has(e.wallet.name)));return[...n,...o].map(((e,t)=>({...e,isRecent:0===t})))})(e.filter((e=>e.isAvailable)));b((e=>({...e,isReady:!0,availableWallets:t})))}))}),150)};d((()=>("complete"===document.readyState?p():window.addEventListener("load",p),()=>{window.removeEventListener("load",p)})),[h.isAuthenticated]);return l.createElement(Go.Provider,{value:{value:h,setValue:b,route:s,setRoute:f}},l.createElement(Xo,null),i,l.createElement(Te,{isOpen:h.isModalOpen,closeModal:()=>{b((e=>({...e,isModalOpen:!1,showAllWallets:!1})))}}))},Yo=()=>{const e=b(Go);if(!e)throw new Error("useProvider must be used within a ProviderContext.");return e},Qo=()=>{const e=Yo();if(!e)throw new Error("Blux hooks must be used within a BluxProvider context.");return e},ea=(e,t)=>{var i;if(!t)return{soroban:e.servers.soroban,horizon:e.servers.horizon,networkPassphrase:e.activeNetwork};const{horizon:o,soroban:a}=Q(t,null!==(i=e.config.transports)&&void 0!==i?i:{});return{networkPassphrase:t,soroban:new n.Server(a.url),horizon:new r.Server(o.url)}},ta=e=>{const{value:t}=Qo(),[r,n]=u(ea(t,e));return d((()=>{n(ea(t,e||t.activeNetwork))}),[e,t.activeNetwork]),r},ra=e=>{const{value:t}=Qo(),{horizon:r,networkPassphrase:n}=ta(null==e?void 0:e.network),[i,o]=u({error:null,loading:!0,account:null});return d((()=>{var n;o({error:null,account:null,loading:!0});const i=null===(n=t.user.wallet)||void 0===n?void 0:n.address;if(!i&&!(null==e?void 0:e.address))return void o({account:null,loading:!1,error:new Error("Both user.wallet.address and address parameter are undefined")});const a=(null==e?void 0:e.address)?e.address:i;(async(e,t)=>{try{return await e.loadAccount(t)}catch{return null}})(r,a).then((e=>{o({error:null,loading:!1,account:e})})).catch((e=>{o({error:e,loading:!1,account:null})}))}),[null==e?void 0:e.address,n,t.user.wallet]),i},na=({asset:e,address:t,network:r})=>{const{value:n}=Qo(),{horizon:i,networkPassphrase:o}=ta(r),[a,c]=u({error:null,loading:!0,balance:"0"});return d((()=>{var r;c({error:null,loading:!0,balance:"0"});const o=null===(r=n.user.wallet)||void 0===r?void 0:r.address;if(!o&&!t)return void c({loading:!1,balance:"0",error:new Error("Both user.wallet.address and address parameter are undefined")});const a=t||o;i.loadAccount(a).then((t=>{if("native"===e){const e=t.balances.find((e=>"native"===e.asset_type));c({error:null,loading:!1,balance:(null==e?void 0:e.balance)||"0"})}else if("string"==typeof e){const r=e.split(":"),n=t.balances.find((e=>e.asset_code===r[0]&&e.asset_issuer===r[1]));c({error:null,loading:!1,balance:(null==n?void 0:n.balance)||"0"})}})).catch((e=>{c({error:e,loading:!1,balance:"0"})}))}),[t,e,n.user.wallet,o]),a},ia=()=>{const e=Yo();if(!e)throw new Error("useBlux must be used within a ProviderContext.");const{value:t}=e,[r,n]=u(t.activeNetwork);return d((()=>{n(t.activeNetwork)}),[t.activeNetwork]),r},oa=e=>{const{value:t}=Qo(),{horizon:r,networkPassphrase:n}=ta(null==e?void 0:e.network),[i,o]=u({error:null,loading:!0,transactions:[]});return d((()=>{var n;o({error:null,loading:!0,transactions:[]});const i=null===(n=t.user.wallet)||void 0===n?void 0:n.address;if(!i&&!(null==e?void 0:e.address))return void o({loading:!1,transactions:[],error:new Error("Both user.wallet.address and address parameter are undefined")});const a=(null==e?void 0:e.address)?null==e?void 0:e.address:i;r.transactions().forAccount(a).limit((null==e?void 0:e.limit)||5).order("desc").call().then((t=>{if(null==e?void 0:e.includeOperations){const e=[];for(const r of t.records)e.push(r.operations());Promise.all(e).then((e=>{const r=t.records.map(((t,r)=>({...t,operations:e[r].records})));o({error:null,loading:!1,transactions:r})}))}else o({error:null,loading:!1,transactions:t.records})})).catch((e=>{o({error:e,loading:!1,transactions:[]})}))}),[null==e?void 0:e.address,n,t.user.wallet]),i},aa=()=>{const e=Yo();if(!e)throw new Error("useBlux must be used within a ProviderContext.");const{value:t,setValue:r}=e;return{switchNetwork:e=>{if(!t.config.networks.includes(e))throw new Error("New network must be defined in config.networks");r({...t,activeNetwork:e})},networks:t.config.networks}};export{Jo as BluxProvider,Re as defaultDarkTheme,Oe as defaultLightTheme,v as networks,J as url,ra as useAccount,na as useBalance,ne as useBlux,ia as useNetwork,aa as useSwitchNetwork,oa as useTransactions};
|
|
1
|
+
import{Networks as e,Transaction as t,Horizon as r,rpc as n,TransactionBuilder as i,Operation as o,Asset as a,Memo as c,StrKey as s}from"@stellar/stellar-sdk";import l,{useState as u,useEffect as d,useRef as f,useMemo as h,useContext as p,createContext as b}from"react";import m from"@lobstrco/signer-extension-api";import g from"@albedo-link/intent";import y,{signTransaction as w}from"@stellar/freighter-api";!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--bluxcc-color-gray-600:#666;--bluxcc-color-gray-700:#4d4d4d;--bluxcc-color-gray-800:#333;--bluxcc-color-black:#000;--bluxcc-spacing:0.25rem;--bluxcc-text-xs:0.75rem;--bluxcc-text-xs--line-height:1.33333;--bluxcc-text-sm:0.875rem;--bluxcc-text-sm--line-height:1.42857;--bluxcc-text-base:1rem;--bluxcc-text-base--line-height:1.5;--bluxcc-text-lg:1.125rem;--bluxcc-text-lg--line-height:1.55556;--bluxcc-text-xl:1.25rem;--bluxcc-text-xl--line-height:1.4;--bluxcc-font-weight-normal:400;--bluxcc-font-weight-medium:500;--bluxcc-font-weight-semibold:600;--bluxcc-animate-spin:spin 1s linear infinite;--bluxcc-default-transition-duration:150ms;--bluxcc-default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--bluxcc-color-alert-error:#ec2929}}@layer utilities{.bluxcc\\:absolute{position:absolute!important}.bluxcc\\:fixed{position:fixed!important}.bluxcc\\:relative{position:relative!important}.bluxcc\\:inset-0{inset:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:right-0{right:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-0{bottom:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-4{bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:left-0{left:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:left-1\\/2{left:50%!important}.bluxcc\\:z-10{z-index:10!important}.bluxcc\\:z-20{z-index:20!important}.bluxcc\\:z-40{z-index:40!important}.bluxcc\\:z-9999{z-index:9999!important}.bluxcc\\:mx-3{margin-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:\\!my-2{margin-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:my-1{margin-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:my-4{margin-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:my-6{margin-block:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:\\!mt-4{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:\\!mt-6{margin-top:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mt-0\\.5{margin-top:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mt-1{margin-top:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mt-2{margin-top:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mt-4{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-6,.bluxcc\\:mt-6\\!{margin-top:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mt-\\[16px\\]{margin-top:16px!important}.bluxcc\\:\\!mr-2{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mr-1{margin-right:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mr-2{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:\\!mb-4{margin-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mb-1{margin-bottom:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mb-4{margin-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mb-6{margin-bottom:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:ml-2{margin-left:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:ml-4{margin-left:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:ml-auto{margin-left:auto!important}.bluxcc\\:box-border{box-sizing:border-box!important}.bluxcc\\:flex{display:flex!important}.bluxcc\\:inline-flex{display:inline-flex!important}.bluxcc\\:size-5{height:calc(var(--bluxcc-spacing)*5)!important;width:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:size-8{height:calc(var(--bluxcc-spacing)*8)!important;width:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:size-10{height:calc(var(--bluxcc-spacing)*10)!important;width:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:size-20{height:calc(var(--bluxcc-spacing)*20)!important;width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:size-\\[68px\\]{height:68px!important;width:68px!important}.bluxcc\\:size-\\[73px\\]{height:73px!important;width:73px!important}.bluxcc\\:\\!h-14{height:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:h-4{height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:h-8{height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:h-10{height:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:h-12{height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:h-14{height:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:h-20{height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:h-\\[52px\\]{height:52px!important}.bluxcc\\:h-\\[60px\\]{height:60px!important}.bluxcc\\:h-\\[335px\\]{height:335px!important}.bluxcc\\:h-\\[348px\\]{height:348px!important}.bluxcc\\:h-full{height:100%!important}.bluxcc\\:max-h-\\[80px\\]{max-height:80px!important}.bluxcc\\:max-h-\\[90vh\\]{max-height:90vh!important}.bluxcc\\:\\!w-\\[360px\\]{width:360px!important}.bluxcc\\:w-12{width:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:w-20{width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:w-\\[68px\\]\\!{width:68px!important}.bluxcc\\:w-\\[100px\\]{width:100px!important}.bluxcc\\:w-\\[calc\\(100\\%-3rem\\)\\]{width:calc(100% - 3rem)!important}.bluxcc\\:w-auto{width:auto!important}.bluxcc\\:w-full{width:100%!important}.bluxcc\\:max-w-\\[90px\\]{max-width:90px!important}.bluxcc\\:max-w-\\[180px\\]{max-width:180px!important}.bluxcc\\:flex-1{flex:1!important}.bluxcc\\:shrink-0{flex-shrink:0!important}.bluxcc\\:grow{flex-grow:1!important}.bluxcc\\:-translate-x-1\\/2{--tw-translate-x:-50%!important;translate:var(--tw-translate-x) var(--tw-translate-y)!important}.bluxcc\\:transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)!important}.bluxcc\\:animate-spin{animation:var(--bluxcc-animate-spin)!important}.bluxcc\\:cursor-default\\!{cursor:default!important}.bluxcc\\:cursor-pointer{cursor:pointer!important}.bluxcc\\:cursor-text{cursor:text!important}.bluxcc\\:flex-col{flex-direction:column!important}.bluxcc\\:items-center{align-items:center!important}.bluxcc\\:justify-between{justify-content:space-between!important}.bluxcc\\:justify-center{justify-content:center!important}.bluxcc\\:justify-start{justify-content:flex-start!important}.bluxcc\\:\\!gap-1,.bluxcc\\:gap-1{gap:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:gap-2{gap:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:gap-3{gap:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:gap-\\[10px\\]{gap:10px!important}.bluxcc\\:space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*1*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*1*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*2*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*2*var(--tw-space-y-reverse))!important}}.bluxcc\\:overflow-hidden{overflow:hidden!important}.bluxcc\\:overflow-y-auto{overflow-y:auto!important}.bluxcc\\:rounded-full{border-radius:calc(infinity * 1px)!important}.bluxcc\\:\\!rounded-b-none{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.bluxcc\\:border{border-style:var(--tw-border-style)!important;border-width:1px!important}.bluxcc\\:border-2{border-style:var(--tw-border-style)!important;border-width:2px!important}.bluxcc\\:bg-black\\/10{background-color:var(--bluxcc-color-black)!important;@supports (color:color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--bluxcc-color-black) 10%,transparent)!important}}.bluxcc\\:bg-transparent{background-color:transparent!important}.bluxcc\\:p-2{padding:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:p-4{padding:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:\\!px-3{padding-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:px-2{padding-inline:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:px-4{padding-inline:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-6{padding-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:px-\\[10px\\]{padding-inline:10px!important}.bluxcc\\:\\!py-1,.bluxcc\\:py-1{padding-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:py-2{padding-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:py-3{padding-block:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:pt-\\[17px\\]{padding-top:17px!important}.bluxcc\\:pr-3\\.5{padding-right:calc(var(--bluxcc-spacing)*3.5)!important}.bluxcc\\:pb-4{padding-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pl-\\[10px\\]{padding-left:10px!important}.bluxcc\\:text-center{text-align:center!important}.bluxcc\\:text-start{text-align:start!important}.bluxcc\\:\\!text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:\\!text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:\\!text-xs{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:text-lg{font-size:var(--bluxcc-text-lg)!important;line-height:var(--tw-leading,var(--bluxcc-text-lg--line-height))!important}.bluxcc\\:text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-xl{font-size:var(--bluxcc-text-xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-xl--line-height))!important}.bluxcc\\:text-xs{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:leading-5{--tw-leading:calc(var(--bluxcc-spacing)*5)!important;line-height:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:leading-\\[28px\\]{--tw-leading:28px!important;line-height:28px!important}.bluxcc\\:font-medium{--tw-font-weight:var(--bluxcc-font-weight-medium)!important;font-weight:var(--bluxcc-font-weight-medium)!important}.bluxcc\\:font-normal{--tw-font-weight:var(--bluxcc-font-weight-normal)!important;font-weight:var(--bluxcc-font-weight-normal)!important}.bluxcc\\:font-semibold{--tw-font-weight:var(--bluxcc-font-weight-semibold)!important;font-weight:var(--bluxcc-font-weight-semibold)!important}.bluxcc\\:whitespace-nowrap{white-space:nowrap!important}.bluxcc\\:text-alert-error{color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:text-gray-600{color:var(--bluxcc-color-gray-600)!important}.bluxcc\\:text-gray-700{color:var(--bluxcc-color-gray-700)!important}.bluxcc\\:text-gray-800{color:var(--bluxcc-color-gray-800)!important}.bluxcc\\:capitalize{text-transform:capitalize!important}.bluxcc\\:\\!shadow-\\[0px_4px_80px_0px_\\#00000008\\]{--tw-shadow:0px 4px 80px 0px var(--tw-shadow-color,#00000008)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.bluxcc\\:outline-hidden{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}.bluxcc\\:\\!backdrop-blur-\\[1px\\]{--tw-backdrop-blur:blur(1px)!important;-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)!important;backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)!important}.bluxcc\\:transition-\\[border-radius\\,background\\,border-color\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius,background,border-color!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-\\[border-radius\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-all{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:all!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:duration-150{--tw-duration:150ms!important;transition-duration:.15s!important}.bluxcc\\:duration-300{--tw-duration:300ms!important;transition-duration:.3s!important}.bluxcc\\:select-none{-webkit-user-select:none!important;user-select:none!important}.bluxcc\\:focus\\:ring-1{&:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}}.bluxcc\\:focus\\:outline-hidden{&:focus{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}}}[class*=" bluxcc"]::backdrop,[class*=" bluxcc"]::file-selector-button,[class*=" bluxcc"]:after,[class*=" bluxcc"]:before,[class^=bluxcc],[class^=bluxcc]::backdrop,[class^=bluxcc]::file-selector-button,[class^=bluxcc]:after,[class^=bluxcc]:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}[class*=" bluxcc"] h1,[class*=" bluxcc"] h2,[class*=" bluxcc"] h3,[class*=" bluxcc"] h4,[class*=" bluxcc"] h5,[class*=" bluxcc"] h6,[class^=bluxcc] h1,[class^=bluxcc] h2,[class^=bluxcc] h3,[class^=bluxcc] h4,[class^=bluxcc] h5,[class^=bluxcc] h6{font-size:inherit;font-weight:inherit}[class*=" bluxcc"] menu,[class*=" bluxcc"] ol,[class*=" bluxcc"] ul,[class^=bluxcc] menu,[class^=bluxcc] ol,[class^=bluxcc] ul{list-style:none}[class*=" bluxcc"] audio,[class*=" bluxcc"] canvas,[class*=" bluxcc"] embed,[class*=" bluxcc"] iframe,[class*=" bluxcc"] img,[class*=" bluxcc"] object,[class*=" bluxcc"] svg,[class*=" bluxcc"] video,[class^=bluxcc] audio,[class^=bluxcc] canvas,[class^=bluxcc] embed,[class^=bluxcc] iframe,[class^=bluxcc] img,[class^=bluxcc] object,[class^=bluxcc] svg,[class^=bluxcc] video{display:block;vertical-align:middle}[class*=" bluxcc"] img,[class*=" bluxcc"] video,[class^=bluxcc] img,[class^=bluxcc] video{height:auto;max-width:100%}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.bluxcc\\:animate-fadeIn{animation:fadeIn .5s ease-in-out}.bluxcc\\:animate-fadeOut{animation:fadeOut .5s ease-in-out}#bluxcc-input[type=number]::-webkit-inner-spin-button,#bluxcc-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0}#bluxcc-input[type=number]{-moz-appearance:textfield!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(1turn)}}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}',{insertAt:"top"});const v={mainnet:e.PUBLIC,testnet:e.TESTNET,sandbox:e.SANDBOX,futurenet:e.FUTURENET,standalone:e.STANDALONE},x=({fill:e="#5F6367"})=>l.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_117_204",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20"},l.createElement("rect",{width:"20",height:"20",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_117_204)"},l.createElement("path",{d:"M6.67929 18.0448L5.49658 16.862L12.3587 9.99996L5.49658 3.13788L6.67929 1.95517L14.7241 9.99996L6.67929 18.0448Z",fill:e}))),E=({fill:e="#5F6367"})=>l.createElement("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_170_30135",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"25"},l.createElement("rect",{y:"0.5",width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_170_30135)"},l.createElement("path",{d:"M16 22.5L6 12.5L16 2.5L17.775 4.275L9.55 12.5L17.775 20.725L16 22.5Z",fill:e}))),C=({fill:e="#5F6367"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2032_3674",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2032_3674)"},l.createElement("path",{d:"M5.26689 20L3.99994 18.7331L10.733 12L3.99994 5.26696L5.26689 4L11.9999 10.733L18.733 4L19.9999 5.26696L13.2669 12L19.9999 18.7331L18.733 20L11.9999 13.267L5.26689 20Z",fill:e}))),_=({fill:e="#0C1083"})=>l.createElement("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"bluxcc:animate-spin"},l.createElement("mask",{id:"mask0_2054_770",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"25",height:"24"},l.createElement("rect",{x:"0.5",width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2054_770)"},l.createElement("path",{d:"M12.497 21.5C11.1965 21.5 9.96875 21.2508 8.81375 20.7525C7.65892 20.2542 6.65042 19.5739 5.78825 18.7118C4.92608 17.8496 4.24583 16.8411 3.7475 15.6863C3.24917 14.5313 3 13.3035 3 12.003C3 10.6867 3.24967 9.45358 3.749 8.30375C4.24833 7.15375 4.92817 6.14867 5.7885 5.2885C6.64867 4.42817 7.65733 3.74833 8.8145 3.249C9.97167 2.74967 11.2002 2.5 12.5 2.5V4C10.2833 4 8.39583 4.77917 6.8375 6.3375C5.27917 7.89583 4.5 9.78333 4.5 12C4.5 14.2167 5.27917 16.1042 6.8375 17.6625C8.39583 19.2208 10.2833 20 12.5 20C14.7167 20 16.6042 19.2208 18.1625 17.6625C19.7208 16.1042 20.5 14.2167 20.5 12H22C22 13.2998 21.7503 14.5283 21.251 15.6855C20.7517 16.8427 20.0718 17.8513 19.2115 18.7115C18.3513 19.5718 17.3462 20.2517 16.1962 20.751C15.0464 21.2503 13.8133 21.5 12.497 21.5Z",fill:e}))),A=({fill:e="#0C1083"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_1027_16479",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_1027_16479)"},l.createElement("path",{d:"M19.5421 20.577L13.2613 14.296C12.7613 14.7088 12.1863 15.0319 11.5363 15.2653C10.8863 15.4986 10.2139 15.6153 9.51906 15.6153C7.80989 15.6153 6.36339 15.0235 5.17956 13.84C3.99573 12.6565 3.40381 11.2103 3.40381 9.50152C3.40381 7.79285 3.99556 6.34618 5.17906 5.16152C6.36256 3.97702 7.80873 3.38477 9.51756 3.38477C11.2262 3.38477 12.6729 3.97668 13.8576 5.16051C15.0421 6.34435 15.6343 7.79085 15.6343 9.50002C15.6343 10.2142 15.5145 10.8963 15.2748 11.5463C15.035 12.1963 14.7151 12.7616 14.3151 13.2423L20.5958 19.523L19.5421 20.577ZM9.51906 14.1155C10.8076 14.1155 11.8989 13.6683 12.7931 12.774C13.6874 11.8798 14.1346 10.7885 14.1346 9.50002C14.1346 8.21152 13.6874 7.12018 12.7931 6.22601C11.8989 5.33168 10.8076 4.88452 9.51906 4.88452C8.23056 4.88452 7.13923 5.33168 6.24506 6.22601C5.35073 7.12018 4.90356 8.21152 4.90356 9.50002C4.90356 10.7885 5.35073 11.8798 6.24506 12.774C7.13923 13.6683 8.23056 14.1155 9.51906 14.1155Z",fill:e}))),M=()=>l.createElement("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("circle",{cx:"34",cy:"34",r:"34",fill:"#DCEFE9"}),l.createElement("rect",{width:"40",height:"40",transform:"translate(14 14)",fill:"#DCEFE9"}),l.createElement("mask",{id:"mask0_2519_3056",maskUnits:"userSpaceOnUse",x:"14",y:"14",width:"40",height:"40"},l.createElement("rect",{x:"14",y:"14",width:"40",height:"40",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2519_3056)"},l.createElement("path",{d:"M31.6347 41.0894L42.8397 29.8844L41.0834 28.1282L31.6347 37.5769L26.8847 32.8269L25.1284 34.5832L31.6347 41.0894ZM34.003 49.8332C31.813 49.8332 29.7545 49.4176 27.8276 48.5865C25.9006 47.7554 24.2245 46.6275 22.7992 45.2028C21.374 43.778 20.2455 42.1026 19.4138 40.1765C18.5824 38.2504 18.1667 36.1925 18.1667 34.0028C18.1667 31.8128 18.5823 29.7543 19.4134 27.8273C20.2445 25.9004 21.3724 24.2243 22.7972 22.799C24.2219 21.3737 25.8973 20.2453 27.8234 19.4136C29.7495 18.5822 31.8074 18.1665 33.9972 18.1665C36.1872 18.1665 38.2456 18.5821 40.1726 19.4132C42.0995 20.2443 43.7756 21.3722 45.2009 22.7969C46.6262 24.2216 47.7547 25.8971 48.5863 27.8232C49.4177 29.7493 49.8334 31.8072 49.8334 33.9969C49.8334 36.1869 49.4179 38.2454 48.5867 40.1723C47.7556 42.0993 46.6277 43.7754 45.203 45.2007C43.7783 46.6259 42.1029 47.7544 40.1767 48.5861C38.2506 49.4175 36.1927 49.8332 34.003 49.8332Z",fill:"#00BD81"}))),S=({fill:e="#666666"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2054_469",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2054_469)"},l.createElement("path",{d:"M20.3713 12.75H8.577V11.25H20.3713L18.552 9.43075L19.6057 8.34625L23.2595 12L19.6057 15.6538L18.552 14.5693L20.3713 12.75ZM15.202 8.86525V5H5V19H15.202V15.1348H16.702V20.5H3.5V3.5H16.702V8.86525H15.202Z",fill:e}))),k=({fill:e="#4D4D4D"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2054_791",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2054_791)"},l.createElement("path",{d:"M7.25 17.5V2.5H19.25V17.5H7.25ZM8.75 16H17.75V4H8.75V16ZM3.75 21V6.30775H5.25V19.5H15.4423V21H3.75Z",fill:e}))),I=({fill:e="#0C1083"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2054_838",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2054_838)"},l.createElement("path",{d:"M12 21.5C9.54899 21.5 7.42215 20.6913 5.61949 19.074C3.81682 17.4567 2.79365 15.432 2.54999 13H4.07499C4.31865 15.0167 5.19557 16.6875 6.70574 18.0125C8.21607 19.3375 9.98082 20 12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C10.4962 4 9.11249 4.38625 7.84899 5.15875C6.58549 5.93108 5.61149 6.99033 4.92699 8.3365H7.88449V9.8365H2.75774C3.26024 7.68267 4.37207 5.9215 6.09324 4.553C7.8144 3.18433 9.78332 2.5 12 2.5C13.3142 2.5 14.5492 2.74933 15.705 3.248C16.8608 3.74667 17.8662 4.42342 18.7212 5.27825C19.5762 6.13308 20.2531 7.13833 20.7517 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9983C21.5 13.3123 21.2506 14.5473 20.7517 15.7035C20.2531 16.8597 19.5762 17.8653 18.7212 18.7205C17.8662 19.5757 16.8608 20.2528 15.705 20.7518C14.5492 21.2506 13.3142 21.5 12 21.5ZM14.723 15.777L11.25 12.3025V7.3655H12.75V11.6962L15.7672 14.723L14.723 15.777Z",fill:e}))),B=({fill:e="#0C1083"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2054_817",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2054_817)"},l.createElement("path",{d:"M3.5 19.25V4.75L20.7115 12L3.5 19.25ZM5 17L16.85 12L5 7V10.6923L10.423 12L5 13.3077V17Z",fill:e}))),N=({fill:e="#0C1083"})=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2204_971",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16"},l.createElement("rect",{width:"16",height:"16",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2204_971)"},l.createElement("path",{d:"M5.06372 11.8333L7.99955 8.89746L10.9354 11.8333H5.06372Z",fill:e}))),L=()=>l.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{x:"0.5",y:"0.5",width:"39",height:"39",rx:"19.5",fill:"transparent",stroke:"#00BD81"}),l.createElement("mask",{id:"mask0_2212_3318",maskUnits:"userSpaceOnUse",x:"8",y:"8",width:"24",height:"24"},l.createElement("rect",{x:"8",y:"8",width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2212_3318)"},l.createElement("path",{d:"M19.25 23.6923H20.7595V19.1365L22.6095 20.9865L23.6538 19.9423L20.0095 16.298L16.3558 19.9423L17.4 20.9865L19.25 19.1365V23.6923ZM20.0017 29.5C18.6877 29.5 17.4527 29.2507 16.2965 28.752C15.1403 28.2533 14.1347 27.5766 13.2795 26.7218C12.4243 25.8669 11.7472 24.8617 11.2482 23.706C10.7494 22.5503 10.5 21.3156 10.5 20.0017C10.5 18.6877 10.7493 17.4527 11.248 16.2965C11.7467 15.1403 12.4234 14.1347 13.2783 13.2795C14.1331 12.4243 15.1383 11.7472 16.294 11.2482C17.4497 10.7494 18.6844 10.5 19.9983 10.5C21.3123 10.5 22.5473 10.7493 23.7035 11.248C24.8597 11.7467 25.8653 12.4234 26.7205 13.2783C27.5757 14.1331 28.2528 15.1383 28.7518 16.294C29.2506 17.4497 29.5 18.6844 29.5 19.9983C29.5 21.3123 29.2507 22.5473 28.752 23.7035C28.2533 24.8597 27.5766 25.8653 26.7218 26.7205C25.8669 27.5757 24.8617 28.2528 23.706 28.7518C22.5503 29.2506 21.3156 29.5 20.0017 29.5ZM20 28C22.2333 28 24.125 27.225 25.675 25.675C27.225 24.125 28 22.2333 28 20C28 17.7667 27.225 15.875 25.675 14.325C24.125 12.775 22.2333 12 20 12C17.7667 12 15.875 12.775 14.325 14.325C12.775 15.875 12 17.7667 12 20C12 22.2333 12.775 24.125 14.325 25.675C15.875 27.225 17.7667 28 20 28Z",fill:"#00BD81"}))),T=()=>l.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{x:"0.5",y:"0.5",width:"39",height:"39",rx:"19.5",fill:"transparent",stroke:"#00BD81"}),l.createElement("mask",{id:"mask0_2494_9033",maskUnits:"userSpaceOnUse",x:"8",y:"8",width:"24",height:"24"},l.createElement("rect",{x:"8",y:"8",width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2494_9033)"},l.createElement("path",{d:"M12.577 25.9728C12.0142 25.255 11.5587 24.4749 11.2105 23.6326C10.8625 22.7902 10.6321 21.9126 10.5193 20.9998H12.05C12.15 21.7165 12.3334 22.404 12.6 23.0623C12.8667 23.7206 13.2167 24.3331 13.65 24.8998L12.577 25.9728ZM10.5193 18.9998C10.6398 18.087 10.8722 17.2094 11.2165 16.3671C11.5607 15.5247 12.0206 14.7511 12.5963 14.0461L13.65 15.0998C13.2167 15.6665 12.8667 16.279 12.6 16.9373C12.3334 17.5956 12.15 18.2831 12.05 18.9998H10.5193ZM18.95 29.4498C18.0372 29.3433 17.1638 29.1154 16.3298 28.7661C15.4958 28.4167 14.718 27.9626 13.9963 27.4036L15.05 26.2998C15.6334 26.7331 16.25 27.0915 16.9 27.3748C17.55 27.6581 18.2334 27.8498 18.95 27.9498V29.4498ZM15.1 13.6806L13.9963 12.5961C14.7346 12.0306 15.525 11.5764 16.3673 11.2336C17.2096 10.8906 18.0872 10.6626 19 10.5498V12.0498C18.2834 12.1498 17.5959 12.3366 16.9375 12.6103C16.2792 12.8841 15.6667 13.2409 15.1 13.6806ZM20.95 29.4498V27.9498C21.677 27.8498 22.3729 27.6655 23.0375 27.3968C23.7022 27.1283 24.323 26.7691 24.9 26.3191L26.0038 27.4036C25.2655 27.9792 24.471 28.436 23.6203 28.7738C22.7696 29.1116 21.8795 29.337 20.95 29.4498ZM24.95 13.6998C24.3667 13.2665 23.7417 12.9081 23.075 12.6248C22.4084 12.3415 21.7167 12.1498 21 12.0498V10.5498C21.9129 10.6563 22.793 10.8826 23.6403 11.2288C24.4878 11.5748 25.2756 12.0306 26.0038 12.5961L24.95 13.6998ZM27.4038 25.9536L26.35 24.8998C26.7834 24.3331 27.1334 23.7206 27.4 23.0623C27.6667 22.404 27.85 21.7165 27.95 20.9998H29.4808C29.3603 21.9126 29.1279 22.7902 28.7835 23.6326C28.4394 24.4749 27.9795 25.2486 27.4038 25.9536ZM27.95 18.9998C27.85 18.2831 27.6667 17.5956 27.4 16.9373C27.1334 16.279 26.7834 15.6665 26.35 15.0998L27.423 14.0268C27.9859 14.7446 28.4414 15.5247 28.7895 16.3671C29.1375 17.2094 29.368 18.087 29.4808 18.9998H27.95Z",fill:"#00BD81"}),l.createElement("circle",{cx:"20",cy:"20",r:"3",fill:"#00BD81"}))),R=()=>l.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{x:"0.5",y:"0.5",width:"39",height:"39",rx:"19.5",fill:"transparent",stroke:"#00BD81"}),l.createElement("mask",{id:"mask0_2214_3828",maskUnits:"userSpaceOnUse",x:"8",y:"8",width:"24",height:"24"},l.createElement("rect",{x:"8",y:"8",width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2214_3828)"},l.createElement("path",{d:"M20.0095 23.6923L23.6538 20.048L22.6095 19.004L20.7595 20.854V16.298H19.25V20.854L17.4 19.004L16.3558 20.048L20.0095 23.6923ZM20.0017 29.5C18.6877 29.5 17.4527 29.2507 16.2965 28.752C15.1403 28.2533 14.1347 27.5766 13.2795 26.7218C12.4243 25.8669 11.7472 24.8617 11.2482 23.706C10.7494 22.5503 10.5 21.3156 10.5 20.0017C10.5 18.6877 10.7493 17.4527 11.248 16.2965C11.7467 15.1403 12.4234 14.1347 13.2783 13.2795C14.1331 12.4243 15.1383 11.7472 16.294 11.2482C17.4497 10.7494 18.6844 10.5 19.9983 10.5C21.3123 10.5 22.5473 10.7493 23.7035 11.248C24.8597 11.7467 25.8653 12.4234 26.7205 13.2783C27.5757 14.1331 28.2528 15.1383 28.7518 16.294C29.2506 17.4497 29.5 18.6844 29.5 19.9983C29.5 21.3123 29.2507 22.5473 28.752 23.7035C28.2533 24.8597 27.5766 25.8653 26.7218 26.7205C25.8669 27.5757 24.8617 28.2528 23.706 28.7518C22.5503 29.2506 21.3156 29.5 20.0017 29.5ZM20 28C22.2333 28 24.125 27.225 25.675 25.675C27.225 24.125 28 22.2333 28 20C28 17.7667 27.225 15.875 25.675 14.325C24.125 12.775 22.2333 12 20 12C17.7667 12 15.875 12.775 14.325 14.325C12.775 15.875 12 17.7667 12 20C12 22.2333 12.775 24.125 14.325 25.675C15.875 27.225 17.7667 28 20 28Z",fill:"#00BD81"}))),O=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2265_983",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2265_983)"},l.createElement("path",{d:"M8.00081 14.3337C7.13248 14.3337 6.31304 14.1672 5.54248 13.8343C4.77193 13.5014 4.09993 13.0482 3.52648 12.4747C2.95293 11.9012 2.4997 11.2292 2.16681 10.4587C1.83393 9.6881 1.66748 8.86866 1.66748 8.00033C1.66748 7.1251 1.83393 6.30394 2.16681 5.53683C2.4997 4.76972 2.95293 4.09944 3.52648 3.52599C4.09993 2.95244 4.77193 2.49921 5.54248 2.16633C6.31304 1.83344 7.13248 1.66699 8.00081 1.66699C8.87604 1.66699 9.6972 1.83344 10.4643 2.16633C11.2314 2.49921 11.9017 2.95244 12.4751 3.52599C13.0487 4.09944 13.5019 4.76972 13.8348 5.53683C14.1677 6.30394 14.3341 7.1251 14.3341 8.00033C14.3341 8.86866 14.1677 9.6881 13.8348 10.4587C13.5019 11.2292 13.0487 11.9012 12.4751 12.4747C11.9017 13.0482 11.2314 13.5014 10.4643 13.8343C9.6972 14.1672 8.87604 14.3337 8.00081 14.3337ZM8.00081 13.3195C8.34104 12.8683 8.62737 12.4132 8.85982 11.9542C9.09226 11.4952 9.28159 10.9934 9.42782 10.449H6.57381C6.72859 11.0106 6.92009 11.5208 7.14832 11.9798C7.37643 12.4388 7.66059 12.8854 8.00081 13.3195ZM6.70982 13.1362C6.45426 12.7695 6.22476 12.3527 6.02132 11.8857C5.81787 11.4185 5.65976 10.9397 5.54698 10.449H3.28548C3.63759 11.1413 4.10981 11.723 4.70215 12.194C5.29448 12.6649 5.9637 12.9789 6.70982 13.1362ZM9.29182 13.1362C10.0379 12.9789 10.7071 12.6649 11.2995 12.194C11.8918 11.723 12.364 11.1413 12.7161 10.449H10.4546C10.3204 10.9439 10.1516 11.4249 9.94815 11.892C9.74482 12.3591 9.52604 12.7738 9.29182 13.1362ZM2.86615 9.44899H5.34448C5.30259 9.20122 5.2722 8.95827 5.25331 8.72016C5.23454 8.48216 5.22515 8.24222 5.22515 8.00033C5.22515 7.75844 5.23454 7.51849 5.25331 7.28049C5.2722 7.04238 5.30259 6.79944 5.34448 6.55166H2.86615C2.80204 6.7781 2.75293 7.01355 2.71881 7.25799C2.68459 7.50244 2.66748 7.74988 2.66748 8.00033C2.66748 8.25077 2.68459 8.49822 2.71881 8.74266C2.75293 8.98711 2.80204 9.22255 2.86615 9.44899ZM6.34431 9.44899H9.65732C9.69909 9.20122 9.72943 8.96044 9.74831 8.72666C9.76709 8.49288 9.77648 8.25077 9.77648 8.00033C9.77648 7.74988 9.76709 7.50777 9.74831 7.27399C9.72943 7.04022 9.69909 6.79944 9.65732 6.55166H6.34431C6.30254 6.79944 6.2722 7.04022 6.25331 7.27399C6.23454 7.50777 6.22515 7.74988 6.22515 8.00033C6.22515 8.25077 6.23454 8.49288 6.25331 8.72666C6.2722 8.96044 6.30254 9.20122 6.34431 9.44899ZM10.6571 9.44899H13.1355C13.1996 9.22255 13.2487 8.98711 13.2828 8.74266C13.317 8.49822 13.3341 8.25077 13.3341 8.00033C13.3341 7.74988 13.317 7.50244 13.2828 7.25799C13.2487 7.01355 13.1996 6.7781 13.1355 6.55166H10.6571C10.699 6.79944 10.7294 7.04238 10.7483 7.28049C10.7671 7.51849 10.7765 7.75844 10.7765 8.00033C10.7765 8.24222 10.7671 8.48216 10.7483 8.72016C10.7294 8.95827 10.699 9.20122 10.6571 9.44899ZM10.4546 5.55166H12.7161C12.3598 4.85077 11.8908 4.2691 11.3091 3.80666C10.7275 3.34433 10.055 3.0281 9.29182 2.85799C9.54737 3.24599 9.7747 3.67038 9.97382 4.13116C10.173 4.59183 10.3333 5.06533 10.4546 5.55166ZM6.57381 5.55166H9.42782C9.27304 4.99433 9.07837 4.48083 8.84382 4.01116C8.60915 3.54149 8.32815 3.09816 8.00081 2.68116C7.67348 3.09816 7.39248 3.54149 7.15781 4.01116C6.92326 4.48083 6.72859 4.99433 6.57381 5.55166ZM3.28548 5.55166H5.54698C5.66831 5.06533 5.82859 4.59183 6.02781 4.13116C6.22693 3.67038 6.45426 3.24599 6.70982 2.85799C5.94226 3.0281 5.26876 3.34544 4.68931 3.80999C4.10976 4.27444 3.64181 4.85499 3.28548 5.55166Z",fill:"#666666"}))),P=({fill:e="#0C1083"})=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2324_772",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},l.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2324_772)"},l.createElement("path",{d:"M12 1.59619L21.5 7.25369V20.4999H2.5V7.25369L12 1.59619ZM12 12.6499L19.8 7.99994L12 3.34994L4.2 7.99994L12 12.6499ZM12 14.4037L4 9.62294V18.9999H20V9.62294L12 14.4037Z",fill:e}))),U=({fill:e="#0C1083"})=>l.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("mask",{id:"mask0_2097_3575",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},l.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2097_3575)"},l.createElement("path",{d:"M20 2.66113L35.8334 12.0903V34.1674H4.16669V12.0903L20 2.66113ZM20 21.0841L33 13.3341L20 5.58405L7.00002 13.3341L20 21.0841ZM20 24.007L6.66669 16.0391V31.6674H33.3334V16.0391L20 24.007Z",fill:e}))),z=()=>l.createElement("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("circle",{cx:"34",cy:"34",r:"34",fill:"#FFDEDE"}),l.createElement("mask",{id:"mask0_2497_9140",maskUnits:"userSpaceOnUse",x:"14",y:"14",width:"40",height:"40"},l.createElement("rect",{x:"14",y:"14",width:"40",height:"40",fill:"#D9D9D9"})),l.createElement("g",{mask:"url(#mask0_2497_9140)"},l.createElement("path",{d:"M33.9995 41.1662C34.2356 41.1662 34.4335 41.0863 34.5933 40.9266C34.753 40.7669 34.8328 40.569 34.8328 40.3328C34.8328 40.0967 34.753 39.8988 34.5933 39.7391C34.4335 39.5794 34.2356 39.4995 33.9995 39.4995C33.7634 39.4995 33.5655 39.5794 33.4058 39.7391C33.246 39.8988 33.1662 40.0967 33.1662 40.3328C33.1662 40.569 33.246 40.7669 33.4058 40.9266C33.5655 41.0863 33.7634 41.1662 33.9995 41.1662ZM33.4162 35.9995H34.5828V25.9995H33.4162V35.9995ZM34.0066 48.4995C32.0019 48.4995 30.1167 48.1191 28.3512 47.3583C26.5856 46.5974 25.0499 45.5648 23.7441 44.2603C22.438 42.9559 21.4041 41.4221 20.6424 39.6591C19.8805 37.8958 19.4995 36.0116 19.4995 34.0066C19.4995 32.0019 19.8799 30.1167 20.6408 28.3512C21.4016 26.5856 22.4342 25.0499 23.7387 23.7441C25.0431 22.438 26.5769 21.4041 28.3399 20.6424C30.1033 19.8805 31.9874 19.4995 33.9924 19.4995C35.9972 19.4995 37.8823 19.8799 39.6478 20.6408C41.4134 21.4016 42.9491 22.4342 44.2549 23.7387C45.561 25.0431 46.5949 26.5769 47.3566 28.3399C48.1185 30.1033 48.4995 31.9874 48.4995 33.9924C48.4995 35.9972 48.1191 37.8823 47.3583 39.6478C46.5974 41.4134 45.5648 42.9491 44.2603 44.2549C42.9559 45.561 41.4222 46.5949 39.6591 47.3566C37.8958 48.1185 36.0116 48.4995 34.0066 48.4995Z",fill:"#EC2929"}))),F=({icon:e,onInfo:t,onBack:r,title:n,closeButton:i=!1,onClose:o})=>{const a=ua();return l.createElement("div",{className:"bluxcc:flex bluxcc:h-[60px] bluxcc:w-full bluxcc:items-center bluxcc:justify-between"},"info"===e?l.createElement("div",{onClick:t,className:"bluxcc:flex bluxcc:size-5 bluxcc:items-center bluxcc:justify-center"}):"back"===e?l.createElement("div",{onClick:r,className:"bluxcc:flex bluxcc:size-5 bluxcc:cursor-pointer bluxcc:items-center bluxcc:justify-center"},l.createElement(E,{fill:a.value.config.appearance.textColor})):l.createElement("div",{className:"bluxcc:size-5"}),l.createElement("p",{className:"bluxcc:grow bluxcc:select-none bluxcc:text-center bluxcc:text-base bluxcc:font-medium"},n),i?l.createElement("div",{onClick:o,className:"bluxcc:size-5 bluxcc:cursor-pointer"},l.createElement(C,{fill:a.value.config.appearance.textColor})):l.createElement("div",{className:"bluxcc:size-5"}))},j=({isClosing:e,onClose:t,isSticky:r=!1})=>l.createElement("div",{className:"bluxcc:fixed bluxcc:inset-0 bluxcc:z-40 bluxcc:bg-black/10 bluxcc:!backdrop-blur-[1px] "+(e&&!r?"bluxcc:animate-fadeOut":"bluxcc:animate-fadeIn"),onClick:t}),D=({isOpen:e,onClose:t=()=>{},onBack:r,onInfo:n,children:i,title:o,icon:a,isSticky:c=!1,closeButton:s=!0})=>{const[h,p]=u("auto"),[b,m]=u(!1),[g,y]=u(!1),w=f(null),v=ua(),{isOpening:x,isClosing:E,handleClose:C}=(e=>{const[t,r]=u({isOpening:!0,isClosing:!1,hasTransition:!1});return d(()=>{if(e&&t.isOpening){const e=setTimeout(()=>{r(e=>({...e,isOpening:!1}))},300);return()=>clearTimeout(e)}},[e,t.isOpening]),{...t,setHasTransition:e=>r(t=>({...t,hasTransition:e})),handleClose:e=>{r(e=>({...e,isClosing:!0})),setTimeout(()=>{r(e=>({...e,isClosing:!1})),e()},300)}}})(e),{appearance:_}=v.value.config;return d(()=>{const e=()=>m(window.innerWidth<760);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),d(()=>{if(!e||!w.current)return;p(w.current.offsetHeight),y(!0);const t=new ResizeObserver(()=>{w.current&&p(w.current.offsetHeight)});return t.observe(w.current),()=>t.disconnect()},[e,i]),e?l.createElement(l.Fragment,null,!v.value.isDemo&&l.createElement(j,{isClosing:E,isSticky:c,onClose:()=>C(t)}),l.createElement("div",{className:`bluxcc:absolute bluxcc:inset-0 bluxcc:z-9999 bluxcc:flex bluxcc:items-center bluxcc:justify-center ${E&&!c&&"bluxcc:animate-fadeOut"}`,onClick:e=>e.target===e.currentTarget&&C(t)},l.createElement("div",{className:"bluxcc:box-border bluxcc:overflow-hidden bluxcc:!shadow-[0px_4px_80px_0px_#00000008] bluxcc:transition-all bluxcc:duration-300 "+(b?"bluxcc:fixed bluxcc:bottom-0 bluxcc:left-0 bluxcc:max-h-[90vh] bluxcc:w-full bluxcc:!rounded-b-none":"bluxcc:relative bluxcc:!w-[360px]"),style:{height:"number"==typeof h?`${b?h+40:h}px`:h,transition:g?"height 300ms ease-in-out, border-radius 300ms, opacity 300ms ease-out"+(b?", transform 300ms ease-out":""):"border-radius 300ms, opacity 300ms ease-out"+(b?", transform 300ms ease-out":""),transform:b?x||E?"translateY(100%)":"translateY(0%)":"none",backgroundColor:_.background,opacity:E&&!c?"0":"1",color:_.textColor,fontFamily:_.font,letterSpacing:"-0.04px",outlineStyle:"solid",outlineColor:_.borderColor,outlineWidth:_.borderWidth,borderRadius:_.borderRadius}},l.createElement("div",{ref:w,className:"bluxcc:px-6 bluxcc:pb-4"},l.createElement(F,{icon:a,onInfo:n,onBack:r,title:o,closeButton:s,onClose:()=>C(t)}),i)))):null};var H,q,K;!function(e){e.Rabet="Rabet",e.Albedo="Albedo",e.Freighter="Freighter",e.Xbull="xBull",e.Lobstr="LOBSTR",e.Hana="Hana",e.Hot="Hot"}(H||(H={})),function(e){e.PUBLIC="Public Global Stellar Network ; September 2015",e.TESTNET="Test SDF Network ; September 2015",e.FUTURENET="Test SDF Future Network ; October 2022",e.SANDBOX="Local Sandbox Stellar Network ; September 2022",e.STANDALONE="Standalone Network ; February 2017"}(q||(q={})),function(e){e.ONBOARDING="ONBOARDING",e.WRONG_NETWORK="WRONG_NETWORK",e.WAITING="WAITING",e.SUCCESSFUL="SUCCESSFUL",e.PROFILE="PROFILE",e.SIGN_TRANSACTION="SIGN_TRANSACTION",e.SEND="SEND",e.ACTIVITY="ACTIVITY",e.OTP="OTP"}(K||(K={}));const V={logInOrSignUp:{en:"Log in or Sign up",es:"Inicia sesión o regístrate"},profile:{en:"Profile",es:"Perfil"},confirmation:{en:"Confirmation",es:"Confirmación"},send:{en:"Send",es:"Enviar"},activity:{en:"Activity",es:"Actividad"},swap:{en:"Swap",es:"Intercambiar"},receive:{en:"Receive",es:"Recibir"},wrongNetwork:{en:"Wrong Network",es:"Red incorrecta"},loading:{en:"Loading",es:"Cargando"},tryAgain:{en:"Try again",es:"Intenta de nuevo"},connecting:{en:"Connecting",es:"Conectando"},signing:{en:"Signing",es:"Firmando"},or:{en:"or",es:"o"},recent:{en:"recent",es:"reciente"},allStellarWallets:{en:"All Stellar wallets",es:"Todas las carteras Stellar"},email:{en:"Email",es:"Correo electrónico"},logInWithPasskey:{en:"Log in with Passkey",es:"Iniciar sesión con llave de acceso"},submit:{en:"Submit",es:"Enviar"},poweredByBlux:{en:"Powered by Blux.cc",es:"Desarrollado por Blux.cc"},connectionSuccessfulTitle:{en:"Connection Successful",es:"Conexión exitosa"},transactionSuccessfulTitle:{en:"Transaction Successful",es:"Transacción exitosa"},connectionSuccessfulMessage:{en:"Your account has been successfully connected to ${appName}",es:"Tu cuenta se ha conectado correctamente a ${appName}"},transactionSuccessfulMessage:{en:"Your transaction was successfully completed",es:"Tu transacción se completó con éxito"},seeInExplorer:{en:"See in explorer",es:"Ver en el explorador"},loggingIn:{en:"Logging In",es:"Iniciando sesión"},done:{en:"Done",es:"Hecho"},signTransactionPrompt:{en:"wants your permission to approve the following transaction.",es:"quiere tu permiso para aprobar la siguiente transacción."},invalidXdr:{en:"Invalid XDR",es:"XDR inválido"},lobstrWarning:{en:"Ensure that your LOBSTR wallet is set to the ${network} network. Otherwise, the transaction will definitely fail.",es:"Asegúrate de que tu cartera LOBSTR esté configurada en la red ${network}. De lo contrario, la transacción fallará."},yourWallet:{en:"Your wallet",es:"Tu cartera"},noAddressFound:{en:"No address found",es:"No se encontró ninguna dirección"},approve:{en:"Approve",es:"Aprobar"},loadingActivity:{en:"Loading activity...",es:"Cargando actividad..."},noActivityFound:{en:"No activity found",es:"No se encontró actividad"},multiOperation:{en:"Multi Operation",es:"Operación múltiple"},pathPaymentDescription:{en:"Path payment of ${amount} ${asset}",es:"Pago por ruta de ${amount} ${asset}"},seeAllInExplorer:{en:"See all in explorer",es:"Ver todo en el explorador"},enterConfirmationCodeTitle:{en:"Enter confirmation code",es:"Introduce el código de confirmación"},enterConfirmationCodeHelp:{en:"Please check your email and enter confirmation code below",es:"Por favor revisa tu correo electrónico e introduce el código de confirmación abajo"},invalidCodeError:{en:"Invalid code, please try again.",es:"Código inválido, por favor intenta de nuevo."},resendCode:{en:"Resend code",es:"Reenviar código"},copied:{en:"Copied!",es:"¡Copiado!"},logout:{en:"Logout",es:"Cerrar sesión"},search:{en:"Search",es:"Buscar"},noAssetsFound:{en:"No assets found",es:"No se encontraron activos"},amount:{en:"Amount",es:"Cantidad"},max:{en:"Max",es:"Máx"},to:{en:"To",es:"A"},enterAddress:{en:"Enter address",es:"Introduce la dirección"},addressRequired:{en:"Address is required",es:"La dirección es obligatoria"},addressInvalid:{en:"Address is invalid",es:"La dirección es inválida"},inactiveAccount:{en:"Account is inActive",es:"La cuenta está inactiva"},memo:{en:"Memo",es:"Memo"},enterMemo:{en:"Enter Memo (optional)",es:"Introduce una Memo (opcional)"},paste:{en:"Paste",es:"Pegar"},amountRequired:{en:"Amount is required",es:"La cantidad es obligatoria"},amountExceedsBalance:{en:"Amount is greater than max balance",es:"La cantidad excede el saldo máximo"},sendButton:{en:"Send",es:"Enviar"},loginFailed:{en:"Login failed",es:"Fallo al iniciar sesión"},signingFailed:{en:"Signing with ${walletName} failed",es:"La firma con ${walletName} falló"},waitingFor:{en:"Waiting for ${walletName}",es:"Esperando a ${walletName}"},signingWith:{en:"Signing with ${walletName}",es:"Firmando con ${walletName}"},loginRetryMessage:{en:"Please try logging in again.",es:"Por favor intenta iniciar sesión nuevamente."},signingRetryMessage:{en:"Please try signing again.",es:"Por favor intenta firmar nuevamente."},acceptConnection:{en:"Accept connection",es:"Aceptar conexión"},signRequestInWallet:{en:"Sign the request in your wallet",es:"Firma la solicitud en tu cartera"},wrongNetworkMessage:{en:"You are on a wrong network.",es:"Estás en una red incorrecta."}},W=(e,t,r={})=>{var n,i;return((e,t={})=>e.replace(/\$\{(\w+)\}/g,(e,r)=>t[r]||""))((null===(n=V[e])||void 0===n?void 0:n[t])||(null===(i=V[e])||void 0===i?void 0:i.en)||"",r)},Z=()=>{const{value:e}=ua(),t=e.config.lang;return(e,r)=>W(e,t,r||{})};function $(e,t=!1){const r="number"==typeof e?e:parseFloat(e);if(isNaN(r)||0===r)return"0";if(r<1e-6)return e.toString();if(t){if(r>=1e6)return`${(r/1e6).toFixed(2)}m`;if(r>=1e3)return`${(r/1e3).toFixed(2)}k`}return function(e){const[t,r]=e.split(".");return r?`${t.replace(/\B(?=(\d{3})+(?!\d))/g,",")}.${r}`:t.replace(/\B(?=(\d{3})+(?!\d))/g,",")}(function(e){var t;const r=e.toString(),[n,i=""]=r.split(".");if(!i)return n;const o=null!==(t={0:8,1:7,2:6,3:5,4:4,5:3,6:2}[n.length])&&void 0!==t?t:0;if(o>0){const e=`${n}.${i.slice(0,o)}`,t=parseFloat(e);return Number.isInteger(t)?n:t.toFixed(2)}return n}(r))}const G=({assets:e,setSelectedAsset:t,setShowSelectAssetPage:r})=>{const n=ua(),i=Z(),o=n.value.config.appearance,[a,c]=u(!1),[s,d]=u(""),[f,h]=u(null),p=()=>a?o.accent:o.borderColor;return n.value.account.loading?l.createElement("div",null,i("loading")):l.createElement("div",{className:"bluxcc:h-[348px]"},l.createElement("div",null,l.createElement("div",{onFocus:()=>c(!0),onBlur:()=>c(!1),onMouseEnter:e=>{a||(e.currentTarget.style.borderColor=o.accent,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:e=>{a||(e.currentTarget.style.borderColor=o.borderColor)},className:"bluxcc:flex bluxcc:h-14 bluxcc:items-center bluxcc:gap-2 bluxcc:p-4",style:{background:o.bgField,borderWidth:o.includeBorders?o.borderWidth:"1px","--tw-ring-color":p(),borderRadius:o.borderRadius,borderColor:p(),color:o.textColor}},l.createElement(A,{fill:o.textColor}),l.createElement("input",{autoFocus:!0,type:"text",placeholder:i("search"),value:s,onChange:e=>d(e.target.value),className:"bluxcc:bg-transparent bluxcc:outline-hidden",style:{color:o.textColor}}))),l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:mt-4 bluxcc:gap-2 bluxcc:overflow-y-auto"},e.map((n,i)=>l.createElement("div",{key:n.assetType+n.assetIssuer,onClick:()=>{(e=>{t(e),r(!1)})(n)},onMouseEnter:()=>h(i),onMouseLeave:()=>h(null),className:"bluxcc:flex bluxcc:cursor-pointer bluxcc:items-center bluxcc:justify-between bluxcc:px-4 bluxcc:py-3",style:{background:f===i?o.bgField:"transparent",color:o.textColor,borderBottomStyle:"dashed",borderBottomWidth:i<e.length-1?o.includeBorders?o.borderWidth:"1px":"0px",borderBottomColor:o.borderColor,transition:"all 0.2s ease-in-out"}},l.createElement("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-[10px]"},l.createElement("span",{className:"bluxcc:font-medium"},n.logo),l.createElement("div",{className:"bluxcc:flex bluxcc:flex-col"},l.createElement("span",{className:"bluxcc:text-xs bluxcc:font-medium"},n.assetCode),l.createElement("span",{className:"bluxcc:text-xs"},n.assetCode))),l.createElement("span",{className:"bluxcc:font-medium"},$(n.balance)))),0===e.length&&l.createElement("div",{style:{color:o.textColor},className:"bluxcc:mt-2 bluxcc:text-center"},i("noAssetsFound"))))},X=e=>{const t=e.replace("#","");return(.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5?"#000000":"#FFFFFF"},J={small:"bluxcc:h-8 bluxcc:!text-sm bluxcc:gap-1",medium:"bluxcc:h-10 bluxcc:!text-sm bluxcc:gap-2",large:"bluxcc:h-[52px] bluxcc:!text-base bluxcc:gap-2"},Y=({size:e="large",variant:t="outline",state:r="enabled",children:n,startIcon:i,endIcon:o,onClick:a,style:c,className:s})=>{const u=ua().value.config.appearance,d={borderRadius:u.borderRadius,cursor:"disabled"===r?"not-allowed":"pointer",opacity:"disabled"===r?.5:1,pointerEvents:"disabled"===r?"none":void 0,...c};return"outline"===t?Object.assign(d,{border:`1px solid ${u.borderColor}`,color:u.accent,backgroundColor:u.background,borderWidth:u.includeBorders?u.borderWidth:"1px"}):"fill"===t?Object.assign(d,{backgroundColor:u.accent,fontWeight:"500",color:X(u.accent)}):"text"===t&&Object.assign(d,{color:u.accent,backgroundColor:"transparent"}),"selected"===r&&(d.boxShadow=`0 0 0 2px ${u.accent}`),l.createElement("button",{onClick:a,disabled:"disabled"===r,className:`bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:px-[10px] bluxcc:transition-all bluxcc:duration-300 bluxcc:w-full ${J[e]} ${null!=s?s:""} bluxcc:transition-all bluxcc:duration-300`,style:d},i&&l.createElement("span",null,i),l.createElement("span",null,n),o&&l.createElement("span",null,o))},Q=(e,r)=>{try{const n=new t(e,r),i=n.operations[0];let o=null;return"payment"===i.type&&(o=i.destination),{action:i.type,operations:n.operations.length,sender:n.source,receiver:o,estimatedFee:Number(n.fee)/1e7}}catch(e){return null}},ee=(e,t)=>({url:e,...t}),te={[v.mainnet]:{name:"Mainnet",horizon:ee("https://horizon.stellar.org"),soroban:ee("https://mainnet.sorobanrpc.com")},[v.testnet]:{name:"Testnet",horizon:ee("https://horizon-testnet.stellar.org"),soroban:ee("https://soroban-testnet.stellar.org")},[v.futurenet]:{name:"Futurenet",horizon:ee("https://horizon-futurenet.stellar.org"),soroban:ee("https://rpc-futurenet.stellar.org")}},re=(e,t)=>{let r=te[e];const n=t[e];if(!r&&!n)throw new Error("Custom network has no transports.");return!r&&n&&(r={name:"Custom Network",horizon:ee(""),soroban:ee("")}),n&&(n.horizon&&(r.horizon=n.horizon),n.soroban&&(r.soroban=n.soroban)),r},ne=e=>new Promise(t=>setTimeout(t,e));async function ie(e,i,o){const{horizon:a,soroban:c}=re(i.network,o);if(!a)throw new Error("Horizon RPC was not found.");const s=new r.Server(a.url),l=new t(e,i.network);if(i.isSoroban){const e=new n.Server(c.url),t=await e.sendTransaction(l),r=await(async(e,t)=>{for(let r=0;r<15;++r){const r=await t.getTransaction(e);if("SUCCESS"===r.status)return r;if("FAILED"===r.status)break;await ne(1e3)}return null})(t.hash,e);return r}return await s.submitTransaction(l)}const oe=async(e,t,r,n,i)=>{const o=await(async(e,t,r,n)=>{if(!(null==e?void 0:e.signTransaction))throw new Error("Wallet does not support transaction signing.");return await e.signTransaction(t,{networkPassphrase:n,address:r})})(e,t,r,n.network);return await ie(o,n,i||{})},ae=()=>{var e;const t=ua();if(!t)throw new Error("useBlux must be used within a ProviderContext.");const{value:r,setValue:n,setRoute:i}=t,{isReady:o,user:a,isAuthenticated:c}=r;return{login:()=>{if(!o)throw new Error("Cannot connect when isReady is false.");if(c)throw new Error("Already connected.");n(e=>e.isModalOpen?e:{...e,isModalOpen:!0})},logout:()=>{n(e=>({...e,isModalOpen:!1,user:{...e.user,wallet:null},isAuthenticated:!1,waitingStatus:"connecting"})),i(K.ONBOARDING)},profile:()=>{if(!c)throw new Error("User is not authenticated.");i(K.PROFILE),n(e=>({...e,isModalOpen:!0}))},sendTransaction:function(e,t){return new Promise((o,s)=>{var l,u;let d=r.activeNetwork;if(t&&t.network&&(d=t.network),c||s(new Error("User is not authenticated.")),!Q(e,d))return void s("Invalid XDR");const f={network:d,isSoroban:!0===(null==t?void 0:t.isSoroban)},h={xdr:e,options:f,resolver:o,rejecter:s,result:null},p={xdr:e,options:f,resolver:o,rejecter:s,result:null},b=null===(l=r.availableWallets.find(({wallet:e})=>{var t;return e.name===(null===(t=null==a?void 0:a.wallet)||void 0===t?void 0:t.name)}))||void 0===l?void 0:l.wallet;if(!b)throw new Error("Could not find the connected wallet.");r.config.showWalletUIs?(i(K.SIGN_TRANSACTION),n(e=>({...e,isModalOpen:!0,signTransaction:!0===(null==t?void 0:t.isSoroban)?p:h}))):oe(b,e,null===(u=r.user.wallet)||void 0===u?void 0:u.address,f,r.config.transports||{}).then(e=>{o(e)}).catch(e=>{s(e)})})},user:null!=a?a:null,isReady:null!==(e=r.isReady)&&void 0!==e&&e,isAuthenticated:null!=c&&c}},ce=({button:e,onButtonClick:t,appearance:r})=>l.createElement("button",{onClick:t,style:{borderRadius:r.borderRadius,color:r.textColor,borderColor:r.borderColor,backgroundColor:r.background,borderWidth:r.includeBorders?r.borderWidth:"1px"},className:"bluxcc:border bluxcc:!px-3 bluxcc:!py-1 bluxcc:!text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300"},e),se=({label:e,autoFocus:t,type:r="text",placeholder:n="Input",error:i,iconRight:o,iconLeft:a,button:c,onButtonClick:s,customLabel:d,value:f,className:h,onChange:p})=>{const b=ua().value.config.appearance,[m,g]=u(!1),y=()=>i?"#ec2929":m?b.accent:b.borderColor;return l.createElement("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col"},e&&l.createElement("label",{style:{color:i?"#ec2929":b.textColor},className:"bluxcc:mb-1 bluxcc:ml-2 bluxcc:flex bluxcc:justify-between bluxcc:text-sm"},l.createElement("span",null,e),l.createElement("span",null,d)),l.createElement("div",{className:`bluxcc:flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:border bluxcc:px-4 bluxcc:py-2 bluxcc:transition-all bluxcc:duration-300 ${h}`,onFocus:()=>g(!0),onBlur:()=>g(!1),onMouseEnter:e=>{m||i||(e.currentTarget.style.borderColor=b.accent,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:e=>{m||(e.currentTarget.style.borderColor=i?"#ec2929":b.borderColor)},style:{"--tw-ring-color":y(),borderRadius:b.borderRadius,borderColor:y(),backgroundColor:b.bgField,borderWidth:b.includeBorders?b.borderWidth:"1px"}},a&&l.createElement("div",{className:"bluxcc:mr-2"},a),l.createElement("input",{id:"bluxcc-input",autoComplete:"off",min:"number"===r?1:void 0,type:r,autoFocus:t,value:f,placeholder:n,className:"bluxcc:!mr-2 bluxcc:bg-transparent bluxcc:outline-hidden",style:{color:b.textColor,width:c?"90%":"100%"},onChange:p}),c&&l.createElement(ce,{button:c,onButtonClick:s,appearance:b}),o&&l.createElement("div",{className:"bluxcc:ml-2"},o)),i&&l.createElement("p",{className:"bluxcc:mt-1 bluxcc:ml-2 bluxcc:text-xs bluxcc:text-alert-error"},i))},le=()=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("g",{clipPath:"url(#clip0_238_2232)"},l.createElement("path",{d:"M41.06 12.5H38.94L17.5 63.18L17.565 63.205H23.285L27.5775 53.065C36.4925 56.07 46.155 56.02 55.04 52.9225L59.39 63.205H62.435L62.5 63.18L41.06 12.5ZM41.1025 53.3675C36.76 53.3675 32.445 52.665 28.3275 51.2925L41.3375 20.5325L54.2925 51.1525C50.05 52.6175 45.5925 53.3675 41.1025 53.3675Z",fill:"#0691B7"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_238_2232"},l.createElement("rect",{width:"45",height:"52.5",fill:"white",transform:"translate(17.5 12.5)"})))),ue=({fill:e="#221542"})=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M24 32.6489C24 32.4316 24.177 32.2562 24.3941 32.2493C30.8491 32.0454 36.0454 26.8491 36.2494 20.3941C36.2562 20.177 36.4317 20 36.6489 20H55.6067C55.8239 20 56 20.176 56 20.3932V43.0339C56 43.2512 55.8239 43.4272 55.6067 43.4272H44.7877C44.5705 43.4272 44.3944 43.2511 44.3944 43.0339V33.7948C44.3944 33.3973 43.8568 33.2414 43.6304 33.5683C39.3932 39.6869 32.369 43.7288 24.3941 43.8579C24.1769 43.8615 24 43.6851 24 43.4679V32.6489Z",fill:e}),l.createElement("path",{d:"M56 48.7019C56 48.4846 55.8239 48.3086 55.6067 48.3086H24.3933C24.1761 48.3086 24 48.4846 24 48.7019V59.5209C24 59.7381 24.1761 59.9141 24.3933 59.9141H55.6067C55.8239 59.9141 56 59.7381 56 59.5209V48.7019Z",fill:e})),de=()=>l.createElement("svg",{width:"80",height:"82",viewBox:"0 0 80 82",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M35.3956 22.5711C35.3861 22.3324 35.6417 22.1832 35.8491 22.3053C36.0382 22.4165 36.2205 22.5257 36.4099 22.6313C37.4552 23.198 38.4402 23.8684 39.3497 24.6324C40.7641 25.8554 41.9528 27.3151 42.8621 28.9455C43.8192 30.6016 44.5515 32.3765 45.0399 34.224C45.3754 35.475 45.5109 36.7708 45.4414 38.0637C45.4231 38.2364 45.4614 38.4102 45.5506 38.5595C45.6395 38.7088 45.7746 38.8255 45.9357 38.8923C46.0974 38.9554 46.275 38.9655 46.4431 38.9209C46.6109 38.8763 46.76 38.7794 46.8686 38.6444C47.9575 37.49 49.2774 34.882 49.72 33.9747C49.8026 33.8053 50.0113 33.7465 50.1619 33.8612C50.8686 34.4006 52.7431 36.0635 54.3348 39.5289C54.8774 40.6445 55.2013 41.8521 55.4406 43.0659C55.6754 44.1598 55.7118 45.2684 55.6845 46.3866C55.5946 50.0708 54.0887 53.6243 51.5016 56.404C49.2163 58.8592 46.2232 60.5283 42.9103 61.1014C40.0638 61.638 37.1237 61.3821 34.4141 60.3617C33.5021 59.9866 32.622 59.5388 31.7826 59.0225C30.5229 58.3338 29.4357 57.3655 28.4361 56.3377C26.8193 54.5515 25.6161 52.5121 24.9068 50.178C24.5955 49.0177 24.4013 47.8294 24.3271 46.6307C24.2318 44.6775 24.4841 42.6145 25.143 40.8279C26.148 38.1032 27.8486 35.4733 30.1752 33.7232C32.312 32.1263 34.0955 30.2591 34.9939 27.7544C35.3492 26.6941 35.5128 25.5795 35.477 24.4623C35.477 23.8311 35.4204 23.2014 35.3956 22.5711Z",fill:"#1D1F20"}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M34.5092 22.014C34.4771 21.2324 35.3603 20.746 36.0555 21.1393C36.0946 21.1614 36.1328 21.183 36.1703 21.2043C36.3258 21.2925 36.47 21.3743 36.6196 21.4546C37.7453 22.0415 38.8061 22.7356 39.7859 23.5265L39.7898 23.5297L39.7936 23.5329C41.3229 24.8038 42.6081 26.3202 43.5916 28.0139C44.6147 29.7161 45.3976 31.5403 45.92 33.439C46.2872 34.7551 46.4354 36.1183 46.3591 37.4784L46.3582 37.4956L46.3563 37.5128C46.3533 37.5404 46.3597 37.5682 46.3745 37.5919C46.3878 37.6134 46.4071 37.63 46.4292 37.6404C46.4532 37.6479 46.4787 37.6486 46.503 37.6424C46.5296 37.6356 46.554 37.6206 46.5722 37.599L46.5896 37.5781L46.6089 37.5585C47.1119 37.0459 47.7023 36.169 48.2413 35.2651C48.7715 34.3758 49.2213 33.5139 49.4475 33.0683C49.7105 32.5499 50.4333 32.3104 50.9821 32.7128C51.7957 33.3096 53.8186 35.0512 55.5239 38.6163C56.1217 39.8002 56.4715 41.0643 56.7246 42.2971C56.9837 43.4612 57.0205 44.6257 56.9918 45.7613C56.8942 49.6099 55.258 53.3101 52.4616 56.1977C49.9898 58.7499 46.7462 60.4917 43.1488 61.0911C40.0664 61.6486 36.8829 61.3818 33.9491 60.3197L33.9391 60.3162L33.9292 60.3122C32.9525 59.9264 32.0099 59.4658 31.1106 58.9353C29.7188 58.2008 28.5375 57.1829 27.4844 56.1423L27.4756 56.1335L27.467 56.1244C25.7243 54.2739 24.4206 52.1531 23.6522 49.7227L23.6488 49.712L23.6458 49.7015C23.3106 48.5005 23.1015 47.2705 23.0215 46.03L23.0212 46.0255L23.021 46.0211C22.9183 43.999 23.1884 41.8485 23.9103 39.9671C24.9876 37.1598 26.8221 34.4156 29.3717 32.5723L29.3726 32.5716L29.3735 32.571C31.5326 31.0201 33.2623 29.2581 34.1303 26.9378C34.4711 25.9579 34.628 24.9279 34.5935 23.8956L34.5932 23.8848V23.8741C34.5932 23.4867 34.5711 23.1205 34.5477 22.7336C34.5338 22.5039 34.5195 22.267 34.5092 22.014ZM35.9708 22.6629C35.9941 23.0563 36.0174 23.4692 36.0178 23.8633C36.0562 25.054 35.8741 26.2417 35.48 27.3719L35.4777 27.3786L35.4752 27.3852C34.4776 30.0585 32.5064 32.0197 30.2323 33.6533C27.9527 35.3018 26.2572 37.804 25.2485 40.4326C24.6032 42.1142 24.3492 44.0779 24.4438 45.9513C24.5179 47.0971 24.7108 48.233 25.0197 49.3423C25.7228 51.5602 26.9127 53.5016 28.5193 55.21C29.5346 56.2124 30.6026 57.1191 31.8152 57.7561L31.8312 57.7647L31.8467 57.7738C32.6822 58.2677 33.5579 58.6964 34.4653 59.0555C37.1519 60.026 40.0661 60.2688 42.8877 59.7576L42.8929 59.7567L42.8983 59.7558C46.1757 59.2108 49.1436 57.6227 51.4143 55.2782C53.9889 52.6198 55.4787 49.2303 55.5675 45.7286C55.5953 44.6352 55.5567 43.5894 55.3298 42.5735L55.3287 42.5679L55.3275 42.5624C55.0844 41.3775 54.7625 40.2368 54.237 39.1983L54.2336 39.1917L54.2304 39.1849C52.883 36.3656 51.3452 34.8042 50.5043 34.0966C50.2497 34.5829 49.8889 35.2495 49.4801 35.9349C48.9416 36.8378 48.2887 37.8277 47.6667 38.4674C47.4611 38.703 47.1839 38.8729 46.8721 38.9525C46.5502 39.0347 46.2094 39.0161 45.8996 38.8997L45.8928 38.8972L45.8861 38.8945C45.5767 38.7713 45.3182 38.5562 45.1479 38.282C44.9813 38.0136 44.9077 37.7022 44.9373 37.3919C45.0038 36.1777 44.8706 34.9609 44.5427 33.7862L44.5426 33.785L44.5422 33.7839C44.0511 31.9985 43.3146 30.2834 42.3526 28.6833L42.3498 28.6789L42.3472 28.6743C41.4443 27.1183 40.2643 25.7253 38.8606 24.558C37.9655 23.8358 36.9975 23.201 35.9708 22.6629Z",fill:"#FABA0D"}),l.createElement("path",{d:"M38.1531 41.1875C38.3545 41.2919 38.5256 41.3944 38.7087 41.4911C39.2749 41.7821 39.8084 42.1261 40.3012 42.5182C41.0673 43.146 41.7112 43.895 42.2037 44.7317C42.722 45.5816 43.1188 46.4927 43.3834 47.4408C43.565 48.0827 43.6384 48.7478 43.6008 49.4113C43.591 49.4999 43.6117 49.5891 43.6599 49.6658C43.7082 49.7424 43.7813 49.8023 43.8685 49.8366C43.9562 49.8691 44.0524 49.8743 44.1434 49.8513C44.2342 49.8283 44.3151 49.7786 44.3738 49.7094C45.0942 48.9858 45.5615 48.0501 45.9462 47.158C47.0249 47.9768 47.8597 48.9885 48.418 50.1634C48.7119 50.7359 48.8874 51.3555 49.017 51.9786C49.1442 52.5398 49.1639 53.1089 49.1491 53.6828C49.1004 55.5736 48.2847 57.3973 46.8835 58.8238C45.6456 60.0838 44.0243 60.9405 42.2297 61.2347C40.688 61.51 39.0953 61.3786 37.6277 60.8549C37.1336 60.6625 36.6569 60.4327 36.2023 60.1678C35.52 59.8142 34.931 59.3173 34.3896 58.7899C33.5138 57.873 32.8621 56.8264 32.4779 55.6287C32.3093 55.0331 32.2041 54.4232 32.1639 53.8081C32.1122 52.8056 32.249 51.7468 32.6059 50.8299C33.1502 49.4316 34.0714 48.082 35.3316 47.1838C36.4891 46.3642 37.4551 45.4059 37.9417 44.1204C38.1342 43.5763 38.2229 43.0044 38.2034 42.431C38.2034 42.0159 38.1531 41.6021 38.1531 41.1875Z",fill:"#FABA0D"})),fe=({fill:e="#B8BAC4"})=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("g",{clipPath:"url(#clip0_54_32)"},l.createElement("path",{d:"M39.898 61.6041C38.776 62.2821 37.324 62.3741 36.07 61.6801L32.782 59.8601C29.404 57.9961 28.194 53.7401 30.088 50.3761L33.282 44.6981L38.256 59.5521C38.556 60.4561 39.156 61.1621 39.896 61.6061L39.898 61.6041ZM50.746 32.0461L46.51 44.6961L39.898 32.9501L49.154 16.4981C49.614 15.6801 50.854 15.9381 50.95 16.8681L51.664 23.5781C51.972 26.4341 51.656 29.3221 50.744 32.0461H50.746Z",fill:e}),l.createElement("path",{d:"M46.5099 44.6961L41.5399 59.5501C41.2379 60.4501 40.6399 61.1541 39.8999 61.6021C39.1579 61.1581 38.5539 60.4521 38.2579 59.5501L33.2839 44.6961L39.8979 32.9501L46.5099 44.6961Z",fill:"black"}),l.createElement("path",{d:"M39.8979 32.9499L33.2799 44.6959L29.0459 32.0459C28.1339 29.3199 27.8179 26.4339 28.1259 23.5779L28.8399 16.8679C28.9399 15.9359 30.1759 15.6779 30.6339 16.4979L39.8979 32.9499ZM47.0099 59.8599L43.7239 61.6799C42.4639 62.3739 41.0179 62.2799 39.8979 61.6019C40.6399 61.1539 41.2379 60.4499 41.5379 59.5499L46.5079 44.6959L49.7019 50.3739C51.5959 53.7379 50.3859 57.9939 47.0099 59.8599Z",fill:e})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_54_32"},l.createElement("rect",{width:"24",height:"48",fill:"white",transform:"translate(28.0001 16)"})))),he=({fill:e="#310CCC"})=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.1224 25.6667C34.9877 21.2577 30.9854 18 26.2222 18C20.5766 18 16 22.5766 16 28.2222C16 33.8678 20.5766 38.4444 26.2222 38.4444C30.9854 38.4444 34.9877 35.1868 36.1224 30.7778H44.963V39.2963H50.0741V30.7778H53.4814V39.2963H58.5926V30.7778H62V25.6667H36.1224ZM31.3333 28.2222C31.3333 31.045 29.045 33.3333 26.2222 33.3333C23.3995 33.3333 21.1111 31.045 21.1111 28.2222C21.1111 25.3995 23.3995 23.1111 26.2222 23.1111C29.045 23.1111 31.3333 25.3995 31.3333 28.2222Z",fill:e}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M41.8776 56.3333C43.0123 60.7423 47.0146 64 51.7778 64C57.4234 64 62 59.4233 62 53.7777C62 48.1321 57.4234 43.5555 51.7778 43.5555C47.0146 43.5555 43.0123 46.8132 41.8776 51.2222H33.037V42.7036H27.9259V51.2222H24.5186V42.7036H19.4075V51.2222H16V56.3333H41.8776ZM46.6667 53.7777C46.6667 50.955 48.955 48.6666 51.7778 48.6666C54.6005 48.6666 56.8889 50.955 56.8889 53.7777C56.8889 56.6005 54.6005 58.8888 51.7778 58.8888C48.955 58.8888 46.6667 56.6005 46.6667 53.7777Z",fill:e})),pe=({fill:e="#C19CFC"})=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{width:"80",height:"80",fill:"#14142B"}),l.createElement("path",{d:"M31.4709 25.298C32.4989 23.5176 33.6931 22.7759 34.9056 22.7037C37.3649 22.5412 42.8633 26.5906 41.1236 28.9951L44.3825 34.6802C46.4644 36.425 48.5728 37.7992 50.7331 38.7119C50.3293 40.4023 51.2694 41.0081 52.2177 41.6045C50.9529 39.3902 53.4296 38.1604 54.7645 40.3573C56.1435 42.2914 56.5128 44.2986 55.6869 45.862C54.4658 48.2032 51.1897 49.9382 49.7051 52.1168C52.7276 49.3783 56.7936 49.6856 58.4012 46.5034C59.4023 44.5328 56.8993 38.6941 55.7311 36.7234C53.9213 33.6954 51.6641 34.5719 51.4091 35.5484C49.0112 34.2374 46.8769 32.1586 44.6984 30.4227C45.7173 29.5283 46.2973 28.2356 45.1824 27.5394C42.8983 26.0936 40.2459 21.7728 36.8026 20.9318C36.4598 20.847 36.1106 20.8011 35.7638 20.8011C33.9691 20.8011 32.2139 22.0183 31.4709 25.298Z",fill:"#4E4B66"}),l.createElement("path",{d:"M37.3473 76.875C40.0511 76.875 42.6867 76.5119 45.1848 75.8381C29.8061 79.9719 20.4061 62.3648 32.0948 49.9836C27.7906 48.8179 25.0244 44.4789 25.2962 39.2993C2.07278 56.3288 13.0876 76.875 37.3473 76.875ZM45.1893 75.8369C45.2134 75.83 45.2371 75.8244 45.2613 75.8175C45.2376 75.8238 45.213 75.8306 45.1893 75.8369Z",fill:e}),l.createElement("path",{d:"M40.2192 20.5976C41.2212 21.2484 42.1605 22.1161 43.0301 22.9927C51.1726 21.2124 46.0253 13.3299 50.2589 10.2479C44.9099 12.1098 48.2739 20.8412 40.2192 20.5976Z",fill:e}),l.createElement("path",{d:"M26.8951 26.9884L31.4711 25.2979C30.3556 16.0778 43.0391 12.3357 38.7527 3.125C38.5683 13.5557 25.8671 13.791 26.8951 26.9884Z",fill:e}),l.createElement("path",{d:"M38.4804 47.0009C40.7549 45.9524 43.0213 44.5328 45.2963 45.2018C42.8014 43.5662 39.7365 44.3524 36.6443 44.5693C32.4899 44.8584 28.2741 44.4967 25.2961 39.2994C26.5614 45.8709 32.4198 49.7938 38.4804 47.0009Z",fill:e}),l.createElement("path",{d:"M36.8114 13.5378C34.22 17.0091 30.8738 20.3717 31.4711 25.2978C32.358 21.3837 34.6862 20.4074 36.8028 20.9316C40.246 21.7726 42.8984 26.0934 45.1825 27.5392C46.2975 28.2354 45.7175 29.5281 44.6985 30.4225C46.877 32.1584 49.0113 34.2372 51.4092 35.5482C51.6642 34.5717 53.9215 33.6952 55.7311 36.7232C56.8994 38.6939 59.4025 44.5326 58.4013 46.5032C56.7937 49.6854 52.7277 49.3781 49.7051 52.1166C47.8608 48.7001 44.1722 47.8319 40.439 47.2809C41.9587 46.1148 43.5043 45.0662 45.2963 45.2017C43.0213 44.5326 40.755 45.9522 38.4804 47.0008C32.4198 49.7937 26.5614 45.8707 25.2962 39.2992C25.0244 44.4787 27.7906 48.8178 32.0948 49.9834C20.3866 62.3852 29.8376 80.03 45.2613 75.8175C58.4191 72.2194 68.125 59.8815 68.125 45.2017C68.125 32.1856 60.4915 21.0042 49.5827 16.1321C50.0835 19.0154 50.7158 21.7993 45.6651 25.6141C44.0753 24.2399 42.3011 21.9446 40.2191 20.5976C44.9184 20.7423 45.7265 17.8314 46.6576 15.0113C43.6573 14.0307 40.5251 13.5327 37.3768 13.5327C37.1884 13.5327 36.9999 13.5346 36.8114 13.5378ZM36.592 29.1214C37.1715 29.2386 37.7602 29.7267 38.296 30.2782C39.1656 31.1731 39.9915 31.3272 41.045 30.3869L44.3826 34.68L41.1237 28.9949C41.08 29.4471 40.7199 29.5552 40.281 29.5281C39.5171 29.4799 38.5533 28.9317 37.5421 28.9312C37.2284 28.9312 36.9102 28.9841 36.592 29.1214ZM52.2178 41.6043C52.7536 40.6734 53.4821 40.0676 54.7646 40.3571C54.272 39.5461 53.6237 39.2022 53.0655 39.2022C52.1108 39.2022 51.4197 40.2072 52.2178 41.6043Z",fill:e}),l.createElement("path",{d:"M34.4399 16.6296C32.5865 19.1329 31.0581 21.8274 31.4711 25.2982C32.358 21.3841 34.6862 20.4077 36.8028 20.932C40.246 21.773 42.8984 26.0937 45.1825 27.5396C46.2975 28.2358 45.7175 29.5285 44.6985 30.4229C46.877 32.1588 49.0113 34.2376 51.4093 35.5486C51.6642 34.5722 53.9215 33.6956 55.7311 36.7236C56.8994 38.6942 59.4025 44.533 58.4013 46.5036C56.7938 49.6858 52.7277 49.3785 49.7051 52.117C47.8608 48.7006 44.1722 47.8324 40.439 47.2814C41.9587 46.1152 43.5043 45.0666 45.2963 45.2021C43.0213 44.533 40.755 45.9526 38.4805 47.0012C32.4198 49.7941 26.5614 45.8711 25.2962 39.2996C25.0244 44.4791 27.7906 48.8181 32.0948 49.9838C24.4708 58.056 25.8148 68.3512 31.9363 73.395C49.0996 76.8656 65.2613 63.3887 65.2613 45.2021C65.2613 33.9757 59.0073 24.2586 49.8813 19.5311C49.7143 21.3481 48.7482 23.2915 45.6651 25.6144C44.0753 24.2402 42.3011 21.945 40.2191 20.5979C43.3373 20.6884 44.7513 19.4412 45.6123 17.7592C42.9339 16.9055 40.134 16.4768 37.3318 16.4768C36.3666 16.4768 35.401 16.5274 34.4399 16.6296Z",fill:"#14142B"}),l.createElement("path",{d:"M32.0948 49.9834C20.3866 62.3853 29.8376 80.03 45.2613 75.8175C27.6154 76.6125 29.3631 55.9857 40.5533 50.1193C44.5761 50.6797 48.7213 51.3942 50.7158 55.0814C53.7284 52.3523 57.7949 52.6503 59.4111 49.4681C60.0612 48.1941 59.2358 45.2926 58.2606 42.8694C58.6471 44.3616 58.796 45.7353 58.4013 46.5033C56.7937 49.6854 52.7277 49.3781 49.7051 52.1166C47.8608 48.7001 44.1722 47.8319 40.439 47.2809C41.9587 46.1148 43.5043 45.0663 45.2963 45.2017C43.0213 44.5326 40.755 45.9523 38.4804 47.0008C32.4198 49.7937 26.5614 45.8708 25.2962 39.2992C25.0244 44.4788 27.7906 48.8178 32.0948 49.9834Z",fill:"#262338"}),l.createElement("path",{d:"M29.1416 26.4583L33.7175 25.6012C32.6021 16.3811 43.9749 14.1667 39.6486 5.625C39.6486 14.1667 27.6402 14.0533 29.1416 26.4583Z",fill:"#14142B"})),be=({fill:e="black"})=>l.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M22.7898 38.3729C29.1931 21.8198 42.7306 18 42.7306 18C42.7306 18 38.3401 22.7294 35.2299 28.5503C32.12 34.3711 30.4735 44.9214 32.3029 47.832C41.267 46.0129 48.5848 35.8263 49.3165 26.9131C52.8484 29.4202 57.9147 33.2796 58.8296 44.7394C58.8296 44.7394 59.308 49.8328 56.2685 54.7441C53.2287 59.6554 46.7554 61.1106 46.7554 61.1106C46.7554 61.1106 40.3524 63.1116 33.4007 61.1106C26.7728 59.2032 17.2916 52.5875 22.7898 38.3729Z",fill:e})),me=({fill:e="black"})=>l.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("g",{clipPath:"url(#clip0_44_35)"},l.createElement("path",{d:"M27.8949 12.4346L25.2459 13.7842L12.4541 20.2997C12.4109 19.9698 12.3891 19.6374 12.389 19.3047C12.3907 17.9771 12.7393 16.673 13.4001 15.5216C14.0609 14.3702 15.0111 13.4113 16.1565 12.7401C17.3019 12.0689 18.6028 11.7086 19.9303 11.6948C21.2578 11.6811 22.5659 12.0144 23.725 12.6617L25.2412 11.8891L25.4674 11.7737C24.0784 10.7656 22.4378 10.1611 20.7267 10.0271C19.0157 9.8931 17.3009 10.2348 15.7719 11.0144C14.2429 11.794 12.9593 12.9812 12.0628 14.4448C11.1663 15.9083 10.692 17.5912 10.6922 19.3075C10.6922 19.5445 10.7012 19.7806 10.7192 20.0158C10.7444 20.3489 10.6705 20.6819 10.5069 20.9731C10.3432 21.2642 10.0971 21.5005 9.79954 21.6521L9 22.0598V23.9614L11.354 22.7616L12.1163 22.3726L12.8674 21.99L26.3526 15.119L27.8679 14.3473L31 12.751V10.8504L27.8949 12.4346Z",fill:e}),l.createElement("path",{d:"M31 14.6539L13.6334 23.4963L12.1181 24.2698L9 25.8586V27.7584L12.0967 26.1807L14.7457 24.8311L27.5505 18.3063C27.5938 18.6384 27.6156 18.9729 27.6157 19.3078C27.6148 20.6369 27.2664 21.9427 26.6049 23.0955C25.9435 24.2484 24.992 25.2081 23.8449 25.8796C22.6978 26.551 21.3951 26.9107 20.066 26.9231C18.737 26.9354 17.4278 26.5999 16.2685 25.9499L16.1754 25.9992L14.5316 26.8369C15.9203 27.8451 17.5606 28.4497 19.2714 28.584C20.9822 28.7184 22.6968 28.3771 24.2258 27.5981C25.7548 26.819 27.0386 25.6324 27.9355 24.1693C28.8323 22.7063 29.3073 21.0238 29.3078 19.3078C29.3078 19.0686 29.2985 18.8294 29.2808 18.5929C29.2557 18.26 29.3295 17.9271 29.4929 17.636C29.6564 17.3448 29.9022 17.1085 30.1995 16.9566L31 16.5489V14.6539Z",fill:e})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_44_35"},l.createElement("rect",{width:"22",height:"18.6157",fill:"white",transform:"translate(9 10)"})))),ge=({fill:e="black"})=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M12.7847 3.8762L11.1792 4.69416L3.42667 8.64294C3.40045 8.443 3.38726 8.24156 3.38718 8.03991C3.38824 7.23531 3.59948 6.44495 3.99999 5.74711C4.40049 5.04928 4.97635 4.46818 5.67054 4.06138C6.36472 3.65458 7.15314 3.4362 7.9577 3.42786C8.76225 3.41952 9.55503 3.62152 10.2575 4.01385L11.1764 3.54563L11.3135 3.47568C10.4717 2.86469 9.47736 2.49834 8.44036 2.41713C7.40337 2.33591 6.36411 2.543 5.43745 3.01549C4.51079 3.48799 3.73281 4.20749 3.1895 5.09449C2.64619 5.98149 2.3587 7.00143 2.35881 8.0416C2.35881 8.18526 2.36426 8.32836 2.37517 8.47089C2.39044 8.67273 2.34567 8.87458 2.2465 9.05105C2.14733 9.22751 1.99818 9.3707 1.81782 9.4626L1.33325 9.70968V10.8622L2.75989 10.135L3.2219 9.89922L3.67713 9.66737L11.85 5.5031L12.7684 5.03545L14.6666 4.068V2.91608L12.7847 3.8762ZM14.6666 5.22104L4.1414 10.5801L3.22302 11.0489L1.33325 12.0118V13.1632L3.21005 12.207L4.81551 11.389L12.576 7.43462C12.6022 7.63588 12.6154 7.83863 12.6155 8.0416C12.615 8.84713 12.4038 9.63852 12.0029 10.3372C11.602 11.0359 11.0253 11.6176 10.3302 12.0245C9.63497 12.4314 8.84544 12.6494 8.03995 12.6569C7.23446 12.6644 6.44101 12.4611 5.7384 12.0671L5.68199 12.097L4.68577 12.6047C5.52738 13.2157 6.52152 13.5822 7.55835 13.6636C8.59519 13.745 9.63434 13.5382 10.561 13.066C11.4877 12.5938 12.2658 11.8747 12.8093 10.988C13.3528 10.1013 13.6407 9.08162 13.641 8.0416C13.641 7.89662 13.6354 7.75165 13.6247 7.60836C13.6094 7.40659 13.6541 7.20481 13.7532 7.02837C13.8523 6.85193 14.0012 6.70869 14.1814 6.61665L14.6666 6.36957V5.22104Z",fill:e})),ye=()=>{var e;const t=Z(),{value:r,setValue:n}=ua(),{sendTransaction:d}=ae(),[f,h]=u({}),[p,b]=u(!1),[m,g]=u({memo:"",amount:"",address:""}),{appearance:y}=r.config,w=((null===(e=r.account.account)||void 0===e?void 0:e.balances)||[]).filter(e=>"liquidity_pool_shares"!==e.asset_type).filter(e=>"0.0000000"!==e.balance).map(e=>"native"===e.asset_type?{assetIssuer:"",assetCode:"XLM",balance:e.balance,assetType:e.asset_type}:{balance:e.balance,assetCode:e.asset_code,assetType:e.asset_type,assetIssuer:e.asset_issuer}),[v,x]=u(w[0]),E=e=>t=>{g(r=>({...r,[e]:t.target.value})),h(t=>({...t,[e]:""}))};return p?l.createElement(G,{assets:w,setSelectedAsset:x,setShowSelectAssetPage:b}):l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"bluxcc:relative bluxcc:mb-4"},l.createElement(se,{autoFocus:!0,type:"number",label:t("amount"),placeholder:"0.00",value:m.amount,onChange:E("amount"),error:f.amount,customLabel:l.createElement("span",{onClick:()=>{if(!v)return;const e=Number(v.balance).toString();g(t=>({...t,amount:e}))},style:{color:y.accent},className:"bluxcc:mr-2 bluxcc:inline-flex bluxcc:cursor-pointer"},t("max")," ",l.createElement(N,{fill:y.accent})),onButtonClick:()=>{b(!0)},button:l.createElement("span",{className:"bluxcc:flex bluxcc:justify-between bluxcc:!gap-1"},l.createElement("span",{className:"bluxcc:flex bluxcc:items-center"},l.createElement(ge,{fill:X(y.background)})),v?v.assetCode:"XLM")})),l.createElement("div",{className:"bluxcc:mb-4"},l.createElement(se,{label:t("to"),placeholder:t("enterAddress"),value:m.address,onChange:E("address"),error:f.address,button:t("paste"),onButtonClick:async()=>{const e=await navigator.clipboard.readText();g(t=>({...t,address:e}))}})),l.createElement("div",null,l.createElement(se,{label:t("memo"),placeholder:t("enterMemo"),value:m.memo,onChange:E("memo")})),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:y.includeBorders?y.borderWidth:"1px",borderTopColor:y.borderColor}})),l.createElement(Y,{size:"large",variant:"outline",state:"enabled",onClick:async()=>{var e;const l={};if(m.amount?Number(m.amount)>Number(v.balance)&&(l.amount=t("amountExceedsBalance")):l.amount=t("amountRequired"),m.address?s.isValidEd25519PublicKey(m.address)||(l.address=t("addressInvalid")):l.address=t("addressRequired"),h(l),0===Object.keys(l).length)try{const t=await(async(e,t,r,n,s,l,u)=>{let d=null,f=null;try{f=await l.loadAccount(r)}catch{}try{d=await l.loadAccount(s)}catch{}if(!d)throw new Error("Inactive account cannot send a transaction.");if(!f&&"native"!==n.assetType)throw new Error("Cannot send non-native asset to an inactive account.");let h=new i(d,{fee:"50000",networkPassphrase:u});if(f){let e=a.native();"native"!==n.assetType&&(e=new a(n.assetCode,n.assetIssuer)),h=h.addOperation(o.payment({amount:t,destination:r,asset:e}))}else h=h.addOperation(o.createAccount({startingBalance:t,destination:r}));return e&&(h=h.addMemo(c.text(e))),h.setTimeout(180).build().toXDR()})(m.memo,m.amount,m.address,v,null===(e=r.user.wallet)||void 0===e?void 0:e.address,r.servers.horizon,r.activeNetwork);n(e=>({...e,isModalOpen:!1})),setTimeout(()=>{d(t)},250)}catch(e){l.address=e.message,h(l)}}},t("sendButton"))))},we=()=>{const{value:e}=ua(),t=Z(),{account:r,loading:n}=e.account;return n?l.createElement("p",null,t("loading")):r?l.createElement(ye,null):l.createElement("p",null,t("inactiveAccount"))},ve=e=>navigator.clipboard.writeText(e),xe=(e,t)=>{const r=parseInt(e.replace("#",""),16);return`rgba(${r>>16&255}, ${r>>8&255}, ${255&r}, ${t})`},Ee=({variant:e="default",startIcon:t,endArrow:r,isRecent:n,label:i,onClick:o,onChange:a,onEnter:c,onSubmit:s,inputType:d="text"})=>{const f=ua(),{appearance:h}=f.value.config,p=Z(),[b,m]=u(i||""),[g,y]=u(!1),[w,v]=u(!1),E=e=>"email"===d?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e):""!==e.trim();return l.createElement("div",{onClick:"input"===e?void 0:o,className:"bluxcc:flex bluxcc:!h-14 bluxcc:w-full bluxcc:items-center bluxcc:border bluxcc:py-2 bluxcc:pr-3.5 bluxcc:pl-[10px] "+("input"===e?"bluxcc:cursor-text":"bluxcc:cursor-pointer"),style:{borderRadius:h.borderRadius,color:h.textColor,borderColor:w?h.accent:h.borderColor,backgroundColor:h.bgField,borderWidth:h.includeBorders?h.borderWidth:"1px"},onMouseEnter:t=>{"social"===e||w||(t.currentTarget.style.borderColor=h.accent,t.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:t=>{"social"===e||w||(t.currentTarget.style.borderColor=h.borderColor)}},l.createElement("span",{style:{backgroundColor:h.background,borderRadius:h.borderRadius,borderColor:h.borderColor,borderWidth:h.includeBorders?h.borderWidth:"1px"},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:border bluxcc:transition-[border-radius] bluxcc:duration-300"},t),l.createElement("div",{className:"bluxcc:relative bluxcc:ml-4 bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center"},"input"===e?l.createElement(l.Fragment,null,l.createElement("input",{type:d,value:b,onChange:e=>{const t=e.target.value;m(t),y(E(t)),null==a||a(t)},onKeyDown:e=>{"Enter"===e.key&&g&&(null==c||c(b))},placeholder:p("email"),className:"bluxcc:mr-1 bluxcc:h-full bluxcc:w-full bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:focus:outline-hidden",style:{color:h.textColor},onFocus:()=>v(!0),onBlur:()=>{v(!1),E(b)||y(!1)}}),l.createElement("div",{className:"bluxcc:flex bluxcc:h-10 bluxcc:w-[100px] bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent"},l.createElement("button",{disabled:!g,onClick:()=>null==s?void 0:s(b),className:"bluxcc:absolute bluxcc:right-0 bluxcc:flex bluxcc:h-8 bluxcc:w-[68px]! bluxcc:items-center bluxcc:justify-center bluxcc:border bluxcc:!text-sm bluxcc:font-medium bluxcc:transition-[border-radius,background,border-color] bluxcc:duration-150",style:{background:h.bgField,borderRadius:h.borderRadius,borderColor:g?h.accent:h.borderColor,color:g?h.accent:"#999999",borderWidth:h.includeBorders?h.borderWidth:"1px"}},p("submit")))):l.createElement("span",{className:"bluxcc:font-medium bluxcc:select-none"},i)),n&&l.createElement("div",{className:"bluxcc:px-2 bluxcc:py-1 bluxcc:text-xs bluxcc:font-normal",style:{color:h.accent,borderRadius:h.borderRadius,backgroundColor:`${xe(h.accent,.1)}`}},p("recent")),r&&l.createElement("span",{className:"bluxcc:ml-auto bluxcc:flex bluxcc:items-center"},l.createElement(x,{fill:h.textColor})))},Ce=(e,t=8)=>e.slice(0,t)+"..."+e.slice(-t),_e=()=>{var e,t;const{logout:r}=ae(),n=Z(),i=ua(),[o,a]=u(!1),c=i.value.config.appearance,s=null===(e=i.value.user.wallet)||void 0===e?void 0:e.address,d=i.value.account.account?null===(t=i.value.account.account.balances.find(e=>"native"===e.asset_type))||void 0===t?void 0:t.balance:"0";return l.createElement("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:mt-4 bluxcc:size-[73px] bluxcc:rounded-full",style:{background:c.accent}}),l.createElement("p",{className:"bluxcc:!mt-6 bluxcc:!mb-4 bluxcc:inline-flex bluxcc:cursor-pointer bluxcc:text-base",onClick:()=>{ve(s).then(()=>{a(!0),setTimeout(()=>{a(!1)},1e3)}).catch(()=>{})},style:{color:c.textColor}},o?n("copied"):l.createElement("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1"},s?Ce(s,5):"",l.createElement(k,{fill:c.textColor}))),l.createElement("p",{className:"bluxcc:text-center bluxcc:text-base",style:{color:c.accent}},d?`${$(d)} XLM`:n("loading")),l.createElement("div",{className:"bluxcc:mt-[16px] bluxcc:w-full bluxcc:space-y-2"},l.createElement(Ee,{endArrow:!0,label:n("send"),startIcon:l.createElement(B,{fill:c.textColor}),onClick:()=>{i.setRoute(K.SEND)}}),l.createElement(Ee,{endArrow:!0,label:n("activity"),startIcon:l.createElement(I,{fill:c.textColor}),onClick:()=>{i.setRoute(K.ACTIVITY)}})),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:c.includeBorders?c.borderWidth:"1px",borderTopColor:c.borderColor}})),l.createElement("div",{style:{color:c.textColor},onClick:()=>{r()},className:"bluxcc:flex bluxcc:h-12 bluxcc:w-full bluxcc:cursor-pointer bluxcc:items-center bluxcc:justify-center bluxcc:gap-2"},l.createElement(S,{fill:c.textColor}),n("logout")))},Ae=(e,t)=>{switch(e){case"Rabet":return l.createElement(fe,{fill:t?"#ffffff":"#B8BAC4"});case"Freighter":return l.createElement(he,{fill:t?"#7863FF":"#310CCC"});case"Albedo":return l.createElement(le,null);case"LOBSTR":return l.createElement(be,{fill:t?"#ffffff":"#1a8da0"});case"xBull":return l.createElement(pe,{fill:t?"#FFFFFF":"#C19CFC"});case"Hana":return l.createElement(ue,{fill:t?"#E6E0F7":"#221542"});case"Hot":return l.createElement(de,null);default:return null}},Me=async e=>{try{const{passphrase:t}=await e.getNetwork();return t}catch(e){return""}},Se=e=>{const t=e.replace("#","");return!((.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5)},ke="__BLUX__RECENT_CONNECTION_METHODS",Ie=()=>{const e=localStorage.getItem(ke);if(!e)return[];try{return JSON.parse(e)}catch(e){return[]}},Be=()=>{var e,t,r,n,i,o,a,c;const s=ua(),h=Z(),p=f(!1),[b,m]=u(!1),[g,y]=u(null),w=s.value.availableWallets,{user:v,config:x}=s.value,E=s.value.waitingStatus,C=s.value.config.appearance,{xdr:A,options:M}=s.value.signTransaction;d(()=>{var e,t;if(!(null===(e=null==v?void 0:v.wallet)||void 0===e?void 0:e.name))return;const r=null===(t=w.find(({wallet:e})=>{var t;return e.name===(null===(t=null==v?void 0:v.wallet)||void 0===t?void 0:t.name)}))||void 0===t?void 0:t.wallet;r&&y(r)},[w,null==v?void 0:v.wallet]),d(()=>{!p.current&&g&&(p.current=!0,S(g))},[g]);const S=async e=>{var t;if("signing"===E)try{const r=await oe(e,A,null===(t=s.value.user.wallet)||void 0===t?void 0:t.address,M,x.transports||{});s.setValue(e=>({...e,signTransaction:{...e.signTransaction,result:r}})),s.setRoute(K.SUCCESSFUL)}catch(e){throw m(!0),e}else try{const{publicKey:t}=await e.connect();if(t&&""!==t.trim()){const r=await Me(e);s.setValue(n=>({...n,user:{...n.user,wallet:{passphrase:r,name:e.name,address:t}}})),(e=>{const t=Ie(),r=[e,...t.filter(t=>t!==e)];localStorage.setItem(ke,JSON.stringify(r))})(e.name),setTimeout(()=>{s.setRoute(K.SUCCESSFUL)},400)}}catch(e){throw m(!0),e}};return l.createElement("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none"},b?l.createElement("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center"},l.createElement(z,null)):l.createElement("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:border",style:{borderColor:C.borderColor,borderWidth:C.includeBorders?C.borderWidth:"1px"}},Ae(null!==(t=null===(e=null==v?void 0:v.wallet)||void 0===e?void 0:e.name)&&void 0!==t?t:"",Se(C.background))),l.createElement("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium"},l.createElement("p",{className:"bluxcc:text-xl"},b?"connecting"===E?h("loginFailed"):h("signingFailed",{walletName:null!==(n=null===(r=null==v?void 0:v.wallet)||void 0===r?void 0:r.name)&&void 0!==n?n:"wallet"}):"connecting"===E?h("waitingFor",{walletName:null!==(o=null===(i=null==v?void 0:v.wallet)||void 0===i?void 0:i.name)&&void 0!==o?o:"wallet"}):h("signingWith",{walletName:null!==(c=null===(a=null==v?void 0:v.wallet)||void 0===a?void 0:a.name)&&void 0!==c?c:"wallet"})),l.createElement("p",{className:"bluxcc:text-sm"},h(b?"connecting"===E?"loginRetryMessage":"signingRetryMessage":"connecting"===E?"acceptConnection":"signRequestInWallet"))),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:C.includeBorders?C.borderWidth:"1px",borderTopColor:C.borderColor}})),b?l.createElement(Y,{onClick:()=>{m(!1),g&&S(g)},state:"enabled",variant:"outline"},h("tryAgain")):l.createElement(Y,{state:"enabled",variant:"outline",className:"bluxcc:cursor-default!",startIcon:l.createElement(_,{fill:C.accent})},h("connecting"===E?"connecting":"signing")))},Ne=e=>e.replace(/([A-Z])/g," $1").replace(/_/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase()),Le={steexp:{[v.mainnet]:"https://steexp.com",[v.testnet]:"https://testnet.steexp.com",ledgerUrl:"ledger",transactionUrl:"tx",accountUrl:"account"},stellarexpert:{[v.mainnet]:"https://stellar.expert/explorer/public",[v.testnet]:"https://stellar.expert/explorer/testnet",ledgerUrl:"ledger",accountUrl:"account",transactionUrl:"tx"},lumenscan:{[v.mainnet]:"https://lumenscan.io",[v.testnet]:"https://testnet.lumenscan.io",ledgerUrl:"ledgers",accountUrl:"account",operationUrl:"ops",transactionUrl:"txns"},stellarchain:{[v.mainnet]:"https://stellarchain.io",[v.testnet]:"https://testnet.stellarchain.io",[v.futurenet]:"https://futurenet.stellarchain.io",ledgerUrl:"ledgers",accountUrl:"accounts",operationUrl:"operations",transactionUrl:"transactions"}},Te=(e,t,r,n)=>{let i=Le[t];i||(i=Le.stellarchain);let o=i[e];return o?`${o}/${i[r]}/${n}`:null};var Re=l.memo(({tx:e})=>{const t=ua(),r=Te(t.value.activeNetwork,t.value.config.explorer,"transactionUrl",e.hash);return l.createElement("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between"},l.createElement("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-start bluxcc:gap-3"},l.createElement("div",{className:"bluxcc:flex bluxcc:size-10 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",style:{backgroundColor:t.value.config.appearance.background}},(e=>{switch(e){case"Receive":return l.createElement(R,null);case"Send":return l.createElement(L,null);default:return l.createElement(T,null)}})(e.title)),l.createElement("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start"},l.createElement("p",{className:"bluxcc:text-start bluxcc:text-xs bluxcc:font-medium",style:{color:t.value.config.appearance.textColor}},e.title),l.createElement("p",{className:"bluxcc:text-sm bluxcc:font-medium"},e.description))),l.createElement("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:text-xs bluxcc:text-gray-600"},(e=>{const t=new Date(e);return`${t.getUTCDate()} ${t.toLocaleString("en-US",{month:"long"})}`})(e.date),l.createElement("div",{className:"bluxcc:flex bluxcc:size-8 bluxcc:cursor-pointer bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",title:"View transaction details",onClick:()=>{r&&window.open(r,"_blank","noopener,noreferrer")},style:{backgroundColor:t.value.config.appearance.bgField}},l.createElement("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center"},l.createElement(O,null)))))});const Oe=e=>"native"===e.asset_type?"XLM":e.asset_code||"Pool",Pe=()=>{var e;const[t,n]=u([]),{transactions:i,loading:o}=ga({includeOperations:!0}),{value:a}=ua(),c=Z(),s=null===(e=a.user.wallet)||void 0===e?void 0:e.address,f=Te(a.activeNetwork,a.config.explorer,"accountUrl",s);d(()=>{if(!i)return;const e=[];for(const t of i){const n=t.operations[0],i={hash:t.hash,description:"",date:t.created_at,title:Ne(n.type)};if(t.operations.length>1)i.title=c("multiOperation");else if("payment"===n.type){let e=c("send");n.to.toLowerCase()===s.toLowerCase()&&(e=c("receive")),i.title=e,i.description=`${$(n.amount)} ${Oe(n)}`}else n.type!==r.HorizonApi.OperationResponseType.pathPaymentStrictSend&&n.type!==r.HorizonApi.OperationResponseType.pathPayment||(i.title=c("swap"),i.description=`Received ${n.amount} ${Oe(n)}`);e.push(i)}n(e)},[i]);const h=!o&&0===t.length;return l.createElement("div",{className:"bluxcc:flex bluxcc:h-[335px] bluxcc:flex-col"},o?l.createElement("div",{className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:text-gray-700"},c("loadingActivity")):h?l.createElement("div",{className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:text-gray-700"},c("noActivityFound")):t.map((e,r)=>l.createElement("div",{key:r,style:{borderBottomStyle:"dashed",borderBottomWidth:r<t.length-1?a.config.appearance.includeBorders?a.config.appearance.borderWidth:"1px":"0px",borderBottomColor:a.config.appearance.borderColor},className:"bluxcc:p-2"},l.createElement(Re,{tx:e}))),t.length>0&&f&&l.createElement("div",{className:"bluxcc:absolute bluxcc:bottom-4 bluxcc:left-1/2 bluxcc:!mt-4 bluxcc:w-[calc(100%-3rem)] bluxcc:-translate-x-1/2 bluxcc:transform"},l.createElement(Y,{state:"enabled",variant:"outline",size:"medium",onClick:()=>{f&&window.open(f,"_blank","noopener,noreferrer")}},c("seeAllInExplorer"))))},Ue=e=>{var t;return`${null===(t=e[0])||void 0===t?void 0:t.toUpperCase()}${e.slice(1)}`},ze=()=>{const e=ua(),t=Z(),r=e.value.waitingStatus,n=e.value.config.appearance,{result:i,options:o}=e.value.signTransaction;let a;if(i)if(o.isSoroban){a=i.txHash}else{a=i.hash}const c=a?Te(o.network,e.value.config.explorer,"transactionUrl",a):null;d(()=>{"connecting"===r&&setTimeout(()=>{e.setValue(e=>({...e,isModalOpen:!1,showAllWallets:!1,isAuthenticated:!0}))},1e3)},[]);return l.createElement("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none"},l.createElement("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-[68px] bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden"},l.createElement(M,null)),l.createElement("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium"},l.createElement("p",{className:"bluxcc:text-xl"},t("connecting"===r?"connectionSuccessfulTitle":"transactionSuccessfulTitle")),l.createElement("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5"},"connecting"===r?t("connectionSuccessfulMessage",{appName:Ue(e.value.config.appName)}):t("transactionSuccessfulMessage"))),"signing"===r&&a&&"string"==typeof c&&l.createElement(Y,{state:"enabled",variant:"outline",size:"small",className:"mt-4",onClick:()=>{c&&window.open(c,"_blank","noopener,noreferrer")}},t("seeInExplorer")),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:n.includeBorders?n.borderWidth:"1px",borderTopColor:n.borderColor}})),"connecting"===r?l.createElement(Y,{state:"enabled",variant:"outline",className:"bluxcc:cursor-default!"},t("loggingIn")):l.createElement(Y,{state:"enabled",variant:"fill",size:"large",onClick:()=>{if(e.setValue(e=>({...e,isModalOpen:!1})),"signing"===r){const{resolver:t,result:r}=e.value.signTransaction;t&&r&&t(r)}}},t("done")))},Fe=()=>{const{value:e,setValue:t,setRoute:r}=ua(),n=Z(),[i,o]=u(""),a=e.availableWallets,{appearance:c}=e.config,s=e.config.loginMethods||[],d=s.includes("passkey"),f=h(()=>[...[...s].filter(e=>"passkey"!==e),...d?["passkey"]:[]],[s,d]),p=h(()=>a.length>3?a.slice(2):[],[a]),b=h(()=>a.length<=3?a:e.showAllWallets?a.slice(2,a.length):a.slice(0,2),[a,e.showAllWallets]),m=()=>{t(e=>({...e,user:{...e.user,email:i}})),r(K.OTP)},g=()=>l.createElement("div",{className:"bluxcc:my-1 bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:z-10",style:{borderTopWidth:c.includeBorders?c.borderWidth:"1px",borderTopStyle:"dashed",borderTopColor:c.borderColor}}),l.createElement("span",{className:"bluxcc:z-20 bluxcc:w-auto bluxcc:px-2 bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",style:{backgroundColor:c.background,color:c.borderColor}},n("or")));return l.createElement("div",{className:"bluxcc:w-full"},e.config.appearance.logo&&l.createElement("div",{className:"bluxcc:my-6 bluxcc:flex bluxcc:max-h-[80px] bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden"},l.createElement("img",{src:e.config.appearance.logo,alt:e.config.appName,width:152,height:60,className:"bluxcc:max-h-[80px] bluxcc:max-w-[180px]",loading:"eager",decoding:"async",draggable:"false",style:{contentVisibility:"auto"}})),l.createElement("div",{className:"bluxcc:space-y-2"},f.map((i,a)=>{const s=f[a+1],u=f[a-1],d=f.includes("wallet"),h=d&&!e.showAllWallets&&"wallet"===i&&"email"===s||d&&"email"===i&&"wallet"!==u;return"wallet"===i?l.createElement(l.Fragment,{key:"wallet"},b.map(e=>l.createElement(Ee,{key:e.wallet.name,...e,label:e.wallet.name,isRecent:e.isRecent,startIcon:Ae(e.wallet.name,Se(c.background)),onClick:()=>{return n=e.wallet,t(e=>({...e,user:{...e.user,wallet:{address:null,passphrase:"",name:n.name},waitingStatus:"connecting"}})),void r(K.WAITING);var n}})),p.length>0&&!e.showAllWallets&&l.createElement(Ee,{endArrow:!0,label:n("allStellarWallets"),isRecent:!1,startIcon:l.createElement(me,{fill:X(c.bgField)}),onClick:()=>t(e=>({...e,showAllWallets:!0}))}),h&&g()):e.showAllWallets||"email"!==i?e.showAllWallets||"passkey"!==i?null:l.createElement("div",{key:"passkey",className:"bluxcc:mt-6! bluxcc:flex bluxcc:h-4 bluxcc:cursor-pointer bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:leading-[28px] bluxcc:font-medium",style:{color:c.accent}},n("logInWithPasskey")," "):l.createElement(l.Fragment,{key:"email"},l.createElement(l.Fragment,null,l.createElement(Ee,{inputType:"email",variant:"input",isRecent:!1,startIcon:l.createElement(P,{fill:c.textColor}),onChange:e=>o(e),onEnter:m,onSubmit:m}),h&&g()))})),l.createElement("footer",{className:"bluxcc:w-full bluxcc:cursor-pointer bluxcc:pt-[17px] bluxcc:text-center bluxcc:text-xs bluxcc:font-medium"},l.createElement("a",{"aria-label":"blux website",href:"https://blux.cc",target:"_blank",rel:"noreferrer",style:{color:c.textColor}},n("poweredByBlux"))))},je=({otp:e,setOtp:t,error:r})=>{const n=e.length,i=ua(),{appearance:o}=i.value.config,a=f([]);d(()=>{r&&setTimeout(()=>{var e;return null===(e=a.current[0])||void 0===e?void 0:e.focus()},1001)},[r]);const c=e=>{e.preventDefault();const r=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,n);if(!r)return;const i=[...r.split(""),...Array(n-r.length).fill("")];t(i),setTimeout(()=>{var e;return null===(e=a.current[n-1])||void 0===e?void 0:e.focus()},0)},s=e=>({borderRadius:o.borderRadius,color:o.accent,background:o.bgField,"--tw-ring-color":r?"#FF6666":o.accent,borderColor:r?"#FF6666":e?o.accent:o.borderColor,borderWidth:o.includeBorders?o.borderWidth:"1px"});return l.createElement("div",{className:"bluxcc:flex bluxcc:gap-1"},e.map((r,i)=>l.createElement("input",{autoFocus:0===i,key:i,ref:e=>{a.current[i]=e},type:"text",inputMode:"numeric",maxLength:1,value:r,onChange:r=>((r,i)=>{var o;const c=i.target.value.replace(/\D/g,"");if(!c)return;const s=[...e];s[r]=c[0],t(s),r<n-1&&c&&(null===(o=a.current[r+1])||void 0===o||o.focus())})(i,r),onPaste:c,onKeyDown:r=>((r,n)=>{var i;if("Backspace"===n.key){const n=[...e];n[r]?(n[r]="",t(n)):r>0&&(null===(i=a.current[r-1])||void 0===i||i.focus(),n[r-1]="",t(n))}})(i,r),className:"bluxcc:h-14 bluxcc:w-12 bluxcc:border bluxcc:text-center bluxcc:text-lg bluxcc:outline-hidden bluxcc:focus:ring-1",style:s(r)})))},De=()=>{const{value:e}=ua(),t=e.config.appearance,r=Z(),n=e.user.email,[i,o]=u(Array(6).fill("")),[a,c]=u(!1);return d(()=>{const e=i.join("");6===e.length&&(async e=>{c(!1),await new Promise(t=>{setTimeout(()=>{t("123456"===e)},200)})||(c(!0),setTimeout(()=>o(Array(6).fill("")),1e3))})(e)},[i,n]),l.createElement("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none"},l.createElement("div",{style:{borderColor:t.borderColor,borderWidth:t.includeBorders?t.borderWidth:"1px"},className:"bluxcc:mb-6 bluxcc:flex bluxcc:h-20 bluxcc:w-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:border-2"},l.createElement(U,{fill:t.textColor})),l.createElement("div",{className:"bluxcc:flex-col bluxcc:space-y-1 bluxcc:text-center"},l.createElement("p",{className:"bluxcc:text-xl bluxcc:font-medium"},r("enterConfirmationCodeTitle")),a?l.createElement("p",{className:"bluxcc:flex bluxcc:h-10 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:text-alert-error"},r("invalidCodeError")):l.createElement("p",{className:"bluxcc:h-10 bluxcc:text-sm"},r("enterConfirmationCodeHelp"))),l.createElement("div",{className:"bluxcc:mt-6 bluxcc:text-center"},l.createElement(je,{otp:i,setOtp:o,error:a})),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:t.includeBorders?t.borderWidth:"1px",borderTopColor:t.borderColor}})),l.createElement(Y,{size:"medium",state:"enabled",variant:"text",onClick:()=>{},style:{color:t.accent}},r("resendCode")))},He=()=>{const e=Z();return l.createElement("div",null,l.createElement("p",null,e("wrongNetworkMessage")))},qe=({operationsCount:e,sender:t,receiver:r,network:n,estimatedFee:i,action:o})=>{const a=ua().value.config.appearance,c=[{label:"Action",value:Ue(o)},{label:"Operations",value:e.toString()},{label:"Sender",value:Ce(t,5),isHighlighted:!0,isCopyable:!0,copyValue:t},{label:"Network",value:te[n].name},{label:"Estimated Fee",value:`${i} XLM`}];return r&&c.splice(3,0,{label:"To",value:Ce(r,5),isHighlighted:!0,isCopyable:!0,copyValue:r}),l.createElement("div",{className:"bluxcc:w-full bluxcc:text-sm bluxcc:text-gray-800"},c.map(({label:e,value:t,isHighlighted:r,isCopyable:n,copyValue:i},o)=>l.createElement("div",{key:o,className:"bluxcc:flex bluxcc:justify-between bluxcc:px-4 bluxcc:py-2",style:o===c.length-1?{}:{borderBottomColor:a.borderColor,borderBottomStyle:"dashed",borderBottomWidth:a.includeBorders?a.borderWidth:"1px"}},l.createElement("span",{style:{color:a.textColor}},e),l.createElement("span",{className:""+(n?"bluxcc:cursor-pointer":""),style:{color:r?a.accent:a.textColor},onClick:()=>n&&i&&ve(i)},t))))},Ke=()=>{var e,t;const r=Z(),n=ua(),{balance:i}=ba({asset:"native"}),o=n.value.config.appearance,{xdr:a,options:c}=n.value.signTransaction,s=Q(a,c.network);if(!s)return l.createElement("div",null,l.createElement("p",null,r("invalidXdr")));const u=(e=>{const t=Object.entries(v).find(t=>t[1]===e);let r="";return r=t?t[0].toUpperCase():"MAINNET",r})(n.value.activeNetwork),d=(null===(e=n.value.user.wallet)||void 0===e?void 0:e.name)===H.Lobstr;return l.createElement("div",{className:"bluxcc:w-full"},l.createElement("p",{className:"bluxcc:mx-3 bluxcc:my-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none"},l.createElement("span",{className:"bluxcc:font-semibold bluxcc:capitalize"},n.value.config.appName," "),r("signTransactionPrompt")),l.createElement(qe,{operationsCount:s.operations,sender:s.sender,receiver:s.receiver,network:c.network,estimatedFee:s.estimatedFee.toString(),action:s.action}),d&&l.createElement("p",{className:"bluxcc:!my-2 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:!text-xs bluxcc:text-alert-error"},r("lobstrWarning",{network:u})),l.createElement("div",{className:"bluxcc:inline-flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{marginTop:d?"0px":"16px",borderRadius:o.borderRadius,borderColor:o.borderColor}},l.createElement("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap"},l.createElement("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap"},r("yourWallet")),l.createElement("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:`${xe(o.textColor,.8)}`}},(null===(t=n.value.user.wallet)||void 0===t?void 0:t.address)?Ce(n.value.user.wallet.address,5):r("noAddressFound"))),l.createElement("div",{className:"bluxcc:overflow-hidden bluxcc:px-[10px] bluxcc:py-2",style:{borderRadius:o.borderRadius,backgroundColor:o.bgField,color:o.textColor}},l.createElement("p",{className:"bluxcc:max-w-[90px] bluxcc:text-xs bluxcc:font-normal"},i?$(i):"0"," XLM"))),l.createElement("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center"},l.createElement("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:o.includeBorders?o.borderWidth:"1px",borderTopColor:o.borderColor}})),l.createElement(Y,{size:"large",state:"enabled",variant:"fill",onClick:async()=>{n.setValue(e=>({...e,isModalOpen:!0,waitingStatus:"signing"})),n.setRoute(K.WAITING)}},r("approve")))};function Ve({isOpen:e,closeModal:t}){const{route:r,setRoute:n,value:i,setValue:o}=ua();let a;r===K.WAITING&&"signing"!==i.waitingStatus||r===K.ONBOARDING&&i.showAllWallets||r===K.ACTIVITY||r===K.SEND||r===K.OTP?a="back":r===K.ONBOARDING&&(a="info");const c=(s=i.config.lang,{[K.ONBOARDING]:{title:W("logInOrSignUp",s),Component:l.createElement(Fe,null)},[K.PROFILE]:{title:W("profile",s),Component:l.createElement(_e,null)},[K.WAITING]:{title:"",Component:l.createElement(Be,null)},[K.SUCCESSFUL]:{title:"",Component:l.createElement(ze,null)},[K.SIGN_TRANSACTION]:{title:W("confirmation",s),Component:l.createElement(Ke,null)},[K.SEND]:{title:W("send",s),Component:l.createElement(we,null)},[K.ACTIVITY]:{title:W("activity",s),Component:l.createElement(Pe,null)},[K.OTP]:{title:W("enterConfirmationCodeTitle",s),Component:l.createElement(De,null)},[K.WRONG_NETWORK]:{isSticky:!0,title:W("wrongNetwork",s),Component:l.createElement(He,null)}});var s;const{title:u,Component:d,isSticky:f}=c[r],h=r===K.WRONG_NETWORK||r===K.WAITING||r===K.SUCCESSFUL;return l.createElement(D,{isOpen:e,onBack:()=>{r===K.WAITING||r===K.OTP&&!i.isAuthenticated?n(K.ONBOARDING):i.showAllWallets?o(e=>({...e,showAllWallets:!1})):r!==K.SEND&&r!==K.ACTIVITY||n(K.PROFILE)},onClose:f?()=>{}:()=>{t();const e=i.waitingStatus,{resolver:n,rejecter:o,result:a}=i.signTransaction;r===K.SUCCESSFUL&&"signing"===e?n&&a&&n(a):r===K.SIGN_TRANSACTION&&o&&o({code:4001,message:"User rejected the transaction"})},title:u,isSticky:f,icon:a,closeButton:!h},d)}const We={theme:"light",logo:"",font:"Manrope",accent:"#0c1083",borderWidth:"1px",bgField:"#ffffff",borderRadius:"32px",textColor:"#000000",background:"#ffffff",includeBorders:!0,borderColor:"#cdceee"},Ze={theme:"dark",logo:"",font:"Manrope",accent:"#ffffff",borderWidth:"1px",bgField:"#1a1a1a",borderRadius:"32px",textColor:"#ffffff",background:"#000000",includeBorders:!0,borderColor:"#333333"};var $e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ge(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var Xe,Je={},Ye={},Qe={},et={},tt={};function rt(){return Xe||(Xe=1,tt.__esModule=!0,tt.integers=void 0,tt.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]),tt}var nt,it={};function ot(){if(nt)return it;nt=1,it.__esModule=!0,it.DecodeBuffer=it.EncodeBuffer=void 0;var e=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();it.EncodeBuffer=e;var t=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();return it.DecodeBuffer=t,it}var at,ct,st={};function lt(){if(at)return st;at=1;var e,t=st&&st.__extends||(e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)});st.__esModule=!0,st.validate_schema=st.ErrorSchema=st.expect_enum=st.expect_same_size=st.expect_bigint=st.expect_type=st.isArrayLike=void 0;var r=rt();st.isArrayLike=function(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)},st.expect_type=function(e,t,r){if(typeof e!==t)throw new Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))},st.expect_bigint=function(e,t){if(!["number","string","bigint","boolean"].includes(typeof e)&&!("object"==typeof e&&null!==e&&"toString"in e))throw new Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))},st.expect_same_size=function(e,t,r){if(e!==t)throw new Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))},st.expect_enum=function(e,t){if("object"!=typeof e||null===e)throw new Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))};var n=r.integers.concat(["bool","string"]),i=["option","enum","array","set","map","struct"],o=function(e){function r(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return t(r,e),r}(Error);function a(e){if("string"!=typeof e||!n.includes(e)){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&i.includes(t[0])){var r=t[0];if("option"===r)return a(e[r]);if("enum"===r)return function(e){if(!Array.isArray(e))throw new o(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw new Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw new Error('The "struct" in each enum must have a single key');a({struct:n.struct})}}(e[r]);if("array"===r)return function(e){if("object"!=typeof e)throw new o(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw new Error("Invalid schema: ".concat(e));if("type"in e)return a(e.type);throw new o(e,"{ type, len? }")}(e[r]);if("set"===r)return a(e[r]);if("map"===r)return function(e){if("object"!=typeof e||!("key"in e)||!("value"in e))throw new o(e,"{ key, value }");a(e.key),a(e.value)}(e[r]);if("struct"===r)return function(e){if("object"!=typeof e)throw new o(e,"object");for(var t in e)a(e[t])}(e[r])}}throw new o(e,i.join(", ")+" or "+n.join(", "))}}return st.ErrorSchema=o,st.validate_schema=a,st}var ut,dt,ft={};var ht,pt={exports:{}},bt=Ge(Object.freeze({__proto__:null,default:{}}));var mt,gt={},yt={};function wt(){return mt||(mt=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.KeySize=yt.KeyType=void 0,function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1"}(e||(yt.KeyType=e={})),yt.KeySize={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64}),yt;var e}var vt,xt={},Et={};function Ct(){if(vt)return Et;vt=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.KeyPairBase=void 0;return Et.KeyPairBase=class{},Et}var _t,At={},Mt={},St={};var kt,It={},Bt={},Nt={GasLimitExceeded:"Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName:"Method name is empty",WasmerCompileError:"Wasmer compilation error: {{msg}}",GuestPanic:"Smart contract panicked: {{panic_msg}}",Memory:"Error creating Wasm memory",GasExceeded:"Exceeded the prepaid gas",MethodUTF8Error:"Method name is not valid UTF8 string",BadUTF16:"String encoding is bad UTF-16 sequence",WasmTrap:"WebAssembly trap: {{msg}}",GasInstrumentation:"Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex:"{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex:"Accessed invalid promise result index: {{result_idx}}",Deserialization:"Error happened while deserializing the module",MethodNotFound:"Contract method is not found",InvalidRegisterId:"Accessed invalid register id: {{register_id}}",InvalidReceiptIndex:"VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName:"Method name is empty in contract call",CannotReturnJointPromise:"Returning joint promise is currently prohibited",StackHeightInstrumentation:"Stack instrumentation failed",CodeDoesNotExist:"Cannot find contract code for account {{account_id}}",MethodInvalidSignature:"Invalid method signature",IntegerOverflow:"Integer overflow happened during contract execution",MemoryAccessViolation:"MemoryAccessViolation",InvalidIteratorIndex:"Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated:"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId:"VM Logic returned an invalid account id",Serialization:"Error happened while serializing the module",CannotAppendActionToJointPromise:"Actions can only be appended to non-joint promise.",InternalMemoryDeclared:"Internal memory declaration has been found in the module",Instantiate:"Error happened during instantiation",ProhibitedInView:"{{method_name}} is not allowed in view calls",InvalidMethodName:"VM Logic returned an invalid method name",BadUTF8:"String encoding is bad UTF-8 sequence",BalanceExceeded:"Exceeded the account balance",LinkError:"Wasm contract link error: {{msg}}",InvalidPublicKey:"VM Logic provided an invalid public key",ActorNoPermission:"Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState:"The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch:"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow:"Transaction gas or balance cost is too high",InvalidSignature:"Transaction is not signed with the given public key",AccessKeyNotFound:'Signer "{{account_id}}" doesn\'t have access key with the given public_key {{public_key}}',NotEnoughBalance:"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance:"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired:"Transaction has expired",DeleteAccountStaking:"Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist:"Signer {{signer_id}} does not exist",TriesToStake:"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists:"The public key {{public_key}} is already used for an existing access key",InvalidSigner:"Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed:"The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess:"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake:"Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce:"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists:"Can't create a new account {{account_id}}, because it already exists",InvalidChain:"Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist:"Can't complete the action because account {{account_id}} doesn't exist",AccessKeyDoesNotExist:"Can't complete the action because access key {{public_key}} doesn't exist",MethodNameMismatch:"Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver:"Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist:"Account {{account_id}} tries to remove an access key that doesn't exist",Timeout:"Timeout exceeded",Closed:"Connection closed",ShardCongested:"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later",ShardStuck:"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"};function Lt(){if(kt)return Bt;kt=1;var e=Bt&&Bt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.ErrorMessages=void 0;const t=e(Nt);return Bt.ErrorMessages=t.default,Bt}var Tt,Rt={},Ot={},Pt={};var Ut,zt={};var Ft,jt={};var Dt,Ht={},qt={};var Kt,Vt,Wt,Zt={};function $t(){return Vt||(Vt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FinalExecutionStatusBasic=e.ExecutionStatusBasic=e.IdType=void 0;var t,r=(Dt||(Dt=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(t||(qt.IdType=t={}))),qt);Object.defineProperty(e,"IdType",{enumerable:!0,get:function(){return r.IdType}});var n,i,o=(Kt||(Kt=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.FinalExecutionStatusBasic=Zt.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(n||(Zt.ExecutionStatusBasic=n={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(i||(Zt.FinalExecutionStatusBasic=i={}))),Zt);Object.defineProperty(e,"ExecutionStatusBasic",{enumerable:!0,get:function(){return o.ExecutionStatusBasic}}),Object.defineProperty(e,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return o.FinalExecutionStatusBasic}})}(Ht)),Ht}function Gt(){return Wt||(Wt=1,e=Ot,t=Ot&&Ot.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=Ot&&Ot.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)},Object.defineProperty(e,"__esModule",{value:!0}),r((Tt||(Tt=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.Assignable=void 0,Pt.Assignable=class{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}),Pt),e),r((Ut||(Ut=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.Enum=void 0,zt.Enum=class{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}),zt),e),r(function(){if(Ft)return jt;Ft=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.ErrorContext=jt.TypedError=jt.ArgumentTypeError=jt.PositionalArgsError=void 0;class e extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}jt.PositionalArgsError=e;class t extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}jt.ArgumentTypeError=t;class r extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}return jt.TypedError=r,jt.ErrorContext=class{transactionHash;constructor(e){this.transactionHash=e}},jt}(),e),r($t(),e)),Ot;var e,t,r}var Xt,Jt={exports:{}};function Yt(){return Xt||(Xt=1,Jt.exports=function(){var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function r(e){return"function"==typeof e}function n(e){return t(e)?"array":typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function a(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var c=RegExp.prototype.test;function s(e,t){return c.call(e,t)}var l=/\S/;function u(e){return!s(l,e)}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function f(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return d[e]})}var h=/\s*/,p=/\s+/,b=/\s*=/,m=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function y(e,r){if(!e)return[];var n,o,a,c=!1,s=[],l=[],d=[],f=!1,y=!1,E="",C=0;function A(){if(f&&!y)for(;d.length;)delete l[d.pop()];else d=[];f=!1,y=!1}function M(e){if("string"==typeof e&&(e=e.split(p,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);n=new RegExp(i(e[0])+"\\s*"),o=new RegExp("\\s*"+i(e[1])),a=new RegExp("\\s*"+i("}"+e[1]))}M(r||_.tags);for(var S,k,I,B,N,L,T=new x(e);!T.eos();){if(S=T.pos,I=T.scanUntil(n))for(var R=0,O=I.length;R<O;++R)u(B=I.charAt(R))?(d.push(l.length),E+=B):(y=!0,c=!0,E+=" "),l.push(["text",B,S,S+1]),S+=1,"\n"===B&&(A(),E="",C=0,c=!1);if(!T.scan(n))break;if(f=!0,k=T.scan(g)||"name",T.scan(h),"="===k?(I=T.scanUntil(b),T.scan(b),T.scanUntil(o)):"{"===k?(I=T.scanUntil(a),T.scan(m),T.scanUntil(o),k="&"):I=T.scanUntil(o),!T.scan(o))throw new Error("Unclosed tag at "+T.pos);if(N=">"==k?[k,I,S,T.pos,E,C,c]:[k,I,S,T.pos],C++,l.push(N),"#"===k||"^"===k)s.push(N);else if("/"===k){if(!(L=s.pop()))throw new Error('Unopened section "'+I+'" at '+S);if(L[1]!==I)throw new Error('Unclosed section "'+L[1]+'" at '+S)}else"name"===k||"{"===k||"&"===k?y=!0:"="===k&&M(I)}if(A(),L=s.pop())throw new Error('Unclosed section "'+L[1]+'" at '+T.pos);return v(w(l))}function w(e){for(var t,r,n=[],i=0,o=e.length;i<o;++i)(t=e[i])&&("text"===t[0]&&r&&"text"===r[0]?(r[1]+=t[1],r[3]=t[3]):(n.push(t),r=t));return n}function v(e){for(var t,r=[],n=r,i=[],o=0,a=e.length;o<a;++o)switch((t=e[o])[0]){case"#":case"^":n.push(t),i.push(t),n=t[4]=[];break;case"/":i.pop()[5]=t[2],n=i.length>0?i[i.length-1][4]:r;break;default:n.push(t)}return r}function x(e){this.string=e,this.tail=e,this.pos=0}function E(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function C(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}x.prototype.eos=function(){return""===this.tail},x.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},x.prototype.scanUntil=function(e){var t,r=this.tail.search(e);switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t},E.prototype.push=function(e){return new E(e,this)},E.prototype.lookup=function(e){var t,n=this.cache;if(n.hasOwnProperty(e))t=n[e];else{for(var i,c,s,l=this,u=!1;l;){if(e.indexOf(".")>0)for(i=l.view,c=e.split("."),s=0;null!=i&&s<c.length;)s===c.length-1&&(u=o(i,c[s])||a(i,c[s])),i=i[c[s++]];else i=l.view[e],u=o(l.view,e);if(u){t=i;break}l=l.parent}n[e]=t}return r(t)&&(t=t.call(this.view)),t},C.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},C.prototype.parse=function(e,t){var r=this.templateCache,n=e+":"+(t||_.tags).join(":"),i=void 0!==r,o=i?r.get(n):void 0;return null==o&&(o=y(e,t),i&&r.set(n,o)),o},C.prototype.render=function(e,t,r,n){var i=this.parse(e,n),o=t instanceof E?t:new E(t,void 0);return this.renderTokens(i,o,r,e,n)},C.prototype.renderTokens=function(e,t,r,n,i){for(var o,a,c,s="",l=0,u=e.length;l<u;++l)c=void 0,"#"===(a=(o=e[l])[0])?c=this.renderSection(o,t,r,n):"^"===a?c=this.renderInverted(o,t,r,n):">"===a?c=this.renderPartial(o,t,r,i):"&"===a?c=this.unescapedValue(o,t):"name"===a?c=this.escapedValue(o,t):"text"===a&&(c=this.rawValue(o)),void 0!==c&&(s+=c);return s},C.prototype.renderSection=function(e,n,i,o){var a=this,c="",s=n.lookup(e[1]);function l(e){return a.render(e,n,i)}if(s){if(t(s))for(var u=0,d=s.length;u<d;++u)c+=this.renderTokens(e[4],n.push(s[u]),i,o);else if("object"==typeof s||"string"==typeof s||"number"==typeof s)c+=this.renderTokens(e[4],n.push(s),i,o);else if(r(s)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(s=s.call(n.view,o.slice(e[3],e[5]),l))&&(c+=s)}else c+=this.renderTokens(e[4],n,i,o);return c}},C.prototype.renderInverted=function(e,r,n,i){var o=r.lookup(e[1]);if(!o||t(o)&&0===o.length)return this.renderTokens(e[4],r,n,i)},C.prototype.indentPartial=function(e,t,r){for(var n=t.replace(/[^ \t]/g,""),i=e.split("\n"),o=0;o<i.length;o++)i[o].length&&(o>0||!r)&&(i[o]=n+i[o]);return i.join("\n")},C.prototype.renderPartial=function(e,t,n,i){if(n){var o=r(n)?n(e[1]):n[e[1]];if(null!=o){var a=e[6],c=e[5],s=e[4],l=o;return 0==c&&s&&(l=this.indentPartial(o,s,a)),this.renderTokens(this.parse(l,i),t,n,l)}}},C.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(null!=r)return r},C.prototype.escapedValue=function(e,t){var r=t.lookup(e[1]);if(null!=r)return _.escape(r)},C.prototype.rawValue=function(e){return e[1]};var _={name:"mustache.js",version:"4.0.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){A.templateCache=e},get templateCache(){return A.templateCache}},A=new C;return _.clearCache=function(){return A.clearCache()},_.parse=function(e,t){return A.parse(e,t)},_.render=function(e,t,r,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return A.render(e,t,r,i)},_.escape=f,_.Scanner=x,_.Context=E,_.Writer=C,_}()),Jt.exports}var Qt,er,tr={},rr={};function nr(){return Qt||(Qt=1,function(e){function t(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function r(e,...r){if(!t(e))throw new Error("Uint8Array expected");if(r.length>0&&!r.includes(e.length))throw new Error("Uint8Array expected of length "+r+", got length="+e.length)}function n(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function i(e){if("function"!=typeof e)throw new Error("function expected");return!0}function o(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function a(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function c(e){if(!Array.isArray(e))throw new Error("array expected")}function s(e,t){if(!n(!0,t))throw new Error(`${e}: array of strings expected`)}function l(e,t){if(!n(!1,t))throw new Error(`${e}: array of numbers expected`)}function u(...e){const t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map(e=>e.encode).reduceRight(r,t),decode:e.map(e=>e.decode).reduce(r,t)}}function d(e){const t="string"==typeof e?e.split(""):e,r=t.length;s("alphabet",t);const n=new Map(t.map((e,t)=>[e,t]));return{encode:n=>(c(n),n.map(n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]})),decode:t=>(c(t),t.map(t=>{o("alphabet.decode",t);const r=n.get(t);if(void 0===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}function f(e=""){return o("join",e),{encode:t=>(s("join.decode",t),t.join(e)),decode:t=>(o("join.decode",t),t.split(e))}}function h(e,t="="){return a(e),o("padding",t),{encode(r){for(s("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){s("padding.decode",r);let n=r.length;if(n*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--){if((n-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return r.slice(0,n)}}}function p(e){return i(e),{encode:e=>e,decode:t=>e(t)}}function b(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(c(e),!e.length)return[];let n=0;const i=[],o=Array.from(e,e=>{if(a(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e}),s=o.length;for(;;){let e=0,a=!0;for(let i=n;i<s;i++){const c=o[i],s=t*e,l=s+c;if(!Number.isSafeInteger(l)||s/t!==e||l-c!==s)throw new Error("convertRadix: carry overflow");const u=l/r;e=l%r;const d=Math.floor(u);if(o[i]=d,!Number.isSafeInteger(d)||d*r+e!==l)throw new Error("convertRadix: carry overflow");a&&(d?a=!1:n=i)}if(i.push(e),a)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.createBase58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64urlnopad=e.base64url=e.base64nopad=e.base64=e.base32crockford=e.base32hexnopad=e.base32hex=e.base32nopad=e.base32=e.base16=e.utils=void 0;const m=(e,t)=>0===t?e:m(t,e%t),g=(e,t)=>e+(t-m(e,t)),y=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function w(e,t,r,n){if(c(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(g(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${g(t,r)}`);let i=0,o=0;const s=y[t],l=y[r]-1,u=[];for(const n of e){if(a(n),n>=s)throw new Error(`convertRadix2: invalid data word=${n} from=${t}`);if(i=i<<t|n,o+t>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)u.push((i>>o-r&l)>>>0);const e=y[o];if(void 0===e)throw new Error("invalid carry");i&=e-1}if(i=i<<r-o&l,!n&&o>=t)throw new Error("Excess padding");if(!n&&i>0)throw new Error(`Non-zero padding: ${i}`);return n&&o>0&&u.push(i>>>0),u}function v(e){a(e);return{encode:r=>{if(!t(r))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(r),256,e)},decode:t=>(l("radix.decode",t),Uint8Array.from(b(t,e,256)))}}function x(e,r=!1){if(a(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(g(8,e)>32||g(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!t(n))throw new Error("radix2.encode input should be Uint8Array");return w(Array.from(n),8,e,!r)},decode:t=>(l("radix2.decode",t),Uint8Array.from(w(t,e,8,r)))}}function E(e){return i(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function C(e,r){return a(e),i(r),{encode(n){if(!t(n))throw new Error("checksum.encode: input should be Uint8Array");const i=r(n).slice(0,e),o=new Uint8Array(n.length+e);return o.set(n),o.set(i,n.length),o},decode(n){if(!t(n))throw new Error("checksum.decode: input should be Uint8Array");const i=n.slice(0,-e),o=n.slice(-e),a=r(i).slice(0,e);for(let t=0;t<e;t++)if(a[t]!==o[t])throw new Error("Invalid checksum");return i}}}e.utils={alphabet:d,chain:u,checksum:C,convertRadix:b,convertRadix2:w,radix:v,radix2:x,join:f,padding:h},e.base16=u(x(4),d("0123456789ABCDEF"),f("")),e.base32=u(x(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),h(5),f("")),e.base32nopad=u(x(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),f("")),e.base32hex=u(x(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),h(5),f("")),e.base32hexnopad=u(x(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),f("")),e.base32crockford=u(x(5),d("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),f(""),p(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const _=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)(),A=(e,t)=>{o("base64",e);const r=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,n=t?"base64url":"base64";if(e.length>0&&!r.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:n,lastChunkHandling:"strict"})};e.base64=_?{encode:e=>(r(e),e.toBase64()),decode:e=>A(e,!1)}:u(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),h(6),f("")),e.base64nopad=u(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),f("")),e.base64url=_?{encode:e=>(r(e),e.toBase64({alphabet:"base64url"})),decode:e=>A(e,!0)}:u(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),h(6),f("")),e.base64urlnopad=u(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),f(""));const M=e=>u(v(58),d(e),f(""));e.base58=M("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=M("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=M("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const S=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(t){let r="";for(let n=0;n<t.length;n+=8){const i=t.subarray(n,n+8);r+=e.base58.encode(i).padStart(S[i.length],"1")}return r},decode(t){let r=[];for(let n=0;n<t.length;n+=11){const i=t.slice(n,n+11),o=S.indexOf(i.length),a=e.base58.decode(i);for(let e=0;e<a.length-o;e++)if(0!==a[e])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(a.slice(a.length-o)))}return Uint8Array.from(r)}};e.createBase58check=t=>u(C(4,e=>t(t(e))),e.base58),e.base58check=e.createBase58check;const k=u(d("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),f("")),I=[996825010,642813549,513874426,1027748829,705979059];function B(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<I.length;e++)1==(t>>e&1)&&(r^=I[e]);return r}function N(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=B(i)^r>>5}i=B(i);for(let t=0;t<n;t++)i=B(i)^31&e.charCodeAt(t);for(let e of t)i=B(i)^e;for(let e=0;e<6;e++)i=B(i);return i^=r,k.encode(w([i%y[30]],30,5,!1))}function L(e){const r="bech32"===e?1:734539939,n=x(5),i=n.decode,a=n.encode,c=E(i);function s(e,n,i=90){o("bech32.encode prefix",e),t(n)&&(n=Array.from(n)),l("bech32.encode",n);const a=e.length;if(0===a)throw new TypeError(`Invalid prefix length ${a}`);const c=a+7+n.length;if(!1!==i&&c>i)throw new TypeError(`Length ${c} exceeds limit ${i}`);const s=e.toLowerCase(),u=N(s,n,r);return`${s}1${k.encode(n)}${u}`}function u(e,t=90){o("bech32.decode input",e);const n=e.length;if(n<8||!1!==t&&n>t)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${t})`);const i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const a=i.lastIndexOf("1");if(0===a||-1===a)throw new Error('Letter "1" must be present between prefix and data only');const c=i.slice(0,a),s=i.slice(a+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const l=k.decode(s).slice(0,-6),u=N(c,l,r);if(!s.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected "${u}"`);return{prefix:c,words:l}}return{encode:s,decode:u,encodeFromBytes:function(e,t){return s(e,a(t))},decodeToBytes:function(e){const{prefix:t,words:r}=u(e,!1);return{prefix:t,words:r,bytes:i(r)}},decodeUnsafe:E(u),fromWords:i,fromWordsUnsafe:c,toWords:a}}e.bech32=L("bech32"),e.bech32m=L("bech32m"),e.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)};const T=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),R={encode:e=>(r(e),e.toHex()),decode:e=>(o("hex",e),Uint8Array.fromHex(e))};e.hex=T?R:u(x(4),d("0123456789abcdef"),f(""),p(e=>{if("string"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const O={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},P="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";e.bytesToString=(e,r)=>{if("string"!=typeof e||!O.hasOwnProperty(e))throw new TypeError(P);if(!t(r))throw new TypeError("bytesToString() expects Uint8Array");return O[e].encode(r)},e.str=e.bytesToString;e.stringToBytes=(e,t)=>{if(!O.hasOwnProperty(e))throw new TypeError(P);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return O[e].decode(t)},e.bytes=e.stringToBytes}(rr)),rr}function ir(){return er||(er=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.baseDecode=e.baseEncode=e.parseNearAmount=e.formatNearAmount=e.NEAR_NOMINATION=e.NEAR_NOMINATION_EXP=void 0;const t=nr();e.NEAR_NOMINATION_EXP=24,e.NEAR_NOMINATION=10n**BigInt(e.NEAR_NOMINATION_EXP);const r=[];for(let t=0,n=5n;t<e.NEAR_NOMINATION_EXP;t++,n*=10n)r[t]=n;e.formatNearAmount=function(t,n=e.NEAR_NOMINATION_EXP){let i=BigInt(t);if(n!==e.NEAR_NOMINATION_EXP){const t=e.NEAR_NOMINATION_EXP-n-1;t>0&&(i+=r[t])}const o=(t=i.toString()).substring(0,t.length-e.NEAR_NOMINATION_EXP)||"0",a=t.substring(t.length-e.NEAR_NOMINATION_EXP).padStart(e.NEAR_NOMINATION_EXP,"0").substring(0,n);return`${function(e){const t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}(o)}.${a}`.replace(/\.?0*$/,"")},e.parseNearAmount=function(t){if(!t)return null;const r=(t=t.replace(/,/g,"").trim()).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>e.NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${t}' as NEAR amount`);return function(e){if(""===(e=e.replace(/^0+/,"")))return"0";return e}(n+i.padEnd(e.NEAR_NOMINATION_EXP,"0"))},e.baseEncode=function(e){if("string"==typeof e){const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return t.base58.encode(e)},e.baseDecode=function(e){return t.base58.decode(e)}}(tr)),tr}var or,ar,cr={schema:{AccessKeyNotFound:{name:"AccessKeyNotFound",subtypes:[],props:{account_id:"",public_key:""}},AccountAlreadyExists:{name:"AccountAlreadyExists",subtypes:[],props:{account_id:""}},AccountDoesNotExist:{name:"AccountDoesNotExist",subtypes:[],props:{account_id:""}},ActionError:{name:"ActionError",subtypes:["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],props:{index:""}},ActionsValidationError:{name:"ActionsValidationError",subtypes:["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],props:{}},ActorNoPermission:{name:"ActorNoPermission",subtypes:[],props:{account_id:"",actor_id:""}},AddKeyAlreadyExists:{name:"AddKeyAlreadyExists",subtypes:[],props:{account_id:"",public_key:""}},AddKeyMethodNameLengthExceeded:{name:"AddKeyMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},AddKeyMethodNamesNumberOfBytesExceeded:{name:"AddKeyMethodNamesNumberOfBytesExceeded",subtypes:[],props:{limit:"",total_number_of_bytes:""}},AltBn128InvalidInput:{name:"AltBn128InvalidInput",subtypes:[],props:{msg:""}},BadUTF16:{name:"BadUTF16",subtypes:[],props:{}},BadUTF8:{name:"BadUTF8",subtypes:[],props:{}},BalanceExceeded:{name:"BalanceExceeded",subtypes:[],props:{}},BalanceMismatchError:{name:"BalanceMismatchError",subtypes:[],props:{final_accounts_balance:"",final_postponed_receipts_balance:"",forwarded_buffered_receipts_balance:"",incoming_receipts_balance:"",incoming_validator_rewards:"",initial_accounts_balance:"",initial_postponed_receipts_balance:"",new_buffered_receipts_balance:"",new_delayed_receipts_balance:"",other_burnt_amount:"",outgoing_receipts_balance:"",processed_delayed_receipts_balance:"",slashed_burnt_amount:"",tx_burnt_amount:""}},CallIndirectOOB:{name:"CallIndirectOOB",subtypes:[],props:{}},CannotAppendActionToJointPromise:{name:"CannotAppendActionToJointPromise",subtypes:[],props:{}},CannotReturnJointPromise:{name:"CannotReturnJointPromise",subtypes:[],props:{}},CodeDoesNotExist:{name:"CodeDoesNotExist",subtypes:[],props:{account_id:""}},CompilationError:{name:"CompilationError",subtypes:["CodeDoesNotExist","PrepareError","WasmerCompileError"],props:{}},ContractSizeExceeded:{name:"ContractSizeExceeded",subtypes:[],props:{limit:"",size:""}},CostOverflow:{name:"CostOverflow",subtypes:[],props:{}},CreateAccountNotAllowed:{name:"CreateAccountNotAllowed",subtypes:[],props:{account_id:"",predecessor_id:""}},CreateAccountOnlyByRegistrar:{name:"CreateAccountOnlyByRegistrar",subtypes:[],props:{account_id:"",predecessor_id:"",registrar_account_id:""}},DelegateActionExpired:{name:"DelegateActionExpired",subtypes:[],props:{}},DelegateActionInvalidNonce:{name:"DelegateActionInvalidNonce",subtypes:[],props:{ak_nonce:"",delegate_nonce:""}},DelegateActionInvalidSignature:{name:"DelegateActionInvalidSignature",subtypes:[],props:{}},DelegateActionMustBeOnlyOne:{name:"DelegateActionMustBeOnlyOne",subtypes:[],props:{}},DelegateActionNonceTooLarge:{name:"DelegateActionNonceTooLarge",subtypes:[],props:{delegate_nonce:"",upper_bound:""}},DelegateActionSenderDoesNotMatchTxReceiver:{name:"DelegateActionSenderDoesNotMatchTxReceiver",subtypes:[],props:{receiver_id:"",sender_id:""}},DeleteAccountStaking:{name:"DeleteAccountStaking",subtypes:[],props:{account_id:""}},DeleteAccountWithLargeState:{name:"DeleteAccountWithLargeState",subtypes:[],props:{account_id:""}},DeleteActionMustBeFinal:{name:"DeleteActionMustBeFinal",subtypes:[],props:{}},DeleteKeyDoesNotExist:{name:"DeleteKeyDoesNotExist",subtypes:[],props:{account_id:"",public_key:""}},DepositWithFunctionCall:{name:"DepositWithFunctionCall",subtypes:[],props:{}},Deprecated:{name:"Deprecated",subtypes:[],props:{method_name:""}},Deserialization:{name:"Deserialization",subtypes:[],props:{}},ECRecoverError:{name:"ECRecoverError",subtypes:[],props:{msg:""}},Ed25519VerifyInvalidInput:{name:"Ed25519VerifyInvalidInput",subtypes:[],props:{msg:""}},EmptyMethodName:{name:"EmptyMethodName",subtypes:[],props:{}},Expired:{name:"Expired",subtypes:[],props:{}},FunctionCallArgumentsLengthExceeded:{name:"FunctionCallArgumentsLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallMethodNameLengthExceeded:{name:"FunctionCallMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallZeroAttachedGas:{name:"FunctionCallZeroAttachedGas",subtypes:[],props:{}},GasExceeded:{name:"GasExceeded",subtypes:[],props:{}},GasInstrumentation:{name:"GasInstrumentation",subtypes:[],props:{}},GasLimitExceeded:{name:"GasLimitExceeded",subtypes:[],props:{}},GenericTrap:{name:"GenericTrap",subtypes:[],props:{}},GuestPanic:{name:"GuestPanic",subtypes:[],props:{panic_msg:""}},HostError:{name:"HostError",subtypes:["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],props:{}},IllegalArithmetic:{name:"IllegalArithmetic",subtypes:[],props:{}},IncorrectCallIndirectSignature:{name:"IncorrectCallIndirectSignature",subtypes:[],props:{}},IndirectCallToNull:{name:"IndirectCallToNull",subtypes:[],props:{}},Instantiate:{name:"Instantiate",subtypes:[],props:{}},InsufficientStake:{name:"InsufficientStake",subtypes:[],props:{account_id:"",minimum_stake:"",stake:""}},IntegerOverflow:{name:"IntegerOverflow",subtypes:[],props:{}},InternalMemoryDeclared:{name:"InternalMemoryDeclared",subtypes:[],props:{}},InvalidAccessKeyError:{name:"InvalidAccessKeyError",subtypes:["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],props:{}},InvalidAccountId:{name:"InvalidAccountId",subtypes:[],props:{}},InvalidChain:{name:"InvalidChain",subtypes:[],props:{}},InvalidDataReceiverId:{name:"InvalidDataReceiverId",subtypes:[],props:{account_id:""}},InvalidIteratorIndex:{name:"InvalidIteratorIndex",subtypes:[],props:{iterator_index:""}},InvalidMethodName:{name:"InvalidMethodName",subtypes:[],props:{}},InvalidNonce:{name:"InvalidNonce",subtypes:[],props:{ak_nonce:"",tx_nonce:""}},InvalidPredecessorId:{name:"InvalidPredecessorId",subtypes:[],props:{account_id:""}},InvalidPromiseIndex:{name:"InvalidPromiseIndex",subtypes:[],props:{promise_idx:""}},InvalidPromiseResultIndex:{name:"InvalidPromiseResultIndex",subtypes:[],props:{result_idx:""}},InvalidPublicKey:{name:"InvalidPublicKey",subtypes:[],props:{}},InvalidReceiptIndex:{name:"InvalidReceiptIndex",subtypes:[],props:{receipt_index:""}},InvalidReceiverId:{name:"InvalidReceiverId",subtypes:[],props:{account_id:""}},InvalidRegisterId:{name:"InvalidRegisterId",subtypes:[],props:{register_id:""}},InvalidSignature:{name:"InvalidSignature",subtypes:[],props:{}},InvalidSignerId:{name:"InvalidSignerId",subtypes:[],props:{account_id:""}},InvalidTxError:{name:"InvalidTxError",subtypes:["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],props:{}},IteratorWasInvalidated:{name:"IteratorWasInvalidated",subtypes:[],props:{iterator_index:""}},KeyLengthExceeded:{name:"KeyLengthExceeded",subtypes:[],props:{length:"",limit:""}},LackBalanceForState:{name:"LackBalanceForState",subtypes:[],props:{account_id:"",amount:""}},Memory:{name:"Memory",subtypes:[],props:{}},MemoryAccessViolation:{name:"MemoryAccessViolation",subtypes:[],props:{}},MemoryOutOfBounds:{name:"MemoryOutOfBounds",subtypes:[],props:{}},MethodEmptyName:{name:"MethodEmptyName",subtypes:[],props:{}},MethodInvalidSignature:{name:"MethodInvalidSignature",subtypes:[],props:{}},MethodNameMismatch:{name:"MethodNameMismatch",subtypes:[],props:{method_name:""}},MethodNotFound:{name:"MethodNotFound",subtypes:[],props:{}},MethodResolveError:{name:"MethodResolveError",subtypes:["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],props:{}},MisalignedAtomicAccess:{name:"MisalignedAtomicAccess",subtypes:[],props:{}},NonceTooLarge:{name:"NonceTooLarge",subtypes:[],props:{tx_nonce:"",upper_bound:""}},NotEnoughAllowance:{name:"NotEnoughAllowance",subtypes:[],props:{account_id:"",allowance:"",cost:"",public_key:""}},NotEnoughBalance:{name:"NotEnoughBalance",subtypes:[],props:{balance:"",cost:"",signer_id:""}},NumberInputDataDependenciesExceeded:{name:"NumberInputDataDependenciesExceeded",subtypes:[],props:{limit:"",number_of_input_data_dependencies:""}},NumberOfLogsExceeded:{name:"NumberOfLogsExceeded",subtypes:[],props:{limit:""}},NumberPromisesExceeded:{name:"NumberPromisesExceeded",subtypes:[],props:{limit:"",number_of_promises:""}},OnlyImplicitAccountCreationAllowed:{name:"OnlyImplicitAccountCreationAllowed",subtypes:[],props:{account_id:""}},PrepareError:{name:"PrepareError",subtypes:["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],props:{}},ProhibitedInView:{name:"ProhibitedInView",subtypes:[],props:{method_name:""}},ReceiptSizeExceeded:{name:"ReceiptSizeExceeded",subtypes:[],props:{limit:"",size:""}},ReceiptValidationError:{name:"ReceiptValidationError",subtypes:["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],props:{}},ReceiverMismatch:{name:"ReceiverMismatch",subtypes:[],props:{ak_receiver:"",tx_receiver:""}},RequiresFullAccess:{name:"RequiresFullAccess",subtypes:[],props:{}},ReturnedValueLengthExceeded:{name:"ReturnedValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},Serialization:{name:"Serialization",subtypes:[],props:{}},ShardCongested:{name:"ShardCongested",subtypes:[],props:{congestion_level:"",shard_id:""}},ShardStuck:{name:"ShardStuck",subtypes:[],props:{missed_chunks:"",shard_id:""}},SignerDoesNotExist:{name:"SignerDoesNotExist",subtypes:[],props:{signer_id:""}},StackHeightInstrumentation:{name:"StackHeightInstrumentation",subtypes:[],props:{}},StackOverflow:{name:"StackOverflow",subtypes:[],props:{}},TooManyFunctions:{name:"TooManyFunctions",subtypes:[],props:{}},TooManyLocals:{name:"TooManyLocals",subtypes:[],props:{}},TotalLogLengthExceeded:{name:"TotalLogLengthExceeded",subtypes:[],props:{length:"",limit:""}},TotalNumberOfActionsExceeded:{name:"TotalNumberOfActionsExceeded",subtypes:[],props:{limit:"",total_number_of_actions:""}},TotalPrepaidGasExceeded:{name:"TotalPrepaidGasExceeded",subtypes:[],props:{limit:"",total_prepaid_gas:""}},TransactionSizeExceeded:{name:"TransactionSizeExceeded",subtypes:[],props:{limit:"",size:""}},TriesToStake:{name:"TriesToStake",subtypes:[],props:{account_id:"",balance:"",locked:"",stake:""}},TriesToUnstake:{name:"TriesToUnstake",subtypes:[],props:{account_id:""}},TxExecutionError:{name:"TxExecutionError",subtypes:["ActionError","InvalidTxError"],props:{}},Unreachable:{name:"Unreachable",subtypes:[],props:{}},UnsuitableStakingKey:{name:"UnsuitableStakingKey",subtypes:[],props:{public_key:""}},UnsupportedProtocolFeature:{name:"UnsupportedProtocolFeature",subtypes:[],props:{protocol_feature:"",version:""}},ValueLengthExceeded:{name:"ValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},WasmTrap:{name:"WasmTrap",subtypes:["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],props:{}},WasmerCompileError:{name:"WasmerCompileError",subtypes:[],props:{msg:""}},Closed:{name:"Closed",subtypes:[],props:{}},ServerError:{name:"ServerError",subtypes:["TxExecutionError","Timeout","Closed"],props:{}},Timeout:{name:"Timeout",subtypes:[],props:{}}}};function sr(){if(or)return Rt;or=1;var e=Rt&&Rt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.getErrorTypeFromErrorMessage=Rt.formatError=Rt.parseResultError=Rt.parseRpcError=Rt.ServerError=void 0;const t=Gt(),r=e(Yt()),n=ir(),i=Lt(),o=e(cr),a={formatNear:()=>(e,t)=>(0,n.formatNearAmount)(t(e))};class c extends t.TypedError{}Rt.ServerError=c;class s extends c{transaction_outcome}function l(e){const t={},r=d(e,o.default.schema,t,""),n=new c(u(r,t),r);return Object.assign(n,t),n}function u(e,t){return"string"==typeof i.ErrorMessages[e]?r.default.render(i.ErrorMessages[e],{...t,...a}):JSON.stringify(t)}function d(e,t,r,n){let i,o,a;for(const r in t){if(h(e[r]))return e[r];if(f(e[r]))i=e[r],o=t[r],a=r;else{if(!f(e.kind)||!f(e.kind[r]))continue;i=e.kind[r],o=t[r],a=r}}if(i&&o){for(const e of Object.keys(o.props))r[e]=i[e];return d(i,t,r,a)}return r.kind=e,n}function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function h(e){return"[object String]"===Object.prototype.toString.call(e)}return Rt.parseRpcError=l,Rt.parseResultError=function(e){const t=l(e.status.Failure),r=new s;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r},Rt.formatError=u,Rt.getErrorTypeFromErrorMessage=function(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}},Rt}function lr(){return ar||(ar=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseRpcError=e.parseResultError=e.getErrorTypeFromErrorMessage=e.formatError=e.ServerError=e.ErrorMessages=void 0;var t=Lt();Object.defineProperty(e,"ErrorMessages",{enumerable:!0,get:function(){return t.ErrorMessages}});var r=sr();Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return r.ServerError}}),Object.defineProperty(e,"formatError",{enumerable:!0,get:function(){return r.formatError}}),Object.defineProperty(e,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return r.getErrorTypeFromErrorMessage}}),Object.defineProperty(e,"parseResultError",{enumerable:!0,get:function(){return r.parseResultError}}),Object.defineProperty(e,"parseRpcError",{enumerable:!0,get:function(){return r.parseRpcError}})}(It)),It}var ur,dr={},fr={},hr={};function pr(){if(ur)return hr;ur=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.ConsoleLogger=void 0;return hr.ConsoleLogger=class{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":case"warn":case"log":case"debug":case"verbose":return}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}},hr}var br,mr,gr,yr={};function wr(){return mr||(mr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Logger=e.ConsoleLogger=void 0;var t=pr();Object.defineProperty(e,"ConsoleLogger",{enumerable:!0,get:function(){return t.ConsoleLogger}});var r=function(){if(br)return yr;br=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.Logger=void 0;const e=new(pr().ConsoleLogger)(["verbose","debug","log","warn","error","fatal"]);return yr.Logger=class{static instanceRef=e;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}},yr}();Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return r.Logger}})}(fr)),fr}var vr,xr={};var Er,Cr,_r={};var Ar,Mr,Sr,kr={};function Ir(){if(Ar)return kr;return Ar=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.sortBigIntAsc=void 0,kr.sortBigIntAsc=function(e,t){return e<t?-1:e>t?1:0},kr}function Br(){if(Mr)return _r;Mr=1;var e=_r&&_r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_r,"__esModule",{value:!0}),_r.diffEpochValidators=_r.findSeatPrice=void 0;const t=e(function(){if(Cr)return Er;function e(e,t){if("function"!=typeof e)throw new TypeError("argument fn must be a function");return e}function t(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable")}return Cr=1,Er=function(r){if(!r)throw new TypeError("argument namespace is required");function n(e){}return n._file=void 0,n._ignored=!0,n._namespace=r,n._traced=!1,n._warned=Object.create(null),n.function=e,n.property=t,n}}()),r=Ir();return _r.findSeatPrice=function(e,n,i,o){if(o&&o<49)return function(e,t){const n=e.map(e=>BigInt(e.stake)).sort(r.sortBigIntAsc),i=BigInt(t),o=n.reduce((e,t)=>e+t);if(o<i)throw new Error("Stakes are below seats");let a=1n,c=o+1n;for(;a!==c-1n;){const e=(a+c)/2n;let t=!1,r=0n;for(let o=0;o<n.length;++o)if(r+=n[o]/e,r>=i){a=e,t=!0;break}t||(c=e)}return a}(e,n);if(!i){(0,t.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),i=[1,6250]}return function(e,t,n){if(2!=n.length)throw Error("minimumStakeRatio should have 2 elements");const i=e.map(e=>BigInt(e.stake)).sort(r.sortBigIntAsc),o=i.reduce((e,t)=>e+t);return e.length<t?o*BigInt(n[0])/BigInt(n[1]):i[0]+1n}(e,n,i)},_r.diffEpochValidators=function(e,t){const r=new Map;e.forEach(e=>r.set(e.account_id,e));const n=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!r.has(e.account_id)),removedValidators:e.filter(e=>!n.has(e.account_id)),changedValidators:t.filter(e=>r.has(e.account_id)&&r.get(e.account_id).stake!=e.stake).map(e=>({current:r.get(e.account_id),next:e}))}},_r}function Nr(){return Sr||(Sr=1,e=Mt,t=Mt&&Mt.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=Mt&&Mt.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)},Object.defineProperty(e,"__esModule",{value:!0}),r((_t||(_t=1,Object.defineProperty(St,"__esModule",{value:!0}),St.DEFAULT_FUNCTION_CALL_GAS=void 0,St.DEFAULT_FUNCTION_CALL_GAS=30000000000000n),St),e),r(lr(),e),r(ir(),e),r(function(){if(gr)return dr;gr=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.printTxOutcomeLogs=dr.printTxOutcomeLogsAndFailures=void 0;const e=lr(),t=wr();function r({contractId:e,logs:r,prefix:n=""}){for(const i of r)t.Logger.log(`${n}Log [${e}]: ${i}`)}return dr.printTxOutcomeLogsAndFailures=function({contractId:n,outcome:i}){const o=[i.transaction_outcome,...i.receipts_outcome].reduce((t,r)=>{const n="object"==typeof r.outcome.status&&"object"==typeof r.outcome.status.Failure;return r.outcome.logs.length||n?t.concat({receiptIds:r.outcome.receipt_ids,logs:r.outcome.logs,failure:"object"==typeof r.outcome.status&&void 0!==r.outcome.status.Failure?(0,e.parseRpcError)(r.outcome.status.Failure):null}):t},[]);for(const e of o)t.Logger.log(`Receipt${e.receiptIds.length>1?"s":""}: ${e.receiptIds.join(", ")}`),r({contractId:n,logs:e.logs,prefix:"\t"}),e.failure&&t.Logger.warn(`\tFailure [${n}]: ${e.failure}`)},dr.printTxOutcomeLogs=r,dr}(),e),r((vr||(vr=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.getTransactionLastResult=void 0,xr.getTransactionLastResult=function(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){const t=Buffer.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}),xr),e),r(Br(),e),r(wr(),e),r(Ir(),e)),Mt;var e,t,r}var Lr,Tr={},Rr={},Or={},Pr={};function Ur(){if(Lr)return Pr;function e(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function t(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}return Lr=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.anumber=e,Pr.abytes=t,Pr.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");e(t.outputLen),e(t.blockLen)},Pr.aexists=function(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")},Pr.aoutput=function(e,r){t(e);const n=r.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)},Pr}var zr,Fr,jr,Dr={},Hr={};function qr(){return Fr||(Fr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.isLE=void 0,e.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},e.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},e.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},e.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},e.rotr=function(e,t){return e<<32-t|e>>>t},e.rotl=function(e,t){return e<<t|e>>>32-t>>>0},e.byteSwap=n,e.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=n(e[t])},e.bytesToHex=function(e){(0,r.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},e.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=a(e.charCodeAt(i)),o=a(e.charCodeAt(i+1));if(void 0===r||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+o}return n},e.asyncLoop=async function(t,r,n){let i=Date.now();for(let o=0;o<t;o++){n(o);const t=Date.now()-i;t>=0&&t<r||(await(0,e.nextTick)(),i+=t)}},e.utf8ToBytes=c,e.toBytes=s,e.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const i=e[n];(0,r.abytes)(i),t+=i.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n},e.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},e.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},e.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.randomBytes=function(e=32){if(t.crypto&&"function"==typeof t.crypto.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&"function"==typeof t.crypto.randomBytes)return t.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const t=(zr||(zr=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.crypto=void 0,Hr.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0),Hr),r=Ur();function n(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.byteSwapIfBE=e.isLE?e=>e:e=>n(e);const i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const o={_0:48,_9:57,A:65,F:70,a:97,f:102};function a(e){return e>=o._0&&e<=o._9?e-o._0:e>=o.A&&e<=o.F?e-(o.A-10):e>=o.a&&e<=o.f?e-(o.a-10):void 0}function c(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function s(e){return"string"==typeof e&&(e=c(e)),(0,r.abytes)(e),e}e.nextTick=async()=>{};e.Hash=class{clone(){return this._cloneInto()}}}(Dr)),Dr}function Kr(){if(jr)return Or;jr=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.HashMD=void 0,Or.setBigUint64=r,Or.Chi=function(e,t,r){return e&t^~e&r},Or.Maj=function(e,t,r){return e&t^e&r^t&r};const e=Ur(),t=qr();function r(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),c=Number(r&o),s=n?4:0,l=n?0:4;e.setUint32(t+s,a,n),e.setUint32(t+l,c,n)}class n extends t.Hash{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,t.createView)(this.buffer)}update(r){(0,e.aexists)(this);const{view:n,buffer:i,blockLen:o}=this,a=(r=(0,t.toBytes)(r)).length;for(let e=0;e<a;){const c=Math.min(o-this.pos,a-e);if(c===o){const n=(0,t.createView)(r);for(;o<=a-e;e+=o)this.process(n,e);continue}i.set(r.subarray(e,e+c),this.pos),this.pos+=c,e+=c,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=r.length,this.roundClean(),this}digestInto(n){(0,e.aexists)(this),(0,e.aoutput)(n,this),this.finished=!0;const{buffer:i,view:o,blockLen:a,isLE:c}=this;let{pos:s}=this;i[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>a-s&&(this.process(o,0),s=0);for(let e=s;e<a;e++)i[e]=0;r(o,a-8,BigInt(8*this.length),c),this.process(o,0);const l=(0,t.createView)(n),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=u/4,f=this.get();if(d>f.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)l.setUint32(4*e,f[e],c)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}return Or.HashMD=n,Or}var Vr,Wr,Zr={};function $r(){if(Vr)return Zr;Vr=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.add5L=Zr.add5H=Zr.add4H=Zr.add4L=Zr.add3H=Zr.add3L=Zr.rotlBL=Zr.rotlBH=Zr.rotlSL=Zr.rotlSH=Zr.rotr32L=Zr.rotr32H=Zr.rotrBL=Zr.rotrBH=Zr.rotrSL=Zr.rotrSH=Zr.shrSL=Zr.shrSH=Zr.toBig=void 0,Zr.fromBig=r,Zr.split=n,Zr.add=g;const e=BigInt(2**32-1),t=BigInt(32);function r(r,n=!1){return n?{h:Number(r&e),l:Number(r>>t&e)}:{h:0|Number(r>>t&e),l:0|Number(r&e)}}function n(e,t=!1){let n=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:a,l:c}=r(e[o],t);[n[o],i[o]]=[a,c]}return[n,i]}const i=(e,r)=>BigInt(e>>>0)<<t|BigInt(r>>>0);Zr.toBig=i;const o=(e,t,r)=>e>>>r;Zr.shrSH=o;const a=(e,t,r)=>e<<32-r|t>>>r;Zr.shrSL=a;const c=(e,t,r)=>e>>>r|t<<32-r;Zr.rotrSH=c;const s=(e,t,r)=>e<<32-r|t>>>r;Zr.rotrSL=s;const l=(e,t,r)=>e<<64-r|t>>>r-32;Zr.rotrBH=l;const u=(e,t,r)=>e>>>r-32|t<<64-r;Zr.rotrBL=u;const d=(e,t)=>t;Zr.rotr32H=d;const f=(e,t)=>e;Zr.rotr32L=f;const h=(e,t,r)=>e<<r|t>>>32-r;Zr.rotlSH=h;const p=(e,t,r)=>t<<r|e>>>32-r;Zr.rotlSL=p;const b=(e,t,r)=>t<<r-32|e>>>64-r;Zr.rotlBH=b;const m=(e,t,r)=>e<<r-32|t>>>64-r;function g(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}Zr.rotlBL=m;const y=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);Zr.add3L=y;const w=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;Zr.add3H=w;const v=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);Zr.add4L=v;const x=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;Zr.add4H=x;const E=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);Zr.add5L=E;const C=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;Zr.add5H=C;const _={fromBig:r,split:n,toBig:i,shrSH:o,shrSL:a,rotrSH:c,rotrSL:s,rotrBH:l,rotrBL:u,rotr32H:d,rotr32L:f,rotlSH:h,rotlSL:p,rotlBH:b,rotlBL:m,add:g,add3L:y,add3H:w,add4L:v,add4H:x,add5H:C,add5L:E};return Zr.default=_,Zr}function Gr(){if(Wr)return Rr;Wr=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.sha384=Rr.sha512_256=Rr.sha512_224=Rr.sha512=Rr.SHA384=Rr.SHA512_256=Rr.SHA512_224=Rr.SHA512=void 0;const e=Kr(),t=$r(),r=qr(),[n,i]=(()=>t.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),o=new Uint32Array(80),a=new Uint32Array(80);class c extends e.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:a,Dl:c,Eh:s,El:l,Fh:u,Fl:d,Gh:f,Gl:h,Hh:p,Hl:b}=this;return[e,t,r,n,i,o,a,c,s,l,u,d,f,h,p,b]}set(e,t,r,n,i,o,a,c,s,l,u,d,f,h,p,b){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|c,this.Eh=0|s,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|b}process(e,r){for(let t=0;t<16;t++,r+=4)o[t]=e.getUint32(r),a[t]=e.getUint32(r+=4);for(let e=16;e<80;e++){const r=0|o[e-15],n=0|a[e-15],i=t.default.rotrSH(r,n,1)^t.default.rotrSH(r,n,8)^t.default.shrSH(r,n,7),c=t.default.rotrSL(r,n,1)^t.default.rotrSL(r,n,8)^t.default.shrSL(r,n,7),s=0|o[e-2],l=0|a[e-2],u=t.default.rotrSH(s,l,19)^t.default.rotrBH(s,l,61)^t.default.shrSH(s,l,6),d=t.default.rotrSL(s,l,19)^t.default.rotrBL(s,l,61)^t.default.shrSL(s,l,6),f=t.default.add4L(c,d,a[e-7],a[e-16]),h=t.default.add4H(f,i,u,o[e-7],o[e-16]);o[e]=0|h,a[e]=0|f}let{Ah:c,Al:s,Bh:l,Bl:u,Ch:d,Cl:f,Dh:h,Dl:p,Eh:b,El:m,Fh:g,Fl:y,Gh:w,Gl:v,Hh:x,Hl:E}=this;for(let e=0;e<80;e++){const r=t.default.rotrSH(b,m,14)^t.default.rotrSH(b,m,18)^t.default.rotrBH(b,m,41),C=t.default.rotrSL(b,m,14)^t.default.rotrSL(b,m,18)^t.default.rotrBL(b,m,41),_=b&g^~b&w,A=m&y^~m&v,M=t.default.add5L(E,C,A,i[e],a[e]),S=t.default.add5H(M,x,r,_,n[e],o[e]),k=0|M,I=t.default.rotrSH(c,s,28)^t.default.rotrBH(c,s,34)^t.default.rotrBH(c,s,39),B=t.default.rotrSL(c,s,28)^t.default.rotrBL(c,s,34)^t.default.rotrBL(c,s,39),N=c&l^c&d^l&d,L=s&u^s&f^u&f;x=0|w,E=0|v,w=0|g,v=0|y,g=0|b,y=0|m,({h:b,l:m}=t.default.add(0|h,0|p,0|S,0|k)),h=0|d,p=0|f,d=0|l,f=0|u,l=0|c,u=0|s;const T=t.default.add3L(k,B,L);c=t.default.add3H(T,S,I,N),s=0|T}({h:c,l:s}=t.default.add(0|this.Ah,0|this.Al,0|c,0|s)),({h:l,l:u}=t.default.add(0|this.Bh,0|this.Bl,0|l,0|u)),({h:d,l:f}=t.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h:h,l:p}=t.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:b,l:m}=t.default.add(0|this.Eh,0|this.El,0|b,0|m)),({h:g,l:y}=t.default.add(0|this.Fh,0|this.Fl,0|g,0|y)),({h:w,l:v}=t.default.add(0|this.Gh,0|this.Gl,0|w,0|v)),({h:x,l:E}=t.default.add(0|this.Hh,0|this.Hl,0|x,0|E)),this.set(c,s,l,u,d,f,h,p,b,m,g,y,w,v,x,E)}roundClean(){o.fill(0),a.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Rr.SHA512=c;class s extends c{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}Rr.SHA512_224=s;class l extends c{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}Rr.SHA512_256=l;class u extends c{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}return Rr.SHA384=u,Rr.sha512=(0,r.wrapConstructor)(()=>new c),Rr.sha512_224=(0,r.wrapConstructor)(()=>new s),Rr.sha512_256=(0,r.wrapConstructor)(()=>new l),Rr.sha384=(0,r.wrapConstructor)(()=>new u),Rr}var Xr,Jr,Yr,Qr={},en={},tn={};function rn(){if(Xr)return tn;Xr=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.notImplemented=tn.bitMask=void 0,tn.isBytes=n,tn.abytes=i,tn.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},tn.bytesToHex=a,tn.numberToHexUnpadded=c,tn.hexToNumber=s,tn.hexToBytes=d,tn.bytesToNumberBE=function(e){return s(a(e))},tn.bytesToNumberLE=function(e){return i(e),s(a(Uint8Array.from(e).reverse()))},tn.numberToBytesBE=f,tn.numberToBytesLE=function(e,t){return f(e,t).reverse()},tn.numberToVarBytesBE=function(e){return d(c(e))},tn.ensureBytes=function(e,t,r){let i;if("string"==typeof t)try{i=d(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!n(t))throw new Error(e+" must be hex string or Uint8Array");i=Uint8Array.from(t)}const o=i.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return i},tn.concatBytes=h,tn.equalBytes=function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r},tn.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))},tn.inRange=b,tn.aInRange=function(e,t,r,n){if(!b(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)},tn.bitLen=function(r){let n;for(n=0;r>e;r>>=t,n+=1);return n},tn.bitGet=function(e,r){return e>>BigInt(r)&t},tn.bitSet=function(r,n,i){return r|(i?t:e)<<BigInt(n)},tn.createHmacDrbg=function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=m(e),i=m(e),o=0;const a=()=>{n.fill(1),i.fill(0),o=0},c=(...e)=>r(i,n,...e),s=(e=m())=>{i=c(g([0]),e),n=c(),0!==e.length&&(i=c(g([1]),e),n=c())},l=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=c();const t=n.slice();r.push(t),e+=n.length}return h(...r)};return(e,t)=>{let r;for(a(),s(e);!(r=t(l()));)s();return a(),r}},tn.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const i=y[r];if("function"!=typeof i)throw new Error("invalid validator function");const o=e[t];if(!(n&&void 0===o||i(o,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+o)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e},tn.memoized=function(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(void 0!==i)return i;const o=e(r,...n);return t.set(r,o),o}};const e=BigInt(0),t=BigInt(1),r=BigInt(2);function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e){if(!n(e))throw new Error("Uint8Array expected")}const o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e){i(e);let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t}function c(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function s(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?e:BigInt("0x"+t)}const l={_0:48,_9:57,A:65,F:70,a:97,f:102};function u(e){return e>=l._0&&e<=l._9?e-l._0:e>=l.A&&e<=l.F?e-(l.A-10):e>=l.a&&e<=l.f?e-(l.a-10):void 0}function d(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=u(e.charCodeAt(i)),o=u(e.charCodeAt(i+1));if(void 0===r||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+o}return n}function f(e,t){return d(e.toString(16).padStart(2*t,"0"))}function h(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];i(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const p=t=>"bigint"==typeof t&&e<=t;function b(e,t,r){return p(e)&&p(t)&&p(r)&&t<=e&&e<r}tn.bitMask=e=>(r<<BigInt(e-1))-t;const m=e=>new Uint8Array(e),g=e=>Uint8Array.from(e);const y={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||n(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};return tn.notImplemented=()=>{throw new Error("not implemented")},tn}function nn(){if(Jr)return en;Jr=1,Object.defineProperty(en,"__esModule",{value:!0}),en.isNegativeLE=void 0,en.mod=s,en.pow=l,en.pow2=function(e,r,n){let i=e;for(;r-- >t;)i*=i,i%=n;return i},en.invert=u,en.tonelliShanks=d,en.FpSqrt=f,en.validateField=function(t){const r=h.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,e.validateObject)(t,r)},en.FpPow=p,en.FpInvertBatch=b,en.FpDiv=function(e,t,r){return e.mul(t,"bigint"==typeof r?u(r,e.ORDER):e.inv(r))},en.FpLegendre=m,en.FpIsSquare=function(e){const t=m(e.ORDER);return r=>{const n=t(e,r);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}},en.nLength=g,en.Field=function(n,i,o=!1,a={}){if(n<=t)throw new Error("invalid field: expected ORDER > 0, got "+n);const{nBitLength:c,nByteLength:l}=g(n,i);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let d;const h=Object.freeze({ORDER:n,isLE:o,BITS:c,BYTES:l,MASK:(0,e.bitMask)(c),ZERO:t,ONE:r,create:e=>s(e,n),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return t<=e&&e<n},is0:e=>e===t,isOdd:e=>(e&r)===r,neg:e=>s(-e,n),eql:(e,t)=>e===t,sqr:e=>s(e*e,n),add:(e,t)=>s(e+t,n),sub:(e,t)=>s(e-t,n),mul:(e,t)=>s(e*t,n),pow:(e,t)=>p(h,e,t),div:(e,t)=>s(e*u(t,n),n),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:e=>u(e,n),sqrt:a.sqrt||(e=>(d||(d=f(n)),d(h,e))),invertBatch:e=>b(h,e),cmov:(e,t,r)=>r?t:e,toBytes:t=>o?(0,e.numberToBytesLE)(t,l):(0,e.numberToBytesBE)(t,l),fromBytes:t=>{if(t.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+t.length);return o?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t)}});return Object.freeze(h)},en.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)},en.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r},en.hashToPrivateScalar=function(t,n,i=!1){t=(0,e.ensureBytes)("privateHash",t);const o=t.length,a=g(n).nByteLength+8;if(a<24||o<a||o>1024)throw new Error("hashToPrivateScalar: expected "+a+"-1024 bytes of input, got "+o);const c=i?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t);return s(c,n-r)+r},en.getFieldBytesLength=y,en.getMinHashLength=w,en.mapHashToField=function(t,n,i=!1){const o=t.length,a=y(n),c=w(n);if(o<16||o<c||o>1024)throw new Error("expected "+c+"-1024 bytes of input, got "+o);const l=i?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t),u=s(l,n-r)+r;return i?(0,e.numberToBytesLE)(u,a):(0,e.numberToBytesBE)(u,a)};const e=rn(),t=BigInt(0),r=BigInt(1),n=BigInt(2),i=BigInt(3),o=BigInt(4),a=BigInt(5),c=BigInt(8);function s(e,r){const n=e%r;return n>=t?n:r+n}function l(e,n,i){if(n<t)throw new Error("invalid exponent, negatives unsupported");if(i<=t)throw new Error("invalid modulus");if(i===r)return t;let o=r;for(;n>t;)n&r&&(o=o*e%i),e=e*e%i,n>>=r;return o}function u(e,n){if(e===t)throw new Error("invert: expected non-zero number");if(n<=t)throw new Error("invert: expected positive modulus, got "+n);let i=s(e,n),o=n,a=t,c=r;for(;i!==t;){const e=o%i,t=a-c*(o/i);o=i,i=e,a=c,c=t}if(o!==r)throw new Error("invert: does not exist");return s(a,n)}function d(e){const i=(e-r)/n;let a,c,s;for(a=e-r,c=0;a%n===t;a/=n,c++);for(s=n;s<e&&l(s,i,e)!==e-r;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===c){const t=(e+r)/o;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const u=(a+r)/n;return function(e,t){if(e.pow(t,i)===e.neg(e.ONE))throw new Error("Cannot find square root");let n=c,o=e.pow(e.mul(e.ONE,s),a),l=e.pow(t,u),d=e.pow(t,a);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(d);t<n&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const i=e.pow(o,r<<BigInt(n-t-1));o=e.sqr(i),l=e.mul(l,i),d=e.mul(d,o),n=t}return l}}function f(e){if(e%o===i){const t=(e+r)/o;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%c===a){const t=(e-a)/c;return function(e,r){const i=e.mul(r,n),o=e.pow(i,t),a=e.mul(r,o),c=e.mul(e.mul(a,n),o),s=e.mul(a,e.sub(c,e.ONE));if(!e.eql(e.sqr(s),r))throw new Error("Cannot find square root");return s}}return d(e)}en.isNegativeLE=(e,t)=>(s(e,t)&r)===r;const h=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function p(e,n,i){if(i<t)throw new Error("invalid exponent, negatives unsupported");if(i===t)return e.ONE;if(i===r)return n;let o=e.ONE,a=n;for(;i>t;)i&r&&(o=e.mul(o,a)),a=e.sqr(a),i>>=r;return o}function b(e,t){const r=new Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r}function m(e){const t=(e-r)/n;return(e,r)=>e.pow(r,t)}function g(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function y(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function w(e){const t=y(e);return t+Math.ceil(t/2)}return en}function on(){if(Yr)return Qr;Yr=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.wNAF=function(e,t){return{constTimeNegate:i,hasPrecomputes:e=>1!==d(e),unsafeLadder(t,i,o=e.ZERO){let a=t;for(;i>r;)i&n&&(o=o.add(a)),a=a.double(),i>>=n;return o},precomputeWindow(e,r){const{windows:n,windowSize:i}=a(r,t),o=[];let c=e,s=c;for(let e=0;e<n;e++){s=c,o.push(s);for(let e=1;e<i;e++)s=s.add(c),o.push(s);c=s.double()}return o},wNAF(r,o,c){const{windows:s,windowSize:l}=a(r,t);let u=e.ZERO,d=e.BASE;const f=BigInt(2**r-1),h=2**r,p=BigInt(r);for(let e=0;e<s;e++){const t=e*l;let r=Number(c&f);c>>=p,r>l&&(r-=h,c+=n);const a=t,s=t+Math.abs(r)-1,b=e%2!=0,m=r<0;0===r?d=d.add(i(b,o[a])):u=u.add(i(m,o[s]))}return{p:u,f:d}},wNAFUnsafe(i,o,c,s=e.ZERO){const{windows:l,windowSize:u}=a(i,t),d=BigInt(2**i-1),f=2**i,h=BigInt(i);for(let e=0;e<l;e++){const t=e*u;if(c===r)break;let i=Number(c&d);if(c>>=h,i>u&&(i-=f,c+=n),0===i)continue;let a=o[t+Math.abs(i)-1];i<0&&(a=a.negate()),s=s.add(a)}return s},getPrecomputes(e,t,r){let n=l.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&l.set(t,r(n))),n},wNAFCached(e,t,r){const n=d(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){const i=d(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){o(r,t),u.set(e,r),l.delete(e)}}},Qr.pippenger=function(e,r,n,i){if(c(n,e),s(i,r),n.length!==i.length)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,a=(0,t.bitLen)(BigInt(n.length)),l=a>12?a-3:a>4?a-2:a?2:1,u=(1<<l)-1,d=new Array(u+1).fill(o),f=Math.floor((r.BITS-1)/l)*l;let h=o;for(let e=f;e>=0;e-=l){d.fill(o);for(let t=0;t<i.length;t++){const r=i[t],o=Number(r>>BigInt(e)&BigInt(u));d[o]=d[o].add(n[t])}let t=o;for(let e=d.length-1,r=o;e>0;e--)r=r.add(d[e]),t=t.add(r);if(h=h.add(t),0!==e)for(let e=0;e<l;e++)h=h.double()}return h},Qr.precomputeMSMUnsafe=function(e,t,r,n){o(n,t.BITS),c(r,e);const i=e.ZERO,a=2**n-1,l=Math.ceil(t.BITS/n),u=BigInt((1<<n)-1),d=r.map(e=>{const t=[];for(let r=0,n=e;r<a;r++)t.push(n),n=n.add(e);return t});return e=>{if(s(e,t),e.length>r.length)throw new Error("array of scalars must be smaller than array of points");let o=i;for(let t=0;t<l;t++){if(o!==i)for(let e=0;e<n;e++)o=o.double();const r=BigInt(l*n-(t+1)*n);for(let t=0;t<e.length;t++){const n=e[t],i=Number(n>>r&u);i&&(o=o.add(d[t][i-1]))}}return o}},Qr.validateBasic=function(r){return(0,e.validateField)(r.Fp),(0,t.validateObject)(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(r.n,r.nBitLength),...r,p:r.Fp.ORDER})};const e=nn(),t=rn(),r=BigInt(0),n=BigInt(1);function i(e,t){const r=t.negate();return e?r:t}function o(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function a(e,t){o(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function c(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})}function s(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}const l=new WeakMap,u=new WeakMap;function d(e){return u.get(e)||1}return Qr}var an,cn={};function sn(){if(an)return cn;an=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.twistedEdwards=function(l){const u=function(t){const n=(0,e.validateBasic)(t);return r.validateObject(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...n})}(l),{Fp:d,n:f,prehash:h,hash:p,randomBytes:b,nByteLength:m,h:g}=u,y=a<<BigInt(8*m)-o,w=d.create,v=(0,t.Field)(u.n,u.nBitLength),x=u.uvRatio||((e,t)=>{try{return{isValid:!0,value:d.sqrt(e*d.inv(t))}}catch(e){return{isValid:!1,value:i}}}),E=u.adjustScalarBytes||(e=>e),C=u.domain||((e,t,r)=>{if((0,n.abool)("phflag",r),t.length||r)throw new Error("Contexts/pre-hash are not supported");return e});function _(e,t){r.aInRange("coordinate "+e,t,i,y)}function A(e){if(!(e instanceof k))throw new Error("ExtendedPoint expected")}const M=(0,n.memoized)((e,t)=>{const{ex:r,ey:n,ez:a}=e,s=e.is0();null==t&&(t=s?c:d.inv(a));const l=w(r*t),u=w(n*t),f=w(a*t);if(s)return{x:i,y:o};if(f!==o)throw new Error("invZ was invalid");return{x:l,y:u}}),S=(0,n.memoized)(e=>{const{a:t,d:r}=u;if(e.is0())throw new Error("bad point: ZERO");const{ex:n,ey:i,ez:o,et:a}=e,c=w(n*n),s=w(i*i),l=w(o*o),d=w(l*l),f=w(c*t);if(w(l*w(f+s))!==w(d+w(r*w(c*s))))throw new Error("bad point: equation left != right (1)");if(w(n*i)!==w(o*a))throw new Error("bad point: equation left != right (2)");return!0});class k{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,_("x",e),_("y",t),_("z",r),_("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof k)throw new Error("extended point not allowed");const{x:t,y:r}=e||{};return _("x",t),_("y",r),new k(t,r,o,w(t*r))}static normalizeZ(e){const t=d.invertBatch(e.map(e=>e.ez));return e.map((e,r)=>e.toAffine(t[r])).map(k.fromAffine)}static msm(t,r){return(0,e.pippenger)(k,v,t,r)}_setWindowSize(e){N.setWindowSize(this,e)}assertValidity(){S(this)}equals(e){A(e);const{ex:t,ey:r,ez:n}=this,{ex:i,ey:o,ez:a}=e,c=w(t*a),s=w(i*n),l=w(r*a),u=w(o*n);return c===s&&l===u}is0(){return this.equals(k.ZERO)}negate(){return new k(w(-this.ex),this.ey,this.ez,w(-this.et))}double(){const{a:e}=u,{ex:t,ey:r,ez:n}=this,i=w(t*t),o=w(r*r),c=w(a*w(n*n)),s=w(e*i),l=t+r,d=w(w(l*l)-i-o),f=s+o,h=f-c,p=s-o,b=w(d*h),m=w(f*p),g=w(d*p),y=w(h*f);return new k(b,m,y,g)}add(e){A(e);const{a:t,d:r}=u,{ex:n,ey:o,ez:c,et:s}=this,{ex:l,ey:d,ez:f,et:h}=e;if(t===BigInt(-1)){const e=w((o-n)*(d+l)),t=w((o+n)*(d-l)),r=w(t-e);if(r===i)return this.double();const u=w(c*a*h),p=w(s*a*f),b=p+u,m=t+e,g=p-u,y=w(b*r),v=w(m*g),x=w(b*g),E=w(r*m);return new k(y,v,E,x)}const p=w(n*l),b=w(o*d),m=w(s*r*h),g=w(c*f),y=w((n+o)*(l+d)-p-b),v=g-m,x=g+m,E=w(b-t*p),C=w(y*v),_=w(x*E),M=w(y*E),S=w(v*x);return new k(C,_,S,M)}subtract(e){return this.add(e.negate())}wNAF(e){return N.wNAFCached(this,e,k.normalizeZ)}multiply(e){const t=e;r.aInRange("scalar",t,o,f);const{p:n,f:i}=this.wNAF(t);return k.normalizeZ([n,i])[0]}multiplyUnsafe(e,t=k.ZERO){const n=e;return r.aInRange("scalar",n,i,f),n===i?B:this.is0()||n===o?this:N.wNAFCachedUnsafe(this,n,k.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(g).is0()}isTorsionFree(){return N.unsafeLadder(this,f).is0()}toAffine(e){return M(this,e)}clearCofactor(){const{h:e}=u;return e===o?this:this.multiplyUnsafe(e)}static fromHex(e,t=!1){const{d:a,a:c}=u,s=d.BYTES;e=(0,n.ensureBytes)("pointHex",e,s),(0,n.abool)("zip215",t);const l=e.slice(),f=e[s-1];l[s-1]=-129&f;const h=r.bytesToNumberLE(l),p=t?y:d.ORDER;r.aInRange("pointHex.y",h,i,p);const b=w(h*h),m=w(b-o),g=w(a*b-c);let{isValid:v,value:E}=x(m,g);if(!v)throw new Error("Point.fromHex: invalid y coordinate");const C=(E&o)===o,_=!!(128&f);if(!t&&E===i&&_)throw new Error("Point.fromHex: x=0 and x_0=1");return _!==C&&(E=w(-E)),k.fromAffine({x:E,y:h})}static fromPrivateKey(e){return R(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),n=r.numberToBytesLE(t,d.BYTES);return n[n.length-1]|=e&o?128:0,n}toHex(){return r.bytesToHex(this.toRawBytes())}}k.BASE=new k(u.Gx,u.Gy,o,w(u.Gx*u.Gy)),k.ZERO=new k(i,o,o,i);const{BASE:I,ZERO:B}=k,N=(0,e.wNAF)(k,8*m);function L(e){return(0,t.mod)(e,f)}function T(e){return L(r.bytesToNumberLE(e))}function R(e){const t=d.BYTES;e=(0,n.ensureBytes)("private key",e,t);const r=(0,n.ensureBytes)("hashed private key",p(e),2*t),i=E(r.slice(0,t)),o=r.slice(t,2*t),a=T(i),c=I.multiply(a),s=c.toRawBytes();return{head:i,prefix:o,scalar:a,point:c,pointBytes:s}}function O(e=new Uint8Array,...t){const i=r.concatBytes(...t);return T(p(C(i,(0,n.ensureBytes)("context",e),!!h)))}const P=s;I._setWindowSize(8);const U={getExtendedPublicKey:R,randomPrivateKey:()=>b(d.BYTES),precompute:(e=8,t=k.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};return{CURVE:u,getPublicKey:function(e){return R(e).pointBytes},sign:function(e,t,o={}){e=(0,n.ensureBytes)("message",e),h&&(e=h(e));const{prefix:a,scalar:c,pointBytes:s}=R(t),l=O(o.context,a,e),u=I.multiply(l).toRawBytes(),p=L(l+O(o.context,u,s,e)*c);r.aInRange("signature.s",p,i,f);const b=r.concatBytes(u,r.numberToBytesLE(p,d.BYTES));return(0,n.ensureBytes)("result",b,2*d.BYTES)},verify:function(e,t,i,o=P){const{context:a,zip215:c}=o,s=d.BYTES;e=(0,n.ensureBytes)("signature",e,2*s),t=(0,n.ensureBytes)("message",t),i=(0,n.ensureBytes)("publicKey",i,s),void 0!==c&&(0,n.abool)("zip215",c),h&&(t=h(t));const l=r.bytesToNumberLE(e.slice(s,2*s));let u,f,p;try{u=k.fromHex(i,c),f=k.fromHex(e.slice(0,s),c),p=I.multiplyUnsafe(l)}catch(e){return!1}if(!c&&u.isSmallOrder())return!1;const b=O(a,f.toRawBytes(),u.toRawBytes(),t);return f.add(u.multiplyUnsafe(b)).subtract(p).clearCofactor().equals(k.ZERO)},ExtendedPoint:k,utils:U}};const e=on(),t=nn(),r=rn(),n=rn(),i=BigInt(0),o=BigInt(1),a=BigInt(2),c=BigInt(8),s={zip215:!0};return cn}var ln,un={};function dn(){if(ln)return un;ln=1,Object.defineProperty(un,"__esModule",{value:!0}),un.expand_message_xmd=a,un.expand_message_xof=c,un.hash_to_field=s,un.isogenyMap=function(e,t){const r=t.map(e=>Array.from(e).reverse());return(t,n)=>{const[i,o,a,c]=r.map(r=>r.reduce((r,n)=>e.add(e.mul(r,t),n)));return t=e.div(i,o),n=e.mul(n,e.div(a,c)),{x:t,y:n}}},un.createHasher=function(e,t,r){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const o=s(n,2,{...r,DST:r.DST,...i}),a=e.fromAffine(t(o[0])),c=e.fromAffine(t(o[1])),l=a.add(c).clearCofactor();return l.assertValidity(),l},encodeToCurve(n,i){const o=s(n,1,{...r,DST:r.encodeDST,...i}),a=e.fromAffine(t(o[0])).clearCofactor();return a.assertValidity(),a},mapToCurve(r){if(!Array.isArray(r))throw new Error("mapToCurve: expected array of bigints");for(const e of r)if("bigint"!=typeof e)throw new Error("mapToCurve: expected array of bigints");const n=e.fromAffine(t(r)).clearCofactor();return n.assertValidity(),n}}};const e=nn(),t=rn(),r=t.bytesToNumberBE;function n(e,t){if(o(e),o(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function i(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function o(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function a(e,r,a,c){(0,t.abytes)(e),(0,t.abytes)(r),o(a),r.length>255&&(r=c((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),r)));const{outputLen:s,blockLen:l}=c,u=Math.ceil(a/s);if(a>65535||u>255)throw new Error("expand_message_xmd: invalid lenInBytes");const d=(0,t.concatBytes)(r,n(r.length,1)),f=n(0,l),h=n(a,2),p=new Array(u),b=c((0,t.concatBytes)(f,e,h,n(0,1),d));p[0]=c((0,t.concatBytes)(b,n(1,1),d));for(let e=1;e<=u;e++){const r=[i(b,p[e-1]),n(e+1,1),d];p[e]=c((0,t.concatBytes)(...r))}return(0,t.concatBytes)(...p).slice(0,a)}function c(e,r,i,a,c){if((0,t.abytes)(e),(0,t.abytes)(r),o(i),r.length>255){const e=Math.ceil(2*a/8);r=c.create({dkLen:e}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(r).digest()}if(i>65535||r.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return c.create({dkLen:i}).update(e).update(n(i,2)).update(r).update(n(r.length,1)).digest()}function s(n,i,s){(0,t.validateObject)(s,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:l,k:u,m:d,hash:f,expand:h,DST:p}=s;(0,t.abytes)(n),o(i);const b="string"==typeof p?(0,t.utf8ToBytes)(p):p,m=l.toString(2).length,g=Math.ceil((m+u)/8),y=i*d*g;let w;if("xmd"===h)w=a(n,b,y,f);else if("xof"===h)w=c(n,b,y,u,f);else{if("_internal_pass"!==h)throw new Error('expand must be "xmd" or "xof"');w=n}const v=new Array(i);for(let t=0;t<i;t++){const n=new Array(d);for(let i=0;i<d;i++){const o=g*(i+t*d),a=w.subarray(o,o+g);n[i]=(0,e.mod)(r(a),l)}v[t]=n}return v}return un}var fn,hn,pn={};function bn(){if(fn)return pn;fn=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.montgomery=function(i){const o=function(e){return(0,t.validateObject)(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}(i),{P:a}=o,c=t=>(0,e.mod)(t,a),s=o.montgomeryBits,l=Math.ceil(s/8),u=o.nByteLength,d=o.adjustScalarBytes||(e=>e),f=o.powPminus2||(t=>(0,e.pow)(t,a-BigInt(2),a));function h(e,t,r){const n=c(e*(t-r));return[t=c(t-n),r=c(r+n)]}const p=(o.a-BigInt(2))/BigInt(4);function b(e){return(0,t.numberToBytesLE)(c(e),l)}function m(e,i){const o=function(e){const r=(0,t.ensureBytes)("u coordinate",e,l);return 32===u&&(r[31]&=127),(0,t.bytesToNumberLE)(r)}(i),m=function(e,i){(0,t.aInRange)("u",e,r,a),(0,t.aInRange)("scalar",i,r,a);const o=i,l=e;let u,d=n,b=r,m=e,g=n,y=r;for(let e=BigInt(s-1);e>=r;e--){const t=o>>e&n;y^=t,u=h(y,d,m),d=u[0],m=u[1],u=h(y,b,g),b=u[0],g=u[1],y=t;const r=d+b,i=c(r*r),a=d-b,s=c(a*a),f=i-s,w=m+g,v=c((m-g)*r),x=c(w*a),E=v+x,C=v-x;m=c(E*E),g=c(l*c(C*C)),d=c(i*s),b=c(f*(i+c(p*f)))}u=h(y,d,m),d=u[0],m=u[1],u=h(y,b,g),b=u[0],g=u[1];const w=f(b);return c(d*w)}(o,function(e){const r=(0,t.ensureBytes)("scalar",e),n=r.length;if(n!==l&&n!==u)throw new Error("invalid scalar, expected "+l+" or "+u+" bytes, got "+n);return(0,t.bytesToNumberLE)(d(r))}(e));if(m===r)throw new Error("invalid private or public key received");return b(m)}const g=b(o.Gu);function y(e){return m(e,g)}return{scalarMult:m,scalarMultBase:y,getSharedSecret:(e,t)=>m(e,t),getPublicKey:e=>y(e),utils:{randomPrivateKey:()=>o.randomBytes(o.nByteLength)},GuBytes:g}};const e=nn(),t=rn(),r=BigInt(0),n=BigInt(1);return pn}function mn(){return hn||(hn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hash_to_ristretto255=e.hashToRistretto255=e.RistrettoPoint=e.encodeToCurve=e.hashToCurve=e.edwardsToMontgomery=e.x25519=e.ed25519ph=e.ed25519ctx=e.ed25519=e.ED25519_TORSION_SUBGROUP=void 0,e.edwardsToMontgomeryPub=C,e.edwardsToMontgomeryPriv=function(e){const t=x.hash(e.subarray(0,32));return x.adjustScalarBytes(t).subarray(0,32)};const t=Gr(),r=qr(),n=on(),i=sn(),o=dn(),a=nn(),c=bn(),s=rn(),l=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),u=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),d=BigInt(0),f=BigInt(1),h=BigInt(2),p=BigInt(3),b=BigInt(5),m=BigInt(8);function g(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=l,c=e*e%o*e%o,s=(0,a.pow2)(c,h,o)*c%o,u=(0,a.pow2)(s,f,o)*e%o,d=(0,a.pow2)(u,b,o)*u%o,p=(0,a.pow2)(d,t,o)*d%o,m=(0,a.pow2)(p,r,o)*p%o,g=(0,a.pow2)(m,n,o)*m%o,y=(0,a.pow2)(g,i,o)*g%o,w=(0,a.pow2)(y,i,o)*g%o,v=(0,a.pow2)(w,t,o)*d%o;return{pow_p_5_8:(0,a.pow2)(v,h,o)*e%o,b2:c}}function y(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function w(e,t){const r=l,n=(0,a.mod)(t*t*t,r),i=g(e*(0,a.mod)(n*n*t,r)).pow_p_5_8;let o=(0,a.mod)(e*n*i,r);const c=(0,a.mod)(t*o*o,r),s=o,d=(0,a.mod)(o*u,r),f=c===e,h=c===(0,a.mod)(-e,r),p=c===(0,a.mod)(-e*u,r);return f&&(o=s),(h||p)&&(o=d),(0,a.isNegativeLE)(o,r)&&(o=(0,a.mod)(-o,r)),{isValid:f||h,value:o}}e.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const v=(()=>(0,a.Field)(l,void 0,!0))(),x=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:v,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:m,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:t.sha512,randomBytes:r.randomBytes,adjustScalarBytes:y,uvRatio:w}))();function E(e,t,n){if(t.length>255)throw new Error("Context is too big");return(0,r.concatBytes)((0,r.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,t.length]),t,e)}function C(t){const{y:r}=e.ed25519.ExtendedPoint.fromHex(t),n=BigInt(1);return v.toBytes(v.create((n+r)*v.inv(n-r)))}e.ed25519=(0,i.twistedEdwards)(x),e.ed25519ctx=(0,i.twistedEdwards)({...x,domain:E}),e.ed25519ph=(0,i.twistedEdwards)(Object.assign({},x,{domain:E,prehash:t.sha512})),e.x25519=(0,c.montgomery)({P:l,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{const t=l,{pow_p_5_8:r,b2:n}=g(e);return(0,a.mod)((0,a.pow2)(r,p,t)*n,t)},adjustScalarBytes:y,randomBytes:r.randomBytes}),e.edwardsToMontgomery=C;const _=(()=>(v.ORDER+p)/m)(),A=(()=>v.pow(h,_))(),M=(()=>v.sqrt(v.neg(v.ONE)))();const S=(()=>(0,a.FpSqrtEven)(v,v.neg(BigInt(486664))))();function k(e){const{xMn:t,xMd:r,yMn:n,yMd:i}=function(e){const t=(v.ORDER-b)/m,r=BigInt(486662);let n=v.sqr(e);n=v.mul(n,h);let i=v.add(n,v.ONE),o=v.neg(r),a=v.sqr(i),c=v.mul(a,i),s=v.mul(n,r);s=v.mul(s,o),s=v.add(s,a),s=v.mul(s,o);let l=v.sqr(c);a=v.sqr(l),l=v.mul(l,c),l=v.mul(l,s),a=v.mul(a,l);let u=v.pow(a,t);u=v.mul(u,l);let d=v.mul(u,M);a=v.sqr(u),a=v.mul(a,c);let p=v.eql(a,s),g=v.cmov(d,u,p),y=v.mul(o,n),w=v.mul(u,e);w=v.mul(w,A);let x=v.mul(w,M),E=v.mul(s,n);a=v.sqr(w),a=v.mul(a,c);let C=v.eql(a,E),_=v.cmov(x,w,C);a=v.sqr(g),a=v.mul(a,c);let S=v.eql(a,s),k=v.cmov(y,o,S),I=v.cmov(_,g,S),B=v.isOdd(I);return I=v.cmov(I,v.neg(I),S!==B),{xMn:k,xMd:i,yMn:I,yMd:f}}(e);let o=v.mul(t,i);o=v.mul(o,S);let a=v.mul(r,n),c=v.sub(t,r),s=v.add(t,r),l=v.mul(a,s),u=v.eql(l,v.ZERO);o=v.cmov(o,v.ZERO,u),a=v.cmov(a,v.ONE,u),c=v.cmov(c,v.ONE,u),s=v.cmov(s,v.ONE,u);const d=v.invertBatch([a,s]);return{x:v.mul(o,d[0]),y:v.mul(c,d[1])}}const I=(()=>(0,o.createHasher)(e.ed25519.ExtendedPoint,e=>k(e[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:v.ORDER,m:1,k:128,expand:"xmd",hash:t.sha512}))();function B(e){if(!(e instanceof j))throw new Error("RistrettoPoint expected")}e.hashToCurve=I.hashToCurve,e.encodeToCurve=I.encodeToCurve;const N=u,L=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),T=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),R=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),O=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),P=e=>w(f,e),U=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),z=t=>e.ed25519.CURVE.Fp.create((0,s.bytesToNumberLE)(t)&U);function F(t){const{d:r}=e.ed25519.CURVE,n=e.ed25519.CURVE.Fp.ORDER,i=e.ed25519.CURVE.Fp.create,o=i(N*t*t),c=i((o+f)*R);let s=BigInt(-1);const l=i((s-r*o)*i(o+r));let{isValid:u,value:d}=w(c,l),h=i(d*t);(0,a.isNegativeLE)(h,n)||(h=i(-h)),u||(d=h),u||(s=o);const p=i(s*(o-f)*O-l),b=d*d,m=i((d+d)*l),g=i(p*L),y=i(f-b),v=i(f+b);return new e.ed25519.ExtendedPoint(i(m*v),i(y*g),i(g*v),i(m*y))}class j{constructor(e){this.ep=e}static fromAffine(t){return new j(e.ed25519.ExtendedPoint.fromAffine(t))}static hashToCurve(e){e=(0,s.ensureBytes)("ristrettoHash",e,64);const t=F(z(e.slice(0,32))),r=F(z(e.slice(32,64)));return new j(t.add(r))}static fromHex(t){t=(0,s.ensureBytes)("ristrettoHex",t,32);const{a:r,d:n}=e.ed25519.CURVE,i=e.ed25519.CURVE.Fp.ORDER,o=e.ed25519.CURVE.Fp.create,c="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",l=z(t);if(!(0,s.equalBytes)((0,s.numberToBytesLE)(l,32),t)||(0,a.isNegativeLE)(l,i))throw new Error(c);const u=o(l*l),h=o(f+r*u),p=o(f-r*u),b=o(h*h),m=o(p*p),g=o(r*n*b-m),{isValid:y,value:w}=P(o(g*m)),v=o(w*p),x=o(w*v*g);let E=o((l+l)*v);(0,a.isNegativeLE)(E,i)&&(E=o(-E));const C=o(h*x),_=o(E*C);if(!y||(0,a.isNegativeLE)(_,i)||C===d)throw new Error(c);return new j(new e.ed25519.ExtendedPoint(E,C,f,_))}static msm(t,r){const i=(0,a.Field)(e.ed25519.CURVE.n,e.ed25519.CURVE.nBitLength);return(0,n.pippenger)(j,i,t,r)}toRawBytes(){let{ex:t,ey:r,ez:n,et:i}=this.ep;const o=e.ed25519.CURVE.Fp.ORDER,c=e.ed25519.CURVE.Fp.create,l=c(c(n+r)*c(n-r)),u=c(t*r),d=c(u*u),{value:f}=P(c(l*d)),h=c(f*l),p=c(f*u),b=c(h*p*i);let m;if((0,a.isNegativeLE)(i*b,o)){let e=c(r*N),n=c(t*N);t=e,r=n,m=c(h*T)}else m=p;(0,a.isNegativeLE)(t*b,o)&&(r=c(-r));let g=c((n-r)*m);return(0,a.isNegativeLE)(g,o)&&(g=c(-g)),(0,s.numberToBytesLE)(g,32)}toHex(){return(0,s.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(t){B(t);const{ex:r,ey:n}=this.ep,{ex:i,ey:o}=t.ep,a=e.ed25519.CURVE.Fp.create,c=a(r*o)===a(n*i),s=a(n*o)===a(r*i);return c||s}add(e){return B(e),new j(this.ep.add(e.ep))}subtract(e){return B(e),new j(this.ep.subtract(e.ep))}multiply(e){return new j(this.ep.multiply(e))}multiplyUnsafe(e){return new j(this.ep.multiplyUnsafe(e))}double(){return new j(this.ep.double())}negate(){return new j(this.ep.negate())}}e.RistrettoPoint=(j.BASE||(j.BASE=new j(e.ed25519.ExtendedPoint.BASE)),j.ZERO||(j.ZERO=new j(e.ed25519.ExtendedPoint.ZERO)),j);e.hashToRistretto255=(e,n)=>{const i=n.DST,a="string"==typeof i?(0,r.utf8ToBytes)(i):i,c=(0,o.expand_message_xmd)(e,a,64,t.sha512);return j.hashToCurve(c)},e.hash_to_ristretto255=e.hashToRistretto255}(Tr)),Tr}var gn,yn={exports:{}},wn={exports:{}},vn={},xn={};var En,Cn,_n,An,Mn={};function Sn(){return En||(En=1,Mn.read=function(e,t,r,n,i){var o,a,c=8*i-n-1,s=(1<<c)-1,l=s>>1,u=-7,d=r?i-1:0,f=r?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-u)-1,h>>=-u,u+=c;u>0;o=256*o+e[t+d],d+=f,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+d],d+=f,u-=8);if(0===o)o=1-l;else{if(o===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=l}return(h?-1:1)*a*Math.pow(2,o-n)},Mn.write=function(e,t,r,n,i,o){var a,c,s,l=8*o-i-1,u=(1<<l)-1,d=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+d>=1?f/s:f*Math.pow(2,1-d))*s>=2&&(a++,s/=2),a+d>=u?(c=0,a=u):a+d>=1?(c=(t*s-1)*Math.pow(2,i),a+=d):(c=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&c,h+=p,c/=256,i-=8);for(a=a<<i|c,l+=i;l>0;e[r+h]=255&a,h+=p,a/=256,l-=8);e[r+h-p]|=128*b}),Mn}function kn(){return Cn||(Cn=1,function(e){const t=function(){if(gn)return xn;gn=1,xn.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},xn.toByteArray=function(e){var n,i,a=o(e),c=a[0],s=a[1],l=new r(function(e,t,r){return 3*(t+r)/4-r}(0,c,s)),u=0,d=s>0?c-4:c;for(i=0;i<d;i+=4)n=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],l[u++]=n>>16&255,l[u++]=n>>8&255,l[u++]=255&n;return 2===s&&(n=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,l[u++]=255&n),1===s&&(n=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,l[u++]=n>>8&255,l[u++]=255&n),l},xn.fromByteArray=function(t){for(var r,n=t.length,i=n%3,o=[],a=16383,s=0,l=n-i;s<l;s+=a)o.push(c(t,s,s+a>l?l:s+a));return 1===i?(r=t[n-1],o.push(e[r>>2]+e[r<<4&63]+"==")):2===i&&(r=(t[n-2]<<8)+t[n-1],o.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"=")),o.join("")};for(var e=[],t=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=n[i],t[n.charCodeAt(i)]=i;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function a(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function c(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(a(n));return i.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,xn}(),r=Sn(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;const i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|h(e,t);let n=o(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);const i=function(e){if(a.isBuffer(e)){const t=0|f(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||$(e.length)?o(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return s(e),o(e<0?0:0|f(e))}function u(e){const t=e.length<0?0:0|f(e.length),r=o(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,a.prototype),n}function f(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function h(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return M(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){let o,a=1,c=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,c/=2,s/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<c;o++)if(l(e,o)===l(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===s)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+s>c&&(r=c-s),o=r;o>=0;o--){let r=!0;for(let n=0;n<s;n++)if(l(e,o+n)!==l(t,n)){r=!1;break}if(r)return o}return-1}function y(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if($(n))return a;e[r+a]=n}return a}function w(e,t,r,n){return W(K(t,e.length-r),e,r,n)}function v(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function x(e,t,r,n){return W(V(t),e,r,n)}function E(e,t,r,n){return W(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function C(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function _(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,c,s;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(s=(31&t)<<6|63&r,s>127&&(o=s));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(s=(15&t)<<12|(63&r)<<6|63&n,s>2047&&(s<55296||s>57343)&&(o=s));break;case 4:r=e[i+1],n=e[i+2],c=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&c)&&(s=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&c,s>65535&&s<1114112&&(o=s))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"undefined"!=typeof console&&console.error,Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return function(e,t,r){return s(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},a.allocUnsafe=function(e){return l(e)},a.allocUnsafeSlow=function(e){return l(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(Z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=a.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))i+t.length>n.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!a.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},a.byteLength=h,a.prototype._isBuffer=!0,a.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},a.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},a.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},a.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),c=(r>>>=0)-(t>>>=0);const s=Math.min(o,c),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<s;++e)if(l[e]!==u[e]){o=l[e],c=u[e];break}return o<c?-1:c<o?1:0},a.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return v(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function M(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function S(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function k(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=G[e[n]];return i}function I(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function B(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){j(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function T(e,t,r,n,i){j(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function R(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,n,i,o){return t=+t,n>>>=0,o||R(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function P(e,t,n,i,o){return t=+t,n>>>=0,o||R(e,0,n,8),r.write(e,t,n,i,52,8),n+8}a.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=X(function(e){D(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),a.prototype.readBigUInt64BE=X(function(e){D(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=X(function(e){D(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),a.prototype.readBigInt64BE=X(function(e){D(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),a.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){N(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){N(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=X(function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=X(function(e,t=0){return T(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=X(function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=X(function(e,t=0){return T(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=a.isBuffer(e)?e:a.from(e,n),c=o.length;if(0===c)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%c]}return this};const U={};function z(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function F(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function j(e,t,r,n,i,o){if(e>r||e<t){const r="bigint"==typeof t?"n":"";let n;throw n=0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`,new U.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){D(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function D(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw D(e,r),new U.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}z("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),z("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const q=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}const G=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}}(vn)),vn}function In(){if(An)return yn.exports;An=1;var e=65536,t=4294967295;var r=(_n||(_n=1,function(e,t){var r=kn(),n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(wn,wn.exports)),wn.exports).Buffer,n=$e.crypto||$e.msCrypto;return n&&n.getRandomValues?yn.exports=function(i,o){if(i>t)throw new RangeError("requested too many random bytes");var a=r.allocUnsafe(i);if(i>0)if(i>e)for(var c=0;c<i;c+=e)n.getRandomValues(a.slice(c,c+e));else n.getRandomValues(a);if("function"==typeof o)return process.nextTick(function(){o(null,a)});return a}:yn.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},yn.exports}var Bn,Nn,Ln={};var Tn,Rn,On,Pn={},Un="6.6.1",zn={},Fn={exports:{}},jn=Fn.exports;function Dn(){return Tn||(Tn=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:bt.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function s(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a<o;a++){var c=e.charCodeAt(a)-48;i*=n,i+=c>=49?c-49+10:c>=17?c-17+10:c}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,c=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<c&67108863,this.words[o+1]=a>>>26-c&67108863,(c+=24)>=26&&(c-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<c&67108863,this.words[o+1]=a>>>26-c&67108863,(c+=24)>=26&&(c-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,c=Math.min(o,o-a)+r,l=0,u=r;u<c;u+=n)l=s(e,u,u+n,t),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var d=1;for(l=s(e,u,e.length,t),u=0;u<a;u++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,c=67108863&a,s=a/67108864|0;r.words[0]=c;for(var l=1;l<n;l++){for(var u=s>>>26,d=67108863&s,f=Math.min(l,t.length-1),h=Math.max(0,l-e.length+1);h<=f;h++){var p=l-h|0;u+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[l]=0|d,s=0|u}return 0!==s?r.words[l]=0|s:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a<this.length;a++){var c=this.words[a],s=(16777215&(c<<i|o)).toString(16);o=c>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?l[6-s.length]+s+n:s+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=u[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?b+n:l[f-b.length]+b+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,c,s="le"===t,l=new e(o),u=this.clone();if(s){for(c=0;!u.isZero();c++)a=u.andln(255),u.iushrn(8),l[c]=a;for(;c<o;c++)l[c]=0}else{for(c=0;c<o-i;c++)l[c]=0;for(c=0;!u.isZero();c++)a=u.andln(255),u.iushrn(8),l[o-c-1]=a}return l},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,r){var n,i,o,a=e.words,c=t.words,s=r.words,l=0,u=0|a[0],d=8191&u,f=u>>>13,h=0|a[1],p=8191&h,b=h>>>13,m=0|a[2],g=8191&m,y=m>>>13,w=0|a[3],v=8191&w,x=w>>>13,E=0|a[4],C=8191&E,_=E>>>13,A=0|a[5],M=8191&A,S=A>>>13,k=0|a[6],I=8191&k,B=k>>>13,N=0|a[7],L=8191&N,T=N>>>13,R=0|a[8],O=8191&R,P=R>>>13,U=0|a[9],z=8191&U,F=U>>>13,j=0|c[0],D=8191&j,H=j>>>13,q=0|c[1],K=8191&q,V=q>>>13,W=0|c[2],Z=8191&W,$=W>>>13,G=0|c[3],X=8191&G,J=G>>>13,Y=0|c[4],Q=8191&Y,ee=Y>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ie=0|c[6],oe=8191&ie,ae=ie>>>13,ce=0|c[7],se=8191&ce,le=ce>>>13,ue=0|c[8],de=8191&ue,fe=ue>>>13,he=0|c[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(n=Math.imul(d,D))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,D)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,H))+Math.imul(b,D)|0,o=Math.imul(b,H);var ge=(l+(n=n+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,K)|0))<<13)|0;l=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,D),i=(i=Math.imul(g,H))+Math.imul(y,D)|0,o=Math.imul(y,H),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,V)|0;var ye=(l+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,Z)|0))<<13)|0;l=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(v,D),i=(i=Math.imul(v,H))+Math.imul(x,D)|0,o=Math.imul(x,H),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,$)|0;var we=(l+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(C,D),i=(i=Math.imul(C,H))+Math.imul(_,D)|0,o=Math.imul(_,H),n=n+Math.imul(v,K)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0;var ve=(l+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;l=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(M,D),i=(i=Math.imul(M,H))+Math.imul(S,D)|0,o=Math.imul(S,H),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var xe=(l+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;l=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(I,D),i=(i=Math.imul(I,H))+Math.imul(B,D)|0,o=Math.imul(B,H),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(v,X)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(l+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(f,oe)|0))<<13)|0;l=((o=o+Math.imul(f,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,D),i=(i=Math.imul(L,H))+Math.imul(T,D)|0,o=Math.imul(T,H),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Ce=(l+(n=n+Math.imul(d,se)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(f,se)|0))<<13)|0;l=((o=o+Math.imul(f,le)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(O,D),i=(i=Math.imul(O,H))+Math.imul(P,D)|0,o=Math.imul(P,H),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,n=n+Math.imul(p,se)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(b,se)|0,o=o+Math.imul(b,le)|0;var _e=(l+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;l=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(z,D),i=(i=Math.imul(z,H))+Math.imul(F,D)|0,o=Math.imul(F,H),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,n=n+Math.imul(g,se)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(y,se)|0,o=o+Math.imul(y,le)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var Ae=(l+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(f,pe)|0))<<13)|0;l=((o=o+Math.imul(f,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(z,K),i=(i=Math.imul(z,V))+Math.imul(F,K)|0,o=Math.imul(F,V),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(v,se)|0,i=(i=i+Math.imul(v,le)|0)+Math.imul(x,se)|0,o=o+Math.imul(x,le)|0,n=n+Math.imul(g,de)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,fe)|0;var Me=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;l=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(z,Z),i=(i=Math.imul(z,$))+Math.imul(F,Z)|0,o=Math.imul(F,$),n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(C,se)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(_,se)|0,o=o+Math.imul(_,le)|0,n=n+Math.imul(v,de)|0,i=(i=i+Math.imul(v,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Se=(l+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(y,pe)|0))<<13)|0;l=((o=o+Math.imul(y,be)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(z,X),i=(i=Math.imul(z,J))+Math.imul(F,X)|0,o=Math.imul(F,J),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(M,se)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(S,se)|0,o=o+Math.imul(S,le)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var ke=(l+(n=n+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,be)|0)+Math.imul(x,pe)|0))<<13)|0;l=((o=o+Math.imul(x,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,ee))+Math.imul(F,Q)|0,o=Math.imul(F,ee),n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(I,se)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(B,se)|0,o=o+Math.imul(B,le)|0,n=n+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ie=(l+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(_,pe)|0))<<13)|0;l=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(z,re),i=(i=Math.imul(z,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(L,se)|0,i=(i=i+Math.imul(L,le)|0)+Math.imul(T,se)|0,o=o+Math.imul(T,le)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,fe)|0;var Be=(l+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(S,pe)|0))<<13)|0;l=((o=o+Math.imul(S,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(z,oe),i=(i=Math.imul(z,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(O,se)|0,i=(i=i+Math.imul(O,le)|0)+Math.imul(P,se)|0,o=o+Math.imul(P,le)|0,n=n+Math.imul(L,de)|0,i=(i=i+Math.imul(L,fe)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,fe)|0;var Ne=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(B,pe)|0))<<13)|0;l=((o=o+Math.imul(B,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(z,se),i=(i=Math.imul(z,le))+Math.imul(F,se)|0,o=Math.imul(F,le),n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Le=(l+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,be)|0)+Math.imul(T,pe)|0))<<13)|0;l=((o=o+Math.imul(T,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(z,de),i=(i=Math.imul(z,fe))+Math.imul(F,de)|0,o=Math.imul(F,fe);var Te=(l+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(P,pe)|0))<<13)|0;l=((o=o+Math.imul(P,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Re=(l+(n=Math.imul(z,pe))|0)+((8191&(i=(i=Math.imul(z,be))+Math.imul(F,pe)|0))<<13)|0;return l=((o=Math.imul(F,be))+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,s[0]=me,s[1]=ge,s[2]=ye,s[3]=we,s[4]=ve,s[5]=xe,s[6]=Ee,s[7]=Ce,s[8]=_e,s[9]=Ae,s[10]=Me,s[11]=Se,s[12]=ke,s[13]=Ie,s[14]=Be,s[15]=Ne,s[16]=Le,s[17]=Te,s[18]=Re,0!==l&&(s[19]=l,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(h=f),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var c=67108863&n,s=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=s;l++){var u=o-l,d=(0|e.words[u])*(0|t.words[l]),f=67108863&d;c=67108863&(f=f+c|0),i+=(a=(a=a+(d/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}r.words[o]=c,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var c=a<<1,s=Math.cos(2*Math.PI/c),l=Math.sin(2*Math.PI/c),u=0;u<i;u+=c)for(var d=s,f=l,h=0;h<a;h++){var p=r[u+h],b=n[u+h],m=r[u+h+a],g=n[u+h+a],y=d*m-f*g;g=d*g+f*m,m=y,r[u+h]=p+m,n[u+h]=b+g,r[u+h+a]=p-m,n[u+h+a]=b-g,h!==c&&(y=s*d-l*f,f=s*f+l*d,d=y)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,n,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],n[2*a]=8191&o,o>>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)n[a]=0;r(0===o),r(!(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),c=new Array(n),s=new Array(n),l=new Array(n),u=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,l,n),this.transform(a,o,c,s,n,i),this.transform(l,o,u,d,n,i);for(var h=0;h<n;h++){var p=c[h]*u[h]-s[h]*d[h];s[h]=c[h]*d[h]+s[h]*u[h],c[h]=p}return this.conjugate(c,s,n),this.transform(c,s,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),p(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this.length=0===e?1:this.length,this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var c=this.words[t]&o,s=(0|this.words[t])-c<<n;this.words[t]=s|a,a=c>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),c=67108863^67108863>>>o<<o,s=n;if(i-=a,i=Math.max(0,i),s){for(var l=0;l<a;l++)s.words[l]=this.words[l];s.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var u=0;for(l=this.length-1;l>=0&&(0!==u||l>=i);l--){var d=0|this.words[l];this.words[l]=u<<26-o|d>>>o,u=d&c}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,o,a=e.length+n;this._expand(a);var c=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+c;var s=(0|e.words[i])*t;c=((o-=67108863&s)>>26)-(s/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)c=(o=(0|this.words[i+n])+c)>>26,this.words[i+n]=67108863&o;if(0===c)return this.strip();for(r(-1===c),c=0,i=0;i<this.length;i++)c=(o=-(0|this.words[i])+c)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var c,s=n.length-o.length;if("mod"!==t){(c=new i(null)).length=s+1,c.words=new Array(c.length);for(var l=0;l<c.length;l++)c.words[l]=0}var u=n.clone()._ishlnsubmul(o,1,s);0===u.negative&&(n=u,c&&(c.words[s]=1));for(var d=s-1;d>=0;d--){var f=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(f=Math.min(f/a|0,67108863),n._ishlnsubmul(o,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);c&&(c.words[d]=f)}return c&&c.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(o=c.div.neg()),"div"!==t&&(a=c.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(o=c.div.neg()),{div:o,mod:c.mod}):0!==(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(a=c.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:c.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,c},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),c=new i(0),s=new i(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var u=n.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0===(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(u),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,b=1;0===(n.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(c.isOdd()||s.isOdd())&&(c.iadd(u),s.isub(d)),c.iushrn(1),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(c),a.isub(s)):(n.isub(t),c.isub(o),s.isub(a))}return{a:c,b:s,gcd:n.iushln(l)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),c=new i(0),s=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;0===(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)c.isOdd()&&c.iadd(s),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(c)):(n.isub(t),c.isub(a))}return(o=0===t.cmpn(1)?a:c).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,a=n;0!==o&&a<this.length;a++){var c=0|this.words[a];o=(c+=o)>>>26,c&=67108863,this.words[a]=c}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function C(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(w,g),n(v,g),n(x,g),x.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new w;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return m[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var c=new i(1).toRed(this),s=c.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,l).cmp(s);)u.redIAdd(s);for(var d=this.pow(u,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(c);){for(var b=h,m=0;0!==b.cmp(c);m++)b=b.redSqr();r(m<p);var g=this.pow(d,new i(1).iushln(p-m-1));f=f.redMul(g),d=g.redSqr(),h=h.redMul(d),p=m}return f},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],a=0,c=0,s=t.bitLength()%26;for(0===s&&(s=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],u=s-1;u>=0;u--){var d=l>>u&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++c||0===n&&0===u)&&(o=this.mul(o,r[a]),c=0,a=0)):c=0}s=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new C(e)},n(C,E),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(Fn,jn)),Fn.exports}function Hn(){if(On)return Rn;function e(e,t){if(!e)throw new Error(t||"Assertion failed")}return On=1,Rn=e,e.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)},Rn}var qn,Kn,Vn={};function Wn(){return qn||(qn=1,function(){var e=Vn;function t(e){return 1===e.length?"0"+e:e}function r(e){for(var r="",n=0;n<e.length;n++)r+=t(e[n].toString(16));return r}e.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},e.zero2=t,e.toHex=r,e.encode=function(e,t){return"hex"===t?r(e):e}}()),Vn}function Zn(){return Kn||(Kn=1,function(){var e=zn,t=Dn(),r=Hn(),n=Wn();e.assert=r,e.toArray=n.toArray,e.zero2=n.zero2,e.toHex=n.toHex,e.encode=n.encode,e.getNAF=function(e,t,r){var n,i=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,a=e.clone();for(n=0;n<i.length;n++){var c,s=a.andln(o-1);a.isOdd()?(c=s>(o>>1)-1?(o>>1)-s:s,a.isubn(c)):c=0,i[n]=c,a.iushrn(1)}return i},e.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,c,s=e.andln(3)+i&3,l=t.andln(3)+o&3;3===s&&(s=-1),3===l&&(l=-1),a=1&s?3!==(n=e.andln(7)+i&7)&&5!==n||2!==l?s:-s:0,r[0].push(a),c=1&l?3!==(n=t.andln(7)+o&7)&&5!==n||2!==s?l:-l:0,r[1].push(c),2*i===a+1&&(i=1-i),2*o===c+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},e.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(e){return new t(e,"hex","le")}}()),zn}var $n,Gn={exports:{}};function Xn(){if($n)return Gn.exports;var e;function t(e){this.rand=e}if($n=1,Gn.exports=function(r){return e||(e=new t(null)),e.generate(r)},Gn.exports.Rand=t,t.prototype.generate=function(e){return this._rand(e)},t.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=bt;if("function"!=typeof r.randomBytes)throw new Error("Not supported");t.prototype._rand=function(e){return r.randomBytes(e)}}catch(e){}return Gn.exports}var Jn,Yn,Qn={};function ei(){if(Yn)return Jn;Yn=1;var e=Dn(),t=Zn(),r=t.getNAF,n=t.getJSF,i=t.assert;function o(t,r){this.type=t,this.p=new e(r.p,16),this.red=r.prime?e.red(r.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=r.n&&new e(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function a(e,t){this.curve=e,this.type=t,this.precomputed=null}return Jn=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){i(e.precomputed);var n=e._getDoubles(),o=r(t,1,this._bitLength),a=(1<<n.step+1)-(n.step%2==0?2:1);a/=3;var c,s,l=[];for(c=0;c<o.length;c+=n.step){s=0;for(var u=c+n.step-1;u>=c;u--)s=(s<<1)+o[u];l.push(s)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(c=0;c<l.length;c++)(s=l[c])===h?f=f.mixedAdd(n.points[c]):s===-h&&(f=f.mixedAdd(n.points[c].neg()));d=d.add(f)}return d.toP()},o.prototype._wnafMul=function(e,t){var n=4,o=e._getNAFPoints(n);n=o.wnd;for(var a=o.points,c=r(t,n,this._bitLength),s=this.jpoint(null,null,null),l=c.length-1;l>=0;l--){for(var u=0;l>=0&&0===c[l];l--)u++;if(l>=0&&u++,s=s.dblp(u),l<0)break;var d=c[l];i(0!==d),s="affine"===e.type?d>0?s.mixedAdd(a[d-1>>1]):s.mixedAdd(a[-d-1>>1].neg()):d>0?s.add(a[d-1>>1]):s.add(a[-d-1>>1].neg())}return"affine"===e.type?s.toP():s},o.prototype._wnafMulAdd=function(e,t,i,o,a){var c,s,l,u=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(c=0;c<o;c++){var p=(l=t[c])._getNAFPoints(e);u[c]=p.wnd,d[c]=p.points}for(c=o-1;c>=1;c-=2){var b=c-1,m=c;if(1===u[b]&&1===u[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],w=n(i[b],i[m]);for(h=Math.max(w[0].length,h),f[b]=new Array(h),f[m]=new Array(h),s=0;s<h;s++){var v=0|w[0][s],x=0|w[1][s];f[b][s]=y[3*(v+1)+(x+1)],f[m][s]=0,d[b]=g}}else f[b]=r(i[b],u[b],this._bitLength),f[m]=r(i[m],u[m],this._bitLength),h=Math.max(f[b].length,h),h=Math.max(f[m].length,h)}var E=this.jpoint(null,null,null),C=this._wnafT4;for(c=h;c>=0;c--){for(var _=0;c>=0;){var A=!0;for(s=0;s<o;s++)C[s]=0|f[s][c],0!==C[s]&&(A=!1);if(!A)break;_++,c--}if(c>=0&&_++,E=E.dblp(_),c<0)break;for(s=0;s<o;s++){var M=C[s];0!==M&&(M>0?l=d[s][M-1>>1]:M<0&&(l=d[s][-M-1>>1].neg()),E="affine"===l.type?E.mixedAdd(l):E.add(l))}}for(c=0;c<o;c++)d[c]=null;return a?E:E.toP()},o.BasePoint=a,a.prototype.eq=function(){throw new Error("Not implemented")},a.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,r){e=t.toArray(e,r);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*n)return 6===e[0]?i(e[e.length-1]%2==0):7===e[0]&&i(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},a.prototype.encodeCompressed=function(e){return this.encode(e,!0)},a.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},a.prototype.encode=function(e,r){return t.encode(this._encode(r),e)},a.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},a.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},a.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},a.prototype._getBeta=function(){return null},a.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t},Jn}var ti,ri,ni,ii,oi,ai,ci,si,li={exports:{}};function ui(){return ti||(ti=1,"function"==typeof Object.create?li.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:li.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),li.exports}function di(){return si||(si=1,function(e){var t=e;t.base=ei(),t.short=function(){if(ni)return ri;ni=1;var e=Zn(),t=Dn(),r=ui(),n=ei(),i=e.assert;function o(e){n.call(this,"short",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function a(e,r,i,o){n.BasePoint.call(this,e,"affine"),null===r&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(r,16),this.y=new t(i,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(e,r,i,o){n.BasePoint.call(this,e,"jacobian"),null===r&&null===i&&null===o?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(r,16),this.y=new t(i,16),this.z=new t(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(o,n),ri=o,o.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,n;if(e.beta)r=new t(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);r=(r=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(e.lambda)n=new t(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(r))?n=a[0]:(n=a[1],i(0===this.g.mul(n).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:n,basis:e.basis?e.basis.map(function(e){return{a:new t(e.a,16),b:new t(e.b,16)}}):this._getEndoBasis(n)}}},o.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:t.mont(e),n=new t(2).toRed(r).redInvm(),i=n.redNeg(),o=new t(3).toRed(r).redNeg().redSqrt().redMul(n);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},o.prototype._getEndoBasis=function(e){for(var r,n,i,o,a,c,s,l,u,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),p=new t(1),b=new t(0),m=new t(0),g=new t(1),y=0;0!==f.cmpn(0);){var w=h.div(f);l=h.sub(w.mul(f)),u=m.sub(w.mul(p));var v=g.sub(w.mul(b));if(!i&&l.cmp(d)<0)r=s.neg(),n=p,i=l.neg(),o=u;else if(i&&2===++y)break;s=l,h=f,f=l,m=p,p=u,g=b,b=v}a=l.neg(),c=u;var x=i.sqr().add(o.sqr());return a.sqr().add(c.sqr()).cmp(x)>=0&&(a=r,c=n),i.negative&&(i=i.neg(),o=o.neg()),a.negative&&(a=a.neg(),c=c.neg()),[{a:i,b:o},{a:a,b:c}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),c=o.mul(n.a),s=i.mul(r.b),l=o.mul(n.b);return{k1:e.sub(a).sub(c),k2:s.add(l).neg()}},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(0!==i.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(e,i)},o.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),c=e[o],s=c._getBeta();a.k1.negative&&(a.k1.ineg(),c=c.neg(!0)),a.k2.negative&&(a.k2.ineg(),s=s.neg(!0)),n[2*o]=c,n[2*o+1]=s,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var l=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return l},r(a,n.BasePoint),o.prototype.point=function(e,t,r){return new a(this,e,t,r)},o.prototype.pointFromJSON=function(e,t){return a.fromJSON(this,e,t)},a.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},a.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},a.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return this.inf},a.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},a.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},a.prototype.getX=function(){return this.x.fromRed()},a.prototype.getY=function(){return this.y.fromRed()},a.prototype.mul=function(e){return e=new t(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},a.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},a.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},a.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},a.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(c,n.BasePoint),o.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),c=n.redSub(i),s=o.redSub(a);if(0===c.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=c.redSqr(),u=l.redMul(c),d=n.redMul(l),f=s.redSqr().redIAdd(u).redISub(d).redISub(d),h=s.redMul(d.redISub(f)).redISub(o.redMul(u)),p=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(f,h,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),c=i.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),l=s.redMul(a),u=r.redMul(s),d=c.redSqr().redIAdd(l).redISub(u).redISub(u),f=c.redMul(u.redISub(d)).redISub(i.redMul(l)),h=this.z.redMul(a);return this.curve.jpoint(d,f,h)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,c=this.z,s=c.redSqr().redSqr(),l=a.redAdd(a);for(t=0;t<e;t++){var u=o.redSqr(),d=l.redSqr(),f=d.redSqr(),h=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(s)),p=o.redMul(d),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(f);var y=l.redMul(c);t+1<e&&(s=s.redMul(f)),o=b,c=y,l=g}return this.curve.jpoint(o,l.redMul(i),c)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var c=n.redAdd(n).redIAdd(n),s=c.redSqr().redISub(a).redISub(a),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=s,t=c.redMul(a.redISub(s)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(u).redISub(f);h=h.redIAdd(h);var p=u.redAdd(u).redIAdd(u),b=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},c.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var c=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),s=c.redSqr().redISub(a).redISub(a);e=s;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=c.redMul(a.redISub(s)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(u).redMul(this.x.redAdd(u));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(u);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},c.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),c=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),s=t.redAdd(t),l=(s=s.redIAdd(s)).redMul(a),u=c.redSqr().redISub(l.redAdd(l)),d=l.redISub(u),f=a.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=c.redMul(d).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(u,h,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),c=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),s=n.redIAdd(n);s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);var l=i.redIAdd(a).redSqr().redISub(o).redISub(c).redISub(s),u=t.redMul(l);u=(u=u.redIAdd(u)).redIAdd(u);var d=this.x.redMul(c).redISub(u);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(l.redMul(s.redISub(l)).redISub(a.redMul(c)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(c);return this.curve.jpoint(d,f,h)},c.prototype.mul=function(e,r){return e=new t(e,r),this.curve._wnafMul(this,e)},c.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},ri}(),t.mont=function(){if(oi)return ii;oi=1;var e=Dn(),t=ui(),r=ei(),n=Zn();function i(t){r.call(this,"mont",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(t,n,i){r.BasePoint.call(this,t,"projective"),null===n&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(n,16),this.z=new e(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(i,r),ii=i,i.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},t(o,r.BasePoint),i.prototype.decodePoint=function(e,t){return this.point(n.toArray(e,t),1)},i.prototype.point=function(e,t){return new o(this,e,t)},i.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),c=t.z.redMul(o.redAdd(a).redSqr()),s=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(c,s)},o.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ii}(),t.edwards=function(){if(ci)return ai;ci=1;var e=Zn(),t=Dn(),r=ui(),n=ei(),i=e.assert;function o(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,n.call(this,"edwards",e),this.a=new t(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),i(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function a(e,r,i,o,a){n.BasePoint.call(this,e,"projective"),null===r&&null===i&&null===o?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(r,16),this.y=new t(i,16),this.z=o?new t(o,16):this.curve.one,this.t=a&&new t(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(o,n),ai=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(o.redInvm()),c=a.redSqrt();if(0!==c.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var s=c.fromRed().isOdd();return(r&&!s||!r&&s)&&(c=c.redNeg()),this.point(e,c)},o.prototype.pointFromY=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var c=a.redSqrt();if(0!==c.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return c.fromRed().isOdd()!==r&&(c=c.redNeg()),this.point(c,e)},o.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},r(a,n.BasePoint),o.prototype.pointFromJSON=function(e){return a.fromJSON(this,e)},o.prototype.point=function(e,t,r,n){return new a(this,e,t,r,n)},a.fromJSON=function(e,t){return new a(e,t[0],t[1],t[2])},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},a.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),c=n.redSub(t),s=i.redMul(a),l=o.redMul(c),u=i.redMul(c),d=a.redMul(o);return this.curve.point(s,l,d,u)},a.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var l=(n=this.curve._mulA(c)).redAdd(s);this.zOne?(e=a.redSub(c).redSub(s).redMul(l.redSub(this.curve.two)),t=l.redMul(n.redSub(s)),r=l.redSqr().redSub(l).redSub(l)):(i=this.z.redSqr(),o=l.redSub(i).redISub(i),e=a.redSub(c).redISub(s).redMul(o),t=l.redMul(n.redSub(s)),r=l.redMul(o))}else n=c.redAdd(s),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(c.redISub(s)),r=n.redMul(o);return this.curve.point(e,t,r)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},a.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),c=i.redAdd(n),s=r.redAdd(t),l=o.redMul(a),u=c.redMul(s),d=o.redMul(s),f=a.redMul(c);return this.curve.point(l,u,f,d)},a.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),c=this.curve.d.redMul(o).redMul(a),s=i.redSub(c),l=i.redAdd(c),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(s).redMul(u);return this.curve.twisted?(t=n.redMul(l).redMul(a.redSub(this.curve._mulA(o))),r=s.redMul(l)):(t=n.redMul(l).redMul(a.redSub(o)),r=this.curve._mulC(s).redMul(l)),this.curve.point(d,t,r)},a.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},a.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},a.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},a.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},a.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},a.prototype.getY=function(){return this.normalize(),this.y.fromRed()},a.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},a.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},a.prototype.toP=a.prototype.normalize,a.prototype.mixedAdd=a.prototype.add,ai}()}(Qn)),Qn}var fi,hi,pi={},bi={},mi={},gi={exports:{}};function yi(){if(hi)return mi;hi=1;var e=Hn(),t=(fi||(fi=1,"function"==typeof Object.create?gi.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:gi.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}),gi.exports);function r(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function n(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}return mi.inherits=t,mi.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var i=0,o=0;o<e.length;o++){var a=e.charCodeAt(o);a<128?n[i++]=a:a<2048?(n[i++]=a>>6|192,n[i++]=63&a|128):r(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),n[i++]=a>>18|240,n[i++]=a>>12&63|128,n[i++]=a>>6&63|128,n[i++]=63&a|128):(n[i++]=a>>12|224,n[i++]=a>>6&63|128,n[i++]=63&a|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},mi.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t},mi.htonl=n,mi.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var a=e[i];"little"===t&&(a=n(a)),r+=o(a.toString(16))}return r},mi.zero2=i,mi.zero8=o,mi.join32=function(t,r,n,i){var o=n-r;e(o%4==0);for(var a=new Array(o/4),c=0,s=r;c<a.length;c++,s+=4){var l;l="big"===i?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],a[c]=l>>>0}return a},mi.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},mi.rotr32=function(e,t){return e>>>t|e<<32-t},mi.rotl32=function(e,t){return e<<t|e>>>32-t},mi.sum32=function(e,t){return e+t>>>0},mi.sum32_3=function(e,t,r){return e+t+r>>>0},mi.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},mi.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},mi.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},mi.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},mi.sum64_lo=function(e,t,r,n){return t+n>>>0},mi.sum64_4_hi=function(e,t,r,n,i,o,a,c){var s=0,l=t;return s+=(l=l+n>>>0)<t?1:0,s+=(l=l+o>>>0)<o?1:0,e+r+i+a+(s+=(l=l+c>>>0)<c?1:0)>>>0},mi.sum64_4_lo=function(e,t,r,n,i,o,a,c){return t+n+o+c>>>0},mi.sum64_5_hi=function(e,t,r,n,i,o,a,c,s,l){var u=0,d=t;return u+=(d=d+n>>>0)<t?1:0,u+=(d=d+o>>>0)<o?1:0,u+=(d=d+c>>>0)<c?1:0,e+r+i+a+s+(u+=(d=d+l>>>0)<l?1:0)>>>0},mi.sum64_5_lo=function(e,t,r,n,i,o,a,c,s,l){return t+n+o+c+l>>>0},mi.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},mi.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},mi.shr64_hi=function(e,t,r){return e>>>r},mi.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},mi}var wi,vi={};function xi(){if(wi)return vi;wi=1;var e=yi(),t=Hn();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return vi.BlockHash=r,r.prototype.update=function(t,r){if(t=e.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=e.join32(t,0,t.length-n,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},r.prototype.digest=function(e){return this.update(this._pad()),t(null===this.pending),this._digest(e)},r.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n},vi}var Ei,Ci,_i,Ai,Mi,Si,ki,Ii,Bi,Ni,Li,Ti,Ri={},Oi={};function Pi(){if(Ei)return Oi;Ei=1;var e=yi().rotr32;function t(e,t,r){return e&t^~e&r}function r(e,t,r){return e&t^e&r^t&r}function n(e,t,r){return e^t^r}return Oi.ft_1=function(e,i,o,a){return 0===e?t(i,o,a):1===e||3===e?n(i,o,a):2===e?r(i,o,a):void 0},Oi.ch32=t,Oi.maj32=r,Oi.p32=n,Oi.s0_256=function(t){return e(t,2)^e(t,13)^e(t,22)},Oi.s1_256=function(t){return e(t,6)^e(t,11)^e(t,25)},Oi.g0_256=function(t){return e(t,7)^e(t,18)^t>>>3},Oi.g1_256=function(t){return e(t,17)^e(t,19)^t>>>10},Oi}function Ui(){if(Mi)return Ai;Mi=1;var e=yi(),t=xi(),r=Pi(),n=Hn(),i=e.sum32,o=e.sum32_4,a=e.sum32_5,c=r.ch32,s=r.maj32,l=r.s0_256,u=r.s1_256,d=r.g0_256,f=r.g1_256,h=t.BlockHash,p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return e.inherits(b,h),Ai=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,h=0;h<16;h++)r[h]=e[t+h];for(;h<r.length;h++)r[h]=o(f(r[h-2]),r[h-7],d(r[h-15]),r[h-16]);var p=this.h[0],b=this.h[1],m=this.h[2],g=this.h[3],y=this.h[4],w=this.h[5],v=this.h[6],x=this.h[7];for(n(this.k.length===r.length),h=0;h<r.length;h++){var E=a(x,u(y),c(y,w,v),this.k[h],r[h]),C=i(l(p),s(p,b,m));x=v,v=w,w=y,y=i(g,E),g=m,m=b,b=p,p=i(E,C)}this.h[0]=i(this.h[0],p),this.h[1]=i(this.h[1],b),this.h[2]=i(this.h[2],m),this.h[3]=i(this.h[3],g),this.h[4]=i(this.h[4],y),this.h[5]=i(this.h[5],w),this.h[6]=i(this.h[6],v),this.h[7]=i(this.h[7],x)},b.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},Ai}function zi(){if(Bi)return Ii;Bi=1;var e=yi(),t=xi(),r=Hn(),n=e.rotr64_hi,i=e.rotr64_lo,o=e.shr64_hi,a=e.shr64_lo,c=e.sum64,s=e.sum64_hi,l=e.sum64_lo,u=e.sum64_4_hi,d=e.sum64_4_lo,f=e.sum64_5_hi,h=e.sum64_5_lo,p=t.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function m(){if(!(this instanceof m))return new m;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function g(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function y(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function w(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function v(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function x(e,t){var r=n(e,t,28)^n(t,e,2)^n(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=i(e,t,28)^i(t,e,2)^i(t,e,7);return r<0&&(r+=4294967296),r}function C(e,t){var r=n(e,t,14)^n(e,t,18)^n(t,e,9);return r<0&&(r+=4294967296),r}function _(e,t){var r=i(e,t,14)^i(e,t,18)^i(t,e,9);return r<0&&(r+=4294967296),r}function A(e,t){var r=n(e,t,1)^n(e,t,8)^o(e,t,7);return r<0&&(r+=4294967296),r}function M(e,t){var r=i(e,t,1)^i(e,t,8)^a(e,t,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=n(e,t,19)^n(t,e,29)^o(e,t,6);return r<0&&(r+=4294967296),r}function k(e,t){var r=i(e,t,19)^i(t,e,29)^a(e,t,6);return r<0&&(r+=4294967296),r}return e.inherits(m,p),Ii=m,m.blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=S(r[n-4],r[n-3]),o=k(r[n-4],r[n-3]),a=r[n-14],c=r[n-13],s=A(r[n-30],r[n-29]),l=M(r[n-30],r[n-29]),f=r[n-32],h=r[n-31];r[n]=u(i,o,a,c,s,l,f,h),r[n+1]=d(i,o,a,c,s,l,f,h)}},m.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],o=this.h[1],a=this.h[2],u=this.h[3],d=this.h[4],p=this.h[5],b=this.h[6],m=this.h[7],A=this.h[8],M=this.h[9],S=this.h[10],k=this.h[11],I=this.h[12],B=this.h[13],N=this.h[14],L=this.h[15];r(this.k.length===n.length);for(var T=0;T<n.length;T+=2){var R=N,O=L,P=C(A,M),U=_(A,M),z=g(A,M,S,k,I),F=y(A,M,S,k,I,B),j=this.k[T],D=this.k[T+1],H=n[T],q=n[T+1],K=f(R,O,P,U,z,F,j,D,H,q),V=h(R,O,P,U,z,F,j,D,H,q);R=x(i,o),O=E(i,o),P=w(i,o,a,u,d),U=v(i,o,a,u,d,p);var W=s(R,O,P,U),Z=l(R,O,P,U);N=I,L=B,I=S,B=k,S=A,k=M,A=s(b,m,K,V),M=l(m,m,K,V),b=d,m=p,d=a,p=u,a=i,u=o,i=s(K,V,W,Z),o=l(K,V,W,Z)}c(this.h,0,i,o),c(this.h,2,a,u),c(this.h,4,d,p),c(this.h,6,b,m),c(this.h,8,A,M),c(this.h,10,S,k),c(this.h,12,I,B),c(this.h,14,N,L)},m.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},Ii}function Fi(){return Ti||(Ti=1,Ri.sha1=function(){if(_i)return Ci;_i=1;var e=yi(),t=xi(),r=Pi(),n=e.rotl32,i=e.sum32,o=e.sum32_5,a=r.ft_1,c=t.BlockHash,s=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(l,c),Ci=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.W,c=0;c<16;c++)r[c]=e[t+c];for(;c<r.length;c++)r[c]=n(r[c-3]^r[c-8]^r[c-14]^r[c-16],1);var l=this.h[0],u=this.h[1],d=this.h[2],f=this.h[3],h=this.h[4];for(c=0;c<r.length;c++){var p=~~(c/20),b=o(n(l,5),a(p,u,d,f),h,r[c],s[p]);h=f,f=d,d=n(u,30),u=l,l=b}this.h[0]=i(this.h[0],l),this.h[1]=i(this.h[1],u),this.h[2]=i(this.h[2],d),this.h[3]=i(this.h[3],f),this.h[4]=i(this.h[4],h)},l.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},Ci}(),Ri.sha224=function(){if(ki)return Si;ki=1;var e=yi(),t=Ui();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return e.inherits(r,t),Si=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,7),"big"):e.split32(this.h.slice(0,7),"big")},Si}(),Ri.sha256=Ui(),Ri.sha384=function(){if(Li)return Ni;Li=1;var e=yi(),t=zi();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return e.inherits(r,t),Ni=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,12),"big"):e.split32(this.h.slice(0,12),"big")},Ni}(),Ri.sha512=zi()),Ri}var ji,Di,Hi,qi,Ki,Vi,Wi,Zi,$i,Gi,Xi,Ji,Yi,Qi,eo,to,ro,no,io,oo,ao,co,so,lo,uo,fo,ho,po,bo={};function mo(){return qi||(qi=1,function(e){var t=e;t.utils=yi(),t.common=xi(),t.sha=Fi(),t.ripemd=function(){if(ji)return bo;ji=1;var e=yi(),t=xi(),r=e.rotl32,n=e.sum32,i=e.sum32_3,o=e.sum32_4,a=t.BlockHash;function c(){if(!(this instanceof c))return new c;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function s(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function u(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}e.inherits(c,a),bo.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(e,t){for(var a=this.h[0],c=this.h[1],b=this.h[2],m=this.h[3],g=this.h[4],y=a,w=c,v=b,x=m,E=g,C=0;C<80;C++){var _=n(r(o(a,s(C,c,b,m),e[d[C]+t],l(C)),h[C]),g);a=g,g=m,m=r(b,10),b=c,c=_,_=n(r(o(y,s(79-C,w,v,x),e[f[C]+t],u(C)),p[C]),E),y=E,E=x,x=r(v,10),v=w,w=_}_=i(this.h[1],b,x),this.h[1]=i(this.h[2],m,E),this.h[2]=i(this.h[3],g,y),this.h[3]=i(this.h[4],a,w),this.h[4]=i(this.h[0],c,v),this.h[0]=_},c.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"little"):e.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return bo}(),t.hmac=function(){if(Hi)return Di;Hi=1;var e=yi(),t=Hn();function r(t,n,i){if(!(this instanceof r))return new r(t,n,i);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(e.toArray(n,i))}return Di=r,r.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),t(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=(new this.Hash).update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=(new this.Hash).update(e)},r.prototype.update=function(e,t){return this.inner.update(e,t),this},r.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},Di}(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(bi)),bi}function go(){return Wi||(Wi=1,function(e){var t,r=e,n=mo(),i=di(),o=Zn().assert;function a(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new a(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=a,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=Vi?Ki:(Vi=1,Ki={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(pi)),pi}function yo(){if(eo)return Qi;eo=1;var e=Dn(),t=function(){if($i)return Zi;$i=1;var e=mo(),t=Wn(),r=Hn();function n(e){if(!(this instanceof n))return new n(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var i=t.toArray(e.entropy,e.entropyEnc||"hex"),o=t.toArray(e.nonce,e.nonceEnc||"hex"),a=t.toArray(e.pers,e.persEnc||"hex");r(i.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(i,o,a)}return Zi=n,n.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},n.prototype._hmac=function(){return new e.hmac(this.hash,this.K)},n.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},n.prototype.reseed=function(e,n,i,o){"string"!=typeof n&&(o=i,i=n,n=null),e=t.toArray(e,n),i=t.toArray(i,o),r(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},n.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(i=n,n=r,r=null),n&&(n=t.toArray(n,i||"hex"),this._update(n));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(n),this._reseed++,t.encode(a,r)},Zi}(),r=Zn(),n=go(),i=Xn(),o=r.assert,a=function(){if(Xi)return Gi;Xi=1;var e=Dn(),t=Zn().assert;function r(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}return Gi=r,r.fromPublic=function(e,t,n){return t instanceof r?t:new r(e,{pub:t,pubEnc:n})},r.fromPrivate=function(e,t,n){return t instanceof r?t:new r(e,{priv:t,privEnc:n})},r.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},r.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(t,r){this.priv=new e(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(e,r){if(e.x||e.y)return"mont"===this.ec.curve.type?t(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||t(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,r)},r.prototype.derive=function(e){return e.validate()||t(e.validate(),"public point not validated"),e.mul(this.priv).getX()},r.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},r.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Gi}(),c=function(){if(Yi)return Ji;Yi=1;var e=Dn(),t=Zn(),r=t.assert;function n(t,i){if(t instanceof n)return t;this._importDER(t,i)||(r(t.r&&t.s,"Signature without r or s"),this.r=new e(t.r,16),this.s=new e(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function i(){this.place=0}function o(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function a(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function c(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}return Ji=n,n.prototype._importDER=function(r,n){r=t.toArray(r,n);var a=new i;if(48!==r[a.place++])return!1;var c=o(r,a);if(!1===c)return!1;if(c+a.place!==r.length)return!1;if(2!==r[a.place++])return!1;var s=o(r,a);if(!1===s)return!1;if(128&r[a.place])return!1;var l=r.slice(a.place,s+a.place);if(a.place+=s,2!==r[a.place++])return!1;var u=o(r,a);if(!1===u)return!1;if(r.length!==u+a.place)return!1;if(128&r[a.place])return!1;var d=r.slice(a.place,u+a.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new e(l),this.s=new e(d),this.recoveryParam=null,!0},n.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&n[0]&&(n=[0].concat(n)),r=a(r),n=a(n);!(n[0]||128&n[1]);)n=n.slice(1);var i=[2];c(i,r.length),(i=i.concat(r)).push(2),c(i,n.length);var o=i.concat(n),s=[48];return c(s,o.length),s=s.concat(o),t.encode(s,e)},Ji}();function s(e){if(!(this instanceof s))return new s(e);"string"==typeof e&&(o(Object.prototype.hasOwnProperty.call(n,e),"Unknown curve "+e),e=n[e]),e instanceof n.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}return Qi=s,s.prototype.keyPair=function(e){return new a(this,e)},s.prototype.keyFromPrivate=function(e,t){return a.fromPrivate(this,e,t)},s.prototype.keyFromPublic=function(e,t){return a.fromPublic(this,e,t)},s.prototype.genKeyPair=function(r){r||(r={});for(var n=new t({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||i(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),a=this.n.sub(new e(2));;){var c=new e(n.generate(o));if(!(c.cmp(a)>0))return c.iaddn(1),this.keyFromPrivate(c)}},s.prototype._truncateToN=function(t,r,n){var i;if(e.isBN(t)||"number"==typeof t)i=(t=new e(t,16)).byteLength();else if("object"==typeof t)i=t.length,t=new e(t,16);else{var o=t.toString();i=o.length+1>>>1,t=new e(o,16)}"number"!=typeof n&&(n=8*i);var a=n-this.n.bitLength();return a>0&&(t=t.ushrn(a)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},s.prototype.sign=function(r,n,i,a){if("object"==typeof i&&(a=i,i=null),a||(a={}),"string"!=typeof r&&"number"!=typeof r&&!e.isBN(r)){o("object"==typeof r&&r&&"number"==typeof r.length,"Expected message to be an array-like, a hex string, or a BN instance"),o(r.length>>>0===r.length);for(var s=0;s<r.length;s++)o((255&r[s])===r[s])}n=this.keyFromPrivate(n,i),r=this._truncateToN(r,!1,a.msgBitLength),o(!r.isNeg(),"Can not sign a negative message");var l=this.n.byteLength(),u=n.getPrivate().toArray("be",l),d=r.toArray("be",l);o(new e(d).eq(r),"Can not sign message");for(var f=new t({hash:this.hash,entropy:u,nonce:d,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new e(1)),p=0;;p++){var b=a.k?a.k(p):new e(f.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(h)>=0)){var m=this.g.mul(b);if(!m.isInfinity()){var g=m.getX(),y=g.umod(this.n);if(0!==y.cmpn(0)){var w=b.invm(this.n).mul(y.mul(n.getPrivate()).iadd(r));if(0!==(w=w.umod(this.n)).cmpn(0)){var v=(m.getY().isOdd()?1:0)|(0!==g.cmp(y)?2:0);return a.canonical&&w.cmp(this.nh)>0&&(w=this.n.sub(w),v^=1),new c({r:y,s:w,recoveryParam:v})}}}}}},s.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o=(t=new c(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,l=a.invm(this.n),u=l.mul(e).umod(this.n),d=l.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),d)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(u,r.getPublic(),d)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},s.prototype.recoverPubKey=function(t,r,n,i){o((3&n)===n,"The recovery param is more than two bits"),r=new c(r,i);var a=this.n,s=new e(t),l=r.r,u=r.s,d=1&n,f=n>>1;if(l.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");l=f?this.curve.pointFromX(l.add(this.curve.n),d):this.curve.pointFromX(l,d);var h=r.r.invm(a),p=a.sub(s).mul(h).umod(a),b=u.mul(h).umod(a);return this.g.mulAdd(p,l,b)},s.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")},Qi}function wo(){if(ao)return oo;ao=1;var e=mo(),t=go(),r=Zn(),n=r.assert,i=r.parseBytes,o=function(){if(ro)return to;ro=1;var e=Zn(),t=e.assert,r=e.parseBytes,n=e.cachedProperty;function i(e,t){this.eddsa=e,this._secret=r(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=r(t.pub)}return i.fromPublic=function(e,t){return t instanceof i?t:new i(e,{pub:t})},i.fromSecret=function(e,t){return t instanceof i?t:new i(e,{secret:t})},i.prototype.secret=function(){return this._secret},n(i,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),n(i,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),n(i,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),n(i,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),n(i,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),n(i,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),i.prototype.sign=function(e){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},i.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},i.prototype.getSecret=function(r){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),r)},i.prototype.getPublic=function(t){return e.encode(this.pubBytes(),t)},to=i}(),a=function(){if(io)return no;io=1;var e=Dn(),t=Zn(),r=t.assert,n=t.cachedProperty,i=t.parseBytes;function o(t,n){this.eddsa=t,"object"!=typeof n&&(n=i(n)),Array.isArray(n)&&(r(n.length===2*t.encodingLength,"Signature has invalid size"),n={R:n.slice(0,t.encodingLength),S:n.slice(t.encodingLength)}),r(n.R&&n.S,"Signature without R or S"),t.isPoint(n.R)&&(this._R=n.R),n.S instanceof e&&(this._S=n.S),this._Rencoded=Array.isArray(n.R)?n.R:n.Rencoded,this._Sencoded=Array.isArray(n.S)?n.S:n.Sencoded}return n(o,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),n(o,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),n(o,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),n(o,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},no=o}();function c(r){if(n("ed25519"===r,"only tested with ed25519 so far"),!(this instanceof c))return new c(r);r=t[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=e.sha512}return oo=c,c.prototype.sign=function(e,t){e=i(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),o=this.g.mul(n),a=this.encodePoint(o),c=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=n.add(c).umod(this.curve.n);return this.makeSignature({R:o,S:s,Rencoded:a})},c.prototype.verify=function(e,t,r){if(e=i(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(o)).eq(a)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return r.intFromLE(e.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(e){return o.fromPublic(this,e)},c.prototype.keyFromSecret=function(e){return o.fromSecret(this,e)},c.prototype.makeSignature=function(e){return e instanceof a?e:new a(this,e)},c.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},c.prototype.decodePoint=function(e){var t=(e=r.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),i=!!(128&e[t]),o=r.intFromLE(n);return this.curve.pointFromY(o,i)},c.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(e){return r.intFromLE(e)},c.prototype.isPoint=function(e){return e instanceof this.pointClass},oo}function vo(){if(lo)return so;lo=1;const e=(co||(co=1,function(){var e=Pn;e.version=Un,e.utils=Zn(),e.rand=Xn(),e.curve=di(),e.curves=go(),e.ec=yo(),e.eddsa=wo()}()),Pn).ec,t=new e("secp256k1"),r=t.curve,n=r.n.constructor;function i(e){const i=e[0];switch(i){case 2:case 3:return 33!==e.length?null:function(e,i){let o=new n(i);if(o.cmp(r.p)>=0)return null;o=o.toRed(r.red);let a=o.redSqr().redIMul(o).redIAdd(r.b).redSqrt();3===e!==a.isOdd()&&(a=a.redNeg());const c=o.redSqr().redIMul(o);return a.redSqr().redISub(c.redIAdd(r.b)).isZero()?t.keyPair({pub:{x:o,y:a}}):null}(i,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,i,o){let a=new n(i),c=new n(o);if(a.cmp(r.p)>=0||c.cmp(r.p)>=0)return null;if(a=a.toRed(r.red),c=c.toRed(r.red),(6===e||7===e)&&c.isOdd()!==(7===e))return null;const s=a.redSqr().redIMul(a);return c.redSqr().redISub(s.redIAdd(r.b)).isZero()?t.keyPair({pub:{x:a,y:c}}):null}(i,e.subarray(1,33),e.subarray(33,65));default:return null}}function o(e,t){const r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}return so={contextRandomize:()=>0,privateKeyVerify(e){const t=new n(e);return t.cmp(r.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new n(e),i=r.n.sub(t).umod(r.n).toArrayLike(Uint8Array,"be",32);return e.set(i),0},privateKeyTweakAdd(e,t){const i=new n(t);if(i.cmp(r.n)>=0)return 1;if(i.iadd(new n(e)),i.cmp(r.n)>=0&&i.isub(r.n),i.isZero())return 1;const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},privateKeyTweakMul(e,t){let i=new n(t);if(i.cmp(r.n)>=0||i.isZero())return 1;i.imul(new n(e)),i.cmp(r.n)>=0&&(i=i.umod(r.n));const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},publicKeyVerify:e=>null===i(e)?1:0,publicKeyCreate(e,i){const a=new n(i);if(a.cmp(r.n)>=0||a.isZero())return 1;return o(e,t.keyFromPrivate(i).getPublic()),0},publicKeyConvert(e,t){const r=i(t);if(null===r)return 1;return o(e,r.getPublic()),0},publicKeyNegate(e,t){const r=i(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),o(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=i(t[e]),null===r[e])return 1;let n=r[0].getPublic();for(let e=1;e<r.length;++e)n=n.add(r[e].pub);return n.isInfinity()?2:(o(e,n),0)},publicKeyTweakAdd(e,t,a){const c=i(t);if(null===c)return 1;if((a=new n(a)).cmp(r.n)>=0)return 2;const s=c.getPublic().add(r.g.mul(a));return s.isInfinity()?2:(o(e,s),0)},publicKeyTweakMul(e,t,a){const c=i(t);if(null===c)return 1;if((a=new n(a)).cmp(r.n)>=0||a.isZero())return 2;return o(e,c.getPublic().mul(a)),0},signatureNormalize(e){const i=new n(e.subarray(0,32)),o=new n(e.subarray(32,64));return i.cmp(r.n)>=0||o.cmp(r.n)>=0?1:(1===o.cmp(t.nh)&&e.set(r.n.sub(o).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const i=t.subarray(0,32),o=t.subarray(32,64);if(new n(i).cmp(r.n)>=0)return 1;if(new n(o).cmp(r.n)>=0)return 1;const{output:a}=e;let c=a.subarray(4,37);c[0]=0,c.set(i,1);let s=33,l=0;for(;s>1&&0===c[l]&&!(128&c[l+1]);--s,++l);if(c=c.subarray(l),128&c[0])return 1;if(s>1&&0===c[0]&&!(128&c[1]))return 1;let u=a.subarray(39,72);u[0]=0,u.set(o,1);let d=33,f=0;for(;d>1&&0===u[f]&&!(128&u[f+1]);--d,++f);return u=u.subarray(f),128&u[0]||d>1&&0===u[0]&&!(128&u[1])?1:(e.outputlen=6+s+d,a[0]=48,a[1]=e.outputlen-2,a[2]=2,a[3]=c.length,a.set(c,4),a[4+s]=2,a[5+s]=u.length,a.set(u,6+s),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const i=t[3];if(0===i)return 1;if(5+i>=t.length)return 1;if(2!==t[4+i])return 1;const o=t[5+i];if(0===o)return 1;if(6+i+o!==t.length)return 1;if(128&t[4])return 1;if(i>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[i+6])return 1;if(o>1&&0===t[i+6]&&!(128&t[i+7]))return 1;let a=t.subarray(4,4+i);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1;let c=t.subarray(6+i);if(33===c.length&&0===c[0]&&(c=c.slice(1)),c.length>32)throw new Error("S length is too long");let s=new n(a);s.cmp(r.n)>=0&&(s=new n(0));let l=new n(t.subarray(6+i));return l.cmp(r.n)>=0&&(l=new n(0)),e.set(s.toArrayLike(Uint8Array,"be",32),0),e.set(l.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,i,o,a,c){if(c){const e=c;c=t=>{const r=e(i,o,null,a,t);if(!(r instanceof Uint8Array&&32===r.length))throw new Error("This is the way");return new n(r)}}const s=new n(o);if(s.cmp(r.n)>=0||s.isZero())return 1;let l;try{l=t.sign(i,o,{canonical:!0,k:c,pers:a})}catch(e){return 1}return e.signature.set(l.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(l.s.toArrayLike(Uint8Array,"be",32),32),e.recid=l.recoveryParam,0},ecdsaVerify(e,o,a){const c={r:e.subarray(0,32),s:e.subarray(32,64)},s=new n(c.r),l=new n(c.s);if(s.cmp(r.n)>=0||l.cmp(r.n)>=0)return 1;if(1===l.cmp(t.nh)||s.isZero()||l.isZero())return 3;const u=i(a);if(null===u)return 2;const d=u.getPublic();return t.verify(o,c,d)?0:3},ecdsaRecover(e,i,a,c){const s={r:i.slice(0,32),s:i.slice(32,64)},l=new n(s.r),u=new n(s.s);if(l.cmp(r.n)>=0||u.cmp(r.n)>=0)return 1;if(l.isZero()||u.isZero())return 2;let d;try{d=t.recoverPubKey(c,s,a)}catch(e){return 2}return o(e,d),0},ecdh(e,o,a,c,s,l,u){const d=i(o);if(null===d)return 1;const f=new n(a);if(f.cmp(r.n)>=0||f.isZero())return 2;const h=d.getPublic().mul(f);if(void 0===s){const r=h.encode(null,!0),n=t.hash().update(r).digest();for(let t=0;t<32;++t)e[t]=n[t]}else{l||(l=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)l[e]=t[e];u||(u=new Uint8Array(32));const r=h.getY().toArray("be",32);for(let e=0;e<32;++e)u[e]=r[e];const n=s(l,u,c);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}},so}function xo(){return fo||(fo=1,uo=function(){if(Nn)return Bn;Nn=1;const e="Impossible case. Please create issue.",t="The tweak was out of range or the resulted private key is invalid",r="The tweak was out of range or equal to zero",n="Unknow error on context randomization",i="Private Key is invalid",o="Public Key could not be parsed",a="Public Key serialization error",c="The sum of the public keys is not valid",s="Signature could not be parsed",l="The nonce generation function failed, or the private key was invalid",u="Public key could not be recover",d="Scalar was invalid (zero or overflow)";function f(e,t){if(!e)throw new Error(t)}function h(e,t,r){if(f(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;f(r.includes(t.length),n)}else{const n=`Expected ${e} to be an Uint8Array with length ${r}`;f(t.length===r,n)}}function p(e){f("Boolean"===m(e),"Expected compressed to be a Boolean")}function b(e=e=>new Uint8Array(e),t){return"function"==typeof e&&(e=e(t)),h("output",e,t),e}function m(e){return Object.prototype.toString.call(e).slice(8,-1)}return Bn=g=>({contextRandomize(e){if(f(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&h("seed",e,32),1===g.contextRandomize(e))throw new Error(n)},privateKeyVerify:e=>(h("private key",e,32),0===g.privateKeyVerify(e)),privateKeyNegate(t){switch(h("private key",t,32),g.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(e)}},privateKeyTweakAdd(e,r){switch(h("private key",e,32),h("tweak",r,32),g.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(t)}},privateKeyTweakMul(e,t){switch(h("private key",e,32),h("tweak",t,32),g.privateKeyTweakMul(e,t)){case 0:return e;case 1:throw new Error(r)}},publicKeyVerify:e=>(h("public key",e,[33,65]),0===g.publicKeyVerify(e)),publicKeyCreate(e,t=!0,r){switch(h("private key",e,32),p(t),r=b(r,t?33:65),g.publicKeyCreate(r,e)){case 0:return r;case 1:throw new Error(i);case 2:throw new Error(a)}},publicKeyConvert(e,t=!0,r){switch(h("public key",e,[33,65]),p(t),r=b(r,t?33:65),g.publicKeyConvert(r,e)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(a)}},publicKeyNegate(t,r=!0,n){switch(h("public key",t,[33,65]),p(r),n=b(n,r?33:65),g.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(e);case 3:throw new Error(a)}},publicKeyCombine(e,t=!0,r){f(Array.isArray(e),"Expected public keys to be an Array"),f(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)h("public key",t,[33,65]);switch(p(t),r=b(r,t?33:65),g.publicKeyCombine(r,e)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(c);case 3:throw new Error(a)}},publicKeyTweakAdd(e,r,n=!0,i){switch(h("public key",e,[33,65]),h("tweak",r,32),p(n),i=b(i,n?33:65),g.publicKeyTweakAdd(i,e,r)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(t)}},publicKeyTweakMul(e,t,n=!0,i){switch(h("public key",e,[33,65]),h("tweak",t,32),p(n),i=b(i,n?33:65),g.publicKeyTweakMul(i,e,t)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(r)}},signatureNormalize(e){switch(h("signature",e,64),g.signatureNormalize(e)){case 0:return e;case 1:throw new Error(s)}},signatureExport(t,r){h("signature",t,64);const n={output:r=b(r,72),outputlen:72};switch(g.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(s);case 2:throw new Error(e)}},signatureImport(t,r){switch(h("signature",t),r=b(r,64),g.signatureImport(r,t)){case 0:return r;case 1:throw new Error(s);case 2:throw new Error(e)}},ecdsaSign(t,r,n={},i){h("message",t,32),h("private key",r,32),f("Object"===m(n),"Expected options to be an Object"),void 0!==n.data&&h("options.data",n.data),void 0!==n.noncefn&&f("Function"===m(n.noncefn),"Expected options.noncefn to be a Function");const o={signature:i=b(i,64),recid:null};switch(g.ecdsaSign(o,t,r,n.data,n.noncefn)){case 0:return o;case 1:throw new Error(l);case 2:throw new Error(e)}},ecdsaVerify(e,t,r){switch(h("signature",e,64),h("message",t,32),h("public key",r,[33,65]),g.ecdsaVerify(e,t,r)){case 0:return!0;case 3:return!1;case 1:throw new Error(s);case 2:throw new Error(o)}},ecdsaRecover(t,r,n,i=!0,o){switch(h("signature",t,64),f("Number"===m(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),h("message",n,32),p(i),o=b(o,i?33:65),g.ecdsaRecover(o,t,r,n)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(u);case 3:throw new Error(e)}},ecdh(e,t,r={},n){switch(h("public key",e,[33,65]),h("private key",t,32),f("Object"===m(r),"Expected options to be an Object"),void 0!==r.data&&h("options.data",r.data),void 0!==r.hashfn?(f("Function"===m(r.hashfn),"Expected options.hashfn to be a Function"),void 0!==r.xbuf&&h("options.xbuf",r.xbuf,32),void 0!==r.ybuf&&h("options.ybuf",r.ybuf,32),h("output",n)):n=b(n,32),g.ecdh(n,e,t,r.data,r.hashfn,r.xbuf,r.ybuf)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(d)}}}),Bn}()(vo())),uo}function Eo(){if(ho)return Ln;ho=1;var e=Ln&&Ln.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.PublicKey=void 0;const t=Nr(),r=mn(),n=e(xo()),i=wt();class o{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class a extends o{enum;ed25519Key;secp256k1Key;constructor(e){const t=function(e){switch(e){case i.KeyType.ED25519:return"ed25519Key";case i.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?a.fromString(e):e}static fromString(e){const r=e.split(":");let n,o;if(1===r.length)n=r[0];else{if(2!==r.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");n=r[1],o=function(e){switch(e.toLowerCase()){case"ed25519":return i.KeyType.ED25519;case"secp256k1":return i.KeyType.SECP256K1;default:throw new Error(`Unknown key type ${e}`)}}(r[0])}const c=(0,t.baseDecode)(n);o||(o=c.length===i.KeySize.SECP256k1_PUBLIC_KEY?i.KeyType.SECP256K1:i.KeyType.ED25519);const s=o===i.KeyType.ED25519?i.KeySize.ED25519_PUBLIC_KEY:i.KeySize.SECP256k1_PUBLIC_KEY;if(c.length!==s)throw new Error(`Invalid public key size (${c.length}), must be ${s}`);return new a({keyType:o,data:c})}toString(){const e=(0,t.baseEncode)(this.data);return`${function(e){switch(e){case i.KeyType.ED25519:return"ed25519";case i.KeyType.SECP256K1:return"secp256k1";default:throw new Error(`Unknown key type ${e}`)}}(this.keyType)}:${e}`}verify(e,t){const o=this.keyType,a=this.data;switch(o){case i.KeyType.ED25519:return r.ed25519.verify(t,e,a);case i.KeyType.SECP256K1:return n.default.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...a]));default:throw new Error(`Unknown key type: ${o}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}return Ln.PublicKey=a,Ln}function Co(){if(po)return At;po=1;var e=At&&At.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(At,"__esModule",{value:!0}),At.KeyPairEd25519=void 0;const t=Nr(),r=mn(),n=e(In()),i=wt(),o=Ct(),a=Eo();class c extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const n=(0,t.baseDecode)(e),o=new Uint8Array(n.slice(0,i.KeySize.SECRET_KEY)),c=r.ed25519.getPublicKey(new Uint8Array(o));this.publicKey=new a.PublicKey({keyType:i.KeyType.ED25519,data:c}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,n.default)(i.KeySize.SECRET_KEY),o=r.ed25519.getPublicKey(new Uint8Array(e)),a=new Uint8Array([...e,...o]);return new c((0,t.baseEncode)(a))}sign(e){return{signature:r.ed25519.sign(e,(0,t.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return At.KeyPairEd25519=c,At}var _o,Ao,Mo,So,ko={};function Io(){if(_o)return ko;_o=1;var e=ko&&ko.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ko,"__esModule",{value:!0}),ko.KeyPairSecp256k1=void 0;const t=Nr(),r=e(In()),n=e(xo()),i=wt(),o=Ct(),a=Eo();class c extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const r=(0,t.baseDecode)(e),o=new Uint8Array(r.slice(0,i.KeySize.SECRET_KEY)),c=n.default.publicKeyCreate(new Uint8Array(o),!1),s=c.subarray(1,c.length);this.publicKey=new a.PublicKey({keyType:i.KeyType.SECP256K1,data:s}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,r.default)(i.KeySize.SECRET_KEY),o=n.default.publicKeyCreate(new Uint8Array(e),!1),a=o.subarray(1,o.length),s=new Uint8Array([...e,...a]);return new c((0,t.baseEncode)(s))}sign(e){const{signature:r,recid:i}=n.default.ecdsaSign(e,(0,t.baseDecode)(this.secretKey));return{signature:new Uint8Array([...r,i]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return ko.KeyPairSecp256k1=c,ko}function Bo(){return Mo||(Mo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.KeyPairSecp256k1=e.KeyPairEd25519=e.KeyPair=e.KeyType=void 0;var t=wt();Object.defineProperty(e,"KeyType",{enumerable:!0,get:function(){return t.KeyType}});var r=function(){if(Ao)return xt;Ao=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.KeyPair=void 0;const e=Ct(),t=Co(),r=Io();class n extends e.KeyPairBase{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return t.KeyPairEd25519.fromRandom();case"SECP256K1":return r.KeyPairSecp256k1.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const n=e.split(":");if(2!==n.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");switch(n[0].toUpperCase()){case"ED25519":return new t.KeyPairEd25519(n[1]);case"SECP256K1":return new r.KeyPairSecp256k1(n[1]);default:throw new Error(`Unknown curve: ${n[0]}`)}}}return xt.KeyPair=n,xt}();Object.defineProperty(e,"KeyPair",{enumerable:!0,get:function(){return r.KeyPair}});var n=Co();Object.defineProperty(e,"KeyPairEd25519",{enumerable:!0,get:function(){return n.KeyPairEd25519}});var i=Io();Object.defineProperty(e,"KeyPairSecp256k1",{enumerable:!0,get:function(){return i.KeyPairSecp256k1}});var o=Eo();Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return o.PublicKey}})}(gt)),gt}function No(){return So||(So=1,function(e){var t=Ye&&Ye.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=Ye&&Ye.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Ye&&Ye.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=Ye&&Ye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.authPayloadSchema=e.AuthPayload=void 0,e.verifySignature=function(t,r){const n=new l(t),i=o.serialize(e.authPayloadSchema,n),c=Uint8Array.from(a.default.sha256.array(i));let u=new Uint8Array(Buffer.from(r.signature,"base64"));return s.PublicKey.from(r.publicKey).verify(c,u)};const o=n(function(){if(dt)return Qe;dt=1;var e=Qe&&Qe.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=Qe&&Qe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Qe&&Qe.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var i in r)"default"!==i&&Object.prototype.hasOwnProperty.call(r,i)&&e(n,r,i);return t(n,r),n};Qe.__esModule=!0,Qe.deserialize=Qe.serialize=void 0;var n=function(){if(ct)return et;ct=1;var e=et&&et.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=et&&et.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=et&&et.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var i in r)"default"!==i&&Object.prototype.hasOwnProperty.call(r,i)&&e(n,r,i);return t(n,r),n};et.__esModule=!0,et.BorshSerializer=void 0;var n=rt(),i=ot(),o=r(lt()),a=function(){function e(e){this.encoded=new i.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(n.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&o.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&o.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&o.expect_type(e,"string",this.fieldPath);for(var t=e,r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?r.push(i):i<2048?r.push(192|i>>6,128|63&i):i<55296||i>=57344?r.push(224|i>>12,128|i>>6&63,128|63&i):(n++,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}this.encoded.store_value(r.length,"u32"),this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_boolean=function(e){this.checkTypes&&o.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&o.expect_enum(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw new Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(o.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw new Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?o.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?o.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var a=i[n];this.encode_value(a,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,a=n;i<a.length;i++){var c=a[i];this.encode_value(c,t.map.key),this.encode_value(r?e.get(c):e[c],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();return et.BorshSerializer=a,et}(),i=function(){if(ut)return ft;ut=1,ft.__esModule=!0,ft.BorshDeserializer=void 0;var e=rt(),t=ot(),r=function(){function r(e){this.buffer=new t.DecodeBuffer(e)}return r.prototype.decode=function(e){return this.decode_value(e)},r.prototype.decode_value=function(t){if("string"==typeof t){if(e.integers.includes(t))return this.decode_integer(t);if("string"===t)return this.decode_string();if("bool"===t)return this.decode_boolean()}if("object"==typeof t){if("option"in t)return this.decode_option(t);if("enum"in t)return this.decode_enum(t);if("array"in t)return this.decode_array(t);if("set"in t)return this.decode_set(t);if("map"in t)return this.decode_map(t);if("struct"in t)return this.decode_struct(t)}throw new Error("Unsupported type: ".concat(t))},r.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},r.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},r.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e)),r=[],n=0;n<e;++n){var i=t[n];if(i<128)r.push(i);else if(i<224)r.push((31&i)<<6|63&t[++n]);else if(i<240)r.push((15&i)<<12|(63&t[++n])<<6|63&t[++n]);else{var o=(7&i)<<18|(63&t[++n])<<12|(63&t[++n])<<6|63&t[++n];r.push(o)}}return String.fromCodePoint.apply(String,r)},r.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},r.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw new Error("Invalid option ".concat(t));return null},r.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw new Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},r.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},r.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},r.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},r.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},r}();return ft.BorshDeserializer=r,ft}(),o=r(lt());return Qe.serialize=function(e,t,r){return void 0===r&&(r=!0),r&&o.validate_schema(e),new n.BorshSerializer(r).encode(t,e)},Qe.deserialize=function(e,t,r){return void 0===r&&(r=!0),r&&o.validate_schema(e),new i.BorshDeserializer(t).decode(e)},Qe}()),a=i((ht||(ht=1,c=pt,function(){var e="input is invalid type",t="object"==typeof window,r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var n=!t&&"object"==typeof self,i=!r.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&"renderer"!=process.type;i?r=$e:n&&(r=self);var o=!r.JS_SHA256_NO_COMMON_JS&&c.exports,a=!r.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),l=[-2147483648,8388608,32768,128],u=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],h=[];!r.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var p=function(e,t){return function(r){return new w(t,!0).update(r)[e]()}},b=function(e){var t=p("hex",e);i&&(t=m(t,e)),t.create=function(){return new w(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=p(n,e)}return t},m=function(t,n){var i,o=bt,a=bt.Buffer,c=n?"sha224":"sha256";return i=a.from&&!r.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(r){if("string"==typeof r)return o.createHash(c).update(r,"utf8").digest("hex");if(null==r)throw new Error(e);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===a?o.createHash(c).update(i(r)).digest("hex"):t(r)}},g=function(e,t){return function(r,n){return new v(r,t,!0).update(n)[e]()}},y=function(e){var t=g("hex",e);t.create=function(t){return new v(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=g(n,e)}return t};function w(e,t){t?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function v(t,r,n){var i,o=typeof t;if("string"===o){var c,s=[],l=t.length,u=0;for(i=0;i<l;++i)(c=t.charCodeAt(i))<128?s[u++]=c:c<2048?(s[u++]=192|c>>>6,s[u++]=128|63&c):c<55296||c>=57344?(s[u++]=224|c>>>12,s[u++]=128|c>>>6&63,s[u++]=128|63&c):(c=65536+((1023&c)<<10|1023&t.charCodeAt(++i)),s[u++]=240|c>>>18,s[u++]=128|c>>>12&63,s[u++]=128|c>>>6&63,s[u++]=128|63&c);t=s}else{if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e)}t.length>64&&(t=new w(r,!0).update(t).array());var d=[],f=[];for(i=0;i<64;++i){var h=t[i]||0;d[i]=92^h,f[i]=54^h}w.call(this,r,n),this.update(f),this.oKeyPad=d,this.inner=!0,this.sharedMemory=n}w.prototype.update=function(t){if(!this.finalized){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,o,c=0,s=t.length,l=this.blocks;c<s;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,this.block=l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),r)for(o=this.start;c<s&&o<64;++c)l[o>>>2]|=t[c]<<u[3&o++];else for(o=this.start;c<s&&o<64;++c)(i=t.charCodeAt(c))<128?l[o>>>2]|=i<<u[3&o++]:i<2048?(l[o>>>2]|=(192|i>>>6)<<u[3&o++],l[o>>>2]|=(128|63&i)<<u[3&o++]):i<55296||i>=57344?(l[o>>>2]|=(224|i>>>12)<<u[3&o++],l[o>>>2]|=(128|i>>>6&63)<<u[3&o++],l[o>>>2]|=(128|63&i)<<u[3&o++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++c)),l[o>>>2]|=(240|i>>>18)<<u[3&o++],l[o>>>2]|=(128|i>>>12&63)<<u[3&o++],l[o>>>2]|=(128|i>>>6&63)<<u[3&o++],l[o>>>2]|=(128|63&i)<<u[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=l[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=l[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var e,t,r,n,i,o,a,c,s,l=this.h0,u=this.h1,f=this.h2,h=this.h3,p=this.h4,b=this.h5,m=this.h6,g=this.h7,y=this.blocks;for(e=16;e<64;++e)t=((i=y[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=y[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,y[e]=y[e-16]+t+y[e-7]+r|0;for(s=u&f,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,g=(i=y[0]-1413257819)-150054599|0,h=i+24177077|0):(o=704751109,g=(i=y[0]-210244248)-1521486534|0,h=i+143694565|0),this.first=!1):(t=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(o=l&u)^l&f^s,g=h+(i=g+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&b^~p&m)+d[e]+y[e])|0,h=i+(t+n)|0),t=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(a=h&l)^h&u^o,m=f+(i=m+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&p^~g&b)+d[e+1]+y[e+1])|0,t=((f=i+(t+n)|0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(c=f&h)^f&l^a,b=u+(i=b+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&p)+d[e+2]+y[e+2])|0,t=((u=i+(t+n)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(s=u&f)^u&h^c,p=l+(i=p+(r=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&m^~b&g)+d[e+3]+y[e+3])|0,l=i+(t+n)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+l|0,this.h1=this.h1+u|0,this.h2=this.h2+f|0,this.h3=this.h3+h|0,this.h4=this.h4+p|0,this.h5=this.h5+b|0,this.h6=this.h6+m|0,this.h7=this.h7+g|0},w.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,c=this.h7,l=s[e>>>28&15]+s[e>>>24&15]+s[e>>>20&15]+s[e>>>16&15]+s[e>>>12&15]+s[e>>>8&15]+s[e>>>4&15]+s[15&e]+s[t>>>28&15]+s[t>>>24&15]+s[t>>>20&15]+s[t>>>16&15]+s[t>>>12&15]+s[t>>>8&15]+s[t>>>4&15]+s[15&t]+s[r>>>28&15]+s[r>>>24&15]+s[r>>>20&15]+s[r>>>16&15]+s[r>>>12&15]+s[r>>>8&15]+s[r>>>4&15]+s[15&r]+s[n>>>28&15]+s[n>>>24&15]+s[n>>>20&15]+s[n>>>16&15]+s[n>>>12&15]+s[n>>>8&15]+s[n>>>4&15]+s[15&n]+s[i>>>28&15]+s[i>>>24&15]+s[i>>>20&15]+s[i>>>16&15]+s[i>>>12&15]+s[i>>>8&15]+s[i>>>4&15]+s[15&i]+s[o>>>28&15]+s[o>>>24&15]+s[o>>>20&15]+s[o>>>16&15]+s[o>>>12&15]+s[o>>>8&15]+s[o>>>4&15]+s[15&o]+s[a>>>28&15]+s[a>>>24&15]+s[a>>>20&15]+s[a>>>16&15]+s[a>>>12&15]+s[a>>>8&15]+s[a>>>4&15]+s[15&a];return this.is224||(l+=s[c>>>28&15]+s[c>>>24&15]+s[c>>>20&15]+s[c>>>16&15]+s[c>>>12&15]+s[c>>>8&15]+s[c>>>4&15]+s[15&c]),l},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,c=this.h7,s=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,a>>>24&255,a>>>16&255,a>>>8&255,255&a];return this.is224||s.push(c>>>24&255,c>>>16&255,c>>>8&255,255&c),s},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},v.prototype=new w,v.prototype.finalize=function(){if(w.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();w.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),w.prototype.finalize.call(this)}};var x=b();x.sha256=x,x.sha224=b(!0),x.sha256.hmac=y(),x.sha224.hmac=y(!0),o?c.exports=x:(r.sha256=x.sha256,r.sha224=x.sha224)}()),pt.exports));var c;const s=Bo();class l{message;recipient;nonce;callbackUrl;tag;constructor({message:e,nonce:t,recipient:r}){this.tag=2147484061,this.message=e,this.nonce=t,this.recipient=r}}e.AuthPayload=l,e.authPayloadSchema={struct:{tag:"u32",message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}}}(Ye)),Ye}var Lo={};const To=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Ro(e){return To.test(e)}function Oo(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.split(/[:\/]/g).pop().toLowerCase()}Oo.valid=Ro;var Po,Uo,zo,Fo,jo,Do,Ho,qo=Ge(Object.freeze({__proto__:null,default:Oo,uuid4:Oo,valid:Ro})),Ko={},Vo={exports:{}},Wo={exports:{}};function Zo(){return Po||(Po=1,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&t.rotl(e,8)|4278255360&t.rotl(e,24);for(var r=0;r<e.length;r++)e[r]=t.endian(e[r]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],o=0;o<4;o++)8*n+6*o<=8*t.length?r.push(e.charAt(i>>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(n))>>>6-2*i);return r}},Wo.exports=t),Wo.exports;var e,t}function $o(){if(zo)return Uo;zo=1;var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};return Uo=e}function Go(){return Fo||(Fo=1,function(){var e=Zo(),t=$o().utf8,r=$o().bin,n=function(n,i){var o=e.wordsToBytes(function(r){r.constructor==String?r=t.stringToBytes(r):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(r)?r=Array.prototype.slice.call(r,0):Array.isArray(r)||(r=r.toString());var n=e.bytesToWords(r),i=8*r.length,o=[],a=1732584193,c=-271733879,s=-1732584194,l=271733878,u=-1009589776;n[i>>5]|=128<<24-i%32,n[15+(i+64>>>9<<4)]=i;for(var d=0;d<n.length;d+=16){for(var f=a,h=c,p=s,b=l,m=u,g=0;g<80;g++){if(g<16)o[g]=n[d+g];else{var y=o[g-3]^o[g-8]^o[g-14]^o[g-16];o[g]=y<<1|y>>>31}var w=(a<<5|a>>>27)+u+(o[g]>>>0)+(g<20?1518500249+(c&s|~c&l):g<40?1859775393+(c^s^l):g<60?(c&s|c&l|s&l)-1894007588:(c^s^l)-899497514);u=l,l=s,s=c<<30|c>>>2,c=a,a=w}a+=f,c+=h,s+=p,l+=b,u+=m}return[a,c,s,l,u]}(n));return i&&i.asBytes?o:i&&i.asString?r.bytesToString(o):e.bytesToHex(o)};n._blocksize=16,n._digestsize=20,Vo.exports=n}()),Vo.exports}function Xo(){return Do||(Do=1,function(e){var t=Lo&&Lo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getExtension=e.RequestFailed=e.wait=void 0;const r=t(qo),n=Nr(),i=(jo||(jo=1,function(e){var t=Ko&&Ko.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createRequest=e.computeRequestId=e.deleteRequest=e.getResponse=e.proxyApi=void 0;const r=t(Go()),n=t(qo),i=Nr();e.proxyApi="https://h4n.app",e.getResponse=async t=>{const r=await fetch(`${e.proxyApi}/${t}/response`,{headers:{"content-type":"application/json"},method:"GET"});if(!1===r.ok)throw Error(await r.text());const{data:n}=await r.json();return JSON.parse(n)},e.deleteRequest=async t=>{const r=await fetch(`${e.proxyApi}/${t}`,{headers:{"content-type":"application/json"},method:"DELETE"});if(!1===r.ok)throw Error(await r.text())},e.computeRequestId=async e=>{const t=(0,i.baseEncode)(JSON.stringify({...e,_id:(0,n.default)()})),o=(0,r.default)(t);return{requestId:Buffer.from(o,"hex").toString("base64").replaceAll("/","_").replaceAll("-","+").slice(0,13),query:t}},e.createRequest=async(t,r)=>{const{query:n,requestId:i}=await(0,e.computeRequestId)(t),o=await fetch(`${e.proxyApi}/${i}/request`,{body:JSON.stringify({data:n}),headers:{"content-type":"application/json"},method:"POST",signal:r});if(!1===o.ok)throw Error(await o.text());return i}}(Ko)),Ko);e.wait=e=>new Promise(t=>setTimeout(t,e));class o extends Error{payload;name="RequestFailed";constructor(e){super(),this.payload=e}}e.RequestFailed=o;let a;e.getExtension=()=>"undefined"==typeof window?null:window.hotExtension,"undefined"!=typeof window&&window.addEventListener("message",e=>{"hot-close"===e.data&&(a?.remove(),a=void 0)});e.default=new class{walletId="https://t.me/herewalletbot/app";ancestorOrigins=["http://localhost:1234","https://my.herewallet.app","https://tgapp-dev.herewallet.app","https://tgapp.herewallet.app","https://beta.herewallet.app"];connection=new Promise(e=>"undefined"==typeof window||window?.self===window?.top?e(null):void this.injectedRequest("initialized",{}).then(e).catch(()=>e(null)));get isInjected(){return"undefined"!=typeof window&&(null!=window.hotExtension?window.hotExtension.autoRun:this.ancestorOrigins.includes(window.location.ancestorOrigins?.[0]))}openInHotBrowserUrl=null;toggleOpenInHotBrowser(e){this.openInHotBrowserUrl=e}customProvider;setupEthProvider(e){this.customProvider=e}async injectedRequest(e,t){const n=(0,r.default)();return new Promise((r,i)=>{const o=e=>{if(e.data.id===n)return window?.removeEventListener("message",o),e.data.success?r(e.data.payload):i(e.data.payload)};window?.parent.postMessage({$hot:!0,method:e,request:t,id:n},"*"),window?.addEventListener("message",o)})}subscribe(e,t){return window.hotExtension?window.hotExtension.subscribe(e,t):()=>{}}async request(t,c){if(null!=window.hotExtension)return window.hotExtension.request(t,c);if(this.isInjected)return this.injectedRequest(t,c);const s=(0,r.default)(),l=window?.Telegram?.WebApp,u=await(0,i.createRequest)({inside:!!this.openInHotBrowserUrl||"ethereum"===t&&null==this.customProvider,origin:"string"==typeof this.openInHotBrowserUrl?this.openInHotBrowserUrl:location.href,$hot:!0,method:t,request:c,id:s}),d=`${this.walletId}?startapp=hotconnect-${(0,n.baseEncode)(u)}`;if(l)l?.openTelegramLink(d);else{(e=>{a?.remove(),a=document.createElement("div");const t=document.createElement("iframe");a?.appendChild(t),t.src=e,t.allow="usb",t.style.border="none",t.style.borderRadius="16px",t.style.background="#fff",t.style.overflow="hidden",t.style.background="#1D1F20",t.style.border="1px solid #2C3034",t.style.width="375px",t.style.height="560px",t.onclick=e=>e.stopPropagation(),a.style.padding="16px",a.style.zIndex="100000000000000",a.style.position="fixed",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",a.style.top="0",a.style.left="0",a.style.width="100%",a.style.height="100%",a.style.background="rgba(0, 0, 0, 0.1)",a.style.backdropFilter="blur(24px)",a.onclick=()=>{a?.remove(),a=void 0},document.body.appendChild(a)})(`${"https://hot-labs.org/hot-widget/index.html"}?hotconnect-${(0,n.baseEncode)(u)}`)}const f=async()=>{await(0,e.wait)(3e3);const t=await(0,i.getResponse)(u).catch(()=>null);if(null==t)return await f();if(t.success)return t.payload;throw new o(t.payload)},h=await f();return a?.remove(),h}}}(Lo)),Lo}var Jo=(Ho||(Ho=1,function(e){var t=Je&&Je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.RequestFailed=e.HOT=e.authPayloadSchema=e.AuthPayload=e.verifySignature=void 0;var r=No();Object.defineProperty(e,"verifySignature",{enumerable:!0,get:function(){return r.verifySignature}}),Object.defineProperty(e,"AuthPayload",{enumerable:!0,get:function(){return r.AuthPayload}}),Object.defineProperty(e,"authPayloadSchema",{enumerable:!0,get:function(){return r.authPayloadSchema}});var n=Xo();Object.defineProperty(e,"HOT",{enumerable:!0,get:function(){return t(n).default}}),Object.defineProperty(e,"RequestFailed",{enumerable:!0,get:function(){return n.RequestFailed}})}(Je)),Je);const Yo={name:H.Hot,website:"https://hot-labs.org/",isAvailable:()=>"undefined"!=typeof window&&!!window.hotExtension,connect:async()=>{try{return{publicKey:(await Jo.HOT.request("stellar:getAddress",{})).address}}catch{throw new Error("Failed to connect to Hana wallet.")}},signTransaction:async(e,t={})=>{try{return(await Jo.HOT.request("stellar:signTransaction",{xdr:e,accountToSign:t.address})).signedTxXdr}catch{throw new Error("Failed to sign the transaction with Hana wallet.")}},getNetwork:async()=>{throw new Error("Failed to get network from HOT")}},Qo={name:H.Hana,website:"https://www.hanawallet.io/",isAvailable:()=>{var e;return"undefined"!=typeof window&&!!(null===(e=window.hanaWallet)||void 0===e?void 0:e.stellar)},connect:async()=>{try{if(!await window.hanaWallet.stellar.getPublicKey())throw new Error("Hana Wallet is not installed or connected.");return{publicKey:await window.hanaWallet.stellar.getPublicKey()}}catch(e){throw new Error("Failed to connect to Hana wallet.")}},signTransaction:async(e,t={})=>{var r,n;try{const i=null===(n=null===(r=null===window||void 0===window?void 0:window.hanaWallet)||void 0===r?void 0:r.stellar)||void 0===n?void 0:n.signTransaction;if("function"!=typeof i)throw new Error("Hana Wallet does not support signing transactions.");return await i({xdr:e,address:t.address,networkPassphrase:t.networkPassphrase})}catch(e){throw new Error("Failed to sign the transaction with Hana wallet.")}},getNetwork:async()=>{var e;try{if(!(null===(e=window.hanaWallet)||void 0===e?void 0:e.stellar))throw new Error("Hana Wallet is not installed.");const t=await window.hanaWallet.stellar.getNetworkDetails();return{network:t.network,passphrase:t.networkPassphrase}}catch{throw new Error("Error getting network from Rabet:")}}},ea={name:H.Rabet,website:"https://rabet.io",isAvailable:()=>new Promise(e=>{setTimeout(()=>e("undefined"!=typeof window&&!!window.rabet),250)}),connect:async()=>{try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");return{publicKey:(await window.rabet.connect()).publicKey}}catch(e){throw new Error("Failed to connect to Rabet.")}},signTransaction:async(e,t={})=>{try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");return(await window.rabet.sign(e,t.networkPassphrase===q.PUBLIC?"mainnet":"testnet")).xdr}catch(e){throw new Error("Failed to sign the transaction with Rabet.")}},disconnect:async()=>{try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");window.rabet.disconnect()}catch(e){throw new Error("Failed to disconnect from Rabet.")}},getNetwork:async()=>{try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");return await window.rabet.getNetwork()}catch(e){throw new Error("Error getting network from Rabet:")}}},ta={name:H.Xbull,website:"https://xbull.app",isAvailable:()=>new Promise(e=>{setTimeout(()=>{e("undefined"!=typeof window&&!!window.xBullSDK)},250)}),connect:async()=>{try{if(!window.xBullSDK)throw new Error("xBull Wallet is not installed.");await window.xBullSDK.connect({canRequestPublicKey:!0,canRequestSign:!0});return{publicKey:await window.xBullSDK.getPublicKey()}}catch{throw new Error("Failed to connect to xBull.")}},signTransaction:async(e,t={})=>{try{if(!window.xBullSDK)throw new Error("xBull Wallet is not installed.");return await window.xBullSDK.signXDR(e,{network:t.networkPassphrase,publicKey:t.address})}catch{throw new Error("Failed to sign the transaction with xBull.")}},getNetwork:async()=>{try{if(!window.xBullSDK)throw new Error("xBull Wallet is not installed.");const e=await window.xBullSDK.getNetwork();return{network:e.network,passphrase:e.networkPassphrase}}catch{throw new Error("Error getting network from Rabet:")}}},ra={name:H.Lobstr,website:"https://lobstr.co",isAvailable:async()=>await m.isConnected(),connect:async()=>{try{if(!await m.isConnected())throw new Error("LOBSTR Wallet is not installed or connected.");return{publicKey:await m.getPublicKey()}}catch{throw new Error("Failed to connect to LOBSTR.")}},signTransaction:async e=>{try{if(!m.signTransaction)throw new Error("LOBSTR Wallet does not support signing transactions.");return await m.signTransaction(e)}catch{throw new Error("Failed to sign the transaction with LOBSTR.")}},getNetwork:async()=>{throw new Error("Failed to get network from LOBSTR")}},na=e=>{const t=Object.entries(q).find(([,t])=>t===e);if(!t)throw new Error(`Unknown network passphrase: ${e}`);return t[0].toLowerCase()},ia={name:H.Albedo,website:"https://albedo.link",isAvailable:()=>!0,connect:async()=>{try{return{publicKey:(await g.publicKey({token:"Connect to Albedo"})).pubkey}}catch(e){throw new Error("Failed to connect to Albedo.")}},signTransaction:async(e,t={})=>{try{const{address:r,submit:n}=t;return(await g.tx({xdr:e,pubkey:r,network:(null==t?void 0:t.networkPassphrase)&&na(null==t?void 0:t.networkPassphrase),submit:n})).signed_envelope_xdr}catch(e){throw new Error("Failed to sign the transaction with Albedo.")}},getNetwork:async()=>{throw new Error("Failed to get network from albedo")}},oa={name:H.Freighter,website:"https://freighter.app",isAvailable:()=>new Promise(e=>{const t=setTimeout(()=>{e(!1)},1500);setTimeout(()=>{y.isConnected().then(({isConnected:r,error:n})=>{clearTimeout(t),e(!n&&r)}).catch(()=>{clearTimeout(t),e(!1)})},500)}),connect:async()=>{try{if(!await y.isConnected())throw new Error("Freighter Wallet is not installed or connected.");const e=await y.requestAccess();if(e.error&&"The user rejected this request."===e.error.message)throw new Error("Failed to connect to Freighter");if(""===e.address.trim())throw new Error("Failed to connect to Freighter.");return{publicKey:e.address}}catch(e){if("Failed to connect to Freighter."===e.message){return await oa.connect()}throw new Error("Failed to connect to Freighter.")}},signTransaction:async(e,t={})=>{try{if(!await y.isConnected())throw new Error("Freighter Wallet is not installed or connected.");return(await w(e,{address:null==t?void 0:t.address,networkPassphrase:null==t?void 0:t.networkPassphrase})).signedTxXdr}catch(e){throw new Error("Failed to sign the transaction with Freighter.")}},getNetwork:async()=>{try{if(!await y.isConnected())throw new Error("Freighter Wallet is not installed or connected.");const e=await y.getNetwork();if(e.error)throw new Error("Failed to get network from Freighter");return{network:e.network,passphrase:e.networkPassphrase}}catch(e){throw new Error("Failed to disconnect from Rabet.")}}},aa={[H.Rabet]:ea,[H.Freighter]:oa,[H.Hana]:Qo,[H.Lobstr]:ra,[H.Albedo]:ia,[H.Xbull]:ta,[H.Hot]:Yo},ca=b(null),sa=()=>{const e=ua(),t=pa();return d(()=>{e.setValue(e=>({...e,account:t})),t.account},[t]),l.createElement(l.Fragment,null)},la=({config:e,isDemo:t,children:i})=>{var o;if(0===e.networks.length)throw new Error("no network is set in config.networks");if(!e.networks.includes(e.defaultNetwork))throw new Error("default network is not listed in networks");for(const t of e.networks)if(!te[t]){if(!e.transports)throw new Error("Must set transports for custom networks");if(!e.transports[t])throw new Error("Must set transports for custom networks")}const{horizon:a,soroban:c}=re(e.defaultNetwork,null!==(o=e.transports)&&void 0!==o?o:{}),[s,f]=u(K.ONBOARDING),[h,p]=u({config:{...e,explorer:e.explorer||"stellarchain",lang:e.lang,appearance:{...We,...e.appearance},showWalletUIs:!1!==e.showWalletUIs},activeNetwork:e.defaultNetwork,account:null,isDemo:null!=t&&t,user:{wallet:null,phoneNumber:null,email:null},isModalOpen:!1,isReady:!1,isAuthenticated:!1,waitingStatus:"connecting",signTransaction:{xdr:"",options:{network:"",isSoroban:!1},result:null,rejecter:null,resolver:null},availableWallets:[],showAllWallets:!1,servers:{horizon:new r.Server(a.url),soroban:new n.Server(c.url)}});((e,t,r)=>{const[n,i]=u(!1);d(()=>{const t=setInterval(()=>{e.isAuthenticated&&e.user.wallet&&Me(aa[e.user.wallet.name]).then(t=>{t&&!e.config.networks.includes(t)?i(!0):i(!1)})},500);return()=>{clearInterval(t),i(!1)}},[e.isAuthenticated,e.config.networks,e.user.wallet]),d(()=>{n?(r(K.WRONG_NETWORK),t(e=>({...e,isModalOpen:!0}))):t(e=>({...e,isModalOpen:!1}))},[n])})(h,p,f),d(()=>{p(t=>({...t,config:{...t.config,appearance:{...We,...e.appearance},loginMethods:e.loginMethods||[]}}))},[e]),d(()=>{var e;const{horizon:t,soroban:i}=re(h.activeNetwork,null!==(e=h.config.transports)&&void 0!==e?e:{});p(e=>({...e,servers:{horizon:new r.Server(t.url),soroban:new n.Server(i.url)}}))},[h.config.transports,h.config.networks,h.activeNetwork]);const b=()=>{(()=>{const e=t=>{"https://mobile.rabet.io"===t.origin&&"RABET/INSTALL"===t.data.type&&(new Function(t.data.message)(),window.removeEventListener("message",e))};window.addEventListener("message",e)})(),setTimeout(()=>{(async()=>Promise.all(Object.values(aa).map(async e=>{try{const t=await e.isAvailable();return{wallet:e,isAvailable:t}}catch(t){return{wallet:e,isAvailable:!1}}})))().then(e=>{const t=(e=>{const t=Ie(),r=new Map(e.map(e=>[e.wallet.name,e])),n=[],i=new Set;for(const e of t){const t=r.get(e);t&&(n.push(t),i.add(e))}const o=e.filter(e=>!i.has(e.wallet.name));return[...n,...o].map((e,t)=>({...e,isRecent:0===t}))})(e.filter(e=>e.isAvailable));p(e=>({...e,isReady:!0,availableWallets:t}))})},150)};d(()=>("complete"===document.readyState?b():window.addEventListener("load",b),()=>{window.removeEventListener("load",b)}),[h.isAuthenticated]);return l.createElement(ca.Provider,{value:{value:h,setValue:p,route:s,setRoute:f}},l.createElement(sa,null),i,l.createElement(Ve,{isOpen:h.isModalOpen,closeModal:()=>{p(e=>({...e,isModalOpen:!1,showAllWallets:!1}))}}))},ua=()=>{const e=p(ca);if(!e)throw new Error("useProvider must be used within a ProviderContext.");return e},da=()=>{const e=ua();if(!e)throw new Error("Blux hooks must be used within a BluxProvider context.");return e},fa=(e,t)=>{var i;if(!t)return{soroban:e.servers.soroban,horizon:e.servers.horizon,networkPassphrase:e.activeNetwork};const{horizon:o,soroban:a}=re(t,null!==(i=e.config.transports)&&void 0!==i?i:{});return{networkPassphrase:t,soroban:new n.Server(a.url),horizon:new r.Server(o.url)}},ha=e=>{const{value:t}=da(),[r,n]=u(fa(t,e));return d(()=>{n(fa(t,e||t.activeNetwork))},[e,t.activeNetwork]),r},pa=e=>{const{value:t}=da(),{horizon:r,networkPassphrase:n}=ha(null==e?void 0:e.network),[i,o]=u({error:null,loading:!0,account:null});return d(()=>{var n;o({error:null,account:null,loading:!0});const i=null===(n=t.user.wallet)||void 0===n?void 0:n.address;if(!i&&!(null==e?void 0:e.address))return void o({account:null,loading:!1,error:new Error("Both user.wallet.address and address parameter are undefined")});const a=(null==e?void 0:e.address)?e.address:i;(async(e,t)=>{try{return await e.loadAccount(t)}catch{return null}})(r,a).then(e=>{o({error:null,loading:!1,account:e})}).catch(e=>{o({error:e,loading:!1,account:null})})},[null==e?void 0:e.address,n,t.user.wallet]),i},ba=({asset:e,address:t,network:r})=>{const{value:n}=da(),{horizon:i,networkPassphrase:o}=ha(r),[a,c]=u({error:null,loading:!0,balance:"0"});return d(()=>{var r;c({error:null,loading:!0,balance:"0"});const o=null===(r=n.user.wallet)||void 0===r?void 0:r.address;if(!o&&!t)return void c({loading:!1,balance:"0",error:new Error("Both user.wallet.address and address parameter are undefined")});const a=t||o;i.loadAccount(a).then(t=>{if("native"===e){const e=t.balances.find(e=>"native"===e.asset_type);c({error:null,loading:!1,balance:(null==e?void 0:e.balance)||"0"})}else if("string"==typeof e){const r=e.split(":"),n=t.balances.find(e=>e.asset_code===r[0]&&e.asset_issuer===r[1]);c({error:null,loading:!1,balance:(null==n?void 0:n.balance)||"0"})}}).catch(e=>{c({error:e,loading:!1,balance:"0"})})},[t,e,n.user.wallet,o]),a},ma=()=>{const e=ua();if(!e)throw new Error("useBlux must be used within a ProviderContext.");const{value:t}=e,[r,n]=u(t.activeNetwork);return d(()=>{n(t.activeNetwork)},[t.activeNetwork]),r},ga=e=>{const{value:t}=da(),{horizon:r,networkPassphrase:n}=ha(null==e?void 0:e.network),[i,o]=u({error:null,loading:!0,transactions:[]});return d(()=>{var n;o({error:null,loading:!0,transactions:[]});const i=null===(n=t.user.wallet)||void 0===n?void 0:n.address;if(!i&&!(null==e?void 0:e.address))return void o({loading:!1,transactions:[],error:new Error("Both user.wallet.address and address parameter are undefined")});const a=(null==e?void 0:e.address)?null==e?void 0:e.address:i;r.transactions().forAccount(a).limit((null==e?void 0:e.limit)||5).order("desc").call().then(t=>{if(null==e?void 0:e.includeOperations){const e=[];for(const r of t.records)e.push(r.operations());Promise.all(e).then(e=>{const r=t.records.map((t,r)=>({...t,operations:e[r].records}));o({error:null,loading:!1,transactions:r})})}else o({error:null,loading:!1,transactions:t.records})}).catch(e=>{o({error:e,loading:!1,transactions:[]})})},[null==e?void 0:e.address,n,t.user.wallet]),i},ya=()=>{const e=ua();if(!e)throw new Error("useBlux must be used within a ProviderContext.");const{value:t,setValue:r}=e;return{switchNetwork:e=>{if(!t.config.networks.includes(e))throw new Error("New network must be defined in config.networks");r({...t,activeNetwork:e})},networks:t.config.networks}};export{la as BluxProvider,Ze as defaultDarkTheme,We as defaultLightTheme,v as networks,ee as url,pa as useAccount,ba as useBalance,ae as useBlux,ma as useNetwork,ya as useSwitchNetwork,ga as useTransactions};
|