diff --git a/assets/index-BaIRtTap.js b/assets/index-D2KcGe_M.js similarity index 86% rename from assets/index-BaIRtTap.js rename to assets/index-D2KcGe_M.js index 25868ebd..d1adee85 100644 --- a/assets/index-BaIRtTap.js +++ b/assets/index-D2KcGe_M.js @@ -220,7 +220,7 @@ Error generating stack: `+tt.message+` width: auto; animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; `),indeterminate2Keyframe)),LinearProgress=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiLinearProgress"}),{className:et,color:tt="primary",value:nt,valueBuffer:rt,variant:ot="indeterminate"}=_e,it=_objectWithoutPropertiesLoose(_e,_excluded$s),st=_extends$2({},_e,{color:tt,variant:ot}),at=useUtilityClasses$q(st),ct=useRtl(),lt={},dt={bar1:{},bar2:{}};if((ot==="determinate"||ot==="buffer")&&nt!==void 0){lt["aria-valuenow"]=Math.round(nt),lt["aria-valuemin"]=0,lt["aria-valuemax"]=100;let ft=nt-100;ct&&(ft=-ft),dt.bar1.transform=`translateX(${ft}%)`}if(ot==="buffer"&&rt!==void 0){let ft=(rt||0)-100;ct&&(ft=-ft),dt.bar2.transform=`translateX(${ft}%)`}return jsxRuntimeExports.jsxs(LinearProgressRoot,_extends$2({className:clsx(at.root,et),ownerState:st,role:"progressbar"},lt,{ref:$},it,{children:[ot==="buffer"?jsxRuntimeExports.jsx(LinearProgressDashed,{className:at.dashed,ownerState:st}):null,jsxRuntimeExports.jsx(LinearProgressBar1,{className:at.bar1,ownerState:st,style:dt.bar1}),ot==="determinate"?null:jsxRuntimeExports.jsx(LinearProgressBar2,{className:at.bar2,ownerState:st,style:dt.bar2})]}))});function getLinkUtilityClass(s){return generateUtilityClass$1("MuiLink",s)}const linkClasses=generateUtilityClasses$1("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),colorTransformations={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},transformDeprecatedColors=s=>colorTransformations[s]||s,getTextDecoration=({theme:s,ownerState:j})=>{const $=transformDeprecatedColors(j.color),_e=getPath(s,`palette.${$}`,!1)||j.color,et=getPath(s,`palette.${$}Channel`);return"vars"in s&&et?`rgba(${et} / 0.4)`:alpha_1(_e,.4)},_excluded$r=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],useUtilityClasses$p=s=>{const{classes:j,component:$,focusVisible:_e,underline:et}=s,tt={root:["root",`underline${capitalize$1(et)}`,$==="button"&&"button",_e&&"focusVisible"]};return composeClasses(tt,getLinkUtilityClass,j)},LinkRoot=styled(Typography,{name:"MuiLink",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,j[`underline${capitalize$1($.underline)}`],$.component==="button"&&j.button]}})(({theme:s,ownerState:j})=>_extends$2({},j.underline==="none"&&{textDecoration:"none"},j.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},j.underline==="always"&&_extends$2({textDecoration:"underline"},j.color!=="inherit"&&{textDecorationColor:getTextDecoration({theme:s,ownerState:j})},{"&:hover":{textDecorationColor:"inherit"}}),j.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${linkClasses.focusVisible}`]:{outline:"auto"}})),Link$1=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiLink"}),{className:et,color:tt="primary",component:nt="a",onBlur:rt,onFocus:ot,TypographyClasses:it,underline:st="always",variant:at="inherit",sx:ct}=_e,lt=_objectWithoutPropertiesLoose(_e,_excluded$r),{isFocusVisibleRef:dt,onBlur:ft,onFocus:gt,ref:ht}=useIsFocusVisible(),[yt,pt]=reactExports.useState(!1),Mt=useForkRef($,ht),St=zt=>{ft(zt),dt.current===!1&&pt(!1),rt&&rt(zt)},Tt=zt=>{gt(zt),dt.current===!0&&pt(!0),ot&&ot(zt)},vt=_extends$2({},_e,{color:tt,component:nt,focusVisible:yt,underline:st,variant:at}),Dt=useUtilityClasses$p(vt);return jsxRuntimeExports.jsx(LinkRoot,_extends$2({color:tt,className:clsx(Dt.root,et),classes:it,component:nt,onBlur:St,onFocus:Tt,ref:Mt,ownerState:vt,variant:at,sx:[...Object.keys(colorTransformations).includes(tt)?[]:[{color:tt}],...Array.isArray(ct)?ct:[ct]]},lt))}),ListContext=reactExports.createContext({});function getListUtilityClass(s){return generateUtilityClass$1("MuiList",s)}generateUtilityClasses$1("MuiList",["root","padding","dense","subheader"]);const _excluded$q=["children","className","component","dense","disablePadding","subheader"],useUtilityClasses$o=s=>{const{classes:j,disablePadding:$,dense:_e,subheader:et}=s;return composeClasses({root:["root",!$&&"padding",_e&&"dense",et&&"subheader"]},getListUtilityClass,j)},ListRoot=styled("ul",{name:"MuiList",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,!$.disablePadding&&j.padding,$.dense&&j.dense,$.subheader&&j.subheader]}})(({ownerState:s})=>_extends$2({listStyle:"none",margin:0,padding:0,position:"relative"},!s.disablePadding&&{paddingTop:8,paddingBottom:8},s.subheader&&{paddingTop:0})),List=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiList"}),{children:et,className:tt,component:nt="ul",dense:rt=!1,disablePadding:ot=!1,subheader:it}=_e,st=_objectWithoutPropertiesLoose(_e,_excluded$q),at=reactExports.useMemo(()=>({dense:rt}),[rt]),ct=_extends$2({},_e,{component:nt,dense:rt,disablePadding:ot}),lt=useUtilityClasses$o(ct);return jsxRuntimeExports.jsx(ListContext.Provider,{value:at,children:jsxRuntimeExports.jsxs(ListRoot,_extends$2({as:nt,className:clsx(lt.root,tt),ref:$,ownerState:ct},st,{children:[it,et]}))})});function getListItemUtilityClass(s){return generateUtilityClass$1("MuiListItem",s)}const listItemClasses=generateUtilityClasses$1("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),listItemButtonClasses=generateUtilityClasses$1("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function getListItemSecondaryActionClassesUtilityClass(s){return generateUtilityClass$1("MuiListItemSecondaryAction",s)}generateUtilityClasses$1("MuiListItemSecondaryAction",["root","disableGutters"]);const _excluded$p=["className"],useUtilityClasses$n=s=>{const{disableGutters:j,classes:$}=s;return composeClasses({root:["root",j&&"disableGutters"]},getListItemSecondaryActionClassesUtilityClass,$)},ListItemSecondaryActionRoot=styled("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,$.disableGutters&&j.disableGutters]}})(({ownerState:s})=>_extends$2({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},s.disableGutters&&{right:0})),ListItemSecondaryAction=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiListItemSecondaryAction"}),{className:et}=_e,tt=_objectWithoutPropertiesLoose(_e,_excluded$p),nt=reactExports.useContext(ListContext),rt=_extends$2({},_e,{disableGutters:nt.disableGutters}),ot=useUtilityClasses$n(rt);return jsxRuntimeExports.jsx(ListItemSecondaryActionRoot,_extends$2({className:clsx(ot.root,et),ownerState:rt,ref:$},tt))});ListItemSecondaryAction.muiName="ListItemSecondaryAction";const _excluded$o=["className"],_excluded2$4=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],overridesResolver$1=(s,j)=>{const{ownerState:$}=s;return[j.root,$.dense&&j.dense,$.alignItems==="flex-start"&&j.alignItemsFlexStart,$.divider&&j.divider,!$.disableGutters&&j.gutters,!$.disablePadding&&j.padding,$.button&&j.button,$.hasSecondaryAction&&j.secondaryAction]},useUtilityClasses$m=s=>{const{alignItems:j,button:$,classes:_e,dense:et,disabled:tt,disableGutters:nt,disablePadding:rt,divider:ot,hasSecondaryAction:it,selected:st}=s;return composeClasses({root:["root",et&&"dense",!nt&&"gutters",!rt&&"padding",ot&&"divider",tt&&"disabled",$&&"button",j==="flex-start"&&"alignItemsFlexStart",it&&"secondaryAction",st&&"selected"],container:["container"]},getListItemUtilityClass,_e)},ListItemRoot=styled("div",{name:"MuiListItem",slot:"Root",overridesResolver:overridesResolver$1})(({theme:s,ownerState:j})=>_extends$2({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!j.disablePadding&&_extends$2({paddingTop:8,paddingBottom:8},j.dense&&{paddingTop:4,paddingBottom:4},!j.disableGutters&&{paddingLeft:16,paddingRight:16},!!j.secondaryAction&&{paddingRight:48}),!!j.secondaryAction&&{[`& > .${listItemButtonClasses.root}`]:{paddingRight:48}},{[`&.${listItemClasses.focusVisible}`]:{backgroundColor:(s.vars||s).palette.action.focus},[`&.${listItemClasses.selected}`]:{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / ${s.vars.palette.action.selectedOpacity})`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity),[`&.${listItemClasses.focusVisible}`]:{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / calc(${s.vars.palette.action.selectedOpacity} + ${s.vars.palette.action.focusOpacity}))`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity+s.palette.action.focusOpacity)}},[`&.${listItemClasses.disabled}`]:{opacity:(s.vars||s).palette.action.disabledOpacity}},j.alignItems==="flex-start"&&{alignItems:"flex-start"},j.divider&&{borderBottom:`1px solid ${(s.vars||s).palette.divider}`,backgroundClip:"padding-box"},j.button&&{transition:s.transitions.create("background-color",{duration:s.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(s.vars||s).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${listItemClasses.selected}:hover`]:{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / calc(${s.vars.palette.action.selectedOpacity} + ${s.vars.palette.action.hoverOpacity}))`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity+s.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / ${s.vars.palette.action.selectedOpacity})`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity)}}},j.hasSecondaryAction&&{paddingRight:48})),ListItemContainer=styled("li",{name:"MuiListItem",slot:"Container",overridesResolver:(s,j)=>j.container})({position:"relative"}),ListItem=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiListItem"}),{alignItems:et="center",autoFocus:tt=!1,button:nt=!1,children:rt,className:ot,component:it,components:st={},componentsProps:at={},ContainerComponent:ct="li",ContainerProps:{className:lt}={},dense:dt=!1,disabled:ft=!1,disableGutters:gt=!1,disablePadding:ht=!1,divider:yt=!1,focusVisibleClassName:pt,secondaryAction:Mt,selected:St=!1,slotProps:Tt={},slots:vt={}}=_e,Dt=_objectWithoutPropertiesLoose(_e.ContainerProps,_excluded$o),zt=_objectWithoutPropertiesLoose(_e,_excluded2$4),Ot=reactExports.useContext(ListContext),Ft=reactExports.useMemo(()=>({dense:dt||Ot.dense||!1,alignItems:et,disableGutters:gt}),[et,Ot.dense,dt,gt]),Pt=reactExports.useRef(null);useEnhancedEffect(()=>{tt&&Pt.current&&Pt.current.focus()},[tt]);const Lt=reactExports.Children.toArray(rt),mt=Lt.length&&isMuiElement(Lt[Lt.length-1],["ListItemSecondaryAction"]),xt=_extends$2({},_e,{alignItems:et,autoFocus:tt,button:nt,dense:Ft.dense,disabled:ft,disableGutters:gt,disablePadding:ht,divider:yt,hasSecondaryAction:mt,selected:St}),It=useUtilityClasses$m(xt),jt=useForkRef(Pt,$),At=vt.root||st.Root||ListItemRoot,wt=Tt.root||at.root||{},Rt=_extends$2({className:clsx(It.root,wt.className,ot),disabled:ft},zt);let Nt=it||"li";return nt&&(Rt.component=it||"div",Rt.focusVisibleClassName=clsx(listItemClasses.focusVisible,pt),Nt=ButtonBase),mt?(Nt=!Rt.component&&!it?"div":Nt,ct==="li"&&(Nt==="li"?Nt="div":Rt.component==="li"&&(Rt.component="div")),jsxRuntimeExports.jsx(ListContext.Provider,{value:Ft,children:jsxRuntimeExports.jsxs(ListItemContainer,_extends$2({as:ct,className:clsx(It.container,lt),ref:jt,ownerState:xt},Dt,{children:[jsxRuntimeExports.jsx(At,_extends$2({},wt,!isHostComponent(At)&&{as:Nt,ownerState:_extends$2({},xt,wt.ownerState)},Rt,{children:Lt})),Lt.pop()]}))})):jsxRuntimeExports.jsx(ListContext.Provider,{value:Ft,children:jsxRuntimeExports.jsxs(At,_extends$2({},wt,{as:Nt,ref:jt},!isHostComponent(At)&&{ownerState:_extends$2({},xt,wt.ownerState)},Rt,{children:[Lt,Mt&&jsxRuntimeExports.jsx(ListItemSecondaryAction,{children:Mt})]}))})});function getListItemIconUtilityClass(s){return generateUtilityClass$1("MuiListItemIcon",s)}const listItemIconClasses=generateUtilityClasses$1("MuiListItemIcon",["root","alignItemsFlexStart"]),_excluded$n=["className"],useUtilityClasses$l=s=>{const{alignItems:j,classes:$}=s;return composeClasses({root:["root",j==="flex-start"&&"alignItemsFlexStart"]},getListItemIconUtilityClass,$)},ListItemIconRoot=styled("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,$.alignItems==="flex-start"&&j.alignItemsFlexStart]}})(({theme:s,ownerState:j})=>_extends$2({minWidth:56,color:(s.vars||s).palette.action.active,flexShrink:0,display:"inline-flex"},j.alignItems==="flex-start"&&{marginTop:8})),ListItemIcon=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiListItemIcon"}),{className:et}=_e,tt=_objectWithoutPropertiesLoose(_e,_excluded$n),nt=reactExports.useContext(ListContext),rt=_extends$2({},_e,{alignItems:nt.alignItems}),ot=useUtilityClasses$l(rt);return jsxRuntimeExports.jsx(ListItemIconRoot,_extends$2({className:clsx(ot.root,et),ownerState:rt,ref:$},tt))});function getListItemTextUtilityClass(s){return generateUtilityClass$1("MuiListItemText",s)}const listItemTextClasses=generateUtilityClasses$1("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),_excluded$m=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],useUtilityClasses$k=s=>{const{classes:j,inset:$,primary:_e,secondary:et,dense:tt}=s;return composeClasses({root:["root",$&&"inset",tt&&"dense",_e&&et&&"multiline"],primary:["primary"],secondary:["secondary"]},getListItemTextUtilityClass,j)},ListItemTextRoot=styled("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[{[`& .${listItemTextClasses.primary}`]:j.primary},{[`& .${listItemTextClasses.secondary}`]:j.secondary},j.root,$.inset&&j.inset,$.primary&&$.secondary&&j.multiline,$.dense&&j.dense]}})(({ownerState:s})=>_extends$2({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},s.primary&&s.secondary&&{marginTop:6,marginBottom:6},s.inset&&{paddingLeft:56})),ListItemText=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiListItemText"}),{children:et,className:tt,disableTypography:nt=!1,inset:rt=!1,primary:ot,primaryTypographyProps:it,secondary:st,secondaryTypographyProps:at}=_e,ct=_objectWithoutPropertiesLoose(_e,_excluded$m),{dense:lt}=reactExports.useContext(ListContext);let dt=ot??et,ft=st;const gt=_extends$2({},_e,{disableTypography:nt,inset:rt,primary:!!dt,secondary:!!ft,dense:lt}),ht=useUtilityClasses$k(gt);return dt!=null&&dt.type!==Typography&&!nt&&(dt=jsxRuntimeExports.jsx(Typography,_extends$2({variant:lt?"body2":"body1",className:ht.primary,component:it!=null&&it.variant?void 0:"span",display:"block"},it,{children:dt}))),ft!=null&&ft.type!==Typography&&!nt&&(ft=jsxRuntimeExports.jsx(Typography,_extends$2({variant:"body2",className:ht.secondary,color:"text.secondary",display:"block"},at,{children:ft}))),jsxRuntimeExports.jsxs(ListItemTextRoot,_extends$2({className:clsx(ht.root,tt),ownerState:gt,ref:$},ct,{children:[dt,ft]}))}),_excluded$l=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function nextItem(s,j,$){return s===j?s.firstChild:j&&j.nextElementSibling?j.nextElementSibling:$?null:s.firstChild}function previousItem(s,j,$){return s===j?$?s.firstChild:s.lastChild:j&&j.previousElementSibling?j.previousElementSibling:$?null:s.lastChild}function textCriteriaMatches(s,j){if(j===void 0)return!0;let $=s.innerText;return $===void 0&&($=s.textContent),$=$.trim().toLowerCase(),$.length===0?!1:j.repeating?$[0]===j.keys[0]:$.indexOf(j.keys.join(""))===0}function moveFocus(s,j,$,_e,et,tt){let nt=!1,rt=et(s,j,j?$:!1);for(;rt;){if(rt===s.firstChild){if(nt)return!1;nt=!0}const ot=_e?!1:rt.disabled||rt.getAttribute("aria-disabled")==="true";if(!rt.hasAttribute("tabindex")||!textCriteriaMatches(rt,tt)||ot)rt=et(s,rt,$);else return rt.focus(),!0}return!1}const MenuList=reactExports.forwardRef(function(j,$){const{actions:_e,autoFocus:et=!1,autoFocusItem:tt=!1,children:nt,className:rt,disabledItemsFocusable:ot=!1,disableListWrap:it=!1,onKeyDown:st,variant:at="selectedMenu"}=j,ct=_objectWithoutPropertiesLoose(j,_excluded$l),lt=reactExports.useRef(null),dt=reactExports.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});useEnhancedEffect(()=>{et&<.current.focus()},[et]),reactExports.useImperativeHandle(_e,()=>({adjustStyleForScrollbar:(pt,{direction:Mt})=>{const St=!lt.current.style.width;if(pt.clientHeight{const Mt=lt.current,St=pt.key,Tt=ownerDocument(Mt).activeElement;if(St==="ArrowDown")pt.preventDefault(),moveFocus(Mt,Tt,it,ot,nextItem);else if(St==="ArrowUp")pt.preventDefault(),moveFocus(Mt,Tt,it,ot,previousItem);else if(St==="Home")pt.preventDefault(),moveFocus(Mt,null,it,ot,nextItem);else if(St==="End")pt.preventDefault(),moveFocus(Mt,null,it,ot,previousItem);else if(St.length===1){const vt=dt.current,Dt=St.toLowerCase(),zt=performance.now();vt.keys.length>0&&(zt-vt.lastTime>500?(vt.keys=[],vt.repeating=!0,vt.previousKeyMatched=!0):vt.repeating&&Dt!==vt.keys[0]&&(vt.repeating=!1)),vt.lastTime=zt,vt.keys.push(Dt);const Ot=Tt&&!vt.repeating&&textCriteriaMatches(Tt,vt);vt.previousKeyMatched&&(Ot||moveFocus(Mt,Tt,!1,ot,nextItem,vt))?pt.preventDefault():vt.previousKeyMatched=!1}st&&st(pt)},gt=useForkRef(lt,$);let ht=-1;reactExports.Children.forEach(nt,(pt,Mt)=>{if(!reactExports.isValidElement(pt)){ht===Mt&&(ht+=1,ht>=nt.length&&(ht=-1));return}pt.props.disabled||(at==="selectedMenu"&&pt.props.selected||ht===-1)&&(ht=Mt),ht===Mt&&(pt.props.disabled||pt.props.muiSkipListHighlight||pt.type.muiSkipListHighlight)&&(ht+=1,ht>=nt.length&&(ht=-1))});const yt=reactExports.Children.map(nt,(pt,Mt)=>{if(Mt===ht){const St={};return tt&&(St.autoFocus=!0),pt.props.tabIndex===void 0&&at==="selectedMenu"&&(St.tabIndex=0),reactExports.cloneElement(pt,St)}return pt});return jsxRuntimeExports.jsx(List,_extends$2({role:"menu",ref:gt,className:rt,onKeyDown:ft,tabIndex:et?0:-1},ct,{children:yt}))});function getPopoverUtilityClass(s){return generateUtilityClass$1("MuiPopover",s)}generateUtilityClasses$1("MuiPopover",["root","paper"]);const _excluded$k=["onEntering"],_excluded2$3=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],_excluded3=["slotProps"];function getOffsetTop(s,j){let $=0;return typeof j=="number"?$=j:j==="center"?$=s.height/2:j==="bottom"&&($=s.height),$}function getOffsetLeft(s,j){let $=0;return typeof j=="number"?$=j:j==="center"?$=s.width/2:j==="right"&&($=s.width),$}function getTransformOriginValue(s){return[s.horizontal,s.vertical].map(j=>typeof j=="number"?`${j}px`:j).join(" ")}function resolveAnchorEl(s){return typeof s=="function"?s():s}const useUtilityClasses$j=s=>{const{classes:j}=s;return composeClasses({root:["root"],paper:["paper"]},getPopoverUtilityClass,j)},PopoverRoot=styled(Modal,{name:"MuiPopover",slot:"Root",overridesResolver:(s,j)=>j.root})({}),PopoverPaper=styled(Paper,{name:"MuiPopover",slot:"Paper",overridesResolver:(s,j)=>j.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Popover=reactExports.forwardRef(function(j,$){var _e,et,tt;const nt=useThemeProps$5({props:j,name:"MuiPopover"}),{action:rt,anchorEl:ot,anchorOrigin:it={vertical:"top",horizontal:"left"},anchorPosition:st,anchorReference:at="anchorEl",children:ct,className:lt,container:dt,elevation:ft=8,marginThreshold:gt=16,open:ht,PaperProps:yt={},slots:pt,slotProps:Mt,transformOrigin:St={vertical:"top",horizontal:"left"},TransitionComponent:Tt=Grow,transitionDuration:vt="auto",TransitionProps:{onEntering:Dt}={},disableScrollLock:zt=!1}=nt,Ot=_objectWithoutPropertiesLoose(nt.TransitionProps,_excluded$k),Ft=_objectWithoutPropertiesLoose(nt,_excluded2$3),Pt=(_e=Mt==null?void 0:Mt.paper)!=null?_e:yt,Lt=reactExports.useRef(),mt=useForkRef(Lt,Pt.ref),xt=_extends$2({},nt,{anchorOrigin:it,anchorReference:at,elevation:ft,marginThreshold:gt,externalPaperSlotProps:Pt,transformOrigin:St,TransitionComponent:Tt,transitionDuration:vt,TransitionProps:Ot}),It=useUtilityClasses$j(xt),jt=reactExports.useCallback(()=>{if(at==="anchorPosition")return st;const tn=resolveAnchorEl(ot),Jt=(tn&&tn.nodeType===1?tn:ownerDocument(Lt.current).body).getBoundingClientRect();return{top:Jt.top+getOffsetTop(Jt,it.vertical),left:Jt.left+getOffsetLeft(Jt,it.horizontal)}},[ot,it.horizontal,it.vertical,st,at]),At=reactExports.useCallback(tn=>({vertical:getOffsetTop(tn,St.vertical),horizontal:getOffsetLeft(tn,St.horizontal)}),[St.horizontal,St.vertical]),wt=reactExports.useCallback(tn=>{const Kt={width:tn.offsetWidth,height:tn.offsetHeight},Jt=At(Kt);if(at==="none")return{top:null,left:null,transformOrigin:getTransformOriginValue(Jt)};const En=jt();let pn=En.top-Jt.vertical,cn=En.left-Jt.horizontal;const Tn=pn+Kt.height,sn=cn+Kt.width,an=ownerWindow(resolveAnchorEl(ot)),Mn=an.innerHeight-gt,hn=an.innerWidth-gt;if(gt!==null&&pnMn){const ln=Tn-Mn;pn-=ln,Jt.vertical+=ln}if(gt!==null&&cnhn){const ln=sn-hn;cn-=ln,Jt.horizontal+=ln}return{top:`${Math.round(pn)}px`,left:`${Math.round(cn)}px`,transformOrigin:getTransformOriginValue(Jt)}},[ot,at,jt,At,gt]),[Rt,Nt]=reactExports.useState(ht),Ct=reactExports.useCallback(()=>{const tn=Lt.current;if(!tn)return;const Kt=wt(tn);Kt.top!==null&&(tn.style.top=Kt.top),Kt.left!==null&&(tn.style.left=Kt.left),tn.style.transformOrigin=Kt.transformOrigin,Nt(!0)},[wt]);reactExports.useEffect(()=>(zt&&window.addEventListener("scroll",Ct),()=>window.removeEventListener("scroll",Ct)),[ot,zt,Ct]);const Bt=(tn,Kt)=>{Dt&&Dt(tn,Kt),Ct()},Gt=()=>{Nt(!1)};reactExports.useEffect(()=>{ht&&Ct()}),reactExports.useImperativeHandle(rt,()=>ht?{updatePosition:()=>{Ct()}}:null,[ht,Ct]),reactExports.useEffect(()=>{if(!ht)return;const tn=debounce$1(()=>{Ct()}),Kt=ownerWindow(ot);return Kt.addEventListener("resize",tn),()=>{tn.clear(),Kt.removeEventListener("resize",tn)}},[ot,ht,Ct]);let Vt=vt;vt==="auto"&&!Tt.muiSupportAuto&&(Vt=void 0);const Yt=dt||(ot?ownerDocument(resolveAnchorEl(ot)).body:void 0),Qt=(et=pt==null?void 0:pt.root)!=null?et:PopoverRoot,qt=(tt=pt==null?void 0:pt.paper)!=null?tt:PopoverPaper,Zt=useSlotProps({elementType:qt,externalSlotProps:_extends$2({},Pt,{style:Rt?Pt.style:_extends$2({},Pt.style,{opacity:0})}),additionalProps:{elevation:ft,ref:mt},ownerState:xt,className:clsx(It.paper,Pt==null?void 0:Pt.className)}),fn=useSlotProps({elementType:Qt,externalSlotProps:(Mt==null?void 0:Mt.root)||{},externalForwardedProps:Ft,additionalProps:{ref:$,slotProps:{backdrop:{invisible:!0}},container:Yt,open:ht},ownerState:xt,className:clsx(It.root,lt)}),{slotProps:Xt}=fn,on=_objectWithoutPropertiesLoose(fn,_excluded3);return jsxRuntimeExports.jsx(Qt,_extends$2({},on,!isHostComponent(Qt)&&{slotProps:Xt,disableScrollLock:zt},{children:jsxRuntimeExports.jsx(Tt,_extends$2({appear:!0,in:ht,onEntering:Bt,onExited:Gt,timeout:Vt},Ot,{children:jsxRuntimeExports.jsx(qt,_extends$2({},Zt,{children:ct}))}))}))});function getMenuUtilityClass(s){return generateUtilityClass$1("MuiMenu",s)}generateUtilityClasses$1("MuiMenu",["root","paper","list"]);const _excluded$j=["onEntering"],_excluded2$2=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],RTL_ORIGIN={vertical:"top",horizontal:"right"},LTR_ORIGIN={vertical:"top",horizontal:"left"},useUtilityClasses$i=s=>{const{classes:j}=s;return composeClasses({root:["root"],paper:["paper"],list:["list"]},getMenuUtilityClass,j)},MenuRoot=styled(Popover,{shouldForwardProp:s=>rootShouldForwardProp(s)||s==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(s,j)=>j.root})({}),MenuPaper=styled(PopoverPaper,{name:"MuiMenu",slot:"Paper",overridesResolver:(s,j)=>j.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MenuMenuList=styled(MenuList,{name:"MuiMenu",slot:"List",overridesResolver:(s,j)=>j.list})({outline:0}),Menu=reactExports.forwardRef(function(j,$){var _e,et;const tt=useThemeProps$5({props:j,name:"MuiMenu"}),{autoFocus:nt=!0,children:rt,className:ot,disableAutoFocusItem:it=!1,MenuListProps:st={},onClose:at,open:ct,PaperProps:lt={},PopoverClasses:dt,transitionDuration:ft="auto",TransitionProps:{onEntering:gt}={},variant:ht="selectedMenu",slots:yt={},slotProps:pt={}}=tt,Mt=_objectWithoutPropertiesLoose(tt.TransitionProps,_excluded$j),St=_objectWithoutPropertiesLoose(tt,_excluded2$2),Tt=useRtl(),vt=_extends$2({},tt,{autoFocus:nt,disableAutoFocusItem:it,MenuListProps:st,onEntering:gt,PaperProps:lt,transitionDuration:ft,TransitionProps:Mt,variant:ht}),Dt=useUtilityClasses$i(vt),zt=nt&&!it&&ct,Ot=reactExports.useRef(null),Ft=(At,wt)=>{Ot.current&&Ot.current.adjustStyleForScrollbar(At,{direction:Tt?"rtl":"ltr"}),gt&>(At,wt)},Pt=At=>{At.key==="Tab"&&(At.preventDefault(),at&&at(At,"tabKeyDown"))};let Lt=-1;reactExports.Children.map(rt,(At,wt)=>{reactExports.isValidElement(At)&&(At.props.disabled||(ht==="selectedMenu"&&At.props.selected||Lt===-1)&&(Lt=wt))});const mt=(_e=yt.paper)!=null?_e:MenuPaper,xt=(et=pt.paper)!=null?et:lt,It=useSlotProps({elementType:yt.root,externalSlotProps:pt.root,ownerState:vt,className:[Dt.root,ot]}),jt=useSlotProps({elementType:mt,externalSlotProps:xt,ownerState:vt,className:Dt.paper});return jsxRuntimeExports.jsx(MenuRoot,_extends$2({onClose:at,anchorOrigin:{vertical:"bottom",horizontal:Tt?"right":"left"},transformOrigin:Tt?RTL_ORIGIN:LTR_ORIGIN,slots:{paper:mt,root:yt.root},slotProps:{root:It,paper:jt},open:ct,ref:$,transitionDuration:ft,TransitionProps:_extends$2({onEntering:Ft},Mt),ownerState:vt},St,{classes:dt,children:jsxRuntimeExports.jsx(MenuMenuList,_extends$2({onKeyDown:Pt,actions:Ot,autoFocus:nt&&(Lt===-1||it),autoFocusItem:zt,variant:ht},st,{className:clsx(Dt.list,st.className),children:rt}))}))});function getMenuItemUtilityClass(s){return generateUtilityClass$1("MuiMenuItem",s)}const menuItemClasses=generateUtilityClasses$1("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),_excluded$i=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],overridesResolver=(s,j)=>{const{ownerState:$}=s;return[j.root,$.dense&&j.dense,$.divider&&j.divider,!$.disableGutters&&j.gutters]},useUtilityClasses$h=s=>{const{disabled:j,dense:$,divider:_e,disableGutters:et,selected:tt,classes:nt}=s,ot=composeClasses({root:["root",$&&"dense",j&&"disabled",!et&&"gutters",_e&&"divider",tt&&"selected"]},getMenuItemUtilityClass,nt);return _extends$2({},nt,ot)},MenuItemRoot=styled(ButtonBase,{shouldForwardProp:s=>rootShouldForwardProp(s)||s==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver})(({theme:s,ownerState:j})=>_extends$2({},s.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!j.disableGutters&&{paddingLeft:16,paddingRight:16},j.divider&&{borderBottom:`1px solid ${(s.vars||s).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(s.vars||s).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${menuItemClasses.selected}`]:{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / ${s.vars.palette.action.selectedOpacity})`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity),[`&.${menuItemClasses.focusVisible}`]:{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / calc(${s.vars.palette.action.selectedOpacity} + ${s.vars.palette.action.focusOpacity}))`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity+s.palette.action.focusOpacity)}},[`&.${menuItemClasses.selected}:hover`]:{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / calc(${s.vars.palette.action.selectedOpacity} + ${s.vars.palette.action.hoverOpacity}))`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity+s.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / ${s.vars.palette.action.selectedOpacity})`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity)}},[`&.${menuItemClasses.focusVisible}`]:{backgroundColor:(s.vars||s).palette.action.focus},[`&.${menuItemClasses.disabled}`]:{opacity:(s.vars||s).palette.action.disabledOpacity},[`& + .${dividerClasses.root}`]:{marginTop:s.spacing(1),marginBottom:s.spacing(1)},[`& + .${dividerClasses.inset}`]:{marginLeft:52},[`& .${listItemTextClasses.root}`]:{marginTop:0,marginBottom:0},[`& .${listItemTextClasses.inset}`]:{paddingLeft:36},[`& .${listItemIconClasses.root}`]:{minWidth:36}},!j.dense&&{[s.breakpoints.up("sm")]:{minHeight:"auto"}},j.dense&&_extends$2({minHeight:32,paddingTop:4,paddingBottom:4},s.typography.body2,{[`& .${listItemIconClasses.root} svg`]:{fontSize:"1.25rem"}}))),MenuItem=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiMenuItem"}),{autoFocus:et=!1,component:tt="li",dense:nt=!1,divider:rt=!1,disableGutters:ot=!1,focusVisibleClassName:it,role:st="menuitem",tabIndex:at,className:ct}=_e,lt=_objectWithoutPropertiesLoose(_e,_excluded$i),dt=reactExports.useContext(ListContext),ft=reactExports.useMemo(()=>({dense:nt||dt.dense||!1,disableGutters:ot}),[dt.dense,nt,ot]),gt=reactExports.useRef(null);useEnhancedEffect(()=>{et&>.current&>.current.focus()},[et]);const ht=_extends$2({},_e,{dense:ft.dense,divider:rt,disableGutters:ot}),yt=useUtilityClasses$h(_e),pt=useForkRef(gt,$);let Mt;return _e.disabled||(Mt=at!==void 0?at:-1),jsxRuntimeExports.jsx(ListContext.Provider,{value:ft,children:jsxRuntimeExports.jsx(MenuItemRoot,_extends$2({ref:pt,role:st,tabIndex:Mt,component:tt,focusVisibleClassName:clsx(yt.focusVisible,it),className:clsx(yt.root,ct)},lt,{ownerState:ht,classes:yt}))})});function getNativeSelectUtilityClasses(s){return generateUtilityClass$1("MuiNativeSelect",s)}const nativeSelectClasses=generateUtilityClasses$1("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),_excluded$h=["className","disabled","error","IconComponent","inputRef","variant"],useUtilityClasses$g=s=>{const{classes:j,variant:$,disabled:_e,multiple:et,open:tt,error:nt}=s,rt={select:["select",$,_e&&"disabled",et&&"multiple",nt&&"error"],icon:["icon",`icon${capitalize$1($)}`,tt&&"iconOpen",_e&&"disabled"]};return composeClasses(rt,getNativeSelectUtilityClasses,j)},nativeSelectSelectStyles=({ownerState:s,theme:j})=>_extends$2({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":_extends$2({},j.vars?{backgroundColor:`rgba(${j.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:j.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${nativeSelectClasses.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(j.vars||j).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},s.variant==="filled"&&{"&&&":{paddingRight:32}},s.variant==="outlined"&&{borderRadius:(j.vars||j).shape.borderRadius,"&:focus":{borderRadius:(j.vars||j).shape.borderRadius},"&&&":{paddingRight:32}}),NativeSelectSelect=styled("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rootShouldForwardProp,overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.select,j[$.variant],$.error&&j.error,{[`&.${nativeSelectClasses.multiple}`]:j.multiple}]}})(nativeSelectSelectStyles),nativeSelectIconStyles=({ownerState:s,theme:j})=>_extends$2({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(j.vars||j).palette.action.active,[`&.${nativeSelectClasses.disabled}`]:{color:(j.vars||j).palette.action.disabled}},s.open&&{transform:"rotate(180deg)"},s.variant==="filled"&&{right:7},s.variant==="outlined"&&{right:7}),NativeSelectIcon=styled("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.icon,$.variant&&j[`icon${capitalize$1($.variant)}`],$.open&&j.iconOpen]}})(nativeSelectIconStyles),NativeSelectInput=reactExports.forwardRef(function(j,$){const{className:_e,disabled:et,error:tt,IconComponent:nt,inputRef:rt,variant:ot="standard"}=j,it=_objectWithoutPropertiesLoose(j,_excluded$h),st=_extends$2({},j,{disabled:et,variant:ot,error:tt}),at=useUtilityClasses$g(st);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(NativeSelectSelect,_extends$2({ownerState:st,className:clsx(at.select,_e),disabled:et,ref:rt||$},it)),j.multiple?null:jsxRuntimeExports.jsx(NativeSelectIcon,{as:nt,ownerState:st,className:at.icon})]})});var _span$1;const _excluded$g=["children","classes","className","label","notched"],NotchedOutlineRoot$1=styled("fieldset",{shouldForwardProp:rootShouldForwardProp})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),NotchedOutlineLegend=styled("legend",{shouldForwardProp:rootShouldForwardProp})(({ownerState:s,theme:j})=>_extends$2({float:"unset",width:"auto",overflow:"hidden"},!s.withLabel&&{padding:0,lineHeight:"11px",transition:j.transitions.create("width",{duration:150,easing:j.transitions.easing.easeOut})},s.withLabel&&_extends$2({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:j.transitions.create("max-width",{duration:50,easing:j.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},s.notched&&{maxWidth:"100%",transition:j.transitions.create("max-width",{duration:100,easing:j.transitions.easing.easeOut,delay:50})})));function NotchedOutline(s){const{className:j,label:$,notched:_e}=s,et=_objectWithoutPropertiesLoose(s,_excluded$g),tt=$!=null&&$!=="",nt=_extends$2({},s,{notched:_e,withLabel:tt});return jsxRuntimeExports.jsx(NotchedOutlineRoot$1,_extends$2({"aria-hidden":!0,className:j,ownerState:nt},et,{children:jsxRuntimeExports.jsx(NotchedOutlineLegend,{ownerState:nt,children:tt?jsxRuntimeExports.jsx("span",{children:$}):_span$1||(_span$1=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"}))})}))}const _excluded$f=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],useUtilityClasses$f=s=>{const{classes:j}=s,_e=composeClasses({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},getOutlinedInputUtilityClass,j);return _extends$2({},j,_e)},OutlinedInputRoot=styled(InputBaseRoot,{shouldForwardProp:s=>rootShouldForwardProp(s)||s==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:s,ownerState:j})=>{const $=s.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return _extends$2({position:"relative",borderRadius:(s.vars||s).shape.borderRadius,[`&:hover .${outlinedInputClasses.notchedOutline}`]:{borderColor:(s.vars||s).palette.text.primary},"@media (hover: none)":{[`&:hover .${outlinedInputClasses.notchedOutline}`]:{borderColor:s.vars?`rgba(${s.vars.palette.common.onBackgroundChannel} / 0.23)`:$}},[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(s.vars||s).palette[j.color].main,borderWidth:2},[`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(s.vars||s).palette.error.main},[`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(s.vars||s).palette.action.disabled}},j.startAdornment&&{paddingLeft:14},j.endAdornment&&{paddingRight:14},j.multiline&&_extends$2({padding:"16.5px 14px"},j.size==="small"&&{padding:"8.5px 14px"}))}),NotchedOutlineRoot=styled(NotchedOutline,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(s,j)=>j.notchedOutline})(({theme:s})=>{const j=s.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:s.vars?`rgba(${s.vars.palette.common.onBackgroundChannel} / 0.23)`:j}}),OutlinedInputInput=styled(InputBaseComponent,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:s,ownerState:j})=>_extends$2({padding:"16.5px 14px"},!s.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:s.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:s.palette.mode==="light"?null:"#fff",caretColor:s.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},s.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[s.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},j.size==="small"&&{padding:"8.5px 14px"},j.multiline&&{padding:0},j.startAdornment&&{paddingLeft:0},j.endAdornment&&{paddingRight:0})),OutlinedInput=reactExports.forwardRef(function(j,$){var _e,et,tt,nt,rt;const ot=useThemeProps$5({props:j,name:"MuiOutlinedInput"}),{components:it={},fullWidth:st=!1,inputComponent:at="input",label:ct,multiline:lt=!1,notched:dt,slots:ft={},type:gt="text"}=ot,ht=_objectWithoutPropertiesLoose(ot,_excluded$f),yt=useUtilityClasses$f(ot),pt=useFormControl(),Mt=formControlState({props:ot,muiFormControl:pt,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),St=_extends$2({},ot,{color:Mt.color||"primary",disabled:Mt.disabled,error:Mt.error,focused:Mt.focused,formControl:pt,fullWidth:st,hiddenLabel:Mt.hiddenLabel,multiline:lt,size:Mt.size,type:gt}),Tt=(_e=(et=ft.root)!=null?et:it.Root)!=null?_e:OutlinedInputRoot,vt=(tt=(nt=ft.input)!=null?nt:it.Input)!=null?tt:OutlinedInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$2({slots:{root:Tt,input:vt},renderSuffix:Dt=>jsxRuntimeExports.jsx(NotchedOutlineRoot,{ownerState:St,className:yt.notchedOutline,label:ct!=null&&ct!==""&&Mt.required?rt||(rt=jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[ct," ","*"]})):ct,notched:typeof dt<"u"?dt:!!(Dt.startAdornment||Dt.filled||Dt.focused)}),fullWidth:st,inputComponent:at,multiline:lt,ref:$,type:gt},ht,{classes:_extends$2({},yt,{notchedOutline:null})}))});OutlinedInput.muiName="Input";function getSelectUtilityClasses(s){return generateUtilityClass$1("MuiSelect",s)}const selectClasses=generateUtilityClasses$1("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var _span;const _excluded$e=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],SelectSelect=styled("div",{name:"MuiSelect",slot:"Select",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[{[`&.${selectClasses.select}`]:j.select},{[`&.${selectClasses.select}`]:j[$.variant]},{[`&.${selectClasses.error}`]:j.error},{[`&.${selectClasses.multiple}`]:j.multiple}]}})(nativeSelectSelectStyles,{[`&.${selectClasses.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),SelectIcon=styled("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.icon,$.variant&&j[`icon${capitalize$1($.variant)}`],$.open&&j.iconOpen]}})(nativeSelectIconStyles),SelectNativeInput=styled("input",{shouldForwardProp:s=>slotShouldForwardProp(s)&&s!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(s,j)=>j.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function areEqualValues(s,j){return typeof j=="object"&&j!==null?s===j:String(s)===String(j)}function isEmpty(s){return s==null||typeof s=="string"&&!s.trim()}const useUtilityClasses$e=s=>{const{classes:j,variant:$,disabled:_e,multiple:et,open:tt,error:nt}=s,rt={select:["select",$,_e&&"disabled",et&&"multiple",nt&&"error"],icon:["icon",`icon${capitalize$1($)}`,tt&&"iconOpen",_e&&"disabled"],nativeInput:["nativeInput"]};return composeClasses(rt,getSelectUtilityClasses,j)},SelectInput=reactExports.forwardRef(function(j,$){var _e;const{"aria-describedby":et,"aria-label":tt,autoFocus:nt,autoWidth:rt,children:ot,className:it,defaultOpen:st,defaultValue:at,disabled:ct,displayEmpty:lt,error:dt=!1,IconComponent:ft,inputRef:gt,labelId:ht,MenuProps:yt={},multiple:pt,name:Mt,onBlur:St,onChange:Tt,onClose:vt,onFocus:Dt,onOpen:zt,open:Ot,readOnly:Ft,renderValue:Pt,SelectDisplayProps:Lt={},tabIndex:mt,value:xt,variant:It="standard"}=j,jt=_objectWithoutPropertiesLoose(j,_excluded$e),[At,wt]=useControlled({controlled:xt,default:at,name:"Select"}),[Rt,Nt]=useControlled({controlled:Ot,default:st,name:"Select"}),Ct=reactExports.useRef(null),Bt=reactExports.useRef(null),[Gt,Vt]=reactExports.useState(null),{current:Yt}=reactExports.useRef(Ot!=null),[Qt,qt]=reactExports.useState(),Zt=useForkRef($,gt),fn=reactExports.useCallback(Wt=>{Bt.current=Wt,Wt&&Vt(Wt)},[]),Xt=Gt==null?void 0:Gt.parentNode;reactExports.useImperativeHandle(Zt,()=>({focus:()=>{Bt.current.focus()},node:Ct.current,value:At}),[At]),reactExports.useEffect(()=>{st&&Rt&&Gt&&!Yt&&(qt(rt?null:Xt.clientWidth),Bt.current.focus())},[Gt,rt]),reactExports.useEffect(()=>{nt&&Bt.current.focus()},[nt]),reactExports.useEffect(()=>{if(!ht)return;const Wt=ownerDocument(Bt.current).getElementById(ht);if(Wt){const nn=()=>{getSelection().isCollapsed&&Bt.current.focus()};return Wt.addEventListener("click",nn),()=>{Wt.removeEventListener("click",nn)}}},[ht]);const on=(Wt,nn)=>{Wt?zt&&zt(nn):vt&&vt(nn),Yt||(qt(rt?null:Xt.clientWidth),Nt(Wt))},tn=Wt=>{Wt.button===0&&(Wt.preventDefault(),Bt.current.focus(),on(!0,Wt))},Kt=Wt=>{on(!1,Wt)},Jt=reactExports.Children.toArray(ot),En=Wt=>{const nn=Jt.find(rn=>rn.props.value===Wt.target.value);nn!==void 0&&(wt(nn.props.value),Tt&&Tt(Wt,nn))},pn=Wt=>nn=>{let rn;if(nn.currentTarget.hasAttribute("tabindex")){if(pt){rn=Array.isArray(At)?At.slice():[];const en=At.indexOf(Wt.props.value);en===-1?rn.push(Wt.props.value):rn.splice(en,1)}else rn=Wt.props.value;if(Wt.props.onClick&&Wt.props.onClick(nn),At!==rn&&(wt(rn),Tt)){const en=nn.nativeEvent||nn,mn=new en.constructor(en.type,en);Object.defineProperty(mn,"target",{writable:!0,value:{value:rn,name:Mt}}),Tt(mn,Wt)}pt||on(!1,nn)}},cn=Wt=>{Ft||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Wt.key)!==-1&&(Wt.preventDefault(),on(!0,Wt))},Tn=Gt!==null&&Rt,sn=Wt=>{!Tn&&St&&(Object.defineProperty(Wt,"target",{writable:!0,value:{value:At,name:Mt}}),St(Wt))};delete jt["aria-invalid"];let an,Mn;const hn=[];let ln=!1;(isFilled({value:At})||lt)&&(Pt?an=Pt(At):ln=!0);const Cn=Jt.map(Wt=>{if(!reactExports.isValidElement(Wt))return null;let nn;if(pt){if(!Array.isArray(At))throw new Error(formatMuiErrorMessage$1(2));nn=At.some(rn=>areEqualValues(rn,Wt.props.value)),nn&&ln&&hn.push(Wt.props.children)}else nn=areEqualValues(At,Wt.props.value),nn&&ln&&(Mn=Wt.props.children);return reactExports.cloneElement(Wt,{"aria-selected":nn?"true":"false",onClick:pn(Wt),onKeyUp:rn=>{rn.key===" "&&rn.preventDefault(),Wt.props.onKeyUp&&Wt.props.onKeyUp(rn)},role:"option",selected:nn,value:void 0,"data-value":Wt.props.value})});ln&&(pt?hn.length===0?an=null:an=hn.reduce((Wt,nn,rn)=>(Wt.push(nn),rn{const{classes:j}=s;return j},styledRootConfig={name:"MuiSelect",overridesResolver:(s,j)=>j.root,shouldForwardProp:s=>rootShouldForwardProp(s)&&s!=="variant",slot:"Root"},StyledInput=styled(Input,styledRootConfig)(""),StyledOutlinedInput=styled(OutlinedInput,styledRootConfig)(""),StyledFilledInput=styled(FilledInput,styledRootConfig)(""),Select=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({name:"MuiSelect",props:j}),{autoWidth:et=!1,children:tt,classes:nt={},className:rt,defaultOpen:ot=!1,displayEmpty:it=!1,IconComponent:st=ArrowDropDownIcon,id:at,input:ct,inputProps:lt,label:dt,labelId:ft,MenuProps:gt,multiple:ht=!1,native:yt=!1,onClose:pt,onOpen:Mt,open:St,renderValue:Tt,SelectDisplayProps:vt,variant:Dt="outlined"}=_e,zt=_objectWithoutPropertiesLoose(_e,_excluded$d),Ot=yt?NativeSelectInput:SelectInput,Ft=useFormControl(),Pt=formControlState({props:_e,muiFormControl:Ft,states:["variant","error"]}),Lt=Pt.variant||Dt,mt=_extends$2({},_e,{variant:Lt,classes:nt}),xt=useUtilityClasses$d(mt),It=_objectWithoutPropertiesLoose(xt,_excluded2$1),jt=ct||{standard:jsxRuntimeExports.jsx(StyledInput,{ownerState:mt}),outlined:jsxRuntimeExports.jsx(StyledOutlinedInput,{label:dt,ownerState:mt}),filled:jsxRuntimeExports.jsx(StyledFilledInput,{ownerState:mt})}[Lt],At=useForkRef($,jt.ref);return jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(jt,_extends$2({inputComponent:Ot,inputProps:_extends$2({children:tt,error:Pt.error,IconComponent:st,variant:Lt,type:void 0,multiple:ht},yt?{id:at}:{autoWidth:et,defaultOpen:ot,displayEmpty:it,labelId:ft,MenuProps:gt,onClose:pt,onOpen:Mt,open:St,renderValue:Tt,SelectDisplayProps:_extends$2({id:at},vt)},lt,{classes:lt?deepmerge$1(It,lt.classes):It},ct?ct.props.inputProps:{})},(ht&&yt||it)&&Lt==="outlined"?{notched:!0}:{},{ref:At,className:clsx(jt.props.className,rt,xt.root)},!ct&&{variant:Lt},zt))})});Select.muiName="Select";const shouldSpreadAdditionalProps=s=>!s||!isHostComponent(s);function getSliderUtilityClass(s){return generateUtilityClass$1("MuiSlider",s)}const sliderClasses=generateUtilityClasses$1("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),useValueLabelClasses=s=>{const{open:j}=s;return{offset:clsx(j&&sliderClasses.valueLabelOpen),circle:sliderClasses.valueLabelCircle,label:sliderClasses.valueLabelLabel}};function SliderValueLabel$1(s){const{children:j,className:$,value:_e}=s,et=useValueLabelClasses(s);return j?reactExports.cloneElement(j,{className:clsx(j.props.className)},jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[j.props.children,jsxRuntimeExports.jsx("span",{className:clsx(et.offset,$),"aria-hidden":!0,children:jsxRuntimeExports.jsx("span",{className:et.circle,children:jsxRuntimeExports.jsx("span",{className:et.label,children:_e})})})]})):null}const _excluded$c=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"],useThemeProps=createUseThemeProps();function Identity(s){return s}const SliderRoot=styled("span",{name:"MuiSlider",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,j[`color${capitalize$1($.color)}`],$.size!=="medium"&&j[`size${capitalize$1($.size)}`],$.marked&&j.marked,$.orientation==="vertical"&&j.vertical,$.track==="inverted"&&j.trackInverted,$.track===!1&&j.trackFalse]}})(({theme:s})=>{var j;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${sliderClasses.disabled}`]:{pointerEvents:"none",cursor:"default",color:(s.vars||s).palette.grey[400]},[`&.${sliderClasses.dragging}`]:{[`& .${sliderClasses.thumb}, & .${sliderClasses.track}`]:{transition:"none"}},variants:[...Object.keys(((j=s.vars)!=null?j:s).palette).filter($=>{var _e;return((_e=s.vars)!=null?_e:s).palette[$].main}).map($=>({props:{color:$},style:{color:(s.vars||s).palette[$].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),SliderRail=styled("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(s,j)=>j.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),SliderTrack=styled("span",{name:"MuiSlider",slot:"Track",overridesResolver:(s,j)=>j.track})(({theme:s})=>{var j;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:s.transitions.create(["left","width","bottom","height"],{duration:s.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((j=s.vars)!=null?j:s).palette).filter($=>{var _e;return((_e=s.vars)!=null?_e:s).palette[$].main}).map($=>({props:{color:$,track:"inverted"},style:_extends$2({},s.vars?{backgroundColor:s.vars.palette.Slider[`${$}Track`],borderColor:s.vars.palette.Slider[`${$}Track`]}:_extends$2({backgroundColor:lighten_1(s.palette[$].main,.62),borderColor:lighten_1(s.palette[$].main,.62)},s.applyStyles("dark",{backgroundColor:darken_1(s.palette[$].main,.5)}),s.applyStyles("dark",{borderColor:darken_1(s.palette[$].main,.5)})))}))]}}),SliderThumb=styled("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.thumb,j[`thumbColor${capitalize$1($.color)}`],$.size!=="medium"&&j[`thumbSize${capitalize$1($.size)}`]]}})(({theme:s})=>{var j;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:s.transitions.create(["box-shadow","left","bottom"],{duration:s.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(s.vars||s).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${sliderClasses.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.keys(((j=s.vars)!=null?j:s).palette).filter($=>{var _e;return((_e=s.vars)!=null?_e:s).palette[$].main}).map($=>({props:{color:$},style:{[`&:hover, &.${sliderClasses.focusVisible}`]:_extends$2({},s.vars?{boxShadow:`0px 0px 0px 8px rgba(${s.vars.palette[$].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${alpha_1(s.palette[$].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${sliderClasses.active}`]:_extends$2({},s.vars?{boxShadow:`0px 0px 0px 14px rgba(${s.vars.palette[$].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${alpha_1(s.palette[$].main,.16)}`})}}))]}}),SliderValueLabel=styled(SliderValueLabel$1,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(s,j)=>j.valueLabel})(({theme:s})=>_extends$2({zIndex:1,whiteSpace:"nowrap"},s.typography.body2,{fontWeight:500,transition:s.transitions.create(["transform"],{duration:s.transitions.duration.shortest}),position:"absolute",backgroundColor:(s.vars||s).palette.grey[600],borderRadius:2,color:(s.vars||s).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${sliderClasses.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${sliderClasses.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:s.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),SliderMark=styled("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:s=>slotShouldForwardProp(s)&&s!=="markActive",overridesResolver:(s,j)=>{const{markActive:$}=s;return[j.mark,$&&j.markActive]}})(({theme:s})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(s.vars||s).palette.background.paper,opacity:.8}}]})),SliderMarkLabel=styled("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:s=>slotShouldForwardProp(s)&&s!=="markLabelActive",overridesResolver:(s,j)=>j.markLabel})(({theme:s})=>_extends$2({},s.typography.body2,{color:(s.vars||s).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(s.vars||s).palette.text.primary}}]})),useUtilityClasses$c=s=>{const{disabled:j,dragging:$,marked:_e,orientation:et,track:tt,classes:nt,color:rt,size:ot}=s,it={root:["root",j&&"disabled",$&&"dragging",_e&&"marked",et==="vertical"&&"vertical",tt==="inverted"&&"trackInverted",tt===!1&&"trackFalse",rt&&`color${capitalize$1(rt)}`,ot&&`size${capitalize$1(ot)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",j&&"disabled",ot&&`thumbSize${capitalize$1(ot)}`,rt&&`thumbColor${capitalize$1(rt)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return composeClasses(it,getSliderUtilityClass,nt)},Forward=({children:s})=>s,Slider=reactExports.forwardRef(function(j,$){var _e,et,tt,nt,rt,ot,it,st,at,ct,lt,dt,ft,gt,ht,yt,pt,Mt,St,Tt,vt,Dt,zt,Ot;const Ft=useThemeProps({props:j,name:"MuiSlider"}),Pt=useRtl(),{"aria-label":Lt,"aria-valuetext":mt,"aria-labelledby":xt,component:It="span",components:jt={},componentsProps:At={},color:wt="primary",classes:Rt,className:Nt,disableSwap:Ct=!1,disabled:Bt=!1,getAriaLabel:Gt,getAriaValueText:Vt,marks:Yt=!1,max:Qt=100,min:qt=0,orientation:Zt="horizontal",shiftStep:fn=10,size:Xt="medium",step:on=1,scale:tn=Identity,slotProps:Kt,slots:Jt,track:En="normal",valueLabelDisplay:pn="off",valueLabelFormat:cn=Identity}=Ft,Tn=_objectWithoutPropertiesLoose(Ft,_excluded$c),sn=_extends$2({},Ft,{isRtl:Pt,max:Qt,min:qt,classes:Rt,disabled:Bt,disableSwap:Ct,orientation:Zt,marks:Yt,color:wt,size:Xt,step:on,shiftStep:fn,scale:tn,track:En,valueLabelDisplay:pn,valueLabelFormat:cn}),{axisProps:an,getRootProps:Mn,getHiddenInputProps:hn,getThumbProps:ln,open:Cn,active:gn,axis:$t,focusedThumbIndex:bt,range:Et,dragging:kt,marks:Ut,values:Ht,trackOffset:Wt,trackLeap:nn,getThumbStyle:rn}=useSlider(_extends$2({},sn,{rootRef:$}));sn.marked=Ut.length>0&&Ut.some(Rn=>Rn.label),sn.dragging=kt,sn.focusedThumbIndex=bt;const en=useUtilityClasses$c(sn),mn=(_e=(et=Jt==null?void 0:Jt.root)!=null?et:jt.Root)!=null?_e:SliderRoot,un=(tt=(nt=Jt==null?void 0:Jt.rail)!=null?nt:jt.Rail)!=null?tt:SliderRail,Bn=(rt=(ot=Jt==null?void 0:Jt.track)!=null?ot:jt.Track)!=null?rt:SliderTrack,Qn=(it=(st=Jt==null?void 0:Jt.thumb)!=null?st:jt.Thumb)!=null?it:SliderThumb,On=(at=(ct=Jt==null?void 0:Jt.valueLabel)!=null?ct:jt.ValueLabel)!=null?at:SliderValueLabel,wn=(lt=(dt=Jt==null?void 0:Jt.mark)!=null?dt:jt.Mark)!=null?lt:SliderMark,Gn=(ft=(gt=Jt==null?void 0:Jt.markLabel)!=null?gt:jt.MarkLabel)!=null?ft:SliderMarkLabel,Nn=(ht=(yt=Jt==null?void 0:Jt.input)!=null?yt:jt.Input)!=null?ht:"input",Ln=(pt=Kt==null?void 0:Kt.root)!=null?pt:At.root,qn=(Mt=Kt==null?void 0:Kt.rail)!=null?Mt:At.rail,_n=(St=Kt==null?void 0:Kt.track)!=null?St:At.track,Dn=(Tt=Kt==null?void 0:Kt.thumb)!=null?Tt:At.thumb,Wn=(vt=Kt==null?void 0:Kt.valueLabel)!=null?vt:At.valueLabel,Pn=(Dt=Kt==null?void 0:Kt.mark)!=null?Dt:At.mark,An=(zt=Kt==null?void 0:Kt.markLabel)!=null?zt:At.markLabel,Vn=(Ot=Kt==null?void 0:Kt.input)!=null?Ot:At.input,Sn=useSlotProps({elementType:mn,getSlotProps:Mn,externalSlotProps:Ln,externalForwardedProps:Tn,additionalProps:_extends$2({},shouldSpreadAdditionalProps(mn)&&{as:It}),ownerState:_extends$2({},sn,Ln==null?void 0:Ln.ownerState),className:[en.root,Nt]}),vn=useSlotProps({elementType:un,externalSlotProps:qn,ownerState:sn,className:en.rail}),Zn=useSlotProps({elementType:Bn,externalSlotProps:_n,additionalProps:{style:_extends$2({},an[$t].offset(Wt),an[$t].leap(nn))},ownerState:_extends$2({},sn,_n==null?void 0:_n.ownerState),className:en.track}),In=useSlotProps({elementType:Qn,getSlotProps:ln,externalSlotProps:Dn,ownerState:_extends$2({},sn,Dn==null?void 0:Dn.ownerState),className:en.thumb}),$n=useSlotProps({elementType:On,externalSlotProps:Wn,ownerState:_extends$2({},sn,Wn==null?void 0:Wn.ownerState),className:en.valueLabel}),Yn=useSlotProps({elementType:wn,externalSlotProps:Pn,ownerState:sn,className:en.mark}),jn=useSlotProps({elementType:Gn,externalSlotProps:An,ownerState:sn,className:en.markLabel}),zn=useSlotProps({elementType:Nn,getSlotProps:hn,externalSlotProps:Vn,ownerState:sn});return jsxRuntimeExports.jsxs(mn,_extends$2({},Sn,{children:[jsxRuntimeExports.jsx(un,_extends$2({},vn)),jsxRuntimeExports.jsx(Bn,_extends$2({},Zn)),Ut.filter(Rn=>Rn.value>=qt&&Rn.value<=Qt).map((Rn,yn)=>{const kn=valueToPercent(Rn.value,qt,Qt),Hn=an[$t].offset(kn);let Un;return En===!1?Un=Ht.indexOf(Rn.value)!==-1:Un=En==="normal"&&(Et?Rn.value>=Ht[0]&&Rn.value<=Ht[Ht.length-1]:Rn.value<=Ht[0])||En==="inverted"&&(Et?Rn.value<=Ht[0]||Rn.value>=Ht[Ht.length-1]:Rn.value>=Ht[0]),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(wn,_extends$2({"data-index":yn},Yn,!isHostComponent(wn)&&{markActive:Un},{style:_extends$2({},Hn,Yn.style),className:clsx(Yn.className,Un&&en.markActive)})),Rn.label!=null?jsxRuntimeExports.jsx(Gn,_extends$2({"aria-hidden":!0,"data-index":yn},jn,!isHostComponent(Gn)&&{markLabelActive:Un},{style:_extends$2({},Hn,jn.style),className:clsx(en.markLabel,jn.className,Un&&en.markLabelActive),children:Rn.label})):null]},yn)}),Ht.map((Rn,yn)=>{const kn=valueToPercent(Rn,qt,Qt),Hn=an[$t].offset(kn),Un=pn==="off"?Forward:On;return jsxRuntimeExports.jsx(Un,_extends$2({},!isHostComponent(Un)&&{valueLabelFormat:cn,valueLabelDisplay:pn,value:typeof cn=="function"?cn(tn(Rn),yn):cn,index:yn,open:Cn===yn||gn===yn||pn==="on",disabled:Bt},$n,{children:jsxRuntimeExports.jsx(Qn,_extends$2({"data-index":yn},In,{className:clsx(en.thumb,In.className,gn===yn&&en.active,bt===yn&&en.focusVisible),style:_extends$2({},Hn,rn(yn),In.style),children:jsxRuntimeExports.jsx(Nn,_extends$2({"data-index":yn,"aria-label":Gt?Gt(yn):Lt,"aria-valuenow":tn(Rn),"aria-labelledby":xt,"aria-valuetext":Vt?Vt(tn(Rn),yn):mt,value:Ht[yn]},zn))}))}),yn)})]}))});function getTooltipUtilityClass(s){return generateUtilityClass$1("MuiTooltip",s)}const tooltipClasses=generateUtilityClasses$1("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),_excluded$b=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function round(s){return Math.round(s*1e5)/1e5}const useUtilityClasses$b=s=>{const{classes:j,disableInteractive:$,arrow:_e,touch:et,placement:tt}=s,nt={popper:["popper",!$&&"popperInteractive",_e&&"popperArrow"],tooltip:["tooltip",_e&&"tooltipArrow",et&&"touch",`tooltipPlacement${capitalize$1(tt.split("-")[0])}`],arrow:["arrow"]};return composeClasses(nt,getTooltipUtilityClass,j)},TooltipPopper=styled(Popper,{name:"MuiTooltip",slot:"Popper",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.popper,!$.disableInteractive&&j.popperInteractive,$.arrow&&j.popperArrow,!$.open&&j.popperClose]}})(({theme:s,ownerState:j,open:$})=>_extends$2({zIndex:(s.vars||s).zIndex.tooltip,pointerEvents:"none"},!j.disableInteractive&&{pointerEvents:"auto"},!$&&{pointerEvents:"none"},j.arrow&&{[`&[data-popper-placement*="bottom"] .${tooltipClasses.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${tooltipClasses.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]:_extends$2({},j.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]:_extends$2({},j.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),TooltipTooltip=styled("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.tooltip,$.touch&&j.touch,$.arrow&&j.tooltipArrow,j[`tooltipPlacement${capitalize$1($.placement.split("-")[0])}`]]}})(({theme:s,ownerState:j})=>_extends$2({backgroundColor:s.vars?s.vars.palette.Tooltip.bg:alpha_1(s.palette.grey[700],.92),borderRadius:(s.vars||s).shape.borderRadius,color:(s.vars||s).palette.common.white,fontFamily:s.typography.fontFamily,padding:"4px 8px",fontSize:s.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:s.typography.fontWeightMedium},j.arrow&&{position:"relative",margin:0},j.touch&&{padding:"8px 16px",fontSize:s.typography.pxToRem(14),lineHeight:`${round(16/14)}em`,fontWeight:s.typography.fontWeightRegular},{[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:_extends$2({transformOrigin:"right center"},j.isRtl?_extends$2({marginLeft:"14px"},j.touch&&{marginLeft:"24px"}):_extends$2({marginRight:"14px"},j.touch&&{marginRight:"24px"})),[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:_extends$2({transformOrigin:"left center"},j.isRtl?_extends$2({marginRight:"14px"},j.touch&&{marginRight:"24px"}):_extends$2({marginLeft:"14px"},j.touch&&{marginLeft:"24px"})),[`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]:_extends$2({transformOrigin:"center bottom",marginBottom:"14px"},j.touch&&{marginBottom:"24px"}),[`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]:_extends$2({transformOrigin:"center top",marginTop:"14px"},j.touch&&{marginTop:"24px"})})),TooltipArrow=styled("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(s,j)=>j.arrow})(({theme:s})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:s.vars?s.vars.palette.Tooltip.bg:alpha_1(s.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let hystersisOpen=!1;const hystersisTimer=new Timeout;let cursorPosition={x:0,y:0};function composeEventHandler(s,j){return($,..._e)=>{j&&j($,..._e),s($,..._e)}}const Tooltip=reactExports.forwardRef(function(j,$){var _e,et,tt,nt,rt,ot,it,st,at,ct,lt,dt,ft,gt,ht,yt,pt,Mt,St;const Tt=useThemeProps$5({props:j,name:"MuiTooltip"}),{arrow:vt=!1,children:Dt,components:zt={},componentsProps:Ot={},describeChild:Ft=!1,disableFocusListener:Pt=!1,disableHoverListener:Lt=!1,disableInteractive:mt=!1,disableTouchListener:xt=!1,enterDelay:It=100,enterNextDelay:jt=0,enterTouchDelay:At=700,followCursor:wt=!1,id:Rt,leaveDelay:Nt=0,leaveTouchDelay:Ct=1500,onClose:Bt,onOpen:Gt,open:Vt,placement:Yt="bottom",PopperComponent:Qt,PopperProps:qt={},slotProps:Zt={},slots:fn={},title:Xt,TransitionComponent:on=Grow,TransitionProps:tn}=Tt,Kt=_objectWithoutPropertiesLoose(Tt,_excluded$b),Jt=reactExports.isValidElement(Dt)?Dt:jsxRuntimeExports.jsx("span",{children:Dt}),En=useTheme$1(),pn=useRtl(),[cn,Tn]=reactExports.useState(),[sn,an]=reactExports.useState(null),Mn=reactExports.useRef(!1),hn=mt||wt,ln=useTimeout(),Cn=useTimeout(),gn=useTimeout(),$t=useTimeout(),[bt,Et]=useControlled({controlled:Vt,default:!1,name:"Tooltip",state:"open"});let kt=bt;const Ut=useId(Rt),Ht=reactExports.useRef(),Wt=useEventCallback(()=>{Ht.current!==void 0&&(document.body.style.WebkitUserSelect=Ht.current,Ht.current=void 0),$t.clear()});reactExports.useEffect(()=>Wt,[Wt]);const nn=xn=>{hystersisTimer.clear(),hystersisOpen=!0,Et(!0),Gt&&!kt&&Gt(xn)},rn=useEventCallback(xn=>{hystersisTimer.start(800+Nt,()=>{hystersisOpen=!1}),Et(!1),Bt&&kt&&Bt(xn),ln.start(En.transitions.duration.shortest,()=>{Mn.current=!1})}),en=xn=>{Mn.current&&xn.type!=="touchstart"||(cn&&cn.removeAttribute("title"),Cn.clear(),gn.clear(),It||hystersisOpen&&jt?Cn.start(hystersisOpen?jt:It,()=>{nn(xn)}):nn(xn))},mn=xn=>{Cn.clear(),gn.start(Nt,()=>{rn(xn)})},{isFocusVisibleRef:un,onBlur:Bn,onFocus:Qn,ref:On}=useIsFocusVisible(),[,wn]=reactExports.useState(!1),Gn=xn=>{Bn(xn),un.current===!1&&(wn(!1),mn(xn))},Nn=xn=>{cn||Tn(xn.currentTarget),Qn(xn),un.current===!0&&(wn(!0),en(xn))},Ln=xn=>{Mn.current=!0;const Fn=Jt.props;Fn.onTouchStart&&Fn.onTouchStart(xn)},qn=xn=>{Ln(xn),gn.clear(),ln.clear(),Wt(),Ht.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",$t.start(At,()=>{document.body.style.WebkitUserSelect=Ht.current,en(xn)})},_n=xn=>{Jt.props.onTouchEnd&&Jt.props.onTouchEnd(xn),Wt(),gn.start(Ct,()=>{rn(xn)})};reactExports.useEffect(()=>{if(!kt)return;function xn(Fn){(Fn.key==="Escape"||Fn.key==="Esc")&&rn(Fn)}return document.addEventListener("keydown",xn),()=>{document.removeEventListener("keydown",xn)}},[rn,kt]);const Dn=useForkRef(Jt.ref,On,Tn,$);!Xt&&Xt!==0&&(kt=!1);const Wn=reactExports.useRef(),Pn=xn=>{const Fn=Jt.props;Fn.onMouseMove&&Fn.onMouseMove(xn),cursorPosition={x:xn.clientX,y:xn.clientY},Wn.current&&Wn.current.update()},An={},Vn=typeof Xt=="string";Ft?(An.title=!kt&&Vn&&!Lt?Xt:null,An["aria-describedby"]=kt?Ut:null):(An["aria-label"]=Vn?Xt:null,An["aria-labelledby"]=kt&&!Vn?Ut:null);const Sn=_extends$2({},An,Kt,Jt.props,{className:clsx(Kt.className,Jt.props.className),onTouchStart:Ln,ref:Dn},wt?{onMouseMove:Pn}:{}),vn={};xt||(Sn.onTouchStart=qn,Sn.onTouchEnd=_n),Lt||(Sn.onMouseOver=composeEventHandler(en,Sn.onMouseOver),Sn.onMouseLeave=composeEventHandler(mn,Sn.onMouseLeave),hn||(vn.onMouseOver=en,vn.onMouseLeave=mn)),Pt||(Sn.onFocus=composeEventHandler(Nn,Sn.onFocus),Sn.onBlur=composeEventHandler(Gn,Sn.onBlur),hn||(vn.onFocus=Nn,vn.onBlur=Gn));const Zn=reactExports.useMemo(()=>{var xn;let Fn=[{name:"arrow",enabled:!!sn,options:{element:sn,padding:4}}];return(xn=qt.popperOptions)!=null&&xn.modifiers&&(Fn=Fn.concat(qt.popperOptions.modifiers)),_extends$2({},qt.popperOptions,{modifiers:Fn})},[sn,qt]),In=_extends$2({},Tt,{isRtl:pn,arrow:vt,disableInteractive:hn,placement:Yt,PopperComponentProp:Qt,touch:Mn.current}),$n=useUtilityClasses$b(In),Yn=(_e=(et=fn.popper)!=null?et:zt.Popper)!=null?_e:TooltipPopper,jn=(tt=(nt=(rt=fn.transition)!=null?rt:zt.Transition)!=null?nt:on)!=null?tt:Grow,zn=(ot=(it=fn.tooltip)!=null?it:zt.Tooltip)!=null?ot:TooltipTooltip,Rn=(st=(at=fn.arrow)!=null?at:zt.Arrow)!=null?st:TooltipArrow,yn=appendOwnerState(Yn,_extends$2({},qt,(ct=Zt.popper)!=null?ct:Ot.popper,{className:clsx($n.popper,qt==null?void 0:qt.className,(lt=(dt=Zt.popper)!=null?dt:Ot.popper)==null?void 0:lt.className)}),In),kn=appendOwnerState(jn,_extends$2({},tn,(ft=Zt.transition)!=null?ft:Ot.transition),In),Hn=appendOwnerState(zn,_extends$2({},(gt=Zt.tooltip)!=null?gt:Ot.tooltip,{className:clsx($n.tooltip,(ht=(yt=Zt.tooltip)!=null?yt:Ot.tooltip)==null?void 0:ht.className)}),In),Un=appendOwnerState(Rn,_extends$2({},(pt=Zt.arrow)!=null?pt:Ot.arrow,{className:clsx($n.arrow,(Mt=(St=Zt.arrow)!=null?St:Ot.arrow)==null?void 0:Mt.className)}),In);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[reactExports.cloneElement(Jt,Sn),jsxRuntimeExports.jsx(Yn,_extends$2({as:Qt??Popper,placement:Yt,anchorEl:wt?{getBoundingClientRect:()=>({top:cursorPosition.y,left:cursorPosition.x,right:cursorPosition.x,bottom:cursorPosition.y,width:0,height:0})}:cn,popperRef:Wn,open:cn?kt:!1,id:Ut,transition:!0},vn,yn,{popperOptions:Zn,children:({TransitionProps:xn})=>jsxRuntimeExports.jsx(jn,_extends$2({timeout:En.transitions.duration.shorter},xn,kn,{children:jsxRuntimeExports.jsxs(zn,_extends$2({},Hn,{children:[Xt,vt?jsxRuntimeExports.jsx(Rn,_extends$2({},Un,{ref:an})):null]}))}))}))]})}),TableContext=reactExports.createContext();function getTableUtilityClass(s){return generateUtilityClass$1("MuiTable",s)}generateUtilityClasses$1("MuiTable",["root","stickyHeader"]);const _excluded$a=["className","component","padding","size","stickyHeader"],useUtilityClasses$a=s=>{const{classes:j,stickyHeader:$}=s;return composeClasses({root:["root",$&&"stickyHeader"]},getTableUtilityClass,j)},TableRoot=styled("table",{name:"MuiTable",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,$.stickyHeader&&j.stickyHeader]}})(({theme:s,ownerState:j})=>_extends$2({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":_extends$2({},s.typography.body2,{padding:s.spacing(2),color:(s.vars||s).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},j.stickyHeader&&{borderCollapse:"separate"})),defaultComponent$4="table",Table$1=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTable"}),{className:et,component:tt=defaultComponent$4,padding:nt="normal",size:rt="medium",stickyHeader:ot=!1}=_e,it=_objectWithoutPropertiesLoose(_e,_excluded$a),st=_extends$2({},_e,{component:tt,padding:nt,size:rt,stickyHeader:ot}),at=useUtilityClasses$a(st),ct=reactExports.useMemo(()=>({padding:nt,size:rt,stickyHeader:ot}),[nt,rt,ot]);return jsxRuntimeExports.jsx(TableContext.Provider,{value:ct,children:jsxRuntimeExports.jsx(TableRoot,_extends$2({as:tt,role:tt===defaultComponent$4?null:"table",ref:$,className:clsx(at.root,et),ownerState:st},it))})}),Tablelvl2Context=reactExports.createContext();function getTableBodyUtilityClass(s){return generateUtilityClass$1("MuiTableBody",s)}generateUtilityClasses$1("MuiTableBody",["root"]);const _excluded$9=["className","component"],useUtilityClasses$9=s=>{const{classes:j}=s;return composeClasses({root:["root"]},getTableBodyUtilityClass,j)},TableBodyRoot=styled("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(s,j)=>j.root})({display:"table-row-group"}),tablelvl2$2={variant:"body"},defaultComponent$3="tbody",TableBody=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableBody"}),{className:et,component:tt=defaultComponent$3}=_e,nt=_objectWithoutPropertiesLoose(_e,_excluded$9),rt=_extends$2({},_e,{component:tt}),ot=useUtilityClasses$9(rt);return jsxRuntimeExports.jsx(Tablelvl2Context.Provider,{value:tablelvl2$2,children:jsxRuntimeExports.jsx(TableBodyRoot,_extends$2({className:clsx(ot.root,et),as:tt,ref:$,role:tt===defaultComponent$3?null:"rowgroup",ownerState:rt},nt))})});function getTableCellUtilityClass(s){return generateUtilityClass$1("MuiTableCell",s)}const tableCellClasses=generateUtilityClasses$1("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),_excluded$8=["align","className","component","padding","scope","size","sortDirection","variant"],useUtilityClasses$8=s=>{const{classes:j,variant:$,align:_e,padding:et,size:tt,stickyHeader:nt}=s,rt={root:["root",$,nt&&"stickyHeader",_e!=="inherit"&&`align${capitalize$1(_e)}`,et!=="normal"&&`padding${capitalize$1(et)}`,`size${capitalize$1(tt)}`]};return composeClasses(rt,getTableCellUtilityClass,j)},TableCellRoot=styled("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,j[$.variant],j[`size${capitalize$1($.size)}`],$.padding!=="normal"&&j[`padding${capitalize$1($.padding)}`],$.align!=="inherit"&&j[`align${capitalize$1($.align)}`],$.stickyHeader&&j.stickyHeader]}})(({theme:s,ownerState:j})=>_extends$2({},s.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:s.vars?`1px solid ${s.vars.palette.TableCell.border}`:`1px solid - ${s.palette.mode==="light"?lighten_1(alpha_1(s.palette.divider,1),.88):darken_1(alpha_1(s.palette.divider,1),.68)}`,textAlign:"left",padding:16},j.variant==="head"&&{color:(s.vars||s).palette.text.primary,lineHeight:s.typography.pxToRem(24),fontWeight:s.typography.fontWeightMedium},j.variant==="body"&&{color:(s.vars||s).palette.text.primary},j.variant==="footer"&&{color:(s.vars||s).palette.text.secondary,lineHeight:s.typography.pxToRem(21),fontSize:s.typography.pxToRem(12)},j.size==="small"&&{padding:"6px 16px",[`&.${tableCellClasses.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},j.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},j.padding==="none"&&{padding:0},j.align==="left"&&{textAlign:"left"},j.align==="center"&&{textAlign:"center"},j.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},j.align==="justify"&&{textAlign:"justify"},j.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(s.vars||s).palette.background.default})),TableCell=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableCell"}),{align:et="inherit",className:tt,component:nt,padding:rt,scope:ot,size:it,sortDirection:st,variant:at}=_e,ct=_objectWithoutPropertiesLoose(_e,_excluded$8),lt=reactExports.useContext(TableContext),dt=reactExports.useContext(Tablelvl2Context),ft=dt&&dt.variant==="head";let gt;nt?gt=nt:gt=ft?"th":"td";let ht=ot;gt==="td"?ht=void 0:!ht&&ft&&(ht="col");const yt=at||dt&&dt.variant,pt=_extends$2({},_e,{align:et,component:gt,padding:rt||(lt&<.padding?lt.padding:"normal"),size:it||(lt&<.size?lt.size:"medium"),sortDirection:st,stickyHeader:yt==="head"&<&<.stickyHeader,variant:yt}),Mt=useUtilityClasses$8(pt);let St=null;return st&&(St=st==="asc"?"ascending":"descending"),jsxRuntimeExports.jsx(TableCellRoot,_extends$2({as:gt,ref:$,className:clsx(Mt.root,tt),"aria-sort":St,scope:ht,ownerState:pt},ct))});function getTableContainerUtilityClass(s){return generateUtilityClass$1("MuiTableContainer",s)}generateUtilityClasses$1("MuiTableContainer",["root"]);const _excluded$7=["className","component"],useUtilityClasses$7=s=>{const{classes:j}=s;return composeClasses({root:["root"]},getTableContainerUtilityClass,j)},TableContainerRoot=styled("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(s,j)=>j.root})({width:"100%",overflowX:"auto"}),TableContainer=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableContainer"}),{className:et,component:tt="div"}=_e,nt=_objectWithoutPropertiesLoose(_e,_excluded$7),rt=_extends$2({},_e,{component:tt}),ot=useUtilityClasses$7(rt);return jsxRuntimeExports.jsx(TableContainerRoot,_extends$2({ref:$,as:tt,className:clsx(ot.root,et),ownerState:rt},nt))});function getTableFooterUtilityClass(s){return generateUtilityClass$1("MuiTableFooter",s)}generateUtilityClasses$1("MuiTableFooter",["root"]);const _excluded$6=["className","component"],useUtilityClasses$6=s=>{const{classes:j}=s;return composeClasses({root:["root"]},getTableFooterUtilityClass,j)},TableFooterRoot=styled("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(s,j)=>j.root})({display:"table-footer-group"}),tablelvl2$1={variant:"footer"},defaultComponent$2="tfoot",TableFooter=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableFooter"}),{className:et,component:tt=defaultComponent$2}=_e,nt=_objectWithoutPropertiesLoose(_e,_excluded$6),rt=_extends$2({},_e,{component:tt}),ot=useUtilityClasses$6(rt);return jsxRuntimeExports.jsx(Tablelvl2Context.Provider,{value:tablelvl2$1,children:jsxRuntimeExports.jsx(TableFooterRoot,_extends$2({as:tt,className:clsx(ot.root,et),ref:$,role:tt===defaultComponent$2?null:"rowgroup",ownerState:rt},nt))})});function getTableHeadUtilityClass(s){return generateUtilityClass$1("MuiTableHead",s)}generateUtilityClasses$1("MuiTableHead",["root"]);const _excluded$5=["className","component"],useUtilityClasses$5=s=>{const{classes:j}=s;return composeClasses({root:["root"]},getTableHeadUtilityClass,j)},TableHeadRoot=styled("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(s,j)=>j.root})({display:"table-header-group"}),tablelvl2={variant:"head"},defaultComponent$1="thead",TableHead=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableHead"}),{className:et,component:tt=defaultComponent$1}=_e,nt=_objectWithoutPropertiesLoose(_e,_excluded$5),rt=_extends$2({},_e,{component:tt}),ot=useUtilityClasses$5(rt);return jsxRuntimeExports.jsx(Tablelvl2Context.Provider,{value:tablelvl2,children:jsxRuntimeExports.jsx(TableHeadRoot,_extends$2({as:tt,className:clsx(ot.root,et),ref:$,role:tt===defaultComponent$1?null:"rowgroup",ownerState:rt},nt))})});function getToolbarUtilityClass(s){return generateUtilityClass$1("MuiToolbar",s)}generateUtilityClasses$1("MuiToolbar",["root","gutters","regular","dense"]);const _excluded$4=["className","component","disableGutters","variant"],useUtilityClasses$4=s=>{const{classes:j,disableGutters:$,variant:_e}=s;return composeClasses({root:["root",!$&&"gutters",_e]},getToolbarUtilityClass,j)},ToolbarRoot=styled("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,!$.disableGutters&&j.gutters,j[$.variant]]}})(({theme:s,ownerState:j})=>_extends$2({position:"relative",display:"flex",alignItems:"center"},!j.disableGutters&&{paddingLeft:s.spacing(2),paddingRight:s.spacing(2),[s.breakpoints.up("sm")]:{paddingLeft:s.spacing(3),paddingRight:s.spacing(3)}},j.variant==="dense"&&{minHeight:48}),({theme:s,ownerState:j})=>j.variant==="regular"&&s.mixins.toolbar),Toolbar=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiToolbar"}),{className:et,component:tt="div",disableGutters:nt=!1,variant:rt="regular"}=_e,ot=_objectWithoutPropertiesLoose(_e,_excluded$4),it=_extends$2({},_e,{component:tt,disableGutters:nt,variant:rt}),st=useUtilityClasses$4(it);return jsxRuntimeExports.jsx(ToolbarRoot,_extends$2({as:tt,className:clsx(st.root,et),ref:$,ownerState:it},ot))});function getTableRowUtilityClass(s){return generateUtilityClass$1("MuiTableRow",s)}const tableRowClasses=generateUtilityClasses$1("MuiTableRow",["root","selected","hover","head","footer"]),_excluded$3=["className","component","hover","selected"],useUtilityClasses$3=s=>{const{classes:j,selected:$,hover:_e,head:et,footer:tt}=s;return composeClasses({root:["root",$&&"selected",_e&&"hover",et&&"head",tt&&"footer"]},getTableRowUtilityClass,j)},TableRowRoot=styled("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,$.head&&j.head,$.footer&&j.footer]}})(({theme:s})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${tableRowClasses.hover}:hover`]:{backgroundColor:(s.vars||s).palette.action.hover},[`&.${tableRowClasses.selected}`]:{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / ${s.vars.palette.action.selectedOpacity})`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity),"&:hover":{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / calc(${s.vars.palette.action.selectedOpacity} + ${s.vars.palette.action.hoverOpacity}))`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity+s.palette.action.hoverOpacity)}}})),defaultComponent="tr",TableRow=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableRow"}),{className:et,component:tt=defaultComponent,hover:nt=!1,selected:rt=!1}=_e,ot=_objectWithoutPropertiesLoose(_e,_excluded$3),it=reactExports.useContext(Tablelvl2Context),st=_extends$2({},_e,{component:tt,hover:nt,selected:rt,head:it&&it.variant==="head",footer:it&&it.variant==="footer"}),at=useUtilityClasses$3(st);return jsxRuntimeExports.jsx(TableRowRoot,_extends$2({as:tt,ref:$,className:clsx(at.root,et),role:tt===defaultComponent?null:"row",ownerState:st},ot))});function getTextFieldUtilityClass(s){return generateUtilityClass$1("MuiTextField",s)}generateUtilityClasses$1("MuiTextField",["root"]);const _excluded$2=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],variantComponent={standard:Input,filled:FilledInput,outlined:OutlinedInput},useUtilityClasses$2=s=>{const{classes:j}=s;return composeClasses({root:["root"]},getTextFieldUtilityClass,j)},TextFieldRoot=styled(FormControl,{name:"MuiTextField",slot:"Root",overridesResolver:(s,j)=>j.root})({}),TextField=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTextField"}),{autoComplete:et,autoFocus:tt=!1,children:nt,className:rt,color:ot="primary",defaultValue:it,disabled:st=!1,error:at=!1,FormHelperTextProps:ct,fullWidth:lt=!1,helperText:dt,id:ft,InputLabelProps:gt,inputProps:ht,InputProps:yt,inputRef:pt,label:Mt,maxRows:St,minRows:Tt,multiline:vt=!1,name:Dt,onBlur:zt,onChange:Ot,onFocus:Ft,placeholder:Pt,required:Lt=!1,rows:mt,select:xt=!1,SelectProps:It,type:jt,value:At,variant:wt="outlined"}=_e,Rt=_objectWithoutPropertiesLoose(_e,_excluded$2),Nt=_extends$2({},_e,{autoFocus:tt,color:ot,disabled:st,error:at,fullWidth:lt,multiline:vt,required:Lt,select:xt,variant:wt}),Ct=useUtilityClasses$2(Nt),Bt={};wt==="outlined"&&(gt&&typeof gt.shrink<"u"&&(Bt.notched=gt.shrink),Bt.label=Mt),xt&&((!It||!It.native)&&(Bt.id=void 0),Bt["aria-describedby"]=void 0);const Gt=useId(ft),Vt=dt&&Gt?`${Gt}-helper-text`:void 0,Yt=Mt&&Gt?`${Gt}-label`:void 0,Qt=variantComponent[wt],qt=jsxRuntimeExports.jsx(Qt,_extends$2({"aria-describedby":Vt,autoComplete:et,autoFocus:tt,defaultValue:it,fullWidth:lt,multiline:vt,name:Dt,rows:mt,maxRows:St,minRows:Tt,type:jt,value:At,id:Gt,inputRef:pt,onBlur:zt,onChange:Ot,onFocus:Ft,placeholder:Pt,inputProps:ht},Bt,yt));return jsxRuntimeExports.jsxs(TextFieldRoot,_extends$2({className:clsx(Ct.root,rt),disabled:st,error:at,fullWidth:lt,ref:$,required:Lt,color:ot,variant:wt,ownerState:Nt},Rt,{children:[Mt!=null&&Mt!==""&&jsxRuntimeExports.jsx(InputLabel,_extends$2({htmlFor:Gt,id:Yt},gt,{children:Mt})),xt?jsxRuntimeExports.jsx(Select,_extends$2({"aria-describedby":Vt,id:Gt,labelId:Yt,value:At,input:qt},It,{children:nt})):qt,dt&&jsxRuntimeExports.jsx(FormHelperText,_extends$2({id:Vt},ct,{children:dt}))]}))});function getToggleButtonUtilityClass(s){return generateUtilityClass$1("MuiToggleButton",s)}const toggleButtonClasses=generateUtilityClasses$1("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),ToggleButtonGroupContext=reactExports.createContext({}),ToggleButtonGroupButtonContext=reactExports.createContext(void 0);function isValueSelected(s,j){return j===void 0||s===void 0?!1:Array.isArray(j)?j.indexOf(s)>=0:s===j}const _excluded$1=["value"],_excluded2=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],useUtilityClasses$1=s=>{const{classes:j,fullWidth:$,selected:_e,disabled:et,size:tt,color:nt}=s,rt={root:["root",_e&&"selected",et&&"disabled",$&&"fullWidth",`size${capitalize$1(tt)}`,nt]};return composeClasses(rt,getToggleButtonUtilityClass,j)},ToggleButtonRoot=styled(ButtonBase,{name:"MuiToggleButton",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,j[`size${capitalize$1($.size)}`]]}})(({theme:s,ownerState:j})=>{let $=j.color==="standard"?s.palette.text.primary:s.palette[j.color].main,_e;return s.vars&&($=j.color==="standard"?s.vars.palette.text.primary:s.vars.palette[j.color].main,_e=j.color==="standard"?s.vars.palette.text.primaryChannel:s.vars.palette[j.color].mainChannel),_extends$2({},s.typography.button,{borderRadius:(s.vars||s).shape.borderRadius,padding:11,border:`1px solid ${(s.vars||s).palette.divider}`,color:(s.vars||s).palette.action.active},j.fullWidth&&{width:"100%"},{[`&.${toggleButtonClasses.disabled}`]:{color:(s.vars||s).palette.action.disabled,border:`1px solid ${(s.vars||s).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:s.vars?`rgba(${s.vars.palette.text.primaryChannel} / ${s.vars.palette.action.hoverOpacity})`:alpha$1(s.palette.text.primary,s.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${toggleButtonClasses.selected}`]:{color:$,backgroundColor:s.vars?`rgba(${_e} / ${s.vars.palette.action.selectedOpacity})`:alpha$1($,s.palette.action.selectedOpacity),"&:hover":{backgroundColor:s.vars?`rgba(${_e} / calc(${s.vars.palette.action.selectedOpacity} + ${s.vars.palette.action.hoverOpacity}))`:alpha$1($,s.palette.action.selectedOpacity+s.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:s.vars?`rgba(${_e} / ${s.vars.palette.action.selectedOpacity})`:alpha$1($,s.palette.action.selectedOpacity)}}}},j.size==="small"&&{padding:7,fontSize:s.typography.pxToRem(13)},j.size==="large"&&{padding:15,fontSize:s.typography.pxToRem(15)})}),ToggleButton=reactExports.forwardRef(function(j,$){const _e=reactExports.useContext(ToggleButtonGroupContext),{value:et}=_e,tt=_objectWithoutPropertiesLoose(_e,_excluded$1),nt=reactExports.useContext(ToggleButtonGroupButtonContext),rt=resolveProps(_extends$2({},tt,{selected:isValueSelected(j.value,et)}),j),ot=useThemeProps$5({props:rt,name:"MuiToggleButton"}),{children:it,className:st,color:at="standard",disabled:ct=!1,disableFocusRipple:lt=!1,fullWidth:dt=!1,onChange:ft,onClick:gt,selected:ht,size:yt="medium",value:pt}=ot,Mt=_objectWithoutPropertiesLoose(ot,_excluded2),St=_extends$2({},ot,{color:at,disabled:ct,disableFocusRipple:lt,fullWidth:dt,size:yt}),Tt=useUtilityClasses$1(St),vt=zt=>{gt&&(gt(zt,pt),zt.defaultPrevented)||ft&&ft(zt,pt)},Dt=nt||"";return jsxRuntimeExports.jsx(ToggleButtonRoot,_extends$2({className:clsx(tt.className,Tt.root,st,Dt),disabled:ct,focusRipple:!lt,ref:$,onClick:vt,onChange:ft,value:pt,ownerState:St,"aria-pressed":ht},Mt,{children:it}))});function getToggleButtonGroupUtilityClass(s){return generateUtilityClass$1("MuiToggleButtonGroup",s)}const toggleButtonGroupClasses=generateUtilityClasses$1("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),_excluded=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],useUtilityClasses=s=>{const{classes:j,orientation:$,fullWidth:_e,disabled:et}=s,tt={root:["root",$==="vertical"&&"vertical",_e&&"fullWidth"],grouped:["grouped",`grouped${capitalize$1($)}`,et&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return composeClasses(tt,getToggleButtonGroupUtilityClass,j)},ToggleButtonGroupRoot=styled("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[{[`& .${toggleButtonGroupClasses.grouped}`]:j.grouped},{[`& .${toggleButtonGroupClasses.grouped}`]:j[`grouped${capitalize$1($.orientation)}`]},{[`& .${toggleButtonGroupClasses.firstButton}`]:j.firstButton},{[`& .${toggleButtonGroupClasses.lastButton}`]:j.lastButton},{[`& .${toggleButtonGroupClasses.middleButton}`]:j.middleButton},j.root,$.orientation==="vertical"&&j.vertical,$.fullWidth&&j.fullWidth]}})(({ownerState:s,theme:j})=>_extends$2({display:"inline-flex",borderRadius:(j.vars||j).shape.borderRadius},s.orientation==="vertical"&&{flexDirection:"column"},s.fullWidth&&{width:"100%"},{[`& .${toggleButtonGroupClasses.grouped}`]:_extends$2({},s.orientation==="horizontal"?{[`&.${toggleButtonGroupClasses.selected} + .${toggleButtonGroupClasses.grouped}.${toggleButtonGroupClasses.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${toggleButtonGroupClasses.selected} + .${toggleButtonGroupClasses.grouped}.${toggleButtonGroupClasses.selected}`]:{borderTop:0,marginTop:0}})},s.orientation==="horizontal"?{[`& .${toggleButtonGroupClasses.firstButton},& .${toggleButtonGroupClasses.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${toggleButtonGroupClasses.lastButton},& .${toggleButtonGroupClasses.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${toggleButtonGroupClasses.firstButton},& .${toggleButtonGroupClasses.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${toggleButtonGroupClasses.lastButton},& .${toggleButtonGroupClasses.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},s.orientation==="horizontal"?{[`& .${toggleButtonGroupClasses.lastButton}.${toggleButtonClasses.disabled},& .${toggleButtonGroupClasses.middleButton}.${toggleButtonClasses.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${toggleButtonGroupClasses.lastButton}.${toggleButtonClasses.disabled},& .${toggleButtonGroupClasses.middleButton}.${toggleButtonClasses.disabled}`]:{borderTop:"1px solid transparent"}})),ToggleButtonGroup=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiToggleButtonGroup"}),{children:et,className:tt,color:nt="standard",disabled:rt=!1,exclusive:ot=!1,fullWidth:it=!1,onChange:st,orientation:at="horizontal",size:ct="medium",value:lt}=_e,dt=_objectWithoutPropertiesLoose(_e,_excluded),ft=_extends$2({},_e,{disabled:rt,fullWidth:it,orientation:at,size:ct}),gt=useUtilityClasses(ft),ht=reactExports.useCallback((vt,Dt)=>{if(!st)return;const zt=lt&<.indexOf(Dt);let Ot;lt&&zt>=0?(Ot=lt.slice(),Ot.splice(zt,1)):Ot=lt?lt.concat(Dt):[Dt],st(vt,Ot)},[st,lt]),yt=reactExports.useCallback((vt,Dt)=>{st&&st(vt,lt===Dt?null:Dt)},[st,lt]),pt=reactExports.useMemo(()=>({className:gt.grouped,onChange:ot?yt:ht,value:lt,size:ct,fullWidth:it,color:nt,disabled:rt}),[gt.grouped,ot,yt,ht,lt,ct,it,nt,rt]),Mt=getValidReactChildren(et),St=Mt.length,Tt=vt=>{const Dt=vt===0,zt=vt===St-1;return Dt&&zt?"":Dt?gt.firstButton:zt?gt.lastButton:gt.middleButton};return jsxRuntimeExports.jsx(ToggleButtonGroupRoot,_extends$2({role:"group",className:clsx(gt.root,tt),ref:$,ownerState:ft},dt,{children:jsxRuntimeExports.jsx(ToggleButtonGroupContext.Provider,{value:pt,children:Mt.map((vt,Dt)=>jsxRuntimeExports.jsx(ToggleButtonGroupButtonContext.Provider,{value:Tt(Dt),children:vt},Dt))})}))});function isAbsolute(s){return s.charAt(0)==="/"}function spliceOne(s,j){for(var $=j,_e=$+1,et=s.length;_e=0;st--){var at=_e[st];at==="."?spliceOne(_e,st):at===".."?(spliceOne(_e,st),it++):it&&(spliceOne(_e,st),it--)}if(!nt)for(;it--;it)_e.unshift("..");nt&&_e[0]!==""&&(!_e[0]||!isAbsolute(_e[0]))&&_e.unshift("");var ct=_e.join("/");return rt&&ct.substr(-1)!=="/"&&(ct+="/"),ct}var prefix="Invariant failed";function invariant(s,j){throw new Error(prefix)}function addLeadingSlash$1(s){return s.charAt(0)==="/"?s:"/"+s}function stripLeadingSlash(s){return s.charAt(0)==="/"?s.substr(1):s}function hasBasename(s,j){return s.toLowerCase().indexOf(j.toLowerCase())===0&&"/?#".indexOf(s.charAt(j.length))!==-1}function stripBasename$1(s,j){return hasBasename(s,j)?s.substr(j.length):s}function stripTrailingSlash(s){return s.charAt(s.length-1)==="/"?s.slice(0,-1):s}function parsePath(s){var j=s||"/",$="",_e="",et=j.indexOf("#");et!==-1&&(_e=j.substr(et),j=j.substr(0,et));var tt=j.indexOf("?");return tt!==-1&&($=j.substr(tt),j=j.substr(0,tt)),{pathname:j,search:$==="?"?"":$,hash:_e==="#"?"":_e}}function createPath(s){var j=s.pathname,$=s.search,_e=s.hash,et=j||"/";return $&&$!=="?"&&(et+=$.charAt(0)==="?"?$:"?"+$),_e&&_e!=="#"&&(et+=_e.charAt(0)==="#"?_e:"#"+_e),et}function createLocation(s,j,$,_e){var et;typeof s=="string"?(et=parsePath(s),et.state=j):(et=_extends$2({},s),et.pathname===void 0&&(et.pathname=""),et.search?et.search.charAt(0)!=="?"&&(et.search="?"+et.search):et.search="",et.hash?et.hash.charAt(0)!=="#"&&(et.hash="#"+et.hash):et.hash="",j!==void 0&&et.state===void 0&&(et.state=j));try{et.pathname=decodeURI(et.pathname)}catch(tt){throw tt instanceof URIError?new URIError('Pathname "'+et.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):tt}return $&&(et.key=$),_e?et.pathname?et.pathname.charAt(0)!=="/"&&(et.pathname=resolvePathname(et.pathname,_e.pathname)):et.pathname=_e.pathname:et.pathname||(et.pathname="/"),et}function createTransitionManager(){var s=null;function j(nt){return s=nt,function(){s===nt&&(s=null)}}function $(nt,rt,ot,it){if(s!=null){var st=typeof s=="function"?s(nt,rt):s;typeof st=="string"?typeof ot=="function"?ot(st,it):it(!0):it(st!==!1)}else it(!0)}var _e=[];function et(nt){var rt=!0;function ot(){rt&&nt.apply(void 0,arguments)}return _e.push(ot),function(){rt=!1,_e=_e.filter(function(it){return it!==ot})}}function tt(){for(var nt=arguments.length,rt=new Array(nt),ot=0;otmt?xt.splice(mt,xt.length-mt,Ft):xt.push(Ft),st({action:Ot,location:Ft,index:mt,entries:xt})}})}function gt(Dt,zt){var Ot="REPLACE",Ft=createLocation(Dt,zt,at(),vt.location);it.confirmTransitionTo(Ft,Ot,$,function(Pt){Pt&&(vt.entries[vt.index]=Ft,st({action:Ot,location:Ft}))})}function ht(Dt){var zt=clamp(vt.index+Dt,0,vt.entries.length-1),Ot="POP",Ft=vt.entries[zt];it.confirmTransitionTo(Ft,Ot,$,function(Pt){Pt?st({action:Ot,location:Ft,index:zt}):st()})}function yt(){ht(-1)}function pt(){ht(1)}function Mt(Dt){var zt=vt.index+Dt;return zt>=0&&zt"u"&&(forwardRef=forwardRefShim);function isModifiedEvent(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}var LinkAnchor=forwardRef(function(s,j){var $=s.innerRef,_e=s.navigate,et=s.onClick,tt=_objectWithoutPropertiesLoose(s,["innerRef","navigate","onClick"]),nt=tt.target,rt=_extends$2({},tt,{onClick:function(it){try{et&&et(it)}catch(st){throw it.preventDefault(),st}!it.defaultPrevented&&it.button===0&&(!nt||nt==="_self")&&!isModifiedEvent(it)&&(it.preventDefault(),_e())}});return forwardRefShim!==forwardRef?rt.ref=j||$:rt.ref=$,React$1.createElement("a",rt)}),Link=forwardRef(function(s,j){var $=s.component,_e=$===void 0?LinkAnchor:$,et=s.replace,tt=s.to,nt=s.innerRef,rt=_objectWithoutPropertiesLoose(s,["component","replace","to","innerRef"]);return React$1.createElement(context.Consumer,null,function(ot){ot||invariant();var it=ot.history,st=normalizeToLocation(resolveToLocation(tt,ot.location),ot.location),at=st?it.createHref(st):"",ct=_extends$2({},rt,{href:at,navigate:function(){var dt=resolveToLocation(tt,ot.location),ft=createPath(ot.location)===createPath(normalizeToLocation(dt)),gt=et||ft?it.replace:it.push;gt(dt)}});return forwardRefShim!==forwardRef?ct.ref=j||nt:ct.innerRef=nt,React$1.createElement(_e,ct)})}),forwardRefShim$1=function(j){return j},forwardRef$1=React$1.forwardRef;typeof forwardRef$1>"u"&&(forwardRef$1=forwardRefShim$1);function joinClassnames(){for(var s=arguments.length,j=new Array(s),$=0;$s&&(s==="light"||s==="dark"||s==="auto"),isSettings=s=>s&&s.theme&&isTheme(s.theme);let localStorageSettings=null;try{const s=localStorage.getItem(STORAGE_KEY);if(s){const j=JSON.parse(s);isSettings(j)&&(localStorageSettings=j)}}catch{}const initialSettings=localStorageSettings||{theme:"auto"},saveSettings=s=>{try{localStorage.setItem(STORAGE_KEY,JSON.stringify(s))}catch{}},SettingsContext=React$1.createContext({settings:initialSettings,updateBackgroundOpacity:s=>{},updateBackgroundUrl:s=>{},updateTheme:s=>{},updateShowChainName:s=>{},updateShowAllMisses:s=>{},updateShowMonitorDetails:s=>{}}),SettingsContextProvider=({children:s})=>{const[j,$]=reactExports.useState(initialSettings),_e=reactExports.useCallback(st=>{$(at=>({...at,backgroundOpacity:st}))},[]),et=reactExports.useCallback(st=>{$(at=>({...at,backgroundUrl:st}))},[]),tt=reactExports.useCallback(st=>{$(at=>({...at,theme:st}))},[]),nt=reactExports.useCallback(st=>{$(at=>({...at,showChainName:st}))},[]),rt=reactExports.useCallback(st=>{$(at=>({...at,showAllMisses:st}))},[]),ot=reactExports.useCallback(st=>{$(at=>({...at,showMonitorDetails:st}))},[]);reactExports.useEffect(()=>{saveSettings(j)},[j]);const it=reactExports.useMemo(()=>({settings:j,updateBackgroundOpacity:_e,updateBackgroundUrl:et,updateTheme:tt,updateShowChainName:nt,updateShowAllMisses:rt,updateShowMonitorDetails:ot}),[j,_e,et,tt,nt,rt,ot]);return jsxRuntimeExports.jsx(SettingsContext.Provider,{value:it,children:s})},useSettingsContext=()=>reactExports.useContext(SettingsContext),mediaQueryList=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");function CustomThemeProvider({children:s}){const{settings:{theme:j,backgroundOpacity:$,backgroundUrl:_e}}=useSettingsContext(),[et,tt]=reactExports.useState(!!(mediaQueryList&&mediaQueryList.matches)),nt=reactExports.useCallback(it=>{tt(!!it.matches)},[]);reactExports.useEffect(()=>{if(j==="auto")return mediaQueryList.addEventListener("change",nt),()=>{mediaQueryList.removeEventListener("change",nt)}},[j,nt]);const rt=j==="dark"||j==="auto"&&et?"dark":"light",ot=reactExports.useMemo(()=>responsiveFontSizes(createTheme({palette:{mode:rt},components:{MuiCssBaseline:{styleOverrides:{body:{overflowY:"scroll"},"*":{scrollbarWidth:"thin",scrollbarColor:rt==="dark"?`${grey[700]} ${grey[900]}`:`${grey[400]} rgb(255,255,255)`},"*::-webkit-scrollbar":{width:"8px",height:"8px",backgroundColor:rt==="dark"?grey[900]:"rgb(255,255,255)"},"*::-webkit-scrollbar-thumb":{backgroundColor:rt==="dark"?grey[700]:grey[400],borderRadius:"4px"},"*::-webkit-scrollbar-corner":{backgroundColor:"transparent"}}}}})),[rt]);return jsxRuntimeExports.jsxs(ThemeProvider,{theme:ot,children:[s,_e&&jsxRuntimeExports.jsx(Box,{sx:{backgroundImage:`url(${_e})`,backgroundPosition:"center",backgroundSize:"cover",opacity:$||.1,position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:-1}})]})}const ArrowDownward=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z"}),"ArrowDownward"),ArrowUpward=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward"),CheckCircleOutline=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline"),Code=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),ContrastOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 22c5.52 0 10-4.48 10-10S17.52 2 12 2 2 6.48 2 12s4.48 10 10 10m1-17.93c3.94.49 7 3.85 7 7.93s-3.05 7.44-7 7.93z"}),"ContrastOutlined"),DarkModeOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkModeOutlined"),ErrorOutline=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline"),ExpandMore=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),FirstPage=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),GitHub=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub"),GridView=createSvgIcon(jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M3 3v8h8V3zm6 6H5V5h4zm-6 4v8h8v-8zm6 6H5v-4h4zm4-16v8h8V3zm6 6h-4V5h4zm-6 4v8h8v-8zm6 6h-4v-4h4z"}),"GridView"),InfoOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined"),KeyboardArrowDown=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),KeyboardArrowRight=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight"),LastPage=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Launch=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch"),LightModeOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightModeOutlined"),LinkIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),MonitorHeartOutlined=createSvgIcon([jsxRuntimeExports.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v3h2V6h16v3h2V6c0-1.1-.9-2-2-2m0 14H4v-3H2v3c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-3h-2z"},"0"),jsxRuntimeExports.jsx("path",{d:"M14.89 7.55c-.34-.68-1.45-.68-1.79 0L10 13.76l-1.11-2.21A.988.988 0 0 0 8 11H2v2h5.38l1.72 3.45c.18.34.52.55.9.55s.72-.21.89-.55L14 10.24l1.11 2.21c.17.34.51.55.89.55h6v-2h-5.38z"},"1")],"MonitorHeartOutlined"),NavigateBefore=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore"),NavigateNext=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),PlayCircleOutline=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"PlayCircleOutline"),ReceiptLongOutlined=createSvgIcon([jsxRuntimeExports.jsx("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM15 20H6c-.55 0-1-.45-1-1v-1h10zm4-1c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),jsxRuntimeExports.jsx("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLongOutlined"),Search=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),SettingsOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined"),SyncAltOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7.41 13.41 6 12l-4 4 4 4 1.41-1.41L5.83 17H21v-2H5.83zm9.18-2.82L18 12l4-4-4-4-1.41 1.41L18.17 7H3v2h15.17z"}),"SyncAltOutlined"),ViewList=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M3 14h4v-4H3zm0 5h4v-4H3zM3 9h4V5H3zm5 5h13v-4H8zm0 5h13v-4H8zM8 5v4h13V5z"}),"ViewList"),WarningAmberOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 5.99 19.53 19H4.47zM12 2 1 21h22zm1 14h-2v2h2zm0-6h-2v4h2z"}),"WarningAmberOutlined"),networks=["Mainnet","Testnet","Devnet"],isNetwork=s=>networks.includes(s),networks$1=Object.freeze(Object.defineProperty({__proto__:null,isNetwork,networks},Symbol.toStringTag,{value:"Module"})),range=s=>[...Array(s).keys()],elementIndexPairs=s=>range(s.length).map(j=>[s[j],j]),entries=s=>range(s.length).map(j=>[j,s[j]]),column=(s,j)=>s.map($=>$[j]),zip=s=>range(s[0].length).map(j=>range(s.length).map($=>s[$][j]));function isMappableKey(s){return["string","number","symbol","bigint","boolean"].includes(typeof s)}const isRecursiveTuple=s=>s.length===2&&!Array.isArray(s[0])&&Array.isArray(s[1]),cartesianRightRecursive=s=>s.length===0?[]:Array.isArray(s[0])?s.map(([j,$])=>Array.isArray($)?(isRecursiveTuple($)?cartesianRightRecursive($):$).map(_e=>[j,_e].flat()):[[j,$]]).flat():isRecursiveTuple(s)?cartesianRightRecursive(s[1]).map(j=>[s[0],j]):s,toMapping=(s,j)=>{const $=cartesianRightRecursive(s);if($.length===0)throw new Error("Invalid mapping: empty");const _e=j===void 0?[range($[0].length-1),[$[0].length-1]]:j.map(ct=>typeof ct=="number"?[ct]:ct);let et=[],tt=!0;const nt=(ct,lt)=>{const dt=Array.from(new Set(ct[0]).values()),ft=new Map(dt.map(ht=>[ht,[]]));for(const[ht,yt]of ct[0].entries())ft.get(yt).push(ht);if(ct.length===1){const ht=Object.fromEntries(dt.map(yt=>[yt,ft.get(yt).map(pt=>lt[pt].length===1?lt[pt][0]:lt[pt])]));if(tt){for(const yt of ft.values())if(yt.length>1)return tt=!1,ht;et.push(ht)}return ht}const gt=zip(ct.slice(1));return Object.fromEntries(dt.map(ht=>{const yt=ft.get(ht),pt=zip(yt.map(St=>gt[St])),Mt=yt.map(St=>lt[St]);return[ht,nt(pt,Mt)]}))},rt=zip($),ot=ct=>{const lt=rt[ct];if(lt===void 0)throw new Error(`Invalid shape: column ${ct} does not exist`);return lt},[it,st]=_e.map(ct=>ct.map(lt=>ot(lt)));if(it.length===0)throw new Error("Invalid shape: empty key set");if(st.length===0)throw new Error("Invalid shape: empty value set");for(const ct of it)for(const lt of ct)if(!isMappableKey(lt))throw new Error(`Invalid key: ${lt} in ${ct}`);const at=nt(it,zip(st));if(tt)for(const ct of et)for(const lt of Object.keys(ct))ct[lt]=ct[lt][0];return at};function constMap(s,j){const $=toMapping(s,j),_e=(...et)=>et.reduce((tt,nt)=>tt?tt[nt.toString()]??void 0:void 0,$);return Object.assign(_e,{has:(...et)=>_e(...et)!==void 0,get:(...et)=>_e(...et),subMap:et=>$[et.toString()]})}function lazyInstantiate$1(s){let j=null;return()=>(j||(j=s()),j)}function onlyOnce$1(s,...j){let $=!1;return()=>{$||($=!0,s(...j))}}function throws$1(s){try{return s(),!1}catch{return!0}}const binaryLiterals=["int","uint","bytes","array","switch"],defaultEndianness="big",numberMaxSize=6,isNumType=s=>typeof s=="number"||typeof s=="bigint",isBytesType=s=>s instanceof Uint8Array,isPrimitiveType=s=>isNumType(s)||isBytesType(s),isLayoutItem=s=>binaryLiterals.includes(s==null?void 0:s.binary),isLayout=s=>isLayoutItem(s)||Array.isArray(s)&&s.every(isLayoutItem),isFixedNumberConversion=s=>typeof(s==null?void 0:s.from)=="number",isFixedBigintConversion=s=>typeof(s==null?void 0:s.from)=="bigint",isFixedUintConversion=s=>isFixedNumberConversion(s)||isFixedBigintConversion(s),isFixedBytesConversion=s=>isBytesType(s==null?void 0:s.from),isFixedPrimitiveConversion=s=>isFixedUintConversion(s)||isFixedBytesConversion(s),customizableBytes=(s,j)=>({...s,binary:"bytes",...j===void 0?{}:isLayout(j)?{layout:j}:j instanceof Uint8Array||isFixedBytesConversion(j)||!Array.isArray(j)?{custom:j}:{layout:j[0],custom:j[1]}}),checkSize=(s,j)=>{if(s!==j)throw new Error(`size mismatch: layout size: ${s}, data size: ${j}`);return j},checkItemSize=(s,j)=>"size"in s&&s.size!==void 0?checkSize(s.size,j):j,checkNumEquals=(s,j)=>{if(s!=j)throw new Error(`value mismatch: (constant) layout value: ${s}, data value: ${j}`)},checkBytesTypeEqual=(s,j,$)=>{const _e=(it,st)=>st===void 0?[0,it.length]:Array.isArray(st)?st:[st,it.length],[et,tt]=_e(s,$==null?void 0:$.customSlice),[nt,rt]=_e(j,$==null?void 0:$.dataSlize),ot=tt-et;checkSize(ot,rt-nt);for(let it=0;it(Array.isArray(_e)?_e[1]:_e)==$)}function calcItemSize$1(s,j){switch(s.binary){case"int":case"uint":return s.size;case"bytes":{const $="lengthSize"in s?s.lengthSize|0:0;if("layout"in s){const{custom:et}=s,tt=internalCalcLayoutSize$1(s.layout,et===void 0?j:typeof et.from=="function"?et.from(j):et.from);return tt===null?"size"in s?s.size??null:null:$+checkItemSize(s,tt)}const{custom:_e}=s;return isBytesType(_e)?$+_e.length:isFixedBytesConversion(_e)?$+_e.from.length:_e===void 0?j?$+checkItemSize(s,j.length):null:j!==void 0?$+checkItemSize(s,_e.from(j).length):null}case"array":{const $="length"in s?s.length:void 0;if(j===void 0){if($!==void 0){const et=internalCalcLayoutSize$1(s.layout);return et===null?null:$*et}return null}let _e=0;if($!==void 0&&$!==j.length)throw new Error(`array length mismatch: layout length: ${$}, data length: ${j.length}`);"lengthSize"in s&&s.lengthSize!==void 0&&(_e+=s.lengthSize);for(let et=0;et{s.bytes.set(j,s.offset),s.offset+=j.length};function serializeLayout$1(s,j,$,_e=0){const et={bytes:$??new Uint8Array(calcLayoutSize$1(s,j)),offset:_e};if(internalSerializeLayout$1(s,j,et),!$&&et.offset!==et.bytes.length)throw new Error(`encoded data is shorter than expected: ${et.bytes.length} > ${et.offset}`);return $?et.offset:et.bytes}const maxAllowedNumberVal$1=2**(numberMaxSize*8);function serializeNum$1(s,j,$,_e=defaultEndianness,et=!1){if(!et&&s<0)throw new Error(`Value ${s} is negative but unsigned`);if(typeof s=="number"){if(!Number.isInteger(s))throw new Error(`Value ${s} is not an integer`);if(j>numberMaxSize){if(s>=maxAllowedNumberVal$1)throw new Error(`Value ${s} is too large to be safely converted into an integer`);if(et&&s<=-maxAllowedNumberVal$1)throw new Error(`Value ${s} is too small to be safely converted into an integer`)}}const tt=2n**BigInt(j*8);if(s>=tt)throw new Error(`Value ${s} is too large for ${j} bytes`);if(et&&s<-tt)throw new Error(`Value ${s} is too small for ${j} bytes`);for(let nt=0;nt>BigInt(8*(_e==="big"?j-nt-1:nt))&0xffn);$.offset+=j}function internalSerializeLayout$1(s,j,$){if(isLayoutItem(s))serializeLayoutItem$1(s,j,$);else for(const _e of s)try{serializeLayoutItem$1(_e,j[_e.name],$)}catch(et){throw et.message=`when serializing item '${_e.name}': ${et.message}`,et}}function serializeLayoutItem$1(s,j,$){switch(s.binary){case"int":case"uint":{const _e=(()=>{var et;return isNumType(s.custom)?("omit"in s&&s.omit||checkNumEquals(s.custom,j),s.custom):isNumType((et=s==null?void 0:s.custom)==null?void 0:et.from)?s.custom.from:s.custom!==void 0?s.custom.from(j):j})();serializeNum$1(_e,s.size,$,s.endianness,s.binary==="int");break}case"bytes":{const _e=$.offset;if("lengthSize"in s&&s.lengthSize!==void 0&&($.offset+=s.lengthSize),"layout"in s){const{custom:et}=s;let tt;et===void 0?tt=j:typeof et.from!="function"?tt=et.from:tt=et.from(j),internalSerializeLayout$1(s.layout,tt,$)}else{const{custom:et}=s;isBytesType(et)?("omit"in s&&s.omit||checkBytesTypeEqual(et,j),cursorWrite$1($,et)):isFixedBytesConversion(et)?cursorWrite$1($,et.from):cursorWrite$1($,et!==void 0?et.from(j):j)}if("lengthSize"in s&&s.lengthSize!==void 0){const et=$.offset-_e-s.lengthSize,tt=$.offset;$.offset=_e,serializeNum$1(et,s.lengthSize,$,s.lengthEndianness),$.offset=tt}else checkItemSize(s,$.offset-_e);break}case"array":{if("length"in s&&s.length!==j.length)throw new Error(`array length mismatch: layout length: ${s.length}, data length: ${j.length}`);"lengthSize"in s&&s.lengthSize!==void 0&&serializeNum$1(j.length,s.lengthSize,$,s.lengthEndianness);for(let _e=0;_e ${_e.offset}`);return($==null?void 0:$.consumeAll)??!0?et:[et,_e.offset]}function updateOffset$1(s,j){const $=s.offset+j;if($>s.end)throw new Error(`chunk is shorter than expected: ${s.end} < ${$}`);s.offset=$}function internalDeserializeLayout$1(s,j){if(!Array.isArray(s))return deserializeLayoutItem$1(s,j);let $={};for(const _e of s)try{(_e.omit?{}:$)[_e.name]=deserializeLayoutItem$1(_e,j)}catch(et){throw et.message=`when deserializing item '${_e.name}': ${et.message}`,et}return $}function deserializeNum$1(s,j,$=defaultEndianness,_e=!1){let et=0n;for(let tt=0;ttnumberMaxSize?et:Number(et)}function deserializeLayoutItem$1(s,j){switch(s.binary){case"int":case"uint":{const $=deserializeNum$1(j,s.size,s.endianness,s.binary==="int"),{custom:_e}=s;return isNumType(_e)?(checkNumEquals(_e,$),_e):isNumType(_e==null?void 0:_e.from)?(checkNumEquals(_e.from,$),_e.to):_e!==void 0?_e.to($):$}case"bytes":{const $="lengthSize"in s&&s.lengthSize!==void 0?deserializeNum$1(j,s.lengthSize,s.lengthEndianness):s==null?void 0:s.size;if("layout"in s){const{custom:rt}=s,ot=j.offset;let it;if($===void 0)it=internalDeserializeLayout$1(s.layout,j);else{const st={...j,end:j.offset+$};if(updateOffset$1(j,$),it=internalDeserializeLayout$1(s.layout,st),st.offset!==st.end)throw new Error(`read less data than expected: ${st.offset-j.offset} < ${$}`)}return rt!==void 0?typeof rt.from!="function"?(checkBytesTypeEqual(getCachedSerializedFrom$1(s),j.bytes,{dataSlize:[ot,j.offset]}),rt.to):rt.to(it):it}const{custom:_e}=s;{let rt,ot;if(isBytesType(_e)?rt=_e:isFixedBytesConversion(_e)&&(rt=_e.from,ot=_e.to),rt!==void 0){const it=$??rt.length,st=j.bytes.slice(j.offset,j.offset+it);return checkBytesTypeEqual(rt,st),updateOffset$1(j,it),ot??rt}}const et=j.offset,tt=$!==void 0?j.offset+$:j.end;updateOffset$1(j,tt-et);const nt=j.bytes.slice(et,tt);return _e!==void 0?_e.to(nt):nt}case"array":{let $=[];const{layout:_e}=s,et=()=>{const nt=internalDeserializeLayout$1(_e,j);$.push(nt)};let tt=null;if("length"in s&&s.length!==void 0?tt=s.length:"lengthSize"in s&&s.lengthSize!==void 0&&(tt=deserializeNum$1(j,s.lengthSize,s.lengthEndianness)),tt!==null)for(let nt=0;ntet?it===$:it[0]===$);if(tt===void 0)throw new Error(`unknown id value: ${$}`);const[nt,rt]=tt,ot=internalDeserializeLayout$1(rt,j);return{[s.idTag??"id"]:et?$:nt[1],...ot}}}}function filterItem$1(s,j){switch(s.binary){case"bytes":if("layout"in s){const{custom:$}=s;if($===void 0){const{layout:et}=s;if(isLayoutItem(et))return filterItem$1(et,j);const tt=internalFilterItemsOfProperLayout$1(et,j);return tt.length>0?{...s,layout:tt}:null}const _e=typeof $.from!="function";return j&&_e||!j&&!_e?s:null}case"int":case"uint":{const{custom:$}=s,_e=isPrimitiveType($)||isFixedPrimitiveConversion($);return j&&_e||!j&&!_e?s:null}case"array":{const $=internalFilterItemsOfLayout$1(s.layout,j);return $!==null?{...s,layout:$}:null}case"switch":{const $=s.layouts.reduce((_e,[et,tt])=>{const nt=internalFilterItemsOfProperLayout$1(tt,j);return nt.length>0?[..._e,[et,nt]]:_e},[]);return{...s,layouts:$}}}}function internalFilterItemsOfProperLayout$1(s,j){return s.reduce(($,_e)=>{const et=filterItem$1(_e,j);return et!==null?[...$,et]:$},[])}function internalFilterItemsOfLayout$1(s,j){return Array.isArray(s)?internalFilterItemsOfProperLayout$1(s,j):filterItem$1(s,j)}function filterItemsOfLayout$1(s,j){return internalFilterItemsOfLayout$1(s,j)}const fixedItemsOfLayout$1=s=>filterItemsOfLayout$1(s,!0),dynamicItemsOfLayout$1=s=>filterItemsOfLayout$1(s,!1);function internalAddFixedValuesItem$1(s,j){switch(s.binary){case"bytes":if("layout"in s){const{custom:$}=s;return $===void 0||typeof $.from!="function"?internalAddFixedValues$1(s.layout,$?$.from:j):j}case"int":case"uint":{const{custom:$}=s;return s!=null&&s.omit?void 0:isPrimitiveType($)?$:isFixedPrimitiveConversion($)?$.to:j}case"array":return Array.isArray(j)?j.map($=>internalAddFixedValues$1(s.layout,$)):void 0;case"switch":{const $=j[s.idTag??"id"],[_e,et]=s.layouts.find(([tt])=>(Array.isArray(tt)?tt[1]:tt)==$);return{[s.idTag??"id"]:$,...internalAddFixedValues$1(et,j)}}}}function internalAddFixedValues$1(s,j){if(j=j??{},isLayoutItem(s))return internalAddFixedValuesItem$1(s,j);const $={};for(const _e of s){const et=internalAddFixedValuesItem$1(_e,j[_e.name]??{});et!==void 0&&($[_e.name]=et)}return $}function addFixedValues$1(s,j){return internalAddFixedValues$1(s,j)}function arrayToBitset$1(s){return s.reduce((j,$)=>j|BigInt(1)<0n;s>>=1n,++$)s&1n&&j.push(Number($));return j}function count$2(s){let j=0;for(;s>0n;s>>=1n)j+=Number(s&1n);return j}const lengthSizeMax$1=s=>s>0?2**(8*s)-1:1/0;function layoutItemMeta$1(s,j,$){var _e;switch(s.binary){case"int":case"uint":{const et=isNumType(s.custom)?s.custom:isNumType((_e=s==null?void 0:s.custom)==null?void 0:_e.from)?s.custom.from:null;if(et!==null&&j!==null){const tt={bytes:new Uint8Array(s.size),offset:0};serializeNum$1(et,s.size,tt,s.endianness,s.binary==="int"),$.push([j,tt.bytes])}return[s.size,s.size]}case"bytes":{const et="lengthSize"in s?s.lengthSize|0:0;let tt,nt;if("layout"in s){const{custom:ot}=s;if(ot!==void 0&&typeof ot.from!="function")tt=getCachedSerializedFrom$1(s),nt=tt.length;else{const it=calcStaticLayoutSize$1(s.layout);it!==null&&(nt=it)}}else{const{custom:ot}=s;isBytesType(ot)?(tt=ot,nt=ot.length):isFixedBytesConversion(ot)&&(tt=ot.from,nt=ot.from.length)}if(et>0&&j!==null){if(nt!==void 0){const ot={bytes:new Uint8Array(et),offset:0},it=s.lengthEndianness;serializeNum$1(nt,et,ot,it,!1),$.push([j,ot.bytes])}j+=et}if(tt!==void 0)return j!==null&&$.push([j,tt]),[et+tt.length,et+tt.length];const rt="size"in s&&s.size!==void 0?[s.size,s.size]:void 0;if("layout"in s){const ot=createLayoutMeta$1(s.layout,j,$);return rt??[et+ot[0],et+ot[1]]}return rt??[et,lengthSizeMax$1(et)]}case"array":{if("length"in s){let tt=[];const nt=createLayoutMeta$1(s.layout,0,tt);if(j!==null)if(nt[0]!==nt[1]){if(s.length>0)for(const[rt,ot]of tt)$.push([j+rt,ot])}else for(let rt=0;rt[]),{idSize:tt,idEndianness:nt}=s,rt=s.layouts.map(([ot,it],st)=>{const at=Array.isArray(ot)?ot[0]:ot;if(j!==null){const lt={bytes:new Uint8Array(tt),offset:0};serializeNum$1(at,tt,lt,nt),et[st].push([0,lt.bytes])}const ct=createLayoutMeta$1(it,j!==null?tt:null,et[st]);return[ct[0]+tt,ct[1]+tt]});return j!==null&&et.every(ot=>ot.length>0)&&(()=>{const ot=Math.min(...et.map(st=>st.at(-1)[0]+st.at(-1)[1].length)),it=et.map(st=>0);for(let st=0;stot)),Math.max(...rt.map(([ot,it])=>it))]}}}function createLayoutMeta$1(s,j,$){if(!Array.isArray(s))return layoutItemMeta$1(s,j,$);let _e=[0,0];for(const et of s){const tt=layoutItemMeta$1(et,j,$);_e[0]+=tt[0],_e[1]+=tt[1],j!==null&&(j=tt[0]===tt[1]?j+tt[0]:null)}return _e}function buildAscendingBounds$1(s){const j=new Map;let $=[];const _e=et=>{for(;$.length>0&&$[0][0]tt<=rt);nt===-1?$=[]:$.splice(0,nt),j.set(tt,arrayToBitset$1($.map(([,rt])=>rt)))}};for(const[[et,tt],nt]of s){_e(et);const rt=$.findIndex(([ot])=>ot>tt);rt===-1?$.push([tt,nt]):$.splice(rt,0,[tt,nt]),j.set(et,arrayToBitset$1($.map(([,ot])=>ot)))}return _e(1/0),j}function generateLayoutDiscriminator$1(s){if(s.length===0)throw new Error("Cannot discriminate empty set of layouts");const j=0n,$=(1n<[]),et=s.map((pt,Mt)=>createLayoutMeta$1(pt,0,_e[Mt])),tt=et.map((pt,Mt)=>[pt,Mt]).sort(([[pt]],[[Mt]])=>pt-Mt),nt=(()=>{let pt=$;const Mt=new Map;for(const[[St],Tt]of tt)pt^=1n<count$2(pt))),it=pt=>{let Mt=$;for(const[St,Tt]of nt){if(pt{let Mt=j;for(const[St,Tt]of rt){if(ptpt.length>0?pt.at(-1)[0]+pt.at(-1)[1].length:0))}).map(()=>[]);for(let pt=0;pt<_e.length;++pt)for(const[Mt,St]of _e[pt])for(let Tt=0;TtOt)),vt=$^St,Dt=new Map;for(const[Ot,Ft]of Mt)Dt.has(Ot)||Dt.set(Ot,j),Dt.set(Ot,Dt.get(Ot)|1n<bitsetToArray$1(Ot.length<=pt?vt:Dt.get(Ot[pt])??j)];ct.push([zt,pt,vt,Dt,Tt])}}if(ot===s.length-1)return[!0,pt=>bitsetToArray$1(st(pt.length))];ct.sort(([pt],[Mt])=>Mt-pt);let lt=!0;const dt=new Map,ft=new Map,gt=(pt,Mt)=>{dt.set(pt,Mt),ft.has(count$2(pt))||ft.set(count$2(pt),[]),ft.get(count$2(pt)).push(pt)},ht=(pt,Mt)=>{if(count$2(pt)<=1||dt.has(pt))return;let St=0;const Tt=new Map;for(const Dt of bitsetToArray$1(pt)){const zt=et[Dt][0],Ot=rt.get(zt)&pt;Tt.set(zt,Ot),St=Math.max(St,count$2(Ot))}St=count$2(pt)-St;const vt=[];for(const[Dt,zt,Ot,Ft,Pt]of Mt){const Lt=new Map;let mt=0;for(const[jt,At]of Ft){const wt=At&pt;count$2(wt)>0&&(Lt.set(jt,wt),mt+=count$2(wt))}const xt=Ot&pt;let It=Lt.size>0?Dt:0;for(const jt of Lt.values()){const At=mt-count$2(jt)+count$2(xt);It=Math.min(It,At)}if(It!==0){if(It===count$2(pt)-1){gt(pt,[zt,xt,Lt]);return}vt.push([It,zt,xt,Lt,Pt&pt])}}if(St===count$2(pt)-1){gt(pt,"size");return}if(vt.sort(([Dt],[zt])=>zt-Dt),vt.length>0&&vt[0][0]>=St){const[,Dt,zt,Ot,Ft]=vt[0];gt(pt,[Dt,zt,Ot]),ht(zt,vt);for(const Pt of Ot.values())ht(Pt|Ft,vt.slice(1));return}if(St>0){gt(pt,"size");for(const Dt of Tt.values())ht(Dt,vt);return}gt(pt,"indistinguishable"),lt=!1};ht($,ct);const yt=pt=>{for(let Mt=count$2(pt)+1;Mt{let Mt=$,St=dt.get(Mt);for(;St!=="indistinguishable";){if(St==="size")Mt&=st(pt.length);else{const[Tt,vt,Dt]=St;if(pt.length<=Tt)Mt&=vt;else{const zt=pt[Tt];for(const[Ot,Ft]of Dt)Ot!==zt&&(Mt^=Mt&Ft);Mt^=Mt&vt}}if(count$2(Mt)<=1)break;St=dt.get(Mt)??yt(Mt)}return bitsetToArray$1(Mt)}]}function layoutDiscriminator$1(s,j){const[$,_e]=generateLayoutDiscriminator$1(s);if(!$&&!j)throw new Error("Cannot uniquely distinguished the given layouts");return j?_e:et=>{const tt=_e(et);return tt.length===0?null:tt[0]}}function enumItem$1(s,j){const $=Object.fromEntries(s.map(([et,tt])=>[tt,et])),_e=Object.fromEntries(s);return{binary:"uint",size:(j==null?void 0:j.size)??1,endianness:(j==null?void 0:j.endianness)??"big",custom:{to:et=>{const tt=$[et];if(tt===void 0)throw new Error(`Invalid enum value: ${et}`);return tt},from:et=>_e[et]}}}const baseOptionItem$1=s=>({binary:"switch",idSize:1,idTag:"isSome",layouts:[[[0,!1],[]],[[1,!0],[customizableBytes({name:"value"},s)]]]});function optionItem$1(s){return{binary:"bytes",layout:baseOptionItem$1(s),custom:{to:j=>j.isSome===!0?j.value:void 0,from:j=>j===void 0?{isSome:!1}:{isSome:!0,value:j}}}}function bitsetItem$1(s,j){return{binary:"uint",size:j??Math.ceil(s.length/8),custom:{to:$=>{const _e={};for(let et=0;et{let _e=0n;for(let et=0;etnumberMaxSize?_e:Number(_e)}}}}const index$1=Object.freeze(Object.defineProperty({__proto__:null,addFixedValues:addFixedValues$1,binaryLiterals,bitsetItem:bitsetItem$1,calcLayoutSize:calcLayoutSize$1,calcStaticLayoutSize:calcStaticLayoutSize$1,checkBytesTypeEqual,checkItemSize,checkNumEquals,checkSize,customizableBytes,defaultEndianness,deserializeLayout:deserializeLayout$1,dynamicItemsOfLayout:dynamicItemsOfLayout$1,enumItem:enumItem$1,findIdLayoutPair,fixedItemsOfLayout:fixedItemsOfLayout$1,getCachedSerializedFrom:getCachedSerializedFrom$1,isBytesType,isFixedBytesConversion,isFixedPrimitiveConversion,isFixedUintConversion,isLayout,isLayoutItem,isNumType,isPrimitiveType,layoutDiscriminator:layoutDiscriminator$1,numberMaxSize,optionItem:optionItem$1,serializeLayout:serializeLayout$1,serializeNum:serializeNum$1},Symbol.toStringTag,{value:"Module"}));function denoise$1(s,j){return Number(Number(s).toFixed(j))}function parse$2(s,j){if(validateAmountInput$1(s,j),s=s.toString(),s.includes("e"))throw new Error("Scientific notation is not supported yet by Amount");const $=s.split(".");if($.length>2)throw"Too many decimals";let[_e,et]=$.length===0?["0",""]:$.length===1?[$[0],""]:$;if(et=et.padEnd(j,"0"),et.length>j){if(BigInt(et.substring(j))!==0n)throw new Error("Amount: invalid input. Decimals too low.");et=et.substring(0,j)}return{amount:BigInt(_e+et).toString(),decimals:j}}function truncate$1(s,j){if(s.decimals<=j)return s;const $=BigInt(s.decimals-j);return{amount:(units$1(s)/10n**$*10n**$).toString(),decimals:s.decimals}}function scale$1(s,j){if(s.decimals===j)return s;if(s.amount==="0")return{amount:s.amount,decimals:j};const $=j-s.decimals;if($>0)return{amount:s.amount+"0".repeat($),decimals:j};if(BigInt(s.amount.substring(s.amount.length+$))===0n)return{amount:s.amount.substring(0,s.amount.length+$),decimals:j};throw new Error(`scaleAmount(${JSON.stringify(s)}, ${j}) would result in altered amount. Use truncateAmount first if you intended to truncate it.`)}function fromBaseUnits$1(s,j){return{amount:s.toString(),decimals:j}}function units$1(s){return validateAmount$1(s),BigInt(s.amount)}function display$1(s,j){validateAmount$1(s);let $=s.amount.substring(0,s.amount.length-s.decimals).padStart(1,"0"),_e=s.amount.substring(s.amount.length-s.decimals).padStart(s.decimals,"0");if(j!==void 0){for(;_e.length>j&&_e[_e.length-1]==="0";)_e=_e.substring(0,_e.length-1);_e=_e.padEnd(j,"0")}return _e.length>0?`${$}.${_e}`:$}function whole$1(s){return Number(display$1(s))}function fmt$1(s,j){return display$1(fromBaseUnits$1(s,j))}function validateAmountInput$1(s,j){if(typeof s=="number"){if(!isFinite(s))throw new Error("Amount: invalid input. Amount must be finite");if(s<0)throw new Error("Amount: invalid input. Amount cannot be negative")}else if(!/^[0-9\.]*$/.test(s))throw new Error("Amount: invalid input. Must only contain digits.");if(!isFinite(j))throw new Error("Amount: invalid input. Decimals must be finite")}function validateAmount$1(s){if(!/^[0-9]*$/.test(s.amount))throw new Error("Amount: invalid input. Must only contain digits.");if(s.decimals<0)throw new Error("Amount: invalid input. Decimals must be >= 0");if(!isFinite(s.decimals))throw new Error("Amount: invalid input. Decimals must be a finite number.")}const amount$2=Object.freeze(Object.defineProperty({__proto__:null,denoise:denoise$1,display:display$1,fmt:fmt$1,fromBaseUnits:fromBaseUnits$1,parse:parse$2,scale:scale$1,truncate:truncate$1,units:units$1,whole:whole$1},Symbol.toStringTag,{value:"Module"}));/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function assertNumber(s){if(!Number.isSafeInteger(s))throw new Error(`Wrong integer: ${s}`)}function isBytes$3(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function chain$2(...s){const j=tt=>tt,$=(tt,nt)=>rt=>tt(nt(rt)),_e=s.map(tt=>tt.encode).reduceRight($,j),et=s.map(tt=>tt.decode).reduce($,j);return{encode:_e,decode:et}}function alphabet(s){return{encode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return j.map($=>{if($<0||$>=s.length)throw new Error(`Digit index outside alphabet: ${$} (alphabet: ${s.length})`);return s[$]})},decode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="string")throw new Error("alphabet.decode input should be array of strings");return j.map($=>{if(typeof $!="string")throw new Error(`alphabet.decode: not string element=${$}`);const _e=s.indexOf($);if(_e===-1)throw new Error(`Unknown letter: "${$}". Allowed: ${s}`);return _e})}}}function join(s=""){if(typeof s!="string")throw new Error("join separator should be string");return{encode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="string")throw new Error("join.encode input should be array of strings");for(let $ of j)if(typeof $!="string")throw new Error(`join.encode: non-string input=${$}`);return j.join(s)},decode:j=>{if(typeof j!="string")throw new Error("join.decode input should be string");return j.split(s)}}}function padding(s,j="="){if(typeof j!="string")throw new Error("padding chr should be string");return{encode($){if(!Array.isArray($)||$.length&&typeof $[0]!="string")throw new Error("padding.encode input should be array of strings");for(let _e of $)if(typeof _e!="string")throw new Error(`padding.encode: non-string input=${_e}`);for(;$.length*s%8;)$.push(j);return $},decode($){if(!Array.isArray($)||$.length&&typeof $[0]!="string")throw new Error("padding.encode input should be array of strings");for(let et of $)if(typeof et!="string")throw new Error(`padding.decode: non-string input=${et}`);let _e=$.length;if(_e*s%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;_e>0&&$[_e-1]===j;_e--)if(!((_e-1)*s%8))throw new Error("Invalid padding: string has too much padding");return $.slice(0,_e)}}}function normalize(s){if(typeof s!="function")throw new Error("normalize fn should be function");return{encode:j=>j,decode:j=>s(j)}}function convertRadix(s,j,$){if(j<2)throw new Error(`convertRadix: wrong from=${j}, base cannot be less than 2`);if($<2)throw new Error(`convertRadix: wrong to=${$}, base cannot be less than 2`);if(!Array.isArray(s))throw new Error("convertRadix: data should be array");if(!s.length)return[];let _e=0;const et=[],tt=Array.from(s);for(tt.forEach(nt=>{if(nt<0||nt>=j)throw new Error(`Wrong integer: ${nt}`)});;){let nt=0,rt=!0;for(let ot=_e;otj?gcd(j,s%j):s,radix2carry=(s,j)=>s+(j-gcd(s,j));function convertRadix2(s,j,$,_e){if(!Array.isArray(s))throw new Error("convertRadix2: data should be array");if(j<=0||j>32)throw new Error(`convertRadix2: wrong from=${j}`);if($<=0||$>32)throw new Error(`convertRadix2: wrong to=${$}`);if(radix2carry(j,$)>32)throw new Error(`convertRadix2: carry overflow from=${j} to=${$} carryBits=${radix2carry(j,$)}`);let et=0,tt=0;const nt=2**$-1,rt=[];for(const ot of s){if(ot>=2**j)throw new Error(`convertRadix2: invalid data word=${ot} from=${j}`);if(et=et<32)throw new Error(`convertRadix2: carry overflow pos=${tt} from=${j}`);for(tt+=j;tt>=$;tt-=$)rt.push((et>>tt-$&nt)>>>0);et&=2**tt-1}if(et=et<<$-tt&nt,!_e&&tt>=j)throw new Error("Excess padding");if(!_e&&et)throw new Error(`Non-zero padding: ${et}`);return _e&&tt>0&&rt.push(et>>>0),rt}function radix(s){return{encode:j=>{if(!isBytes$3(j))throw new Error("radix.encode input should be Uint8Array");return convertRadix(Array.from(j),2**8,s)},decode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(convertRadix(j,s,2**8))}}}function radix2(s,j=!1){if(s<=0||s>32)throw new Error("radix2: bits should be in (0..32]");if(radix2carry(8,s)>32||radix2carry(s,8)>32)throw new Error("radix2: carry overflow");return{encode:$=>{if(!isBytes$3($))throw new Error("radix2.encode input should be Uint8Array");return convertRadix2(Array.from($),8,s,!j)},decode:$=>{if(!Array.isArray($)||$.length&&typeof $[0]!="number")throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(convertRadix2($,s,8,j))}}}function unsafeWrapper(s){if(typeof s!="function")throw new Error("unsafeWrapper fn should be function");return function(...j){try{return s.apply(null,j)}catch{}}}function checksum(s,j){if(typeof j!="function")throw new Error("checksum fn should be function");return{encode($){if(!isBytes$3($))throw new Error("checksum.encode: input should be Uint8Array");const _e=j($).slice(0,s),et=new Uint8Array($.length+s);return et.set($),et.set(_e,$.length),et},decode($){if(!isBytes$3($))throw new Error("checksum.decode: input should be Uint8Array");const _e=$.slice(0,-s),et=j(_e).slice(0,s),tt=$.slice(-s);for(let nt=0;nts.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),base64$2=chain$2(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),padding(6),join("")),base64nopad=chain$2(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),join("")),base64url=chain$2(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),padding(6),join("")),base64urlnopad=chain$2(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),join("")),genBase58=s=>chain$2(radix(58),alphabet(s),join("")),base58$1=genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),base58flickr=genBase58("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),base58xrp=genBase58("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),XMR_BLOCK_LEN=[0,2,3,5,6,7,9,10,11],base58xmr={encode(s){let j="";for(let $=0;$chain$2(checksum(4,j=>s(s(j))),base58$1),base58check=createBase58check,BECH_ALPHABET=chain$2(alphabet("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),join("")),POLYMOD_GENERATORS=[996825010,642813549,513874426,1027748829,705979059];function bech32Polymod(s){const j=s>>25;let $=(s&33554431)<<5;for(let _e=0;_e>_e&1)===1&&($^=POLYMOD_GENERATORS[_e]);return $}function bechChecksum(s,j,$=1){const _e=s.length;let et=1;for(let tt=0;tt<_e;tt++){const nt=s.charCodeAt(tt);if(nt<33||nt>126)throw new Error(`Invalid prefix (${s})`);et=bech32Polymod(et)^nt>>5}et=bech32Polymod(et);for(let tt=0;tt<_e;tt++)et=bech32Polymod(et)^s.charCodeAt(tt)&31;for(let tt of j)et=bech32Polymod(et)^tt;for(let tt=0;tt<6;tt++)et=bech32Polymod(et);return et^=$,BECH_ALPHABET.encode(convertRadix2([et%2**30],30,5,!1))}function genBech32(s){const j=s==="bech32"?1:734539939,$=radix2(5),_e=$.decode,et=$.encode,tt=unsafeWrapper(_e);function nt(st,at,ct=90){if(typeof st!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof st}`);if(!Array.isArray(at)||at.length&&typeof at[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof at}`);if(st.length===0)throw new TypeError(`Invalid prefix length ${st.length}`);const lt=st.length+7+at.length;if(ct!==!1&<>ct)throw new TypeError(`Length ${lt} exceeds limit ${ct}`);const dt=st.toLowerCase(),ft=bechChecksum(dt,at,j);return`${dt}1${BECH_ALPHABET.encode(at)}${ft}`}function rt(st,at=90){if(typeof st!="string")throw new Error(`bech32.decode input should be string, not ${typeof st}`);if(st.length<8||at!==!1&&st.length>at)throw new TypeError(`Wrong string length: ${st.length} (${st}). Expected (8..${at})`);const ct=st.toLowerCase();if(st!==ct&&st!==st.toUpperCase())throw new Error("String must be lowercase or uppercase");const lt=ct.lastIndexOf("1");if(lt===0||lt===-1)throw new Error('Letter "1" must be present between prefix and data only');const dt=ct.slice(0,lt),ft=ct.slice(lt+1);if(ft.length<6)throw new Error("Data must be at least 6 characters long");const gt=BECH_ALPHABET.decode(ft).slice(0,-6),ht=bechChecksum(dt,gt,j);if(!ft.endsWith(ht))throw new Error(`Invalid checksum in ${st}: expected "${ht}"`);return{prefix:dt,words:gt}}const ot=unsafeWrapper(rt);function it(st){const{prefix:at,words:ct}=rt(st,!1);return{prefix:at,words:ct,bytes:_e(ct)}}return{encode:nt,decode:rt,decodeToBytes:it,decodeUnsafe:ot,fromWords:_e,fromWordsUnsafe:tt,toWords:et}}const bech32=genBech32("bech32"),bech32m=genBech32("bech32m"),utf8$3={encode:s=>new TextDecoder().decode(s),decode:s=>new TextEncoder().encode(s)},hex$1=chain$2(radix2(4),alphabet("0123456789abcdef"),join(""),normalize(s=>{if(typeof s!="string"||s.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`);return s.toLowerCase()})),CODERS={utf8:utf8$3,hex:hex$1,base16,base32,base64:base64$2,base64url,base58:base58$1,base58xmr},coderTypeError="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",bytesToString=(s,j)=>{if(typeof s!="string"||!CODERS.hasOwnProperty(s))throw new TypeError(coderTypeError);if(!isBytes$3(j))throw new TypeError("bytesToString() expects Uint8Array");return CODERS[s].encode(j)},str=bytesToString,stringToBytes$1=(s,j)=>{if(!CODERS.hasOwnProperty(s))throw new TypeError(coderTypeError);if(typeof j!="string")throw new TypeError("stringToBytes() expects string");return CODERS[s].decode(j)},bytes$3=stringToBytes$1,esm$1=Object.freeze(Object.defineProperty({__proto__:null,assertNumber,base16,base32,base32crockford,base32hex,base58:base58$1,base58check,base58flickr,base58xmr,base58xrp,base64:base64$2,base64nopad,base64url,base64urlnopad,bech32,bech32m,bytes:bytes$3,bytesToString,createBase58check,hex:hex$1,str,stringToBytes:stringToBytes$1,utf8:utf8$3,utils:utils$8},Symbol.toStringTag,{value:"Module"})),stripPrefix=(s,j)=>j.startsWith(s)?j.slice(s.length):j,isHexRegex=/^(?:0x)?[0-9a-fA-F]+$/,hex={valid:s=>isHexRegex.test(s),decode:s=>base16.decode(stripPrefix("0x",s).toUpperCase()),encode:(s,j=!1)=>(s=typeof s=="string"?bytes$2.encode(s):s,(j?"0x":"")+base16.encode(s).toLowerCase())},isB64Regex=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,b64={valid:s=>isB64Regex.test(s),decode:base64$2.decode,encode:s=>base64$2.encode(typeof s=="string"?bytes$2.encode(s):s)},b58={decode:base58$1.decode,encode:s=>base58$1.encode(typeof s=="string"?bytes$2.encode(s):s)},bignum={decode:s=>(typeof s!="string"&&(s=hex.encode(s,!0)),s===""||s==="0x"?0n:BigInt(s)),encode:(s,j=!1)=>bignum.toString(s,j),toString:(s,j=!1)=>{let $=s.toString(16);return $=$.length%2===1?$="0"+$:$,j?"0x"+$:$},toBytes:(s,j)=>{typeof s=="number"&&(s=bignum.toBigInt(s));const $=hex.decode(bignum.toString(s));if(!j)return $;if(j<$.length)throw new Error(`Can't fit ${s} into ${j} bytes.`);return bytes$2.zpad($,j)},toNumber:s=>{if(s>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`Invalid cast: ${s} exceeds MAX_SAFE_INTEGER`);return Number(s)},toBigInt:s=>{if(s>Number.MAX_SAFE_INTEGER)throw new Error(`Invalid cast: ${s} exceeds MAX_SAFE_INTEGER`);return BigInt(s)}},bytes$2={encode:s=>new TextEncoder().encode(s),decode:s=>new TextDecoder().decode(s),equals:(s,j)=>s.length===j.length&&s.every(($,_e)=>$===j[_e]),zpad:(s,j,$=!0)=>$?bytes$2.concat(new Uint8Array(j-s.length),s):bytes$2.concat(s,new Uint8Array(j-s.length)),concat:(...s)=>{const j=s.reduce((et,tt)=>et+tt.length,0),$=new Uint8Array(j);let _e=0;return s.forEach(et=>{$.set(et,_e),_e+=et.length}),$}},encoding$3=Object.freeze(Object.defineProperty({__proto__:null,b58,b64,bech32,bignum,bytes:bytes$2,hex,stripPrefix},Symbol.toStringTag,{value:"Module"})),chainIdAndChainEntries=[[1,"Solana"],[2,"Ethereum"],[3,"Terra"],[4,"Bsc"],[5,"Polygon"],[6,"Avalanche"],[7,"Oasis"],[8,"Algorand"],[9,"Aurora"],[10,"Fantom"],[11,"Karura"],[12,"Acala"],[13,"Klaytn"],[14,"Celo"],[15,"Near"],[16,"Moonbeam"],[17,"Neon"],[18,"Terra2"],[19,"Injective"],[20,"Osmosis"],[21,"Sui"],[22,"Aptos"],[23,"Arbitrum"],[24,"Optimism"],[25,"Gnosis"],[26,"Pythnet"],[28,"Xpla"],[29,"Btc"],[30,"Base"],[32,"Sei"],[33,"Rootstock"],[34,"Scroll"],[35,"Mantle"],[36,"Blast"],[37,"Xlayer"],[38,"Linea"],[39,"Berachain"],[40,"Seievm"],[43,"Snaxchain"],[3104,"Wormchain"],[4e3,"Cosmoshub"],[4001,"Evmos"],[4002,"Kujira"],[4003,"Neutron"],[4004,"Celestia"],[4005,"Stargaze"],[4006,"Seda"],[4007,"Dymension"],[4008,"Provenance"],[10002,"Sepolia"],[10003,"ArbitrumSepolia"],[10004,"BaseSepolia"],[10005,"OptimismSepolia"],[10006,"Holesky"],[10007,"PolygonSepolia"]],[chainIds,chains]=zip(chainIdAndChainEntries),chainToChainId=constMap(chainIdAndChainEntries,[1,0]),chainIdToChain=constMap(chainIdAndChainEntries),isChain=s=>chainToChainId.has(s),isChainId=s=>chainIdToChain.has(s);function assertChainId(s){if(!isChainId(s))throw Error(`Unknown Wormhole chain id: ${s}`)}function assertChain(s){if(!isChain(s))throw Error(`Unknown Wormhole chain: ${s}`)}const asChainId=s=>(assertChainId(s),s),toChainId=s=>{switch(typeof s){case"string":if(isChain(s))return chainToChainId(s);break;case"number":if(isChainId(s))return s;break}throw Error(`Cannot convert to ChainId: ${s}`)},toChain=s=>{switch(typeof s){case"string":if(isChain(s))return s;break;case"number":if(isChainId(s))return chainIdToChain(s);break;case"bigint":if(isChainId(Number(s)))return chainIdToChain.get(Number(s));break}throw Error(`Cannot convert to Chain: ${s}`)},chains$1=Object.freeze(Object.defineProperty({__proto__:null,asChainId,assertChain,assertChainId,chainIdToChain,chainIds,chainToChainId,chains,isChain,isChainId,toChain,toChainId},Symbol.toStringTag,{value:"Module"})),platformAndChainsEntries=[["Evm",["Acala","Arbitrum","Aurora","Avalanche","Base","Bsc","Celo","Ethereum","Fantom","Gnosis","Karura","Klaytn","Moonbeam","Neon","Oasis","Optimism","Polygon","Rootstock","Sepolia","ArbitrumSepolia","BaseSepolia","OptimismSepolia","Holesky","PolygonSepolia","Mantle","Scroll","Blast","Xlayer","Linea","Berachain","Seievm","Snaxchain"]],["Solana",["Solana","Pythnet"]],["Cosmwasm",["Cosmoshub","Evmos","Injective","Kujira","Osmosis","Sei","Terra","Terra2","Wormchain","Xpla","Dymension","Neutron","Stargaze","Celestia","Seda","Provenance"]],["Btc",["Btc"]],["Algorand",["Algorand"]],["Sui",["Sui"]],["Aptos",["Aptos"]],["Near",["Near"]]],platforms=column(platformAndChainsEntries,0),platformToChains=constMap(platformAndChainsEntries),chainToPlatform=constMap(platformAndChainsEntries,[1,0]),isPlatform=s=>platformToChains.has(s),platformAddressFormatEntries=[["Evm","hex"],["Solana","base58"],["Cosmwasm","bech32"],["Btc","bech32"],["Algorand","algorandAppId"],["Sui","hex"],["Aptos","hex"],["Near","sha256"]],platformToAddressFormat=constMap(platformAddressFormatEntries),platforms$1=Object.freeze(Object.defineProperty({__proto__:null,chainToPlatform,isPlatform,platformToAddressFormat,platformToChains,platforms},Symbol.toStringTag,{value:"Module"})),filters={byAddress:(s,j)=>Object.values(s).find($=>isEqualCaseInsensitive($.address,j)),native:s=>filters.byAddress(s,"native"),bySymbol:(s,j)=>{const $=Object.values(s).filter(_e=>_e.symbol===j);return $&&$.length>0?$:void 0},byKey:(s,j)=>{const $=Object.entries(s).find(([_e])=>j===_e);return $?$[1]:void 0}},isEqualCaseInsensitive=(s,j)=>s.toLowerCase()===j.toLowerCase();var ConsistencyLevels;(function(s){s[s.Finalized=1]="Finalized",s[s.Immediate=200]="Immediate",s[s.Safe=201]="Safe"})(ConsistencyLevels||(ConsistencyLevels={}));const safeThresholds=[["Ethereum",32]],safeThreshold=constMap(safeThresholds),finalityThresholds=[["Solana",32],["Ethereum",64],["Bsc",15],["Optimism",512],["Base",512],["Arbitrum",4096],["Polygon",32],["Fantom",1],["Celo",1],["Moonbeam",1],["Karura",1],["Acala",1],["Oasis",1],["Avalanche",0],["Sui",0],["Algorand",0],["Aptos",0],["Klaytn",0],["Sei",0],["Near",0],["Osmosis",0],["Terra",0],["Terra2",0],["Xpla",0],["Injective",0],["Berachain",0],["Snaxchain",0],["Cosmoshub",0],["Evmos",0],["Kujira",0],["Neutron",0],["Celestia",0],["Stargaze",0],["Dymension",0],["Provenance",0]],finalityThreshold=constMap(finalityThresholds),blockTimeMilliseconds=[["Acala",12e3],["Algorand",3300],["Aptos",4e3],["Arbitrum",260],["ArbitrumSepolia",260],["Aurora",3e3],["Avalanche",2e3],["Base",2e3],["BaseSepolia",2e3],["Bsc",3e3],["Celo",5e3],["Cosmoshub",5e3],["Ethereum",15e3],["Evmos",2e3],["Fantom",2500],["Gnosis",5e3],["Holesky",15e3],["Injective",2500],["Karura",12e3],["Klaytn",1e3],["Kujira",3e3],["Moonbeam",12e3],["Near",1500],["Neon",3e4],["Oasis",6e3],["Optimism",2e3],["OptimismSepolia",2e3],["Osmosis",6e3],["Polygon",2e3],["PolygonSepolia",2e3],["Rootstock",3e4],["Sei",400],["Sepolia",15e3],["Solana",400],["Sui",3e3],["Scroll",4e3],["Mantle",2e3],["Terra",6e3],["Terra2",6e3],["Xpla",5e3],["Wormchain",5e3],["Btc",6e5],["Pythnet",400],["Dymension",5e3],["Celestia",5e3],["Neutron",5e3],["Stargaze",5e3],["Seda",7500]],blockTime=constMap(blockTimeMilliseconds);function consistencyLevelToBlock(s,j,$=0n){if(j===ConsistencyLevels.Immediate)return $;if(s==="Bsc")return $+BigInt(j);if(s==="Solana"&&j===0)return $;const _e=finalityThreshold.get(s);if(_e===void 0)throw new Error("Cannot find chain finality for "+s);if(_e===0)return $;if(j!==ConsistencyLevels.Safe)return $+BigInt(_e);const et=safeThreshold.get(s);if(et===void 0)throw new Error("Cannot find safe threshold for "+s);switch(s){case"Ethereum":const tt=$%BigInt(et),nt=tt===0n?0n:BigInt(et)-tt;return $+nt;default:throw new Error("Only Ethereum safe is supported for now")}}function estimateFinalityTime(s){const j=finalityThreshold.get(s);if(j===void 0)throw new Error("Cannot find finality for "+s);const $=blockTime.get(s);if($===void 0)throw new Error("Cannot find block time for "+s);return j*$}const finality=Object.freeze(Object.defineProperty({__proto__:null,get ConsistencyLevels(){return ConsistencyLevels},blockTime,consistencyLevelToBlock,estimateFinalityTime,finalityThreshold,safeThreshold},Symbol.toStringTag,{value:"Module"})),nativeDecimalEntries=[["Evm",18],["Solana",9],["Sui",9],["Aptos",8],["Cosmwasm",6],["Algorand",6],["Btc",8],["Near",12]],nativeDecimals=constMap(nativeDecimalEntries),decimals=Object.freeze(Object.defineProperty({__proto__:null,nativeDecimals},Symbol.toStringTag,{value:"Module"})),explorerConfig=[["Mainnet",[["Ethereum",{name:"Etherscan",baseUrl:"https://etherscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Solana",{name:"Solana Explorer",baseUrl:"https://explorer.solana.com/",endpoints:{tx:"tx/",account:"address/"}}],["Polygon",{name:"PolygonScan",baseUrl:"https://polygonscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Bsc",{name:"BscScan",baseUrl:"https://bscscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Avalanche",{name:"Snowtrace",baseUrl:"https://snowtrace.io/",endpoints:{tx:"tx/",account:"address/"}}],["Fantom",{name:"FTMscan",baseUrl:"https://ftmscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Celo",{name:"Celo Explorer",baseUrl:"https://explorer.celo.org/mainnet/",endpoints:{tx:"tx/",account:"address/"}}],["Moonbeam",{name:"Moonscan",baseUrl:"https://moonscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Sui",{name:"Sui Explorer",baseUrl:"https://explorer.sui.io/",endpoints:{tx:"txblock/",account:"address/"}}],["Aptos",{name:"Aptos Explorer",baseUrl:"https://explorer.aptoslabs.com/",endpoints:{tx:"txn/",account:"account/"}}],["Sei",{name:"Sei Explorer",baseUrl:"https://sei.explorers.guru/",endpoints:{tx:"transaction/",account:"address/"}}],["Karura",{name:"Karura Explorer",baseUrl:"https://blockscout.karura.network/",endpoints:{tx:"tx/",account:"address/"}}],["Acala",{name:"Acala Explorer",baseUrl:"https://blockscout.acala.network/",endpoints:{tx:"tx/",account:"address/"}}]]],["Testnet",[["Ethereum",{name:"Etherscan",baseUrl:"https://goerli.etherscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Polygon",{name:"PolygonScan",baseUrl:"https://mumbai.polygonscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Bsc",{name:"BscScan",baseUrl:"https://testnet.bscscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Avalanche",{name:"Snowtrace",baseUrl:"https://testnet.snowtrace.io/",endpoints:{tx:"tx/",account:"address/"}}],["Fantom",{name:"FTMscan",baseUrl:"https://testnet.ftmscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Celo",{name:"Celo Explorer",baseUrl:"https://explorer.celo.org/alfajores/",endpoints:{tx:"tx/",account:"address/"}}],["Moonbeam",{name:"Moonscan",baseUrl:"https://moonbase.moonscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Solana",{name:"Solana Explorer",baseUrl:"https://explorer.solana.com/",endpoints:{tx:"tx/",account:"address/"},networkQuery:{default:"Devnet",Testnet:"?cluster=testnet",Devnet:"?cluster=devnet"}}],["Sui",{name:"Sui Explorer",baseUrl:"https://explorer.sui.io/",endpoints:{tx:"txblock/",account:"address/"},networkQuery:{default:"Testnet",Testnet:"?network=testnet",Devnet:"?network=devnet"}}],["Aptos",{name:"Aptos Explorer",baseUrl:"https://explorer.aptoslabs.com/",endpoints:{tx:"txn/",account:"account/"},networkQuery:{default:"Testnet",Testnet:"?network=testnet",Devnet:"?network=devnet"}}],["Sei",{name:"Sei Explorer",baseUrl:"https://sei.explorers.guru/",endpoints:{tx:"transaction/",account:"address/"}}],["Karura",{name:"Karura Explorer",baseUrl:"https://blockscout.karura-testnet.aca-staging.network/",endpoints:{tx:"tx/",account:"address/"}}],["Acala",{name:"Acala Explorer",baseUrl:"https://blockscout.acala-dev.aca-dev.network/",endpoints:{tx:"tx/",account:"address/"}}]]]],explorerConfs=constMap(explorerConfig),explorerConfigs=(s,j)=>s==="Devnet"?void 0:explorerConfs.get(s,j);function linkToTx(s,j,$){const _e=explorerConfigs($,s);if(!_e)throw new Error("invalid chain, explorer config not found");const{baseUrl:et,endpoints:tt,networkQuery:nt}=_e,rt=nt?nt[$]:"";return`${et}${tt.tx}${j}${rt}`}function linkToAccount(s,j,$){const _e=explorerConfigs($,s);if(!_e)throw new Error("invalid chain, explorer config not found");const{baseUrl:et,endpoints:tt,networkQuery:nt}=_e,rt=nt?nt[$]:"";return`${et}${tt.account}${j}${rt}`}const explorer$1=Object.freeze(Object.defineProperty({__proto__:null,explorerConfigs,explorerConfs,linkToAccount,linkToTx},Symbol.toStringTag,{value:"Module"})),rpcConfig=[["Mainnet",[["Ethereum","https://rpc.ankr.com/eth"],["Solana","https://api.mainnet-beta.solana.com"],["Polygon","https://rpc.ankr.com/polygon"],["Bsc","https://bscrpc.com"],["Avalanche","https://rpc.ankr.com/avalanche"],["Fantom","https://rpc.ankr.com/fantom"],["Celo","https://rpc.ankr.com/celo"],["Moonbeam","https://rpc.ankr.com/moonbeam"],["Sui","https://rpc.mainnet.sui.io"],["Aptos","https://fullnode.mainnet.aptoslabs.com/v1"],["Arbitrum","https://arb1.arbitrum.io/rpc"],["Optimism","https://mainnet.optimism.io"],["Base","https://mainnet.base.org"],["Osmosis","https://osmosis-rpc.polkachu.com"],["Cosmoshub","https://cosmos-rpc.publicnode.com:443"],["Evmos","https://evmos-rpc.polkachu.com"],["Injective","https://sentry.tm.injective.network"],["Wormchain","https://wormchain-rpc.quickapi.com"],["Xpla","https://dimension-rpc.xpla.dev"],["Sei","https://sei-rpc.polkachu.com/"],["Algorand","https://mainnet-api.algonode.cloud"],["Terra","https://terra-classic-rpc.publicnode.com"],["Terra2","https://terra-rpc.polkachu.com"],["Karura","https://eth-rpc-karura.aca-api.network"],["Acala","https://eth-rpc-acala.aca-api.network"],["Oasis","https://emerald.oasis.dev"],["Dymension","https://dymension-rpc.polkachu.com/"],["Stargaze","https://stargaze-rpc.polkachu.com/"],["Celestia","https://celestia-rpc.polkachu.com/"],["Neutron","https://neutron-rpc.polkachu.com/"],["Blast","https://rpc.blast.io"],["Provenance","https://rpc.provenance.io/"],["Linea","https://rpc.linea.build"],["Scroll","https://rpc.ankr.com/scroll"],["Xlayer","https://xlayerrpc.okx.com/"],["Gnosis","https://rpc.ankr.com/gnosis"],["Rootstock","https://public-node.rsk.co"],["Mantle","https://rpc.mantle.xyz"]]],["Testnet",[["Ethereum","https://eth-goerli.public.blastapi.io"],["Polygon","https://rpc-mumbai.polygon.technology"],["Bsc","https://data-seed-prebsc-1-s3.binance.org:8545"],["Avalanche","https://api.avax-test.network/ext/bc/C/rpc"],["Fantom","https://rpc.ankr.com/fantom_testnet"],["Celo","https://alfajores-forno.celo-testnet.org"],["Solana","https://api.devnet.solana.com"],["Oasis","https://testnet.emerald.oasis.io"],["Moonbeam","https://rpc.api.moonbase.moonbeam.network"],["Sui","https://fullnode.testnet.sui.io"],["Aptos","https://fullnode.testnet.aptoslabs.com/v1"],["Sei","https://sei-testnet-rpc.polkachu.com"],["Arbitrum","https://arbitrum-goerli.public.blastapi.io"],["Optimism","https://optimism-goerli.public.blastapi.io"],["Base","https://base-goerli.public.blastapi.io"],["Injective","https://testnet.sentry.tm.injective.network"],["Osmosis","https://rpc.testnet.osmosis.zone"],["Cosmoshub","https://rpc.sentry-02.theta-testnet.polypore.xyz"],["Evmos","https://evmos-testnet-rpc.polkachu.com"],["Wormchain","https://gateway.testnet.xlabs.xyz/"],["Xpla","https://cube-rpc.xpla.dev"],["Sepolia","https://ethereum-sepolia.publicnode.com"],["Algorand","https://testnet-api.algonode.cloud"],["Terra","https://bombay.stakesystems.io"],["Terra2","https://terra-testnet-rpc.polkachu.com"],["ArbitrumSepolia","https://sepolia-rollup.arbitrum.io/rpc"],["OptimismSepolia","https://sepolia.optimism.io"],["BaseSepolia","https://sepolia.base.org"],["PolygonSepolia","https://rpc-amoy.polygon.technology/"],["Mantle","https://mantle-sepolia.drpc.org"],["Karura","https://eth-rpc-karura-testnet.aca-staging.network"],["Acala","https://eth-rpc-acala-testnet.aca-staging.network"],["Blast","https://sepolia.blast.io"],["Berachain","https://artio.rpc.berachain.com"],["Linea","https://rpc.sepolia.linea.build"],["Xlayer","https://testrpc.xlayer.tech/"],["Scroll","https://rpc.ankr.com/scroll_sepolia_testnet"],["Rootstock","https://public-node.testnet.rsk.co"],["Gnosis","https://rpc.chiadochain.net"]]],["Devnet",[["Ethereum","http://eth-devnet:8545"],["Bsc","http://eth-devnet2:8545"],["Solana","http://solana-devnet:8899"]]]],rpc$2=constMap(rpcConfig),rpcAddress=(s,j)=>rpc$2.get(s,j)??"",rpc$3=Object.freeze(Object.defineProperty({__proto__:null,rpcAddress},Symbol.toStringTag,{value:"Module"})),chainNetworkNativeChainIdEntries=[["Mainnet",[["Aptos",1n],["Algorand","mainnet-v1.0"],["Near","mainnet"],["Cosmoshub","cosmoshub-4"],["Evmos","evmos_9001-2"],["Injective","injective-1"],["Osmosis","osmosis-1"],["Sei","pacific-1"],["Terra","columbus-5"],["Terra2","phoenix-1"],["Wormchain","wormchain"],["Xpla","dimension_37-1"],["Kujira","kaiyo-1"],["Solana","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d"],["Sui","35834a8a"],["Acala",787n],["Arbitrum",42161n],["Aurora",1313161554n],["Avalanche",43114n],["Base",8453n],["Bsc",56n],["Celo",42220n],["Ethereum",1n],["Fantom",250n],["Gnosis",100n],["Karura",686n],["Klaytn",8217n],["Moonbeam",1284n],["Neon",245022934n],["Oasis",42262n],["Optimism",10n],["Polygon",137n],["Rootstock",30n],["Neutron","neutron-1"],["Stargaze","stargaze-1"],["Celestia","celestia"],["Dymension","dymension_1100-1"],["Provenance","pio-mainnet-1"],["Xlayer",196n],["Mantle",5000n],["Scroll",534352n],["Blast",81457n],["Linea",59144n]]],["Testnet",[["Aptos",2n],["Algorand","testnet-v1.0"],["Near","testnet"],["Cosmoshub","theta-testnet-001"],["Evmos","evmos_9000-4"],["Injective","injective-888"],["Osmosis","osmo-test-5"],["Sei","atlantic-2"],["Terra","bombay-12"],["Terra2","pisco-1"],["Wormchain","wormchain-testnet-0"],["Xpla","cube_47-5"],["Kujira","harpoon-4"],["Solana","EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG"],["Sui","4c78adac"],["Acala",597n],["Arbitrum",421613n],["Aurora",1313161555n],["Avalanche",43113n],["Base",84531n],["Bsc",97n],["Celo",44787n],["Ethereum",5n],["Fantom",4002n],["Gnosis",10200n],["Karura",596n],["Klaytn",1001n],["Moonbeam",1287n],["Neon",245022940n],["Oasis",42261n],["Optimism",420n],["Polygon",80001n],["Rootstock",31n],["Sepolia",11155111n],["ArbitrumSepolia",421614n],["BaseSepolia",84532n],["OptimismSepolia",11155420n],["PolygonSepolia",80002n],["Holesky",17000n],["Neutron","pion-1"],["Celestia","mocha-4"],["Seda","seda-1-testnet"],["Blast",168587773n],["Mantle",5003n],["Scroll",534351n],["Berachain",80084n],["Snaxchain",2192n],["Xlayer",195n],["Linea",59141n]]],["Devnet",[["Aptos",0n],["Algorand","sandnet-v1.0"],["Bsc",1397n],["Ethereum",1337n],["Injective","injective_devnet_fake"],["Solana","8wF6jKV3cKwyaVkWcoV9KpDqmkjvEYno9hKZrKx8TbZn"]]]],networkChainToNativeChainId=constMap(chainNetworkNativeChainIdEntries),nativeChainIdToNetworkChain=constMap(chainNetworkNativeChainIdEntries,[2,[0,1]]);function platformNativeChainIdToNetworkChain(s,j){const _e=nativeChainIdToNetworkChain(j).filter(([et,tt])=>chainToPlatform(tt)===s);if(_e.length!==1)throw new Error(`Platform ${s} has multiple chains with native chain id ${j}`);return _e[0]}const nativeChainIds=Object.freeze(Object.defineProperty({__proto__:null,networkChainToNativeChainId,platformNativeChainIdToNetworkChain},Symbol.toStringTag,{value:"Module"})),circleAPIs=[["Mainnet","https://iris-api.circle.com/v1/attestations"],["Testnet","https://iris-api-sandbox.circle.com/v1/attestations"]],circleAPI=constMap(circleAPIs),usdcContracts=[["Mainnet",[["Ethereum","0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"],["Avalanche","0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e"],["Optimism","0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"],["Arbitrum","0xaf88d065e77c8cC2239327C5EDb3A432268e5831"],["Solana","EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"],["Base","0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"],["Polygon","0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"]]],["Testnet",[["Sepolia","0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"],["Avalanche","0x5425890298aed601595a70AB815c96711a31Bc65"],["OptimismSepolia","0x5fd84259d66Cd46123540766Be93DFE6D43130D7"],["ArbitrumSepolia","0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"],["Solana","4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"],["BaseSepolia","0x036CbD53842c5426634e7929541eC2318f3dCF7e"],["Polygon","0x9999f7fea5938fd3b1e26a12c3f2fb024e194f97"]]]],usdcContract=constMap(usdcContracts),circleDomains=[["Mainnet",[["Ethereum",0],["Avalanche",1],["Optimism",2],["Arbitrum",3],["Solana",5],["Base",6],["Polygon",7]]],["Testnet",[["Sepolia",0],["Avalanche",1],["OptimismSepolia",2],["ArbitrumSepolia",3],["Solana",5],["BaseSepolia",6],["Polygon",7]]]],circleChainId=constMap(circleDomains,[[0,1],2]),circleChainIdToChain=constMap(circleDomains,[[0,2],1]),[circleNetworks,circleChainMap]=zip(circleDomains),isCircleChain=(s,j)=>circleChainId.has(s,j),isCircleChainId=(s,j)=>circleChainIdToChain.has(s,j),isCircleSupported=(s,j)=>usdcContract.has(s,j);function assertCircleChainId(s,j){if(!isCircleChainId(s,j))throw Error(`Unknown Circle chain id: ${j}`)}function assertCircleChain(s,j){if(!isCircleChain(s,j))throw Error(`Unknown Circle chain: ${j}`)}const asCircleChainId=(s,j)=>(assertCircleChainId(s,j),j),toCircleChainId=(s,j)=>{switch(typeof j){case"string":if(isCircleChain(s,j))return circleChainId.get(s,j);break;case"number":if(isCircleChainId(s,j))return j;break;case"bigint":const $=Number(j);if(isCircleChainId(s,$))return $;break}throw Error(`Cannot convert to ChainId: ${j}`)},toCircleChain=(s,j)=>{switch(typeof j){case"string":if(isCircleChain(s,j))return j;break;case"number":if(isCircleChainId(s,j))return circleChainIdToChain(s,j);break;case"bigint":const $=Number(j);if(isCircleChainId(s,$))return circleChainIdToChain(s,$);break}throw Error(`Cannot convert to Chain: ${j}`)},circle$1=Object.freeze(Object.defineProperty({__proto__:null,asCircleChainId,assertCircleChain,assertCircleChainId,circleAPI,circleChainId,circleChainIdToChain,circleChainMap,circleNetworks,isCircleChain,isCircleChainId,isCircleSupported,toCircleChain,toCircleChainId,usdcContract},Symbol.toStringTag,{value:"Module"})),coreBridgeContracts=[["Mainnet",[["Solana","worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth"],["Ethereum","0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"],["Terra","terra1dq03ugtd40zu9hcgdzrsq6z2z4hwhc9tqk2uy5"],["Bsc","0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"],["Polygon","0x7A4B5a56256163F07b2C80A7cA55aBE66c4ec4d7"],["Avalanche","0x54a8e5f9c4CbA08F9943965859F6c34eAF03E26c"],["Oasis","0xfE8cD454b4A1CA468B57D79c0cc77Ef5B6f64585"],["Algorand","842125965"],["Aurora","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Fantom","0x126783A6Cb203a3E35344528B26ca3a0489a1485"],["Karura","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Acala","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Klaytn","0x0C21603c4f3a6387e241c0091A7EA39E43E90bb7"],["Celo","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Near","contract.wormhole_crypto.near"],["Injective","inj17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9l2q74d"],["Aptos","0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625"],["Sui","0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c"],["Moonbeam","0xC8e2b0cD52Cf01b0Ce87d389Daa3d414d4cE29f3"],["Terra2","terra12mrnzvhx3rpej6843uge2yyfppfyd3u9c3uq223q8sl48huz9juqffcnhp"],["Arbitrum","0xa5f208e072434bC67592E4C49C1B991BA79BCA46"],["Optimism","0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722"],["Gnosis","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Pythnet","H3fxXJ86ADW2PNuDDmZJg6mzTtPxkYCpNuQUTgmJ7AjU"],["Base","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Rootstock","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Xlayer","0x194B123c5E96B9b2E49763619985790Dc241CAC0"],["Xpla","xpla1jn8qmdda5m6f6fqu9qv46rt7ajhklg40ukpqchkejcvy8x7w26cqxamv3w"],["Sei","sei1gjrrme22cyha4ht2xapn3f08zzw6z3d4uxx6fyy9zd5dyr3yxgzqqncdqn"],["Wormchain","wormhole1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqaqfk2j"],["Neutron","neutron16rerygcpahqcxx5t8vjla46ym8ccn7xz7rtc6ju5ujcd36cmc7zs9zrunh"],["Blast","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Scroll","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Mantle","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"]]],["Testnet",[["Solana","3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"],["Ethereum","0x706abc4E45D419950511e474C7B9Ed348A4a716c"],["Terra","terra1pd65m0q9tl3v8znnz5f5ltsfegyzah7g42cx5v"],["Bsc","0x68605AD7b15c732a30b1BbC62BE8F2A509D74b4D"],["Polygon","0x0CBE91CF822c73C2315FB05100C2F714765d5c20"],["Avalanche","0x7bbcE28e64B3F8b84d876Ab298393c38ad7aac4C"],["Oasis","0xc1C338397ffA53a2Eb12A7038b4eeb34791F8aCb"],["Algorand","86525623"],["Aurora","0xBd07292de7b505a4E803CEe286184f7Acf908F5e"],["Fantom","0x1BB3B4119b7BA9dfad76B0545fb3F531383c3bB7"],["Karura","0x64fb09E405D2043ed7785a29E296C766D56F2056"],["Acala","0x64fb09E405D2043ed7785a29E296C766D56F2056"],["Klaytn","0x1830CC6eE66c84D2F177B94D544967c774E624cA"],["Celo","0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56"],["Near","wormhole.wormhole.testnet"],["Injective","inj1xx3aupmgv3ce537c0yce8zzd3sz567syuyedpg"],["Osmosis","osmo1hggkxr0hpw83f8vuft7ruvmmamsxmwk2hzz6nytdkzyup9krt0dq27sgyx"],["Aptos","0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625"],["Sui","0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790"],["Moonbeam","0xa5B7D85a8f27dd7907dc8FdC21FA5657D5E2F901"],["Neon","0x268557122Ffd64c85750d630b716471118F323c8"],["Terra2","terra19nv3xr5lrmmr7egvrk2kqgw4kcn43xrtd5g0mpgwwvhetusk4k7s66jyv0"],["Arbitrum","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Optimism","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["Gnosis","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Pythnet","EUrRARh92Cdc54xrDn6qzaqjA77NRrCcfbr8kPwoTL4z"],["Xpla","xpla1upkjn4mthr0047kahvn0llqx4qpqfn75lnph4jpxfn8walmm8mqsanyy35"],["Base","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Sei","sei1nna9mzp274djrgzhzkac2gvm3j27l402s4xzr08chq57pjsupqnqaj0d5s"],["Sepolia","0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78"],["Rootstock","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Wormchain","wormhole16jzpxp0e8550c9aht6q9svcux30vtyyyyxv5w2l2djjra46580wsazcjwp"],["ArbitrumSepolia","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["BaseSepolia","0x79A1027a6A159502049F10906D333EC57E95F083"],["OptimismSepolia","0x31377888146f3253211EFEf5c676D41ECe7D58Fe"],["Holesky","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Neutron","neutron1enf63k37nnv9cugggpm06mg70emcnxgj9p64v2s8yx7a2yhhzk2q6xesk4"],["Mantle","0x376428e7f26D5867e69201b275553C45B09EE090"],["PolygonSepolia","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["Scroll","0x055F47F1250012C6B20c436570a76e52c17Af2D5"],["Blast","0x473e002D7add6fB67a4964F13bFd61280Ca46886"],["Berachain","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Snaxchain","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Xlayer","0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"],["Linea","0x79A1027a6A159502049F10906D333EC57E95F083"]]],["Devnet",[["Solana","Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"],["Ethereum","0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"],["Terra","terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au"],["Bsc","0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"],["Algorand","1004"],["Near","wormhole.test.near"],["Aptos","0xde0036a9600559e295d5f6802ef6f3f802f510366e0c23912b0655d972166017"],["Sui","0x5a5160ca3c2037f4b4051344096ef7a48ebf4400b3f385e57ea90e1628a8bde0"],["Terra2","terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au"],["Wormchain","wormhole17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgshdnj3k"]]]],tokenBridgeContracts=[["Mainnet",[["Solana","wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb"],["Ethereum","0x3ee18B2214AFF97000D974cf647E7C347E8fa585"],["Terra","terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf"],["Bsc","0xB6F6D86a8f9879A9c87f643768d9efc38c1Da6E7"],["Polygon","0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE"],["Avalanche","0x0e082F06FF657D94310cB8cE8B0D9a04541d8052"],["Oasis","0x5848C791e09901b40A9Ef749f2a6735b418d7564"],["Algorand","842126029"],["Aurora","0x51b5123a7b0F9b2bA265f9c4C8de7D78D52f510F"],["Fantom","0x7C9Fc5741288cDFdD83CeB07f3ea7e22618D79D2"],["Karura","0xae9d7fe007b3327AA64A32824Aaac52C42a6E624"],["Acala","0xae9d7fe007b3327AA64A32824Aaac52C42a6E624"],["Klaytn","0x5b08ac39EAED75c0439FC750d9FE7E1F9dD0193F"],["Celo","0x796Dff6D74F3E27060B71255Fe517BFb23C93eed"],["Near","contract.portalbridge.near"],["Injective","inj1ghd753shjuwexxywmgs4xz7x2q732vcnxxynfn"],["Aptos","0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f"],["Sui","0xc57508ee0d4595e5a8728974a4a93a787d38f339757230d441e895422c07aba9"],["Moonbeam","0xb1731c586ca89a23809861c6103f0b96b3f57d92"],["Terra2","terra153366q50k7t8nn7gec00hg66crnhkdggpgdtaxltaq6xrutkkz3s992fw9"],["Arbitrum","0x0b2402144Bb366A632D14B83F244D2e0e21bD39c"],["Optimism","0x1D68124e65faFC907325e3EDbF8c4d84499DAa8b"],["Base","0x8d2de8d2f73F1F4cAB472AC9A881C9b123C79627"],["Xlayer","0x5537857664B0f9eFe38C9f320F75fEf23234D904"],["Xpla","xpla137w0wfch2dfmz7jl2ap8pcmswasj8kg06ay4dtjzw7tzkn77ufxqfw7acv"],["Sei","sei1smzlm9t79kur392nu9egl8p8je9j92q4gzguewj56a05kyxxra0qy0nuf3"],["Wormchain","wormhole1466nf3zuxpya8q9emxukd7vftaf6h4psr0a07srl5zw74zh84yjq4lyjmh"],["Blast","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"],["Scroll","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"],["Mantle","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"]]],["Testnet",[["Solana","DZnkkTmCiFWfYTfT41X3Rd1kDgozqzxWaHqsw6W4x2oe"],["Ethereum","0xF890982f9310df57d00f659cf4fd87e65adEd8d7"],["Terra","terra1pseddrv0yfsn76u4zxrjmtf45kdlmalswdv39a"],["Bsc","0x9dcF9D205C9De35334D646BeE44b2D2859712A09"],["Polygon","0x377D55a7928c046E18eEbb61977e714d2a76472a"],["Avalanche","0x61E44E506Ca5659E6c0bba9b678586fA2d729756"],["Oasis","0x88d8004A9BdbfD9D28090A02010C19897a29605c"],["Algorand","86525641"],["Aurora","0xD05eD3ad637b890D68a854d607eEAF11aF456fba"],["Fantom","0x599CEa2204B4FaECd584Ab1F2b6aCA137a0afbE8"],["Karura","0xe157115ef34c93145Fec2FE53706846853B07F42"],["Acala","0xe157115ef34c93145Fec2FE53706846853B07F42"],["Klaytn","0xC7A13BE098720840dEa132D860fDfa030884b09A"],["Celo","0x05ca6037eC51F8b712eD2E6Fa72219FEaE74E153"],["Near","token.wormhole.testnet"],["Injective","inj1q0e70vhrv063eah90mu97sazhywmeegp7myvnh"],["Aptos","0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f"],["Sui","0x6fb10cdb7aa299e9a4308752dadecb049ff55a892de92992a1edbd7912b3d6da"],["Moonbeam","0xbc976D4b9D57E57c3cA52e1Fd136C45FF7955A96"],["Neon","0xEe3dB83916Ccdc3593b734F7F2d16D630F39F1D0"],["Terra2","terra1c02vds4uhgtrmcw7ldlg75zumdqxr8hwf7npseuf2h58jzhpgjxsgmwkvk"],["Arbitrum","0x23908A62110e21C04F3A4e011d24F901F911744A"],["ArbitrumSepolia","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Optimism","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["OptimismSepolia","0x99737Ec4B815d816c49A385943baf0380e75c0Ac"],["Xpla","xpla1kek6zgdaxcsu35nqfsyvs2t9vs87dqkkq6hjdgczacysjn67vt8sern93x"],["Base","0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"],["BaseSepolia","0x86F55A04690fd7815A3D802bD587e83eA888B239"],["Sei","sei1jv5xw094mclanxt5emammy875qelf3v62u4tl4lp5nhte3w3s9ts9w9az2"],["Sepolia","0xDB5492265f6038831E89f495670FF909aDe94bd9"],["Wormchain","wormhole1aaf9r6s7nxhysuegqrxv0wpm27ypyv4886medd3mrkrw6t4yfcnst3qpex"],["Holesky","0x76d093BbaE4529a342080546cAFEec4AcbA59EC6"],["Mantle","0x75Bfa155a9D7A3714b0861c8a8aF0C4633c45b5D"],["PolygonSepolia","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Scroll","0x22427d90B7dA3fA4642F7025A854c7254E4e45BF"],["Blast","0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2"],["Xlayer","0xdA91a06299BBF302091B053c6B9EF86Eff0f930D"],["Berachain","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Snaxchain","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Linea","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"]]],["Devnet",[["Solana","B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE"],["Ethereum","0x0290FB167208Af455bB137780163b7B7a9a10C16"],["Terra","terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6"],["Bsc","0x0290FB167208Af455bB137780163b7B7a9a10C16"],["Algorand","1006"],["Near","token.test.near"],["Aptos","0x84a5f374d29fc77e370014dce4fd6a55b58ad608de8074b0be5571701724da31"],["Sui","0xa6a3da85bbe05da5bfd953708d56f1a3a023e7fb58e5a824a3d4de3791e8f690"],["Terra2","terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6"],["Wormchain","wormhole1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqtm7t3h"]]]],tokenBridgeRelayerContracts=[["Mainnet",[["Ethereum","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Bsc","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Polygon","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Avalanche","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Fantom","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Celo","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Sui","0x57f4e0ba41a7045e29d435bc66cc4175f381eb700e6ec16d4fdfe92e5a4dff9f"],["Solana","3vxKRPwUTiEkeUVyoZ9MXFe1V71sRLbLqu1gRYaWmehQ"],["Base","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"],["Moonbeam","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"]]],["Testnet",[["Ethereum","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Bsc","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Polygon","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Avalanche","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Fantom","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Celo","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Sui","0xb30040e5120f8cb853b691cb6d45981ae884b1d68521a9dc7c3ae881c0031923"],["Base","0xae8dc4a7438801ec4edc0b035eccccf3807f4cc1"],["Moonbeam","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Solana","3bPRWXqtSfUaCw3S4wdgvypQtsSzcmvDeaqSqPDkncrg"],["Sepolia",""],["ArbitrumSepolia",""],["OptimismSepolia",""],["BaseSepolia",""]]]],nftBridgeContracts=[["Mainnet",[["Solana","WnFt12ZrnzZrFZkt2xsNsaNWoQribnuQ5B5FrDbwDhD"],["Ethereum","0x6FFd7EdE62328b3Af38FCD61461Bbfc52F5651fE"],["Bsc","0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE"],["Polygon","0x90BBd86a6Fe93D3bc3ed6335935447E75fAb7fCf"],["Avalanche","0xf7B6737Ca9c4e08aE573F75A97B73D7a813f5De5"],["Oasis","0x04952D522Ff217f40B5Ef3cbF659EcA7b952a6c1"],["Aurora","0x6dcC0484472523ed9Cdc017F711Bcbf909789284"],["Fantom","0xA9c7119aBDa80d4a4E0C06C8F4d8cF5893234535"],["Karura","0xb91e3638F82A1fACb28690b37e3aAE45d2c33808"],["Acala","0xb91e3638F82A1fACb28690b37e3aAE45d2c33808"],["Klaytn","0x3c3c561757BAa0b78c5C025CdEAa4ee24C1dFfEf"],["Celo","0xA6A377d75ca5c9052c9a77ED1e865Cc25Bd97bf3"],["Aptos","0x1bdffae984043833ed7fe223f7af7a3f8902d04129b14f801823e64827da7130"],["Moonbeam","0x453cfbe096c0f8d763e8c5f24b441097d577bde2"],["Arbitrum","0x3dD14D553cFD986EAC8e3bddF629d82073e188c8"],["Base","0xDA3adC6621B2677BEf9aD26598e6939CF0D92f88"],["Optimism","0xfE8cD454b4A1CA468B57D79c0cc77Ef5B6f64585"]]],["Testnet",[["Solana","2rHhojZ7hpu1zA91nvZmT8TqWWvMcKmmNBCr2mKTtMq4"],["Ethereum","0xD8E4C2DbDd2e2bd8F1336EA691dBFF6952B1a6eB"],["Bsc","0xcD16E5613EF35599dc82B24Cb45B5A93D779f1EE"],["Polygon","0x51a02d0dcb5e52F5b92bdAA38FA013C91c7309A9"],["Avalanche","0xD601BAf2EEE3C028344471684F6b27E789D9075D"],["Oasis","0xC5c25B41AB0b797571620F5204Afa116A44c0ebA"],["Aurora","0x8F399607E9BA2405D87F5f3e1B78D950b44b2e24"],["Fantom","0x63eD9318628D26BdCB15df58B53BB27231D1B227"],["Klaytn","0x94c994fC51c13101062958b567e743f1a04432dE"],["Celo","0xaCD8190F647a31E56A656748bC30F69259f245Db"],["Moonbeam","0x98A0F4B96972b32Fcb3BD03cAeB66A44a6aB9Edb"],["Neon","0x66E5BcFD45D2F3f166c567ADa663f9d2ffb292B4"],["Arbitrum","0xEe3dB83916Ccdc3593b734F7F2d16D630F39F1D0"],["Optimism","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Base","0xF681d1cc5F25a3694E348e7975d7564Aa581db59"],["Sepolia","0x6a0B52ac198e4870e5F3797d5B403838a5bbFD99"],["Aptos","0x1bdffae984043833ed7fe223f7af7a3f8902d04129b14f801823e64827da7130"],["ArbitrumSepolia","0x23908A62110e21C04F3A4e011d24F901F911744A"],["BaseSepolia","0x268557122Ffd64c85750d630b716471118F323c8"],["OptimismSepolia","0x27812285fbe85BA1DF242929B906B31EE3dd1b9f"],["Holesky","0xc8941d483c45eF8FB72E4d1F9dDE089C95fF8171"],["PolygonSepolia","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Mantle","0xD7D732C8Bf5eBF620EA55b5828eae20418eEF083"],["Scroll","0x47B9a1406BEe29a3001BFEB7e45aE45fFFB40c18"]]],["Devnet",[["Solana","NFTWqJR8YnRVqPDvTJrYuLrQDitTG5AScqbeghi4zSA"],["Ethereum","0x26b4afb60d6c903165150c6f0aa14f8016be4aec"],["Terra","terra1plju286nnfj3z54wgcggd4enwaa9fgf5kgrgzl"],["Bsc","0x26b4afb60d6c903165150c6f0aa14f8016be4aec"],["Aptos","0x46da3d4c569388af61f951bdd1153f4c875f90c2991f6b2d0a38e2161a40852c"]]]],relayerContracts=[["Mainnet",[["Ethereum","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Bsc","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Polygon","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Avalanche","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Fantom","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Klaytn","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Celo","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Acala","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Karura","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Moonbeam","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Base","0x706f82e9bb5b0813501714ab5974216704980e31"],["Arbitrum","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Optimism","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Blast","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Scroll","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Mantle","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Xlayer","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"]]],["Testnet",[["Ethereum","0x28D8F1Be96f97C1387e94A53e00eCcFb4E75175a"],["Bsc","0x80aC94316391752A193C1c47E27D382b507c93F3"],["Polygon","0x0591C25ebd0580E0d4F27A82Fc2e24E7489CB5e0"],["Avalanche","0xA3cF45939bD6260bcFe3D66bc73d60f19e49a8BB"],["Fantom","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Celo","0x306B68267Deb7c5DfCDa3619E22E9Ca39C374f84"],["Moonbeam","0x0591C25ebd0580E0d4F27A82Fc2e24E7489CB5e0"],["Arbitrum","0xAd753479354283eEE1b86c9470c84D42f229FF43"],["Optimism","0x01A957A525a5b7A72808bA9D10c389674E459891"],["Base","0xea8029CD7FCAEFFcD1F53686430Db0Fc8ed384E1"],["Sepolia","0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470"],["ArbitrumSepolia","0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470"],["BaseSepolia","0x93BAD53DDfB6132b0aC8E37f6029163E63372cEE"],["OptimismSepolia","0x93BAD53DDfB6132b0aC8E37f6029163E63372cEE"]]],["Devnet",[["Ethereum","0xcC680D088586c09c3E0E099a676FA4b6e42467b4"],["Bsc","0xcC680D088586c09c3E0E099a676FA4b6e42467b4"]]]],circleContracts$1=[["Mainnet",[["Ethereum",{tokenMessenger:"0xbd3fa81b58ba92a82136038b25adec7066af3155",messageTransmitter:"0x0a992d191deec32afe36203ad87d7d289a738f81",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0xAaDA05BD399372f0b0463744C09113c137636f6a"}],["Avalanche",{tokenMessenger:"0x6b25532e1060ce10cc3b0a99e5683b91bfde6982",messageTransmitter:"0x8186359af5f57fbb40c6b14a588d2a59c0c29880",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x09Fb06A271faFf70A651047395AaEb6265265F13"}],["Optimism",{tokenMessenger:"0x2B4069517957735bE00ceE0fadAE88a26365528f",messageTransmitter:"0x4d41f22c5a0e5c74090899e5a8fb597a8842b3e8",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Arbitrum",{tokenMessenger:"0x19330d10D9Cc8751218eaf51E8885D058642E08A",messageTransmitter:"0xC30362313FBBA5cf9163F0bb16a0e01f01A896ca",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Base",{tokenMessenger:"0x1682Ae6375C4E4A97e4B583BC394c861A46D8962",messageTransmitter:"0xAD09780d193884d503182aD4588450C416D6F9D4",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x03faBB06Fa052557143dC28eFCFc63FC12843f1D"}],["Solana",{tokenMessenger:"CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3",messageTransmitter:"CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd",wormholeRelayer:"",wormhole:""}],["Polygon",{tokenMessenger:"0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE",messageTransmitter:"0xF3be9355363857F3e001be68856A2f96b4C39Ba9",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x0FF28217dCc90372345954563486528aa865cDd6"}]]],["Testnet",[["Sepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Avalanche",{tokenMessenger:"0xeb08f243e5d3fcff26a9e38ae5520a669f4019d0",messageTransmitter:"0xa9fb1b3009dcb79e2fe346c16a604b8fa8ae0a79",wormholeRelayer:"0x774a70bbd03327c21460b60f25b677d9e46ab458",wormhole:"0x58f4c17449c90665891c42e14d34aae7a26a472e"}],["OptimismSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["ArbitrumSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0xaCF1ceeF35caAc005e15888dDb8A3515C41B4872",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Solana",{tokenMessenger:"CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3",messageTransmitter:"CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd",wormholeRelayer:"",wormhole:""}],["BaseSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Polygon",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0xe09A679F56207EF33F5b9d8fb4499Ec00792eA73",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}]]]],gatewayContracts=[["Mainnet",[["Wormchain","wormhole14ejqjyq8um4p3xfqj74yld5waqljf88fz25yxnma0cngspxe3les00fpjx"]]],["Testnet",[["Wormchain","wormhole1ctnjk7an90lz5wjfvr3cf6x984a8cjnv8dpmztmlpcq4xteaa2xs9pwmzk"]]]],translatorContracts=[["Mainnet",[["Sei","sei189adguawugk3e55zn63z8r9ll29xrjwca636ra7v7gxuzn98sxyqwzt47l"]]],["Testnet",[["Sei","sei1dkdwdvknx0qav5cp5kw68mkn3r99m3svkyjfvkztwh97dv2lm0ksj6xrak"]]]],rollupContractAddresses=[["Mainnet",[["Polygon",["Ethereum","0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287"]],["Optimism",["Ethereum","0xdfe97868233d1aa22e815a266982f2cf17685a27"]],["Arbitrum",["Ethereum","0x1c479675ad559dc151f6ec7ed3fbf8cee79582b6"]]]],["Testnet",[["Polygon",["Ethereum","0x2890ba17efe978480615e330ecb65333b880928e"]],["Optimism",["Ethereum","0xe6dfba0953616bacab0c9a8ecb3a9bba77fc15c0"]],["Arbitrum",["Ethereum","0x45af9ed1d03703e480ce7d328fb684bb67da5049"]]]]],porticoContracts=[["Mainnet",[["Ethereum",{portico:"0x48b6101128C0ed1E208b7C910e60542A2ee6f476",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e"}],["Polygon",{portico:"0x227bABe533fa9a1085f5261210E0B7137E44437B",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e"}],["Bsc",{portico:"0x05498574BD0Fa99eeCB01e1241661E7eE58F8a85",uniswapQuoterV2:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077"}],["Avalanche",{portico:"0xE565E118e75304dD3cF83dff409c90034b7EA18a",uniswapQuoterV2:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F"}],["Arbitrum",{portico:"0x48fa7528bFD6164DdF09dF0Ed22451cF59c84130",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e"}],["Optimism",{portico:"0x9ae506cDDd27DEe1275fd1fe6627E5dc65257061",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e"}],["Base",{portico:"0x610d4DFAC3EC32e0be98D18DDb280DACD76A1889",uniswapQuoterV2:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a"}]]]],coreBridge=constMap(coreBridgeContracts),tokenBridge$2=constMap(tokenBridgeContracts),tokenBridgeRelayer=constMap(tokenBridgeRelayerContracts),nftBridge=constMap(nftBridgeContracts),relayer$1=constMap(relayerContracts),gateway=constMap(gatewayContracts),translator=constMap(translatorContracts),portico$2=constMap(porticoContracts),circleContracts=constMap(circleContracts$1),rollupContracts=constMap(rollupContractAddresses),tokenBridgeChains=constMap(tokenBridgeContracts,[0,1]),tokenBridgeRelayerChains=constMap(tokenBridgeRelayerContracts,[0,1]),circleContractChains=constMap(circleContracts$1,[0,1]),porticoContractChains=constMap(porticoContracts,[0,1]),index=Object.freeze(Object.defineProperty({__proto__:null,circleContractChains,circleContracts,coreBridge,gateway,nftBridge,portico:portico$2,porticoContractChains,relayer:relayer$1,rollupContracts,tokenBridge:tokenBridge$2,tokenBridgeChains,tokenBridgeRelayer,tokenBridgeRelayerChains,translator},Symbol.toStringTag,{value:"Module"})),guardianKeyAndNameEntries=[["Mainnet",[["0x58CC3AE5C097b213cE3c81979e1B9f9570746AA5","JumpCrypto"],["0xfF6CB952589BDE862c25Ef4392132fb9D4A42157","Staked"],["0x114De8460193bdf3A2fCf81f86a09765F4762fD1","Figment"],["0x107A0086b32d7A0977926A205131d8731D39cbEB","ChainodeTech"],["0x8C82B2fd82FaeD2711d59AF0F2499D16e726f6b2","Inotel"],["0x11b39756C042441BE6D8650b69b54EbE715E2343","HashQuark"],["0x54Ce5B4D348fb74B958e8966e2ec3dBd4958a7cd","Chainlayer"],["0x15e7cAF07C4e3DC8e7C469f92C8Cd88FB8005a20","xLabs"],["0x74a3bf913953D695260D88BC1aA25A4eeE363ef0","Forbole"],["0x000aC0076727b35FBea2dAc28fEE5cCB0fEA768e","StakingFund"],["0xAF45Ced136b9D9e24903464AE889F5C8a723FC14","MoonletWallet"],["0xf93124b7c738843CBB89E864c862c38cddCccF95","P2PValidator"],["0xD2CC37A4dc036a8D232b48f62cDD4731412f4890","01Node"],["0xDA798F6896A3331F64b48c12D1D57Fd9cbe70811","MCF"],["0x71AA1BE1D36CaFE3867910F99C09e347899C19C3","Everstake"],["0x8192b6E7387CCd768277c17DAb1b7a5027c0b3Cf","ChorusOne"],["0x178e21ad2E77AE06711549CFBB1f9c7a9d8096e8","Syncnode"],["0x5E1487F35515d02A92753504a8D75471b9f49EdB","Triton"],["0x6FbEBc898F403E4773E95feB15E80C9A99c8348d","StakingFacilities"]]],["Testnet",[["0x13947Bd48b18E53fdAeEe77F3473391aC727C638","Testnet guardian"]]]],guardianKeys=column(cartesianRightRecursive(guardianKeyAndNameEntries),1),guardianNames=column(cartesianRightRecursive(guardianKeyAndNameEntries),2),guardianNameToKey=constMap(guardianKeyAndNameEntries,[[0,2],1]),guardianKeyToName=constMap(guardianKeyAndNameEntries,[1,[0,2]]),devnetGuardianPrivateKey="cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0",guardians=Object.freeze(Object.defineProperty({__proto__:null,devnetGuardianPrivateKey,guardianKeyToName,guardianKeys,guardianNameToKey,guardianNames},Symbol.toStringTag,{value:"Module"})),esm=Object.freeze(Object.defineProperty({__proto__:null,addFixedValues:addFixedValues$1,amount:amount$2,asChainId,assertChain,assertChainId,binaryLiterals,bitsetItem:bitsetItem$1,calcLayoutSize:calcLayoutSize$1,calcStaticLayoutSize:calcStaticLayoutSize$1,cartesianRightRecursive,chain:chains$1,chainIdToChain,chainIds,chainToChainId,chainToPlatform,chains,checkBytesTypeEqual,checkItemSize,checkNumEquals,checkSize,circle:circle$1,column,constMap,contracts:index,customizableBytes,decimals,defaultEndianness,deserializeLayout:deserializeLayout$1,dynamicItemsOfLayout:dynamicItemsOfLayout$1,elementIndexPairs,encoding:encoding$3,entries,enumItem:enumItem$1,explorer:explorer$1,filters,finality,findIdLayoutPair,fixedItemsOfLayout:fixedItemsOfLayout$1,getCachedSerializedFrom:getCachedSerializedFrom$1,guardians,isBytesType,isChain,isChainId,isEqualCaseInsensitive,isFixedBytesConversion,isFixedPrimitiveConversion,isFixedUintConversion,isLayout,isLayoutItem,isNetwork,isNumType,isPlatform,isPrimitiveType,layout:index$1,layoutDiscriminator:layoutDiscriminator$1,lazyInstantiate:lazyInstantiate$1,nativeChainIds,network:networks$1,networks,numberMaxSize,onlyOnce:onlyOnce$1,optionItem:optionItem$1,platform:platforms$1,platformToAddressFormat,platformToChains,platforms,range,rpc:rpc$3,serializeLayout:serializeLayout$1,serializeNum:serializeNum$1,throws:throws$1,toChain,toChainId,zip},Symbol.toStringTag,{value:"Module"})),networkOptions=[{env:"Mainnet",endpoint:"https://europe-west3-wormhole-message-db-mainnet.cloudfunctions.net",name:"Mainnet",logo:"",type:"cloudfunction"},{env:"Mainnet",endpoint:"https://wormhole-v2-mainnet-api.mcf.rocks",name:"MCF",logo:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCA0OCAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAuODk2IDEyVjAuNDhIMy4zNDRMNy4zNzYgNS4yOTZMMTEuMzkyIDAuNDhIMTMuODU2VjEySDExLjUzNlYzLjkyTDcuMzc2IDguODk2TDMuMiAzLjkzNlYxMkgwLjg5NlpNMjEuODAzOCAxMkMyMS4zNzcxIDEyIDIwLjk4NzggMTEuODk4NyAyMC42MzU4IDExLjY5NkMyMC4yOTQ0IDExLjQ4MjcgMjAuMDE3MSAxMS4yMDUzIDE5LjgwMzggMTAuODY0QzE5LjYwMTEgMTAuNTEyIDE5LjQ5OTggMTAuMTIyNyAxOS40OTk4IDkuNjk2VjIuNzg0QzE5LjQ5OTggMi4zNTczMyAxOS42MDExIDEuOTczMzMgMTkuODAzOCAxLjYzMkMyMC4wMTcxIDEuMjggMjAuMjk0NCAxLjAwMjY3IDIwLjYzNTggMC43OTk5OTlDMjAuOTg3OCAwLjU4NjY2NiAyMS4zNzcxIDAuNDggMjEuODAzOCAwLjQ4SDMwLjk4NzhWMi44SDIyLjM0NzhDMjIuMTc3MSAyLjggMjIuMDQzOCAyLjg0OCAyMS45NDc4IDIuOTQ0QzIxLjg1MTggMy4wMjkzMyAyMS44MDM4IDMuMTYyNjcgMjEuODAzOCAzLjM0NFY5LjEzNkMyMS44MDM4IDkuMzA2NjcgMjEuODUxOCA5LjQ0IDIxLjk0NzggOS41MzZDMjIuMDQzOCA5LjYzMiAyMi4xNzcxIDkuNjggMjIuMzQ3OCA5LjY4SDMwLjk4NzhWMTJIMjEuODAzOFpNMzYuNDQ4IDEyVjAuNDhINDcuMDcyVjIuOEgzOC43ODRWNS4wNzJINDUuNDU2VjcuNDA4SDM4Ljc4NFYxMkgzNi40NDhaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K",type:"guardian"},{env:"Mainnet",endpoint:"https://wormhole-v2-mainnet-api.chainlayer.network",name:"ChainLayer",logo:"",type:"guardian"},{env:"Mainnet",endpoint:"https://worm-dash-01.rockrpc.net",name:"RockawayX",logo:"",type:"guardian"},{env:"Mainnet",endpoint:"https://wormhole-v2-mainnet-api.staking.fund",name:"Staking Fund",logo:"",type:"guardian"},{env:"Testnet",endpoint:"https://europe-west3-wormhole-message-db-testnet.cloudfunctions.net",name:"Testnet",logo:"",type:"cloudfunction"},{env:"Testnet",endpoint:"https://p2p-guardian-testnet-web.solana.p2p.org",name:"Testnet - P2P",logo:"",type:"guardian"},{env:"Testnet",endpoint:"https://guardian.testnet.xlabs.xyz",name:"Testnet - xLabs (LB)",logo:"",type:"guardian"},{env:"Testnet",endpoint:"https://guardian-01.testnet.xlabs.xyz",name:"Testnet - xLabs 1",logo:"",type:"guardian"},{env:"Testnet",endpoint:"https://guardian-02.testnet.xlabs.xyz",name:"Testnet - xLabs 2",logo:"",type:"guardian"},{env:"Devnet",endpoint:"http://localhost:7071",name:"Devnet",logo:"",type:"guardian"}],defaultNetwork=networkOptions[0],urlParamKey="endpoint",NetworkContext=React$1.createContext({currentNetwork:defaultNetwork,setCurrentNetwork:()=>{}}),NetworkContextProvider=({children:s})=>{const{push:j,replace:$}=useHistory(),{search:_e}=useLocation(),{urlParams:et,urlNetwork:tt,currentNetwork:nt}=reactExports.useMemo(()=>{const it=new URLSearchParams(_e),st=it.get(urlParamKey),at=networkOptions.find(ct=>ct.name===st)||defaultNetwork;return{urlParams:it,urlNetwork:st,currentNetwork:at}},[_e]),rt=reactExports.useCallback((it,st)=>{tt!==it.name&&(et.set(urlParamKey,it.name),st?$({search:et.toString()}):j({search:et.toString()}))},[tt,et,$,j]);reactExports.useEffect(()=>{rt(nt,!0)},[nt,rt]);const ot=reactExports.useMemo(()=>({currentNetwork:nt,setCurrentNetwork:rt}),[nt,rt]);return jsxRuntimeExports.jsx(NetworkContext.Provider,{value:ot,children:s})},useNetworkContext=()=>reactExports.useContext(NetworkContext),useCurrentEnvironment=()=>reactExports.useContext(NetworkContext).currentNetwork.env;function useChainHeartbeats(s){const j={};return s.forEach(($,_e)=>{$.networks.forEach(et=>{j[et.id]||(j[et.id]=s.map(tt=>({guardian:tt.guardianAddr,name:tt.nodeName,network:{...et,contractAddress:"",errorCount:"0",height:"0",safeHeight:"0",finalizedHeight:"0"}}))),j[et.id][_e]={guardian:$.guardianAddr,name:$.nodeName,network:et}})}),j}var dist={},arrays={};Object.defineProperty(arrays,"__esModule",{value:!0});arrays.chunkArray=void 0;function chunkArray(s,j){const $=[];for(let _e=0;_e{try{return(0,sdk_base_1$f.toChain)(s)}catch{}return"Unknown"};chainIdToName$1.chainIdToName=chainIdToName;var consts={};(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.isTokenDenylisted=s.TVL_TOKEN_DENYLIST=s.GUARDIAN_SET_4=s.NTT_ACCOUNTANT_CONTRACT_ADDRESS_TESTNET=s.NTT_ACCOUNTANT_CONTRACT_ADDRESS_MAINNET=s.ACCOUNTANT_CONTRACT_ADDRESS=s.CIRCLE_DOMAIN_TO_CHAIN_ID=s.isCircleIntegrationEmitter=s.CIRCLE_INTEGRATION_EMITTERS=s.isNFTBridgeEmitter=s.NFT_BRIDGE_EMITTERS=s.isTokenBridgeEmitter=s.TOKEN_BRIDGE_EMITTERS=s.getMissThreshold=s.INITIAL_DEPLOYMENT_BLOCK_BY_MODE=s.INITIAL_FT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN=s.INITIAL_NTT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN=s.INITIAL_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN=s.VAA_VERSION=s.MAX_VAA_DECIMALS=s.MISS_THRESHOLD_LABEL=void 0;const j=require$$0$6,$=40;s.MISS_THRESHOLD_LABEL="40 minutes",s.MAX_VAA_DECIMALS=8,s.VAA_VERSION=1,s.INITIAL_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN={Mainnet:{Ethereum:"12959638",Terra:"4810000",Bsc:"9745450",Polygon:"20629146",Avalanche:"8237163",Oasis:"1757",Algorand:"22931277",Fantom:"31817467",Karura:"1824665",Acala:"1144161",Klaytn:"90563824",Celo:"12947144",Moonbeam:"1486591",Terra2:"399813",Injective:"20908376",Arbitrum:"18128584",Optimism:"69401779",Aptos:"0",Near:"72767136",Xpla:"777549",Solana:"94396403",Sui:"1485552",Base:"1422314",Scroll:"4955534",Mantle:"64176265",Blast:"2375628",Sei:"238594",Wormchain:"4510119"},Testnet:{Ethereum:"0",Terra:"0",Bsc:"0",Polygon:"0",Avalanche:"0",Oasis:"0",Algorand:"0",Fantom:"0",Karura:"0",Acala:"0",Klaytn:"0",Celo:"0",Moonbeam:"0",Terra2:"0",Injective:"0",Arbitrum:"0",Optimism:"0",Aptos:"0",Near:"0",Xpla:"0",Solana:"0",Sui:"0",Scroll:"0",Mantle:"0",Blast:"0",Base:"0",Sei:"0",Wormchain:"4495661",PolygonSepolia:"2379275",Berachain:"1473347"},Devnet:{}},s.INITIAL_NTT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN={Mainnet:{Solana:"260508723",Ethereum:"19583505",Fantom:"78727372",Arbitrum:"201652677",Optimism:"118840800",Base:"13245519"},Testnet:{Solana:"285100152",Sepolia:"5472203",ArbitrumSepolia:"22501243",BaseSepolia:"7249669",OptimismSepolia:"9232548"},Devnet:{}},s.INITIAL_FT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN={Mainnet:{},Testnet:{Solana:"302162456",ArbitrumSepolia:"49505590"},Devnet:{}},s.INITIAL_DEPLOYMENT_BLOCK_BY_MODE={vaa:s.INITIAL_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN,ntt:s.INITIAL_NTT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN,ft:s.INITIAL_FT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN};function _e(ot,it){let st;try{let ct;typeof it=="string"&&!Number.isNaN(Number(it))?ct=(0,j.toChainId)(Number(it)):ct=(0,j.toChainId)(it),st=ct===(0,j.toChainId)("Scroll")?120:$}catch{st=$}const at=ot;return at.setMinutes(at.getMinutes()-st),at.toISOString()}s.getMissThreshold=_e,s.TOKEN_BRIDGE_EMITTERS={Solana:"ec7372995d5cc8732397fb0ad35c0121e0eaa90d26f828a534cab54391b3a4f5",Ethereum:"0000000000000000000000003ee18b2214aff97000d974cf647e7c347e8fa585",Terra:"0000000000000000000000007cf7b764e38a0a5e967972c1df77d432510564e2",Terra2:"a463ad028fb79679cfc8ce1efba35ac0e77b35080a1abe9bebe83461f176b0a3",Bsc:"000000000000000000000000b6f6d86a8f9879a9c87f643768d9efc38c1da6e7",Polygon:"0000000000000000000000005a58505a96d1dbf8df91cb21b54419fc36e93fde",Avalanche:"0000000000000000000000000e082f06ff657d94310cb8ce8b0d9a04541d8052",Oasis:"0000000000000000000000005848c791e09901b40a9ef749f2a6735b418d7564",Algorand:"67e93fa6c8ac5c819990aa7340c0c16b508abb1178be9b30d024b8ac25193d45",Aptos:"0000000000000000000000000000000000000000000000000000000000000001",Aurora:"00000000000000000000000051b5123a7b0f9b2ba265f9c4c8de7d78d52f510f",Fantom:"0000000000000000000000007c9fc5741288cdfdd83ceb07f3ea7e22618d79d2",Karura:"000000000000000000000000ae9d7fe007b3327aa64a32824aaac52c42a6e624",Acala:"000000000000000000000000ae9d7fe007b3327aa64a32824aaac52c42a6e624",Klaytn:"0000000000000000000000005b08ac39eaed75c0439fc750d9fe7e1f9dd0193f",Celo:"000000000000000000000000796dff6d74f3e27060b71255fe517bfb23c93eed",Near:"148410499d3fcda4dcfd68a1ebfcdddda16ab28326448d4aae4d2f0465cdfcb7",Moonbeam:"000000000000000000000000b1731c586ca89a23809861c6103f0b96b3f57d92",Arbitrum:"0000000000000000000000000b2402144bb366a632d14b83f244d2e0e21bd39c",Optimism:"0000000000000000000000001d68124e65fafc907325e3edbf8c4d84499daa8b",Xpla:"8f9cf727175353b17a5f574270e370776123d90fd74956ae4277962b4fdee24c",Injective:"00000000000000000000000045dbea4617971d93188eda21530bc6503d153313",Sui:"ccceeb29348f71bdd22ffef43a2a19c1f5b5e17c5cca5411529120182672ade5",Base:"0000000000000000000000008d2de8d2f73f1f4cab472ac9a881c9b123c79627",Scroll:"00000000000000000000000024850c6f61C438823F01B7A3BF2B89B72174Fa9d",Mantle:"00000000000000000000000024850c6f61C438823F01B7A3BF2B89B72174Fa9d",Blast:"00000000000000000000000024850c6f61C438823F01B7A3BF2B89B72174Fa9d",Xlayer:"0000000000000000000000005537857664B0f9eFe38C9f320F75fEf23234D904",Sei:"86c5fd957e2db8389553e1728f9c27964b22a8154091ccba54d75f4b10c61f5e",Wormchain:"aeb534c45c3049d380b9d9b966f9895f53abd4301bfaff407fa09dea8ae7a924"};const et=(ot,it)=>{var st;return((st=s.TOKEN_BRIDGE_EMITTERS[(0,j.toChain)(ot)])==null?void 0:st.toLowerCase())===it.toLowerCase()};s.isTokenBridgeEmitter=et,s.NFT_BRIDGE_EMITTERS={Solana:"0def15a24423e1edd1a5ab16f557b9060303ddbab8c803d2ee48f4b78a1cfd6b",Ethereum:"0000000000000000000000006ffd7ede62328b3af38fcd61461bbfc52f5651fe",Bsc:"0000000000000000000000005a58505a96d1dbf8df91cb21b54419fc36e93fde",Polygon:"00000000000000000000000090bbd86a6fe93d3bc3ed6335935447e75fab7fcf",Avalanche:"000000000000000000000000f7b6737ca9c4e08ae573f75a97b73d7a813f5de5",Oasis:"00000000000000000000000004952d522ff217f40b5ef3cbf659eca7b952a6c1",Aurora:"0000000000000000000000006dcc0484472523ed9cdc017f711bcbf909789284",Fantom:"000000000000000000000000a9c7119abda80d4a4e0c06c8f4d8cf5893234535",Karura:"000000000000000000000000b91e3638f82a1facb28690b37e3aae45d2c33808",Acala:"000000000000000000000000b91e3638f82a1facb28690b37e3aae45d2c33808",Klaytn:"0000000000000000000000003c3c561757baa0b78c5c025cdeaa4ee24c1dffef",Celo:"000000000000000000000000a6a377d75ca5c9052c9a77ed1e865cc25bd97bf3",Moonbeam:"000000000000000000000000453cfbe096c0f8d763e8c5f24b441097d577bde2",Arbitrum:"0000000000000000000000003dd14d553cfd986eac8e3bddf629d82073e188c8",Optimism:"000000000000000000000000fe8cd454b4a1ca468b57d79c0cc77ef5b6f64585",Aptos:"0000000000000000000000000000000000000000000000000000000000000005",Base:"000000000000000000000000da3adc6621b2677bef9ad26598e6939cf0d92f88"};const tt=(ot,it)=>{var st;return((st=s.NFT_BRIDGE_EMITTERS[(0,j.toChain)(ot)])==null?void 0:st.toLowerCase())===it.toLowerCase()};s.isNFTBridgeEmitter=tt,s.CIRCLE_INTEGRATION_EMITTERS={Ethereum:"000000000000000000000000aada05bd399372f0b0463744c09113c137636f6a",Avalanche:"00000000000000000000000009fb06a271faff70a651047395aaeb6265265f13",Optimism:"0000000000000000000000002703483b1a5a7c577e8680de9df8be03c6f30e3c",Arbitrum:"0000000000000000000000002703483b1a5a7c577e8680de9df8be03c6f30e3c",Base:"00000000000000000000000003faBB06Fa052557143dC28eFCFc63FC12843f1D",Polygon:"0000000000000000000000000FF28217dCc90372345954563486528aa865cDd6"};const nt=(ot,it)=>{var st;return((st=s.CIRCLE_INTEGRATION_EMITTERS[(0,j.toChain)(ot)])==null?void 0:st.toLowerCase())===it.toLowerCase()};s.isCircleIntegrationEmitter=nt,s.CIRCLE_DOMAIN_TO_CHAIN_ID={0:(0,j.chainToChainId)("Ethereum"),1:(0,j.chainToChainId)("Avalanche"),2:(0,j.chainToChainId)("Optimism"),3:(0,j.chainToChainId)("Arbitrum"),6:(0,j.chainToChainId)("Base"),7:(0,j.chainToChainId)("Polygon")},s.ACCOUNTANT_CONTRACT_ADDRESS="wormhole14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9srrg465",s.NTT_ACCOUNTANT_CONTRACT_ADDRESS_MAINNET="wormhole1mc23vtzxh46e63vq22e8cnv23an06akvkqws04kghkrxrauzpgwq2hmwm7",s.NTT_ACCOUNTANT_CONTRACT_ADDRESS_TESTNET="wormhole169tvyx49zmjqhlv7mzwj8j2weprascc0jq3rdglw9pynldqx34nscvhc7k",s.GUARDIAN_SET_4=[{pubkey:"0x5893B5A76c3f739645648885bDCcC06cd70a3Cd3",name:"RockawayX"},{pubkey:"0xfF6CB952589BDE862c25Ef4392132fb9D4A42157",name:"Staked"},{pubkey:"0x114De8460193bdf3A2fCf81f86a09765F4762fD1",name:"Figment"},{pubkey:"0x107A0086b32d7A0977926A205131d8731D39cbEB",name:"ChainodeTech"},{pubkey:"0x8C82B2fd82FaeD2711d59AF0F2499D16e726f6b2",name:"Inotel"},{pubkey:"0x11b39756C042441BE6D8650b69b54EbE715E2343",name:"HashQuark"},{pubkey:"0x54Ce5B4D348fb74B958e8966e2ec3dBd4958a7cd",name:"Chainlayer"},{pubkey:"0x15e7cAF07C4e3DC8e7C469f92C8Cd88FB8005a20",name:"xLabs"},{pubkey:"0x74a3bf913953D695260D88BC1aA25A4eeE363ef0",name:"Forbole"},{pubkey:"0x000aC0076727b35FBea2dAc28fEE5cCB0fEA768e",name:"Staking Fund"},{pubkey:"0xAF45Ced136b9D9e24903464AE889F5C8a723FC14",name:"MoonletWallet"},{pubkey:"0xf93124b7c738843CBB89E864c862c38cddCccF95",name:"P2P Validator"},{pubkey:"0xD2CC37A4dc036a8D232b48f62cDD4731412f4890",name:"01Node"},{pubkey:"0xDA798F6896A3331F64b48c12D1D57Fd9cbe70811",name:"MCF"},{pubkey:"0x71AA1BE1D36CaFE3867910F99C09e347899C19C3",name:"Everstake"},{pubkey:"0x8192b6E7387CCd768277c17DAb1b7a5027c0b3Cf",name:"Chorus One"},{pubkey:"0x178e21ad2E77AE06711549CFBB1f9c7a9d8096e8",name:"Syncnode"},{pubkey:"0x5E1487F35515d02A92753504a8D75471b9f49EdB",name:"Triton"},{pubkey:"0x6FbEBc898F403E4773E95feB15E80C9A99c8348d",name:"Staking Facilities"}],s.TVL_TOKEN_DENYLIST={[(0,j.chainToChainId)("Fantom")]:["0x5b2af7fd27e2ea14945c82dd254c79d3ed34685e"]};const rt=(ot,it)=>{var st;return((st=s.TVL_TOKEN_DENYLIST[ot])==null?void 0:st.includes(it.toLowerCase()))??!1};s.isTokenDenylisted=rt})(consts);var explorer={},safeBuffer={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(s,j){var $=buffer,_e=$.Buffer;function et(nt,rt){for(var ot in nt)rt[ot]=nt[ot]}_e.from&&_e.alloc&&_e.allocUnsafe&&_e.allocUnsafeSlow?s.exports=$:(et($,j),j.Buffer=tt);function tt(nt,rt,ot){return _e(nt,rt,ot)}tt.prototype=Object.create(_e.prototype),et(_e,tt),tt.from=function(nt,rt,ot){if(typeof nt=="number")throw new TypeError("Argument must not be a number");return _e(nt,rt,ot)},tt.alloc=function(nt,rt,ot){if(typeof nt!="number")throw new TypeError("Argument must be a number");var it=_e(nt);return rt!==void 0?typeof ot=="string"?it.fill(rt,ot):it.fill(rt):it.fill(0),it},tt.allocUnsafe=function(nt){if(typeof nt!="number")throw new TypeError("Argument must be a number");return _e(nt)},tt.allocUnsafeSlow=function(nt){if(typeof nt!="number")throw new TypeError("Argument must be a number");return $.SlowBuffer(nt)}})(safeBuffer,safeBuffer.exports);var safeBufferExports=safeBuffer.exports,_Buffer=safeBufferExports.Buffer;function base(s){if(s.length>=255)throw new TypeError("Alphabet too long");for(var j=new Uint8Array(256),$=0;$>>0,pt=new Uint8Array(yt);gt!==ht;){for(var Mt=lt[gt],St=0,Tt=yt-1;(Mt!==0||St>>0,pt[Tt]=Mt%nt>>>0,Mt=Mt/nt>>>0;if(Mt!==0)throw new Error("Non-zero carry");ft=St,gt++}for(var vt=yt-ft;vt!==yt&&pt[vt]===0;)vt++;for(var Dt=rt.repeat(dt);vt>>0,yt=new Uint8Array(ht);lt[dt];){var pt=j[lt.charCodeAt(dt)];if(pt===255)return;for(var Mt=0,St=ht-1;(pt!==0||Mt>>0,yt[St]=pt%256>>>0,pt=pt/256>>>0;if(pt!==0)throw new Error("Non-zero carry");gt=Mt,dt++}for(var Tt=ht-gt;Tt!==ht&&yt[Tt]===0;)Tt++;var vt=_Buffer.allocUnsafe(ft+(ht-Tt));vt.fill(0,0,ft);for(var Dt=ft;Tt!==ht;)vt[Dt++]=yt[Tt++];return vt}function ct(lt){var dt=at(lt);if(dt)return dt;throw new Error("Non-base"+nt+" character")}return{encode:st,decodeUnsafe:at,decode:ct}}var src=base,basex=src,ALPHABET$1="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",bs58=basex(ALPHABET$1);const base58=getDefaultExportFromCjs$1(bs58);var __importDefault$4=commonjsGlobal$1&&commonjsGlobal$1.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(explorer,"__esModule",{value:!0});explorer.getExplorerTxHash=explorer.explorerVaa=explorer.explorerTx=explorer.explorerBlock=void 0;const sdk_base_1$e=require$$0$6,bs58_1$2=__importDefault$4(bs58),buffer_1$2=buffer,explorerBlock=(s,j,$)=>s==="Mainnet"?j===(0,sdk_base_1$e.chainToChainId)("Solana")?`https://solana.fm/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Ethereum")?`https://etherscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Terra")?`https://finder.terra.money/columbus-5/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Bsc")?`https://bscscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Polygon")?`https://polygonscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Avalanche")?`https://snowtrace.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Oasis")?`https://explorer.emerald.oasis.dev/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Algorand")?`https://app.dappflow.org/explorer/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Fantom")?`https://ftmscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Karura")?`https://blockscout.karura.network/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Acala")?`https://blockscout.acala.network/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Klaytn")?`https://scope.klaytn.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Celo")?`https://explorer.celo.org/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Near")?`https://nearblocks.io/blocks/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Moonbeam")?`https://moonscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Terra2")?`https://finder.terra.money/phoenix-1/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Injective")?`https://explorer.injective.network/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sui")?`https://suiexplorer.com/checkpoint/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Aptos")?`https://explorer.aptoslabs.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Arbitrum")?`https://arbiscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Optimism")?`https://optimistic.etherscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xpla")?`https://explorer.xpla.io/mainnet/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Base")?`https://basescan.org/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sei")?`https://www.seiscan.app/pacific-1/blocks/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Scroll")?`https://scrollscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Mantle")?`https://explorer.mantle.xyz/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Blast")?`https://blastscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xlayer")?`https://www.oklink.com/xlayer/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Linea")?`https://lineascan.build/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Berachain")?`https://beratrail.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Wormchain")?`https://bigdipper.live/wormhole/blocks/${$}`:"":j===(0,sdk_base_1$e.chainToChainId)("Solana")?`https://explorer.solana.com/${$}?cluster=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Ethereum")?`https://sepolia.etherscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Bsc")?`https://testnet.bscscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Polygon")?`https://mumbai.polygonscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Avalanche")?`https://testnet.snowtrace.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Oasis")?`https://testnet.oasisscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Algorand")?`https://app.dappflow.org/explorer/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Fantom")?`https://testnet.ftmscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Acala")?`https://blockscout.mandala.aca-staging.network/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Klaytn")?`https://baobab.klaytnscope.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Celo")?`https://alfajores.celoscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Moonbeam")?`https://moonbase.moonscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sui")?`https://suiexplorer.com/checkpoint/${$}?network=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Aptos")?`https://explorer.aptoslabs.com/block/${$}?network=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Arbitrum")?`https://sepolia.arbiscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Optimism")?`https://sepolia-optimism.etherscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xpla")?`https://explorer.xpla.io/testnet/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Base")?`https://goerli.basescan.org/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sei")?`https://www.seiscan.app/atlantic-2/blocks/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Scroll")?`https://sepolia.scrollscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Mantle")?`https://explorer.sepolia.mantle.xyz/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Blast")?`https://testnet.blastscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xlayer")?`https://www.oklink.com/xlayer-test/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Linea")?`https://sepolia.lineascan.build/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Berachain")?`https://artio.beratrail.io/block/${$}`:"";explorer.explorerBlock=explorerBlock;const explorerTx=(s,j,$)=>s==="Mainnet"?j===(0,sdk_base_1$e.chainToChainId)("Solana")?`https://solana.fm/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Ethereum")?`https://etherscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Terra")?`https://finder.terra.money/columbus-5/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Bsc")?`https://bscscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Polygon")?`https://polygonscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Avalanche")?`https://snowtrace.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Oasis")?`https://explorer.emerald.oasis.dev/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Algorand")?`https://app.dappflow.org/explorer/transaction/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Fantom")?`https://ftmscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Karura")?`https://blockscout.karura.network/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Acala")?`https://blockscout.acala.network/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Klaytn")?`https://scope.klaytn.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Celo")?`https://explorer.celo.org/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Near")?`https://explorer.near.org/transactions/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Moonbeam")?`https://moonscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Terra2")?`https://finder.terra.money/phoenix-1/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Injective")?`https://explorer.injective.network/transaction/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sui")?`https://suiexplorer.com/txblock/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Aptos")?`https://explorer.aptoslabs.com/txn/${$}?network=mainnet`:j===(0,sdk_base_1$e.chainToChainId)("Arbitrum")?`https://arbiscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Optimism")?`https://optimistic.etherscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xpla")?`https://explorer.xpla.io/mainnet/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Base")?`https://basescan.org/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sei")?`https://www.seiscan.app/pacific-1/txs/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Scroll")?`https://scrollscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Mantle")?`https://explorer.mantle.xyz/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Blast")?`https://blastscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xlayer")?`https://www.oklink.com/xlayer/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Linea")?`https://lineascan.build/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Berachain")?`https://artio.beratrail.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Wormchain")?`https://bigdipper.live/wormhole/transactions/${$}`:"":j===(0,sdk_base_1$e.chainToChainId)("Solana")?`https://solscan.io/txs/${$}?cluster=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Ethereum")?`https://sepolia.etherscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Bsc")?`https://testnet.bscscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Polygon")?`https://mumbai.polygonscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Avalanche")?`https://testnet.snowtrace.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Oasis")?`https://testnet.oasisscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Algorand")?`https://app.dappflow.org/explorer/transaction/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Fantom")?`https://testnet.ftmscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Acala")?`https://blockscout.mandala.aca-staging.network/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Klaytn")?`https://baobab.klaytnscope.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Celo")?`https://alfajores.celoscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Moonbeam")?`https://moonbase.moonscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sui")?`https://suiexplorer.com/txblock/${$}?network=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Aptos")?`https://explorer.aptoslabs.com/txn/${$}?network=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Arbitrum")?`https://sepolia.arbiscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Optimism")?`https://sepolia-optimism.etherscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xpla")?`https://explorer.xpla.io/testnet/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Base")?`https://goerli.basescan.org/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sei")?`https://www.seiscan.app/atlantic-2/txs/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Scroll")?`https://sepolia.scrollscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Mantle")?`https://explorer.sepolia.mantle.xyz/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Blast")?`https://testnet.blastscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xlayer")?`https://www.oklink.com/xlayer-test/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Linea")?`https://sepolia.lineascan.build/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Berachain")?`https://artio.beratrail.io/tx/${$}`:"";explorer.explorerTx=explorerTx;const explorerVaa=(s,j)=>s==="Mainnet"?`https://wormholescan.io/#/tx/${j}`:`https://wormholescan.io/#/tx/${j}?network=TESTNET`;explorer.explorerVaa=explorerVaa;const getExplorerTxHash=(s,j,$)=>{let _e="";const et=(0,sdk_base_1$e.chainToPlatform)((0,sdk_base_1$e.chainIdToChain)(j));if(et==="Cosmwasm")_e=$.slice(2);else if(et==="Sui"||et==="Solana"){const tt=buffer_1$2.Buffer.from($.slice(2),"hex");_e=bs58_1$2.default.encode(tt)}else _e=$;return _e};explorer.getExplorerTxHash=getExplorerTxHash;var solana={},sha512={},_md={},_assert={};Object.defineProperty(_assert,"__esModule",{value:!0});_assert.output=_assert.exists=_assert.hash=_assert.bytes=_assert.bool=_assert.number=_assert.isBytes=void 0;function number$2(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`positive integer expected, not ${s}`)}_assert.number=number$2;function bool(s){if(typeof s!="boolean")throw new Error(`boolean expected, not ${s}`)}_assert.bool=bool;function isBytes$2(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}_assert.isBytes=isBytes$2;function bytes$1(s,...j){if(!isBytes$2(s))throw new Error("Uint8Array expected");if(j.length>0&&!j.includes(s.length))throw new Error(`Uint8Array expected of length ${j}, not of length=${s.length}`)}_assert.bytes=bytes$1;function hash$1(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$2(s.outputLen),number$2(s.blockLen)}_assert.hash=hash$1;function exists$1(s,j=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(j&&s.finished)throw new Error("Hash#digest() has already been called")}_assert.exists=exists$1;function output$1(s,j){bytes$1(s);const $=j.outputLen;if(s.length<$)throw new Error(`digestInto() expects output buffer of length at least ${$}`)}_assert.output=output$1;const assert$2={number:number$2,bool,bytes:bytes$1,hash:hash$1,exists:exists$1,output:output$1};_assert.default=assert$2;var utils$7={},crypto$2={};Object.defineProperty(crypto$2,"__esModule",{value:!0});crypto$2.crypto=void 0;crypto$2.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(s){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(s,"__esModule",{value:!0}),s.randomBytes=s.wrapXOFConstructorWithOpts=s.wrapConstructorWithOpts=s.wrapConstructor=s.checkOpts=s.Hash=s.concatBytes=s.toBytes=s.utf8ToBytes=s.asyncLoop=s.nextTick=s.hexToBytes=s.bytesToHex=s.byteSwap32=s.byteSwapIfBE=s.byteSwap=s.isLE=s.rotl=s.rotr=s.createView=s.u32=s.u8=s.isBytes=void 0;const j=crypto$2,$=_assert;function _e(Pt){return Pt instanceof Uint8Array||Pt!=null&&typeof Pt=="object"&&Pt.constructor.name==="Uint8Array"}s.isBytes=_e;const et=Pt=>new Uint8Array(Pt.buffer,Pt.byteOffset,Pt.byteLength);s.u8=et;const tt=Pt=>new Uint32Array(Pt.buffer,Pt.byteOffset,Math.floor(Pt.byteLength/4));s.u32=tt;const nt=Pt=>new DataView(Pt.buffer,Pt.byteOffset,Pt.byteLength);s.createView=nt;const rt=(Pt,Lt)=>Pt<<32-Lt|Pt>>>Lt;s.rotr=rt;const ot=(Pt,Lt)=>Pt<>>32-Lt>>>0;s.rotl=ot,s.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const it=Pt=>Pt<<24&4278190080|Pt<<8&16711680|Pt>>>8&65280|Pt>>>24&255;s.byteSwap=it,s.byteSwapIfBE=s.isLE?Pt=>Pt:Pt=>(0,s.byteSwap)(Pt);function st(Pt){for(let Lt=0;LtLt.toString(16).padStart(2,"0"));function ct(Pt){(0,$.bytes)(Pt);let Lt="";for(let mt=0;mt=lt._0&&Pt<=lt._9)return Pt-lt._0;if(Pt>=lt._A&&Pt<=lt._F)return Pt-(lt._A-10);if(Pt>=lt._a&&Pt<=lt._f)return Pt-(lt._a-10)}function ft(Pt){if(typeof Pt!="string")throw new Error("hex string expected, got "+typeof Pt);const Lt=Pt.length,mt=Lt/2;if(Lt%2)throw new Error("padded hex string expected, got unpadded hex of length "+Lt);const xt=new Uint8Array(mt);for(let It=0,jt=0;It{};s.nextTick=gt;async function ht(Pt,Lt,mt){let xt=Date.now();for(let It=0;It=0&&jtPt().update(pt(xt)).digest(),mt=Pt();return Lt.outputLen=mt.outputLen,Lt.blockLen=mt.blockLen,Lt.create=()=>Pt(),Lt}s.wrapConstructor=Dt;function zt(Pt){const Lt=(xt,It)=>Pt(It).update(pt(xt)).digest(),mt=Pt({});return Lt.outputLen=mt.outputLen,Lt.blockLen=mt.blockLen,Lt.create=xt=>Pt(xt),Lt}s.wrapConstructorWithOpts=zt;function Ot(Pt){const Lt=(xt,It)=>Pt(It).update(pt(xt)).digest(),mt=Pt({});return Lt.outputLen=mt.outputLen,Lt.blockLen=mt.blockLen,Lt.create=xt=>Pt(xt),Lt}s.wrapXOFConstructorWithOpts=Ot;function Ft(Pt=32){if(j.crypto&&typeof j.crypto.getRandomValues=="function")return j.crypto.getRandomValues(new Uint8Array(Pt));throw new Error("crypto.getRandomValues must be defined")}s.randomBytes=Ft})(utils$7);Object.defineProperty(_md,"__esModule",{value:!0});_md.HashMD=_md.Maj=_md.Chi=void 0;const _assert_js_1=_assert,utils_js_1$a=utils$7;function setBigUint64$1(s,j,$,_e){if(typeof s.setBigUint64=="function")return s.setBigUint64(j,$,_e);const et=BigInt(32),tt=BigInt(4294967295),nt=Number($>>et&tt),rt=Number($&tt),ot=_e?4:0,it=_e?0:4;s.setUint32(j+ot,nt,_e),s.setUint32(j+it,rt,_e)}const Chi$1=(s,j,$)=>s&j^~s&$;_md.Chi=Chi$1;const Maj$1=(s,j,$)=>s&j^s&$^j&$;_md.Maj=Maj$1;let HashMD$1=class extends utils_js_1$a.Hash{constructor(j,$,_e,et){super(),this.blockLen=j,this.outputLen=$,this.padOffset=_e,this.isLE=et,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(j),this.view=(0,utils_js_1$a.createView)(this.buffer)}update(j){(0,_assert_js_1.exists)(this);const{view:$,buffer:_e,blockLen:et}=this;j=(0,utils_js_1$a.toBytes)(j);const tt=j.length;for(let nt=0;ntet-nt&&(this.process(_e,0),nt=0);for(let at=nt;atst.length)throw new Error("_sha2: outputLen bigger than state");for(let at=0;at>_32n$1&U32_MASK64$1)}:{h:Number(s>>_32n$1&U32_MASK64$1)|0,l:Number(s&U32_MASK64$1)|0}}_u64.fromBig=fromBig$1;function split$1(s,j=!1){let $=new Uint32Array(s.length),_e=new Uint32Array(s.length);for(let et=0;etBigInt(s>>>0)<<_32n$1|BigInt(j>>>0);_u64.toBig=toBig;const shrSH=(s,j,$)=>s>>>$;_u64.shrSH=shrSH;const shrSL=(s,j,$)=>s<<32-$|j>>>$;_u64.shrSL=shrSL;const rotrSH=(s,j,$)=>s>>>$|j<<32-$;_u64.rotrSH=rotrSH;const rotrSL=(s,j,$)=>s<<32-$|j>>>$;_u64.rotrSL=rotrSL;const rotrBH=(s,j,$)=>s<<64-$|j>>>$-32;_u64.rotrBH=rotrBH;const rotrBL=(s,j,$)=>s>>>$-32|j<<64-$;_u64.rotrBL=rotrBL;const rotr32H=(s,j)=>j;_u64.rotr32H=rotr32H;const rotr32L=(s,j)=>s;_u64.rotr32L=rotr32L;const rotlSH$1=(s,j,$)=>s<<$|j>>>32-$;_u64.rotlSH=rotlSH$1;const rotlSL$1=(s,j,$)=>j<<$|s>>>32-$;_u64.rotlSL=rotlSL$1;const rotlBH$1=(s,j,$)=>j<<$-32|s>>>64-$;_u64.rotlBH=rotlBH$1;const rotlBL$1=(s,j,$)=>s<<$-32|j>>>64-$;_u64.rotlBL=rotlBL$1;function add(s,j,$,_e){const et=(j>>>0)+(_e>>>0);return{h:s+$+(et/2**32|0)|0,l:et|0}}_u64.add=add;const add3L=(s,j,$)=>(s>>>0)+(j>>>0)+($>>>0);_u64.add3L=add3L;const add3H=(s,j,$,_e)=>j+$+_e+(s/2**32|0)|0;_u64.add3H=add3H;const add4L=(s,j,$,_e)=>(s>>>0)+(j>>>0)+($>>>0)+(_e>>>0);_u64.add4L=add4L;const add4H=(s,j,$,_e,et)=>j+$+_e+et+(s/2**32|0)|0;_u64.add4H=add4H;const add5L=(s,j,$,_e,et)=>(s>>>0)+(j>>>0)+($>>>0)+(_e>>>0)+(et>>>0);_u64.add5L=add5L;const add5H=(s,j,$,_e,et,tt)=>j+$+_e+et+tt+(s/2**32|0)|0;_u64.add5H=add5H;const u64$1={fromBig:fromBig$1,split:split$1,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH:rotlSH$1,rotlSL:rotlSL$1,rotlBH:rotlBH$1,rotlBL:rotlBL$1,add,add3L,add3H,add4L,add4H,add5H,add5L};_u64.default=u64$1;Object.defineProperty(sha512,"__esModule",{value:!0});sha512.sha384=sha512.sha512_256=sha512.sha512_224=sha512_1=sha512.sha512=sha512.SHA512=void 0;const _md_js_1=_md,_u64_js_1=_u64,utils_js_1$9=utils$7,[SHA512_Kh,SHA512_Kl]=_u64_js_1.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(s=>BigInt(s))),SHA512_W_H=new Uint32Array(80),SHA512_W_L=new Uint32Array(80);class SHA512 extends _md_js_1.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:j,Al:$,Bh:_e,Bl:et,Ch:tt,Cl:nt,Dh:rt,Dl:ot,Eh:it,El:st,Fh:at,Fl:ct,Gh:lt,Gl:dt,Hh:ft,Hl:gt}=this;return[j,$,_e,et,tt,nt,rt,ot,it,st,at,ct,lt,dt,ft,gt]}set(j,$,_e,et,tt,nt,rt,ot,it,st,at,ct,lt,dt,ft,gt){this.Ah=j|0,this.Al=$|0,this.Bh=_e|0,this.Bl=et|0,this.Ch=tt|0,this.Cl=nt|0,this.Dh=rt|0,this.Dl=ot|0,this.Eh=it|0,this.El=st|0,this.Fh=at|0,this.Fl=ct|0,this.Gh=lt|0,this.Gl=dt|0,this.Hh=ft|0,this.Hl=gt|0}process(j,$){for(let pt=0;pt<16;pt++,$+=4)SHA512_W_H[pt]=j.getUint32($),SHA512_W_L[pt]=j.getUint32($+=4);for(let pt=16;pt<80;pt++){const Mt=SHA512_W_H[pt-15]|0,St=SHA512_W_L[pt-15]|0,Tt=_u64_js_1.default.rotrSH(Mt,St,1)^_u64_js_1.default.rotrSH(Mt,St,8)^_u64_js_1.default.shrSH(Mt,St,7),vt=_u64_js_1.default.rotrSL(Mt,St,1)^_u64_js_1.default.rotrSL(Mt,St,8)^_u64_js_1.default.shrSL(Mt,St,7),Dt=SHA512_W_H[pt-2]|0,zt=SHA512_W_L[pt-2]|0,Ot=_u64_js_1.default.rotrSH(Dt,zt,19)^_u64_js_1.default.rotrBH(Dt,zt,61)^_u64_js_1.default.shrSH(Dt,zt,6),Ft=_u64_js_1.default.rotrSL(Dt,zt,19)^_u64_js_1.default.rotrBL(Dt,zt,61)^_u64_js_1.default.shrSL(Dt,zt,6),Pt=_u64_js_1.default.add4L(vt,Ft,SHA512_W_L[pt-7],SHA512_W_L[pt-16]),Lt=_u64_js_1.default.add4H(Pt,Tt,Ot,SHA512_W_H[pt-7],SHA512_W_H[pt-16]);SHA512_W_H[pt]=Lt|0,SHA512_W_L[pt]=Pt|0}let{Ah:_e,Al:et,Bh:tt,Bl:nt,Ch:rt,Cl:ot,Dh:it,Dl:st,Eh:at,El:ct,Fh:lt,Fl:dt,Gh:ft,Gl:gt,Hh:ht,Hl:yt}=this;for(let pt=0;pt<80;pt++){const Mt=_u64_js_1.default.rotrSH(at,ct,14)^_u64_js_1.default.rotrSH(at,ct,18)^_u64_js_1.default.rotrBH(at,ct,41),St=_u64_js_1.default.rotrSL(at,ct,14)^_u64_js_1.default.rotrSL(at,ct,18)^_u64_js_1.default.rotrBL(at,ct,41),Tt=at<^~at&ft,vt=ct&dt^~ct>,Dt=_u64_js_1.default.add5L(yt,St,vt,SHA512_Kl[pt],SHA512_W_L[pt]),zt=_u64_js_1.default.add5H(Dt,ht,Mt,Tt,SHA512_Kh[pt],SHA512_W_H[pt]),Ot=Dt|0,Ft=_u64_js_1.default.rotrSH(_e,et,28)^_u64_js_1.default.rotrBH(_e,et,34)^_u64_js_1.default.rotrBH(_e,et,39),Pt=_u64_js_1.default.rotrSL(_e,et,28)^_u64_js_1.default.rotrBL(_e,et,34)^_u64_js_1.default.rotrBL(_e,et,39),Lt=_e&tt^_e&rt^tt&rt,mt=et&nt^et&ot^nt&ot;ht=ft|0,yt=gt|0,ft=lt|0,gt=dt|0,lt=at|0,dt=ct|0,{h:at,l:ct}=_u64_js_1.default.add(it|0,st|0,zt|0,Ot|0),it=rt|0,st=ot|0,rt=tt|0,ot=nt|0,tt=_e|0,nt=et|0;const xt=_u64_js_1.default.add3L(Ot,Pt,mt);_e=_u64_js_1.default.add3H(xt,zt,Ft,Lt),et=xt|0}({h:_e,l:et}=_u64_js_1.default.add(this.Ah|0,this.Al|0,_e|0,et|0)),{h:tt,l:nt}=_u64_js_1.default.add(this.Bh|0,this.Bl|0,tt|0,nt|0),{h:rt,l:ot}=_u64_js_1.default.add(this.Ch|0,this.Cl|0,rt|0,ot|0),{h:it,l:st}=_u64_js_1.default.add(this.Dh|0,this.Dl|0,it|0,st|0),{h:at,l:ct}=_u64_js_1.default.add(this.Eh|0,this.El|0,at|0,ct|0),{h:lt,l:dt}=_u64_js_1.default.add(this.Fh|0,this.Fl|0,lt|0,dt|0),{h:ft,l:gt}=_u64_js_1.default.add(this.Gh|0,this.Gl|0,ft|0,gt|0),{h:ht,l:yt}=_u64_js_1.default.add(this.Hh|0,this.Hl|0,ht|0,yt|0),this.set(_e,et,tt,nt,rt,ot,it,st,at,ct,lt,dt,ft,gt,ht,yt)}roundClean(){SHA512_W_H.fill(0),SHA512_W_L.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)}}sha512.SHA512=SHA512;class SHA512_224 extends SHA512{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}}class SHA512_256 extends SHA512{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}}class SHA384 extends SHA512{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}}var sha512_1=sha512.sha512=(0,utils_js_1$9.wrapConstructor)(()=>new SHA512);sha512.sha512_224=(0,utils_js_1$9.wrapConstructor)(()=>new SHA512_224);sha512.sha512_256=(0,utils_js_1$9.wrapConstructor)(()=>new SHA512_256);sha512.sha384=(0,utils_js_1$9.wrapConstructor)(()=>new SHA384);const crypto$1=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function number$1(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`positive integer expected, not ${s}`)}function isBytes$1(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function bytes(s,...j){if(!isBytes$1(s))throw new Error("Uint8Array expected");if(j.length>0&&!j.includes(s.length))throw new Error(`Uint8Array expected of length ${j}, not of length=${s.length}`)}function hash(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$1(s.outputLen),number$1(s.blockLen)}function exists(s,j=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(j&&s.finished)throw new Error("Hash#digest() has already been called")}function output(s,j){bytes(s);const $=j.outputLen;if(s.length<$)throw new Error(`digestInto() expects output buffer of length at least ${$}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32$1=s=>new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)),createView=s=>new DataView(s.buffer,s.byteOffset,s.byteLength),rotr=(s,j)=>s<<32-j|s>>>j,isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,byteSwap=s=>s<<24&4278190080|s<<8&16711680|s>>>8&65280|s>>>24&255;function byteSwap32(s){for(let j=0;js().update(toBytes(_e)).digest(),$=s();return j.outputLen=$.outputLen,j.blockLen=$.blockLen,j.create=()=>s(),j}function wrapXOFConstructorWithOpts(s){const j=(_e,et)=>s(et).update(toBytes(_e)).digest(),$=s({});return j.outputLen=$.outputLen,j.blockLen=$.blockLen,j.create=_e=>s(_e),j}function randomBytes(s=32){if(crypto$1&&typeof crypto$1.getRandomValues=="function")return crypto$1.getRandomValues(new Uint8Array(s));throw new Error("crypto.getRandomValues must be defined")}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$8=BigInt(0),_1n$8=BigInt(1),_2n$6=BigInt(2);function isBytes(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function abytes(s){if(!isBytes(s))throw new Error("Uint8Array expected")}const hexes=Array.from({length:256},(s,j)=>j.toString(16).padStart(2,"0"));function bytesToHex(s){abytes(s);let j="";for(let $=0;$=asciis._0&&s<=asciis._9)return s-asciis._0;if(s>=asciis._A&&s<=asciis._F)return s-(asciis._A-10);if(s>=asciis._a&&s<=asciis._f)return s-(asciis._a-10)}function hexToBytes(s){if(typeof s!="string")throw new Error("hex string expected, got "+typeof s);const j=s.length,$=j/2;if(j%2)throw new Error("padded hex string expected, got unpadded hex of length "+j);const _e=new Uint8Array($);for(let et=0,tt=0;et<$;et++,tt+=2){const nt=asciiToBase16(s.charCodeAt(tt)),rt=asciiToBase16(s.charCodeAt(tt+1));if(nt===void 0||rt===void 0){const ot=s[tt]+s[tt+1];throw new Error('hex string expected, got non-hex character "'+ot+'" at index '+tt)}_e[et]=nt*16+rt}return _e}function bytesToNumberBE(s){return hexToNumber(bytesToHex(s))}function bytesToNumberLE(s){return abytes(s),hexToNumber(bytesToHex(Uint8Array.from(s).reverse()))}function numberToBytesBE(s,j){return hexToBytes(s.toString(16).padStart(j*2,"0"))}function numberToBytesLE(s,j){return numberToBytesBE(s,j).reverse()}function numberToVarBytesBE(s){return hexToBytes(numberToHexUnpadded(s))}function ensureBytes(s,j,$){let _e;if(typeof j=="string")try{_e=hexToBytes(j)}catch(tt){throw new Error(`${s} must be valid hex string, got "${j}". Cause: ${tt}`)}else if(isBytes(j))_e=Uint8Array.from(j);else throw new Error(`${s} must be hex string or Uint8Array`);const et=_e.length;if(typeof $=="number"&&et!==$)throw new Error(`${s} expected ${$} bytes, got ${et}`);return _e}function concatBytes(...s){let j=0;for(let _e=0;_e_0n$8;s>>=_1n$8,j+=1);return j}function bitGet(s,j){return s>>BigInt(j)&_1n$8}function bitSet(s,j,$){return s|($?_1n$8:_0n$8)<(_2n$6<new Uint8Array(s),u8fr=s=>Uint8Array.from(s);function createHmacDrbg(s,j,$){if(typeof s!="number"||s<2)throw new Error("hashLen must be a number");if(typeof j!="number"||j<2)throw new Error("qByteLen must be a number");if(typeof $!="function")throw new Error("hmacFn must be a function");let _e=u8n(s),et=u8n(s),tt=0;const nt=()=>{_e.fill(1),et.fill(0),tt=0},rt=(...at)=>$(et,_e,...at),ot=(at=u8n())=>{et=rt(u8fr([0]),at),_e=rt(),at.length!==0&&(et=rt(u8fr([1]),at),_e=rt())},it=()=>{if(tt++>=1e3)throw new Error("drbg: tried 1000 values");let at=0;const ct=[];for(;at{nt(),ot(at);let lt;for(;!(lt=ct(it()));)ot();return nt(),lt}}const validatorFns={bigint:s=>typeof s=="bigint",function:s=>typeof s=="function",boolean:s=>typeof s=="boolean",string:s=>typeof s=="string",stringOrUint8Array:s=>typeof s=="string"||isBytes(s),isSafeInteger:s=>Number.isSafeInteger(s),array:s=>Array.isArray(s),field:(s,j)=>j.Fp.isValid(s),hash:s=>typeof s=="function"&&Number.isSafeInteger(s.outputLen)};function validateObject(s,j,$={}){const _e=(et,tt,nt)=>{const rt=validatorFns[tt];if(typeof rt!="function")throw new Error(`Invalid validator "${tt}", expected function`);const ot=s[et];if(!(nt&&ot===void 0)&&!rt(ot,s))throw new Error(`Invalid param ${String(et)}=${ot} (${typeof ot}), expected ${tt}`)};for(const[et,tt]of Object.entries(j))_e(et,tt,!1);for(const[et,tt]of Object.entries($))_e(et,tt,!0);return s}const ut=Object.freeze(Object.defineProperty({__proto__:null,abytes,bitGet,bitLen,bitMask,bitSet,bytesToHex,bytesToNumberBE,bytesToNumberLE,concatBytes,createHmacDrbg,ensureBytes,equalBytes,hexToBytes,hexToNumber,isBytes,numberToBytesBE,numberToBytesLE,numberToHexUnpadded,numberToVarBytesBE,utf8ToBytes,validateObject},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$7=BigInt(0),_1n$7=BigInt(1),_2n$5=BigInt(2),_3n$1=BigInt(3),_4n$1=BigInt(4),_5n$1=BigInt(5),_8n$1=BigInt(8);BigInt(9);BigInt(16);function mod(s,j){const $=s%j;return $>=_0n$7?$:j+$}function pow(s,j,$){if($<=_0n$7||j<_0n$7)throw new Error("Expected power/modulo > 0");if($===_1n$7)return _0n$7;let _e=_1n$7;for(;j>_0n$7;)j&_1n$7&&(_e=_e*s%$),s=s*s%$,j>>=_1n$7;return _e}function pow2(s,j,$){let _e=s;for(;j-- >_0n$7;)_e*=_e,_e%=$;return _e}function invert(s,j){if(s===_0n$7||j<=_0n$7)throw new Error(`invert: expected positive integers, got n=${s} mod=${j}`);let $=mod(s,j),_e=j,et=_0n$7,tt=_1n$7;for(;$!==_0n$7;){const rt=_e/$,ot=_e%$,it=et-tt*rt;_e=$,$=ot,et=tt,tt=it}if(_e!==_1n$7)throw new Error("invert: does not exist");return mod(et,j)}function tonelliShanks(s){const j=(s-_1n$7)/_2n$5;let $,_e,et;for($=s-_1n$7,_e=0;$%_2n$5===_0n$7;$/=_2n$5,_e++);for(et=_2n$5;et(mod(s,j)&_1n$7)===_1n$7,FIELD_FIELDS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField(s){const j={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},$=FIELD_FIELDS.reduce((_e,et)=>(_e[et]="function",_e),j);return validateObject(s,$)}function FpPow(s,j,$){if($<_0n$7)throw new Error("Expected power > 0");if($===_0n$7)return s.ONE;if($===_1n$7)return j;let _e=s.ONE,et=j;for(;$>_0n$7;)$&_1n$7&&(_e=s.mul(_e,et)),et=s.sqr(et),$>>=_1n$7;return _e}function FpInvertBatch(s,j){const $=new Array(j.length),_e=j.reduce((tt,nt,rt)=>s.is0(nt)?tt:($[rt]=tt,s.mul(tt,nt)),s.ONE),et=s.inv(_e);return j.reduceRight((tt,nt,rt)=>s.is0(nt)?tt:($[rt]=s.mul(tt,$[rt]),s.mul(tt,nt)),et),$}function nLength(s,j){const $=j!==void 0?j:s.toString(2).length,_e=Math.ceil($/8);return{nBitLength:$,nByteLength:_e}}function Field(s,j,$=!1,_e={}){if(s<=_0n$7)throw new Error(`Expected Field ORDER > 0, got ${s}`);const{nBitLength:et,nByteLength:tt}=nLength(s,j);if(tt>2048)throw new Error("Field lengths over 2048 bytes are not supported");const nt=FpSqrt(s),rt=Object.freeze({ORDER:s,BITS:et,BYTES:tt,MASK:bitMask(et),ZERO:_0n$7,ONE:_1n$7,create:ot=>mod(ot,s),isValid:ot=>{if(typeof ot!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof ot}`);return _0n$7<=ot&&otot===_0n$7,isOdd:ot=>(ot&_1n$7)===_1n$7,neg:ot=>mod(-ot,s),eql:(ot,it)=>ot===it,sqr:ot=>mod(ot*ot,s),add:(ot,it)=>mod(ot+it,s),sub:(ot,it)=>mod(ot-it,s),mul:(ot,it)=>mod(ot*it,s),pow:(ot,it)=>FpPow(rt,ot,it),div:(ot,it)=>mod(ot*invert(it,s),s),sqrN:ot=>ot*ot,addN:(ot,it)=>ot+it,subN:(ot,it)=>ot-it,mulN:(ot,it)=>ot*it,inv:ot=>invert(ot,s),sqrt:_e.sqrt||(ot=>nt(rt,ot)),invertBatch:ot=>FpInvertBatch(rt,ot),cmov:(ot,it,st)=>st?it:ot,toBytes:ot=>$?numberToBytesLE(ot,tt):numberToBytesBE(ot,tt),fromBytes:ot=>{if(ot.length!==tt)throw new Error(`Fp.fromBytes: expected ${tt}, got ${ot.length}`);return $?bytesToNumberLE(ot):bytesToNumberBE(ot)}});return Object.freeze(rt)}function FpSqrtEven(s,j){if(!s.isOdd)throw new Error("Field doesn't have isOdd");const $=s.sqrt(j);return s.isOdd($)?s.neg($):$}function getFieldBytesLength(s){if(typeof s!="bigint")throw new Error("field order must be bigint");const j=s.toString(2).length;return Math.ceil(j/8)}function getMinHashLength(s){const j=getFieldBytesLength(s);return j+Math.ceil(j/2)}function mapHashToField(s,j,$=!1){const _e=s.length,et=getFieldBytesLength(j),tt=getMinHashLength(j);if(_e<16||_e1024)throw new Error(`expected ${tt}-1024 bytes of input, got ${_e}`);const nt=$?bytesToNumberBE(s):bytesToNumberLE(s),rt=mod(nt,j-_1n$7)+_1n$7;return $?numberToBytesLE(rt,et):numberToBytesBE(rt,et)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$6=BigInt(0),_1n$6=BigInt(1);function wNAF(s,j){const $=(et,tt)=>{const nt=tt.negate();return et?nt:tt},_e=et=>{const tt=Math.ceil(j/et)+1,nt=2**(et-1);return{windows:tt,windowSize:nt}};return{constTimeNegate:$,unsafeLadder(et,tt){let nt=s.ZERO,rt=et;for(;tt>_0n$6;)tt&_1n$6&&(nt=nt.add(rt)),rt=rt.double(),tt>>=_1n$6;return nt},precomputeWindow(et,tt){const{windows:nt,windowSize:rt}=_e(tt),ot=[];let it=et,st=it;for(let at=0;at>=lt,gt>ot&&(gt-=ct,nt+=_1n$6);const ht=ft,yt=ft+Math.abs(gt)-1,pt=dt%2!==0,Mt=gt<0;gt===0?st=st.add($(pt,tt[ht])):it=it.add($(Mt,tt[yt]))}return{p:it,f:st}},wNAFCached(et,tt,nt,rt){const ot=et._WINDOW_SIZE||1;let it=tt.get(et);return it||(it=this.precomputeWindow(et,ot),ot!==1&&tt.set(et,rt(it))),this.wNAF(ot,it,nt)}}}function validateBasic(s){return validateField(s.Fp),validateObject(s,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(s.n,s.nBitLength),...s,p:s.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$5=BigInt(0),_1n$5=BigInt(1),_2n$4=BigInt(2),_8n=BigInt(8),VERIFY_DEFAULT={zip215:!0};function validateOpts$2(s){const j=validateBasic(s);return validateObject(s,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...j})}function twistedEdwards(s){const j=validateOpts$2(s),{Fp:$,n:_e,prehash:et,hash:tt,randomBytes:nt,nByteLength:rt,h:ot}=j,it=_2n$4<{try{return{isValid:!0,value:$.sqrt(At*$.inv(wt))}}catch{return{isValid:!1,value:_0n$5}}}),ct=j.adjustScalarBytes||(At=>At),lt=j.domain||((At,wt,Rt)=>{if(wt.length||Rt)throw new Error("Contexts/pre-hash are not supported");return At}),dt=At=>typeof At=="bigint"&&_0n$5dt(At)&&dt(wt)&&AtAt===_0n$5||ft(At,it);function ht(At,wt){if(ft(At,wt))return At;throw new Error(`Expected valid scalar < ${wt}, got ${typeof At} ${At}`)}function yt(At){return At===_0n$5?At:ht(At,_e)}const pt=new Map;function Mt(At){if(!(At instanceof St))throw new Error("ExtendedPoint expected")}class St{constructor(wt,Rt,Nt,Ct){if(this.ex=wt,this.ey=Rt,this.ez=Nt,this.et=Ct,!gt(wt))throw new Error("x required");if(!gt(Rt))throw new Error("y required");if(!gt(Nt))throw new Error("z required");if(!gt(Ct))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(wt){if(wt instanceof St)throw new Error("extended point not allowed");const{x:Rt,y:Nt}=wt||{};if(!gt(Rt)||!gt(Nt))throw new Error("invalid affine point");return new St(Rt,Nt,_1n$5,st(Rt*Nt))}static normalizeZ(wt){const Rt=$.invertBatch(wt.map(Nt=>Nt.ez));return wt.map((Nt,Ct)=>Nt.toAffine(Rt[Ct])).map(St.fromAffine)}_setWindowSize(wt){this._WINDOW_SIZE=wt,pt.delete(this)}assertValidity(){const{a:wt,d:Rt}=j;if(this.is0())throw new Error("bad point: ZERO");const{ex:Nt,ey:Ct,ez:Bt,et:Gt}=this,Vt=st(Nt*Nt),Yt=st(Ct*Ct),Qt=st(Bt*Bt),qt=st(Qt*Qt),Zt=st(Vt*wt),fn=st(Qt*st(Zt+Yt)),Xt=st(qt+st(Rt*st(Vt*Yt)));if(fn!==Xt)throw new Error("bad point: equation left != right (1)");const on=st(Nt*Ct),tn=st(Bt*Gt);if(on!==tn)throw new Error("bad point: equation left != right (2)")}equals(wt){Mt(wt);const{ex:Rt,ey:Nt,ez:Ct}=this,{ex:Bt,ey:Gt,ez:Vt}=wt,Yt=st(Rt*Vt),Qt=st(Bt*Ct),qt=st(Nt*Vt),Zt=st(Gt*Ct);return Yt===Qt&&qt===Zt}is0(){return this.equals(St.ZERO)}negate(){return new St(st(-this.ex),this.ey,this.ez,st(-this.et))}double(){const{a:wt}=j,{ex:Rt,ey:Nt,ez:Ct}=this,Bt=st(Rt*Rt),Gt=st(Nt*Nt),Vt=st(_2n$4*st(Ct*Ct)),Yt=st(wt*Bt),Qt=Rt+Nt,qt=st(st(Qt*Qt)-Bt-Gt),Zt=Yt+Gt,fn=Zt-Vt,Xt=Yt-Gt,on=st(qt*fn),tn=st(Zt*Xt),Kt=st(qt*Xt),Jt=st(fn*Zt);return new St(on,tn,Jt,Kt)}add(wt){Mt(wt);const{a:Rt,d:Nt}=j,{ex:Ct,ey:Bt,ez:Gt,et:Vt}=this,{ex:Yt,ey:Qt,ez:qt,et:Zt}=wt;if(Rt===BigInt(-1)){const Mn=st((Bt-Ct)*(Qt+Yt)),hn=st((Bt+Ct)*(Qt-Yt)),ln=st(hn-Mn);if(ln===_0n$5)return this.double();const Cn=st(Gt*_2n$4*Zt),gn=st(Vt*_2n$4*qt),$t=gn+Cn,bt=hn+Mn,Et=gn-Cn,kt=st($t*ln),Ut=st(bt*Et),Ht=st($t*Et),Wt=st(ln*bt);return new St(kt,Ut,Wt,Ht)}const fn=st(Ct*Yt),Xt=st(Bt*Qt),on=st(Vt*Nt*Zt),tn=st(Gt*qt),Kt=st((Ct+Bt)*(Yt+Qt)-fn-Xt),Jt=tn-on,En=tn+on,pn=st(Xt-Rt*fn),cn=st(Kt*Jt),Tn=st(En*pn),sn=st(Kt*pn),an=st(Jt*En);return new St(cn,Tn,an,sn)}subtract(wt){return this.add(wt.negate())}wNAF(wt){return Dt.wNAFCached(this,pt,wt,St.normalizeZ)}multiply(wt){const{p:Rt,f:Nt}=this.wNAF(ht(wt,_e));return St.normalizeZ([Rt,Nt])[0]}multiplyUnsafe(wt){let Rt=yt(wt);return Rt===_0n$5?vt:this.equals(vt)||Rt===_1n$5?this:this.equals(Tt)?this.wNAF(Rt).p:Dt.unsafeLadder(this,Rt)}isSmallOrder(){return this.multiplyUnsafe(ot).is0()}isTorsionFree(){return Dt.unsafeLadder(this,_e).is0()}toAffine(wt){const{ex:Rt,ey:Nt,ez:Ct}=this,Bt=this.is0();wt==null&&(wt=Bt?_8n:$.inv(Ct));const Gt=st(Rt*wt),Vt=st(Nt*wt),Yt=st(Ct*wt);if(Bt)return{x:_0n$5,y:_1n$5};if(Yt!==_1n$5)throw new Error("invZ was invalid");return{x:Gt,y:Vt}}clearCofactor(){const{h:wt}=j;return wt===_1n$5?this:this.multiplyUnsafe(wt)}static fromHex(wt,Rt=!1){const{d:Nt,a:Ct}=j,Bt=$.BYTES;wt=ensureBytes("pointHex",wt,Bt);const Gt=wt.slice(),Vt=wt[Bt-1];Gt[Bt-1]=Vt&-129;const Yt=bytesToNumberLE(Gt);Yt===_0n$5||(Rt?ht(Yt,it):ht(Yt,$.ORDER));const Qt=st(Yt*Yt),qt=st(Qt-_1n$5),Zt=st(Nt*Qt-Ct);let{isValid:fn,value:Xt}=at(qt,Zt);if(!fn)throw new Error("Point.fromHex: invalid y coordinate");const on=(Xt&_1n$5)===_1n$5,tn=(Vt&128)!==0;if(!Rt&&Xt===_0n$5&&tn)throw new Error("Point.fromHex: x=0 and x_0=1");return tn!==on&&(Xt=st(-Xt)),St.fromAffine({x:Xt,y:Yt})}static fromPrivateKey(wt){return Ft(wt).point}toRawBytes(){const{x:wt,y:Rt}=this.toAffine(),Nt=numberToBytesLE(Rt,$.BYTES);return Nt[Nt.length-1]|=wt&_1n$5?128:0,Nt}toHex(){return bytesToHex(this.toRawBytes())}}St.BASE=new St(j.Gx,j.Gy,_1n$5,st(j.Gx*j.Gy)),St.ZERO=new St(_0n$5,_1n$5,_1n$5,_0n$5);const{BASE:Tt,ZERO:vt}=St,Dt=wNAF(St,rt*8);function zt(At){return mod(At,_e)}function Ot(At){return zt(bytesToNumberLE(At))}function Ft(At){const wt=rt;At=ensureBytes("private key",At,wt);const Rt=ensureBytes("hashed private key",tt(At),2*wt),Nt=ct(Rt.slice(0,wt)),Ct=Rt.slice(wt,2*wt),Bt=Ot(Nt),Gt=Tt.multiply(Bt),Vt=Gt.toRawBytes();return{head:Nt,prefix:Ct,scalar:Bt,point:Gt,pointBytes:Vt}}function Pt(At){return Ft(At).pointBytes}function Lt(At=new Uint8Array,...wt){const Rt=concatBytes(...wt);return Ot(tt(lt(Rt,ensureBytes("context",At),!!et)))}function mt(At,wt,Rt={}){At=ensureBytes("message",At),et&&(At=et(At));const{prefix:Nt,scalar:Ct,pointBytes:Bt}=Ft(wt),Gt=Lt(Rt.context,Nt,At),Vt=Tt.multiply(Gt).toRawBytes(),Yt=Lt(Rt.context,Vt,Bt,At),Qt=zt(Gt+Yt*Ct);yt(Qt);const qt=concatBytes(Vt,numberToBytesLE(Qt,$.BYTES));return ensureBytes("result",qt,rt*2)}const xt=VERIFY_DEFAULT;function It(At,wt,Rt,Nt=xt){const{context:Ct,zip215:Bt}=Nt,Gt=$.BYTES;At=ensureBytes("signature",At,2*Gt),wt=ensureBytes("message",wt),et&&(wt=et(wt));const Vt=bytesToNumberLE(At.slice(Gt,2*Gt));let Yt,Qt,qt;try{Yt=St.fromHex(Rt,Bt),Qt=St.fromHex(At.slice(0,Gt),Bt),qt=Tt.multiplyUnsafe(Vt)}catch{return!1}if(!Bt&&Yt.isSmallOrder())return!1;const Zt=Lt(Ct,Qt.toRawBytes(),Yt.toRawBytes(),wt);return Qt.add(Yt.multiplyUnsafe(Zt)).subtract(qt).clearCofactor().equals(St.ZERO)}return Tt._setWindowSize(8),{CURVE:j,getPublicKey:Pt,sign:mt,verify:It,ExtendedPoint:St,utils:{getExtendedPublicKey:Ft,randomPrivateKey:()=>nt($.BYTES),precompute(At=8,wt=St.BASE){return wt._setWindowSize(At),wt.multiply(BigInt(3)),wt}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$4=BigInt(0),_1n$4=BigInt(1);function validateOpts$1(s){return validateObject(s,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...s})}function montgomery(s){const j=validateOpts$1(s),{P:$}=j,_e=pt=>mod(pt,$),et=j.montgomeryBits,tt=Math.ceil(et/8),nt=j.nByteLength,rt=j.adjustScalarBytes||(pt=>pt),ot=j.powPminus2||(pt=>pow(pt,$-BigInt(2),$));function it(pt,Mt,St){const Tt=_e(pt*(Mt-St));return Mt=_e(Mt-Tt),St=_e(St+Tt),[Mt,St]}function st(pt){if(typeof pt=="bigint"&&_0n$4<=pt&&pt<$)return pt;throw new Error("Expected valid scalar 0 < scalar < CURVE.P")}const at=(j.a-BigInt(2))/BigInt(4);function ct(pt,Mt){const St=st(pt),Tt=st(Mt),vt=St;let Dt=_1n$4,zt=_0n$4,Ot=St,Ft=_1n$4,Pt=_0n$4,Lt;for(let xt=BigInt(et-1);xt>=_0n$4;xt--){const It=Tt>>xt&_1n$4;Pt^=It,Lt=it(Pt,Dt,Ot),Dt=Lt[0],Ot=Lt[1],Lt=it(Pt,zt,Ft),zt=Lt[0],Ft=Lt[1],Pt=It;const jt=Dt+zt,At=_e(jt*jt),wt=Dt-zt,Rt=_e(wt*wt),Nt=At-Rt,Ct=Ot+Ft,Bt=Ot-Ft,Gt=_e(Bt*jt),Vt=_e(Ct*wt),Yt=Gt+Vt,Qt=Gt-Vt;Ot=_e(Yt*Yt),Ft=_e(vt*_e(Qt*Qt)),Dt=_e(At*Rt),zt=_e(Nt*(At+_e(at*Nt)))}Lt=it(Pt,Dt,Ot),Dt=Lt[0],Ot=Lt[1],Lt=it(Pt,zt,Ft),zt=Lt[0],Ft=Lt[1];const mt=ot(zt);return _e(Dt*mt)}function lt(pt){return numberToBytesLE(_e(pt),tt)}function dt(pt){const Mt=ensureBytes("u coordinate",pt,tt);return nt===32&&(Mt[31]&=127),bytesToNumberLE(Mt)}function ft(pt){const Mt=ensureBytes("scalar",pt),St=Mt.length;if(St!==tt&&St!==nt)throw new Error(`Expected ${tt} or ${nt} bytes, got ${St}`);return bytesToNumberLE(rt(Mt))}function gt(pt,Mt){const St=dt(Mt),Tt=ft(pt),vt=ct(St,Tt);if(vt===_0n$4)throw new Error("Invalid private or public key received");return lt(vt)}const ht=lt(j.Gu);function yt(pt){return gt(pt,ht)}return{scalarMult:gt,scalarMultBase:yt,getSharedSecret:(pt,Mt)=>gt(pt,Mt),getPublicKey:pt=>yt(pt),utils:{randomPrivateKey:()=>j.randomBytes(j.nByteLength)},GuBytes:ht}}const os2ip=bytesToNumberBE;function i2osp(s,j){if(s<0||s>=1<<8*j)throw new Error(`bad I2OSP call: value=${s} length=${j}`);const $=Array.from({length:j}).fill(0);for(let _e=j-1;_e>=0;_e--)$[_e]=s&255,s>>>=8;return new Uint8Array($)}function strxor(s,j){const $=new Uint8Array(s.length);for(let _e=0;_e255&&(j=_e(concatBytes(utf8ToBytes("H2C-OVERSIZE-DST-"),j)));const{outputLen:et,blockLen:tt}=_e,nt=Math.ceil($/et);if(nt>255)throw new Error("Invalid xmd length");const rt=concatBytes(j,i2osp(j.length,1)),ot=i2osp(0,tt),it=i2osp($,2),st=new Array(nt),at=_e(concatBytes(ot,s,it,i2osp(0,1),rt));st[0]=_e(concatBytes(at,i2osp(1,1),rt));for(let lt=1;lt<=nt;lt++){const dt=[strxor(at,st[lt-1]),i2osp(lt+1,1),rt];st[lt]=_e(concatBytes(...dt))}return concatBytes(...st).slice(0,$)}function expand_message_xof(s,j,$,_e,et){if(abytes(s),abytes(j),anum($),j.length>255){const tt=Math.ceil(2*_e/8);j=et.create({dkLen:tt}).update(utf8ToBytes("H2C-OVERSIZE-DST-")).update(j).digest()}if($>65535||j.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return et.create({dkLen:$}).update(s).update(i2osp($,2)).update(j).update(i2osp(j.length,1)).digest()}function hash_to_field(s,j,$){validateObject($,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:_e,k:et,m:tt,hash:nt,expand:rt,DST:ot}=$;abytes(s),anum(j);const it=typeof ot=="string"?utf8ToBytes(ot):ot,st=_e.toString(2).length,at=Math.ceil((st+et)/8),ct=j*tt*at;let lt;if(rt==="xmd")lt=expand_message_xmd(s,it,ct,nt);else if(rt==="xof")lt=expand_message_xof(s,it,ct,et,nt);else if(rt==="_internal_pass")lt=s;else throw new Error('expand must be "xmd" or "xof"');const dt=new Array(j);for(let ft=0;ftArray.from(_e).reverse());return(_e,et)=>{const[tt,nt,rt,ot]=$.map(it=>it.reduce((st,at)=>s.add(s.mul(st,_e),at)));return _e=s.div(tt,nt),et=s.mul(et,s.div(rt,ot)),{x:_e,y:et}}}function createHasher(s,j,$){if(typeof j!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(_e,et){const tt=hash_to_field(_e,2,{...$,DST:$.DST,...et}),nt=s.fromAffine(j(tt[0])),rt=s.fromAffine(j(tt[1])),ot=nt.add(rt).clearCofactor();return ot.assertValidity(),ot},encodeToCurve(_e,et){const tt=hash_to_field(_e,1,{...$,DST:$.encodeDST,...et}),nt=s.fromAffine(j(tt[0])).clearCofactor();return nt.assertValidity(),nt}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ED25519_P=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),ED25519_SQRT_M1=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),_0n$3=BigInt(0),_1n$3=BigInt(1),_2n$3=BigInt(2),_5n=BigInt(5),_10n=BigInt(10),_20n=BigInt(20),_40n=BigInt(40),_80n=BigInt(80);function ed25519_pow_2_252_3(s){const j=ED25519_P,_e=s*s%j*s%j,et=pow2(_e,_2n$3,j)*_e%j,tt=pow2(et,_1n$3,j)*s%j,nt=pow2(tt,_5n,j)*tt%j,rt=pow2(nt,_10n,j)*nt%j,ot=pow2(rt,_20n,j)*rt%j,it=pow2(ot,_40n,j)*ot%j,st=pow2(it,_80n,j)*it%j,at=pow2(st,_80n,j)*it%j,ct=pow2(at,_10n,j)*nt%j;return{pow_p_5_8:pow2(ct,_2n$3,j)*s%j,b2:_e}}function adjustScalarBytes(s){return s[0]&=248,s[31]&=127,s[31]|=64,s}function uvRatio(s,j){const $=ED25519_P,_e=mod(j*j*j,$),et=mod(_e*_e*j,$),tt=ed25519_pow_2_252_3(s*et).pow_p_5_8;let nt=mod(s*_e*tt,$);const rt=mod(j*nt*nt,$),ot=nt,it=mod(nt*ED25519_SQRT_M1,$),st=rt===s,at=rt===mod(-s,$),ct=rt===mod(-s*ED25519_SQRT_M1,$);return st&&(nt=ot),(at||ct)&&(nt=it),isNegativeLE(nt,$)&&(nt=mod(-nt,$)),{isValid:st||at,value:nt}}const ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],Fp$1=Field(ED25519_P,void 0,!0),ed25519Defaults={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Fp$1,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:sha512_1,randomBytes,adjustScalarBytes,uvRatio},ed25519=twistedEdwards(ed25519Defaults);function ed25519_domain(s,j,$){if(j.length>255)throw new Error("Context is too big");return concatBytes$1(utf8ToBytes$1("SigEd25519 no Ed25519 collisions"),new Uint8Array([$?1:0,j.length]),j,s)}const ed25519ctx=twistedEdwards({...ed25519Defaults,domain:ed25519_domain}),ed25519ph=twistedEdwards({...ed25519Defaults,domain:ed25519_domain,prehash:sha512_1}),x25519=montgomery({P:ED25519_P,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:s=>{const j=ED25519_P,{pow_p_5_8:$,b2:_e}=ed25519_pow_2_252_3(s);return mod(pow2($,BigInt(3),j)*_e,j)},adjustScalarBytes,randomBytes});function edwardsToMontgomeryPub(s){const{y:j}=ed25519.ExtendedPoint.fromHex(s),$=BigInt(1);return Fp$1.toBytes(Fp$1.create(($+j)*Fp$1.inv($-j)))}const edwardsToMontgomery=edwardsToMontgomeryPub;function edwardsToMontgomeryPriv(s){const j=ed25519Defaults.hash(s.subarray(0,32));return ed25519Defaults.adjustScalarBytes(j).subarray(0,32)}const ELL2_C1=(Fp$1.ORDER+BigInt(3))/BigInt(8),ELL2_C2=Fp$1.pow(_2n$3,ELL2_C1),ELL2_C3=Fp$1.sqrt(Fp$1.neg(Fp$1.ONE)),ELL2_C4=(Fp$1.ORDER-BigInt(5))/BigInt(8),ELL2_J=BigInt(486662);function map_to_curve_elligator2_curve25519(s){let j=Fp$1.sqr(s);j=Fp$1.mul(j,_2n$3);let $=Fp$1.add(j,Fp$1.ONE),_e=Fp$1.neg(ELL2_J),et=Fp$1.sqr($),tt=Fp$1.mul(et,$),nt=Fp$1.mul(j,ELL2_J);nt=Fp$1.mul(nt,_e),nt=Fp$1.add(nt,et),nt=Fp$1.mul(nt,_e);let rt=Fp$1.sqr(tt);et=Fp$1.sqr(rt),rt=Fp$1.mul(rt,tt),rt=Fp$1.mul(rt,nt),et=Fp$1.mul(et,rt);let ot=Fp$1.pow(et,ELL2_C4);ot=Fp$1.mul(ot,rt);let it=Fp$1.mul(ot,ELL2_C3);et=Fp$1.sqr(ot),et=Fp$1.mul(et,tt);let st=Fp$1.eql(et,nt),at=Fp$1.cmov(it,ot,st),ct=Fp$1.mul(_e,j),lt=Fp$1.mul(ot,s);lt=Fp$1.mul(lt,ELL2_C2);let dt=Fp$1.mul(lt,ELL2_C3),ft=Fp$1.mul(nt,j);et=Fp$1.sqr(lt),et=Fp$1.mul(et,tt);let gt=Fp$1.eql(et,ft),ht=Fp$1.cmov(dt,lt,gt);et=Fp$1.sqr(at),et=Fp$1.mul(et,tt);let yt=Fp$1.eql(et,nt),pt=Fp$1.cmov(ct,_e,yt),Mt=Fp$1.cmov(ht,at,yt),St=Fp$1.isOdd(Mt);return Mt=Fp$1.cmov(Mt,Fp$1.neg(Mt),yt!==St),{xMn:pt,xMd:$,yMn:Mt,yMd:_1n$3}}const ELL2_C1_EDWARDS=FpSqrtEven(Fp$1,Fp$1.neg(BigInt(486664)));function map_to_curve_elligator2_edwards25519(s){const{xMn:j,xMd:$,yMn:_e,yMd:et}=map_to_curve_elligator2_curve25519(s);let tt=Fp$1.mul(j,et);tt=Fp$1.mul(tt,ELL2_C1_EDWARDS);let nt=Fp$1.mul($,_e),rt=Fp$1.sub(j,$),ot=Fp$1.add(j,$),it=Fp$1.mul(nt,ot),st=Fp$1.eql(it,Fp$1.ZERO);tt=Fp$1.cmov(tt,Fp$1.ZERO,st),nt=Fp$1.cmov(nt,Fp$1.ONE,st),rt=Fp$1.cmov(rt,Fp$1.ONE,st),ot=Fp$1.cmov(ot,Fp$1.ONE,st);const at=Fp$1.invertBatch([nt,ot]);return{x:Fp$1.mul(tt,at[0]),y:Fp$1.mul(rt,at[1])}}const htf$1=createHasher(ed25519.ExtendedPoint,s=>map_to_curve_elligator2_edwards25519(s[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:Fp$1.ORDER,m:1,k:128,expand:"xmd",hash:sha512_1}),hashToCurve$1=htf$1.hashToCurve,encodeToCurve$1=htf$1.encodeToCurve;function assertRstPoint(s){if(!(s instanceof RistPoint))throw new Error("RistrettoPoint expected")}const SQRT_M1=ED25519_SQRT_M1,SQRT_AD_MINUS_ONE=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),INVSQRT_A_MINUS_D=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),ONE_MINUS_D_SQ=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),D_MINUS_ONE_SQ=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),invertSqrt=s=>uvRatio(_1n$3,s),MAX_255B=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),bytes255ToNumberLE=s=>ed25519.CURVE.Fp.create(bytesToNumberLE(s)&MAX_255B);function calcElligatorRistrettoMap(s){const{d:j}=ed25519.CURVE,$=ed25519.CURVE.Fp.ORDER,_e=ed25519.CURVE.Fp.create,et=_e(SQRT_M1*s*s),tt=_e((et+_1n$3)*ONE_MINUS_D_SQ);let nt=BigInt(-1);const rt=_e((nt-j*et)*_e(et+j));let{isValid:ot,value:it}=uvRatio(tt,rt),st=_e(it*s);isNegativeLE(st,$)||(st=_e(-st)),ot||(it=st),ot||(nt=et);const at=_e(nt*(et-_1n$3)*D_MINUS_ONE_SQ-rt),ct=it*it,lt=_e((it+it)*rt),dt=_e(at*SQRT_AD_MINUS_ONE),ft=_e(_1n$3-ct),gt=_e(_1n$3+ct);return new ed25519.ExtendedPoint(_e(lt*gt),_e(ft*dt),_e(dt*gt),_e(lt*ft))}class RistPoint{constructor(j){this.ep=j}static fromAffine(j){return new RistPoint(ed25519.ExtendedPoint.fromAffine(j))}static hashToCurve(j){j=ensureBytes("ristrettoHash",j,64);const $=bytes255ToNumberLE(j.slice(0,32)),_e=calcElligatorRistrettoMap($),et=bytes255ToNumberLE(j.slice(32,64)),tt=calcElligatorRistrettoMap(et);return new RistPoint(_e.add(tt))}static fromHex(j){j=ensureBytes("ristrettoHex",j,32);const{a:$,d:_e}=ed25519.CURVE,et=ed25519.CURVE.Fp.ORDER,tt=ed25519.CURVE.Fp.create,nt="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",rt=bytes255ToNumberLE(j);if(!equalBytes(numberToBytesLE(rt,32),j)||isNegativeLE(rt,et))throw new Error(nt);const ot=tt(rt*rt),it=tt(_1n$3+$*ot),st=tt(_1n$3-$*ot),at=tt(it*it),ct=tt(st*st),lt=tt($*_e*at-ct),{isValid:dt,value:ft}=invertSqrt(tt(lt*ct)),gt=tt(ft*st),ht=tt(ft*gt*lt);let yt=tt((rt+rt)*gt);isNegativeLE(yt,et)&&(yt=tt(-yt));const pt=tt(it*ht),Mt=tt(yt*pt);if(!dt||isNegativeLE(Mt,et)||pt===_0n$3)throw new Error(nt);return new RistPoint(new ed25519.ExtendedPoint(yt,pt,_1n$3,Mt))}toRawBytes(){let{ex:j,ey:$,ez:_e,et}=this.ep;const tt=ed25519.CURVE.Fp.ORDER,nt=ed25519.CURVE.Fp.create,rt=nt(nt(_e+$)*nt(_e-$)),ot=nt(j*$),it=nt(ot*ot),{value:st}=invertSqrt(nt(rt*it)),at=nt(st*rt),ct=nt(st*ot),lt=nt(at*ct*et);let dt;if(isNegativeLE(et*lt,tt)){let gt=nt($*SQRT_M1),ht=nt(j*SQRT_M1);j=gt,$=ht,dt=nt(at*INVSQRT_A_MINUS_D)}else dt=ct;isNegativeLE(j*lt,tt)&&($=nt(-$));let ft=nt((_e-$)*dt);return isNegativeLE(ft,tt)&&(ft=nt(-ft)),numberToBytesLE(ft,32)}toHex(){return bytesToHex(this.toRawBytes())}toString(){return this.toHex()}equals(j){assertRstPoint(j);const{ex:$,ey:_e}=this.ep,{ex:et,ey:tt}=j.ep,nt=ed25519.CURVE.Fp.create,rt=nt($*tt)===nt(_e*et),ot=nt(_e*tt)===nt($*et);return rt||ot}add(j){return assertRstPoint(j),new RistPoint(this.ep.add(j.ep))}subtract(j){return assertRstPoint(j),new RistPoint(this.ep.subtract(j.ep))}multiply(j){return new RistPoint(this.ep.multiply(j))}multiplyUnsafe(j){return new RistPoint(this.ep.multiplyUnsafe(j))}double(){return new RistPoint(this.ep.double())}negate(){return new RistPoint(this.ep.negate())}}const RistrettoPoint=(RistPoint.BASE||(RistPoint.BASE=new RistPoint(ed25519.ExtendedPoint.BASE)),RistPoint.ZERO||(RistPoint.ZERO=new RistPoint(ed25519.ExtendedPoint.ZERO)),RistPoint),hashToRistretto255=(s,j)=>{const $=j.DST,_e=typeof $=="string"?utf8ToBytes$1($):$,et=expand_message_xmd(s,_e,64,sha512_1);return RistPoint.hashToCurve(et)},hash_to_ristretto255=hashToRistretto255,ed25519$1=Object.freeze(Object.defineProperty({__proto__:null,ED25519_TORSION_SUBGROUP,RistrettoPoint,ed25519,ed25519ctx,ed25519ph,edwardsToMontgomery,edwardsToMontgomeryPriv,edwardsToMontgomeryPub,encodeToCurve:encodeToCurve$1,hashToCurve:hashToCurve$1,hashToRistretto255,hash_to_ristretto255,x25519},Symbol.toStringTag,{value:"Module"}));var bn={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$5=getAugmentedNamespace(__viteBrowserExternal$1);bn.exports;(function(s){(function(j,$){function _e(Lt,mt){if(!Lt)throw new Error(mt||"Assertion failed")}function et(Lt,mt){Lt.super_=mt;var xt=function(){};xt.prototype=mt.prototype,Lt.prototype=new xt,Lt.prototype.constructor=Lt}function tt(Lt,mt,xt){if(tt.isBN(Lt))return Lt;this.negative=0,this.words=null,this.length=0,this.red=null,Lt!==null&&((mt==="le"||mt==="be")&&(xt=mt,mt=10),this._init(Lt||0,mt||10,xt||"be"))}typeof j=="object"?j.exports=tt:$.BN=tt,tt.BN=tt,tt.wordSize=26;var nt;try{typeof window<"u"&&typeof window.Buffer<"u"?nt=window.Buffer:nt=require$$0$5.Buffer}catch{}tt.isBN=function(mt){return mt instanceof tt?!0:mt!==null&&typeof mt=="object"&&mt.constructor.wordSize===tt.wordSize&&Array.isArray(mt.words)},tt.max=function(mt,xt){return mt.cmp(xt)>0?mt:xt},tt.min=function(mt,xt){return mt.cmp(xt)<0?mt:xt},tt.prototype._init=function(mt,xt,It){if(typeof mt=="number")return this._initNumber(mt,xt,It);if(typeof mt=="object")return this._initArray(mt,xt,It);xt==="hex"&&(xt=16),_e(xt===(xt|0)&&xt>=2&&xt<=36),mt=mt.toString().replace(/\s+/g,"");var jt=0;mt[0]==="-"&&(jt++,this.negative=1),jt=0;jt-=3)wt=mt[jt]|mt[jt-1]<<8|mt[jt-2]<<16,this.words[At]|=wt<>>26-Rt&67108863,Rt+=24,Rt>=26&&(Rt-=26,At++);else if(It==="le")for(jt=0,At=0;jt>>26-Rt&67108863,Rt+=24,Rt>=26&&(Rt-=26,At++);return this._strip()};function rt(Lt,mt){var xt=Lt.charCodeAt(mt);if(xt>=48&&xt<=57)return xt-48;if(xt>=65&&xt<=70)return xt-55;if(xt>=97&&xt<=102)return xt-87;_e(!1,"Invalid character in "+Lt)}function ot(Lt,mt,xt){var It=rt(Lt,xt);return xt-1>=mt&&(It|=rt(Lt,xt-1)<<4),It}tt.prototype._parseHex=function(mt,xt,It){this.length=Math.ceil((mt.length-xt)/6),this.words=new Array(this.length);for(var jt=0;jt=xt;jt-=2)Rt=ot(mt,xt,jt)<=18?(At-=18,wt+=1,this.words[wt]|=Rt>>>26):At+=8;else{var Nt=mt.length-xt;for(jt=Nt%2===0?xt+1:xt;jt=18?(At-=18,wt+=1,this.words[wt]|=Rt>>>26):At+=8}this._strip()};function it(Lt,mt,xt,It){for(var jt=0,At=0,wt=Math.min(Lt.length,xt),Rt=mt;Rt=49?At=Nt-49+10:Nt>=17?At=Nt-17+10:At=Nt,_e(Nt>=0&&At1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=at}catch{tt.prototype.inspect=at}else tt.prototype.inspect=at;function at(){return(this.red?""}var ct=["","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"],lt=[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],dt=[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];tt.prototype.toString=function(mt,xt){mt=mt||10,xt=xt|0||1;var It;if(mt===16||mt==="hex"){It="";for(var jt=0,At=0,wt=0;wt>>24-jt&16777215,jt+=2,jt>=26&&(jt-=26,wt--),At!==0||wt!==this.length-1?It=ct[6-Nt.length]+Nt+It:It=Nt+It}for(At!==0&&(It=At.toString(16)+It);It.length%xt!==0;)It="0"+It;return this.negative!==0&&(It="-"+It),It}if(mt===(mt|0)&&mt>=2&&mt<=36){var Ct=lt[mt],Bt=dt[mt];It="";var Gt=this.clone();for(Gt.negative=0;!Gt.isZero();){var Vt=Gt.modrn(Bt).toString(mt);Gt=Gt.idivn(Bt),Gt.isZero()?It=Vt+It:It=ct[Ct-Vt.length]+Vt+It}for(this.isZero()&&(It="0"+It);It.length%xt!==0;)It="0"+It;return this.negative!==0&&(It="-"+It),It}_e(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var mt=this.words[0];return this.length===2?mt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?mt+=4503599627370496+this.words[1]*67108864:this.length>2&&_e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-mt:mt},tt.prototype.toJSON=function(){return this.toString(16,2)},nt&&(tt.prototype.toBuffer=function(mt,xt){return this.toArrayLike(nt,mt,xt)}),tt.prototype.toArray=function(mt,xt){return this.toArrayLike(Array,mt,xt)};var ft=function(mt,xt){return mt.allocUnsafe?mt.allocUnsafe(xt):new mt(xt)};tt.prototype.toArrayLike=function(mt,xt,It){this._strip();var jt=this.byteLength(),At=It||Math.max(1,jt);_e(jt<=At,"byte array longer than desired length"),_e(At>0,"Requested array length <= 0");var wt=ft(mt,At),Rt=xt==="le"?"LE":"BE";return this["_toArrayLike"+Rt](wt,jt),wt},tt.prototype._toArrayLikeLE=function(mt,xt){for(var It=0,jt=0,At=0,wt=0;At>8&255),It>16&255),wt===6?(It>24&255),jt=0,wt=0):(jt=Rt>>>24,wt+=2)}if(It=0&&(mt[It--]=Rt>>8&255),It>=0&&(mt[It--]=Rt>>16&255),wt===6?(It>=0&&(mt[It--]=Rt>>24&255),jt=0,wt=0):(jt=Rt>>>24,wt+=2)}if(It>=0)for(mt[It--]=jt;It>=0;)mt[It--]=0},Math.clz32?tt.prototype._countBits=function(mt){return 32-Math.clz32(mt)}:tt.prototype._countBits=function(mt){var xt=mt,It=0;return xt>=4096&&(It+=13,xt>>>=13),xt>=64&&(It+=7,xt>>>=7),xt>=8&&(It+=4,xt>>>=4),xt>=2&&(It+=2,xt>>>=2),It+xt},tt.prototype._zeroBits=function(mt){if(mt===0)return 26;var xt=mt,It=0;return xt&8191||(It+=13,xt>>>=13),xt&127||(It+=7,xt>>>=7),xt&15||(It+=4,xt>>>=4),xt&3||(It+=2,xt>>>=2),xt&1||It++,It},tt.prototype.bitLength=function(){var mt=this.words[this.length-1],xt=this._countBits(mt);return(this.length-1)*26+xt};function gt(Lt){for(var mt=new Array(Lt.bitLength()),xt=0;xt>>jt&1}return mt}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var mt=0,xt=0;xtmt.length?this.clone().ior(mt):mt.clone().ior(this)},tt.prototype.uor=function(mt){return this.length>mt.length?this.clone().iuor(mt):mt.clone().iuor(this)},tt.prototype.iuand=function(mt){var xt;this.length>mt.length?xt=mt:xt=this;for(var It=0;Itmt.length?this.clone().iand(mt):mt.clone().iand(this)},tt.prototype.uand=function(mt){return this.length>mt.length?this.clone().iuand(mt):mt.clone().iuand(this)},tt.prototype.iuxor=function(mt){var xt,It;this.length>mt.length?(xt=this,It=mt):(xt=mt,It=this);for(var jt=0;jtmt.length?this.clone().ixor(mt):mt.clone().ixor(this)},tt.prototype.uxor=function(mt){return this.length>mt.length?this.clone().iuxor(mt):mt.clone().iuxor(this)},tt.prototype.inotn=function(mt){_e(typeof mt=="number"&&mt>=0);var xt=Math.ceil(mt/26)|0,It=mt%26;this._expand(xt),It>0&&xt--;for(var jt=0;jt0&&(this.words[jt]=~this.words[jt]&67108863>>26-It),this._strip()},tt.prototype.notn=function(mt){return this.clone().inotn(mt)},tt.prototype.setn=function(mt,xt){_e(typeof mt=="number"&&mt>=0);var It=mt/26|0,jt=mt%26;return this._expand(It+1),xt?this.words[It]=this.words[It]|1<mt.length?(It=this,jt=mt):(It=mt,jt=this);for(var At=0,wt=0;wt>>26;for(;At!==0&&wt>>26;if(this.length=It.length,At!==0)this.words[this.length]=At,this.length++;else if(It!==this)for(;wtmt.length?this.clone().iadd(mt):mt.clone().iadd(this)},tt.prototype.isub=function(mt){if(mt.negative!==0){mt.negative=0;var xt=this.iadd(mt);return mt.negative=1,xt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(mt),this.negative=1,this._normSign();var It=this.cmp(mt);if(It===0)return this.negative=0,this.length=1,this.words[0]=0,this;var jt,At;It>0?(jt=this,At=mt):(jt=mt,At=this);for(var wt=0,Rt=0;Rt>26,this.words[Rt]=xt&67108863;for(;wt!==0&&Rt>26,this.words[Rt]=xt&67108863;if(wt===0&&Rt>>26,Gt=Nt&67108863,Vt=Math.min(Ct,mt.length-1),Yt=Math.max(0,Ct-Lt.length+1);Yt<=Vt;Yt++){var Qt=Ct-Yt|0;jt=Lt.words[Qt]|0,At=mt.words[Yt]|0,wt=jt*At+Gt,Bt+=wt/67108864|0,Gt=wt&67108863}xt.words[Ct]=Gt|0,Nt=Bt|0}return Nt!==0?xt.words[Ct]=Nt|0:xt.length--,xt._strip()}var yt=function(mt,xt,It){var jt=mt.words,At=xt.words,wt=It.words,Rt=0,Nt,Ct,Bt,Gt=jt[0]|0,Vt=Gt&8191,Yt=Gt>>>13,Qt=jt[1]|0,qt=Qt&8191,Zt=Qt>>>13,fn=jt[2]|0,Xt=fn&8191,on=fn>>>13,tn=jt[3]|0,Kt=tn&8191,Jt=tn>>>13,En=jt[4]|0,pn=En&8191,cn=En>>>13,Tn=jt[5]|0,sn=Tn&8191,an=Tn>>>13,Mn=jt[6]|0,hn=Mn&8191,ln=Mn>>>13,Cn=jt[7]|0,gn=Cn&8191,$t=Cn>>>13,bt=jt[8]|0,Et=bt&8191,kt=bt>>>13,Ut=jt[9]|0,Ht=Ut&8191,Wt=Ut>>>13,nn=At[0]|0,rn=nn&8191,en=nn>>>13,mn=At[1]|0,un=mn&8191,Bn=mn>>>13,Qn=At[2]|0,On=Qn&8191,wn=Qn>>>13,Gn=At[3]|0,Nn=Gn&8191,Ln=Gn>>>13,qn=At[4]|0,_n=qn&8191,Dn=qn>>>13,Wn=At[5]|0,Pn=Wn&8191,An=Wn>>>13,Vn=At[6]|0,Sn=Vn&8191,vn=Vn>>>13,Zn=At[7]|0,In=Zn&8191,$n=Zn>>>13,Yn=At[8]|0,jn=Yn&8191,zn=Yn>>>13,Rn=At[9]|0,yn=Rn&8191,kn=Rn>>>13;It.negative=mt.negative^xt.negative,It.length=19,Nt=Math.imul(Vt,rn),Ct=Math.imul(Vt,en),Ct=Ct+Math.imul(Yt,rn)|0,Bt=Math.imul(Yt,en);var Hn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,Nt=Math.imul(qt,rn),Ct=Math.imul(qt,en),Ct=Ct+Math.imul(Zt,rn)|0,Bt=Math.imul(Zt,en),Nt=Nt+Math.imul(Vt,un)|0,Ct=Ct+Math.imul(Vt,Bn)|0,Ct=Ct+Math.imul(Yt,un)|0,Bt=Bt+Math.imul(Yt,Bn)|0;var Un=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Un>>>26)|0,Un&=67108863,Nt=Math.imul(Xt,rn),Ct=Math.imul(Xt,en),Ct=Ct+Math.imul(on,rn)|0,Bt=Math.imul(on,en),Nt=Nt+Math.imul(qt,un)|0,Ct=Ct+Math.imul(qt,Bn)|0,Ct=Ct+Math.imul(Zt,un)|0,Bt=Bt+Math.imul(Zt,Bn)|0,Nt=Nt+Math.imul(Vt,On)|0,Ct=Ct+Math.imul(Vt,wn)|0,Ct=Ct+Math.imul(Yt,On)|0,Bt=Bt+Math.imul(Yt,wn)|0;var xn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(xn>>>26)|0,xn&=67108863,Nt=Math.imul(Kt,rn),Ct=Math.imul(Kt,en),Ct=Ct+Math.imul(Jt,rn)|0,Bt=Math.imul(Jt,en),Nt=Nt+Math.imul(Xt,un)|0,Ct=Ct+Math.imul(Xt,Bn)|0,Ct=Ct+Math.imul(on,un)|0,Bt=Bt+Math.imul(on,Bn)|0,Nt=Nt+Math.imul(qt,On)|0,Ct=Ct+Math.imul(qt,wn)|0,Ct=Ct+Math.imul(Zt,On)|0,Bt=Bt+Math.imul(Zt,wn)|0,Nt=Nt+Math.imul(Vt,Nn)|0,Ct=Ct+Math.imul(Vt,Ln)|0,Ct=Ct+Math.imul(Yt,Nn)|0,Bt=Bt+Math.imul(Yt,Ln)|0;var Fn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,Nt=Math.imul(pn,rn),Ct=Math.imul(pn,en),Ct=Ct+Math.imul(cn,rn)|0,Bt=Math.imul(cn,en),Nt=Nt+Math.imul(Kt,un)|0,Ct=Ct+Math.imul(Kt,Bn)|0,Ct=Ct+Math.imul(Jt,un)|0,Bt=Bt+Math.imul(Jt,Bn)|0,Nt=Nt+Math.imul(Xt,On)|0,Ct=Ct+Math.imul(Xt,wn)|0,Ct=Ct+Math.imul(on,On)|0,Bt=Bt+Math.imul(on,wn)|0,Nt=Nt+Math.imul(qt,Nn)|0,Ct=Ct+Math.imul(qt,Ln)|0,Ct=Ct+Math.imul(Zt,Nn)|0,Bt=Bt+Math.imul(Zt,Ln)|0,Nt=Nt+Math.imul(Vt,_n)|0,Ct=Ct+Math.imul(Vt,Dn)|0,Ct=Ct+Math.imul(Yt,_n)|0,Bt=Bt+Math.imul(Yt,Dn)|0;var Kn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,Nt=Math.imul(sn,rn),Ct=Math.imul(sn,en),Ct=Ct+Math.imul(an,rn)|0,Bt=Math.imul(an,en),Nt=Nt+Math.imul(pn,un)|0,Ct=Ct+Math.imul(pn,Bn)|0,Ct=Ct+Math.imul(cn,un)|0,Bt=Bt+Math.imul(cn,Bn)|0,Nt=Nt+Math.imul(Kt,On)|0,Ct=Ct+Math.imul(Kt,wn)|0,Ct=Ct+Math.imul(Jt,On)|0,Bt=Bt+Math.imul(Jt,wn)|0,Nt=Nt+Math.imul(Xt,Nn)|0,Ct=Ct+Math.imul(Xt,Ln)|0,Ct=Ct+Math.imul(on,Nn)|0,Bt=Bt+Math.imul(on,Ln)|0,Nt=Nt+Math.imul(qt,_n)|0,Ct=Ct+Math.imul(qt,Dn)|0,Ct=Ct+Math.imul(Zt,_n)|0,Bt=Bt+Math.imul(Zt,Dn)|0,Nt=Nt+Math.imul(Vt,Pn)|0,Ct=Ct+Math.imul(Vt,An)|0,Ct=Ct+Math.imul(Yt,Pn)|0,Bt=Bt+Math.imul(Yt,An)|0;var Xn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,Nt=Math.imul(hn,rn),Ct=Math.imul(hn,en),Ct=Ct+Math.imul(ln,rn)|0,Bt=Math.imul(ln,en),Nt=Nt+Math.imul(sn,un)|0,Ct=Ct+Math.imul(sn,Bn)|0,Ct=Ct+Math.imul(an,un)|0,Bt=Bt+Math.imul(an,Bn)|0,Nt=Nt+Math.imul(pn,On)|0,Ct=Ct+Math.imul(pn,wn)|0,Ct=Ct+Math.imul(cn,On)|0,Bt=Bt+Math.imul(cn,wn)|0,Nt=Nt+Math.imul(Kt,Nn)|0,Ct=Ct+Math.imul(Kt,Ln)|0,Ct=Ct+Math.imul(Jt,Nn)|0,Bt=Bt+Math.imul(Jt,Ln)|0,Nt=Nt+Math.imul(Xt,_n)|0,Ct=Ct+Math.imul(Xt,Dn)|0,Ct=Ct+Math.imul(on,_n)|0,Bt=Bt+Math.imul(on,Dn)|0,Nt=Nt+Math.imul(qt,Pn)|0,Ct=Ct+Math.imul(qt,An)|0,Ct=Ct+Math.imul(Zt,Pn)|0,Bt=Bt+Math.imul(Zt,An)|0,Nt=Nt+Math.imul(Vt,Sn)|0,Ct=Ct+Math.imul(Vt,vn)|0,Ct=Ct+Math.imul(Yt,Sn)|0,Bt=Bt+Math.imul(Yt,vn)|0;var Jn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Nt=Math.imul(gn,rn),Ct=Math.imul(gn,en),Ct=Ct+Math.imul($t,rn)|0,Bt=Math.imul($t,en),Nt=Nt+Math.imul(hn,un)|0,Ct=Ct+Math.imul(hn,Bn)|0,Ct=Ct+Math.imul(ln,un)|0,Bt=Bt+Math.imul(ln,Bn)|0,Nt=Nt+Math.imul(sn,On)|0,Ct=Ct+Math.imul(sn,wn)|0,Ct=Ct+Math.imul(an,On)|0,Bt=Bt+Math.imul(an,wn)|0,Nt=Nt+Math.imul(pn,Nn)|0,Ct=Ct+Math.imul(pn,Ln)|0,Ct=Ct+Math.imul(cn,Nn)|0,Bt=Bt+Math.imul(cn,Ln)|0,Nt=Nt+Math.imul(Kt,_n)|0,Ct=Ct+Math.imul(Kt,Dn)|0,Ct=Ct+Math.imul(Jt,_n)|0,Bt=Bt+Math.imul(Jt,Dn)|0,Nt=Nt+Math.imul(Xt,Pn)|0,Ct=Ct+Math.imul(Xt,An)|0,Ct=Ct+Math.imul(on,Pn)|0,Bt=Bt+Math.imul(on,An)|0,Nt=Nt+Math.imul(qt,Sn)|0,Ct=Ct+Math.imul(qt,vn)|0,Ct=Ct+Math.imul(Zt,Sn)|0,Bt=Bt+Math.imul(Zt,vn)|0,Nt=Nt+Math.imul(Vt,In)|0,Ct=Ct+Math.imul(Vt,$n)|0,Ct=Ct+Math.imul(Yt,In)|0,Bt=Bt+Math.imul(Yt,$n)|0;var er=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(er>>>26)|0,er&=67108863,Nt=Math.imul(Et,rn),Ct=Math.imul(Et,en),Ct=Ct+Math.imul(kt,rn)|0,Bt=Math.imul(kt,en),Nt=Nt+Math.imul(gn,un)|0,Ct=Ct+Math.imul(gn,Bn)|0,Ct=Ct+Math.imul($t,un)|0,Bt=Bt+Math.imul($t,Bn)|0,Nt=Nt+Math.imul(hn,On)|0,Ct=Ct+Math.imul(hn,wn)|0,Ct=Ct+Math.imul(ln,On)|0,Bt=Bt+Math.imul(ln,wn)|0,Nt=Nt+Math.imul(sn,Nn)|0,Ct=Ct+Math.imul(sn,Ln)|0,Ct=Ct+Math.imul(an,Nn)|0,Bt=Bt+Math.imul(an,Ln)|0,Nt=Nt+Math.imul(pn,_n)|0,Ct=Ct+Math.imul(pn,Dn)|0,Ct=Ct+Math.imul(cn,_n)|0,Bt=Bt+Math.imul(cn,Dn)|0,Nt=Nt+Math.imul(Kt,Pn)|0,Ct=Ct+Math.imul(Kt,An)|0,Ct=Ct+Math.imul(Jt,Pn)|0,Bt=Bt+Math.imul(Jt,An)|0,Nt=Nt+Math.imul(Xt,Sn)|0,Ct=Ct+Math.imul(Xt,vn)|0,Ct=Ct+Math.imul(on,Sn)|0,Bt=Bt+Math.imul(on,vn)|0,Nt=Nt+Math.imul(qt,In)|0,Ct=Ct+Math.imul(qt,$n)|0,Ct=Ct+Math.imul(Zt,In)|0,Bt=Bt+Math.imul(Zt,$n)|0,Nt=Nt+Math.imul(Vt,jn)|0,Ct=Ct+Math.imul(Vt,zn)|0,Ct=Ct+Math.imul(Yt,jn)|0,Bt=Bt+Math.imul(Yt,zn)|0;var tr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(tr>>>26)|0,tr&=67108863,Nt=Math.imul(Ht,rn),Ct=Math.imul(Ht,en),Ct=Ct+Math.imul(Wt,rn)|0,Bt=Math.imul(Wt,en),Nt=Nt+Math.imul(Et,un)|0,Ct=Ct+Math.imul(Et,Bn)|0,Ct=Ct+Math.imul(kt,un)|0,Bt=Bt+Math.imul(kt,Bn)|0,Nt=Nt+Math.imul(gn,On)|0,Ct=Ct+Math.imul(gn,wn)|0,Ct=Ct+Math.imul($t,On)|0,Bt=Bt+Math.imul($t,wn)|0,Nt=Nt+Math.imul(hn,Nn)|0,Ct=Ct+Math.imul(hn,Ln)|0,Ct=Ct+Math.imul(ln,Nn)|0,Bt=Bt+Math.imul(ln,Ln)|0,Nt=Nt+Math.imul(sn,_n)|0,Ct=Ct+Math.imul(sn,Dn)|0,Ct=Ct+Math.imul(an,_n)|0,Bt=Bt+Math.imul(an,Dn)|0,Nt=Nt+Math.imul(pn,Pn)|0,Ct=Ct+Math.imul(pn,An)|0,Ct=Ct+Math.imul(cn,Pn)|0,Bt=Bt+Math.imul(cn,An)|0,Nt=Nt+Math.imul(Kt,Sn)|0,Ct=Ct+Math.imul(Kt,vn)|0,Ct=Ct+Math.imul(Jt,Sn)|0,Bt=Bt+Math.imul(Jt,vn)|0,Nt=Nt+Math.imul(Xt,In)|0,Ct=Ct+Math.imul(Xt,$n)|0,Ct=Ct+Math.imul(on,In)|0,Bt=Bt+Math.imul(on,$n)|0,Nt=Nt+Math.imul(qt,jn)|0,Ct=Ct+Math.imul(qt,zn)|0,Ct=Ct+Math.imul(Zt,jn)|0,Bt=Bt+Math.imul(Zt,zn)|0,Nt=Nt+Math.imul(Vt,yn)|0,Ct=Ct+Math.imul(Vt,kn)|0,Ct=Ct+Math.imul(Yt,yn)|0,Bt=Bt+Math.imul(Yt,kn)|0;var nr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(nr>>>26)|0,nr&=67108863,Nt=Math.imul(Ht,un),Ct=Math.imul(Ht,Bn),Ct=Ct+Math.imul(Wt,un)|0,Bt=Math.imul(Wt,Bn),Nt=Nt+Math.imul(Et,On)|0,Ct=Ct+Math.imul(Et,wn)|0,Ct=Ct+Math.imul(kt,On)|0,Bt=Bt+Math.imul(kt,wn)|0,Nt=Nt+Math.imul(gn,Nn)|0,Ct=Ct+Math.imul(gn,Ln)|0,Ct=Ct+Math.imul($t,Nn)|0,Bt=Bt+Math.imul($t,Ln)|0,Nt=Nt+Math.imul(hn,_n)|0,Ct=Ct+Math.imul(hn,Dn)|0,Ct=Ct+Math.imul(ln,_n)|0,Bt=Bt+Math.imul(ln,Dn)|0,Nt=Nt+Math.imul(sn,Pn)|0,Ct=Ct+Math.imul(sn,An)|0,Ct=Ct+Math.imul(an,Pn)|0,Bt=Bt+Math.imul(an,An)|0,Nt=Nt+Math.imul(pn,Sn)|0,Ct=Ct+Math.imul(pn,vn)|0,Ct=Ct+Math.imul(cn,Sn)|0,Bt=Bt+Math.imul(cn,vn)|0,Nt=Nt+Math.imul(Kt,In)|0,Ct=Ct+Math.imul(Kt,$n)|0,Ct=Ct+Math.imul(Jt,In)|0,Bt=Bt+Math.imul(Jt,$n)|0,Nt=Nt+Math.imul(Xt,jn)|0,Ct=Ct+Math.imul(Xt,zn)|0,Ct=Ct+Math.imul(on,jn)|0,Bt=Bt+Math.imul(on,zn)|0,Nt=Nt+Math.imul(qt,yn)|0,Ct=Ct+Math.imul(qt,kn)|0,Ct=Ct+Math.imul(Zt,yn)|0,Bt=Bt+Math.imul(Zt,kn)|0;var rr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(rr>>>26)|0,rr&=67108863,Nt=Math.imul(Ht,On),Ct=Math.imul(Ht,wn),Ct=Ct+Math.imul(Wt,On)|0,Bt=Math.imul(Wt,wn),Nt=Nt+Math.imul(Et,Nn)|0,Ct=Ct+Math.imul(Et,Ln)|0,Ct=Ct+Math.imul(kt,Nn)|0,Bt=Bt+Math.imul(kt,Ln)|0,Nt=Nt+Math.imul(gn,_n)|0,Ct=Ct+Math.imul(gn,Dn)|0,Ct=Ct+Math.imul($t,_n)|0,Bt=Bt+Math.imul($t,Dn)|0,Nt=Nt+Math.imul(hn,Pn)|0,Ct=Ct+Math.imul(hn,An)|0,Ct=Ct+Math.imul(ln,Pn)|0,Bt=Bt+Math.imul(ln,An)|0,Nt=Nt+Math.imul(sn,Sn)|0,Ct=Ct+Math.imul(sn,vn)|0,Ct=Ct+Math.imul(an,Sn)|0,Bt=Bt+Math.imul(an,vn)|0,Nt=Nt+Math.imul(pn,In)|0,Ct=Ct+Math.imul(pn,$n)|0,Ct=Ct+Math.imul(cn,In)|0,Bt=Bt+Math.imul(cn,$n)|0,Nt=Nt+Math.imul(Kt,jn)|0,Ct=Ct+Math.imul(Kt,zn)|0,Ct=Ct+Math.imul(Jt,jn)|0,Bt=Bt+Math.imul(Jt,zn)|0,Nt=Nt+Math.imul(Xt,yn)|0,Ct=Ct+Math.imul(Xt,kn)|0,Ct=Ct+Math.imul(on,yn)|0,Bt=Bt+Math.imul(on,kn)|0;var or=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(or>>>26)|0,or&=67108863,Nt=Math.imul(Ht,Nn),Ct=Math.imul(Ht,Ln),Ct=Ct+Math.imul(Wt,Nn)|0,Bt=Math.imul(Wt,Ln),Nt=Nt+Math.imul(Et,_n)|0,Ct=Ct+Math.imul(Et,Dn)|0,Ct=Ct+Math.imul(kt,_n)|0,Bt=Bt+Math.imul(kt,Dn)|0,Nt=Nt+Math.imul(gn,Pn)|0,Ct=Ct+Math.imul(gn,An)|0,Ct=Ct+Math.imul($t,Pn)|0,Bt=Bt+Math.imul($t,An)|0,Nt=Nt+Math.imul(hn,Sn)|0,Ct=Ct+Math.imul(hn,vn)|0,Ct=Ct+Math.imul(ln,Sn)|0,Bt=Bt+Math.imul(ln,vn)|0,Nt=Nt+Math.imul(sn,In)|0,Ct=Ct+Math.imul(sn,$n)|0,Ct=Ct+Math.imul(an,In)|0,Bt=Bt+Math.imul(an,$n)|0,Nt=Nt+Math.imul(pn,jn)|0,Ct=Ct+Math.imul(pn,zn)|0,Ct=Ct+Math.imul(cn,jn)|0,Bt=Bt+Math.imul(cn,zn)|0,Nt=Nt+Math.imul(Kt,yn)|0,Ct=Ct+Math.imul(Kt,kn)|0,Ct=Ct+Math.imul(Jt,yn)|0,Bt=Bt+Math.imul(Jt,kn)|0;var ir=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(ir>>>26)|0,ir&=67108863,Nt=Math.imul(Ht,_n),Ct=Math.imul(Ht,Dn),Ct=Ct+Math.imul(Wt,_n)|0,Bt=Math.imul(Wt,Dn),Nt=Nt+Math.imul(Et,Pn)|0,Ct=Ct+Math.imul(Et,An)|0,Ct=Ct+Math.imul(kt,Pn)|0,Bt=Bt+Math.imul(kt,An)|0,Nt=Nt+Math.imul(gn,Sn)|0,Ct=Ct+Math.imul(gn,vn)|0,Ct=Ct+Math.imul($t,Sn)|0,Bt=Bt+Math.imul($t,vn)|0,Nt=Nt+Math.imul(hn,In)|0,Ct=Ct+Math.imul(hn,$n)|0,Ct=Ct+Math.imul(ln,In)|0,Bt=Bt+Math.imul(ln,$n)|0,Nt=Nt+Math.imul(sn,jn)|0,Ct=Ct+Math.imul(sn,zn)|0,Ct=Ct+Math.imul(an,jn)|0,Bt=Bt+Math.imul(an,zn)|0,Nt=Nt+Math.imul(pn,yn)|0,Ct=Ct+Math.imul(pn,kn)|0,Ct=Ct+Math.imul(cn,yn)|0,Bt=Bt+Math.imul(cn,kn)|0;var sr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(sr>>>26)|0,sr&=67108863,Nt=Math.imul(Ht,Pn),Ct=Math.imul(Ht,An),Ct=Ct+Math.imul(Wt,Pn)|0,Bt=Math.imul(Wt,An),Nt=Nt+Math.imul(Et,Sn)|0,Ct=Ct+Math.imul(Et,vn)|0,Ct=Ct+Math.imul(kt,Sn)|0,Bt=Bt+Math.imul(kt,vn)|0,Nt=Nt+Math.imul(gn,In)|0,Ct=Ct+Math.imul(gn,$n)|0,Ct=Ct+Math.imul($t,In)|0,Bt=Bt+Math.imul($t,$n)|0,Nt=Nt+Math.imul(hn,jn)|0,Ct=Ct+Math.imul(hn,zn)|0,Ct=Ct+Math.imul(ln,jn)|0,Bt=Bt+Math.imul(ln,zn)|0,Nt=Nt+Math.imul(sn,yn)|0,Ct=Ct+Math.imul(sn,kn)|0,Ct=Ct+Math.imul(an,yn)|0,Bt=Bt+Math.imul(an,kn)|0;var ar=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(ar>>>26)|0,ar&=67108863,Nt=Math.imul(Ht,Sn),Ct=Math.imul(Ht,vn),Ct=Ct+Math.imul(Wt,Sn)|0,Bt=Math.imul(Wt,vn),Nt=Nt+Math.imul(Et,In)|0,Ct=Ct+Math.imul(Et,$n)|0,Ct=Ct+Math.imul(kt,In)|0,Bt=Bt+Math.imul(kt,$n)|0,Nt=Nt+Math.imul(gn,jn)|0,Ct=Ct+Math.imul(gn,zn)|0,Ct=Ct+Math.imul($t,jn)|0,Bt=Bt+Math.imul($t,zn)|0,Nt=Nt+Math.imul(hn,yn)|0,Ct=Ct+Math.imul(hn,kn)|0,Ct=Ct+Math.imul(ln,yn)|0,Bt=Bt+Math.imul(ln,kn)|0;var lr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(lr>>>26)|0,lr&=67108863,Nt=Math.imul(Ht,In),Ct=Math.imul(Ht,$n),Ct=Ct+Math.imul(Wt,In)|0,Bt=Math.imul(Wt,$n),Nt=Nt+Math.imul(Et,jn)|0,Ct=Ct+Math.imul(Et,zn)|0,Ct=Ct+Math.imul(kt,jn)|0,Bt=Bt+Math.imul(kt,zn)|0,Nt=Nt+Math.imul(gn,yn)|0,Ct=Ct+Math.imul(gn,kn)|0,Ct=Ct+Math.imul($t,yn)|0,Bt=Bt+Math.imul($t,kn)|0;var ur=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(ur>>>26)|0,ur&=67108863,Nt=Math.imul(Ht,jn),Ct=Math.imul(Ht,zn),Ct=Ct+Math.imul(Wt,jn)|0,Bt=Math.imul(Wt,zn),Nt=Nt+Math.imul(Et,yn)|0,Ct=Ct+Math.imul(Et,kn)|0,Ct=Ct+Math.imul(kt,yn)|0,Bt=Bt+Math.imul(kt,kn)|0;var cr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(cr>>>26)|0,cr&=67108863,Nt=Math.imul(Ht,yn),Ct=Math.imul(Ht,kn),Ct=Ct+Math.imul(Wt,yn)|0,Bt=Math.imul(Wt,kn);var dr=(Rt+Nt|0)+((Ct&8191)<<13)|0;return Rt=(Bt+(Ct>>>13)|0)+(dr>>>26)|0,dr&=67108863,wt[0]=Hn,wt[1]=Un,wt[2]=xn,wt[3]=Fn,wt[4]=Kn,wt[5]=Xn,wt[6]=Jn,wt[7]=er,wt[8]=tr,wt[9]=nr,wt[10]=rr,wt[11]=or,wt[12]=ir,wt[13]=sr,wt[14]=ar,wt[15]=lr,wt[16]=ur,wt[17]=cr,wt[18]=dr,Rt!==0&&(wt[19]=Rt,It.length++),It};Math.imul||(yt=ht);function pt(Lt,mt,xt){xt.negative=mt.negative^Lt.negative,xt.length=Lt.length+mt.length;for(var It=0,jt=0,At=0;At>>26)|0,jt+=wt>>>26,wt&=67108863}xt.words[At]=Rt,It=wt,wt=jt}return It!==0?xt.words[At]=It:xt.length--,xt._strip()}function Mt(Lt,mt,xt){return pt(Lt,mt,xt)}tt.prototype.mulTo=function(mt,xt){var It,jt=this.length+mt.length;return this.length===10&&mt.length===10?It=yt(this,mt,xt):jt<63?It=ht(this,mt,xt):jt<1024?It=pt(this,mt,xt):It=Mt(this,mt,xt),It},tt.prototype.mul=function(mt){var xt=new tt(null);return xt.words=new Array(this.length+mt.length),this.mulTo(mt,xt)},tt.prototype.mulf=function(mt){var xt=new tt(null);return xt.words=new Array(this.length+mt.length),Mt(this,mt,xt)},tt.prototype.imul=function(mt){return this.clone().mulTo(mt,this)},tt.prototype.imuln=function(mt){var xt=mt<0;xt&&(mt=-mt),_e(typeof mt=="number"),_e(mt<67108864);for(var It=0,jt=0;jt>=26,It+=At/67108864|0,It+=wt>>>26,this.words[jt]=wt&67108863}return It!==0&&(this.words[jt]=It,this.length++),xt?this.ineg():this},tt.prototype.muln=function(mt){return this.clone().imuln(mt)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(mt){var xt=gt(mt);if(xt.length===0)return new tt(1);for(var It=this,jt=0;jt=0);var xt=mt%26,It=(mt-xt)/26,jt=67108863>>>26-xt<<26-xt,At;if(xt!==0){var wt=0;for(At=0;At>>26-xt}wt&&(this.words[At]=wt,this.length++)}if(It!==0){for(At=this.length-1;At>=0;At--)this.words[At+It]=this.words[At];for(At=0;At=0);var jt;xt?jt=(xt-xt%26)/26:jt=0;var At=mt%26,wt=Math.min((mt-At)/26,this.length),Rt=67108863^67108863>>>At<wt)for(this.length-=wt,Ct=0;Ct=0&&(Bt!==0||Ct>=jt);Ct--){var Gt=this.words[Ct]|0;this.words[Ct]=Bt<<26-At|Gt>>>At,Bt=Gt&Rt}return Nt&&Bt!==0&&(Nt.words[Nt.length++]=Bt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},tt.prototype.ishrn=function(mt,xt,It){return _e(this.negative===0),this.iushrn(mt,xt,It)},tt.prototype.shln=function(mt){return this.clone().ishln(mt)},tt.prototype.ushln=function(mt){return this.clone().iushln(mt)},tt.prototype.shrn=function(mt){return this.clone().ishrn(mt)},tt.prototype.ushrn=function(mt){return this.clone().iushrn(mt)},tt.prototype.testn=function(mt){_e(typeof mt=="number"&&mt>=0);var xt=mt%26,It=(mt-xt)/26,jt=1<=0);var xt=mt%26,It=(mt-xt)/26;if(_e(this.negative===0,"imaskn works only with positive numbers"),this.length<=It)return this;if(xt!==0&&It++,this.length=Math.min(It,this.length),xt!==0){var jt=67108863^67108863>>>xt<=67108864;xt++)this.words[xt]-=67108864,xt===this.length-1?this.words[xt+1]=1:this.words[xt+1]++;return this.length=Math.max(this.length,xt+1),this},tt.prototype.isubn=function(mt){if(_e(typeof mt=="number"),_e(mt<67108864),mt<0)return this.iaddn(-mt);if(this.negative!==0)return this.negative=0,this.iaddn(mt),this.negative=1,this;if(this.words[0]-=mt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var xt=0;xt>26)-(Nt/67108864|0),this.words[At+It]=wt&67108863}for(;At>26,this.words[At+It]=wt&67108863;if(Rt===0)return this._strip();for(_e(Rt===-1),Rt=0,At=0;At>26,this.words[At]=wt&67108863;return this.negative=1,this._strip()},tt.prototype._wordDiv=function(mt,xt){var It=this.length-mt.length,jt=this.clone(),At=mt,wt=At.words[At.length-1]|0,Rt=this._countBits(wt);It=26-Rt,It!==0&&(At=At.ushln(It),jt.iushln(It),wt=At.words[At.length-1]|0);var Nt=jt.length-At.length,Ct;if(xt!=="mod"){Ct=new tt(null),Ct.length=Nt+1,Ct.words=new Array(Ct.length);for(var Bt=0;Bt=0;Vt--){var Yt=(jt.words[At.length+Vt]|0)*67108864+(jt.words[At.length+Vt-1]|0);for(Yt=Math.min(Yt/wt|0,67108863),jt._ishlnsubmul(At,Yt,Vt);jt.negative!==0;)Yt--,jt.negative=0,jt._ishlnsubmul(At,1,Vt),jt.isZero()||(jt.negative^=1);Ct&&(Ct.words[Vt]=Yt)}return Ct&&Ct._strip(),jt._strip(),xt!=="div"&&It!==0&&jt.iushrn(It),{div:Ct||null,mod:jt}},tt.prototype.divmod=function(mt,xt,It){if(_e(!mt.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var jt,At,wt;return this.negative!==0&&mt.negative===0?(wt=this.neg().divmod(mt,xt),xt!=="mod"&&(jt=wt.div.neg()),xt!=="div"&&(At=wt.mod.neg(),It&&At.negative!==0&&At.iadd(mt)),{div:jt,mod:At}):this.negative===0&&mt.negative!==0?(wt=this.divmod(mt.neg(),xt),xt!=="mod"&&(jt=wt.div.neg()),{div:jt,mod:wt.mod}):this.negative&mt.negative?(wt=this.neg().divmod(mt.neg(),xt),xt!=="div"&&(At=wt.mod.neg(),It&&At.negative!==0&&At.isub(mt)),{div:wt.div,mod:At}):mt.length>this.length||this.cmp(mt)<0?{div:new tt(0),mod:this}:mt.length===1?xt==="div"?{div:this.divn(mt.words[0]),mod:null}:xt==="mod"?{div:null,mod:new tt(this.modrn(mt.words[0]))}:{div:this.divn(mt.words[0]),mod:new tt(this.modrn(mt.words[0]))}:this._wordDiv(mt,xt)},tt.prototype.div=function(mt){return this.divmod(mt,"div",!1).div},tt.prototype.mod=function(mt){return this.divmod(mt,"mod",!1).mod},tt.prototype.umod=function(mt){return this.divmod(mt,"mod",!0).mod},tt.prototype.divRound=function(mt){var xt=this.divmod(mt);if(xt.mod.isZero())return xt.div;var It=xt.div.negative!==0?xt.mod.isub(mt):xt.mod,jt=mt.ushrn(1),At=mt.andln(1),wt=It.cmp(jt);return wt<0||At===1&&wt===0?xt.div:xt.div.negative!==0?xt.div.isubn(1):xt.div.iaddn(1)},tt.prototype.modrn=function(mt){var xt=mt<0;xt&&(mt=-mt),_e(mt<=67108863);for(var It=(1<<26)%mt,jt=0,At=this.length-1;At>=0;At--)jt=(It*jt+(this.words[At]|0))%mt;return xt?-jt:jt},tt.prototype.modn=function(mt){return this.modrn(mt)},tt.prototype.idivn=function(mt){var xt=mt<0;xt&&(mt=-mt),_e(mt<=67108863);for(var It=0,jt=this.length-1;jt>=0;jt--){var At=(this.words[jt]|0)+It*67108864;this.words[jt]=At/mt|0,It=At%mt}return this._strip(),xt?this.ineg():this},tt.prototype.divn=function(mt){return this.clone().idivn(mt)},tt.prototype.egcd=function(mt){_e(mt.negative===0),_e(!mt.isZero());var xt=this,It=mt.clone();xt.negative!==0?xt=xt.umod(mt):xt=xt.clone();for(var jt=new tt(1),At=new tt(0),wt=new tt(0),Rt=new tt(1),Nt=0;xt.isEven()&&It.isEven();)xt.iushrn(1),It.iushrn(1),++Nt;for(var Ct=It.clone(),Bt=xt.clone();!xt.isZero();){for(var Gt=0,Vt=1;!(xt.words[0]&Vt)&&Gt<26;++Gt,Vt<<=1);if(Gt>0)for(xt.iushrn(Gt);Gt-- >0;)(jt.isOdd()||At.isOdd())&&(jt.iadd(Ct),At.isub(Bt)),jt.iushrn(1),At.iushrn(1);for(var Yt=0,Qt=1;!(It.words[0]&Qt)&&Yt<26;++Yt,Qt<<=1);if(Yt>0)for(It.iushrn(Yt);Yt-- >0;)(wt.isOdd()||Rt.isOdd())&&(wt.iadd(Ct),Rt.isub(Bt)),wt.iushrn(1),Rt.iushrn(1);xt.cmp(It)>=0?(xt.isub(It),jt.isub(wt),At.isub(Rt)):(It.isub(xt),wt.isub(jt),Rt.isub(At))}return{a:wt,b:Rt,gcd:It.iushln(Nt)}},tt.prototype._invmp=function(mt){_e(mt.negative===0),_e(!mt.isZero());var xt=this,It=mt.clone();xt.negative!==0?xt=xt.umod(mt):xt=xt.clone();for(var jt=new tt(1),At=new tt(0),wt=It.clone();xt.cmpn(1)>0&&It.cmpn(1)>0;){for(var Rt=0,Nt=1;!(xt.words[0]&Nt)&&Rt<26;++Rt,Nt<<=1);if(Rt>0)for(xt.iushrn(Rt);Rt-- >0;)jt.isOdd()&&jt.iadd(wt),jt.iushrn(1);for(var Ct=0,Bt=1;!(It.words[0]&Bt)&&Ct<26;++Ct,Bt<<=1);if(Ct>0)for(It.iushrn(Ct);Ct-- >0;)At.isOdd()&&At.iadd(wt),At.iushrn(1);xt.cmp(It)>=0?(xt.isub(It),jt.isub(At)):(It.isub(xt),At.isub(jt))}var Gt;return xt.cmpn(1)===0?Gt=jt:Gt=At,Gt.cmpn(0)<0&&Gt.iadd(mt),Gt},tt.prototype.gcd=function(mt){if(this.isZero())return mt.abs();if(mt.isZero())return this.abs();var xt=this.clone(),It=mt.clone();xt.negative=0,It.negative=0;for(var jt=0;xt.isEven()&&It.isEven();jt++)xt.iushrn(1),It.iushrn(1);do{for(;xt.isEven();)xt.iushrn(1);for(;It.isEven();)It.iushrn(1);var At=xt.cmp(It);if(At<0){var wt=xt;xt=It,It=wt}else if(At===0||It.cmpn(1)===0)break;xt.isub(It)}while(!0);return It.iushln(jt)},tt.prototype.invm=function(mt){return this.egcd(mt).a.umod(mt)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(mt){return this.words[0]&mt},tt.prototype.bincn=function(mt){_e(typeof mt=="number");var xt=mt%26,It=(mt-xt)/26,jt=1<>>26,Rt&=67108863,this.words[wt]=Rt}return At!==0&&(this.words[wt]=At,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(mt){var xt=mt<0;if(this.negative!==0&&!xt)return-1;if(this.negative===0&&xt)return 1;this._strip();var It;if(this.length>1)It=1;else{xt&&(mt=-mt),_e(mt<=67108863,"Number is too big");var jt=this.words[0]|0;It=jt===mt?0:jtmt.length)return 1;if(this.length=0;It--){var jt=this.words[It]|0,At=mt.words[It]|0;if(jt!==At){jtAt&&(xt=1);break}}return xt},tt.prototype.gtn=function(mt){return this.cmpn(mt)===1},tt.prototype.gt=function(mt){return this.cmp(mt)===1},tt.prototype.gten=function(mt){return this.cmpn(mt)>=0},tt.prototype.gte=function(mt){return this.cmp(mt)>=0},tt.prototype.ltn=function(mt){return this.cmpn(mt)===-1},tt.prototype.lt=function(mt){return this.cmp(mt)===-1},tt.prototype.lten=function(mt){return this.cmpn(mt)<=0},tt.prototype.lte=function(mt){return this.cmp(mt)<=0},tt.prototype.eqn=function(mt){return this.cmpn(mt)===0},tt.prototype.eq=function(mt){return this.cmp(mt)===0},tt.red=function(mt){return new Ft(mt)},tt.prototype.toRed=function(mt){return _e(!this.red,"Already a number in reduction context"),_e(this.negative===0,"red works only with positives"),mt.convertTo(this)._forceRed(mt)},tt.prototype.fromRed=function(){return _e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(mt){return this.red=mt,this},tt.prototype.forceRed=function(mt){return _e(!this.red,"Already a number in reduction context"),this._forceRed(mt)},tt.prototype.redAdd=function(mt){return _e(this.red,"redAdd works only with red numbers"),this.red.add(this,mt)},tt.prototype.redIAdd=function(mt){return _e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,mt)},tt.prototype.redSub=function(mt){return _e(this.red,"redSub works only with red numbers"),this.red.sub(this,mt)},tt.prototype.redISub=function(mt){return _e(this.red,"redISub works only with red numbers"),this.red.isub(this,mt)},tt.prototype.redShl=function(mt){return _e(this.red,"redShl works only with red numbers"),this.red.shl(this,mt)},tt.prototype.redMul=function(mt){return _e(this.red,"redMul works only with red numbers"),this.red._verify2(this,mt),this.red.mul(this,mt)},tt.prototype.redIMul=function(mt){return _e(this.red,"redMul works only with red numbers"),this.red._verify2(this,mt),this.red.imul(this,mt)},tt.prototype.redSqr=function(){return _e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return _e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return _e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return _e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return _e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(mt){return _e(this.red&&!mt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,mt)};var St={k256:null,p224:null,p192:null,p25519:null};function Tt(Lt,mt){this.name=Lt,this.p=new tt(mt,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Tt.prototype._tmp=function(){var mt=new tt(null);return mt.words=new Array(Math.ceil(this.n/13)),mt},Tt.prototype.ireduce=function(mt){var xt=mt,It;do this.split(xt,this.tmp),xt=this.imulK(xt),xt=xt.iadd(this.tmp),It=xt.bitLength();while(It>this.n);var jt=It0?xt.isub(this.p):xt.strip!==void 0?xt.strip():xt._strip(),xt},Tt.prototype.split=function(mt,xt){mt.iushrn(this.n,0,xt)},Tt.prototype.imulK=function(mt){return mt.imul(this.k)};function vt(){Tt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(vt,Tt),vt.prototype.split=function(mt,xt){for(var It=4194303,jt=Math.min(mt.length,9),At=0;At>>22,wt=Rt}wt>>>=22,mt.words[At-10]=wt,wt===0&&mt.length>10?mt.length-=10:mt.length-=9},vt.prototype.imulK=function(mt){mt.words[mt.length]=0,mt.words[mt.length+1]=0,mt.length+=2;for(var xt=0,It=0;It>>=26,mt.words[It]=At,xt=jt}return xt!==0&&(mt.words[mt.length++]=xt),mt},tt._prime=function(mt){if(St[mt])return St[mt];var xt;if(mt==="k256")xt=new vt;else if(mt==="p224")xt=new Dt;else if(mt==="p192")xt=new zt;else if(mt==="p25519")xt=new Ot;else throw new Error("Unknown prime "+mt);return St[mt]=xt,xt};function Ft(Lt){if(typeof Lt=="string"){var mt=tt._prime(Lt);this.m=mt.p,this.prime=mt}else _e(Lt.gtn(1),"modulus must be greater than 1"),this.m=Lt,this.prime=null}Ft.prototype._verify1=function(mt){_e(mt.negative===0,"red works only with positives"),_e(mt.red,"red works only with red numbers")},Ft.prototype._verify2=function(mt,xt){_e((mt.negative|xt.negative)===0,"red works only with positives"),_e(mt.red&&mt.red===xt.red,"red works only with red numbers")},Ft.prototype.imod=function(mt){return this.prime?this.prime.ireduce(mt)._forceRed(this):(st(mt,mt.umod(this.m)._forceRed(this)),mt)},Ft.prototype.neg=function(mt){return mt.isZero()?mt.clone():this.m.sub(mt)._forceRed(this)},Ft.prototype.add=function(mt,xt){this._verify2(mt,xt);var It=mt.add(xt);return It.cmp(this.m)>=0&&It.isub(this.m),It._forceRed(this)},Ft.prototype.iadd=function(mt,xt){this._verify2(mt,xt);var It=mt.iadd(xt);return It.cmp(this.m)>=0&&It.isub(this.m),It},Ft.prototype.sub=function(mt,xt){this._verify2(mt,xt);var It=mt.sub(xt);return It.cmpn(0)<0&&It.iadd(this.m),It._forceRed(this)},Ft.prototype.isub=function(mt,xt){this._verify2(mt,xt);var It=mt.isub(xt);return It.cmpn(0)<0&&It.iadd(this.m),It},Ft.prototype.shl=function(mt,xt){return this._verify1(mt),this.imod(mt.ushln(xt))},Ft.prototype.imul=function(mt,xt){return this._verify2(mt,xt),this.imod(mt.imul(xt))},Ft.prototype.mul=function(mt,xt){return this._verify2(mt,xt),this.imod(mt.mul(xt))},Ft.prototype.isqr=function(mt){return this.imul(mt,mt.clone())},Ft.prototype.sqr=function(mt){return this.mul(mt,mt)},Ft.prototype.sqrt=function(mt){if(mt.isZero())return mt.clone();var xt=this.m.andln(3);if(_e(xt%2===1),xt===3){var It=this.m.add(new tt(1)).iushrn(2);return this.pow(mt,It)}for(var jt=this.m.subn(1),At=0;!jt.isZero()&&jt.andln(1)===0;)At++,jt.iushrn(1);_e(!jt.isZero());var wt=new tt(1).toRed(this),Rt=wt.redNeg(),Nt=this.m.subn(1).iushrn(1),Ct=this.m.bitLength();for(Ct=new tt(2*Ct*Ct).toRed(this);this.pow(Ct,Nt).cmp(Rt)!==0;)Ct.redIAdd(Rt);for(var Bt=this.pow(Ct,jt),Gt=this.pow(mt,jt.addn(1).iushrn(1)),Vt=this.pow(mt,jt),Yt=At;Vt.cmp(wt)!==0;){for(var Qt=Vt,qt=0;Qt.cmp(wt)!==0;qt++)Qt=Qt.redSqr();_e(qt=0;At--){for(var Bt=xt.words[At],Gt=Ct-1;Gt>=0;Gt--){var Vt=Bt>>Gt&1;if(wt!==jt[0]&&(wt=this.sqr(wt)),Vt===0&&Rt===0){Nt=0;continue}Rt<<=1,Rt|=Vt,Nt++,!(Nt!==It&&(At!==0||Gt!==0))&&(wt=this.mul(wt,jt[Rt]),Nt=0,Rt=0)}Ct=26}return wt},Ft.prototype.convertTo=function(mt){var xt=mt.umod(this.m);return xt===mt?xt.clone():xt},Ft.prototype.convertFrom=function(mt){var xt=mt.clone();return xt.red=null,xt},tt.mont=function(mt){return new Pt(mt)};function Pt(Lt){Ft.call(this,Lt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(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)}et(Pt,Ft),Pt.prototype.convertTo=function(mt){return this.imod(mt.ushln(this.shift))},Pt.prototype.convertFrom=function(mt){var xt=this.imod(mt.mul(this.rinv));return xt.red=null,xt},Pt.prototype.imul=function(mt,xt){if(mt.isZero()||xt.isZero())return mt.words[0]=0,mt.length=1,mt;var It=mt.imul(xt),jt=It.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=It.isub(jt).iushrn(this.shift),wt=At;return At.cmp(this.m)>=0?wt=At.isub(this.m):At.cmpn(0)<0&&(wt=At.iadd(this.m)),wt._forceRed(this)},Pt.prototype.mul=function(mt,xt){if(mt.isZero()||xt.isZero())return new tt(0)._forceRed(this);var It=mt.mul(xt),jt=It.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=It.isub(jt).iushrn(this.shift),wt=At;return At.cmp(this.m)>=0?wt=At.isub(this.m):At.cmpn(0)<0&&(wt=At.iadd(this.m)),wt._forceRed(this)},Pt.prototype.invm=function(mt){var xt=this.imod(mt._invmp(this.m).mul(this.r2));return xt._forceRed(this)}})(s,commonjsGlobal$1)})(bn);var bnExports=bn.exports;const BN=getDefaultExportFromCjs$1(bnExports);function setBigUint64(s,j,$,_e){if(typeof s.setBigUint64=="function")return s.setBigUint64(j,$,_e);const et=BigInt(32),tt=BigInt(4294967295),nt=Number($>>et&tt),rt=Number($&tt),ot=_e?4:0,it=_e?0:4;s.setUint32(j+ot,nt,_e),s.setUint32(j+it,rt,_e)}const Chi=(s,j,$)=>s&j^~s&$,Maj=(s,j,$)=>s&j^s&$^j&$;class HashMD extends Hash{constructor(j,$,_e,et){super(),this.blockLen=j,this.outputLen=$,this.padOffset=_e,this.isLE=et,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(j),this.view=createView(this.buffer)}update(j){exists(this);const{view:$,buffer:_e,blockLen:et}=this;j=toBytes(j);const tt=j.length;for(let nt=0;ntet-nt&&(this.process(_e,0),nt=0);for(let at=nt;atst.length)throw new Error("_sha2: outputLen bigger than state");for(let at=0;at>>3,ft=rotr(lt,17)^rotr(lt,19)^lt>>>10;SHA256_W[at]=ft+SHA256_W[at-7]+dt+SHA256_W[at-16]|0}let{A:_e,B:et,C:tt,D:nt,E:rt,F:ot,G:it,H:st}=this;for(let at=0;at<64;at++){const ct=rotr(rt,6)^rotr(rt,11)^rotr(rt,25),lt=st+ct+Chi(rt,ot,it)+SHA256_K[at]+SHA256_W[at]|0,ft=(rotr(_e,2)^rotr(_e,13)^rotr(_e,22))+Maj(_e,et,tt)|0;st=it,it=ot,ot=rt,rt=nt+lt|0,nt=tt,tt=et,et=_e,_e=lt+ft|0}_e=_e+this.A|0,et=et+this.B|0,tt=tt+this.C|0,nt=nt+this.D|0,rt=rt+this.E|0,ot=ot+this.F|0,it=it+this.G|0,st=st+this.H|0,this.set(_e,et,tt,nt,rt,ot,it,st)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class SHA224 extends SHA256{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const sha256=wrapConstructor(()=>new SHA256),sha224=wrapConstructor(()=>new SHA224),sha256$1=Object.freeze(Object.defineProperty({__proto__:null,sha224,sha256},Symbol.toStringTag,{value:"Module"}));var lib={};function inRange(s,j,$){return j<=s&&s<=$}function ToDictionary(s){if(s===void 0)return{};if(s===Object(s))return s;throw TypeError("Could not convert argument to dictionary")}function stringToCodePoints(s){for(var j=String(s),$=j.length,_e=0,et=[];_e<$;){var tt=j.charCodeAt(_e);if(tt<55296||tt>57343)et.push(tt);else if(56320<=tt&&tt<=57343)et.push(65533);else if(55296<=tt&&tt<=56319)if(_e===$-1)et.push(65533);else{var nt=s.charCodeAt(_e+1);if(56320<=nt&&nt<=57343){var rt=tt&1023,ot=nt&1023;et.push(65536+(rt<<10)+ot),_e+=1}else et.push(65533)}_e+=1}return et}function codePointsToString(s){for(var j="",$=0;$>10)+55296,(_e&1023)+56320))}return j}var end_of_stream=-1;function Stream(s){this.tokens=[].slice.call(s)}Stream.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():end_of_stream},prepend:function(s){if(Array.isArray(s))for(var j=s;j.length;)this.tokens.unshift(j.pop());else this.tokens.unshift(s)},push:function(s){if(Array.isArray(s))for(var j=s;j.length;)this.tokens.push(j.shift());else this.tokens.push(s)}};var finished=-1;function decoderError(s,j){if(s)throw TypeError("Decoder error");return j||65533}var DEFAULT_ENCODING="utf-8";function TextDecoder$1(s,j){if(!(this instanceof TextDecoder$1))return new TextDecoder$1(s,j);if(s=s!==void 0?String(s).toLowerCase():DEFAULT_ENCODING,s!==DEFAULT_ENCODING)throw new Error("Encoding not supported. Only utf-8 is supported");j=ToDictionary(j),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!j.fatal,this._ignoreBOM=!!j.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}TextDecoder$1.prototype={decode:function(j,$){var _e;typeof j=="object"&&j instanceof ArrayBuffer?_e=new Uint8Array(j):typeof j=="object"&&"buffer"in j&&j.buffer instanceof ArrayBuffer?_e=new Uint8Array(j.buffer,j.byteOffset,j.byteLength):_e=new Uint8Array(0),$=ToDictionary($),this._streaming||(this._decoder=new UTF8Decoder({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!$.stream;for(var et=new Stream(_e),tt=[],nt;!et.endOfStream()&&(nt=this._decoder.handler(et,et.read()),nt!==finished);)nt!==null&&(Array.isArray(nt)?tt.push.apply(tt,nt):tt.push(nt));if(!this._streaming){do{if(nt=this._decoder.handler(et,et.read()),nt===finished)break;nt!==null&&(Array.isArray(nt)?tt.push.apply(tt,nt):tt.push(nt))}while(!et.endOfStream());this._decoder=null}return tt.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(tt[0]===65279?(this._BOMseen=!0,tt.shift()):this._BOMseen=!0),codePointsToString(tt)}};function TextEncoder$1(s,j){if(!(this instanceof TextEncoder$1))return new TextEncoder$1(s,j);if(s=s!==void 0?String(s).toLowerCase():DEFAULT_ENCODING,s!==DEFAULT_ENCODING)throw new Error("Encoding not supported. Only utf-8 is supported");j=ToDictionary(j),this._streaming=!1,this._encoder=null,this._options={fatal:!!j.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}TextEncoder$1.prototype={encode:function(j,$){j=j?String(j):"",$=ToDictionary($),this._streaming||(this._encoder=new UTF8Encoder(this._options)),this._streaming=!!$.stream;for(var _e=[],et=new Stream(stringToCodePoints(j)),tt;!et.endOfStream()&&(tt=this._encoder.handler(et,et.read()),tt!==finished);)Array.isArray(tt)?_e.push.apply(_e,tt):_e.push(tt);if(!this._streaming){for(;tt=this._encoder.handler(et,et.read()),tt!==finished;)Array.isArray(tt)?_e.push.apply(_e,tt):_e.push(tt);this._encoder=null}return new Uint8Array(_e)}};function UTF8Decoder(s){var j=s.fatal,$=0,_e=0,et=0,tt=128,nt=191;this.handler=function(rt,ot){if(ot===end_of_stream&&et!==0)return et=0,decoderError(j);if(ot===end_of_stream)return finished;if(et===0){if(inRange(ot,0,127))return ot;if(inRange(ot,194,223))et=1,$=ot-192;else if(inRange(ot,224,239))ot===224&&(tt=160),ot===237&&(nt=159),et=2,$=ot-224;else if(inRange(ot,240,244))ot===240&&(tt=144),ot===244&&(nt=143),et=3,$=ot-240;else return decoderError(j);return $=$<<6*et,null}if(!inRange(ot,tt,nt))return $=et=_e=0,tt=128,nt=191,rt.prepend(ot),decoderError(j);if(tt=128,nt=191,_e+=1,$+=ot-128<<6*(et-_e),_e!==et)return null;var it=$;return $=et=_e=0,it}}function UTF8Encoder(s){s.fatal,this.handler=function(j,$){if($===end_of_stream)return finished;if(inRange($,0,127))return $;var _e,et;inRange($,128,2047)?(_e=1,et=192):inRange($,2048,65535)?(_e=2,et=224):inRange($,65536,1114111)&&(_e=3,et=240);for(var tt=[($>>6*_e)+et];_e>0;){var nt=$>>6*(_e-1);tt.push(128|nt&63),_e-=1}return tt}}const encoding$2=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:TextDecoder$1,TextEncoder:TextEncoder$1},Symbol.toStringTag,{value:"Module"})),require$$2=getAugmentedNamespace(encoding$2);var __createBinding=commonjsGlobal$1&&commonjsGlobal$1.__createBinding||(Object.create?function(s,j,$,_e){_e===void 0&&(_e=$),Object.defineProperty(s,_e,{enumerable:!0,get:function(){return j[$]}})}:function(s,j,$,_e){_e===void 0&&(_e=$),s[_e]=j[$]}),__setModuleDefault=commonjsGlobal$1&&commonjsGlobal$1.__setModuleDefault||(Object.create?function(s,j){Object.defineProperty(s,"default",{enumerable:!0,value:j})}:function(s,j){s.default=j}),__decorate=commonjsGlobal$1&&commonjsGlobal$1.__decorate||function(s,j,$,_e){var et=arguments.length,tt=et<3?j:_e===null?_e=Object.getOwnPropertyDescriptor(j,$):_e,nt;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")tt=Reflect.decorate(s,j,$,_e);else for(var rt=s.length-1;rt>=0;rt--)(nt=s[rt])&&(tt=(et<3?nt(tt):et>3?nt(j,$,tt):nt(j,$))||tt);return et>3&&tt&&Object.defineProperty(j,$,tt),tt},__importStar=commonjsGlobal$1&&commonjsGlobal$1.__importStar||function(s){if(s&&s.__esModule)return s;var j={};if(s!=null)for(var $ in s)$!=="default"&&Object.hasOwnProperty.call(s,$)&&__createBinding(j,s,$);return __setModuleDefault(j,s),j},__importDefault$3=commonjsGlobal$1&&commonjsGlobal$1.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(lib,"__esModule",{value:!0});var deserializeUnchecked_1=lib.deserializeUnchecked=deserialize_1=lib.deserialize=serialize_1=lib.serialize=lib.BinaryReader=lib.BinaryWriter=lib.BorshError=lib.baseDecode=lib.baseEncode=void 0;const bn_js_1=__importDefault$3(bnExports),bs58_1$1=__importDefault$3(bs58),encoding$1=__importStar(require$$2),ResolvedTextDecoder=typeof TextDecoder!="function"?encoding$1.TextDecoder:TextDecoder,textDecoder=new ResolvedTextDecoder("utf-8",{fatal:!0});function baseEncode(s){return typeof s=="string"&&(s=Buffer.from(s,"utf8")),bs58_1$1.default.encode(Buffer.from(s))}lib.baseEncode=baseEncode;function baseDecode(s){return Buffer.from(bs58_1$1.default.decode(s))}lib.baseDecode=baseDecode;const INITIAL_LENGTH=1024;class BorshError extends Error{constructor(j){super(j),this.fieldPath=[],this.originalMessage=j}addToFieldPath(j){this.fieldPath.splice(0,0,j),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}lib.BorshError=BorshError;class BinaryWriter{constructor(){this.buf=Buffer.alloc(INITIAL_LENGTH),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(INITIAL_LENGTH)]))}writeU8(j){this.maybeResize(),this.buf.writeUInt8(j,this.length),this.length+=1}writeU16(j){this.maybeResize(),this.buf.writeUInt16LE(j,this.length),this.length+=2}writeU32(j){this.maybeResize(),this.buf.writeUInt32LE(j,this.length),this.length+=4}writeU64(j){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(j).toArray("le",8)))}writeU128(j){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(j).toArray("le",16)))}writeU256(j){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(j).toArray("le",32)))}writeU512(j){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(j).toArray("le",64)))}writeBuffer(j){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),j,Buffer.alloc(INITIAL_LENGTH)]),this.length+=j.length}writeString(j){this.maybeResize();const $=Buffer.from(j,"utf8");this.writeU32($.length),this.writeBuffer($)}writeFixedArray(j){this.writeBuffer(Buffer.from(j))}writeArray(j,$){this.maybeResize(),this.writeU32(j.length);for(const _e of j)this.maybeResize(),$(_e)}toArray(){return this.buf.subarray(0,this.length)}}lib.BinaryWriter=BinaryWriter;function handlingRangeError(s,j,$){const _e=$.value;$.value=function(...et){try{return _e.apply(this,et)}catch(tt){if(tt instanceof RangeError){const nt=tt.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(nt)>=0)throw new BorshError("Reached the end of buffer when deserializing")}throw tt}}}let BinaryReader$2=class{constructor(j){this.buf=j,this.offset=0}readU8(){const j=this.buf.readUInt8(this.offset);return this.offset+=1,j}readU16(){const j=this.buf.readUInt16LE(this.offset);return this.offset+=2,j}readU32(){const j=this.buf.readUInt32LE(this.offset);return this.offset+=4,j}readU64(){const j=this.readBuffer(8);return new bn_js_1.default(j,"le")}readU128(){const j=this.readBuffer(16);return new bn_js_1.default(j,"le")}readU256(){const j=this.readBuffer(32);return new bn_js_1.default(j,"le")}readU512(){const j=this.readBuffer(64);return new bn_js_1.default(j,"le")}readBuffer(j){if(this.offset+j>this.buf.length)throw new BorshError(`Expected buffer length ${j} isn't within bounds`);const $=this.buf.slice(this.offset,this.offset+j);return this.offset+=j,$}readString(){const j=this.readU32(),$=this.readBuffer(j);try{return textDecoder.decode($)}catch(_e){throw new BorshError(`Error decoding UTF-8 string: ${_e}`)}}readFixedArray(j){return new Uint8Array(this.readBuffer(j))}readArray(j){const $=this.readU32(),_e=Array();for(let et=0;et<$;++et)_e.push(j());return _e}};__decorate([handlingRangeError],BinaryReader$2.prototype,"readU8",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU16",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU32",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU64",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU128",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU256",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU512",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readString",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readFixedArray",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readArray",null);lib.BinaryReader=BinaryReader$2;function capitalizeFirstLetter(s){return s.charAt(0).toUpperCase()+s.slice(1)}function serializeField(s,j,$,_e,et){try{if(typeof _e=="string")et[`write${capitalizeFirstLetter(_e)}`]($);else if(_e instanceof Array)if(typeof _e[0]=="number"){if($.length!==_e[0])throw new BorshError(`Expecting byte array of length ${_e[0]}, but got ${$.length} bytes`);et.writeFixedArray($)}else if(_e.length===2&&typeof _e[1]=="number"){if($.length!==_e[1])throw new BorshError(`Expecting byte array of length ${_e[1]}, but got ${$.length} bytes`);for(let tt=0;tt<_e[1];tt++)serializeField(s,null,$[tt],_e[0],et)}else et.writeArray($,tt=>{serializeField(s,j,tt,_e[0],et)});else if(_e.kind!==void 0)switch(_e.kind){case"option":{$==null?et.writeU8(0):(et.writeU8(1),serializeField(s,j,$,_e.type,et));break}case"map":{et.writeU32($.size),$.forEach((tt,nt)=>{serializeField(s,j,nt,_e.key,et),serializeField(s,j,tt,_e.value,et)});break}default:throw new BorshError(`FieldType ${_e} unrecognized`)}else serializeStruct(s,$,et)}catch(tt){throw tt instanceof BorshError&&tt.addToFieldPath(j),tt}}function serializeStruct(s,j,$){if(typeof j.borshSerialize=="function"){j.borshSerialize($);return}const _e=s.get(j.constructor);if(!_e)throw new BorshError(`Class ${j.constructor.name} is missing in schema`);if(_e.kind==="struct")_e.fields.map(([et,tt])=>{serializeField(s,et,j[et],tt,$)});else if(_e.kind==="enum"){const et=j[_e.field];for(let tt=0;tt<_e.values.length;++tt){const[nt,rt]=_e.values[tt];if(nt===et){$.writeU8(tt),serializeField(s,nt,j[nt],rt,$);break}}}else throw new BorshError(`Unexpected schema kind: ${_e.kind} for ${j.constructor.name}`)}function serialize$2(s,j,$=BinaryWriter){const _e=new $;return serializeStruct(s,j,_e),_e.toArray()}var serialize_1=lib.serialize=serialize$2;function deserializeField(s,j,$,_e){try{if(typeof $=="string")return _e[`read${capitalizeFirstLetter($)}`]();if($ instanceof Array){if(typeof $[0]=="number")return _e.readFixedArray($[0]);if(typeof $[1]=="number"){const et=[];for(let tt=0;tt<$[1];tt++)et.push(deserializeField(s,null,$[0],_e));return et}else return _e.readArray(()=>deserializeField(s,j,$[0],_e))}if($.kind==="option")return _e.readU8()?deserializeField(s,j,$.type,_e):void 0;if($.kind==="map"){let et=new Map;const tt=_e.readU32();for(let nt=0;nt=_e.values.length)throw new BorshError(`Enum index: ${et} is out of range`);const[tt,nt]=_e.values[et],rt=deserializeField(s,tt,nt,$);return new j({[tt]:rt})}throw new BorshError(`Unexpected schema kind: ${_e.kind} for ${j.constructor.name}`)}function deserialize$2(s,j,$,_e=BinaryReader$2){const et=new _e($),tt=deserializeStruct(s,j,et);if(et.offset<$.length)throw new BorshError(`Unexpected ${$.length-et.offset} bytes after deserialized data`);return tt}var deserialize_1=lib.deserialize=deserialize$2;function deserializeUnchecked(s,j,$,_e=BinaryReader$2){const et=new _e($);return deserializeStruct(s,j,et)}deserializeUnchecked_1=lib.deserializeUnchecked=deserializeUnchecked;var Layout$1={};Object.defineProperty(Layout$1,"__esModule",{value:!0});Layout$1.s16=Layout$1.s8=Layout$1.nu64be=Layout$1.u48be=Layout$1.u40be=Layout$1.u32be=Layout$1.u24be=Layout$1.u16be=nu64=Layout$1.nu64=Layout$1.u48=Layout$1.u40=u32=Layout$1.u32=Layout$1.u24=u16=Layout$1.u16=u8=Layout$1.u8=offset=Layout$1.offset=Layout$1.greedy=Layout$1.Constant=Layout$1.UTF8=Layout$1.CString=Layout$1.Blob=Layout$1.Boolean=Layout$1.BitField=Layout$1.BitStructure=Layout$1.VariantLayout=Layout$1.Union=Layout$1.UnionLayoutDiscriminator=Layout$1.UnionDiscriminator=Layout$1.Structure=Layout$1.Sequence=Layout$1.DoubleBE=Layout$1.Double=Layout$1.FloatBE=Layout$1.Float=Layout$1.NearInt64BE=Layout$1.NearInt64=Layout$1.NearUInt64BE=Layout$1.NearUInt64=Layout$1.IntBE=Layout$1.Int=Layout$1.UIntBE=Layout$1.UInt=Layout$1.OffsetLayout=Layout$1.GreedyCount=Layout$1.ExternalLayout=Layout$1.bindConstructorLayout=Layout$1.nameWithProperty=Layout$1.Layout=Layout$1.uint8ArrayToBuffer=Layout$1.checkUint8Array=void 0;Layout$1.constant=Layout$1.utf8=Layout$1.cstr=blob=Layout$1.blob=Layout$1.unionLayoutDiscriminator=Layout$1.union=seq=Layout$1.seq=Layout$1.bits=struct=Layout$1.struct=Layout$1.f64be=Layout$1.f64=Layout$1.f32be=Layout$1.f32=Layout$1.ns64be=Layout$1.s48be=Layout$1.s40be=Layout$1.s32be=Layout$1.s24be=Layout$1.s16be=ns64=Layout$1.ns64=Layout$1.s48=Layout$1.s40=Layout$1.s32=Layout$1.s24=void 0;const buffer_1$1=buffer;function checkUint8Array(s){if(!(s instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}Layout$1.checkUint8Array=checkUint8Array;function uint8ArrayToBuffer(s){return checkUint8Array(s),buffer_1$1.Buffer.from(s.buffer,s.byteOffset,s.length)}Layout$1.uint8ArrayToBuffer=uint8ArrayToBuffer;class Layout{constructor(j,$){if(!Number.isInteger(j))throw new TypeError("span must be an integer");this.span=j,this.property=$}makeDestinationObject(){return{}}getSpan(j,$){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(j){const $=Object.create(this.constructor.prototype);return Object.assign($,this),$.property=j,$}fromArray(j){}}Layout$1.Layout=Layout;function nameWithProperty(s,j){return j.property?s+"["+j.property+"]":s}Layout$1.nameWithProperty=nameWithProperty;function bindConstructorLayout(s,j){if(typeof s!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(s,"layout_"))throw new Error("Class is already bound to a layout");if(!(j&&j instanceof Layout))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(j,"boundConstructor_"))throw new Error("layout is already bound to a constructor");s.layout_=j,j.boundConstructor_=s,j.makeDestinationObject=()=>new s,Object.defineProperty(s.prototype,"encode",{value($,_e){return j.encode(this,$,_e)},writable:!0}),Object.defineProperty(s,"decode",{value($,_e){return j.decode($,_e)},writable:!0})}Layout$1.bindConstructorLayout=bindConstructorLayout;class ExternalLayout extends Layout{isCount(){throw new Error("ExternalLayout is abstract")}}Layout$1.ExternalLayout=ExternalLayout;class GreedyCount extends ExternalLayout{constructor(j=1,$){if(!Number.isInteger(j)||0>=j)throw new TypeError("elementSpan must be a (positive) integer");super(-1,$),this.elementSpan=j}isCount(){return!0}decode(j,$=0){checkUint8Array(j);const _e=j.length-$;return Math.floor(_e/this.elementSpan)}encode(j,$,_e){return 0}}Layout$1.GreedyCount=GreedyCount;class OffsetLayout extends ExternalLayout{constructor(j,$=0,_e){if(!(j instanceof Layout))throw new TypeError("layout must be a Layout");if(!Number.isInteger($))throw new TypeError("offset must be integer or undefined");super(j.span,_e||j.property),this.layout=j,this.offset=$}isCount(){return this.layout instanceof UInt||this.layout instanceof UIntBE}decode(j,$=0){return this.layout.decode(j,$+this.offset)}encode(j,$,_e=0){return this.layout.encode(j,$,_e+this.offset)}}Layout$1.OffsetLayout=OffsetLayout;class UInt extends Layout{constructor(j,$){if(super(j,$),6nt+et.encode(rt,$,_e+nt),0);return this.count instanceof ExternalLayout&&this.count.encode(j.length,$,_e),tt}}Layout$1.Sequence=Sequence;class Structure extends Layout{constructor(j,$,_e){if(!(Array.isArray(j)&&j.reduce((tt,nt)=>tt&&nt instanceof Layout,!0)))throw new TypeError("fields must be array of Layout instances");typeof $=="boolean"&&_e===void 0&&(_e=$,$=void 0);for(const tt of j)if(0>tt.span&&tt.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let et=-1;try{et=j.reduce((tt,nt)=>tt+nt.getSpan(),0)}catch{}super(et,$),this.fields=j,this.decodePrefixes=!!_e}getSpan(j,$=0){if(0<=this.span)return this.span;let _e=0;try{_e=this.fields.reduce((et,tt)=>{const nt=tt.getSpan(j,$);return $+=nt,et+nt},0)}catch{throw new RangeError("indeterminate span")}return _e}decode(j,$=0){checkUint8Array(j);const _e=this.makeDestinationObject();for(const et of this.fields)if(et.property!==void 0&&(_e[et.property]=et.decode(j,$)),$+=et.getSpan(j,$),this.decodePrefixes&&j.length===$)break;return _e}encode(j,$,_e=0){const et=_e;let tt=0,nt=0;for(const rt of this.fields){let ot=rt.span;if(nt=0ot&&(ot=rt.getSpan($,_e)))}tt=_e,_e+=ot}return tt+nt-et}fromArray(j){const $=this.makeDestinationObject();for(const _e of this.fields)_e.property!==void 0&&0_e.span?$=-1:0<=$&&($+=_e.span)}}}Layout$1.Structure=Structure;class UnionDiscriminator{constructor(j){this.property=j}decode(j,$){throw new Error("UnionDiscriminator is abstract")}encode(j,$,_e){throw new Error("UnionDiscriminator is abstract")}}Layout$1.UnionDiscriminator=UnionDiscriminator;class UnionLayoutDiscriminator extends UnionDiscriminator{constructor(j,$){if(!(j instanceof ExternalLayout&&j.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super($||j.property||"variant"),this.layout=j}decode(j,$){return this.layout.decode(j,$)}encode(j,$,_e){return this.layout.encode(j,$,_e)}}Layout$1.UnionLayoutDiscriminator=UnionLayoutDiscriminator;class Union extends Layout{constructor(j,$,_e){let et;if(j instanceof UInt||j instanceof UIntBE)et=new UnionLayoutDiscriminator(new OffsetLayout(j));else if(j instanceof ExternalLayout&&j.isCount())et=new UnionLayoutDiscriminator(j);else if(j instanceof UnionDiscriminator)et=j;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if($===void 0&&($=null),!($===null||$ instanceof Layout))throw new TypeError("defaultLayout must be null or a Layout");if($!==null){if(0>$.span)throw new Error("defaultLayout must have constant span");$.property===void 0&&($=$.replicate("content"))}let tt=-1;$&&(tt=$.span,0<=tt&&(j instanceof UInt||j instanceof UIntBE)&&(tt+=et.layout.span)),super(tt,_e),this.discriminator=et,this.usesPrefixDiscriminator=j instanceof UInt||j instanceof UIntBE,this.defaultLayout=$,this.registry={};let nt=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(rt){return nt(rt)},this.configGetSourceVariant=function(rt){nt=rt.bind(this)}}getSpan(j,$=0){if(0<=this.span)return this.span;const _e=this.getVariant(j,$);if(!_e)throw new Error("unable to determine span for unrecognized variant");return _e.getSpan(j,$)}defaultGetSourceVariant(j){if(Object.prototype.hasOwnProperty.call(j,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(j,this.defaultLayout.property))return;const $=this.registry[j[this.discriminator.property]];if($&&(!$.layout||$.property&&Object.prototype.hasOwnProperty.call(j,$.property)))return $}else for(const $ in this.registry){const _e=this.registry[$];if(_e.property&&Object.prototype.hasOwnProperty.call(j,_e.property))return _e}throw new Error("unable to infer src variant")}decode(j,$=0){let _e;const et=this.discriminator,tt=et.decode(j,$),nt=this.registry[tt];if(nt===void 0){const rt=this.defaultLayout;let ot=0;this.usesPrefixDiscriminator&&(ot=et.layout.span),_e=this.makeDestinationObject(),_e[et.property]=tt,_e[rt.property]=rt.decode(j,$+ot)}else _e=nt.decode(j,$);return _e}encode(j,$,_e=0){const et=this.getSourceVariant(j);if(et===void 0){const tt=this.discriminator,nt=this.defaultLayout;let rt=0;return this.usesPrefixDiscriminator&&(rt=tt.layout.span),tt.encode(j[tt.property],$,_e),rt+nt.encode(j[nt.property],$,_e+rt)}return et.encode(j,$,_e)}addVariant(j,$,_e){const et=new VariantLayout(this,j,$,_e);return this.registry[j]=et,et}getVariant(j,$=0){let _e;return j instanceof Uint8Array?_e=this.discriminator.decode(j,$):_e=j,this.registry[_e]}}Layout$1.Union=Union;class VariantLayout extends Layout{constructor(j,$,_e,et){if(!(j instanceof Union))throw new TypeError("union must be a Union");if(!Number.isInteger($)||0>$)throw new TypeError("variant must be a (non-negative) integer");if(typeof _e=="string"&&et===void 0&&(et=_e,_e=null),_e){if(!(_e instanceof Layout))throw new TypeError("layout must be a Layout");if(j.defaultLayout!==null&&0<=_e.span&&_e.span>j.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof et!="string")throw new TypeError("variant must have a String property")}let tt=j.span;0>j.span&&(tt=_e?_e.span:0,0<=tt&&j.usesPrefixDiscriminator&&(tt+=j.discriminator.layout.span)),super(tt,et),this.union=j,this.variant=$,this.layout=_e||null}getSpan(j,$=0){if(0<=this.span)return this.span;let _e=0;this.union.usesPrefixDiscriminator&&(_e=this.union.discriminator.layout.span);let et=0;return this.layout&&(et=this.layout.getSpan(j,$+_e)),_e+et}decode(j,$=0){const _e=this.makeDestinationObject();if(this!==this.union.getVariant(j,$))throw new Error("variant mismatch");let et=0;return this.union.usesPrefixDiscriminator&&(et=this.union.discriminator.layout.span),this.layout?_e[this.property]=this.layout.decode(j,$+et):this.property?_e[this.property]=!0:this.union.usesPrefixDiscriminator&&(_e[this.union.discriminator.property]=this.variant),_e}encode(j,$,_e=0){let et=0;if(this.union.usesPrefixDiscriminator&&(et=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(j,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,$,_e);let tt=et;if(this.layout&&(this.layout.encode(j[this.property],$,_e+et),tt+=this.layout.getSpan($,_e+et),0<=this.union.span&&tt>this.union.span))throw new Error("encoded variant overruns containing union");return tt}fromArray(j){if(this.layout)return this.layout.fromArray(j)}}Layout$1.VariantLayout=VariantLayout;function fixBitwiseResult(s){return 0>s&&(s+=4294967296),s}class BitStructure extends Layout{constructor(j,$,_e){if(!(j instanceof UInt||j instanceof UIntBE))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof $=="string"&&_e===void 0&&(_e=$,$=!1),4=$)throw new TypeError("bits must be positive integer");const et=8*j.span,tt=j.fields.reduce((nt,rt)=>nt+rt.bits,0);if($+tt>et)throw new Error("bits too long for span remainder ("+(et-tt)+" of "+et+" remain)");this.container=j,this.bits=$,this.valueMask=(1<<$)-1,$===32&&(this.valueMask=4294967295),this.start=tt,this.container.msb&&(this.start=et-tt-$),this.wordMask=fixBitwiseResult(this.valueMask<>>this.start}encode(j){if(typeof j!="number"||!Number.isInteger(j)||j!==fixBitwiseResult(j&this.valueMask))throw new TypeError(nameWithProperty("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const $=this.container._packedGetValue(),_e=fixBitwiseResult(j<_e&&(_e=this.length.decode(j,$)),_e}decode(j,$=0){let _e=this.span;return 0>_e&&(_e=this.length.decode(j,$)),uint8ArrayToBuffer(j).slice($,$+_e)}encode(j,$,_e){let et=this.length;if(this.length instanceof ExternalLayout&&(et=j.length),!(j instanceof Uint8Array&&et===j.length))throw new TypeError(nameWithProperty("Blob.encode",this)+" requires (length "+et+") Uint8Array as src");if(_e+et>$.length)throw new RangeError("encoding overruns Uint8Array");const tt=uint8ArrayToBuffer(j);return uint8ArrayToBuffer($).write(tt.toString("hex"),_e,et,"hex"),this.length instanceof ExternalLayout&&this.length.encode(et,$,_e),et}};Layout$1.Blob=Blob$2;class CString extends Layout{constructor(j){super(-1,j)}getSpan(j,$=0){checkUint8Array(j);let _e=$;for(;_e$.length)throw new RangeError("encoding overruns Buffer");const nt=uint8ArrayToBuffer($);return et.copy(nt,_e),nt[_e+tt]=0,tt+1}}Layout$1.CString=CString;class UTF8 extends Layout{constructor(j,$){if(typeof j=="string"&&$===void 0&&($=j,j=void 0),j===void 0)j=-1;else if(!Number.isInteger(j))throw new TypeError("maxSpan must be an integer");super(-1,$),this.maxSpan=j}getSpan(j,$=0){return checkUint8Array(j),j.length-$}decode(j,$=0){const _e=this.getSpan(j,$);if(0<=this.maxSpan&&this.maxSpan<_e)throw new RangeError("text length exceeds maxSpan");return uint8ArrayToBuffer(j).slice($,$+_e).toString("utf-8")}encode(j,$,_e=0){typeof j!="string"&&(j=String(j));const et=buffer_1$1.Buffer.from(j,"utf8"),tt=et.length;if(0<=this.maxSpan&&this.maxSpan$.length)throw new RangeError("encoding overruns Buffer");return et.copy(uint8ArrayToBuffer($),_e),tt}}Layout$1.UTF8=UTF8;class Constant extends Layout{constructor(j,$){super(0,$),this.value=j}decode(j,$){return this.value}encode(j,$,_e){return 0}}Layout$1.Constant=Constant;Layout$1.greedy=(s,j)=>new GreedyCount(s,j);var offset=Layout$1.offset=(s,j,$)=>new OffsetLayout(s,j,$),u8=Layout$1.u8=s=>new UInt(1,s),u16=Layout$1.u16=s=>new UInt(2,s);Layout$1.u24=s=>new UInt(3,s);var u32=Layout$1.u32=s=>new UInt(4,s);Layout$1.u40=s=>new UInt(5,s);Layout$1.u48=s=>new UInt(6,s);var nu64=Layout$1.nu64=s=>new NearUInt64(s);Layout$1.u16be=s=>new UIntBE(2,s);Layout$1.u24be=s=>new UIntBE(3,s);Layout$1.u32be=s=>new UIntBE(4,s);Layout$1.u40be=s=>new UIntBE(5,s);Layout$1.u48be=s=>new UIntBE(6,s);Layout$1.nu64be=s=>new NearUInt64BE(s);Layout$1.s8=s=>new Int(1,s);Layout$1.s16=s=>new Int(2,s);Layout$1.s24=s=>new Int(3,s);Layout$1.s32=s=>new Int(4,s);Layout$1.s40=s=>new Int(5,s);Layout$1.s48=s=>new Int(6,s);var ns64=Layout$1.ns64=s=>new NearInt64(s);Layout$1.s16be=s=>new IntBE(2,s);Layout$1.s24be=s=>new IntBE(3,s);Layout$1.s32be=s=>new IntBE(4,s);Layout$1.s40be=s=>new IntBE(5,s);Layout$1.s48be=s=>new IntBE(6,s);Layout$1.ns64be=s=>new NearInt64BE(s);Layout$1.f32=s=>new Float(s);Layout$1.f32be=s=>new FloatBE(s);Layout$1.f64=s=>new Double(s);Layout$1.f64be=s=>new DoubleBE(s);var struct=Layout$1.struct=(s,j,$)=>new Structure(s,j,$);Layout$1.bits=(s,j,$)=>new BitStructure(s,j,$);var seq=Layout$1.seq=(s,j,$)=>new Sequence(s,j,$);Layout$1.union=(s,j,$)=>new Union(s,j,$);Layout$1.unionLayoutDiscriminator=(s,j)=>new UnionLayoutDiscriminator(s,j);var blob=Layout$1.blob=(s,j)=>new Blob$2(s,j);Layout$1.cstr=s=>new CString(s);Layout$1.utf8=(s,j)=>new UTF8(s,j);Layout$1.constant=(s,j)=>new Constant(s,j);var browser$1={};Object.defineProperty(browser$1,"__esModule",{value:!0});function toBigIntLE(s){{const j=Buffer.from(s);j.reverse();const $=j.toString("hex");return $.length===0?BigInt(0):BigInt(`0x${$}`)}}var toBigIntLE_1=browser$1.toBigIntLE=toBigIntLE;function toBigIntBE(s){{const j=s.toString("hex");return j.length===0?BigInt(0):BigInt(`0x${j}`)}}browser$1.toBigIntBE=toBigIntBE;function toBufferLE(s,j){{const $=s.toString(16),_e=Buffer.from($.padStart(j*2,"0").slice(0,j*2),"hex");return _e.reverse(),_e}}var toBufferLE_1=browser$1.toBufferLE=toBufferLE;function toBufferBE(s,j){{const $=s.toString(16);return Buffer.from($.padStart(j*2,"0").slice(0,j*2),"hex")}}browser$1.toBufferBE=toBufferBE;class StructError extends TypeError{constructor(j,$){let _e;const{message:et,...tt}=j,{path:nt}=j,rt=nt.length===0?et:"At path: "+nt.join(".")+" -- "+et;super(rt),Object.assign(this,tt),this.name=this.constructor.name,this.failures=()=>{var ot;return(ot=_e)!=null?ot:_e=[j,...$()]}}}function isIterable(s){return isObject$1(s)&&typeof s[Symbol.iterator]=="function"}function isObject$1(s){return typeof s=="object"&&s!=null}function print(s){return typeof s=="string"?JSON.stringify(s):""+s}function shiftIterator(s){const{done:j,value:$}=s.next();return j?void 0:$}function toFailure(s,j,$,_e){if(s===!0)return;s===!1?s={}:typeof s=="string"&&(s={message:s});const{path:et,branch:tt}=j,{type:nt}=$,{refinement:rt,message:ot="Expected a value of type `"+nt+"`"+(rt?" with refinement `"+rt+"`":"")+", but received: `"+print(_e)+"`"}=s;return{value:_e,type:nt,refinement:rt,key:et[et.length-1],path:et,branch:tt,...s,message:ot}}function*toFailures(s,j,$,_e){isIterable(s)||(s=[s]);for(const et of s){const tt=toFailure(et,j,$,_e);tt&&(yield tt)}}function*run(s,j,$={}){const{path:_e=[],branch:et=[s],coerce:tt=!1,mask:nt=!1}=$,rt={path:_e,branch:et};if(tt&&(s=j.coercer(s,rt),nt&&j.type!=="type"&&isObject$1(j.schema)&&isObject$1(s)&&!Array.isArray(s)))for(const it in s)j.schema[it]===void 0&&delete s[it];let ot=!0;for(const it of j.validator(s,rt))ot=!1,yield[it,void 0];for(let[it,st,at]of j.entries(s,rt)){const ct=run(st,at,{path:it===void 0?_e:[..._e,it],branch:it===void 0?et:[...et,st],coerce:tt,mask:nt});for(const lt of ct)lt[0]?(ot=!1,yield[lt[0],void 0]):tt&&(st=lt[1],it===void 0?s=st:s instanceof Map?s.set(it,st):s instanceof Set?s.add(st):isObject$1(s)&&(s[it]=st))}if(ot)for(const it of j.refiner(s,rt))ot=!1,yield[it,void 0];ot&&(yield[void 0,s])}let Struct$1=class{constructor(j){const{type:$,schema:_e,validator:et,refiner:tt,coercer:nt=ot=>ot,entries:rt=function*(){}}=j;this.type=$,this.schema=_e,this.entries=rt,this.coercer=nt,et?this.validator=(ot,it)=>{const st=et(ot,it);return toFailures(st,it,this,ot)}:this.validator=()=>[],tt?this.refiner=(ot,it)=>{const st=tt(ot,it);return toFailures(st,it,this,ot)}:this.refiner=()=>[]}assert(j){return assert$1(j,this)}create(j){return create$4(j,this)}is(j){return is(j,this)}mask(j){return mask(j,this)}validate(j,$={}){return validate$1(j,this,$)}};function assert$1(s,j){const $=validate$1(s,j);if($[0])throw $[0]}function create$4(s,j){const $=validate$1(s,j,{coerce:!0});if($[0])throw $[0];return $[1]}function mask(s,j){const $=validate$1(s,j,{coerce:!0,mask:!0});if($[0])throw $[0];return $[1]}function is(s,j){return!validate$1(s,j)[0]}function validate$1(s,j,$={}){const _e=run(s,j,$),et=shiftIterator(_e);return et[0]?[new StructError(et[0],function*(){for(const nt of _e)nt[0]&&(yield nt[0])}),void 0]:[void 0,et[1]]}function define(s,j){return new Struct$1({type:s,schema:null,validator:j})}function any(){return define("any",()=>!0)}function array$1(s){return new Struct$1({type:"array",schema:s,*entries(j){if(s&&Array.isArray(j))for(const[$,_e]of j.entries())yield[$,_e,s]},coercer(j){return Array.isArray(j)?j.slice():j},validator(j){return Array.isArray(j)||"Expected an array value, but received: "+print(j)}})}function boolean$1(){return define("boolean",s=>typeof s=="boolean")}function instance(s){return define("instance",j=>j instanceof s||"Expected a `"+s.name+"` instance, but received: "+print(j))}function literal(s){const j=print(s),$=typeof s;return new Struct$1({type:"literal",schema:$==="string"||$==="number"||$==="boolean"?s:null,validator(_e){return _e===s||"Expected the literal `"+j+"`, but received: "+print(_e)}})}function never(){return define("never",()=>!1)}function nullable(s){return new Struct$1({...s,validator:(j,$)=>j===null||s.validator(j,$),refiner:(j,$)=>j===null||s.refiner(j,$)})}function number(){return define("number",s=>typeof s=="number"&&!isNaN(s)||"Expected a number, but received: "+print(s))}function optional(s){return new Struct$1({...s,validator:(j,$)=>j===void 0||s.validator(j,$),refiner:(j,$)=>j===void 0||s.refiner(j,$)})}function record(s,j){return new Struct$1({type:"record",schema:null,*entries($){if(isObject$1($))for(const _e in $){const et=$[_e];yield[_e,_e,s],yield[_e,et,j]}},validator($){return isObject$1($)||"Expected an object, but received: "+print($)}})}function string$1(){return define("string",s=>typeof s=="string"||"Expected a string, but received: "+print(s))}function tuple(s){const j=never();return new Struct$1({type:"tuple",schema:null,*entries($){if(Array.isArray($)){const _e=Math.max(s.length,$.length);for(let et=0;et<_e;et++)yield[et,$[et],s[et]||j]}},validator($){return Array.isArray($)||"Expected an array, but received: "+print($)}})}function type(s){const j=Object.keys(s);return new Struct$1({type:"type",schema:s,*entries($){if(isObject$1($))for(const _e of j)yield[_e,$[_e],s[_e]]},validator($){return isObject$1($)||"Expected an object, but received: "+print($)}})}function union(s){const j=s.map($=>$.type).join(" | ");return new Struct$1({type:"union",schema:null,validator($,_e){const et=[];for(const tt of s){const[...nt]=run($,tt,_e),[rt]=nt;if(rt[0])for(const[ot]of nt)ot&&et.push(ot);else return[]}return["Expected the value to satisfy a union of `"+j+"`, but received: "+print($),...et]}})}function unknown(){return define("unknown",()=>!0)}function coerce(s,j,$){return new Struct$1({...s,coercer:(_e,et)=>is(_e,j)?s.coercer($(_e,et),et):s.coercer(_e,et)})}var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(s){return typeof s=="string"&®EX.test(s)}var byteToHex=[];for(var i$1=0;i$1<256;++i$1)byteToHex.push((i$1+256).toString(16).substr(1));function stringify$1(s){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,$=(byteToHex[s[j+0]]+byteToHex[s[j+1]]+byteToHex[s[j+2]]+byteToHex[s[j+3]]+"-"+byteToHex[s[j+4]]+byteToHex[s[j+5]]+"-"+byteToHex[s[j+6]]+byteToHex[s[j+7]]+"-"+byteToHex[s[j+8]]+byteToHex[s[j+9]]+"-"+byteToHex[s[j+10]]+byteToHex[s[j+11]]+byteToHex[s[j+12]]+byteToHex[s[j+13]]+byteToHex[s[j+14]]+byteToHex[s[j+15]]).toLowerCase();if(!validate($))throw TypeError("Stringified UUID is invalid");return $}var _nodeId,_clockseq,_lastMSecs=0,_lastNSecs=0;function v1(s,j,$){var _e=j&&$||0,et=j||new Array(16);s=s||{};var tt=s.node||_nodeId,nt=s.clockseq!==void 0?s.clockseq:_clockseq;if(tt==null||nt==null){var rt=s.random||(s.rng||rng)();tt==null&&(tt=_nodeId=[rt[0]|1,rt[1],rt[2],rt[3],rt[4],rt[5]]),nt==null&&(nt=_clockseq=(rt[6]<<8|rt[7])&16383)}var ot=s.msecs!==void 0?s.msecs:Date.now(),it=s.nsecs!==void 0?s.nsecs:_lastNSecs+1,st=ot-_lastMSecs+(it-_lastNSecs)/1e4;if(st<0&&s.clockseq===void 0&&(nt=nt+1&16383),(st<0||ot>_lastMSecs)&&s.nsecs===void 0&&(it=0),it>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs=ot,_lastNSecs=it,_clockseq=nt,ot+=122192928e5;var at=((ot&268435455)*1e4+it)%4294967296;et[_e++]=at>>>24&255,et[_e++]=at>>>16&255,et[_e++]=at>>>8&255,et[_e++]=at&255;var ct=ot/4294967296*1e4&268435455;et[_e++]=ct>>>8&255,et[_e++]=ct&255,et[_e++]=ct>>>24&15|16,et[_e++]=ct>>>16&255,et[_e++]=nt>>>8|128,et[_e++]=nt&255;for(var lt=0;lt<6;++lt)et[_e+lt]=tt[lt];return j||stringify$1(et)}function parse$1(s){if(!validate(s))throw TypeError("Invalid UUID");var j,$=new Uint8Array(16);return $[0]=(j=parseInt(s.slice(0,8),16))>>>24,$[1]=j>>>16&255,$[2]=j>>>8&255,$[3]=j&255,$[4]=(j=parseInt(s.slice(9,13),16))>>>8,$[5]=j&255,$[6]=(j=parseInt(s.slice(14,18),16))>>>8,$[7]=j&255,$[8]=(j=parseInt(s.slice(19,23),16))>>>8,$[9]=j&255,$[10]=(j=parseInt(s.slice(24,36),16))/1099511627776&255,$[11]=j/4294967296&255,$[12]=j>>>24&255,$[13]=j>>>16&255,$[14]=j>>>8&255,$[15]=j&255,$}function stringToBytes(s){s=unescape(encodeURIComponent(s));for(var j=[],$=0;$>5]>>>et%32&255,nt=parseInt(_e.charAt(tt>>>4&15)+_e.charAt(tt&15),16);j.push(nt)}return j}function getOutputLength(s){return(s+64>>>9<<4)+14+1}function wordsToMd5(s,j){s[j>>5]|=128<>5]|=(s[_e/8]&255)<<_e%32;return $}function safeAdd(s,j){var $=(s&65535)+(j&65535),_e=(s>>16)+(j>>16)+($>>16);return _e<<16|$&65535}function bitRotateLeft(s,j){return s<>>32-j}function md5cmn(s,j,$,_e,et,tt){return safeAdd(bitRotateLeft(safeAdd(safeAdd(j,s),safeAdd(_e,tt)),et),$)}function md5ff(s,j,$,_e,et,tt,nt){return md5cmn(j&$|~j&_e,s,j,et,tt,nt)}function md5gg(s,j,$,_e,et,tt,nt){return md5cmn(j&_e|$&~_e,s,j,et,tt,nt)}function md5hh(s,j,$,_e,et,tt,nt){return md5cmn(j^$^_e,s,j,et,tt,nt)}function md5ii(s,j,$,_e,et,tt,nt){return md5cmn($^(j|~_e),s,j,et,tt,nt)}var v3=v35("v3",48,md5);const v3$1=v3;function v4(s,j,$){s=s||{};var _e=s.random||(s.rng||rng)();if(_e[6]=_e[6]&15|64,_e[8]=_e[8]&63|128,j){$=$||0;for(var et=0;et<16;++et)j[$+et]=_e[et];return j}return stringify$1(_e)}function f(s,j,$,_e){switch(s){case 0:return j&$^~j&_e;case 1:return j^$^_e;case 2:return j&$^j&_e^$&_e;case 3:return j^$^_e}}function ROTL(s,j){return s<>>32-j}function sha1(s){var j=[1518500249,1859775393,2400959708,3395469782],$=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof s=="string"){var _e=unescape(encodeURIComponent(s));s=[];for(var et=0;et<_e.length;++et)s.push(_e.charCodeAt(et))}else Array.isArray(s)||(s=Array.prototype.slice.call(s));s.push(128);for(var tt=s.length/4+2,nt=Math.ceil(tt/16),rt=new Array(nt),ot=0;ot>>0;pt=yt,yt=ht,ht=ROTL(gt,30)>>>0,gt=ft,ft=Tt}$[0]=$[0]+ft>>>0,$[1]=$[1]+gt>>>0,$[2]=$[2]+ht>>>0,$[3]=$[3]+yt>>>0,$[4]=$[4]+pt>>>0}return[$[0]>>24&255,$[0]>>16&255,$[0]>>8&255,$[0]&255,$[1]>>24&255,$[1]>>16&255,$[1]>>8&255,$[1]&255,$[2]>>24&255,$[2]>>16&255,$[2]>>8&255,$[2]&255,$[3]>>24&255,$[3]>>16&255,$[3]>>8&255,$[3]&255,$[4]>>24&255,$[4]>>16&255,$[4]>>8&255,$[4]&255]}var v5=v35("v5",80,sha1);const v5$1=v5,nil="00000000-0000-0000-0000-000000000000";function version(s){if(!validate(s))throw TypeError("Invalid UUID");return parseInt(s.substr(14,1),16)}const esmBrowser=Object.freeze(Object.defineProperty({__proto__:null,NIL:nil,parse:parse$1,stringify:stringify$1,v1,v3:v3$1,v4,v5:v5$1,validate,version},Symbol.toStringTag,{value:"Module"})),require$$0$4=getAugmentedNamespace(esmBrowser),uuid$1=require$$0$4.v4,generateRequest$1=function(s,j,$,_e){if(typeof s!="string")throw new TypeError(s+" must be a string");_e=_e||{};const et=typeof _e.version=="number"?_e.version:2;if(et!==1&&et!==2)throw new TypeError(et+" must be 1 or 2");const tt={method:s};if(et===2&&(tt.jsonrpc="2.0"),j){if(typeof j!="object"&&!Array.isArray(j))throw new TypeError(j+" must be an object, array or omitted");tt.params=j}if(typeof $>"u"){const nt=typeof _e.generator=="function"?_e.generator:function(){return uuid$1()};tt.id=nt(tt,_e)}else et===2&&$===null?_e.notificationIdNull&&(tt.id=null):tt.id=$;return tt};var generateRequest_1=generateRequest$1;const uuid=require$$0$4.v4,generateRequest=generateRequest_1,ClientBrowser=function(s,j){if(!(this instanceof ClientBrowser))return new ClientBrowser(s,j);j||(j={}),this.options={reviver:typeof j.reviver<"u"?j.reviver:null,replacer:typeof j.replacer<"u"?j.replacer:null,generator:typeof j.generator<"u"?j.generator:function(){return uuid()},version:typeof j.version<"u"?j.version:2,notificationIdNull:typeof j.notificationIdNull=="boolean"?j.notificationIdNull:!1},this.callServer=s};var browser=ClientBrowser;ClientBrowser.prototype.request=function(s,j,$,_e){const et=this;let tt=null;const nt=Array.isArray(s)&&typeof j=="function";if(this.options.version===1&&nt)throw new TypeError("JSON-RPC 1.0 does not support batching");if(nt||!nt&&s&&typeof s=="object"&&typeof j=="function")_e=j,tt=s;else{typeof $=="function"&&(_e=$,$=void 0);const it=typeof _e=="function";try{tt=generateRequest(s,j,$,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(st){if(it)return _e(st);throw st}if(!it)return tt}let ot;try{ot=JSON.stringify(tt,this.options.replacer)}catch(it){return _e(it)}return this.callServer(ot,function(it,st){et._parseResponse(it,st,_e)}),tt};ClientBrowser.prototype._parseResponse=function(s,j,$){if(s){$(s);return}if(!j)return $();let _e;try{_e=JSON.parse(j,this.options.reviver)}catch(et){return $(et)}if($.length===3)if(Array.isArray(_e)){const et=function(nt){return typeof nt.error<"u"},tt=function(nt){return!et(nt)};return $(null,_e.filter(et),_e.filter(tt))}else return $(null,_e.error,_e.result);$(null,_e)};const RpcClient=getDefaultExportFromCjs$1(browser);var client={},eventemitter3={exports:{}};(function(s){var j=Object.prototype.hasOwnProperty,$="~";function _e(){}Object.create&&(_e.prototype=Object.create(null),new _e().__proto__||($=!1));function et(ot,it,st){this.fn=ot,this.context=it,this.once=st||!1}function tt(ot,it,st,at,ct){if(typeof st!="function")throw new TypeError("The listener must be a function");var lt=new et(st,at||ot,ct),dt=$?$+it:it;return ot._events[dt]?ot._events[dt].fn?ot._events[dt]=[ot._events[dt],lt]:ot._events[dt].push(lt):(ot._events[dt]=lt,ot._eventsCount++),ot}function nt(ot,it){--ot._eventsCount===0?ot._events=new _e:delete ot._events[it]}function rt(){this._events=new _e,this._eventsCount=0}rt.prototype.eventNames=function(){var it=[],st,at;if(this._eventsCount===0)return it;for(at in st=this._events)j.call(st,at)&&it.push($?at.slice(1):at);return Object.getOwnPropertySymbols?it.concat(Object.getOwnPropertySymbols(st)):it},rt.prototype.listeners=function(it){var st=$?$+it:it,at=this._events[st];if(!at)return[];if(at.fn)return[at.fn];for(var ct=0,lt=at.length,dt=new Array(lt);ct++this.rpc_id),st?this.dataPack=st:this.dataPack=new utils_1.DefaultDataPack,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call($,_e,et,tt){return!tt&&typeof et=="object"&&(tt=et,et=null),new Promise((nt,rt)=>{if(!this.ready)return rt(new Error("socket not ready"));const ot=this.generate_request_id($,_e),it={jsonrpc:"2.0",method:$,params:_e||void 0,id:ot};this.socket.send(this.dataPack.encode(it),tt,st=>{if(st)return rt(st);this.queue[ot]={promise:[nt,rt]},et&&(this.queue[ot].timeout=setTimeout(()=>{delete this.queue[ot],rt(new Error("reply timeout"))},et))})})}async login($){const _e=await this.call("rpc.login",$);if(!_e)throw new Error("authentication failed");return _e}async listMethods(){return await this.call("__listMethods")}notify($,_e){return new Promise((et,tt)=>{if(!this.ready)return tt(new Error("socket not ready"));const nt={jsonrpc:"2.0",method:$,params:_e};this.socket.send(this.dataPack.encode(nt),rt=>{if(rt)return tt(rt);et()})})}async subscribe($){typeof $=="string"&&($=[$]);const _e=await this.call("rpc.on",$);if(typeof $=="string"&&_e[$]!=="ok")throw new Error("Failed subscribing to an event '"+$+"' with: "+_e[$]);return _e}async unsubscribe($){typeof $=="string"&&($=[$]);const _e=await this.call("rpc.off",$);if(typeof $=="string"&&_e[$]!=="ok")throw new Error("Failed unsubscribing from an event with: "+_e);return _e}close($,_e){this.socket.close($||1e3,_e)}setAutoReconnect($){this.reconnect=$}setReconnectInterval($){this.reconnect_interval=$}setMaxReconnects($){this.max_reconnects=$}_connect($,_e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory($,_e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:et})=>{et instanceof ArrayBuffer&&(et=Buffer.from(et).toString());try{et=this.dataPack.decode(et)}catch{return}if(et.notification&&this.listeners(et.notification).length){if(!Object.keys(et.params).length)return this.emit(et.notification);const tt=[et.notification];if(et.params.constructor===Object)tt.push(et.params);else for(let nt=0;nt{this.emit.apply(this,tt)})}if(!this.queue[et.id])return et.method?Promise.resolve().then(()=>{this.emit(et.method,et==null?void 0:et.params)}):void 0;"error"in et=="result"in et&&this.queue[et.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[et.id].timeout&&clearTimeout(this.queue[et.id].timeout),et.error?this.queue[et.id].promise[1](et.error):this.queue[et.id].promise[0](et.result),delete this.queue[et.id]}),this.socket.addEventListener("error",et=>this.emit("error",et)),this.socket.addEventListener("close",({code:et,reason:tt})=>{this.ready&&setTimeout(()=>this.emit("close",et,tt),0),this.ready=!1,this.socket=void 0,et!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect($,_e),this.reconnect_interval)))})}}var _default$1=client.default=CommonClient,websocket_browser={};Object.defineProperty(websocket_browser,"__esModule",{value:!0});const eventemitter3_1=eventemitter3Exports;class WebSocketBrowserImpl extends eventemitter3_1.EventEmitter{constructor($,_e,et){super();dn(this,"socket");this.socket=new window.WebSocket($,et),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=tt=>this.emit("message",tt.data),this.socket.onerror=tt=>this.emit("error",tt),this.socket.onclose=tt=>{this.emit("close",tt.code,tt.reason)}}send($,_e,et){const tt=et||_e;try{this.socket.send($),tt()}catch(nt){tt(nt)}}close($,_e){this.socket.close($,_e)}addEventListener($,_e,et){this.socket.addEventListener($,_e,et)}}function default_1(s,j){return new WebSocketBrowserImpl(s,j)}var _default=websocket_browser.default=default_1;const U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(s,j=!1){return j?{h:Number(s&U32_MASK64),l:Number(s>>_32n&U32_MASK64)}:{h:Number(s>>_32n&U32_MASK64)|0,l:Number(s&U32_MASK64)|0}}function split(s,j=!1){let $=new Uint32Array(s.length),_e=new Uint32Array(s.length);for(let et=0;ets<<$|j>>>32-$,rotlSL=(s,j,$)=>j<<$|s>>>32-$,rotlBH=(s,j,$)=>j<<$-32|s>>>64-$,rotlBL=(s,j,$)=>s<<$-32|j>>>64-$,SHA3_PI=[],SHA3_ROTL=[],_SHA3_IOTA=[],_0n$2=BigInt(0),_1n$2=BigInt(1),_2n$2=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let s=0,j=_1n$2,$=1,_e=0;s<24;s++){[$,_e]=[_e,(2*$+3*_e)%5],SHA3_PI.push(2*(5*_e+$)),SHA3_ROTL.push((s+1)*(s+2)/2%64);let et=_0n$2;for(let tt=0;tt<7;tt++)j=(j<<_1n$2^(j>>_7n)*_0x71n)%_256n,j&_2n$2&&(et^=_1n$2<<(_1n$2<$>32?rotlBH(s,j,$):rotlSH(s,j,$),rotlL=(s,j,$)=>$>32?rotlBL(s,j,$):rotlSL(s,j,$);function keccakP(s,j=24){const $=new Uint32Array(10);for(let _e=24-j;_e<24;_e++){for(let nt=0;nt<10;nt++)$[nt]=s[nt]^s[nt+10]^s[nt+20]^s[nt+30]^s[nt+40];for(let nt=0;nt<10;nt+=2){const rt=(nt+8)%10,ot=(nt+2)%10,it=$[ot],st=$[ot+1],at=rotlH(it,st,1)^$[rt],ct=rotlL(it,st,1)^$[rt+1];for(let lt=0;lt<50;lt+=10)s[nt+lt]^=at,s[nt+lt+1]^=ct}let et=s[2],tt=s[3];for(let nt=0;nt<24;nt++){const rt=SHA3_ROTL[nt],ot=rotlH(et,tt,rt),it=rotlL(et,tt,rt),st=SHA3_PI[nt];et=s[st],tt=s[st+1],s[st]=ot,s[st+1]=it}for(let nt=0;nt<50;nt+=10){for(let rt=0;rt<10;rt++)$[rt]=s[nt+rt];for(let rt=0;rt<10;rt++)s[nt+rt]^=~$[(rt+2)%10]&$[(rt+4)%10]}s[0]^=SHA3_IOTA_H[_e],s[1]^=SHA3_IOTA_L[_e]}$.fill(0)}class Keccak extends Hash{constructor(j,$,_e,et=!1,tt=24){if(super(),this.blockLen=j,this.suffix=$,this.outputLen=_e,this.enableXOF=et,this.rounds=tt,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number$1(_e),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32$1(this.state)}keccak(){isLE||byteSwap32(this.state32),keccakP(this.state32,this.rounds),isLE||byteSwap32(this.state32),this.posOut=0,this.pos=0}update(j){exists(this);const{blockLen:$,state:_e}=this;j=toBytes(j);const et=j.length;for(let tt=0;tt=_e&&this.keccak();const nt=Math.min(_e-this.posOut,tt-et);j.set($.subarray(this.posOut,this.posOut+nt),et),this.posOut+=nt,et+=nt}return j}xofInto(j){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(j)}xof(j){return number$1(j),this.xofInto(new Uint8Array(j))}digestInto(j){if(output(j,this),this.finished)throw new Error("digest() was already called");return this.writeInto(j),this.destroy(),j}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(j){const{blockLen:$,suffix:_e,outputLen:et,rounds:tt,enableXOF:nt}=this;return j||(j=new Keccak($,_e,et,nt,tt)),j.state32.set(this.state32),j.pos=this.pos,j.posOut=this.posOut,j.finished=this.finished,j.rounds=tt,j.suffix=_e,j.outputLen=et,j.enableXOF=nt,j.destroyed=this.destroyed,j}}const gen=(s,j,$)=>wrapConstructor(()=>new Keccak(j,s,$)),sha3_224=gen(6,144,224/8),sha3_256=gen(6,136,256/8),sha3_384=gen(6,104,384/8),sha3_512=gen(6,72,512/8),keccak_224=gen(1,144,224/8),keccak_256=gen(1,136,256/8),keccak_384=gen(1,104,384/8),keccak_512=gen(1,72,512/8),genShake=(s,j,$)=>wrapXOFConstructorWithOpts((_e={})=>new Keccak(j,s,_e.dkLen===void 0?$:_e.dkLen,!0)),shake128=genShake(31,168,128/8),shake256=genShake(31,136,256/8),sha3=Object.freeze(Object.defineProperty({__proto__:null,Keccak,keccakP,keccak_224,keccak_256,keccak_384,keccak_512,sha3_224,sha3_256,sha3_384,sha3_512,shake128,shake256},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validatePointOpts(s){const j=validateBasic(s);validateObject(j,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:$,Fp:_e,a:et}=j;if($){if(!_e.eql(et,_e.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof $!="object"||typeof $.beta!="bigint"||typeof $.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...j})}const{bytesToNumberBE:b2n,hexToBytes:h2b}=ut,DER={Err:class extends Error{constructor(j=""){super(j)}},_parseInt(s){const{Err:j}=DER;if(s.length<2||s[0]!==2)throw new j("Invalid signature integer tag");const $=s[1],_e=s.subarray(2,$+2);if(!$||_e.length!==$)throw new j("Invalid signature integer: wrong length");if(_e[0]&128)throw new j("Invalid signature integer: negative");if(_e[0]===0&&!(_e[1]&128))throw new j("Invalid signature integer: unnecessary leading zero");return{d:b2n(_e),l:s.subarray($+2)}},toSig(s){const{Err:j}=DER,$=typeof s=="string"?h2b(s):s;abytes($);let _e=$.length;if(_e<2||$[0]!=48)throw new j("Invalid signature tag");if($[1]!==_e-2)throw new j("Invalid signature: incorrect length");const{d:et,l:tt}=DER._parseInt($.subarray(2)),{d:nt,l:rt}=DER._parseInt(tt);if(rt.length)throw new j("Invalid signature: left bytes after parsing");return{r:et,s:nt}},hexFromSig(s){const j=it=>Number.parseInt(it[0],16)&8?"00"+it:it,$=it=>{const st=it.toString(16);return st.length&1?`0${st}`:st},_e=j($(s.s)),et=j($(s.r)),tt=_e.length/2,nt=et.length/2,rt=$(tt),ot=$(nt);return`30${$(nt+tt+4)}02${ot}${et}02${rt}${_e}`}},_0n$1=BigInt(0),_1n$1=BigInt(1),_2n$1=BigInt(2),_3n=BigInt(3),_4n=BigInt(4);function weierstrassPoints(s){const j=validatePointOpts(s),{Fp:$}=j,_e=j.toBytes||((dt,ft,gt)=>{const ht=ft.toAffine();return concatBytes(Uint8Array.from([4]),$.toBytes(ht.x),$.toBytes(ht.y))}),et=j.fromBytes||(dt=>{const ft=dt.subarray(1),gt=$.fromBytes(ft.subarray(0,$.BYTES)),ht=$.fromBytes(ft.subarray($.BYTES,2*$.BYTES));return{x:gt,y:ht}});function tt(dt){const{a:ft,b:gt}=j,ht=$.sqr(dt),yt=$.mul(ht,dt);return $.add($.add(yt,$.mul(dt,ft)),gt)}if(!$.eql($.sqr(j.Gy),tt(j.Gx)))throw new Error("bad generator point: equation left != right");function nt(dt){return typeof dt=="bigint"&&_0n$1$.eql(pt,$.ZERO);return yt(gt)&&yt(ht)?at.ZERO:new at(gt,ht,$.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(ft){const gt=$.invertBatch(ft.map(ht=>ht.pz));return ft.map((ht,yt)=>ht.toAffine(gt[yt])).map(at.fromAffine)}static fromHex(ft){const gt=at.fromAffine(et(ensureBytes("pointHex",ft)));return gt.assertValidity(),gt}static fromPrivateKey(ft){return at.BASE.multiply(ot(ft))}_setWindowSize(ft){this._WINDOW_SIZE=ft,it.delete(this)}assertValidity(){if(this.is0()){if(j.allowInfinityPoint&&!$.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:ft,y:gt}=this.toAffine();if(!$.isValid(ft)||!$.isValid(gt))throw new Error("bad point: x or y not FE");const ht=$.sqr(gt),yt=tt(ft);if(!$.eql(ht,yt))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:ft}=this.toAffine();if($.isOdd)return!$.isOdd(ft);throw new Error("Field doesn't support isOdd")}equals(ft){st(ft);const{px:gt,py:ht,pz:yt}=this,{px:pt,py:Mt,pz:St}=ft,Tt=$.eql($.mul(gt,St),$.mul(pt,yt)),vt=$.eql($.mul(ht,St),$.mul(Mt,yt));return Tt&&vt}negate(){return new at(this.px,$.neg(this.py),this.pz)}double(){const{a:ft,b:gt}=j,ht=$.mul(gt,_3n),{px:yt,py:pt,pz:Mt}=this;let St=$.ZERO,Tt=$.ZERO,vt=$.ZERO,Dt=$.mul(yt,yt),zt=$.mul(pt,pt),Ot=$.mul(Mt,Mt),Ft=$.mul(yt,pt);return Ft=$.add(Ft,Ft),vt=$.mul(yt,Mt),vt=$.add(vt,vt),St=$.mul(ft,vt),Tt=$.mul(ht,Ot),Tt=$.add(St,Tt),St=$.sub(zt,Tt),Tt=$.add(zt,Tt),Tt=$.mul(St,Tt),St=$.mul(Ft,St),vt=$.mul(ht,vt),Ot=$.mul(ft,Ot),Ft=$.sub(Dt,Ot),Ft=$.mul(ft,Ft),Ft=$.add(Ft,vt),vt=$.add(Dt,Dt),Dt=$.add(vt,Dt),Dt=$.add(Dt,Ot),Dt=$.mul(Dt,Ft),Tt=$.add(Tt,Dt),Ot=$.mul(pt,Mt),Ot=$.add(Ot,Ot),Dt=$.mul(Ot,Ft),St=$.sub(St,Dt),vt=$.mul(Ot,zt),vt=$.add(vt,vt),vt=$.add(vt,vt),new at(St,Tt,vt)}add(ft){st(ft);const{px:gt,py:ht,pz:yt}=this,{px:pt,py:Mt,pz:St}=ft;let Tt=$.ZERO,vt=$.ZERO,Dt=$.ZERO;const zt=j.a,Ot=$.mul(j.b,_3n);let Ft=$.mul(gt,pt),Pt=$.mul(ht,Mt),Lt=$.mul(yt,St),mt=$.add(gt,ht),xt=$.add(pt,Mt);mt=$.mul(mt,xt),xt=$.add(Ft,Pt),mt=$.sub(mt,xt),xt=$.add(gt,yt);let It=$.add(pt,St);return xt=$.mul(xt,It),It=$.add(Ft,Lt),xt=$.sub(xt,It),It=$.add(ht,yt),Tt=$.add(Mt,St),It=$.mul(It,Tt),Tt=$.add(Pt,Lt),It=$.sub(It,Tt),Dt=$.mul(zt,xt),Tt=$.mul(Ot,Lt),Dt=$.add(Tt,Dt),Tt=$.sub(Pt,Dt),Dt=$.add(Pt,Dt),vt=$.mul(Tt,Dt),Pt=$.add(Ft,Ft),Pt=$.add(Pt,Ft),Lt=$.mul(zt,Lt),xt=$.mul(Ot,xt),Pt=$.add(Pt,Lt),Lt=$.sub(Ft,Lt),Lt=$.mul(zt,Lt),xt=$.add(xt,Lt),Ft=$.mul(Pt,xt),vt=$.add(vt,Ft),Ft=$.mul(It,xt),Tt=$.mul(mt,Tt),Tt=$.sub(Tt,Ft),Ft=$.mul(mt,Pt),Dt=$.mul(It,Dt),Dt=$.add(Dt,Ft),new at(Tt,vt,Dt)}subtract(ft){return this.add(ft.negate())}is0(){return this.equals(at.ZERO)}wNAF(ft){return lt.wNAFCached(this,it,ft,gt=>{const ht=$.invertBatch(gt.map(yt=>yt.pz));return gt.map((yt,pt)=>yt.toAffine(ht[pt])).map(at.fromAffine)})}multiplyUnsafe(ft){const gt=at.ZERO;if(ft===_0n$1)return gt;if(rt(ft),ft===_1n$1)return this;const{endo:ht}=j;if(!ht)return lt.unsafeLadder(this,ft);let{k1neg:yt,k1:pt,k2neg:Mt,k2:St}=ht.splitScalar(ft),Tt=gt,vt=gt,Dt=this;for(;pt>_0n$1||St>_0n$1;)pt&_1n$1&&(Tt=Tt.add(Dt)),St&_1n$1&&(vt=vt.add(Dt)),Dt=Dt.double(),pt>>=_1n$1,St>>=_1n$1;return yt&&(Tt=Tt.negate()),Mt&&(vt=vt.negate()),vt=new at($.mul(vt.px,ht.beta),vt.py,vt.pz),Tt.add(vt)}multiply(ft){rt(ft);let gt=ft,ht,yt;const{endo:pt}=j;if(pt){const{k1neg:Mt,k1:St,k2neg:Tt,k2:vt}=pt.splitScalar(gt);let{p:Dt,f:zt}=this.wNAF(St),{p:Ot,f:Ft}=this.wNAF(vt);Dt=lt.constTimeNegate(Mt,Dt),Ot=lt.constTimeNegate(Tt,Ot),Ot=new at($.mul(Ot.px,pt.beta),Ot.py,Ot.pz),ht=Dt.add(Ot),yt=zt.add(Ft)}else{const{p:Mt,f:St}=this.wNAF(gt);ht=Mt,yt=St}return at.normalizeZ([ht,yt])[0]}multiplyAndAddUnsafe(ft,gt,ht){const yt=at.BASE,pt=(St,Tt)=>Tt===_0n$1||Tt===_1n$1||!St.equals(yt)?St.multiplyUnsafe(Tt):St.multiply(Tt),Mt=pt(this,gt).add(pt(ft,ht));return Mt.is0()?void 0:Mt}toAffine(ft){const{px:gt,py:ht,pz:yt}=this,pt=this.is0();ft==null&&(ft=pt?$.ONE:$.inv(yt));const Mt=$.mul(gt,ft),St=$.mul(ht,ft),Tt=$.mul(yt,ft);if(pt)return{x:$.ZERO,y:$.ZERO};if(!$.eql(Tt,$.ONE))throw new Error("invZ was invalid");return{x:Mt,y:St}}isTorsionFree(){const{h:ft,isTorsionFree:gt}=j;if(ft===_1n$1)return!0;if(gt)return gt(at,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:ft,clearCofactor:gt}=j;return ft===_1n$1?this:gt?gt(at,this):this.multiplyUnsafe(j.h)}toRawBytes(ft=!0){return this.assertValidity(),_e(at,this,ft)}toHex(ft=!0){return bytesToHex(this.toRawBytes(ft))}}at.BASE=new at(j.Gx,j.Gy,$.ONE),at.ZERO=new at($.ZERO,$.ONE,$.ZERO);const ct=j.nBitLength,lt=wNAF(at,j.endo?Math.ceil(ct/2):ct);return{CURVE:j,ProjectivePoint:at,normPrivateKeyToScalar:ot,weierstrassEquation:tt,isWithinCurveOrder:nt}}function validateOpts(s){const j=validateBasic(s);return validateObject(j,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...j})}function weierstrass(s){const j=validateOpts(s),{Fp:$,n:_e}=j,et=$.BYTES+1,tt=2*$.BYTES+1;function nt(xt){return _0n$1bytesToHex(numberToBytesBE(xt,j.nByteLength));function dt(xt){const It=_e>>_1n$1;return xt>It}function ft(xt){return dt(xt)?rt(-xt):xt}const gt=(xt,It,jt)=>bytesToNumberBE(xt.slice(It,jt));class ht{constructor(It,jt,At){this.r=It,this.s=jt,this.recovery=At,this.assertValidity()}static fromCompact(It){const jt=j.nByteLength;return It=ensureBytes("compactSignature",It,jt*2),new ht(gt(It,0,jt),gt(It,jt,2*jt))}static fromDER(It){const{r:jt,s:At}=DER.toSig(ensureBytes("DER",It));return new ht(jt,At)}assertValidity(){if(!ct(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!ct(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(It){return new ht(this.r,this.s,It)}recoverPublicKey(It){const{r:jt,s:At,recovery:wt}=this,Rt=vt(ensureBytes("msgHash",It));if(wt==null||![0,1,2,3].includes(wt))throw new Error("recovery id invalid");const Nt=wt===2||wt===3?jt+j.n:jt;if(Nt>=$.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ct=wt&1?"03":"02",Bt=it.fromHex(Ct+lt(Nt)),Gt=ot(Nt),Vt=rt(-Rt*Gt),Yt=rt(At*Gt),Qt=it.BASE.multiplyAndAddUnsafe(Bt,Vt,Yt);if(!Qt)throw new Error("point at infinify");return Qt.assertValidity(),Qt}hasHighS(){return dt(this.s)}normalizeS(){return this.hasHighS()?new ht(this.r,rt(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return lt(this.r)+lt(this.s)}}const yt={isValidPrivateKey(xt){try{return st(xt),!0}catch{return!1}},normPrivateKeyToScalar:st,randomPrivateKey:()=>{const xt=getMinHashLength(j.n);return mapHashToField(j.randomBytes(xt),j.n)},precompute(xt=8,It=it.BASE){return It._setWindowSize(xt),It.multiply(BigInt(3)),It}};function pt(xt,It=!0){return it.fromPrivateKey(xt).toRawBytes(It)}function Mt(xt){const It=isBytes(xt),jt=typeof xt=="string",At=(It||jt)&&xt.length;return It?At===et||At===tt:jt?At===2*et||At===2*tt:xt instanceof it}function St(xt,It,jt=!0){if(Mt(xt))throw new Error("first arg must be private key");if(!Mt(It))throw new Error("second arg must be public key");return it.fromHex(It).multiply(st(xt)).toRawBytes(jt)}const Tt=j.bits2int||function(xt){const It=bytesToNumberBE(xt),jt=xt.length*8-j.nBitLength;return jt>0?It>>BigInt(jt):It},vt=j.bits2int_modN||function(xt){return rt(Tt(xt))},Dt=bitMask(j.nBitLength);function zt(xt){if(typeof xt!="bigint")throw new Error("bigint expected");if(!(_0n$1<=xt&&xtZt in jt))throw new Error("sign() legacy options not supported");const{hash:At,randomBytes:wt}=j;let{lowS:Rt,prehash:Nt,extraEntropy:Ct}=jt;Rt==null&&(Rt=!0),xt=ensureBytes("msgHash",xt),Nt&&(xt=ensureBytes("prehashed msgHash",At(xt)));const Bt=vt(xt),Gt=st(It),Vt=[zt(Gt),zt(Bt)];if(Ct!=null&&Ct!==!1){const Zt=Ct===!0?wt($.BYTES):Ct;Vt.push(ensureBytes("extraEntropy",Zt))}const Yt=concatBytes(...Vt),Qt=Bt;function qt(Zt){const fn=Tt(Zt);if(!ct(fn))return;const Xt=ot(fn),on=it.BASE.multiply(fn).toAffine(),tn=rt(on.x);if(tn===_0n$1)return;const Kt=rt(Xt*rt(Qt+tn*Gt));if(Kt===_0n$1)return;let Jt=(on.x===tn?0:2)|Number(on.y&_1n$1),En=Kt;return Rt&&dt(Kt)&&(En=ft(Kt),Jt^=1),new ht(tn,En,Jt)}return{seed:Yt,k2sig:qt}}const Ft={lowS:j.lowS,prehash:!1},Pt={lowS:j.lowS,prehash:!1};function Lt(xt,It,jt=Ft){const{seed:At,k2sig:wt}=Ot(xt,It,jt),Rt=j;return createHmacDrbg(Rt.hash.outputLen,Rt.nByteLength,Rt.hmac)(At,wt)}it.BASE._setWindowSize(8);function mt(xt,It,jt,At=Pt){var on;const wt=xt;if(It=ensureBytes("msgHash",It),jt=ensureBytes("publicKey",jt),"strict"in At)throw new Error("options.strict was renamed to lowS");const{lowS:Rt,prehash:Nt}=At;let Ct,Bt;try{if(typeof wt=="string"||isBytes(wt))try{Ct=ht.fromDER(wt)}catch(tn){if(!(tn instanceof DER.Err))throw tn;Ct=ht.fromCompact(wt)}else if(typeof wt=="object"&&typeof wt.r=="bigint"&&typeof wt.s=="bigint"){const{r:tn,s:Kt}=wt;Ct=new ht(tn,Kt)}else throw new Error("PARSE");Bt=it.fromHex(jt)}catch(tn){if(tn.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Rt&&Ct.hasHighS())return!1;Nt&&(It=j.hash(It));const{r:Gt,s:Vt}=Ct,Yt=vt(It),Qt=ot(Vt),qt=rt(Yt*Qt),Zt=rt(Gt*Qt),fn=(on=it.BASE.multiplyAndAddUnsafe(Bt,qt,Zt))==null?void 0:on.toAffine();return fn?rt(fn.x)===Gt:!1}return{CURVE:j,getPublicKey:pt,getSharedSecret:St,sign:Lt,verify:mt,ProjectivePoint:it,Signature:ht,utils:yt}}function SWUFpSqrtRatio(s,j){const $=s.ORDER;let _e=_0n$1;for(let dt=$-_1n$1;dt%_2n$1===_0n$1;dt/=_2n$1)_e+=_1n$1;const et=_e,tt=_2n$1<{let gt=at,ht=s.pow(ft,it),yt=s.sqr(ht);yt=s.mul(yt,ft);let pt=s.mul(dt,yt);pt=s.pow(pt,ot),pt=s.mul(pt,ht),ht=s.mul(pt,ft),yt=s.mul(pt,dt);let Mt=s.mul(yt,ht);pt=s.pow(Mt,st);let St=s.eql(pt,s.ONE);ht=s.mul(yt,ct),pt=s.mul(Mt,gt),yt=s.cmov(ht,yt,St),Mt=s.cmov(pt,Mt,St);for(let Tt=et;Tt>_1n$1;Tt--){let vt=Tt-_2n$1;vt=_2n$1<{let yt=s.sqr(ht);const pt=s.mul(gt,ht);yt=s.mul(yt,pt);let Mt=s.pow(yt,dt);Mt=s.mul(Mt,pt);const St=s.mul(Mt,ft),Tt=s.mul(s.sqr(Mt),ht),vt=s.eql(Tt,gt);let Dt=s.cmov(St,Mt,vt);return{isValid:vt,value:Dt}}}return lt}function mapToCurveSimpleSWU(s,j){if(validateField(s),!s.isValid(j.A)||!s.isValid(j.B)||!s.isValid(j.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const $=SWUFpSqrtRatio(s,j.Z);if(!s.isOdd)throw new Error("Fp.isOdd is not implemented!");return _e=>{let et,tt,nt,rt,ot,it,st,at;et=s.sqr(_e),et=s.mul(et,j.Z),tt=s.sqr(et),tt=s.add(tt,et),nt=s.add(tt,s.ONE),nt=s.mul(nt,j.B),rt=s.cmov(j.Z,s.neg(tt),!s.eql(tt,s.ZERO)),rt=s.mul(rt,j.A),tt=s.sqr(nt),it=s.sqr(rt),ot=s.mul(it,j.A),tt=s.add(tt,ot),tt=s.mul(tt,nt),it=s.mul(it,rt),ot=s.mul(it,j.B),tt=s.add(tt,ot),st=s.mul(et,nt);const{isValid:ct,value:lt}=$(tt,it);at=s.mul(et,_e),at=s.mul(at,lt),st=s.cmov(st,nt,ct),at=s.cmov(at,lt,ct);const dt=s.isOdd(_e)===s.isOdd(at);return at=s.cmov(s.neg(at),at,dt),st=s.div(st,rt),{x:st,y:at}}}class HMAC extends Hash{constructor(j,$){super(),this.finished=!1,this.destroyed=!1,hash(j);const _e=toBytes($);if(this.iHash=j.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const et=this.blockLen,tt=new Uint8Array(et);tt.set(_e.length>et?j.create().update(_e).digest():_e);for(let nt=0;ntnew HMAC(s,j).update($).digest();hmac.create=(s,j)=>new HMAC(s,j);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(s){return{hash:s,hmac:(j,...$)=>hmac(s,j,concatBytes$1(...$)),randomBytes}}function createCurve(s,j){const $=_e=>weierstrass({...s,...getHash(_e)});return Object.freeze({...$(j),create:$})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n=BigInt(1),_2n=BigInt(2),divNearest=(s,j)=>(s+j/_2n)/j;function sqrtMod(s){const j=secp256k1P,$=BigInt(3),_e=BigInt(6),et=BigInt(11),tt=BigInt(22),nt=BigInt(23),rt=BigInt(44),ot=BigInt(88),it=s*s*s%j,st=it*it*s%j,at=pow2(st,$,j)*st%j,ct=pow2(at,$,j)*st%j,lt=pow2(ct,_2n,j)*it%j,dt=pow2(lt,et,j)*lt%j,ft=pow2(dt,tt,j)*dt%j,gt=pow2(ft,rt,j)*ft%j,ht=pow2(gt,ot,j)*gt%j,yt=pow2(ht,rt,j)*ft%j,pt=pow2(yt,$,j)*st%j,Mt=pow2(pt,nt,j)*dt%j,St=pow2(Mt,_e,j)*it%j,Tt=pow2(St,_2n,j);if(!Fp.eql(Fp.sqr(Tt),s))throw new Error("Cannot find square root");return Tt}const Fp=Field(secp256k1P,void 0,void 0,{sqrt:sqrtMod}),secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:s=>{const j=secp256k1N,$=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),_e=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),et=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),tt=$,nt=BigInt("0x100000000000000000000000000000000"),rt=divNearest(tt*s,j),ot=divNearest(-_e*s,j);let it=mod(s-rt*$-ot*et,j),st=mod(-rt*_e-ot*tt,j);const at=it>nt,ct=st>nt;if(at&&(it=j-it),ct&&(st=j-st),it>nt||st>nt)throw new Error("splitScalar: Endomorphism failed, k="+s);return{k1neg:at,k1:it,k2neg:ct,k2:st}}}},sha256),_0n=BigInt(0),fe=s=>typeof s=="bigint"&&_0ntypeof s=="bigint"&&_0net.charCodeAt(0)));$=concatBytes(_e,_e),TAGGED_HASH_PREFIXES[s]=$}return sha256(concatBytes($,...j))}const pointToBytes=s=>s.toRawBytes(!0).slice(1),numTo32b=s=>numberToBytesBE(s,32),modP=s=>mod(s,secp256k1P),modN=s=>mod(s,secp256k1N),Point=secp256k1.ProjectivePoint,GmulAdd=(s,j,$)=>Point.BASE.multiplyAndAddUnsafe(s,j,$);function schnorrGetExtPubKey(s){let j=secp256k1.utils.normPrivateKeyToScalar(s),$=Point.fromPrivateKey(j);return{scalar:$.hasEvenY()?j:modN(-j),bytes:pointToBytes($)}}function lift_x(s){if(!fe(s))throw new Error("bad x: need 0 < x < p");const j=modP(s*s),$=modP(j*s+BigInt(7));let _e=sqrtMod($);_e%_2n!==_0n&&(_e=modP(-_e));const et=new Point(s,_e,_1n);return et.assertValidity(),et}function challenge(...s){return modN(bytesToNumberBE(taggedHash("BIP0340/challenge",...s)))}function schnorrGetPublicKey(s){return schnorrGetExtPubKey(s).bytes}function schnorrSign(s,j,$=randomBytes(32)){const _e=ensureBytes("message",s),{bytes:et,scalar:tt}=schnorrGetExtPubKey(j),nt=ensureBytes("auxRand",$,32),rt=numTo32b(tt^bytesToNumberBE(taggedHash("BIP0340/aux",nt))),ot=taggedHash("BIP0340/nonce",rt,et,_e),it=modN(bytesToNumberBE(ot));if(it===_0n)throw new Error("sign failed: k is zero");const{bytes:st,scalar:at}=schnorrGetExtPubKey(it),ct=challenge(st,et,_e),lt=new Uint8Array(64);if(lt.set(st,0),lt.set(numTo32b(modN(at+ct*tt)),32),!schnorrVerify(lt,_e,et))throw new Error("sign: Invalid signature produced");return lt}function schnorrVerify(s,j,$){const _e=ensureBytes("signature",s,64),et=ensureBytes("message",j),tt=ensureBytes("publicKey",$,32);try{const nt=lift_x(bytesToNumberBE(tt)),rt=bytesToNumberBE(_e.subarray(0,32));if(!fe(rt))return!1;const ot=bytesToNumberBE(_e.subarray(32,64));if(!ge(ot))return!1;const it=challenge(numTo32b(rt),pointToBytes(nt),et),st=GmulAdd(nt,ot,modN(-it));return!(!st||!st.hasEvenY()||st.toAffine().x!==rt)}catch{return!1}}const schnorr={getPublicKey:schnorrGetPublicKey,sign:schnorrSign,verify:schnorrVerify,utils:{randomPrivateKey:secp256k1.utils.randomPrivateKey,lift_x,pointToBytes,numberToBytesBE,bytesToNumberBE,taggedHash,mod}},isoMap=isogenyMap(Fp,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(s=>s.map(j=>BigInt(j)))),mapSWU=mapToCurveSimpleSWU(Fp,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Fp.create(BigInt("-11"))}),htf=createHasher(secp256k1.ProjectivePoint,s=>{const{x:j,y:$}=mapSWU(Fp.create(s[0]));return isoMap(j,$)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Fp.ORDER,m:1,k:128,expand:"xmd",hash:sha256}),hashToCurve=htf.hashToCurve,encodeToCurve=htf.encodeToCurve,secp256k1$1=Object.freeze(Object.defineProperty({__proto__:null,encodeToCurve,hashToCurve,schnorr,secp256k1},Symbol.toStringTag,{value:"Module"})),generatePrivateKey=ed25519.utils.randomPrivateKey,generateKeypair=()=>{const s=ed25519.utils.randomPrivateKey(),j=getPublicKey(s),$=new Uint8Array(64);return $.set(s),$.set(j,32),{publicKey:j,secretKey:$}},getPublicKey=ed25519.getPublicKey;function isOnCurve(s){try{return ed25519.ExtendedPoint.fromHex(s),!0}catch{return!1}}const sign=(s,j)=>ed25519.sign(s,j.slice(0,32)),verify=ed25519.verify,toBuffer=s=>buffer.Buffer.isBuffer(s)?s:s instanceof Uint8Array?buffer.Buffer.from(s.buffer,s.byteOffset,s.byteLength):buffer.Buffer.from(s);class Struct{constructor(j){Object.assign(this,j)}encode(){return buffer.Buffer.from(serialize_1(SOLANA_SCHEMA,this))}static decode(j){return deserialize_1(SOLANA_SCHEMA,this,j)}static decodeUnchecked(j){return deserializeUnchecked_1(SOLANA_SCHEMA,this,j)}}class Enum extends Struct{constructor(j){if(super(j),this.enum="",Object.keys(j).length!==1)throw new Error("Enum can only take single value");Object.keys(j).map($=>{this.enum=$})}}const SOLANA_SCHEMA=new Map;var _PublicKey;const MAX_SEED_LENGTH=32,PUBLIC_KEY_LENGTH=32;function isPublicKeyData(s){return s._bn!==void 0}let uniquePublicKeyCounter=1;class PublicKey extends Struct{constructor(j){if(super({}),this._bn=void 0,isPublicKeyData(j))this._bn=j._bn;else{if(typeof j=="string"){const $=base58.decode(j);if($.length!=PUBLIC_KEY_LENGTH)throw new Error("Invalid public key input");this._bn=new BN($)}else this._bn=new BN(j);if(this._bn.byteLength()>PUBLIC_KEY_LENGTH)throw new Error("Invalid public key input")}}static unique(){const j=new PublicKey(uniquePublicKeyCounter);return uniquePublicKeyCounter+=1,new PublicKey(j.toBuffer())}equals(j){return this._bn.eq(j._bn)}toBase58(){return base58.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const j=this.toBuffer();return new Uint8Array(j.buffer,j.byteOffset,j.byteLength)}toBuffer(){const j=this._bn.toArrayLike(buffer.Buffer);if(j.length===PUBLIC_KEY_LENGTH)return j;const $=buffer.Buffer.alloc(32);return j.copy($,32-j.length),$}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(j,$,_e){const et=buffer.Buffer.concat([j.toBuffer(),buffer.Buffer.from($),_e.toBuffer()]),tt=sha256(et);return new PublicKey(tt)}static createProgramAddressSync(j,$){let _e=buffer.Buffer.alloc(0);j.forEach(function(tt){if(tt.length>MAX_SEED_LENGTH)throw new TypeError("Max seed length exceeded");_e=buffer.Buffer.concat([_e,toBuffer(tt)])}),_e=buffer.Buffer.concat([_e,$.toBuffer(),buffer.Buffer.from("ProgramDerivedAddress")]);const et=sha256(_e);if(isOnCurve(et))throw new Error("Invalid seeds, address must fall off the curve");return new PublicKey(et)}static async createProgramAddress(j,$){return this.createProgramAddressSync(j,$)}static findProgramAddressSync(j,$){let _e=255,et;for(;_e!=0;){try{const tt=j.concat(buffer.Buffer.from([_e]));et=this.createProgramAddressSync(tt,$)}catch(tt){if(tt instanceof TypeError)throw tt;_e--;continue}return[et,_e]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(j,$){return this.findProgramAddressSync(j,$)}static isOnCurve(j){const $=new PublicKey(j);return isOnCurve($.toBytes())}}_PublicKey=PublicKey;PublicKey.default=new _PublicKey("11111111111111111111111111111111");SOLANA_SCHEMA.set(PublicKey,{kind:"struct",fields:[["_bn","u256"]]});class Account{constructor(j){if(this._publicKey=void 0,this._secretKey=void 0,j){const $=toBuffer(j);if(j.length!==64)throw new Error("bad secret key size");this._publicKey=$.slice(32,64),this._secretKey=$.slice(0,32)}else this._secretKey=toBuffer(generatePrivateKey()),this._publicKey=toBuffer(getPublicKey(this._secretKey))}get publicKey(){return new PublicKey(this._publicKey)}get secretKey(){return buffer.Buffer.concat([this._secretKey,this._publicKey],64)}}const BPF_LOADER_DEPRECATED_PROGRAM_ID=new PublicKey("BPFLoader1111111111111111111111111111111111"),PACKET_DATA_SIZE=1232,VERSION_PREFIX_MASK=127,SIGNATURE_LENGTH_IN_BYTES=64;class TransactionExpiredBlockheightExceededError extends Error{constructor(j){super(`Signature ${j} has expired: block height exceeded.`),this.signature=void 0,this.signature=j}}Object.defineProperty(TransactionExpiredBlockheightExceededError.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class TransactionExpiredTimeoutError extends Error{constructor(j,$){super(`Transaction was not confirmed in ${$.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${j} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=j}}Object.defineProperty(TransactionExpiredTimeoutError.prototype,"name",{value:"TransactionExpiredTimeoutError"});class TransactionExpiredNonceInvalidError extends Error{constructor(j){super(`Signature ${j} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=j}}Object.defineProperty(TransactionExpiredNonceInvalidError.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class MessageAccountKeys{constructor(j,$){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=j,this.accountKeysFromLookups=$}keySegments(){const j=[this.staticAccountKeys];return this.accountKeysFromLookups&&(j.push(this.accountKeysFromLookups.writable),j.push(this.accountKeysFromLookups.readonly)),j}get(j){for(const $ of this.keySegments()){if(j<$.length)return $[j];j-=$.length}}get length(){return this.keySegments().flat().length}compileInstructions(j){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const _e=new Map;this.keySegments().flat().forEach((tt,nt)=>{_e.set(tt.toBase58(),nt)});const et=tt=>{const nt=_e.get(tt.toBase58());if(nt===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return nt};return j.map(tt=>({programIdIndex:et(tt.programId),accountKeyIndexes:tt.keys.map(nt=>et(nt.pubkey)),data:tt.data}))}}const publicKey=(s="publicKey")=>blob(32,s),signature$2=(s="signature")=>blob(64,s),rustString=(s="string")=>{const j=struct([u32("length"),u32("lengthPadding"),blob(offset(u32(),-8),"chars")],s),$=j.decode.bind(j),_e=j.encode.bind(j),et=j;return et.decode=(tt,nt)=>$(tt,nt).chars.toString(),et.encode=(tt,nt,rt)=>{const ot={chars:buffer.Buffer.from(tt,"utf8")};return _e(ot,nt,rt)},et.alloc=tt=>u32().span+u32().span+buffer.Buffer.from(tt,"utf8").length,et},authorized=(s="authorized")=>struct([publicKey("staker"),publicKey("withdrawer")],s),lockup=(s="lockup")=>struct([ns64("unixTimestamp"),ns64("epoch"),publicKey("custodian")],s),voteInit=(s="voteInit")=>struct([publicKey("nodePubkey"),publicKey("authorizedVoter"),publicKey("authorizedWithdrawer"),u8("commission")],s),voteAuthorizeWithSeedArgs=(s="voteAuthorizeWithSeedArgs")=>struct([u32("voteAuthorizationType"),publicKey("currentAuthorityDerivedKeyOwnerPubkey"),rustString("currentAuthorityDerivedKeySeed"),publicKey("newAuthorized")],s);function getAlloc(s,j){const $=et=>{if(et.span>=0)return et.span;if(typeof et.alloc=="function")return et.alloc(j[et.property]);if("count"in et&&"elementLayout"in et){const tt=j[et.property];if(Array.isArray(tt))return tt.length*$(et.elementLayout)}else if("fields"in et)return getAlloc({layout:et},j[et.property]);return 0};let _e=0;return s.layout.fields.forEach(et=>{_e+=$(et)}),_e}function decodeLength(s){let j=0,$=0;for(;;){let _e=s.shift();if(j|=(_e&127)<<$*7,$+=1,!(_e&128))break}return j}function encodeLength(s,j){let $=j;for(;;){let _e=$&127;if($>>=7,$==0){s.push(_e);break}else _e|=128,s.push(_e)}}function assert(s,j){if(!s)throw new Error(j||"Assertion failed")}class CompiledKeys{constructor(j,$){this.payer=void 0,this.keyMetaMap=void 0,this.payer=j,this.keyMetaMap=$}static compile(j,$){const _e=new Map,et=nt=>{const rt=nt.toBase58();let ot=_e.get(rt);return ot===void 0&&(ot={isSigner:!1,isWritable:!1,isInvoked:!1},_e.set(rt,ot)),ot},tt=et($);tt.isSigner=!0,tt.isWritable=!0;for(const nt of j){et(nt.programId).isInvoked=!0;for(const rt of nt.keys){const ot=et(rt.pubkey);ot.isSigner||(ot.isSigner=rt.isSigner),ot.isWritable||(ot.isWritable=rt.isWritable)}}return new CompiledKeys($,_e)}getMessageComponents(){const j=[...this.keyMetaMap.entries()];assert(j.length<=256,"Max static account keys length exceeded");const $=j.filter(([,ot])=>ot.isSigner&&ot.isWritable),_e=j.filter(([,ot])=>ot.isSigner&&!ot.isWritable),et=j.filter(([,ot])=>!ot.isSigner&&ot.isWritable),tt=j.filter(([,ot])=>!ot.isSigner&&!ot.isWritable),nt={numRequiredSignatures:$.length+_e.length,numReadonlySignedAccounts:_e.length,numReadonlyUnsignedAccounts:tt.length};{assert($.length>0,"Expected at least one writable signer key");const[ot]=$[0];assert(ot===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const rt=[...$.map(([ot])=>new PublicKey(ot)),..._e.map(([ot])=>new PublicKey(ot)),...et.map(([ot])=>new PublicKey(ot)),...tt.map(([ot])=>new PublicKey(ot))];return[nt,rt]}extractTableLookup(j){const[$,_e]=this.drainKeysFoundInLookupTable(j.state.addresses,nt=>!nt.isSigner&&!nt.isInvoked&&nt.isWritable),[et,tt]=this.drainKeysFoundInLookupTable(j.state.addresses,nt=>!nt.isSigner&&!nt.isInvoked&&!nt.isWritable);if(!($.length===0&&et.length===0))return[{accountKey:j.key,writableIndexes:$,readonlyIndexes:et},{writable:_e,readonly:tt}]}drainKeysFoundInLookupTable(j,$){const _e=new Array,et=new Array;for(const[tt,nt]of this.keyMetaMap.entries())if($(nt)){const rt=new PublicKey(tt),ot=j.findIndex(it=>it.equals(rt));ot>=0&&(assert(ot<256,"Max lookup table index exceeded"),_e.push(ot),et.push(rt),this.keyMetaMap.delete(tt))}return[_e,et]}}const END_OF_BUFFER_ERROR_MESSAGE="Reached end of buffer unexpectedly";function guardedShift(s){if(s.length===0)throw new Error(END_OF_BUFFER_ERROR_MESSAGE);return s.shift()}function guardedSplice(s,...j){const[$]=j;if(j.length===2?$+(j[1]??0)>s.length:$>=s.length)throw new Error(END_OF_BUFFER_ERROR_MESSAGE);return s.splice(...j)}class Message{constructor(j){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=j.header,this.accountKeys=j.accountKeys.map($=>new PublicKey($)),this.recentBlockhash=j.recentBlockhash,this.instructions=j.instructions,this.instructions.forEach($=>this.indexToProgramIds.set($.programIdIndex,this.accountKeys[$.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(j=>({programIdIndex:j.programIdIndex,accountKeyIndexes:j.accounts,data:base58.decode(j.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new MessageAccountKeys(this.staticAccountKeys)}static compile(j){const $=CompiledKeys.compile(j.instructions,j.payerKey),[_e,et]=$.getMessageComponents(),nt=new MessageAccountKeys(et).compileInstructions(j.instructions).map(rt=>({programIdIndex:rt.programIdIndex,accounts:rt.accountKeyIndexes,data:base58.encode(rt.data)}));return new Message({header:_e,accountKeys:et,recentBlockhash:j.recentBlockhash,instructions:nt})}isAccountSigner(j){return j=this.header.numRequiredSignatures){const _e=j-$,tt=this.accountKeys.length-$-this.header.numReadonlyUnsignedAccounts;return _e!this.isProgramId($))}serialize(){const j=this.accountKeys.length;let $=[];encodeLength($,j);const _e=this.instructions.map(at=>{const{accounts:ct,programIdIndex:lt}=at,dt=Array.from(base58.decode(at.data));let ft=[];encodeLength(ft,ct.length);let gt=[];return encodeLength(gt,dt.length),{programIdIndex:lt,keyIndicesCount:buffer.Buffer.from(ft),keyIndices:ct,dataLength:buffer.Buffer.from(gt),data:dt}});let et=[];encodeLength(et,_e.length);let tt=buffer.Buffer.alloc(PACKET_DATA_SIZE);buffer.Buffer.from(et).copy(tt);let nt=et.length;_e.forEach(at=>{const lt=struct([u8("programIdIndex"),blob(at.keyIndicesCount.length,"keyIndicesCount"),seq(u8("keyIndex"),at.keyIndices.length,"keyIndices"),blob(at.dataLength.length,"dataLength"),seq(u8("userdatum"),at.data.length,"data")]).encode(at,tt,nt);nt+=lt}),tt=tt.slice(0,nt);const rt=struct([blob(1,"numRequiredSignatures"),blob(1,"numReadonlySignedAccounts"),blob(1,"numReadonlyUnsignedAccounts"),blob($.length,"keyCount"),seq(publicKey("key"),j,"keys"),publicKey("recentBlockhash")]),ot={numRequiredSignatures:buffer.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:buffer.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:buffer.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:buffer.Buffer.from($),keys:this.accountKeys.map(at=>toBuffer(at.toBytes())),recentBlockhash:base58.decode(this.recentBlockhash)};let it=buffer.Buffer.alloc(2048);const st=rt.encode(ot,it);return tt.copy(it,st),it.slice(0,st+tt.length)}static from(j){let $=[...j];const _e=guardedShift($);if(_e!==(_e&VERSION_PREFIX_MASK))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const et=guardedShift($),tt=guardedShift($),nt=decodeLength($);let rt=[];for(let ct=0;ct0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new MessageAccountKeys(this.staticAccountKeys,$)}isAccountSigner(j){return j=_e){const et=j-_e,tt=this.addressTableLookups.reduce((nt,rt)=>nt+rt.writableIndexes.length,0);return et=this.header.numRequiredSignatures){const et=j-$,nt=_e-$-this.header.numReadonlyUnsignedAccounts;return ettt.key.equals(_e.accountKey));if(!et)throw new Error(`Failed to find address lookup table account for table key ${_e.accountKey.toBase58()}`);for(const tt of _e.writableIndexes)if(ttst.toBytes()),recentBlockhash:base58.decode(this.recentBlockhash),instructionsLength:new Uint8Array(_e),serializedInstructions:$,addressTableLookupsLength:new Uint8Array(tt),serializedAddressTableLookups:et},rt);return rt.slice(0,it)}serializeInstructions(){let j=0;const $=new Uint8Array(PACKET_DATA_SIZE);for(const _e of this.compiledInstructions){const et=Array();encodeLength(et,_e.accountKeyIndexes.length);const tt=Array();encodeLength(tt,_e.data.length);const nt=struct([u8("programIdIndex"),blob(et.length,"encodedAccountKeyIndexesLength"),seq(u8(),_e.accountKeyIndexes.length,"accountKeyIndexes"),blob(tt.length,"encodedDataLength"),blob(_e.data.length,"data")]);j+=nt.encode({programIdIndex:_e.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(et),accountKeyIndexes:_e.accountKeyIndexes,encodedDataLength:new Uint8Array(tt),data:_e.data},$,j)}return $.slice(0,j)}serializeAddressTableLookups(){let j=0;const $=new Uint8Array(PACKET_DATA_SIZE);for(const _e of this.addressTableLookups){const et=Array();encodeLength(et,_e.writableIndexes.length);const tt=Array();encodeLength(tt,_e.readonlyIndexes.length);const nt=struct([publicKey("accountKey"),blob(et.length,"encodedWritableIndexesLength"),seq(u8(),_e.writableIndexes.length,"writableIndexes"),blob(tt.length,"encodedReadonlyIndexesLength"),seq(u8(),_e.readonlyIndexes.length,"readonlyIndexes")]);j+=nt.encode({accountKey:_e.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(et),writableIndexes:_e.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(tt),readonlyIndexes:_e.readonlyIndexes},$,j)}return $.slice(0,j)}static deserialize(j){let $=[...j];const _e=guardedShift($),et=_e&VERSION_PREFIX_MASK;assert(_e!==et,"Expected versioned message but received legacy message");const tt=et;assert(tt===0,`Expected versioned message with version 0 but found version ${tt}`);const nt={numRequiredSignatures:guardedShift($),numReadonlySignedAccounts:guardedShift($),numReadonlyUnsignedAccounts:guardedShift($)},rt=[],ot=decodeLength($);for(let dt=0;dt{const j=VersionedMessage.deserializeMessageVersion(s);if(j==="legacy")return Message.from(s);if(j===0)return MessageV0.deserialize(s);throw new Error(`Transaction message version ${j} deserialization is not supported`)}};let TransactionStatus=function(s){return s[s.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",s[s.PROCESSED=1]="PROCESSED",s[s.TIMED_OUT=2]="TIMED_OUT",s[s.NONCE_INVALID=3]="NONCE_INVALID",s}({});const DEFAULT_SIGNATURE=buffer.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);class TransactionInstruction{constructor(j){this.keys=void 0,this.programId=void 0,this.data=buffer.Buffer.alloc(0),this.programId=j.programId,this.keys=j.keys,j.data&&(this.data=j.data)}toJSON(){return{keys:this.keys.map(({pubkey:j,isSigner:$,isWritable:_e})=>({pubkey:j.toJSON(),isSigner:$,isWritable:_e})),programId:this.programId.toJSON(),data:[...this.data]}}}class Transaction{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(j){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!j)if(j.feePayer&&(this.feePayer=j.feePayer),j.signatures&&(this.signatures=j.signatures),Object.prototype.hasOwnProperty.call(j,"nonceInfo")){const{minContextSlot:$,nonceInfo:_e}=j;this.minNonceContextSlot=$,this.nonceInfo=_e}else if(Object.prototype.hasOwnProperty.call(j,"lastValidBlockHeight")){const{blockhash:$,lastValidBlockHeight:_e}=j;this.recentBlockhash=$,this.lastValidBlockHeight=_e}else{const{recentBlockhash:$,nonceInfo:_e}=j;_e&&(this.nonceInfo=_e),this.recentBlockhash=$}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(j=>j.toJSON()),signers:this.signatures.map(({publicKey:j})=>j.toJSON())}}add(...j){if(j.length===0)throw new Error("No instructions");return j.forEach($=>{"instructions"in $?this.instructions=this.instructions.concat($.instructions):"data"in $&&"programId"in $&&"keys"in $?this.instructions.push($):this.instructions.push(new TransactionInstruction($))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let j,$;if(this.nonceInfo?(j=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?$=[this.nonceInfo.nonceInstruction,...this.instructions]:$=this.instructions):(j=this.recentBlockhash,$=this.instructions),!j)throw new Error("Transaction recentBlockhash required");$.length<1&&console.warn("No instructions provided");let _e;if(this.feePayer)_e=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)_e=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let ft=0;ft<$.length;ft++)if($[ft].programId===void 0)throw new Error(`Transaction instruction index ${ft} has undefined program id`);const et=[],tt=[];$.forEach(ft=>{ft.keys.forEach(ht=>{tt.push({...ht})});const gt=ft.programId.toString();et.includes(gt)||et.push(gt)}),et.forEach(ft=>{tt.push({pubkey:new PublicKey(ft),isSigner:!1,isWritable:!1})});const nt=[];tt.forEach(ft=>{const gt=ft.pubkey.toString(),ht=nt.findIndex(yt=>yt.pubkey.toString()===gt);ht>-1?(nt[ht].isWritable=nt[ht].isWritable||ft.isWritable,nt[ht].isSigner=nt[ht].isSigner||ft.isSigner):nt.push(ft)}),nt.sort(function(ft,gt){if(ft.isSigner!==gt.isSigner)return ft.isSigner?-1:1;if(ft.isWritable!==gt.isWritable)return ft.isWritable?-1:1;const ht={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return ft.pubkey.toBase58().localeCompare(gt.pubkey.toBase58(),"en",ht)});const rt=nt.findIndex(ft=>ft.pubkey.equals(_e));if(rt>-1){const[ft]=nt.splice(rt,1);ft.isSigner=!0,ft.isWritable=!0,nt.unshift(ft)}else nt.unshift({pubkey:_e,isSigner:!0,isWritable:!0});for(const ft of this.signatures){const gt=nt.findIndex(ht=>ht.pubkey.equals(ft.publicKey));if(gt>-1)nt[gt].isSigner||(nt[gt].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${ft.publicKey.toString()}`)}let ot=0,it=0,st=0;const at=[],ct=[];nt.forEach(({pubkey:ft,isSigner:gt,isWritable:ht})=>{gt?(at.push(ft.toString()),ot+=1,ht||(it+=1)):(ct.push(ft.toString()),ht||(st+=1))});const lt=at.concat(ct),dt=$.map(ft=>{const{data:gt,programId:ht}=ft;return{programIdIndex:lt.indexOf(ht.toString()),accounts:ft.keys.map(yt=>lt.indexOf(yt.pubkey.toString())),data:base58.encode(gt)}});return dt.forEach(ft=>{assert(ft.programIdIndex>=0),ft.accounts.forEach(gt=>assert(gt>=0))}),new Message({header:{numRequiredSignatures:ot,numReadonlySignedAccounts:it,numReadonlyUnsignedAccounts:st},accountKeys:lt,recentBlockhash:j,instructions:dt})}_compile(){const j=this.compileMessage(),$=j.accountKeys.slice(0,j.header.numRequiredSignatures);return this.signatures.length===$.length&&this.signatures.every((et,tt)=>$[tt].equals(et.publicKey))||(this.signatures=$.map(_e=>({signature:null,publicKey:_e}))),j}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(j){return(await j.getFeeForMessage(this.compileMessage())).value}setSigners(...j){if(j.length===0)throw new Error("No signers");const $=new Set;this.signatures=j.filter(_e=>{const et=_e.toString();return $.has(et)?!1:($.add(et),!0)}).map(_e=>({signature:null,publicKey:_e}))}sign(...j){if(j.length===0)throw new Error("No signers");const $=new Set,_e=[];for(const tt of j){const nt=tt.publicKey.toString();$.has(nt)||($.add(nt),_e.push(tt))}this.signatures=_e.map(tt=>({signature:null,publicKey:tt.publicKey}));const et=this._compile();this._partialSign(et,..._e)}partialSign(...j){if(j.length===0)throw new Error("No signers");const $=new Set,_e=[];for(const tt of j){const nt=tt.publicKey.toString();$.has(nt)||($.add(nt),_e.push(tt))}const et=this._compile();this._partialSign(et,..._e)}_partialSign(j,...$){const _e=j.serialize();$.forEach(et=>{const tt=sign(_e,et.secretKey);this._addSignature(et.publicKey,toBuffer(tt))})}addSignature(j,$){this._compile(),this._addSignature(j,$)}_addSignature(j,$){assert($.length===64);const _e=this.signatures.findIndex(et=>j.equals(et.publicKey));if(_e<0)throw new Error(`unknown signer: ${j.toString()}`);this.signatures[_e].signature=buffer.Buffer.from($)}verifySignatures(j=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),j)}_getMessageSignednessErrors(j,$){const _e={};for(const{signature:et,publicKey:tt}of this.signatures)et===null?$&&(_e.missing||(_e.missing=[])).push(tt):verify(et,j,tt.toBytes())||(_e.invalid||(_e.invalid=[])).push(tt);return _e.invalid||_e.missing?_e:void 0}serialize(j){const{requireAllSignatures:$,verifySignatures:_e}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},j),et=this.serializeMessage();if(_e){const tt=this._getMessageSignednessErrors(et,$);if(tt){let nt="Signature verification failed.";throw tt.invalid&&(nt+=` + ${s.palette.mode==="light"?lighten_1(alpha_1(s.palette.divider,1),.88):darken_1(alpha_1(s.palette.divider,1),.68)}`,textAlign:"left",padding:16},j.variant==="head"&&{color:(s.vars||s).palette.text.primary,lineHeight:s.typography.pxToRem(24),fontWeight:s.typography.fontWeightMedium},j.variant==="body"&&{color:(s.vars||s).palette.text.primary},j.variant==="footer"&&{color:(s.vars||s).palette.text.secondary,lineHeight:s.typography.pxToRem(21),fontSize:s.typography.pxToRem(12)},j.size==="small"&&{padding:"6px 16px",[`&.${tableCellClasses.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},j.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},j.padding==="none"&&{padding:0},j.align==="left"&&{textAlign:"left"},j.align==="center"&&{textAlign:"center"},j.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},j.align==="justify"&&{textAlign:"justify"},j.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(s.vars||s).palette.background.default})),TableCell=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableCell"}),{align:et="inherit",className:tt,component:nt,padding:rt,scope:ot,size:it,sortDirection:st,variant:at}=_e,ct=_objectWithoutPropertiesLoose(_e,_excluded$8),lt=reactExports.useContext(TableContext),dt=reactExports.useContext(Tablelvl2Context),ft=dt&&dt.variant==="head";let gt;nt?gt=nt:gt=ft?"th":"td";let ht=ot;gt==="td"?ht=void 0:!ht&&ft&&(ht="col");const yt=at||dt&&dt.variant,pt=_extends$2({},_e,{align:et,component:gt,padding:rt||(lt&<.padding?lt.padding:"normal"),size:it||(lt&<.size?lt.size:"medium"),sortDirection:st,stickyHeader:yt==="head"&<&<.stickyHeader,variant:yt}),Mt=useUtilityClasses$8(pt);let St=null;return st&&(St=st==="asc"?"ascending":"descending"),jsxRuntimeExports.jsx(TableCellRoot,_extends$2({as:gt,ref:$,className:clsx(Mt.root,tt),"aria-sort":St,scope:ht,ownerState:pt},ct))});function getTableContainerUtilityClass(s){return generateUtilityClass$1("MuiTableContainer",s)}generateUtilityClasses$1("MuiTableContainer",["root"]);const _excluded$7=["className","component"],useUtilityClasses$7=s=>{const{classes:j}=s;return composeClasses({root:["root"]},getTableContainerUtilityClass,j)},TableContainerRoot=styled("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(s,j)=>j.root})({width:"100%",overflowX:"auto"}),TableContainer=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableContainer"}),{className:et,component:tt="div"}=_e,nt=_objectWithoutPropertiesLoose(_e,_excluded$7),rt=_extends$2({},_e,{component:tt}),ot=useUtilityClasses$7(rt);return jsxRuntimeExports.jsx(TableContainerRoot,_extends$2({ref:$,as:tt,className:clsx(ot.root,et),ownerState:rt},nt))});function getTableFooterUtilityClass(s){return generateUtilityClass$1("MuiTableFooter",s)}generateUtilityClasses$1("MuiTableFooter",["root"]);const _excluded$6=["className","component"],useUtilityClasses$6=s=>{const{classes:j}=s;return composeClasses({root:["root"]},getTableFooterUtilityClass,j)},TableFooterRoot=styled("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(s,j)=>j.root})({display:"table-footer-group"}),tablelvl2$1={variant:"footer"},defaultComponent$2="tfoot",TableFooter=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableFooter"}),{className:et,component:tt=defaultComponent$2}=_e,nt=_objectWithoutPropertiesLoose(_e,_excluded$6),rt=_extends$2({},_e,{component:tt}),ot=useUtilityClasses$6(rt);return jsxRuntimeExports.jsx(Tablelvl2Context.Provider,{value:tablelvl2$1,children:jsxRuntimeExports.jsx(TableFooterRoot,_extends$2({as:tt,className:clsx(ot.root,et),ref:$,role:tt===defaultComponent$2?null:"rowgroup",ownerState:rt},nt))})});function getTableHeadUtilityClass(s){return generateUtilityClass$1("MuiTableHead",s)}generateUtilityClasses$1("MuiTableHead",["root"]);const _excluded$5=["className","component"],useUtilityClasses$5=s=>{const{classes:j}=s;return composeClasses({root:["root"]},getTableHeadUtilityClass,j)},TableHeadRoot=styled("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(s,j)=>j.root})({display:"table-header-group"}),tablelvl2={variant:"head"},defaultComponent$1="thead",TableHead=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableHead"}),{className:et,component:tt=defaultComponent$1}=_e,nt=_objectWithoutPropertiesLoose(_e,_excluded$5),rt=_extends$2({},_e,{component:tt}),ot=useUtilityClasses$5(rt);return jsxRuntimeExports.jsx(Tablelvl2Context.Provider,{value:tablelvl2,children:jsxRuntimeExports.jsx(TableHeadRoot,_extends$2({as:tt,className:clsx(ot.root,et),ref:$,role:tt===defaultComponent$1?null:"rowgroup",ownerState:rt},nt))})});function getToolbarUtilityClass(s){return generateUtilityClass$1("MuiToolbar",s)}generateUtilityClasses$1("MuiToolbar",["root","gutters","regular","dense"]);const _excluded$4=["className","component","disableGutters","variant"],useUtilityClasses$4=s=>{const{classes:j,disableGutters:$,variant:_e}=s;return composeClasses({root:["root",!$&&"gutters",_e]},getToolbarUtilityClass,j)},ToolbarRoot=styled("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,!$.disableGutters&&j.gutters,j[$.variant]]}})(({theme:s,ownerState:j})=>_extends$2({position:"relative",display:"flex",alignItems:"center"},!j.disableGutters&&{paddingLeft:s.spacing(2),paddingRight:s.spacing(2),[s.breakpoints.up("sm")]:{paddingLeft:s.spacing(3),paddingRight:s.spacing(3)}},j.variant==="dense"&&{minHeight:48}),({theme:s,ownerState:j})=>j.variant==="regular"&&s.mixins.toolbar),Toolbar=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiToolbar"}),{className:et,component:tt="div",disableGutters:nt=!1,variant:rt="regular"}=_e,ot=_objectWithoutPropertiesLoose(_e,_excluded$4),it=_extends$2({},_e,{component:tt,disableGutters:nt,variant:rt}),st=useUtilityClasses$4(it);return jsxRuntimeExports.jsx(ToolbarRoot,_extends$2({as:tt,className:clsx(st.root,et),ref:$,ownerState:it},ot))});function getTableRowUtilityClass(s){return generateUtilityClass$1("MuiTableRow",s)}const tableRowClasses=generateUtilityClasses$1("MuiTableRow",["root","selected","hover","head","footer"]),_excluded$3=["className","component","hover","selected"],useUtilityClasses$3=s=>{const{classes:j,selected:$,hover:_e,head:et,footer:tt}=s;return composeClasses({root:["root",$&&"selected",_e&&"hover",et&&"head",tt&&"footer"]},getTableRowUtilityClass,j)},TableRowRoot=styled("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,$.head&&j.head,$.footer&&j.footer]}})(({theme:s})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${tableRowClasses.hover}:hover`]:{backgroundColor:(s.vars||s).palette.action.hover},[`&.${tableRowClasses.selected}`]:{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / ${s.vars.palette.action.selectedOpacity})`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity),"&:hover":{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / calc(${s.vars.palette.action.selectedOpacity} + ${s.vars.palette.action.hoverOpacity}))`:alpha_1(s.palette.primary.main,s.palette.action.selectedOpacity+s.palette.action.hoverOpacity)}}})),defaultComponent="tr",TableRow=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTableRow"}),{className:et,component:tt=defaultComponent,hover:nt=!1,selected:rt=!1}=_e,ot=_objectWithoutPropertiesLoose(_e,_excluded$3),it=reactExports.useContext(Tablelvl2Context),st=_extends$2({},_e,{component:tt,hover:nt,selected:rt,head:it&&it.variant==="head",footer:it&&it.variant==="footer"}),at=useUtilityClasses$3(st);return jsxRuntimeExports.jsx(TableRowRoot,_extends$2({as:tt,ref:$,className:clsx(at.root,et),role:tt===defaultComponent?null:"row",ownerState:st},ot))});function getTextFieldUtilityClass(s){return generateUtilityClass$1("MuiTextField",s)}generateUtilityClasses$1("MuiTextField",["root"]);const _excluded$2=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],variantComponent={standard:Input,filled:FilledInput,outlined:OutlinedInput},useUtilityClasses$2=s=>{const{classes:j}=s;return composeClasses({root:["root"]},getTextFieldUtilityClass,j)},TextFieldRoot=styled(FormControl,{name:"MuiTextField",slot:"Root",overridesResolver:(s,j)=>j.root})({}),TextField=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiTextField"}),{autoComplete:et,autoFocus:tt=!1,children:nt,className:rt,color:ot="primary",defaultValue:it,disabled:st=!1,error:at=!1,FormHelperTextProps:ct,fullWidth:lt=!1,helperText:dt,id:ft,InputLabelProps:gt,inputProps:ht,InputProps:yt,inputRef:pt,label:Mt,maxRows:St,minRows:Tt,multiline:vt=!1,name:Dt,onBlur:zt,onChange:Ot,onFocus:Ft,placeholder:Pt,required:Lt=!1,rows:mt,select:xt=!1,SelectProps:It,type:jt,value:At,variant:wt="outlined"}=_e,Rt=_objectWithoutPropertiesLoose(_e,_excluded$2),Nt=_extends$2({},_e,{autoFocus:tt,color:ot,disabled:st,error:at,fullWidth:lt,multiline:vt,required:Lt,select:xt,variant:wt}),Ct=useUtilityClasses$2(Nt),Bt={};wt==="outlined"&&(gt&&typeof gt.shrink<"u"&&(Bt.notched=gt.shrink),Bt.label=Mt),xt&&((!It||!It.native)&&(Bt.id=void 0),Bt["aria-describedby"]=void 0);const Gt=useId(ft),Vt=dt&&Gt?`${Gt}-helper-text`:void 0,Yt=Mt&&Gt?`${Gt}-label`:void 0,Qt=variantComponent[wt],qt=jsxRuntimeExports.jsx(Qt,_extends$2({"aria-describedby":Vt,autoComplete:et,autoFocus:tt,defaultValue:it,fullWidth:lt,multiline:vt,name:Dt,rows:mt,maxRows:St,minRows:Tt,type:jt,value:At,id:Gt,inputRef:pt,onBlur:zt,onChange:Ot,onFocus:Ft,placeholder:Pt,inputProps:ht},Bt,yt));return jsxRuntimeExports.jsxs(TextFieldRoot,_extends$2({className:clsx(Ct.root,rt),disabled:st,error:at,fullWidth:lt,ref:$,required:Lt,color:ot,variant:wt,ownerState:Nt},Rt,{children:[Mt!=null&&Mt!==""&&jsxRuntimeExports.jsx(InputLabel,_extends$2({htmlFor:Gt,id:Yt},gt,{children:Mt})),xt?jsxRuntimeExports.jsx(Select,_extends$2({"aria-describedby":Vt,id:Gt,labelId:Yt,value:At,input:qt},It,{children:nt})):qt,dt&&jsxRuntimeExports.jsx(FormHelperText,_extends$2({id:Vt},ct,{children:dt}))]}))});function getToggleButtonUtilityClass(s){return generateUtilityClass$1("MuiToggleButton",s)}const toggleButtonClasses=generateUtilityClasses$1("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),ToggleButtonGroupContext=reactExports.createContext({}),ToggleButtonGroupButtonContext=reactExports.createContext(void 0);function isValueSelected(s,j){return j===void 0||s===void 0?!1:Array.isArray(j)?j.indexOf(s)>=0:s===j}const _excluded$1=["value"],_excluded2=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],useUtilityClasses$1=s=>{const{classes:j,fullWidth:$,selected:_e,disabled:et,size:tt,color:nt}=s,rt={root:["root",_e&&"selected",et&&"disabled",$&&"fullWidth",`size${capitalize$1(tt)}`,nt]};return composeClasses(rt,getToggleButtonUtilityClass,j)},ToggleButtonRoot=styled(ButtonBase,{name:"MuiToggleButton",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[j.root,j[`size${capitalize$1($.size)}`]]}})(({theme:s,ownerState:j})=>{let $=j.color==="standard"?s.palette.text.primary:s.palette[j.color].main,_e;return s.vars&&($=j.color==="standard"?s.vars.palette.text.primary:s.vars.palette[j.color].main,_e=j.color==="standard"?s.vars.palette.text.primaryChannel:s.vars.palette[j.color].mainChannel),_extends$2({},s.typography.button,{borderRadius:(s.vars||s).shape.borderRadius,padding:11,border:`1px solid ${(s.vars||s).palette.divider}`,color:(s.vars||s).palette.action.active},j.fullWidth&&{width:"100%"},{[`&.${toggleButtonClasses.disabled}`]:{color:(s.vars||s).palette.action.disabled,border:`1px solid ${(s.vars||s).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:s.vars?`rgba(${s.vars.palette.text.primaryChannel} / ${s.vars.palette.action.hoverOpacity})`:alpha$1(s.palette.text.primary,s.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${toggleButtonClasses.selected}`]:{color:$,backgroundColor:s.vars?`rgba(${_e} / ${s.vars.palette.action.selectedOpacity})`:alpha$1($,s.palette.action.selectedOpacity),"&:hover":{backgroundColor:s.vars?`rgba(${_e} / calc(${s.vars.palette.action.selectedOpacity} + ${s.vars.palette.action.hoverOpacity}))`:alpha$1($,s.palette.action.selectedOpacity+s.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:s.vars?`rgba(${_e} / ${s.vars.palette.action.selectedOpacity})`:alpha$1($,s.palette.action.selectedOpacity)}}}},j.size==="small"&&{padding:7,fontSize:s.typography.pxToRem(13)},j.size==="large"&&{padding:15,fontSize:s.typography.pxToRem(15)})}),ToggleButton=reactExports.forwardRef(function(j,$){const _e=reactExports.useContext(ToggleButtonGroupContext),{value:et}=_e,tt=_objectWithoutPropertiesLoose(_e,_excluded$1),nt=reactExports.useContext(ToggleButtonGroupButtonContext),rt=resolveProps(_extends$2({},tt,{selected:isValueSelected(j.value,et)}),j),ot=useThemeProps$5({props:rt,name:"MuiToggleButton"}),{children:it,className:st,color:at="standard",disabled:ct=!1,disableFocusRipple:lt=!1,fullWidth:dt=!1,onChange:ft,onClick:gt,selected:ht,size:yt="medium",value:pt}=ot,Mt=_objectWithoutPropertiesLoose(ot,_excluded2),St=_extends$2({},ot,{color:at,disabled:ct,disableFocusRipple:lt,fullWidth:dt,size:yt}),Tt=useUtilityClasses$1(St),vt=zt=>{gt&&(gt(zt,pt),zt.defaultPrevented)||ft&&ft(zt,pt)},Dt=nt||"";return jsxRuntimeExports.jsx(ToggleButtonRoot,_extends$2({className:clsx(tt.className,Tt.root,st,Dt),disabled:ct,focusRipple:!lt,ref:$,onClick:vt,onChange:ft,value:pt,ownerState:St,"aria-pressed":ht},Mt,{children:it}))});function getToggleButtonGroupUtilityClass(s){return generateUtilityClass$1("MuiToggleButtonGroup",s)}const toggleButtonGroupClasses=generateUtilityClasses$1("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),_excluded=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],useUtilityClasses=s=>{const{classes:j,orientation:$,fullWidth:_e,disabled:et}=s,tt={root:["root",$==="vertical"&&"vertical",_e&&"fullWidth"],grouped:["grouped",`grouped${capitalize$1($)}`,et&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return composeClasses(tt,getToggleButtonGroupUtilityClass,j)},ToggleButtonGroupRoot=styled("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(s,j)=>{const{ownerState:$}=s;return[{[`& .${toggleButtonGroupClasses.grouped}`]:j.grouped},{[`& .${toggleButtonGroupClasses.grouped}`]:j[`grouped${capitalize$1($.orientation)}`]},{[`& .${toggleButtonGroupClasses.firstButton}`]:j.firstButton},{[`& .${toggleButtonGroupClasses.lastButton}`]:j.lastButton},{[`& .${toggleButtonGroupClasses.middleButton}`]:j.middleButton},j.root,$.orientation==="vertical"&&j.vertical,$.fullWidth&&j.fullWidth]}})(({ownerState:s,theme:j})=>_extends$2({display:"inline-flex",borderRadius:(j.vars||j).shape.borderRadius},s.orientation==="vertical"&&{flexDirection:"column"},s.fullWidth&&{width:"100%"},{[`& .${toggleButtonGroupClasses.grouped}`]:_extends$2({},s.orientation==="horizontal"?{[`&.${toggleButtonGroupClasses.selected} + .${toggleButtonGroupClasses.grouped}.${toggleButtonGroupClasses.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${toggleButtonGroupClasses.selected} + .${toggleButtonGroupClasses.grouped}.${toggleButtonGroupClasses.selected}`]:{borderTop:0,marginTop:0}})},s.orientation==="horizontal"?{[`& .${toggleButtonGroupClasses.firstButton},& .${toggleButtonGroupClasses.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${toggleButtonGroupClasses.lastButton},& .${toggleButtonGroupClasses.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${toggleButtonGroupClasses.firstButton},& .${toggleButtonGroupClasses.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${toggleButtonGroupClasses.lastButton},& .${toggleButtonGroupClasses.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},s.orientation==="horizontal"?{[`& .${toggleButtonGroupClasses.lastButton}.${toggleButtonClasses.disabled},& .${toggleButtonGroupClasses.middleButton}.${toggleButtonClasses.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${toggleButtonGroupClasses.lastButton}.${toggleButtonClasses.disabled},& .${toggleButtonGroupClasses.middleButton}.${toggleButtonClasses.disabled}`]:{borderTop:"1px solid transparent"}})),ToggleButtonGroup=reactExports.forwardRef(function(j,$){const _e=useThemeProps$5({props:j,name:"MuiToggleButtonGroup"}),{children:et,className:tt,color:nt="standard",disabled:rt=!1,exclusive:ot=!1,fullWidth:it=!1,onChange:st,orientation:at="horizontal",size:ct="medium",value:lt}=_e,dt=_objectWithoutPropertiesLoose(_e,_excluded),ft=_extends$2({},_e,{disabled:rt,fullWidth:it,orientation:at,size:ct}),gt=useUtilityClasses(ft),ht=reactExports.useCallback((vt,Dt)=>{if(!st)return;const zt=lt&<.indexOf(Dt);let Ot;lt&&zt>=0?(Ot=lt.slice(),Ot.splice(zt,1)):Ot=lt?lt.concat(Dt):[Dt],st(vt,Ot)},[st,lt]),yt=reactExports.useCallback((vt,Dt)=>{st&&st(vt,lt===Dt?null:Dt)},[st,lt]),pt=reactExports.useMemo(()=>({className:gt.grouped,onChange:ot?yt:ht,value:lt,size:ct,fullWidth:it,color:nt,disabled:rt}),[gt.grouped,ot,yt,ht,lt,ct,it,nt,rt]),Mt=getValidReactChildren(et),St=Mt.length,Tt=vt=>{const Dt=vt===0,zt=vt===St-1;return Dt&&zt?"":Dt?gt.firstButton:zt?gt.lastButton:gt.middleButton};return jsxRuntimeExports.jsx(ToggleButtonGroupRoot,_extends$2({role:"group",className:clsx(gt.root,tt),ref:$,ownerState:ft},dt,{children:jsxRuntimeExports.jsx(ToggleButtonGroupContext.Provider,{value:pt,children:Mt.map((vt,Dt)=>jsxRuntimeExports.jsx(ToggleButtonGroupButtonContext.Provider,{value:Tt(Dt),children:vt},Dt))})}))});function isAbsolute(s){return s.charAt(0)==="/"}function spliceOne(s,j){for(var $=j,_e=$+1,et=s.length;_e=0;st--){var at=_e[st];at==="."?spliceOne(_e,st):at===".."?(spliceOne(_e,st),it++):it&&(spliceOne(_e,st),it--)}if(!nt)for(;it--;it)_e.unshift("..");nt&&_e[0]!==""&&(!_e[0]||!isAbsolute(_e[0]))&&_e.unshift("");var ct=_e.join("/");return rt&&ct.substr(-1)!=="/"&&(ct+="/"),ct}var prefix="Invariant failed";function invariant(s,j){throw new Error(prefix)}function addLeadingSlash$1(s){return s.charAt(0)==="/"?s:"/"+s}function stripLeadingSlash(s){return s.charAt(0)==="/"?s.substr(1):s}function hasBasename(s,j){return s.toLowerCase().indexOf(j.toLowerCase())===0&&"/?#".indexOf(s.charAt(j.length))!==-1}function stripBasename$1(s,j){return hasBasename(s,j)?s.substr(j.length):s}function stripTrailingSlash(s){return s.charAt(s.length-1)==="/"?s.slice(0,-1):s}function parsePath(s){var j=s||"/",$="",_e="",et=j.indexOf("#");et!==-1&&(_e=j.substr(et),j=j.substr(0,et));var tt=j.indexOf("?");return tt!==-1&&($=j.substr(tt),j=j.substr(0,tt)),{pathname:j,search:$==="?"?"":$,hash:_e==="#"?"":_e}}function createPath(s){var j=s.pathname,$=s.search,_e=s.hash,et=j||"/";return $&&$!=="?"&&(et+=$.charAt(0)==="?"?$:"?"+$),_e&&_e!=="#"&&(et+=_e.charAt(0)==="#"?_e:"#"+_e),et}function createLocation(s,j,$,_e){var et;typeof s=="string"?(et=parsePath(s),et.state=j):(et=_extends$2({},s),et.pathname===void 0&&(et.pathname=""),et.search?et.search.charAt(0)!=="?"&&(et.search="?"+et.search):et.search="",et.hash?et.hash.charAt(0)!=="#"&&(et.hash="#"+et.hash):et.hash="",j!==void 0&&et.state===void 0&&(et.state=j));try{et.pathname=decodeURI(et.pathname)}catch(tt){throw tt instanceof URIError?new URIError('Pathname "'+et.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):tt}return $&&(et.key=$),_e?et.pathname?et.pathname.charAt(0)!=="/"&&(et.pathname=resolvePathname(et.pathname,_e.pathname)):et.pathname=_e.pathname:et.pathname||(et.pathname="/"),et}function createTransitionManager(){var s=null;function j(nt){return s=nt,function(){s===nt&&(s=null)}}function $(nt,rt,ot,it){if(s!=null){var st=typeof s=="function"?s(nt,rt):s;typeof st=="string"?typeof ot=="function"?ot(st,it):it(!0):it(st!==!1)}else it(!0)}var _e=[];function et(nt){var rt=!0;function ot(){rt&&nt.apply(void 0,arguments)}return _e.push(ot),function(){rt=!1,_e=_e.filter(function(it){return it!==ot})}}function tt(){for(var nt=arguments.length,rt=new Array(nt),ot=0;otmt?xt.splice(mt,xt.length-mt,Ft):xt.push(Ft),st({action:Ot,location:Ft,index:mt,entries:xt})}})}function gt(Dt,zt){var Ot="REPLACE",Ft=createLocation(Dt,zt,at(),vt.location);it.confirmTransitionTo(Ft,Ot,$,function(Pt){Pt&&(vt.entries[vt.index]=Ft,st({action:Ot,location:Ft}))})}function ht(Dt){var zt=clamp(vt.index+Dt,0,vt.entries.length-1),Ot="POP",Ft=vt.entries[zt];it.confirmTransitionTo(Ft,Ot,$,function(Pt){Pt?st({action:Ot,location:Ft,index:zt}):st()})}function yt(){ht(-1)}function pt(){ht(1)}function Mt(Dt){var zt=vt.index+Dt;return zt>=0&&zt"u"&&(forwardRef=forwardRefShim);function isModifiedEvent(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}var LinkAnchor=forwardRef(function(s,j){var $=s.innerRef,_e=s.navigate,et=s.onClick,tt=_objectWithoutPropertiesLoose(s,["innerRef","navigate","onClick"]),nt=tt.target,rt=_extends$2({},tt,{onClick:function(it){try{et&&et(it)}catch(st){throw it.preventDefault(),st}!it.defaultPrevented&&it.button===0&&(!nt||nt==="_self")&&!isModifiedEvent(it)&&(it.preventDefault(),_e())}});return forwardRefShim!==forwardRef?rt.ref=j||$:rt.ref=$,React$1.createElement("a",rt)}),Link=forwardRef(function(s,j){var $=s.component,_e=$===void 0?LinkAnchor:$,et=s.replace,tt=s.to,nt=s.innerRef,rt=_objectWithoutPropertiesLoose(s,["component","replace","to","innerRef"]);return React$1.createElement(context.Consumer,null,function(ot){ot||invariant();var it=ot.history,st=normalizeToLocation(resolveToLocation(tt,ot.location),ot.location),at=st?it.createHref(st):"",ct=_extends$2({},rt,{href:at,navigate:function(){var dt=resolveToLocation(tt,ot.location),ft=createPath(ot.location)===createPath(normalizeToLocation(dt)),gt=et||ft?it.replace:it.push;gt(dt)}});return forwardRefShim!==forwardRef?ct.ref=j||nt:ct.innerRef=nt,React$1.createElement(_e,ct)})}),forwardRefShim$1=function(j){return j},forwardRef$1=React$1.forwardRef;typeof forwardRef$1>"u"&&(forwardRef$1=forwardRefShim$1);function joinClassnames(){for(var s=arguments.length,j=new Array(s),$=0;$s&&(s==="light"||s==="dark"||s==="auto"),isSettings=s=>s&&s.theme&&isTheme(s.theme);let localStorageSettings=null;try{const s=localStorage.getItem(STORAGE_KEY);if(s){const j=JSON.parse(s);isSettings(j)&&(localStorageSettings=j)}}catch{}const initialSettings=localStorageSettings||{theme:"auto"},saveSettings=s=>{try{localStorage.setItem(STORAGE_KEY,JSON.stringify(s))}catch{}},SettingsContext=React$1.createContext({settings:initialSettings,updateBackgroundOpacity:s=>{},updateBackgroundUrl:s=>{},updateTheme:s=>{},updateShowChainName:s=>{},updateShowAllMisses:s=>{},updateShowMonitorDetails:s=>{}}),SettingsContextProvider=({children:s})=>{const[j,$]=reactExports.useState(initialSettings),_e=reactExports.useCallback(st=>{$(at=>({...at,backgroundOpacity:st}))},[]),et=reactExports.useCallback(st=>{$(at=>({...at,backgroundUrl:st}))},[]),tt=reactExports.useCallback(st=>{$(at=>({...at,theme:st}))},[]),nt=reactExports.useCallback(st=>{$(at=>({...at,showChainName:st}))},[]),rt=reactExports.useCallback(st=>{$(at=>({...at,showAllMisses:st}))},[]),ot=reactExports.useCallback(st=>{$(at=>({...at,showMonitorDetails:st}))},[]);reactExports.useEffect(()=>{saveSettings(j)},[j]);const it=reactExports.useMemo(()=>({settings:j,updateBackgroundOpacity:_e,updateBackgroundUrl:et,updateTheme:tt,updateShowChainName:nt,updateShowAllMisses:rt,updateShowMonitorDetails:ot}),[j,_e,et,tt,nt,rt,ot]);return jsxRuntimeExports.jsx(SettingsContext.Provider,{value:it,children:s})},useSettingsContext=()=>reactExports.useContext(SettingsContext),mediaQueryList=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");function CustomThemeProvider({children:s}){const{settings:{theme:j,backgroundOpacity:$,backgroundUrl:_e}}=useSettingsContext(),[et,tt]=reactExports.useState(!!(mediaQueryList&&mediaQueryList.matches)),nt=reactExports.useCallback(it=>{tt(!!it.matches)},[]);reactExports.useEffect(()=>{if(j==="auto")return mediaQueryList.addEventListener("change",nt),()=>{mediaQueryList.removeEventListener("change",nt)}},[j,nt]);const rt=j==="dark"||j==="auto"&&et?"dark":"light",ot=reactExports.useMemo(()=>responsiveFontSizes(createTheme({palette:{mode:rt},components:{MuiCssBaseline:{styleOverrides:{body:{overflowY:"scroll"},"*":{scrollbarWidth:"thin",scrollbarColor:rt==="dark"?`${grey[700]} ${grey[900]}`:`${grey[400]} rgb(255,255,255)`},"*::-webkit-scrollbar":{width:"8px",height:"8px",backgroundColor:rt==="dark"?grey[900]:"rgb(255,255,255)"},"*::-webkit-scrollbar-thumb":{backgroundColor:rt==="dark"?grey[700]:grey[400],borderRadius:"4px"},"*::-webkit-scrollbar-corner":{backgroundColor:"transparent"}}}}})),[rt]);return jsxRuntimeExports.jsxs(ThemeProvider,{theme:ot,children:[s,_e&&jsxRuntimeExports.jsx(Box,{sx:{backgroundImage:`url(${_e})`,backgroundPosition:"center",backgroundSize:"cover",opacity:$||.1,position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:-1}})]})}const ArrowDownward=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z"}),"ArrowDownward"),ArrowUpward=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward"),CheckCircleOutline=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline"),Code=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),ContrastOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 22c5.52 0 10-4.48 10-10S17.52 2 12 2 2 6.48 2 12s4.48 10 10 10m1-17.93c3.94.49 7 3.85 7 7.93s-3.05 7.44-7 7.93z"}),"ContrastOutlined"),DarkModeOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkModeOutlined"),ErrorOutline=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline"),ExpandMore=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),FirstPage=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),GitHub=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub"),GridView=createSvgIcon(jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M3 3v8h8V3zm6 6H5V5h4zm-6 4v8h8v-8zm6 6H5v-4h4zm4-16v8h8V3zm6 6h-4V5h4zm-6 4v8h8v-8zm6 6h-4v-4h4z"}),"GridView"),InfoOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined"),KeyboardArrowDown=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),KeyboardArrowRight=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight"),LastPage=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Launch=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch"),LightModeOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightModeOutlined"),LinkIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),MonitorHeartOutlined=createSvgIcon([jsxRuntimeExports.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v3h2V6h16v3h2V6c0-1.1-.9-2-2-2m0 14H4v-3H2v3c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-3h-2z"},"0"),jsxRuntimeExports.jsx("path",{d:"M14.89 7.55c-.34-.68-1.45-.68-1.79 0L10 13.76l-1.11-2.21A.988.988 0 0 0 8 11H2v2h5.38l1.72 3.45c.18.34.52.55.9.55s.72-.21.89-.55L14 10.24l1.11 2.21c.17.34.51.55.89.55h6v-2h-5.38z"},"1")],"MonitorHeartOutlined"),NavigateBefore=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore"),NavigateNext=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),PlayCircleOutline=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"PlayCircleOutline"),ReceiptLongOutlined=createSvgIcon([jsxRuntimeExports.jsx("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM15 20H6c-.55 0-1-.45-1-1v-1h10zm4-1c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),jsxRuntimeExports.jsx("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLongOutlined"),Search=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),SettingsOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined"),SyncAltOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7.41 13.41 6 12l-4 4 4 4 1.41-1.41L5.83 17H21v-2H5.83zm9.18-2.82L18 12l4-4-4-4-1.41 1.41L18.17 7H3v2h15.17z"}),"SyncAltOutlined"),ViewList=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M3 14h4v-4H3zm0 5h4v-4H3zM3 9h4V5H3zm5 5h13v-4H8zm0 5h13v-4H8zM8 5v4h13V5z"}),"ViewList"),WarningAmberOutlined=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 5.99 19.53 19H4.47zM12 2 1 21h22zm1 14h-2v2h2zm0-6h-2v4h2z"}),"WarningAmberOutlined"),networks=["Mainnet","Testnet","Devnet"],isNetwork=s=>networks.includes(s),networks$1=Object.freeze(Object.defineProperty({__proto__:null,isNetwork,networks},Symbol.toStringTag,{value:"Module"})),range=s=>[...Array(s).keys()],elementIndexPairs=s=>range(s.length).map(j=>[s[j],j]),entries=s=>range(s.length).map(j=>[j,s[j]]),column=(s,j)=>s.map($=>$[j]),zip=s=>range(s[0].length).map(j=>range(s.length).map($=>s[$][j]));function isMappableKey(s){return["string","number","symbol","bigint","boolean"].includes(typeof s)}const isRecursiveTuple=s=>s.length===2&&!Array.isArray(s[0])&&Array.isArray(s[1]),cartesianRightRecursive=s=>s.length===0?[]:Array.isArray(s[0])?s.map(([j,$])=>Array.isArray($)?(isRecursiveTuple($)?cartesianRightRecursive($):$).map(_e=>[j,_e].flat()):[[j,$]]).flat():isRecursiveTuple(s)?cartesianRightRecursive(s[1]).map(j=>[s[0],j]):s,toMapping=(s,j)=>{const $=cartesianRightRecursive(s);if($.length===0)throw new Error("Invalid mapping: empty");const _e=j===void 0?[range($[0].length-1),[$[0].length-1]]:j.map(ct=>typeof ct=="number"?[ct]:ct);let et=[],tt=!0;const nt=(ct,lt)=>{const dt=Array.from(new Set(ct[0]).values()),ft=new Map(dt.map(ht=>[ht,[]]));for(const[ht,yt]of ct[0].entries())ft.get(yt).push(ht);if(ct.length===1){const ht=Object.fromEntries(dt.map(yt=>[yt,ft.get(yt).map(pt=>lt[pt].length===1?lt[pt][0]:lt[pt])]));if(tt){for(const yt of ft.values())if(yt.length>1)return tt=!1,ht;et.push(ht)}return ht}const gt=zip(ct.slice(1));return Object.fromEntries(dt.map(ht=>{const yt=ft.get(ht),pt=zip(yt.map(St=>gt[St])),Mt=yt.map(St=>lt[St]);return[ht,nt(pt,Mt)]}))},rt=zip($),ot=ct=>{const lt=rt[ct];if(lt===void 0)throw new Error(`Invalid shape: column ${ct} does not exist`);return lt},[it,st]=_e.map(ct=>ct.map(lt=>ot(lt)));if(it.length===0)throw new Error("Invalid shape: empty key set");if(st.length===0)throw new Error("Invalid shape: empty value set");for(const ct of it)for(const lt of ct)if(!isMappableKey(lt))throw new Error(`Invalid key: ${lt} in ${ct}`);const at=nt(it,zip(st));if(tt)for(const ct of et)for(const lt of Object.keys(ct))ct[lt]=ct[lt][0];return at};function constMap(s,j){const $=toMapping(s,j),_e=(...et)=>et.reduce((tt,nt)=>tt?tt[nt.toString()]??void 0:void 0,$);return Object.assign(_e,{has:(...et)=>_e(...et)!==void 0,get:(...et)=>_e(...et),subMap:et=>$[et.toString()]})}function lazyInstantiate$1(s){let j=null;return()=>(j||(j=s()),j)}function onlyOnce$1(s,...j){let $=!1;return()=>{$||($=!0,s(...j))}}function throws$1(s){try{return s(),!1}catch{return!0}}const binaryLiterals=["int","uint","bytes","array","switch"],defaultEndianness="big",numberMaxSize=6,isNumType=s=>typeof s=="number"||typeof s=="bigint",isBytesType=s=>s instanceof Uint8Array,isPrimitiveType=s=>isNumType(s)||isBytesType(s),isLayoutItem=s=>binaryLiterals.includes(s==null?void 0:s.binary),isLayout=s=>isLayoutItem(s)||Array.isArray(s)&&s.every(isLayoutItem),isFixedNumberConversion=s=>typeof(s==null?void 0:s.from)=="number",isFixedBigintConversion=s=>typeof(s==null?void 0:s.from)=="bigint",isFixedUintConversion=s=>isFixedNumberConversion(s)||isFixedBigintConversion(s),isFixedBytesConversion=s=>isBytesType(s==null?void 0:s.from),isFixedPrimitiveConversion=s=>isFixedUintConversion(s)||isFixedBytesConversion(s),customizableBytes=(s,j)=>({...s,binary:"bytes",...j===void 0?{}:isLayout(j)?{layout:j}:j instanceof Uint8Array||isFixedBytesConversion(j)||!Array.isArray(j)?{custom:j}:{layout:j[0],custom:j[1]}}),checkSize=(s,j)=>{if(s!==j)throw new Error(`size mismatch: layout size: ${s}, data size: ${j}`);return j},checkItemSize=(s,j)=>"size"in s&&s.size!==void 0?checkSize(s.size,j):j,checkNumEquals=(s,j)=>{if(s!=j)throw new Error(`value mismatch: (constant) layout value: ${s}, data value: ${j}`)},checkBytesTypeEqual=(s,j,$)=>{const _e=(it,st)=>st===void 0?[0,it.length]:Array.isArray(st)?st:[st,it.length],[et,tt]=_e(s,$==null?void 0:$.customSlice),[nt,rt]=_e(j,$==null?void 0:$.dataSlize),ot=tt-et;checkSize(ot,rt-nt);for(let it=0;it(Array.isArray(_e)?_e[1]:_e)==$)}function calcItemSize$1(s,j){switch(s.binary){case"int":case"uint":return s.size;case"bytes":{const $="lengthSize"in s?s.lengthSize|0:0;if("layout"in s){const{custom:et}=s,tt=internalCalcLayoutSize$1(s.layout,et===void 0?j:typeof et.from=="function"?et.from(j):et.from);return tt===null?"size"in s?s.size??null:null:$+checkItemSize(s,tt)}const{custom:_e}=s;return isBytesType(_e)?$+_e.length:isFixedBytesConversion(_e)?$+_e.from.length:_e===void 0?j?$+checkItemSize(s,j.length):null:j!==void 0?$+checkItemSize(s,_e.from(j).length):null}case"array":{const $="length"in s?s.length:void 0;if(j===void 0){if($!==void 0){const et=internalCalcLayoutSize$1(s.layout);return et===null?null:$*et}return null}let _e=0;if($!==void 0&&$!==j.length)throw new Error(`array length mismatch: layout length: ${$}, data length: ${j.length}`);"lengthSize"in s&&s.lengthSize!==void 0&&(_e+=s.lengthSize);for(let et=0;et{s.bytes.set(j,s.offset),s.offset+=j.length};function serializeLayout$1(s,j,$,_e=0){const et={bytes:$??new Uint8Array(calcLayoutSize$1(s,j)),offset:_e};if(internalSerializeLayout$1(s,j,et),!$&&et.offset!==et.bytes.length)throw new Error(`encoded data is shorter than expected: ${et.bytes.length} > ${et.offset}`);return $?et.offset:et.bytes}const maxAllowedNumberVal$1=2**(numberMaxSize*8);function serializeNum$1(s,j,$,_e=defaultEndianness,et=!1){if(!et&&s<0)throw new Error(`Value ${s} is negative but unsigned`);if(typeof s=="number"){if(!Number.isInteger(s))throw new Error(`Value ${s} is not an integer`);if(j>numberMaxSize){if(s>=maxAllowedNumberVal$1)throw new Error(`Value ${s} is too large to be safely converted into an integer`);if(et&&s<=-maxAllowedNumberVal$1)throw new Error(`Value ${s} is too small to be safely converted into an integer`)}}const tt=2n**BigInt(j*8);if(s>=tt)throw new Error(`Value ${s} is too large for ${j} bytes`);if(et&&s<-tt)throw new Error(`Value ${s} is too small for ${j} bytes`);for(let nt=0;nt>BigInt(8*(_e==="big"?j-nt-1:nt))&0xffn);$.offset+=j}function internalSerializeLayout$1(s,j,$){if(isLayoutItem(s))serializeLayoutItem$1(s,j,$);else for(const _e of s)try{serializeLayoutItem$1(_e,j[_e.name],$)}catch(et){throw et.message=`when serializing item '${_e.name}': ${et.message}`,et}}function serializeLayoutItem$1(s,j,$){switch(s.binary){case"int":case"uint":{const _e=(()=>{var et;return isNumType(s.custom)?("omit"in s&&s.omit||checkNumEquals(s.custom,j),s.custom):isNumType((et=s==null?void 0:s.custom)==null?void 0:et.from)?s.custom.from:s.custom!==void 0?s.custom.from(j):j})();serializeNum$1(_e,s.size,$,s.endianness,s.binary==="int");break}case"bytes":{const _e=$.offset;if("lengthSize"in s&&s.lengthSize!==void 0&&($.offset+=s.lengthSize),"layout"in s){const{custom:et}=s;let tt;et===void 0?tt=j:typeof et.from!="function"?tt=et.from:tt=et.from(j),internalSerializeLayout$1(s.layout,tt,$)}else{const{custom:et}=s;isBytesType(et)?("omit"in s&&s.omit||checkBytesTypeEqual(et,j),cursorWrite$1($,et)):isFixedBytesConversion(et)?cursorWrite$1($,et.from):cursorWrite$1($,et!==void 0?et.from(j):j)}if("lengthSize"in s&&s.lengthSize!==void 0){const et=$.offset-_e-s.lengthSize,tt=$.offset;$.offset=_e,serializeNum$1(et,s.lengthSize,$,s.lengthEndianness),$.offset=tt}else checkItemSize(s,$.offset-_e);break}case"array":{if("length"in s&&s.length!==j.length)throw new Error(`array length mismatch: layout length: ${s.length}, data length: ${j.length}`);"lengthSize"in s&&s.lengthSize!==void 0&&serializeNum$1(j.length,s.lengthSize,$,s.lengthEndianness);for(let _e=0;_e ${_e.offset}`);return($==null?void 0:$.consumeAll)??!0?et:[et,_e.offset]}function updateOffset$1(s,j){const $=s.offset+j;if($>s.end)throw new Error(`chunk is shorter than expected: ${s.end} < ${$}`);s.offset=$}function internalDeserializeLayout$1(s,j){if(!Array.isArray(s))return deserializeLayoutItem$1(s,j);let $={};for(const _e of s)try{(_e.omit?{}:$)[_e.name]=deserializeLayoutItem$1(_e,j)}catch(et){throw et.message=`when deserializing item '${_e.name}': ${et.message}`,et}return $}function deserializeNum$1(s,j,$=defaultEndianness,_e=!1){let et=0n;for(let tt=0;ttnumberMaxSize?et:Number(et)}function deserializeLayoutItem$1(s,j){switch(s.binary){case"int":case"uint":{const $=deserializeNum$1(j,s.size,s.endianness,s.binary==="int"),{custom:_e}=s;return isNumType(_e)?(checkNumEquals(_e,$),_e):isNumType(_e==null?void 0:_e.from)?(checkNumEquals(_e.from,$),_e.to):_e!==void 0?_e.to($):$}case"bytes":{const $="lengthSize"in s&&s.lengthSize!==void 0?deserializeNum$1(j,s.lengthSize,s.lengthEndianness):s==null?void 0:s.size;if("layout"in s){const{custom:rt}=s,ot=j.offset;let it;if($===void 0)it=internalDeserializeLayout$1(s.layout,j);else{const st={...j,end:j.offset+$};if(updateOffset$1(j,$),it=internalDeserializeLayout$1(s.layout,st),st.offset!==st.end)throw new Error(`read less data than expected: ${st.offset-j.offset} < ${$}`)}return rt!==void 0?typeof rt.from!="function"?(checkBytesTypeEqual(getCachedSerializedFrom$1(s),j.bytes,{dataSlize:[ot,j.offset]}),rt.to):rt.to(it):it}const{custom:_e}=s;{let rt,ot;if(isBytesType(_e)?rt=_e:isFixedBytesConversion(_e)&&(rt=_e.from,ot=_e.to),rt!==void 0){const it=$??rt.length,st=j.bytes.slice(j.offset,j.offset+it);return checkBytesTypeEqual(rt,st),updateOffset$1(j,it),ot??rt}}const et=j.offset,tt=$!==void 0?j.offset+$:j.end;updateOffset$1(j,tt-et);const nt=j.bytes.slice(et,tt);return _e!==void 0?_e.to(nt):nt}case"array":{let $=[];const{layout:_e}=s,et=()=>{const nt=internalDeserializeLayout$1(_e,j);$.push(nt)};let tt=null;if("length"in s&&s.length!==void 0?tt=s.length:"lengthSize"in s&&s.lengthSize!==void 0&&(tt=deserializeNum$1(j,s.lengthSize,s.lengthEndianness)),tt!==null)for(let nt=0;ntet?it===$:it[0]===$);if(tt===void 0)throw new Error(`unknown id value: ${$}`);const[nt,rt]=tt,ot=internalDeserializeLayout$1(rt,j);return{[s.idTag??"id"]:et?$:nt[1],...ot}}}}function filterItem$1(s,j){switch(s.binary){case"bytes":if("layout"in s){const{custom:$}=s;if($===void 0){const{layout:et}=s;if(isLayoutItem(et))return filterItem$1(et,j);const tt=internalFilterItemsOfProperLayout$1(et,j);return tt.length>0?{...s,layout:tt}:null}const _e=typeof $.from!="function";return j&&_e||!j&&!_e?s:null}case"int":case"uint":{const{custom:$}=s,_e=isPrimitiveType($)||isFixedPrimitiveConversion($);return j&&_e||!j&&!_e?s:null}case"array":{const $=internalFilterItemsOfLayout$1(s.layout,j);return $!==null?{...s,layout:$}:null}case"switch":{const $=s.layouts.reduce((_e,[et,tt])=>{const nt=internalFilterItemsOfProperLayout$1(tt,j);return nt.length>0?[..._e,[et,nt]]:_e},[]);return{...s,layouts:$}}}}function internalFilterItemsOfProperLayout$1(s,j){return s.reduce(($,_e)=>{const et=filterItem$1(_e,j);return et!==null?[...$,et]:$},[])}function internalFilterItemsOfLayout$1(s,j){return Array.isArray(s)?internalFilterItemsOfProperLayout$1(s,j):filterItem$1(s,j)}function filterItemsOfLayout$1(s,j){return internalFilterItemsOfLayout$1(s,j)}const fixedItemsOfLayout$1=s=>filterItemsOfLayout$1(s,!0),dynamicItemsOfLayout$1=s=>filterItemsOfLayout$1(s,!1);function internalAddFixedValuesItem$1(s,j){switch(s.binary){case"bytes":if("layout"in s){const{custom:$}=s;return $===void 0||typeof $.from!="function"?internalAddFixedValues$1(s.layout,$?$.from:j):j}case"int":case"uint":{const{custom:$}=s;return s!=null&&s.omit?void 0:isPrimitiveType($)?$:isFixedPrimitiveConversion($)?$.to:j}case"array":return Array.isArray(j)?j.map($=>internalAddFixedValues$1(s.layout,$)):void 0;case"switch":{const $=j[s.idTag??"id"],[_e,et]=s.layouts.find(([tt])=>(Array.isArray(tt)?tt[1]:tt)==$);return{[s.idTag??"id"]:$,...internalAddFixedValues$1(et,j)}}}}function internalAddFixedValues$1(s,j){if(j=j??{},isLayoutItem(s))return internalAddFixedValuesItem$1(s,j);const $={};for(const _e of s){const et=internalAddFixedValuesItem$1(_e,j[_e.name]??{});et!==void 0&&($[_e.name]=et)}return $}function addFixedValues$1(s,j){return internalAddFixedValues$1(s,j)}function arrayToBitset$1(s){return s.reduce((j,$)=>j|BigInt(1)<0n;s>>=1n,++$)s&1n&&j.push(Number($));return j}function count$2(s){let j=0;for(;s>0n;s>>=1n)j+=Number(s&1n);return j}const lengthSizeMax$1=s=>s>0?2**(8*s)-1:1/0;function layoutItemMeta$1(s,j,$){var _e;switch(s.binary){case"int":case"uint":{const et=isNumType(s.custom)?s.custom:isNumType((_e=s==null?void 0:s.custom)==null?void 0:_e.from)?s.custom.from:null;if(et!==null&&j!==null){const tt={bytes:new Uint8Array(s.size),offset:0};serializeNum$1(et,s.size,tt,s.endianness,s.binary==="int"),$.push([j,tt.bytes])}return[s.size,s.size]}case"bytes":{const et="lengthSize"in s?s.lengthSize|0:0;let tt,nt;if("layout"in s){const{custom:ot}=s;if(ot!==void 0&&typeof ot.from!="function")tt=getCachedSerializedFrom$1(s),nt=tt.length;else{const it=calcStaticLayoutSize$1(s.layout);it!==null&&(nt=it)}}else{const{custom:ot}=s;isBytesType(ot)?(tt=ot,nt=ot.length):isFixedBytesConversion(ot)&&(tt=ot.from,nt=ot.from.length)}if(et>0&&j!==null){if(nt!==void 0){const ot={bytes:new Uint8Array(et),offset:0},it=s.lengthEndianness;serializeNum$1(nt,et,ot,it,!1),$.push([j,ot.bytes])}j+=et}if(tt!==void 0)return j!==null&&$.push([j,tt]),[et+tt.length,et+tt.length];const rt="size"in s&&s.size!==void 0?[s.size,s.size]:void 0;if("layout"in s){const ot=createLayoutMeta$1(s.layout,j,$);return rt??[et+ot[0],et+ot[1]]}return rt??[et,lengthSizeMax$1(et)]}case"array":{if("length"in s){let tt=[];const nt=createLayoutMeta$1(s.layout,0,tt);if(j!==null)if(nt[0]!==nt[1]){if(s.length>0)for(const[rt,ot]of tt)$.push([j+rt,ot])}else for(let rt=0;rt[]),{idSize:tt,idEndianness:nt}=s,rt=s.layouts.map(([ot,it],st)=>{const at=Array.isArray(ot)?ot[0]:ot;if(j!==null){const lt={bytes:new Uint8Array(tt),offset:0};serializeNum$1(at,tt,lt,nt),et[st].push([0,lt.bytes])}const ct=createLayoutMeta$1(it,j!==null?tt:null,et[st]);return[ct[0]+tt,ct[1]+tt]});return j!==null&&et.every(ot=>ot.length>0)&&(()=>{const ot=Math.min(...et.map(st=>st.at(-1)[0]+st.at(-1)[1].length)),it=et.map(st=>0);for(let st=0;stot)),Math.max(...rt.map(([ot,it])=>it))]}}}function createLayoutMeta$1(s,j,$){if(!Array.isArray(s))return layoutItemMeta$1(s,j,$);let _e=[0,0];for(const et of s){const tt=layoutItemMeta$1(et,j,$);_e[0]+=tt[0],_e[1]+=tt[1],j!==null&&(j=tt[0]===tt[1]?j+tt[0]:null)}return _e}function buildAscendingBounds$1(s){const j=new Map;let $=[];const _e=et=>{for(;$.length>0&&$[0][0]tt<=rt);nt===-1?$=[]:$.splice(0,nt),j.set(tt,arrayToBitset$1($.map(([,rt])=>rt)))}};for(const[[et,tt],nt]of s){_e(et);const rt=$.findIndex(([ot])=>ot>tt);rt===-1?$.push([tt,nt]):$.splice(rt,0,[tt,nt]),j.set(et,arrayToBitset$1($.map(([,ot])=>ot)))}return _e(1/0),j}function generateLayoutDiscriminator$1(s){if(s.length===0)throw new Error("Cannot discriminate empty set of layouts");const j=0n,$=(1n<[]),et=s.map((pt,Mt)=>createLayoutMeta$1(pt,0,_e[Mt])),tt=et.map((pt,Mt)=>[pt,Mt]).sort(([[pt]],[[Mt]])=>pt-Mt),nt=(()=>{let pt=$;const Mt=new Map;for(const[[St],Tt]of tt)pt^=1n<count$2(pt))),it=pt=>{let Mt=$;for(const[St,Tt]of nt){if(pt{let Mt=j;for(const[St,Tt]of rt){if(ptpt.length>0?pt.at(-1)[0]+pt.at(-1)[1].length:0))}).map(()=>[]);for(let pt=0;pt<_e.length;++pt)for(const[Mt,St]of _e[pt])for(let Tt=0;TtOt)),vt=$^St,Dt=new Map;for(const[Ot,Ft]of Mt)Dt.has(Ot)||Dt.set(Ot,j),Dt.set(Ot,Dt.get(Ot)|1n<bitsetToArray$1(Ot.length<=pt?vt:Dt.get(Ot[pt])??j)];ct.push([zt,pt,vt,Dt,Tt])}}if(ot===s.length-1)return[!0,pt=>bitsetToArray$1(st(pt.length))];ct.sort(([pt],[Mt])=>Mt-pt);let lt=!0;const dt=new Map,ft=new Map,gt=(pt,Mt)=>{dt.set(pt,Mt),ft.has(count$2(pt))||ft.set(count$2(pt),[]),ft.get(count$2(pt)).push(pt)},ht=(pt,Mt)=>{if(count$2(pt)<=1||dt.has(pt))return;let St=0;const Tt=new Map;for(const Dt of bitsetToArray$1(pt)){const zt=et[Dt][0],Ot=rt.get(zt)&pt;Tt.set(zt,Ot),St=Math.max(St,count$2(Ot))}St=count$2(pt)-St;const vt=[];for(const[Dt,zt,Ot,Ft,Pt]of Mt){const Lt=new Map;let mt=0;for(const[jt,At]of Ft){const wt=At&pt;count$2(wt)>0&&(Lt.set(jt,wt),mt+=count$2(wt))}const xt=Ot&pt;let It=Lt.size>0?Dt:0;for(const jt of Lt.values()){const At=mt-count$2(jt)+count$2(xt);It=Math.min(It,At)}if(It!==0){if(It===count$2(pt)-1){gt(pt,[zt,xt,Lt]);return}vt.push([It,zt,xt,Lt,Pt&pt])}}if(St===count$2(pt)-1){gt(pt,"size");return}if(vt.sort(([Dt],[zt])=>zt-Dt),vt.length>0&&vt[0][0]>=St){const[,Dt,zt,Ot,Ft]=vt[0];gt(pt,[Dt,zt,Ot]),ht(zt,vt);for(const Pt of Ot.values())ht(Pt|Ft,vt.slice(1));return}if(St>0){gt(pt,"size");for(const Dt of Tt.values())ht(Dt,vt);return}gt(pt,"indistinguishable"),lt=!1};ht($,ct);const yt=pt=>{for(let Mt=count$2(pt)+1;Mt{let Mt=$,St=dt.get(Mt);for(;St!=="indistinguishable";){if(St==="size")Mt&=st(pt.length);else{const[Tt,vt,Dt]=St;if(pt.length<=Tt)Mt&=vt;else{const zt=pt[Tt];for(const[Ot,Ft]of Dt)Ot!==zt&&(Mt^=Mt&Ft);Mt^=Mt&vt}}if(count$2(Mt)<=1)break;St=dt.get(Mt)??yt(Mt)}return bitsetToArray$1(Mt)}]}function layoutDiscriminator$1(s,j){const[$,_e]=generateLayoutDiscriminator$1(s);if(!$&&!j)throw new Error("Cannot uniquely distinguished the given layouts");return j?_e:et=>{const tt=_e(et);return tt.length===0?null:tt[0]}}function enumItem$1(s,j){const $=Object.fromEntries(s.map(([et,tt])=>[tt,et])),_e=Object.fromEntries(s);return{binary:"uint",size:(j==null?void 0:j.size)??1,endianness:(j==null?void 0:j.endianness)??"big",custom:{to:et=>{const tt=$[et];if(tt===void 0)throw new Error(`Invalid enum value: ${et}`);return tt},from:et=>_e[et]}}}const baseOptionItem$1=s=>({binary:"switch",idSize:1,idTag:"isSome",layouts:[[[0,!1],[]],[[1,!0],[customizableBytes({name:"value"},s)]]]});function optionItem$1(s){return{binary:"bytes",layout:baseOptionItem$1(s),custom:{to:j=>j.isSome===!0?j.value:void 0,from:j=>j===void 0?{isSome:!1}:{isSome:!0,value:j}}}}function bitsetItem$1(s,j){return{binary:"uint",size:j??Math.ceil(s.length/8),custom:{to:$=>{const _e={};for(let et=0;et{let _e=0n;for(let et=0;etnumberMaxSize?_e:Number(_e)}}}}const index$1=Object.freeze(Object.defineProperty({__proto__:null,addFixedValues:addFixedValues$1,binaryLiterals,bitsetItem:bitsetItem$1,calcLayoutSize:calcLayoutSize$1,calcStaticLayoutSize:calcStaticLayoutSize$1,checkBytesTypeEqual,checkItemSize,checkNumEquals,checkSize,customizableBytes,defaultEndianness,deserializeLayout:deserializeLayout$1,dynamicItemsOfLayout:dynamicItemsOfLayout$1,enumItem:enumItem$1,findIdLayoutPair,fixedItemsOfLayout:fixedItemsOfLayout$1,getCachedSerializedFrom:getCachedSerializedFrom$1,isBytesType,isFixedBytesConversion,isFixedPrimitiveConversion,isFixedUintConversion,isLayout,isLayoutItem,isNumType,isPrimitiveType,layoutDiscriminator:layoutDiscriminator$1,numberMaxSize,optionItem:optionItem$1,serializeLayout:serializeLayout$1,serializeNum:serializeNum$1},Symbol.toStringTag,{value:"Module"}));function denoise$1(s,j){return Number(Number(s).toFixed(j))}function parse$2(s,j){if(validateAmountInput$1(s,j),s=s.toString(),s.includes("e"))throw new Error("Scientific notation is not supported yet by Amount");const $=s.split(".");if($.length>2)throw"Too many decimals";let[_e,et]=$.length===0?["0",""]:$.length===1?[$[0],""]:$;if(et=et.padEnd(j,"0"),et.length>j){if(BigInt(et.substring(j))!==0n)throw new Error("Amount: invalid input. Decimals too low.");et=et.substring(0,j)}return{amount:BigInt(_e+et).toString(),decimals:j}}function truncate$1(s,j){if(s.decimals<=j)return s;const $=BigInt(s.decimals-j);return{amount:(units$1(s)/10n**$*10n**$).toString(),decimals:s.decimals}}function scale$1(s,j){if(s.decimals===j)return s;if(s.amount==="0")return{amount:s.amount,decimals:j};const $=j-s.decimals;if($>0)return{amount:s.amount+"0".repeat($),decimals:j};if(BigInt(s.amount.substring(s.amount.length+$))===0n)return{amount:s.amount.substring(0,s.amount.length+$),decimals:j};throw new Error(`scaleAmount(${JSON.stringify(s)}, ${j}) would result in altered amount. Use truncateAmount first if you intended to truncate it.`)}function fromBaseUnits$1(s,j){return{amount:s.toString(),decimals:j}}function units$1(s){return validateAmount$1(s),BigInt(s.amount)}function display$1(s,j){validateAmount$1(s);let $=s.amount.substring(0,s.amount.length-s.decimals).padStart(1,"0"),_e=s.amount.substring(s.amount.length-s.decimals).padStart(s.decimals,"0");if(j!==void 0){for(;_e.length>j&&_e[_e.length-1]==="0";)_e=_e.substring(0,_e.length-1);_e=_e.padEnd(j,"0")}return _e.length>0?`${$}.${_e}`:$}function whole$1(s){return Number(display$1(s))}function fmt$1(s,j){return display$1(fromBaseUnits$1(s,j))}function validateAmountInput$1(s,j){if(typeof s=="number"){if(!isFinite(s))throw new Error("Amount: invalid input. Amount must be finite");if(s<0)throw new Error("Amount: invalid input. Amount cannot be negative")}else if(!/^[0-9\.]*$/.test(s))throw new Error("Amount: invalid input. Must only contain digits.");if(!isFinite(j))throw new Error("Amount: invalid input. Decimals must be finite")}function validateAmount$1(s){if(!/^[0-9]*$/.test(s.amount))throw new Error("Amount: invalid input. Must only contain digits.");if(s.decimals<0)throw new Error("Amount: invalid input. Decimals must be >= 0");if(!isFinite(s.decimals))throw new Error("Amount: invalid input. Decimals must be a finite number.")}const amount$2=Object.freeze(Object.defineProperty({__proto__:null,denoise:denoise$1,display:display$1,fmt:fmt$1,fromBaseUnits:fromBaseUnits$1,parse:parse$2,scale:scale$1,truncate:truncate$1,units:units$1,whole:whole$1},Symbol.toStringTag,{value:"Module"}));/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function assertNumber(s){if(!Number.isSafeInteger(s))throw new Error(`Wrong integer: ${s}`)}function isBytes$3(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function chain$2(...s){const j=tt=>tt,$=(tt,nt)=>rt=>tt(nt(rt)),_e=s.map(tt=>tt.encode).reduceRight($,j),et=s.map(tt=>tt.decode).reduce($,j);return{encode:_e,decode:et}}function alphabet(s){return{encode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return j.map($=>{if($<0||$>=s.length)throw new Error(`Digit index outside alphabet: ${$} (alphabet: ${s.length})`);return s[$]})},decode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="string")throw new Error("alphabet.decode input should be array of strings");return j.map($=>{if(typeof $!="string")throw new Error(`alphabet.decode: not string element=${$}`);const _e=s.indexOf($);if(_e===-1)throw new Error(`Unknown letter: "${$}". Allowed: ${s}`);return _e})}}}function join(s=""){if(typeof s!="string")throw new Error("join separator should be string");return{encode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="string")throw new Error("join.encode input should be array of strings");for(let $ of j)if(typeof $!="string")throw new Error(`join.encode: non-string input=${$}`);return j.join(s)},decode:j=>{if(typeof j!="string")throw new Error("join.decode input should be string");return j.split(s)}}}function padding(s,j="="){if(typeof j!="string")throw new Error("padding chr should be string");return{encode($){if(!Array.isArray($)||$.length&&typeof $[0]!="string")throw new Error("padding.encode input should be array of strings");for(let _e of $)if(typeof _e!="string")throw new Error(`padding.encode: non-string input=${_e}`);for(;$.length*s%8;)$.push(j);return $},decode($){if(!Array.isArray($)||$.length&&typeof $[0]!="string")throw new Error("padding.encode input should be array of strings");for(let et of $)if(typeof et!="string")throw new Error(`padding.decode: non-string input=${et}`);let _e=$.length;if(_e*s%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;_e>0&&$[_e-1]===j;_e--)if(!((_e-1)*s%8))throw new Error("Invalid padding: string has too much padding");return $.slice(0,_e)}}}function normalize(s){if(typeof s!="function")throw new Error("normalize fn should be function");return{encode:j=>j,decode:j=>s(j)}}function convertRadix(s,j,$){if(j<2)throw new Error(`convertRadix: wrong from=${j}, base cannot be less than 2`);if($<2)throw new Error(`convertRadix: wrong to=${$}, base cannot be less than 2`);if(!Array.isArray(s))throw new Error("convertRadix: data should be array");if(!s.length)return[];let _e=0;const et=[],tt=Array.from(s);for(tt.forEach(nt=>{if(nt<0||nt>=j)throw new Error(`Wrong integer: ${nt}`)});;){let nt=0,rt=!0;for(let ot=_e;otj?gcd(j,s%j):s,radix2carry=(s,j)=>s+(j-gcd(s,j));function convertRadix2(s,j,$,_e){if(!Array.isArray(s))throw new Error("convertRadix2: data should be array");if(j<=0||j>32)throw new Error(`convertRadix2: wrong from=${j}`);if($<=0||$>32)throw new Error(`convertRadix2: wrong to=${$}`);if(radix2carry(j,$)>32)throw new Error(`convertRadix2: carry overflow from=${j} to=${$} carryBits=${radix2carry(j,$)}`);let et=0,tt=0;const nt=2**$-1,rt=[];for(const ot of s){if(ot>=2**j)throw new Error(`convertRadix2: invalid data word=${ot} from=${j}`);if(et=et<32)throw new Error(`convertRadix2: carry overflow pos=${tt} from=${j}`);for(tt+=j;tt>=$;tt-=$)rt.push((et>>tt-$&nt)>>>0);et&=2**tt-1}if(et=et<<$-tt&nt,!_e&&tt>=j)throw new Error("Excess padding");if(!_e&&et)throw new Error(`Non-zero padding: ${et}`);return _e&&tt>0&&rt.push(et>>>0),rt}function radix(s){return{encode:j=>{if(!isBytes$3(j))throw new Error("radix.encode input should be Uint8Array");return convertRadix(Array.from(j),2**8,s)},decode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(convertRadix(j,s,2**8))}}}function radix2(s,j=!1){if(s<=0||s>32)throw new Error("radix2: bits should be in (0..32]");if(radix2carry(8,s)>32||radix2carry(s,8)>32)throw new Error("radix2: carry overflow");return{encode:$=>{if(!isBytes$3($))throw new Error("radix2.encode input should be Uint8Array");return convertRadix2(Array.from($),8,s,!j)},decode:$=>{if(!Array.isArray($)||$.length&&typeof $[0]!="number")throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(convertRadix2($,s,8,j))}}}function unsafeWrapper(s){if(typeof s!="function")throw new Error("unsafeWrapper fn should be function");return function(...j){try{return s.apply(null,j)}catch{}}}function checksum(s,j){if(typeof j!="function")throw new Error("checksum fn should be function");return{encode($){if(!isBytes$3($))throw new Error("checksum.encode: input should be Uint8Array");const _e=j($).slice(0,s),et=new Uint8Array($.length+s);return et.set($),et.set(_e,$.length),et},decode($){if(!isBytes$3($))throw new Error("checksum.decode: input should be Uint8Array");const _e=$.slice(0,-s),et=j(_e).slice(0,s),tt=$.slice(-s);for(let nt=0;nts.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),base64$2=chain$2(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),padding(6),join("")),base64nopad=chain$2(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),join("")),base64url=chain$2(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),padding(6),join("")),base64urlnopad=chain$2(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),join("")),genBase58=s=>chain$2(radix(58),alphabet(s),join("")),base58$1=genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),base58flickr=genBase58("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),base58xrp=genBase58("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),XMR_BLOCK_LEN=[0,2,3,5,6,7,9,10,11],base58xmr={encode(s){let j="";for(let $=0;$chain$2(checksum(4,j=>s(s(j))),base58$1),base58check=createBase58check,BECH_ALPHABET=chain$2(alphabet("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),join("")),POLYMOD_GENERATORS=[996825010,642813549,513874426,1027748829,705979059];function bech32Polymod(s){const j=s>>25;let $=(s&33554431)<<5;for(let _e=0;_e>_e&1)===1&&($^=POLYMOD_GENERATORS[_e]);return $}function bechChecksum(s,j,$=1){const _e=s.length;let et=1;for(let tt=0;tt<_e;tt++){const nt=s.charCodeAt(tt);if(nt<33||nt>126)throw new Error(`Invalid prefix (${s})`);et=bech32Polymod(et)^nt>>5}et=bech32Polymod(et);for(let tt=0;tt<_e;tt++)et=bech32Polymod(et)^s.charCodeAt(tt)&31;for(let tt of j)et=bech32Polymod(et)^tt;for(let tt=0;tt<6;tt++)et=bech32Polymod(et);return et^=$,BECH_ALPHABET.encode(convertRadix2([et%2**30],30,5,!1))}function genBech32(s){const j=s==="bech32"?1:734539939,$=radix2(5),_e=$.decode,et=$.encode,tt=unsafeWrapper(_e);function nt(st,at,ct=90){if(typeof st!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof st}`);if(!Array.isArray(at)||at.length&&typeof at[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof at}`);if(st.length===0)throw new TypeError(`Invalid prefix length ${st.length}`);const lt=st.length+7+at.length;if(ct!==!1&<>ct)throw new TypeError(`Length ${lt} exceeds limit ${ct}`);const dt=st.toLowerCase(),ft=bechChecksum(dt,at,j);return`${dt}1${BECH_ALPHABET.encode(at)}${ft}`}function rt(st,at=90){if(typeof st!="string")throw new Error(`bech32.decode input should be string, not ${typeof st}`);if(st.length<8||at!==!1&&st.length>at)throw new TypeError(`Wrong string length: ${st.length} (${st}). Expected (8..${at})`);const ct=st.toLowerCase();if(st!==ct&&st!==st.toUpperCase())throw new Error("String must be lowercase or uppercase");const lt=ct.lastIndexOf("1");if(lt===0||lt===-1)throw new Error('Letter "1" must be present between prefix and data only');const dt=ct.slice(0,lt),ft=ct.slice(lt+1);if(ft.length<6)throw new Error("Data must be at least 6 characters long");const gt=BECH_ALPHABET.decode(ft).slice(0,-6),ht=bechChecksum(dt,gt,j);if(!ft.endsWith(ht))throw new Error(`Invalid checksum in ${st}: expected "${ht}"`);return{prefix:dt,words:gt}}const ot=unsafeWrapper(rt);function it(st){const{prefix:at,words:ct}=rt(st,!1);return{prefix:at,words:ct,bytes:_e(ct)}}return{encode:nt,decode:rt,decodeToBytes:it,decodeUnsafe:ot,fromWords:_e,fromWordsUnsafe:tt,toWords:et}}const bech32=genBech32("bech32"),bech32m=genBech32("bech32m"),utf8$3={encode:s=>new TextDecoder().decode(s),decode:s=>new TextEncoder().encode(s)},hex$1=chain$2(radix2(4),alphabet("0123456789abcdef"),join(""),normalize(s=>{if(typeof s!="string"||s.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`);return s.toLowerCase()})),CODERS={utf8:utf8$3,hex:hex$1,base16,base32,base64:base64$2,base64url,base58:base58$1,base58xmr},coderTypeError="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",bytesToString=(s,j)=>{if(typeof s!="string"||!CODERS.hasOwnProperty(s))throw new TypeError(coderTypeError);if(!isBytes$3(j))throw new TypeError("bytesToString() expects Uint8Array");return CODERS[s].encode(j)},str=bytesToString,stringToBytes$1=(s,j)=>{if(!CODERS.hasOwnProperty(s))throw new TypeError(coderTypeError);if(typeof j!="string")throw new TypeError("stringToBytes() expects string");return CODERS[s].decode(j)},bytes$3=stringToBytes$1,esm$1=Object.freeze(Object.defineProperty({__proto__:null,assertNumber,base16,base32,base32crockford,base32hex,base58:base58$1,base58check,base58flickr,base58xmr,base58xrp,base64:base64$2,base64nopad,base64url,base64urlnopad,bech32,bech32m,bytes:bytes$3,bytesToString,createBase58check,hex:hex$1,str,stringToBytes:stringToBytes$1,utf8:utf8$3,utils:utils$8},Symbol.toStringTag,{value:"Module"})),stripPrefix=(s,j)=>j.startsWith(s)?j.slice(s.length):j,isHexRegex=/^(?:0x)?[0-9a-fA-F]+$/,hex={valid:s=>isHexRegex.test(s),decode:s=>base16.decode(stripPrefix("0x",s).toUpperCase()),encode:(s,j=!1)=>(s=typeof s=="string"?bytes$2.encode(s):s,(j?"0x":"")+base16.encode(s).toLowerCase())},isB64Regex=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,b64={valid:s=>isB64Regex.test(s),decode:base64$2.decode,encode:s=>base64$2.encode(typeof s=="string"?bytes$2.encode(s):s)},b58={decode:base58$1.decode,encode:s=>base58$1.encode(typeof s=="string"?bytes$2.encode(s):s)},bignum={decode:s=>(typeof s!="string"&&(s=hex.encode(s,!0)),s===""||s==="0x"?0n:BigInt(s)),encode:(s,j=!1)=>bignum.toString(s,j),toString:(s,j=!1)=>{let $=s.toString(16);return $=$.length%2===1?$="0"+$:$,j?"0x"+$:$},toBytes:(s,j)=>{typeof s=="number"&&(s=bignum.toBigInt(s));const $=hex.decode(bignum.toString(s));if(!j)return $;if(j<$.length)throw new Error(`Can't fit ${s} into ${j} bytes.`);return bytes$2.zpad($,j)},toNumber:s=>{if(s>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`Invalid cast: ${s} exceeds MAX_SAFE_INTEGER`);return Number(s)},toBigInt:s=>{if(s>Number.MAX_SAFE_INTEGER)throw new Error(`Invalid cast: ${s} exceeds MAX_SAFE_INTEGER`);return BigInt(s)}},bytes$2={encode:s=>new TextEncoder().encode(s),decode:s=>new TextDecoder().decode(s),equals:(s,j)=>s.length===j.length&&s.every(($,_e)=>$===j[_e]),zpad:(s,j,$=!0)=>$?bytes$2.concat(new Uint8Array(j-s.length),s):bytes$2.concat(s,new Uint8Array(j-s.length)),concat:(...s)=>{const j=s.reduce((et,tt)=>et+tt.length,0),$=new Uint8Array(j);let _e=0;return s.forEach(et=>{$.set(et,_e),_e+=et.length}),$}},encoding$3=Object.freeze(Object.defineProperty({__proto__:null,b58,b64,bech32,bignum,bytes:bytes$2,hex,stripPrefix},Symbol.toStringTag,{value:"Module"})),chainIdAndChainEntries=[[1,"Solana"],[2,"Ethereum"],[3,"Terra"],[4,"Bsc"],[5,"Polygon"],[6,"Avalanche"],[7,"Oasis"],[8,"Algorand"],[9,"Aurora"],[10,"Fantom"],[11,"Karura"],[12,"Acala"],[13,"Klaytn"],[14,"Celo"],[15,"Near"],[16,"Moonbeam"],[17,"Neon"],[18,"Terra2"],[19,"Injective"],[20,"Osmosis"],[21,"Sui"],[22,"Aptos"],[23,"Arbitrum"],[24,"Optimism"],[25,"Gnosis"],[26,"Pythnet"],[28,"Xpla"],[29,"Btc"],[30,"Base"],[32,"Sei"],[33,"Rootstock"],[34,"Scroll"],[35,"Mantle"],[36,"Blast"],[37,"Xlayer"],[38,"Linea"],[39,"Berachain"],[40,"Seievm"],[43,"Snaxchain"],[3104,"Wormchain"],[4e3,"Cosmoshub"],[4001,"Evmos"],[4002,"Kujira"],[4003,"Neutron"],[4004,"Celestia"],[4005,"Stargaze"],[4006,"Seda"],[4007,"Dymension"],[4008,"Provenance"],[10002,"Sepolia"],[10003,"ArbitrumSepolia"],[10004,"BaseSepolia"],[10005,"OptimismSepolia"],[10006,"Holesky"],[10007,"PolygonSepolia"]],[chainIds,chains]=zip(chainIdAndChainEntries),chainToChainId=constMap(chainIdAndChainEntries,[1,0]),chainIdToChain=constMap(chainIdAndChainEntries),isChain=s=>chainToChainId.has(s),isChainId=s=>chainIdToChain.has(s);function assertChainId(s){if(!isChainId(s))throw Error(`Unknown Wormhole chain id: ${s}`)}function assertChain(s){if(!isChain(s))throw Error(`Unknown Wormhole chain: ${s}`)}const asChainId=s=>(assertChainId(s),s),toChainId=s=>{switch(typeof s){case"string":if(isChain(s))return chainToChainId(s);break;case"number":if(isChainId(s))return s;break}throw Error(`Cannot convert to ChainId: ${s}`)},toChain=s=>{switch(typeof s){case"string":if(isChain(s))return s;break;case"number":if(isChainId(s))return chainIdToChain(s);break;case"bigint":if(isChainId(Number(s)))return chainIdToChain.get(Number(s));break}throw Error(`Cannot convert to Chain: ${s}`)},chains$1=Object.freeze(Object.defineProperty({__proto__:null,asChainId,assertChain,assertChainId,chainIdToChain,chainIds,chainToChainId,chains,isChain,isChainId,toChain,toChainId},Symbol.toStringTag,{value:"Module"})),platformAndChainsEntries=[["Evm",["Acala","Arbitrum","Aurora","Avalanche","Base","Bsc","Celo","Ethereum","Fantom","Gnosis","Karura","Klaytn","Moonbeam","Neon","Oasis","Optimism","Polygon","Rootstock","Sepolia","ArbitrumSepolia","BaseSepolia","OptimismSepolia","Holesky","PolygonSepolia","Mantle","Scroll","Blast","Xlayer","Linea","Berachain","Seievm","Snaxchain"]],["Solana",["Solana","Pythnet"]],["Cosmwasm",["Cosmoshub","Evmos","Injective","Kujira","Osmosis","Sei","Terra","Terra2","Wormchain","Xpla","Dymension","Neutron","Stargaze","Celestia","Seda","Provenance"]],["Btc",["Btc"]],["Algorand",["Algorand"]],["Sui",["Sui"]],["Aptos",["Aptos"]],["Near",["Near"]]],platforms=column(platformAndChainsEntries,0),platformToChains=constMap(platformAndChainsEntries),chainToPlatform=constMap(platformAndChainsEntries,[1,0]),isPlatform=s=>platformToChains.has(s),platformAddressFormatEntries=[["Evm","hex"],["Solana","base58"],["Cosmwasm","bech32"],["Btc","bech32"],["Algorand","algorandAppId"],["Sui","hex"],["Aptos","hex"],["Near","sha256"]],platformToAddressFormat=constMap(platformAddressFormatEntries),platforms$1=Object.freeze(Object.defineProperty({__proto__:null,chainToPlatform,isPlatform,platformToAddressFormat,platformToChains,platforms},Symbol.toStringTag,{value:"Module"})),filters={byAddress:(s,j)=>Object.values(s).find($=>isEqualCaseInsensitive($.address,j)),native:s=>filters.byAddress(s,"native"),bySymbol:(s,j)=>{const $=Object.values(s).filter(_e=>_e.symbol===j);return $&&$.length>0?$:void 0},byKey:(s,j)=>{const $=Object.entries(s).find(([_e])=>j===_e);return $?$[1]:void 0}},isEqualCaseInsensitive=(s,j)=>s.toLowerCase()===j.toLowerCase();var ConsistencyLevels;(function(s){s[s.Finalized=1]="Finalized",s[s.Immediate=200]="Immediate",s[s.Safe=201]="Safe"})(ConsistencyLevels||(ConsistencyLevels={}));const safeThresholds=[["Ethereum",32]],safeThreshold=constMap(safeThresholds),finalityThresholds=[["Solana",32],["Ethereum",64],["Bsc",15],["Optimism",512],["Base",512],["Arbitrum",4096],["Polygon",32],["Fantom",1],["Celo",1],["Moonbeam",1],["Karura",1],["Acala",1],["Oasis",1],["Avalanche",0],["Sui",0],["Algorand",0],["Aptos",0],["Klaytn",0],["Sei",0],["Near",0],["Osmosis",0],["Terra",0],["Terra2",0],["Xpla",0],["Injective",0],["Berachain",0],["Snaxchain",0],["Cosmoshub",0],["Evmos",0],["Kujira",0],["Neutron",0],["Celestia",0],["Stargaze",0],["Dymension",0],["Provenance",0]],finalityThreshold=constMap(finalityThresholds),blockTimeMilliseconds=[["Acala",12e3],["Algorand",3300],["Aptos",4e3],["Arbitrum",260],["ArbitrumSepolia",260],["Aurora",3e3],["Avalanche",2e3],["Base",2e3],["BaseSepolia",2e3],["Bsc",3e3],["Celo",5e3],["Cosmoshub",5e3],["Ethereum",15e3],["Evmos",2e3],["Fantom",2500],["Gnosis",5e3],["Holesky",15e3],["Injective",2500],["Karura",12e3],["Klaytn",1e3],["Kujira",3e3],["Moonbeam",12e3],["Near",1500],["Neon",3e4],["Oasis",6e3],["Optimism",2e3],["OptimismSepolia",2e3],["Osmosis",6e3],["Polygon",2e3],["PolygonSepolia",2e3],["Rootstock",3e4],["Sei",400],["Sepolia",15e3],["Solana",400],["Sui",3e3],["Scroll",4e3],["Mantle",2e3],["Terra",6e3],["Terra2",6e3],["Xpla",5e3],["Wormchain",5e3],["Btc",6e5],["Pythnet",400],["Dymension",5e3],["Celestia",5e3],["Neutron",5e3],["Stargaze",5e3],["Seda",7500]],blockTime=constMap(blockTimeMilliseconds);function consistencyLevelToBlock(s,j,$=0n){if(j===ConsistencyLevels.Immediate)return $;if(s==="Bsc")return $+BigInt(j);if(s==="Solana"&&j===0)return $;const _e=finalityThreshold.get(s);if(_e===void 0)throw new Error("Cannot find chain finality for "+s);if(_e===0)return $;if(j!==ConsistencyLevels.Safe)return $+BigInt(_e);const et=safeThreshold.get(s);if(et===void 0)throw new Error("Cannot find safe threshold for "+s);switch(s){case"Ethereum":const tt=$%BigInt(et),nt=tt===0n?0n:BigInt(et)-tt;return $+nt;default:throw new Error("Only Ethereum safe is supported for now")}}function estimateFinalityTime(s){const j=finalityThreshold.get(s);if(j===void 0)throw new Error("Cannot find finality for "+s);const $=blockTime.get(s);if($===void 0)throw new Error("Cannot find block time for "+s);return j*$}const finality=Object.freeze(Object.defineProperty({__proto__:null,get ConsistencyLevels(){return ConsistencyLevels},blockTime,consistencyLevelToBlock,estimateFinalityTime,finalityThreshold,safeThreshold},Symbol.toStringTag,{value:"Module"})),nativeDecimalEntries=[["Evm",18],["Solana",9],["Sui",9],["Aptos",8],["Cosmwasm",6],["Algorand",6],["Btc",8],["Near",12]],nativeDecimals=constMap(nativeDecimalEntries),decimals=Object.freeze(Object.defineProperty({__proto__:null,nativeDecimals},Symbol.toStringTag,{value:"Module"})),explorerConfig=[["Mainnet",[["Ethereum",{name:"Etherscan",baseUrl:"https://etherscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Solana",{name:"Solana Explorer",baseUrl:"https://explorer.solana.com/",endpoints:{tx:"tx/",account:"address/"}}],["Polygon",{name:"PolygonScan",baseUrl:"https://polygonscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Bsc",{name:"BscScan",baseUrl:"https://bscscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Avalanche",{name:"Snowtrace",baseUrl:"https://snowtrace.io/",endpoints:{tx:"tx/",account:"address/"}}],["Fantom",{name:"FTMscan",baseUrl:"https://ftmscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Celo",{name:"Celo Explorer",baseUrl:"https://explorer.celo.org/mainnet/",endpoints:{tx:"tx/",account:"address/"}}],["Moonbeam",{name:"Moonscan",baseUrl:"https://moonscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Sui",{name:"Sui Explorer",baseUrl:"https://explorer.sui.io/",endpoints:{tx:"txblock/",account:"address/"}}],["Aptos",{name:"Aptos Explorer",baseUrl:"https://explorer.aptoslabs.com/",endpoints:{tx:"txn/",account:"account/"}}],["Sei",{name:"Sei Explorer",baseUrl:"https://sei.explorers.guru/",endpoints:{tx:"transaction/",account:"address/"}}],["Karura",{name:"Karura Explorer",baseUrl:"https://blockscout.karura.network/",endpoints:{tx:"tx/",account:"address/"}}],["Acala",{name:"Acala Explorer",baseUrl:"https://blockscout.acala.network/",endpoints:{tx:"tx/",account:"address/"}}]]],["Testnet",[["Ethereum",{name:"Etherscan",baseUrl:"https://goerli.etherscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Polygon",{name:"PolygonScan",baseUrl:"https://mumbai.polygonscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Bsc",{name:"BscScan",baseUrl:"https://testnet.bscscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Avalanche",{name:"Snowtrace",baseUrl:"https://testnet.snowtrace.io/",endpoints:{tx:"tx/",account:"address/"}}],["Fantom",{name:"FTMscan",baseUrl:"https://testnet.ftmscan.com/",endpoints:{tx:"tx/",account:"address/"}}],["Celo",{name:"Celo Explorer",baseUrl:"https://explorer.celo.org/alfajores/",endpoints:{tx:"tx/",account:"address/"}}],["Moonbeam",{name:"Moonscan",baseUrl:"https://moonbase.moonscan.io/",endpoints:{tx:"tx/",account:"address/"}}],["Solana",{name:"Solana Explorer",baseUrl:"https://explorer.solana.com/",endpoints:{tx:"tx/",account:"address/"},networkQuery:{default:"Devnet",Testnet:"?cluster=testnet",Devnet:"?cluster=devnet"}}],["Sui",{name:"Sui Explorer",baseUrl:"https://explorer.sui.io/",endpoints:{tx:"txblock/",account:"address/"},networkQuery:{default:"Testnet",Testnet:"?network=testnet",Devnet:"?network=devnet"}}],["Aptos",{name:"Aptos Explorer",baseUrl:"https://explorer.aptoslabs.com/",endpoints:{tx:"txn/",account:"account/"},networkQuery:{default:"Testnet",Testnet:"?network=testnet",Devnet:"?network=devnet"}}],["Sei",{name:"Sei Explorer",baseUrl:"https://sei.explorers.guru/",endpoints:{tx:"transaction/",account:"address/"}}],["Karura",{name:"Karura Explorer",baseUrl:"https://blockscout.karura-testnet.aca-staging.network/",endpoints:{tx:"tx/",account:"address/"}}],["Acala",{name:"Acala Explorer",baseUrl:"https://blockscout.acala-dev.aca-dev.network/",endpoints:{tx:"tx/",account:"address/"}}]]]],explorerConfs=constMap(explorerConfig),explorerConfigs=(s,j)=>s==="Devnet"?void 0:explorerConfs.get(s,j);function linkToTx(s,j,$){const _e=explorerConfigs($,s);if(!_e)throw new Error("invalid chain, explorer config not found");const{baseUrl:et,endpoints:tt,networkQuery:nt}=_e,rt=nt?nt[$]:"";return`${et}${tt.tx}${j}${rt}`}function linkToAccount(s,j,$){const _e=explorerConfigs($,s);if(!_e)throw new Error("invalid chain, explorer config not found");const{baseUrl:et,endpoints:tt,networkQuery:nt}=_e,rt=nt?nt[$]:"";return`${et}${tt.account}${j}${rt}`}const explorer$1=Object.freeze(Object.defineProperty({__proto__:null,explorerConfigs,explorerConfs,linkToAccount,linkToTx},Symbol.toStringTag,{value:"Module"})),rpcConfig=[["Mainnet",[["Ethereum","https://rpc.ankr.com/eth"],["Solana","https://api.mainnet-beta.solana.com"],["Polygon","https://rpc.ankr.com/polygon"],["Bsc","https://bscrpc.com"],["Avalanche","https://rpc.ankr.com/avalanche"],["Fantom","https://rpc.ankr.com/fantom"],["Celo","https://rpc.ankr.com/celo"],["Moonbeam","https://rpc.ankr.com/moonbeam"],["Sui","https://rpc.mainnet.sui.io"],["Aptos","https://fullnode.mainnet.aptoslabs.com/v1"],["Arbitrum","https://arb1.arbitrum.io/rpc"],["Optimism","https://mainnet.optimism.io"],["Base","https://mainnet.base.org"],["Osmosis","https://osmosis-rpc.polkachu.com"],["Cosmoshub","https://cosmos-rpc.publicnode.com:443"],["Evmos","https://evmos-rpc.polkachu.com"],["Injective","https://sentry.tm.injective.network"],["Wormchain","https://wormchain-rpc.quickapi.com"],["Xpla","https://dimension-rpc.xpla.dev"],["Sei","https://sei-rpc.polkachu.com/"],["Algorand","https://mainnet-api.algonode.cloud"],["Terra","https://terra-classic-rpc.publicnode.com"],["Terra2","https://terra-rpc.polkachu.com"],["Karura","https://eth-rpc-karura.aca-api.network"],["Acala","https://eth-rpc-acala.aca-api.network"],["Oasis","https://emerald.oasis.dev"],["Dymension","https://dymension-rpc.polkachu.com/"],["Stargaze","https://stargaze-rpc.polkachu.com/"],["Celestia","https://celestia-rpc.polkachu.com/"],["Neutron","https://neutron-rpc.polkachu.com/"],["Blast","https://rpc.blast.io"],["Provenance","https://rpc.provenance.io/"],["Linea","https://rpc.linea.build"],["Scroll","https://rpc.ankr.com/scroll"],["Xlayer","https://xlayerrpc.okx.com/"],["Gnosis","https://rpc.ankr.com/gnosis"],["Rootstock","https://public-node.rsk.co"],["Mantle","https://rpc.mantle.xyz"]]],["Testnet",[["Ethereum","https://eth-goerli.public.blastapi.io"],["Polygon","https://rpc-mumbai.polygon.technology"],["Bsc","https://data-seed-prebsc-1-s3.binance.org:8545"],["Avalanche","https://api.avax-test.network/ext/bc/C/rpc"],["Fantom","https://rpc.ankr.com/fantom_testnet"],["Celo","https://alfajores-forno.celo-testnet.org"],["Solana","https://api.devnet.solana.com"],["Oasis","https://testnet.emerald.oasis.io"],["Moonbeam","https://rpc.api.moonbase.moonbeam.network"],["Sui","https://fullnode.testnet.sui.io"],["Aptos","https://fullnode.testnet.aptoslabs.com/v1"],["Sei","https://sei-testnet-rpc.polkachu.com"],["Arbitrum","https://arbitrum-goerli.public.blastapi.io"],["Optimism","https://optimism-goerli.public.blastapi.io"],["Base","https://base-goerli.public.blastapi.io"],["Injective","https://testnet.sentry.tm.injective.network"],["Osmosis","https://rpc.testnet.osmosis.zone"],["Cosmoshub","https://rpc.sentry-02.theta-testnet.polypore.xyz"],["Evmos","https://evmos-testnet-rpc.polkachu.com"],["Wormchain","https://gateway.testnet.xlabs.xyz/"],["Xpla","https://cube-rpc.xpla.dev"],["Sepolia","https://ethereum-sepolia.publicnode.com"],["Algorand","https://testnet-api.algonode.cloud"],["Terra","https://bombay.stakesystems.io"],["Terra2","https://terra-testnet-rpc.polkachu.com"],["ArbitrumSepolia","https://sepolia-rollup.arbitrum.io/rpc"],["OptimismSepolia","https://sepolia.optimism.io"],["BaseSepolia","https://sepolia.base.org"],["PolygonSepolia","https://rpc-amoy.polygon.technology/"],["Mantle","https://mantle-sepolia.drpc.org"],["Karura","https://eth-rpc-karura-testnet.aca-staging.network"],["Acala","https://eth-rpc-acala-testnet.aca-staging.network"],["Blast","https://sepolia.blast.io"],["Berachain","https://artio.rpc.berachain.com"],["Linea","https://rpc.sepolia.linea.build"],["Xlayer","https://testrpc.xlayer.tech/"],["Scroll","https://rpc.ankr.com/scroll_sepolia_testnet"],["Rootstock","https://public-node.testnet.rsk.co"],["Gnosis","https://rpc.chiadochain.net"]]],["Devnet",[["Ethereum","http://eth-devnet:8545"],["Bsc","http://eth-devnet2:8545"],["Solana","http://solana-devnet:8899"]]]],rpc$2=constMap(rpcConfig),rpcAddress=(s,j)=>rpc$2.get(s,j)??"",rpc$3=Object.freeze(Object.defineProperty({__proto__:null,rpcAddress},Symbol.toStringTag,{value:"Module"})),chainNetworkNativeChainIdEntries=[["Mainnet",[["Aptos",1n],["Algorand","mainnet-v1.0"],["Near","mainnet"],["Cosmoshub","cosmoshub-4"],["Evmos","evmos_9001-2"],["Injective","injective-1"],["Osmosis","osmosis-1"],["Sei","pacific-1"],["Terra","columbus-5"],["Terra2","phoenix-1"],["Wormchain","wormchain"],["Xpla","dimension_37-1"],["Kujira","kaiyo-1"],["Solana","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d"],["Sui","35834a8a"],["Acala",787n],["Arbitrum",42161n],["Aurora",1313161554n],["Avalanche",43114n],["Base",8453n],["Bsc",56n],["Celo",42220n],["Ethereum",1n],["Fantom",250n],["Gnosis",100n],["Karura",686n],["Klaytn",8217n],["Moonbeam",1284n],["Neon",245022934n],["Oasis",42262n],["Optimism",10n],["Polygon",137n],["Rootstock",30n],["Neutron","neutron-1"],["Stargaze","stargaze-1"],["Celestia","celestia"],["Dymension","dymension_1100-1"],["Provenance","pio-mainnet-1"],["Xlayer",196n],["Mantle",5000n],["Scroll",534352n],["Blast",81457n],["Linea",59144n]]],["Testnet",[["Aptos",2n],["Algorand","testnet-v1.0"],["Near","testnet"],["Cosmoshub","theta-testnet-001"],["Evmos","evmos_9000-4"],["Injective","injective-888"],["Osmosis","osmo-test-5"],["Sei","atlantic-2"],["Terra","bombay-12"],["Terra2","pisco-1"],["Wormchain","wormchain-testnet-0"],["Xpla","cube_47-5"],["Kujira","harpoon-4"],["Solana","EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG"],["Sui","4c78adac"],["Acala",597n],["Arbitrum",421613n],["Aurora",1313161555n],["Avalanche",43113n],["Base",84531n],["Bsc",97n],["Celo",44787n],["Ethereum",5n],["Fantom",4002n],["Gnosis",10200n],["Karura",596n],["Klaytn",1001n],["Moonbeam",1287n],["Neon",245022940n],["Oasis",42261n],["Optimism",420n],["Polygon",80001n],["Rootstock",31n],["Sepolia",11155111n],["ArbitrumSepolia",421614n],["BaseSepolia",84532n],["OptimismSepolia",11155420n],["PolygonSepolia",80002n],["Holesky",17000n],["Neutron","pion-1"],["Celestia","mocha-4"],["Seda","seda-1-testnet"],["Blast",168587773n],["Mantle",5003n],["Scroll",534351n],["Berachain",80084n],["Snaxchain",2192n],["Xlayer",195n],["Linea",59141n]]],["Devnet",[["Aptos",0n],["Algorand","sandnet-v1.0"],["Bsc",1397n],["Ethereum",1337n],["Injective","injective_devnet_fake"],["Solana","8wF6jKV3cKwyaVkWcoV9KpDqmkjvEYno9hKZrKx8TbZn"]]]],networkChainToNativeChainId=constMap(chainNetworkNativeChainIdEntries),nativeChainIdToNetworkChain=constMap(chainNetworkNativeChainIdEntries,[2,[0,1]]);function platformNativeChainIdToNetworkChain(s,j){const _e=nativeChainIdToNetworkChain(j).filter(([et,tt])=>chainToPlatform(tt)===s);if(_e.length!==1)throw new Error(`Platform ${s} has multiple chains with native chain id ${j}`);return _e[0]}const nativeChainIds=Object.freeze(Object.defineProperty({__proto__:null,networkChainToNativeChainId,platformNativeChainIdToNetworkChain},Symbol.toStringTag,{value:"Module"})),circleAPIs=[["Mainnet","https://iris-api.circle.com/v1/attestations"],["Testnet","https://iris-api-sandbox.circle.com/v1/attestations"]],circleAPI=constMap(circleAPIs),usdcContracts=[["Mainnet",[["Ethereum","0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"],["Avalanche","0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e"],["Optimism","0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"],["Arbitrum","0xaf88d065e77c8cC2239327C5EDb3A432268e5831"],["Solana","EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"],["Base","0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"],["Polygon","0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"]]],["Testnet",[["Sepolia","0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"],["Avalanche","0x5425890298aed601595a70AB815c96711a31Bc65"],["OptimismSepolia","0x5fd84259d66Cd46123540766Be93DFE6D43130D7"],["ArbitrumSepolia","0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"],["Solana","4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"],["BaseSepolia","0x036CbD53842c5426634e7929541eC2318f3dCF7e"],["Polygon","0x9999f7fea5938fd3b1e26a12c3f2fb024e194f97"]]]],usdcContract=constMap(usdcContracts),circleDomains=[["Mainnet",[["Ethereum",0],["Avalanche",1],["Optimism",2],["Arbitrum",3],["Solana",5],["Base",6],["Polygon",7]]],["Testnet",[["Sepolia",0],["Avalanche",1],["OptimismSepolia",2],["ArbitrumSepolia",3],["Solana",5],["BaseSepolia",6],["Polygon",7]]]],circleChainId=constMap(circleDomains,[[0,1],2]),circleChainIdToChain=constMap(circleDomains,[[0,2],1]),[circleNetworks,circleChainMap]=zip(circleDomains),isCircleChain=(s,j)=>circleChainId.has(s,j),isCircleChainId=(s,j)=>circleChainIdToChain.has(s,j),isCircleSupported=(s,j)=>usdcContract.has(s,j);function assertCircleChainId(s,j){if(!isCircleChainId(s,j))throw Error(`Unknown Circle chain id: ${j}`)}function assertCircleChain(s,j){if(!isCircleChain(s,j))throw Error(`Unknown Circle chain: ${j}`)}const asCircleChainId=(s,j)=>(assertCircleChainId(s,j),j),toCircleChainId=(s,j)=>{switch(typeof j){case"string":if(isCircleChain(s,j))return circleChainId.get(s,j);break;case"number":if(isCircleChainId(s,j))return j;break;case"bigint":const $=Number(j);if(isCircleChainId(s,$))return $;break}throw Error(`Cannot convert to ChainId: ${j}`)},toCircleChain=(s,j)=>{switch(typeof j){case"string":if(isCircleChain(s,j))return j;break;case"number":if(isCircleChainId(s,j))return circleChainIdToChain(s,j);break;case"bigint":const $=Number(j);if(isCircleChainId(s,$))return circleChainIdToChain(s,$);break}throw Error(`Cannot convert to Chain: ${j}`)},circle$1=Object.freeze(Object.defineProperty({__proto__:null,asCircleChainId,assertCircleChain,assertCircleChainId,circleAPI,circleChainId,circleChainIdToChain,circleChainMap,circleNetworks,isCircleChain,isCircleChainId,isCircleSupported,toCircleChain,toCircleChainId,usdcContract},Symbol.toStringTag,{value:"Module"})),coreBridgeContracts=[["Mainnet",[["Solana","worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth"],["Ethereum","0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"],["Terra","terra1dq03ugtd40zu9hcgdzrsq6z2z4hwhc9tqk2uy5"],["Bsc","0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"],["Polygon","0x7A4B5a56256163F07b2C80A7cA55aBE66c4ec4d7"],["Avalanche","0x54a8e5f9c4CbA08F9943965859F6c34eAF03E26c"],["Oasis","0xfE8cD454b4A1CA468B57D79c0cc77Ef5B6f64585"],["Algorand","842125965"],["Aurora","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Fantom","0x126783A6Cb203a3E35344528B26ca3a0489a1485"],["Karura","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Acala","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Klaytn","0x0C21603c4f3a6387e241c0091A7EA39E43E90bb7"],["Celo","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Near","contract.wormhole_crypto.near"],["Injective","inj17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9l2q74d"],["Aptos","0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625"],["Sui","0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c"],["Moonbeam","0xC8e2b0cD52Cf01b0Ce87d389Daa3d414d4cE29f3"],["Terra2","terra12mrnzvhx3rpej6843uge2yyfppfyd3u9c3uq223q8sl48huz9juqffcnhp"],["Arbitrum","0xa5f208e072434bC67592E4C49C1B991BA79BCA46"],["Optimism","0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722"],["Gnosis","0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],["Pythnet","H3fxXJ86ADW2PNuDDmZJg6mzTtPxkYCpNuQUTgmJ7AjU"],["Base","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Rootstock","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Xlayer","0x194B123c5E96B9b2E49763619985790Dc241CAC0"],["Xpla","xpla1jn8qmdda5m6f6fqu9qv46rt7ajhklg40ukpqchkejcvy8x7w26cqxamv3w"],["Sei","sei1gjrrme22cyha4ht2xapn3f08zzw6z3d4uxx6fyy9zd5dyr3yxgzqqncdqn"],["Wormchain","wormhole1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqaqfk2j"],["Neutron","neutron16rerygcpahqcxx5t8vjla46ym8ccn7xz7rtc6ju5ujcd36cmc7zs9zrunh"],["Blast","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Scroll","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Mantle","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"]]],["Testnet",[["Solana","3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"],["Ethereum","0x706abc4E45D419950511e474C7B9Ed348A4a716c"],["Terra","terra1pd65m0q9tl3v8znnz5f5ltsfegyzah7g42cx5v"],["Bsc","0x68605AD7b15c732a30b1BbC62BE8F2A509D74b4D"],["Polygon","0x0CBE91CF822c73C2315FB05100C2F714765d5c20"],["Avalanche","0x7bbcE28e64B3F8b84d876Ab298393c38ad7aac4C"],["Oasis","0xc1C338397ffA53a2Eb12A7038b4eeb34791F8aCb"],["Algorand","86525623"],["Aurora","0xBd07292de7b505a4E803CEe286184f7Acf908F5e"],["Fantom","0x1BB3B4119b7BA9dfad76B0545fb3F531383c3bB7"],["Karura","0x64fb09E405D2043ed7785a29E296C766D56F2056"],["Acala","0x64fb09E405D2043ed7785a29E296C766D56F2056"],["Klaytn","0x1830CC6eE66c84D2F177B94D544967c774E624cA"],["Celo","0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56"],["Near","wormhole.wormhole.testnet"],["Injective","inj1xx3aupmgv3ce537c0yce8zzd3sz567syuyedpg"],["Osmosis","osmo1hggkxr0hpw83f8vuft7ruvmmamsxmwk2hzz6nytdkzyup9krt0dq27sgyx"],["Aptos","0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625"],["Sui","0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790"],["Moonbeam","0xa5B7D85a8f27dd7907dc8FdC21FA5657D5E2F901"],["Neon","0x268557122Ffd64c85750d630b716471118F323c8"],["Terra2","terra19nv3xr5lrmmr7egvrk2kqgw4kcn43xrtd5g0mpgwwvhetusk4k7s66jyv0"],["Arbitrum","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Optimism","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["Gnosis","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Pythnet","EUrRARh92Cdc54xrDn6qzaqjA77NRrCcfbr8kPwoTL4z"],["Xpla","xpla1upkjn4mthr0047kahvn0llqx4qpqfn75lnph4jpxfn8walmm8mqsanyy35"],["Base","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Sei","sei1nna9mzp274djrgzhzkac2gvm3j27l402s4xzr08chq57pjsupqnqaj0d5s"],["Sepolia","0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78"],["Rootstock","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"],["Wormchain","wormhole16jzpxp0e8550c9aht6q9svcux30vtyyyyxv5w2l2djjra46580wsazcjwp"],["ArbitrumSepolia","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["BaseSepolia","0x79A1027a6A159502049F10906D333EC57E95F083"],["OptimismSepolia","0x31377888146f3253211EFEf5c676D41ECe7D58Fe"],["Holesky","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Neutron","neutron1enf63k37nnv9cugggpm06mg70emcnxgj9p64v2s8yx7a2yhhzk2q6xesk4"],["Mantle","0x376428e7f26D5867e69201b275553C45B09EE090"],["PolygonSepolia","0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],["Scroll","0x055F47F1250012C6B20c436570a76e52c17Af2D5"],["Blast","0x473e002D7add6fB67a4964F13bFd61280Ca46886"],["Berachain","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Snaxchain","0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],["Xlayer","0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"],["Linea","0x79A1027a6A159502049F10906D333EC57E95F083"]]],["Devnet",[["Solana","Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"],["Ethereum","0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"],["Terra","terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au"],["Bsc","0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"],["Algorand","1004"],["Near","wormhole.test.near"],["Aptos","0xde0036a9600559e295d5f6802ef6f3f802f510366e0c23912b0655d972166017"],["Sui","0x5a5160ca3c2037f4b4051344096ef7a48ebf4400b3f385e57ea90e1628a8bde0"],["Terra2","terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au"],["Wormchain","wormhole17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgshdnj3k"]]]],tokenBridgeContracts=[["Mainnet",[["Solana","wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb"],["Ethereum","0x3ee18B2214AFF97000D974cf647E7C347E8fa585"],["Terra","terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf"],["Bsc","0xB6F6D86a8f9879A9c87f643768d9efc38c1Da6E7"],["Polygon","0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE"],["Avalanche","0x0e082F06FF657D94310cB8cE8B0D9a04541d8052"],["Oasis","0x5848C791e09901b40A9Ef749f2a6735b418d7564"],["Algorand","842126029"],["Aurora","0x51b5123a7b0F9b2bA265f9c4C8de7D78D52f510F"],["Fantom","0x7C9Fc5741288cDFdD83CeB07f3ea7e22618D79D2"],["Karura","0xae9d7fe007b3327AA64A32824Aaac52C42a6E624"],["Acala","0xae9d7fe007b3327AA64A32824Aaac52C42a6E624"],["Klaytn","0x5b08ac39EAED75c0439FC750d9FE7E1F9dD0193F"],["Celo","0x796Dff6D74F3E27060B71255Fe517BFb23C93eed"],["Near","contract.portalbridge.near"],["Injective","inj1ghd753shjuwexxywmgs4xz7x2q732vcnxxynfn"],["Aptos","0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f"],["Sui","0xc57508ee0d4595e5a8728974a4a93a787d38f339757230d441e895422c07aba9"],["Moonbeam","0xb1731c586ca89a23809861c6103f0b96b3f57d92"],["Terra2","terra153366q50k7t8nn7gec00hg66crnhkdggpgdtaxltaq6xrutkkz3s992fw9"],["Arbitrum","0x0b2402144Bb366A632D14B83F244D2e0e21bD39c"],["Optimism","0x1D68124e65faFC907325e3EDbF8c4d84499DAa8b"],["Base","0x8d2de8d2f73F1F4cAB472AC9A881C9b123C79627"],["Xlayer","0x5537857664B0f9eFe38C9f320F75fEf23234D904"],["Xpla","xpla137w0wfch2dfmz7jl2ap8pcmswasj8kg06ay4dtjzw7tzkn77ufxqfw7acv"],["Sei","sei1smzlm9t79kur392nu9egl8p8je9j92q4gzguewj56a05kyxxra0qy0nuf3"],["Wormchain","wormhole1466nf3zuxpya8q9emxukd7vftaf6h4psr0a07srl5zw74zh84yjq4lyjmh"],["Blast","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"],["Scroll","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"],["Mantle","0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"]]],["Testnet",[["Solana","DZnkkTmCiFWfYTfT41X3Rd1kDgozqzxWaHqsw6W4x2oe"],["Ethereum","0xF890982f9310df57d00f659cf4fd87e65adEd8d7"],["Terra","terra1pseddrv0yfsn76u4zxrjmtf45kdlmalswdv39a"],["Bsc","0x9dcF9D205C9De35334D646BeE44b2D2859712A09"],["Polygon","0x377D55a7928c046E18eEbb61977e714d2a76472a"],["Avalanche","0x61E44E506Ca5659E6c0bba9b678586fA2d729756"],["Oasis","0x88d8004A9BdbfD9D28090A02010C19897a29605c"],["Algorand","86525641"],["Aurora","0xD05eD3ad637b890D68a854d607eEAF11aF456fba"],["Fantom","0x599CEa2204B4FaECd584Ab1F2b6aCA137a0afbE8"],["Karura","0xe157115ef34c93145Fec2FE53706846853B07F42"],["Acala","0xe157115ef34c93145Fec2FE53706846853B07F42"],["Klaytn","0xC7A13BE098720840dEa132D860fDfa030884b09A"],["Celo","0x05ca6037eC51F8b712eD2E6Fa72219FEaE74E153"],["Near","token.wormhole.testnet"],["Injective","inj1q0e70vhrv063eah90mu97sazhywmeegp7myvnh"],["Aptos","0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f"],["Sui","0x6fb10cdb7aa299e9a4308752dadecb049ff55a892de92992a1edbd7912b3d6da"],["Moonbeam","0xbc976D4b9D57E57c3cA52e1Fd136C45FF7955A96"],["Neon","0xEe3dB83916Ccdc3593b734F7F2d16D630F39F1D0"],["Terra2","terra1c02vds4uhgtrmcw7ldlg75zumdqxr8hwf7npseuf2h58jzhpgjxsgmwkvk"],["Arbitrum","0x23908A62110e21C04F3A4e011d24F901F911744A"],["ArbitrumSepolia","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Optimism","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["OptimismSepolia","0x99737Ec4B815d816c49A385943baf0380e75c0Ac"],["Xpla","xpla1kek6zgdaxcsu35nqfsyvs2t9vs87dqkkq6hjdgczacysjn67vt8sern93x"],["Base","0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"],["BaseSepolia","0x86F55A04690fd7815A3D802bD587e83eA888B239"],["Sei","sei1jv5xw094mclanxt5emammy875qelf3v62u4tl4lp5nhte3w3s9ts9w9az2"],["Sepolia","0xDB5492265f6038831E89f495670FF909aDe94bd9"],["Wormchain","wormhole1aaf9r6s7nxhysuegqrxv0wpm27ypyv4886medd3mrkrw6t4yfcnst3qpex"],["Holesky","0x76d093BbaE4529a342080546cAFEec4AcbA59EC6"],["Mantle","0x75Bfa155a9D7A3714b0861c8a8aF0C4633c45b5D"],["PolygonSepolia","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],["Scroll","0x22427d90B7dA3fA4642F7025A854c7254E4e45BF"],["Blast","0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2"],["Xlayer","0xdA91a06299BBF302091B053c6B9EF86Eff0f930D"],["Berachain","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Snaxchain","0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"],["Linea","0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"]]],["Devnet",[["Solana","B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE"],["Ethereum","0x0290FB167208Af455bB137780163b7B7a9a10C16"],["Terra","terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6"],["Bsc","0x0290FB167208Af455bB137780163b7B7a9a10C16"],["Algorand","1006"],["Near","token.test.near"],["Aptos","0x84a5f374d29fc77e370014dce4fd6a55b58ad608de8074b0be5571701724da31"],["Sui","0xa6a3da85bbe05da5bfd953708d56f1a3a023e7fb58e5a824a3d4de3791e8f690"],["Terra2","terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6"],["Wormchain","wormhole1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqtm7t3h"]]]],tokenBridgeRelayerContracts=[["Mainnet",[["Ethereum","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Bsc","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Polygon","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Avalanche","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Fantom","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Celo","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"],["Sui","0x57f4e0ba41a7045e29d435bc66cc4175f381eb700e6ec16d4fdfe92e5a4dff9f"],["Solana","3vxKRPwUTiEkeUVyoZ9MXFe1V71sRLbLqu1gRYaWmehQ"],["Base","0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"],["Moonbeam","0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"]]],["Testnet",[["Ethereum","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Bsc","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Polygon","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Avalanche","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Fantom","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Celo","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Sui","0xb30040e5120f8cb853b691cb6d45981ae884b1d68521a9dc7c3ae881c0031923"],["Base","0xae8dc4a7438801ec4edc0b035eccccf3807f4cc1"],["Moonbeam","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Solana","3bPRWXqtSfUaCw3S4wdgvypQtsSzcmvDeaqSqPDkncrg"],["Sepolia",""],["ArbitrumSepolia",""],["OptimismSepolia",""],["BaseSepolia",""]]]],nftBridgeContracts=[["Mainnet",[["Solana","WnFt12ZrnzZrFZkt2xsNsaNWoQribnuQ5B5FrDbwDhD"],["Ethereum","0x6FFd7EdE62328b3Af38FCD61461Bbfc52F5651fE"],["Bsc","0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE"],["Polygon","0x90BBd86a6Fe93D3bc3ed6335935447E75fAb7fCf"],["Avalanche","0xf7B6737Ca9c4e08aE573F75A97B73D7a813f5De5"],["Oasis","0x04952D522Ff217f40B5Ef3cbF659EcA7b952a6c1"],["Aurora","0x6dcC0484472523ed9Cdc017F711Bcbf909789284"],["Fantom","0xA9c7119aBDa80d4a4E0C06C8F4d8cF5893234535"],["Karura","0xb91e3638F82A1fACb28690b37e3aAE45d2c33808"],["Acala","0xb91e3638F82A1fACb28690b37e3aAE45d2c33808"],["Klaytn","0x3c3c561757BAa0b78c5C025CdEAa4ee24C1dFfEf"],["Celo","0xA6A377d75ca5c9052c9a77ED1e865Cc25Bd97bf3"],["Aptos","0x1bdffae984043833ed7fe223f7af7a3f8902d04129b14f801823e64827da7130"],["Moonbeam","0x453cfbe096c0f8d763e8c5f24b441097d577bde2"],["Arbitrum","0x3dD14D553cFD986EAC8e3bddF629d82073e188c8"],["Base","0xDA3adC6621B2677BEf9aD26598e6939CF0D92f88"],["Optimism","0xfE8cD454b4A1CA468B57D79c0cc77Ef5B6f64585"]]],["Testnet",[["Solana","2rHhojZ7hpu1zA91nvZmT8TqWWvMcKmmNBCr2mKTtMq4"],["Ethereum","0xD8E4C2DbDd2e2bd8F1336EA691dBFF6952B1a6eB"],["Bsc","0xcD16E5613EF35599dc82B24Cb45B5A93D779f1EE"],["Polygon","0x51a02d0dcb5e52F5b92bdAA38FA013C91c7309A9"],["Avalanche","0xD601BAf2EEE3C028344471684F6b27E789D9075D"],["Oasis","0xC5c25B41AB0b797571620F5204Afa116A44c0ebA"],["Aurora","0x8F399607E9BA2405D87F5f3e1B78D950b44b2e24"],["Fantom","0x63eD9318628D26BdCB15df58B53BB27231D1B227"],["Klaytn","0x94c994fC51c13101062958b567e743f1a04432dE"],["Celo","0xaCD8190F647a31E56A656748bC30F69259f245Db"],["Moonbeam","0x98A0F4B96972b32Fcb3BD03cAeB66A44a6aB9Edb"],["Neon","0x66E5BcFD45D2F3f166c567ADa663f9d2ffb292B4"],["Arbitrum","0xEe3dB83916Ccdc3593b734F7F2d16D630F39F1D0"],["Optimism","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Base","0xF681d1cc5F25a3694E348e7975d7564Aa581db59"],["Sepolia","0x6a0B52ac198e4870e5F3797d5B403838a5bbFD99"],["Aptos","0x1bdffae984043833ed7fe223f7af7a3f8902d04129b14f801823e64827da7130"],["ArbitrumSepolia","0x23908A62110e21C04F3A4e011d24F901F911744A"],["BaseSepolia","0x268557122Ffd64c85750d630b716471118F323c8"],["OptimismSepolia","0x27812285fbe85BA1DF242929B906B31EE3dd1b9f"],["Holesky","0xc8941d483c45eF8FB72E4d1F9dDE089C95fF8171"],["PolygonSepolia","0x23908A62110e21C04F3A4e011d24F901F911744A"],["Mantle","0xD7D732C8Bf5eBF620EA55b5828eae20418eEF083"],["Scroll","0x47B9a1406BEe29a3001BFEB7e45aE45fFFB40c18"]]],["Devnet",[["Solana","NFTWqJR8YnRVqPDvTJrYuLrQDitTG5AScqbeghi4zSA"],["Ethereum","0x26b4afb60d6c903165150c6f0aa14f8016be4aec"],["Terra","terra1plju286nnfj3z54wgcggd4enwaa9fgf5kgrgzl"],["Bsc","0x26b4afb60d6c903165150c6f0aa14f8016be4aec"],["Aptos","0x46da3d4c569388af61f951bdd1153f4c875f90c2991f6b2d0a38e2161a40852c"]]]],relayerContracts=[["Mainnet",[["Ethereum","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Bsc","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Polygon","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Avalanche","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Fantom","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Klaytn","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Celo","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Acala","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Karura","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Moonbeam","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Base","0x706f82e9bb5b0813501714ab5974216704980e31"],["Arbitrum","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Optimism","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Blast","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Scroll","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Mantle","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"],["Xlayer","0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"]]],["Testnet",[["Ethereum","0x28D8F1Be96f97C1387e94A53e00eCcFb4E75175a"],["Bsc","0x80aC94316391752A193C1c47E27D382b507c93F3"],["Polygon","0x0591C25ebd0580E0d4F27A82Fc2e24E7489CB5e0"],["Avalanche","0xA3cF45939bD6260bcFe3D66bc73d60f19e49a8BB"],["Fantom","0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"],["Celo","0x306B68267Deb7c5DfCDa3619E22E9Ca39C374f84"],["Moonbeam","0x0591C25ebd0580E0d4F27A82Fc2e24E7489CB5e0"],["Arbitrum","0xAd753479354283eEE1b86c9470c84D42f229FF43"],["Optimism","0x01A957A525a5b7A72808bA9D10c389674E459891"],["Base","0xea8029CD7FCAEFFcD1F53686430Db0Fc8ed384E1"],["Sepolia","0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470"],["ArbitrumSepolia","0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470"],["BaseSepolia","0x93BAD53DDfB6132b0aC8E37f6029163E63372cEE"],["OptimismSepolia","0x93BAD53DDfB6132b0aC8E37f6029163E63372cEE"]]],["Devnet",[["Ethereum","0xcC680D088586c09c3E0E099a676FA4b6e42467b4"],["Bsc","0xcC680D088586c09c3E0E099a676FA4b6e42467b4"]]]],circleContracts$1=[["Mainnet",[["Ethereum",{tokenMessenger:"0xbd3fa81b58ba92a82136038b25adec7066af3155",messageTransmitter:"0x0a992d191deec32afe36203ad87d7d289a738f81",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0xAaDA05BD399372f0b0463744C09113c137636f6a"}],["Avalanche",{tokenMessenger:"0x6b25532e1060ce10cc3b0a99e5683b91bfde6982",messageTransmitter:"0x8186359af5f57fbb40c6b14a588d2a59c0c29880",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x09Fb06A271faFf70A651047395AaEb6265265F13"}],["Optimism",{tokenMessenger:"0x2B4069517957735bE00ceE0fadAE88a26365528f",messageTransmitter:"0x4d41f22c5a0e5c74090899e5a8fb597a8842b3e8",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Arbitrum",{tokenMessenger:"0x19330d10D9Cc8751218eaf51E8885D058642E08A",messageTransmitter:"0xC30362313FBBA5cf9163F0bb16a0e01f01A896ca",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Base",{tokenMessenger:"0x1682Ae6375C4E4A97e4B583BC394c861A46D8962",messageTransmitter:"0xAD09780d193884d503182aD4588450C416D6F9D4",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x03faBB06Fa052557143dC28eFCFc63FC12843f1D"}],["Solana",{tokenMessenger:"CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3",messageTransmitter:"CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd",wormholeRelayer:"",wormhole:""}],["Polygon",{tokenMessenger:"0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE",messageTransmitter:"0xF3be9355363857F3e001be68856A2f96b4C39Ba9",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x0FF28217dCc90372345954563486528aa865cDd6"}]]],["Testnet",[["Sepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Avalanche",{tokenMessenger:"0xeb08f243e5d3fcff26a9e38ae5520a669f4019d0",messageTransmitter:"0xa9fb1b3009dcb79e2fe346c16a604b8fa8ae0a79",wormholeRelayer:"0x774a70bbd03327c21460b60f25b677d9e46ab458",wormhole:"0x58f4c17449c90665891c42e14d34aae7a26a472e"}],["OptimismSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["ArbitrumSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0xaCF1ceeF35caAc005e15888dDb8A3515C41B4872",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Solana",{tokenMessenger:"CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3",messageTransmitter:"CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd",wormholeRelayer:"",wormhole:""}],["BaseSepolia",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0x7865fAfC2db2093669d92c0F33AeEF291086BEFD",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}],["Polygon",{tokenMessenger:"0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",messageTransmitter:"0xe09A679F56207EF33F5b9d8fb4499Ec00792eA73",wormholeRelayer:"0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",wormhole:"0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c"}]]]],gatewayContracts=[["Mainnet",[["Wormchain","wormhole14ejqjyq8um4p3xfqj74yld5waqljf88fz25yxnma0cngspxe3les00fpjx"]]],["Testnet",[["Wormchain","wormhole1ctnjk7an90lz5wjfvr3cf6x984a8cjnv8dpmztmlpcq4xteaa2xs9pwmzk"]]]],translatorContracts=[["Mainnet",[["Sei","sei189adguawugk3e55zn63z8r9ll29xrjwca636ra7v7gxuzn98sxyqwzt47l"]]],["Testnet",[["Sei","sei1dkdwdvknx0qav5cp5kw68mkn3r99m3svkyjfvkztwh97dv2lm0ksj6xrak"]]]],rollupContractAddresses=[["Mainnet",[["Polygon",["Ethereum","0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287"]],["Optimism",["Ethereum","0xdfe97868233d1aa22e815a266982f2cf17685a27"]],["Arbitrum",["Ethereum","0x1c479675ad559dc151f6ec7ed3fbf8cee79582b6"]]]],["Testnet",[["Polygon",["Ethereum","0x2890ba17efe978480615e330ecb65333b880928e"]],["Optimism",["Ethereum","0xe6dfba0953616bacab0c9a8ecb3a9bba77fc15c0"]],["Arbitrum",["Ethereum","0x45af9ed1d03703e480ce7d328fb684bb67da5049"]]]]],porticoContracts=[["Mainnet",[["Ethereum",{portico:"0x48b6101128C0ed1E208b7C910e60542A2ee6f476",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e"}],["Polygon",{portico:"0x227bABe533fa9a1085f5261210E0B7137E44437B",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e"}],["Bsc",{portico:"0x05498574BD0Fa99eeCB01e1241661E7eE58F8a85",uniswapQuoterV2:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077"}],["Avalanche",{portico:"0xE565E118e75304dD3cF83dff409c90034b7EA18a",uniswapQuoterV2:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F"}],["Arbitrum",{portico:"0x48fa7528bFD6164DdF09dF0Ed22451cF59c84130",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e"}],["Optimism",{portico:"0x9ae506cDDd27DEe1275fd1fe6627E5dc65257061",uniswapQuoterV2:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e"}],["Base",{portico:"0x610d4DFAC3EC32e0be98D18DDb280DACD76A1889",uniswapQuoterV2:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a"}]]]],coreBridge=constMap(coreBridgeContracts),tokenBridge$2=constMap(tokenBridgeContracts),tokenBridgeRelayer=constMap(tokenBridgeRelayerContracts),nftBridge=constMap(nftBridgeContracts),relayer$1=constMap(relayerContracts),gateway=constMap(gatewayContracts),translator=constMap(translatorContracts),portico$2=constMap(porticoContracts),circleContracts=constMap(circleContracts$1),rollupContracts=constMap(rollupContractAddresses),tokenBridgeChains=constMap(tokenBridgeContracts,[0,1]),tokenBridgeRelayerChains=constMap(tokenBridgeRelayerContracts,[0,1]),circleContractChains=constMap(circleContracts$1,[0,1]),porticoContractChains=constMap(porticoContracts,[0,1]),index=Object.freeze(Object.defineProperty({__proto__:null,circleContractChains,circleContracts,coreBridge,gateway,nftBridge,portico:portico$2,porticoContractChains,relayer:relayer$1,rollupContracts,tokenBridge:tokenBridge$2,tokenBridgeChains,tokenBridgeRelayer,tokenBridgeRelayerChains,translator},Symbol.toStringTag,{value:"Module"})),guardianKeyAndNameEntries=[["Mainnet",[["0x58CC3AE5C097b213cE3c81979e1B9f9570746AA5","JumpCrypto"],["0xfF6CB952589BDE862c25Ef4392132fb9D4A42157","Staked"],["0x114De8460193bdf3A2fCf81f86a09765F4762fD1","Figment"],["0x107A0086b32d7A0977926A205131d8731D39cbEB","ChainodeTech"],["0x8C82B2fd82FaeD2711d59AF0F2499D16e726f6b2","Inotel"],["0x11b39756C042441BE6D8650b69b54EbE715E2343","HashQuark"],["0x54Ce5B4D348fb74B958e8966e2ec3dBd4958a7cd","Chainlayer"],["0x15e7cAF07C4e3DC8e7C469f92C8Cd88FB8005a20","xLabs"],["0x74a3bf913953D695260D88BC1aA25A4eeE363ef0","Forbole"],["0x000aC0076727b35FBea2dAc28fEE5cCB0fEA768e","StakingFund"],["0xAF45Ced136b9D9e24903464AE889F5C8a723FC14","MoonletWallet"],["0xf93124b7c738843CBB89E864c862c38cddCccF95","P2PValidator"],["0xD2CC37A4dc036a8D232b48f62cDD4731412f4890","01Node"],["0xDA798F6896A3331F64b48c12D1D57Fd9cbe70811","MCF"],["0x71AA1BE1D36CaFE3867910F99C09e347899C19C3","Everstake"],["0x8192b6E7387CCd768277c17DAb1b7a5027c0b3Cf","ChorusOne"],["0x178e21ad2E77AE06711549CFBB1f9c7a9d8096e8","Syncnode"],["0x5E1487F35515d02A92753504a8D75471b9f49EdB","Triton"],["0x6FbEBc898F403E4773E95feB15E80C9A99c8348d","StakingFacilities"]]],["Testnet",[["0x13947Bd48b18E53fdAeEe77F3473391aC727C638","Testnet guardian"]]]],guardianKeys=column(cartesianRightRecursive(guardianKeyAndNameEntries),1),guardianNames=column(cartesianRightRecursive(guardianKeyAndNameEntries),2),guardianNameToKey=constMap(guardianKeyAndNameEntries,[[0,2],1]),guardianKeyToName=constMap(guardianKeyAndNameEntries,[1,[0,2]]),devnetGuardianPrivateKey="cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0",guardians=Object.freeze(Object.defineProperty({__proto__:null,devnetGuardianPrivateKey,guardianKeyToName,guardianKeys,guardianNameToKey,guardianNames},Symbol.toStringTag,{value:"Module"})),esm=Object.freeze(Object.defineProperty({__proto__:null,addFixedValues:addFixedValues$1,amount:amount$2,asChainId,assertChain,assertChainId,binaryLiterals,bitsetItem:bitsetItem$1,calcLayoutSize:calcLayoutSize$1,calcStaticLayoutSize:calcStaticLayoutSize$1,cartesianRightRecursive,chain:chains$1,chainIdToChain,chainIds,chainToChainId,chainToPlatform,chains,checkBytesTypeEqual,checkItemSize,checkNumEquals,checkSize,circle:circle$1,column,constMap,contracts:index,customizableBytes,decimals,defaultEndianness,deserializeLayout:deserializeLayout$1,dynamicItemsOfLayout:dynamicItemsOfLayout$1,elementIndexPairs,encoding:encoding$3,entries,enumItem:enumItem$1,explorer:explorer$1,filters,finality,findIdLayoutPair,fixedItemsOfLayout:fixedItemsOfLayout$1,getCachedSerializedFrom:getCachedSerializedFrom$1,guardians,isBytesType,isChain,isChainId,isEqualCaseInsensitive,isFixedBytesConversion,isFixedPrimitiveConversion,isFixedUintConversion,isLayout,isLayoutItem,isNetwork,isNumType,isPlatform,isPrimitiveType,layout:index$1,layoutDiscriminator:layoutDiscriminator$1,lazyInstantiate:lazyInstantiate$1,nativeChainIds,network:networks$1,networks,numberMaxSize,onlyOnce:onlyOnce$1,optionItem:optionItem$1,platform:platforms$1,platformToAddressFormat,platformToChains,platforms,range,rpc:rpc$3,serializeLayout:serializeLayout$1,serializeNum:serializeNum$1,throws:throws$1,toChain,toChainId,zip},Symbol.toStringTag,{value:"Module"})),networkOptions=[{env:"Mainnet",endpoint:"https://europe-west3-wormhole-message-db-mainnet.cloudfunctions.net",name:"Mainnet",logo:"",type:"cloudfunction"},{env:"Mainnet",endpoint:"https://wormhole-v2-mainnet-api.mcf.rocks",name:"MCF",logo:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCA0OCAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAuODk2IDEyVjAuNDhIMy4zNDRMNy4zNzYgNS4yOTZMMTEuMzkyIDAuNDhIMTMuODU2VjEySDExLjUzNlYzLjkyTDcuMzc2IDguODk2TDMuMiAzLjkzNlYxMkgwLjg5NlpNMjEuODAzOCAxMkMyMS4zNzcxIDEyIDIwLjk4NzggMTEuODk4NyAyMC42MzU4IDExLjY5NkMyMC4yOTQ0IDExLjQ4MjcgMjAuMDE3MSAxMS4yMDUzIDE5LjgwMzggMTAuODY0QzE5LjYwMTEgMTAuNTEyIDE5LjQ5OTggMTAuMTIyNyAxOS40OTk4IDkuNjk2VjIuNzg0QzE5LjQ5OTggMi4zNTczMyAxOS42MDExIDEuOTczMzMgMTkuODAzOCAxLjYzMkMyMC4wMTcxIDEuMjggMjAuMjk0NCAxLjAwMjY3IDIwLjYzNTggMC43OTk5OTlDMjAuOTg3OCAwLjU4NjY2NiAyMS4zNzcxIDAuNDggMjEuODAzOCAwLjQ4SDMwLjk4NzhWMi44SDIyLjM0NzhDMjIuMTc3MSAyLjggMjIuMDQzOCAyLjg0OCAyMS45NDc4IDIuOTQ0QzIxLjg1MTggMy4wMjkzMyAyMS44MDM4IDMuMTYyNjcgMjEuODAzOCAzLjM0NFY5LjEzNkMyMS44MDM4IDkuMzA2NjcgMjEuODUxOCA5LjQ0IDIxLjk0NzggOS41MzZDMjIuMDQzOCA5LjYzMiAyMi4xNzcxIDkuNjggMjIuMzQ3OCA5LjY4SDMwLjk4NzhWMTJIMjEuODAzOFpNMzYuNDQ4IDEyVjAuNDhINDcuMDcyVjIuOEgzOC43ODRWNS4wNzJINDUuNDU2VjcuNDA4SDM4Ljc4NFYxMkgzNi40NDhaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K",type:"guardian"},{env:"Mainnet",endpoint:"https://wormhole-v2-mainnet-api.chainlayer.network",name:"ChainLayer",logo:"",type:"guardian"},{env:"Mainnet",endpoint:"https://worm-dash-01.rockrpc.net",name:"RockawayX",logo:"",type:"guardian"},{env:"Mainnet",endpoint:"https://wormhole-v2-mainnet-api.staking.fund",name:"Staking Fund",logo:"",type:"guardian"},{env:"Testnet",endpoint:"https://europe-west3-wormhole-message-db-testnet.cloudfunctions.net",name:"Testnet",logo:"",type:"cloudfunction"},{env:"Testnet",endpoint:"https://p2p-guardian-testnet-web.solana.p2p.org",name:"Testnet - P2P",logo:"",type:"guardian"},{env:"Testnet",endpoint:"https://guardian.testnet.xlabs.xyz",name:"Testnet - xLabs (LB)",logo:"",type:"guardian"},{env:"Testnet",endpoint:"https://guardian-01.testnet.xlabs.xyz",name:"Testnet - xLabs 1",logo:"",type:"guardian"},{env:"Testnet",endpoint:"https://guardian-02.testnet.xlabs.xyz",name:"Testnet - xLabs 2",logo:"",type:"guardian"},{env:"Devnet",endpoint:"http://localhost:7071",name:"Devnet",logo:"",type:"guardian"}],defaultNetwork=networkOptions[0],urlParamKey="endpoint",NetworkContext=React$1.createContext({currentNetwork:defaultNetwork,setCurrentNetwork:()=>{}}),NetworkContextProvider=({children:s})=>{const{push:j,replace:$}=useHistory(),{search:_e}=useLocation(),{urlParams:et,urlNetwork:tt,currentNetwork:nt}=reactExports.useMemo(()=>{const it=new URLSearchParams(_e),st=it.get(urlParamKey),at=networkOptions.find(ct=>ct.name===st)||defaultNetwork;return{urlParams:it,urlNetwork:st,currentNetwork:at}},[_e]),rt=reactExports.useCallback((it,st)=>{tt!==it.name&&(et.set(urlParamKey,it.name),st?$({search:et.toString()}):j({search:et.toString()}))},[tt,et,$,j]);reactExports.useEffect(()=>{rt(nt,!0)},[nt,rt]);const ot=reactExports.useMemo(()=>({currentNetwork:nt,setCurrentNetwork:rt}),[nt,rt]);return jsxRuntimeExports.jsx(NetworkContext.Provider,{value:ot,children:s})},useNetworkContext=()=>reactExports.useContext(NetworkContext),useCurrentEnvironment=()=>reactExports.useContext(NetworkContext).currentNetwork.env;function useChainHeartbeats(s){const j={};return s.forEach(($,_e)=>{$.networks.forEach(et=>{j[et.id]||(j[et.id]=s.map(tt=>({guardian:tt.guardianAddr,name:tt.nodeName,network:{...et,contractAddress:"",errorCount:"0",height:"0",safeHeight:"0",finalizedHeight:"0"}}))),j[et.id][_e]={guardian:$.guardianAddr,name:$.nodeName,network:et}})}),j}var dist={},arrays={};Object.defineProperty(arrays,"__esModule",{value:!0});arrays.chunkArray=void 0;function chunkArray(s,j){const $=[];for(let _e=0;_e{try{return(0,sdk_base_1$f.toChain)(s)}catch{}return"Unknown"};chainIdToName$1.chainIdToName=chainIdToName;var consts={};(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.isTokenDenylisted=s.TVL_TOKEN_DENYLIST=s.GUARDIAN_SET_4=s.NTT_ACCOUNTANT_CONTRACT_ADDRESS_TESTNET=s.NTT_ACCOUNTANT_CONTRACT_ADDRESS_MAINNET=s.ACCOUNTANT_CONTRACT_ADDRESS=s.CIRCLE_DOMAIN_TO_CHAIN_ID=s.isCircleIntegrationEmitter=s.CIRCLE_INTEGRATION_EMITTERS=s.isNFTBridgeEmitter=s.NFT_BRIDGE_EMITTERS=s.isTokenBridgeEmitter=s.TOKEN_BRIDGE_EMITTERS=s.getMissThreshold=s.INITIAL_DEPLOYMENT_BLOCK_BY_MODE=s.INITIAL_FT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN=s.INITIAL_NTT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN=s.INITIAL_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN=s.VAA_VERSION=s.MAX_VAA_DECIMALS=s.MISS_THRESHOLD_LABEL=void 0;const j=require$$0$6,$=40;s.MISS_THRESHOLD_LABEL="40 minutes",s.MAX_VAA_DECIMALS=8,s.VAA_VERSION=1,s.INITIAL_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN={Mainnet:{Ethereum:"12959638",Terra:"4810000",Bsc:"9745450",Polygon:"20629146",Avalanche:"8237163",Oasis:"1757",Algorand:"22931277",Fantom:"31817467",Karura:"1824665",Acala:"1144161",Klaytn:"90563824",Celo:"12947144",Moonbeam:"1486591",Terra2:"399813",Injective:"20908376",Arbitrum:"18128584",Optimism:"69401779",Aptos:"0",Near:"72767136",Xpla:"777549",Solana:"94396403",Sui:"1485552",Base:"1422314",Scroll:"4955534",Mantle:"64176265",Blast:"2375628",Sei:"238594",Wormchain:"4510119"},Testnet:{Ethereum:"0",Terra:"0",Bsc:"0",Polygon:"0",Avalanche:"0",Oasis:"0",Algorand:"0",Fantom:"0",Karura:"0",Acala:"0",Klaytn:"0",Celo:"0",Moonbeam:"0",Terra2:"0",Injective:"0",Arbitrum:"0",Optimism:"0",Aptos:"0",Near:"0",Xpla:"0",Solana:"0",Sui:"0",Scroll:"0",Mantle:"0",Blast:"0",Base:"0",Sei:"0",Wormchain:"4495661",PolygonSepolia:"2379275",Berachain:"1473347",Snaxchain:"482557"},Devnet:{}},s.INITIAL_NTT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN={Mainnet:{Solana:"260508723",Ethereum:"19583505",Fantom:"78727372",Arbitrum:"201652677",Optimism:"118840800",Base:"13245519"},Testnet:{Solana:"285100152",Sepolia:"5472203",ArbitrumSepolia:"22501243",BaseSepolia:"7249669",OptimismSepolia:"9232548"},Devnet:{}},s.INITIAL_FT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN={Mainnet:{},Testnet:{Solana:"302162456",ArbitrumSepolia:"49505590"},Devnet:{}},s.INITIAL_DEPLOYMENT_BLOCK_BY_MODE={vaa:s.INITIAL_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN,ntt:s.INITIAL_NTT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN,ft:s.INITIAL_FT_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN};function _e(ot,it){let st;try{let ct;typeof it=="string"&&!Number.isNaN(Number(it))?ct=(0,j.toChainId)(Number(it)):ct=(0,j.toChainId)(it),st=ct===(0,j.toChainId)("Scroll")?120:$}catch{st=$}const at=ot;return at.setMinutes(at.getMinutes()-st),at.toISOString()}s.getMissThreshold=_e,s.TOKEN_BRIDGE_EMITTERS={Solana:"ec7372995d5cc8732397fb0ad35c0121e0eaa90d26f828a534cab54391b3a4f5",Ethereum:"0000000000000000000000003ee18b2214aff97000d974cf647e7c347e8fa585",Terra:"0000000000000000000000007cf7b764e38a0a5e967972c1df77d432510564e2",Terra2:"a463ad028fb79679cfc8ce1efba35ac0e77b35080a1abe9bebe83461f176b0a3",Bsc:"000000000000000000000000b6f6d86a8f9879a9c87f643768d9efc38c1da6e7",Polygon:"0000000000000000000000005a58505a96d1dbf8df91cb21b54419fc36e93fde",Avalanche:"0000000000000000000000000e082f06ff657d94310cb8ce8b0d9a04541d8052",Oasis:"0000000000000000000000005848c791e09901b40a9ef749f2a6735b418d7564",Algorand:"67e93fa6c8ac5c819990aa7340c0c16b508abb1178be9b30d024b8ac25193d45",Aptos:"0000000000000000000000000000000000000000000000000000000000000001",Aurora:"00000000000000000000000051b5123a7b0f9b2ba265f9c4c8de7d78d52f510f",Fantom:"0000000000000000000000007c9fc5741288cdfdd83ceb07f3ea7e22618d79d2",Karura:"000000000000000000000000ae9d7fe007b3327aa64a32824aaac52c42a6e624",Acala:"000000000000000000000000ae9d7fe007b3327aa64a32824aaac52c42a6e624",Klaytn:"0000000000000000000000005b08ac39eaed75c0439fc750d9fe7e1f9dd0193f",Celo:"000000000000000000000000796dff6d74f3e27060b71255fe517bfb23c93eed",Near:"148410499d3fcda4dcfd68a1ebfcdddda16ab28326448d4aae4d2f0465cdfcb7",Moonbeam:"000000000000000000000000b1731c586ca89a23809861c6103f0b96b3f57d92",Arbitrum:"0000000000000000000000000b2402144bb366a632d14b83f244d2e0e21bd39c",Optimism:"0000000000000000000000001d68124e65fafc907325e3edbf8c4d84499daa8b",Xpla:"8f9cf727175353b17a5f574270e370776123d90fd74956ae4277962b4fdee24c",Injective:"00000000000000000000000045dbea4617971d93188eda21530bc6503d153313",Sui:"ccceeb29348f71bdd22ffef43a2a19c1f5b5e17c5cca5411529120182672ade5",Base:"0000000000000000000000008d2de8d2f73f1f4cab472ac9a881c9b123c79627",Scroll:"00000000000000000000000024850c6f61C438823F01B7A3BF2B89B72174Fa9d",Mantle:"00000000000000000000000024850c6f61C438823F01B7A3BF2B89B72174Fa9d",Blast:"00000000000000000000000024850c6f61C438823F01B7A3BF2B89B72174Fa9d",Xlayer:"0000000000000000000000005537857664B0f9eFe38C9f320F75fEf23234D904",Sei:"86c5fd957e2db8389553e1728f9c27964b22a8154091ccba54d75f4b10c61f5e",Wormchain:"aeb534c45c3049d380b9d9b966f9895f53abd4301bfaff407fa09dea8ae7a924"};const et=(ot,it)=>{var st;return((st=s.TOKEN_BRIDGE_EMITTERS[(0,j.toChain)(ot)])==null?void 0:st.toLowerCase())===it.toLowerCase()};s.isTokenBridgeEmitter=et,s.NFT_BRIDGE_EMITTERS={Solana:"0def15a24423e1edd1a5ab16f557b9060303ddbab8c803d2ee48f4b78a1cfd6b",Ethereum:"0000000000000000000000006ffd7ede62328b3af38fcd61461bbfc52f5651fe",Bsc:"0000000000000000000000005a58505a96d1dbf8df91cb21b54419fc36e93fde",Polygon:"00000000000000000000000090bbd86a6fe93d3bc3ed6335935447e75fab7fcf",Avalanche:"000000000000000000000000f7b6737ca9c4e08ae573f75a97b73d7a813f5de5",Oasis:"00000000000000000000000004952d522ff217f40b5ef3cbf659eca7b952a6c1",Aurora:"0000000000000000000000006dcc0484472523ed9cdc017f711bcbf909789284",Fantom:"000000000000000000000000a9c7119abda80d4a4e0c06c8f4d8cf5893234535",Karura:"000000000000000000000000b91e3638f82a1facb28690b37e3aae45d2c33808",Acala:"000000000000000000000000b91e3638f82a1facb28690b37e3aae45d2c33808",Klaytn:"0000000000000000000000003c3c561757baa0b78c5c025cdeaa4ee24c1dffef",Celo:"000000000000000000000000a6a377d75ca5c9052c9a77ed1e865cc25bd97bf3",Moonbeam:"000000000000000000000000453cfbe096c0f8d763e8c5f24b441097d577bde2",Arbitrum:"0000000000000000000000003dd14d553cfd986eac8e3bddf629d82073e188c8",Optimism:"000000000000000000000000fe8cd454b4a1ca468b57d79c0cc77ef5b6f64585",Aptos:"0000000000000000000000000000000000000000000000000000000000000005",Base:"000000000000000000000000da3adc6621b2677bef9ad26598e6939cf0d92f88"};const tt=(ot,it)=>{var st;return((st=s.NFT_BRIDGE_EMITTERS[(0,j.toChain)(ot)])==null?void 0:st.toLowerCase())===it.toLowerCase()};s.isNFTBridgeEmitter=tt,s.CIRCLE_INTEGRATION_EMITTERS={Ethereum:"000000000000000000000000aada05bd399372f0b0463744c09113c137636f6a",Avalanche:"00000000000000000000000009fb06a271faff70a651047395aaeb6265265f13",Optimism:"0000000000000000000000002703483b1a5a7c577e8680de9df8be03c6f30e3c",Arbitrum:"0000000000000000000000002703483b1a5a7c577e8680de9df8be03c6f30e3c",Base:"00000000000000000000000003faBB06Fa052557143dC28eFCFc63FC12843f1D",Polygon:"0000000000000000000000000FF28217dCc90372345954563486528aa865cDd6"};const nt=(ot,it)=>{var st;return((st=s.CIRCLE_INTEGRATION_EMITTERS[(0,j.toChain)(ot)])==null?void 0:st.toLowerCase())===it.toLowerCase()};s.isCircleIntegrationEmitter=nt,s.CIRCLE_DOMAIN_TO_CHAIN_ID={0:(0,j.chainToChainId)("Ethereum"),1:(0,j.chainToChainId)("Avalanche"),2:(0,j.chainToChainId)("Optimism"),3:(0,j.chainToChainId)("Arbitrum"),6:(0,j.chainToChainId)("Base"),7:(0,j.chainToChainId)("Polygon")},s.ACCOUNTANT_CONTRACT_ADDRESS="wormhole14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9srrg465",s.NTT_ACCOUNTANT_CONTRACT_ADDRESS_MAINNET="wormhole1mc23vtzxh46e63vq22e8cnv23an06akvkqws04kghkrxrauzpgwq2hmwm7",s.NTT_ACCOUNTANT_CONTRACT_ADDRESS_TESTNET="wormhole169tvyx49zmjqhlv7mzwj8j2weprascc0jq3rdglw9pynldqx34nscvhc7k",s.GUARDIAN_SET_4=[{pubkey:"0x5893B5A76c3f739645648885bDCcC06cd70a3Cd3",name:"RockawayX"},{pubkey:"0xfF6CB952589BDE862c25Ef4392132fb9D4A42157",name:"Staked"},{pubkey:"0x114De8460193bdf3A2fCf81f86a09765F4762fD1",name:"Figment"},{pubkey:"0x107A0086b32d7A0977926A205131d8731D39cbEB",name:"ChainodeTech"},{pubkey:"0x8C82B2fd82FaeD2711d59AF0F2499D16e726f6b2",name:"Inotel"},{pubkey:"0x11b39756C042441BE6D8650b69b54EbE715E2343",name:"HashQuark"},{pubkey:"0x54Ce5B4D348fb74B958e8966e2ec3dBd4958a7cd",name:"Chainlayer"},{pubkey:"0x15e7cAF07C4e3DC8e7C469f92C8Cd88FB8005a20",name:"xLabs"},{pubkey:"0x74a3bf913953D695260D88BC1aA25A4eeE363ef0",name:"Forbole"},{pubkey:"0x000aC0076727b35FBea2dAc28fEE5cCB0fEA768e",name:"Staking Fund"},{pubkey:"0xAF45Ced136b9D9e24903464AE889F5C8a723FC14",name:"MoonletWallet"},{pubkey:"0xf93124b7c738843CBB89E864c862c38cddCccF95",name:"P2P Validator"},{pubkey:"0xD2CC37A4dc036a8D232b48f62cDD4731412f4890",name:"01Node"},{pubkey:"0xDA798F6896A3331F64b48c12D1D57Fd9cbe70811",name:"MCF"},{pubkey:"0x71AA1BE1D36CaFE3867910F99C09e347899C19C3",name:"Everstake"},{pubkey:"0x8192b6E7387CCd768277c17DAb1b7a5027c0b3Cf",name:"Chorus One"},{pubkey:"0x178e21ad2E77AE06711549CFBB1f9c7a9d8096e8",name:"Syncnode"},{pubkey:"0x5E1487F35515d02A92753504a8D75471b9f49EdB",name:"Triton"},{pubkey:"0x6FbEBc898F403E4773E95feB15E80C9A99c8348d",name:"Staking Facilities"}],s.TVL_TOKEN_DENYLIST={[(0,j.chainToChainId)("Fantom")]:["0x5b2af7fd27e2ea14945c82dd254c79d3ed34685e"]};const rt=(ot,it)=>{var st;return((st=s.TVL_TOKEN_DENYLIST[ot])==null?void 0:st.includes(it.toLowerCase()))??!1};s.isTokenDenylisted=rt})(consts);var explorer={},safeBuffer={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(s,j){var $=buffer,_e=$.Buffer;function et(nt,rt){for(var ot in nt)rt[ot]=nt[ot]}_e.from&&_e.alloc&&_e.allocUnsafe&&_e.allocUnsafeSlow?s.exports=$:(et($,j),j.Buffer=tt);function tt(nt,rt,ot){return _e(nt,rt,ot)}tt.prototype=Object.create(_e.prototype),et(_e,tt),tt.from=function(nt,rt,ot){if(typeof nt=="number")throw new TypeError("Argument must not be a number");return _e(nt,rt,ot)},tt.alloc=function(nt,rt,ot){if(typeof nt!="number")throw new TypeError("Argument must be a number");var it=_e(nt);return rt!==void 0?typeof ot=="string"?it.fill(rt,ot):it.fill(rt):it.fill(0),it},tt.allocUnsafe=function(nt){if(typeof nt!="number")throw new TypeError("Argument must be a number");return _e(nt)},tt.allocUnsafeSlow=function(nt){if(typeof nt!="number")throw new TypeError("Argument must be a number");return $.SlowBuffer(nt)}})(safeBuffer,safeBuffer.exports);var safeBufferExports=safeBuffer.exports,_Buffer=safeBufferExports.Buffer;function base(s){if(s.length>=255)throw new TypeError("Alphabet too long");for(var j=new Uint8Array(256),$=0;$>>0,pt=new Uint8Array(yt);gt!==ht;){for(var Mt=lt[gt],St=0,Tt=yt-1;(Mt!==0||St>>0,pt[Tt]=Mt%nt>>>0,Mt=Mt/nt>>>0;if(Mt!==0)throw new Error("Non-zero carry");ft=St,gt++}for(var vt=yt-ft;vt!==yt&&pt[vt]===0;)vt++;for(var Dt=rt.repeat(dt);vt>>0,yt=new Uint8Array(ht);lt[dt];){var pt=j[lt.charCodeAt(dt)];if(pt===255)return;for(var Mt=0,St=ht-1;(pt!==0||Mt>>0,yt[St]=pt%256>>>0,pt=pt/256>>>0;if(pt!==0)throw new Error("Non-zero carry");gt=Mt,dt++}for(var Tt=ht-gt;Tt!==ht&&yt[Tt]===0;)Tt++;var vt=_Buffer.allocUnsafe(ft+(ht-Tt));vt.fill(0,0,ft);for(var Dt=ft;Tt!==ht;)vt[Dt++]=yt[Tt++];return vt}function ct(lt){var dt=at(lt);if(dt)return dt;throw new Error("Non-base"+nt+" character")}return{encode:st,decodeUnsafe:at,decode:ct}}var src=base,basex=src,ALPHABET$1="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",bs58=basex(ALPHABET$1);const base58=getDefaultExportFromCjs$1(bs58);var __importDefault$4=commonjsGlobal$1&&commonjsGlobal$1.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(explorer,"__esModule",{value:!0});explorer.getExplorerTxHash=explorer.explorerVaa=explorer.explorerTx=explorer.explorerBlock=void 0;const sdk_base_1$e=require$$0$6,bs58_1$2=__importDefault$4(bs58),buffer_1$2=buffer,explorerBlock=(s,j,$)=>s==="Mainnet"?j===(0,sdk_base_1$e.chainToChainId)("Solana")?`https://solana.fm/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Ethereum")?`https://etherscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Terra")?`https://finder.terra.money/columbus-5/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Bsc")?`https://bscscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Polygon")?`https://polygonscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Avalanche")?`https://snowtrace.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Oasis")?`https://explorer.emerald.oasis.dev/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Algorand")?`https://app.dappflow.org/explorer/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Fantom")?`https://ftmscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Karura")?`https://blockscout.karura.network/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Acala")?`https://blockscout.acala.network/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Klaytn")?`https://scope.klaytn.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Celo")?`https://explorer.celo.org/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Near")?`https://nearblocks.io/blocks/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Moonbeam")?`https://moonscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Terra2")?`https://finder.terra.money/phoenix-1/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Injective")?`https://explorer.injective.network/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sui")?`https://suiexplorer.com/checkpoint/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Aptos")?`https://explorer.aptoslabs.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Arbitrum")?`https://arbiscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Optimism")?`https://optimistic.etherscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xpla")?`https://explorer.xpla.io/mainnet/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Base")?`https://basescan.org/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sei")?`https://www.seiscan.app/pacific-1/blocks/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Scroll")?`https://scrollscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Mantle")?`https://explorer.mantle.xyz/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Blast")?`https://blastscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xlayer")?`https://www.oklink.com/xlayer/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Linea")?`https://lineascan.build/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Berachain")?`https://beratrail.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Wormchain")?`https://bigdipper.live/wormhole/blocks/${$}`:"":j===(0,sdk_base_1$e.chainToChainId)("Solana")?`https://explorer.solana.com/${$}?cluster=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Ethereum")?`https://sepolia.etherscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Bsc")?`https://testnet.bscscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Polygon")?`https://mumbai.polygonscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Avalanche")?`https://testnet.snowtrace.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Oasis")?`https://testnet.oasisscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Algorand")?`https://app.dappflow.org/explorer/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Fantom")?`https://testnet.ftmscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Acala")?`https://blockscout.mandala.aca-staging.network/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Klaytn")?`https://baobab.klaytnscope.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Celo")?`https://alfajores.celoscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Moonbeam")?`https://moonbase.moonscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sui")?`https://suiexplorer.com/checkpoint/${$}?network=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Aptos")?`https://explorer.aptoslabs.com/block/${$}?network=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Arbitrum")?`https://sepolia.arbiscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Optimism")?`https://sepolia-optimism.etherscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xpla")?`https://explorer.xpla.io/testnet/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Base")?`https://goerli.basescan.org/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sei")?`https://www.seiscan.app/atlantic-2/blocks/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Scroll")?`https://sepolia.scrollscan.com/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Mantle")?`https://explorer.sepolia.mantle.xyz/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Blast")?`https://testnet.blastscan.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xlayer")?`https://www.oklink.com/xlayer-test/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Linea")?`https://sepolia.lineascan.build/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Berachain")?`https://bartio.beratrail.io/block/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Snaxchain")?`https://explorer-snaxchain-s50q0kjngn.t.conduit.xyz/${$}`:"";explorer.explorerBlock=explorerBlock;const explorerTx=(s,j,$)=>s==="Mainnet"?j===(0,sdk_base_1$e.chainToChainId)("Solana")?`https://solana.fm/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Ethereum")?`https://etherscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Terra")?`https://finder.terra.money/columbus-5/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Bsc")?`https://bscscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Polygon")?`https://polygonscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Avalanche")?`https://snowtrace.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Oasis")?`https://explorer.emerald.oasis.dev/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Algorand")?`https://app.dappflow.org/explorer/transaction/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Fantom")?`https://ftmscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Karura")?`https://blockscout.karura.network/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Acala")?`https://blockscout.acala.network/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Klaytn")?`https://scope.klaytn.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Celo")?`https://explorer.celo.org/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Near")?`https://explorer.near.org/transactions/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Moonbeam")?`https://moonscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Terra2")?`https://finder.terra.money/phoenix-1/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Injective")?`https://explorer.injective.network/transaction/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sui")?`https://suiexplorer.com/txblock/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Aptos")?`https://explorer.aptoslabs.com/txn/${$}?network=mainnet`:j===(0,sdk_base_1$e.chainToChainId)("Arbitrum")?`https://arbiscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Optimism")?`https://optimistic.etherscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xpla")?`https://explorer.xpla.io/mainnet/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Base")?`https://basescan.org/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sei")?`https://www.seiscan.app/pacific-1/txs/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Scroll")?`https://scrollscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Mantle")?`https://explorer.mantle.xyz/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Blast")?`https://blastscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xlayer")?`https://www.oklink.com/xlayer/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Linea")?`https://lineascan.build/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Berachain")?`https://bartio.beratrail.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Wormchain")?`https://bigdipper.live/wormhole/transactions/${$}`:"":j===(0,sdk_base_1$e.chainToChainId)("Solana")?`https://solscan.io/txs/${$}?cluster=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Ethereum")?`https://sepolia.etherscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Bsc")?`https://testnet.bscscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Polygon")?`https://mumbai.polygonscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Avalanche")?`https://testnet.snowtrace.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Oasis")?`https://testnet.oasisscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Algorand")?`https://app.dappflow.org/explorer/transaction/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Fantom")?`https://testnet.ftmscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Acala")?`https://blockscout.mandala.aca-staging.network/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Klaytn")?`https://baobab.klaytnscope.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Celo")?`https://alfajores.celoscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Moonbeam")?`https://moonbase.moonscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sui")?`https://suiexplorer.com/txblock/${$}?network=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Aptos")?`https://explorer.aptoslabs.com/txn/${$}?network=testnet`:j===(0,sdk_base_1$e.chainToChainId)("Arbitrum")?`https://sepolia.arbiscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Optimism")?`https://sepolia-optimism.etherscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xpla")?`https://explorer.xpla.io/testnet/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Base")?`https://goerli.basescan.org/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Sei")?`https://www.seiscan.app/atlantic-2/txs/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Scroll")?`https://sepolia.scrollscan.com/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Mantle")?`https://explorer.sepolia.mantle.xyz/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Blast")?`https://testnet.blastscan.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Xlayer")?`https://www.oklink.com/xlayer-test/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Linea")?`https://sepolia.lineascan.build/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Berachain")?`https://bartio.beratrail.io/tx/${$}`:j===(0,sdk_base_1$e.chainToChainId)("Snaxchain")?`https://explorer-snaxchain-s50q0kjngn.t.conduit.xyz/tx/${$}`:"";explorer.explorerTx=explorerTx;const explorerVaa=(s,j)=>s==="Mainnet"?`https://wormholescan.io/#/tx/${j}`:`https://wormholescan.io/#/tx/${j}?network=TESTNET`;explorer.explorerVaa=explorerVaa;const getExplorerTxHash=(s,j,$)=>{let _e="";const et=(0,sdk_base_1$e.chainToPlatform)((0,sdk_base_1$e.chainIdToChain)(j));if(et==="Cosmwasm")_e=$.slice(2);else if(et==="Sui"||et==="Solana"){const tt=buffer_1$2.Buffer.from($.slice(2),"hex");_e=bs58_1$2.default.encode(tt)}else _e=$;return _e};explorer.getExplorerTxHash=getExplorerTxHash;var solana={},sha512={},_md={},_assert={};Object.defineProperty(_assert,"__esModule",{value:!0});_assert.output=_assert.exists=_assert.hash=_assert.bytes=_assert.bool=_assert.number=_assert.isBytes=void 0;function number$2(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`positive integer expected, not ${s}`)}_assert.number=number$2;function bool(s){if(typeof s!="boolean")throw new Error(`boolean expected, not ${s}`)}_assert.bool=bool;function isBytes$2(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}_assert.isBytes=isBytes$2;function bytes$1(s,...j){if(!isBytes$2(s))throw new Error("Uint8Array expected");if(j.length>0&&!j.includes(s.length))throw new Error(`Uint8Array expected of length ${j}, not of length=${s.length}`)}_assert.bytes=bytes$1;function hash$1(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$2(s.outputLen),number$2(s.blockLen)}_assert.hash=hash$1;function exists$1(s,j=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(j&&s.finished)throw new Error("Hash#digest() has already been called")}_assert.exists=exists$1;function output$1(s,j){bytes$1(s);const $=j.outputLen;if(s.length<$)throw new Error(`digestInto() expects output buffer of length at least ${$}`)}_assert.output=output$1;const assert$2={number:number$2,bool,bytes:bytes$1,hash:hash$1,exists:exists$1,output:output$1};_assert.default=assert$2;var utils$7={},crypto$2={};Object.defineProperty(crypto$2,"__esModule",{value:!0});crypto$2.crypto=void 0;crypto$2.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(s){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(s,"__esModule",{value:!0}),s.randomBytes=s.wrapXOFConstructorWithOpts=s.wrapConstructorWithOpts=s.wrapConstructor=s.checkOpts=s.Hash=s.concatBytes=s.toBytes=s.utf8ToBytes=s.asyncLoop=s.nextTick=s.hexToBytes=s.bytesToHex=s.byteSwap32=s.byteSwapIfBE=s.byteSwap=s.isLE=s.rotl=s.rotr=s.createView=s.u32=s.u8=s.isBytes=void 0;const j=crypto$2,$=_assert;function _e(Pt){return Pt instanceof Uint8Array||Pt!=null&&typeof Pt=="object"&&Pt.constructor.name==="Uint8Array"}s.isBytes=_e;const et=Pt=>new Uint8Array(Pt.buffer,Pt.byteOffset,Pt.byteLength);s.u8=et;const tt=Pt=>new Uint32Array(Pt.buffer,Pt.byteOffset,Math.floor(Pt.byteLength/4));s.u32=tt;const nt=Pt=>new DataView(Pt.buffer,Pt.byteOffset,Pt.byteLength);s.createView=nt;const rt=(Pt,Lt)=>Pt<<32-Lt|Pt>>>Lt;s.rotr=rt;const ot=(Pt,Lt)=>Pt<>>32-Lt>>>0;s.rotl=ot,s.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const it=Pt=>Pt<<24&4278190080|Pt<<8&16711680|Pt>>>8&65280|Pt>>>24&255;s.byteSwap=it,s.byteSwapIfBE=s.isLE?Pt=>Pt:Pt=>(0,s.byteSwap)(Pt);function st(Pt){for(let Lt=0;LtLt.toString(16).padStart(2,"0"));function ct(Pt){(0,$.bytes)(Pt);let Lt="";for(let mt=0;mt=lt._0&&Pt<=lt._9)return Pt-lt._0;if(Pt>=lt._A&&Pt<=lt._F)return Pt-(lt._A-10);if(Pt>=lt._a&&Pt<=lt._f)return Pt-(lt._a-10)}function ft(Pt){if(typeof Pt!="string")throw new Error("hex string expected, got "+typeof Pt);const Lt=Pt.length,mt=Lt/2;if(Lt%2)throw new Error("padded hex string expected, got unpadded hex of length "+Lt);const xt=new Uint8Array(mt);for(let It=0,jt=0;It{};s.nextTick=gt;async function ht(Pt,Lt,mt){let xt=Date.now();for(let It=0;It=0&&jtPt().update(pt(xt)).digest(),mt=Pt();return Lt.outputLen=mt.outputLen,Lt.blockLen=mt.blockLen,Lt.create=()=>Pt(),Lt}s.wrapConstructor=Dt;function zt(Pt){const Lt=(xt,It)=>Pt(It).update(pt(xt)).digest(),mt=Pt({});return Lt.outputLen=mt.outputLen,Lt.blockLen=mt.blockLen,Lt.create=xt=>Pt(xt),Lt}s.wrapConstructorWithOpts=zt;function Ot(Pt){const Lt=(xt,It)=>Pt(It).update(pt(xt)).digest(),mt=Pt({});return Lt.outputLen=mt.outputLen,Lt.blockLen=mt.blockLen,Lt.create=xt=>Pt(xt),Lt}s.wrapXOFConstructorWithOpts=Ot;function Ft(Pt=32){if(j.crypto&&typeof j.crypto.getRandomValues=="function")return j.crypto.getRandomValues(new Uint8Array(Pt));throw new Error("crypto.getRandomValues must be defined")}s.randomBytes=Ft})(utils$7);Object.defineProperty(_md,"__esModule",{value:!0});_md.HashMD=_md.Maj=_md.Chi=void 0;const _assert_js_1=_assert,utils_js_1$a=utils$7;function setBigUint64$1(s,j,$,_e){if(typeof s.setBigUint64=="function")return s.setBigUint64(j,$,_e);const et=BigInt(32),tt=BigInt(4294967295),nt=Number($>>et&tt),rt=Number($&tt),ot=_e?4:0,it=_e?0:4;s.setUint32(j+ot,nt,_e),s.setUint32(j+it,rt,_e)}const Chi$1=(s,j,$)=>s&j^~s&$;_md.Chi=Chi$1;const Maj$1=(s,j,$)=>s&j^s&$^j&$;_md.Maj=Maj$1;let HashMD$1=class extends utils_js_1$a.Hash{constructor(j,$,_e,et){super(),this.blockLen=j,this.outputLen=$,this.padOffset=_e,this.isLE=et,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(j),this.view=(0,utils_js_1$a.createView)(this.buffer)}update(j){(0,_assert_js_1.exists)(this);const{view:$,buffer:_e,blockLen:et}=this;j=(0,utils_js_1$a.toBytes)(j);const tt=j.length;for(let nt=0;ntet-nt&&(this.process(_e,0),nt=0);for(let at=nt;atst.length)throw new Error("_sha2: outputLen bigger than state");for(let at=0;at>_32n$1&U32_MASK64$1)}:{h:Number(s>>_32n$1&U32_MASK64$1)|0,l:Number(s&U32_MASK64$1)|0}}_u64.fromBig=fromBig$1;function split$1(s,j=!1){let $=new Uint32Array(s.length),_e=new Uint32Array(s.length);for(let et=0;etBigInt(s>>>0)<<_32n$1|BigInt(j>>>0);_u64.toBig=toBig;const shrSH=(s,j,$)=>s>>>$;_u64.shrSH=shrSH;const shrSL=(s,j,$)=>s<<32-$|j>>>$;_u64.shrSL=shrSL;const rotrSH=(s,j,$)=>s>>>$|j<<32-$;_u64.rotrSH=rotrSH;const rotrSL=(s,j,$)=>s<<32-$|j>>>$;_u64.rotrSL=rotrSL;const rotrBH=(s,j,$)=>s<<64-$|j>>>$-32;_u64.rotrBH=rotrBH;const rotrBL=(s,j,$)=>s>>>$-32|j<<64-$;_u64.rotrBL=rotrBL;const rotr32H=(s,j)=>j;_u64.rotr32H=rotr32H;const rotr32L=(s,j)=>s;_u64.rotr32L=rotr32L;const rotlSH$1=(s,j,$)=>s<<$|j>>>32-$;_u64.rotlSH=rotlSH$1;const rotlSL$1=(s,j,$)=>j<<$|s>>>32-$;_u64.rotlSL=rotlSL$1;const rotlBH$1=(s,j,$)=>j<<$-32|s>>>64-$;_u64.rotlBH=rotlBH$1;const rotlBL$1=(s,j,$)=>s<<$-32|j>>>64-$;_u64.rotlBL=rotlBL$1;function add(s,j,$,_e){const et=(j>>>0)+(_e>>>0);return{h:s+$+(et/2**32|0)|0,l:et|0}}_u64.add=add;const add3L=(s,j,$)=>(s>>>0)+(j>>>0)+($>>>0);_u64.add3L=add3L;const add3H=(s,j,$,_e)=>j+$+_e+(s/2**32|0)|0;_u64.add3H=add3H;const add4L=(s,j,$,_e)=>(s>>>0)+(j>>>0)+($>>>0)+(_e>>>0);_u64.add4L=add4L;const add4H=(s,j,$,_e,et)=>j+$+_e+et+(s/2**32|0)|0;_u64.add4H=add4H;const add5L=(s,j,$,_e,et)=>(s>>>0)+(j>>>0)+($>>>0)+(_e>>>0)+(et>>>0);_u64.add5L=add5L;const add5H=(s,j,$,_e,et,tt)=>j+$+_e+et+tt+(s/2**32|0)|0;_u64.add5H=add5H;const u64$1={fromBig:fromBig$1,split:split$1,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH:rotlSH$1,rotlSL:rotlSL$1,rotlBH:rotlBH$1,rotlBL:rotlBL$1,add,add3L,add3H,add4L,add4H,add5H,add5L};_u64.default=u64$1;Object.defineProperty(sha512,"__esModule",{value:!0});sha512.sha384=sha512.sha512_256=sha512.sha512_224=sha512_1=sha512.sha512=sha512.SHA512=void 0;const _md_js_1=_md,_u64_js_1=_u64,utils_js_1$9=utils$7,[SHA512_Kh,SHA512_Kl]=_u64_js_1.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(s=>BigInt(s))),SHA512_W_H=new Uint32Array(80),SHA512_W_L=new Uint32Array(80);class SHA512 extends _md_js_1.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:j,Al:$,Bh:_e,Bl:et,Ch:tt,Cl:nt,Dh:rt,Dl:ot,Eh:it,El:st,Fh:at,Fl:ct,Gh:lt,Gl:dt,Hh:ft,Hl:gt}=this;return[j,$,_e,et,tt,nt,rt,ot,it,st,at,ct,lt,dt,ft,gt]}set(j,$,_e,et,tt,nt,rt,ot,it,st,at,ct,lt,dt,ft,gt){this.Ah=j|0,this.Al=$|0,this.Bh=_e|0,this.Bl=et|0,this.Ch=tt|0,this.Cl=nt|0,this.Dh=rt|0,this.Dl=ot|0,this.Eh=it|0,this.El=st|0,this.Fh=at|0,this.Fl=ct|0,this.Gh=lt|0,this.Gl=dt|0,this.Hh=ft|0,this.Hl=gt|0}process(j,$){for(let pt=0;pt<16;pt++,$+=4)SHA512_W_H[pt]=j.getUint32($),SHA512_W_L[pt]=j.getUint32($+=4);for(let pt=16;pt<80;pt++){const Mt=SHA512_W_H[pt-15]|0,St=SHA512_W_L[pt-15]|0,Tt=_u64_js_1.default.rotrSH(Mt,St,1)^_u64_js_1.default.rotrSH(Mt,St,8)^_u64_js_1.default.shrSH(Mt,St,7),vt=_u64_js_1.default.rotrSL(Mt,St,1)^_u64_js_1.default.rotrSL(Mt,St,8)^_u64_js_1.default.shrSL(Mt,St,7),Dt=SHA512_W_H[pt-2]|0,zt=SHA512_W_L[pt-2]|0,Ot=_u64_js_1.default.rotrSH(Dt,zt,19)^_u64_js_1.default.rotrBH(Dt,zt,61)^_u64_js_1.default.shrSH(Dt,zt,6),Ft=_u64_js_1.default.rotrSL(Dt,zt,19)^_u64_js_1.default.rotrBL(Dt,zt,61)^_u64_js_1.default.shrSL(Dt,zt,6),Pt=_u64_js_1.default.add4L(vt,Ft,SHA512_W_L[pt-7],SHA512_W_L[pt-16]),Lt=_u64_js_1.default.add4H(Pt,Tt,Ot,SHA512_W_H[pt-7],SHA512_W_H[pt-16]);SHA512_W_H[pt]=Lt|0,SHA512_W_L[pt]=Pt|0}let{Ah:_e,Al:et,Bh:tt,Bl:nt,Ch:rt,Cl:ot,Dh:it,Dl:st,Eh:at,El:ct,Fh:lt,Fl:dt,Gh:ft,Gl:gt,Hh:ht,Hl:yt}=this;for(let pt=0;pt<80;pt++){const Mt=_u64_js_1.default.rotrSH(at,ct,14)^_u64_js_1.default.rotrSH(at,ct,18)^_u64_js_1.default.rotrBH(at,ct,41),St=_u64_js_1.default.rotrSL(at,ct,14)^_u64_js_1.default.rotrSL(at,ct,18)^_u64_js_1.default.rotrBL(at,ct,41),Tt=at<^~at&ft,vt=ct&dt^~ct>,Dt=_u64_js_1.default.add5L(yt,St,vt,SHA512_Kl[pt],SHA512_W_L[pt]),zt=_u64_js_1.default.add5H(Dt,ht,Mt,Tt,SHA512_Kh[pt],SHA512_W_H[pt]),Ot=Dt|0,Ft=_u64_js_1.default.rotrSH(_e,et,28)^_u64_js_1.default.rotrBH(_e,et,34)^_u64_js_1.default.rotrBH(_e,et,39),Pt=_u64_js_1.default.rotrSL(_e,et,28)^_u64_js_1.default.rotrBL(_e,et,34)^_u64_js_1.default.rotrBL(_e,et,39),Lt=_e&tt^_e&rt^tt&rt,mt=et&nt^et&ot^nt&ot;ht=ft|0,yt=gt|0,ft=lt|0,gt=dt|0,lt=at|0,dt=ct|0,{h:at,l:ct}=_u64_js_1.default.add(it|0,st|0,zt|0,Ot|0),it=rt|0,st=ot|0,rt=tt|0,ot=nt|0,tt=_e|0,nt=et|0;const xt=_u64_js_1.default.add3L(Ot,Pt,mt);_e=_u64_js_1.default.add3H(xt,zt,Ft,Lt),et=xt|0}({h:_e,l:et}=_u64_js_1.default.add(this.Ah|0,this.Al|0,_e|0,et|0)),{h:tt,l:nt}=_u64_js_1.default.add(this.Bh|0,this.Bl|0,tt|0,nt|0),{h:rt,l:ot}=_u64_js_1.default.add(this.Ch|0,this.Cl|0,rt|0,ot|0),{h:it,l:st}=_u64_js_1.default.add(this.Dh|0,this.Dl|0,it|0,st|0),{h:at,l:ct}=_u64_js_1.default.add(this.Eh|0,this.El|0,at|0,ct|0),{h:lt,l:dt}=_u64_js_1.default.add(this.Fh|0,this.Fl|0,lt|0,dt|0),{h:ft,l:gt}=_u64_js_1.default.add(this.Gh|0,this.Gl|0,ft|0,gt|0),{h:ht,l:yt}=_u64_js_1.default.add(this.Hh|0,this.Hl|0,ht|0,yt|0),this.set(_e,et,tt,nt,rt,ot,it,st,at,ct,lt,dt,ft,gt,ht,yt)}roundClean(){SHA512_W_H.fill(0),SHA512_W_L.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)}}sha512.SHA512=SHA512;class SHA512_224 extends SHA512{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}}class SHA512_256 extends SHA512{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}}class SHA384 extends SHA512{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}}var sha512_1=sha512.sha512=(0,utils_js_1$9.wrapConstructor)(()=>new SHA512);sha512.sha512_224=(0,utils_js_1$9.wrapConstructor)(()=>new SHA512_224);sha512.sha512_256=(0,utils_js_1$9.wrapConstructor)(()=>new SHA512_256);sha512.sha384=(0,utils_js_1$9.wrapConstructor)(()=>new SHA384);const crypto$1=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function number$1(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`positive integer expected, not ${s}`)}function isBytes$1(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function bytes(s,...j){if(!isBytes$1(s))throw new Error("Uint8Array expected");if(j.length>0&&!j.includes(s.length))throw new Error(`Uint8Array expected of length ${j}, not of length=${s.length}`)}function hash(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$1(s.outputLen),number$1(s.blockLen)}function exists(s,j=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(j&&s.finished)throw new Error("Hash#digest() has already been called")}function output(s,j){bytes(s);const $=j.outputLen;if(s.length<$)throw new Error(`digestInto() expects output buffer of length at least ${$}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32$1=s=>new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)),createView=s=>new DataView(s.buffer,s.byteOffset,s.byteLength),rotr=(s,j)=>s<<32-j|s>>>j,isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,byteSwap=s=>s<<24&4278190080|s<<8&16711680|s>>>8&65280|s>>>24&255;function byteSwap32(s){for(let j=0;js().update(toBytes(_e)).digest(),$=s();return j.outputLen=$.outputLen,j.blockLen=$.blockLen,j.create=()=>s(),j}function wrapXOFConstructorWithOpts(s){const j=(_e,et)=>s(et).update(toBytes(_e)).digest(),$=s({});return j.outputLen=$.outputLen,j.blockLen=$.blockLen,j.create=_e=>s(_e),j}function randomBytes(s=32){if(crypto$1&&typeof crypto$1.getRandomValues=="function")return crypto$1.getRandomValues(new Uint8Array(s));throw new Error("crypto.getRandomValues must be defined")}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$8=BigInt(0),_1n$8=BigInt(1),_2n$6=BigInt(2);function isBytes(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function abytes(s){if(!isBytes(s))throw new Error("Uint8Array expected")}const hexes=Array.from({length:256},(s,j)=>j.toString(16).padStart(2,"0"));function bytesToHex(s){abytes(s);let j="";for(let $=0;$=asciis._0&&s<=asciis._9)return s-asciis._0;if(s>=asciis._A&&s<=asciis._F)return s-(asciis._A-10);if(s>=asciis._a&&s<=asciis._f)return s-(asciis._a-10)}function hexToBytes(s){if(typeof s!="string")throw new Error("hex string expected, got "+typeof s);const j=s.length,$=j/2;if(j%2)throw new Error("padded hex string expected, got unpadded hex of length "+j);const _e=new Uint8Array($);for(let et=0,tt=0;et<$;et++,tt+=2){const nt=asciiToBase16(s.charCodeAt(tt)),rt=asciiToBase16(s.charCodeAt(tt+1));if(nt===void 0||rt===void 0){const ot=s[tt]+s[tt+1];throw new Error('hex string expected, got non-hex character "'+ot+'" at index '+tt)}_e[et]=nt*16+rt}return _e}function bytesToNumberBE(s){return hexToNumber(bytesToHex(s))}function bytesToNumberLE(s){return abytes(s),hexToNumber(bytesToHex(Uint8Array.from(s).reverse()))}function numberToBytesBE(s,j){return hexToBytes(s.toString(16).padStart(j*2,"0"))}function numberToBytesLE(s,j){return numberToBytesBE(s,j).reverse()}function numberToVarBytesBE(s){return hexToBytes(numberToHexUnpadded(s))}function ensureBytes(s,j,$){let _e;if(typeof j=="string")try{_e=hexToBytes(j)}catch(tt){throw new Error(`${s} must be valid hex string, got "${j}". Cause: ${tt}`)}else if(isBytes(j))_e=Uint8Array.from(j);else throw new Error(`${s} must be hex string or Uint8Array`);const et=_e.length;if(typeof $=="number"&&et!==$)throw new Error(`${s} expected ${$} bytes, got ${et}`);return _e}function concatBytes(...s){let j=0;for(let _e=0;_e_0n$8;s>>=_1n$8,j+=1);return j}function bitGet(s,j){return s>>BigInt(j)&_1n$8}function bitSet(s,j,$){return s|($?_1n$8:_0n$8)<(_2n$6<new Uint8Array(s),u8fr=s=>Uint8Array.from(s);function createHmacDrbg(s,j,$){if(typeof s!="number"||s<2)throw new Error("hashLen must be a number");if(typeof j!="number"||j<2)throw new Error("qByteLen must be a number");if(typeof $!="function")throw new Error("hmacFn must be a function");let _e=u8n(s),et=u8n(s),tt=0;const nt=()=>{_e.fill(1),et.fill(0),tt=0},rt=(...at)=>$(et,_e,...at),ot=(at=u8n())=>{et=rt(u8fr([0]),at),_e=rt(),at.length!==0&&(et=rt(u8fr([1]),at),_e=rt())},it=()=>{if(tt++>=1e3)throw new Error("drbg: tried 1000 values");let at=0;const ct=[];for(;at{nt(),ot(at);let lt;for(;!(lt=ct(it()));)ot();return nt(),lt}}const validatorFns={bigint:s=>typeof s=="bigint",function:s=>typeof s=="function",boolean:s=>typeof s=="boolean",string:s=>typeof s=="string",stringOrUint8Array:s=>typeof s=="string"||isBytes(s),isSafeInteger:s=>Number.isSafeInteger(s),array:s=>Array.isArray(s),field:(s,j)=>j.Fp.isValid(s),hash:s=>typeof s=="function"&&Number.isSafeInteger(s.outputLen)};function validateObject(s,j,$={}){const _e=(et,tt,nt)=>{const rt=validatorFns[tt];if(typeof rt!="function")throw new Error(`Invalid validator "${tt}", expected function`);const ot=s[et];if(!(nt&&ot===void 0)&&!rt(ot,s))throw new Error(`Invalid param ${String(et)}=${ot} (${typeof ot}), expected ${tt}`)};for(const[et,tt]of Object.entries(j))_e(et,tt,!1);for(const[et,tt]of Object.entries($))_e(et,tt,!0);return s}const ut=Object.freeze(Object.defineProperty({__proto__:null,abytes,bitGet,bitLen,bitMask,bitSet,bytesToHex,bytesToNumberBE,bytesToNumberLE,concatBytes,createHmacDrbg,ensureBytes,equalBytes,hexToBytes,hexToNumber,isBytes,numberToBytesBE,numberToBytesLE,numberToHexUnpadded,numberToVarBytesBE,utf8ToBytes,validateObject},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$7=BigInt(0),_1n$7=BigInt(1),_2n$5=BigInt(2),_3n$1=BigInt(3),_4n$1=BigInt(4),_5n$1=BigInt(5),_8n$1=BigInt(8);BigInt(9);BigInt(16);function mod(s,j){const $=s%j;return $>=_0n$7?$:j+$}function pow(s,j,$){if($<=_0n$7||j<_0n$7)throw new Error("Expected power/modulo > 0");if($===_1n$7)return _0n$7;let _e=_1n$7;for(;j>_0n$7;)j&_1n$7&&(_e=_e*s%$),s=s*s%$,j>>=_1n$7;return _e}function pow2(s,j,$){let _e=s;for(;j-- >_0n$7;)_e*=_e,_e%=$;return _e}function invert(s,j){if(s===_0n$7||j<=_0n$7)throw new Error(`invert: expected positive integers, got n=${s} mod=${j}`);let $=mod(s,j),_e=j,et=_0n$7,tt=_1n$7;for(;$!==_0n$7;){const rt=_e/$,ot=_e%$,it=et-tt*rt;_e=$,$=ot,et=tt,tt=it}if(_e!==_1n$7)throw new Error("invert: does not exist");return mod(et,j)}function tonelliShanks(s){const j=(s-_1n$7)/_2n$5;let $,_e,et;for($=s-_1n$7,_e=0;$%_2n$5===_0n$7;$/=_2n$5,_e++);for(et=_2n$5;et(mod(s,j)&_1n$7)===_1n$7,FIELD_FIELDS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField(s){const j={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},$=FIELD_FIELDS.reduce((_e,et)=>(_e[et]="function",_e),j);return validateObject(s,$)}function FpPow(s,j,$){if($<_0n$7)throw new Error("Expected power > 0");if($===_0n$7)return s.ONE;if($===_1n$7)return j;let _e=s.ONE,et=j;for(;$>_0n$7;)$&_1n$7&&(_e=s.mul(_e,et)),et=s.sqr(et),$>>=_1n$7;return _e}function FpInvertBatch(s,j){const $=new Array(j.length),_e=j.reduce((tt,nt,rt)=>s.is0(nt)?tt:($[rt]=tt,s.mul(tt,nt)),s.ONE),et=s.inv(_e);return j.reduceRight((tt,nt,rt)=>s.is0(nt)?tt:($[rt]=s.mul(tt,$[rt]),s.mul(tt,nt)),et),$}function nLength(s,j){const $=j!==void 0?j:s.toString(2).length,_e=Math.ceil($/8);return{nBitLength:$,nByteLength:_e}}function Field(s,j,$=!1,_e={}){if(s<=_0n$7)throw new Error(`Expected Field ORDER > 0, got ${s}`);const{nBitLength:et,nByteLength:tt}=nLength(s,j);if(tt>2048)throw new Error("Field lengths over 2048 bytes are not supported");const nt=FpSqrt(s),rt=Object.freeze({ORDER:s,BITS:et,BYTES:tt,MASK:bitMask(et),ZERO:_0n$7,ONE:_1n$7,create:ot=>mod(ot,s),isValid:ot=>{if(typeof ot!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof ot}`);return _0n$7<=ot&&otot===_0n$7,isOdd:ot=>(ot&_1n$7)===_1n$7,neg:ot=>mod(-ot,s),eql:(ot,it)=>ot===it,sqr:ot=>mod(ot*ot,s),add:(ot,it)=>mod(ot+it,s),sub:(ot,it)=>mod(ot-it,s),mul:(ot,it)=>mod(ot*it,s),pow:(ot,it)=>FpPow(rt,ot,it),div:(ot,it)=>mod(ot*invert(it,s),s),sqrN:ot=>ot*ot,addN:(ot,it)=>ot+it,subN:(ot,it)=>ot-it,mulN:(ot,it)=>ot*it,inv:ot=>invert(ot,s),sqrt:_e.sqrt||(ot=>nt(rt,ot)),invertBatch:ot=>FpInvertBatch(rt,ot),cmov:(ot,it,st)=>st?it:ot,toBytes:ot=>$?numberToBytesLE(ot,tt):numberToBytesBE(ot,tt),fromBytes:ot=>{if(ot.length!==tt)throw new Error(`Fp.fromBytes: expected ${tt}, got ${ot.length}`);return $?bytesToNumberLE(ot):bytesToNumberBE(ot)}});return Object.freeze(rt)}function FpSqrtEven(s,j){if(!s.isOdd)throw new Error("Field doesn't have isOdd");const $=s.sqrt(j);return s.isOdd($)?s.neg($):$}function getFieldBytesLength(s){if(typeof s!="bigint")throw new Error("field order must be bigint");const j=s.toString(2).length;return Math.ceil(j/8)}function getMinHashLength(s){const j=getFieldBytesLength(s);return j+Math.ceil(j/2)}function mapHashToField(s,j,$=!1){const _e=s.length,et=getFieldBytesLength(j),tt=getMinHashLength(j);if(_e<16||_e1024)throw new Error(`expected ${tt}-1024 bytes of input, got ${_e}`);const nt=$?bytesToNumberBE(s):bytesToNumberLE(s),rt=mod(nt,j-_1n$7)+_1n$7;return $?numberToBytesLE(rt,et):numberToBytesBE(rt,et)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$6=BigInt(0),_1n$6=BigInt(1);function wNAF(s,j){const $=(et,tt)=>{const nt=tt.negate();return et?nt:tt},_e=et=>{const tt=Math.ceil(j/et)+1,nt=2**(et-1);return{windows:tt,windowSize:nt}};return{constTimeNegate:$,unsafeLadder(et,tt){let nt=s.ZERO,rt=et;for(;tt>_0n$6;)tt&_1n$6&&(nt=nt.add(rt)),rt=rt.double(),tt>>=_1n$6;return nt},precomputeWindow(et,tt){const{windows:nt,windowSize:rt}=_e(tt),ot=[];let it=et,st=it;for(let at=0;at>=lt,gt>ot&&(gt-=ct,nt+=_1n$6);const ht=ft,yt=ft+Math.abs(gt)-1,pt=dt%2!==0,Mt=gt<0;gt===0?st=st.add($(pt,tt[ht])):it=it.add($(Mt,tt[yt]))}return{p:it,f:st}},wNAFCached(et,tt,nt,rt){const ot=et._WINDOW_SIZE||1;let it=tt.get(et);return it||(it=this.precomputeWindow(et,ot),ot!==1&&tt.set(et,rt(it))),this.wNAF(ot,it,nt)}}}function validateBasic(s){return validateField(s.Fp),validateObject(s,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(s.n,s.nBitLength),...s,p:s.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$5=BigInt(0),_1n$5=BigInt(1),_2n$4=BigInt(2),_8n=BigInt(8),VERIFY_DEFAULT={zip215:!0};function validateOpts$2(s){const j=validateBasic(s);return validateObject(s,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...j})}function twistedEdwards(s){const j=validateOpts$2(s),{Fp:$,n:_e,prehash:et,hash:tt,randomBytes:nt,nByteLength:rt,h:ot}=j,it=_2n$4<{try{return{isValid:!0,value:$.sqrt(At*$.inv(wt))}}catch{return{isValid:!1,value:_0n$5}}}),ct=j.adjustScalarBytes||(At=>At),lt=j.domain||((At,wt,Rt)=>{if(wt.length||Rt)throw new Error("Contexts/pre-hash are not supported");return At}),dt=At=>typeof At=="bigint"&&_0n$5dt(At)&&dt(wt)&&AtAt===_0n$5||ft(At,it);function ht(At,wt){if(ft(At,wt))return At;throw new Error(`Expected valid scalar < ${wt}, got ${typeof At} ${At}`)}function yt(At){return At===_0n$5?At:ht(At,_e)}const pt=new Map;function Mt(At){if(!(At instanceof St))throw new Error("ExtendedPoint expected")}class St{constructor(wt,Rt,Nt,Ct){if(this.ex=wt,this.ey=Rt,this.ez=Nt,this.et=Ct,!gt(wt))throw new Error("x required");if(!gt(Rt))throw new Error("y required");if(!gt(Nt))throw new Error("z required");if(!gt(Ct))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(wt){if(wt instanceof St)throw new Error("extended point not allowed");const{x:Rt,y:Nt}=wt||{};if(!gt(Rt)||!gt(Nt))throw new Error("invalid affine point");return new St(Rt,Nt,_1n$5,st(Rt*Nt))}static normalizeZ(wt){const Rt=$.invertBatch(wt.map(Nt=>Nt.ez));return wt.map((Nt,Ct)=>Nt.toAffine(Rt[Ct])).map(St.fromAffine)}_setWindowSize(wt){this._WINDOW_SIZE=wt,pt.delete(this)}assertValidity(){const{a:wt,d:Rt}=j;if(this.is0())throw new Error("bad point: ZERO");const{ex:Nt,ey:Ct,ez:Bt,et:Gt}=this,Vt=st(Nt*Nt),Yt=st(Ct*Ct),Qt=st(Bt*Bt),qt=st(Qt*Qt),Zt=st(Vt*wt),fn=st(Qt*st(Zt+Yt)),Xt=st(qt+st(Rt*st(Vt*Yt)));if(fn!==Xt)throw new Error("bad point: equation left != right (1)");const on=st(Nt*Ct),tn=st(Bt*Gt);if(on!==tn)throw new Error("bad point: equation left != right (2)")}equals(wt){Mt(wt);const{ex:Rt,ey:Nt,ez:Ct}=this,{ex:Bt,ey:Gt,ez:Vt}=wt,Yt=st(Rt*Vt),Qt=st(Bt*Ct),qt=st(Nt*Vt),Zt=st(Gt*Ct);return Yt===Qt&&qt===Zt}is0(){return this.equals(St.ZERO)}negate(){return new St(st(-this.ex),this.ey,this.ez,st(-this.et))}double(){const{a:wt}=j,{ex:Rt,ey:Nt,ez:Ct}=this,Bt=st(Rt*Rt),Gt=st(Nt*Nt),Vt=st(_2n$4*st(Ct*Ct)),Yt=st(wt*Bt),Qt=Rt+Nt,qt=st(st(Qt*Qt)-Bt-Gt),Zt=Yt+Gt,fn=Zt-Vt,Xt=Yt-Gt,on=st(qt*fn),tn=st(Zt*Xt),Kt=st(qt*Xt),Jt=st(fn*Zt);return new St(on,tn,Jt,Kt)}add(wt){Mt(wt);const{a:Rt,d:Nt}=j,{ex:Ct,ey:Bt,ez:Gt,et:Vt}=this,{ex:Yt,ey:Qt,ez:qt,et:Zt}=wt;if(Rt===BigInt(-1)){const Mn=st((Bt-Ct)*(Qt+Yt)),hn=st((Bt+Ct)*(Qt-Yt)),ln=st(hn-Mn);if(ln===_0n$5)return this.double();const Cn=st(Gt*_2n$4*Zt),gn=st(Vt*_2n$4*qt),$t=gn+Cn,bt=hn+Mn,Et=gn-Cn,kt=st($t*ln),Ut=st(bt*Et),Ht=st($t*Et),Wt=st(ln*bt);return new St(kt,Ut,Wt,Ht)}const fn=st(Ct*Yt),Xt=st(Bt*Qt),on=st(Vt*Nt*Zt),tn=st(Gt*qt),Kt=st((Ct+Bt)*(Yt+Qt)-fn-Xt),Jt=tn-on,En=tn+on,pn=st(Xt-Rt*fn),cn=st(Kt*Jt),Tn=st(En*pn),sn=st(Kt*pn),an=st(Jt*En);return new St(cn,Tn,an,sn)}subtract(wt){return this.add(wt.negate())}wNAF(wt){return Dt.wNAFCached(this,pt,wt,St.normalizeZ)}multiply(wt){const{p:Rt,f:Nt}=this.wNAF(ht(wt,_e));return St.normalizeZ([Rt,Nt])[0]}multiplyUnsafe(wt){let Rt=yt(wt);return Rt===_0n$5?vt:this.equals(vt)||Rt===_1n$5?this:this.equals(Tt)?this.wNAF(Rt).p:Dt.unsafeLadder(this,Rt)}isSmallOrder(){return this.multiplyUnsafe(ot).is0()}isTorsionFree(){return Dt.unsafeLadder(this,_e).is0()}toAffine(wt){const{ex:Rt,ey:Nt,ez:Ct}=this,Bt=this.is0();wt==null&&(wt=Bt?_8n:$.inv(Ct));const Gt=st(Rt*wt),Vt=st(Nt*wt),Yt=st(Ct*wt);if(Bt)return{x:_0n$5,y:_1n$5};if(Yt!==_1n$5)throw new Error("invZ was invalid");return{x:Gt,y:Vt}}clearCofactor(){const{h:wt}=j;return wt===_1n$5?this:this.multiplyUnsafe(wt)}static fromHex(wt,Rt=!1){const{d:Nt,a:Ct}=j,Bt=$.BYTES;wt=ensureBytes("pointHex",wt,Bt);const Gt=wt.slice(),Vt=wt[Bt-1];Gt[Bt-1]=Vt&-129;const Yt=bytesToNumberLE(Gt);Yt===_0n$5||(Rt?ht(Yt,it):ht(Yt,$.ORDER));const Qt=st(Yt*Yt),qt=st(Qt-_1n$5),Zt=st(Nt*Qt-Ct);let{isValid:fn,value:Xt}=at(qt,Zt);if(!fn)throw new Error("Point.fromHex: invalid y coordinate");const on=(Xt&_1n$5)===_1n$5,tn=(Vt&128)!==0;if(!Rt&&Xt===_0n$5&&tn)throw new Error("Point.fromHex: x=0 and x_0=1");return tn!==on&&(Xt=st(-Xt)),St.fromAffine({x:Xt,y:Yt})}static fromPrivateKey(wt){return Ft(wt).point}toRawBytes(){const{x:wt,y:Rt}=this.toAffine(),Nt=numberToBytesLE(Rt,$.BYTES);return Nt[Nt.length-1]|=wt&_1n$5?128:0,Nt}toHex(){return bytesToHex(this.toRawBytes())}}St.BASE=new St(j.Gx,j.Gy,_1n$5,st(j.Gx*j.Gy)),St.ZERO=new St(_0n$5,_1n$5,_1n$5,_0n$5);const{BASE:Tt,ZERO:vt}=St,Dt=wNAF(St,rt*8);function zt(At){return mod(At,_e)}function Ot(At){return zt(bytesToNumberLE(At))}function Ft(At){const wt=rt;At=ensureBytes("private key",At,wt);const Rt=ensureBytes("hashed private key",tt(At),2*wt),Nt=ct(Rt.slice(0,wt)),Ct=Rt.slice(wt,2*wt),Bt=Ot(Nt),Gt=Tt.multiply(Bt),Vt=Gt.toRawBytes();return{head:Nt,prefix:Ct,scalar:Bt,point:Gt,pointBytes:Vt}}function Pt(At){return Ft(At).pointBytes}function Lt(At=new Uint8Array,...wt){const Rt=concatBytes(...wt);return Ot(tt(lt(Rt,ensureBytes("context",At),!!et)))}function mt(At,wt,Rt={}){At=ensureBytes("message",At),et&&(At=et(At));const{prefix:Nt,scalar:Ct,pointBytes:Bt}=Ft(wt),Gt=Lt(Rt.context,Nt,At),Vt=Tt.multiply(Gt).toRawBytes(),Yt=Lt(Rt.context,Vt,Bt,At),Qt=zt(Gt+Yt*Ct);yt(Qt);const qt=concatBytes(Vt,numberToBytesLE(Qt,$.BYTES));return ensureBytes("result",qt,rt*2)}const xt=VERIFY_DEFAULT;function It(At,wt,Rt,Nt=xt){const{context:Ct,zip215:Bt}=Nt,Gt=$.BYTES;At=ensureBytes("signature",At,2*Gt),wt=ensureBytes("message",wt),et&&(wt=et(wt));const Vt=bytesToNumberLE(At.slice(Gt,2*Gt));let Yt,Qt,qt;try{Yt=St.fromHex(Rt,Bt),Qt=St.fromHex(At.slice(0,Gt),Bt),qt=Tt.multiplyUnsafe(Vt)}catch{return!1}if(!Bt&&Yt.isSmallOrder())return!1;const Zt=Lt(Ct,Qt.toRawBytes(),Yt.toRawBytes(),wt);return Qt.add(Yt.multiplyUnsafe(Zt)).subtract(qt).clearCofactor().equals(St.ZERO)}return Tt._setWindowSize(8),{CURVE:j,getPublicKey:Pt,sign:mt,verify:It,ExtendedPoint:St,utils:{getExtendedPublicKey:Ft,randomPrivateKey:()=>nt($.BYTES),precompute(At=8,wt=St.BASE){return wt._setWindowSize(At),wt.multiply(BigInt(3)),wt}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$4=BigInt(0),_1n$4=BigInt(1);function validateOpts$1(s){return validateObject(s,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...s})}function montgomery(s){const j=validateOpts$1(s),{P:$}=j,_e=pt=>mod(pt,$),et=j.montgomeryBits,tt=Math.ceil(et/8),nt=j.nByteLength,rt=j.adjustScalarBytes||(pt=>pt),ot=j.powPminus2||(pt=>pow(pt,$-BigInt(2),$));function it(pt,Mt,St){const Tt=_e(pt*(Mt-St));return Mt=_e(Mt-Tt),St=_e(St+Tt),[Mt,St]}function st(pt){if(typeof pt=="bigint"&&_0n$4<=pt&&pt<$)return pt;throw new Error("Expected valid scalar 0 < scalar < CURVE.P")}const at=(j.a-BigInt(2))/BigInt(4);function ct(pt,Mt){const St=st(pt),Tt=st(Mt),vt=St;let Dt=_1n$4,zt=_0n$4,Ot=St,Ft=_1n$4,Pt=_0n$4,Lt;for(let xt=BigInt(et-1);xt>=_0n$4;xt--){const It=Tt>>xt&_1n$4;Pt^=It,Lt=it(Pt,Dt,Ot),Dt=Lt[0],Ot=Lt[1],Lt=it(Pt,zt,Ft),zt=Lt[0],Ft=Lt[1],Pt=It;const jt=Dt+zt,At=_e(jt*jt),wt=Dt-zt,Rt=_e(wt*wt),Nt=At-Rt,Ct=Ot+Ft,Bt=Ot-Ft,Gt=_e(Bt*jt),Vt=_e(Ct*wt),Yt=Gt+Vt,Qt=Gt-Vt;Ot=_e(Yt*Yt),Ft=_e(vt*_e(Qt*Qt)),Dt=_e(At*Rt),zt=_e(Nt*(At+_e(at*Nt)))}Lt=it(Pt,Dt,Ot),Dt=Lt[0],Ot=Lt[1],Lt=it(Pt,zt,Ft),zt=Lt[0],Ft=Lt[1];const mt=ot(zt);return _e(Dt*mt)}function lt(pt){return numberToBytesLE(_e(pt),tt)}function dt(pt){const Mt=ensureBytes("u coordinate",pt,tt);return nt===32&&(Mt[31]&=127),bytesToNumberLE(Mt)}function ft(pt){const Mt=ensureBytes("scalar",pt),St=Mt.length;if(St!==tt&&St!==nt)throw new Error(`Expected ${tt} or ${nt} bytes, got ${St}`);return bytesToNumberLE(rt(Mt))}function gt(pt,Mt){const St=dt(Mt),Tt=ft(pt),vt=ct(St,Tt);if(vt===_0n$4)throw new Error("Invalid private or public key received");return lt(vt)}const ht=lt(j.Gu);function yt(pt){return gt(pt,ht)}return{scalarMult:gt,scalarMultBase:yt,getSharedSecret:(pt,Mt)=>gt(pt,Mt),getPublicKey:pt=>yt(pt),utils:{randomPrivateKey:()=>j.randomBytes(j.nByteLength)},GuBytes:ht}}const os2ip=bytesToNumberBE;function i2osp(s,j){if(s<0||s>=1<<8*j)throw new Error(`bad I2OSP call: value=${s} length=${j}`);const $=Array.from({length:j}).fill(0);for(let _e=j-1;_e>=0;_e--)$[_e]=s&255,s>>>=8;return new Uint8Array($)}function strxor(s,j){const $=new Uint8Array(s.length);for(let _e=0;_e255&&(j=_e(concatBytes(utf8ToBytes("H2C-OVERSIZE-DST-"),j)));const{outputLen:et,blockLen:tt}=_e,nt=Math.ceil($/et);if(nt>255)throw new Error("Invalid xmd length");const rt=concatBytes(j,i2osp(j.length,1)),ot=i2osp(0,tt),it=i2osp($,2),st=new Array(nt),at=_e(concatBytes(ot,s,it,i2osp(0,1),rt));st[0]=_e(concatBytes(at,i2osp(1,1),rt));for(let lt=1;lt<=nt;lt++){const dt=[strxor(at,st[lt-1]),i2osp(lt+1,1),rt];st[lt]=_e(concatBytes(...dt))}return concatBytes(...st).slice(0,$)}function expand_message_xof(s,j,$,_e,et){if(abytes(s),abytes(j),anum($),j.length>255){const tt=Math.ceil(2*_e/8);j=et.create({dkLen:tt}).update(utf8ToBytes("H2C-OVERSIZE-DST-")).update(j).digest()}if($>65535||j.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return et.create({dkLen:$}).update(s).update(i2osp($,2)).update(j).update(i2osp(j.length,1)).digest()}function hash_to_field(s,j,$){validateObject($,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:_e,k:et,m:tt,hash:nt,expand:rt,DST:ot}=$;abytes(s),anum(j);const it=typeof ot=="string"?utf8ToBytes(ot):ot,st=_e.toString(2).length,at=Math.ceil((st+et)/8),ct=j*tt*at;let lt;if(rt==="xmd")lt=expand_message_xmd(s,it,ct,nt);else if(rt==="xof")lt=expand_message_xof(s,it,ct,et,nt);else if(rt==="_internal_pass")lt=s;else throw new Error('expand must be "xmd" or "xof"');const dt=new Array(j);for(let ft=0;ftArray.from(_e).reverse());return(_e,et)=>{const[tt,nt,rt,ot]=$.map(it=>it.reduce((st,at)=>s.add(s.mul(st,_e),at)));return _e=s.div(tt,nt),et=s.mul(et,s.div(rt,ot)),{x:_e,y:et}}}function createHasher(s,j,$){if(typeof j!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(_e,et){const tt=hash_to_field(_e,2,{...$,DST:$.DST,...et}),nt=s.fromAffine(j(tt[0])),rt=s.fromAffine(j(tt[1])),ot=nt.add(rt).clearCofactor();return ot.assertValidity(),ot},encodeToCurve(_e,et){const tt=hash_to_field(_e,1,{...$,DST:$.encodeDST,...et}),nt=s.fromAffine(j(tt[0])).clearCofactor();return nt.assertValidity(),nt}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ED25519_P=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),ED25519_SQRT_M1=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),_0n$3=BigInt(0),_1n$3=BigInt(1),_2n$3=BigInt(2),_5n=BigInt(5),_10n=BigInt(10),_20n=BigInt(20),_40n=BigInt(40),_80n=BigInt(80);function ed25519_pow_2_252_3(s){const j=ED25519_P,_e=s*s%j*s%j,et=pow2(_e,_2n$3,j)*_e%j,tt=pow2(et,_1n$3,j)*s%j,nt=pow2(tt,_5n,j)*tt%j,rt=pow2(nt,_10n,j)*nt%j,ot=pow2(rt,_20n,j)*rt%j,it=pow2(ot,_40n,j)*ot%j,st=pow2(it,_80n,j)*it%j,at=pow2(st,_80n,j)*it%j,ct=pow2(at,_10n,j)*nt%j;return{pow_p_5_8:pow2(ct,_2n$3,j)*s%j,b2:_e}}function adjustScalarBytes(s){return s[0]&=248,s[31]&=127,s[31]|=64,s}function uvRatio(s,j){const $=ED25519_P,_e=mod(j*j*j,$),et=mod(_e*_e*j,$),tt=ed25519_pow_2_252_3(s*et).pow_p_5_8;let nt=mod(s*_e*tt,$);const rt=mod(j*nt*nt,$),ot=nt,it=mod(nt*ED25519_SQRT_M1,$),st=rt===s,at=rt===mod(-s,$),ct=rt===mod(-s*ED25519_SQRT_M1,$);return st&&(nt=ot),(at||ct)&&(nt=it),isNegativeLE(nt,$)&&(nt=mod(-nt,$)),{isValid:st||at,value:nt}}const ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],Fp$1=Field(ED25519_P,void 0,!0),ed25519Defaults={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Fp$1,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:sha512_1,randomBytes,adjustScalarBytes,uvRatio},ed25519=twistedEdwards(ed25519Defaults);function ed25519_domain(s,j,$){if(j.length>255)throw new Error("Context is too big");return concatBytes$1(utf8ToBytes$1("SigEd25519 no Ed25519 collisions"),new Uint8Array([$?1:0,j.length]),j,s)}const ed25519ctx=twistedEdwards({...ed25519Defaults,domain:ed25519_domain}),ed25519ph=twistedEdwards({...ed25519Defaults,domain:ed25519_domain,prehash:sha512_1}),x25519=montgomery({P:ED25519_P,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:s=>{const j=ED25519_P,{pow_p_5_8:$,b2:_e}=ed25519_pow_2_252_3(s);return mod(pow2($,BigInt(3),j)*_e,j)},adjustScalarBytes,randomBytes});function edwardsToMontgomeryPub(s){const{y:j}=ed25519.ExtendedPoint.fromHex(s),$=BigInt(1);return Fp$1.toBytes(Fp$1.create(($+j)*Fp$1.inv($-j)))}const edwardsToMontgomery=edwardsToMontgomeryPub;function edwardsToMontgomeryPriv(s){const j=ed25519Defaults.hash(s.subarray(0,32));return ed25519Defaults.adjustScalarBytes(j).subarray(0,32)}const ELL2_C1=(Fp$1.ORDER+BigInt(3))/BigInt(8),ELL2_C2=Fp$1.pow(_2n$3,ELL2_C1),ELL2_C3=Fp$1.sqrt(Fp$1.neg(Fp$1.ONE)),ELL2_C4=(Fp$1.ORDER-BigInt(5))/BigInt(8),ELL2_J=BigInt(486662);function map_to_curve_elligator2_curve25519(s){let j=Fp$1.sqr(s);j=Fp$1.mul(j,_2n$3);let $=Fp$1.add(j,Fp$1.ONE),_e=Fp$1.neg(ELL2_J),et=Fp$1.sqr($),tt=Fp$1.mul(et,$),nt=Fp$1.mul(j,ELL2_J);nt=Fp$1.mul(nt,_e),nt=Fp$1.add(nt,et),nt=Fp$1.mul(nt,_e);let rt=Fp$1.sqr(tt);et=Fp$1.sqr(rt),rt=Fp$1.mul(rt,tt),rt=Fp$1.mul(rt,nt),et=Fp$1.mul(et,rt);let ot=Fp$1.pow(et,ELL2_C4);ot=Fp$1.mul(ot,rt);let it=Fp$1.mul(ot,ELL2_C3);et=Fp$1.sqr(ot),et=Fp$1.mul(et,tt);let st=Fp$1.eql(et,nt),at=Fp$1.cmov(it,ot,st),ct=Fp$1.mul(_e,j),lt=Fp$1.mul(ot,s);lt=Fp$1.mul(lt,ELL2_C2);let dt=Fp$1.mul(lt,ELL2_C3),ft=Fp$1.mul(nt,j);et=Fp$1.sqr(lt),et=Fp$1.mul(et,tt);let gt=Fp$1.eql(et,ft),ht=Fp$1.cmov(dt,lt,gt);et=Fp$1.sqr(at),et=Fp$1.mul(et,tt);let yt=Fp$1.eql(et,nt),pt=Fp$1.cmov(ct,_e,yt),Mt=Fp$1.cmov(ht,at,yt),St=Fp$1.isOdd(Mt);return Mt=Fp$1.cmov(Mt,Fp$1.neg(Mt),yt!==St),{xMn:pt,xMd:$,yMn:Mt,yMd:_1n$3}}const ELL2_C1_EDWARDS=FpSqrtEven(Fp$1,Fp$1.neg(BigInt(486664)));function map_to_curve_elligator2_edwards25519(s){const{xMn:j,xMd:$,yMn:_e,yMd:et}=map_to_curve_elligator2_curve25519(s);let tt=Fp$1.mul(j,et);tt=Fp$1.mul(tt,ELL2_C1_EDWARDS);let nt=Fp$1.mul($,_e),rt=Fp$1.sub(j,$),ot=Fp$1.add(j,$),it=Fp$1.mul(nt,ot),st=Fp$1.eql(it,Fp$1.ZERO);tt=Fp$1.cmov(tt,Fp$1.ZERO,st),nt=Fp$1.cmov(nt,Fp$1.ONE,st),rt=Fp$1.cmov(rt,Fp$1.ONE,st),ot=Fp$1.cmov(ot,Fp$1.ONE,st);const at=Fp$1.invertBatch([nt,ot]);return{x:Fp$1.mul(tt,at[0]),y:Fp$1.mul(rt,at[1])}}const htf$1=createHasher(ed25519.ExtendedPoint,s=>map_to_curve_elligator2_edwards25519(s[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:Fp$1.ORDER,m:1,k:128,expand:"xmd",hash:sha512_1}),hashToCurve$1=htf$1.hashToCurve,encodeToCurve$1=htf$1.encodeToCurve;function assertRstPoint(s){if(!(s instanceof RistPoint))throw new Error("RistrettoPoint expected")}const SQRT_M1=ED25519_SQRT_M1,SQRT_AD_MINUS_ONE=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),INVSQRT_A_MINUS_D=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),ONE_MINUS_D_SQ=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),D_MINUS_ONE_SQ=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),invertSqrt=s=>uvRatio(_1n$3,s),MAX_255B=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),bytes255ToNumberLE=s=>ed25519.CURVE.Fp.create(bytesToNumberLE(s)&MAX_255B);function calcElligatorRistrettoMap(s){const{d:j}=ed25519.CURVE,$=ed25519.CURVE.Fp.ORDER,_e=ed25519.CURVE.Fp.create,et=_e(SQRT_M1*s*s),tt=_e((et+_1n$3)*ONE_MINUS_D_SQ);let nt=BigInt(-1);const rt=_e((nt-j*et)*_e(et+j));let{isValid:ot,value:it}=uvRatio(tt,rt),st=_e(it*s);isNegativeLE(st,$)||(st=_e(-st)),ot||(it=st),ot||(nt=et);const at=_e(nt*(et-_1n$3)*D_MINUS_ONE_SQ-rt),ct=it*it,lt=_e((it+it)*rt),dt=_e(at*SQRT_AD_MINUS_ONE),ft=_e(_1n$3-ct),gt=_e(_1n$3+ct);return new ed25519.ExtendedPoint(_e(lt*gt),_e(ft*dt),_e(dt*gt),_e(lt*ft))}class RistPoint{constructor(j){this.ep=j}static fromAffine(j){return new RistPoint(ed25519.ExtendedPoint.fromAffine(j))}static hashToCurve(j){j=ensureBytes("ristrettoHash",j,64);const $=bytes255ToNumberLE(j.slice(0,32)),_e=calcElligatorRistrettoMap($),et=bytes255ToNumberLE(j.slice(32,64)),tt=calcElligatorRistrettoMap(et);return new RistPoint(_e.add(tt))}static fromHex(j){j=ensureBytes("ristrettoHex",j,32);const{a:$,d:_e}=ed25519.CURVE,et=ed25519.CURVE.Fp.ORDER,tt=ed25519.CURVE.Fp.create,nt="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",rt=bytes255ToNumberLE(j);if(!equalBytes(numberToBytesLE(rt,32),j)||isNegativeLE(rt,et))throw new Error(nt);const ot=tt(rt*rt),it=tt(_1n$3+$*ot),st=tt(_1n$3-$*ot),at=tt(it*it),ct=tt(st*st),lt=tt($*_e*at-ct),{isValid:dt,value:ft}=invertSqrt(tt(lt*ct)),gt=tt(ft*st),ht=tt(ft*gt*lt);let yt=tt((rt+rt)*gt);isNegativeLE(yt,et)&&(yt=tt(-yt));const pt=tt(it*ht),Mt=tt(yt*pt);if(!dt||isNegativeLE(Mt,et)||pt===_0n$3)throw new Error(nt);return new RistPoint(new ed25519.ExtendedPoint(yt,pt,_1n$3,Mt))}toRawBytes(){let{ex:j,ey:$,ez:_e,et}=this.ep;const tt=ed25519.CURVE.Fp.ORDER,nt=ed25519.CURVE.Fp.create,rt=nt(nt(_e+$)*nt(_e-$)),ot=nt(j*$),it=nt(ot*ot),{value:st}=invertSqrt(nt(rt*it)),at=nt(st*rt),ct=nt(st*ot),lt=nt(at*ct*et);let dt;if(isNegativeLE(et*lt,tt)){let gt=nt($*SQRT_M1),ht=nt(j*SQRT_M1);j=gt,$=ht,dt=nt(at*INVSQRT_A_MINUS_D)}else dt=ct;isNegativeLE(j*lt,tt)&&($=nt(-$));let ft=nt((_e-$)*dt);return isNegativeLE(ft,tt)&&(ft=nt(-ft)),numberToBytesLE(ft,32)}toHex(){return bytesToHex(this.toRawBytes())}toString(){return this.toHex()}equals(j){assertRstPoint(j);const{ex:$,ey:_e}=this.ep,{ex:et,ey:tt}=j.ep,nt=ed25519.CURVE.Fp.create,rt=nt($*tt)===nt(_e*et),ot=nt(_e*tt)===nt($*et);return rt||ot}add(j){return assertRstPoint(j),new RistPoint(this.ep.add(j.ep))}subtract(j){return assertRstPoint(j),new RistPoint(this.ep.subtract(j.ep))}multiply(j){return new RistPoint(this.ep.multiply(j))}multiplyUnsafe(j){return new RistPoint(this.ep.multiplyUnsafe(j))}double(){return new RistPoint(this.ep.double())}negate(){return new RistPoint(this.ep.negate())}}const RistrettoPoint=(RistPoint.BASE||(RistPoint.BASE=new RistPoint(ed25519.ExtendedPoint.BASE)),RistPoint.ZERO||(RistPoint.ZERO=new RistPoint(ed25519.ExtendedPoint.ZERO)),RistPoint),hashToRistretto255=(s,j)=>{const $=j.DST,_e=typeof $=="string"?utf8ToBytes$1($):$,et=expand_message_xmd(s,_e,64,sha512_1);return RistPoint.hashToCurve(et)},hash_to_ristretto255=hashToRistretto255,ed25519$1=Object.freeze(Object.defineProperty({__proto__:null,ED25519_TORSION_SUBGROUP,RistrettoPoint,ed25519,ed25519ctx,ed25519ph,edwardsToMontgomery,edwardsToMontgomeryPriv,edwardsToMontgomeryPub,encodeToCurve:encodeToCurve$1,hashToCurve:hashToCurve$1,hashToRistretto255,hash_to_ristretto255,x25519},Symbol.toStringTag,{value:"Module"}));var bn={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$5=getAugmentedNamespace(__viteBrowserExternal$1);bn.exports;(function(s){(function(j,$){function _e(Lt,mt){if(!Lt)throw new Error(mt||"Assertion failed")}function et(Lt,mt){Lt.super_=mt;var xt=function(){};xt.prototype=mt.prototype,Lt.prototype=new xt,Lt.prototype.constructor=Lt}function tt(Lt,mt,xt){if(tt.isBN(Lt))return Lt;this.negative=0,this.words=null,this.length=0,this.red=null,Lt!==null&&((mt==="le"||mt==="be")&&(xt=mt,mt=10),this._init(Lt||0,mt||10,xt||"be"))}typeof j=="object"?j.exports=tt:$.BN=tt,tt.BN=tt,tt.wordSize=26;var nt;try{typeof window<"u"&&typeof window.Buffer<"u"?nt=window.Buffer:nt=require$$0$5.Buffer}catch{}tt.isBN=function(mt){return mt instanceof tt?!0:mt!==null&&typeof mt=="object"&&mt.constructor.wordSize===tt.wordSize&&Array.isArray(mt.words)},tt.max=function(mt,xt){return mt.cmp(xt)>0?mt:xt},tt.min=function(mt,xt){return mt.cmp(xt)<0?mt:xt},tt.prototype._init=function(mt,xt,It){if(typeof mt=="number")return this._initNumber(mt,xt,It);if(typeof mt=="object")return this._initArray(mt,xt,It);xt==="hex"&&(xt=16),_e(xt===(xt|0)&&xt>=2&&xt<=36),mt=mt.toString().replace(/\s+/g,"");var jt=0;mt[0]==="-"&&(jt++,this.negative=1),jt=0;jt-=3)wt=mt[jt]|mt[jt-1]<<8|mt[jt-2]<<16,this.words[At]|=wt<>>26-Rt&67108863,Rt+=24,Rt>=26&&(Rt-=26,At++);else if(It==="le")for(jt=0,At=0;jt>>26-Rt&67108863,Rt+=24,Rt>=26&&(Rt-=26,At++);return this._strip()};function rt(Lt,mt){var xt=Lt.charCodeAt(mt);if(xt>=48&&xt<=57)return xt-48;if(xt>=65&&xt<=70)return xt-55;if(xt>=97&&xt<=102)return xt-87;_e(!1,"Invalid character in "+Lt)}function ot(Lt,mt,xt){var It=rt(Lt,xt);return xt-1>=mt&&(It|=rt(Lt,xt-1)<<4),It}tt.prototype._parseHex=function(mt,xt,It){this.length=Math.ceil((mt.length-xt)/6),this.words=new Array(this.length);for(var jt=0;jt=xt;jt-=2)Rt=ot(mt,xt,jt)<=18?(At-=18,wt+=1,this.words[wt]|=Rt>>>26):At+=8;else{var Nt=mt.length-xt;for(jt=Nt%2===0?xt+1:xt;jt=18?(At-=18,wt+=1,this.words[wt]|=Rt>>>26):At+=8}this._strip()};function it(Lt,mt,xt,It){for(var jt=0,At=0,wt=Math.min(Lt.length,xt),Rt=mt;Rt=49?At=Nt-49+10:Nt>=17?At=Nt-17+10:At=Nt,_e(Nt>=0&&At1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=at}catch{tt.prototype.inspect=at}else tt.prototype.inspect=at;function at(){return(this.red?""}var ct=["","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"],lt=[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],dt=[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];tt.prototype.toString=function(mt,xt){mt=mt||10,xt=xt|0||1;var It;if(mt===16||mt==="hex"){It="";for(var jt=0,At=0,wt=0;wt>>24-jt&16777215,jt+=2,jt>=26&&(jt-=26,wt--),At!==0||wt!==this.length-1?It=ct[6-Nt.length]+Nt+It:It=Nt+It}for(At!==0&&(It=At.toString(16)+It);It.length%xt!==0;)It="0"+It;return this.negative!==0&&(It="-"+It),It}if(mt===(mt|0)&&mt>=2&&mt<=36){var Ct=lt[mt],Bt=dt[mt];It="";var Gt=this.clone();for(Gt.negative=0;!Gt.isZero();){var Vt=Gt.modrn(Bt).toString(mt);Gt=Gt.idivn(Bt),Gt.isZero()?It=Vt+It:It=ct[Ct-Vt.length]+Vt+It}for(this.isZero()&&(It="0"+It);It.length%xt!==0;)It="0"+It;return this.negative!==0&&(It="-"+It),It}_e(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var mt=this.words[0];return this.length===2?mt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?mt+=4503599627370496+this.words[1]*67108864:this.length>2&&_e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-mt:mt},tt.prototype.toJSON=function(){return this.toString(16,2)},nt&&(tt.prototype.toBuffer=function(mt,xt){return this.toArrayLike(nt,mt,xt)}),tt.prototype.toArray=function(mt,xt){return this.toArrayLike(Array,mt,xt)};var ft=function(mt,xt){return mt.allocUnsafe?mt.allocUnsafe(xt):new mt(xt)};tt.prototype.toArrayLike=function(mt,xt,It){this._strip();var jt=this.byteLength(),At=It||Math.max(1,jt);_e(jt<=At,"byte array longer than desired length"),_e(At>0,"Requested array length <= 0");var wt=ft(mt,At),Rt=xt==="le"?"LE":"BE";return this["_toArrayLike"+Rt](wt,jt),wt},tt.prototype._toArrayLikeLE=function(mt,xt){for(var It=0,jt=0,At=0,wt=0;At>8&255),It>16&255),wt===6?(It>24&255),jt=0,wt=0):(jt=Rt>>>24,wt+=2)}if(It=0&&(mt[It--]=Rt>>8&255),It>=0&&(mt[It--]=Rt>>16&255),wt===6?(It>=0&&(mt[It--]=Rt>>24&255),jt=0,wt=0):(jt=Rt>>>24,wt+=2)}if(It>=0)for(mt[It--]=jt;It>=0;)mt[It--]=0},Math.clz32?tt.prototype._countBits=function(mt){return 32-Math.clz32(mt)}:tt.prototype._countBits=function(mt){var xt=mt,It=0;return xt>=4096&&(It+=13,xt>>>=13),xt>=64&&(It+=7,xt>>>=7),xt>=8&&(It+=4,xt>>>=4),xt>=2&&(It+=2,xt>>>=2),It+xt},tt.prototype._zeroBits=function(mt){if(mt===0)return 26;var xt=mt,It=0;return xt&8191||(It+=13,xt>>>=13),xt&127||(It+=7,xt>>>=7),xt&15||(It+=4,xt>>>=4),xt&3||(It+=2,xt>>>=2),xt&1||It++,It},tt.prototype.bitLength=function(){var mt=this.words[this.length-1],xt=this._countBits(mt);return(this.length-1)*26+xt};function gt(Lt){for(var mt=new Array(Lt.bitLength()),xt=0;xt>>jt&1}return mt}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var mt=0,xt=0;xtmt.length?this.clone().ior(mt):mt.clone().ior(this)},tt.prototype.uor=function(mt){return this.length>mt.length?this.clone().iuor(mt):mt.clone().iuor(this)},tt.prototype.iuand=function(mt){var xt;this.length>mt.length?xt=mt:xt=this;for(var It=0;Itmt.length?this.clone().iand(mt):mt.clone().iand(this)},tt.prototype.uand=function(mt){return this.length>mt.length?this.clone().iuand(mt):mt.clone().iuand(this)},tt.prototype.iuxor=function(mt){var xt,It;this.length>mt.length?(xt=this,It=mt):(xt=mt,It=this);for(var jt=0;jtmt.length?this.clone().ixor(mt):mt.clone().ixor(this)},tt.prototype.uxor=function(mt){return this.length>mt.length?this.clone().iuxor(mt):mt.clone().iuxor(this)},tt.prototype.inotn=function(mt){_e(typeof mt=="number"&&mt>=0);var xt=Math.ceil(mt/26)|0,It=mt%26;this._expand(xt),It>0&&xt--;for(var jt=0;jt0&&(this.words[jt]=~this.words[jt]&67108863>>26-It),this._strip()},tt.prototype.notn=function(mt){return this.clone().inotn(mt)},tt.prototype.setn=function(mt,xt){_e(typeof mt=="number"&&mt>=0);var It=mt/26|0,jt=mt%26;return this._expand(It+1),xt?this.words[It]=this.words[It]|1<mt.length?(It=this,jt=mt):(It=mt,jt=this);for(var At=0,wt=0;wt>>26;for(;At!==0&&wt>>26;if(this.length=It.length,At!==0)this.words[this.length]=At,this.length++;else if(It!==this)for(;wtmt.length?this.clone().iadd(mt):mt.clone().iadd(this)},tt.prototype.isub=function(mt){if(mt.negative!==0){mt.negative=0;var xt=this.iadd(mt);return mt.negative=1,xt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(mt),this.negative=1,this._normSign();var It=this.cmp(mt);if(It===0)return this.negative=0,this.length=1,this.words[0]=0,this;var jt,At;It>0?(jt=this,At=mt):(jt=mt,At=this);for(var wt=0,Rt=0;Rt>26,this.words[Rt]=xt&67108863;for(;wt!==0&&Rt>26,this.words[Rt]=xt&67108863;if(wt===0&&Rt>>26,Gt=Nt&67108863,Vt=Math.min(Ct,mt.length-1),Yt=Math.max(0,Ct-Lt.length+1);Yt<=Vt;Yt++){var Qt=Ct-Yt|0;jt=Lt.words[Qt]|0,At=mt.words[Yt]|0,wt=jt*At+Gt,Bt+=wt/67108864|0,Gt=wt&67108863}xt.words[Ct]=Gt|0,Nt=Bt|0}return Nt!==0?xt.words[Ct]=Nt|0:xt.length--,xt._strip()}var yt=function(mt,xt,It){var jt=mt.words,At=xt.words,wt=It.words,Rt=0,Nt,Ct,Bt,Gt=jt[0]|0,Vt=Gt&8191,Yt=Gt>>>13,Qt=jt[1]|0,qt=Qt&8191,Zt=Qt>>>13,fn=jt[2]|0,Xt=fn&8191,on=fn>>>13,tn=jt[3]|0,Kt=tn&8191,Jt=tn>>>13,En=jt[4]|0,pn=En&8191,cn=En>>>13,Tn=jt[5]|0,sn=Tn&8191,an=Tn>>>13,Mn=jt[6]|0,hn=Mn&8191,ln=Mn>>>13,Cn=jt[7]|0,gn=Cn&8191,$t=Cn>>>13,bt=jt[8]|0,Et=bt&8191,kt=bt>>>13,Ut=jt[9]|0,Ht=Ut&8191,Wt=Ut>>>13,nn=At[0]|0,rn=nn&8191,en=nn>>>13,mn=At[1]|0,un=mn&8191,Bn=mn>>>13,Qn=At[2]|0,On=Qn&8191,wn=Qn>>>13,Gn=At[3]|0,Nn=Gn&8191,Ln=Gn>>>13,qn=At[4]|0,_n=qn&8191,Dn=qn>>>13,Wn=At[5]|0,Pn=Wn&8191,An=Wn>>>13,Vn=At[6]|0,Sn=Vn&8191,vn=Vn>>>13,Zn=At[7]|0,In=Zn&8191,$n=Zn>>>13,Yn=At[8]|0,jn=Yn&8191,zn=Yn>>>13,Rn=At[9]|0,yn=Rn&8191,kn=Rn>>>13;It.negative=mt.negative^xt.negative,It.length=19,Nt=Math.imul(Vt,rn),Ct=Math.imul(Vt,en),Ct=Ct+Math.imul(Yt,rn)|0,Bt=Math.imul(Yt,en);var Hn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,Nt=Math.imul(qt,rn),Ct=Math.imul(qt,en),Ct=Ct+Math.imul(Zt,rn)|0,Bt=Math.imul(Zt,en),Nt=Nt+Math.imul(Vt,un)|0,Ct=Ct+Math.imul(Vt,Bn)|0,Ct=Ct+Math.imul(Yt,un)|0,Bt=Bt+Math.imul(Yt,Bn)|0;var Un=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Un>>>26)|0,Un&=67108863,Nt=Math.imul(Xt,rn),Ct=Math.imul(Xt,en),Ct=Ct+Math.imul(on,rn)|0,Bt=Math.imul(on,en),Nt=Nt+Math.imul(qt,un)|0,Ct=Ct+Math.imul(qt,Bn)|0,Ct=Ct+Math.imul(Zt,un)|0,Bt=Bt+Math.imul(Zt,Bn)|0,Nt=Nt+Math.imul(Vt,On)|0,Ct=Ct+Math.imul(Vt,wn)|0,Ct=Ct+Math.imul(Yt,On)|0,Bt=Bt+Math.imul(Yt,wn)|0;var xn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(xn>>>26)|0,xn&=67108863,Nt=Math.imul(Kt,rn),Ct=Math.imul(Kt,en),Ct=Ct+Math.imul(Jt,rn)|0,Bt=Math.imul(Jt,en),Nt=Nt+Math.imul(Xt,un)|0,Ct=Ct+Math.imul(Xt,Bn)|0,Ct=Ct+Math.imul(on,un)|0,Bt=Bt+Math.imul(on,Bn)|0,Nt=Nt+Math.imul(qt,On)|0,Ct=Ct+Math.imul(qt,wn)|0,Ct=Ct+Math.imul(Zt,On)|0,Bt=Bt+Math.imul(Zt,wn)|0,Nt=Nt+Math.imul(Vt,Nn)|0,Ct=Ct+Math.imul(Vt,Ln)|0,Ct=Ct+Math.imul(Yt,Nn)|0,Bt=Bt+Math.imul(Yt,Ln)|0;var Fn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,Nt=Math.imul(pn,rn),Ct=Math.imul(pn,en),Ct=Ct+Math.imul(cn,rn)|0,Bt=Math.imul(cn,en),Nt=Nt+Math.imul(Kt,un)|0,Ct=Ct+Math.imul(Kt,Bn)|0,Ct=Ct+Math.imul(Jt,un)|0,Bt=Bt+Math.imul(Jt,Bn)|0,Nt=Nt+Math.imul(Xt,On)|0,Ct=Ct+Math.imul(Xt,wn)|0,Ct=Ct+Math.imul(on,On)|0,Bt=Bt+Math.imul(on,wn)|0,Nt=Nt+Math.imul(qt,Nn)|0,Ct=Ct+Math.imul(qt,Ln)|0,Ct=Ct+Math.imul(Zt,Nn)|0,Bt=Bt+Math.imul(Zt,Ln)|0,Nt=Nt+Math.imul(Vt,_n)|0,Ct=Ct+Math.imul(Vt,Dn)|0,Ct=Ct+Math.imul(Yt,_n)|0,Bt=Bt+Math.imul(Yt,Dn)|0;var Kn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,Nt=Math.imul(sn,rn),Ct=Math.imul(sn,en),Ct=Ct+Math.imul(an,rn)|0,Bt=Math.imul(an,en),Nt=Nt+Math.imul(pn,un)|0,Ct=Ct+Math.imul(pn,Bn)|0,Ct=Ct+Math.imul(cn,un)|0,Bt=Bt+Math.imul(cn,Bn)|0,Nt=Nt+Math.imul(Kt,On)|0,Ct=Ct+Math.imul(Kt,wn)|0,Ct=Ct+Math.imul(Jt,On)|0,Bt=Bt+Math.imul(Jt,wn)|0,Nt=Nt+Math.imul(Xt,Nn)|0,Ct=Ct+Math.imul(Xt,Ln)|0,Ct=Ct+Math.imul(on,Nn)|0,Bt=Bt+Math.imul(on,Ln)|0,Nt=Nt+Math.imul(qt,_n)|0,Ct=Ct+Math.imul(qt,Dn)|0,Ct=Ct+Math.imul(Zt,_n)|0,Bt=Bt+Math.imul(Zt,Dn)|0,Nt=Nt+Math.imul(Vt,Pn)|0,Ct=Ct+Math.imul(Vt,An)|0,Ct=Ct+Math.imul(Yt,Pn)|0,Bt=Bt+Math.imul(Yt,An)|0;var Xn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,Nt=Math.imul(hn,rn),Ct=Math.imul(hn,en),Ct=Ct+Math.imul(ln,rn)|0,Bt=Math.imul(ln,en),Nt=Nt+Math.imul(sn,un)|0,Ct=Ct+Math.imul(sn,Bn)|0,Ct=Ct+Math.imul(an,un)|0,Bt=Bt+Math.imul(an,Bn)|0,Nt=Nt+Math.imul(pn,On)|0,Ct=Ct+Math.imul(pn,wn)|0,Ct=Ct+Math.imul(cn,On)|0,Bt=Bt+Math.imul(cn,wn)|0,Nt=Nt+Math.imul(Kt,Nn)|0,Ct=Ct+Math.imul(Kt,Ln)|0,Ct=Ct+Math.imul(Jt,Nn)|0,Bt=Bt+Math.imul(Jt,Ln)|0,Nt=Nt+Math.imul(Xt,_n)|0,Ct=Ct+Math.imul(Xt,Dn)|0,Ct=Ct+Math.imul(on,_n)|0,Bt=Bt+Math.imul(on,Dn)|0,Nt=Nt+Math.imul(qt,Pn)|0,Ct=Ct+Math.imul(qt,An)|0,Ct=Ct+Math.imul(Zt,Pn)|0,Bt=Bt+Math.imul(Zt,An)|0,Nt=Nt+Math.imul(Vt,Sn)|0,Ct=Ct+Math.imul(Vt,vn)|0,Ct=Ct+Math.imul(Yt,Sn)|0,Bt=Bt+Math.imul(Yt,vn)|0;var Jn=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Nt=Math.imul(gn,rn),Ct=Math.imul(gn,en),Ct=Ct+Math.imul($t,rn)|0,Bt=Math.imul($t,en),Nt=Nt+Math.imul(hn,un)|0,Ct=Ct+Math.imul(hn,Bn)|0,Ct=Ct+Math.imul(ln,un)|0,Bt=Bt+Math.imul(ln,Bn)|0,Nt=Nt+Math.imul(sn,On)|0,Ct=Ct+Math.imul(sn,wn)|0,Ct=Ct+Math.imul(an,On)|0,Bt=Bt+Math.imul(an,wn)|0,Nt=Nt+Math.imul(pn,Nn)|0,Ct=Ct+Math.imul(pn,Ln)|0,Ct=Ct+Math.imul(cn,Nn)|0,Bt=Bt+Math.imul(cn,Ln)|0,Nt=Nt+Math.imul(Kt,_n)|0,Ct=Ct+Math.imul(Kt,Dn)|0,Ct=Ct+Math.imul(Jt,_n)|0,Bt=Bt+Math.imul(Jt,Dn)|0,Nt=Nt+Math.imul(Xt,Pn)|0,Ct=Ct+Math.imul(Xt,An)|0,Ct=Ct+Math.imul(on,Pn)|0,Bt=Bt+Math.imul(on,An)|0,Nt=Nt+Math.imul(qt,Sn)|0,Ct=Ct+Math.imul(qt,vn)|0,Ct=Ct+Math.imul(Zt,Sn)|0,Bt=Bt+Math.imul(Zt,vn)|0,Nt=Nt+Math.imul(Vt,In)|0,Ct=Ct+Math.imul(Vt,$n)|0,Ct=Ct+Math.imul(Yt,In)|0,Bt=Bt+Math.imul(Yt,$n)|0;var er=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(er>>>26)|0,er&=67108863,Nt=Math.imul(Et,rn),Ct=Math.imul(Et,en),Ct=Ct+Math.imul(kt,rn)|0,Bt=Math.imul(kt,en),Nt=Nt+Math.imul(gn,un)|0,Ct=Ct+Math.imul(gn,Bn)|0,Ct=Ct+Math.imul($t,un)|0,Bt=Bt+Math.imul($t,Bn)|0,Nt=Nt+Math.imul(hn,On)|0,Ct=Ct+Math.imul(hn,wn)|0,Ct=Ct+Math.imul(ln,On)|0,Bt=Bt+Math.imul(ln,wn)|0,Nt=Nt+Math.imul(sn,Nn)|0,Ct=Ct+Math.imul(sn,Ln)|0,Ct=Ct+Math.imul(an,Nn)|0,Bt=Bt+Math.imul(an,Ln)|0,Nt=Nt+Math.imul(pn,_n)|0,Ct=Ct+Math.imul(pn,Dn)|0,Ct=Ct+Math.imul(cn,_n)|0,Bt=Bt+Math.imul(cn,Dn)|0,Nt=Nt+Math.imul(Kt,Pn)|0,Ct=Ct+Math.imul(Kt,An)|0,Ct=Ct+Math.imul(Jt,Pn)|0,Bt=Bt+Math.imul(Jt,An)|0,Nt=Nt+Math.imul(Xt,Sn)|0,Ct=Ct+Math.imul(Xt,vn)|0,Ct=Ct+Math.imul(on,Sn)|0,Bt=Bt+Math.imul(on,vn)|0,Nt=Nt+Math.imul(qt,In)|0,Ct=Ct+Math.imul(qt,$n)|0,Ct=Ct+Math.imul(Zt,In)|0,Bt=Bt+Math.imul(Zt,$n)|0,Nt=Nt+Math.imul(Vt,jn)|0,Ct=Ct+Math.imul(Vt,zn)|0,Ct=Ct+Math.imul(Yt,jn)|0,Bt=Bt+Math.imul(Yt,zn)|0;var tr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(tr>>>26)|0,tr&=67108863,Nt=Math.imul(Ht,rn),Ct=Math.imul(Ht,en),Ct=Ct+Math.imul(Wt,rn)|0,Bt=Math.imul(Wt,en),Nt=Nt+Math.imul(Et,un)|0,Ct=Ct+Math.imul(Et,Bn)|0,Ct=Ct+Math.imul(kt,un)|0,Bt=Bt+Math.imul(kt,Bn)|0,Nt=Nt+Math.imul(gn,On)|0,Ct=Ct+Math.imul(gn,wn)|0,Ct=Ct+Math.imul($t,On)|0,Bt=Bt+Math.imul($t,wn)|0,Nt=Nt+Math.imul(hn,Nn)|0,Ct=Ct+Math.imul(hn,Ln)|0,Ct=Ct+Math.imul(ln,Nn)|0,Bt=Bt+Math.imul(ln,Ln)|0,Nt=Nt+Math.imul(sn,_n)|0,Ct=Ct+Math.imul(sn,Dn)|0,Ct=Ct+Math.imul(an,_n)|0,Bt=Bt+Math.imul(an,Dn)|0,Nt=Nt+Math.imul(pn,Pn)|0,Ct=Ct+Math.imul(pn,An)|0,Ct=Ct+Math.imul(cn,Pn)|0,Bt=Bt+Math.imul(cn,An)|0,Nt=Nt+Math.imul(Kt,Sn)|0,Ct=Ct+Math.imul(Kt,vn)|0,Ct=Ct+Math.imul(Jt,Sn)|0,Bt=Bt+Math.imul(Jt,vn)|0,Nt=Nt+Math.imul(Xt,In)|0,Ct=Ct+Math.imul(Xt,$n)|0,Ct=Ct+Math.imul(on,In)|0,Bt=Bt+Math.imul(on,$n)|0,Nt=Nt+Math.imul(qt,jn)|0,Ct=Ct+Math.imul(qt,zn)|0,Ct=Ct+Math.imul(Zt,jn)|0,Bt=Bt+Math.imul(Zt,zn)|0,Nt=Nt+Math.imul(Vt,yn)|0,Ct=Ct+Math.imul(Vt,kn)|0,Ct=Ct+Math.imul(Yt,yn)|0,Bt=Bt+Math.imul(Yt,kn)|0;var nr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(nr>>>26)|0,nr&=67108863,Nt=Math.imul(Ht,un),Ct=Math.imul(Ht,Bn),Ct=Ct+Math.imul(Wt,un)|0,Bt=Math.imul(Wt,Bn),Nt=Nt+Math.imul(Et,On)|0,Ct=Ct+Math.imul(Et,wn)|0,Ct=Ct+Math.imul(kt,On)|0,Bt=Bt+Math.imul(kt,wn)|0,Nt=Nt+Math.imul(gn,Nn)|0,Ct=Ct+Math.imul(gn,Ln)|0,Ct=Ct+Math.imul($t,Nn)|0,Bt=Bt+Math.imul($t,Ln)|0,Nt=Nt+Math.imul(hn,_n)|0,Ct=Ct+Math.imul(hn,Dn)|0,Ct=Ct+Math.imul(ln,_n)|0,Bt=Bt+Math.imul(ln,Dn)|0,Nt=Nt+Math.imul(sn,Pn)|0,Ct=Ct+Math.imul(sn,An)|0,Ct=Ct+Math.imul(an,Pn)|0,Bt=Bt+Math.imul(an,An)|0,Nt=Nt+Math.imul(pn,Sn)|0,Ct=Ct+Math.imul(pn,vn)|0,Ct=Ct+Math.imul(cn,Sn)|0,Bt=Bt+Math.imul(cn,vn)|0,Nt=Nt+Math.imul(Kt,In)|0,Ct=Ct+Math.imul(Kt,$n)|0,Ct=Ct+Math.imul(Jt,In)|0,Bt=Bt+Math.imul(Jt,$n)|0,Nt=Nt+Math.imul(Xt,jn)|0,Ct=Ct+Math.imul(Xt,zn)|0,Ct=Ct+Math.imul(on,jn)|0,Bt=Bt+Math.imul(on,zn)|0,Nt=Nt+Math.imul(qt,yn)|0,Ct=Ct+Math.imul(qt,kn)|0,Ct=Ct+Math.imul(Zt,yn)|0,Bt=Bt+Math.imul(Zt,kn)|0;var rr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(rr>>>26)|0,rr&=67108863,Nt=Math.imul(Ht,On),Ct=Math.imul(Ht,wn),Ct=Ct+Math.imul(Wt,On)|0,Bt=Math.imul(Wt,wn),Nt=Nt+Math.imul(Et,Nn)|0,Ct=Ct+Math.imul(Et,Ln)|0,Ct=Ct+Math.imul(kt,Nn)|0,Bt=Bt+Math.imul(kt,Ln)|0,Nt=Nt+Math.imul(gn,_n)|0,Ct=Ct+Math.imul(gn,Dn)|0,Ct=Ct+Math.imul($t,_n)|0,Bt=Bt+Math.imul($t,Dn)|0,Nt=Nt+Math.imul(hn,Pn)|0,Ct=Ct+Math.imul(hn,An)|0,Ct=Ct+Math.imul(ln,Pn)|0,Bt=Bt+Math.imul(ln,An)|0,Nt=Nt+Math.imul(sn,Sn)|0,Ct=Ct+Math.imul(sn,vn)|0,Ct=Ct+Math.imul(an,Sn)|0,Bt=Bt+Math.imul(an,vn)|0,Nt=Nt+Math.imul(pn,In)|0,Ct=Ct+Math.imul(pn,$n)|0,Ct=Ct+Math.imul(cn,In)|0,Bt=Bt+Math.imul(cn,$n)|0,Nt=Nt+Math.imul(Kt,jn)|0,Ct=Ct+Math.imul(Kt,zn)|0,Ct=Ct+Math.imul(Jt,jn)|0,Bt=Bt+Math.imul(Jt,zn)|0,Nt=Nt+Math.imul(Xt,yn)|0,Ct=Ct+Math.imul(Xt,kn)|0,Ct=Ct+Math.imul(on,yn)|0,Bt=Bt+Math.imul(on,kn)|0;var or=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(or>>>26)|0,or&=67108863,Nt=Math.imul(Ht,Nn),Ct=Math.imul(Ht,Ln),Ct=Ct+Math.imul(Wt,Nn)|0,Bt=Math.imul(Wt,Ln),Nt=Nt+Math.imul(Et,_n)|0,Ct=Ct+Math.imul(Et,Dn)|0,Ct=Ct+Math.imul(kt,_n)|0,Bt=Bt+Math.imul(kt,Dn)|0,Nt=Nt+Math.imul(gn,Pn)|0,Ct=Ct+Math.imul(gn,An)|0,Ct=Ct+Math.imul($t,Pn)|0,Bt=Bt+Math.imul($t,An)|0,Nt=Nt+Math.imul(hn,Sn)|0,Ct=Ct+Math.imul(hn,vn)|0,Ct=Ct+Math.imul(ln,Sn)|0,Bt=Bt+Math.imul(ln,vn)|0,Nt=Nt+Math.imul(sn,In)|0,Ct=Ct+Math.imul(sn,$n)|0,Ct=Ct+Math.imul(an,In)|0,Bt=Bt+Math.imul(an,$n)|0,Nt=Nt+Math.imul(pn,jn)|0,Ct=Ct+Math.imul(pn,zn)|0,Ct=Ct+Math.imul(cn,jn)|0,Bt=Bt+Math.imul(cn,zn)|0,Nt=Nt+Math.imul(Kt,yn)|0,Ct=Ct+Math.imul(Kt,kn)|0,Ct=Ct+Math.imul(Jt,yn)|0,Bt=Bt+Math.imul(Jt,kn)|0;var ir=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(ir>>>26)|0,ir&=67108863,Nt=Math.imul(Ht,_n),Ct=Math.imul(Ht,Dn),Ct=Ct+Math.imul(Wt,_n)|0,Bt=Math.imul(Wt,Dn),Nt=Nt+Math.imul(Et,Pn)|0,Ct=Ct+Math.imul(Et,An)|0,Ct=Ct+Math.imul(kt,Pn)|0,Bt=Bt+Math.imul(kt,An)|0,Nt=Nt+Math.imul(gn,Sn)|0,Ct=Ct+Math.imul(gn,vn)|0,Ct=Ct+Math.imul($t,Sn)|0,Bt=Bt+Math.imul($t,vn)|0,Nt=Nt+Math.imul(hn,In)|0,Ct=Ct+Math.imul(hn,$n)|0,Ct=Ct+Math.imul(ln,In)|0,Bt=Bt+Math.imul(ln,$n)|0,Nt=Nt+Math.imul(sn,jn)|0,Ct=Ct+Math.imul(sn,zn)|0,Ct=Ct+Math.imul(an,jn)|0,Bt=Bt+Math.imul(an,zn)|0,Nt=Nt+Math.imul(pn,yn)|0,Ct=Ct+Math.imul(pn,kn)|0,Ct=Ct+Math.imul(cn,yn)|0,Bt=Bt+Math.imul(cn,kn)|0;var sr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(sr>>>26)|0,sr&=67108863,Nt=Math.imul(Ht,Pn),Ct=Math.imul(Ht,An),Ct=Ct+Math.imul(Wt,Pn)|0,Bt=Math.imul(Wt,An),Nt=Nt+Math.imul(Et,Sn)|0,Ct=Ct+Math.imul(Et,vn)|0,Ct=Ct+Math.imul(kt,Sn)|0,Bt=Bt+Math.imul(kt,vn)|0,Nt=Nt+Math.imul(gn,In)|0,Ct=Ct+Math.imul(gn,$n)|0,Ct=Ct+Math.imul($t,In)|0,Bt=Bt+Math.imul($t,$n)|0,Nt=Nt+Math.imul(hn,jn)|0,Ct=Ct+Math.imul(hn,zn)|0,Ct=Ct+Math.imul(ln,jn)|0,Bt=Bt+Math.imul(ln,zn)|0,Nt=Nt+Math.imul(sn,yn)|0,Ct=Ct+Math.imul(sn,kn)|0,Ct=Ct+Math.imul(an,yn)|0,Bt=Bt+Math.imul(an,kn)|0;var ar=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(ar>>>26)|0,ar&=67108863,Nt=Math.imul(Ht,Sn),Ct=Math.imul(Ht,vn),Ct=Ct+Math.imul(Wt,Sn)|0,Bt=Math.imul(Wt,vn),Nt=Nt+Math.imul(Et,In)|0,Ct=Ct+Math.imul(Et,$n)|0,Ct=Ct+Math.imul(kt,In)|0,Bt=Bt+Math.imul(kt,$n)|0,Nt=Nt+Math.imul(gn,jn)|0,Ct=Ct+Math.imul(gn,zn)|0,Ct=Ct+Math.imul($t,jn)|0,Bt=Bt+Math.imul($t,zn)|0,Nt=Nt+Math.imul(hn,yn)|0,Ct=Ct+Math.imul(hn,kn)|0,Ct=Ct+Math.imul(ln,yn)|0,Bt=Bt+Math.imul(ln,kn)|0;var lr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(lr>>>26)|0,lr&=67108863,Nt=Math.imul(Ht,In),Ct=Math.imul(Ht,$n),Ct=Ct+Math.imul(Wt,In)|0,Bt=Math.imul(Wt,$n),Nt=Nt+Math.imul(Et,jn)|0,Ct=Ct+Math.imul(Et,zn)|0,Ct=Ct+Math.imul(kt,jn)|0,Bt=Bt+Math.imul(kt,zn)|0,Nt=Nt+Math.imul(gn,yn)|0,Ct=Ct+Math.imul(gn,kn)|0,Ct=Ct+Math.imul($t,yn)|0,Bt=Bt+Math.imul($t,kn)|0;var ur=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(ur>>>26)|0,ur&=67108863,Nt=Math.imul(Ht,jn),Ct=Math.imul(Ht,zn),Ct=Ct+Math.imul(Wt,jn)|0,Bt=Math.imul(Wt,zn),Nt=Nt+Math.imul(Et,yn)|0,Ct=Ct+Math.imul(Et,kn)|0,Ct=Ct+Math.imul(kt,yn)|0,Bt=Bt+Math.imul(kt,kn)|0;var cr=(Rt+Nt|0)+((Ct&8191)<<13)|0;Rt=(Bt+(Ct>>>13)|0)+(cr>>>26)|0,cr&=67108863,Nt=Math.imul(Ht,yn),Ct=Math.imul(Ht,kn),Ct=Ct+Math.imul(Wt,yn)|0,Bt=Math.imul(Wt,kn);var dr=(Rt+Nt|0)+((Ct&8191)<<13)|0;return Rt=(Bt+(Ct>>>13)|0)+(dr>>>26)|0,dr&=67108863,wt[0]=Hn,wt[1]=Un,wt[2]=xn,wt[3]=Fn,wt[4]=Kn,wt[5]=Xn,wt[6]=Jn,wt[7]=er,wt[8]=tr,wt[9]=nr,wt[10]=rr,wt[11]=or,wt[12]=ir,wt[13]=sr,wt[14]=ar,wt[15]=lr,wt[16]=ur,wt[17]=cr,wt[18]=dr,Rt!==0&&(wt[19]=Rt,It.length++),It};Math.imul||(yt=ht);function pt(Lt,mt,xt){xt.negative=mt.negative^Lt.negative,xt.length=Lt.length+mt.length;for(var It=0,jt=0,At=0;At>>26)|0,jt+=wt>>>26,wt&=67108863}xt.words[At]=Rt,It=wt,wt=jt}return It!==0?xt.words[At]=It:xt.length--,xt._strip()}function Mt(Lt,mt,xt){return pt(Lt,mt,xt)}tt.prototype.mulTo=function(mt,xt){var It,jt=this.length+mt.length;return this.length===10&&mt.length===10?It=yt(this,mt,xt):jt<63?It=ht(this,mt,xt):jt<1024?It=pt(this,mt,xt):It=Mt(this,mt,xt),It},tt.prototype.mul=function(mt){var xt=new tt(null);return xt.words=new Array(this.length+mt.length),this.mulTo(mt,xt)},tt.prototype.mulf=function(mt){var xt=new tt(null);return xt.words=new Array(this.length+mt.length),Mt(this,mt,xt)},tt.prototype.imul=function(mt){return this.clone().mulTo(mt,this)},tt.prototype.imuln=function(mt){var xt=mt<0;xt&&(mt=-mt),_e(typeof mt=="number"),_e(mt<67108864);for(var It=0,jt=0;jt>=26,It+=At/67108864|0,It+=wt>>>26,this.words[jt]=wt&67108863}return It!==0&&(this.words[jt]=It,this.length++),xt?this.ineg():this},tt.prototype.muln=function(mt){return this.clone().imuln(mt)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(mt){var xt=gt(mt);if(xt.length===0)return new tt(1);for(var It=this,jt=0;jt=0);var xt=mt%26,It=(mt-xt)/26,jt=67108863>>>26-xt<<26-xt,At;if(xt!==0){var wt=0;for(At=0;At>>26-xt}wt&&(this.words[At]=wt,this.length++)}if(It!==0){for(At=this.length-1;At>=0;At--)this.words[At+It]=this.words[At];for(At=0;At=0);var jt;xt?jt=(xt-xt%26)/26:jt=0;var At=mt%26,wt=Math.min((mt-At)/26,this.length),Rt=67108863^67108863>>>At<wt)for(this.length-=wt,Ct=0;Ct=0&&(Bt!==0||Ct>=jt);Ct--){var Gt=this.words[Ct]|0;this.words[Ct]=Bt<<26-At|Gt>>>At,Bt=Gt&Rt}return Nt&&Bt!==0&&(Nt.words[Nt.length++]=Bt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},tt.prototype.ishrn=function(mt,xt,It){return _e(this.negative===0),this.iushrn(mt,xt,It)},tt.prototype.shln=function(mt){return this.clone().ishln(mt)},tt.prototype.ushln=function(mt){return this.clone().iushln(mt)},tt.prototype.shrn=function(mt){return this.clone().ishrn(mt)},tt.prototype.ushrn=function(mt){return this.clone().iushrn(mt)},tt.prototype.testn=function(mt){_e(typeof mt=="number"&&mt>=0);var xt=mt%26,It=(mt-xt)/26,jt=1<=0);var xt=mt%26,It=(mt-xt)/26;if(_e(this.negative===0,"imaskn works only with positive numbers"),this.length<=It)return this;if(xt!==0&&It++,this.length=Math.min(It,this.length),xt!==0){var jt=67108863^67108863>>>xt<=67108864;xt++)this.words[xt]-=67108864,xt===this.length-1?this.words[xt+1]=1:this.words[xt+1]++;return this.length=Math.max(this.length,xt+1),this},tt.prototype.isubn=function(mt){if(_e(typeof mt=="number"),_e(mt<67108864),mt<0)return this.iaddn(-mt);if(this.negative!==0)return this.negative=0,this.iaddn(mt),this.negative=1,this;if(this.words[0]-=mt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var xt=0;xt>26)-(Nt/67108864|0),this.words[At+It]=wt&67108863}for(;At>26,this.words[At+It]=wt&67108863;if(Rt===0)return this._strip();for(_e(Rt===-1),Rt=0,At=0;At>26,this.words[At]=wt&67108863;return this.negative=1,this._strip()},tt.prototype._wordDiv=function(mt,xt){var It=this.length-mt.length,jt=this.clone(),At=mt,wt=At.words[At.length-1]|0,Rt=this._countBits(wt);It=26-Rt,It!==0&&(At=At.ushln(It),jt.iushln(It),wt=At.words[At.length-1]|0);var Nt=jt.length-At.length,Ct;if(xt!=="mod"){Ct=new tt(null),Ct.length=Nt+1,Ct.words=new Array(Ct.length);for(var Bt=0;Bt=0;Vt--){var Yt=(jt.words[At.length+Vt]|0)*67108864+(jt.words[At.length+Vt-1]|0);for(Yt=Math.min(Yt/wt|0,67108863),jt._ishlnsubmul(At,Yt,Vt);jt.negative!==0;)Yt--,jt.negative=0,jt._ishlnsubmul(At,1,Vt),jt.isZero()||(jt.negative^=1);Ct&&(Ct.words[Vt]=Yt)}return Ct&&Ct._strip(),jt._strip(),xt!=="div"&&It!==0&&jt.iushrn(It),{div:Ct||null,mod:jt}},tt.prototype.divmod=function(mt,xt,It){if(_e(!mt.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var jt,At,wt;return this.negative!==0&&mt.negative===0?(wt=this.neg().divmod(mt,xt),xt!=="mod"&&(jt=wt.div.neg()),xt!=="div"&&(At=wt.mod.neg(),It&&At.negative!==0&&At.iadd(mt)),{div:jt,mod:At}):this.negative===0&&mt.negative!==0?(wt=this.divmod(mt.neg(),xt),xt!=="mod"&&(jt=wt.div.neg()),{div:jt,mod:wt.mod}):this.negative&mt.negative?(wt=this.neg().divmod(mt.neg(),xt),xt!=="div"&&(At=wt.mod.neg(),It&&At.negative!==0&&At.isub(mt)),{div:wt.div,mod:At}):mt.length>this.length||this.cmp(mt)<0?{div:new tt(0),mod:this}:mt.length===1?xt==="div"?{div:this.divn(mt.words[0]),mod:null}:xt==="mod"?{div:null,mod:new tt(this.modrn(mt.words[0]))}:{div:this.divn(mt.words[0]),mod:new tt(this.modrn(mt.words[0]))}:this._wordDiv(mt,xt)},tt.prototype.div=function(mt){return this.divmod(mt,"div",!1).div},tt.prototype.mod=function(mt){return this.divmod(mt,"mod",!1).mod},tt.prototype.umod=function(mt){return this.divmod(mt,"mod",!0).mod},tt.prototype.divRound=function(mt){var xt=this.divmod(mt);if(xt.mod.isZero())return xt.div;var It=xt.div.negative!==0?xt.mod.isub(mt):xt.mod,jt=mt.ushrn(1),At=mt.andln(1),wt=It.cmp(jt);return wt<0||At===1&&wt===0?xt.div:xt.div.negative!==0?xt.div.isubn(1):xt.div.iaddn(1)},tt.prototype.modrn=function(mt){var xt=mt<0;xt&&(mt=-mt),_e(mt<=67108863);for(var It=(1<<26)%mt,jt=0,At=this.length-1;At>=0;At--)jt=(It*jt+(this.words[At]|0))%mt;return xt?-jt:jt},tt.prototype.modn=function(mt){return this.modrn(mt)},tt.prototype.idivn=function(mt){var xt=mt<0;xt&&(mt=-mt),_e(mt<=67108863);for(var It=0,jt=this.length-1;jt>=0;jt--){var At=(this.words[jt]|0)+It*67108864;this.words[jt]=At/mt|0,It=At%mt}return this._strip(),xt?this.ineg():this},tt.prototype.divn=function(mt){return this.clone().idivn(mt)},tt.prototype.egcd=function(mt){_e(mt.negative===0),_e(!mt.isZero());var xt=this,It=mt.clone();xt.negative!==0?xt=xt.umod(mt):xt=xt.clone();for(var jt=new tt(1),At=new tt(0),wt=new tt(0),Rt=new tt(1),Nt=0;xt.isEven()&&It.isEven();)xt.iushrn(1),It.iushrn(1),++Nt;for(var Ct=It.clone(),Bt=xt.clone();!xt.isZero();){for(var Gt=0,Vt=1;!(xt.words[0]&Vt)&&Gt<26;++Gt,Vt<<=1);if(Gt>0)for(xt.iushrn(Gt);Gt-- >0;)(jt.isOdd()||At.isOdd())&&(jt.iadd(Ct),At.isub(Bt)),jt.iushrn(1),At.iushrn(1);for(var Yt=0,Qt=1;!(It.words[0]&Qt)&&Yt<26;++Yt,Qt<<=1);if(Yt>0)for(It.iushrn(Yt);Yt-- >0;)(wt.isOdd()||Rt.isOdd())&&(wt.iadd(Ct),Rt.isub(Bt)),wt.iushrn(1),Rt.iushrn(1);xt.cmp(It)>=0?(xt.isub(It),jt.isub(wt),At.isub(Rt)):(It.isub(xt),wt.isub(jt),Rt.isub(At))}return{a:wt,b:Rt,gcd:It.iushln(Nt)}},tt.prototype._invmp=function(mt){_e(mt.negative===0),_e(!mt.isZero());var xt=this,It=mt.clone();xt.negative!==0?xt=xt.umod(mt):xt=xt.clone();for(var jt=new tt(1),At=new tt(0),wt=It.clone();xt.cmpn(1)>0&&It.cmpn(1)>0;){for(var Rt=0,Nt=1;!(xt.words[0]&Nt)&&Rt<26;++Rt,Nt<<=1);if(Rt>0)for(xt.iushrn(Rt);Rt-- >0;)jt.isOdd()&&jt.iadd(wt),jt.iushrn(1);for(var Ct=0,Bt=1;!(It.words[0]&Bt)&&Ct<26;++Ct,Bt<<=1);if(Ct>0)for(It.iushrn(Ct);Ct-- >0;)At.isOdd()&&At.iadd(wt),At.iushrn(1);xt.cmp(It)>=0?(xt.isub(It),jt.isub(At)):(It.isub(xt),At.isub(jt))}var Gt;return xt.cmpn(1)===0?Gt=jt:Gt=At,Gt.cmpn(0)<0&&Gt.iadd(mt),Gt},tt.prototype.gcd=function(mt){if(this.isZero())return mt.abs();if(mt.isZero())return this.abs();var xt=this.clone(),It=mt.clone();xt.negative=0,It.negative=0;for(var jt=0;xt.isEven()&&It.isEven();jt++)xt.iushrn(1),It.iushrn(1);do{for(;xt.isEven();)xt.iushrn(1);for(;It.isEven();)It.iushrn(1);var At=xt.cmp(It);if(At<0){var wt=xt;xt=It,It=wt}else if(At===0||It.cmpn(1)===0)break;xt.isub(It)}while(!0);return It.iushln(jt)},tt.prototype.invm=function(mt){return this.egcd(mt).a.umod(mt)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(mt){return this.words[0]&mt},tt.prototype.bincn=function(mt){_e(typeof mt=="number");var xt=mt%26,It=(mt-xt)/26,jt=1<>>26,Rt&=67108863,this.words[wt]=Rt}return At!==0&&(this.words[wt]=At,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(mt){var xt=mt<0;if(this.negative!==0&&!xt)return-1;if(this.negative===0&&xt)return 1;this._strip();var It;if(this.length>1)It=1;else{xt&&(mt=-mt),_e(mt<=67108863,"Number is too big");var jt=this.words[0]|0;It=jt===mt?0:jtmt.length)return 1;if(this.length=0;It--){var jt=this.words[It]|0,At=mt.words[It]|0;if(jt!==At){jtAt&&(xt=1);break}}return xt},tt.prototype.gtn=function(mt){return this.cmpn(mt)===1},tt.prototype.gt=function(mt){return this.cmp(mt)===1},tt.prototype.gten=function(mt){return this.cmpn(mt)>=0},tt.prototype.gte=function(mt){return this.cmp(mt)>=0},tt.prototype.ltn=function(mt){return this.cmpn(mt)===-1},tt.prototype.lt=function(mt){return this.cmp(mt)===-1},tt.prototype.lten=function(mt){return this.cmpn(mt)<=0},tt.prototype.lte=function(mt){return this.cmp(mt)<=0},tt.prototype.eqn=function(mt){return this.cmpn(mt)===0},tt.prototype.eq=function(mt){return this.cmp(mt)===0},tt.red=function(mt){return new Ft(mt)},tt.prototype.toRed=function(mt){return _e(!this.red,"Already a number in reduction context"),_e(this.negative===0,"red works only with positives"),mt.convertTo(this)._forceRed(mt)},tt.prototype.fromRed=function(){return _e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(mt){return this.red=mt,this},tt.prototype.forceRed=function(mt){return _e(!this.red,"Already a number in reduction context"),this._forceRed(mt)},tt.prototype.redAdd=function(mt){return _e(this.red,"redAdd works only with red numbers"),this.red.add(this,mt)},tt.prototype.redIAdd=function(mt){return _e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,mt)},tt.prototype.redSub=function(mt){return _e(this.red,"redSub works only with red numbers"),this.red.sub(this,mt)},tt.prototype.redISub=function(mt){return _e(this.red,"redISub works only with red numbers"),this.red.isub(this,mt)},tt.prototype.redShl=function(mt){return _e(this.red,"redShl works only with red numbers"),this.red.shl(this,mt)},tt.prototype.redMul=function(mt){return _e(this.red,"redMul works only with red numbers"),this.red._verify2(this,mt),this.red.mul(this,mt)},tt.prototype.redIMul=function(mt){return _e(this.red,"redMul works only with red numbers"),this.red._verify2(this,mt),this.red.imul(this,mt)},tt.prototype.redSqr=function(){return _e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return _e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return _e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return _e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return _e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(mt){return _e(this.red&&!mt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,mt)};var St={k256:null,p224:null,p192:null,p25519:null};function Tt(Lt,mt){this.name=Lt,this.p=new tt(mt,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Tt.prototype._tmp=function(){var mt=new tt(null);return mt.words=new Array(Math.ceil(this.n/13)),mt},Tt.prototype.ireduce=function(mt){var xt=mt,It;do this.split(xt,this.tmp),xt=this.imulK(xt),xt=xt.iadd(this.tmp),It=xt.bitLength();while(It>this.n);var jt=It0?xt.isub(this.p):xt.strip!==void 0?xt.strip():xt._strip(),xt},Tt.prototype.split=function(mt,xt){mt.iushrn(this.n,0,xt)},Tt.prototype.imulK=function(mt){return mt.imul(this.k)};function vt(){Tt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(vt,Tt),vt.prototype.split=function(mt,xt){for(var It=4194303,jt=Math.min(mt.length,9),At=0;At>>22,wt=Rt}wt>>>=22,mt.words[At-10]=wt,wt===0&&mt.length>10?mt.length-=10:mt.length-=9},vt.prototype.imulK=function(mt){mt.words[mt.length]=0,mt.words[mt.length+1]=0,mt.length+=2;for(var xt=0,It=0;It>>=26,mt.words[It]=At,xt=jt}return xt!==0&&(mt.words[mt.length++]=xt),mt},tt._prime=function(mt){if(St[mt])return St[mt];var xt;if(mt==="k256")xt=new vt;else if(mt==="p224")xt=new Dt;else if(mt==="p192")xt=new zt;else if(mt==="p25519")xt=new Ot;else throw new Error("Unknown prime "+mt);return St[mt]=xt,xt};function Ft(Lt){if(typeof Lt=="string"){var mt=tt._prime(Lt);this.m=mt.p,this.prime=mt}else _e(Lt.gtn(1),"modulus must be greater than 1"),this.m=Lt,this.prime=null}Ft.prototype._verify1=function(mt){_e(mt.negative===0,"red works only with positives"),_e(mt.red,"red works only with red numbers")},Ft.prototype._verify2=function(mt,xt){_e((mt.negative|xt.negative)===0,"red works only with positives"),_e(mt.red&&mt.red===xt.red,"red works only with red numbers")},Ft.prototype.imod=function(mt){return this.prime?this.prime.ireduce(mt)._forceRed(this):(st(mt,mt.umod(this.m)._forceRed(this)),mt)},Ft.prototype.neg=function(mt){return mt.isZero()?mt.clone():this.m.sub(mt)._forceRed(this)},Ft.prototype.add=function(mt,xt){this._verify2(mt,xt);var It=mt.add(xt);return It.cmp(this.m)>=0&&It.isub(this.m),It._forceRed(this)},Ft.prototype.iadd=function(mt,xt){this._verify2(mt,xt);var It=mt.iadd(xt);return It.cmp(this.m)>=0&&It.isub(this.m),It},Ft.prototype.sub=function(mt,xt){this._verify2(mt,xt);var It=mt.sub(xt);return It.cmpn(0)<0&&It.iadd(this.m),It._forceRed(this)},Ft.prototype.isub=function(mt,xt){this._verify2(mt,xt);var It=mt.isub(xt);return It.cmpn(0)<0&&It.iadd(this.m),It},Ft.prototype.shl=function(mt,xt){return this._verify1(mt),this.imod(mt.ushln(xt))},Ft.prototype.imul=function(mt,xt){return this._verify2(mt,xt),this.imod(mt.imul(xt))},Ft.prototype.mul=function(mt,xt){return this._verify2(mt,xt),this.imod(mt.mul(xt))},Ft.prototype.isqr=function(mt){return this.imul(mt,mt.clone())},Ft.prototype.sqr=function(mt){return this.mul(mt,mt)},Ft.prototype.sqrt=function(mt){if(mt.isZero())return mt.clone();var xt=this.m.andln(3);if(_e(xt%2===1),xt===3){var It=this.m.add(new tt(1)).iushrn(2);return this.pow(mt,It)}for(var jt=this.m.subn(1),At=0;!jt.isZero()&&jt.andln(1)===0;)At++,jt.iushrn(1);_e(!jt.isZero());var wt=new tt(1).toRed(this),Rt=wt.redNeg(),Nt=this.m.subn(1).iushrn(1),Ct=this.m.bitLength();for(Ct=new tt(2*Ct*Ct).toRed(this);this.pow(Ct,Nt).cmp(Rt)!==0;)Ct.redIAdd(Rt);for(var Bt=this.pow(Ct,jt),Gt=this.pow(mt,jt.addn(1).iushrn(1)),Vt=this.pow(mt,jt),Yt=At;Vt.cmp(wt)!==0;){for(var Qt=Vt,qt=0;Qt.cmp(wt)!==0;qt++)Qt=Qt.redSqr();_e(qt=0;At--){for(var Bt=xt.words[At],Gt=Ct-1;Gt>=0;Gt--){var Vt=Bt>>Gt&1;if(wt!==jt[0]&&(wt=this.sqr(wt)),Vt===0&&Rt===0){Nt=0;continue}Rt<<=1,Rt|=Vt,Nt++,!(Nt!==It&&(At!==0||Gt!==0))&&(wt=this.mul(wt,jt[Rt]),Nt=0,Rt=0)}Ct=26}return wt},Ft.prototype.convertTo=function(mt){var xt=mt.umod(this.m);return xt===mt?xt.clone():xt},Ft.prototype.convertFrom=function(mt){var xt=mt.clone();return xt.red=null,xt},tt.mont=function(mt){return new Pt(mt)};function Pt(Lt){Ft.call(this,Lt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(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)}et(Pt,Ft),Pt.prototype.convertTo=function(mt){return this.imod(mt.ushln(this.shift))},Pt.prototype.convertFrom=function(mt){var xt=this.imod(mt.mul(this.rinv));return xt.red=null,xt},Pt.prototype.imul=function(mt,xt){if(mt.isZero()||xt.isZero())return mt.words[0]=0,mt.length=1,mt;var It=mt.imul(xt),jt=It.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=It.isub(jt).iushrn(this.shift),wt=At;return At.cmp(this.m)>=0?wt=At.isub(this.m):At.cmpn(0)<0&&(wt=At.iadd(this.m)),wt._forceRed(this)},Pt.prototype.mul=function(mt,xt){if(mt.isZero()||xt.isZero())return new tt(0)._forceRed(this);var It=mt.mul(xt),jt=It.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=It.isub(jt).iushrn(this.shift),wt=At;return At.cmp(this.m)>=0?wt=At.isub(this.m):At.cmpn(0)<0&&(wt=At.iadd(this.m)),wt._forceRed(this)},Pt.prototype.invm=function(mt){var xt=this.imod(mt._invmp(this.m).mul(this.r2));return xt._forceRed(this)}})(s,commonjsGlobal$1)})(bn);var bnExports=bn.exports;const BN=getDefaultExportFromCjs$1(bnExports);function setBigUint64(s,j,$,_e){if(typeof s.setBigUint64=="function")return s.setBigUint64(j,$,_e);const et=BigInt(32),tt=BigInt(4294967295),nt=Number($>>et&tt),rt=Number($&tt),ot=_e?4:0,it=_e?0:4;s.setUint32(j+ot,nt,_e),s.setUint32(j+it,rt,_e)}const Chi=(s,j,$)=>s&j^~s&$,Maj=(s,j,$)=>s&j^s&$^j&$;class HashMD extends Hash{constructor(j,$,_e,et){super(),this.blockLen=j,this.outputLen=$,this.padOffset=_e,this.isLE=et,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(j),this.view=createView(this.buffer)}update(j){exists(this);const{view:$,buffer:_e,blockLen:et}=this;j=toBytes(j);const tt=j.length;for(let nt=0;ntet-nt&&(this.process(_e,0),nt=0);for(let at=nt;atst.length)throw new Error("_sha2: outputLen bigger than state");for(let at=0;at>>3,ft=rotr(lt,17)^rotr(lt,19)^lt>>>10;SHA256_W[at]=ft+SHA256_W[at-7]+dt+SHA256_W[at-16]|0}let{A:_e,B:et,C:tt,D:nt,E:rt,F:ot,G:it,H:st}=this;for(let at=0;at<64;at++){const ct=rotr(rt,6)^rotr(rt,11)^rotr(rt,25),lt=st+ct+Chi(rt,ot,it)+SHA256_K[at]+SHA256_W[at]|0,ft=(rotr(_e,2)^rotr(_e,13)^rotr(_e,22))+Maj(_e,et,tt)|0;st=it,it=ot,ot=rt,rt=nt+lt|0,nt=tt,tt=et,et=_e,_e=lt+ft|0}_e=_e+this.A|0,et=et+this.B|0,tt=tt+this.C|0,nt=nt+this.D|0,rt=rt+this.E|0,ot=ot+this.F|0,it=it+this.G|0,st=st+this.H|0,this.set(_e,et,tt,nt,rt,ot,it,st)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class SHA224 extends SHA256{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const sha256=wrapConstructor(()=>new SHA256),sha224=wrapConstructor(()=>new SHA224),sha256$1=Object.freeze(Object.defineProperty({__proto__:null,sha224,sha256},Symbol.toStringTag,{value:"Module"}));var lib={};function inRange(s,j,$){return j<=s&&s<=$}function ToDictionary(s){if(s===void 0)return{};if(s===Object(s))return s;throw TypeError("Could not convert argument to dictionary")}function stringToCodePoints(s){for(var j=String(s),$=j.length,_e=0,et=[];_e<$;){var tt=j.charCodeAt(_e);if(tt<55296||tt>57343)et.push(tt);else if(56320<=tt&&tt<=57343)et.push(65533);else if(55296<=tt&&tt<=56319)if(_e===$-1)et.push(65533);else{var nt=s.charCodeAt(_e+1);if(56320<=nt&&nt<=57343){var rt=tt&1023,ot=nt&1023;et.push(65536+(rt<<10)+ot),_e+=1}else et.push(65533)}_e+=1}return et}function codePointsToString(s){for(var j="",$=0;$>10)+55296,(_e&1023)+56320))}return j}var end_of_stream=-1;function Stream(s){this.tokens=[].slice.call(s)}Stream.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():end_of_stream},prepend:function(s){if(Array.isArray(s))for(var j=s;j.length;)this.tokens.unshift(j.pop());else this.tokens.unshift(s)},push:function(s){if(Array.isArray(s))for(var j=s;j.length;)this.tokens.push(j.shift());else this.tokens.push(s)}};var finished=-1;function decoderError(s,j){if(s)throw TypeError("Decoder error");return j||65533}var DEFAULT_ENCODING="utf-8";function TextDecoder$1(s,j){if(!(this instanceof TextDecoder$1))return new TextDecoder$1(s,j);if(s=s!==void 0?String(s).toLowerCase():DEFAULT_ENCODING,s!==DEFAULT_ENCODING)throw new Error("Encoding not supported. Only utf-8 is supported");j=ToDictionary(j),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!j.fatal,this._ignoreBOM=!!j.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}TextDecoder$1.prototype={decode:function(j,$){var _e;typeof j=="object"&&j instanceof ArrayBuffer?_e=new Uint8Array(j):typeof j=="object"&&"buffer"in j&&j.buffer instanceof ArrayBuffer?_e=new Uint8Array(j.buffer,j.byteOffset,j.byteLength):_e=new Uint8Array(0),$=ToDictionary($),this._streaming||(this._decoder=new UTF8Decoder({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!$.stream;for(var et=new Stream(_e),tt=[],nt;!et.endOfStream()&&(nt=this._decoder.handler(et,et.read()),nt!==finished);)nt!==null&&(Array.isArray(nt)?tt.push.apply(tt,nt):tt.push(nt));if(!this._streaming){do{if(nt=this._decoder.handler(et,et.read()),nt===finished)break;nt!==null&&(Array.isArray(nt)?tt.push.apply(tt,nt):tt.push(nt))}while(!et.endOfStream());this._decoder=null}return tt.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(tt[0]===65279?(this._BOMseen=!0,tt.shift()):this._BOMseen=!0),codePointsToString(tt)}};function TextEncoder$1(s,j){if(!(this instanceof TextEncoder$1))return new TextEncoder$1(s,j);if(s=s!==void 0?String(s).toLowerCase():DEFAULT_ENCODING,s!==DEFAULT_ENCODING)throw new Error("Encoding not supported. Only utf-8 is supported");j=ToDictionary(j),this._streaming=!1,this._encoder=null,this._options={fatal:!!j.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}TextEncoder$1.prototype={encode:function(j,$){j=j?String(j):"",$=ToDictionary($),this._streaming||(this._encoder=new UTF8Encoder(this._options)),this._streaming=!!$.stream;for(var _e=[],et=new Stream(stringToCodePoints(j)),tt;!et.endOfStream()&&(tt=this._encoder.handler(et,et.read()),tt!==finished);)Array.isArray(tt)?_e.push.apply(_e,tt):_e.push(tt);if(!this._streaming){for(;tt=this._encoder.handler(et,et.read()),tt!==finished;)Array.isArray(tt)?_e.push.apply(_e,tt):_e.push(tt);this._encoder=null}return new Uint8Array(_e)}};function UTF8Decoder(s){var j=s.fatal,$=0,_e=0,et=0,tt=128,nt=191;this.handler=function(rt,ot){if(ot===end_of_stream&&et!==0)return et=0,decoderError(j);if(ot===end_of_stream)return finished;if(et===0){if(inRange(ot,0,127))return ot;if(inRange(ot,194,223))et=1,$=ot-192;else if(inRange(ot,224,239))ot===224&&(tt=160),ot===237&&(nt=159),et=2,$=ot-224;else if(inRange(ot,240,244))ot===240&&(tt=144),ot===244&&(nt=143),et=3,$=ot-240;else return decoderError(j);return $=$<<6*et,null}if(!inRange(ot,tt,nt))return $=et=_e=0,tt=128,nt=191,rt.prepend(ot),decoderError(j);if(tt=128,nt=191,_e+=1,$+=ot-128<<6*(et-_e),_e!==et)return null;var it=$;return $=et=_e=0,it}}function UTF8Encoder(s){s.fatal,this.handler=function(j,$){if($===end_of_stream)return finished;if(inRange($,0,127))return $;var _e,et;inRange($,128,2047)?(_e=1,et=192):inRange($,2048,65535)?(_e=2,et=224):inRange($,65536,1114111)&&(_e=3,et=240);for(var tt=[($>>6*_e)+et];_e>0;){var nt=$>>6*(_e-1);tt.push(128|nt&63),_e-=1}return tt}}const encoding$2=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:TextDecoder$1,TextEncoder:TextEncoder$1},Symbol.toStringTag,{value:"Module"})),require$$2=getAugmentedNamespace(encoding$2);var __createBinding=commonjsGlobal$1&&commonjsGlobal$1.__createBinding||(Object.create?function(s,j,$,_e){_e===void 0&&(_e=$),Object.defineProperty(s,_e,{enumerable:!0,get:function(){return j[$]}})}:function(s,j,$,_e){_e===void 0&&(_e=$),s[_e]=j[$]}),__setModuleDefault=commonjsGlobal$1&&commonjsGlobal$1.__setModuleDefault||(Object.create?function(s,j){Object.defineProperty(s,"default",{enumerable:!0,value:j})}:function(s,j){s.default=j}),__decorate=commonjsGlobal$1&&commonjsGlobal$1.__decorate||function(s,j,$,_e){var et=arguments.length,tt=et<3?j:_e===null?_e=Object.getOwnPropertyDescriptor(j,$):_e,nt;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")tt=Reflect.decorate(s,j,$,_e);else for(var rt=s.length-1;rt>=0;rt--)(nt=s[rt])&&(tt=(et<3?nt(tt):et>3?nt(j,$,tt):nt(j,$))||tt);return et>3&&tt&&Object.defineProperty(j,$,tt),tt},__importStar=commonjsGlobal$1&&commonjsGlobal$1.__importStar||function(s){if(s&&s.__esModule)return s;var j={};if(s!=null)for(var $ in s)$!=="default"&&Object.hasOwnProperty.call(s,$)&&__createBinding(j,s,$);return __setModuleDefault(j,s),j},__importDefault$3=commonjsGlobal$1&&commonjsGlobal$1.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(lib,"__esModule",{value:!0});var deserializeUnchecked_1=lib.deserializeUnchecked=deserialize_1=lib.deserialize=serialize_1=lib.serialize=lib.BinaryReader=lib.BinaryWriter=lib.BorshError=lib.baseDecode=lib.baseEncode=void 0;const bn_js_1=__importDefault$3(bnExports),bs58_1$1=__importDefault$3(bs58),encoding$1=__importStar(require$$2),ResolvedTextDecoder=typeof TextDecoder!="function"?encoding$1.TextDecoder:TextDecoder,textDecoder=new ResolvedTextDecoder("utf-8",{fatal:!0});function baseEncode(s){return typeof s=="string"&&(s=Buffer.from(s,"utf8")),bs58_1$1.default.encode(Buffer.from(s))}lib.baseEncode=baseEncode;function baseDecode(s){return Buffer.from(bs58_1$1.default.decode(s))}lib.baseDecode=baseDecode;const INITIAL_LENGTH=1024;class BorshError extends Error{constructor(j){super(j),this.fieldPath=[],this.originalMessage=j}addToFieldPath(j){this.fieldPath.splice(0,0,j),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}lib.BorshError=BorshError;class BinaryWriter{constructor(){this.buf=Buffer.alloc(INITIAL_LENGTH),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(INITIAL_LENGTH)]))}writeU8(j){this.maybeResize(),this.buf.writeUInt8(j,this.length),this.length+=1}writeU16(j){this.maybeResize(),this.buf.writeUInt16LE(j,this.length),this.length+=2}writeU32(j){this.maybeResize(),this.buf.writeUInt32LE(j,this.length),this.length+=4}writeU64(j){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(j).toArray("le",8)))}writeU128(j){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(j).toArray("le",16)))}writeU256(j){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(j).toArray("le",32)))}writeU512(j){this.maybeResize(),this.writeBuffer(Buffer.from(new bn_js_1.default(j).toArray("le",64)))}writeBuffer(j){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),j,Buffer.alloc(INITIAL_LENGTH)]),this.length+=j.length}writeString(j){this.maybeResize();const $=Buffer.from(j,"utf8");this.writeU32($.length),this.writeBuffer($)}writeFixedArray(j){this.writeBuffer(Buffer.from(j))}writeArray(j,$){this.maybeResize(),this.writeU32(j.length);for(const _e of j)this.maybeResize(),$(_e)}toArray(){return this.buf.subarray(0,this.length)}}lib.BinaryWriter=BinaryWriter;function handlingRangeError(s,j,$){const _e=$.value;$.value=function(...et){try{return _e.apply(this,et)}catch(tt){if(tt instanceof RangeError){const nt=tt.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(nt)>=0)throw new BorshError("Reached the end of buffer when deserializing")}throw tt}}}let BinaryReader$2=class{constructor(j){this.buf=j,this.offset=0}readU8(){const j=this.buf.readUInt8(this.offset);return this.offset+=1,j}readU16(){const j=this.buf.readUInt16LE(this.offset);return this.offset+=2,j}readU32(){const j=this.buf.readUInt32LE(this.offset);return this.offset+=4,j}readU64(){const j=this.readBuffer(8);return new bn_js_1.default(j,"le")}readU128(){const j=this.readBuffer(16);return new bn_js_1.default(j,"le")}readU256(){const j=this.readBuffer(32);return new bn_js_1.default(j,"le")}readU512(){const j=this.readBuffer(64);return new bn_js_1.default(j,"le")}readBuffer(j){if(this.offset+j>this.buf.length)throw new BorshError(`Expected buffer length ${j} isn't within bounds`);const $=this.buf.slice(this.offset,this.offset+j);return this.offset+=j,$}readString(){const j=this.readU32(),$=this.readBuffer(j);try{return textDecoder.decode($)}catch(_e){throw new BorshError(`Error decoding UTF-8 string: ${_e}`)}}readFixedArray(j){return new Uint8Array(this.readBuffer(j))}readArray(j){const $=this.readU32(),_e=Array();for(let et=0;et<$;++et)_e.push(j());return _e}};__decorate([handlingRangeError],BinaryReader$2.prototype,"readU8",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU16",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU32",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU64",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU128",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU256",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readU512",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readString",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readFixedArray",null);__decorate([handlingRangeError],BinaryReader$2.prototype,"readArray",null);lib.BinaryReader=BinaryReader$2;function capitalizeFirstLetter(s){return s.charAt(0).toUpperCase()+s.slice(1)}function serializeField(s,j,$,_e,et){try{if(typeof _e=="string")et[`write${capitalizeFirstLetter(_e)}`]($);else if(_e instanceof Array)if(typeof _e[0]=="number"){if($.length!==_e[0])throw new BorshError(`Expecting byte array of length ${_e[0]}, but got ${$.length} bytes`);et.writeFixedArray($)}else if(_e.length===2&&typeof _e[1]=="number"){if($.length!==_e[1])throw new BorshError(`Expecting byte array of length ${_e[1]}, but got ${$.length} bytes`);for(let tt=0;tt<_e[1];tt++)serializeField(s,null,$[tt],_e[0],et)}else et.writeArray($,tt=>{serializeField(s,j,tt,_e[0],et)});else if(_e.kind!==void 0)switch(_e.kind){case"option":{$==null?et.writeU8(0):(et.writeU8(1),serializeField(s,j,$,_e.type,et));break}case"map":{et.writeU32($.size),$.forEach((tt,nt)=>{serializeField(s,j,nt,_e.key,et),serializeField(s,j,tt,_e.value,et)});break}default:throw new BorshError(`FieldType ${_e} unrecognized`)}else serializeStruct(s,$,et)}catch(tt){throw tt instanceof BorshError&&tt.addToFieldPath(j),tt}}function serializeStruct(s,j,$){if(typeof j.borshSerialize=="function"){j.borshSerialize($);return}const _e=s.get(j.constructor);if(!_e)throw new BorshError(`Class ${j.constructor.name} is missing in schema`);if(_e.kind==="struct")_e.fields.map(([et,tt])=>{serializeField(s,et,j[et],tt,$)});else if(_e.kind==="enum"){const et=j[_e.field];for(let tt=0;tt<_e.values.length;++tt){const[nt,rt]=_e.values[tt];if(nt===et){$.writeU8(tt),serializeField(s,nt,j[nt],rt,$);break}}}else throw new BorshError(`Unexpected schema kind: ${_e.kind} for ${j.constructor.name}`)}function serialize$2(s,j,$=BinaryWriter){const _e=new $;return serializeStruct(s,j,_e),_e.toArray()}var serialize_1=lib.serialize=serialize$2;function deserializeField(s,j,$,_e){try{if(typeof $=="string")return _e[`read${capitalizeFirstLetter($)}`]();if($ instanceof Array){if(typeof $[0]=="number")return _e.readFixedArray($[0]);if(typeof $[1]=="number"){const et=[];for(let tt=0;tt<$[1];tt++)et.push(deserializeField(s,null,$[0],_e));return et}else return _e.readArray(()=>deserializeField(s,j,$[0],_e))}if($.kind==="option")return _e.readU8()?deserializeField(s,j,$.type,_e):void 0;if($.kind==="map"){let et=new Map;const tt=_e.readU32();for(let nt=0;nt=_e.values.length)throw new BorshError(`Enum index: ${et} is out of range`);const[tt,nt]=_e.values[et],rt=deserializeField(s,tt,nt,$);return new j({[tt]:rt})}throw new BorshError(`Unexpected schema kind: ${_e.kind} for ${j.constructor.name}`)}function deserialize$2(s,j,$,_e=BinaryReader$2){const et=new _e($),tt=deserializeStruct(s,j,et);if(et.offset<$.length)throw new BorshError(`Unexpected ${$.length-et.offset} bytes after deserialized data`);return tt}var deserialize_1=lib.deserialize=deserialize$2;function deserializeUnchecked(s,j,$,_e=BinaryReader$2){const et=new _e($);return deserializeStruct(s,j,et)}deserializeUnchecked_1=lib.deserializeUnchecked=deserializeUnchecked;var Layout$1={};Object.defineProperty(Layout$1,"__esModule",{value:!0});Layout$1.s16=Layout$1.s8=Layout$1.nu64be=Layout$1.u48be=Layout$1.u40be=Layout$1.u32be=Layout$1.u24be=Layout$1.u16be=nu64=Layout$1.nu64=Layout$1.u48=Layout$1.u40=u32=Layout$1.u32=Layout$1.u24=u16=Layout$1.u16=u8=Layout$1.u8=offset=Layout$1.offset=Layout$1.greedy=Layout$1.Constant=Layout$1.UTF8=Layout$1.CString=Layout$1.Blob=Layout$1.Boolean=Layout$1.BitField=Layout$1.BitStructure=Layout$1.VariantLayout=Layout$1.Union=Layout$1.UnionLayoutDiscriminator=Layout$1.UnionDiscriminator=Layout$1.Structure=Layout$1.Sequence=Layout$1.DoubleBE=Layout$1.Double=Layout$1.FloatBE=Layout$1.Float=Layout$1.NearInt64BE=Layout$1.NearInt64=Layout$1.NearUInt64BE=Layout$1.NearUInt64=Layout$1.IntBE=Layout$1.Int=Layout$1.UIntBE=Layout$1.UInt=Layout$1.OffsetLayout=Layout$1.GreedyCount=Layout$1.ExternalLayout=Layout$1.bindConstructorLayout=Layout$1.nameWithProperty=Layout$1.Layout=Layout$1.uint8ArrayToBuffer=Layout$1.checkUint8Array=void 0;Layout$1.constant=Layout$1.utf8=Layout$1.cstr=blob=Layout$1.blob=Layout$1.unionLayoutDiscriminator=Layout$1.union=seq=Layout$1.seq=Layout$1.bits=struct=Layout$1.struct=Layout$1.f64be=Layout$1.f64=Layout$1.f32be=Layout$1.f32=Layout$1.ns64be=Layout$1.s48be=Layout$1.s40be=Layout$1.s32be=Layout$1.s24be=Layout$1.s16be=ns64=Layout$1.ns64=Layout$1.s48=Layout$1.s40=Layout$1.s32=Layout$1.s24=void 0;const buffer_1$1=buffer;function checkUint8Array(s){if(!(s instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}Layout$1.checkUint8Array=checkUint8Array;function uint8ArrayToBuffer(s){return checkUint8Array(s),buffer_1$1.Buffer.from(s.buffer,s.byteOffset,s.length)}Layout$1.uint8ArrayToBuffer=uint8ArrayToBuffer;class Layout{constructor(j,$){if(!Number.isInteger(j))throw new TypeError("span must be an integer");this.span=j,this.property=$}makeDestinationObject(){return{}}getSpan(j,$){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(j){const $=Object.create(this.constructor.prototype);return Object.assign($,this),$.property=j,$}fromArray(j){}}Layout$1.Layout=Layout;function nameWithProperty(s,j){return j.property?s+"["+j.property+"]":s}Layout$1.nameWithProperty=nameWithProperty;function bindConstructorLayout(s,j){if(typeof s!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(s,"layout_"))throw new Error("Class is already bound to a layout");if(!(j&&j instanceof Layout))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(j,"boundConstructor_"))throw new Error("layout is already bound to a constructor");s.layout_=j,j.boundConstructor_=s,j.makeDestinationObject=()=>new s,Object.defineProperty(s.prototype,"encode",{value($,_e){return j.encode(this,$,_e)},writable:!0}),Object.defineProperty(s,"decode",{value($,_e){return j.decode($,_e)},writable:!0})}Layout$1.bindConstructorLayout=bindConstructorLayout;class ExternalLayout extends Layout{isCount(){throw new Error("ExternalLayout is abstract")}}Layout$1.ExternalLayout=ExternalLayout;class GreedyCount extends ExternalLayout{constructor(j=1,$){if(!Number.isInteger(j)||0>=j)throw new TypeError("elementSpan must be a (positive) integer");super(-1,$),this.elementSpan=j}isCount(){return!0}decode(j,$=0){checkUint8Array(j);const _e=j.length-$;return Math.floor(_e/this.elementSpan)}encode(j,$,_e){return 0}}Layout$1.GreedyCount=GreedyCount;class OffsetLayout extends ExternalLayout{constructor(j,$=0,_e){if(!(j instanceof Layout))throw new TypeError("layout must be a Layout");if(!Number.isInteger($))throw new TypeError("offset must be integer or undefined");super(j.span,_e||j.property),this.layout=j,this.offset=$}isCount(){return this.layout instanceof UInt||this.layout instanceof UIntBE}decode(j,$=0){return this.layout.decode(j,$+this.offset)}encode(j,$,_e=0){return this.layout.encode(j,$,_e+this.offset)}}Layout$1.OffsetLayout=OffsetLayout;class UInt extends Layout{constructor(j,$){if(super(j,$),6nt+et.encode(rt,$,_e+nt),0);return this.count instanceof ExternalLayout&&this.count.encode(j.length,$,_e),tt}}Layout$1.Sequence=Sequence;class Structure extends Layout{constructor(j,$,_e){if(!(Array.isArray(j)&&j.reduce((tt,nt)=>tt&&nt instanceof Layout,!0)))throw new TypeError("fields must be array of Layout instances");typeof $=="boolean"&&_e===void 0&&(_e=$,$=void 0);for(const tt of j)if(0>tt.span&&tt.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let et=-1;try{et=j.reduce((tt,nt)=>tt+nt.getSpan(),0)}catch{}super(et,$),this.fields=j,this.decodePrefixes=!!_e}getSpan(j,$=0){if(0<=this.span)return this.span;let _e=0;try{_e=this.fields.reduce((et,tt)=>{const nt=tt.getSpan(j,$);return $+=nt,et+nt},0)}catch{throw new RangeError("indeterminate span")}return _e}decode(j,$=0){checkUint8Array(j);const _e=this.makeDestinationObject();for(const et of this.fields)if(et.property!==void 0&&(_e[et.property]=et.decode(j,$)),$+=et.getSpan(j,$),this.decodePrefixes&&j.length===$)break;return _e}encode(j,$,_e=0){const et=_e;let tt=0,nt=0;for(const rt of this.fields){let ot=rt.span;if(nt=0ot&&(ot=rt.getSpan($,_e)))}tt=_e,_e+=ot}return tt+nt-et}fromArray(j){const $=this.makeDestinationObject();for(const _e of this.fields)_e.property!==void 0&&0_e.span?$=-1:0<=$&&($+=_e.span)}}}Layout$1.Structure=Structure;class UnionDiscriminator{constructor(j){this.property=j}decode(j,$){throw new Error("UnionDiscriminator is abstract")}encode(j,$,_e){throw new Error("UnionDiscriminator is abstract")}}Layout$1.UnionDiscriminator=UnionDiscriminator;class UnionLayoutDiscriminator extends UnionDiscriminator{constructor(j,$){if(!(j instanceof ExternalLayout&&j.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super($||j.property||"variant"),this.layout=j}decode(j,$){return this.layout.decode(j,$)}encode(j,$,_e){return this.layout.encode(j,$,_e)}}Layout$1.UnionLayoutDiscriminator=UnionLayoutDiscriminator;class Union extends Layout{constructor(j,$,_e){let et;if(j instanceof UInt||j instanceof UIntBE)et=new UnionLayoutDiscriminator(new OffsetLayout(j));else if(j instanceof ExternalLayout&&j.isCount())et=new UnionLayoutDiscriminator(j);else if(j instanceof UnionDiscriminator)et=j;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if($===void 0&&($=null),!($===null||$ instanceof Layout))throw new TypeError("defaultLayout must be null or a Layout");if($!==null){if(0>$.span)throw new Error("defaultLayout must have constant span");$.property===void 0&&($=$.replicate("content"))}let tt=-1;$&&(tt=$.span,0<=tt&&(j instanceof UInt||j instanceof UIntBE)&&(tt+=et.layout.span)),super(tt,_e),this.discriminator=et,this.usesPrefixDiscriminator=j instanceof UInt||j instanceof UIntBE,this.defaultLayout=$,this.registry={};let nt=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(rt){return nt(rt)},this.configGetSourceVariant=function(rt){nt=rt.bind(this)}}getSpan(j,$=0){if(0<=this.span)return this.span;const _e=this.getVariant(j,$);if(!_e)throw new Error("unable to determine span for unrecognized variant");return _e.getSpan(j,$)}defaultGetSourceVariant(j){if(Object.prototype.hasOwnProperty.call(j,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(j,this.defaultLayout.property))return;const $=this.registry[j[this.discriminator.property]];if($&&(!$.layout||$.property&&Object.prototype.hasOwnProperty.call(j,$.property)))return $}else for(const $ in this.registry){const _e=this.registry[$];if(_e.property&&Object.prototype.hasOwnProperty.call(j,_e.property))return _e}throw new Error("unable to infer src variant")}decode(j,$=0){let _e;const et=this.discriminator,tt=et.decode(j,$),nt=this.registry[tt];if(nt===void 0){const rt=this.defaultLayout;let ot=0;this.usesPrefixDiscriminator&&(ot=et.layout.span),_e=this.makeDestinationObject(),_e[et.property]=tt,_e[rt.property]=rt.decode(j,$+ot)}else _e=nt.decode(j,$);return _e}encode(j,$,_e=0){const et=this.getSourceVariant(j);if(et===void 0){const tt=this.discriminator,nt=this.defaultLayout;let rt=0;return this.usesPrefixDiscriminator&&(rt=tt.layout.span),tt.encode(j[tt.property],$,_e),rt+nt.encode(j[nt.property],$,_e+rt)}return et.encode(j,$,_e)}addVariant(j,$,_e){const et=new VariantLayout(this,j,$,_e);return this.registry[j]=et,et}getVariant(j,$=0){let _e;return j instanceof Uint8Array?_e=this.discriminator.decode(j,$):_e=j,this.registry[_e]}}Layout$1.Union=Union;class VariantLayout extends Layout{constructor(j,$,_e,et){if(!(j instanceof Union))throw new TypeError("union must be a Union");if(!Number.isInteger($)||0>$)throw new TypeError("variant must be a (non-negative) integer");if(typeof _e=="string"&&et===void 0&&(et=_e,_e=null),_e){if(!(_e instanceof Layout))throw new TypeError("layout must be a Layout");if(j.defaultLayout!==null&&0<=_e.span&&_e.span>j.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof et!="string")throw new TypeError("variant must have a String property")}let tt=j.span;0>j.span&&(tt=_e?_e.span:0,0<=tt&&j.usesPrefixDiscriminator&&(tt+=j.discriminator.layout.span)),super(tt,et),this.union=j,this.variant=$,this.layout=_e||null}getSpan(j,$=0){if(0<=this.span)return this.span;let _e=0;this.union.usesPrefixDiscriminator&&(_e=this.union.discriminator.layout.span);let et=0;return this.layout&&(et=this.layout.getSpan(j,$+_e)),_e+et}decode(j,$=0){const _e=this.makeDestinationObject();if(this!==this.union.getVariant(j,$))throw new Error("variant mismatch");let et=0;return this.union.usesPrefixDiscriminator&&(et=this.union.discriminator.layout.span),this.layout?_e[this.property]=this.layout.decode(j,$+et):this.property?_e[this.property]=!0:this.union.usesPrefixDiscriminator&&(_e[this.union.discriminator.property]=this.variant),_e}encode(j,$,_e=0){let et=0;if(this.union.usesPrefixDiscriminator&&(et=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(j,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,$,_e);let tt=et;if(this.layout&&(this.layout.encode(j[this.property],$,_e+et),tt+=this.layout.getSpan($,_e+et),0<=this.union.span&&tt>this.union.span))throw new Error("encoded variant overruns containing union");return tt}fromArray(j){if(this.layout)return this.layout.fromArray(j)}}Layout$1.VariantLayout=VariantLayout;function fixBitwiseResult(s){return 0>s&&(s+=4294967296),s}class BitStructure extends Layout{constructor(j,$,_e){if(!(j instanceof UInt||j instanceof UIntBE))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof $=="string"&&_e===void 0&&(_e=$,$=!1),4=$)throw new TypeError("bits must be positive integer");const et=8*j.span,tt=j.fields.reduce((nt,rt)=>nt+rt.bits,0);if($+tt>et)throw new Error("bits too long for span remainder ("+(et-tt)+" of "+et+" remain)");this.container=j,this.bits=$,this.valueMask=(1<<$)-1,$===32&&(this.valueMask=4294967295),this.start=tt,this.container.msb&&(this.start=et-tt-$),this.wordMask=fixBitwiseResult(this.valueMask<>>this.start}encode(j){if(typeof j!="number"||!Number.isInteger(j)||j!==fixBitwiseResult(j&this.valueMask))throw new TypeError(nameWithProperty("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const $=this.container._packedGetValue(),_e=fixBitwiseResult(j<_e&&(_e=this.length.decode(j,$)),_e}decode(j,$=0){let _e=this.span;return 0>_e&&(_e=this.length.decode(j,$)),uint8ArrayToBuffer(j).slice($,$+_e)}encode(j,$,_e){let et=this.length;if(this.length instanceof ExternalLayout&&(et=j.length),!(j instanceof Uint8Array&&et===j.length))throw new TypeError(nameWithProperty("Blob.encode",this)+" requires (length "+et+") Uint8Array as src");if(_e+et>$.length)throw new RangeError("encoding overruns Uint8Array");const tt=uint8ArrayToBuffer(j);return uint8ArrayToBuffer($).write(tt.toString("hex"),_e,et,"hex"),this.length instanceof ExternalLayout&&this.length.encode(et,$,_e),et}};Layout$1.Blob=Blob$2;class CString extends Layout{constructor(j){super(-1,j)}getSpan(j,$=0){checkUint8Array(j);let _e=$;for(;_e$.length)throw new RangeError("encoding overruns Buffer");const nt=uint8ArrayToBuffer($);return et.copy(nt,_e),nt[_e+tt]=0,tt+1}}Layout$1.CString=CString;class UTF8 extends Layout{constructor(j,$){if(typeof j=="string"&&$===void 0&&($=j,j=void 0),j===void 0)j=-1;else if(!Number.isInteger(j))throw new TypeError("maxSpan must be an integer");super(-1,$),this.maxSpan=j}getSpan(j,$=0){return checkUint8Array(j),j.length-$}decode(j,$=0){const _e=this.getSpan(j,$);if(0<=this.maxSpan&&this.maxSpan<_e)throw new RangeError("text length exceeds maxSpan");return uint8ArrayToBuffer(j).slice($,$+_e).toString("utf-8")}encode(j,$,_e=0){typeof j!="string"&&(j=String(j));const et=buffer_1$1.Buffer.from(j,"utf8"),tt=et.length;if(0<=this.maxSpan&&this.maxSpan$.length)throw new RangeError("encoding overruns Buffer");return et.copy(uint8ArrayToBuffer($),_e),tt}}Layout$1.UTF8=UTF8;class Constant extends Layout{constructor(j,$){super(0,$),this.value=j}decode(j,$){return this.value}encode(j,$,_e){return 0}}Layout$1.Constant=Constant;Layout$1.greedy=(s,j)=>new GreedyCount(s,j);var offset=Layout$1.offset=(s,j,$)=>new OffsetLayout(s,j,$),u8=Layout$1.u8=s=>new UInt(1,s),u16=Layout$1.u16=s=>new UInt(2,s);Layout$1.u24=s=>new UInt(3,s);var u32=Layout$1.u32=s=>new UInt(4,s);Layout$1.u40=s=>new UInt(5,s);Layout$1.u48=s=>new UInt(6,s);var nu64=Layout$1.nu64=s=>new NearUInt64(s);Layout$1.u16be=s=>new UIntBE(2,s);Layout$1.u24be=s=>new UIntBE(3,s);Layout$1.u32be=s=>new UIntBE(4,s);Layout$1.u40be=s=>new UIntBE(5,s);Layout$1.u48be=s=>new UIntBE(6,s);Layout$1.nu64be=s=>new NearUInt64BE(s);Layout$1.s8=s=>new Int(1,s);Layout$1.s16=s=>new Int(2,s);Layout$1.s24=s=>new Int(3,s);Layout$1.s32=s=>new Int(4,s);Layout$1.s40=s=>new Int(5,s);Layout$1.s48=s=>new Int(6,s);var ns64=Layout$1.ns64=s=>new NearInt64(s);Layout$1.s16be=s=>new IntBE(2,s);Layout$1.s24be=s=>new IntBE(3,s);Layout$1.s32be=s=>new IntBE(4,s);Layout$1.s40be=s=>new IntBE(5,s);Layout$1.s48be=s=>new IntBE(6,s);Layout$1.ns64be=s=>new NearInt64BE(s);Layout$1.f32=s=>new Float(s);Layout$1.f32be=s=>new FloatBE(s);Layout$1.f64=s=>new Double(s);Layout$1.f64be=s=>new DoubleBE(s);var struct=Layout$1.struct=(s,j,$)=>new Structure(s,j,$);Layout$1.bits=(s,j,$)=>new BitStructure(s,j,$);var seq=Layout$1.seq=(s,j,$)=>new Sequence(s,j,$);Layout$1.union=(s,j,$)=>new Union(s,j,$);Layout$1.unionLayoutDiscriminator=(s,j)=>new UnionLayoutDiscriminator(s,j);var blob=Layout$1.blob=(s,j)=>new Blob$2(s,j);Layout$1.cstr=s=>new CString(s);Layout$1.utf8=(s,j)=>new UTF8(s,j);Layout$1.constant=(s,j)=>new Constant(s,j);var browser$1={};Object.defineProperty(browser$1,"__esModule",{value:!0});function toBigIntLE(s){{const j=Buffer.from(s);j.reverse();const $=j.toString("hex");return $.length===0?BigInt(0):BigInt(`0x${$}`)}}var toBigIntLE_1=browser$1.toBigIntLE=toBigIntLE;function toBigIntBE(s){{const j=s.toString("hex");return j.length===0?BigInt(0):BigInt(`0x${j}`)}}browser$1.toBigIntBE=toBigIntBE;function toBufferLE(s,j){{const $=s.toString(16),_e=Buffer.from($.padStart(j*2,"0").slice(0,j*2),"hex");return _e.reverse(),_e}}var toBufferLE_1=browser$1.toBufferLE=toBufferLE;function toBufferBE(s,j){{const $=s.toString(16);return Buffer.from($.padStart(j*2,"0").slice(0,j*2),"hex")}}browser$1.toBufferBE=toBufferBE;class StructError extends TypeError{constructor(j,$){let _e;const{message:et,...tt}=j,{path:nt}=j,rt=nt.length===0?et:"At path: "+nt.join(".")+" -- "+et;super(rt),Object.assign(this,tt),this.name=this.constructor.name,this.failures=()=>{var ot;return(ot=_e)!=null?ot:_e=[j,...$()]}}}function isIterable(s){return isObject$1(s)&&typeof s[Symbol.iterator]=="function"}function isObject$1(s){return typeof s=="object"&&s!=null}function print(s){return typeof s=="string"?JSON.stringify(s):""+s}function shiftIterator(s){const{done:j,value:$}=s.next();return j?void 0:$}function toFailure(s,j,$,_e){if(s===!0)return;s===!1?s={}:typeof s=="string"&&(s={message:s});const{path:et,branch:tt}=j,{type:nt}=$,{refinement:rt,message:ot="Expected a value of type `"+nt+"`"+(rt?" with refinement `"+rt+"`":"")+", but received: `"+print(_e)+"`"}=s;return{value:_e,type:nt,refinement:rt,key:et[et.length-1],path:et,branch:tt,...s,message:ot}}function*toFailures(s,j,$,_e){isIterable(s)||(s=[s]);for(const et of s){const tt=toFailure(et,j,$,_e);tt&&(yield tt)}}function*run(s,j,$={}){const{path:_e=[],branch:et=[s],coerce:tt=!1,mask:nt=!1}=$,rt={path:_e,branch:et};if(tt&&(s=j.coercer(s,rt),nt&&j.type!=="type"&&isObject$1(j.schema)&&isObject$1(s)&&!Array.isArray(s)))for(const it in s)j.schema[it]===void 0&&delete s[it];let ot=!0;for(const it of j.validator(s,rt))ot=!1,yield[it,void 0];for(let[it,st,at]of j.entries(s,rt)){const ct=run(st,at,{path:it===void 0?_e:[..._e,it],branch:it===void 0?et:[...et,st],coerce:tt,mask:nt});for(const lt of ct)lt[0]?(ot=!1,yield[lt[0],void 0]):tt&&(st=lt[1],it===void 0?s=st:s instanceof Map?s.set(it,st):s instanceof Set?s.add(st):isObject$1(s)&&(s[it]=st))}if(ot)for(const it of j.refiner(s,rt))ot=!1,yield[it,void 0];ot&&(yield[void 0,s])}let Struct$1=class{constructor(j){const{type:$,schema:_e,validator:et,refiner:tt,coercer:nt=ot=>ot,entries:rt=function*(){}}=j;this.type=$,this.schema=_e,this.entries=rt,this.coercer=nt,et?this.validator=(ot,it)=>{const st=et(ot,it);return toFailures(st,it,this,ot)}:this.validator=()=>[],tt?this.refiner=(ot,it)=>{const st=tt(ot,it);return toFailures(st,it,this,ot)}:this.refiner=()=>[]}assert(j){return assert$1(j,this)}create(j){return create$4(j,this)}is(j){return is(j,this)}mask(j){return mask(j,this)}validate(j,$={}){return validate$1(j,this,$)}};function assert$1(s,j){const $=validate$1(s,j);if($[0])throw $[0]}function create$4(s,j){const $=validate$1(s,j,{coerce:!0});if($[0])throw $[0];return $[1]}function mask(s,j){const $=validate$1(s,j,{coerce:!0,mask:!0});if($[0])throw $[0];return $[1]}function is(s,j){return!validate$1(s,j)[0]}function validate$1(s,j,$={}){const _e=run(s,j,$),et=shiftIterator(_e);return et[0]?[new StructError(et[0],function*(){for(const nt of _e)nt[0]&&(yield nt[0])}),void 0]:[void 0,et[1]]}function define(s,j){return new Struct$1({type:s,schema:null,validator:j})}function any(){return define("any",()=>!0)}function array$1(s){return new Struct$1({type:"array",schema:s,*entries(j){if(s&&Array.isArray(j))for(const[$,_e]of j.entries())yield[$,_e,s]},coercer(j){return Array.isArray(j)?j.slice():j},validator(j){return Array.isArray(j)||"Expected an array value, but received: "+print(j)}})}function boolean$1(){return define("boolean",s=>typeof s=="boolean")}function instance(s){return define("instance",j=>j instanceof s||"Expected a `"+s.name+"` instance, but received: "+print(j))}function literal(s){const j=print(s),$=typeof s;return new Struct$1({type:"literal",schema:$==="string"||$==="number"||$==="boolean"?s:null,validator(_e){return _e===s||"Expected the literal `"+j+"`, but received: "+print(_e)}})}function never(){return define("never",()=>!1)}function nullable(s){return new Struct$1({...s,validator:(j,$)=>j===null||s.validator(j,$),refiner:(j,$)=>j===null||s.refiner(j,$)})}function number(){return define("number",s=>typeof s=="number"&&!isNaN(s)||"Expected a number, but received: "+print(s))}function optional(s){return new Struct$1({...s,validator:(j,$)=>j===void 0||s.validator(j,$),refiner:(j,$)=>j===void 0||s.refiner(j,$)})}function record(s,j){return new Struct$1({type:"record",schema:null,*entries($){if(isObject$1($))for(const _e in $){const et=$[_e];yield[_e,_e,s],yield[_e,et,j]}},validator($){return isObject$1($)||"Expected an object, but received: "+print($)}})}function string$1(){return define("string",s=>typeof s=="string"||"Expected a string, but received: "+print(s))}function tuple(s){const j=never();return new Struct$1({type:"tuple",schema:null,*entries($){if(Array.isArray($)){const _e=Math.max(s.length,$.length);for(let et=0;et<_e;et++)yield[et,$[et],s[et]||j]}},validator($){return Array.isArray($)||"Expected an array, but received: "+print($)}})}function type(s){const j=Object.keys(s);return new Struct$1({type:"type",schema:s,*entries($){if(isObject$1($))for(const _e of j)yield[_e,$[_e],s[_e]]},validator($){return isObject$1($)||"Expected an object, but received: "+print($)}})}function union(s){const j=s.map($=>$.type).join(" | ");return new Struct$1({type:"union",schema:null,validator($,_e){const et=[];for(const tt of s){const[...nt]=run($,tt,_e),[rt]=nt;if(rt[0])for(const[ot]of nt)ot&&et.push(ot);else return[]}return["Expected the value to satisfy a union of `"+j+"`, but received: "+print($),...et]}})}function unknown(){return define("unknown",()=>!0)}function coerce(s,j,$){return new Struct$1({...s,coercer:(_e,et)=>is(_e,j)?s.coercer($(_e,et),et):s.coercer(_e,et)})}var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(s){return typeof s=="string"&®EX.test(s)}var byteToHex=[];for(var i$1=0;i$1<256;++i$1)byteToHex.push((i$1+256).toString(16).substr(1));function stringify$1(s){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,$=(byteToHex[s[j+0]]+byteToHex[s[j+1]]+byteToHex[s[j+2]]+byteToHex[s[j+3]]+"-"+byteToHex[s[j+4]]+byteToHex[s[j+5]]+"-"+byteToHex[s[j+6]]+byteToHex[s[j+7]]+"-"+byteToHex[s[j+8]]+byteToHex[s[j+9]]+"-"+byteToHex[s[j+10]]+byteToHex[s[j+11]]+byteToHex[s[j+12]]+byteToHex[s[j+13]]+byteToHex[s[j+14]]+byteToHex[s[j+15]]).toLowerCase();if(!validate($))throw TypeError("Stringified UUID is invalid");return $}var _nodeId,_clockseq,_lastMSecs=0,_lastNSecs=0;function v1(s,j,$){var _e=j&&$||0,et=j||new Array(16);s=s||{};var tt=s.node||_nodeId,nt=s.clockseq!==void 0?s.clockseq:_clockseq;if(tt==null||nt==null){var rt=s.random||(s.rng||rng)();tt==null&&(tt=_nodeId=[rt[0]|1,rt[1],rt[2],rt[3],rt[4],rt[5]]),nt==null&&(nt=_clockseq=(rt[6]<<8|rt[7])&16383)}var ot=s.msecs!==void 0?s.msecs:Date.now(),it=s.nsecs!==void 0?s.nsecs:_lastNSecs+1,st=ot-_lastMSecs+(it-_lastNSecs)/1e4;if(st<0&&s.clockseq===void 0&&(nt=nt+1&16383),(st<0||ot>_lastMSecs)&&s.nsecs===void 0&&(it=0),it>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs=ot,_lastNSecs=it,_clockseq=nt,ot+=122192928e5;var at=((ot&268435455)*1e4+it)%4294967296;et[_e++]=at>>>24&255,et[_e++]=at>>>16&255,et[_e++]=at>>>8&255,et[_e++]=at&255;var ct=ot/4294967296*1e4&268435455;et[_e++]=ct>>>8&255,et[_e++]=ct&255,et[_e++]=ct>>>24&15|16,et[_e++]=ct>>>16&255,et[_e++]=nt>>>8|128,et[_e++]=nt&255;for(var lt=0;lt<6;++lt)et[_e+lt]=tt[lt];return j||stringify$1(et)}function parse$1(s){if(!validate(s))throw TypeError("Invalid UUID");var j,$=new Uint8Array(16);return $[0]=(j=parseInt(s.slice(0,8),16))>>>24,$[1]=j>>>16&255,$[2]=j>>>8&255,$[3]=j&255,$[4]=(j=parseInt(s.slice(9,13),16))>>>8,$[5]=j&255,$[6]=(j=parseInt(s.slice(14,18),16))>>>8,$[7]=j&255,$[8]=(j=parseInt(s.slice(19,23),16))>>>8,$[9]=j&255,$[10]=(j=parseInt(s.slice(24,36),16))/1099511627776&255,$[11]=j/4294967296&255,$[12]=j>>>24&255,$[13]=j>>>16&255,$[14]=j>>>8&255,$[15]=j&255,$}function stringToBytes(s){s=unescape(encodeURIComponent(s));for(var j=[],$=0;$>5]>>>et%32&255,nt=parseInt(_e.charAt(tt>>>4&15)+_e.charAt(tt&15),16);j.push(nt)}return j}function getOutputLength(s){return(s+64>>>9<<4)+14+1}function wordsToMd5(s,j){s[j>>5]|=128<>5]|=(s[_e/8]&255)<<_e%32;return $}function safeAdd(s,j){var $=(s&65535)+(j&65535),_e=(s>>16)+(j>>16)+($>>16);return _e<<16|$&65535}function bitRotateLeft(s,j){return s<>>32-j}function md5cmn(s,j,$,_e,et,tt){return safeAdd(bitRotateLeft(safeAdd(safeAdd(j,s),safeAdd(_e,tt)),et),$)}function md5ff(s,j,$,_e,et,tt,nt){return md5cmn(j&$|~j&_e,s,j,et,tt,nt)}function md5gg(s,j,$,_e,et,tt,nt){return md5cmn(j&_e|$&~_e,s,j,et,tt,nt)}function md5hh(s,j,$,_e,et,tt,nt){return md5cmn(j^$^_e,s,j,et,tt,nt)}function md5ii(s,j,$,_e,et,tt,nt){return md5cmn($^(j|~_e),s,j,et,tt,nt)}var v3=v35("v3",48,md5);const v3$1=v3;function v4(s,j,$){s=s||{};var _e=s.random||(s.rng||rng)();if(_e[6]=_e[6]&15|64,_e[8]=_e[8]&63|128,j){$=$||0;for(var et=0;et<16;++et)j[$+et]=_e[et];return j}return stringify$1(_e)}function f(s,j,$,_e){switch(s){case 0:return j&$^~j&_e;case 1:return j^$^_e;case 2:return j&$^j&_e^$&_e;case 3:return j^$^_e}}function ROTL(s,j){return s<>>32-j}function sha1(s){var j=[1518500249,1859775393,2400959708,3395469782],$=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof s=="string"){var _e=unescape(encodeURIComponent(s));s=[];for(var et=0;et<_e.length;++et)s.push(_e.charCodeAt(et))}else Array.isArray(s)||(s=Array.prototype.slice.call(s));s.push(128);for(var tt=s.length/4+2,nt=Math.ceil(tt/16),rt=new Array(nt),ot=0;ot>>0;pt=yt,yt=ht,ht=ROTL(gt,30)>>>0,gt=ft,ft=Tt}$[0]=$[0]+ft>>>0,$[1]=$[1]+gt>>>0,$[2]=$[2]+ht>>>0,$[3]=$[3]+yt>>>0,$[4]=$[4]+pt>>>0}return[$[0]>>24&255,$[0]>>16&255,$[0]>>8&255,$[0]&255,$[1]>>24&255,$[1]>>16&255,$[1]>>8&255,$[1]&255,$[2]>>24&255,$[2]>>16&255,$[2]>>8&255,$[2]&255,$[3]>>24&255,$[3]>>16&255,$[3]>>8&255,$[3]&255,$[4]>>24&255,$[4]>>16&255,$[4]>>8&255,$[4]&255]}var v5=v35("v5",80,sha1);const v5$1=v5,nil="00000000-0000-0000-0000-000000000000";function version(s){if(!validate(s))throw TypeError("Invalid UUID");return parseInt(s.substr(14,1),16)}const esmBrowser=Object.freeze(Object.defineProperty({__proto__:null,NIL:nil,parse:parse$1,stringify:stringify$1,v1,v3:v3$1,v4,v5:v5$1,validate,version},Symbol.toStringTag,{value:"Module"})),require$$0$4=getAugmentedNamespace(esmBrowser),uuid$1=require$$0$4.v4,generateRequest$1=function(s,j,$,_e){if(typeof s!="string")throw new TypeError(s+" must be a string");_e=_e||{};const et=typeof _e.version=="number"?_e.version:2;if(et!==1&&et!==2)throw new TypeError(et+" must be 1 or 2");const tt={method:s};if(et===2&&(tt.jsonrpc="2.0"),j){if(typeof j!="object"&&!Array.isArray(j))throw new TypeError(j+" must be an object, array or omitted");tt.params=j}if(typeof $>"u"){const nt=typeof _e.generator=="function"?_e.generator:function(){return uuid$1()};tt.id=nt(tt,_e)}else et===2&&$===null?_e.notificationIdNull&&(tt.id=null):tt.id=$;return tt};var generateRequest_1=generateRequest$1;const uuid=require$$0$4.v4,generateRequest=generateRequest_1,ClientBrowser=function(s,j){if(!(this instanceof ClientBrowser))return new ClientBrowser(s,j);j||(j={}),this.options={reviver:typeof j.reviver<"u"?j.reviver:null,replacer:typeof j.replacer<"u"?j.replacer:null,generator:typeof j.generator<"u"?j.generator:function(){return uuid()},version:typeof j.version<"u"?j.version:2,notificationIdNull:typeof j.notificationIdNull=="boolean"?j.notificationIdNull:!1},this.callServer=s};var browser=ClientBrowser;ClientBrowser.prototype.request=function(s,j,$,_e){const et=this;let tt=null;const nt=Array.isArray(s)&&typeof j=="function";if(this.options.version===1&&nt)throw new TypeError("JSON-RPC 1.0 does not support batching");if(nt||!nt&&s&&typeof s=="object"&&typeof j=="function")_e=j,tt=s;else{typeof $=="function"&&(_e=$,$=void 0);const it=typeof _e=="function";try{tt=generateRequest(s,j,$,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(st){if(it)return _e(st);throw st}if(!it)return tt}let ot;try{ot=JSON.stringify(tt,this.options.replacer)}catch(it){return _e(it)}return this.callServer(ot,function(it,st){et._parseResponse(it,st,_e)}),tt};ClientBrowser.prototype._parseResponse=function(s,j,$){if(s){$(s);return}if(!j)return $();let _e;try{_e=JSON.parse(j,this.options.reviver)}catch(et){return $(et)}if($.length===3)if(Array.isArray(_e)){const et=function(nt){return typeof nt.error<"u"},tt=function(nt){return!et(nt)};return $(null,_e.filter(et),_e.filter(tt))}else return $(null,_e.error,_e.result);$(null,_e)};const RpcClient=getDefaultExportFromCjs$1(browser);var client={},eventemitter3={exports:{}};(function(s){var j=Object.prototype.hasOwnProperty,$="~";function _e(){}Object.create&&(_e.prototype=Object.create(null),new _e().__proto__||($=!1));function et(ot,it,st){this.fn=ot,this.context=it,this.once=st||!1}function tt(ot,it,st,at,ct){if(typeof st!="function")throw new TypeError("The listener must be a function");var lt=new et(st,at||ot,ct),dt=$?$+it:it;return ot._events[dt]?ot._events[dt].fn?ot._events[dt]=[ot._events[dt],lt]:ot._events[dt].push(lt):(ot._events[dt]=lt,ot._eventsCount++),ot}function nt(ot,it){--ot._eventsCount===0?ot._events=new _e:delete ot._events[it]}function rt(){this._events=new _e,this._eventsCount=0}rt.prototype.eventNames=function(){var it=[],st,at;if(this._eventsCount===0)return it;for(at in st=this._events)j.call(st,at)&&it.push($?at.slice(1):at);return Object.getOwnPropertySymbols?it.concat(Object.getOwnPropertySymbols(st)):it},rt.prototype.listeners=function(it){var st=$?$+it:it,at=this._events[st];if(!at)return[];if(at.fn)return[at.fn];for(var ct=0,lt=at.length,dt=new Array(lt);ct++this.rpc_id),st?this.dataPack=st:this.dataPack=new utils_1.DefaultDataPack,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call($,_e,et,tt){return!tt&&typeof et=="object"&&(tt=et,et=null),new Promise((nt,rt)=>{if(!this.ready)return rt(new Error("socket not ready"));const ot=this.generate_request_id($,_e),it={jsonrpc:"2.0",method:$,params:_e||void 0,id:ot};this.socket.send(this.dataPack.encode(it),tt,st=>{if(st)return rt(st);this.queue[ot]={promise:[nt,rt]},et&&(this.queue[ot].timeout=setTimeout(()=>{delete this.queue[ot],rt(new Error("reply timeout"))},et))})})}async login($){const _e=await this.call("rpc.login",$);if(!_e)throw new Error("authentication failed");return _e}async listMethods(){return await this.call("__listMethods")}notify($,_e){return new Promise((et,tt)=>{if(!this.ready)return tt(new Error("socket not ready"));const nt={jsonrpc:"2.0",method:$,params:_e};this.socket.send(this.dataPack.encode(nt),rt=>{if(rt)return tt(rt);et()})})}async subscribe($){typeof $=="string"&&($=[$]);const _e=await this.call("rpc.on",$);if(typeof $=="string"&&_e[$]!=="ok")throw new Error("Failed subscribing to an event '"+$+"' with: "+_e[$]);return _e}async unsubscribe($){typeof $=="string"&&($=[$]);const _e=await this.call("rpc.off",$);if(typeof $=="string"&&_e[$]!=="ok")throw new Error("Failed unsubscribing from an event with: "+_e);return _e}close($,_e){this.socket.close($||1e3,_e)}setAutoReconnect($){this.reconnect=$}setReconnectInterval($){this.reconnect_interval=$}setMaxReconnects($){this.max_reconnects=$}_connect($,_e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory($,_e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:et})=>{et instanceof ArrayBuffer&&(et=Buffer.from(et).toString());try{et=this.dataPack.decode(et)}catch{return}if(et.notification&&this.listeners(et.notification).length){if(!Object.keys(et.params).length)return this.emit(et.notification);const tt=[et.notification];if(et.params.constructor===Object)tt.push(et.params);else for(let nt=0;nt{this.emit.apply(this,tt)})}if(!this.queue[et.id])return et.method?Promise.resolve().then(()=>{this.emit(et.method,et==null?void 0:et.params)}):void 0;"error"in et=="result"in et&&this.queue[et.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[et.id].timeout&&clearTimeout(this.queue[et.id].timeout),et.error?this.queue[et.id].promise[1](et.error):this.queue[et.id].promise[0](et.result),delete this.queue[et.id]}),this.socket.addEventListener("error",et=>this.emit("error",et)),this.socket.addEventListener("close",({code:et,reason:tt})=>{this.ready&&setTimeout(()=>this.emit("close",et,tt),0),this.ready=!1,this.socket=void 0,et!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect($,_e),this.reconnect_interval)))})}}var _default$1=client.default=CommonClient,websocket_browser={};Object.defineProperty(websocket_browser,"__esModule",{value:!0});const eventemitter3_1=eventemitter3Exports;class WebSocketBrowserImpl extends eventemitter3_1.EventEmitter{constructor($,_e,et){super();dn(this,"socket");this.socket=new window.WebSocket($,et),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=tt=>this.emit("message",tt.data),this.socket.onerror=tt=>this.emit("error",tt),this.socket.onclose=tt=>{this.emit("close",tt.code,tt.reason)}}send($,_e,et){const tt=et||_e;try{this.socket.send($),tt()}catch(nt){tt(nt)}}close($,_e){this.socket.close($,_e)}addEventListener($,_e,et){this.socket.addEventListener($,_e,et)}}function default_1(s,j){return new WebSocketBrowserImpl(s,j)}var _default=websocket_browser.default=default_1;const U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(s,j=!1){return j?{h:Number(s&U32_MASK64),l:Number(s>>_32n&U32_MASK64)}:{h:Number(s>>_32n&U32_MASK64)|0,l:Number(s&U32_MASK64)|0}}function split(s,j=!1){let $=new Uint32Array(s.length),_e=new Uint32Array(s.length);for(let et=0;ets<<$|j>>>32-$,rotlSL=(s,j,$)=>j<<$|s>>>32-$,rotlBH=(s,j,$)=>j<<$-32|s>>>64-$,rotlBL=(s,j,$)=>s<<$-32|j>>>64-$,SHA3_PI=[],SHA3_ROTL=[],_SHA3_IOTA=[],_0n$2=BigInt(0),_1n$2=BigInt(1),_2n$2=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let s=0,j=_1n$2,$=1,_e=0;s<24;s++){[$,_e]=[_e,(2*$+3*_e)%5],SHA3_PI.push(2*(5*_e+$)),SHA3_ROTL.push((s+1)*(s+2)/2%64);let et=_0n$2;for(let tt=0;tt<7;tt++)j=(j<<_1n$2^(j>>_7n)*_0x71n)%_256n,j&_2n$2&&(et^=_1n$2<<(_1n$2<$>32?rotlBH(s,j,$):rotlSH(s,j,$),rotlL=(s,j,$)=>$>32?rotlBL(s,j,$):rotlSL(s,j,$);function keccakP(s,j=24){const $=new Uint32Array(10);for(let _e=24-j;_e<24;_e++){for(let nt=0;nt<10;nt++)$[nt]=s[nt]^s[nt+10]^s[nt+20]^s[nt+30]^s[nt+40];for(let nt=0;nt<10;nt+=2){const rt=(nt+8)%10,ot=(nt+2)%10,it=$[ot],st=$[ot+1],at=rotlH(it,st,1)^$[rt],ct=rotlL(it,st,1)^$[rt+1];for(let lt=0;lt<50;lt+=10)s[nt+lt]^=at,s[nt+lt+1]^=ct}let et=s[2],tt=s[3];for(let nt=0;nt<24;nt++){const rt=SHA3_ROTL[nt],ot=rotlH(et,tt,rt),it=rotlL(et,tt,rt),st=SHA3_PI[nt];et=s[st],tt=s[st+1],s[st]=ot,s[st+1]=it}for(let nt=0;nt<50;nt+=10){for(let rt=0;rt<10;rt++)$[rt]=s[nt+rt];for(let rt=0;rt<10;rt++)s[nt+rt]^=~$[(rt+2)%10]&$[(rt+4)%10]}s[0]^=SHA3_IOTA_H[_e],s[1]^=SHA3_IOTA_L[_e]}$.fill(0)}class Keccak extends Hash{constructor(j,$,_e,et=!1,tt=24){if(super(),this.blockLen=j,this.suffix=$,this.outputLen=_e,this.enableXOF=et,this.rounds=tt,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number$1(_e),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32$1(this.state)}keccak(){isLE||byteSwap32(this.state32),keccakP(this.state32,this.rounds),isLE||byteSwap32(this.state32),this.posOut=0,this.pos=0}update(j){exists(this);const{blockLen:$,state:_e}=this;j=toBytes(j);const et=j.length;for(let tt=0;tt=_e&&this.keccak();const nt=Math.min(_e-this.posOut,tt-et);j.set($.subarray(this.posOut,this.posOut+nt),et),this.posOut+=nt,et+=nt}return j}xofInto(j){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(j)}xof(j){return number$1(j),this.xofInto(new Uint8Array(j))}digestInto(j){if(output(j,this),this.finished)throw new Error("digest() was already called");return this.writeInto(j),this.destroy(),j}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(j){const{blockLen:$,suffix:_e,outputLen:et,rounds:tt,enableXOF:nt}=this;return j||(j=new Keccak($,_e,et,nt,tt)),j.state32.set(this.state32),j.pos=this.pos,j.posOut=this.posOut,j.finished=this.finished,j.rounds=tt,j.suffix=_e,j.outputLen=et,j.enableXOF=nt,j.destroyed=this.destroyed,j}}const gen=(s,j,$)=>wrapConstructor(()=>new Keccak(j,s,$)),sha3_224=gen(6,144,224/8),sha3_256=gen(6,136,256/8),sha3_384=gen(6,104,384/8),sha3_512=gen(6,72,512/8),keccak_224=gen(1,144,224/8),keccak_256=gen(1,136,256/8),keccak_384=gen(1,104,384/8),keccak_512=gen(1,72,512/8),genShake=(s,j,$)=>wrapXOFConstructorWithOpts((_e={})=>new Keccak(j,s,_e.dkLen===void 0?$:_e.dkLen,!0)),shake128=genShake(31,168,128/8),shake256=genShake(31,136,256/8),sha3=Object.freeze(Object.defineProperty({__proto__:null,Keccak,keccakP,keccak_224,keccak_256,keccak_384,keccak_512,sha3_224,sha3_256,sha3_384,sha3_512,shake128,shake256},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validatePointOpts(s){const j=validateBasic(s);validateObject(j,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:$,Fp:_e,a:et}=j;if($){if(!_e.eql(et,_e.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof $!="object"||typeof $.beta!="bigint"||typeof $.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...j})}const{bytesToNumberBE:b2n,hexToBytes:h2b}=ut,DER={Err:class extends Error{constructor(j=""){super(j)}},_parseInt(s){const{Err:j}=DER;if(s.length<2||s[0]!==2)throw new j("Invalid signature integer tag");const $=s[1],_e=s.subarray(2,$+2);if(!$||_e.length!==$)throw new j("Invalid signature integer: wrong length");if(_e[0]&128)throw new j("Invalid signature integer: negative");if(_e[0]===0&&!(_e[1]&128))throw new j("Invalid signature integer: unnecessary leading zero");return{d:b2n(_e),l:s.subarray($+2)}},toSig(s){const{Err:j}=DER,$=typeof s=="string"?h2b(s):s;abytes($);let _e=$.length;if(_e<2||$[0]!=48)throw new j("Invalid signature tag");if($[1]!==_e-2)throw new j("Invalid signature: incorrect length");const{d:et,l:tt}=DER._parseInt($.subarray(2)),{d:nt,l:rt}=DER._parseInt(tt);if(rt.length)throw new j("Invalid signature: left bytes after parsing");return{r:et,s:nt}},hexFromSig(s){const j=it=>Number.parseInt(it[0],16)&8?"00"+it:it,$=it=>{const st=it.toString(16);return st.length&1?`0${st}`:st},_e=j($(s.s)),et=j($(s.r)),tt=_e.length/2,nt=et.length/2,rt=$(tt),ot=$(nt);return`30${$(nt+tt+4)}02${ot}${et}02${rt}${_e}`}},_0n$1=BigInt(0),_1n$1=BigInt(1),_2n$1=BigInt(2),_3n=BigInt(3),_4n=BigInt(4);function weierstrassPoints(s){const j=validatePointOpts(s),{Fp:$}=j,_e=j.toBytes||((dt,ft,gt)=>{const ht=ft.toAffine();return concatBytes(Uint8Array.from([4]),$.toBytes(ht.x),$.toBytes(ht.y))}),et=j.fromBytes||(dt=>{const ft=dt.subarray(1),gt=$.fromBytes(ft.subarray(0,$.BYTES)),ht=$.fromBytes(ft.subarray($.BYTES,2*$.BYTES));return{x:gt,y:ht}});function tt(dt){const{a:ft,b:gt}=j,ht=$.sqr(dt),yt=$.mul(ht,dt);return $.add($.add(yt,$.mul(dt,ft)),gt)}if(!$.eql($.sqr(j.Gy),tt(j.Gx)))throw new Error("bad generator point: equation left != right");function nt(dt){return typeof dt=="bigint"&&_0n$1$.eql(pt,$.ZERO);return yt(gt)&&yt(ht)?at.ZERO:new at(gt,ht,$.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(ft){const gt=$.invertBatch(ft.map(ht=>ht.pz));return ft.map((ht,yt)=>ht.toAffine(gt[yt])).map(at.fromAffine)}static fromHex(ft){const gt=at.fromAffine(et(ensureBytes("pointHex",ft)));return gt.assertValidity(),gt}static fromPrivateKey(ft){return at.BASE.multiply(ot(ft))}_setWindowSize(ft){this._WINDOW_SIZE=ft,it.delete(this)}assertValidity(){if(this.is0()){if(j.allowInfinityPoint&&!$.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:ft,y:gt}=this.toAffine();if(!$.isValid(ft)||!$.isValid(gt))throw new Error("bad point: x or y not FE");const ht=$.sqr(gt),yt=tt(ft);if(!$.eql(ht,yt))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:ft}=this.toAffine();if($.isOdd)return!$.isOdd(ft);throw new Error("Field doesn't support isOdd")}equals(ft){st(ft);const{px:gt,py:ht,pz:yt}=this,{px:pt,py:Mt,pz:St}=ft,Tt=$.eql($.mul(gt,St),$.mul(pt,yt)),vt=$.eql($.mul(ht,St),$.mul(Mt,yt));return Tt&&vt}negate(){return new at(this.px,$.neg(this.py),this.pz)}double(){const{a:ft,b:gt}=j,ht=$.mul(gt,_3n),{px:yt,py:pt,pz:Mt}=this;let St=$.ZERO,Tt=$.ZERO,vt=$.ZERO,Dt=$.mul(yt,yt),zt=$.mul(pt,pt),Ot=$.mul(Mt,Mt),Ft=$.mul(yt,pt);return Ft=$.add(Ft,Ft),vt=$.mul(yt,Mt),vt=$.add(vt,vt),St=$.mul(ft,vt),Tt=$.mul(ht,Ot),Tt=$.add(St,Tt),St=$.sub(zt,Tt),Tt=$.add(zt,Tt),Tt=$.mul(St,Tt),St=$.mul(Ft,St),vt=$.mul(ht,vt),Ot=$.mul(ft,Ot),Ft=$.sub(Dt,Ot),Ft=$.mul(ft,Ft),Ft=$.add(Ft,vt),vt=$.add(Dt,Dt),Dt=$.add(vt,Dt),Dt=$.add(Dt,Ot),Dt=$.mul(Dt,Ft),Tt=$.add(Tt,Dt),Ot=$.mul(pt,Mt),Ot=$.add(Ot,Ot),Dt=$.mul(Ot,Ft),St=$.sub(St,Dt),vt=$.mul(Ot,zt),vt=$.add(vt,vt),vt=$.add(vt,vt),new at(St,Tt,vt)}add(ft){st(ft);const{px:gt,py:ht,pz:yt}=this,{px:pt,py:Mt,pz:St}=ft;let Tt=$.ZERO,vt=$.ZERO,Dt=$.ZERO;const zt=j.a,Ot=$.mul(j.b,_3n);let Ft=$.mul(gt,pt),Pt=$.mul(ht,Mt),Lt=$.mul(yt,St),mt=$.add(gt,ht),xt=$.add(pt,Mt);mt=$.mul(mt,xt),xt=$.add(Ft,Pt),mt=$.sub(mt,xt),xt=$.add(gt,yt);let It=$.add(pt,St);return xt=$.mul(xt,It),It=$.add(Ft,Lt),xt=$.sub(xt,It),It=$.add(ht,yt),Tt=$.add(Mt,St),It=$.mul(It,Tt),Tt=$.add(Pt,Lt),It=$.sub(It,Tt),Dt=$.mul(zt,xt),Tt=$.mul(Ot,Lt),Dt=$.add(Tt,Dt),Tt=$.sub(Pt,Dt),Dt=$.add(Pt,Dt),vt=$.mul(Tt,Dt),Pt=$.add(Ft,Ft),Pt=$.add(Pt,Ft),Lt=$.mul(zt,Lt),xt=$.mul(Ot,xt),Pt=$.add(Pt,Lt),Lt=$.sub(Ft,Lt),Lt=$.mul(zt,Lt),xt=$.add(xt,Lt),Ft=$.mul(Pt,xt),vt=$.add(vt,Ft),Ft=$.mul(It,xt),Tt=$.mul(mt,Tt),Tt=$.sub(Tt,Ft),Ft=$.mul(mt,Pt),Dt=$.mul(It,Dt),Dt=$.add(Dt,Ft),new at(Tt,vt,Dt)}subtract(ft){return this.add(ft.negate())}is0(){return this.equals(at.ZERO)}wNAF(ft){return lt.wNAFCached(this,it,ft,gt=>{const ht=$.invertBatch(gt.map(yt=>yt.pz));return gt.map((yt,pt)=>yt.toAffine(ht[pt])).map(at.fromAffine)})}multiplyUnsafe(ft){const gt=at.ZERO;if(ft===_0n$1)return gt;if(rt(ft),ft===_1n$1)return this;const{endo:ht}=j;if(!ht)return lt.unsafeLadder(this,ft);let{k1neg:yt,k1:pt,k2neg:Mt,k2:St}=ht.splitScalar(ft),Tt=gt,vt=gt,Dt=this;for(;pt>_0n$1||St>_0n$1;)pt&_1n$1&&(Tt=Tt.add(Dt)),St&_1n$1&&(vt=vt.add(Dt)),Dt=Dt.double(),pt>>=_1n$1,St>>=_1n$1;return yt&&(Tt=Tt.negate()),Mt&&(vt=vt.negate()),vt=new at($.mul(vt.px,ht.beta),vt.py,vt.pz),Tt.add(vt)}multiply(ft){rt(ft);let gt=ft,ht,yt;const{endo:pt}=j;if(pt){const{k1neg:Mt,k1:St,k2neg:Tt,k2:vt}=pt.splitScalar(gt);let{p:Dt,f:zt}=this.wNAF(St),{p:Ot,f:Ft}=this.wNAF(vt);Dt=lt.constTimeNegate(Mt,Dt),Ot=lt.constTimeNegate(Tt,Ot),Ot=new at($.mul(Ot.px,pt.beta),Ot.py,Ot.pz),ht=Dt.add(Ot),yt=zt.add(Ft)}else{const{p:Mt,f:St}=this.wNAF(gt);ht=Mt,yt=St}return at.normalizeZ([ht,yt])[0]}multiplyAndAddUnsafe(ft,gt,ht){const yt=at.BASE,pt=(St,Tt)=>Tt===_0n$1||Tt===_1n$1||!St.equals(yt)?St.multiplyUnsafe(Tt):St.multiply(Tt),Mt=pt(this,gt).add(pt(ft,ht));return Mt.is0()?void 0:Mt}toAffine(ft){const{px:gt,py:ht,pz:yt}=this,pt=this.is0();ft==null&&(ft=pt?$.ONE:$.inv(yt));const Mt=$.mul(gt,ft),St=$.mul(ht,ft),Tt=$.mul(yt,ft);if(pt)return{x:$.ZERO,y:$.ZERO};if(!$.eql(Tt,$.ONE))throw new Error("invZ was invalid");return{x:Mt,y:St}}isTorsionFree(){const{h:ft,isTorsionFree:gt}=j;if(ft===_1n$1)return!0;if(gt)return gt(at,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:ft,clearCofactor:gt}=j;return ft===_1n$1?this:gt?gt(at,this):this.multiplyUnsafe(j.h)}toRawBytes(ft=!0){return this.assertValidity(),_e(at,this,ft)}toHex(ft=!0){return bytesToHex(this.toRawBytes(ft))}}at.BASE=new at(j.Gx,j.Gy,$.ONE),at.ZERO=new at($.ZERO,$.ONE,$.ZERO);const ct=j.nBitLength,lt=wNAF(at,j.endo?Math.ceil(ct/2):ct);return{CURVE:j,ProjectivePoint:at,normPrivateKeyToScalar:ot,weierstrassEquation:tt,isWithinCurveOrder:nt}}function validateOpts(s){const j=validateBasic(s);return validateObject(j,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...j})}function weierstrass(s){const j=validateOpts(s),{Fp:$,n:_e}=j,et=$.BYTES+1,tt=2*$.BYTES+1;function nt(xt){return _0n$1bytesToHex(numberToBytesBE(xt,j.nByteLength));function dt(xt){const It=_e>>_1n$1;return xt>It}function ft(xt){return dt(xt)?rt(-xt):xt}const gt=(xt,It,jt)=>bytesToNumberBE(xt.slice(It,jt));class ht{constructor(It,jt,At){this.r=It,this.s=jt,this.recovery=At,this.assertValidity()}static fromCompact(It){const jt=j.nByteLength;return It=ensureBytes("compactSignature",It,jt*2),new ht(gt(It,0,jt),gt(It,jt,2*jt))}static fromDER(It){const{r:jt,s:At}=DER.toSig(ensureBytes("DER",It));return new ht(jt,At)}assertValidity(){if(!ct(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!ct(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(It){return new ht(this.r,this.s,It)}recoverPublicKey(It){const{r:jt,s:At,recovery:wt}=this,Rt=vt(ensureBytes("msgHash",It));if(wt==null||![0,1,2,3].includes(wt))throw new Error("recovery id invalid");const Nt=wt===2||wt===3?jt+j.n:jt;if(Nt>=$.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ct=wt&1?"03":"02",Bt=it.fromHex(Ct+lt(Nt)),Gt=ot(Nt),Vt=rt(-Rt*Gt),Yt=rt(At*Gt),Qt=it.BASE.multiplyAndAddUnsafe(Bt,Vt,Yt);if(!Qt)throw new Error("point at infinify");return Qt.assertValidity(),Qt}hasHighS(){return dt(this.s)}normalizeS(){return this.hasHighS()?new ht(this.r,rt(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return lt(this.r)+lt(this.s)}}const yt={isValidPrivateKey(xt){try{return st(xt),!0}catch{return!1}},normPrivateKeyToScalar:st,randomPrivateKey:()=>{const xt=getMinHashLength(j.n);return mapHashToField(j.randomBytes(xt),j.n)},precompute(xt=8,It=it.BASE){return It._setWindowSize(xt),It.multiply(BigInt(3)),It}};function pt(xt,It=!0){return it.fromPrivateKey(xt).toRawBytes(It)}function Mt(xt){const It=isBytes(xt),jt=typeof xt=="string",At=(It||jt)&&xt.length;return It?At===et||At===tt:jt?At===2*et||At===2*tt:xt instanceof it}function St(xt,It,jt=!0){if(Mt(xt))throw new Error("first arg must be private key");if(!Mt(It))throw new Error("second arg must be public key");return it.fromHex(It).multiply(st(xt)).toRawBytes(jt)}const Tt=j.bits2int||function(xt){const It=bytesToNumberBE(xt),jt=xt.length*8-j.nBitLength;return jt>0?It>>BigInt(jt):It},vt=j.bits2int_modN||function(xt){return rt(Tt(xt))},Dt=bitMask(j.nBitLength);function zt(xt){if(typeof xt!="bigint")throw new Error("bigint expected");if(!(_0n$1<=xt&&xtZt in jt))throw new Error("sign() legacy options not supported");const{hash:At,randomBytes:wt}=j;let{lowS:Rt,prehash:Nt,extraEntropy:Ct}=jt;Rt==null&&(Rt=!0),xt=ensureBytes("msgHash",xt),Nt&&(xt=ensureBytes("prehashed msgHash",At(xt)));const Bt=vt(xt),Gt=st(It),Vt=[zt(Gt),zt(Bt)];if(Ct!=null&&Ct!==!1){const Zt=Ct===!0?wt($.BYTES):Ct;Vt.push(ensureBytes("extraEntropy",Zt))}const Yt=concatBytes(...Vt),Qt=Bt;function qt(Zt){const fn=Tt(Zt);if(!ct(fn))return;const Xt=ot(fn),on=it.BASE.multiply(fn).toAffine(),tn=rt(on.x);if(tn===_0n$1)return;const Kt=rt(Xt*rt(Qt+tn*Gt));if(Kt===_0n$1)return;let Jt=(on.x===tn?0:2)|Number(on.y&_1n$1),En=Kt;return Rt&&dt(Kt)&&(En=ft(Kt),Jt^=1),new ht(tn,En,Jt)}return{seed:Yt,k2sig:qt}}const Ft={lowS:j.lowS,prehash:!1},Pt={lowS:j.lowS,prehash:!1};function Lt(xt,It,jt=Ft){const{seed:At,k2sig:wt}=Ot(xt,It,jt),Rt=j;return createHmacDrbg(Rt.hash.outputLen,Rt.nByteLength,Rt.hmac)(At,wt)}it.BASE._setWindowSize(8);function mt(xt,It,jt,At=Pt){var on;const wt=xt;if(It=ensureBytes("msgHash",It),jt=ensureBytes("publicKey",jt),"strict"in At)throw new Error("options.strict was renamed to lowS");const{lowS:Rt,prehash:Nt}=At;let Ct,Bt;try{if(typeof wt=="string"||isBytes(wt))try{Ct=ht.fromDER(wt)}catch(tn){if(!(tn instanceof DER.Err))throw tn;Ct=ht.fromCompact(wt)}else if(typeof wt=="object"&&typeof wt.r=="bigint"&&typeof wt.s=="bigint"){const{r:tn,s:Kt}=wt;Ct=new ht(tn,Kt)}else throw new Error("PARSE");Bt=it.fromHex(jt)}catch(tn){if(tn.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Rt&&Ct.hasHighS())return!1;Nt&&(It=j.hash(It));const{r:Gt,s:Vt}=Ct,Yt=vt(It),Qt=ot(Vt),qt=rt(Yt*Qt),Zt=rt(Gt*Qt),fn=(on=it.BASE.multiplyAndAddUnsafe(Bt,qt,Zt))==null?void 0:on.toAffine();return fn?rt(fn.x)===Gt:!1}return{CURVE:j,getPublicKey:pt,getSharedSecret:St,sign:Lt,verify:mt,ProjectivePoint:it,Signature:ht,utils:yt}}function SWUFpSqrtRatio(s,j){const $=s.ORDER;let _e=_0n$1;for(let dt=$-_1n$1;dt%_2n$1===_0n$1;dt/=_2n$1)_e+=_1n$1;const et=_e,tt=_2n$1<{let gt=at,ht=s.pow(ft,it),yt=s.sqr(ht);yt=s.mul(yt,ft);let pt=s.mul(dt,yt);pt=s.pow(pt,ot),pt=s.mul(pt,ht),ht=s.mul(pt,ft),yt=s.mul(pt,dt);let Mt=s.mul(yt,ht);pt=s.pow(Mt,st);let St=s.eql(pt,s.ONE);ht=s.mul(yt,ct),pt=s.mul(Mt,gt),yt=s.cmov(ht,yt,St),Mt=s.cmov(pt,Mt,St);for(let Tt=et;Tt>_1n$1;Tt--){let vt=Tt-_2n$1;vt=_2n$1<{let yt=s.sqr(ht);const pt=s.mul(gt,ht);yt=s.mul(yt,pt);let Mt=s.pow(yt,dt);Mt=s.mul(Mt,pt);const St=s.mul(Mt,ft),Tt=s.mul(s.sqr(Mt),ht),vt=s.eql(Tt,gt);let Dt=s.cmov(St,Mt,vt);return{isValid:vt,value:Dt}}}return lt}function mapToCurveSimpleSWU(s,j){if(validateField(s),!s.isValid(j.A)||!s.isValid(j.B)||!s.isValid(j.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const $=SWUFpSqrtRatio(s,j.Z);if(!s.isOdd)throw new Error("Fp.isOdd is not implemented!");return _e=>{let et,tt,nt,rt,ot,it,st,at;et=s.sqr(_e),et=s.mul(et,j.Z),tt=s.sqr(et),tt=s.add(tt,et),nt=s.add(tt,s.ONE),nt=s.mul(nt,j.B),rt=s.cmov(j.Z,s.neg(tt),!s.eql(tt,s.ZERO)),rt=s.mul(rt,j.A),tt=s.sqr(nt),it=s.sqr(rt),ot=s.mul(it,j.A),tt=s.add(tt,ot),tt=s.mul(tt,nt),it=s.mul(it,rt),ot=s.mul(it,j.B),tt=s.add(tt,ot),st=s.mul(et,nt);const{isValid:ct,value:lt}=$(tt,it);at=s.mul(et,_e),at=s.mul(at,lt),st=s.cmov(st,nt,ct),at=s.cmov(at,lt,ct);const dt=s.isOdd(_e)===s.isOdd(at);return at=s.cmov(s.neg(at),at,dt),st=s.div(st,rt),{x:st,y:at}}}class HMAC extends Hash{constructor(j,$){super(),this.finished=!1,this.destroyed=!1,hash(j);const _e=toBytes($);if(this.iHash=j.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const et=this.blockLen,tt=new Uint8Array(et);tt.set(_e.length>et?j.create().update(_e).digest():_e);for(let nt=0;ntnew HMAC(s,j).update($).digest();hmac.create=(s,j)=>new HMAC(s,j);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(s){return{hash:s,hmac:(j,...$)=>hmac(s,j,concatBytes$1(...$)),randomBytes}}function createCurve(s,j){const $=_e=>weierstrass({...s,...getHash(_e)});return Object.freeze({...$(j),create:$})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n=BigInt(1),_2n=BigInt(2),divNearest=(s,j)=>(s+j/_2n)/j;function sqrtMod(s){const j=secp256k1P,$=BigInt(3),_e=BigInt(6),et=BigInt(11),tt=BigInt(22),nt=BigInt(23),rt=BigInt(44),ot=BigInt(88),it=s*s*s%j,st=it*it*s%j,at=pow2(st,$,j)*st%j,ct=pow2(at,$,j)*st%j,lt=pow2(ct,_2n,j)*it%j,dt=pow2(lt,et,j)*lt%j,ft=pow2(dt,tt,j)*dt%j,gt=pow2(ft,rt,j)*ft%j,ht=pow2(gt,ot,j)*gt%j,yt=pow2(ht,rt,j)*ft%j,pt=pow2(yt,$,j)*st%j,Mt=pow2(pt,nt,j)*dt%j,St=pow2(Mt,_e,j)*it%j,Tt=pow2(St,_2n,j);if(!Fp.eql(Fp.sqr(Tt),s))throw new Error("Cannot find square root");return Tt}const Fp=Field(secp256k1P,void 0,void 0,{sqrt:sqrtMod}),secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:s=>{const j=secp256k1N,$=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),_e=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),et=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),tt=$,nt=BigInt("0x100000000000000000000000000000000"),rt=divNearest(tt*s,j),ot=divNearest(-_e*s,j);let it=mod(s-rt*$-ot*et,j),st=mod(-rt*_e-ot*tt,j);const at=it>nt,ct=st>nt;if(at&&(it=j-it),ct&&(st=j-st),it>nt||st>nt)throw new Error("splitScalar: Endomorphism failed, k="+s);return{k1neg:at,k1:it,k2neg:ct,k2:st}}}},sha256),_0n=BigInt(0),fe=s=>typeof s=="bigint"&&_0ntypeof s=="bigint"&&_0net.charCodeAt(0)));$=concatBytes(_e,_e),TAGGED_HASH_PREFIXES[s]=$}return sha256(concatBytes($,...j))}const pointToBytes=s=>s.toRawBytes(!0).slice(1),numTo32b=s=>numberToBytesBE(s,32),modP=s=>mod(s,secp256k1P),modN=s=>mod(s,secp256k1N),Point=secp256k1.ProjectivePoint,GmulAdd=(s,j,$)=>Point.BASE.multiplyAndAddUnsafe(s,j,$);function schnorrGetExtPubKey(s){let j=secp256k1.utils.normPrivateKeyToScalar(s),$=Point.fromPrivateKey(j);return{scalar:$.hasEvenY()?j:modN(-j),bytes:pointToBytes($)}}function lift_x(s){if(!fe(s))throw new Error("bad x: need 0 < x < p");const j=modP(s*s),$=modP(j*s+BigInt(7));let _e=sqrtMod($);_e%_2n!==_0n&&(_e=modP(-_e));const et=new Point(s,_e,_1n);return et.assertValidity(),et}function challenge(...s){return modN(bytesToNumberBE(taggedHash("BIP0340/challenge",...s)))}function schnorrGetPublicKey(s){return schnorrGetExtPubKey(s).bytes}function schnorrSign(s,j,$=randomBytes(32)){const _e=ensureBytes("message",s),{bytes:et,scalar:tt}=schnorrGetExtPubKey(j),nt=ensureBytes("auxRand",$,32),rt=numTo32b(tt^bytesToNumberBE(taggedHash("BIP0340/aux",nt))),ot=taggedHash("BIP0340/nonce",rt,et,_e),it=modN(bytesToNumberBE(ot));if(it===_0n)throw new Error("sign failed: k is zero");const{bytes:st,scalar:at}=schnorrGetExtPubKey(it),ct=challenge(st,et,_e),lt=new Uint8Array(64);if(lt.set(st,0),lt.set(numTo32b(modN(at+ct*tt)),32),!schnorrVerify(lt,_e,et))throw new Error("sign: Invalid signature produced");return lt}function schnorrVerify(s,j,$){const _e=ensureBytes("signature",s,64),et=ensureBytes("message",j),tt=ensureBytes("publicKey",$,32);try{const nt=lift_x(bytesToNumberBE(tt)),rt=bytesToNumberBE(_e.subarray(0,32));if(!fe(rt))return!1;const ot=bytesToNumberBE(_e.subarray(32,64));if(!ge(ot))return!1;const it=challenge(numTo32b(rt),pointToBytes(nt),et),st=GmulAdd(nt,ot,modN(-it));return!(!st||!st.hasEvenY()||st.toAffine().x!==rt)}catch{return!1}}const schnorr={getPublicKey:schnorrGetPublicKey,sign:schnorrSign,verify:schnorrVerify,utils:{randomPrivateKey:secp256k1.utils.randomPrivateKey,lift_x,pointToBytes,numberToBytesBE,bytesToNumberBE,taggedHash,mod}},isoMap=isogenyMap(Fp,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(s=>s.map(j=>BigInt(j)))),mapSWU=mapToCurveSimpleSWU(Fp,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Fp.create(BigInt("-11"))}),htf=createHasher(secp256k1.ProjectivePoint,s=>{const{x:j,y:$}=mapSWU(Fp.create(s[0]));return isoMap(j,$)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Fp.ORDER,m:1,k:128,expand:"xmd",hash:sha256}),hashToCurve=htf.hashToCurve,encodeToCurve=htf.encodeToCurve,secp256k1$1=Object.freeze(Object.defineProperty({__proto__:null,encodeToCurve,hashToCurve,schnorr,secp256k1},Symbol.toStringTag,{value:"Module"})),generatePrivateKey=ed25519.utils.randomPrivateKey,generateKeypair=()=>{const s=ed25519.utils.randomPrivateKey(),j=getPublicKey(s),$=new Uint8Array(64);return $.set(s),$.set(j,32),{publicKey:j,secretKey:$}},getPublicKey=ed25519.getPublicKey;function isOnCurve(s){try{return ed25519.ExtendedPoint.fromHex(s),!0}catch{return!1}}const sign=(s,j)=>ed25519.sign(s,j.slice(0,32)),verify=ed25519.verify,toBuffer=s=>buffer.Buffer.isBuffer(s)?s:s instanceof Uint8Array?buffer.Buffer.from(s.buffer,s.byteOffset,s.byteLength):buffer.Buffer.from(s);class Struct{constructor(j){Object.assign(this,j)}encode(){return buffer.Buffer.from(serialize_1(SOLANA_SCHEMA,this))}static decode(j){return deserialize_1(SOLANA_SCHEMA,this,j)}static decodeUnchecked(j){return deserializeUnchecked_1(SOLANA_SCHEMA,this,j)}}class Enum extends Struct{constructor(j){if(super(j),this.enum="",Object.keys(j).length!==1)throw new Error("Enum can only take single value");Object.keys(j).map($=>{this.enum=$})}}const SOLANA_SCHEMA=new Map;var _PublicKey;const MAX_SEED_LENGTH=32,PUBLIC_KEY_LENGTH=32;function isPublicKeyData(s){return s._bn!==void 0}let uniquePublicKeyCounter=1;class PublicKey extends Struct{constructor(j){if(super({}),this._bn=void 0,isPublicKeyData(j))this._bn=j._bn;else{if(typeof j=="string"){const $=base58.decode(j);if($.length!=PUBLIC_KEY_LENGTH)throw new Error("Invalid public key input");this._bn=new BN($)}else this._bn=new BN(j);if(this._bn.byteLength()>PUBLIC_KEY_LENGTH)throw new Error("Invalid public key input")}}static unique(){const j=new PublicKey(uniquePublicKeyCounter);return uniquePublicKeyCounter+=1,new PublicKey(j.toBuffer())}equals(j){return this._bn.eq(j._bn)}toBase58(){return base58.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const j=this.toBuffer();return new Uint8Array(j.buffer,j.byteOffset,j.byteLength)}toBuffer(){const j=this._bn.toArrayLike(buffer.Buffer);if(j.length===PUBLIC_KEY_LENGTH)return j;const $=buffer.Buffer.alloc(32);return j.copy($,32-j.length),$}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(j,$,_e){const et=buffer.Buffer.concat([j.toBuffer(),buffer.Buffer.from($),_e.toBuffer()]),tt=sha256(et);return new PublicKey(tt)}static createProgramAddressSync(j,$){let _e=buffer.Buffer.alloc(0);j.forEach(function(tt){if(tt.length>MAX_SEED_LENGTH)throw new TypeError("Max seed length exceeded");_e=buffer.Buffer.concat([_e,toBuffer(tt)])}),_e=buffer.Buffer.concat([_e,$.toBuffer(),buffer.Buffer.from("ProgramDerivedAddress")]);const et=sha256(_e);if(isOnCurve(et))throw new Error("Invalid seeds, address must fall off the curve");return new PublicKey(et)}static async createProgramAddress(j,$){return this.createProgramAddressSync(j,$)}static findProgramAddressSync(j,$){let _e=255,et;for(;_e!=0;){try{const tt=j.concat(buffer.Buffer.from([_e]));et=this.createProgramAddressSync(tt,$)}catch(tt){if(tt instanceof TypeError)throw tt;_e--;continue}return[et,_e]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(j,$){return this.findProgramAddressSync(j,$)}static isOnCurve(j){const $=new PublicKey(j);return isOnCurve($.toBytes())}}_PublicKey=PublicKey;PublicKey.default=new _PublicKey("11111111111111111111111111111111");SOLANA_SCHEMA.set(PublicKey,{kind:"struct",fields:[["_bn","u256"]]});class Account{constructor(j){if(this._publicKey=void 0,this._secretKey=void 0,j){const $=toBuffer(j);if(j.length!==64)throw new Error("bad secret key size");this._publicKey=$.slice(32,64),this._secretKey=$.slice(0,32)}else this._secretKey=toBuffer(generatePrivateKey()),this._publicKey=toBuffer(getPublicKey(this._secretKey))}get publicKey(){return new PublicKey(this._publicKey)}get secretKey(){return buffer.Buffer.concat([this._secretKey,this._publicKey],64)}}const BPF_LOADER_DEPRECATED_PROGRAM_ID=new PublicKey("BPFLoader1111111111111111111111111111111111"),PACKET_DATA_SIZE=1232,VERSION_PREFIX_MASK=127,SIGNATURE_LENGTH_IN_BYTES=64;class TransactionExpiredBlockheightExceededError extends Error{constructor(j){super(`Signature ${j} has expired: block height exceeded.`),this.signature=void 0,this.signature=j}}Object.defineProperty(TransactionExpiredBlockheightExceededError.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class TransactionExpiredTimeoutError extends Error{constructor(j,$){super(`Transaction was not confirmed in ${$.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${j} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=j}}Object.defineProperty(TransactionExpiredTimeoutError.prototype,"name",{value:"TransactionExpiredTimeoutError"});class TransactionExpiredNonceInvalidError extends Error{constructor(j){super(`Signature ${j} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=j}}Object.defineProperty(TransactionExpiredNonceInvalidError.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class MessageAccountKeys{constructor(j,$){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=j,this.accountKeysFromLookups=$}keySegments(){const j=[this.staticAccountKeys];return this.accountKeysFromLookups&&(j.push(this.accountKeysFromLookups.writable),j.push(this.accountKeysFromLookups.readonly)),j}get(j){for(const $ of this.keySegments()){if(j<$.length)return $[j];j-=$.length}}get length(){return this.keySegments().flat().length}compileInstructions(j){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const _e=new Map;this.keySegments().flat().forEach((tt,nt)=>{_e.set(tt.toBase58(),nt)});const et=tt=>{const nt=_e.get(tt.toBase58());if(nt===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return nt};return j.map(tt=>({programIdIndex:et(tt.programId),accountKeyIndexes:tt.keys.map(nt=>et(nt.pubkey)),data:tt.data}))}}const publicKey=(s="publicKey")=>blob(32,s),signature$2=(s="signature")=>blob(64,s),rustString=(s="string")=>{const j=struct([u32("length"),u32("lengthPadding"),blob(offset(u32(),-8),"chars")],s),$=j.decode.bind(j),_e=j.encode.bind(j),et=j;return et.decode=(tt,nt)=>$(tt,nt).chars.toString(),et.encode=(tt,nt,rt)=>{const ot={chars:buffer.Buffer.from(tt,"utf8")};return _e(ot,nt,rt)},et.alloc=tt=>u32().span+u32().span+buffer.Buffer.from(tt,"utf8").length,et},authorized=(s="authorized")=>struct([publicKey("staker"),publicKey("withdrawer")],s),lockup=(s="lockup")=>struct([ns64("unixTimestamp"),ns64("epoch"),publicKey("custodian")],s),voteInit=(s="voteInit")=>struct([publicKey("nodePubkey"),publicKey("authorizedVoter"),publicKey("authorizedWithdrawer"),u8("commission")],s),voteAuthorizeWithSeedArgs=(s="voteAuthorizeWithSeedArgs")=>struct([u32("voteAuthorizationType"),publicKey("currentAuthorityDerivedKeyOwnerPubkey"),rustString("currentAuthorityDerivedKeySeed"),publicKey("newAuthorized")],s);function getAlloc(s,j){const $=et=>{if(et.span>=0)return et.span;if(typeof et.alloc=="function")return et.alloc(j[et.property]);if("count"in et&&"elementLayout"in et){const tt=j[et.property];if(Array.isArray(tt))return tt.length*$(et.elementLayout)}else if("fields"in et)return getAlloc({layout:et},j[et.property]);return 0};let _e=0;return s.layout.fields.forEach(et=>{_e+=$(et)}),_e}function decodeLength(s){let j=0,$=0;for(;;){let _e=s.shift();if(j|=(_e&127)<<$*7,$+=1,!(_e&128))break}return j}function encodeLength(s,j){let $=j;for(;;){let _e=$&127;if($>>=7,$==0){s.push(_e);break}else _e|=128,s.push(_e)}}function assert(s,j){if(!s)throw new Error(j||"Assertion failed")}class CompiledKeys{constructor(j,$){this.payer=void 0,this.keyMetaMap=void 0,this.payer=j,this.keyMetaMap=$}static compile(j,$){const _e=new Map,et=nt=>{const rt=nt.toBase58();let ot=_e.get(rt);return ot===void 0&&(ot={isSigner:!1,isWritable:!1,isInvoked:!1},_e.set(rt,ot)),ot},tt=et($);tt.isSigner=!0,tt.isWritable=!0;for(const nt of j){et(nt.programId).isInvoked=!0;for(const rt of nt.keys){const ot=et(rt.pubkey);ot.isSigner||(ot.isSigner=rt.isSigner),ot.isWritable||(ot.isWritable=rt.isWritable)}}return new CompiledKeys($,_e)}getMessageComponents(){const j=[...this.keyMetaMap.entries()];assert(j.length<=256,"Max static account keys length exceeded");const $=j.filter(([,ot])=>ot.isSigner&&ot.isWritable),_e=j.filter(([,ot])=>ot.isSigner&&!ot.isWritable),et=j.filter(([,ot])=>!ot.isSigner&&ot.isWritable),tt=j.filter(([,ot])=>!ot.isSigner&&!ot.isWritable),nt={numRequiredSignatures:$.length+_e.length,numReadonlySignedAccounts:_e.length,numReadonlyUnsignedAccounts:tt.length};{assert($.length>0,"Expected at least one writable signer key");const[ot]=$[0];assert(ot===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const rt=[...$.map(([ot])=>new PublicKey(ot)),..._e.map(([ot])=>new PublicKey(ot)),...et.map(([ot])=>new PublicKey(ot)),...tt.map(([ot])=>new PublicKey(ot))];return[nt,rt]}extractTableLookup(j){const[$,_e]=this.drainKeysFoundInLookupTable(j.state.addresses,nt=>!nt.isSigner&&!nt.isInvoked&&nt.isWritable),[et,tt]=this.drainKeysFoundInLookupTable(j.state.addresses,nt=>!nt.isSigner&&!nt.isInvoked&&!nt.isWritable);if(!($.length===0&&et.length===0))return[{accountKey:j.key,writableIndexes:$,readonlyIndexes:et},{writable:_e,readonly:tt}]}drainKeysFoundInLookupTable(j,$){const _e=new Array,et=new Array;for(const[tt,nt]of this.keyMetaMap.entries())if($(nt)){const rt=new PublicKey(tt),ot=j.findIndex(it=>it.equals(rt));ot>=0&&(assert(ot<256,"Max lookup table index exceeded"),_e.push(ot),et.push(rt),this.keyMetaMap.delete(tt))}return[_e,et]}}const END_OF_BUFFER_ERROR_MESSAGE="Reached end of buffer unexpectedly";function guardedShift(s){if(s.length===0)throw new Error(END_OF_BUFFER_ERROR_MESSAGE);return s.shift()}function guardedSplice(s,...j){const[$]=j;if(j.length===2?$+(j[1]??0)>s.length:$>=s.length)throw new Error(END_OF_BUFFER_ERROR_MESSAGE);return s.splice(...j)}class Message{constructor(j){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=j.header,this.accountKeys=j.accountKeys.map($=>new PublicKey($)),this.recentBlockhash=j.recentBlockhash,this.instructions=j.instructions,this.instructions.forEach($=>this.indexToProgramIds.set($.programIdIndex,this.accountKeys[$.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(j=>({programIdIndex:j.programIdIndex,accountKeyIndexes:j.accounts,data:base58.decode(j.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new MessageAccountKeys(this.staticAccountKeys)}static compile(j){const $=CompiledKeys.compile(j.instructions,j.payerKey),[_e,et]=$.getMessageComponents(),nt=new MessageAccountKeys(et).compileInstructions(j.instructions).map(rt=>({programIdIndex:rt.programIdIndex,accounts:rt.accountKeyIndexes,data:base58.encode(rt.data)}));return new Message({header:_e,accountKeys:et,recentBlockhash:j.recentBlockhash,instructions:nt})}isAccountSigner(j){return j=this.header.numRequiredSignatures){const _e=j-$,tt=this.accountKeys.length-$-this.header.numReadonlyUnsignedAccounts;return _e!this.isProgramId($))}serialize(){const j=this.accountKeys.length;let $=[];encodeLength($,j);const _e=this.instructions.map(at=>{const{accounts:ct,programIdIndex:lt}=at,dt=Array.from(base58.decode(at.data));let ft=[];encodeLength(ft,ct.length);let gt=[];return encodeLength(gt,dt.length),{programIdIndex:lt,keyIndicesCount:buffer.Buffer.from(ft),keyIndices:ct,dataLength:buffer.Buffer.from(gt),data:dt}});let et=[];encodeLength(et,_e.length);let tt=buffer.Buffer.alloc(PACKET_DATA_SIZE);buffer.Buffer.from(et).copy(tt);let nt=et.length;_e.forEach(at=>{const lt=struct([u8("programIdIndex"),blob(at.keyIndicesCount.length,"keyIndicesCount"),seq(u8("keyIndex"),at.keyIndices.length,"keyIndices"),blob(at.dataLength.length,"dataLength"),seq(u8("userdatum"),at.data.length,"data")]).encode(at,tt,nt);nt+=lt}),tt=tt.slice(0,nt);const rt=struct([blob(1,"numRequiredSignatures"),blob(1,"numReadonlySignedAccounts"),blob(1,"numReadonlyUnsignedAccounts"),blob($.length,"keyCount"),seq(publicKey("key"),j,"keys"),publicKey("recentBlockhash")]),ot={numRequiredSignatures:buffer.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:buffer.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:buffer.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:buffer.Buffer.from($),keys:this.accountKeys.map(at=>toBuffer(at.toBytes())),recentBlockhash:base58.decode(this.recentBlockhash)};let it=buffer.Buffer.alloc(2048);const st=rt.encode(ot,it);return tt.copy(it,st),it.slice(0,st+tt.length)}static from(j){let $=[...j];const _e=guardedShift($);if(_e!==(_e&VERSION_PREFIX_MASK))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const et=guardedShift($),tt=guardedShift($),nt=decodeLength($);let rt=[];for(let ct=0;ct0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new MessageAccountKeys(this.staticAccountKeys,$)}isAccountSigner(j){return j=_e){const et=j-_e,tt=this.addressTableLookups.reduce((nt,rt)=>nt+rt.writableIndexes.length,0);return et=this.header.numRequiredSignatures){const et=j-$,nt=_e-$-this.header.numReadonlyUnsignedAccounts;return ettt.key.equals(_e.accountKey));if(!et)throw new Error(`Failed to find address lookup table account for table key ${_e.accountKey.toBase58()}`);for(const tt of _e.writableIndexes)if(ttst.toBytes()),recentBlockhash:base58.decode(this.recentBlockhash),instructionsLength:new Uint8Array(_e),serializedInstructions:$,addressTableLookupsLength:new Uint8Array(tt),serializedAddressTableLookups:et},rt);return rt.slice(0,it)}serializeInstructions(){let j=0;const $=new Uint8Array(PACKET_DATA_SIZE);for(const _e of this.compiledInstructions){const et=Array();encodeLength(et,_e.accountKeyIndexes.length);const tt=Array();encodeLength(tt,_e.data.length);const nt=struct([u8("programIdIndex"),blob(et.length,"encodedAccountKeyIndexesLength"),seq(u8(),_e.accountKeyIndexes.length,"accountKeyIndexes"),blob(tt.length,"encodedDataLength"),blob(_e.data.length,"data")]);j+=nt.encode({programIdIndex:_e.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(et),accountKeyIndexes:_e.accountKeyIndexes,encodedDataLength:new Uint8Array(tt),data:_e.data},$,j)}return $.slice(0,j)}serializeAddressTableLookups(){let j=0;const $=new Uint8Array(PACKET_DATA_SIZE);for(const _e of this.addressTableLookups){const et=Array();encodeLength(et,_e.writableIndexes.length);const tt=Array();encodeLength(tt,_e.readonlyIndexes.length);const nt=struct([publicKey("accountKey"),blob(et.length,"encodedWritableIndexesLength"),seq(u8(),_e.writableIndexes.length,"writableIndexes"),blob(tt.length,"encodedReadonlyIndexesLength"),seq(u8(),_e.readonlyIndexes.length,"readonlyIndexes")]);j+=nt.encode({accountKey:_e.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(et),writableIndexes:_e.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(tt),readonlyIndexes:_e.readonlyIndexes},$,j)}return $.slice(0,j)}static deserialize(j){let $=[...j];const _e=guardedShift($),et=_e&VERSION_PREFIX_MASK;assert(_e!==et,"Expected versioned message but received legacy message");const tt=et;assert(tt===0,`Expected versioned message with version 0 but found version ${tt}`);const nt={numRequiredSignatures:guardedShift($),numReadonlySignedAccounts:guardedShift($),numReadonlyUnsignedAccounts:guardedShift($)},rt=[],ot=decodeLength($);for(let dt=0;dt{const j=VersionedMessage.deserializeMessageVersion(s);if(j==="legacy")return Message.from(s);if(j===0)return MessageV0.deserialize(s);throw new Error(`Transaction message version ${j} deserialization is not supported`)}};let TransactionStatus=function(s){return s[s.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",s[s.PROCESSED=1]="PROCESSED",s[s.TIMED_OUT=2]="TIMED_OUT",s[s.NONCE_INVALID=3]="NONCE_INVALID",s}({});const DEFAULT_SIGNATURE=buffer.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);class TransactionInstruction{constructor(j){this.keys=void 0,this.programId=void 0,this.data=buffer.Buffer.alloc(0),this.programId=j.programId,this.keys=j.keys,j.data&&(this.data=j.data)}toJSON(){return{keys:this.keys.map(({pubkey:j,isSigner:$,isWritable:_e})=>({pubkey:j.toJSON(),isSigner:$,isWritable:_e})),programId:this.programId.toJSON(),data:[...this.data]}}}class Transaction{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(j){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!j)if(j.feePayer&&(this.feePayer=j.feePayer),j.signatures&&(this.signatures=j.signatures),Object.prototype.hasOwnProperty.call(j,"nonceInfo")){const{minContextSlot:$,nonceInfo:_e}=j;this.minNonceContextSlot=$,this.nonceInfo=_e}else if(Object.prototype.hasOwnProperty.call(j,"lastValidBlockHeight")){const{blockhash:$,lastValidBlockHeight:_e}=j;this.recentBlockhash=$,this.lastValidBlockHeight=_e}else{const{recentBlockhash:$,nonceInfo:_e}=j;_e&&(this.nonceInfo=_e),this.recentBlockhash=$}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(j=>j.toJSON()),signers:this.signatures.map(({publicKey:j})=>j.toJSON())}}add(...j){if(j.length===0)throw new Error("No instructions");return j.forEach($=>{"instructions"in $?this.instructions=this.instructions.concat($.instructions):"data"in $&&"programId"in $&&"keys"in $?this.instructions.push($):this.instructions.push(new TransactionInstruction($))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let j,$;if(this.nonceInfo?(j=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?$=[this.nonceInfo.nonceInstruction,...this.instructions]:$=this.instructions):(j=this.recentBlockhash,$=this.instructions),!j)throw new Error("Transaction recentBlockhash required");$.length<1&&console.warn("No instructions provided");let _e;if(this.feePayer)_e=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)_e=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let ft=0;ft<$.length;ft++)if($[ft].programId===void 0)throw new Error(`Transaction instruction index ${ft} has undefined program id`);const et=[],tt=[];$.forEach(ft=>{ft.keys.forEach(ht=>{tt.push({...ht})});const gt=ft.programId.toString();et.includes(gt)||et.push(gt)}),et.forEach(ft=>{tt.push({pubkey:new PublicKey(ft),isSigner:!1,isWritable:!1})});const nt=[];tt.forEach(ft=>{const gt=ft.pubkey.toString(),ht=nt.findIndex(yt=>yt.pubkey.toString()===gt);ht>-1?(nt[ht].isWritable=nt[ht].isWritable||ft.isWritable,nt[ht].isSigner=nt[ht].isSigner||ft.isSigner):nt.push(ft)}),nt.sort(function(ft,gt){if(ft.isSigner!==gt.isSigner)return ft.isSigner?-1:1;if(ft.isWritable!==gt.isWritable)return ft.isWritable?-1:1;const ht={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return ft.pubkey.toBase58().localeCompare(gt.pubkey.toBase58(),"en",ht)});const rt=nt.findIndex(ft=>ft.pubkey.equals(_e));if(rt>-1){const[ft]=nt.splice(rt,1);ft.isSigner=!0,ft.isWritable=!0,nt.unshift(ft)}else nt.unshift({pubkey:_e,isSigner:!0,isWritable:!0});for(const ft of this.signatures){const gt=nt.findIndex(ht=>ht.pubkey.equals(ft.publicKey));if(gt>-1)nt[gt].isSigner||(nt[gt].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${ft.publicKey.toString()}`)}let ot=0,it=0,st=0;const at=[],ct=[];nt.forEach(({pubkey:ft,isSigner:gt,isWritable:ht})=>{gt?(at.push(ft.toString()),ot+=1,ht||(it+=1)):(ct.push(ft.toString()),ht||(st+=1))});const lt=at.concat(ct),dt=$.map(ft=>{const{data:gt,programId:ht}=ft;return{programIdIndex:lt.indexOf(ht.toString()),accounts:ft.keys.map(yt=>lt.indexOf(yt.pubkey.toString())),data:base58.encode(gt)}});return dt.forEach(ft=>{assert(ft.programIdIndex>=0),ft.accounts.forEach(gt=>assert(gt>=0))}),new Message({header:{numRequiredSignatures:ot,numReadonlySignedAccounts:it,numReadonlyUnsignedAccounts:st},accountKeys:lt,recentBlockhash:j,instructions:dt})}_compile(){const j=this.compileMessage(),$=j.accountKeys.slice(0,j.header.numRequiredSignatures);return this.signatures.length===$.length&&this.signatures.every((et,tt)=>$[tt].equals(et.publicKey))||(this.signatures=$.map(_e=>({signature:null,publicKey:_e}))),j}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(j){return(await j.getFeeForMessage(this.compileMessage())).value}setSigners(...j){if(j.length===0)throw new Error("No signers");const $=new Set;this.signatures=j.filter(_e=>{const et=_e.toString();return $.has(et)?!1:($.add(et),!0)}).map(_e=>({signature:null,publicKey:_e}))}sign(...j){if(j.length===0)throw new Error("No signers");const $=new Set,_e=[];for(const tt of j){const nt=tt.publicKey.toString();$.has(nt)||($.add(nt),_e.push(tt))}this.signatures=_e.map(tt=>({signature:null,publicKey:tt.publicKey}));const et=this._compile();this._partialSign(et,..._e)}partialSign(...j){if(j.length===0)throw new Error("No signers");const $=new Set,_e=[];for(const tt of j){const nt=tt.publicKey.toString();$.has(nt)||($.add(nt),_e.push(tt))}const et=this._compile();this._partialSign(et,..._e)}_partialSign(j,...$){const _e=j.serialize();$.forEach(et=>{const tt=sign(_e,et.secretKey);this._addSignature(et.publicKey,toBuffer(tt))})}addSignature(j,$){this._compile(),this._addSignature(j,$)}_addSignature(j,$){assert($.length===64);const _e=this.signatures.findIndex(et=>j.equals(et.publicKey));if(_e<0)throw new Error(`unknown signer: ${j.toString()}`);this.signatures[_e].signature=buffer.Buffer.from($)}verifySignatures(j=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),j)}_getMessageSignednessErrors(j,$){const _e={};for(const{signature:et,publicKey:tt}of this.signatures)et===null?$&&(_e.missing||(_e.missing=[])).push(tt):verify(et,j,tt.toBytes())||(_e.invalid||(_e.invalid=[])).push(tt);return _e.invalid||_e.missing?_e:void 0}serialize(j){const{requireAllSignatures:$,verifySignatures:_e}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},j),et=this.serializeMessage();if(_e){const tt=this._getMessageSignednessErrors(et,$);if(tt){let nt="Signature verification failed.";throw tt.invalid&&(nt+=` Invalid signature for public key${tt.invalid.length===1?"":"(s)"} [\`${tt.invalid.map(rt=>rt.toBase58()).join("`, `")}\`].`),tt.missing&&(nt+=` Missing signature for public key${tt.missing.length===1?"":"(s)"} [\`${tt.missing.map(rt=>rt.toBase58()).join("`, `")}\`].`),new Error(nt)}}return this._serialize(et)}_serialize(j){const{signatures:$}=this,_e=[];encodeLength(_e,$.length);const et=_e.length+$.length*64+j.length,tt=buffer.Buffer.alloc(et);return assert($.length<256),buffer.Buffer.from(_e).copy(tt,0),$.forEach(({signature:nt},rt)=>{nt!==null&&(assert(nt.length===64,"signature has invalid length"),buffer.Buffer.from(nt).copy(tt,_e.length+rt*64))}),j.copy(tt,_e.length+$.length*64),assert(tt.length<=PACKET_DATA_SIZE,`Transaction too large: ${tt.length} > ${PACKET_DATA_SIZE}`),tt}get keys(){return assert(this.instructions.length===1),this.instructions[0].keys.map(j=>j.pubkey)}get programId(){return assert(this.instructions.length===1),this.instructions[0].programId}get data(){return assert(this.instructions.length===1),this.instructions[0].data}static from(j){let $=[...j];const _e=decodeLength($);let et=[];for(let tt=0;tt<_e;tt++){const nt=guardedSplice($,0,SIGNATURE_LENGTH_IN_BYTES);et.push(base58.encode(buffer.Buffer.from(nt)))}return Transaction.populate(Message.from($),et)}static populate(j,$=[]){const _e=new Transaction;return _e.recentBlockhash=j.recentBlockhash,j.header.numRequiredSignatures>0&&(_e.feePayer=j.accountKeys[0]),$.forEach((et,tt)=>{const nt={signature:et==base58.encode(DEFAULT_SIGNATURE)?null:base58.decode(et),publicKey:j.accountKeys[tt]};_e.signatures.push(nt)}),j.instructions.forEach(et=>{const tt=et.accounts.map(nt=>{const rt=j.accountKeys[nt];return{pubkey:rt,isSigner:_e.signatures.some(ot=>ot.publicKey.toString()===rt.toString())||j.isAccountSigner(nt),isWritable:j.isAccountWritable(nt)}});_e.instructions.push(new TransactionInstruction({keys:tt,programId:j.accountKeys[et.programIdIndex],data:base58.decode(et.data)}))}),_e._message=j,_e._json=_e.toJSON(),_e}}class TransactionMessage{constructor(j){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=j.payerKey,this.instructions=j.instructions,this.recentBlockhash=j.recentBlockhash}static decompile(j,$){const{header:_e,compiledInstructions:et,recentBlockhash:tt}=j,{numRequiredSignatures:nt,numReadonlySignedAccounts:rt,numReadonlyUnsignedAccounts:ot}=_e,it=nt-rt;assert(it>0,"Message header is invalid");const st=j.staticAccountKeys.length-nt-ot;assert(st>=0,"Message header is invalid");const at=j.getAccountKeys($),ct=at.get(0);if(ct===void 0)throw new Error("Failed to decompile message because no account keys were found");const lt=[];for(const dt of et){const ft=[];for(const ht of dt.accountKeyIndexes){const yt=at.get(ht);if(yt===void 0)throw new Error(`Failed to find key for account key index ${ht}`);const pt=htnt.equals(et.publicKey));assert(tt>=0,`Cannot sign with non signer key ${et.publicKey.toBase58()}`),this.signatures[tt]=sign($,et.secretKey)}}addSignature(j,$){assert($.byteLength===64,"Signature must be 64 bytes long");const et=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(tt=>tt.equals(j));assert(et>=0,`Can not add signature; \`${j.toBase58()}\` is not required to sign this transaction`),this.signatures[et]=$}}const NUM_TICKS_PER_SECOND=160,DEFAULT_TICKS_PER_SLOT=64,NUM_SLOTS_PER_SECOND=NUM_TICKS_PER_SECOND/DEFAULT_TICKS_PER_SLOT,MS_PER_SLOT=1e3/NUM_SLOTS_PER_SECOND,SYSVAR_CLOCK_PUBKEY=new PublicKey("SysvarC1ock11111111111111111111111111111111"),SYSVAR_EPOCH_SCHEDULE_PUBKEY=new PublicKey("SysvarEpochSchedu1e111111111111111111111111"),SYSVAR_INSTRUCTIONS_PUBKEY=new PublicKey("Sysvar1nstructions1111111111111111111111111"),SYSVAR_RECENT_BLOCKHASHES_PUBKEY=new PublicKey("SysvarRecentB1ockHashes11111111111111111111"),SYSVAR_RENT_PUBKEY=new PublicKey("SysvarRent111111111111111111111111111111111"),SYSVAR_REWARDS_PUBKEY=new PublicKey("SysvarRewards111111111111111111111111111111"),SYSVAR_SLOT_HASHES_PUBKEY=new PublicKey("SysvarS1otHashes111111111111111111111111111"),SYSVAR_SLOT_HISTORY_PUBKEY=new PublicKey("SysvarS1otHistory11111111111111111111111111"),SYSVAR_STAKE_HISTORY_PUBKEY=new PublicKey("SysvarStakeHistory1111111111111111111111111");async function sendAndConfirmTransaction(s,j,$,_e){const et=_e&&{skipPreflight:_e.skipPreflight,preflightCommitment:_e.preflightCommitment||_e.commitment,maxRetries:_e.maxRetries,minContextSlot:_e.minContextSlot},tt=await s.sendTransaction(j,$,et);let nt;if(j.recentBlockhash!=null&&j.lastValidBlockHeight!=null)nt=(await s.confirmTransaction({abortSignal:_e==null?void 0:_e.abortSignal,signature:tt,blockhash:j.recentBlockhash,lastValidBlockHeight:j.lastValidBlockHeight},_e&&_e.commitment)).value;else if(j.minNonceContextSlot!=null&&j.nonceInfo!=null){const{nonceInstruction:rt}=j.nonceInfo,ot=rt.keys[0].pubkey;nt=(await s.confirmTransaction({abortSignal:_e==null?void 0:_e.abortSignal,minContextSlot:j.minNonceContextSlot,nonceAccountPubkey:ot,nonceValue:j.nonceInfo.nonce,signature:tt},_e&&_e.commitment)).value}else(_e==null?void 0:_e.abortSignal)!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),nt=(await s.confirmTransaction(tt,_e&&_e.commitment)).value;if(nt.err)throw new Error(`Transaction ${tt} failed (${JSON.stringify(nt)})`);return tt}function sleep(s){return new Promise(j=>setTimeout(j,s))}function encodeData(s,j){const $=s.layout.span>=0?s.layout.span:getAlloc(s,j),_e=buffer.Buffer.alloc($),et=Object.assign({instruction:s.index},j);return s.layout.encode(et,_e),_e}function decodeData$1(s,j){let $;try{$=s.layout.decode(j)}catch(_e){throw new Error("invalid instruction; "+_e)}if($.instruction!==s.index)throw new Error(`invalid instruction; instruction index mismatch ${$.instruction} != ${s.index}`);return $}const FeeCalculatorLayout=nu64("lamportsPerSignature"),NonceAccountLayout=struct([u32("version"),u32("state"),publicKey("authorizedPubkey"),publicKey("nonce"),struct([FeeCalculatorLayout],"feeCalculator")]),NONCE_ACCOUNT_LENGTH=NonceAccountLayout.span;class NonceAccount{constructor(j){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=j.authorizedPubkey,this.nonce=j.nonce,this.feeCalculator=j.feeCalculator}static fromAccountData(j){const $=NonceAccountLayout.decode(toBuffer(j),0);return new NonceAccount({authorizedPubkey:new PublicKey($.authorizedPubkey),nonce:new PublicKey($.nonce).toString(),feeCalculator:$.feeCalculator})}}const encodeDecode=s=>{const j=s.decode.bind(s),$=s.encode.bind(s);return{decode:j,encode:$}},bigInt=s=>j=>{const $=blob(s,j),{encode:_e,decode:et}=encodeDecode($),tt=$;return tt.decode=(nt,rt)=>{const ot=et(nt,rt);return toBigIntLE_1(buffer.Buffer.from(ot))},tt.encode=(nt,rt,ot)=>{const it=toBufferLE_1(nt,s);return _e(it,rt,ot)},tt},u64=bigInt(8);class SystemInstruction{constructor(){}static decodeInstructionType(j){this.checkProgramId(j.programId);const _e=u32("instruction").decode(j.data);let et;for(const[tt,nt]of Object.entries(SYSTEM_INSTRUCTION_LAYOUTS))if(nt.index==_e){et=tt;break}if(!et)throw new Error("Instruction type incorrect; not a SystemInstruction");return et}static decodeCreateAccount(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,2);const{lamports:$,space:_e,programId:et}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Create,j.data);return{fromPubkey:j.keys[0].pubkey,newAccountPubkey:j.keys[1].pubkey,lamports:$,space:_e,programId:new PublicKey(et)}}static decodeTransfer(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,2);const{lamports:$}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Transfer,j.data);return{fromPubkey:j.keys[0].pubkey,toPubkey:j.keys[1].pubkey,lamports:$}}static decodeTransferWithSeed(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,3);const{lamports:$,seed:_e,programId:et}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed,j.data);return{fromPubkey:j.keys[0].pubkey,basePubkey:j.keys[1].pubkey,toPubkey:j.keys[2].pubkey,lamports:$,seed:_e,programId:new PublicKey(et)}}static decodeAllocate(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,1);const{space:$}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Allocate,j.data);return{accountPubkey:j.keys[0].pubkey,space:$}}static decodeAllocateWithSeed(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,1);const{base:$,seed:_e,space:et,programId:tt}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed,j.data);return{accountPubkey:j.keys[0].pubkey,basePubkey:new PublicKey($),seed:_e,space:et,programId:new PublicKey(tt)}}static decodeAssign(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,1);const{programId:$}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Assign,j.data);return{accountPubkey:j.keys[0].pubkey,programId:new PublicKey($)}}static decodeAssignWithSeed(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,1);const{base:$,seed:_e,programId:et}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed,j.data);return{accountPubkey:j.keys[0].pubkey,basePubkey:new PublicKey($),seed:_e,programId:new PublicKey(et)}}static decodeCreateWithSeed(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,2);const{base:$,seed:_e,lamports:et,space:tt,programId:nt}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed,j.data);return{fromPubkey:j.keys[0].pubkey,newAccountPubkey:j.keys[1].pubkey,basePubkey:new PublicKey($),seed:_e,lamports:et,space:tt,programId:new PublicKey(nt)}}static decodeNonceInitialize(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,3);const{authorized:$}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount,j.data);return{noncePubkey:j.keys[0].pubkey,authorizedPubkey:new PublicKey($)}}static decodeNonceAdvance(j){return this.checkProgramId(j.programId),this.checkKeyLength(j.keys,3),decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount,j.data),{noncePubkey:j.keys[0].pubkey,authorizedPubkey:j.keys[2].pubkey}}static decodeNonceWithdraw(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,5);const{lamports:$}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount,j.data);return{noncePubkey:j.keys[0].pubkey,toPubkey:j.keys[1].pubkey,authorizedPubkey:j.keys[4].pubkey,lamports:$}}static decodeNonceAuthorize(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,2);const{authorized:$}=decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount,j.data);return{noncePubkey:j.keys[0].pubkey,authorizedPubkey:j.keys[1].pubkey,newAuthorizedPubkey:new PublicKey($)}}static checkProgramId(j){if(!j.equals(SystemProgram.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(j,$){if(j.length<$)throw new Error(`invalid instruction; found ${j.length} keys, expected at least ${$}`)}}const SYSTEM_INSTRUCTION_LAYOUTS=Object.freeze({Create:{index:0,layout:struct([u32("instruction"),ns64("lamports"),ns64("space"),publicKey("programId")])},Assign:{index:1,layout:struct([u32("instruction"),publicKey("programId")])},Transfer:{index:2,layout:struct([u32("instruction"),u64("lamports")])},CreateWithSeed:{index:3,layout:struct([u32("instruction"),publicKey("base"),rustString("seed"),ns64("lamports"),ns64("space"),publicKey("programId")])},AdvanceNonceAccount:{index:4,layout:struct([u32("instruction")])},WithdrawNonceAccount:{index:5,layout:struct([u32("instruction"),ns64("lamports")])},InitializeNonceAccount:{index:6,layout:struct([u32("instruction"),publicKey("authorized")])},AuthorizeNonceAccount:{index:7,layout:struct([u32("instruction"),publicKey("authorized")])},Allocate:{index:8,layout:struct([u32("instruction"),ns64("space")])},AllocateWithSeed:{index:9,layout:struct([u32("instruction"),publicKey("base"),rustString("seed"),ns64("space"),publicKey("programId")])},AssignWithSeed:{index:10,layout:struct([u32("instruction"),publicKey("base"),rustString("seed"),publicKey("programId")])},TransferWithSeed:{index:11,layout:struct([u32("instruction"),u64("lamports"),rustString("seed"),publicKey("programId")])},UpgradeNonceAccount:{index:12,layout:struct([u32("instruction")])}});class SystemProgram{constructor(){}static createAccount(j){const $=SYSTEM_INSTRUCTION_LAYOUTS.Create,_e=encodeData($,{lamports:j.lamports,space:j.space,programId:toBuffer(j.programId.toBuffer())});return new TransactionInstruction({keys:[{pubkey:j.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:j.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:_e})}static transfer(j){let $,_e;if("basePubkey"in j){const et=SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed;$=encodeData(et,{lamports:BigInt(j.lamports),seed:j.seed,programId:toBuffer(j.programId.toBuffer())}),_e=[{pubkey:j.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:j.basePubkey,isSigner:!0,isWritable:!1},{pubkey:j.toPubkey,isSigner:!1,isWritable:!0}]}else{const et=SYSTEM_INSTRUCTION_LAYOUTS.Transfer;$=encodeData(et,{lamports:BigInt(j.lamports)}),_e=[{pubkey:j.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:j.toPubkey,isSigner:!1,isWritable:!0}]}return new TransactionInstruction({keys:_e,programId:this.programId,data:$})}static assign(j){let $,_e;if("basePubkey"in j){const et=SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed;$=encodeData(et,{base:toBuffer(j.basePubkey.toBuffer()),seed:j.seed,programId:toBuffer(j.programId.toBuffer())}),_e=[{pubkey:j.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:j.basePubkey,isSigner:!0,isWritable:!1}]}else{const et=SYSTEM_INSTRUCTION_LAYOUTS.Assign;$=encodeData(et,{programId:toBuffer(j.programId.toBuffer())}),_e=[{pubkey:j.accountPubkey,isSigner:!0,isWritable:!0}]}return new TransactionInstruction({keys:_e,programId:this.programId,data:$})}static createAccountWithSeed(j){const $=SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed,_e=encodeData($,{base:toBuffer(j.basePubkey.toBuffer()),seed:j.seed,lamports:j.lamports,space:j.space,programId:toBuffer(j.programId.toBuffer())});let et=[{pubkey:j.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:j.newAccountPubkey,isSigner:!1,isWritable:!0}];return j.basePubkey!=j.fromPubkey&&et.push({pubkey:j.basePubkey,isSigner:!0,isWritable:!1}),new TransactionInstruction({keys:et,programId:this.programId,data:_e})}static createNonceAccount(j){const $=new Transaction;"basePubkey"in j&&"seed"in j?$.add(SystemProgram.createAccountWithSeed({fromPubkey:j.fromPubkey,newAccountPubkey:j.noncePubkey,basePubkey:j.basePubkey,seed:j.seed,lamports:j.lamports,space:NONCE_ACCOUNT_LENGTH,programId:this.programId})):$.add(SystemProgram.createAccount({fromPubkey:j.fromPubkey,newAccountPubkey:j.noncePubkey,lamports:j.lamports,space:NONCE_ACCOUNT_LENGTH,programId:this.programId}));const _e={noncePubkey:j.noncePubkey,authorizedPubkey:j.authorizedPubkey};return $.add(this.nonceInitialize(_e)),$}static nonceInitialize(j){const $=SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount,_e=encodeData($,{authorized:toBuffer(j.authorizedPubkey.toBuffer())}),et={keys:[{pubkey:j.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_RECENT_BLOCKHASHES_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:SYSVAR_RENT_PUBKEY,isSigner:!1,isWritable:!1}],programId:this.programId,data:_e};return new TransactionInstruction(et)}static nonceAdvance(j){const $=SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount,_e=encodeData($),et={keys:[{pubkey:j.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_RECENT_BLOCKHASHES_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:j.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:_e};return new TransactionInstruction(et)}static nonceWithdraw(j){const $=SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount,_e=encodeData($,{lamports:j.lamports});return new TransactionInstruction({keys:[{pubkey:j.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:j.toPubkey,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_RECENT_BLOCKHASHES_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:SYSVAR_RENT_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:j.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:_e})}static nonceAuthorize(j){const $=SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount,_e=encodeData($,{authorized:toBuffer(j.newAuthorizedPubkey.toBuffer())});return new TransactionInstruction({keys:[{pubkey:j.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:j.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:_e})}static allocate(j){let $,_e;if("basePubkey"in j){const et=SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed;$=encodeData(et,{base:toBuffer(j.basePubkey.toBuffer()),seed:j.seed,space:j.space,programId:toBuffer(j.programId.toBuffer())}),_e=[{pubkey:j.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:j.basePubkey,isSigner:!0,isWritable:!1}]}else{const et=SYSTEM_INSTRUCTION_LAYOUTS.Allocate;$=encodeData(et,{space:j.space}),_e=[{pubkey:j.accountPubkey,isSigner:!0,isWritable:!0}]}return new TransactionInstruction({keys:_e,programId:this.programId,data:$})}}SystemProgram.programId=new PublicKey("11111111111111111111111111111111");const CHUNK_SIZE=PACKET_DATA_SIZE-300;class Loader{constructor(){}static getMinNumSignatures(j){return 2*(Math.ceil(j/Loader.chunkSize)+1+1)}static async load(j,$,_e,et,tt){{const at=await j.getMinimumBalanceForRentExemption(tt.length),ct=await j.getAccountInfo(_e.publicKey,"confirmed");let lt=null;if(ct!==null){if(ct.executable)return console.error("Program load failed, account is already executable"),!1;ct.data.length!==tt.length&&(lt=lt||new Transaction,lt.add(SystemProgram.allocate({accountPubkey:_e.publicKey,space:tt.length}))),ct.owner.equals(et)||(lt=lt||new Transaction,lt.add(SystemProgram.assign({accountPubkey:_e.publicKey,programId:et}))),ct.lamports0?at:1,space:tt.length,programId:et}));lt!==null&&await sendAndConfirmTransaction(j,lt,[$,_e],{commitment:"confirmed"})}const nt=struct([u32("instruction"),u32("offset"),u32("bytesLength"),u32("bytesLengthPadding"),seq(u8("byte"),offset(u32(),-8),"bytes")]),rt=Loader.chunkSize;let ot=0,it=tt,st=[];for(;it.length>0;){const at=it.slice(0,rt),ct=buffer.Buffer.alloc(rt+16);nt.encode({instruction:0,offset:ot,bytes:at,bytesLength:0,bytesLengthPadding:0},ct);const lt=new Transaction().add({keys:[{pubkey:_e.publicKey,isSigner:!0,isWritable:!0}],programId:et,data:ct});st.push(sendAndConfirmTransaction(j,lt,[$,_e],{commitment:"confirmed"})),j._rpcEndpoint.includes("solana.com")&&await sleep(1e3/4),ot+=rt,it=it.slice(rt)}await Promise.all(st);{const at=struct([u32("instruction")]),ct=buffer.Buffer.alloc(at.span);at.encode({instruction:1},ct);const lt=new Transaction().add({keys:[{pubkey:_e.publicKey,isSigner:!0,isWritable:!0},{pubkey:SYSVAR_RENT_PUBKEY,isSigner:!1,isWritable:!1}],programId:et,data:ct}),dt="processed",ft=await j.sendTransaction(lt,[$,_e],{preflightCommitment:dt}),{context:gt,value:ht}=await j.confirmTransaction({signature:ft,lastValidBlockHeight:lt.lastValidBlockHeight,blockhash:lt.recentBlockhash},dt);if(ht.err)throw new Error(`Transaction ${ft} failed (${JSON.stringify(ht)})`);for(;;){try{if(await j.getSlot({commitment:dt})>gt.slot)break}catch{}await new Promise(yt=>setTimeout(yt,Math.round(MS_PER_SLOT/2)))}}return!0}}Loader.chunkSize=CHUNK_SIZE;const BPF_LOADER_PROGRAM_ID=new PublicKey("BPFLoader2111111111111111111111111111111111");class BpfLoader{static getMinNumSignatures(j){return Loader.getMinNumSignatures(j)}static load(j,$,_e,et,tt){return Loader.load(j,$,_e,tt,et)}}function getDefaultExportFromCjs(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var objToString=Object.prototype.toString,objKeys=Object.keys||function(s){var j=[];for(var $ in s)j.push($);return j};function stringify(s,j){var $,_e,et,tt,nt,rt,ot;if(s===!0)return"true";if(s===!1)return"false";switch(typeof s){case"object":if(s===null)return null;if(s.toJSON&&typeof s.toJSON=="function")return stringify(s.toJSON(),j);if(ot=objToString.call(s),ot==="[object Array]"){for(et="[",_e=s.length-1,$=0;$<_e;$++)et+=stringify(s[$],!0)+",";return _e>-1&&(et+=stringify(s[$],!0)),et+"]"}else if(ot==="[object Object]"){for(tt=objKeys(s).sort(),_e=tt.length,et="",$=0;$<_e;)nt=tt[$],rt=stringify(s[nt],!1),rt!==void 0&&(et&&(et+=","),et+=JSON.stringify(nt)+":"+rt),$++;return"{"+et+"}"}else return JSON.stringify(s);case"function":case"undefined":return j?null:void 0;case"string":return JSON.stringify(s);default:return isFinite(s)?s:null}}var fastStableStringify=function(s){var j=stringify(s,!1);if(j!==void 0)return""+j},fastStableStringify$1=getDefaultExportFromCjs(fastStableStringify);const MINIMUM_SLOT_PER_EPOCH=32;function trailingZeros(s){let j=0;for(;s>1;)s/=2,j++;return j}function nextPowerOfTwo(s){return s===0?1:(s--,s|=s>>1,s|=s>>2,s|=s>>4,s|=s>>8,s|=s>>16,s|=s>>32,s+1)}class EpochSchedule{constructor(j,$,_e,et,tt){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=j,this.leaderScheduleSlotOffset=$,this.warmup=_e,this.firstNormalEpoch=et,this.firstNormalSlot=tt}getEpoch(j){return this.getEpochAndSlotIndex(j)[0]}getEpochAndSlotIndex(j){if(j{const nt=_default(tt,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...$});return"socket"in nt?this.underlyingSocket=nt.socket:this.underlyingSocket=nt,nt};super(et,j,$,_e),this.underlyingSocket=void 0}call(...j){var _e;const $=(_e=this.underlyingSocket)==null?void 0:_e.readyState;return $===1?super.call(...j):Promise.reject(new Error("Tried to call a JSON-RPC method `"+j[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+$+")"))}notify(...j){var _e;const $=(_e=this.underlyingSocket)==null?void 0:_e.readyState;return $===1?super.notify(...j):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+j[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+$+")"))}}function decodeData(s,j){let $;try{$=s.layout.decode(j)}catch(_e){throw new Error("invalid instruction; "+_e)}if($.typeIndex!==s.index)throw new Error(`invalid account data; account type mismatch ${$.typeIndex} != ${s.index}`);return $}const LOOKUP_TABLE_META_SIZE=56;class AddressLookupTableAccount{constructor(j){this.key=void 0,this.state=void 0,this.key=j.key,this.state=j.state}isActive(){const j=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===j}static deserialize(j){const $=decodeData(LookupTableMetaLayout,j),_e=j.length-LOOKUP_TABLE_META_SIZE;assert(_e>=0,"lookup table is invalid"),assert(_e%32===0,"lookup table is invalid");const et=_e/32,{addresses:tt}=struct([seq(publicKey(),et,"addresses")]).decode(j.slice(LOOKUP_TABLE_META_SIZE));return{deactivationSlot:$.deactivationSlot,lastExtendedSlot:$.lastExtendedSlot,lastExtendedSlotStartIndex:$.lastExtendedStartIndex,authority:$.authority.length!==0?new PublicKey($.authority[0]):void 0,addresses:tt.map(nt=>new PublicKey(nt))}}}const LookupTableMetaLayout={index:1,layout:struct([u32("typeIndex"),u64("deactivationSlot"),nu64("lastExtendedSlot"),u8("lastExtendedStartIndex"),u8(),seq(publicKey(),offset(u8(),-1),"authority")])},URL_RE=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function makeWebsocketUrl(s){const j=s.match(URL_RE);if(j==null)throw TypeError(`Failed to validate endpoint URL \`${s}\``);const[$,_e,et,tt]=j,nt=s.startsWith("https:")?"wss:":"ws:",rt=et==null?null:parseInt(et.slice(1),10),ot=rt==null?"":`:${rt+1}`;return`${nt}//${_e}${ot}${tt}`}const PublicKeyFromString=coerce(instance(PublicKey),string$1(),s=>new PublicKey(s)),RawAccountDataResult=tuple([string$1(),literal("base64")]),BufferFromRawAccountData=coerce(instance(buffer.Buffer),RawAccountDataResult,s=>buffer.Buffer.from(s[0],"base64")),BLOCKHASH_CACHE_TIMEOUT_MS=30*1e3;function assertEndpointUrl(s){if(/^https?:/.test(s)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return s}function extractCommitmentFromConfig(s){let j,$;if(typeof s=="string")j=s;else if(s){const{commitment:_e,...et}=s;j=_e,$=et}return{commitment:j,config:$}}function createRpcResult(s){return union([type({jsonrpc:literal("2.0"),id:string$1(),result:s}),type({jsonrpc:literal("2.0"),id:string$1(),error:type({code:unknown(),message:string$1(),data:optional(any())})})])}const UnknownRpcResult=createRpcResult(unknown());function jsonRpcResult(s){return coerce(createRpcResult(s),UnknownRpcResult,j=>"error"in j?j:{...j,result:create$4(j.result,s)})}function jsonRpcResultAndContext(s){return jsonRpcResult(type({context:type({slot:number()}),value:s}))}function notificationResultAndContext(s){return type({context:type({slot:number()}),value:s})}function versionedMessageFromResponse(s,j){return s===0?new MessageV0({header:j.header,staticAccountKeys:j.accountKeys.map($=>new PublicKey($)),recentBlockhash:j.recentBlockhash,compiledInstructions:j.instructions.map($=>({programIdIndex:$.programIdIndex,accountKeyIndexes:$.accounts,data:base58.decode($.data)})),addressTableLookups:j.addressTableLookups}):new Message(j)}const GetInflationGovernorResult=type({foundation:number(),foundationTerm:number(),initial:number(),taper:number(),terminal:number()}),GetInflationRewardResult=jsonRpcResult(array$1(nullable(type({epoch:number(),effectiveSlot:number(),amount:number(),postBalance:number(),commission:optional(nullable(number()))})))),GetRecentPrioritizationFeesResult=array$1(type({slot:number(),prioritizationFee:number()})),GetInflationRateResult=type({total:number(),validator:number(),foundation:number(),epoch:number()}),GetEpochInfoResult=type({epoch:number(),slotIndex:number(),slotsInEpoch:number(),absoluteSlot:number(),blockHeight:optional(number()),transactionCount:optional(number())}),GetEpochScheduleResult=type({slotsPerEpoch:number(),leaderScheduleSlotOffset:number(),warmup:boolean$1(),firstNormalEpoch:number(),firstNormalSlot:number()}),GetLeaderScheduleResult=record(string$1(),array$1(number())),TransactionErrorResult=nullable(union([type({}),string$1()])),SignatureStatusResult=type({err:TransactionErrorResult}),SignatureReceivedResult=literal("receivedSignature"),VersionResult=type({"solana-core":string$1(),"feature-set":optional(number())}),SimulatedTransactionResponseStruct=jsonRpcResultAndContext(type({err:nullable(union([type({}),string$1()])),logs:nullable(array$1(string$1())),accounts:optional(nullable(array$1(nullable(type({executable:boolean$1(),owner:string$1(),lamports:number(),data:array$1(string$1()),rentEpoch:optional(number())}))))),unitsConsumed:optional(number()),returnData:optional(nullable(type({programId:string$1(),data:tuple([string$1(),literal("base64")])})))})),BlockProductionResponseStruct=jsonRpcResultAndContext(type({byIdentity:record(string$1(),array$1(number())),range:type({firstSlot:number(),lastSlot:number()})}));function createRpcClient(s,j,$,_e,et,tt){const nt=$||fetchImpl;let rt;tt!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let ot;return _e&&(ot=async(st,at)=>{const ct=await new Promise((lt,dt)=>{try{_e(st,at,(ft,gt)=>lt([ft,gt]))}catch(ft){dt(ft)}});return await nt(...ct)}),new RpcClient(async(st,at)=>{const ct={method:"POST",body:st,agent:rt,headers:Object.assign({"Content-Type":"application/json"},j||{},COMMON_HTTP_HEADERS)};try{let lt=5,dt,ft=500;for(;ot?dt=await ot(s,ct):dt=await nt(s,ct),!(dt.status!==429||et===!0||(lt-=1,lt===0));)console.error(`Server responded with ${dt.status} ${dt.statusText}. Retrying after ${ft}ms delay...`),await sleep(ft),ft*=2;const gt=await dt.text();dt.ok?at(null,gt):at(new Error(`${dt.status} ${dt.statusText}: ${gt}`))}catch(lt){lt instanceof Error&&at(lt)}},{})}function createRpcRequest(s){return(j,$)=>new Promise((_e,et)=>{s.request(j,$,(tt,nt)=>{if(tt){et(tt);return}_e(nt)})})}function createRpcBatchRequest(s){return j=>new Promise(($,_e)=>{j.length===0&&$([]);const et=j.map(tt=>s.request(tt.methodName,tt.args));s.request(et,(tt,nt)=>{if(tt){_e(tt);return}$(nt)})})}const GetInflationGovernorRpcResult=jsonRpcResult(GetInflationGovernorResult),GetInflationRateRpcResult=jsonRpcResult(GetInflationRateResult),GetRecentPrioritizationFeesRpcResult=jsonRpcResult(GetRecentPrioritizationFeesResult),GetEpochInfoRpcResult=jsonRpcResult(GetEpochInfoResult),GetEpochScheduleRpcResult=jsonRpcResult(GetEpochScheduleResult),GetLeaderScheduleRpcResult=jsonRpcResult(GetLeaderScheduleResult),SlotRpcResult=jsonRpcResult(number()),GetSupplyRpcResult=jsonRpcResultAndContext(type({total:number(),circulating:number(),nonCirculating:number(),nonCirculatingAccounts:array$1(PublicKeyFromString)})),TokenAmountResult=type({amount:string$1(),uiAmount:nullable(number()),decimals:number(),uiAmountString:optional(string$1())}),GetTokenLargestAccountsResult=jsonRpcResultAndContext(array$1(type({address:PublicKeyFromString,amount:string$1(),uiAmount:nullable(number()),decimals:number(),uiAmountString:optional(string$1())}))),GetTokenAccountsByOwner=jsonRpcResultAndContext(array$1(type({pubkey:PublicKeyFromString,account:type({executable:boolean$1(),owner:PublicKeyFromString,lamports:number(),data:BufferFromRawAccountData,rentEpoch:number()})}))),ParsedAccountDataResult=type({program:string$1(),parsed:unknown(),space:number()}),GetParsedTokenAccountsByOwner=jsonRpcResultAndContext(array$1(type({pubkey:PublicKeyFromString,account:type({executable:boolean$1(),owner:PublicKeyFromString,lamports:number(),data:ParsedAccountDataResult,rentEpoch:number()})}))),GetLargestAccountsRpcResult=jsonRpcResultAndContext(array$1(type({lamports:number(),address:PublicKeyFromString}))),AccountInfoResult=type({executable:boolean$1(),owner:PublicKeyFromString,lamports:number(),data:BufferFromRawAccountData,rentEpoch:number()}),KeyedAccountInfoResult=type({pubkey:PublicKeyFromString,account:AccountInfoResult}),ParsedOrRawAccountData=coerce(union([instance(buffer.Buffer),ParsedAccountDataResult]),union([RawAccountDataResult,ParsedAccountDataResult]),s=>Array.isArray(s)?create$4(s,BufferFromRawAccountData):s),ParsedAccountInfoResult=type({executable:boolean$1(),owner:PublicKeyFromString,lamports:number(),data:ParsedOrRawAccountData,rentEpoch:number()}),KeyedParsedAccountInfoResult=type({pubkey:PublicKeyFromString,account:ParsedAccountInfoResult}),StakeActivationResult=type({state:union([literal("active"),literal("inactive"),literal("activating"),literal("deactivating")]),active:number(),inactive:number()}),GetConfirmedSignaturesForAddress2RpcResult=jsonRpcResult(array$1(type({signature:string$1(),slot:number(),err:TransactionErrorResult,memo:nullable(string$1()),blockTime:optional(nullable(number()))}))),GetSignaturesForAddressRpcResult=jsonRpcResult(array$1(type({signature:string$1(),slot:number(),err:TransactionErrorResult,memo:nullable(string$1()),blockTime:optional(nullable(number()))}))),AccountNotificationResult=type({subscription:number(),result:notificationResultAndContext(AccountInfoResult)}),ProgramAccountInfoResult=type({pubkey:PublicKeyFromString,account:AccountInfoResult}),ProgramAccountNotificationResult=type({subscription:number(),result:notificationResultAndContext(ProgramAccountInfoResult)}),SlotInfoResult=type({parent:number(),slot:number(),root:number()}),SlotNotificationResult=type({subscription:number(),result:SlotInfoResult}),SlotUpdateResult=union([type({type:union([literal("firstShredReceived"),literal("completed"),literal("optimisticConfirmation"),literal("root")]),slot:number(),timestamp:number()}),type({type:literal("createdBank"),parent:number(),slot:number(),timestamp:number()}),type({type:literal("frozen"),slot:number(),timestamp:number(),stats:type({numTransactionEntries:number(),numSuccessfulTransactions:number(),numFailedTransactions:number(),maxTransactionsPerEntry:number()})}),type({type:literal("dead"),slot:number(),timestamp:number(),err:string$1()})]),SlotUpdateNotificationResult=type({subscription:number(),result:SlotUpdateResult}),SignatureNotificationResult=type({subscription:number(),result:notificationResultAndContext(union([SignatureStatusResult,SignatureReceivedResult]))}),RootNotificationResult=type({subscription:number(),result:number()}),ContactInfoResult=type({pubkey:string$1(),gossip:nullable(string$1()),tpu:nullable(string$1()),rpc:nullable(string$1()),version:nullable(string$1())}),VoteAccountInfoResult=type({votePubkey:string$1(),nodePubkey:string$1(),activatedStake:number(),epochVoteAccount:boolean$1(),epochCredits:array$1(tuple([number(),number(),number()])),commission:number(),lastVote:number(),rootSlot:nullable(number())}),GetVoteAccounts=jsonRpcResult(type({current:array$1(VoteAccountInfoResult),delinquent:array$1(VoteAccountInfoResult)})),ConfirmationStatus=union([literal("processed"),literal("confirmed"),literal("finalized")]),SignatureStatusResponse=type({slot:number(),confirmations:nullable(number()),err:TransactionErrorResult,confirmationStatus:optional(ConfirmationStatus)}),GetSignatureStatusesRpcResult=jsonRpcResultAndContext(array$1(nullable(SignatureStatusResponse))),GetMinimumBalanceForRentExemptionRpcResult=jsonRpcResult(number()),AddressTableLookupStruct=type({accountKey:PublicKeyFromString,writableIndexes:array$1(number()),readonlyIndexes:array$1(number())}),ConfirmedTransactionResult=type({signatures:array$1(string$1()),message:type({accountKeys:array$1(string$1()),header:type({numRequiredSignatures:number(),numReadonlySignedAccounts:number(),numReadonlyUnsignedAccounts:number()}),instructions:array$1(type({accounts:array$1(number()),data:string$1(),programIdIndex:number()})),recentBlockhash:string$1(),addressTableLookups:optional(array$1(AddressTableLookupStruct))})}),AnnotatedAccountKey=type({pubkey:PublicKeyFromString,signer:boolean$1(),writable:boolean$1(),source:optional(union([literal("transaction"),literal("lookupTable")]))}),ConfirmedTransactionAccountsModeResult=type({accountKeys:array$1(AnnotatedAccountKey),signatures:array$1(string$1())}),ParsedInstructionResult=type({parsed:unknown(),program:string$1(),programId:PublicKeyFromString}),RawInstructionResult=type({accounts:array$1(PublicKeyFromString),data:string$1(),programId:PublicKeyFromString}),InstructionResult=union([RawInstructionResult,ParsedInstructionResult]),UnknownInstructionResult=union([type({parsed:unknown(),program:string$1(),programId:string$1()}),type({accounts:array$1(string$1()),data:string$1(),programId:string$1()})]),ParsedOrRawInstruction=coerce(InstructionResult,UnknownInstructionResult,s=>"accounts"in s?create$4(s,RawInstructionResult):create$4(s,ParsedInstructionResult)),ParsedConfirmedTransactionResult=type({signatures:array$1(string$1()),message:type({accountKeys:array$1(AnnotatedAccountKey),instructions:array$1(ParsedOrRawInstruction),recentBlockhash:string$1(),addressTableLookups:optional(nullable(array$1(AddressTableLookupStruct)))})}),TokenBalanceResult=type({accountIndex:number(),mint:string$1(),owner:optional(string$1()),uiTokenAmount:TokenAmountResult}),LoadedAddressesResult=type({writable:array$1(PublicKeyFromString),readonly:array$1(PublicKeyFromString)}),ConfirmedTransactionMetaResult=type({err:TransactionErrorResult,fee:number(),innerInstructions:optional(nullable(array$1(type({index:number(),instructions:array$1(type({accounts:array$1(number()),data:string$1(),programIdIndex:number()}))})))),preBalances:array$1(number()),postBalances:array$1(number()),logMessages:optional(nullable(array$1(string$1()))),preTokenBalances:optional(nullable(array$1(TokenBalanceResult))),postTokenBalances:optional(nullable(array$1(TokenBalanceResult))),loadedAddresses:optional(LoadedAddressesResult),computeUnitsConsumed:optional(number())}),ParsedConfirmedTransactionMetaResult=type({err:TransactionErrorResult,fee:number(),innerInstructions:optional(nullable(array$1(type({index:number(),instructions:array$1(ParsedOrRawInstruction)})))),preBalances:array$1(number()),postBalances:array$1(number()),logMessages:optional(nullable(array$1(string$1()))),preTokenBalances:optional(nullable(array$1(TokenBalanceResult))),postTokenBalances:optional(nullable(array$1(TokenBalanceResult))),loadedAddresses:optional(LoadedAddressesResult),computeUnitsConsumed:optional(number())}),TransactionVersionStruct=union([literal(0),literal("legacy")]),RewardsResult=type({pubkey:string$1(),lamports:number(),postBalance:nullable(number()),rewardType:nullable(string$1()),commission:optional(nullable(number()))}),GetBlockRpcResult=jsonRpcResult(nullable(type({blockhash:string$1(),previousBlockhash:string$1(),parentSlot:number(),transactions:array$1(type({transaction:ConfirmedTransactionResult,meta:nullable(ConfirmedTransactionMetaResult),version:optional(TransactionVersionStruct)})),rewards:optional(array$1(RewardsResult)),blockTime:nullable(number()),blockHeight:nullable(number())}))),GetNoneModeBlockRpcResult=jsonRpcResult(nullable(type({blockhash:string$1(),previousBlockhash:string$1(),parentSlot:number(),rewards:optional(array$1(RewardsResult)),blockTime:nullable(number()),blockHeight:nullable(number())}))),GetAccountsModeBlockRpcResult=jsonRpcResult(nullable(type({blockhash:string$1(),previousBlockhash:string$1(),parentSlot:number(),transactions:array$1(type({transaction:ConfirmedTransactionAccountsModeResult,meta:nullable(ConfirmedTransactionMetaResult),version:optional(TransactionVersionStruct)})),rewards:optional(array$1(RewardsResult)),blockTime:nullable(number()),blockHeight:nullable(number())}))),GetParsedBlockRpcResult=jsonRpcResult(nullable(type({blockhash:string$1(),previousBlockhash:string$1(),parentSlot:number(),transactions:array$1(type({transaction:ParsedConfirmedTransactionResult,meta:nullable(ParsedConfirmedTransactionMetaResult),version:optional(TransactionVersionStruct)})),rewards:optional(array$1(RewardsResult)),blockTime:nullable(number()),blockHeight:nullable(number())}))),GetParsedAccountsModeBlockRpcResult=jsonRpcResult(nullable(type({blockhash:string$1(),previousBlockhash:string$1(),parentSlot:number(),transactions:array$1(type({transaction:ConfirmedTransactionAccountsModeResult,meta:nullable(ParsedConfirmedTransactionMetaResult),version:optional(TransactionVersionStruct)})),rewards:optional(array$1(RewardsResult)),blockTime:nullable(number()),blockHeight:nullable(number())}))),GetParsedNoneModeBlockRpcResult=jsonRpcResult(nullable(type({blockhash:string$1(),previousBlockhash:string$1(),parentSlot:number(),rewards:optional(array$1(RewardsResult)),blockTime:nullable(number()),blockHeight:nullable(number())}))),GetConfirmedBlockRpcResult=jsonRpcResult(nullable(type({blockhash:string$1(),previousBlockhash:string$1(),parentSlot:number(),transactions:array$1(type({transaction:ConfirmedTransactionResult,meta:nullable(ConfirmedTransactionMetaResult)})),rewards:optional(array$1(RewardsResult)),blockTime:nullable(number())}))),GetBlockSignaturesRpcResult=jsonRpcResult(nullable(type({blockhash:string$1(),previousBlockhash:string$1(),parentSlot:number(),signatures:array$1(string$1()),blockTime:nullable(number())}))),GetTransactionRpcResult=jsonRpcResult(nullable(type({slot:number(),meta:nullable(ConfirmedTransactionMetaResult),blockTime:optional(nullable(number())),transaction:ConfirmedTransactionResult,version:optional(TransactionVersionStruct)}))),GetParsedTransactionRpcResult=jsonRpcResult(nullable(type({slot:number(),transaction:ParsedConfirmedTransactionResult,meta:nullable(ParsedConfirmedTransactionMetaResult),blockTime:optional(nullable(number())),version:optional(TransactionVersionStruct)}))),GetRecentBlockhashAndContextRpcResult=jsonRpcResultAndContext(type({blockhash:string$1(),feeCalculator:type({lamportsPerSignature:number()})})),GetLatestBlockhashRpcResult=jsonRpcResultAndContext(type({blockhash:string$1(),lastValidBlockHeight:number()})),IsBlockhashValidRpcResult=jsonRpcResultAndContext(boolean$1()),PerfSampleResult=type({slot:number(),numTransactions:number(),numSlots:number(),samplePeriodSecs:number()}),GetRecentPerformanceSamplesRpcResult=jsonRpcResult(array$1(PerfSampleResult)),GetFeeCalculatorRpcResult=jsonRpcResultAndContext(nullable(type({feeCalculator:type({lamportsPerSignature:number()})}))),RequestAirdropRpcResult=jsonRpcResult(string$1()),SendTransactionRpcResult=jsonRpcResult(string$1()),LogsResult=type({err:TransactionErrorResult,logs:array$1(string$1()),signature:string$1()}),LogsNotificationResult=type({result:notificationResultAndContext(LogsResult),subscription:number()}),COMMON_HTTP_HEADERS={"solana-client":"js/0.0.0-development"};class Connection{constructor(j,$){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const it={};return async st=>{const{commitment:at,config:ct}=extractCommitmentFromConfig(st),lt=this._buildArgs([],at,void 0,ct),dt=fastStableStringify$1(lt);return it[dt]=it[dt]??(async()=>{try{const ft=await this._rpcRequest("getBlockHeight",lt),gt=create$4(ft,jsonRpcResult(number()));if("error"in gt)throw new SolanaJSONRPCError(gt.error,"failed to get block height information");return gt.result}finally{delete it[dt]}})(),await it[dt]}})();let _e,et,tt,nt,rt,ot;$&&typeof $=="string"?this._commitment=$:$&&(this._commitment=$.commitment,this._confirmTransactionInitialTimeout=$.confirmTransactionInitialTimeout,_e=$.wsEndpoint,et=$.httpHeaders,tt=$.fetch,nt=$.fetchMiddleware,rt=$.disableRetryOnRateLimit,ot=$.httpAgent),this._rpcEndpoint=assertEndpointUrl(j),this._rpcWsEndpoint=_e||makeWebsocketUrl(j),this._rpcClient=createRpcClient(j,et,tt,nt,rt,ot),this._rpcRequest=createRpcRequest(this._rpcClient),this._rpcBatchRequest=createRpcBatchRequest(this._rpcClient),this._rpcWebSocket=new RpcWebSocketClient(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=this._buildArgs([j.toBase58()],_e,void 0,et),nt=await this._rpcRequest("getBalance",tt),rt=create$4(nt,jsonRpcResultAndContext(number()));if("error"in rt)throw new SolanaJSONRPCError(rt.error,`failed to get balance for ${j.toBase58()}`);return rt.result}async getBalance(j,$){return await this.getBalanceAndContext(j,$).then(_e=>_e.value).catch(_e=>{throw new Error("failed to get balance of account "+j.toBase58()+": "+_e)})}async getBlockTime(j){const $=await this._rpcRequest("getBlockTime",[j]),_e=create$4($,jsonRpcResult(nullable(number())));if("error"in _e)throw new SolanaJSONRPCError(_e.error,`failed to get block time for slot ${j}`);return _e.result}async getMinimumLedgerSlot(){const j=await this._rpcRequest("minimumLedgerSlot",[]),$=create$4(j,jsonRpcResult(number()));if("error"in $)throw new SolanaJSONRPCError($.error,"failed to get minimum ledger slot");return $.result}async getFirstAvailableBlock(){const j=await this._rpcRequest("getFirstAvailableBlock",[]),$=create$4(j,SlotRpcResult);if("error"in $)throw new SolanaJSONRPCError($.error,"failed to get first available block");return $.result}async getSupply(j){let $={};typeof j=="string"?$={commitment:j}:j?$={...j,commitment:j&&j.commitment||this.commitment}:$={commitment:this.commitment};const _e=await this._rpcRequest("getSupply",[$]),et=create$4(_e,GetSupplyRpcResult);if("error"in et)throw new SolanaJSONRPCError(et.error,"failed to get supply");return et.result}async getTokenSupply(j,$){const _e=this._buildArgs([j.toBase58()],$),et=await this._rpcRequest("getTokenSupply",_e),tt=create$4(et,jsonRpcResultAndContext(TokenAmountResult));if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get token supply");return tt.result}async getTokenAccountBalance(j,$){const _e=this._buildArgs([j.toBase58()],$),et=await this._rpcRequest("getTokenAccountBalance",_e),tt=create$4(et,jsonRpcResultAndContext(TokenAmountResult));if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get token account balance");return tt.result}async getTokenAccountsByOwner(j,$,_e){const{commitment:et,config:tt}=extractCommitmentFromConfig(_e);let nt=[j.toBase58()];"mint"in $?nt.push({mint:$.mint.toBase58()}):nt.push({programId:$.programId.toBase58()});const rt=this._buildArgs(nt,et,"base64",tt),ot=await this._rpcRequest("getTokenAccountsByOwner",rt),it=create$4(ot,GetTokenAccountsByOwner);if("error"in it)throw new SolanaJSONRPCError(it.error,`failed to get token accounts owned by account ${j.toBase58()}`);return it.result}async getParsedTokenAccountsByOwner(j,$,_e){let et=[j.toBase58()];"mint"in $?et.push({mint:$.mint.toBase58()}):et.push({programId:$.programId.toBase58()});const tt=this._buildArgs(et,_e,"jsonParsed"),nt=await this._rpcRequest("getTokenAccountsByOwner",tt),rt=create$4(nt,GetParsedTokenAccountsByOwner);if("error"in rt)throw new SolanaJSONRPCError(rt.error,`failed to get token accounts owned by account ${j.toBase58()}`);return rt.result}async getLargestAccounts(j){const $={...j,commitment:j&&j.commitment||this.commitment},_e=$.filter||$.commitment?[$]:[],et=await this._rpcRequest("getLargestAccounts",_e),tt=create$4(et,GetLargestAccountsRpcResult);if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get largest accounts");return tt.result}async getTokenLargestAccounts(j,$){const _e=this._buildArgs([j.toBase58()],$),et=await this._rpcRequest("getTokenLargestAccounts",_e),tt=create$4(et,GetTokenLargestAccountsResult);if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get token largest accounts");return tt.result}async getAccountInfoAndContext(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=this._buildArgs([j.toBase58()],_e,"base64",et),nt=await this._rpcRequest("getAccountInfo",tt),rt=create$4(nt,jsonRpcResultAndContext(nullable(AccountInfoResult)));if("error"in rt)throw new SolanaJSONRPCError(rt.error,`failed to get info about account ${j.toBase58()}`);return rt.result}async getParsedAccountInfo(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=this._buildArgs([j.toBase58()],_e,"jsonParsed",et),nt=await this._rpcRequest("getAccountInfo",tt),rt=create$4(nt,jsonRpcResultAndContext(nullable(ParsedAccountInfoResult)));if("error"in rt)throw new SolanaJSONRPCError(rt.error,`failed to get info about account ${j.toBase58()}`);return rt.result}async getAccountInfo(j,$){try{return(await this.getAccountInfoAndContext(j,$)).value}catch(_e){throw new Error("failed to get info about account "+j.toBase58()+": "+_e)}}async getMultipleParsedAccounts(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=j.map(it=>it.toBase58()),nt=this._buildArgs([tt],_e,"jsonParsed",et),rt=await this._rpcRequest("getMultipleAccounts",nt),ot=create$4(rt,jsonRpcResultAndContext(array$1(nullable(ParsedAccountInfoResult))));if("error"in ot)throw new SolanaJSONRPCError(ot.error,`failed to get info for accounts ${tt}`);return ot.result}async getMultipleAccountsInfoAndContext(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=j.map(it=>it.toBase58()),nt=this._buildArgs([tt],_e,"base64",et),rt=await this._rpcRequest("getMultipleAccounts",nt),ot=create$4(rt,jsonRpcResultAndContext(array$1(nullable(AccountInfoResult))));if("error"in ot)throw new SolanaJSONRPCError(ot.error,`failed to get info for accounts ${tt}`);return ot.result}async getMultipleAccountsInfo(j,$){return(await this.getMultipleAccountsInfoAndContext(j,$)).value}async getStakeActivation(j,$,_e){const{commitment:et,config:tt}=extractCommitmentFromConfig($),nt=this._buildArgs([j.toBase58()],et,void 0,{...tt,epoch:_e??(tt==null?void 0:tt.epoch)}),rt=await this._rpcRequest("getStakeActivation",nt),ot=create$4(rt,jsonRpcResult(StakeActivationResult));if("error"in ot)throw new SolanaJSONRPCError(ot.error,`failed to get Stake Activation ${j.toBase58()}`);return ot.result}async getProgramAccounts(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),{encoding:tt,...nt}=et||{},rt=this._buildArgs([j.toBase58()],_e,tt||"base64",nt),ot=await this._rpcRequest("getProgramAccounts",rt),it=array$1(KeyedAccountInfoResult),st=nt.withContext===!0?create$4(ot,jsonRpcResultAndContext(it)):create$4(ot,jsonRpcResult(it));if("error"in st)throw new SolanaJSONRPCError(st.error,`failed to get accounts owned by program ${j.toBase58()}`);return st.result}async getParsedProgramAccounts(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=this._buildArgs([j.toBase58()],_e,"jsonParsed",et),nt=await this._rpcRequest("getProgramAccounts",tt),rt=create$4(nt,jsonRpcResult(array$1(KeyedParsedAccountInfoResult)));if("error"in rt)throw new SolanaJSONRPCError(rt.error,`failed to get accounts owned by program ${j.toBase58()}`);return rt.result}async confirmTransaction(j,$){var tt;let _e;if(typeof j=="string")_e=j;else{const nt=j;if((tt=nt.abortSignal)!=null&&tt.aborted)return Promise.reject(nt.abortSignal.reason);_e=nt.signature}let et;try{et=base58.decode(_e)}catch{throw new Error("signature must be base58 encoded: "+_e)}return assert(et.length===64,"signature has invalid length"),typeof j=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:$||this.commitment,signature:_e}):"lastValidBlockHeight"in j?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:$||this.commitment,strategy:j}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:$||this.commitment,strategy:j})}getCancellationPromise(j){return new Promise(($,_e)=>{j!=null&&(j.aborted?_e(j.reason):j.addEventListener("abort",()=>{_e(j.reason)}))})}getTransactionConfirmationPromise({commitment:j,signature:$}){let _e,et,tt=!1;const nt=new Promise((ot,it)=>{try{_e=this.onSignature($,(at,ct)=>{_e=void 0;const lt={context:ct,value:at};ot({__type:TransactionStatus.PROCESSED,response:lt})},j);const st=new Promise(at=>{_e==null?at():et=this._onSubscriptionStateChange(_e,ct=>{ct==="subscribed"&&at()})});(async()=>{if(await st,tt)return;const at=await this.getSignatureStatus($);if(tt||at==null)return;const{context:ct,value:lt}=at;if(lt!=null)if(lt!=null&<.err)it(lt.err);else{switch(j){case"confirmed":case"single":case"singleGossip":{if(lt.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(lt.confirmationStatus==="processed"||lt.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}tt=!0,ot({__type:TransactionStatus.PROCESSED,response:{context:ct,value:lt}})}})()}catch(st){it(st)}});return{abortConfirmation:()=>{et&&(et(),et=void 0),_e!=null&&(this.removeSignatureListener(_e),_e=void 0)},confirmationPromise:nt}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:j,strategy:{abortSignal:$,lastValidBlockHeight:_e,signature:et}}){let tt=!1;const nt=new Promise(at=>{const ct=async()=>{try{return await this.getBlockHeight(j)}catch{return-1}};(async()=>{let lt=await ct();if(!tt){for(;lt<=_e;)if(await sleep(1e3),tt||(lt=await ct(),tt))return;at({__type:TransactionStatus.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:rt,confirmationPromise:ot}=this.getTransactionConfirmationPromise({commitment:j,signature:et}),it=this.getCancellationPromise($);let st;try{const at=await Promise.race([it,ot,nt]);if(at.__type===TransactionStatus.PROCESSED)st=at.response;else throw new TransactionExpiredBlockheightExceededError(et)}finally{tt=!0,rt()}return st}async confirmTransactionUsingDurableNonceStrategy({commitment:j,strategy:{abortSignal:$,minContextSlot:_e,nonceAccountPubkey:et,nonceValue:tt,signature:nt}}){let rt=!1;const ot=new Promise(lt=>{let dt=tt,ft=null;const gt=async()=>{try{const{context:ht,value:yt}=await this.getNonceAndContext(et,{commitment:j,minContextSlot:_e});return ft=ht.slot,yt==null?void 0:yt.nonce}catch{return dt}};(async()=>{if(dt=await gt(),!rt)for(;;){if(tt!==dt){lt({__type:TransactionStatus.NONCE_INVALID,slotInWhichNonceDidAdvance:ft});return}if(await sleep(2e3),rt||(dt=await gt(),rt))return}})()}),{abortConfirmation:it,confirmationPromise:st}=this.getTransactionConfirmationPromise({commitment:j,signature:nt}),at=this.getCancellationPromise($);let ct;try{const lt=await Promise.race([at,st,ot]);if(lt.__type===TransactionStatus.PROCESSED)ct=lt.response;else{let dt;for(;;){const ft=await this.getSignatureStatus(nt);if(ft==null)break;if(ft.context.slot<(lt.slotInWhichNonceDidAdvance??_e)){await sleep(400);continue}dt=ft;break}if(dt!=null&&dt.value){const ft=j||"finalized",{confirmationStatus:gt}=dt.value;switch(ft){case"processed":case"recent":if(gt!=="processed"&>!=="confirmed"&>!=="finalized")throw new TransactionExpiredNonceInvalidError(nt);break;case"confirmed":case"single":case"singleGossip":if(gt!=="confirmed"&>!=="finalized")throw new TransactionExpiredNonceInvalidError(nt);break;case"finalized":case"max":case"root":if(gt!=="finalized")throw new TransactionExpiredNonceInvalidError(nt);break;default:}ct={context:dt.context,value:{err:dt.value.err}}}else throw new TransactionExpiredNonceInvalidError(nt)}}finally{rt=!0,it()}return ct}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:j,signature:$}){let _e;const et=new Promise(ot=>{let it=this._confirmTransactionInitialTimeout||6e4;switch(j){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{it=this._confirmTransactionInitialTimeout||3e4;break}}_e=setTimeout(()=>ot({__type:TransactionStatus.TIMED_OUT,timeoutMs:it}),it)}),{abortConfirmation:tt,confirmationPromise:nt}=this.getTransactionConfirmationPromise({commitment:j,signature:$});let rt;try{const ot=await Promise.race([nt,et]);if(ot.__type===TransactionStatus.PROCESSED)rt=ot.response;else throw new TransactionExpiredTimeoutError($,ot.timeoutMs/1e3)}finally{clearTimeout(_e),tt()}return rt}async getClusterNodes(){const j=await this._rpcRequest("getClusterNodes",[]),$=create$4(j,jsonRpcResult(array$1(ContactInfoResult)));if("error"in $)throw new SolanaJSONRPCError($.error,"failed to get cluster nodes");return $.result}async getVoteAccounts(j){const $=this._buildArgs([],j),_e=await this._rpcRequest("getVoteAccounts",$),et=create$4(_e,GetVoteAccounts);if("error"in et)throw new SolanaJSONRPCError(et.error,"failed to get vote accounts");return et.result}async getSlot(j){const{commitment:$,config:_e}=extractCommitmentFromConfig(j),et=this._buildArgs([],$,void 0,_e),tt=await this._rpcRequest("getSlot",et),nt=create$4(tt,jsonRpcResult(number()));if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get slot");return nt.result}async getSlotLeader(j){const{commitment:$,config:_e}=extractCommitmentFromConfig(j),et=this._buildArgs([],$,void 0,_e),tt=await this._rpcRequest("getSlotLeader",et),nt=create$4(tt,jsonRpcResult(string$1()));if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get slot leader");return nt.result}async getSlotLeaders(j,$){const _e=[j,$],et=await this._rpcRequest("getSlotLeaders",_e),tt=create$4(et,jsonRpcResult(array$1(PublicKeyFromString)));if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get slot leaders");return tt.result}async getSignatureStatus(j,$){const{context:_e,value:et}=await this.getSignatureStatuses([j],$);assert(et.length===1);const tt=et[0];return{context:_e,value:tt}}async getSignatureStatuses(j,$){const _e=[j];$&&_e.push($);const et=await this._rpcRequest("getSignatureStatuses",_e),tt=create$4(et,GetSignatureStatusesRpcResult);if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get signature status");return tt.result}async getTransactionCount(j){const{commitment:$,config:_e}=extractCommitmentFromConfig(j),et=this._buildArgs([],$,void 0,_e),tt=await this._rpcRequest("getTransactionCount",et),nt=create$4(tt,jsonRpcResult(number()));if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get transaction count");return nt.result}async getTotalSupply(j){return(await this.getSupply({commitment:j,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(j){const $=this._buildArgs([],j),_e=await this._rpcRequest("getInflationGovernor",$),et=create$4(_e,GetInflationGovernorRpcResult);if("error"in et)throw new SolanaJSONRPCError(et.error,"failed to get inflation");return et.result}async getInflationReward(j,$,_e){const{commitment:et,config:tt}=extractCommitmentFromConfig(_e),nt=this._buildArgs([j.map(it=>it.toBase58())],et,void 0,{...tt,epoch:$??(tt==null?void 0:tt.epoch)}),rt=await this._rpcRequest("getInflationReward",nt),ot=create$4(rt,GetInflationRewardResult);if("error"in ot)throw new SolanaJSONRPCError(ot.error,"failed to get inflation reward");return ot.result}async getInflationRate(){const j=await this._rpcRequest("getInflationRate",[]),$=create$4(j,GetInflationRateRpcResult);if("error"in $)throw new SolanaJSONRPCError($.error,"failed to get inflation rate");return $.result}async getEpochInfo(j){const{commitment:$,config:_e}=extractCommitmentFromConfig(j),et=this._buildArgs([],$,void 0,_e),tt=await this._rpcRequest("getEpochInfo",et),nt=create$4(tt,GetEpochInfoRpcResult);if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get epoch info");return nt.result}async getEpochSchedule(){const j=await this._rpcRequest("getEpochSchedule",[]),$=create$4(j,GetEpochScheduleRpcResult);if("error"in $)throw new SolanaJSONRPCError($.error,"failed to get epoch schedule");const _e=$.result;return new EpochSchedule(_e.slotsPerEpoch,_e.leaderScheduleSlotOffset,_e.warmup,_e.firstNormalEpoch,_e.firstNormalSlot)}async getLeaderSchedule(){const j=await this._rpcRequest("getLeaderSchedule",[]),$=create$4(j,GetLeaderScheduleRpcResult);if("error"in $)throw new SolanaJSONRPCError($.error,"failed to get leader schedule");return $.result}async getMinimumBalanceForRentExemption(j,$){const _e=this._buildArgs([j],$),et=await this._rpcRequest("getMinimumBalanceForRentExemption",_e),tt=create$4(et,GetMinimumBalanceForRentExemptionRpcResult);return"error"in tt?(console.warn("Unable to fetch minimum balance for rent exemption"),0):tt.result}async getRecentBlockhashAndContext(j){const $=this._buildArgs([],j),_e=await this._rpcRequest("getRecentBlockhash",$),et=create$4(_e,GetRecentBlockhashAndContextRpcResult);if("error"in et)throw new SolanaJSONRPCError(et.error,"failed to get recent blockhash");return et.result}async getRecentPerformanceSamples(j){const $=await this._rpcRequest("getRecentPerformanceSamples",j?[j]:[]),_e=create$4($,GetRecentPerformanceSamplesRpcResult);if("error"in _e)throw new SolanaJSONRPCError(_e.error,"failed to get recent performance samples");return _e.result}async getFeeCalculatorForBlockhash(j,$){const _e=this._buildArgs([j],$),et=await this._rpcRequest("getFeeCalculatorForBlockhash",_e),tt=create$4(et,GetFeeCalculatorRpcResult);if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get fee calculator");const{context:nt,value:rt}=tt.result;return{context:nt,value:rt!==null?rt.feeCalculator:null}}async getFeeForMessage(j,$){const _e=toBuffer(j.serialize()).toString("base64"),et=this._buildArgs([_e],$),tt=await this._rpcRequest("getFeeForMessage",et),nt=create$4(tt,jsonRpcResultAndContext(nullable(number())));if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get fee for message");if(nt.result===null)throw new Error("invalid blockhash");return nt.result}async getRecentPrioritizationFees(j){var nt;const $=(nt=j==null?void 0:j.lockedWritableAccounts)==null?void 0:nt.map(rt=>rt.toBase58()),_e=$!=null&&$.length?[$]:[],et=await this._rpcRequest("getRecentPrioritizationFees",_e),tt=create$4(et,GetRecentPrioritizationFeesRpcResult);if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get recent prioritization fees");return tt.result}async getRecentBlockhash(j){try{return(await this.getRecentBlockhashAndContext(j)).value}catch($){throw new Error("failed to get recent blockhash: "+$)}}async getLatestBlockhash(j){try{return(await this.getLatestBlockhashAndContext(j)).value}catch($){throw new Error("failed to get recent blockhash: "+$)}}async getLatestBlockhashAndContext(j){const{commitment:$,config:_e}=extractCommitmentFromConfig(j),et=this._buildArgs([],$,void 0,_e),tt=await this._rpcRequest("getLatestBlockhash",et),nt=create$4(tt,GetLatestBlockhashRpcResult);if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get latest blockhash");return nt.result}async isBlockhashValid(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=this._buildArgs([j],_e,void 0,et),nt=await this._rpcRequest("isBlockhashValid",tt),rt=create$4(nt,IsBlockhashValidRpcResult);if("error"in rt)throw new SolanaJSONRPCError(rt.error,"failed to determine if the blockhash `"+j+"`is valid");return rt.result}async getVersion(){const j=await this._rpcRequest("getVersion",[]),$=create$4(j,jsonRpcResult(VersionResult));if("error"in $)throw new SolanaJSONRPCError($.error,"failed to get version");return $.result}async getGenesisHash(){const j=await this._rpcRequest("getGenesisHash",[]),$=create$4(j,jsonRpcResult(string$1()));if("error"in $)throw new SolanaJSONRPCError($.error,"failed to get genesis hash");return $.result}async getBlock(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=this._buildArgsAtLeastConfirmed([j],_e,void 0,et),nt=await this._rpcRequest("getBlock",tt);try{switch(et==null?void 0:et.transactionDetails){case"accounts":{const rt=create$4(nt,GetAccountsModeBlockRpcResult);if("error"in rt)throw rt.error;return rt.result}case"none":{const rt=create$4(nt,GetNoneModeBlockRpcResult);if("error"in rt)throw rt.error;return rt.result}default:{const rt=create$4(nt,GetBlockRpcResult);if("error"in rt)throw rt.error;const{result:ot}=rt;return ot?{...ot,transactions:ot.transactions.map(({transaction:it,meta:st,version:at})=>({meta:st,transaction:{...it,message:versionedMessageFromResponse(at,it.message)},version:at}))}:null}}}catch(rt){throw new SolanaJSONRPCError(rt,"failed to get confirmed block")}}async getParsedBlock(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=this._buildArgsAtLeastConfirmed([j],_e,"jsonParsed",et),nt=await this._rpcRequest("getBlock",tt);try{switch(et==null?void 0:et.transactionDetails){case"accounts":{const rt=create$4(nt,GetParsedAccountsModeBlockRpcResult);if("error"in rt)throw rt.error;return rt.result}case"none":{const rt=create$4(nt,GetParsedNoneModeBlockRpcResult);if("error"in rt)throw rt.error;return rt.result}default:{const rt=create$4(nt,GetParsedBlockRpcResult);if("error"in rt)throw rt.error;return rt.result}}}catch(rt){throw new SolanaJSONRPCError(rt,"failed to get block")}}async getBlockProduction(j){let $,_e;if(typeof j=="string")_e=j;else if(j){const{commitment:rt,...ot}=j;_e=rt,$=ot}const et=this._buildArgs([],_e,"base64",$),tt=await this._rpcRequest("getBlockProduction",et),nt=create$4(tt,BlockProductionResponseStruct);if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get block production information");return nt.result}async getTransaction(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=this._buildArgsAtLeastConfirmed([j],_e,void 0,et),nt=await this._rpcRequest("getTransaction",tt),rt=create$4(nt,GetTransactionRpcResult);if("error"in rt)throw new SolanaJSONRPCError(rt.error,"failed to get transaction");const ot=rt.result;return ot&&{...ot,transaction:{...ot.transaction,message:versionedMessageFromResponse(ot.version,ot.transaction.message)}}}async getParsedTransaction(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=this._buildArgsAtLeastConfirmed([j],_e,"jsonParsed",et),nt=await this._rpcRequest("getTransaction",tt),rt=create$4(nt,GetParsedTransactionRpcResult);if("error"in rt)throw new SolanaJSONRPCError(rt.error,"failed to get transaction");return rt.result}async getParsedTransactions(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=j.map(ot=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([ot],_e,"jsonParsed",et)}));return(await this._rpcBatchRequest(tt)).map(ot=>{const it=create$4(ot,GetParsedTransactionRpcResult);if("error"in it)throw new SolanaJSONRPCError(it.error,"failed to get transactions");return it.result})}async getTransactions(j,$){const{commitment:_e,config:et}=extractCommitmentFromConfig($),tt=j.map(ot=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([ot],_e,void 0,et)}));return(await this._rpcBatchRequest(tt)).map(ot=>{const it=create$4(ot,GetTransactionRpcResult);if("error"in it)throw new SolanaJSONRPCError(it.error,"failed to get transactions");const st=it.result;return st&&{...st,transaction:{...st.transaction,message:versionedMessageFromResponse(st.version,st.transaction.message)}}})}async getConfirmedBlock(j,$){const _e=this._buildArgsAtLeastConfirmed([j],$),et=await this._rpcRequest("getConfirmedBlock",_e),tt=create$4(et,GetConfirmedBlockRpcResult);if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get confirmed block");const nt=tt.result;if(!nt)throw new Error("Confirmed block "+j+" not found");const rt={...nt,transactions:nt.transactions.map(({transaction:ot,meta:it})=>{const st=new Message(ot.message);return{meta:it,transaction:{...ot,message:st}}})};return{...rt,transactions:rt.transactions.map(({transaction:ot,meta:it})=>({meta:it,transaction:Transaction.populate(ot.message,ot.signatures)}))}}async getBlocks(j,$,_e){const et=this._buildArgsAtLeastConfirmed($!==void 0?[j,$]:[j],_e),tt=await this._rpcRequest("getBlocks",et),nt=create$4(tt,jsonRpcResult(array$1(number())));if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get blocks");return nt.result}async getBlockSignatures(j,$){const _e=this._buildArgsAtLeastConfirmed([j],$,void 0,{transactionDetails:"signatures",rewards:!1}),et=await this._rpcRequest("getBlock",_e),tt=create$4(et,GetBlockSignaturesRpcResult);if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get block");const nt=tt.result;if(!nt)throw new Error("Block "+j+" not found");return nt}async getConfirmedBlockSignatures(j,$){const _e=this._buildArgsAtLeastConfirmed([j],$,void 0,{transactionDetails:"signatures",rewards:!1}),et=await this._rpcRequest("getConfirmedBlock",_e),tt=create$4(et,GetBlockSignaturesRpcResult);if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get confirmed block");const nt=tt.result;if(!nt)throw new Error("Confirmed block "+j+" not found");return nt}async getConfirmedTransaction(j,$){const _e=this._buildArgsAtLeastConfirmed([j],$),et=await this._rpcRequest("getConfirmedTransaction",_e),tt=create$4(et,GetTransactionRpcResult);if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get transaction");const nt=tt.result;if(!nt)return nt;const rt=new Message(nt.transaction.message),ot=nt.transaction.signatures;return{...nt,transaction:Transaction.populate(rt,ot)}}async getParsedConfirmedTransaction(j,$){const _e=this._buildArgsAtLeastConfirmed([j],$,"jsonParsed"),et=await this._rpcRequest("getConfirmedTransaction",_e),tt=create$4(et,GetParsedTransactionRpcResult);if("error"in tt)throw new SolanaJSONRPCError(tt.error,"failed to get confirmed transaction");return tt.result}async getParsedConfirmedTransactions(j,$){const _e=j.map(nt=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([nt],$,"jsonParsed")}));return(await this._rpcBatchRequest(_e)).map(nt=>{const rt=create$4(nt,GetParsedTransactionRpcResult);if("error"in rt)throw new SolanaJSONRPCError(rt.error,"failed to get confirmed transactions");return rt.result})}async getConfirmedSignaturesForAddress(j,$,_e){let et={},tt=await this.getFirstAvailableBlock();for(;!("until"in et)&&($--,!($<=0||$0&&(et.until=ot.signatures[ot.signatures.length-1].toString())}catch(ot){if(ot instanceof Error&&ot.message.includes("skipped"))continue;throw ot}let nt=await this.getSlot("finalized");for(;!("before"in et)&&(_e++,!(_e>nt));)try{const ot=await this.getConfirmedBlockSignatures(_e);ot.signatures.length>0&&(et.before=ot.signatures[ot.signatures.length-1].toString())}catch(ot){if(ot instanceof Error&&ot.message.includes("skipped"))continue;throw ot}return(await this.getConfirmedSignaturesForAddress2(j,et)).map(ot=>ot.signature)}async getConfirmedSignaturesForAddress2(j,$,_e){const et=this._buildArgsAtLeastConfirmed([j.toBase58()],_e,void 0,$),tt=await this._rpcRequest("getConfirmedSignaturesForAddress2",et),nt=create$4(tt,GetConfirmedSignaturesForAddress2RpcResult);if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get confirmed signatures for address");return nt.result}async getSignaturesForAddress(j,$,_e){const et=this._buildArgsAtLeastConfirmed([j.toBase58()],_e,void 0,$),tt=await this._rpcRequest("getSignaturesForAddress",et),nt=create$4(tt,GetSignaturesForAddressRpcResult);if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get signatures for address");return nt.result}async getAddressLookupTable(j,$){const{context:_e,value:et}=await this.getAccountInfoAndContext(j,$);let tt=null;return et!==null&&(tt=new AddressLookupTableAccount({key:j,state:AddressLookupTableAccount.deserialize(et.data)})),{context:_e,value:tt}}async getNonceAndContext(j,$){const{context:_e,value:et}=await this.getAccountInfoAndContext(j,$);let tt=null;return et!==null&&(tt=NonceAccount.fromAccountData(et.data)),{context:_e,value:tt}}async getNonce(j,$){return await this.getNonceAndContext(j,$).then(_e=>_e.value).catch(_e=>{throw new Error("failed to get nonce for account "+j.toBase58()+": "+_e)})}async requestAirdrop(j,$){const _e=await this._rpcRequest("requestAirdrop",[j.toBase58(),$]),et=create$4(_e,RequestAirdropRpcResult);if("error"in et)throw new SolanaJSONRPCError(et.error,`airdrop to ${j.toBase58()} failed`);return et.result}async _blockhashWithExpiryBlockHeight(j){if(!j){for(;this._pollingBlockhash;)await sleep(100);const _e=Date.now()-this._blockhashInfo.lastFetch>=BLOCKHASH_CACHE_TIMEOUT_MS;if(this._blockhashInfo.latestBlockhash!==null&&!_e)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const j=Date.now(),$=this._blockhashInfo.latestBlockhash,_e=$?$.blockhash:null;for(let et=0;et<50;et++){const tt=await this.getLatestBlockhash("finalized");if(_e!==tt.blockhash)return this._blockhashInfo={latestBlockhash:tt,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},tt;await sleep(MS_PER_SLOT/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-j}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(j){const{commitment:$,config:_e}=extractCommitmentFromConfig(j),et=this._buildArgs([],$,"base64",_e),tt=await this._rpcRequest("getStakeMinimumDelegation",et),nt=create$4(tt,jsonRpcResultAndContext(number()));if("error"in nt)throw new SolanaJSONRPCError(nt.error,"failed to get stake minimum delegation");return nt.result}async simulateTransaction(j,$,_e){if("message"in j){const ft=j.serialize(),gt=buffer.Buffer.from(ft).toString("base64");if(Array.isArray($)||_e!==void 0)throw new Error("Invalid arguments");const ht=$||{};ht.encoding="base64","commitment"in ht||(ht.commitment=this.commitment);const yt=[gt,ht],pt=await this._rpcRequest("simulateTransaction",yt),Mt=create$4(pt,SimulatedTransactionResponseStruct);if("error"in Mt)throw new Error("failed to simulate transaction: "+Mt.error.message);return Mt.result}let et;if(j instanceof Transaction){let dt=j;et=new Transaction,et.feePayer=dt.feePayer,et.instructions=j.instructions,et.nonceInfo=dt.nonceInfo,et.signatures=dt.signatures}else et=Transaction.populate(j),et._message=et._json=void 0;if($!==void 0&&!Array.isArray($))throw new Error("Invalid arguments");const tt=$;if(et.nonceInfo&&tt)et.sign(...tt);else{let dt=this._disableBlockhashCaching;for(;;){const ft=await this._blockhashWithExpiryBlockHeight(dt);if(et.lastValidBlockHeight=ft.lastValidBlockHeight,et.recentBlockhash=ft.blockhash,!tt)break;if(et.sign(...tt),!et.signature)throw new Error("!signature");const gt=et.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(gt)&&!this._blockhashInfo.transactionSignatures.includes(gt)){this._blockhashInfo.simulatedSignatures.push(gt);break}else dt=!0}}const nt=et._compile(),rt=nt.serialize(),it=et._serialize(rt).toString("base64"),st={encoding:"base64",commitment:this.commitment};if(_e){const dt=(Array.isArray(_e)?_e:nt.nonProgramIds()).map(ft=>ft.toBase58());st.accounts={encoding:"base64",addresses:dt}}tt&&(st.sigVerify=!0);const at=[it,st],ct=await this._rpcRequest("simulateTransaction",at),lt=create$4(ct,SimulatedTransactionResponseStruct);if("error"in lt){let dt;if("data"in lt.error&&(dt=lt.error.data.logs,dt&&Array.isArray(dt))){const ft=` `,gt=ft+dt.join(ft);console.error(lt.error.message,gt)}throw new SendTransactionError("failed to simulate transaction: "+lt.error.message,dt)}return lt.result}async sendTransaction(j,$,_e){if("version"in j){if($&&Array.isArray($))throw new Error("Invalid arguments");const nt=j.serialize();return await this.sendRawTransaction(nt,$)}if($===void 0||!Array.isArray($))throw new Error("Invalid arguments");const et=$;if(j.nonceInfo)j.sign(...et);else{let nt=this._disableBlockhashCaching;for(;;){const rt=await this._blockhashWithExpiryBlockHeight(nt);if(j.lastValidBlockHeight=rt.lastValidBlockHeight,j.recentBlockhash=rt.blockhash,j.sign(...et),!j.signature)throw new Error("!signature");const ot=j.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(ot))nt=!0;else{this._blockhashInfo.transactionSignatures.push(ot);break}}}const tt=j.serialize();return await this.sendRawTransaction(tt,_e)}async sendRawTransaction(j,$){const _e=toBuffer(j).toString("base64");return await this.sendEncodedTransaction(_e,$)}async sendEncodedTransaction(j,$){const _e={encoding:"base64"},et=$&&$.skipPreflight,tt=et===!0?"processed":$&&$.preflightCommitment||this.commitment;$&&$.maxRetries!=null&&(_e.maxRetries=$.maxRetries),$&&$.minContextSlot!=null&&(_e.minContextSlot=$.minContextSlot),et&&(_e.skipPreflight=et),tt&&(_e.preflightCommitment=tt);const nt=[j,_e],rt=await this._rpcRequest("sendTransaction",nt),ot=create$4(rt,SendTransactionRpcResult);if("error"in ot){let it;throw"data"in ot.error&&(it=ot.error.data.logs),new SendTransactionError("failed to send transaction: "+ot.error.message,it)}return ot.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(j){this._rpcWebSocketConnected=!1,console.error("ws error:",j.message)}_wsOnClose(j){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),j===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([$,_e])=>{this._setSubscription($,{..._e,state:"pending"})})}_setSubscription(j,$){var et;const _e=(et=this._subscriptionsByHash[j])==null?void 0:et.state;if(this._subscriptionsByHash[j]=$,_e!==$.state){const tt=this._subscriptionStateChangeCallbacksByHash[j];tt&&tt.forEach(nt=>{try{nt($.state)}catch{}})}}_onSubscriptionStateChange(j,$){var tt;const _e=this._subscriptionHashByClientSubscriptionId[j];if(_e==null)return()=>{};const et=(tt=this._subscriptionStateChangeCallbacksByHash)[_e]||(tt[_e]=new Set);return et.add($),()=>{et.delete($),et.size===0&&delete this._subscriptionStateChangeCallbacksByHash[_e]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(_e){_e instanceof Error&&console.log(`Error when closing socket connection: ${_e.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}const j=this._rpcWebSocketGeneration,$=()=>j===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async _e=>{const et=this._subscriptionsByHash[_e];if(et!==void 0)switch(et.state){case"pending":case"unsubscribed":if(et.callbacks.size===0){delete this._subscriptionsByHash[_e],et.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[et.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{const{args:tt,method:nt}=et;try{this._setSubscription(_e,{...et,state:"subscribing"});const rt=await this._rpcWebSocket.call(nt,tt);this._setSubscription(_e,{...et,serverSubscriptionId:rt,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[rt]=et.callbacks,await this._updateSubscriptions()}catch(rt){if(rt instanceof Error&&console.error(`${nt} error for argument`,tt,rt.message),!$())return;this._setSubscription(_e,{...et,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":et.callbacks.size===0&&await(async()=>{const{serverSubscriptionId:tt,unsubscribeMethod:nt}=et;if(this._subscriptionsAutoDisposedByRpc.has(tt))this._subscriptionsAutoDisposedByRpc.delete(tt);else{this._setSubscription(_e,{...et,state:"unsubscribing"}),this._setSubscription(_e,{...et,state:"unsubscribing"});try{await this._rpcWebSocket.call(nt,[tt])}catch(rt){if(rt instanceof Error&&console.error(`${nt} error:`,rt.message),!$())return;this._setSubscription(_e,{...et,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(_e,{...et,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(j,$){const _e=this._subscriptionCallbacksByServerSubscriptionId[j];_e!==void 0&&_e.forEach(et=>{try{et(...$)}catch(tt){console.error(tt)}})}_wsOnAccountNotification(j){const{result:$,subscription:_e}=create$4(j,AccountNotificationResult);this._handleServerNotification(_e,[$.value,$.context])}_makeSubscription(j,$){const _e=this._nextClientSubscriptionId++,et=fastStableStringify$1([j.method,$]),tt=this._subscriptionsByHash[et];return tt===void 0?this._subscriptionsByHash[et]={...j,args:$,callbacks:new Set([j.callback]),state:"pending"}:tt.callbacks.add(j.callback),this._subscriptionHashByClientSubscriptionId[_e]=et,this._subscriptionDisposeFunctionsByClientSubscriptionId[_e]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[_e],delete this._subscriptionHashByClientSubscriptionId[_e];const nt=this._subscriptionsByHash[et];assert(nt!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${_e}`),nt.callbacks.delete(j.callback),await this._updateSubscriptions()},this._updateSubscriptions(),_e}onAccountChange(j,$,_e){const et=this._buildArgs([j.toBase58()],_e||this._commitment||"finalized","base64");return this._makeSubscription({callback:$,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},et)}async removeAccountChangeListener(j){await this._unsubscribeClientSubscription(j,"account change")}_wsOnProgramAccountNotification(j){const{result:$,subscription:_e}=create$4(j,ProgramAccountNotificationResult);this._handleServerNotification(_e,[{accountId:$.value.pubkey,accountInfo:$.value.account},$.context])}onProgramAccountChange(j,$,_e,et){const tt=this._buildArgs([j.toBase58()],_e||this._commitment||"finalized","base64",et?{filters:et}:void 0);return this._makeSubscription({callback:$,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},tt)}async removeProgramAccountChangeListener(j){await this._unsubscribeClientSubscription(j,"program account change")}onLogs(j,$,_e){const et=this._buildArgs([typeof j=="object"?{mentions:[j.toString()]}:j],_e||this._commitment||"finalized");return this._makeSubscription({callback:$,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},et)}async removeOnLogsListener(j){await this._unsubscribeClientSubscription(j,"logs")}_wsOnLogsNotification(j){const{result:$,subscription:_e}=create$4(j,LogsNotificationResult);this._handleServerNotification(_e,[$.value,$.context])}_wsOnSlotNotification(j){const{result:$,subscription:_e}=create$4(j,SlotNotificationResult);this._handleServerNotification(_e,[$])}onSlotChange(j){return this._makeSubscription({callback:j,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(j){await this._unsubscribeClientSubscription(j,"slot change")}_wsOnSlotUpdatesNotification(j){const{result:$,subscription:_e}=create$4(j,SlotUpdateNotificationResult);this._handleServerNotification(_e,[$])}onSlotUpdate(j){return this._makeSubscription({callback:j,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(j){await this._unsubscribeClientSubscription(j,"slot update")}async _unsubscribeClientSubscription(j,$){const _e=this._subscriptionDisposeFunctionsByClientSubscriptionId[j];_e?await _e():console.warn(`Ignored unsubscribe request because an active subscription with id \`${j}\` for '${$}' events could not be found.`)}_buildArgs(j,$,_e,et){const tt=$||this._commitment;if(tt||_e||et){let nt={};_e&&(nt.encoding=_e),tt&&(nt.commitment=tt),et&&(nt=Object.assign(nt,et)),j.push(nt)}return j}_buildArgsAtLeastConfirmed(j,$,_e,et){const tt=$||this._commitment;if(tt&&!["confirmed","finalized"].includes(tt))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(j,$,_e,et)}_wsOnSignatureNotification(j){const{result:$,subscription:_e}=create$4(j,SignatureNotificationResult);$.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(_e),this._handleServerNotification(_e,$.value==="receivedSignature"?[{type:"received"},$.context]:[{type:"status",result:$.value},$.context])}onSignature(j,$,_e){const et=this._buildArgs([j],_e||this._commitment||"finalized"),tt=this._makeSubscription({callback:(nt,rt)=>{if(nt.type==="status"){$(nt.result,rt);try{this.removeSignatureListener(tt)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},et);return tt}onSignatureWithOptions(j,$,_e){const{commitment:et,...tt}={..._e,commitment:_e&&_e.commitment||this._commitment||"finalized"},nt=this._buildArgs([j],et,void 0,tt),rt=this._makeSubscription({callback:(ot,it)=>{$(ot,it);try{this.removeSignatureListener(rt)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},nt);return rt}async removeSignatureListener(j){await this._unsubscribeClientSubscription(j,"signature result")}_wsOnRootNotification(j){const{result:$,subscription:_e}=create$4(j,RootNotificationResult);this._handleServerNotification(_e,[$])}onRootChange(j){return this._makeSubscription({callback:j,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(j){await this._unsubscribeClientSubscription(j,"root change")}}class Keypair{constructor(j){this._keypair=void 0,this._keypair=j??generateKeypair()}static generate(){return new Keypair(generateKeypair())}static fromSecretKey(j,$){if(j.byteLength!==64)throw new Error("bad secret key size");const _e=j.slice(32,64);if(!$||!$.skipValidation){const et=j.slice(0,32),tt=getPublicKey(et);for(let nt=0;nt<32;nt++)if(_e[nt]!==tt[nt])throw new Error("provided secretKey is invalid")}return new Keypair({publicKey:_e,secretKey:j})}static fromSeed(j){const $=getPublicKey(j),_e=new Uint8Array(64);return _e.set(j),_e.set($,32),new Keypair({publicKey:$,secretKey:_e})}get publicKey(){return new PublicKey(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const LOOKUP_TABLE_INSTRUCTION_LAYOUTS=Object.freeze({CreateLookupTable:{index:0,layout:struct([u32("instruction"),u64("recentSlot"),u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:struct([u32("instruction")])},ExtendLookupTable:{index:2,layout:struct([u32("instruction"),u64(),seq(publicKey(),offset(u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:struct([u32("instruction")])},CloseLookupTable:{index:4,layout:struct([u32("instruction")])}});class AddressLookupTableInstruction{constructor(){}static decodeInstructionType(j){this.checkProgramId(j.programId);const _e=u32("instruction").decode(j.data);let et;for(const[tt,nt]of Object.entries(LOOKUP_TABLE_INSTRUCTION_LAYOUTS))if(nt.index==_e){et=tt;break}if(!et)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return et}static decodeCreateLookupTable(j){this.checkProgramId(j.programId),this.checkKeysLength(j.keys,4);const{recentSlot:$}=decodeData$1(LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable,j.data);return{authority:j.keys[1].pubkey,payer:j.keys[2].pubkey,recentSlot:Number($)}}static decodeExtendLookupTable(j){if(this.checkProgramId(j.programId),j.keys.length<2)throw new Error(`invalid instruction; found ${j.keys.length} keys, expected at least 2`);const{addresses:$}=decodeData$1(LOOKUP_TABLE_INSTRUCTION_LAYOUTS.ExtendLookupTable,j.data);return{lookupTable:j.keys[0].pubkey,authority:j.keys[1].pubkey,payer:j.keys.length>2?j.keys[2].pubkey:void 0,addresses:$.map(_e=>new PublicKey(_e))}}static decodeCloseLookupTable(j){return this.checkProgramId(j.programId),this.checkKeysLength(j.keys,3),{lookupTable:j.keys[0].pubkey,authority:j.keys[1].pubkey,recipient:j.keys[2].pubkey}}static decodeFreezeLookupTable(j){return this.checkProgramId(j.programId),this.checkKeysLength(j.keys,2),{lookupTable:j.keys[0].pubkey,authority:j.keys[1].pubkey}}static decodeDeactivateLookupTable(j){return this.checkProgramId(j.programId),this.checkKeysLength(j.keys,2),{lookupTable:j.keys[0].pubkey,authority:j.keys[1].pubkey}}static checkProgramId(j){if(!j.equals(AddressLookupTableProgram.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(j,$){if(j.length<$)throw new Error(`invalid instruction; found ${j.length} keys, expected at least ${$}`)}}class AddressLookupTableProgram{constructor(){}static createLookupTable(j){const[$,_e]=PublicKey.findProgramAddressSync([j.authority.toBuffer(),toBufferLE_1(BigInt(j.recentSlot),8)],this.programId),et=LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable,tt=encodeData(et,{recentSlot:BigInt(j.recentSlot),bumpSeed:_e}),nt=[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:j.authority,isSigner:!0,isWritable:!1},{pubkey:j.payer,isSigner:!0,isWritable:!0},{pubkey:SystemProgram.programId,isSigner:!1,isWritable:!1}];return[new TransactionInstruction({programId:this.programId,keys:nt,data:tt}),$]}static freezeLookupTable(j){const $=LOOKUP_TABLE_INSTRUCTION_LAYOUTS.FreezeLookupTable,_e=encodeData($),et=[{pubkey:j.lookupTable,isSigner:!1,isWritable:!0},{pubkey:j.authority,isSigner:!0,isWritable:!1}];return new TransactionInstruction({programId:this.programId,keys:et,data:_e})}static extendLookupTable(j){const $=LOOKUP_TABLE_INSTRUCTION_LAYOUTS.ExtendLookupTable,_e=encodeData($,{addresses:j.addresses.map(tt=>tt.toBytes())}),et=[{pubkey:j.lookupTable,isSigner:!1,isWritable:!0},{pubkey:j.authority,isSigner:!0,isWritable:!1}];return j.payer&&et.push({pubkey:j.payer,isSigner:!0,isWritable:!0},{pubkey:SystemProgram.programId,isSigner:!1,isWritable:!1}),new TransactionInstruction({programId:this.programId,keys:et,data:_e})}static deactivateLookupTable(j){const $=LOOKUP_TABLE_INSTRUCTION_LAYOUTS.DeactivateLookupTable,_e=encodeData($),et=[{pubkey:j.lookupTable,isSigner:!1,isWritable:!0},{pubkey:j.authority,isSigner:!0,isWritable:!1}];return new TransactionInstruction({programId:this.programId,keys:et,data:_e})}static closeLookupTable(j){const $=LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CloseLookupTable,_e=encodeData($),et=[{pubkey:j.lookupTable,isSigner:!1,isWritable:!0},{pubkey:j.authority,isSigner:!0,isWritable:!1},{pubkey:j.recipient,isSigner:!1,isWritable:!0}];return new TransactionInstruction({programId:this.programId,keys:et,data:_e})}}AddressLookupTableProgram.programId=new PublicKey("AddressLookupTab1e1111111111111111111111111");class ComputeBudgetInstruction{constructor(){}static decodeInstructionType(j){this.checkProgramId(j.programId);const _e=u8("instruction").decode(j.data);let et;for(const[tt,nt]of Object.entries(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS))if(nt.index==_e){et=tt;break}if(!et)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return et}static decodeRequestUnits(j){this.checkProgramId(j.programId);const{units:$,additionalFee:_e}=decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits,j.data);return{units:$,additionalFee:_e}}static decodeRequestHeapFrame(j){this.checkProgramId(j.programId);const{bytes:$}=decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestHeapFrame,j.data);return{bytes:$}}static decodeSetComputeUnitLimit(j){this.checkProgramId(j.programId);const{units:$}=decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit,j.data);return{units:$}}static decodeSetComputeUnitPrice(j){this.checkProgramId(j.programId);const{microLamports:$}=decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice,j.data);return{microLamports:$}}static checkProgramId(j){if(!j.equals(ComputeBudgetProgram.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const COMPUTE_BUDGET_INSTRUCTION_LAYOUTS=Object.freeze({RequestUnits:{index:0,layout:struct([u8("instruction"),u32("units"),u32("additionalFee")])},RequestHeapFrame:{index:1,layout:struct([u8("instruction"),u32("bytes")])},SetComputeUnitLimit:{index:2,layout:struct([u8("instruction"),u32("units")])},SetComputeUnitPrice:{index:3,layout:struct([u8("instruction"),u64("microLamports")])}});class ComputeBudgetProgram{constructor(){}static requestUnits(j){const $=COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits,_e=encodeData($,j);return new TransactionInstruction({keys:[],programId:this.programId,data:_e})}static requestHeapFrame(j){const $=COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestHeapFrame,_e=encodeData($,j);return new TransactionInstruction({keys:[],programId:this.programId,data:_e})}static setComputeUnitLimit(j){const $=COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit,_e=encodeData($,j);return new TransactionInstruction({keys:[],programId:this.programId,data:_e})}static setComputeUnitPrice(j){const $=COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice,_e=encodeData($,{microLamports:BigInt(j.microLamports)});return new TransactionInstruction({keys:[],programId:this.programId,data:_e})}}ComputeBudgetProgram.programId=new PublicKey("ComputeBudget111111111111111111111111111111");const PRIVATE_KEY_BYTES$1=64,PUBLIC_KEY_BYTES$1=32,SIGNATURE_BYTES=64,ED25519_INSTRUCTION_LAYOUT=struct([u8("numSignatures"),u8("padding"),u16("signatureOffset"),u16("signatureInstructionIndex"),u16("publicKeyOffset"),u16("publicKeyInstructionIndex"),u16("messageDataOffset"),u16("messageDataSize"),u16("messageInstructionIndex")]);class Ed25519Program{constructor(){}static createInstructionWithPublicKey(j){const{publicKey:$,message:_e,signature:et,instructionIndex:tt}=j;assert($.length===PUBLIC_KEY_BYTES$1,`Public Key must be ${PUBLIC_KEY_BYTES$1} bytes but received ${$.length} bytes`),assert(et.length===SIGNATURE_BYTES,`Signature must be ${SIGNATURE_BYTES} bytes but received ${et.length} bytes`);const nt=ED25519_INSTRUCTION_LAYOUT.span,rt=nt+$.length,ot=rt+et.length,it=1,st=buffer.Buffer.alloc(ot+_e.length),at=tt??65535;return ED25519_INSTRUCTION_LAYOUT.encode({numSignatures:it,padding:0,signatureOffset:rt,signatureInstructionIndex:at,publicKeyOffset:nt,publicKeyInstructionIndex:at,messageDataOffset:ot,messageDataSize:_e.length,messageInstructionIndex:at},st),st.fill($,nt),st.fill(et,rt),st.fill(_e,ot),new TransactionInstruction({keys:[],programId:Ed25519Program.programId,data:st})}static createInstructionWithPrivateKey(j){const{privateKey:$,message:_e,instructionIndex:et}=j;assert($.length===PRIVATE_KEY_BYTES$1,`Private key must be ${PRIVATE_KEY_BYTES$1} bytes but received ${$.length} bytes`);try{const tt=Keypair.fromSecretKey($),nt=tt.publicKey.toBytes(),rt=sign(_e,tt.secretKey);return this.createInstructionWithPublicKey({publicKey:nt,message:_e,signature:rt,instructionIndex:et})}catch(tt){throw new Error(`Error creating instruction; ${tt}`)}}}Ed25519Program.programId=new PublicKey("Ed25519SigVerify111111111111111111111111111");const ecdsaSign=(s,j)=>{const $=secp256k1.sign(s,j);return[$.toCompactRawBytes(),$.recovery]};secp256k1.utils.isValidPrivateKey;const publicKeyCreate=secp256k1.getPublicKey,PRIVATE_KEY_BYTES=32,ETHEREUM_ADDRESS_BYTES=20,PUBLIC_KEY_BYTES=64,SIGNATURE_OFFSETS_SERIALIZED_SIZE=11,SECP256K1_INSTRUCTION_LAYOUT=struct([u8("numSignatures"),u16("signatureOffset"),u8("signatureInstructionIndex"),u16("ethAddressOffset"),u8("ethAddressInstructionIndex"),u16("messageDataOffset"),u16("messageDataSize"),u8("messageInstructionIndex"),blob(20,"ethAddress"),blob(64,"signature"),u8("recoveryId")]);class Secp256k1Program{constructor(){}static publicKeyToEthAddress(j){assert(j.length===PUBLIC_KEY_BYTES,`Public key must be ${PUBLIC_KEY_BYTES} bytes but received ${j.length} bytes`);try{return buffer.Buffer.from(keccak_256(toBuffer(j))).slice(-ETHEREUM_ADDRESS_BYTES)}catch($){throw new Error(`Error constructing Ethereum address: ${$}`)}}static createInstructionWithPublicKey(j){const{publicKey:$,message:_e,signature:et,recoveryId:tt,instructionIndex:nt}=j;return Secp256k1Program.createInstructionWithEthAddress({ethAddress:Secp256k1Program.publicKeyToEthAddress($),message:_e,signature:et,recoveryId:tt,instructionIndex:nt})}static createInstructionWithEthAddress(j){const{ethAddress:$,message:_e,signature:et,recoveryId:tt,instructionIndex:nt=0}=j;let rt;typeof $=="string"?$.startsWith("0x")?rt=buffer.Buffer.from($.substr(2),"hex"):rt=buffer.Buffer.from($,"hex"):rt=$,assert(rt.length===ETHEREUM_ADDRESS_BYTES,`Address must be ${ETHEREUM_ADDRESS_BYTES} bytes but received ${rt.length} bytes`);const ot=1+SIGNATURE_OFFSETS_SERIALIZED_SIZE,it=ot,st=ot+rt.length,at=st+et.length+1,ct=1,lt=buffer.Buffer.alloc(SECP256K1_INSTRUCTION_LAYOUT.span+_e.length);return SECP256K1_INSTRUCTION_LAYOUT.encode({numSignatures:ct,signatureOffset:st,signatureInstructionIndex:nt,ethAddressOffset:it,ethAddressInstructionIndex:nt,messageDataOffset:at,messageDataSize:_e.length,messageInstructionIndex:nt,signature:toBuffer(et),ethAddress:toBuffer(rt),recoveryId:tt},lt),lt.fill(toBuffer(_e),SECP256K1_INSTRUCTION_LAYOUT.span),new TransactionInstruction({keys:[],programId:Secp256k1Program.programId,data:lt})}static createInstructionWithPrivateKey(j){const{privateKey:$,message:_e,instructionIndex:et}=j;assert($.length===PRIVATE_KEY_BYTES,`Private key must be ${PRIVATE_KEY_BYTES} bytes but received ${$.length} bytes`);try{const tt=toBuffer($),nt=publicKeyCreate(tt,!1).slice(1),rt=buffer.Buffer.from(keccak_256(toBuffer(_e))),[ot,it]=ecdsaSign(rt,tt);return this.createInstructionWithPublicKey({publicKey:nt,message:_e,signature:ot,recoveryId:it,instructionIndex:et})}catch(tt){throw new Error(`Error creating instruction; ${tt}`)}}}Secp256k1Program.programId=new PublicKey("KeccakSecp256k11111111111111111111111111111");var _Lockup;const STAKE_CONFIG_ID=new PublicKey("StakeConfig11111111111111111111111111111111");class Authorized{constructor(j,$){this.staker=void 0,this.withdrawer=void 0,this.staker=j,this.withdrawer=$}}class Lockup{constructor(j,$,_e){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=j,this.epoch=$,this.custodian=_e}}_Lockup=Lockup;Lockup.default=new _Lockup(0,0,PublicKey.default);class StakeInstruction{constructor(){}static decodeInstructionType(j){this.checkProgramId(j.programId);const _e=u32("instruction").decode(j.data);let et;for(const[tt,nt]of Object.entries(STAKE_INSTRUCTION_LAYOUTS))if(nt.index==_e){et=tt;break}if(!et)throw new Error("Instruction type incorrect; not a StakeInstruction");return et}static decodeInitialize(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,2);const{authorized:$,lockup:_e}=decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Initialize,j.data);return{stakePubkey:j.keys[0].pubkey,authorized:new Authorized(new PublicKey($.staker),new PublicKey($.withdrawer)),lockup:new Lockup(_e.unixTimestamp,_e.epoch,new PublicKey(_e.custodian))}}static decodeDelegate(j){return this.checkProgramId(j.programId),this.checkKeyLength(j.keys,6),decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Delegate,j.data),{stakePubkey:j.keys[0].pubkey,votePubkey:j.keys[1].pubkey,authorizedPubkey:j.keys[5].pubkey}}static decodeAuthorize(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,3);const{newAuthorized:$,stakeAuthorizationType:_e}=decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Authorize,j.data),et={stakePubkey:j.keys[0].pubkey,authorizedPubkey:j.keys[2].pubkey,newAuthorizedPubkey:new PublicKey($),stakeAuthorizationType:{index:_e}};return j.keys.length>3&&(et.custodianPubkey=j.keys[3].pubkey),et}static decodeAuthorizeWithSeed(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,2);const{newAuthorized:$,stakeAuthorizationType:_e,authoritySeed:et,authorityOwner:tt}=decodeData$1(STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed,j.data),nt={stakePubkey:j.keys[0].pubkey,authorityBase:j.keys[1].pubkey,authoritySeed:et,authorityOwner:new PublicKey(tt),newAuthorizedPubkey:new PublicKey($),stakeAuthorizationType:{index:_e}};return j.keys.length>3&&(nt.custodianPubkey=j.keys[3].pubkey),nt}static decodeSplit(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,3);const{lamports:$}=decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Split,j.data);return{stakePubkey:j.keys[0].pubkey,splitStakePubkey:j.keys[1].pubkey,authorizedPubkey:j.keys[2].pubkey,lamports:$}}static decodeMerge(j){return this.checkProgramId(j.programId),this.checkKeyLength(j.keys,3),decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Merge,j.data),{stakePubkey:j.keys[0].pubkey,sourceStakePubKey:j.keys[1].pubkey,authorizedPubkey:j.keys[4].pubkey}}static decodeWithdraw(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,5);const{lamports:$}=decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Withdraw,j.data),_e={stakePubkey:j.keys[0].pubkey,toPubkey:j.keys[1].pubkey,authorizedPubkey:j.keys[4].pubkey,lamports:$};return j.keys.length>5&&(_e.custodianPubkey=j.keys[5].pubkey),_e}static decodeDeactivate(j){return this.checkProgramId(j.programId),this.checkKeyLength(j.keys,3),decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Deactivate,j.data),{stakePubkey:j.keys[0].pubkey,authorizedPubkey:j.keys[2].pubkey}}static checkProgramId(j){if(!j.equals(StakeProgram.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(j,$){if(j.length<$)throw new Error(`invalid instruction; found ${j.length} keys, expected at least ${$}`)}}const STAKE_INSTRUCTION_LAYOUTS=Object.freeze({Initialize:{index:0,layout:struct([u32("instruction"),authorized(),lockup()])},Authorize:{index:1,layout:struct([u32("instruction"),publicKey("newAuthorized"),u32("stakeAuthorizationType")])},Delegate:{index:2,layout:struct([u32("instruction")])},Split:{index:3,layout:struct([u32("instruction"),ns64("lamports")])},Withdraw:{index:4,layout:struct([u32("instruction"),ns64("lamports")])},Deactivate:{index:5,layout:struct([u32("instruction")])},Merge:{index:7,layout:struct([u32("instruction")])},AuthorizeWithSeed:{index:8,layout:struct([u32("instruction"),publicKey("newAuthorized"),u32("stakeAuthorizationType"),rustString("authoritySeed"),publicKey("authorityOwner")])}}),StakeAuthorizationLayout=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class StakeProgram{constructor(){}static initialize(j){const{stakePubkey:$,authorized:_e,lockup:et}=j,tt=et||Lockup.default,nt=STAKE_INSTRUCTION_LAYOUTS.Initialize,rt=encodeData(nt,{authorized:{staker:toBuffer(_e.staker.toBuffer()),withdrawer:toBuffer(_e.withdrawer.toBuffer())},lockup:{unixTimestamp:tt.unixTimestamp,epoch:tt.epoch,custodian:toBuffer(tt.custodian.toBuffer())}}),ot={keys:[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_RENT_PUBKEY,isSigner:!1,isWritable:!1}],programId:this.programId,data:rt};return new TransactionInstruction(ot)}static createAccountWithSeed(j){const $=new Transaction;$.add(SystemProgram.createAccountWithSeed({fromPubkey:j.fromPubkey,newAccountPubkey:j.stakePubkey,basePubkey:j.basePubkey,seed:j.seed,lamports:j.lamports,space:this.space,programId:this.programId}));const{stakePubkey:_e,authorized:et,lockup:tt}=j;return $.add(this.initialize({stakePubkey:_e,authorized:et,lockup:tt}))}static createAccount(j){const $=new Transaction;$.add(SystemProgram.createAccount({fromPubkey:j.fromPubkey,newAccountPubkey:j.stakePubkey,lamports:j.lamports,space:this.space,programId:this.programId}));const{stakePubkey:_e,authorized:et,lockup:tt}=j;return $.add(this.initialize({stakePubkey:_e,authorized:et,lockup:tt}))}static delegate(j){const{stakePubkey:$,authorizedPubkey:_e,votePubkey:et}=j,tt=STAKE_INSTRUCTION_LAYOUTS.Delegate,nt=encodeData(tt);return new Transaction().add({keys:[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:et,isSigner:!1,isWritable:!1},{pubkey:SYSVAR_CLOCK_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:SYSVAR_STAKE_HISTORY_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:STAKE_CONFIG_ID,isSigner:!1,isWritable:!1},{pubkey:_e,isSigner:!0,isWritable:!1}],programId:this.programId,data:nt})}static authorize(j){const{stakePubkey:$,authorizedPubkey:_e,newAuthorizedPubkey:et,stakeAuthorizationType:tt,custodianPubkey:nt}=j,rt=STAKE_INSTRUCTION_LAYOUTS.Authorize,ot=encodeData(rt,{newAuthorized:toBuffer(et.toBuffer()),stakeAuthorizationType:tt.index}),it=[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_CLOCK_PUBKEY,isSigner:!1,isWritable:!0},{pubkey:_e,isSigner:!0,isWritable:!1}];return nt&&it.push({pubkey:nt,isSigner:!0,isWritable:!1}),new Transaction().add({keys:it,programId:this.programId,data:ot})}static authorizeWithSeed(j){const{stakePubkey:$,authorityBase:_e,authoritySeed:et,authorityOwner:tt,newAuthorizedPubkey:nt,stakeAuthorizationType:rt,custodianPubkey:ot}=j,it=STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed,st=encodeData(it,{newAuthorized:toBuffer(nt.toBuffer()),stakeAuthorizationType:rt.index,authoritySeed:et,authorityOwner:toBuffer(tt.toBuffer())}),at=[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:_e,isSigner:!0,isWritable:!1},{pubkey:SYSVAR_CLOCK_PUBKEY,isSigner:!1,isWritable:!1}];return ot&&at.push({pubkey:ot,isSigner:!0,isWritable:!1}),new Transaction().add({keys:at,programId:this.programId,data:st})}static splitInstruction(j){const{stakePubkey:$,authorizedPubkey:_e,splitStakePubkey:et,lamports:tt}=j,nt=STAKE_INSTRUCTION_LAYOUTS.Split,rt=encodeData(nt,{lamports:tt});return new TransactionInstruction({keys:[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:et,isSigner:!1,isWritable:!0},{pubkey:_e,isSigner:!0,isWritable:!1}],programId:this.programId,data:rt})}static split(j,$){const _e=new Transaction;return _e.add(SystemProgram.createAccount({fromPubkey:j.authorizedPubkey,newAccountPubkey:j.splitStakePubkey,lamports:$,space:this.space,programId:this.programId})),_e.add(this.splitInstruction(j))}static splitWithSeed(j,$){const{stakePubkey:_e,authorizedPubkey:et,splitStakePubkey:tt,basePubkey:nt,seed:rt,lamports:ot}=j,it=new Transaction;return it.add(SystemProgram.allocate({accountPubkey:tt,basePubkey:nt,seed:rt,space:this.space,programId:this.programId})),$&&$>0&&it.add(SystemProgram.transfer({fromPubkey:j.authorizedPubkey,toPubkey:tt,lamports:$})),it.add(this.splitInstruction({stakePubkey:_e,authorizedPubkey:et,splitStakePubkey:tt,lamports:ot}))}static merge(j){const{stakePubkey:$,sourceStakePubKey:_e,authorizedPubkey:et}=j,tt=STAKE_INSTRUCTION_LAYOUTS.Merge,nt=encodeData(tt);return new Transaction().add({keys:[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:_e,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_CLOCK_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:SYSVAR_STAKE_HISTORY_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:et,isSigner:!0,isWritable:!1}],programId:this.programId,data:nt})}static withdraw(j){const{stakePubkey:$,authorizedPubkey:_e,toPubkey:et,lamports:tt,custodianPubkey:nt}=j,rt=STAKE_INSTRUCTION_LAYOUTS.Withdraw,ot=encodeData(rt,{lamports:tt}),it=[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:et,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_CLOCK_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:SYSVAR_STAKE_HISTORY_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:_e,isSigner:!0,isWritable:!1}];return nt&&it.push({pubkey:nt,isSigner:!0,isWritable:!1}),new Transaction().add({keys:it,programId:this.programId,data:ot})}static deactivate(j){const{stakePubkey:$,authorizedPubkey:_e}=j,et=STAKE_INSTRUCTION_LAYOUTS.Deactivate,tt=encodeData(et);return new Transaction().add({keys:[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_CLOCK_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:_e,isSigner:!0,isWritable:!1}],programId:this.programId,data:tt})}}StakeProgram.programId=new PublicKey("Stake11111111111111111111111111111111111111");StakeProgram.space=200;class VoteInit{constructor(j,$,_e,et){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=j,this.authorizedVoter=$,this.authorizedWithdrawer=_e,this.commission=et}}class VoteInstruction{constructor(){}static decodeInstructionType(j){this.checkProgramId(j.programId);const _e=u32("instruction").decode(j.data);let et;for(const[tt,nt]of Object.entries(VOTE_INSTRUCTION_LAYOUTS))if(nt.index==_e){et=tt;break}if(!et)throw new Error("Instruction type incorrect; not a VoteInstruction");return et}static decodeInitializeAccount(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,4);const{voteInit:$}=decodeData$1(VOTE_INSTRUCTION_LAYOUTS.InitializeAccount,j.data);return{votePubkey:j.keys[0].pubkey,nodePubkey:j.keys[3].pubkey,voteInit:new VoteInit(new PublicKey($.nodePubkey),new PublicKey($.authorizedVoter),new PublicKey($.authorizedWithdrawer),$.commission)}}static decodeAuthorize(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,3);const{newAuthorized:$,voteAuthorizationType:_e}=decodeData$1(VOTE_INSTRUCTION_LAYOUTS.Authorize,j.data);return{votePubkey:j.keys[0].pubkey,authorizedPubkey:j.keys[2].pubkey,newAuthorizedPubkey:new PublicKey($),voteAuthorizationType:{index:_e}}}static decodeAuthorizeWithSeed(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:$,currentAuthorityDerivedKeySeed:_e,newAuthorized:et,voteAuthorizationType:tt}}=decodeData$1(VOTE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed,j.data);return{currentAuthorityDerivedKeyBasePubkey:j.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new PublicKey($),currentAuthorityDerivedKeySeed:_e,newAuthorizedPubkey:new PublicKey(et),voteAuthorizationType:{index:tt},votePubkey:j.keys[0].pubkey}}static decodeWithdraw(j){this.checkProgramId(j.programId),this.checkKeyLength(j.keys,3);const{lamports:$}=decodeData$1(VOTE_INSTRUCTION_LAYOUTS.Withdraw,j.data);return{votePubkey:j.keys[0].pubkey,authorizedWithdrawerPubkey:j.keys[2].pubkey,lamports:$,toPubkey:j.keys[1].pubkey}}static checkProgramId(j){if(!j.equals(VoteProgram.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(j,$){if(j.length<$)throw new Error(`invalid instruction; found ${j.length} keys, expected at least ${$}`)}}const VOTE_INSTRUCTION_LAYOUTS=Object.freeze({InitializeAccount:{index:0,layout:struct([u32("instruction"),voteInit()])},Authorize:{index:1,layout:struct([u32("instruction"),publicKey("newAuthorized"),u32("voteAuthorizationType")])},Withdraw:{index:3,layout:struct([u32("instruction"),ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:struct([u32("instruction")])},AuthorizeWithSeed:{index:10,layout:struct([u32("instruction"),voteAuthorizeWithSeedArgs()])}}),VoteAuthorizationLayout=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class VoteProgram{constructor(){}static initializeAccount(j){const{votePubkey:$,nodePubkey:_e,voteInit:et}=j,tt=VOTE_INSTRUCTION_LAYOUTS.InitializeAccount,nt=encodeData(tt,{voteInit:{nodePubkey:toBuffer(et.nodePubkey.toBuffer()),authorizedVoter:toBuffer(et.authorizedVoter.toBuffer()),authorizedWithdrawer:toBuffer(et.authorizedWithdrawer.toBuffer()),commission:et.commission}}),rt={keys:[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_RENT_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:SYSVAR_CLOCK_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:_e,isSigner:!0,isWritable:!1}],programId:this.programId,data:nt};return new TransactionInstruction(rt)}static createAccount(j){const $=new Transaction;return $.add(SystemProgram.createAccount({fromPubkey:j.fromPubkey,newAccountPubkey:j.votePubkey,lamports:j.lamports,space:this.space,programId:this.programId})),$.add(this.initializeAccount({votePubkey:j.votePubkey,nodePubkey:j.voteInit.nodePubkey,voteInit:j.voteInit}))}static authorize(j){const{votePubkey:$,authorizedPubkey:_e,newAuthorizedPubkey:et,voteAuthorizationType:tt}=j,nt=VOTE_INSTRUCTION_LAYOUTS.Authorize,rt=encodeData(nt,{newAuthorized:toBuffer(et.toBuffer()),voteAuthorizationType:tt.index}),ot=[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_CLOCK_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:_e,isSigner:!0,isWritable:!1}];return new Transaction().add({keys:ot,programId:this.programId,data:rt})}static authorizeWithSeed(j){const{currentAuthorityDerivedKeyBasePubkey:$,currentAuthorityDerivedKeyOwnerPubkey:_e,currentAuthorityDerivedKeySeed:et,newAuthorizedPubkey:tt,voteAuthorizationType:nt,votePubkey:rt}=j,ot=VOTE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed,it=encodeData(ot,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:toBuffer(_e.toBuffer()),currentAuthorityDerivedKeySeed:et,newAuthorized:toBuffer(tt.toBuffer()),voteAuthorizationType:nt.index}}),st=[{pubkey:rt,isSigner:!1,isWritable:!0},{pubkey:SYSVAR_CLOCK_PUBKEY,isSigner:!1,isWritable:!1},{pubkey:$,isSigner:!0,isWritable:!1}];return new Transaction().add({keys:st,programId:this.programId,data:it})}static withdraw(j){const{votePubkey:$,authorizedWithdrawerPubkey:_e,lamports:et,toPubkey:tt}=j,nt=VOTE_INSTRUCTION_LAYOUTS.Withdraw,rt=encodeData(nt,{lamports:et}),ot=[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:tt,isSigner:!1,isWritable:!0},{pubkey:_e,isSigner:!0,isWritable:!1}];return new Transaction().add({keys:ot,programId:this.programId,data:rt})}static safeWithdraw(j,$,_e){if(j.lamports>$-_e)throw new Error("Withdraw will leave vote account with insufficient funds.");return VoteProgram.withdraw(j)}static updateValidatorIdentity(j){const{votePubkey:$,authorizedWithdrawerPubkey:_e,nodePubkey:et}=j,tt=VOTE_INSTRUCTION_LAYOUTS.UpdateValidatorIdentity,nt=encodeData(tt),rt=[{pubkey:$,isSigner:!1,isWritable:!0},{pubkey:et,isSigner:!0,isWritable:!1},{pubkey:_e,isSigner:!0,isWritable:!1}];return new Transaction().add({keys:rt,programId:this.programId,data:nt})}}VoteProgram.programId=new PublicKey("Vote111111111111111111111111111111111111111");VoteProgram.space=3762;const VALIDATOR_INFO_KEY=new PublicKey("Va1idator1nfo111111111111111111111111111111"),InfoString=type({name:string$1(),website:optional(string$1()),details:optional(string$1()),keybaseUsername:optional(string$1())});class ValidatorInfo{constructor(j,$){this.key=void 0,this.info=void 0,this.key=j,this.info=$}static fromConfigData(j){let $=[...j];if(decodeLength($)!==2)return null;const et=[];for(let tt=0;tt<2;tt++){const nt=new PublicKey(guardedSplice($,0,PUBLIC_KEY_LENGTH)),rt=guardedShift($)===1;et.push({publicKey:nt,isSigner:rt})}if(et[0].publicKey.equals(VALIDATOR_INFO_KEY)&&et[1].isSigner){const tt=rustString().decode(buffer.Buffer.from($)),nt=JSON.parse(tt);return assert$1(nt,InfoString),new ValidatorInfo(et[1].publicKey,nt)}return null}}const VOTE_PROGRAM_ID=new PublicKey("Vote111111111111111111111111111111111111111"),VoteAccountLayout=struct([publicKey("nodePubkey"),publicKey("authorizedWithdrawer"),u8("commission"),nu64(),seq(struct([nu64("slot"),u32("confirmationCount")]),offset(u32(),-8),"votes"),u8("rootSlotValid"),nu64("rootSlot"),nu64(),seq(struct([nu64("epoch"),publicKey("authorizedVoter")]),offset(u32(),-8),"authorizedVoters"),struct([seq(struct([publicKey("authorizedPubkey"),nu64("epochOfLastAuthorizedSwitch"),nu64("targetEpoch")]),32,"buf"),nu64("idx"),u8("isEmpty")],"priorVoters"),nu64(),seq(struct([nu64("epoch"),nu64("credits"),nu64("prevCredits")]),offset(u32(),-8),"epochCredits"),struct([nu64("slot"),nu64("timestamp")],"lastTimestamp")]);class VoteAccount{constructor(j){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=j.nodePubkey,this.authorizedWithdrawer=j.authorizedWithdrawer,this.commission=j.commission,this.rootSlot=j.rootSlot,this.votes=j.votes,this.authorizedVoters=j.authorizedVoters,this.priorVoters=j.priorVoters,this.epochCredits=j.epochCredits,this.lastTimestamp=j.lastTimestamp}static fromAccountData(j){const _e=VoteAccountLayout.decode(toBuffer(j),4);let et=_e.rootSlot;return _e.rootSlotValid||(et=null),new VoteAccount({nodePubkey:new PublicKey(_e.nodePubkey),authorizedWithdrawer:new PublicKey(_e.authorizedWithdrawer),commission:_e.commission,votes:_e.votes,rootSlot:et,authorizedVoters:_e.authorizedVoters.map(parseAuthorizedVoter),priorVoters:getPriorVoters(_e.priorVoters),epochCredits:_e.epochCredits,lastTimestamp:_e.lastTimestamp})}}function parseAuthorizedVoter({authorizedVoter:s,epoch:j}){return{epoch:j,authorizedVoter:new PublicKey(s)}}function parsePriorVoters({authorizedPubkey:s,epochOfLastAuthorizedSwitch:j,targetEpoch:$}){return{authorizedPubkey:new PublicKey(s),epochOfLastAuthorizedSwitch:j,targetEpoch:$}}function getPriorVoters({buf:s,idx:j,isEmpty:$}){return $?[]:[...s.slice(j+1).map(parsePriorVoters),...s.slice(0,j).map(parsePriorVoters)]}const endpoint={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function clusterApiUrl(s,j){const $=j===!1?"http":"https";if(!s)return endpoint[$].devnet;const _e=endpoint[$][s];if(!_e)throw new Error(`Unknown ${$} cluster: ${s}`);return _e}async function sendAndConfirmRawTransaction(s,j,$,_e){let et,tt;$&&Object.prototype.hasOwnProperty.call($,"lastValidBlockHeight")||$&&Object.prototype.hasOwnProperty.call($,"nonceValue")?(et=$,tt=_e):tt=$;const nt=tt&&{skipPreflight:tt.skipPreflight,preflightCommitment:tt.preflightCommitment||tt.commitment,minContextSlot:tt.minContextSlot},rt=await s.sendRawTransaction(j,nt),ot=tt&&tt.commitment,st=(await(et?s.confirmTransaction(et,ot):s.confirmTransaction(rt,ot))).value;if(st.err)throw new Error(`Raw transaction ${rt} failed (${JSON.stringify(st)})`);return rt}const LAMPORTS_PER_SOL=1e9,index_browser_esm=Object.freeze(Object.defineProperty({__proto__:null,Account,AddressLookupTableAccount,AddressLookupTableInstruction,AddressLookupTableProgram,Authorized,BLOCKHASH_CACHE_TIMEOUT_MS,BPF_LOADER_DEPRECATED_PROGRAM_ID,BPF_LOADER_PROGRAM_ID,BpfLoader,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS,ComputeBudgetInstruction,ComputeBudgetProgram,Connection,Ed25519Program,Enum,EpochSchedule,FeeCalculatorLayout,Keypair,LAMPORTS_PER_SOL,LOOKUP_TABLE_INSTRUCTION_LAYOUTS,Loader,Lockup,MAX_SEED_LENGTH,Message,MessageAccountKeys,MessageV0,NONCE_ACCOUNT_LENGTH,NonceAccount,PACKET_DATA_SIZE,PUBLIC_KEY_LENGTH,PublicKey,SIGNATURE_LENGTH_IN_BYTES,SOLANA_SCHEMA,STAKE_CONFIG_ID,STAKE_INSTRUCTION_LAYOUTS,SYSTEM_INSTRUCTION_LAYOUTS,SYSVAR_CLOCK_PUBKEY,SYSVAR_EPOCH_SCHEDULE_PUBKEY,SYSVAR_INSTRUCTIONS_PUBKEY,SYSVAR_RECENT_BLOCKHASHES_PUBKEY,SYSVAR_RENT_PUBKEY,SYSVAR_REWARDS_PUBKEY,SYSVAR_SLOT_HASHES_PUBKEY,SYSVAR_SLOT_HISTORY_PUBKEY,SYSVAR_STAKE_HISTORY_PUBKEY,Secp256k1Program,SendTransactionError,SolanaJSONRPCError,SolanaJSONRPCErrorCode,StakeAuthorizationLayout,StakeInstruction,StakeProgram,Struct,SystemInstruction,SystemProgram,Transaction,TransactionExpiredBlockheightExceededError,TransactionExpiredNonceInvalidError,TransactionExpiredTimeoutError,TransactionInstruction,TransactionMessage,TransactionStatus,VALIDATOR_INFO_KEY,VERSION_PREFIX_MASK,VOTE_PROGRAM_ID,ValidatorInfo,VersionedMessage,VersionedTransaction,VoteAccount,VoteAuthorizationLayout,VoteInit,VoteInstruction,VoteProgram,clusterApiUrl,sendAndConfirmRawTransaction,sendAndConfirmTransaction},Symbol.toStringTag,{value:"Module"})),require$$0$3=getAugmentedNamespace(index_browser_esm);function bind(s,j){return function(){return s.apply(j,arguments)}}const{toString:toString$1}=Object.prototype,{getPrototypeOf}=Object,kindOf=(s=>j=>{const $=toString$1.call(j);return s[$]||(s[$]=$.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=s=>(s=s.toLowerCase(),j=>kindOf(j)===s),typeOfTest=s=>j=>typeof j===s,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(s){return s!==null&&!isUndefined(s)&&s.constructor!==null&&!isUndefined(s.constructor)&&isFunction$1(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(s){let j;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?j=ArrayBuffer.isView(s):j=s&&s.buffer&&isArrayBuffer(s.buffer),j}const isString=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=s=>s!==null&&typeof s=="object",isBoolean=s=>s===!0||s===!1,isPlainObject=s=>{if(kindOf(s)!=="object")return!1;const j=getPrototypeOf(s);return(j===null||j===Object.prototype||Object.getPrototypeOf(j)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=s=>isObject(s)&&isFunction$1(s.pipe),isFormData=s=>{let j;return s&&(typeof FormData=="function"&&s instanceof FormData||isFunction$1(s.append)&&((j=kindOf(s))==="formdata"||j==="object"&&isFunction$1(s.toString)&&s.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(s,j,{allOwnKeys:$=!1}={}){if(s===null||typeof s>"u")return;let _e,et;if(typeof s!="object"&&(s=[s]),isArray(s))for(_e=0,et=s.length;_e0;)if(et=$[_e],j===et.toLowerCase())return et;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=s=>!isUndefined(s)&&s!==_global;function merge(){const{caseless:s}=isContextDefined(this)&&this||{},j={},$=(_e,et)=>{const tt=s&&findKey(j,et)||et;isPlainObject(j[tt])&&isPlainObject(_e)?j[tt]=merge(j[tt],_e):isPlainObject(_e)?j[tt]=merge({},_e):isArray(_e)?j[tt]=_e.slice():j[tt]=_e};for(let _e=0,et=arguments.length;_e(forEach(j,(et,tt)=>{$&&isFunction$1(et)?s[tt]=bind(et,$):s[tt]=et},{allOwnKeys:_e}),s),stripBOM=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),inherits=(s,j,$,_e)=>{s.prototype=Object.create(j.prototype,_e),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:j.prototype}),$&&Object.assign(s.prototype,$)},toFlatObject=(s,j,$,_e)=>{let et,tt,nt;const rt={};if(j=j||{},s==null)return j;do{for(et=Object.getOwnPropertyNames(s),tt=et.length;tt-- >0;)nt=et[tt],(!_e||_e(nt,s,j))&&!rt[nt]&&(j[nt]=s[nt],rt[nt]=!0);s=$!==!1&&getPrototypeOf(s)}while(s&&(!$||$(s,j))&&s!==Object.prototype);return j},endsWith=(s,j,$)=>{s=String(s),($===void 0||$>s.length)&&($=s.length),$-=j.length;const _e=s.indexOf(j,$);return _e!==-1&&_e===$},toArray=s=>{if(!s)return null;if(isArray(s))return s;let j=s.length;if(!isNumber(j))return null;const $=new Array(j);for(;j-- >0;)$[j]=s[j];return $},isTypedArray=(s=>j=>s&&j instanceof s)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(s,j)=>{const _e=(s&&s[Symbol.iterator]).call(s);let et;for(;(et=_e.next())&&!et.done;){const tt=et.value;j.call(s,tt[0],tt[1])}},matchAll=(s,j)=>{let $;const _e=[];for(;($=s.exec(j))!==null;)_e.push($);return _e},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function($,_e,et){return _e.toUpperCase()+et}),hasOwnProperty=(({hasOwnProperty:s})=>(j,$)=>s.call(j,$))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(s,j)=>{const $=Object.getOwnPropertyDescriptors(s),_e={};forEach($,(et,tt)=>{let nt;(nt=j(et,tt,s))!==!1&&(_e[tt]=nt||et)}),Object.defineProperties(s,_e)},freezeMethods=s=>{reduceDescriptors(s,(j,$)=>{if(isFunction$1(s)&&["arguments","caller","callee"].indexOf($)!==-1)return!1;const _e=s[$];if(isFunction$1(_e)){if(j.enumerable=!1,"writable"in j){j.writable=!1;return}j.set||(j.set=()=>{throw Error("Can not rewrite read-only method '"+$+"'")})}})},toObjectSet=(s,j)=>{const $={},_e=et=>{et.forEach(tt=>{$[tt]=!0})};return isArray(s)?_e(s):_e(String(s).split(j)),$},noop$1=()=>{},toFiniteNumber=(s,j)=>s!=null&&Number.isFinite(s=+s)?s:j,ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(s=16,j=ALPHABET.ALPHA_DIGIT)=>{let $="";const{length:_e}=j;for(;s--;)$+=j[Math.random()*_e|0];return $};function isSpecCompliantForm(s){return!!(s&&isFunction$1(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const toJSONObject=s=>{const j=new Array(10),$=(_e,et)=>{if(isObject(_e)){if(j.indexOf(_e)>=0)return;if(!("toJSON"in _e)){j[et]=_e;const tt=isArray(_e)?[]:{};return forEach(_e,(nt,rt)=>{const ot=$(nt,et+1);!isUndefined(ot)&&(tt[rt]=ot)}),j[et]=void 0,tt}}return _e};return $(s,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=s=>s&&(isObject(s)||isFunction$1(s))&&isFunction$1(s.then)&&isFunction$1(s.catch),utils$5={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isBoolean,isObject,isPlainObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$1,toFiniteNumber,findKey,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable};function AxiosError$1(s,j,$,_e,et){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",j&&(this.code=j),$&&(this.config=$),_e&&(this.request=_e),et&&(this.response=et)}utils$5.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$5.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{descriptors[s]={value:s}});Object.defineProperties(AxiosError$1,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError$1.from=(s,j,$,_e,et,tt)=>{const nt=Object.create(prototype$1);return utils$5.toFlatObject(s,nt,function(ot){return ot!==Error.prototype},rt=>rt!=="isAxiosError"),AxiosError$1.call(nt,s.message,j,$,_e,et),nt.cause=s,nt.name=s.name,tt&&Object.assign(nt,tt),nt};const httpAdapter=null;function isVisitable(s){return utils$5.isPlainObject(s)||utils$5.isArray(s)}function removeBrackets(s){return utils$5.endsWith(s,"[]")?s.slice(0,-2):s}function renderKey(s,j,$){return s?s.concat(j).map(function(et,tt){return et=removeBrackets(et),!$&&tt?"["+et+"]":et}).join($?".":""):j}function isFlatArray(s){return utils$5.isArray(s)&&!s.some(isVisitable)}const predicates=utils$5.toFlatObject(utils$5,{},null,function(j){return/^is[A-Z]/.test(j)});function toFormData$1(s,j,$){if(!utils$5.isObject(s))throw new TypeError("target must be an object");j=j||new FormData,$=utils$5.toFlatObject($,{metaTokens:!0,dots:!1,indexes:!1},!1,function(ft,gt){return!utils$5.isUndefined(gt[ft])});const _e=$.metaTokens,et=$.visitor||st,tt=$.dots,nt=$.indexes,ot=($.Blob||typeof Blob<"u"&&Blob)&&utils$5.isSpecCompliantForm(j);if(!utils$5.isFunction(et))throw new TypeError("visitor must be a function");function it(dt){if(dt===null)return"";if(utils$5.isDate(dt))return dt.toISOString();if(!ot&&utils$5.isBlob(dt))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$5.isArrayBuffer(dt)||utils$5.isTypedArray(dt)?ot&&typeof Blob=="function"?new Blob([dt]):Buffer.from(dt):dt}function st(dt,ft,gt){let ht=dt;if(dt&&!gt&&typeof dt=="object"){if(utils$5.endsWith(ft,"{}"))ft=_e?ft:ft.slice(0,-2),dt=JSON.stringify(dt);else if(utils$5.isArray(dt)&&isFlatArray(dt)||(utils$5.isFileList(dt)||utils$5.endsWith(ft,"[]"))&&(ht=utils$5.toArray(dt)))return ft=removeBrackets(ft),ht.forEach(function(pt,Mt){!(utils$5.isUndefined(pt)||pt===null)&&j.append(nt===!0?renderKey([ft],Mt,tt):nt===null?ft:ft+"[]",it(pt))}),!1}return isVisitable(dt)?!0:(j.append(renderKey(gt,ft,tt),it(dt)),!1)}const at=[],ct=Object.assign(predicates,{defaultVisitor:st,convertValue:it,isVisitable});function lt(dt,ft){if(!utils$5.isUndefined(dt)){if(at.indexOf(dt)!==-1)throw Error("Circular reference detected in "+ft.join("."));at.push(dt),utils$5.forEach(dt,function(ht,yt){(!(utils$5.isUndefined(ht)||ht===null)&&et.call(j,ht,utils$5.isString(yt)?yt.trim():yt,ft,ct))===!0&<(ht,ft?ft.concat(yt):[yt])}),at.pop()}}if(!utils$5.isObject(s))throw new TypeError("data must be an object");return lt(s),j}function encode$1(s){const j={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(_e){return j[_e]})}function AxiosURLSearchParams(s,j){this._pairs=[],s&&toFormData$1(s,this,j)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(j,$){this._pairs.push([j,$])};prototype.toString=function(j){const $=j?function(_e){return j.call(this,_e,encode$1)}:encode$1;return this._pairs.map(function(et){return $(et[0])+"="+$(et[1])},"").join("&")};function encode(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(s,j,$){if(!j)return s;const _e=$&&$.encode||encode,et=$&&$.serialize;let tt;if(et?tt=et(j,$):tt=utils$5.isURLSearchParams(j)?j.toString():new AxiosURLSearchParams(j,$).toString(_e),tt){const nt=s.indexOf("#");nt!==-1&&(s=s.slice(0,nt)),s+=(s.indexOf("?")===-1?"?":"&")+tt}return s}class InterceptorManager{constructor(){this.handlers=[]}use(j,$,_e){return this.handlers.push({fulfilled:j,rejected:$,synchronous:_e?_e.synchronous:!1,runWhen:_e?_e.runWhen:null}),this.handlers.length-1}eject(j){this.handlers[j]&&(this.handlers[j]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(j){utils$5.forEach(this.handlers,function(_e){_e!==null&&j(_e)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$2={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",hasStandardBrowserEnv=(s=>hasBrowserEnv&&["ReactNative","NativeScript","NS"].indexOf(s)<0)(typeof navigator<"u"&&navigator.product),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils$4=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,origin},Symbol.toStringTag,{value:"Module"})),platform$1={...utils$4,...platform$2};function toURLEncodedForm(s,j){return toFormData$1(s,new platform$1.classes.URLSearchParams,Object.assign({visitor:function($,_e,et,tt){return platform$1.isNode&&utils$5.isBuffer($)?(this.append(_e,$.toString("base64")),!1):tt.defaultVisitor.apply(this,arguments)}},j))}function parsePropPath(s){return utils$5.matchAll(/\w+|\[(\w*)]/g,s).map(j=>j[0]==="[]"?"":j[1]||j[0])}function arrayToObject(s){const j={},$=Object.keys(s);let _e;const et=$.length;let tt;for(_e=0;_e=$.length;return nt=!nt&&utils$5.isArray(et)?et.length:nt,ot?(utils$5.hasOwnProp(et,nt)?et[nt]=[et[nt],_e]:et[nt]=_e,!rt):((!et[nt]||!utils$5.isObject(et[nt]))&&(et[nt]=[]),j($,_e,et[nt],tt)&&utils$5.isArray(et[nt])&&(et[nt]=arrayToObject(et[nt])),!rt)}if(utils$5.isFormData(s)&&utils$5.isFunction(s.entries)){const $={};return utils$5.forEachEntry(s,(_e,et)=>{j(parsePropPath(_e),et,$,0)}),$}return null}function stringifySafely(s,j,$){if(utils$5.isString(s))try{return(j||JSON.parse)(s),utils$5.trim(s)}catch(_e){if(_e.name!=="SyntaxError")throw _e}return($||JSON.stringify)(s)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(j,$){const _e=$.getContentType()||"",et=_e.indexOf("application/json")>-1,tt=utils$5.isObject(j);if(tt&&utils$5.isHTMLForm(j)&&(j=new FormData(j)),utils$5.isFormData(j))return et?JSON.stringify(formDataToJSON(j)):j;if(utils$5.isArrayBuffer(j)||utils$5.isBuffer(j)||utils$5.isStream(j)||utils$5.isFile(j)||utils$5.isBlob(j)||utils$5.isReadableStream(j))return j;if(utils$5.isArrayBufferView(j))return j.buffer;if(utils$5.isURLSearchParams(j))return $.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),j.toString();let rt;if(tt){if(_e.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(j,this.formSerializer).toString();if((rt=utils$5.isFileList(j))||_e.indexOf("multipart/form-data")>-1){const ot=this.env&&this.env.FormData;return toFormData$1(rt?{"files[]":j}:j,ot&&new ot,this.formSerializer)}}return tt||et?($.setContentType("application/json",!1),stringifySafely(j)):j}],transformResponse:[function(j){const $=this.transitional||defaults.transitional,_e=$&&$.forcedJSONParsing,et=this.responseType==="json";if(utils$5.isResponse(j)||utils$5.isReadableStream(j))return j;if(j&&utils$5.isString(j)&&(_e&&!this.responseType||et)){const nt=!($&&$.silentJSONParsing)&&et;try{return JSON.parse(j)}catch(rt){if(nt)throw rt.name==="SyntaxError"?AxiosError$1.from(rt,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):rt}}return j}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform$1.classes.FormData,Blob:platform$1.classes.Blob},validateStatus:function(j){return j>=200&&j<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$5.forEach(["delete","get","head","post","put","patch"],s=>{defaults.headers[s]={}});const ignoreDuplicateOf=utils$5.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=s=>{const j={};let $,_e,et;return s&&s.split(` diff --git a/index.html b/index.html index 4429a7e1..8585cb17 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ Wormhole Dashboard - +