diff --git a/404/index.html b/404/index.html index 2e4f6adf..6f925136 100644 --- a/404/index.html +++ b/404/index.html @@ -1 +1 @@ -ZeroLend - Open Source Liquidity Protocol on Layer 2s
404 - Page not found

Page not found

Sorry, we couldn't find the page you were looking for.
We suggest you go back to the Dashboard.

Back to Dashboard
\ No newline at end of file +ZeroLend - Open Source Liquidity Protocol on Layer 2s
404 - Page not found

Page not found

Sorry, we couldn't find the page you were looking for.
We suggest you go back to the Dashboard.

Back to Dashboard
\ No newline at end of file diff --git a/500/index.html b/500/index.html index ec1d1c18..d32b0a7c 100644 --- a/500/index.html +++ b/500/index.html @@ -1 +1 @@ -ZeroLend - Open Source Liquidity Protocol on Layer 2s

Something went wrong

Sorry, an unexpected error happened. In the meantime you may try reloading the page, or come back later.

If the error continues to happen,
you may report it to this Discord channel.

\ No newline at end of file +ZeroLend - Open Source Liquidity Protocol on Layer 2s

Something went wrong

Sorry, an unexpected error happened. In the meantime you may try reloading the page, or come back later.

If the error continues to happen,
you may report it to this Discord channel.

\ No newline at end of file diff --git a/_next/static/FZyGxiOlU-PcElpme1JSJ/_buildManifest.js b/_next/static/MrdhaAqvvrDJCaKIXK10v/_buildManifest.js similarity index 96% rename from _next/static/FZyGxiOlU-PcElpme1JSJ/_buildManifest.js rename to _next/static/MrdhaAqvvrDJCaKIXK10v/_buildManifest.js index 4e71e71e..5fb537ae 100644 --- a/_next/static/FZyGxiOlU-PcElpme1JSJ/_buildManifest.js +++ b/_next/static/MrdhaAqvvrDJCaKIXK10v/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(s,a,e,t,c){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,a,"static/chunks/pages/index-13e07cdd7fa4fd33.js"],"/404":["static/chunks/pages/404-f4b88a564c047ba4.js"],"/500":["static/chunks/pages/500-a19eabc04f7ea09c.js"],"/_error":["static/chunks/pages/_error-deefae67ca062615.js"],"/dashboard":[s,a,"static/chunks/pages/dashboard-8305a6f866b53d01.js"],"/emission-voting":[e,"static/chunks/pages/emission-voting-e3b202549d72cfa9.js"],"/faucet":[s,"static/chunks/pages/faucet-c9a4a71b69414db8.js"],"/gravity":[s,"static/chunks/pages/gravity-95eb3d835ed5a865.js"],"/history":[s,"static/chunks/pages/history-459a10960ca59f58.js"],"/markets":["static/chunks/pages/markets-1d4e018a5baa8666.js"],"/reserve-overview":[t,c,"static/chunks/pages/reserve-overview-03358f03fe95009a.js"],"/rewards":["static/chunks/pages/rewards-056914751623a069.js"],"/stake":[e,"static/chunks/pages/stake-7035c12d20ea1efb.js"],"/strategy":["static/chunks/pages/strategy-63923b636e39126e.js"],"/strategy-overview":[t,"static/chunks/248-5aa8206b6ebf3409.js",c,"static/chunks/pages/strategy-overview-1625f9045563c94c.js"],"/trade":["static/chunks/4b358913-41db465c692e4c58.js","static/chunks/4-035baab1971d1d5f.js","static/chunks/pages/trade-f45298bec164b53a.js"],"/v3-migration":[s,"static/chunks/pages/v3-migration-c027b4b3fe06d268.js"],sortedPages:["/","/404","/500","/_app","/_error","/dashboard","/emission-voting","/faucet","/gravity","/history","/markets","/reserve-overview","/rewards","/stake","/strategy","/strategy-overview","/trade","/v3-migration"]}}("static/chunks/828-2b8a7f6ff4c2beb7.js","static/chunks/305-22078999a6d79e67.js","static/chunks/209-59adc69affd6999e.js","static/chunks/274-83c246377f0103f9.js","static/chunks/761-dd3884c827f9c573.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(s,a,e,t,c){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,a,"static/chunks/pages/index-13e07cdd7fa4fd33.js"],"/404":["static/chunks/pages/404-f4b88a564c047ba4.js"],"/500":["static/chunks/pages/500-a19eabc04f7ea09c.js"],"/_error":["static/chunks/pages/_error-deefae67ca062615.js"],"/dashboard":[s,a,"static/chunks/pages/dashboard-8305a6f866b53d01.js"],"/emission-voting":[e,"static/chunks/pages/emission-voting-e3b202549d72cfa9.js"],"/faucet":[s,"static/chunks/pages/faucet-c9a4a71b69414db8.js"],"/gravity":[s,"static/chunks/pages/gravity-95eb3d835ed5a865.js"],"/history":[s,"static/chunks/pages/history-459a10960ca59f58.js"],"/markets":["static/chunks/pages/markets-1d4e018a5baa8666.js"],"/reserve-overview":[t,c,"static/chunks/pages/reserve-overview-03358f03fe95009a.js"],"/rewards":["static/chunks/pages/rewards-386fb36f974e5785.js"],"/stake":[e,"static/chunks/pages/stake-7035c12d20ea1efb.js"],"/strategy":["static/chunks/pages/strategy-63923b636e39126e.js"],"/strategy-overview":[t,"static/chunks/248-5aa8206b6ebf3409.js",c,"static/chunks/pages/strategy-overview-1625f9045563c94c.js"],"/trade":["static/chunks/4b358913-41db465c692e4c58.js","static/chunks/4-035baab1971d1d5f.js","static/chunks/pages/trade-f45298bec164b53a.js"],"/v3-migration":[s,"static/chunks/pages/v3-migration-c027b4b3fe06d268.js"],sortedPages:["/","/404","/500","/_app","/_error","/dashboard","/emission-voting","/faucet","/gravity","/history","/markets","/reserve-overview","/rewards","/stake","/strategy","/strategy-overview","/trade","/v3-migration"]}}("static/chunks/828-2b8a7f6ff4c2beb7.js","static/chunks/305-22078999a6d79e67.js","static/chunks/209-59adc69affd6999e.js","static/chunks/274-83c246377f0103f9.js","static/chunks/761-dd3884c827f9c573.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/_next/static/FZyGxiOlU-PcElpme1JSJ/_middlewareManifest.js b/_next/static/MrdhaAqvvrDJCaKIXK10v/_middlewareManifest.js similarity index 100% rename from _next/static/FZyGxiOlU-PcElpme1JSJ/_middlewareManifest.js rename to _next/static/MrdhaAqvvrDJCaKIXK10v/_middlewareManifest.js diff --git a/_next/static/FZyGxiOlU-PcElpme1JSJ/_ssgManifest.js b/_next/static/MrdhaAqvvrDJCaKIXK10v/_ssgManifest.js similarity index 100% rename from _next/static/FZyGxiOlU-PcElpme1JSJ/_ssgManifest.js rename to _next/static/MrdhaAqvvrDJCaKIXK10v/_ssgManifest.js diff --git a/_next/static/chunks/pages/_app-3e4d6e61cff937c3.js b/_next/static/chunks/pages/_app-fc0f02f19ab0f102.js similarity index 74% rename from _next/static/chunks/pages/_app-3e4d6e61cff937c3.js rename to _next/static/chunks/pages/_app-fc0f02f19ab0f102.js index 0f62eb0d..aeb17cb4 100644 --- a/_next/static/chunks/pages/_app-3e4d6e61cff937c3.js +++ b/_next/static/chunks/pages/_app-fc0f02f19ab0f102.js @@ -148,4 +148,4 @@ right: 0; top: 0; } - `),_,(t.vars||t).palette.action.hover)));var T=o.forwardRef((function(e,t){const n=(0,p.Z)({props:e,name:"MuiSkeleton"}),{animation:o="pulse",className:a,component:u="span",height:l,style:d,variant:f="text",width:h}=n,b=(0,r.Z)(n,y),v=(0,i.Z)({},n,{animation:o,component:u,variant:f,hasChildren:Boolean(b.children)}),w=(e=>{const{classes:t,variant:n,animation:r,hasChildren:i,width:o,height:s}=e,a={root:["root",n,r,i&&"withChildren",i&&!o&&"fitContent",i&&!s&&"heightAuto"]};return(0,c.Z)(a,m,t)})(v);return(0,g.jsx)(k,(0,i.Z)({as:u,ref:t,className:(0,s.default)(w.root,a),ownerState:v},b,{style:(0,i.Z)({width:h,height:l},d)}))}))},17155:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var r=n(63366),i=n(87462),o=n(67294),s=n(86010),a=n(94780),c=n(23926),u=n(81719),l=n(62097),d=n(78884),f=n(26432),p=n(36622),h=n(61760),m=n(41796),g=n(70918),y=n(34867),b=n(1588);function v(e){return(0,y.Z)("MuiSnackbarContent",e)}(0,b.Z)("MuiSnackbarContent",["root","message","action"]);var w=n(85893);const x=["action","className","message","role"],A=(0,u.ZP)(g.Z,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(e,t)=>t.root})((({theme:e})=>{const t="light"===e.palette.mode?.8:.98,n=(0,m._4)(e.palette.background.default,t);return(0,i.Z)({},e.typography.body2,{color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(n),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})})),E=(0,u.ZP)("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0"}),_=(0,u.ZP)("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8});var k=o.forwardRef((function(e,t){const n=(0,d.Z)({props:e,name:"MuiSnackbarContent"}),{action:o,className:c,message:u,role:l="alert"}=n,f=(0,r.Z)(n,x),p=n,h=(e=>{const{classes:t}=e;return(0,a.Z)({root:["root"],action:["action"],message:["message"]},v,t)})(p);return(0,w.jsxs)(A,(0,i.Z)({role:l,square:!0,elevation:6,className:(0,s.default)(h.root,c),ownerState:p,ref:t},f,{children:[(0,w.jsx)(E,{className:h.message,ownerState:p,children:u}),o?(0,w.jsx)(_,{className:h.action,ownerState:p,children:o}):null]}))}));function T(e){return(0,y.Z)("MuiSnackbar",e)}(0,b.Z)("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const S=["onEnter","onExited"],C=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],I=(0,u.ZP)("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${(0,p.Z)(n.anchorOrigin.vertical)}${(0,p.Z)(n.anchorOrigin.horizontal)}`]]}})((({theme:e,ownerState:t})=>(0,i.Z)({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},"top"===t.anchorOrigin.vertical?{top:8}:{bottom:8},"left"===t.anchorOrigin.horizontal&&{justifyContent:"flex-start"},"right"===t.anchorOrigin.horizontal&&{justifyContent:"flex-end"},{[e.breakpoints.up("sm")]:(0,i.Z)({},"top"===t.anchorOrigin.vertical?{top:24}:{bottom:24},"center"===t.anchorOrigin.horizontal&&{left:"50%",right:"auto",transform:"translateX(-50%)"},"left"===t.anchorOrigin.horizontal&&{left:24,right:"auto"},"right"===t.anchorOrigin.horizontal&&{right:24,left:"auto"})})));var O=o.forwardRef((function(e,t){const n=(0,d.Z)({props:e,name:"MuiSnackbar"}),u=(0,l.Z)(),m={enter:u.transitions.duration.enteringScreen,exit:u.transitions.duration.leavingScreen},{action:g,anchorOrigin:{vertical:y,horizontal:b}={vertical:"bottom",horizontal:"left"},autoHideDuration:v=null,children:x,className:A,ClickAwayListenerProps:E,ContentProps:_,disableWindowBlurListener:O=!1,message:R,onBlur:D,onClose:P,onFocus:B,onMouseEnter:M,onMouseLeave:N,open:F,resumeHideDuration:L,TransitionComponent:j=h.Z,transitionDuration:U=m,TransitionProps:{onEnter:Z,onExited:H}={}}=n,z=(0,r.Z)(n.TransitionProps,S),G=(0,r.Z)(n,C),V=(0,i.Z)({},n,{anchorOrigin:{vertical:y,horizontal:b}}),W=(e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${(0,p.Z)(n.vertical)}${(0,p.Z)(n.horizontal)}`]};return(0,a.Z)(r,T,t)})(V),q=o.useRef(),[$,K]=o.useState(!0),Y=(0,f.Z)(((...e)=>{P&&P(...e)})),X=(0,f.Z)((e=>{P&&null!=e&&(clearTimeout(q.current),q.current=setTimeout((()=>{Y(null,"timeout")}),e))}));o.useEffect((()=>(F&&X(v),()=>{clearTimeout(q.current)})),[F,v,X]);const J=()=>{clearTimeout(q.current)},Q=o.useCallback((()=>{null!=v&&X(null!=L?L:.5*v)}),[v,L,X]);return o.useEffect((()=>{if(!O&&F)return window.addEventListener("focus",Q),window.addEventListener("blur",J),()=>{window.removeEventListener("focus",Q),window.removeEventListener("blur",J)}}),[O,Q,F]),o.useEffect((()=>{if(F)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"!==e.key&&"Esc"!==e.key||P&&P(e,"escapeKeyDown")}}),[$,F,P]),!F&&$?null:(0,w.jsx)(c.Z,(0,i.Z)({onClickAway:e=>{P&&P(e,"clickaway")}},E,{children:(0,w.jsx)(I,(0,i.Z)({className:(0,s.default)(W.root,A),onBlur:e=>{D&&D(e),Q()},onFocus:e=>{B&&B(e),J()},onMouseEnter:e=>{M&&M(e),J()},onMouseLeave:e=>{N&&N(e),Q()},ownerState:V,ref:t,role:"presentation"},G,{children:(0,w.jsx)(j,(0,i.Z)({appear:!0,in:F,timeout:U,direction:"top"===y?"down":"up",onEnter:(e,t)=>{K(!1),Z&&Z(e,t)},onExited:e=>{K(!0),H&&H(e)}},z,{children:x||(0,w.jsx)(k,(0,i.Z)({message:R,action:g},_))}))}))}))}))},9144:function(e,t,n){"use strict";var r=n(63366),i=n(87462),o=n(67294),s=n(95408),a=n(98700),c=n(39707),u=n(59766),l=n(81719),d=n(78884),f=n(85893);const p=["component","direction","spacing","divider","children"];function h(e,t){const n=o.Children.toArray(e).filter(Boolean);return n.reduce(((e,r,i)=>(e.push(r),i[t.root]})((({ownerState:e,theme:t})=>{let n=(0,i.Z)({display:"flex",flexDirection:"column"},(0,s.k9)({theme:t},(0,s.P$)({values:e.direction,breakpoints:t.breakpoints.values}),(e=>({flexDirection:e}))));if(e.spacing){const r=(0,a.hB)(t),i=Object.keys(t.breakpoints.values).reduce(((t,n)=>(("object"===typeof e.spacing&&null!=e.spacing[n]||"object"===typeof e.direction&&null!=e.direction[n])&&(t[n]=!0),t)),{}),o=(0,s.P$)({values:e.direction,base:i}),c=(0,s.P$)({values:e.spacing,base:i});"object"===typeof o&&Object.keys(o).forEach(((e,t,n)=>{if(!o[e]){const r=t>0?o[n[t-1]]:"column";o[e]=r}}));const l=(t,n)=>{return{"& > :not(style) + :not(style)":{margin:0,[`margin${i=n?o[n]:e.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[i]}`]:(0,a.NA)(r,t)}};var i};n=(0,u.Z)(n,(0,s.k9)({theme:t},c,l))}return n=(0,s.dt)(t.breakpoints,n),n})),g=o.forwardRef((function(e,t){const n=(0,d.Z)({props:e,name:"MuiStack"}),o=(0,c.Z)(n),{component:s="div",direction:a="column",spacing:u=0,divider:l,children:g}=o,y=(0,r.Z)(o,p),b={direction:a,spacing:u};return(0,f.jsx)(m,(0,i.Z)({as:s,ownerState:b,ref:t},y,{children:l?h(g,l):g}))}));t.Z=g},81645:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(87462),i=n(63366),o=n(67294),s=n(86010),a=n(94780),c=n(36622),u=n(78884),l=n(81719),d=n(34867);function f(e){return(0,d.Z)("MuiSvgIcon",e)}(0,n(1588).Z)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var p=n(85893);const h=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],m=(0,l.ZP)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${(0,c.Z)(n.color)}`],t[`fontSize${(0,c.Z)(n.fontSize)}`]]}})((({theme:e,ownerState:t})=>{var n,r,i,o,s,a,c,u,l,d,f,p,h,m,g,y,b;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:null==(n=e.transitions)||null==(r=n.create)?void 0:r.call(n,"fill",{duration:null==(i=e.transitions)||null==(o=i.duration)?void 0:o.shorter}),fontSize:{inherit:"inherit",small:(null==(s=e.typography)||null==(a=s.pxToRem)?void 0:a.call(s,20))||"1.25rem",medium:(null==(c=e.typography)||null==(u=c.pxToRem)?void 0:u.call(c,24))||"1.5rem",large:(null==(l=e.typography)||null==(d=l.pxToRem)?void 0:d.call(l,35))||"2.1875rem"}[t.fontSize],color:null!=(f=null==(p=(e.vars||e).palette)||null==(h=p[t.color])?void 0:h.main)?f:{action:null==(m=(e.vars||e).palette)||null==(g=m.action)?void 0:g.active,disabled:null==(y=(e.vars||e).palette)||null==(b=y.action)?void 0:b.disabled,inherit:void 0}[t.color]}})),g=o.forwardRef((function(e,t){const n=(0,u.Z)({props:e,name:"MuiSvgIcon"}),{children:o,className:l,color:d="inherit",component:g="svg",fontSize:y="medium",htmlColor:b,inheritViewBox:v=!1,titleAccess:w,viewBox:x="0 0 24 24"}=n,A=(0,i.Z)(n,h),E=(0,r.Z)({},n,{color:d,component:g,fontSize:y,instanceFontSize:e.fontSize,inheritViewBox:v,viewBox:x}),_={};v||(_.viewBox=x);const k=(e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root","inherit"!==t&&`color${(0,c.Z)(t)}`,`fontSize${(0,c.Z)(n)}`]};return(0,a.Z)(i,f,r)})(E);return(0,p.jsxs)(m,(0,r.Z)({as:g,className:(0,s.default)(k.root,l),focusable:"false",color:b,"aria-hidden":!w||void 0,role:w?"img":void 0,ref:t},_,A,{ownerState:E,children:[o,w?(0,p.jsx)("title",{children:w}):null]}))}));g.muiName="SvgIcon";var y=g},54181:function(e,t,n){"use strict";n.d(t,{Z:function(){return A}});var r=n(63366),i=n(87462),o=n(67294),s=n(86010),a=n(94780),c=n(41796),u=n(36622),l=n(37743),d=n(78884),f=n(81719),p=n(34867);function h(e){return(0,p.Z)("MuiSwitch",e)}var m=(0,n(1588).Z)("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),g=n(85893);const y=["className","color","edge","size","sx"],b=(0,f.ZP)("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${(0,u.Z)(n.edge)}`],t[`size${(0,u.Z)(n.size)}`]]}})((({ownerState:e})=>(0,i.Z)({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},"start"===e.edge&&{marginLeft:-8},"end"===e.edge&&{marginRight:-8},"small"===e.size&&{width:40,height:24,padding:7,[`& .${m.thumb}`]:{width:16,height:16},[`& .${m.switchBase}`]:{padding:4,[`&.${m.checked}`]:{transform:"translateX(16px)"}}}))),v=(0,f.ZP)(l.Z,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${m.input}`]:t.input},"default"!==n.color&&t[`color${(0,u.Z)(n.color)}`]]}})((({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${"light"===e.palette.mode?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${m.checked}`]:{transform:"translateX(20px)"},[`&.${m.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${"light"===e.palette.mode?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${m.checked} + .${m.track}`]:{opacity:.5},[`&.${m.disabled} + .${m.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:""+("light"===e.palette.mode?.12:.2)},[`& .${m.input}`]:{left:"-100%",width:"300%"}})),(({theme:e,ownerState:t})=>(0,i.Z)({"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,c.Fq)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==t.color&&{[`&.${m.checked}`]:{color:(e.vars||e).palette[t.color].main,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,c.Fq)(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${m.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t.color}DisabledColor`]:`${"light"===e.palette.mode?(0,c.$n)(e.palette[t.color].main,.62):(0,c._j)(e.palette[t.color].main,.55)}`}},[`&.${m.checked} + .${m.track}`]:{backgroundColor:(e.vars||e).palette[t.color].main}}))),w=(0,f.ZP)("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,t)=>t.track})((({theme:e})=>({height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${"light"===e.palette.mode?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:""+("light"===e.palette.mode?.38:.3)}))),x=(0,f.ZP)("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})((({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})));var A=o.forwardRef((function(e,t){const n=(0,d.Z)({props:e,name:"MuiSwitch"}),{className:o,color:c="primary",edge:l=!1,size:f="medium",sx:p}=n,m=(0,r.Z)(n,y),A=(0,i.Z)({},n,{color:c,edge:l,size:f}),E=(e=>{const{classes:t,edge:n,size:r,color:o,checked:s,disabled:c}=e,l={root:["root",n&&`edge${(0,u.Z)(n)}`,`size${(0,u.Z)(r)}`],switchBase:["switchBase",`color${(0,u.Z)(o)}`,s&&"checked",c&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},d=(0,a.Z)(l,h,t);return(0,i.Z)({},t,d)})(A),_=(0,g.jsx)(x,{className:E.thumb,ownerState:A});return(0,g.jsxs)(b,{className:(0,s.default)(E.root,o),sx:p,ownerState:A,children:[(0,g.jsx)(v,(0,i.Z)({type:"checkbox",icon:_,checkedIcon:_,ref:t,ownerState:A},m,{classes:(0,i.Z)({},E,{root:E.switchBase})})),(0,g.jsx)(w,{className:E.track,ownerState:A})]})}))},87054:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(63366),i=n(87462),o=n(67294),s=n(86010),a=n(94780),c=n(41796),u=n(83187),l=n(36622),d=n(78884),f=n(81719),p=n(34867);function h(e){return(0,p.Z)("MuiToggleButton",e)}var m=(0,n(1588).Z)("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),g=n(85893);const y=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],b=(0,f.ZP)(u.Z,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`size${(0,l.Z)(n.size)}`]]}})((({theme:e,ownerState:t})=>{let n,r="standard"===t.color?e.palette.text.primary:e.palette[t.color].main;return e.vars&&(r="standard"===t.color?e.vars.palette.text.primary:e.vars.palette[t.color].main,n="standard"===t.color?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),(0,i.Z)({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${m.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,c.Fq)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${m.selected}`]:{color:r,backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:(0,c.Fq)(r,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${n} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,c.Fq)(r,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:(0,c.Fq)(r,e.palette.action.selectedOpacity)}}}},"small"===t.size&&{padding:7,fontSize:e.typography.pxToRem(13)},"large"===t.size&&{padding:15,fontSize:e.typography.pxToRem(15)})}));var v=o.forwardRef((function(e,t){const n=(0,d.Z)({props:e,name:"MuiToggleButton"}),{children:o,className:c,color:u="standard",disabled:f=!1,disableFocusRipple:p=!1,fullWidth:m=!1,onChange:v,onClick:w,selected:x,size:A="medium",value:E}=n,_=(0,r.Z)(n,y),k=(0,i.Z)({},n,{color:u,disabled:f,disableFocusRipple:p,fullWidth:m,size:A}),T=(e=>{const{classes:t,fullWidth:n,selected:r,disabled:i,size:o,color:s}=e,c={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${(0,l.Z)(o)}`,s]};return(0,a.Z)(c,h,t)})(k);return(0,g.jsx)(b,(0,i.Z)({className:(0,s.default)(T.root,c),disabled:f,focusRipple:!p,ref:t,onClick:e=>{w&&(w(e,E),e.defaultPrevented)||v&&v(e,E)},onChange:v,value:E,ownerState:k,"aria-pressed":x},_,{children:o}))}))},85390:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(63366),i=n(87462),o=n(67294),s=(n(59864),n(86010)),a=n(94780),c=n(81719),u=n(78884),l=n(36622);function d(e,t){return void 0!==t&&void 0!==e&&(Array.isArray(t)?t.indexOf(e)>=0:e===t)}var f=n(34867);function p(e){return(0,f.Z)("MuiToggleButtonGroup",e)}var h=(0,n(1588).Z)("MuiToggleButtonGroup",["root","selected","vertical","disabled","grouped","groupedHorizontal","groupedVertical"]),m=n(85893);const g=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],y=(0,c.ZP)("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${h.grouped}`]:t.grouped},{[`& .${h.grouped}`]:t[`grouped${(0,l.Z)(n.orientation)}`]},t.root,"vertical"===n.orientation&&t.vertical,n.fullWidth&&t.fullWidth]}})((({ownerState:e,theme:t})=>(0,i.Z)({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius},"vertical"===e.orientation&&{flexDirection:"column"},e.fullWidth&&{width:"100%"},{[`& .${h.grouped}`]:(0,i.Z)({},"horizontal"===e.orientation?{"&:not(:first-of-type)":{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0},[`&.${h.selected} + .${h.grouped}.${h.selected}`]:{borderLeft:0,marginLeft:0}}:{"&:not(:first-of-type)":{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},"&:not(:last-of-type)":{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`&.${h.selected} + .${h.grouped}.${h.selected}`]:{borderTop:0,marginTop:0}})})));var b=o.forwardRef((function(e,t){const n=(0,u.Z)({props:e,name:"MuiToggleButtonGroup"}),{children:c,className:f,color:h="standard",disabled:b=!1,exclusive:v=!1,fullWidth:w=!1,onChange:x,orientation:A="horizontal",size:E="medium",value:_}=n,k=(0,r.Z)(n,g),T=(0,i.Z)({},n,{disabled:b,fullWidth:w,orientation:A,size:E}),S=(e=>{const{classes:t,orientation:n,fullWidth:r,disabled:i}=e,o={root:["root","vertical"===n&&"vertical",r&&"fullWidth"],grouped:["grouped",`grouped${(0,l.Z)(n)}`,i&&"disabled"]};return(0,a.Z)(o,p,t)})(T),C=(e,t)=>{if(!x)return;const n=_&&_.indexOf(t);let r;_&&n>=0?(r=_.slice(),r.splice(n,1)):r=_?_.concat(t):[t],x(e,r)},I=(e,t)=>{x&&x(e,_===t?null:t)};return(0,m.jsx)(y,(0,i.Z)({role:"group",className:(0,s.default)(S.root,f),ref:t,ownerState:T},k,{children:o.Children.map(c,(e=>o.isValidElement(e)?o.cloneElement(e,{className:(0,s.default)(S.grouped,e.props.className),onChange:v?I:C,selected:void 0===e.props.selected?d(e.props.value,_):e.props.selected,size:e.props.size||E,fullWidth:w,color:e.props.color||h,disabled:e.props.disabled||b}):null))}))}))},72389:function(e,t,n){"use strict";n.d(t,{Z:function(){return D}});var r=n(63366),i=n(87462),o=n(67294),s=n(86010),a=n(94780),c=n(10238),u=n(41796),l=n(81719),d=n(62097),f=n(78884),p=n(36622),h=n(61760),m=n(58402),g=n(26432),y=n(84771),b=n(49669),v=n(40011),w=n(42293),x=n(34867);function A(e){return(0,x.Z)("MuiTooltip",e)}var E=(0,n(1588).Z)("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),_=n(85893);const k=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","title","TransitionComponent","TransitionProps"];const T=(0,l.ZP)(m.Z,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})((({theme:e,ownerState:t,open:n})=>(0,i.Z)({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${E.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${E.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${E.arrow}`]:(0,i.Z)({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${E.arrow}`]:(0,i.Z)({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})}))),S=(0,l.ZP)("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${(0,p.Z)(n.placement.split("-")[0])}`]]}})((({theme:e,ownerState:t})=>{return(0,i.Z)({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:(0,u.Fq)(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:(n=16/14,Math.round(1e5*n)/1e5)+"em",fontWeight:e.typography.fontWeightRegular},{[`.${E.popper}[data-popper-placement*="left"] &`]:(0,i.Z)({transformOrigin:"right center"},t.isRtl?(0,i.Z)({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):(0,i.Z)({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${E.popper}[data-popper-placement*="right"] &`]:(0,i.Z)({transformOrigin:"left center"},t.isRtl?(0,i.Z)({marginRight:"14px"},t.touch&&{marginRight:"24px"}):(0,i.Z)({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${E.popper}[data-popper-placement*="top"] &`]:(0,i.Z)({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${E.popper}[data-popper-placement*="bottom"] &`]:(0,i.Z)({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})});var n})),C=(0,l.ZP)("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})((({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:(0,u.Fq)(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let I=!1,O=null;function R(e,t){return n=>{t&&t(n),e(n)}}var D=o.forwardRef((function(e,t){var n,u,l,x,E,D;const P=(0,f.Z)({props:e,name:"MuiTooltip"}),{arrow:B=!1,children:M,components:N={},componentsProps:F={},describeChild:L=!1,disableFocusListener:j=!1,disableHoverListener:U=!1,disableInteractive:Z=!1,disableTouchListener:H=!1,enterDelay:z=100,enterNextDelay:G=0,enterTouchDelay:V=700,followCursor:W=!1,id:q,leaveDelay:$=0,leaveTouchDelay:K=1500,onClose:Y,onOpen:X,open:J,placement:Q="bottom",PopperComponent:ee,PopperProps:te={},title:ne,TransitionComponent:re=h.Z,TransitionProps:ie}=P,oe=(0,r.Z)(P,k),se=(0,d.Z)(),ae="rtl"===se.direction,[ce,ue]=o.useState(),[le,de]=o.useState(null),fe=o.useRef(!1),pe=Z||W,he=o.useRef(),me=o.useRef(),ge=o.useRef(),ye=o.useRef(),[be,ve]=(0,w.Z)({controlled:J,default:!1,name:"Tooltip",state:"open"});let we=be;const xe=(0,b.Z)(q),Ae=o.useRef(),Ee=o.useCallback((()=>{void 0!==Ae.current&&(document.body.style.WebkitUserSelect=Ae.current,Ae.current=void 0),clearTimeout(ye.current)}),[]);o.useEffect((()=>()=>{clearTimeout(he.current),clearTimeout(me.current),clearTimeout(ge.current),Ee()}),[Ee]);const _e=e=>{clearTimeout(O),I=!0,ve(!0),X&&!we&&X(e)},ke=(0,g.Z)((e=>{clearTimeout(O),O=setTimeout((()=>{I=!1}),800+$),ve(!1),Y&&we&&Y(e),clearTimeout(he.current),he.current=setTimeout((()=>{fe.current=!1}),se.transitions.duration.shortest)})),Te=e=>{fe.current&&"touchstart"!==e.type||(ce&&ce.removeAttribute("title"),clearTimeout(me.current),clearTimeout(ge.current),z||I&&G?me.current=setTimeout((()=>{_e(e)}),I?G:z):_e(e))},Se=e=>{clearTimeout(me.current),clearTimeout(ge.current),ge.current=setTimeout((()=>{ke(e)}),$)},{isFocusVisibleRef:Ce,onBlur:Ie,onFocus:Oe,ref:Re}=(0,v.Z)(),[,De]=o.useState(!1),Pe=e=>{Ie(e),!1===Ce.current&&(De(!1),Se(e))},Be=e=>{ce||ue(e.currentTarget),Oe(e),!0===Ce.current&&(De(!0),Te(e))},Me=e=>{fe.current=!0;const t=M.props;t.onTouchStart&&t.onTouchStart(e)},Ne=Te,Fe=Se,Le=e=>{Me(e),clearTimeout(ge.current),clearTimeout(he.current),Ee(),Ae.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ye.current=setTimeout((()=>{document.body.style.WebkitUserSelect=Ae.current,Te(e)}),V)},je=e=>{M.props.onTouchEnd&&M.props.onTouchEnd(e),Ee(),clearTimeout(ge.current),ge.current=setTimeout((()=>{ke(e)}),K)};o.useEffect((()=>{if(we)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"!==e.key&&"Esc"!==e.key||ke(e)}}),[ke,we]);const Ue=(0,y.Z)(M.ref,Re,ue,t);"number"===typeof ne||ne||(we=!1);const Ze=o.useRef({x:0,y:0}),He=o.useRef(),ze={},Ge="string"===typeof ne;L?(ze.title=we||!Ge||U?null:ne,ze["aria-describedby"]=we?xe:null):(ze["aria-label"]=Ge?ne:null,ze["aria-labelledby"]=we&&!Ge?xe:null);const Ve=(0,i.Z)({},ze,oe,M.props,{className:(0,s.default)(oe.className,M.props.className),onTouchStart:Me,ref:Ue},W?{onMouseMove:e=>{const t=M.props;t.onMouseMove&&t.onMouseMove(e),Ze.current={x:e.clientX,y:e.clientY},He.current&&He.current.update()}}:{});const We={};H||(Ve.onTouchStart=Le,Ve.onTouchEnd=je),U||(Ve.onMouseOver=R(Ne,Ve.onMouseOver),Ve.onMouseLeave=R(Fe,Ve.onMouseLeave),pe||(We.onMouseOver=Ne,We.onMouseLeave=Fe)),j||(Ve.onFocus=R(Be,Ve.onFocus),Ve.onBlur=R(Pe,Ve.onBlur),pe||(We.onFocus=Be,We.onBlur=Pe));const qe=o.useMemo((()=>{var e;let t=[{name:"arrow",enabled:Boolean(le),options:{element:le,padding:4}}];return null!=(e=te.popperOptions)&&e.modifiers&&(t=t.concat(te.popperOptions.modifiers)),(0,i.Z)({},te.popperOptions,{modifiers:t})}),[le,te]),$e=(0,i.Z)({},P,{isRtl:ae,arrow:B,disableInteractive:pe,placement:Q,PopperComponentProp:ee,touch:fe.current}),Ke=(e=>{const{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,s={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${(0,p.Z)(o.split("-")[0])}`],arrow:["arrow"]};return(0,a.Z)(s,A,t)})($e),Ye=null!=(n=N.Popper)?n:T,Xe=null!=(u=null!=(l=N.Transition)?l:re)?u:h.Z,Je=null!=(x=N.Tooltip)?x:S,Qe=null!=(E=N.Arrow)?E:C,et=(0,c.Z)(Ye,(0,i.Z)({},te,F.popper),$e),tt=(0,c.Z)(Xe,(0,i.Z)({},ie,F.transition),$e),nt=(0,c.Z)(Je,(0,i.Z)({},F.tooltip),$e),rt=(0,c.Z)(Qe,(0,i.Z)({},F.arrow),$e);return(0,_.jsxs)(o.Fragment,{children:[o.cloneElement(M,Ve),(0,_.jsx)(Ye,(0,i.Z)({as:null!=ee?ee:m.Z,placement:Q,anchorEl:W?{getBoundingClientRect:()=>({top:Ze.current.y,left:Ze.current.x,right:Ze.current.x,bottom:Ze.current.y,width:0,height:0})}:ce,popperRef:He,open:!!ce&&we,id:xe,transition:!0},We,et,{className:(0,s.default)(Ke.popper,null==te?void 0:te.className,null==(D=F.popper)?void 0:D.className),popperOptions:qe,children:({TransitionProps:e})=>{var t,n;return(0,_.jsx)(Xe,(0,i.Z)({timeout:se.transitions.duration.shorter},e,tt,{children:(0,_.jsxs)(Je,(0,i.Z)({},nt,{className:(0,s.default)(Ke.tooltip,null==(t=F.tooltip)?void 0:t.className),children:[ne,B?(0,_.jsx)(Qe,(0,i.Z)({},rt,{className:(0,s.default)(Ke.arrow,null==(n=F.arrow)?void 0:n.className),ref:de})):null]}))}))}}))]})}))},29630:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(63366),i=n(87462),o=n(67294),s=n(86010),a=n(39707),c=n(94780),u=n(81719),l=n(78884),d=n(36622),f=n(34867);function p(e){return(0,f.Z)("MuiTypography",e)}(0,n(1588).Z)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);var h=n(85893);const m=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],g=(0,u.ZP)("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${(0,d.Z)(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})((({theme:e,ownerState:t})=>(0,i.Z)({margin:0},t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16}))),y={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},b={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"};var v=o.forwardRef((function(e,t){const n=(0,l.Z)({props:e,name:"MuiTypography"}),o=(e=>b[e]||e)(n.color),u=(0,a.Z)((0,i.Z)({},n,{color:o})),{align:f="inherit",className:v,component:w,gutterBottom:x=!1,noWrap:A=!1,paragraph:E=!1,variant:_="body1",variantMapping:k=y}=u,T=(0,r.Z)(u,m),S=(0,i.Z)({},u,{align:f,color:o,className:v,component:w,gutterBottom:x,noWrap:A,paragraph:E,variant:_,variantMapping:k}),C=w||(E?"p":k[_]||y[_])||"span",I=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=e,a={root:["root",o,"inherit"!==e.align&&`align${(0,d.Z)(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return(0,c.Z)(a,p,s)})(S);return(0,h.jsx)(g,(0,i.Z)({as:C,ref:t,ownerState:S,className:(0,s.default)(I.root,v)},T))}))},37743:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(63366),i=n(87462),o=n(67294),s=n(86010),a=n(94780),c=n(36622),u=n(81719),l=n(42293),d=n(59711),f=n(83187),p=n(34867);function h(e){return(0,p.Z)("PrivateSwitchBase",e)}(0,n(1588).Z)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);var m=n(85893);const g=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],y=(0,u.ZP)(f.Z)((({ownerState:e})=>(0,i.Z)({padding:9,borderRadius:"50%"},"start"===e.edge&&{marginLeft:"small"===e.size?-3:-12},"end"===e.edge&&{marginRight:"small"===e.size?-3:-12}))),b=(0,u.ZP)("input")({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1});var v=o.forwardRef((function(e,t){const{autoFocus:n,checked:o,checkedIcon:u,className:f,defaultChecked:p,disabled:v,disableFocusRipple:w=!1,edge:x=!1,icon:A,id:E,inputProps:_,inputRef:k,name:T,onBlur:S,onChange:C,onFocus:I,readOnly:O,required:R,tabIndex:D,type:P,value:B}=e,M=(0,r.Z)(e,g),[N,F]=(0,l.Z)({controlled:o,default:Boolean(p),name:"SwitchBase",state:"checked"}),L=(0,d.Z)();let j=v;L&&"undefined"===typeof j&&(j=L.disabled);const U="checkbox"===P||"radio"===P,Z=(0,i.Z)({},e,{checked:N,disabled:j,disableFocusRipple:w,edge:x}),H=(e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${(0,c.Z)(i)}`],input:["input"]};return(0,a.Z)(o,h,t)})(Z);return(0,m.jsxs)(y,(0,i.Z)({component:"span",className:(0,s.default)(H.root,f),centerRipple:!0,focusRipple:!w,disabled:j,tabIndex:null,role:void 0,onFocus:e=>{I&&I(e),L&&L.onFocus&&L.onFocus(e)},onBlur:e=>{S&&S(e),L&&L.onBlur&&L.onBlur(e)},ownerState:Z,ref:t},M,{children:[(0,m.jsx)(b,(0,i.Z)({autoFocus:n,checked:o,defaultChecked:p,className:H.input,disabled:j,id:U&&E,name:T,onChange:e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;F(t),C&&C(e,t)},readOnly:O,ref:k,required:R,ownerState:Z,tabIndex:D,type:P},"checkbox"===P&&void 0===B?{}:{value:B},_)),N?u:A]}))}))},19762:function(e,t,n){"use strict";n.d(t,{Z:function(){return F}});var r=n(87462),i=n(63366),o=n(71387),s=n(59766),a=n(66500);var c=n(41796);var u={black:"#000",white:"#fff"};var l={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};var d={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"};var f={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"};var p={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"};var h={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"};var m={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"};var g={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};const y=["mode","contrastThreshold","tonalOffset"],b={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:u.white,default:u.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},v={text:{primary:u.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:u.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function w(e,t,n,r){const i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,c.$n)(e.main,i):"dark"===t&&(e.dark=(0,c._j)(e.main,o)))}function x(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:a=.2}=e,x=(0,i.Z)(e,y),A=e.primary||function(e="light"){return"dark"===e?{main:h[200],light:h[50],dark:h[400]}:{main:h[700],light:h[400],dark:h[800]}}(t),E=e.secondary||function(e="light"){return"dark"===e?{main:d[200],light:d[50],dark:d[400]}:{main:d[500],light:d[300],dark:d[700]}}(t),_=e.error||function(e="light"){return"dark"===e?{main:f[500],light:f[300],dark:f[700]}:{main:f[700],light:f[400],dark:f[800]}}(t),k=e.info||function(e="light"){return"dark"===e?{main:m[400],light:m[300],dark:m[700]}:{main:m[700],light:m[500],dark:m[900]}}(t),T=e.success||function(e="light"){return"dark"===e?{main:g[400],light:g[300],dark:g[700]}:{main:g[800],light:g[500],dark:g[900]}}(t),S=e.warning||function(e="light"){return"dark"===e?{main:p[400],light:p[300],dark:p[700]}:{main:"#ed6c02",light:p[500],dark:p[900]}}(t);function C(e){return(0,c.mi)(e,v.text.primary)>=n?v.text.primary:b.text.primary}const I=({color:e,name:t,mainShade:n=500,lightShade:i=300,darkShade:s=700})=>{if(!(e=(0,r.Z)({},e)).main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty("main"))throw new Error((0,o.Z)(11,t?` (${t})`:"",n));if("string"!==typeof e.main)throw new Error((0,o.Z)(12,t?` (${t})`:"",JSON.stringify(e.main)));return w(e,"light",i,a),w(e,"dark",s,a),e.contrastText||(e.contrastText=C(e.main)),e},O={dark:v,light:b};return(0,s.Z)((0,r.Z)({common:(0,r.Z)({},u),mode:t,primary:I({color:A,name:"primary"}),secondary:I({color:E,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:I({color:_,name:"error"}),warning:I({color:S,name:"warning"}),info:I({color:k,name:"info"}),success:I({color:T,name:"success"}),grey:l,contrastThreshold:n,getContrastText:C,augmentColor:I,tonalOffset:a},O[t]),x)}const A=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];const E={textTransform:"uppercase"},_='"Roboto", "Helvetica", "Arial", sans-serif';function k(e,t){const n="function"===typeof t?t(e):t,{fontFamily:o=_,fontSize:a=14,fontWeightLight:c=300,fontWeightRegular:u=400,fontWeightMedium:l=500,fontWeightBold:d=700,htmlFontSize:f=16,allVariants:p,pxToRem:h}=n,m=(0,i.Z)(n,A);const g=a/14,y=h||(e=>e/f*g+"rem"),b=(e,t,n,i,s)=>{return(0,r.Z)({fontFamily:o,fontWeight:e,fontSize:y(t),lineHeight:n},o===_?{letterSpacing:(a=i/t,Math.round(1e5*a)/1e5)+"em"}:{},s,p);var a},v={h1:b(c,96,1.167,-1.5),h2:b(c,60,1.2,-.5),h3:b(u,48,1.167,0),h4:b(u,34,1.235,.25),h5:b(u,24,1.334,0),h6:b(l,20,1.6,.15),subtitle1:b(u,16,1.75,.15),subtitle2:b(l,14,1.57,.1),body1:b(u,16,1.5,.15),body2:b(u,14,1.43,.15),button:b(l,14,1.75,.4,E),caption:b(u,12,1.66,.4),overline:b(u,12,2.66,1,E)};return(0,s.Z)((0,r.Z)({htmlFontSize:f,pxToRem:y,fontFamily:o,fontSize:a,fontWeightLight:c,fontWeightRegular:u,fontWeightMedium:l,fontWeightBold:d},v),m,{clone:!1})}function T(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}var S=["none",T(0,2,1,-1,0,1,1,0,0,1,3,0),T(0,3,1,-2,0,2,2,0,0,1,5,0),T(0,3,3,-2,0,3,4,0,0,1,8,0),T(0,2,4,-1,0,4,5,0,0,1,10,0),T(0,3,5,-1,0,5,8,0,0,1,14,0),T(0,3,5,-1,0,6,10,0,0,1,18,0),T(0,4,5,-2,0,7,10,1,0,2,16,1),T(0,5,5,-3,0,8,10,1,0,3,14,2),T(0,5,6,-3,0,9,12,1,0,3,16,2),T(0,6,6,-3,0,10,14,1,0,4,18,3),T(0,6,7,-4,0,11,15,1,0,4,20,3),T(0,7,8,-4,0,12,17,2,0,5,22,4),T(0,7,8,-4,0,13,19,2,0,5,24,4),T(0,7,9,-4,0,14,21,2,0,5,26,4),T(0,8,9,-5,0,15,22,2,0,6,28,5),T(0,8,10,-5,0,16,24,2,0,6,30,5),T(0,8,11,-5,0,17,26,2,0,6,32,5),T(0,9,11,-5,0,18,28,2,0,7,34,6),T(0,9,12,-6,0,19,29,2,0,7,36,6),T(0,10,13,-6,0,20,31,3,0,8,38,7),T(0,10,13,-6,0,21,33,3,0,8,40,7),T(0,10,14,-6,0,22,35,3,0,8,42,7),T(0,11,14,-7,0,23,36,3,0,9,44,8),T(0,11,15,-7,0,24,38,3,0,9,46,8)];const C=["duration","easing","delay"],I={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},O={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function R(e){return`${Math.round(e)}ms`}function D(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function P(e){const t=(0,r.Z)({},I,e.easing),n=(0,r.Z)({},O,e.duration);return(0,r.Z)({getAutoHeightDuration:D,create:(e=["all"],r={})=>{const{duration:o=n.standard,easing:s=t.easeInOut,delay:a=0}=r;(0,i.Z)(r,C);return(Array.isArray(e)?e:[e]).map((e=>`${e} ${"string"===typeof o?o:R(o)} ${s} ${"string"===typeof a?a:R(a)}`)).join(",")}},e,{easing:t,duration:n})}var B={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};const M=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function N(e={},...t){const{mixins:n={},palette:c={},transitions:u={},typography:l={}}=e,d=(0,i.Z)(e,M);if(e.vars)throw new Error((0,o.Z)(18));const f=x(c),p=(0,a.Z)(e);let h=(0,s.Z)(p,{mixins:(m=p.breakpoints,g=n,(0,r.Z)({toolbar:{minHeight:56,[m.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[m.up("sm")]:{minHeight:64}}},g)),palette:f,shadows:S.slice(),typography:k(f,l),transitions:P(u),zIndex:(0,r.Z)({},B)});var m,g;return h=(0,s.Z)(h,d),h=t.reduce(((e,t)=>(0,s.Z)(e,t)),h),h}var F=N},25165:function(e,t,n){"use strict";const r=(0,n(19762).Z)();t.Z=r},81719:function(e,t,n){"use strict";n.d(t,{FO:function(){return o},Dz:function(){return s}});var r=n(70182),i=n(25165);const o=e=>(0,r.x9)(e)&&"classes"!==e,s=r.x9,a=(0,r.ZP)({defaultTheme:i.Z,rootShouldForwardProp:o});t.ZP=a},62097:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});n(67294);var r=n(96682),i=n(25165);function o(){return(0,r.Z)(i.Z)}},78884:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(29628),i=n(25165);function o({props:e,name:t}){return(0,r.Z)({props:e,name:t,defaultTheme:i.Z})}},53566:function(e,t,n){"use strict";n.d(t,{n:function(){return r},C:function(){return i}});const r=e=>e.scrollTop;function i(e,t){var n,r;const{timeout:i,easing:o,style:s={}}=e;return{duration:null!=(n=s.transitionDuration)?n:"number"===typeof i?i:i[t.mode]||0,easing:null!=(r=s.transitionTimingFunction)?r:"object"===typeof o?o[t.mode]:o,delay:s.transitionDelay}}},61225:function(e,t,n){"use strict";var r;n.d(t,{Z:function(){return d}});var i=n(67294),o=n(34168),s=n(20539),a=n(63289);function c(e,t,n,r,o){const s="undefined"!==typeof window&&"undefined"!==typeof window.matchMedia,[c,u]=i.useState((()=>o&&s?n(e).matches:r?r(e).matches:t));return(0,a.Z)((()=>{let t=!0;if(!s)return;const r=n(e),i=()=>{t&&u(r.matches)};return i(),r.addListener(i),()=>{t=!1,r.removeListener(i)}}),[e,n,s]),c}const u=(r||(r=n.t(i,2))).useSyncExternalStore;function l(e,t,n,r){const o=i.useCallback((()=>t),[t]),s=i.useMemo((()=>{if(null!==r){const{matches:t}=r(e);return()=>t}return o}),[o,e,r]),[a,c]=i.useMemo((()=>{if(null===n)return[o,()=>()=>{}];const t=n(e);return[()=>t.matches,e=>(t.addListener(e),()=>{t.removeListener(e)})]}),[o,n,e]);return u(c,a,s)}function d(e,t={}){const n=(0,o.Z)(),r="undefined"!==typeof window&&"undefined"!==typeof window.matchMedia,{defaultMatches:i=!1,matchMedia:a=(r?window.matchMedia:null),ssrMatchMedia:d=null,noSsr:f}=(0,s.Z)({name:"MuiUseMediaQuery",props:t,theme:n});let p="function"===typeof e?e(n):e;p=p.replace(/^@media( ?)/m,"");return(void 0!==u?l:c)(p,i,a,d,f)}},36622:function(e,t,n){"use strict";var r=n(28320);t.Z=r.Z},54235:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(87462),i=n(67294),o=n(81645),s=n(85893);function a(e,t){const n=(n,i)=>(0,s.jsx)(o.Z,(0,r.Z)({"data-testid":`${t}Icon`,ref:i},n,{children:e}));return n.muiName=o.Z.muiName,i.memo(i.forwardRef(n))}},75400:function(e,t,n){"use strict";var r=n(87596);t.Z=r.Z},58075:function(e,t,n){"use strict";n.r(t),n.d(t,{capitalize:function(){return i.Z},createChainedFunction:function(){return o},createSvgIcon:function(){return s.Z},debounce:function(){return a.Z},deprecatedPropType:function(){return c},isMuiElement:function(){return u.Z},ownerDocument:function(){return l.Z},ownerWindow:function(){return d.Z},requirePropFactory:function(){return f},setRef:function(){return p},unstable_ClassNameGenerator:function(){return x},unstable_useEnhancedEffect:function(){return h.Z},unstable_useId:function(){return m.Z},unsupportedProp:function(){return g},useControlled:function(){return y.Z},useEventCallback:function(){return b.Z},useForkRef:function(){return v.Z},useIsFocusVisible:function(){return w.Z}});var r=n(37078),i=n(36622),o=n(49064).Z,s=n(54235),a=n(75400);var c=function(e,t){return()=>null},u=n(7335),l=n(47505),d=n(57577);n(87462);var f=function(e,t){return()=>null},p=n(7960).Z,h=n(63289),m=n(49669);var g=function(e,t,n,r,i){return null},y=n(42293),b=n(26432),v=n(84771),w=n(40011);const x={configure:e=>{console.warn(["MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.","","You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead","","The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401","","The updated documentation: https://mui.com/guides/classname-generator/"].join("\n")),r.Z.configure(e)}}},7335:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(67294);var i=function(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},47505:function(e,t,n){"use strict";var r=n(57094);t.Z=r.Z},57577:function(e,t,n){"use strict";var r=n(58290);t.Z=r.Z},69633:function(e,t,n){"use strict";var r=n(28442);t.Z=e=>!e||!(0,r.Z)(e)},42293:function(e,t,n){"use strict";var r=n(8925);t.Z=r.Z},63289:function(e,t,n){"use strict";var r=n(16600);t.Z=r.Z},26432:function(e,t,n){"use strict";var r=n(73633);t.Z=r.Z},84771:function(e,t,n){"use strict";var r=n(30067);t.Z=r.Z},49669:function(e,t,n){"use strict";var r=n(57579);t.Z=r.Z},40011:function(e,t,n){"use strict";var r=n(99962);t.Z=r.Z},44819:function(e,t,n){"use strict";const r=n(67294).createContext(null);t.Z=r},56760:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(67294),i=n(44819);function o(){return r.useContext(i.Z)}},49731:function(e,t,n){"use strict";n.d(t,{ZP:function(){return w},Co:function(){return x}});var r=n(67294),i=n(87462),o=n(45042),s=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,a=(0,o.Z)((function(e){return s.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),c=n(52443),u=n(70444),l=n(48137),d=n(27278),f=a,p=function(e){return"theme"!==e},h=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?f:p},m=function(e,t,n){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!==typeof r&&n&&(r=e.__emotion_forwardProp),r},g=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;(0,u.hC)(t,n,r);(0,d.L)((function(){return(0,u.My)(t,n,r)}));return null},y=function e(t,n){var o,s,a=t.__emotion_real===t,d=a&&t.__emotion_base||t;void 0!==n&&(o=n.label,s=n.target);var f=m(t,n,a),p=f||h(d),y=!p("as");return function(){var b=arguments,v=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&v.push("label:"+o+";"),null==b[0]||void 0===b[0].raw)v.push.apply(v,b);else{0,v.push(b[0][0]);for(var w=b.length,x=1;x{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}},18377:function(e,t,n){"use strict";const r=(0,n(61354).Z)();t.Z=r},95408:function(e,t,n){"use strict";n.d(t,{VO:function(){return i},k9:function(){return s},W8:function(){return a},L7:function(){return c},dt:function(){return u},P$:function(){return l}});var r=n(59766);const i={xs:0,sm:600,md:900,lg:1200,xl:1536},o={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${i[e]}px)`};function s(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||o;return t.reduce(((r,i,o)=>(r[e.up(e.keys[o])]=n(t[o]),r)),{})}if("object"===typeof t){const e=r.breakpoints||o;return Object.keys(t).reduce(((r,o)=>{if(-1!==Object.keys(e.values||i).indexOf(o)){r[e.up(o)]=n(t[o],o)}else{const e=o;r[e]=t[e]}return r}),{})}return n(t)}function a(e={}){var t;return(null==(t=e.keys)?void 0:t.reduce(((t,n)=>(t[e.up(n)]={},t)),{}))||{}}function c(e,t){return e.reduce(((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}function u(e,...t){const n=a(e),i=[n,...t].reduce(((e,t)=>(0,r.Z)(e,t)),{});return c(Object.keys(n),i)}function l({values:e,breakpoints:t,base:n}){const r=n||function(e,t){if("object"!==typeof e)return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach(((t,r)=>{r{null!=e[t]&&(n[t]=!0)})),n}(e,t),i=Object.keys(r);if(0===i.length)return e;let o;return i.reduce(((t,n,r)=>(Array.isArray(e)?(t[n]=null!=e[r]?e[r]:e[o],o=r):"object"===typeof e?(t[n]=null!=e[n]?e[n]:e[o],o=n):t[n]=e,t)),{})}},41796:function(e,t,n){"use strict";n.d(t,{mi:function(){return c},Fq:function(){return u},_j:function(){return l},$n:function(){return d},_4:function(){return f}});var r=n(71387);function i(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(function(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map((e=>e+e))),n?`rgb${4===n.length?"a":""}(${n.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error((0,r.Z)(9,e));let i,s=e.substring(t+1,e.length-1);if("color"===n){if(s=s.split(" "),i=s.shift(),4===s.length&&"/"===s[3].charAt(0)&&(s[3]=s[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i))throw new Error((0,r.Z)(10,i))}else s=s.split(",");return s=s.map((e=>parseFloat(e))),{type:n,values:s,colorSpace:i}}function s(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return-1!==t.indexOf("rgb")?r=r.map(((e,t)=>t<3?parseInt(e,10):e)):-1!==t.indexOf("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=-1!==t.indexOf("color")?`${n} ${r.join(" ")}`:`${r.join(", ")}`,`${t}(${r})`}function a(e){let t="hsl"===(e=o(e)).type||"hsla"===e.type?o(function(e){e=o(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),c=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1);let u="rgb";const l=[Math.round(255*c(0)),Math.round(255*c(8)),Math.round(255*c(4))];return"hsla"===e.type&&(u+="a",l.push(t[3])),s({type:u,values:l})}(e)).values:e.values;return t=t.map((t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4))),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e,t){const n=a(e),r=a(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function u(e,t){return e=o(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,s(e)}function l(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return s(e)}function d(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return s(e)}function f(e,t=.15){return a(e)>.5?l(e,t):d(e,t)}},61354:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(87462),i=n(63366),o=n(67294),s=n(86010),a=n(49731),c=n(86523),u=n(39707),l=n(96682),d=n(85893);const f=["className","component"];function p(e={}){const{defaultTheme:t,defaultClassName:n="MuiBox-root",generateClassName:p,styleFunctionSx:h=c.Z}=e,m=(0,a.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(h);return o.forwardRef((function(e,o){const a=(0,l.Z)(t),c=(0,u.Z)(e),{className:h,component:g="div"}=c,y=(0,i.Z)(c,f);return(0,d.jsx)(m,(0,r.Z)({as:g,ref:o,className:(0,s.default)(h,p?p(n):n),theme:a},y))}))}},70182:function(e,t,n){"use strict";n.d(t,{ZP:function(){return b},x9:function(){return g}});var r=n(63366),i=n(87462),o=n(49731),s=n(66500),a=n(28320);const c=["variant"];function u(e){return 0===e.length}function l(e){const{variant:t}=e,n=(0,r.Z)(e,c);let i=t||"";return Object.keys(n).sort().forEach((t=>{i+="color"===t?u(i)?e[t]:(0,a.Z)(e[t]):`${u(i)?t:(0,a.Z)(t)}${(0,a.Z)(e[t].toString())}`})),i}var d=n(86523);const f=["name","slot","skipVariantsResolver","skipSx","overridesResolver"],p=["theme"],h=["theme"];function m(e){return 0===Object.keys(e).length}function g(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const y=(0,s.Z)();function b(e={}){const{defaultTheme:t=y,rootShouldForwardProp:n=g,slotShouldForwardProp:s=g,styleFunctionSx:a=d.Z}=e,c=e=>{const n=m(e.theme)?t:e.theme;return a((0,i.Z)({},e,{theme:n}))};return c.__mui_systemSx=!0,(e,a={})=>{(0,o.Co)(e,(e=>e.filter((e=>!(null!=e&&e.__mui_systemSx)))));const{name:u,slot:d,skipVariantsResolver:y,skipSx:b,overridesResolver:v}=a,w=(0,r.Z)(a,f),x=void 0!==y?y:d&&"Root"!==d||!1,A=b||!1;let E=g;"Root"===d?E=n:d?E=s:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(E=void 0);const _=(0,o.ZP)(e,(0,i.Z)({shouldForwardProp:E,label:undefined},w)),k=(e,...n)=>{const o=n?n.map((e=>"function"===typeof e&&e.__emotion_real!==e?n=>{let{theme:o}=n,s=(0,r.Z)(n,p);return e((0,i.Z)({theme:m(o)?t:o},s))}:e)):[];let s=e;u&&v&&o.push((e=>{const n=m(e.theme)?t:e.theme,r=((e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null)(u,n);if(r){const t={};return Object.entries(r).forEach((([r,o])=>{t[r]="function"===typeof o?o((0,i.Z)({},e,{theme:n})):o})),v(e,t)}return null})),u&&!x&&o.push((e=>{const n=m(e.theme)?t:e.theme;return((e,t,n,r)=>{var i,o;const{ownerState:s={}}=e,a=[],c=null==n||null==(i=n.components)||null==(o=i[r])?void 0:o.variants;return c&&c.forEach((n=>{let r=!0;Object.keys(n.props).forEach((t=>{s[t]!==n.props[t]&&e[t]!==n.props[t]&&(r=!1)})),r&&a.push(t[l(n.props)])})),a})(e,((e,t)=>{let n=[];t&&t.components&&t.components[e]&&t.components[e].variants&&(n=t.components[e].variants);const r={};return n.forEach((e=>{const t=l(e.props);r[t]=e.style})),r})(u,n),n,u)})),A||o.push(c);const a=o.length-n.length;if(Array.isArray(e)&&a>0){const t=new Array(a).fill("");s=[...e,...t],s.raw=[...e.raw,...t]}else"function"===typeof e&&e.__emotion_real!==e&&(s=n=>{let{theme:o}=n,s=(0,r.Z)(n,h);return e((0,i.Z)({theme:m(o)?t:o},s))});return _(s,...o)};return _.withConfig&&(k.withConfig=_.withConfig),k}}},66500:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(87462),i=n(63366),o=n(59766);const s=["values","unit","step"];function a(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:o=5}=e,a=(0,i.Z)(e,s),c=(e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>(0,r.Z)({},e,{[t.key]:t.val})),{})})(t),u=Object.keys(c);function l(e){return`@media (min-width:${"number"===typeof t[e]?t[e]:e}${n})`}function d(e){return`@media (max-width:${("number"===typeof t[e]?t[e]:e)-o/100}${n})`}function f(e,r){const i=u.indexOf(r);return`@media (min-width:${"number"===typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==i&&"number"===typeof t[u[i]]?t[u[i]]:r)-o/100}${n})`}return(0,r.Z)({keys:u,values:c,up:l,down:d,between:f,only:function(e){return u.indexOf(e)+1(0===e.length?[1]:e).map((e=>{const n=t(e);return"number"===typeof n?`${n}px`:n})).join(" ");return n.mui=!0,n}(d);let g=(0,o.Z)({breakpoints:h,direction:"ltr",components:{},palette:(0,r.Z)({mode:"light"},s),spacing:m,shape:(0,r.Z)({},c,f)},p);return g=t.reduce(((e,t)=>(0,o.Z)(e,t)),g),g}},85578:function(e,t,n){"use strict";n.d(t,{Gc:function(){return K},G$:function(){return $}});var r=n(54844),i=n(47730);var o=function(...e){const t=e.reduce(((e,t)=>(t.filterProps.forEach((n=>{e[n]=t})),e)),{}),n=e=>Object.keys(e).reduce(((n,r)=>t[r]?(0,i.Z)(n,t[r](e)):n),{});return n.propTypes={},n.filterProps=e.reduce(((e,t)=>e.concat(t.filterProps)),[]),n},s=n(98700),a=n(95408);function c(e){return"number"!==typeof e?e:`${e}px solid`}const u=(0,r.Z)({prop:"border",themeKey:"borders",transform:c}),l=(0,r.Z)({prop:"borderTop",themeKey:"borders",transform:c}),d=(0,r.Z)({prop:"borderRight",themeKey:"borders",transform:c}),f=(0,r.Z)({prop:"borderBottom",themeKey:"borders",transform:c}),p=(0,r.Z)({prop:"borderLeft",themeKey:"borders",transform:c}),h=(0,r.Z)({prop:"borderColor",themeKey:"palette"}),m=(0,r.Z)({prop:"borderTopColor",themeKey:"palette"}),g=(0,r.Z)({prop:"borderRightColor",themeKey:"palette"}),y=(0,r.Z)({prop:"borderBottomColor",themeKey:"palette"}),b=(0,r.Z)({prop:"borderLeftColor",themeKey:"palette"}),v=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=(0,s.eI)(e.theme,"shape.borderRadius",4,"borderRadius"),n=e=>({borderRadius:(0,s.NA)(t,e)});return(0,a.k9)(e,e.borderRadius,n)}return null};v.propTypes={},v.filterProps=["borderRadius"];var w=o(u,l,d,f,p,h,m,g,y,b,v);var x=o((0,r.Z)({prop:"displayPrint",cssProperty:!1,transform:e=>({"@media print":{display:e}})}),(0,r.Z)({prop:"display"}),(0,r.Z)({prop:"overflow"}),(0,r.Z)({prop:"textOverflow"}),(0,r.Z)({prop:"visibility"}),(0,r.Z)({prop:"whiteSpace"}));var A=o((0,r.Z)({prop:"flexBasis"}),(0,r.Z)({prop:"flexDirection"}),(0,r.Z)({prop:"flexWrap"}),(0,r.Z)({prop:"justifyContent"}),(0,r.Z)({prop:"alignItems"}),(0,r.Z)({prop:"alignContent"}),(0,r.Z)({prop:"order"}),(0,r.Z)({prop:"flex"}),(0,r.Z)({prop:"flexGrow"}),(0,r.Z)({prop:"flexShrink"}),(0,r.Z)({prop:"alignSelf"}),(0,r.Z)({prop:"justifyItems"}),(0,r.Z)({prop:"justifySelf"}));const E=e=>{if(void 0!==e.gap&&null!==e.gap){const t=(0,s.eI)(e.theme,"spacing",8,"gap"),n=e=>({gap:(0,s.NA)(t,e)});return(0,a.k9)(e,e.gap,n)}return null};E.propTypes={},E.filterProps=["gap"];const _=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=(0,s.eI)(e.theme,"spacing",8,"columnGap"),n=e=>({columnGap:(0,s.NA)(t,e)});return(0,a.k9)(e,e.columnGap,n)}return null};_.propTypes={},_.filterProps=["columnGap"];const k=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=(0,s.eI)(e.theme,"spacing",8,"rowGap"),n=e=>({rowGap:(0,s.NA)(t,e)});return(0,a.k9)(e,e.rowGap,n)}return null};k.propTypes={},k.filterProps=["rowGap"];var T=o(E,_,k,(0,r.Z)({prop:"gridColumn"}),(0,r.Z)({prop:"gridRow"}),(0,r.Z)({prop:"gridAutoFlow"}),(0,r.Z)({prop:"gridAutoColumns"}),(0,r.Z)({prop:"gridAutoRows"}),(0,r.Z)({prop:"gridTemplateColumns"}),(0,r.Z)({prop:"gridTemplateRows"}),(0,r.Z)({prop:"gridTemplateAreas"}),(0,r.Z)({prop:"gridArea"}));var S=o((0,r.Z)({prop:"position"}),(0,r.Z)({prop:"zIndex",themeKey:"zIndex"}),(0,r.Z)({prop:"top"}),(0,r.Z)({prop:"right"}),(0,r.Z)({prop:"bottom"}),(0,r.Z)({prop:"left"}));var C=o((0,r.Z)({prop:"color",themeKey:"palette"}),(0,r.Z)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette"}),(0,r.Z)({prop:"backgroundColor",themeKey:"palette"}));var I=(0,r.Z)({prop:"boxShadow",themeKey:"shadows"});function O(e){return e<=1&&0!==e?100*e+"%":e}const R=(0,r.Z)({prop:"width",transform:O}),D=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var n,r,i;return{maxWidth:(null==(n=e.theme)||null==(r=n.breakpoints)||null==(i=r.values)?void 0:i[t])||a.VO[t]||O(t)}};return(0,a.k9)(e,e.maxWidth,t)}return null};D.filterProps=["maxWidth"];const P=(0,r.Z)({prop:"minWidth",transform:O}),B=(0,r.Z)({prop:"height",transform:O}),M=(0,r.Z)({prop:"maxHeight",transform:O}),N=(0,r.Z)({prop:"minHeight",transform:O});(0,r.Z)({prop:"size",cssProperty:"width",transform:O}),(0,r.Z)({prop:"size",cssProperty:"height",transform:O});var F=o(R,D,P,B,M,N,(0,r.Z)({prop:"boxSizing"}));const L=(0,r.Z)({prop:"fontFamily",themeKey:"typography"}),j=(0,r.Z)({prop:"fontSize",themeKey:"typography"}),U=(0,r.Z)({prop:"fontStyle",themeKey:"typography"}),Z=(0,r.Z)({prop:"fontWeight",themeKey:"typography"}),H=(0,r.Z)({prop:"letterSpacing"}),z=(0,r.Z)({prop:"textTransform"}),G=(0,r.Z)({prop:"lineHeight"}),V=(0,r.Z)({prop:"textAlign"});var W=o((0,r.Z)({prop:"typography",cssProperty:!1,themeKey:"typography"}),L,j,U,Z,H,G,V,z);const q={borders:w.filterProps,display:x.filterProps,flexbox:A.filterProps,grid:T.filterProps,positions:S.filterProps,palette:C.filterProps,shadows:I.filterProps,sizing:F.filterProps,spacing:s.ZP.filterProps,typography:W.filterProps},$={borders:w,display:x,flexbox:A,grid:T,positions:S,palette:C,shadows:I,sizing:F,spacing:s.ZP,typography:W},K=Object.keys(q).reduce(((e,t)=>(q[t].forEach((n=>{e[n]=$[t]})),e)),{})},47730:function(e,t,n){"use strict";var r=n(59766);t.Z=function(e,t){return t?(0,r.Z)(e,t,{clone:!1}):e}},98700:function(e,t,n){"use strict";n.d(t,{hB:function(){return h},eI:function(){return p},ZP:function(){return x},NA:function(){return m}});var r=n(95408),i=n(54844),o=n(47730);const s={m:"margin",p:"padding"},a={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},c={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},u=function(e){const t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}((e=>{if(e.length>2){if(!c[e])return[e];e=c[e]}const[t,n]=e.split(""),r=s[t],i=a[n]||"";return Array.isArray(i)?i.map((e=>r+e)):[r+i]})),l=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],d=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],f=[...l,...d];function p(e,t,n,r){var o;const s=null!=(o=(0,i.D)(e,t,!1))?o:n;return"number"===typeof s?e=>"string"===typeof e?e:s*e:Array.isArray(s)?e=>"string"===typeof e?e:s[e]:"function"===typeof s?s:()=>{}}function h(e){return p(e,"spacing",8)}function m(e,t){if("string"===typeof t||null==t)return t;const n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:`-${n}`}function g(e,t,n,i){if(-1===t.indexOf(n))return null;const o=function(e,t){return n=>e.reduce(((e,r)=>(e[r]=m(t,n),e)),{})}(u(n),i),s=e[n];return(0,r.k9)(e,s,o)}function y(e,t){const n=h(e.theme);return Object.keys(e).map((r=>g(e,t,r,n))).reduce(o.Z,{})}function b(e){return y(e,l)}function v(e){return y(e,d)}function w(e){return y(e,f)}b.propTypes={},b.filterProps=l,v.propTypes={},v.filterProps=d,w.propTypes={},w.filterProps=f;var x=w},54844:function(e,t,n){"use strict";n.d(t,{D:function(){return o}});var r=n(28320),i=n(95408);function o(e,t,n=!0){if(!t||"string"!==typeof t)return null;if(e&&e.vars&&n){const n=`vars.${t}`.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=n)return n}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function s(e,t,n,r=n){let i;return i="function"===typeof e?e(n):Array.isArray(e)?e[n]||r:o(e,n)||r,t&&(i=t(i)),i}t.Z=function(e){const{prop:t,cssProperty:n=e.prop,themeKey:a,transform:c}=e,u=e=>{if(null==e[t])return null;const u=e[t],l=o(e.theme,a)||{};return(0,i.k9)(e,u,(e=>{let i=s(l,c,e);return e===i&&"string"===typeof e&&(i=s(l,c,`${t}${"default"===e?"":(0,r.Z)(e)}`,e)),!1===n?i:{[n]:i}}))};return u.propTypes={},u.filterProps=[t],u}},39707:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(87462),i=n(63366),o=n(59766),s=n(85578);const a=["sx"];function c(e){const{sx:t}=e,n=(0,i.Z)(e,a),{systemProps:c,otherProps:u}=(e=>{const t={systemProps:{},otherProps:{}};return Object.keys(e).forEach((n=>{s.Gc[n]?t.systemProps[n]=e[n]:t.otherProps[n]=e[n]})),t})(n);let l;return l=Array.isArray(t)?[c,...t]:"function"===typeof t?(...e)=>{const n=t(...e);return(0,o.P)(n)?(0,r.Z)({},c,n):c}:(0,r.Z)({},c,t),(0,r.Z)({},u,{sx:l})}},86523:function(e,t,n){"use strict";var r=n(47730),i=n(85578),o=n(95408);const s=function(e=i.G$){const t=Object.keys(e).reduce(((t,n)=>(e[n].filterProps.forEach((r=>{t[r]=e[n]})),t)),{});function n(e,n,r){const i={[e]:n,theme:r},o=t[e];return o?o(i):{[e]:n}}return function e(i){const{sx:s,theme:a={}}=i||{};if(!s)return null;function c(i){let s=i;if("function"===typeof i)s=i(a);else if("object"!==typeof i)return i;if(!s)return null;const c=(0,o.W8)(a.breakpoints),u=Object.keys(c);let l=c;return Object.keys(s).forEach((i=>{const c=(u=s[i],d=a,"function"===typeof u?u(d):u);var u,d;if(null!==c&&void 0!==c)if("object"===typeof c)if(t[i])l=(0,r.Z)(l,n(i,c,a));else{const t=(0,o.k9)({theme:a},c,(e=>({[i]:e})));!function(...e){const t=e.reduce(((e,t)=>e.concat(Object.keys(t))),[]),n=new Set(t);return e.every((e=>n.size===Object.keys(e).length))}(t,c)?l=(0,r.Z)(l,t):l[i]=e({sx:c,theme:a})}else l=(0,r.Z)(l,n(i,c,a))})),(0,o.L7)(u,l)}return Array.isArray(s)?s.map(c):c(s)}}();s.filterProps=["sx"],t.Z=s},20525:function(e,t,n){"use strict";var r=n(86523);t.Z=function(e){return({theme:t})=>(0,r.Z)({sx:e,theme:t})}},96682:function(e,t,n){"use strict";var r=n(66500),i=n(34168);const o=(0,r.Z)();t.Z=function(e=o){return(0,i.Z)(e)}},20539:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(47925);function i(e){const{theme:t,name:n,props:i}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,r.Z)(t.components[n].defaultProps,i):i}},29628:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(20539),i=n(96682);function o({props:e,name:t,defaultTheme:n}){const o=(0,i.Z)(n);return(0,r.Z)({theme:o,name:t,props:e})}},34168:function(e,t,n){"use strict";var r=n(56760);t.Z=function(e=null){const t=(0,r.Z)();return t&&(n=t,0!==Object.keys(n).length)?t:e;var n}},37078:function(e,t){"use strict";const n=e=>e,r=(()=>{let e=n;return{configure(t){e=t},generate:t=>e(t),reset(){e=n}}})();t.Z=r},28320:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(71387);function i(e){if("string"!==typeof e)throw new Error((0,r.Z)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},94780:function(e,t,n){"use strict";function r(e,t,n){const r={};return Object.keys(e).forEach((i=>{r[i]=e[i].reduce(((e,r)=>(r&&(e.push(t(r)),n&&n[r]&&e.push(n[r])),e)),[]).join(" ")})),r}n.d(t,{Z:function(){return r}})},49064:function(e,t,n){"use strict";function r(...e){return e.reduce(((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)}),(()=>{}))}n.d(t,{Z:function(){return r}})},87596:function(e,t,n){"use strict";function r(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout((()=>{e.apply(this,r)}),t)}return r.clear=()=>{clearTimeout(n)},r}n.d(t,{Z:function(){return r}})},59766:function(e,t,n){"use strict";n.d(t,{P:function(){return i},Z:function(){return o}});var r=n(87462);function i(e){return null!==e&&"object"===typeof e&&e.constructor===Object}function o(e,t,n={clone:!0}){const s=n.clone?(0,r.Z)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((r=>{"__proto__"!==r&&(i(t[r])&&r in e&&i(e[r])?s[r]=o(e[r],t[r],n):s[r]=t[r])})),s}},71387:function(e,t,n){"use strict";function r(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n{i[t]=(0,r.Z)(e,t,n)})),i}},95806:function(e,t,n){"use strict";function r(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}n.d(t,{Z:function(){return r}})},57094:function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{Z:function(){return r}})},58290:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(57094);function i(e){return(0,r.Z)(e).defaultView||window}},47925:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(87462);function i(e,t){const n=(0,r.Z)({},t);return Object.keys(e).forEach((t=>{void 0===n[t]&&(n[t]=e[t])})),n}},7960:function(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,{Z:function(){return r}})},8925:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(67294);function i({controlled:e,default:t,name:n,state:i="value"}){const{current:o}=r.useRef(void 0!==e),[s,a]=r.useState(t);return[o?e:s,r.useCallback((e=>{o||a(e)}),[])]}},16600:function(e,t,n){"use strict";var r=n(67294);const i="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;t.Z=i},73633:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(67294),i=n(16600);function o(e){const t=r.useRef(e);return(0,i.Z)((()=>{t.current=e})),r.useCallback(((...e)=>(0,t.current)(...e)),[])}},30067:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(67294),i=n(7960);function o(...e){return r.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{(0,i.Z)(e,t)}))}),e)}},57579:function(e,t,n){"use strict";var r;n.d(t,{Z:function(){return a}});var i=n(67294);let o=0;const s=(r||(r=n.t(i,2))).useId;function a(e){if(void 0!==s){const t=s();return null!=e?e:t}return function(e){const[t,n]=i.useState(e),r=e||t;return i.useEffect((()=>{null==t&&(o+=1,n(`mui-${o}`))}),[t]),r}(e)}},99962:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(67294);let i,o=!0,s=!1;const a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function u(){o=!1}function l(){"hidden"===this.visibilityState&&s&&(o=!0)}function d(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(n){}return o||function(e){const{type:t,tagName:n}=e;return!("INPUT"!==n||!a[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function f(){const e=r.useCallback((e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("touchstart",u,!0),t.addEventListener("visibilitychange",l,!0))}),[]),t=r.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!d(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(s=!0,window.clearTimeout(i),i=window.setTimeout((()=>{s=!1}),100),t.current=!1,!0)},ref:e}}},52102:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DirectContractMethods=t.DirectContractMethodsWithFeeModel=t.ContractMethod=t.SwapSide=void 0,function(e){e.BUY="BUY",e.SELL="SELL"}(t.SwapSide||(t.SwapSide={})),function(e){e.swapOnUniswap="swapOnUniswap",e.buyOnUniswap="buyOnUniswap",e.swapOnUniswapFork="swapOnUniswapFork",e.buyOnUniswapFork="buyOnUniswapFork",e.swapOnUniswapV2Fork="swapOnUniswapV2Fork",e.buyOnUniswapV2Fork="buyOnUniswapV2Fork",e.simpleBuy="simpleBuy",e.simpleSwap="simpleSwap",e.multiSwap="multiSwap",e.megaSwap="megaSwap",e.protectedMultiSwap="protectedMultiSwap",e.protectedMegaSwap="protectedMegaSwap",e.protectedSimpleSwap="protectedSimpleSwap",e.protectedSimpleBuy="protectedSimpleBuy",e.swapOnZeroXv2="swapOnZeroXv2",e.swapOnZeroXv4="swapOnZeroXv4",e.buy="buy",e.directUniV3Swap="directUniV3Swap",e.directUniV3Buy="directUniV3Buy",e.directCurveV1Swap="directCurveV1Swap",e.directCurveV2Swap="directCurveV2Swap",e.directBalancerV2GivenInSwap="directBalancerV2GivenInSwap",e.directBalancerV2GivenOutSwap="directBalancerV2GivenOutSwap"}(n=t.ContractMethod||(t.ContractMethod={})),t.DirectContractMethodsWithFeeModel=[n.directUniV3Swap,n.directUniV3Buy,n.directCurveV1Swap,n.directCurveV2Swap,n.directBalancerV2GivenInSwap,n.directBalancerV2GivenOutSwap],t.DirectContractMethods=[n.swapOnUniswap,n.buyOnUniswap,n.swapOnUniswapFork,n.buyOnUniswapFork,n.swapOnUniswapV2Fork,n.buyOnUniswapV2Fork,n.swapOnZeroXv2,n.swapOnZeroXv4].concat(t.DirectContractMethodsWithFeeModel)},32524:function(e,t,n){"use strict";t.OZ=t.PC=void 0;var r=n(52102);Object.defineProperty(t,"PC",{enumerable:!0,get:function(){return r.SwapSide}}),Object.defineProperty(t,"OZ",{enumerable:!0,get:function(){return r.ContractMethod}})},68518:function(e,t,n){"use strict";function r(){return"undefined"!==typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}function i(){return"npm"}n.d(t,{S:function(){return i},n:function(){return r}})},61422:function(e,t,n){"use strict";n.d(t,{l$:function(){return s},KV:function(){return o}});var r=n(68518);e=n.hmd(e);var i=n(83454);function o(){return!(0,r.n)()&&"[object process]"===Object.prototype.toString.call("undefined"!==typeof i?i:0)}function s(e,t){return e.require(t)}},21170:function(e,t,n){"use strict";n.d(t,{Z1:function(){return f},yW:function(){return u},ph:function(){return l}});var r=n(61422),i=n(71235);e=n.hmd(e);const o=(0,i.Rf)(),s={nowSeconds:()=>Date.now()/1e3};const a=(0,r.KV)()?function(){try{return(0,r.l$)(e,"perf_hooks").performance}catch(t){return}}():function(){const{performance:e}=o;if(!e||!e.now)return;return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),c=void 0===a?s:{nowSeconds:()=>(a.timeOrigin+a.now())/1e3},u=s.nowSeconds.bind(s),l=c.nowSeconds.bind(c);let d;const f=(()=>{const{performance:e}=o;if(!e||!e.now)return void(d="none");const t=36e5,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,s=ithis.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}function a(e,t){return t.property?e+"["+t.property+"]":e}class c extends s{isCount(){throw new Error("ExternalLayout is abstract")}}class u extends c{constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){i(e);const n=e.length-t;return Math.floor(n/this.elementSpan)}encode(e,t,n){return 0}}class l extends c{constructor(e,t=0,n){if(!(e instanceof s))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,n||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof d||this.layout instanceof f}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,n=0){return this.layout.encode(e,t,n+this.offset)}}class d extends s{constructor(e,t){if(super(e,t),6e+r.encode(i,t,n+e)),0);return this.count instanceof c&&this.count.encode(e.length,t,n),i}}class S extends s{constructor(e,t,n){if(!Array.isArray(e)||!e.reduce(((e,t)=>e&&t instanceof s),!0))throw new TypeError("fields must be array of Layout instances");"boolean"===typeof t&&void 0===n&&(n=t,t=void 0);for(const o of e)if(0>o.span&&void 0===o.property)throw new Error("fields cannot contain unnamed variable-length layout");let r=-1;try{r=e.reduce(((e,t)=>e+t.getSpan()),0)}catch(i){}super(r,t),this.fields=e,this.decodePrefixes=!!n}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce(((n,r)=>{const i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(r){throw new RangeError("indeterminate span")}return n}decode(e,t=0){i(e);const n=this.makeDestinationObject();for(const r of this.fields)if(void 0!==r.property&&(n[r.property]=r.decode(e,t)),t+=r.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return n}encode(e,t,n=0){const r=n;let i=0,o=0;for(const s of this.fields){let r=s.span;if(o=0r&&(r=s.getSpan(t,n)))}i=n,n+=r}return i+o-r}fromArray(e){const t=this.makeDestinationObject();for(const n of this.fields)void 0!==n.property&&0n.span?t=-1:0<=t&&(t+=n.span)}}}class C{constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,n){throw new Error("UnionDiscriminator is abstract")}}class I extends C{constructor(e,t){if(!(e instanceof c&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,n){return this.layout.encode(e,t,n)}}class O extends s{constructor(e,t,n){let r;if(e instanceof d||e instanceof f)r=new I(new l(e));else if(e instanceof c&&e.isCount())r=new I(e);else{if(!(e instanceof C))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");r=e}if(void 0===t&&(t=null),!(null===t||t instanceof s))throw new TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw new Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}let i=-1;t&&(i=t.span,0<=i&&(e instanceof d||e instanceof f)&&(i+=r.layout.span)),super(i,n),this.discriminator=r,this.usesPrefixDiscriminator=e instanceof d||e instanceof f,this.defaultLayout=t,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return o(e)},this.configGetSourceVariant=function(e){o=e.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;const n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;const t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(const t in this.registry){const n=this.registry[t];if(n.property&&Object.prototype.hasOwnProperty.call(e,n.property))return n}throw new Error("unable to infer src variant")}decode(e,t=0){let n;const r=this.discriminator,i=r.decode(e,t),o=this.registry[i];if(void 0===o){const o=this.defaultLayout;let s=0;this.usesPrefixDiscriminator&&(s=r.layout.span),n=this.makeDestinationObject(),n[r.property]=i,n[o.property]=o.decode(e,t+s)}else n=o.decode(e,t);return n}encode(e,t,n=0){const r=this.getSourceVariant(e);if(void 0===r){const r=this.discriminator,i=this.defaultLayout;let o=0;return this.usesPrefixDiscriminator&&(o=r.layout.span),r.encode(e[r.property],t,n),o+i.encode(e[i.property],t,n+o)}return r.encode(e,t,n)}addVariant(e,t,n){const r=new R(this,e,t,n);return this.registry[e]=r,r}getVariant(e,t=0){let n;return n=e instanceof Uint8Array?this.discriminator.decode(e,t):e,this.registry[n]}}class R extends s{constructor(e,t,n,r){if(!(e instanceof O))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if("string"===typeof n&&void 0===r&&(r=n,n=null),n){if(!(n instanceof s))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=n.span&&n.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!==typeof r)throw new TypeError("variant must have a String property")}let i=e.span;0>e.span&&(i=n?n.span:0,0<=i&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span)),super(i,r),this.union=e,this.variant=t,this.layout=n||null}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);let r=0;return this.layout&&(r=this.layout.getSpan(e,t+n)),n+r}decode(e,t=0){const n=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(e,t,n=0){let r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);let i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}function D(e){return 0>e&&(e+=4294967296),e}class P extends s{constructor(e,t,n){if(!(e instanceof d||e instanceof f))throw new TypeError("word must be a UInt or UIntBE layout");if("string"===typeof t&&void 0===n&&(n=t,t=!1),4=t)throw new TypeError("bits must be positive integer");const r=8*e.span,i=e.fields.reduce(((e,t)=>e+t.bits),0);if(t+i>r)throw new Error("bits too long for span remainder ("+(r-i)+" of "+r+" remain)");this.container=e,this.bits=t,this.valueMask=(1<>>this.start}encode(e){if("number"!==typeof e||!Number.isInteger(e)||e!==D(e&this.valueMask))throw new TypeError(a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const t=this.container._packedGetValue(),n=D(e<n&&(n=this.length.decode(e,t)),n}decode(e,t=0){let n=this.span;return 0>n&&(n=this.length.decode(e,t)),o(e).slice(t,t+n)}encode(e,t,n){let r=this.length;if(this.length instanceof c&&(r=e.length),!(e instanceof Uint8Array&&r===e.length))throw new TypeError(a("Blob.encode",this)+" requires (length "+r+") Uint8Array as src");if(n+r>t.length)throw new RangeError("encoding overruns Uint8Array");const i=o(e);return o(t).write(i.toString("hex"),n,r,"hex"),this.length instanceof c&&this.length.encode(r,t,n),r}}class F extends s{constructor(e){super(-1,e)}getSpan(e,t=0){i(e);let n=t;for(;nt.length)throw new RangeError("encoding overruns Buffer");const a=o(t);return i.copy(a,n),a[n+s]=0,s+1}}class L extends s{constructor(e,t){if("string"===typeof e&&void 0===t&&(t=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t=0){return i(e),e.length-t}decode(e,t=0){const n=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return i.copy(o(t),n),s}}class j extends s{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,n){return 0}}t.cv=(e,t,n)=>new l(e,t,n),t.u8=e=>new d(1,e),t.KB=e=>new d(2,e),t.Jq=e=>new d(4,e),t._O=e=>new b(e),t.gM=e=>new w(e),t.n_=(e,t,n)=>new S(e,t,n),t.A9=(e,t,n)=>new T(e,t,n),t.Ik=(e,t)=>new N(e,t)},28779:function(e,t,n){"use strict";const r=n(79742),i=n(80645),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|m(e,t);let r=a(n);const i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const i=function(e){if(c.isBuffer(e)){const t=0|h(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||Y(e.length)?a(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),a(e<0?0:0|h(e))}function f(e){const t=e.length<0?0:0|h(e.length),n=a(t);for(let r=0;r=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(i)return r?-1:W(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){let o,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let r=-1;for(o=n;oa&&(n=a-c),o=n;o>=0;o--){let n=!0;for(let r=0;ri&&(r=i):r=i;const o=t.length;let s;for(r>o/2&&(r=o/2),s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+s<=n){let n,r,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128===(192&n)&&(c=(31&t)<<6|63&n,c>127&&(o=c));break;case 3:n=e[i+1],r=e[i+2],128===(192&n)&&128===(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:n=e[i+1],r=e[i+2],a=e[i+3],128===(192&n)&&128===(192&r)&&128===(192&a)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const a=Math.min(o,s),u=this.slice(r,i),l=e.slice(t,n);for(let c=0;c>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return A(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function C(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;ir)&&(n=r);let i="";for(let o=t;on)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function B(e,t,n,r,i){H(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function M(e,t,n,r,i){H(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function N(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,o){return t=+t,n>>>=0,o||N(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return t=+t,n>>>=0,o||N(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||D(e,t,this.length);let r=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,n||D(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J((function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||D(e,t,this.length);let r=this[e],i=1,o=0;for(;++o=i&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J((function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){P(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,!r){P(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J((function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=J((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J((function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=J((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function H(e,t,n,r,i,o){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new j.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||G(t,e.length-(n+1))}(r,i,o)}function z(e,t){if("number"!==typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,n){if(Math.floor(e)!==e)throw z(e,n),new j.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=Z(String(n)):"bigint"===typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=Z(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function W(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let s=0;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function $(e,t,n,r){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!==e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function J(e){return"undefined"===typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},13384:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(11922).Buffer}catch(C){}function a(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,n,i){for(var o=0,s=0,a=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,s=o%r,a=Math.min(o,o-s)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(C){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?""}var f=["","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"],p=[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],h=[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];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?f[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=p[e],l=h[e];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(l).toString(e);n=(d=d.idivn(l)).isZero()?m+n:f[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;n.words[0]=a;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=f;p++){var h=u-p|0;l+=(s=(i=0|e.words[h])*(o=0|t.words[p])+d)/67108864|0,d=67108863&s}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(e[n--]=s>>8&255),n>=0&&(e[n--]=s>>16&255),6===o?(n>=0&&(e[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,p=0|s[1],h=8191&p,m=p>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,A=0|s[4],E=8191&A,_=A>>>13,k=0|s[5],T=8191&k,S=k>>>13,C=0|s[6],I=8191&C,O=C>>>13,R=0|s[7],D=8191&R,P=R>>>13,B=0|s[8],M=8191&B,N=B>>>13,F=0|s[9],L=8191&F,j=F>>>13,U=0|a[0],Z=8191&U,H=U>>>13,z=0|a[1],G=8191&z,V=z>>>13,W=0|a[2],q=8191&W,$=W>>>13,K=0|a[3],Y=8191&K,X=K>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],ne=8191&te,re=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,pe=0|a[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(d,Z))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,Z)|0))<<13)|0;u=((o=Math.imul(f,H))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,H))+Math.imul(m,Z)|0,o=Math.imul(m,H);var ye=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,H))+Math.imul(b,Z)|0,o=Math.imul(b,H),r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0;var be=(u+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,H))+Math.imul(x,Z)|0,o=Math.imul(x,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,V)|0,r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0;var ve=(u+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(E,Z),i=(i=Math.imul(E,H))+Math.imul(_,Z)|0,o=Math.imul(_,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,$)|0,r=r+Math.imul(h,Y)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,X)|0;var we=(u+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,H))+Math.imul(S,Z)|0,o=Math.imul(S,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,$)|0,r=r+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,X)|0,r=r+Math.imul(h,Q)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var xe=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(I,Z),i=(i=Math.imul(I,H))+Math.imul(O,Z)|0,o=Math.imul(O,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,X)|0,r=r+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(u+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,H))+Math.imul(P,Z)|0,o=Math.imul(P,H),r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Ee=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,H))+Math.imul(N,Z)|0,o=Math.imul(N,H),r=r+Math.imul(D,G)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,r=r+Math.imul(h,ce)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var _e=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,H))+Math.imul(j,Z)|0,o=Math.imul(j,H),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(D,q)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,r=r+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var ke=(u+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,he)|0))<<13)|0;u=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(j,G)|0,o=Math.imul(j,V),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,r=r+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var Te=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,$))+Math.imul(j,q)|0,o=Math.imul(j,$),r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Se=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,Y),i=(i=Math.imul(L,X))+Math.imul(j,Y)|0,o=Math.imul(j,X),r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(D,ne)|0,i=(i=i+Math.imul(D,re)|0)+Math.imul(P,ne)|0,o=o+Math.imul(P,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var Ce=(u+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,r=r+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ie=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(_,he)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(j,ne)|0,o=Math.imul(j,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,r=r+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,fe)|0;var Oe=(u+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,oe),i=(i=Math.imul(L,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,r=r+Math.imul(D,de)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Re=(u+(r=r+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(O,he)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,ce),i=(i=Math.imul(L,ue))+Math.imul(j,ce)|0,o=Math.imul(j,ue),r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var De=(u+(r=r+Math.imul(D,he)|0)|0)+((8191&(i=(i=i+Math.imul(D,me)|0)+Math.imul(P,he)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,fe))+Math.imul(j,de)|0,o=Math.imul(j,fe);var Pe=(u+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(N,he)|0))<<13)|0;u=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Be=(u+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(j,he)|0))<<13)|0;return u=((o=Math.imul(j,me))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ae,c[7]=Ee,c[8]=_e,c[9]=ke,c[10]=Te,c[11]=Se,c[12]=Ce,c[13]=Ie,c[14]=Oe,c[15]=Re,c[16]=De,c[17]=Pe,c[18]=Be,0!==u&&(c[19]=u,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function b(e,t,n){return y(e,t,n)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=m),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?m(this,e,t):n<1024?y(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},v.prototype.permute=function(e,t,n,r,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,s=0|i.words[i.length-1];0!==(n=26-this._countBits(s))&&(i=i.ushln(n),r.iushln(n),s=0|i.words[i.length-1]);var a,c=r.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);a&&(a.words[d]=f)}return a&&a._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new T(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(A,x),A.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return w[e]=t,t},T.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=s;0!==p.cmp(a);){for(var m=p,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===r&&0===l)&&(i=this.mul(i,n[s]),a=0,s=0)):a=0}c=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,T),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},64285:function(e,t,n){"use strict";const r=n(79742),i=n(80645),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|m(e,t);let r=a(n);const i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const i=function(e){if(c.isBuffer(e)){const t=0|h(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||Y(e.length)?a(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),a(e<0?0:0|h(e))}function f(e){const t=e.length<0?0:0|h(e.length),n=a(t);for(let r=0;r=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(i)return r?-1:W(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){let o,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let r=-1;for(o=n;oa&&(n=a-c),o=n;o>=0;o--){let n=!0;for(let r=0;ri&&(r=i):r=i;const o=t.length;let s;for(r>o/2&&(r=o/2),s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+s<=n){let n,r,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128===(192&n)&&(c=(31&t)<<6|63&n,c>127&&(o=c));break;case 3:n=e[i+1],r=e[i+2],128===(192&n)&&128===(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:n=e[i+1],r=e[i+2],a=e[i+3],128===(192&n)&&128===(192&r)&&128===(192&a)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const a=Math.min(o,s),u=this.slice(r,i),l=e.slice(t,n);for(let c=0;c>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return A(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function C(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;ir)&&(n=r);let i="";for(let o=t;on)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function B(e,t,n,r,i){H(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function M(e,t,n,r,i){H(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function N(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,o){return t=+t,n>>>=0,o||N(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return t=+t,n>>>=0,o||N(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||D(e,t,this.length);let r=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,n||D(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J((function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||D(e,t,this.length);let r=this[e],i=1,o=0;for(;++o=i&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J((function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){P(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,!r){P(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J((function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=J((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J((function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=J((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function H(e,t,n,r,i,o){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new j.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||G(t,e.length-(n+1))}(r,i,o)}function z(e,t){if("number"!==typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,n){if(Math.floor(e)!==e)throw z(e,n),new j.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=Z(String(n)):"bigint"===typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=Z(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function W(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let s=0;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function $(e,t,n,r){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!==e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function J(e){return"undefined"===typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},18106:function(e,t,n){"use strict";var r,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ParsedMessage=void 0;const o=i(n(75528)),s=i(n(28737)),a=n(37705);class c{static generateApi(){const e=new o.default('\nsign-in-with-ethereum =\n [ scheme "://" ] domain %s" wants you to sign in with your Ethereum account:" LF\n address LF\n LF\n [ statement LF ]\n LF\n %s"URI: " URI LF\n %s"Version: " version LF\n %s"Chain ID: " chain-id LF\n %s"Nonce: " nonce LF\n %s"Issued At: " issued-at\n [ LF %s"Expiration Time: " expiration-time ]\n [ LF %s"Not Before: " not-before ]\n [ LF %s"Request ID: " request-id ]\n [ LF %s"Resources:"\n resources ]\n\ndomain = authority\n\naddress = "0x" 40*40HEXDIG\n ; Must also conform to captilization\n ; checksum encoding specified in EIP-55\n ; where applicable (EOAs).\n\nstatement = 1*( reserved / unreserved / " " )\n ; The purpose is to exclude LF (line breaks).\n\nversion = "1"\n\nnonce = 8*( ALPHA / DIGIT )\n\nissued-at = date-time\nexpiration-time = date-time\nnot-before = date-time\n\nrequest-id = *pchar\n\nchain-id = 1*DIGIT\n ; See EIP-155 for valid CHAIN_IDs.\n\nresources = *( LF resource )\n\nresource = "- " URI\n\n; ------------------------------------------------------------------------------\n; RFC 3986\n\nURI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]\n\nhier-part = "//" authority path-abempty\n / path-absolute\n / path-rootless\n / path-empty\n\nscheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )\n\nauthority = [ userinfo "@" ] host [ ":" port ]\nuserinfo = *( unreserved / pct-encoded / sub-delims / ":" )\nhost = IP-literal / IPv4address / reg-name\nport = *DIGIT\n\nIP-literal = "[" ( IPv6address / IPvFuture ) "]"\n\nIPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )\n\nIPv6address = 6( h16 ":" ) ls32\n / "::" 5( h16 ":" ) ls32\n / [ h16 ] "::" 4( h16 ":" ) ls32\n / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32\n / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32\n / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32\n / [ *4( h16 ":" ) h16 ] "::" ls32\n / [ *5( h16 ":" ) h16 ] "::" h16\n / [ *6( h16 ":" ) h16 ] "::"\n\nh16 = 1*4HEXDIG\nls32 = ( h16 ":" h16 ) / IPv4address\nIPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet\ndec-octet = DIGIT ; 0-9\n / %x31-39 DIGIT ; 10-99\n / "1" 2DIGIT ; 100-199\n / "2" %x30-34 DIGIT ; 200-249\n / "25" %x30-35 ; 250-255\n\nreg-name = *( unreserved / pct-encoded / sub-delims )\n\npath-abempty = *( "/" segment )\npath-absolute = "/" [ segment-nz *( "/" segment ) ]\npath-rootless = segment-nz *( "/" segment )\npath-empty = 0pchar\n\nsegment = *pchar\nsegment-nz = 1*pchar\n\npchar = unreserved / pct-encoded / sub-delims / ":" / "@"\n\nquery = *( pchar / "/" / "?" )\n\nfragment = *( pchar / "/" / "?" )\n\npct-encoded = "%" HEXDIG HEXDIG\n\nunreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"\nreserved = gen-delims / sub-delims\ngen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"\nsub-delims = "!" / "$" / "&" / "\'" / "(" / ")"\n / "*" / "+" / "," / ";" / "="\n\n; ------------------------------------------------------------------------------\n; RFC 3339\n\ndate-fullyear = 4DIGIT\ndate-month = 2DIGIT ; 01-12\ndate-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on\n ; month/year\ntime-hour = 2DIGIT ; 00-23\ntime-minute = 2DIGIT ; 00-59\ntime-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second\n ; rules\ntime-secfrac = "." 1*DIGIT\ntime-numoffset = ("+" / "-") time-hour ":" time-minute\ntime-offset = "Z" / time-numoffset\n\npartial-time = time-hour ":" time-minute ":" time-second\n [time-secfrac]\nfull-date = date-fullyear "-" date-month "-" date-mday\nfull-time = partial-time time-offset\n\ndate-time = full-date "T" full-time\n\n; ------------------------------------------------------------------------------\n; RFC 5234\n\nALPHA = %x41-5A / %x61-7A ; A-Z / a-z\nLF = %x0A\n ; linefeed\nDIGIT = %x30-39\n ; 0-9\nHEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n');if(e.generate(),e.errors.length)throw console.error(e.errorsToAscii()),console.error(e.linesToAscii()),console.log(e.displayAttributeErrors()),new Error("ABNF grammar has errors");return e.toObject()}}r=c,c.grammarObj=r.generateApi();t.ParsedMessage=class{constructor(e){const t=new s.default.parser;t.ast=new s.default.ast;const n=s.default.ids;t.ast.callbacks.scheme=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&0===r&&(o.scheme=s.default.utils.charsToString(t,r,i)),a};t.ast.callbacks.domain=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.domain=s.default.utils.charsToString(t,r,i)),a};t.ast.callbacks.address=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.address=s.default.utils.charsToString(t,r,i)),a};t.ast.callbacks.statement=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.statement=s.default.utils.charsToString(t,r,i)),a};t.ast.callbacks.uri=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.uri||(o.uri=s.default.utils.charsToString(t,r,i))),a};t.ast.callbacks.version=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.version=s.default.utils.charsToString(t,r,i)),a};t.ast.callbacks["chain-id"]=function(e,t,r,i,o){const c=n.SEM_OK;return e===n.SEM_PRE&&(o.chainId=(0,a.parseIntegerNumber)(s.default.utils.charsToString(t,r,i))),c};t.ast.callbacks.nonce=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.nonce=s.default.utils.charsToString(t,r,i)),a};t.ast.callbacks["issued-at"]=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.issuedAt=s.default.utils.charsToString(t,r,i)),a};t.ast.callbacks["expiration-time"]=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.expirationTime=s.default.utils.charsToString(t,r,i)),a};t.ast.callbacks["not-before"]=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.notBefore=s.default.utils.charsToString(t,r,i)),a};t.ast.callbacks["request-id"]=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.requestId=s.default.utils.charsToString(t,r,i)),a};t.ast.callbacks.resources=function(e,t,r,i,o){const a=n.SEM_OK;return e===n.SEM_PRE&&(o.resources=s.default.utils.charsToString(t,r,i).slice(3).split("\n- ")),a};const r=t.parse(c.grammarObj,"sign-in-with-ethereum",e);if(!r.success)throw new Error(`Invalid message: ${JSON.stringify(r)}`);const i={};t.ast.translate(i);for(const[o,s]of Object.entries(i))this[o]=s;if(0===this.domain.length)throw new Error("Domain cannot be empty.");if(!(0,a.isEIP55Address)(this.address))throw new Error("Address not conformant to EIP-55.")}}},20200:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.ParsedMessage=void 0;const o=n(18106);Object.defineProperty(t,"ParsedMessage",{enumerable:!0,get:function(){return o.ParsedMessage}}),i(n(37705),t)},37705:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIntegerNumber=t.isEIP55Address=void 0;const r=n(88925),i=n(47726);t.isEIP55Address=e=>{if(42!=e.length)return!1;const t=`${e}`.toLowerCase().replace("0x",""),n=(0,i.bytesToHex)((0,r.keccak_256)(t));let o="0x";for(let r=0;r=8?o+=t[r].toUpperCase():o+=t[r];return e===o};t.parseIntegerNumber=e=>{const t=parseInt(e);if(isNaN(t))throw new Error("Invalid number.");if(t===1/0)throw new Error("Invalid number.");return t}},46882:function(e,t){"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function r(e){if("boolean"!==typeof e)throw new Error(`boolean expected, not ${e}`)}function i(e){return e instanceof Uint8Array||null!=e&&"object"===typeof e&&"Uint8Array"===e.constructor.name}function o(e,...t){if(!i(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function s(e){if("function"!==typeof e||"function"!==typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function c(e,t){o(e);const n=t.outputLen;if(e.length>r&n)}:{h:0|Number(e>>r&n),l:0|Number(e&n)}}function o(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0);t.toBig=s;const a=(e,t,n)=>e>>>n;t.shrSH=a;const c=(e,t,n)=>e<<32-n|t>>>n;t.shrSL=c;const u=(e,t,n)=>e>>>n|t<<32-n;t.rotrSH=u;const l=(e,t,n)=>e<<32-n|t>>>n;t.rotrSL=l;const d=(e,t,n)=>e<<64-n|t>>>n-32;t.rotrBH=d;const f=(e,t,n)=>e>>>n-32|t<<64-n;t.rotrBL=f;const p=(e,t)=>t;t.rotr32H=p;const h=(e,t)=>e;t.rotr32L=h;const m=(e,t,n)=>e<>>32-n;t.rotlSH=m;const g=(e,t,n)=>t<>>32-n;t.rotlSL=g;const y=(e,t,n)=>t<>>64-n;t.rotlBH=y;const b=(e,t,n)=>e<>>64-n;function v(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}}t.rotlBL=b,t.add=v;const w=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);t.add3L=w;const x=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;t.add3H=x;const A=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);t.add4L=A;const E=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0;t.add4H=E;const _=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0);t.add5L=_;const k=(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0;t.add5H=k;const T={fromBig:i,split:o,toBig:s,shrSH:a,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:d,rotrBL:f,rotr32H:p,rotr32L:h,rotlSH:m,rotlSL:g,rotlBH:y,rotlBL:b,add:v,add3L:w,add3H:x,add4L:A,add4H:E,add5H:k,add5L:_};t.default=T},65034:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"===typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},88925:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;const r=n(46882),i=n(71187),o=n(47726),s=[],a=[],c=[],u=BigInt(0),l=BigInt(1),d=BigInt(2),f=BigInt(7),p=BigInt(256),h=BigInt(113);for(let E=0,_=l,k=1,T=0;E<24;E++){[k,T]=[T,(2*k+3*T)%5],s.push(2*(5*T+k)),a.push((E+1)*(E+2)/2%64);let e=u;for(let t=0;t<7;t++)_=(_<>f)*h)%p,_&d&&(e^=l<<(l<n>32?(0,i.rotlBH)(e,t,n):(0,i.rotlSH)(e,t,n),b=(e,t,n)=>n>32?(0,i.rotlBL)(e,t,n):(0,i.rotlSL)(e,t,n);function v(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let r=0;r<10;r++)n[r]=e[r]^e[r+10]^e[r+20]^e[r+30]^e[r+40];for(let r=0;r<10;r+=2){const t=(r+8)%10,i=(r+2)%10,o=n[i],s=n[i+1],a=y(o,s,1)^n[t],c=b(o,s,1)^n[t+1];for(let n=0;n<50;n+=10)e[r+n]^=a,e[r+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=a[n],o=y(t,i,r),c=b(t,i,r),u=s[n];t=e[u],i=e[u+1],e[u]=o,e[u+1]=c}for(let r=0;r<50;r+=10){for(let t=0;t<10;t++)n[t]=e[r+t];for(let t=0;t<10;t++)e[r+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=m[r],e[1]^=g[r]}n.fill(0)}t.keccakP=v;class w extends o.Hash{constructor(e,t,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,r.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,o.u32)(this.state)}keccak(){o.isLE||(0,o.byteSwap32)(this.state32),v(this.state32,this.rounds),o.isLE||(0,o.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,r.exists)(this);const{blockLen:t,state:n}=this,i=(e=(0,o.toBytes)(e)).length;for(let r=0;r=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,r.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,r.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new w(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}t.Keccak=w;const x=(e,t,n)=>(0,o.wrapConstructor)((()=>new w(t,e,n)));t.sha3_224=x(6,144,28),t.sha3_256=x(6,136,32),t.sha3_384=x(6,104,48),t.sha3_512=x(6,72,64),t.keccak_224=x(1,144,28),t.keccak_256=x(1,136,32),t.keccak_384=x(1,104,48),t.keccak_512=x(1,72,64);const A=(e,t,n)=>(0,o.wrapXOFConstructorWithOpts)(((r={})=>new w(t,e,void 0===r.dkLen?n:r.dkLen,!0)));t.shake128=A(31,168,16),t.shake256=A(31,136,32)},47726:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.byteSwap32=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=t.isBytes=void 0;const r=n(65034),i=n(46882);t.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"===typeof e&&"Uint8Array"===e.constructor.name};t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);t.rotr=(e,t)=>e<<32-t|e>>>t;t.rotl=(e,t)=>e<>>32-t>>>0,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];t.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,t.byteSwapIfBE=t.isLE?e=>e:e=>(0,t.byteSwap)(e),t.byteSwap32=function(e){for(let n=0;nt.toString(16).padStart(2,"0")));t.bytesToHex=function(e){(0,i.bytes)(e);let t="";for(let n=0;n=s&&e<=a?e-s:e>=c&&e<=u?e-(c-10):e>=l&&e<=d?e-(l-10):void 0}t.hexToBytes=function(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let i=0,o=0;i{},t.asyncLoop=async function(e,n,r){let i=Date.now();for(let o=0;o=0&&ee().update(h(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(h(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(h(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(r.crypto&&"function"===typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},98099:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(97117);function i(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>8,t[n+1]=e>>>0,t}function o(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t}function s(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function c(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function u(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function l(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>24,t[n+1]=e>>>16,t[n+2]=e>>>8,t[n+3]=e>>>0,t}function d(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24,t}function f(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),l(e/4294967296>>>0,t,n),l(e>>>0,t,n+4),t}function p(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),d(e>>>0,t,n),d(e/4294967296>>>0,t,n+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=o,t.writeInt16LE=o,t.readInt32BE=s,t.readUint32BE=a,t.readInt32LE=c,t.readUint32LE=u,t.writeUint32BE=l,t.writeInt32BE=l,t.writeUint32LE=d,t.writeInt32LE=d,t.readInt64BE=function(e,t){void 0===t&&(t=0);var n=s(e,t),r=s(e,t+4);return 4294967296*n+r-4294967296*(r>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var n=c(e,t);return 4294967296*c(e,t+4)+n-4294967296*(n>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var n=u(e,t);return 4294967296*u(e,t+4)+n},t.writeUint64BE=f,t.writeInt64BE=f,t.writeUint64LE=p,t.writeInt64LE=p,t.readUintBE=function(e,t,n){if(void 0===n&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var r=0,i=1,o=e/8+n-1;o>=n;o--)r+=t[o]*i,i*=256;return r},t.readUintLE=function(e,t,n){if(void 0===n&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var r=0,i=1,o=n;o=i;s--)n[s]=t/o&255,o*=256;return n},t.writeUintLE=function(e,t,n,i){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!r.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},31416:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const r=n(46008),i=n(98099),o=n(17309);function s(e,n=t.defaultRandomSource){return n.randomBytes(e)}t.defaultRandomSource=new r.SystemRandomSource,t.randomBytes=s,t.randomUint32=function(e=t.defaultRandomSource){const n=s(4,e),r=(0,i.readUint32LE)(n);return(0,o.wipe)(n),r};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(e,n=a,r=t.defaultRandomSource){if(n.length<2)throw new Error("randomString charset is too short");if(n.length>256)throw new Error("randomString charset is too long");let i="";const c=n.length,u=256-256%c;for(;e>0;){const t=s(Math.ceil(256*e/u),r);for(let r=0;r0;r++){const o=t[r];o>1]>>4>=8&&(n[u]=n[u].toUpperCase()),(15&s[u>>1])>=8&&(n[u+1]=n[u+1].toUpperCase());var l="0x"+n.join("");return t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==l&&o(!1),l}var v,w=function(e,t){try{var n=function(n){return Promise.resolve(Promise.all([void 0===t.chainId?e.getChainId():t.chainId,void 0===t.account?e.getAccount():t.account])).then((function(t){var r=t[0],i=t[1],o=y(r);if(e.supportedChainIds&&!e.supportedChainIds.includes(o))throw new A(o,e.supportedChainIds);var s=null===i?i:b(i);return{provider:n,chainId:o,account:s}}))},r=void 0===t.provider;return Promise.resolve(r?Promise.resolve(e.getProvider()).then(n):n(t.provider))}catch(i){return Promise.reject(i)}},x=function(e){function t(){var t;return(t=e.call(this)||this).name=t.constructor.name,t}return l(t,e),t}(m(Error)),A=function(e){function t(t,n){var r;return(r=e.call(this)||this).name=r.constructor.name,r.message="Unsupported chain id: "+t+". Supported chain ids are: "+n+".",r}return l(t,e),t}(m(Error));function E(e,t){var n=t.type,r=t.payload;switch(n){case v.ACTIVATE_CONNECTOR:return{connector:r.connector,provider:r.provider,chainId:r.chainId,account:r.account,onError:r.onError};case v.UPDATE:var i=r.provider,o=r.chainId,s=r.account;return u({},e,void 0===i?{}:{provider:i},void 0===o?{}:{chainId:o},void 0===s?{}:{account:s});case v.UPDATE_FROM_ERROR:var a=r.provider,c=r.chainId,l=r.account;return u({},e,void 0===a?{}:{provider:a},void 0===c?{}:{chainId:c},void 0===l?{}:{account:l},{error:void 0});case v.ERROR:var d=r.error;return{connector:e.connector,error:d,onError:e.onError};case v.ERROR_FROM_ACTIVATION:return{connector:r.connector,error:r.error};case v.DEACTIVATE_CONNECTOR:return{}}}!function(e){e[e.ACTIVATE_CONNECTOR=0]="ACTIVATE_CONNECTOR",e[e.UPDATE=1]="UPDATE",e[e.UPDATE_FROM_ERROR=2]="UPDATE_FROM_ERROR",e[e.ERROR=3]="ERROR",e[e.ERROR_FROM_ACTIVATION=4]="ERROR_FROM_ACTIVATION",e[e.DEACTIVATE_CONNECTOR=5]="DEACTIVATE_CONNECTOR"}(v||(v={}));var _="primary",k={};function T(e){k[e]&&o(!1),k[e]=(0,r.createContext)({activate:function(){try{return o(!1),Promise.resolve()}catch(e){return Promise.reject(e)}},setError:function(){o(!1)},deactivate:function(){o(!1)},active:!1}),k[e].displayName="Web3ReactContext - "+e;var t=k[e].Provider;return function(e){var n=e.getLibrary,i=e.children,o=function(){var e=(0,r.useReducer)(E,{}),t=e[0],n=e[1],i=t.connector,o=t.provider,a=t.chainId,c=t.account,l=t.onError,d=t.error,f=(0,r.useRef)(-1);f.current+=1;var p=(0,r.useCallback)((function(e,t,r){void 0===r&&(r=!1);try{var i=f.current,o=!1;return Promise.resolve(g((function(){return Promise.resolve(e.activate().then((function(e){return o=!0,e}))).then((function(r){return Promise.resolve(w(e,r)).then((function(r){if(f.current>i)throw new x;n({type:v.ACTIVATE_CONNECTOR,payload:u({connector:e},r,{onError:t})})}))}))}),(function(i){if(i instanceof x)o&&e.deactivate();else{if(r)throw o&&e.deactivate(),i;t?(o&&e.deactivate(),t(i)):n({type:v.ERROR_FROM_ACTIVATION,payload:{connector:e,error:i}})}})))}catch(s){return Promise.reject(s)}}),[]),h=(0,r.useCallback)((function(e){n({type:v.ERROR,payload:{error:e}})}),[]),m=(0,r.useCallback)((function(){n({type:v.DEACTIVATE_CONNECTOR})}),[]),_=(0,r.useCallback)((function(e){try{if(!i)throw Error("This should never happen, it's just so Typescript stops complaining");var t=f.current;return Promise.resolve(function(){if(d)return g((function(){return Promise.resolve(w(i,e)).then((function(e){if(f.current>t)throw new x;n({type:v.UPDATE_FROM_ERROR,payload:e})}))}),(function(e){e instanceof x||(l?l(e):n({type:v.ERROR,payload:{error:e}}))}));var r=void 0===e.chainId?void 0:y(e.chainId);if(void 0!==r&&i.supportedChainIds&&!i.supportedChainIds.includes(r)){var o=new A(r,i.supportedChainIds);l?l(o):n({type:v.ERROR,payload:{error:o}})}else{var s="string"===typeof e.account?b(e.account):e.account;n({type:v.UPDATE,payload:{provider:e.provider,chainId:r,account:s}})}}())}catch(r){return Promise.reject(r)}}),[i,d,l]),k=(0,r.useCallback)((function(e){l?l(e):n({type:v.ERROR,payload:{error:e}})}),[l]),T=(0,r.useCallback)((function(){n({type:v.DEACTIVATE_CONNECTOR})}),[]);return(0,r.useEffect)((function(){return function(){i&&i.deactivate()}}),[i]),(0,r.useEffect)((function(){return i&&i.on(s._.Update,_).on(s._.Error,k).on(s._.Deactivate,T),function(){i&&i.off(s._.Update,_).off(s._.Error,k).off(s._.Deactivate,T)}}),[i,_,k,T]),{connector:i,provider:o,chainId:a,account:c,activate:p,setError:h,deactivate:m,error:d}}(),a=o.connector,c=o.provider,l=o.chainId,d=o.account,f=o.activate,p=o.setError,h=o.deactivate,m=o.error,_=void 0!==a&&void 0!==l&&void 0!==d&&!m,k=(0,r.useMemo)((function(){return _&&void 0!==l&&Number.isInteger(l)&&a?n(c,a):void 0}),[_,n,c,a,l]),T={connector:a,library:k,chainId:l,account:d,activate:f,setError:p,deactivate:h,active:_,error:m};return r.createElement(t,{value:T},i)}}var S=T(_);function C(e){return void 0===e&&(e=_),Object.keys(k).includes(e)||o(!1),k[e]}function I(e){return(0,r.useContext)(C(e))}},32120:function(e,t,n){const r=n(17187),i=!1;e.exports=class extends r{constructor(e,t,n){super(),this.targets=t,this.connections=e,this.connected=!1,this.status="loading",this.interval=n.interval||5e3,this.name=n.name||"default",this.inSetup=!0,this.connect()}connect(e=0){if(this.connection&&"connected"===this.connection.status&&e>=this.connection.index)i;else if(0===this.targets.length)i;else{const{protocol:t,location:n}=this.targets[e];this.connection=this.connections[t](n),this.connection.on("error",(t=>this.connected?this.listenerCount("error")?this.emit("error",t):void console.warn("eth-provider - Uncaught connection error: "+t.message):this.connectionError(e,t))),this.connection.on("close",(e=>{this.connected=!1,this.emit("close"),this.closing||this.refresh()})),this.connection.on("connect",(()=>{this.connection.target=this.targets[e],this.connection.index=e,this.targets[e].status=this.connection.status,this.connected=!0,this.inSetup=!1,this.emit("connect")})),this.connection.on("data",(e=>this.emit("data",e))),this.connection.on("payload",(e=>this.emit("payload",e)))}}refresh(e=this.interval){clearTimeout(this.connectTimer),this.connectTimer=setTimeout((()=>this.connect()),e)}connectionError(e,t){this.targets[e].status=t,this.targets.length-1===e?(this.inSetup=!1,this.refresh()):this.connect(++e)}close(){this.closing=!0,this.connection?this.connection.close():this.emit("close"),clearTimeout(this.connectTimer)}error(e,t,n=-1){this.emit("payload",{id:e.id,jsonrpc:e.jsonrpc,error:{message:t,code:n}})}send(e){this.inSetup?setTimeout((()=>this.send(e)),100):this.connection.closed?this.error(e,"Not connected"):this.connection.send(e)}}},36939:function(e,t,n){const r=n(44253),i=n(9207),o=n(35479),s={ethereum:"undefined"!==typeof window&&"undefined"!==typeof window.ethereum?window.ethereum:null,web3:"undefined"!==typeof window&&"undefined"!==typeof window.web3?window.web3.currentProvider:null},a="undefined"!==typeof window&&"undefined"!==typeof window.WebSocket?window.WebSocket:null,c="undefined"!==typeof window&&"undefined"!==typeof window.XMLHttpRequest?window.XMLHttpRequest:null;s.ethereum&&(s.ethereum.__isProvider=!0);const u={injected:s.ethereum||n(54806)(s.web3),ipc:n(16886)("IPC connections are unavliable in the browser"),ws:n(3809)(a),http:n(11252)(c)};e.exports=(e=["injected","frame"],t={})=>i(u,r(e,o),t)},11252:function(e,t,n){const r=n(17187),i=n(95394);let o;class s extends r{constructor(e,t,n){super(),o=e,this.connected=!1,this.subscriptions=!1,this.status="loading",this.url=t,this.pollId=i(),setTimeout((()=>this.create()),0)}create(){if(!o)return this.emit("error",new Error("No HTTP transport available"));this.on("error",(()=>{this.connected&&this.close()})),this.init()}init(){this.send({jsonrpc:"2.0",method:"eth_syncing",params:[],id:1},((e,t)=>{if(e)return this.emit("error",e);this.send({jsonrpc:"2.0",id:1,method:"eth_pollSubscriptions",params:[this.pollId,"immediate"]},((e,t)=>{e||(this.subscriptions=!0,this.pollSubscriptions()),this.connected=!0,this.emit("connect")}))}))}pollSubscriptions(){this.send({jsonrpc:"2.0",id:1,method:"eth_pollSubscriptions",params:[this.pollId]},((e,t)=>{if(e)return this.subscriptionTimeout=setTimeout((()=>this.pollSubscriptions()),1e4),this.emit("error",e);this.closed||(this.subscriptionTimeout=this.pollSubscriptions()),t&&t.map((e=>{let t;try{t=JSON.parse(e)}catch(n){t=!1}return t})).filter((e=>e)).forEach((e=>this.emit("payload",e)))}))}close(){this.closed=!0,this.emit("close"),clearTimeout(this.subscriptionTimeout),this.removeAllListeners()}filterStatus(e){if(e.status>=200&&e.status<300)return e;const t=new Error(e.statusText);throw t.res=e,t.message}error(e,t,n=-1){this.emit("payload",{id:e.id,jsonrpc:e.jsonrpc,error:{message:t,code:n}})}send(e,t){if(this.closed)return this.error(e,"Not connected");if("eth_subscribe"===e.method){if(!this.subscriptions)return this.error(e,"Subscriptions are not supported by this HTTP endpoint");e.pollId=this.pollId}const n=new o;let r=!1;const i=(i,o)=>{if(!r)if(n.abort(),r=!0,t)t(i,o);else{const{id:t,jsonrpc:n}=e,r=i?{id:t,jsonrpc:n,error:{message:i.message,code:i.code}}:{id:t,jsonrpc:n,result:o};this.emit("payload",r)}};n.open("POST",this.url,!0),n.setRequestHeader("Content-Type","application/json"),n.timeout=6e4,n.onerror=i,n.ontimeout=i,n.onreadystatechange=()=>{if(4===n.readyState)try{const e=JSON.parse(n.responseText);i(e.error,e.result)}catch(e){i(e)}},n.send(JSON.stringify(e))}}e.exports=e=>(t,n)=>new s(e,t,n)},54806:function(e,t,n){const r=n(17187);class i extends r{constructor(e,t){super(),e?setTimeout((()=>this.emit("error",new Error("Injected web3 provider is not currently supported"))),0):setTimeout((()=>this.emit("error",new Error("No injected provider found"))),0)}}e.exports=e=>t=>new i(e,t)},16886:function(e,t,n){const r=n(17187);class i extends r{constructor(e){super(),setTimeout((()=>this.emit("error",new Error(e))),0)}}e.exports=e=>()=>new i(e)},3809:function(e,t,n){const r=n(17187),i=n(19851);let o;class s extends r{constructor(e,t,n){super(),o=e,setTimeout((()=>this.create(t,n)),0)}create(e,t){o||this.emit("error",new Error("No WebSocket transport available"));try{this.socket=new o(e)}catch(n){return this.emit("error",n)}this.socket.addEventListener("error",(e=>this.emit("error",e))),this.socket.addEventListener("open",(()=>{this.emit("connect"),this.socket.addEventListener("message",(e=>{const t="string"===typeof e.data?e.data:"";i(t,((e,t)=>{e||t.forEach((e=>{Array.isArray(e)?e.forEach((e=>this.emit("payload",e))):this.emit("payload",e)}))}))})),this.socket.addEventListener("close",(()=>this.onClose()))}))}onClose(){this.socket=null,this.closed=!0,this.emit("close"),this.removeAllListeners()}close(){this.socket?this.socket.close():this.onClose()}error(e,t,n=-1){this.emit("payload",{id:e.id,jsonrpc:e.jsonrpc,error:{message:t,code:n}})}send(e){this.socket&&this.socket.readyState===this.socket.CONNECTING?setTimeout((t=>this.send(e)),10):!this.socket||this.socket.readyState>1?(this.connected=!1,this.error(e,"Not connected")):this.socket.send(JSON.stringify(e))}}e.exports=e=>(t,n)=>new s(e,t,n)},19851:function(e){let t,n;e.exports=(e,r)=>{const i=[];e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach((e=>{let o;t&&(e=t+e);try{o=JSON.parse(e)}catch(s){return t=e,clearTimeout(n),void(n=setTimeout((()=>r(new Error("Parse response timeout"))),15e3))}clearTimeout(n),t=null,o&&i.push(o)})),r(null,i)}},35479:function(e){e.exports={injected:["injected"],frame:["ws://127.0.0.1:1248","http://127.0.0.1:1248"],direct:["ws://127.0.0.1:8546","http://127.0.0.1:8545"],infura:["wss://mainnet.infura.io/ws/v3/786ade30f36244469480aa5c2bf0743b","https://mainnet.infura.io/v3/786ade30f36244469480aa5c2bf0743b"],infuraRopsten:["wss://ropsten.infura.io/ws/v3/786ade30f36244469480aa5c2bf0743b","https://ropsten.infura.io/v3/786ade30f36244469480aa5c2bf0743b"],infuraRinkeby:["wss://rinkeby.infura.io/ws/v3/786ade30f36244469480aa5c2bf0743b","https://rinkeby.infura.io/v3/786ade30f36244469480aa5c2bf0743b"],infuraKovan:["wss://kovan.infura.io/ws/v3/786ade30f36244469480aa5c2bf0743b","https://kovan.infura.io/v3/786ade30f36244469480aa5c2bf0743b"]}},9207:function(e,t,n){const r=n(17187),i=n(12990),o=n(32120),s=e=>{function t(t){e.status=t,e instanceof r&&e.emit("status",t)}async function n(){if(e.inSetup)return setTimeout(n,1e3);try{await e.send("eth_syncing")?(t("syncing"),setTimeout((()=>n()),5e3)):t("connected")}catch(r){t("disconnected")}}return t("loading"),n(),e.on("connect",(()=>n())),e.on("close",(()=>t("disconnected"))),e};e.exports=(e,t,n)=>{if(e.injected.__isProvider&&t.map((e=>e.type)).indexOf("injected")>-1)return delete e.injected.__isProvider,s(e.injected);const r=new i(new o(e,t,n));return r.setMaxListeners(128),s(r)}},44253:function(e){const t=e=>"injected"===e?"injected":e.endsWith(".ipc")?"ipc":e.startsWith("wss://")||e.startsWith("ws://")?"ws":e.startsWith("https://")||e.startsWith("http://")?"http":"";e.exports=(e,n)=>[].concat(...[].concat(e).map((e=>n[e]?n[e].map((n=>({type:e,location:n,protocol:t(n)}))):{type:"custom",location:e,protocol:t(e)}))).filter((e=>!(!e.protocol&&"injected"!==e.type)||(console.log('eth-provider | Invalid provider preset/location: "'+e.location+'"'),!1)))},12990:function(e,t,n){const r=n(17187);e.exports=class extends r{constructor(e){super(),this.connected=!1,this.nextId=0,this.promises={},this.subscriptions=[],this.connection=e,this.connection.on("connect",(()=>this.checkConnection())),this.connection.on("close",(()=>this.emit("close"))),this.connection.on("payload",(e=>{const{id:t,method:n,error:r,result:i}=e;"undefined"!==typeof t?this.promises[t]&&(e.error?this.promises[t].reject(r):this.promises[t].resolve(i),delete this.promises[t]):n&&n.indexOf("_subscription")>-1&&(this.emit(e.params.subscription,e.params.result),this.emit(n,e.params),this.emit("data",e))})),this.on("newListener",((e,t)=>{"networkChanged"===e?!this.attemptedNetworkSubscription&&this.connected&&this.startNetworkSubscription():"accountsChanged"===e&&!this.attemptedAccountsSubscription&&this.connected&&this.startAccountsSubscription()}))}async checkConnection(){try{this.emit("connect",await this._send("net_version")),this.connected=!0,this.listenerCount("networkChanged")&&!this.attemptedNetworkSubscription&&this.startNetworkSubscription(),this.listenerCount("accountsChanged")&&!this.attemptedAccountsSubscription&&this.startAccountsSubscription()}catch(e){this.connected=!1}}async startNetworkSubscription(){this.attemptedNetworkSubscription=!0;try{let e=await this.subscribe("eth_subscribe","networkChanged");this.on(e,(e=>this.emit("networkChanged",e)))}catch(e){console.warn("Unable to subscribe to networkChanged",e)}}async startAccountsSubscription(){this.attemptedAccountsSubscription=!0;try{let e=await this.subscribe("eth_subscribe","accountsChanged");this.on(e,(e=>this.emit("accountsChanged",e)))}catch(e){console.warn("Unable to subscribe to accountsChanged",e)}}enable(){return new Promise(((e,t)=>{this._send("eth_accounts").then((n=>{if(n.length>0)this.accounts=n,this.coinbase=n[0],this.emit("enable"),e(n);else{const e=new Error("User Denied Full Provider");e.code=4001,t(e)}})).catch(t)}))}_send(e,t=[]){if(!e||"string"!==typeof e)return new Error("Method is not a valid string.");if(!(t instanceof Array))return new Error("Params is not a valid array.");const n={jsonrpc:"2.0",id:this.nextId++,method:e,params:t},r=new Promise(((e,t)=>{this.promises[n.id]={resolve:e,reject:t}}));return this.connection.send(n),r}send(...e){return this._send(...e)}_sendBatch(e){return Promise.all(e.map((e=>this._send(e.method,e.params))))}subscribe(e,t,n=[]){return this._send(e,[t,...n]).then((e=>(this.subscriptions.push(e),e)))}unsubscribe(e,t){return this._send(e,[t]).then((e=>{if(e)return this.subscriptions=this.subscriptions.filter((e=>e!==t)),this.removeAllListeners(t),e}))}sendAsync(e,t){return t&&"function"===typeof t?e?e instanceof Array?this.sendAsyncBatch(e,t):this._send(e.method,e.params).then((n=>{t(null,{id:e.id,jsonrpc:e.jsonrpc,result:n})})).catch((e=>{t(e)})):t(new Error("Invalid Payload")):t(new Error("Invalid or undefined callback provided to sendAsync"))}sendAsyncBatch(e,t){return this._sendBatch(e).then((n=>{let r=n.map(((t,n)=>({id:e[n].id,jsonrpc:e[n].jsonrpc,result:t})));t(null,r)})).catch((e=>{t(e)}))}isConnected(){return this.connected}close(){this.connection.close(),this.connected=!1;let e=new Error("Provider closed, subscription lost, please subscribe again.");this.subscriptions.forEach((t=>this.emit(t,e))),this.subscriptions=[]}}},49977:function(e){for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},21912:function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},95394:function(e,t,n){var r=n(21912),i=n(49977);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||i(s)}},30950:function(e,t,n){"use strict";n.d(t,{_k:function(){return g},A5:function(){return h}});var r=n(26939);function i(){return i=Object.assign||function(e){for(var t=1;t0})))}),(function(){return!1}))):Promise.resolve(!1)}catch(e){return Promise.reject(e)}},t}(r.AbstractConnector)},31630:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Q:function(){return i}});var i=function(e){var t,i;function o(t){var n,r=t.chainId,i=t.initOptions,o=void 0===i?{}:i,s=t.constructorOptions,a=void 0===s?{}:s,c=t.loginOptions,u=void 0===c?{}:c;return(n=e.call(this,{supportedChainIds:[r]})||this).chainId=r,n.initOptions=o,n.constructorOptions=a,n.loginOptions=u,n}i=e,(t=o).prototype=Object.create(i.prototype),t.prototype.constructor=t,r(t,i);var s=o.prototype;return s.activate=function(){try{var e=this,t=function(){return Promise.resolve(e.torus.login(e.loginOptions).then((function(e){return e[0]}))).then((function(t){return{provider:e.torus.provider,account:t}}))},r=function(){if(!e.torus)return Promise.resolve(Promise.all([n.e(714),n.e(661),n.e(756),n.e(755)]).then(n.bind(n,38086)).then((function(e){var t;return null!=(t=null==e?void 0:e.default)?t:e}))).then((function(t){return e.torus=new t(e.constructorOptions),Promise.resolve(e.torus.init(e.initOptions)).then((function(){}))}))}();return Promise.resolve(r&&r.then?r.then(t):t())}catch(i){return Promise.reject(i)}},s.getProvider=function(){try{return Promise.resolve(this.torus.provider)}catch(e){return Promise.reject(e)}},s.getChainId=function(){try{return Promise.resolve(this.chainId)}catch(e){return Promise.reject(e)}},s.getAccount=function(){try{return Promise.resolve(this.torus.ethereum.request({method:"eth_accounts"}).then((function(e){return e[0]})))}catch(e){return Promise.reject(e)}},s.deactivate=function(){return Promise.resolve()},s.close=function(){try{var e=this;return Promise.resolve(e.torus.cleanUp()).then((function(){e.torus=void 0,e.emitDeactivate()}))}catch(t){return Promise.reject(t)}},o}(n(26939).AbstractConnector)},53653:function(e,t,n){"use strict";var r;n.d(t,{_:function(){return r}}),function(e){e.Update="Web3ReactUpdate",e.Error="Web3ReactError",e.Deactivate="Web3ReactDeactivate"}(r||(r={}))},97452:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(26939);function i(){return i=Object.assign||function(e){for(var t=1;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!r(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(n(e.length)&&r(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function s(e,t,n,r,i){null==r&&null==i||(e=e.slice?e.slice(r,i):Array.prototype.slice.call(e,r,i)),t.set(e,n)}var a={toBytes:function(e){var t=[],n=0;for(e=encodeURI(e);n191&&r<224?(t.push(String.fromCharCode((31&r)<<6|63&e[n+1])),n+=2):(t.push(String.fromCharCode((15&r)<<12|(63&e[n+1])<<6|63&e[n+2])),n+=3)}return t.join("")}},c=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var t=[],n=0;n>4]+e[15&i])}return n.join("")}}}(),u={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],h=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],v=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],x=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],A=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],_=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function k(e){for(var t=[],n=0;n>2,this._Ke[n][t%4]=o[t],this._Kd[e-n][t%4]=o[t];for(var s,a=0,c=i;c>16&255]<<24^d[s>>8&255]<<16^d[255&s]<<8^d[s>>24&255]^l[a]<<24,a+=1,8!=i)for(t=1;t>8&255]<<8^d[s>>16&255]<<16^d[s>>24&255]<<24;for(t=i/2+1;t>2,p=c%4,this._Ke[f][p]=o[t],this._Kd[e-f][p]=o[t++],c++}for(var f=1;f>24&255]^A[s>>16&255]^E[s>>8&255]^_[255&s]},T.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,n=[0,0,0,0],r=k(e),i=0;i<4;i++)r[i]^=this._Ke[0][i];for(var s=1;s>24&255]^h[r[(i+1)%4]>>16&255]^m[r[(i+2)%4]>>8&255]^g[255&r[(i+3)%4]]^this._Ke[s][i];r=n.slice()}var a,c=o(16);for(i=0;i<4;i++)a=this._Ke[t][i],c[4*i]=255&(d[r[i]>>24&255]^a>>24),c[4*i+1]=255&(d[r[(i+1)%4]>>16&255]^a>>16),c[4*i+2]=255&(d[r[(i+2)%4]>>8&255]^a>>8),c[4*i+3]=255&(d[255&r[(i+3)%4]]^a);return c},T.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,n=[0,0,0,0],r=k(e),i=0;i<4;i++)r[i]^=this._Kd[0][i];for(var s=1;s>24&255]^b[r[(i+3)%4]>>16&255]^v[r[(i+2)%4]>>8&255]^w[255&r[(i+1)%4]]^this._Kd[s][i];r=n.slice()}var a,c=o(16);for(i=0;i<4;i++)a=this._Kd[t][i],c[4*i]=255&(f[r[i]>>24&255]^a>>24),c[4*i+1]=255&(f[r[(i+3)%4]>>16&255]^a>>16),c[4*i+2]=255&(f[r[(i+2)%4]>>8&255]^a>>8),c[4*i+3]=255&(f[255&r[(i+1)%4]]^a);return c};var S=function(e){if(!(this instanceof S))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new T(e)};S.prototype.encrypt=function(e){if((e=i(e)).length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),n=o(16),r=0;r=0;--t)this._counter[t]=e%256,e>>=8},R.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var D=function(e,t){if(!(this instanceof D))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof R||(t=new R(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new T(e)};D.prototype.encrypt=function(e){for(var t=i(e,!0),n=0;n16)throw new Error("PKCS#7 padding byte out of range");for(var n=e.length-t,r=0;r`,o="",s=``,a="";let c,u="";for(;Array.isArray(e)&&0!==e.length;){if("number"!==typeof t)throw new Error("abnfToHtml: beg must be type number");if(t>=e.length)break;c="number"!==typeof n||t+n>=e.length?e.length:t+n;let l=0;for(let n=t;n=32&&t<=126)switch(1===l?(u+=o,l=0):2===l&&(u+=a,l=0),t){case 32:u+=" ";break;case 60:u+="<";break;case 62:u+=">";break;case 38:u+="&";break;case 34:u+=""";break;case 39:u+="'";break;case 92:u+="\";break;default:u+=String.fromCharCode(t)}else 9===t||10===t||13===t?(0===l?(u+=r,l=1):2===l&&(u+=a+r,l=1),9===t&&(u+="TAB"),10===t&&(u+="LF"),13===t&&(u+="CR")):(0===l?(u+=s,l=2):1===l&&(u+=o+s,l=2),u+=`\\x${i.utils.charToHex(t)}`)}2===l&&(u+=a),1===l&&(u+=o);break}return u},h=function(e,t,n){let r="";for(let i=t;i=32&&t<=126)r+=String.fromCharCode(t);else switch(t){case 9:r+="\\t";break;case 10:r+="\\n";break;case 13:r+="\\r";break;default:r+="\\unknown"}}return r};let m,g=!1,y=!1,b=!1,v=!1,w=0;if(this.errors=[],t.isBuffer(e))this.chars=o.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else{if("string"!==typeof e)throw new Error("api.js: input source is not a string, byte Buffer or character array");this.chars=o.decode("STRING",e)}this.sabnf=o.encode("STRING",this.chars),this.scan=function(e,t){this.lines=s(this.chars,this.errors,e,t),g=!0},this.parse=function(e,t,n){if(!g)throw new Error("api.js: grammar not scanned");a.syntax(this.chars,this.lines,this.errors,e,t,n),y=!0},this.translate=function(){if(!y)throw new Error("api.js: grammar not scanned and parsed");const e=a.semantic(this.chars,this.lines,this.errors);0===this.errors.length&&(this.rules=e.rules,this.udts=e.udts,m=e.lineMap,b=!0)},this.attributes=function(){if(!b)throw new Error("api.js: grammar not scanned, parsed and translated");return w=c(this.rules,this.udts,m,this.errors),v=!0,w},this.generate=function(e){if(this.lines=s(this.chars,this.errors,e),this.errors.length)return;if(a.syntax(this.chars,this.lines,this.errors,e),this.errors.length)return;const t=a.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=t.rules,this.udts=t.udts,m=t.lineMap,w=c(this.rules,this.udts,m,this.errors),v=!0)},this.displayRules=function(e="index"){if(!b)throw new Error("api.js: grammar not scanned, parsed and translated");return f(this.rules,this.udts,e)},this.displayRuleDependencies=function(e="index"){if(!v)throw new Error("api.js: no attributes - must be preceeded by call to attributes()");return d(e)},this.displayAttributes=function(e="index"){if(!v)throw new Error("api.js: no attributes - must be preceeded by call to attributes()");return w&&l(e),u(e)},this.displayAttributeErrors=function(){if(!v)throw new Error("api.js: no attributes - must be preceeded by call to attributes()");return l()},this.toSource=function(e){if(!v)throw new Error("api.js: can't generate parser source - must be preceeded by call to attributes()");if(w)throw new Error(`api.js: can't generate parser source - attributes have ${w} errors`);return a.generateSource(this.chars,this.lines,this.rules,this.udts,e)},this.toObject=function(){if(!v)throw new Error("api.js: can't generate parser source - must be preceeded by call to attributes()");if(w)throw new Error(`api.js: can't generate parser source - attributes have ${w} errors`);return a.generateObject(this.sabnf,this.rules,this.udts)},this.errorsToAscii=function(){return function(e,t,n){let r,i,o,s;return r="",e.forEach((e=>{i=t[e.line],r+=`${i.lineNo}: `,r+=`${i.beginChar}: `,r+=e.char-i.beginChar+": ",o=i.beginChar,s=e.char-i.beginChar,r+=h(n,o,s),r+=" >> ",o=e.char,s=i.beginChar+i.length-e.char,r+=h(n,o,s),r+="\n",r+=`${i.lineNo}: `,r+=`${i.beginChar}: `,r+=e.char-i.beginChar+": ",r+="error: ",r+=e.msg,r+="\n"})),r}(this.errors,this.lines,this.chars)},this.errorsToHtml=function(e){return function(e,t,n,r){const[o]=i;let s="";const a=`»`;return s+=`

\n`,r&&"string"===typeof r&&(s+=`\n`),s+="\n",e.forEach((e=>{let r,o,c,u,l,d="",f="";0===t.length?(l=a,o=0):(r=t[e.line],c=r.beginChar,e.char>c&&(d=p(n,c,e.char-c)),c=e.char,u=r.beginChar+r.length,c",s+=``,s+="\n",s+="",s+=``,s+="\n")})),s+="
${r}
line
no.
line
offset
error
offset

text
${e.line}${r.beginChar}${o}${l}
↑: ${i.utils.stringToAsciiHtml(e.msg)}

\n",s}(this.errors,this.lines,this.chars,e)},this.linesToAscii=function(){return function(e){let t="Annotated Input Grammar";return e.forEach((e=>{t+="\n",t+=`line no: ${e.lineNo}`,t+=` : char index: ${e.beginChar}`,t+=` : length: ${e.length}`,t+=` : abnf: ${h(r.chars,e.beginChar,e.length)}`})),t+="\n",t}(this.lines)},this.linesToHtml=function(){return function(e){let t="";return t+=`\n`,t+="\n",t+="",t+="",t+="\n",e.forEach((e=>{t+="",t+=`",t+="\n"})),t+="
Annotated Input Grammar
line
no.
first
char

length

text
${e.lineNo}`,t+=`${e.beginChar}`,t+=`${e.length}`,t+=`${p(r.chars,e.beginChar,e.length)}`,t+="
\n",t}(this.lines)}}},68862:function(e,t,n){e.exports=function(){const e=n(58276),{ruleAttributes:t,showAttributes:r,showAttributeErrors:i}=n(94246),{ruleDependencies:o,showRuleDependencies:s}=n(37008);class a{constructor(e,t){this.rules=e,this.udts=t,this.ruleCount=e.length,this.udtCount=t.length,this.startRule=0,this.dependenciesComplete=!1,this.attributesComplete=!1,this.isMutuallyRecursive=!1,this.ruleIndexes=this.indexArray(this.ruleCount),this.ruleAlphaIndexes=this.indexArray(this.ruleCount),this.ruleTypeIndexes=this.indexArray(this.ruleCount),this.udtIndexes=this.indexArray(this.udtCount),this.udtAlphaIndexes=this.indexArray(this.udtCount),this.attrsErrorCount=0,this.attrs=[],this.attrsErrors=[],this.attrsWorking=[],this.ruleDeps=[];for(let n=0;n0)for(let n=0;n0)for(let n=0;nthis.rules[t].lower?1:0}compUdtsAlpha(e,t){return this.udts[e].lowerthis.udts[t].lower?1:0}compRulesType(e,t){return this.ruleDeps[e].recursiveTypethis.ruleDeps[t].recursiveType?1:0}compRulesGroup(t,n){if(this.ruleDeps[t].recursiveType===e.ATTR_MR&&this.ruleDeps[n].recursiveType===e.ATTR_MR){if(this.ruleDeps[t].groupNumberthis.ruleDeps[n].groupNumber)return 1}return 0}}return{attributes:function(e=[],n=[],r=[],i=[]){const s=new a(e,n);return o(s),t(s),s.attrsErrorCount&&i.push({line:0,char:0,msg:`${s.attrsErrorCount} attribute errors`}),s.attrsErrorCount},showAttributes:r,showAttributeErrors:i,showRuleDependencies:s}}()},73737:function(e,t,n){e.exports=function(){const e=n(28737),t=e.ids,r=new(n(74216)),i=new(n(11832)),o=new(n(33610)),s=new e.parser;s.ast=new e.ast,s.callbacks=r.callbacks,s.ast.callbacks=i.callbacks;const a=function(e,t,n){if(t<0||t>=n)return-1;for(let r=0;r=e[r].beginChar&&t{const n=[],r=[];let i=0;e.opcodes.forEach((e=>{e.type===t.ALT&&1===e.children.length||e.type===t.CAT&&1===e.children.length||e.type===t.REP&&1===e.min&&1===e.max?r.push(null):(r.push(i),n.push(e),i+=1)})),r.push(i),n.forEach((e=>{if(e.type===t.ALT||e.type===t.CAT)for(let t=0;t{m.push(e.lower),f+=e.opcodes.length,e.opcodes.forEach((e=>{switch(e.type){case t.ALT:b+=1;break;case t.CAT:v+=1;break;case t.RNM:w+=1;break;case t.UDT:x+=1;break;case t.REP:A+=1;break;case t.AND:E+=1;break;case t.NOT:_+=1;break;case t.BKA:I+=1;break;case t.BKN:O+=1;break;case t.BKR:C+=1;break;case t.ABG:R+=1;break;case t.AEN:D+=1;break;case t.TLS:for(k+=1,s=0;sh&&(h=e.string[s]);break;case t.TBS:for(T+=1,s=0;sh&&(h=e.string[s]);break;case t.TRG:S+=1,e.minh&&(h=e.max);break;default:throw new Error("generateSource: unrecognized opcode")}}))})),m.sort(),i.length>0&&(i.forEach((e=>{g.push(e.lower)})),g.sort()),u+="// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved
\n",u+="// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)
\n",u+="//\n",u+="// Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)\n",o?o.funcName?u+=`const ${o.funcName} = function grammar(){\n`:u+=l?"export function grammar(){\n":d?"export default function grammar(){\n":"module.exports = function grammar(){\n":u+="module.exports = function grammar(){\n",u+=" // ```\n",u+=" // SUMMARY\n",u+=` // rules = ${r.length}\n`,u+=` // udts = ${i.length}\n`,u+=` // opcodes = ${f}\n`,u+=" // --- ABNF original opcodes\n",u+=` // ALT = ${b}\n`,u+=` // CAT = ${v}\n`,u+=` // REP = ${A}\n`,u+=` // RNM = ${w}\n`,u+=` // TLS = ${k}\n`,u+=` // TBS = ${T}\n`,u+=` // TRG = ${S}\n`,u+=" // --- SABNF superset opcodes\n",u+=` // UDT = ${x}\n`,u+=` // AND = ${E}\n`,u+=` // NOT = ${_}\n`,d||(u+=` // BKA = ${I}\n`,u+=` // BKN = ${O}\n`,u+=` // BKR = ${C}\n`,u+=` // ABG = ${R}\n`,u+=` // AEN = ${D}\n`),u+=" // characters = [",u+=k+T+S===0?" none defined ]":`${p} - ${h}]`,x>0&&(u+=" + user defined"),u+="\n",u+=" // ```\n",u+=" /* OBJECT IDENTIFIER (for internal parser use) */\n",u+=" this.grammarObject = 'grammarObject';\n",u+="\n",u+=" /* RULES */\n",u+=" this.rules = [];\n",r.forEach(((e,t)=>{let n=" this.rules[";n+=t,n+="] = { name: '",n+=e.name,n+="', lower: '",n+=e.lower,n+="', index: ",n+=e.index,n+=", isBkr: ",n+=e.isBkr,n+=" };\n",u+=n})),u+="\n",u+=" /* UDTS */\n",u+=" this.udts = [];\n",i.length>0&&i.forEach(((e,t)=>{let n=" this.udts[";n+=t,n+="] = { name: '",n+=e.name,n+="', lower: '",n+=e.lower,n+="', index: ",n+=e.index,n+=", empty: ",n+=e.empty,n+=", isBkr: ",n+=e.isBkr,n+=" };\n",u+=n})),u+="\n",u+=" /* OPCODES */\n",r.forEach(((e,n)=>{n>0&&(u+="\n"),u+=` /* ${e.name} */\n`,u+=` this.rules[${n}].opcodes = [];\n`,e.opcodes.forEach(((e,o)=>{let s;switch(e.type){case t.ALT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, children: [${e.children.toString()}] };// ALT\n`;break;case t.CAT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, children: [${e.children.toString()}] };// CAT\n`;break;case t.RNM:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, index: ${e.index} };// RNM(${r[e.index].name})\n`;break;case t.BKR:e.index>=r.length?(a=i[e.index-r.length].name,c=i[e.index-r.length].lower):(a=r[e.index].name,c=r[e.index].lower),s="%i",e.bkrCase===t.BKR_MODE_CS&&(s="%s"),e.bkrMode===t.BKR_MODE_UM?s+="%u":s+="%p",a=s+a,u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, index: ${e.index}, lower: '${c}', bkrCase: ${e.bkrCase}, bkrMode: ${e.bkrMode} };// BKR(\\${a})\n`;break;case t.UDT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, empty: ${e.empty}, index: ${e.index} };// UDT(${i[e.index].name})\n`;break;case t.REP:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, min: ${e.min}, max: ${e.max} };// REP\n`;break;case t.AND:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// AND\n`;break;case t.NOT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// NOT\n`;break;case t.ABG:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// ABG(%^)\n`;break;case t.AEN:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// AEN(%$)\n`;break;case t.BKA:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// BKA\n`;break;case t.BKN:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// BKN\n`;break;case t.TLS:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, string: [${e.string.toString()}] };// TLS\n`;break;case t.TBS:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, string: [${e.string.toString()}] };// TBS\n`;break;case t.TRG:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, min: ${e.min}, max: ${e.max} };// TRG\n`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}}))})),u+="\n",u+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",u+=" this.toString = function toString(){\n",u+=' let str = "";\n',n.forEach((t=>{const n=t.beginChar+t.length;y="",u+=' str += "';for(let r=t.beginChar;r{i.push(e.lower)})),i.sort(),n.length>0&&(n.forEach((e=>{o.push(e.lower)})),o.sort()),r.callbacks=[],i.forEach((e=>{r.callbacks[e]=!1})),n.length>0&&o.forEach((e=>{r.callbacks[e]=!1})),r.rules=t,r.udts=n,r.toString=function(){return s},r}}},94246:function(e,t,n){e.exports=function(){const e=n(58276);let t=null;function r(e){return!(e.left||e.nested||e.right||e.cyclic)&&e.empty}function i(e){return!!(e.left||e.nested||e.right||e.cyclic)}function o(e,t,n,o){let a=0;const c=t[n],u=c.children.length,l=[];for(a=0;a=0;n-=1){if(e[n].right)return!0;if(!e[n].empty)return!1}return!1}(l,u),o.nested=function(e,t){let n=0,o=0,s=0;for(n=0;n=0;n-=1)if(e[n].left&&!e[n].leaf)for(o=n-1;o>=0;o-=1)if(!r(e[o]))return!0;for(n=0;n=e.ruleCount?(r.empty=e.udts[i.index-e.ruleCount].empty,r.finite=!0):(a(e,i.index,r),r.left=!1,r.nested=!1,r.right=!1,r.cyclic=!1)}(t,n,r,i);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:s(t,n,r+1,i),i.empty=!0;break;case e.TLS:i.empty=!n[r].string.length,i.finite=!0,i.cyclic=!1;break;case e.TBS:case e.TRG:i.empty=!1,i.finite=!0,i.cyclic=!1;break;case e.UDT:i.empty=c.empty,i.finite=!0,i.cyclic=!1;break;case e.ABG:case e.AEN:i.empty=!0,i.finite=!0,i.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${c}`)}}function a(e,t,n){const r=e.attrsWorking[t];r.isComplete?e.attrCopy(n,r):r.isOpen?t===e.startRule?t===e.startRule&&(n.left=!0,n.right=!0,n.cyclic=!0,n.leaf=!0):n.finite=!0:(r.isOpen=!0,s(e,r.rule.opcodes,0,n),r.left=n.left,r.right=n.right,r.nested=n.nested,r.empty=n.empty,r.finite=n.finite,r.cyclic=n.cyclic,r.leaf=!1,r.isOpen=!1,r.isComplete=!0)}const c=e=>e?"t":"f",u=e=>e?"e":"f",l=(n,r,i,o)=>{let s=`${n}:${r}:`;return s+=`${u(i.left)} `,s+=`${c(i.nested)} `,s+=`${c(i.right)} `,s+=`${u(i.cyclic)} `,s+=(i.finite?"t":"e")+" ",s+=`${c(i.empty)}:`,s+=`${t.typeToString(o.recursiveType)}:`,s+=o.recursiveType===e.ATTR_MR?o.groupNumber:"-",s+=`:${i.rule.name}\n`,s},d=()=>{let e="LEGEND - t=true, f=false, e=error\n";return e+="sequence:rule index:left nested right cyclic finite empty:type:group number:rule name\n","LEGEND - t=true, f=false, e=error\nsequence:rule index:left nested right cyclic finite empty:type:group number:rule name\n"},f=e=>{let n=0,r=0,i=null,o=null,s="",{ruleIndexes:a}=t;for(97===e?a=t.ruleAlphaIndexes:116===e&&(a=t.ruleTypeIndexes),n=0;n{t=e;let n=0,r=0;const i=t.attrGen();for(n=0;n{if(!t.attributesComplete)throw new Error("rule-attributes.js:showAttributes: attributes not available");let n="";const r="RULE ATTRIBUTES\n";return 97===e.charCodeAt(0)?(n+="alphabetical by rule name\n",n+=r,n+=d(),n+=f(97)):116===e.charCodeAt(0)?(n+="ordered by rule type\n",n+=r,n+=d(),n+=f(116)):(n+="ordered by rule index\n",n+=r,n+=d(),n+=f()),n},showAttributeErrors:()=>{let e=null,n=null,r="";if(r+="RULE ATTRIBUTES WITH ERRORS\n",r+=d(),t.attrsErrorCount)for(let i=0;i{const e=n(58276);let t=null;const r=(t,n,i,o)=>{let s=0,a=0;const c=n[i];o[i]=!0;const u=c.rule.opcodes;for(s=0;s{let n=0,r=0,i=0,o=0;const s=t.ruleCount-1,a=t.udtCount-1;let c="",u="";const l="=> ";let d=!1,f=null,{ruleIndexes:p}=t,{udtIndexes:h}=t;for(97===e?(p=t.ruleAlphaIndexes,h=t.udtAlphaIndexes):116===e&&(p=t.ruleTypeIndexes,h=t.udtAlphaIndexes),n=0;n-1?f.groupNumber:"-",u+=":"),u+=" ",c+=`${u+t.rules[p[n]].name}\n`,d=!0,i=0,o=c.length,c+=u,r=0;r100&&r!==s&&(c+=`\n${u}=> `,o=c.length);if(t.udtCount)for(r=0;r100&&r!==a&&(c+=`\n${u}=> `,o=c.length);for(0===i&&(c+="=> \n"),!1===d&&(c+="\n"),d=!0,i=0,o=c.length,c+=u,r=0;r100&&r!==s&&(c+=`\n${u}=> `,o=c.length);0===i&&(c+="<= \n"),!1===d&&(c+="\n"),c+="\n"}return c};return{ruleDependencies:n=>{t=n;let i=0,o=0,s=0,a=null,c=null,u=!1;t.dependenciesComplete=!1;const l=t.falseArray(t.ruleCount);for(i=0;i-1,t.ruleAlphaIndexes.sort(t.compRulesAlpha),t.ruleTypeIndexes.sort(t.compRulesAlpha),t.ruleTypeIndexes.sort(t.compRulesType),t.isMutuallyRecursive&&t.ruleTypeIndexes.sort(t.compRulesGroup),t.udtCount&&t.udtAlphaIndexes.sort(t.compUdtsAlpha),t.dependenciesComplete=!0},showRuleDependencies:(e="index")=>{let n="RULE DEPENDENCIES(index:type:[group number:])\n";return n+="=> refers to rule names\n",n+="<= referenced by rule names\n",t.dependenciesComplete?(97===e.charCodeAt(0)?(n+="alphabetical by rule name\n",n+=i(97)):116===e.charCodeAt(0)?(n+="ordered by rule type\n",n+=i(116)):(n+="ordered by rule index\n",n+=i(null)),n):n}}})()},33610:function(e){e.exports=function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=function(){let e="";return e+=";\n",e+="; ABNF for JavaScript APG 2.0 SABNF\n",e+="; RFC 5234 with some restrictions and additions.\n",e+="; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation\n",e+='; - accepts %s"string" as a case-sensitive string\n',e+='; - accepts %i"string" as a case-insensitive string\n',e+='; - accepts "string" as a case-insensitive string\n',e+=";\n",e+="; Some restrictions:\n",e+="; 1. Rules must begin at first character of each line.\n",e+="; Indentations on first rule and rules thereafter are not allowed.\n",e+="; 2. Relaxed line endings. CRLF, LF or CR are accepted as valid line ending.\n",e+="; 3. Prose values, i.e. , are accepted as valid grammar syntax.\n",e+="; However, a working parser cannot be generated from them.\n",e+=";\n",e+="; Super set (SABNF) additions:\n",e+="; 1. Look-ahead (syntactic predicate) operators are accepted as element prefixes.\n",e+="; & is the positive look-ahead operator, succeeds and backtracks if the look-ahead phrase is found\n",e+="; ! is the negative look-ahead operator, succeeds and backtracks if the look-ahead phrase is NOT found\n",e+="; e.g. &%d13 or &rule or !(A / B)\n",e+="; 2. User-Defined Terminals (UDT) of the form, u_name and e_name are accepted.\n",e+="; 'name' is alpha followed by alpha/num/hyphen just like a rule name.\n",e+="; u_name may be used as an element but no rule definition is given.\n",e+="; e.g. rule = A / u_myUdt\n",e+='; A = "a"\n',e+="; would be a valid grammar.\n",e+="; 3. Case-sensitive, single-quoted strings are accepted.\n",e+="; e.g. 'abc' would be equivalent to %d97.98.99\n",e+='; (kept for backward compatibility, but superseded by %s"abc") \n',e+="; New 12/26/2015\n",e+="; 4. Look-behind operators are accepted as element prefixes.\n",e+="; && is the positive look-behind operator, succeeds and backtracks if the look-behind phrase is found\n",e+="; !! is the negative look-behind operator, succeeds and backtracks if the look-behind phrase is NOT found\n",e+="; e.g. &&%d13 or &&rule or !!(A / B)\n",e+="; 5. Back reference operators, i.e. \\rulename, are accepted.\n",e+="; A back reference operator acts like a TLS or TBS terminal except that the phrase it attempts\n",e+="; to match is a phrase previously matched by the rule 'rulename'.\n",e+="; There are two modes of previous phrase matching - the parent-frame mode and the universal mode.\n",e+="; In universal mode, \\rulename matches the last match to 'rulename' regardless of where it was found.\n",e+="; In parent-frame mode, \\rulename matches only the last match found on the parent's frame or parse tree level.\n",e+="; Back reference modifiers can be used to specify case and mode.\n",e+="; \\A defaults to case-insensitive and universal mode, e.g. \\A === \\%i%uA\n",e+="; Modifiers %i and %s determine case-insensitive and case-sensitive mode, respectively.\n",e+="; Modifiers %u and %p determine universal mode and parent frame mode, respectively.\n",e+="; Case and mode modifiers can appear in any order, e.g. \\%s%pA === \\%p%sA. \n",e+="; 7. String begin anchor, ABG(%^) matches the beginning of the input string location.\n",e+="; Returns EMPTY or NOMATCH. Never consumes any characters.\n",e+="; 8. String end anchor, AEN(%$) matches the end of the input string location.\n",e+="; Returns EMPTY or NOMATCH. Never consumes any characters.\n",e+=";\n",e+="File = *(BlankLine / Rule / RuleError)\n",e+="BlankLine = *(%d32/%d9) [comment] LineEnd\n",e+="Rule = RuleLookup owsp Alternation ((owsp LineEnd)\n",e+=" / (LineEndError LineEnd))\n",e+="RuleLookup = RuleNameTest owsp DefinedAsTest\n",e+="RuleNameTest = RuleName/RuleNameError\n",e+="RuleName = alphanum\n",e+="RuleNameError = 1*(%d33-60/%d62-126)\n",e+="DefinedAsTest = DefinedAs / DefinedAsError\n",e+="DefinedAsError = 1*2%d33-126\n",e+="DefinedAs = IncAlt / Defined\n",e+="Defined = %d61\n",e+="IncAlt = %d61.47\n",e+="RuleError = 1*(%d32-126 / %d9 / LineContinue) LineEnd\n",e+="LineEndError = 1*(%d32-126 / %d9 / LineContinue)\n",e+="Alternation = Concatenation *(owsp AltOp Concatenation)\n",e+="Concatenation = Repetition *(CatOp Repetition)\n",e+="Repetition = [Modifier] (Group / Option / BasicElement / BasicElementErr)\n",e+="Modifier = (Predicate [RepOp])\n",e+=" / RepOp\n",e+="Predicate = BkaOp\n",e+=" / BknOp\n",e+=" / AndOp\n",e+=" / NotOp\n",e+="BasicElement = UdtOp\n",e+=" / RnmOp\n",e+=" / TrgOp\n",e+=" / TbsOp\n",e+=" / TlsOp\n",e+=" / ClsOp\n",e+=" / BkrOp\n",e+=" / AbgOp\n",e+=" / AenOp\n",e+=" / ProsVal\n",e+="BasicElementErr = 1*(%d33-40/%d42-46/%d48-92/%d94-126)\n",e+="Group = GroupOpen Alternation (GroupClose / GroupError)\n",e+="GroupError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\n",e+="GroupOpen = %d40 owsp\n",e+="GroupClose = owsp %d41\n",e+="Option = OptionOpen Alternation (OptionClose / OptionError)\n",e+="OptionError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\n",e+="OptionOpen = %d91 owsp\n",e+="OptionClose = owsp %d93\n",e+="RnmOp = alphanum\n",e+="BkrOp = %d92 [bkrModifier] bkr-name\n",e+="bkrModifier = (cs [um / pm]) / (ci [um / pm]) / (um [cs /ci]) / (pm [cs / ci])\n",e+="cs = '%s'\n",e+="ci = '%i'\n",e+="um = '%u'\n",e+="pm = '%p'\n",e+="bkr-name = uname / ename / rname\n",e+="rname = alphanum\n",e+="uname = %d117.95 alphanum\n",e+="ename = %d101.95 alphanum\n",e+="UdtOp = udt-empty\n",e+=" / udt-non-empty\n",e+="udt-non-empty = %d117.95 alphanum\n",e+="udt-empty = %d101.95 alphanum\n",e+="RepOp = (rep-min StarOp rep-max)\n",e+=" / (rep-min StarOp)\n",e+=" / (StarOp rep-max)\n",e+=" / StarOp\n",e+=" / rep-min-max\n",e+="AltOp = %d47 owsp\n",e+="CatOp = wsp\n",e+="StarOp = %d42\n",e+="AndOp = %d38\n",e+="NotOp = %d33\n",e+="BkaOp = %d38.38\n",e+="BknOp = %d33.33\n",e+="AbgOp = %d37.94\n",e+="AenOp = %d37.36\n",e+="TrgOp = %d37 ((Dec dmin %d45 dmax) / (Hex xmin %d45 xmax) / (Bin bmin %d45 bmax))\n",e+="TbsOp = %d37 ((Dec dString *(%d46 dString)) / (Hex xString *(%d46 xString)) / (Bin bString *(%d46 bString)))\n",e+="TlsOp = TlsCase TlsOpen TlsString TlsClose\n",e+='TlsCase = ["%i" / "%s"]\n',e+="TlsOpen = %d34\n",e+="TlsClose = %d34\n",e+="TlsString = *(%d32-33/%d35-126/StringTab)\n",e+="StringTab = %d9\n",e+="ClsOp = ClsOpen ClsString ClsClose\n",e+="ClsOpen = %d39\n",e+="ClsClose = %d39\n",e+="ClsString = *(%d32-38/%d40-126/StringTab)\n",e+="ProsVal = ProsValOpen ProsValString ProsValClose\n",e+="ProsValOpen = %d60\n",e+="ProsValString = *(%d32-61/%d63-126/StringTab)\n",e+="ProsValClose = %d62\n",e+="rep-min = rep-num\n",e+="rep-min-max = rep-num\n",e+="rep-max = rep-num\n",e+="rep-num = 1*(%d48-57)\n",e+="dString = dnum\n",e+="xString = xnum\n",e+="bString = bnum\n",e+="Dec = (%d68/%d100)\n",e+="Hex = (%d88/%d120)\n",e+="Bin = (%d66/%d98)\n",e+="dmin = dnum\n",e+="dmax = dnum\n",e+="bmin = bnum\n",e+="bmax = bnum\n",e+="xmin = xnum\n",e+="xmax = xnum\n",e+="dnum = 1*(%d48-57)\n",e+="bnum = 1*%d48-49\n",e+="xnum = 1*(%d48-57 / %d65-70 / %d97-102)\n",e+=";\n",e+="; Basics\n",e+="alphanum = (%d97-122/%d65-90) *(%d97-122/%d65-90/%d48-57/%d45)\n",e+="owsp = *space\n",e+="wsp = 1*space\n",e+="space = %d32\n",e+=" / %d9\n",e+=" / comment\n",e+=" / LineContinue\n",e+="comment = %d59 *(%d32-126 / %d9)\n",e+="LineEnd = %d13.10\n",e+=" / %d10\n",e+=" / %d13\n",e+="LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)\n",";\n; ABNF for JavaScript APG 2.0 SABNF\n; RFC 5234 with some restrictions and additions.\n; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation\n; - accepts %s\"string\" as a case-sensitive string\n; - accepts %i\"string\" as a case-insensitive string\n; - accepts \"string\" as a case-insensitive string\n;\n; Some restrictions:\n; 1. Rules must begin at first character of each line.\n; Indentations on first rule and rules thereafter are not allowed.\n; 2. Relaxed line endings. CRLF, LF or CR are accepted as valid line ending.\n; 3. Prose values, i.e. , are accepted as valid grammar syntax.\n; However, a working parser cannot be generated from them.\n;\n; Super set (SABNF) additions:\n; 1. Look-ahead (syntactic predicate) operators are accepted as element prefixes.\n; & is the positive look-ahead operator, succeeds and backtracks if the look-ahead phrase is found\n; ! is the negative look-ahead operator, succeeds and backtracks if the look-ahead phrase is NOT found\n; e.g. &%d13 or &rule or !(A / B)\n; 2. User-Defined Terminals (UDT) of the form, u_name and e_name are accepted.\n; 'name' is alpha followed by alpha/num/hyphen just like a rule name.\n; u_name may be used as an element but no rule definition is given.\n; e.g. rule = A / u_myUdt\n; A = \"a\"\n; would be a valid grammar.\n; 3. Case-sensitive, single-quoted strings are accepted.\n; e.g. 'abc' would be equivalent to %d97.98.99\n; (kept for backward compatibility, but superseded by %s\"abc\") \n; New 12/26/2015\n; 4. Look-behind operators are accepted as element prefixes.\n; && is the positive look-behind operator, succeeds and backtracks if the look-behind phrase is found\n; !! is the negative look-behind operator, succeeds and backtracks if the look-behind phrase is NOT found\n; e.g. &&%d13 or &&rule or !!(A / B)\n; 5. Back reference operators, i.e. \\rulename, are accepted.\n; A back reference operator acts like a TLS or TBS terminal except that the phrase it attempts\n; to match is a phrase previously matched by the rule 'rulename'.\n; There are two modes of previous phrase matching - the parent-frame mode and the universal mode.\n; In universal mode, \\rulename matches the last match to 'rulename' regardless of where it was found.\n; In parent-frame mode, \\rulename matches only the last match found on the parent's frame or parse tree level.\n; Back reference modifiers can be used to specify case and mode.\n; \\A defaults to case-insensitive and universal mode, e.g. \\A === \\%i%uA\n; Modifiers %i and %s determine case-insensitive and case-sensitive mode, respectively.\n; Modifiers %u and %p determine universal mode and parent frame mode, respectively.\n; Case and mode modifiers can appear in any order, e.g. \\%s%pA === \\%p%sA. \n; 7. String begin anchor, ABG(%^) matches the beginning of the input string location.\n; Returns EMPTY or NOMATCH. Never consumes any characters.\n; 8. String end anchor, AEN(%$) matches the end of the input string location.\n; Returns EMPTY or NOMATCH. Never consumes any characters.\n;\nFile = *(BlankLine / Rule / RuleError)\nBlankLine = *(%d32/%d9) [comment] LineEnd\nRule = RuleLookup owsp Alternation ((owsp LineEnd)\n / (LineEndError LineEnd))\nRuleLookup = RuleNameTest owsp DefinedAsTest\nRuleNameTest = RuleName/RuleNameError\nRuleName = alphanum\nRuleNameError = 1*(%d33-60/%d62-126)\nDefinedAsTest = DefinedAs / DefinedAsError\nDefinedAsError = 1*2%d33-126\nDefinedAs = IncAlt / Defined\nDefined = %d61\nIncAlt = %d61.47\nRuleError = 1*(%d32-126 / %d9 / LineContinue) LineEnd\nLineEndError = 1*(%d32-126 / %d9 / LineContinue)\nAlternation = Concatenation *(owsp AltOp Concatenation)\nConcatenation = Repetition *(CatOp Repetition)\nRepetition = [Modifier] (Group / Option / BasicElement / BasicElementErr)\nModifier = (Predicate [RepOp])\n / RepOp\nPredicate = BkaOp\n / BknOp\n / AndOp\n / NotOp\nBasicElement = UdtOp\n / RnmOp\n / TrgOp\n / TbsOp\n / TlsOp\n / ClsOp\n / BkrOp\n / AbgOp\n / AenOp\n / ProsVal\nBasicElementErr = 1*(%d33-40/%d42-46/%d48-92/%d94-126)\nGroup = GroupOpen Alternation (GroupClose / GroupError)\nGroupError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\nGroupOpen = %d40 owsp\nGroupClose = owsp %d41\nOption = OptionOpen Alternation (OptionClose / OptionError)\nOptionError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\nOptionOpen = %d91 owsp\nOptionClose = owsp %d93\nRnmOp = alphanum\nBkrOp = %d92 [bkrModifier] bkr-name\nbkrModifier = (cs [um / pm]) / (ci [um / pm]) / (um [cs /ci]) / (pm [cs / ci])\ncs = '%s'\nci = '%i'\num = '%u'\npm = '%p'\nbkr-name = uname / ename / rname\nrname = alphanum\nuname = %d117.95 alphanum\nename = %d101.95 alphanum\nUdtOp = udt-empty\n / udt-non-empty\nudt-non-empty = %d117.95 alphanum\nudt-empty = %d101.95 alphanum\nRepOp = (rep-min StarOp rep-max)\n / (rep-min StarOp)\n / (StarOp rep-max)\n / StarOp\n / rep-min-max\nAltOp = %d47 owsp\nCatOp = wsp\nStarOp = %d42\nAndOp = %d38\nNotOp = %d33\nBkaOp = %d38.38\nBknOp = %d33.33\nAbgOp = %d37.94\nAenOp = %d37.36\nTrgOp = %d37 ((Dec dmin %d45 dmax) / (Hex xmin %d45 xmax) / (Bin bmin %d45 bmax))\nTbsOp = %d37 ((Dec dString *(%d46 dString)) / (Hex xString *(%d46 xString)) / (Bin bString *(%d46 bString)))\nTlsOp = TlsCase TlsOpen TlsString TlsClose\nTlsCase = [\"%i\" / \"%s\"]\nTlsOpen = %d34\nTlsClose = %d34\nTlsString = *(%d32-33/%d35-126/StringTab)\nStringTab = %d9\nClsOp = ClsOpen ClsString ClsClose\nClsOpen = %d39\nClsClose = %d39\nClsString = *(%d32-38/%d40-126/StringTab)\nProsVal = ProsValOpen ProsValString ProsValClose\nProsValOpen = %d60\nProsValString = *(%d32-61/%d63-126/StringTab)\nProsValClose = %d62\nrep-min = rep-num\nrep-min-max = rep-num\nrep-max = rep-num\nrep-num = 1*(%d48-57)\ndString = dnum\nxString = xnum\nbString = bnum\nDec = (%d68/%d100)\nHex = (%d88/%d120)\nBin = (%d66/%d98)\ndmin = dnum\ndmax = dnum\nbmin = bnum\nbmax = bnum\nxmin = xnum\nxmax = xnum\ndnum = 1*(%d48-57)\nbnum = 1*%d48-49\nxnum = 1*(%d48-57 / %d65-70 / %d97-102)\n;\n; Basics\nalphanum = (%d97-122/%d65-90) *(%d97-122/%d65-90/%d48-57/%d45)\nowsp = *space\nwsp = 1*space\nspace = %d32\n / %d9\n / comment\n / LineContinue\ncomment = %d59 *(%d32-126 / %d9)\nLineEnd = %d13.10\n / %d10\n / %d13\nLineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)\n"}}},73479:function(e,t,n){const r=n(58276),i=n(8544);const o=[];o.line=function(e,t,n,i,o){return e===r.SEM_PRE?(o.endLength=0,o.textLength=0,o.invalidCount=0):o.lines.push({lineNo:o.lines.length,beginChar:n,length:i,textLength:o.textLength,endType:o.endType,invalidChars:o.invalidCount}),r.SEM_OK},o["line-text"]=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.textLength=i),r.SEM_OK},o["last-line"]=function(e,t,n,i,o){return e===r.SEM_PRE?(o.endLength=0,o.textLength=0,o.invalidCount=0):o.strict?(o.lines.push({lineNo:o.lines.length,beginChar:n,length:i,textLength:i,endType:"none",invalidChars:o.invalidCount}),o.errors.push({line:o.lineNo,char:n+i,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(t.push(10),o.lines.push({lineNo:o.lines.length,beginChar:n,length:i+1,textLength:i,endType:"LF",invalidChars:o.invalidCount})),r.SEM_OK},o.invalid=function(e,t,n,o,s){return e===r.SEM_PRE&&s.errors.push({line:s.lineNo,char:n,msg:`invalid character found '\\x${i.charToHex(t[n])}'`}),r.SEM_OK},o.end=function(e,t,n,i,o){return e===r.SEM_POST&&(o.lineNo+=1),r.SEM_OK},o.lf=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.endType="LF",o.strict&&o.errors.push({line:o.lineNo,char:n,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),r.SEM_OK},o.cr=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.endType="CR",o.strict&&o.errors.push({line:o.lineNo,char:n,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),r.SEM_OK},o.crlf=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.endType="CRLF"),r.SEM_OK},t.callbacks=o},66410:function(e){e.exports=function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"file",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"line",lower:"line",index:1,isBkr:!1},this.rules[2]={name:"line-text",lower:"line-text",index:2,isBkr:!1},this.rules[3]={name:"last-line",lower:"last-line",index:3,isBkr:!1},this.rules[4]={name:"valid",lower:"valid",index:4,isBkr:!1},this.rules[5]={name:"invalid",lower:"invalid",index:5,isBkr:!1},this.rules[6]={name:"end",lower:"end",index:6,isBkr:!1},this.rules[7]={name:"CRLF",lower:"crlf",index:7,isBkr:!1},this.rules[8]={name:"LF",lower:"lf",index:8,isBkr:!1},this.rules[9]={name:"CR",lower:"cr",index:9,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,3]},this.rules[0].opcodes[1]={type:3,min:0,max:1/0},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:3,min:0,max:1},this.rules[0].opcodes[4]={type:4,index:3},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2]},this.rules[1].opcodes[1]={type:4,index:2},this.rules[1].opcodes[2]={type:4,index:6},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:0,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:4},this.rules[2].opcodes[3]={type:4,index:5},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:1,max:1/0},this.rules[3].opcodes[1]={type:1,children:[2,3]},this.rules[3].opcodes[2]={type:4,index:4},this.rules[3].opcodes[3]={type:4,index:5},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:5,min:32,max:126},this.rules[4].opcodes[2]={type:6,string:[9]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[5].opcodes[1]={type:5,min:0,max:8},this.rules[5].opcodes[2]={type:5,min:11,max:12},this.rules[5].opcodes[3]={type:5,min:14,max:31},this.rules[5].opcodes[4]={type:5,min:127,max:4294967295},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:1,children:[1,2,3]},this.rules[6].opcodes[1]={type:4,index:7},this.rules[6].opcodes[2]={type:4,index:8},this.rules[6].opcodes[3]={type:4,index:9},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:6,string:[13,10]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:6,string:[10]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:6,string:[13]},this.toString=function(){let e="";return e+="file = *line [last-line]\n",e+="line = line-text end\n",e+="line-text = *(valid/invalid)\n",e+="last-line = 1*(valid/invalid)\n",e+="valid = %d32-126 / %d9\n",e+="invalid = %d0-8 / %d11-12 /%d14-31 / %x7f-ffffffff\n",e+="end = CRLF / LF / CR\n",e+="CRLF = %d13.10\n",e+="LF = %d10\n",e+="CR = %d13\n","file = *line [last-line]\nline = line-text end\nline-text = *(valid/invalid)\nlast-line = 1*(valid/invalid)\nvalid = %d32-126 / %d9\ninvalid = %d0-8 / %d11-12 /%d14-31 / %x7f-ffffffff\nend = CRLF / LF / CR\nCRLF = %d13.10\nLF = %d10\nCR = %d13\n"}}},1789:function(e,t,n){e.exports=function(e,t,r,i){const o=n(28737),s=new(n(66410)),{callbacks:a}=n(73479),c=[],u=new o.parser;if(u.ast=new o.ast,u.ast.callbacks=a,i){if("traceObject"!==i.traceObject)throw new TypeError("scanner.js: trace argument is not a trace object");u.trace=i}if(!0!==u.parse(s,"file",e).success)return void t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});const l={lines:c,lineNo:0,errors:t,strict:!!r};return u.ast.translate(l),c}},11832:function(e,t,n){e.exports=function(){const e=n(28737),t=e.ids,r=function(){this.names=[],this.add=function(e){let t=-1;return-1===this.get(e)&&(t={name:e,lower:e.toLowerCase(),index:this.names.length},this.names.push(t)),t},this.get=function(e){let t=-1;const n=e.toLowerCase();for(let r=0;r=48&&t<=57)t-=48;else if(t>=65&&t<=70)t-=55;else{if(!(t>=97&&t<=102))throw new Error("hexnum out of range");t-=87}r=16*r+t}return r};this.callbacks=[],this.callbacks.abgop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.ABG}),s},this.callbacks.aenop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.AEN}),s},this.callbacks.alternation=function(e,n,r,i,o){let s=t.SEM_OK;if(e===t.SEM_PRE){const e=!0;for(;e;){if(null===o.definedas){s=t.SEM_SKIP;break}if(null===o.topStack){if("="===o.definedas){o.topStack={alt:{type:t.ALT,children:[]},cat:null},o.altStack.push(o.topStack),o.opcodes.push(o.topStack.alt);break}o.topStack={alt:o.opcodes[0],cat:null},o.altStack.push(o.topStack);break}o.topStack={alt:{type:t.ALT,children:[]},cat:null},o.altStack.push(o.topStack),o.opcodes.push(o.topStack.alt);break}}else e===t.SEM_POST&&(o.altStack.pop(),o.altStack.length>0?o.topStack=o.altStack[o.altStack.length-1]:o.topStack=null);return s},this.callbacks.andop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.AND}),s},this.callbacks.bmax=function(e,n,r,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=o(n,r,i)),a},this.callbacks.bmin=function(e,n,r,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=o(n,r,i)),a},this.callbacks.bkaop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.BKA}),s},this.callbacks.bknop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.BKN}),s},this.callbacks.bkrop=function(n,r,i,o,s){const a=t.SEM_OK;return n===t.SEM_PRE?(s.ci=!0,s.cs=!1,s.um=!0,s.pm=!1):n===t.SEM_POST&&s.opcodes.push({type:t.BKR,bkrCase:!0===s.cs?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:!0===s.pm?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:s.bkrname.phraseIndex,name:e.utils.charsToString(r,s.bkrname.phraseIndex,s.bkrname.phraseLength)}}),a},this.callbacks["bkr-name"]=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.bkrname={phraseIndex:r,phraseLength:i}),s},this.callbacks.bstring=function(e,n,r,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&s.tbsstr.push(o(n,r,i)),a},this.callbacks.clsop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(i<=2?o.opcodes.push({type:t.TLS,string:[]}):o.opcodes.push({type:t.TBS,string:n.slice(r+1,r+i-1)})),s},this.callbacks.ci=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.ci=!0),s},this.callbacks.cs=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.cs=!0),s},this.callbacks.um=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.um=!0),s},this.callbacks.pm=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.pm=!0),s},this.callbacks.concatenation=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.topStack.alt.children.push(o.opcodes.length),o.topStack.cat={type:t.CAT,children:[]},o.opcodes.push(o.topStack.cat)):e===t.SEM_POST&&(o.topStack.cat=null),s},this.callbacks.defined=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.definedas="="),s},this.callbacks.dmax=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=i(n,r,o)),a},this.callbacks.dmin=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=i(n,r,o)),a},this.callbacks.dstring=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&s.tbsstr.push(i(n,r,o)),a},this.callbacks.file=function(e,n,i,o,s){const a=t.SEM_OK;if(e===t.SEM_PRE)s.ruleNames=new r,s.udtNames=new r,s.rules=[],s.udts=[],s.rulesLineMap=[],s.opcodes=[],s.altStack=[],s.topStack=null,s.topRule=null;else if(e===t.SEM_POST){let e;s.rules.forEach((n=>{n.isBkr=!1,n.opcodes.forEach((n=>{n.type===t.RNM&&(e=s.ruleNames.get(n.index.name),-1===e?(s.errors.push({line:s.findLine(s.lines,n.index.phraseIndex,s.charsLength),char:n.index.phraseIndex,msg:`Rule name '${n.index.name}' used but not defined.`}),n.index=-1):n.index=e.index)}))})),s.udts.forEach((e=>{e.isBkr=!1})),s.rules.forEach((n=>{n.opcodes.forEach((r=>{r.type===t.BKR&&(n.hasBkr=!0,e=s.ruleNames.get(r.index.name),-1!==e?(s.rules[e.index].isBkr=!0,r.index=e.index):(e=s.udtNames.get(r.index.name),-1!==e?(s.udts[e.index].isBkr=!0,r.index=s.rules.length+e.index):(s.errors.push({line:s.findLine(s.lines,r.index.phraseIndex,s.charsLength),char:r.index.phraseIndex,msg:`Back reference name '${r.index.name}' refers to undefined rule or unamed UDT.`}),r.index=-1)))}))}))}return a},this.callbacks.incalt=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.definedas="=/"),s},this.callbacks.notop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.NOT}),s},this.callbacks.optionopen=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.REP,min:0,max:1,char:r}),s},this.callbacks["rep-max"]=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=i(n,r,o)),a},this.callbacks["rep-min"]=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=i(n,r,o)),a},this.callbacks["rep-min-max"]=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=i(n,r,o),s.min=s.max),a},this.callbacks.repetition=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&o.topStack.cat.children.push(o.opcodes.length),s},this.callbacks.repop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.min=0,o.max=1/0,o.topRep={type:t.REP,min:0,max:1/0},o.opcodes.push(o.topRep)):e===t.SEM_POST&&(o.min>o.max&&o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`repetition min cannot be greater than max: min: ${o.min}: max: ${o.max}`}),o.topRep.min=o.min,o.topRep.max=o.max),s},this.callbacks.rnmop=function(n,r,i,o,s){const a=t.SEM_OK;return n===t.SEM_POST&&s.opcodes.push({type:t.RNM,index:{phraseIndex:i,name:e.utils.charsToString(r,i,o)}}),a},this.callbacks.rule=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&(o.altStack.length=0,o.topStack=null,o.rulesLineMap.push({line:o.findLine(o.lines,r,o.charsLength),char:r})),s},this.callbacks.rulelookup=function(e,n,r,i,o){const s=t.SEM_OK;if(e===t.SEM_PRE)o.ruleName="",o.definedas="";else if(e===t.SEM_POST){let e;"="===o.definedas?(e=o.ruleNames.add(o.ruleName),-1===e?(o.definedas=null,o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`Rule name '${o.ruleName}' previously defined.`})):(o.topRule={name:e.name,lower:e.lower,opcodes:[],index:e.index},o.rules.push(o.topRule),o.opcodes=o.topRule.opcodes)):(e=o.ruleNames.get(o.ruleName),-1===e?(o.definedas=null,o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`Rule name '${o.ruleName}' for incremental alternate not previously defined.`})):(o.topRule=o.rules[e.index],o.opcodes=o.topRule.opcodes))}return s},this.callbacks.rulename=function(n,r,i,o,s){const a=t.SEM_OK;return n===t.SEM_PRE&&(s.ruleName=e.utils.charsToString(r,i,o)),a},this.callbacks.tbsop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?o.tbsstr=[]:e===t.SEM_POST&&o.opcodes.push({type:t.TBS,string:o.tbsstr}),s},this.callbacks.tlscase=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&i>0&&(83===n[r+1]||115===n[r+1])&&(o.tlscase=!1),s},this.callbacks.tlsstring=function(e,n,r,i,o){const s=t.SEM_OK;if(e===t.SEM_POST)if(o.tlscase){const e=n.slice(r,r+i);for(let t=0;t=65&&e[t]<=90&&(e[t]+=32);o.opcodes.push({type:t.TLS,string:e})}else o.opcodes.push({type:t.TBS,string:n.slice(r,r+i)});return s},this.callbacks.tlsop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&(o.tlscase=!0),s},this.callbacks.trgop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.min=0,o.max=0):e===t.SEM_POST&&(o.min>o.max&&o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${o.min}: max: ${o.max}`}),o.opcodes.push({type:t.TRG,min:o.min,max:o.max})),s},this.callbacks["udt-empty"]=function(n,r,i,o,s){const a=t.SEM_OK;if(n===t.SEM_POST){const n=e.utils.charsToString(r,i,o);let a=s.udtNames.add(n);if(-1===a){if(a=s.udtNames.get(n),-1===a)throw new Error("semUdtEmpty: name look up error")}else s.udts.push({name:a.name,lower:a.lower,index:a.index,empty:!0});s.opcodes.push({type:t.UDT,empty:!0,index:a.index})}return a},this.callbacks["udt-non-empty"]=function(n,r,i,o,s){const a=t.SEM_OK;if(n===t.SEM_POST){const n=e.utils.charsToString(r,i,o);let a=s.udtNames.add(n);if(-1===a){if(a=s.udtNames.get(n),-1===a)throw new Error("semUdtNonEmpty: name look up error")}else s.udts.push({name:a.name,lower:a.lower,index:a.index,empty:!1});s.opcodes.push({type:t.UDT,empty:!1,index:a.index,syntax:null,semantic:null})}return a},this.callbacks.xmax=function(e,n,r,i,o){const a=t.SEM_OK;return e===t.SEM_POST&&(o.max=s(n,r,i)),a},this.callbacks.xmin=function(e,n,r,i,o){const a=t.SEM_OK;return e===t.SEM_POST&&(o.min=s(n,r,i)),a},this.callbacks.xstring=function(e,n,r,i,o){const a=t.SEM_OK;return e===t.SEM_POST&&o.tbsstr.push(s(n,r,i)),a}}},2595:function(e){e.exports=function(e=[],t=[],n="index"){let r=[],i=[];const o=[],s=[],a=e,c=t,u=e.length,l=t.length;let d,f="RULE/UDT NAMES";if(!Array.isArray(e)||!e.length)throw new Error("show-rules.js:showRules: rules arg must be array with length > 0");if(!Array.isArray(t))throw new Error("show-rules.js:showRules: udts arg must be array");for(d=0;da[t].lower?1:0})),l){for(d=0;dc[t].lower?1:0}))}if(97===n.charCodeAt(0)){for(f+=" - alphabetical by rule/UDT name\n",d=0;d) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case r.MATCH:s.errors.push({line:s.findLine(s.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),i.prosValOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.prosvalopen=function(t,n,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:i.prosValOpen=o;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.prosvalstring=function(t,n,i,o){switch(t.state){case r.ACTIVE:o.stringTabChar=!1;break;case r.EMPTY:case r.NOMATCH:break;case r.MATCH:!1!==o.stringTabChar&&o.errors.push({line:o.findLine(o.lines,o.stringTabChar),char:o.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.repetition=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:case r.MATCH:o.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.rule=function(t,n,o,s){switch(t.state){case r.ACTIVE:s.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},s.altStack.push(i);break;case r.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case r.NOMATCH:break;case r.MATCH:s.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.ruleerror=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.rulenameerror=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.stringtab=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.stringTabChar=i;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.tlsclose=function(t,n,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:s.errors.push({line:s.findLine(s.lines,i.tlsOpen),char:i.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),i.basicError=!0,i.tlsOpen=null;break;case r.MATCH:i.tlsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.tlsopen=function(t,n,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:i.tlsOpen=o;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.tlsstring=function(t,n,i,o){switch(t.state){case r.ACTIVE:o.stringTabChar=!1;break;case r.EMPTY:case r.NOMATCH:break;case r.MATCH:!1!==o.stringTabChar&&o.errors.push({line:o.findLine(o.lines,o.stringTabChar),char:o.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.udtop=function(n,i,o,s){switch(n.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:if(s.strict){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`UDT operator found(${e}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.bkaop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Positive look-behind operator(&&) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Positive look-behind operator(&&) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.bknop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Negative look-behind operator(!!) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Negative look-behind operator(!!) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.bkrop=function(n,i,o,s){switch(n.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:if(s.strict){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`Back reference operator(${e}) found - strict ABNF specified.`})}else if(s.lite){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`Back reference operator(${e}) found - apg-lite specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.abgop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Beginning of string anchor(%^) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Beginning of string anchor(%^) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.aenop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"End of string anchor(%$) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"End of string anchor(%$) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}}},20979:function(e,t,n){const{Buffer:r}=n(48764),i=n(46322),o="UTF8",s="UTF16",a="UTF16BE",c="UTF16LE",u="UTF32",l="UTF32BE",d="UTF32LE",f="UINT7",p="ASCII",h="BINARY",m="UINT8",g="UINT16",y="UINT16LE",b="UINT16BE",v="UINT32",w="UINT32LE",x="UINT32BE",A="ESCAPED",E="STRING",_=function(e,t){const n=function(e){const t={type:"",base64:!1},n=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(e);return n&&(n[2]&&(t.type=n[2].toUpperCase()),n[1]&&(t.base64=!0)),t}(e.toUpperCase());if(n.base64){if(n.type===E)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type STRING`);if(r.isBuffer(t))n.data=i.base64.decode(t);else{if("string"!==typeof t)throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`);{const e=r.from(t,"ascii");n.data=i.base64.decode(e)}}}else n.data=t;switch(n.type){case o:!function(e){e.type=o;const t=e.data;e.bom=0,t.length>=3&&239===t[0]&&187===t[1]&&191===t[2]&&(e.bom=3)}(n);break;case s:case a:case c:!function(e){const t=e.data;switch(e.bom=0,e.type){case s:e.type=a,t.length>=2&&(254===t[0]&&255===t[1]?e.bom=2:255===t[0]&&254===t[1]&&(e.type=c,e.bom=2));break;case a:if(e.type=a,t.length>=2)if(254===t[0]&&255===t[1])e.bom=2;else if(255===t[0]&&254===t[1])throw new TypeError('src type: "UTF16BE" specified but BOM is for "UTF16LE"');break;case c:if(e.type=c,t.length>=0){if(254===t[0]&&255===t[1])throw new TypeError('src type: "UTF16LE" specified but BOM is for "UTF16BE"');255===t[0]&&254===t[1]&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}}(n);break;case u:case l:case d:!function(e){const t=e.data;switch(e.bom=0,e.type){case u:e.type=l,t.length>=4&&(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3]&&(e.bom=4),255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]&&(e.type=d,e.bom=4));break;case l:if(e.type=l,t.length>=4&&(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3]&&(e.bom=4),255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]))throw new TypeError('src type: UTF32BE specified but BOM is for UTF32LE"');break;case d:if(e.type=d,t.length>=4){if(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3])throw new TypeError('src type: "UTF32LE" specified but BOM is for "UTF32BE"');255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}}(n);break;case g:n.type=b;break;case v:n.type=x;break;case p:n.type=f;break;case h:n.type=m;break;case f:case m:case y:case b:case w:case x:case E:case A:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(n.type===E){if("string"!==typeof n.data)throw new TypeError(`type: "${e}" but data is not a string`)}else if(!r.isBuffer(n.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return n},k=function(e,t){switch(e){case o:return i.utf8.encode(t);case a:return i.utf16be.encode(t);case c:return i.utf16le.encode(t);case l:return i.utf32be.encode(t);case d:return i.utf32le.encode(t);case f:return i.uint7.encode(t);case m:return i.uint8.encode(t);case b:return i.uint16be.encode(t);case y:return i.uint16le.encode(t);case x:return i.uint32be.encode(t);case w:return i.uint32le.encode(t);case E:return i.string.encode(t);case A:return i.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}};t.decode=function(e,t){return function(e){switch(e.type){case o:return i.utf8.decode(e.data,e.bom);case c:return i.utf16le.decode(e.data,e.bom);case a:return i.utf16be.decode(e.data,e.bom);case l:return i.utf32be.decode(e.data,e.bom);case d:return i.utf32le.decode(e.data,e.bom);case f:return i.uint7.decode(e.data);case m:return i.uint8.decode(e.data);case b:return i.uint16be.decode(e.data);case y:return i.uint16le.decode(e.data);case x:return i.uint32be.decode(e.data);case w:return i.uint32le.decode(e.data);case E:return i.string.decode(e.data);case A:return i.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}}(_(e,t))},t.encode=function(e,t){let n,r;const _=function(e,t){if(!Array.isArray(t))throw new TypeError('dst chars: not array: "'+typeof t);if("string"!==typeof e)throw new TypeError('dst type: not string: "'+typeof e);const n=function(e){let t,n;const r={crlf:!1,lf:!1,base64:!1,type:""};for(;;){if(n=e,t=e.slice(0,5),"CRLF:"===t){r.crlf=!0,n=e.slice(5);break}if(t=e.slice(0,3),"LF:"===t){r.lf=!0,n=e.slice(3);break}break}return t=n.split(":"),1===t.length?r.type=t[0]:2===t.length&&"BASE64"===t[1]&&(r.base64=!0,r.type=t[0]),r}(e.toUpperCase());switch(n.type){case o:case a:case c:case l:case d:case f:case m:case y:case b:case w:case x:case A:break;case E:if(n.base64)throw new TypeError('":BASE64" suffix not allowed with type STRING');break;case p:n.type=f;break;case h:n.type=m;break;case s:n.type=a;break;case u:n.type=l;break;case g:n.type=b;break;case v:n.type=x;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return n}(e,t);return _.crlf?(n=i.lineEnds.crlf(t),r=k(_.type,n)):_.lf?(n=i.lineEnds.lf(t),r=k(_.type,n)):r=k(_.type,t),_.base64&&(r=i.base64.encode(r)),r};t.convert=function(e,n,r){return t.encode(r,t.decode(e,n))}},46322:function(e,t,n){const{Buffer:r}=n(48764),i=4294967292,o=4294967293,s=4294967294,a=4294967295,c=[0,1,3,7,15,31,63,127,255,511,1023],u=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),d=[];l.forEach((e=>{d.push(e.charCodeAt(0))})),t.utf8={encode(e){const t=[];return e.forEach((e=>{if(e>=0&&e<=127)t.push(e);else if(e<=2047)t.push(192+(e>>6&c[5])),t.push(128+(e&c[6]));else if(e<55296||e>57343&&e<=65535)t.push(224+(e>>12&c[4])),t.push(128+(e>>6&c[6])),t.push(128+(e&c[6]));else{if(!(e>=65536&&e<=1114111))throw new RangeError(`utf8.encode: character out of range: char: ${e}`);{const n=e>>16&c[5];t.push(240+(n>>2)),t.push(128+((n&c[2])<<4)+(e>>12&c[4])),t.push(128+(e>>6&c[6])),t.push(128+(e&c[6]))}}})),r.from(t)},decode(e,t){function n(e,t){if(128!==(192&t))return o;const n=((e&c[5])<<6)+(t&c[6]);return n<128?i:n}function r(e,t,n){if(128!==(192&n)||128!==(192&t))return o;const r=((e&c[4])<<12)+((t&c[6])<<6)+(n&c[6]);return r<2048?i:r>=55296&&r<=57343?s:r}function u(e,t,n,r){if(128!==(192&r)||128!==(192&n)||128!==(192&t))return o;const a=(((e&c[3])<<2)+(t>>4&c[2])<<16)+((t&c[4])<<12)+((n&c[6])<<6)+(r&c[6]);return a<65536?i:a>1114111?s:a}let l,d,f,p,h,m;const g=e.length;let y=t?3:0;const b=[];for(;y=0&&d<=127){l=d,m=1;break}if(f=y+1,f=194&&d<=223){l=n(d,e[f]),m=2;break}if(p=y+2,p=224&&d<=239){l=r(d,e[f],e[p]),m=3;break}if(h=y+3,h=240&&d<=244){l=u(d,e[f],e[p],e[h]),m=4;break}break}if(l>1114111){const e=`byte[${y}]`;if(l===a)throw new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${e}`);if(l===o)throw new RangeError(`utf8.decode: illegal trailing byte found at: ${e}`);if(l===s)throw new RangeError(`utf8.decode: code point out of range found at: ${e}`);if(l===i)throw new RangeError(`utf8.decode: non-shortest form found at: ${e}`);throw new RangeError(`utf8.decode: unrecognized error found at: ${e}`)}b.push(l),y+=m}return b}},t.utf16be={encode(e){const t=[];let n,i,o;for(let r=0;r=0&&n<=55295||n>=57344&&n<=65535)t.push(n>>8&c[8]),t.push(n&c[8]);else{if(!(n>=65536&&n<=1114111))throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${r}]: ${n}`);o=n-65536,i=55296+(o>>10),o=56320+(o&c[10]),t.push(i>>8&c[8]),t.push(i&c[8]),t.push(o>>8&c[8]),t.push(o&c[8])}return r.from(t)},decode(e,t){if(e.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${e.length}`);const n=[],r=e.length;let i,o,s,a,c,u,l=t?2:0,d=0;for(;l57343){i=c,o=2;break}if(a=l+3,a=56320&&u<=57343)){i=65536+(c-55296<<10)+(u-56320),o=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${l}]`)}n[d++]=i,l+=o}return n}},t.utf16le={encode(e){const t=[];let n,i,o;for(let r=0;r=0&&n<=55295||n>=57344&&n<=65535)t.push(n&c[8]),t.push(n>>8&c[8]);else{if(!(n>=65536&&n<=1114111))throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${r}]: ${n}`);o=n-65536,i=55296+(o>>10),o=56320+(o&c[10]),t.push(i&c[8]),t.push(i>>8&c[8]),t.push(o&c[8]),t.push(o>>8&c[8])}return r.from(t)},decode(e,t){if(e.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${e.length}`);const n=[],r=e.length;let i,o,s,a,c,u,l=t?2:0,d=0;for(;l57343){i=c,o=2;break}if(a=l+3,a=56320&&u<=57343)){i=65536+(c-55296<<10)+(u-56320),o=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${l}]`)}n[d++]=i,l+=o}return n}},t.utf32be={encode(e){const t=r.alloc(4*e.length);let n=0;return e.forEach((e=>{if(e>=55296&&e<=57343||e>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${n/4}]: ${e}`);t[n++]=e>>24&c[8],t[n++]=e>>16&c[8],t[n++]=e>>8&c[8],t[n++]=e&c[8]})),t},decode(e,t){if(e.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${e.length}`);const n=[];let r=t?4:0;for(;r=55296&&t<=57343||t>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${r/4}]: ${t}`);n.push(t)}return n}},t.utf32le={encode(e){const t=r.alloc(4*e.length);let n=0;return e.forEach((e=>{if(e>=55296&&e<=57343||e>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${e}`);t[n++]=e&c[8],t[n++]=e>>8&c[8],t[n++]=e>>16&c[8],t[n++]=e>>24&c[8]})),t},decode(e,t){if(e.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${e.length}`);const n=[];let r=t?4:0;for(;r=55296&&t<=57343||t>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${r/4}]: ${t}`);n.push(t)}return n}},t.uint7={encode(e){const t=r.alloc(e.length);for(let n=0;n127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${n}]: ${e[n]}`);t[n]=e[n]}return t},decode(e){const t=[];for(let n=0;n127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${n}]: ${e[n]}`);t[n]=e[n]}return t}},t.uint8={encode(e){const t=r.alloc(e.length);for(let n=0;n255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${n}]: ${e[n]}`);t[n]=e[n]}return t},decode(e){const t=[];for(let n=0;n{if(e>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${n/2}]: ${e}`);t[n++]=e>>8&c[8],t[n++]=e&c[8]})),t},decode(e){if(e.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${e.length}`);const t=[];for(let n=0;n{if(e>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${n/2}]: ${e}`);t[n++]=e&c[8],t[n++]=e>>8&c[8]})),t},decode(e){if(e.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${e.length}`);const t=[];for(let n=0;n{t[n++]=e>>24&c[8],t[n++]=e>>16&c[8],t[n++]=e>>8&c[8],t[n++]=e&c[8]})),t},decode(e){if(e.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${e.length}`);const t=[];for(let n=0;n{t[n++]=e&c[8],t[n++]=e>>8&c[8],t[n++]=e>>16&c[8],t[n++]=e>>24&c[8]})),t},decode(e){if(e.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${e.length}`);const t=[];for(let n=0;nt.utf16le.encode(e).toString("utf16le"),decode:e=>t.utf16le.decode(r.from(e,"utf16le"),0)},t.escaped={encode(e){const t=[];for(let n=0;n=32&&i<=126)t.push(i);else{let e="";if(i>=0&&i<=31)e+=`\`x${u[i]}`;else if(i>=127&&i<=255)e+=`\`x${u[i]}`;else if(i>=256&&i<=65535)e+=`\`u${u[i>>8&c[8]]}${u[i&c[8]]}`;else{if(!(i>=65536&&i<=4294967295))throw new Error("escape.encode(char): char > 0xffffffff not allowed");{e+="`u{";const t=i>>24&c[8];t>0&&(e+=u[t]),e+=`${u[i>>16&c[8]]+u[i>>8&c[8]]+u[i&c[8]]}}`}}r.from(e).forEach((e=>{t.push(e)}))}}return r.from(t)},decode(e){function t(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function n(e,n,r){const i={char:null,nexti:e+2,error:!0};if(e+1=s)break;if(96===e[a]){o.push(96),l+=2,u=!1;break}if(120===e[a]){if(c=n(a+1,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}if(117===e[a]){if(123===e[a+1]){if(c=i(a+2,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}if(c=r(a+1,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}break}if(u)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${l}]`)}return o}};const f=10;t.lineEnds={crlf(e){const t=[];let n=0;for(;n0&&t[t.length-1]!==f&&(t.push(13),t.push(f)),t},lf(e){const t=[];let n=0;for(;n0&&t[t.length-1]!==f&&t.push(f),t}},t.base64={encode(e){if(0===e.length)return r.alloc(0);let t,n,i,o=e.length%3;o=o>0?3-o:0;let s=(e.length+o)/3;const a=r.alloc(4*s);o>0&&(s-=1),t=0,n=0;for(let r=0;r>18&c[6]],a[n++]=d[i>>12&c[6]],a[n++]=d[i>>6&c[6]],a[n++]=d[i&c[6]];return 0===o?a:1===o?(i=e[t++]<<16,i+=e[t]<<8,a[n++]=d[i>>18&c[6]],a[n++]=d[i>>12&c[6]],a[n++]=d[i>>6&c[6]],a[n]=d[64],a):2===o?(i=e[t]<<16,a[n++]=d[i>>18&c[6]],a[n++]=d[i>>12&c[6]],a[n++]=d[64],a[n]=d[64],a):void 0},decode(e){if(0===e.length)return r.alloc(0);const t=function(e){const t=[];let n=0;for(let r=0;r=65&&i<=90){t.push(i-65);break}if(i>=97&&i<=122){t.push(i-71);break}if(i>=48&&i<=57){t.push(i+4);break}if(43===i){t.push(62);break}if(47===i){t.push(63);break}if(61===i){t.push(64),n+=1;break}throw new RangeError(`base64.decode: invalid character buf[${r}]: ${i}`)}}if(t.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${t.length}`);switch(n){case 0:break;case 1:if(64!==t[t.length-1])throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(64!==t[t.length-1]||64!==t[t.length-2])throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${n}`)}return{tail:n,buf:r.from(t)}}(e),{tail:n}=t,i=t.buf;let o,s,a,u=i.length/4;const l=r.alloc(3*u-n);n>0&&(u-=1),s=0,o=0;for(let r=0;r>16&c[8],l[s++]=a>>8&c[8],l[s++]=a&c[8];return 1===n&&(a=i[o++]<<18,a+=i[o++]<<12,a+=i[o]<<6,l[s++]=a>>16&c[8],l[s]=a>>8&c[8]),2===n&&(a=i[o++]<<18,a+=i[o++]<<12,l[s]=a>>16&c[8]),l},toString(e){if(e.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${e.length}`);let t="",n=0;function r(e,r,i,o){switch(n){case 76:t+=`\r\n${e}${r}${i}${o}`,n=4;break;case 75:t+=`${e}\r\n${r}${i}${o}`,n=3;break;case 74:t+=`${e+r}\r\n${i}${o}`,n=2;break;case 73:t+=`${e+r+i}\r\n${o}`,n=1;break;default:t+=e+r+i+o,n+=4}}for(let o=0;o=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||43===i||47===i||61===i))throw new RangeError(`base64.toString: buf[${t}]: ${e[t]} : not valid base64 character code`);r(String.fromCharCode(e[o]),String.fromCharCode(e[o+1]),String.fromCharCode(e[o+2]),String.fromCharCode(e[o+3]))}var i;return t}}},90580:function(e,t,n){e.exports=function(){const e=n(58276),t=n(8544),r=this;let i=null,o=null,s=null,a=0;const c=[],u=[],l=[],d=[];function f(e){let t="";for(let n=0;n0?d[e-1].stack:0},this.getLength=function(){return d.length},this.toXml=function(n){let r=t.charsToDec,i="decimal integer character codes";if("string"===typeof n&&n.length>=3){const e=n.slice(0,3).toLowerCase();"asc"===e?(r=t.charsToAscii,i="ASCII for printing characters, hex for non-printing"):"hex"===e?(r=t.charsToHex,i="hexadecimal integer character codes"):"uni"===e&&(r=t.charsToUnicode,i="Unicode UTF-32 integer character codes")}let o="",a=0;return o+='\n',o+=`\n`,o+=`\x3c!-- input string, ${i} --\x3e\n`,o+=f(a+2),o+=r(s),o+="\n",d.forEach((t=>{t.state===e.SEM_PRE?(a+=1,o+=f(a),o+=`\n`,o+=f(a+2),o+=r(s,t.phraseIndex,t.phraseLength),o+="\n"):(o+=f(a),o+=`\x3c!-- name="${t.name}" --\x3e\n`,a-=1)})),o+="\n",o},this.phrases=function(){const t={};let n,r;for(n=0;n 0");t=Math.ceil(n),e=-1},this.increment=function(){return e+=1,(e+t)%t},this.maxSize=function(){return t},this.items=function(){return e+1},this.getListIndex=function(n){return-1===e||n<0||n>e||e-n>=t?-1:(n+t)%t},this.forEach=function(n){if(-1!==e)if(e=g.length)throw new Error(`${o}rule index: ${t} out of range`);if(n>=a)throw new Error(`${o}phrase index: ${n} out of range`);const{length:s}=u;u.push({type:e.RNM,index:t}),i(s,n,r),u.pop()},E=function(t,n,r){const o="parser.js: evaluateUdt(): ";if(t>=y.length)throw new Error(`${o}udt index: ${t} out of range`);if(n>=a)throw new Error(`${o}phrase index: ${n} out of range`);const{length:s}=u;u.push({type:e.UDT,empty:y[t].empty,index:t}),i(s,n,r),u.pop()},_=function(){d=0,f=0,p=0,v=0,c=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],g=null,y=null,l=null,o=0,s=0,a=0,h=null,m=null,b=null,u=null},k=function(){const e=[];this.push=function(){e.push(function(){const t=e[e.length-1],n={};for(const e in t)n[e]=t[e];return n}())},this.pop=function(t){let n=t;if(n||(n=e.length-1),n<1||n>e.length)throw new Error(`parser.js: backRef.pop(): bad length: ${n}`);return e.length=n,e[e.length-1]},this.length=function(){return e.length},this.savePhrase=function(t,n,r){e[e.length-1][t]={phraseIndex:n,phraseLength:r}},this.getPhrase=function(t){return e[e.length-1][t]},function(){const t={};g.forEach((e=>{e.isBkr&&(t[e.lower]=null)})),y.length>0&&y.forEach((e=>{e.isBkr&&(t[e.lower]=null)})),e.push(t)}()},T=function(){const t=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=c[c.length-1],this.uFrame=new k,this.pFrame=new k,this.evaluateRule=A,this.evaluateUdt=E,this.refresh=function(){t.state=e.ACTIVE,t.phraseLength=0,t.lookAround=c[c.length-1]}},S=function(){return c[c.length-1]},C=function(){return c.length>1},I=function(e,n,r){const i="parser.js: initializeInputChars(): ";let c=e,u=n,d=r;if(void 0===c)throw new Error(`${i}input string is undefined`);if(null===c)throw new Error(`${i}input string is null`);if("string"===typeof c)c=t.stringToChars(c);else if(!Array.isArray(c))throw new Error(`${i}input string is not a string or array`);if(c.length>0&&"number"!==typeof c[0])throw new Error(`${i}input string not an array of integers`);if("number"!==typeof u)u=0;else if(u=Math.floor(u),u<0||u>c.length)throw new Error(`${i}input beginning index out of range: ${u}`);if("number"!==typeof d)d=c.length-u;else if(d=Math.floor(d),d<0||d>c.length-u)throw new Error(`${i}input length out of range: ${d}`);l=c,o=u,s=d,a=o+s};this.setMaxTreeDepth=function(e){if("number"!==typeof e)throw new Error(`parser: max tree depth must be integer > 0: ${e}`);if(w=Math.floor(e),w<=0)throw new Error(`parser: max tree depth must be integer > 0: ${e}`)},this.setMaxNodeHits=function(e){if("number"!==typeof e)throw new Error(`parser: max node hits must be integer > 0: ${e}`);if(x=Math.floor(e),x<=0)throw new Error(`parser: max node hits must be integer > 0: ${e}`)};const O=function(t,n,c){let d;!function(e){const t="parser.js: initializeGrammar(): ";if(!e)throw new Error(`${t}grammar object undefined`);if("grammarObject"!==e.grammarObject)throw new Error(`${t}bad grammar object`);g=e.rules,y=e.udts}(t);const w=function(e){const t="parser.js: initializeStartRule(): ";let n=null;if("number"===typeof e){if(e>=g.length)throw new Error(`${t}start rule index too large: max: ${g.length}: index: ${e}`);n=e}else{if("string"!==typeof e)throw new Error(`${t}type of start rule '${typeof e}' not recognized`);{const r=e.toLowerCase();for(let e=0;er){let e=`parser.js: opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${r}`,new Error(e)}switch(n.state){case e.ACTIVE:if(!0!==i)throw new Error(`parser.js: opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:n.phraseLength=0;break;case e.MATCH:0===n.phraseLength&&(n.state=e.EMPTY);break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`parser.js: opRNM(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}},P=function(t,n,o){let s,c,d,f,p,m;const y=u[t],v=g[y.index],w=h[v.index],x=!C();if(x&&(c=r.ast&&r.ast.ruleDefined(y.index),c&&(s=r.ast.getLength(),r.ast.down(y.index,g[y.index].name)),f=o.uFrame.length(),p=o.pFrame.length(),o.uFrame.push(),o.pFrame.push(),m=o.pFrame,o.pFrame=new k),null===w)d=u,u=v.opcodes,i(0,n,o),u=d;else{const t=a-n;o.ruleIndex=v.index,w(o,l,n,b),D(v,o,t,!0),o.state===e.ACTIVE&&(d=u,u=v.opcodes,i(0,n,o),u=d,o.ruleIndex=v.index,w(o,l,n,b),D(v,o,t,!1))}x&&(c&&(o.state===e.NOMATCH?r.ast.setLength(s):r.ast.up(y.index,v.name,n,o.phraseLength)),o.pFrame=m,o.state===e.NOMATCH?(o.uFrame.pop(f),o.pFrame.pop(p)):v.isBkr&&(o.pFrame.savePhrase(v.lower,n,o.phraseLength),o.uFrame.savePhrase(v.lower,n,o.phraseLength)))},B=function(t,n,i){let o,s,c,d,f,p;const h=u[t],v=y[h.index];i.UdtIndex=v.index;const w=!C();w&&(c=r.ast&&r.ast.udtDefined(h.index),c&&(s=g.length+h.index,o=r.ast.getLength(),r.ast.down(s,v.name)),d=i.uFrame.length(),f=i.pFrame.length(),i.uFrame.push(),i.pFrame.push(),p=i.pFrame,i.pFrame=new k);const x=a-n;m[h.index](i,l,n,b),function(t,n,r){if(n.phraseLength>r){let e=`parser.js: opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${r}`,new Error(e)}switch(n.state){case e.ACTIVE:throw new Error(`parser.js: opUDT(${t.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(!1===t.empty)throw new Error(`parser.js: opUDT(${t.name}): callback function return error. May not return EMPTY.`);n.phraseLength=0;break;case e.MATCH:if(0===n.phraseLength){if(!1===t.empty)throw new Error(`parser.js: opUDT(${t.name}): callback function return error. May not return EMPTY.`);n.state=e.EMPTY}break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`parser.js: opUDT(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}}(v,i,x),w&&(c&&(i.state===e.NOMATCH?r.ast.setLength(o):r.ast.up(s,v.name,n,i.phraseLength)),i.pFrame=p,i.state===e.NOMATCH?(i.uFrame.pop(d),i.pFrame.pop(f)):v.isBkr&&(i.pFrame.savePhrase(v.lower,n,i.phraseLength),i.uFrame.savePhrase(v.lower,n,i.phraseLength)))},M=function(t,n,r){c.push({lookAround:e.LOOKAROUND_AHEAD,anchor:n,charsEnd:a,charsLength:s}),a=l.length,s=l.length-o,i(t+1,n,r);const u=c.pop();switch(a=u.charsEnd,s=u.charsLength,r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.EMPTY;break;case e.NOMATCH:r.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${r.state}`)}},N=function(t,n,r){c.push({lookAround:e.LOOKAROUND_AHEAD,anchor:n,charsEnd:a,charsLength:s}),a=l.length,s=l.length-o,i(t+1,n,r);const u=c.pop();switch(a=u.charsEnd,s=u.charsLength,r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.NOMATCH;break;case e.NOMATCH:r.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${r.state}`)}},F=function(t,n,r){r.state=e.NOMATCH,r.phraseLength=0,r.state=0===n?e.EMPTY:e.NOMATCH},L=function(t,n,r){r.state=e.NOMATCH,r.phraseLength=0,r.state=n===l.length?e.EMPTY:e.NOMATCH},j=function(t,n,r){switch(c.push({lookAround:e.LOOKAROUND_BEHIND,anchor:n}),i(t+1,n,r),c.pop(),r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.EMPTY;break;case e.NOMATCH:r.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${r.state}`)}},U=function(t,n,r){switch(c.push({lookAround:e.LOOKAROUND_BEHIND,anchor:n}),i(t+1,n,r),c.pop(),r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.NOMATCH;break;case e.NOMATCH:r.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${r.state}`)}};i=function(t,n,o){let s=!0;const h=u[t];if(p+=1,p>x)throw new Error(`parser: maximum number of node hits exceeded: ${x}`);if(d+=1,d>f&&(f=d,f>w))throw new Error(`parser: maximum parse tree depth exceeded: ${w}`);if(o.refresh(),null!==r.trace){const e=S();r.trace.down(h,o.state,n,o.phraseLength,e.anchor,e.lookAround)}if(c[c.length-1].lookAround===e.LOOKAROUND_BEHIND)switch(h.type){case e.ALT:R(t,n,o);break;case e.CAT:!function(t,n,o){let s,a,c,l;const d=u[t],f=o.uFrame.length(),p=o.pFrame.length();r.ast&&(a=r.ast.getLength()),s=!0,c=n,l=0;for(let r=d.children.length-1;r>=0;r-=1)if(i(d.children[r],c,o),c-=o.phraseLength,l+=o.phraseLength,o.state===e.NOMATCH){s=!1;break}s?(o.state=0===l?e.EMPTY:e.MATCH,o.phraseLength=l):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(f),o.pFrame.pop(p),r.ast&&r.ast.setLength(a))}(t,n,o);break;case e.REP:!function(t,n,o){let s,a,c,l;const d=u[t];a=n,c=0,l=0;const f=o.uFrame.length(),p=o.pFrame.length();for(r.ast&&(s=r.ast.getLength());!(a<=0)&&(i(t+1,a,o),o.state!==e.NOMATCH)&&o.state!==e.EMPTY&&(l+=1,c+=o.phraseLength,a-=o.phraseLength,l!==d.max););o.state===e.EMPTY||l>=d.min?(o.state=0===c?e.EMPTY:e.MATCH,o.phraseLength=c):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(f),o.pFrame.pop(p),r.ast&&r.ast.setLength(s))}(t,n,o);break;case e.RNM:P(t,n,o);break;case e.UDT:B(t,n,o);break;case e.AND:M(t,n,o);break;case e.NOT:N(t,n,o);break;case e.TRG:!function(t,n,r){const i=u[t];if(r.state=e.NOMATCH,r.phraseLength=0,n>0){const t=l[n-1];i.min<=t&&t<=i.max&&(r.state=e.MATCH,r.phraseLength=1)}}(t,n,o);break;case e.TBS:!function(t,n,r){let i;const o=u[t];r.state=e.NOMATCH;const s=o.string.length,a=n-s;if(a>=0){for(i=0;i=0){for(let e=0;e=65&&i<=90&&(i+=32),i!==o.string[e])return;r.state=e.MATCH,r.phraseLength=s}}(t,n,o);break;case e.BKR:!function(t,n,r){let i,o,s,a;const c=u[t];r.state=e.NOMATCH,r.phraseLength=0,a=c.index=0){if(f){for(i=0;i=65&&o<=90&&(o+=32),s>=65&&s<=90&&(s+=32),o!==s)return;r.state=e.MATCH,r.phraseLength=h}else for(i=0;i=a)&&(i(t+1,c,o),o.state!==e.NOMATCH)&&o.state!==e.EMPTY&&(d+=1,l+=o.phraseLength,c+=o.phraseLength,d!==f.max););o.state===e.EMPTY||d>=f.min?(o.state=0===l?e.EMPTY:e.MATCH,o.phraseLength=l):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(p),o.pFrame.pop(h),r.ast&&r.ast.setLength(s))}(t,n,o);break;case e.RNM:P(t,n,o);break;case e.UDT:B(t,n,o);break;case e.AND:M(t,n,o);break;case e.NOT:N(t,n,o);break;case e.TRG:!function(t,n,r){const i=u[t];r.state=e.NOMATCH,n=65&&o<=90&&(o+=32),o!==s.string[i])return;r.state=e.MATCH,r.phraseLength=c}}else r.state=e.EMPTY}(t,n,o);break;case e.BKR:!function(t,n,r){let i,o,s,c;const d=u[t];r.state=e.NOMATCH,c=d.index=65&&o<=90&&(o+=32),s>=65&&s<=90&&(s+=32),o!==s)return;r.state=e.MATCH,r.phraseLength=m}else for(i=0;iv&&(v=n+o.phraseLength),null!==r.stats&&r.stats.collect(h,o),null!==r.trace){const e=S();r.trace.up(h,o.state,n,o.phraseLength,e.anchor,e.lookAround)}return d-=1,s}}},35403:function(e,t,n){e.exports=function(){const e=n(58276),t=n(8544),r=n(93932);let i=[],o=[];const s=[];let a;const c=[],u=[];this.statsObject="statsObject";const l=function(e,t){return e.lowert.lower?1:0},d=function(e,t){return e.totalt.total?-1:l(e,t)},f=function(e,t){return e.indext.index?1:0},p=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},h=function(t,n){switch(t.total+=1,n){case e.EMPTY:t.empty+=1;break;case e.MATCH:t.match+=1;break;case e.NOMATCH:t.nomatch+=1;break;default:throw new Error(`stats.js: collect(): incStat(): unrecognized state: ${n}`)}},m=function(e,t){let n="";return n+="",n+=`${e}`,n+=`${t.empty}`,n+=`${t.match}`,n+=`${t.nomatch}`,n+=`${t.total}`,n+="\n",n},g=function(){let t="";return t+=m("ALT",s[e.ALT]),t+=m("CAT",s[e.CAT]),t+=m("REP",s[e.REP]),t+=m("RNM",s[e.RNM]),t+=m("TRG",s[e.TRG]),t+=m("TBS",s[e.TBS]),t+=m("TLS",s[e.TLS]),t+=m("UDT",s[e.UDT]),t+=m("AND",s[e.AND]),t+=m("NOT",s[e.NOT]),t+=m("BKR",s[e.BKR]),t+=m("BKA",s[e.BKA]),t+=m("BKN",s[e.BKN]),t+=m("ABG",s[e.ABG]),t+=m("AEN",s[e.AEN]),t+=m("totals",a),t},y=function(){let e="";e+="\n",e+="rules\n";for(let t=0;t0&&(e+="",e+=`${c[t].name}`,e+=`${c[t].empty}`,e+=`${c[t].match}`,e+=`${c[t].nomatch}`,e+=`${c[t].total}`,e+="\n");if(o.length>0){e+="\n",e+="udts\n";for(let t=0;t0&&(e+="",e+=`${u[t].name}`,e+=`${u[t].empty}`,e+=`${u[t].match}`,e+=`${u[t].nomatch}`,e+=`${u[t].total}`,e+="\n")}return e};this.validate=function(e){let t=!1;return"string"===typeof e&&"stats"===e&&(t=!0),t},this.init=function(t,n){i=t,o=n,function(){s.length=0,a=new p,s[e.ALT]=new p,s[e.CAT]=new p,s[e.REP]=new p,s[e.RNM]=new p,s[e.TRG]=new p,s[e.TBS]=new p,s[e.TLS]=new p,s[e.UDT]=new p,s[e.AND]=new p,s[e.NOT]=new p,s[e.BKR]=new p,s[e.BKA]=new p,s[e.BKN]=new p,s[e.ABG]=new p,s[e.AEN]=new p,c.length=0;for(let e=0;e0){u.length=0;for(let e=0;e\n`,"string"===typeof t&&(n+=`${t}\n`),n+=`ops\n`,n+=`EMPTY\n`,n+=`MATCH\n`,n+=`NOMATCH\n`,n+=`totals\n`;for(;;){if(void 0===e){n+=g();break}if(null===e){n+=g();break}if("ops"===e){n+=g();break}if("index"===e){c.sort(f),u.length>0&&u.sort(f),n+=g(),n+=y();break}if("hits"===e){c.sort(d),u.length>0&&u.sort(f),n+=g(),n+=y();break}if("alpha"===e){c.sort(l),u.length>0&&u.sort(l),n+=g(),n+=y();break}break}return n+="\n",n},this.toHtmlPage=function(e,n,r){return t.htmlToPage(this.toHtml(e,n),r)}}},93932:function(e){e.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}},99290:function(e,t,n){e.exports=function(){const e=n(8544),t=n(93932),r=new(n(42761)),i=n(58276),o=this,s=16,a=80,c=[];let u=5e3,l=-1,d=0,f=0;const p=[];let h=null,m=null,g=null;const y=[],b=[],v=``,w=``,x=`𝜺`;this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(e,t){l=-1,"number"===typeof e&&e>0?(u=Math.ceil(e),"number"===typeof t&&(l=Math.floor(t),l<0&&(l=-1))):u=0},this.getMaxRecords=function(){return u},this.getLastRecord=function(){return l},this.init=function(e,t,n){c.length=0,p.length=0,d=0,f=0,h=n,m=e,g=t,function(){const e=function(e){y[i.ALT]=e,y[i.CAT]=e,y[i.REP]=e,y[i.TLS]=e,y[i.TBS]=e,y[i.TRG]=e,y[i.AND]=e,y[i.NOT]=e,y[i.BKR]=e,y[i.BKA]=e,y[i.BKN]=e,y[i.ABG]=e,y[i.AEN]=e};let t=0;for(const n in o.filter.operators)t+=1;if(0!==t){for(const t in o.filter.operators){const n=t.toUpperCase();if(""===n)return void e(!0);if(""===n)return void e(!1)}e(!1);for(const e in o.filter.operators){const t=e.toUpperCase();if("ALT"===t)y[i.ALT]=!0===o.filter.operators[e];else if("CAT"===t)y[i.CAT]=!0===o.filter.operators[e];else if("REP"===t)y[i.REP]=!0===o.filter.operators[e];else if("AND"===t)y[i.AND]=!0===o.filter.operators[e];else if("NOT"===t)y[i.NOT]=!0===o.filter.operators[e];else if("TLS"===t)y[i.TLS]=!0===o.filter.operators[e];else if("TBS"===t)y[i.TBS]=!0===o.filter.operators[e];else if("TRG"===t)y[i.TRG]=!0===o.filter.operators[e];else if("BKR"===t)y[i.BKR]=!0===o.filter.operators[e];else if("BKA"===t)y[i.BKA]=!0===o.filter.operators[e];else if("BKN"===t)y[i.BKN]=!0===o.filter.operators[e];else if("ABG"===t)y[i.ABG]=!0===o.filter.operators[e];else{if("AEN"!==t)throw new Error(`trace.js: initOpratorFilter: '${e}' not a valid operator name. Must be , , alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`);y[i.AEN]=!0===o.filter.operators[e]}}}else e(!1)}(),function(){const e=function(e){y[i.RNM]=e,y[i.UDT]=e;const t=m.length+g.length;b.length=0;for(let n=0;n"===n)return void e(!0);if(""===n)return void e(!1)}e(!1),y[i.RNM]=!0,y[i.UDT]=!0;for(const e in o.filter.rules){const t=e.toLowerCase();if(n=r.indexOf(t),n<0)throw new Error(`trace.js: initRuleFilter: '${e}' not a valid rule or udt name`);b[n]=!0===o.filter.rules[e]}}else e(!0)}(),r.init(u)};const A=function(e){let t=!1;return t=e.type===i.RNM?!(!y[e.type]||!b[e.index]):e.type===i.UDT?!(!y[e.type]||!b[m.length+e.index]):y[e.type],t},E=function(e){return-1===l||e<=l};this.down=function(e,t,n,i,o,s){E(d)&&A(e)&&(p.push(d),c[r.increment()]={dirUp:!1,depth:f,thisLine:d,thatLine:void 0,opcode:e,state:t,phraseIndex:n,phraseLength:i,lookAnchor:o,lookAround:s},d+=1,f+=1)},this.up=function(e,t,n,i,o,s){if(E(d)&&A(e)){const a=d,u=p.pop(),l=r.getListIndex(u);-1!==l&&(c[l].thatLine=a),f-=1,c[r.increment()]={dirUp:!0,depth:f,thisLine:a,thatLine:u,opcode:e,state:t,phraseIndex:n,phraseLength:i,lookAnchor:o,lookAround:s},d+=1}};this.toTree=function(t){const n=function(){function t(t,n){let r,o,s;if(n)switch(t.op={id:n.type,name:e.opcodeToString(n.type)},t.opData=void 0,n.type){case i.RNM:t.opData=m[n.index].name;break;case i.UDT:t.opData=g[n.index].name;break;case i.BKR:r=n.index{if(w=c[e],x&&(x=!1,w.depth>0)){const e=w.dirUp?w.depth+1:w.depth;for(let t=0;t1;)b=p.pop(),a(b,null);if(0===A.children.length)throw new Error("trace.toTree(): parse tree has no nodes");if(0===p.length)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");y=A.children[0];let E=y;for(;y&&!y.down&&!y.up;)E=y,y=y.children[0];y=E,y.leftMost=!0,y.rightMost=!0,function e(t){if(l+=1,t.branch=d,l>f&&(f=l),0===t.children.length)u+=1;else for(let n=0;n0&&(d+=1),t.children[n].leftMost=!1,t.children[n].rightMost=!1,t.leftMost&&(t.children[n].leftMost=0===n),t.rightMost&&(t.children[n].rightMost=n===t.children.length-1),e(t.children[n]);l-=1}(y),y.branch=0;const _={string:[]};for(let e=0;e`,g="";let y=!1;switch(r){case i.EMPTY:p+=x;case i.NOMATCH:case i.ACTIVE:u=o,l=0,d=o,f=n.length-d;break;case i.MATCH:u=o,l=s,d=o+l,f=n.length-d;break;default:throw new Error("unrecognized state")}return h=v,l>a?(l=a,h=w,f=0):l+f>a&&(h=w,f=a-l),l>0&&(p+=c,p+=_(e,n,u,l,y),p+=g,y=!0),f>0&&(p+=m,p+=_(e,n,d,f,y),p+=g),p+h},T=function(n){if(null===m)return"";let u,l,d,f,p,y,b="";return b+="(a)(b)(c)(d)(e)(f)",b+="operatorphrase\n",r.forEach((r=>{const A=c[r];switch(u=A.thisLine,l=void 0!==A.thatLine?A.thatLine:"--",d=!1,f=!1,p=!1,A.lookAround===i.LOOKAROUND_AHEAD&&(d=!0,p=!0,y=A.lookAnchor),A.opcode.type!==i.AND&&A.opcode.type!==i.NOT||(d=!0,p=!0,y=A.phraseIndex),A.lookAround===i.LOOKAROUND_BEHIND&&(f=!0,p=!0,y=A.lookAnchor),A.opcode.type!==i.BKA&&A.opcode.type!==i.BKN||(f=!0,p=!0,y=A.phraseIndex),b+="",b+=`${u}${l}`,b+=`${A.phraseIndex}`,b+=`${A.phraseLength}`,b+=`${A.depth}`,b+="",A.state){case i.ACTIVE:b+=`↓ `;break;case i.MATCH:b+=`↑M`;break;case i.NOMATCH:b+=`↑N`;break;case i.EMPTY:b+=`↑E`;break;default:b+=`--`}if(b+="",b+="",b+=o.indent(A.depth),d?b+=``:f&&(b+=``),b+=e.opcodeToString(A.opcode.type),A.opcode.type===i.RNM&&(b+=`(${m[A.opcode.index].name}) `),A.opcode.type===i.BKR){const e=A.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",t=A.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";b+=`(\\${e}${t}${m[A.opcode.index].name}) `}A.opcode.type===i.UDT&&(b+=`(${g[A.opcode.index].name}) `),A.opcode.type===i.TRG&&(b+=`(${function(e,t){let n="";if(t.type===i.TRG)if(e===s||32===e){let r=t.min.toString(16).toUpperCase();r.length%2!==0&&(r=`0${r}`),n+=e===s?"%x":"U+",n+=r,r=t.max.toString(16).toUpperCase(),r.length%2!==0&&(r=`0${r}`),n+=`–${r}`}else n=`%d${t.min.toString(10)}–${t.max.toString(10)}`;return n}(n,A.opcode)}) `),A.opcode.type===i.TBS&&(b+=`(${function(e,t){let n="";if(t.type===i.TBS){const r=Math.min(t.string.length,10);if(e===s||32===e){n+=e===s?"%x":"U+";for(let e=0;e0&&(n+="."),r=t.string[e].toString(16).toUpperCase(),r.length%2!==0&&(r=`0${r}`),n+=r}}else{n="%d";for(let e=0;e0&&(n+="."),n+=t.string[e].toString(10)}r0&&(r+="."),o=n.string[t],o>=97&&o<=122?(e=o-32,r+=`${e.toString(a)}/${o.toString(a)}`.toUpperCase()):o>=65&&o<=90?(e=o,o+=32,r+=`${e.toString(a)}/${o.toString(a)}`.toUpperCase()):r+=o.toString(a).toUpperCase();i`,g=``,y="";let b=!1;switch(r){case i.EMPTY:p+=x;case i.NOMATCH:case i.MATCH:case i.ACTIVE:u=o-s,l=c-u,d=c,f=n.length-d;break;default:throw new Error("unrecognized state")}return h=v,l>a?(l=a,h=w,f=0):l+f>a&&(h=w,f=a-l),l>0&&(p+=m,p+=_(e,n,u,l,b),p+=y,b=!0),f>0&&(p+=g,p+=_(e,n,d,f,b),p+=y),p+h}(n,h,A.state,A.phraseIndex,A.phraseLength,y):d?function(e,n,r,i,o){const s=``;return k(e,n,r,i,o,s)}(n,h,A.state,A.phraseIndex,A.phraseLength):function(e,n,r,i,o){const s=``;return k(e,n,r,i,o,s)}(n,h,A.state,A.phraseIndex,A.phraseLength),b+="\n"})),b+="(a)(b)(c)(d)(e)(f)",b+="operatorphrase\n",b+="\n",b};this.toHtml=function(e,n){let r=8;if("string"===typeof e&&e.length>=3){const t=e.toLowerCase().slice(0,3);"hex"===t?r=s:"dec"===t?r=10:"uni"===t&&(r=32)}let i="";return i+=function(e,n){let r;switch(e){case s:r="hexadecimal";break;case 10:r="decimal";break;case 8:r="ASCII";break;case 32:r="UNICODE";break;default:throw new Error(`trace.js: htmlHeader: unrecognized mode: ${e}`)}let i="";return i+=`

display mode: ${r}

\n`,i+=`\n`,"string"===typeof n&&(i+=``),i}(r,n),i+=T(r),i+=function(){let e="";return e+="
${n}
\n",e+=`

legend:
\n`,e+="(a) - line number
\n",e+="(b) - matching line number
\n",e+="(c) - phrase offset
\n",e+="(d) - phrase length
\n",e+="(e) - tree depth
\n",e+="(f) - operator state
\n",e+=`    -   phrase opened
\n`,e+=`    - ↑M phrase matched
\n`,e+=`    - ↑E empty phrase matched
\n`,e+=`    - ↑N phrase not matched
\n`,e+="operator - ALT, CAT, REP, RNM, TRG, TLS, TBS, UDT, AND, NOT, BKA, BKN, BKR, ABG, AEN
\n",e+="phrase   - up to 80 characters of the phrase being matched
\n",e+=`         - matched characters
\n`,e+=`         - matched characters in look ahead mode
\n`,e+=`         - matched characters in look behind mode
\n`,e+=`         - remainder characters(not yet examined by parser)
\n`,e+=`         - control characters, TAB, LF, CR, etc. (ASCII mode only)
\n`,e+=`         - ${x} empty string
\n`,e+=`         - ${v} end of input string
\n`,e+=`         - ${w} input string display truncated
\n`,e+="

\n",e+=`

\n`,e+="original ABNF operators:
\n",e+="ALT - alternation
\n",e+="CAT - concatenation
\n",e+="REP - repetition
\n",e+="RNM - rule name
\n",e+="TRG - terminal range
\n",e+="TLS - terminal literal string (case insensitive)
\n",e+="TBS - terminal binary string (case sensitive)
\n",e+="
\n",e+="super set SABNF operators:
\n",e+="UDT - user-defined terminal
\n",e+="AND - positive look ahead
\n",e+="NOT - negative look ahead
\n",e+="BKA - positive look behind
\n",e+="BKN - negative look behind
\n",e+="BKR - back reference
\n",e+="ABG - anchor - begin of input string
\n",e+="AEN - anchor - end of input string
\n",e+="

\n",e}(),i}}},8544:function(e,t,n){const r=n(93932),i=n(20979),o=n(91593),s=n(58276),a=function(e,t,n){let r,i=t;for(;;){if(e<=0){i=0,r=0;break}if("number"!==typeof i){i=0,r=e;break}if(i>=e){i=e,r=e;break}if("number"!==typeof n){r=e;break}if(r=i+n,r>e){r=e;break}break}return{beg:i,end:r}};t.htmlToPage=function(e,t){let n;if("string"!==typeof e)throw new Error("utilities.js: htmlToPage: input HTML is not a string");n="string"!==typeof t?"htmlToPage":t;let r="";return r+="\n",r+='\n',r+="\n",r+='\n',r+=`${n}\n`,r+="\n",r+="\n\n",r+=`

${new Date}

\n`,r+=e,r+="\n\n",r},t.parserResultToHtml=function(e,t){let n,i,o=null;"string"===typeof t&&""!==t&&(o=t),n=!0===e.success?`true`:`false`,i=e.state===s.EMPTY?`EMPTY`:e.state===s.MATCH?`MATCH`:e.state===s.NOMATCH?`NOMATCH`:`unrecognized`;let a="";return a+=`\n`,o&&(a+=`\n`),a+="\n",a+=`\n`,a+=`\n",a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+="
${o}
state itemvaluedescription
parser success${n}true if the parse succeeded,\n`,a+=` false otherwise`,a+="
NOTE: for success, entire string must be matched
parser state${i}EMPTY, `,a+=`MATCH or \n`,a+=`NOMATCH
string length${e.length}length of the input (sub)string
matched length${e.matched}number of input string characters matched
max matched${e.maxMatched}maximum number of input string characters matched
max tree depth${e.maxTreeDepth}maximum depth of the parse tree reached
node hits${e.nodeHits}number of parse tree node hits (opcode function calls)
input length${e.inputLength}length of full input string
sub-string begin${e.subBegin}sub-string first character index
sub-string end${e.subEnd}sub-string end-of-string index
sub-string length${e.subLength}sub-string length
\n",a},t.charsToString=function(e,t,n){let r,o;if("number"===typeof t){if(t>=e.length)return"";r=t<0?0:t}else r=0;if("number"===typeof n){if(n<=0)return"";o=n>e.length-r?e.length:r+n}else o=e.length;return ri.beg){r+=e[i.beg];for(let t=i.beg+1;to.beg){i+=`\\x${t.charToHex(e[o.beg])}`;for(let n=o.beg+1;ni.beg)for(let o=i.beg;oo.beg)for(let a=o.beg;a=55296&&s<=57343||s>1114111?` U+${t.charToHex(e[a])}`:`&#${e[a]};`;var s;return i},t.charsToJsUnicode=function(e,n,r){let i="";if(!Array.isArray(e))throw new Error("utilities.js: charsToJsUnicode: input must be an array of integers");const o=a(e.length,n,r);if(o.end>o.beg){i+=`\\u${t.charToHex(e[o.beg])}`;for(let n=o.beg+1;n=32&&n<=126?String.fromCharCode(n):`\\x${t.charToHex(n)}`}return i},t.charsToAsciiHtml=function(e,n,i){if(!Array.isArray(e))throw new Error("utilities.js: charsToAsciiHtml: input must be an array of integers");let o,s="";const c=a(e.length,n,i);for(let a=c.beg;a${t.asciiChars[o]}
`:o>127?`U+${t.charToHex(o)}`:t.asciiChars[o];return s},t.stringToAsciiHtml=function(e){const t=i.decode("STRING",e);return this.charsToAsciiHtml(t)}},9669:function(e,t,n){e.exports=n(51609)},55448:function(e,t,n){"use strict";var r=n(64867),i=n(36026),o=n(4372),s=n(15327),a=n(94097),c=n(84109),u=n(67985),l=n(77874),d=n(82648),f=n(60644),p=n(90205);e.exports=function(e){return new Promise((function(t,n){var h,m=e.data,g=e.headers,y=e.responseType;function b(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}r.isFormData(m)&&r.isStandardBrowserEnv()&&delete g["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",x=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";g.Authorization="Basic "+btoa(w+":"+x)}var A=a(e.baseURL,e.url);function E(){if(v){var r="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,o={data:y&&"text"!==y&&"json"!==y?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:r,config:e,request:v};i((function(e){t(e),b()}),(function(e){n(e),b()}),o),v=null}}if(v.open(e.method.toUpperCase(),s(A,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=E:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(E)},v.onabort=function(){v&&(n(new d("Request aborted",d.ECONNABORTED,e,v)),v=null)},v.onerror=function(){n(new d("Network Error",d.ERR_NETWORK,e,v,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||l;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new d(t,r.clarifyTimeoutError?d.ETIMEDOUT:d.ECONNABORTED,e,v)),v=null},r.isStandardBrowserEnv()){var _=(e.withCredentials||u(A))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;_&&(g[e.xsrfHeaderName]=_)}"setRequestHeader"in v&&r.forEach(g,(function(e,t){"undefined"===typeof m&&"content-type"===t.toLowerCase()?delete g[t]:v.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),y&&"json"!==y&&(v.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){v&&(n(!e||e&&e.type?new f:e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),m||(m=null);var k=p(A);k&&-1===["http","https","file"].indexOf(k)?n(new d("Unsupported protocol "+k+":",d.ERR_BAD_REQUEST,e)):v.send(m)}))}},51609:function(e,t,n){"use strict";var r=n(64867),i=n(91849),o=n(30321),s=n(47185);var a=function e(t){var n=new o(t),a=i(o.prototype.request,n);return r.extend(a,o.prototype,n),r.extend(a,n),a.create=function(n){return e(s(t,n))},a}(n(45546));a.Axios=o,a.CanceledError=n(60644),a.CancelToken=n(14972),a.isCancel=n(26502),a.VERSION=n(97288).version,a.toFormData=n(47675),a.AxiosError=n(82648),a.Cancel=a.CanceledError,a.all=function(e){return Promise.all(e)},a.spread=n(8713),a.isAxiosError=n(16268),e.exports=a,e.exports.default=a},14972:function(e,t,n){"use strict";var r=n(60644);function i(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(e){d.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){d.headers[e]=i.merge(u)})),e.exports=d},77874:function(e){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},97288:function(e){e.exports={version:"0.27.2"}},91849:function(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},90205:function(e){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},8713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},47675:function(e,t,n){"use strict";var r=n(48764).Buffer,i=n(64867);e.exports=function(e,t){t=t||new FormData;var n=[];function o(e){return null===e?"":i.isDate(e)?e.toISOString():i.isArrayBuffer(e)||i.isTypedArray(e)?"function"===typeof Blob?new Blob([e]):r.from(e):e}return function e(r,s){if(i.isPlainObject(r)||i.isArray(r)){if(-1!==n.indexOf(r))throw Error("Circular reference detected in "+s);n.push(r),i.forEach(r,(function(n,r){if(!i.isUndefined(n)){var a,c=s?s+"."+r:r;if(n&&!s&&"object"===typeof n)if(i.endsWith(r,"{}"))n=JSON.stringify(n);else if(i.endsWith(r,"[]")&&(a=i.toArray(n)))return void a.forEach((function(e){!i.isUndefined(e)&&t.append(c,o(e))}));e(n,c)}})),n.pop()}else t.append(s,o(r))}(e),t}},54875:function(e,t,n){"use strict";var r=n(97288).version,i=n(82648),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var s={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new i(o(r," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!s[r]&&(s[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!==typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var s=r[o],a=t[s];if(a){var c=e[s],u=void 0===c||a(c,s,e);if(!0!==u)throw new i("option "+s+" must be "+u,i.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new i("Unknown option "+s,i.ERR_BAD_OPTION)}},validators:o}},64867:function(e,t,n){"use strict";var r,i=n(91849),o=Object.prototype.toString,s=(r=Object.create(null),function(e){var t=o.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function a(e){return e=e.toLowerCase(),function(t){return s(t)===e}}function c(e){return Array.isArray(e)}function u(e){return"undefined"===typeof e}var l=a("ArrayBuffer");function d(e){return null!==e&&"object"===typeof e}function f(e){if("object"!==s(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var p=a("Date"),h=a("File"),m=a("Blob"),g=a("FileList");function y(e){return"[object Function]"===o.call(e)}var b=a("URLSearchParams");function v(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),c(e))for(var n=0,r=e.length;n0;)s[o=r[i]]||(t[o]=e[o],s[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;var t=e.length;if(u(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:x,isFileList:g}},58162:function(e,t,n){"use strict";var r=n(89509).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,l=new Uint8Array(s);e[n];){var d=t[e.charCodeAt(n)];if(255===d)return;for(var f=0,p=s-1;(0!==d||f>>0,l[p]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error("Non-zero carry");o=f,n++}for(var h=s-o;h!==s&&0===l[h];)h++;var m=r.allocUnsafe(i+(s-h));m.fill(0,0,i);for(var g=i;h!==s;)m[g++]=l[h++];return m}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=r.from(t)),!r.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var n=0,i=0,o=0,s=t.length;o!==s&&0===t[o];)o++,n++;for(var u=(s-o)*l+1>>>0,d=new Uint8Array(u);o!==s;){for(var f=t[o],p=0,h=u-1;(0!==f||p>>0,d[h]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");i=p,o++}for(var m=u-i;m!==u&&0===d[m];)m++;for(var g=c.repeat(n);m0?s-4:s;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===a&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===a&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,c=r-i;ac?c:a+s));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],r=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,o,s=[],a=t;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},92882:function(e){"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={},r=0;r>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=o(t)^r>>5}for(t=o(t),n=0;nt)return"Exceeds length limit";var r=e.toLowerCase(),i=e.toUpperCase();if(e!==r&&e!==i)return"Mixed-case string "+e;var a=(e=r).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var c=e.slice(0,a),u=e.slice(a+1);if(u.length<6)return"Data too short";var l=s(c);if("string"===typeof l)return l;for(var d=[],f=0;f=u.length||d.push(h)}return 1!==l?"Invalid checksum for "+e:{prefix:c,words:d}}function c(e,t,n,r){for(var i=0,o=0,s=(1<=n;)o-=n,a.push(i>>o&s);if(r)o>0&&a.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var i=s(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var a=e+"1",c=0;c>5!==0)throw new Error("Non 5-bit word");i=o(i)^u,a+=t.charAt(u)}for(c=0;c<6;++c)i=o(i);for(i^=1,c=0;c<6;++c){a+=t.charAt(i>>5*(5-c)&31)}return a},toWordsUnsafe:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},40475:function(e,t,n){"use strict";var r=n(48764).Buffer;t.oU=function(e){{const t=r.from(e);t.reverse();const n=t.toString("hex");return 0===n.length?BigInt(0):BigInt(`0x${n}`)}},t.k$=function(e,t){{const n=e.toString(16),i=r.from(n.padStart(2*t,"0").slice(0,2*t),"hex");return i.reverse(),i}}},13550:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(46601).Buffer}catch(k){}function a(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function c(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,n,r){for(var i=0,o=Math.min(e.length,n),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,s=o%r,a=Math.min(o,o-s)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[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],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;n.words[0]=a;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=f;p++){var h=u-p|0;l+=(s=(i=0|e.words[h])*(o=0|t.words[p])+d)/67108864|0,d=67108863&s}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?l[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],p=f[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modn(p).toString(e);n=(h=h.idivn(p)).isZero()?m+n:l[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r("undefined"!==typeof s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,p=0|s[1],h=8191&p,m=p>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,A=0|s[4],E=8191&A,_=A>>>13,k=0|s[5],T=8191&k,S=k>>>13,C=0|s[6],I=8191&C,O=C>>>13,R=0|s[7],D=8191&R,P=R>>>13,B=0|s[8],M=8191&B,N=B>>>13,F=0|s[9],L=8191&F,j=F>>>13,U=0|a[0],Z=8191&U,H=U>>>13,z=0|a[1],G=8191&z,V=z>>>13,W=0|a[2],q=8191&W,$=W>>>13,K=0|a[3],Y=8191&K,X=K>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],ne=8191&te,re=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,pe=0|a[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(d,Z))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,Z)|0))<<13)|0;u=((o=Math.imul(f,H))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,H))+Math.imul(m,Z)|0,o=Math.imul(m,H);var ye=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,H))+Math.imul(b,Z)|0,o=Math.imul(b,H),r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0;var be=(u+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,H))+Math.imul(x,Z)|0,o=Math.imul(x,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,V)|0,r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0;var ve=(u+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(E,Z),i=(i=Math.imul(E,H))+Math.imul(_,Z)|0,o=Math.imul(_,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,$)|0,r=r+Math.imul(h,Y)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,X)|0;var we=(u+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,H))+Math.imul(S,Z)|0,o=Math.imul(S,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,$)|0,r=r+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,X)|0,r=r+Math.imul(h,Q)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var xe=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(I,Z),i=(i=Math.imul(I,H))+Math.imul(O,Z)|0,o=Math.imul(O,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,X)|0,r=r+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(u+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,H))+Math.imul(P,Z)|0,o=Math.imul(P,H),r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Ee=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,H))+Math.imul(N,Z)|0,o=Math.imul(N,H),r=r+Math.imul(D,G)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,r=r+Math.imul(h,ce)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var _e=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,H))+Math.imul(j,Z)|0,o=Math.imul(j,H),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(D,q)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,r=r+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var ke=(u+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,he)|0))<<13)|0;u=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(j,G)|0,o=Math.imul(j,V),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,r=r+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var Te=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,$))+Math.imul(j,q)|0,o=Math.imul(j,$),r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Se=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,Y),i=(i=Math.imul(L,X))+Math.imul(j,Y)|0,o=Math.imul(j,X),r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(D,ne)|0,i=(i=i+Math.imul(D,re)|0)+Math.imul(P,ne)|0,o=o+Math.imul(P,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var Ce=(u+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,r=r+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ie=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(_,he)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(j,ne)|0,o=Math.imul(j,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,r=r+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,fe)|0;var Oe=(u+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,oe),i=(i=Math.imul(L,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,r=r+Math.imul(D,de)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Re=(u+(r=r+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(O,he)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,ce),i=(i=Math.imul(L,ue))+Math.imul(j,ce)|0,o=Math.imul(j,ue),r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var De=(u+(r=r+Math.imul(D,he)|0)|0)+((8191&(i=(i=i+Math.imul(D,me)|0)+Math.imul(P,he)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,fe))+Math.imul(j,de)|0,o=Math.imul(j,fe);var Pe=(u+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(N,he)|0))<<13)|0;u=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Be=(u+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(j,he)|0))<<13)|0;return u=((o=Math.imul(j,me))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ae,c[7]=Ee,c[8]=_e,c[9]=ke,c[10]=Te,c[11]=Se,c[12]=Ce,c[13]=Ie,c[14]=Oe,c[15]=Re,c[16]=De,c[17]=Pe,c[18]=Be,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(h=p),o.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?h(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):m(this,e,t),n},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,s=0|i.words[i.length-1];0!==(n=26-this._countBits(s))&&(i=i.ushln(n),r.iushln(n),s=0|i.words[i.length-1]);var a,c=r.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);a&&(a.words[d]=f)}return a&&a.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=s;0!==p.cmp(a);){for(var m=p,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===r&&0===l)&&(i=this.mul(i,n[s]),a=0,s=0)):a=0}c=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new _(e)},i(_,E),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},25532:function(e,t,n){"use strict";var r=n(48764).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeUnchecked=t.deserialize=t.serialize=t.BinaryReader=t.BinaryWriter=t.BorshError=t.baseDecode=t.baseEncode=void 0;const u=c(n(70945)),l=c(n(77191)),d=a(n(21127)),f=new("function"!==typeof TextDecoder?d.TextDecoder:TextDecoder)("utf-8",{fatal:!0});t.baseEncode=function(e){return"string"===typeof e&&(e=r.from(e,"utf8")),l.default.encode(r.from(e))},t.baseDecode=function(e){return r.from(l.default.decode(e))};const p=1024;class h extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}t.BorshError=h;class m{constructor(){this.buf=r.alloc(p),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=r.concat([this.buf,r.alloc(p)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",64)))}writeBuffer(e){this.buf=r.concat([r.from(this.buf.subarray(0,this.length)),e,r.alloc(p)]),this.length+=e.length}writeString(e){this.maybeResize();const t=r.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(r.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(const n of e)this.maybeResize(),t(n)}toArray(){return this.buf.subarray(0,this.length)}}function g(e,t,n){const r=n.value;n.value=function(...e){try{return r.apply(this,e)}catch(t){if(t instanceof RangeError){const e=t.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(e)>=0)throw new h("Reached the end of buffer when deserializing")}throw t}}}t.BinaryWriter=m;class y{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new u.default(e,"le")}readU128(){const e=this.readBuffer(16);return new u.default(e,"le")}readU256(){const e=this.readBuffer(32);return new u.default(e,"le")}readU512(){const e=this.readBuffer(64);return new u.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new h(`Expected buffer length ${e} isn't within bounds`);const t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){const e=this.readU32(),t=this.readBuffer(e);try{return f.decode(t)}catch(n){throw new h(`Error decoding UTF-8 string: ${n}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const t=this.readU32(),n=Array();for(let r=0;r{v(e,t,n,r[0],i)}));else if(void 0!==r.kind)switch(r.kind){case"option":null===n||void 0===n?i.writeU8(0):(i.writeU8(1),v(e,t,n,r.type,i));break;case"map":i.writeU32(n.size),n.forEach(((n,o)=>{v(e,t,o,r.key,i),v(e,t,n,r.value,i)}));break;default:throw new h(`FieldType ${r} unrecognized`)}else w(e,n,i)}catch(o){throw o instanceof h&&o.addToFieldPath(t),o}}function w(e,t,n){if("function"===typeof t.borshSerialize)return void t.borshSerialize(n);const r=e.get(t.constructor);if(!r)throw new h(`Class ${t.constructor.name} is missing in schema`);if("struct"===r.kind)r.fields.map((([r,i])=>{v(e,r,t[r],i,n)}));else{if("enum"!==r.kind)throw new h(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`);{const i=t[r.field];for(let o=0;ox(e,t,n[0],r)))}if("option"===n.kind){return r.readU8()?x(e,t,n.type,r):void 0}if("map"===n.kind){let i=new Map;const o=r.readU32();for(let s=0;s=r.values.length)throw new h(`Enum index: ${i} is out of range`);const[o,s]=r.values[i];return new t({[o]:x(e,o,s,n)})}throw new h(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}s([g],y.prototype,"readU8",null),s([g],y.prototype,"readU16",null),s([g],y.prototype,"readU32",null),s([g],y.prototype,"readU64",null),s([g],y.prototype,"readU128",null),s([g],y.prototype,"readU256",null),s([g],y.prototype,"readU512",null),s([g],y.prototype,"readString",null),s([g],y.prototype,"readFixedArray",null),s([g],y.prototype,"readArray",null),t.BinaryReader=y,t.serialize=function(e,t,n=m){const r=new n;return w(e,t,r),r.toArray()},t.deserialize=function(e,t,n,r=y){const i=new r(n),o=A(e,t,i);if(i.offset=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,n,i){for(var o=0,s=0,a=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,s=o%r,a=Math.min(o,o-s)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(C){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?""}var f=["","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"],p=[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],h=[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];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?f[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=p[e],l=h[e];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(l).toString(e);n=(d=d.idivn(l)).isZero()?m+n:f[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;n.words[0]=a;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=f;p++){var h=u-p|0;l+=(s=(i=0|e.words[h])*(o=0|t.words[p])+d)/67108864|0,d=67108863&s}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(e[n--]=s>>8&255),n>=0&&(e[n--]=s>>16&255),6===o?(n>=0&&(e[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,p=0|s[1],h=8191&p,m=p>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,A=0|s[4],E=8191&A,_=A>>>13,k=0|s[5],T=8191&k,S=k>>>13,C=0|s[6],I=8191&C,O=C>>>13,R=0|s[7],D=8191&R,P=R>>>13,B=0|s[8],M=8191&B,N=B>>>13,F=0|s[9],L=8191&F,j=F>>>13,U=0|a[0],Z=8191&U,H=U>>>13,z=0|a[1],G=8191&z,V=z>>>13,W=0|a[2],q=8191&W,$=W>>>13,K=0|a[3],Y=8191&K,X=K>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],ne=8191&te,re=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,pe=0|a[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(d,Z))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,Z)|0))<<13)|0;u=((o=Math.imul(f,H))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,H))+Math.imul(m,Z)|0,o=Math.imul(m,H);var ye=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,H))+Math.imul(b,Z)|0,o=Math.imul(b,H),r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0;var be=(u+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,H))+Math.imul(x,Z)|0,o=Math.imul(x,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,V)|0,r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0;var ve=(u+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(E,Z),i=(i=Math.imul(E,H))+Math.imul(_,Z)|0,o=Math.imul(_,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,$)|0,r=r+Math.imul(h,Y)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,X)|0;var we=(u+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,H))+Math.imul(S,Z)|0,o=Math.imul(S,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,$)|0,r=r+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,X)|0,r=r+Math.imul(h,Q)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var xe=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(I,Z),i=(i=Math.imul(I,H))+Math.imul(O,Z)|0,o=Math.imul(O,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,X)|0,r=r+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(u+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,H))+Math.imul(P,Z)|0,o=Math.imul(P,H),r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Ee=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,H))+Math.imul(N,Z)|0,o=Math.imul(N,H),r=r+Math.imul(D,G)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,r=r+Math.imul(h,ce)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var _e=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,H))+Math.imul(j,Z)|0,o=Math.imul(j,H),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(D,q)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,r=r+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var ke=(u+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,he)|0))<<13)|0;u=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(j,G)|0,o=Math.imul(j,V),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,r=r+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var Te=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,$))+Math.imul(j,q)|0,o=Math.imul(j,$),r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Se=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,Y),i=(i=Math.imul(L,X))+Math.imul(j,Y)|0,o=Math.imul(j,X),r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(D,ne)|0,i=(i=i+Math.imul(D,re)|0)+Math.imul(P,ne)|0,o=o+Math.imul(P,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var Ce=(u+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,r=r+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ie=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(_,he)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(j,ne)|0,o=Math.imul(j,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,r=r+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,fe)|0;var Oe=(u+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,oe),i=(i=Math.imul(L,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,r=r+Math.imul(D,de)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Re=(u+(r=r+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(O,he)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,ce),i=(i=Math.imul(L,ue))+Math.imul(j,ce)|0,o=Math.imul(j,ue),r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var De=(u+(r=r+Math.imul(D,he)|0)|0)+((8191&(i=(i=i+Math.imul(D,me)|0)+Math.imul(P,he)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,fe))+Math.imul(j,de)|0,o=Math.imul(j,fe);var Pe=(u+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(N,he)|0))<<13)|0;u=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Be=(u+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(j,he)|0))<<13)|0;return u=((o=Math.imul(j,me))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ae,c[7]=Ee,c[8]=_e,c[9]=ke,c[10]=Te,c[11]=Se,c[12]=Ce,c[13]=Ie,c[14]=Oe,c[15]=Re,c[16]=De,c[17]=Pe,c[18]=Be,0!==u&&(c[19]=u,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function b(e,t,n){return y(e,t,n)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=m),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?m(this,e,t):n<1024?y(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},v.prototype.permute=function(e,t,n,r,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,s=0|i.words[i.length-1];0!==(n=26-this._countBits(s))&&(i=i.ushln(n),r.iushln(n),s=0|i.words[i.length-1]);var a,c=r.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);a&&(a.words[d]=f)}return a&&a._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new T(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(A,x),A.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return w[e]=t,t},T.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=s;0!==p.cmp(a);){for(var m=p,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===r&&0===l)&&(i=this.mul(i,n[s]),a=0,s=0)):a=0}c=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,T),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},77191:function(e,t,n){var r=n(58162);e.exports=r("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},48764:function(e,t,n){"use strict";var r=n(79742),i=n(80645),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50;var s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|m(e,t),r=a(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);var i=function(e){if(c.isBuffer(e)){var t=0|h(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||H(e.length)?a(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),a(e<0?0:0|h(e))}function f(e){for(var t=e.length<0?0:0|h(e.length),n=a(t),r=0;r=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(i)return r?-1:L(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),H(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;oa&&(n=a-c),o=n;o>=0;o--){for(var d=!0,f=0;fi&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+d<=n)switch(d){case 1:u<128&&(l=u);break;case 2:128===(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],s=e[i+2],128===(192&o)&&128===(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128===(192&o)&&128===(192&s)&&128===(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?c.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else{if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i)}i+=o.length}return r},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),l=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return A(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return t=+t,n>>>=0,o||B(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,o){return t=+t,n>>>=0,o||B(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function U(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!==e}var z=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},86010:function(e,t,n){"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t=t?e:""+Array(t+1-r.length).join(n)+e},b={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function e(t,n){if(t.date()1)return e(s[0])}else{var a=t.name;w[a]=t,i=a}return!r&&i&&(v=i),i||!r&&v},E=function(e,t){if(x(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new k(n)},_=b;_.l=A,_.i=x,_.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function g(e){this.$L=A(e.locale,null,!0),this.parse(e)}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(_.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return _},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(e,t){var n=E(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return E(e)>19^e^e>>8,(o[3]>>>0)/(1<<31>>>0)}function a(){return[Math.floor(360*s())/360,(60*s()+40)/100,25*(s()+s()+s()+s())/100]}function c(e,t,n,r,i,o){for(let s=0;s>24&255,e>>16&255,e>>8&255,255&e)}function o(e){return String.fromCharCode(255&e,e>>8&255)}this.width=e,this.height=t,this.depth=n,this.pix_size=t*(e+1),this.data_size=2+this.pix_size+5*Math.floor((65534+this.pix_size)/65535)+4,this.ihdr_offs=0,this.ihdr_size=25,this.plte_offs=this.ihdr_offs+this.ihdr_size,this.plte_size=8+3*n+4,this.trns_offs=this.plte_offs+this.plte_size,this.trns_size=8+n+4,this.idat_offs=this.trns_offs+this.trns_size,this.idat_size=8+this.data_size+4,this.iend_offs=this.idat_offs+this.idat_size,this.iend_size=12,this.buffer_size=this.iend_offs+this.iend_size,this.buffer=new Array,this.palette=new Object,this.pindex=0;for(var s=new Array,a=0;a>8&255,255&c))),a=0;(a<<16)-1>1&2147483647:f>>1&2147483647;s[a]=f}this.index=function(e,t){var n=t*(this.width+1)+e+1;return this.idat_offs+8+2+5*Math.floor(n/65535+1)+n},this.color=function(e,t,n,r){var i=(((r=r>=0?r:255)<<8|e)<<8|t)<<8|n;if("undefined"==typeof this.palette[i]){if(this.pindex==this.depth)return"\0";var o=this.plte_offs+8+3*this.pindex;this.buffer[o+0]=String.fromCharCode(e),this.buffer[o+1]=String.fromCharCode(t),this.buffer[o+2]=String.fromCharCode(n),this.buffer[this.trns_offs+8+this.pindex]=String.fromCharCode(r),this.palette[i]=String.fromCharCode(this.pindex++)}return this.palette[i]},this.getBase64=function(){var e,t,n,r,i,o,s,a=this.getDump(),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=a.length,l=0,d="";do{r=(e=a.charCodeAt(l))>>2,i=(3&e)<<4|(t=a.charCodeAt(l+1))>>4,n=a.charCodeAt(l+2),o=u>6,s=u>8&16777215;r(e,t+n-4,i(-1^o))}return t%=e,n%=e,r(this.buffer,this.idat_offs+this.idat_size-8,i(n<<16|t)),u(this.buffer,this.ihdr_offs,this.ihdr_size),u(this.buffer,this.plte_offs,this.plte_size),u(this.buffer,this.trns_offs,this.trns_size),u(this.buffer,this.idat_offs,this.idat_size),u(this.buffer,this.iend_offs,this.iend_size),"\x89PNG\r\n\x1a\n"+this.buffer.join("")}}},function(e,t){function n(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}e.exports=function(e,t,r){let i,o,s;if(0==t)i=o=s=r;else{const a=r<.5?r*(1+t):r+t-r*t,c=2*r-a;i=n(c,a,e+1/3),o=n(c,a,e),s=n(c,a,e-1/3)}return[Math.round(255*i),Math.round(255*o),Math.round(255*s),255]}}])},e.exports=t()},14694:function(e,t,n){"use strict";n.r(t),n.d(t,{BaseX:function(){return o},Base32:function(){return s},Base58:function(){return a}});var r=n(93667),i=n(97208);class o{constructor(e){(0,i.defineReadOnly)(this,"alphabet",e),(0,i.defineReadOnly)(this,"base",e.length),(0,i.defineReadOnly)(this,"_alphabetMap",{}),(0,i.defineReadOnly)(this,"_leader",e.charAt(0));for(let t=0;t0;)n.push(e%this.base),e=e/this.base|0}let i="";for(let r=0;0===t[r]&&r=0;--r)i+=this.alphabet[n[r]];return i}decode(e){if("string"!==typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let n=0;n>=8;for(;i>0;)t.push(255&i),i>>=8}for(let n=0;e[n]===this._leader&&n0&&Array.isArray(e)?i(e,t-1):n.push(e)}))};return i(e,t),n}function u(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),i=1,o=[0,1];for(let w=1;w>--c&1}const d=Math.pow(2,31),f=d>>>1,p=f>>1,h=d-1;let m=0;for(let w=0;w<31;w++)m=m<<1|l();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*i-1)/b),t=0,n=r;for(;n-t>1;){let r=t+n>>>1;e>>1|l(),s=s<<1^f,a=(a^f)<<1|f|1;y=s,b=1+a-s}let v=r-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return v+256+(e[a++]<<8|e[a++]);case 1:return v+e[a++];default:return t-1}}))}(e))}function l(e){return 1&e?~e>>1:e>>1}function d(e,t){let n=Array(e);for(let r=0,i=-1;rt[e])):n}function h(e,t,n){let r=Array(e).fill(void 0).map((()=>[]));for(let i=0;ir[t].push(e)));return r}function m(e,t){let n=1+t(),r=t(),i=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(n)}return t}(t);return c(h(i.length,1+e,t).map(((e,t)=>{const o=e[0],s=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*r;return[o+t*n,s.map((e=>e+i))]}))})))}function g(e,t){return h(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const y=u((0,n(59567).J)("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),b=new Set(p(y)),v=new Set(p(y)),w=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(m(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(g(n,e))}return function(e){const t={};for(let n=0;ne-t));return function n(){let r=[];for(;;){let i=p(e,t);if(0==i.length)break;r.push({set:new Set(i),node:n()})}r.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let s=!!(1&i);return i>>=1,{branches:r,valid:o,fe0f:s,save:1==i,check:2==i}}()}(y);function A(e){return(0,i.XL)(e)}function E(e){return e.filter((e=>65039!=e))}function _(e){for(let n of e.split(".")){let e=A(n);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&45===e[2]&&45===e[3])throw new Error("invalid label extension")}catch(t){throw new Error(`Invalid label "${n}": ${t.message}`)}}return e}function k(e){return _(function(e,t){let n=A(e).reverse(),r=[];for(;n.length;){let e=T(n);if(e){r.push(...t(e));continue}let i=n.pop();if(b.has(i)){r.push(i);continue}if(v.has(i))continue;let o=w[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);r.push(...o)}return _((i=String.fromCodePoint(...r),i.normalize("NFC")));var i}(e,E))}function T(e,t){var n;let r,i,o=x,s=[],a=e.length;for(t&&(t.length=0);a;){let c=e[--a];if(o=null===(n=o.branches.find((e=>e.set.has(c))))||void 0===n?void 0:n.node,!o)break;if(o.save)i=c;else if(o.check&&c===i)break;s.push(c),o.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),o.valid&&(r=s.slice(),2==o.valid&&r.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return r}const S=new s.Logger(a.i),C=new Uint8Array(32);function I(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function O(e){const t=(0,i.Y0)(k(e)),n=[];if(0===e.length)return n;let r=0;for(let i=0;i=t.length)throw new Error("invalid ENS name; empty component");return n.push(I(t.slice(r))),n}function R(e){return O(e).map((e=>(0,i.ZN)(e))).join(".")}function D(e){try{return 0!==O(e).length}catch(t){}return!1}function P(e){"string"!==typeof e&&S.throwArgumentError("invalid ENS name; not a string","name",e);let t=C;const n=O(e);for(;n.length;)t=(0,o.keccak256)((0,r.concat)([t,(0,o.keccak256)(n.pop())]));return(0,r.hexlify)(t)}function B(e){return(0,r.hexlify)((0,r.concat)(O(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}C.fill(0)},27771:function(e,t,n){"use strict";n.d(t,{E:function(){return T}});var r=n(66379),i=n(2593),o=n(93667),s=n(88017),a=n(97208),c=n(168),u=n(53736),l=n(83859),d=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const f=new c.Logger(u.i),p=new Uint8Array(32);p.fill(0);const h=i.O$.from(-1),m=i.O$.from(0),g=i.O$.from(1),y=i.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const b=(0,o.hexZeroPad)(g.toHexString(),32),v=(0,o.hexZeroPad)(m.toHexString(),32),w={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},x=["name","version","chainId","verifyingContract","salt"];function A(e){return function(t){return"string"!==typeof t&&f.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const E={name:A("name"),version:A("version"),chainId:function(e){try{return i.O$.from(e).toString()}catch(t){}return f.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,r.getAddress)(e).toLowerCase()}catch(t){}return f.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=(0,o.arrayify)(e);if(32!==t.length)throw new Error("bad length");return(0,o.hexlify)(t)}catch(t){}return f.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function _(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const n=""===t[1],r=parseInt(t[2]||"256");(r%8!==0||r>256||t[2]&&t[2]!==String(r))&&f.throwArgumentError("invalid numeric width","type",e);const s=y.mask(n?r-1:r),a=n?s.add(g).mul(h):m;return function(t){const n=i.O$.from(t);return(n.lt(a)||n.gt(s))&&f.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),(0,o.hexZeroPad)(n.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return(0===n||n>32||t[1]!==String(n))&&f.throwArgumentError("invalid bytes width","type",e),function(t){return(0,o.arrayify)(t).length!==n&&f.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=(0,o.arrayify)(e),n=t.length%32;return n?(0,o.hexConcat)([t,p.slice(n)]):(0,o.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,o.hexZeroPad)((0,r.getAddress)(e),32)};case"bool":return function(e){return e?b:v};case"bytes":return function(e){return(0,s.keccak256)(e)};case"string":return function(e){return(0,l.id)(e)}}return null}function k(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class T{constructor(e){(0,a.defineReadOnly)(this,"types",Object.freeze((0,a.deepCopy)(e))),(0,a.defineReadOnly)(this,"_encoderCache",{}),(0,a.defineReadOnly)(this,"_types",{});const t={},n={},r={};Object.keys(e).forEach((e=>{t[e]={},n[e]=[],r[e]={}}));for(const o in e){const r={};e[o].forEach((i=>{r[i.name]&&f.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(o)}`,"types",e),r[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===o&&f.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e);_(s)||(n[s]||f.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),n[s].push(o),t[o][s]=!0)}))}const i=Object.keys(n).filter((e=>0===n[e].length));0===i.length?f.throwArgumentError("missing primary type","types",e):i.length>1&&f.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,a.defineReadOnly)(this,"primaryType",i[0]),function i(o,s){s[o]&&f.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),s[o]=!0,Object.keys(t[o]).forEach((e=>{n[e]&&(i(e,s),Object.keys(s).forEach((t=>{r[t][e]=!0})))})),delete s[o]}(this.primaryType,{});for(const o in r){const t=Object.keys(r[o]);t.sort(),this._types[o]=k(o,e[o])+t.map((t=>k(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=_(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],n=this.getEncoder(e),r=parseInt(t[3]);return t=>{r>=0&&t.length!==r&&f.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(n);return this._types[e]&&(i=i.map(s.keccak256)),(0,s.keccak256)((0,o.hexConcat)(i))}}const n=this.types[e];if(n){const t=(0,l.id)(this._types[e]);return e=>{const r=n.map((({name:t,type:n})=>{const r=this.getEncoder(n)(e[t]);return this._types[n]?(0,s.keccak256)(r):r}));return r.unshift(t),(0,o.hexConcat)(r)}}return f.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||f.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,s.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(_(e))return n(e,t);const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const e=r[1],i=parseInt(r[3]);return i>=0&&t.length!==i&&f.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,n)))}const i=this.types[e];return i?i.reduce(((e,{name:r,type:i})=>(e[r]=this._visit(i,t[r],n),e)),{}):f.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new T(e)}static getPrimaryType(e){return T.from(e).primaryType}static hashStruct(e,t,n){return T.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){const r=w[n];r||f.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:r})}return t.sort(((e,t)=>x.indexOf(e.name)-x.indexOf(t.name))),T.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return(0,o.hexConcat)(["0x1901",T.hashDomain(e),T.from(t).hash(n)])}static hash(e,t,n){return(0,s.keccak256)(T.encode(e,t,n))}static resolveNames(e,t,n,r){return d(this,void 0,void 0,(function*(){e=(0,a.shallowCopy)(e);const i={};e.verifyingContract&&!(0,o.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const s=T.from(t);s.visit(n,((e,t)=>("address"!==e||(0,o.isHexString)(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield r(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=s.visit(n,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:n}}))}static getPayload(e,t,n){T.hashDomain(e);const r={},s=[];x.forEach((t=>{const n=e[t];null!=n&&(r[t]=E[t](n),s.push({name:t,type:w[t]}))}));const c=T.from(t),u=(0,a.shallowCopy)(t);return u.EIP712Domain?f.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):u.EIP712Domain=s,c.encode(n),{types:u,domain:r,primaryType:c.primaryType,message:c.visit(n,((e,t)=>{if(e.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.arrayify)(t));if(e.match(/^u?int/))return i.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&f.throwArgumentError("invalid string","value",t),t}return f.throwArgumentError("unsupported type","type",e)}))}}}},4682:function(e,t,n){"use strict";n.r(t),n.d(t,{HDNode:function(){return R},defaultPath:function(){return O},entropyToMnemonic:function(){return B},getAccountPath:function(){return N},isValidMnemonic:function(){return M},mnemonicToEntropy:function(){return P},mnemonicToSeed:function(){return D}});var r=n(14694),i=n(93667),o=n(2593),s=n(84804),a=n(76447),c=n(97208),u=n(70184),l=n(19763),d=n(6648),f=n(60561),p=n(83859),h=n(168);const m=new h.Logger("wordlists/5.7.0");class g{constructor(e){m.checkAbstract(new.target,g),(0,c.defineReadOnly)(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let n=0;n<2048;n++){const r=e.getWord(n);if(n!==e.getWordIndex(r))return"0x";t.push(r)}return(0,p.id)(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let y=null;function b(e){if(null==y&&(y="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==g.check(e)))throw y=null,new Error("BIP39 Wordlist for en (English) FAILED")}const v=new class extends g{constructor(){super("en")}getWord(e){return b(this),y[e]}getWordIndex(e){return b(this),y.indexOf(e)}};g.register(v);const w={en:v},x=new h.Logger("hdnode/5.7.0"),A=o.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),E=(0,s.Y0)("Bitcoin seed"),_=2147483648;function k(e){return(1<=256)throw new Error("Depth too large!");return S((0,i.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,i.hexlify)(this.depth),this.parentFingerprint,(0,i.hexZeroPad)((0,i.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,i.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new R(I,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const n=new Uint8Array(37);if(e&_){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set((0,i.arrayify)(this.privateKey),1),t&&(t+="'")}else n.set((0,i.arrayify)(this.publicKey));for(let i=24;i>=0;i-=8)n[33+(i>>3)]=e>>24-i&255;const r=(0,i.arrayify)((0,l.Gy)(d.p.sha512,this.chainCode,n)),s=r.slice(0,32),a=r.slice(32);let c=null,f=null;if(this.privateKey)c=T(o.O$.from(s).add(this.privateKey).mod(A));else{f=new u.SigningKey((0,i.hexlify)(s))._addPoint(this.publicKey)}let p=t;const h=this.mnemonic;return h&&(p=Object.freeze({phrase:h.phrase,path:t,locale:h.locale||"en"})),new R(I,c,f,this.fingerprint,T(a),e,this.depth+1,p)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let n=this;for(let r=0;r=_)throw new Error("invalid path index - "+e);n=n._derive(_+t)}else{if(!e.match(/^[0-9]+$/))throw new Error("invalid path component - "+e);{const t=parseInt(e);if(t>=_)throw new Error("invalid path index - "+e);n=n._derive(t)}}}return n}static _fromSeed(e,t){const n=(0,i.arrayify)(e);if(n.length<16||n.length>64)throw new Error("invalid seed");const r=(0,i.arrayify)((0,l.Gy)(d.p.sha512,E,n));return new R(I,T(r.slice(0,32)),null,"0x00000000",T(r.slice(32)),0,0,t)}static fromMnemonic(e,t,n){return e=B(P(e,n=C(n)),n),R._fromSeed(D(e,t),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return R._fromSeed(e,null)}static fromExtendedKey(e){const t=r.Base58.decode(e);82===t.length&&S(t.slice(0,78))===e||x.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=t[4],o=(0,i.hexlify)(t.slice(5,9)),s=parseInt((0,i.hexlify)(t.slice(9,13)).substring(2),16),a=(0,i.hexlify)(t.slice(13,45)),c=t.slice(45,78);switch((0,i.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new R(I,null,(0,i.hexlify)(c),o,a,s,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new R(I,(0,i.hexlify)(c.slice(1)),null,o,a,s,n,null)}return x.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function D(e,t){t||(t="");const n=(0,s.Y0)("mnemonic"+t,s.Uj.NFKD);return(0,a.n)((0,s.Y0)(e,s.Uj.NFKD),n,2048,64,"sha512")}function P(e,t){t=C(t),x.checkNormalize();const n=t.split(e);if(n.length%3!==0)throw new Error("invalid mnemonic");const r=(0,i.arrayify)(new Uint8Array(Math.ceil(11*n.length/8)));let o=0;for(let i=0;i>3]|=1<<7-o%8),o++}const s=32*n.length/3,a=k(n.length/3);if(((0,i.arrayify)((0,l.JQ)(r.slice(0,s/8)))[0]&a)!==(r[r.length-1]&a))throw new Error("invalid checksum");return(0,i.hexlify)(r.slice(0,s/8))}function B(e,t){if(t=C(t),(e=(0,i.arrayify)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");const n=[0];let r=11;for(let i=0;i8?(n[n.length-1]<<=8,n[n.length-1]|=e[i],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[i]>>8-r,n.push(e[i]&(1<<8-r)-1),r+=3);const o=e.length/4,s=(0,i.arrayify)((0,l.JQ)(e))[0]&k(o);return n[n.length-1]<<=o,n[n.length-1]|=s>>8-o,t.join(n.map((e=>t.getWord(e))))}function M(e,t){try{return P(e,t),!0}catch(n){}return!1}function N(e){return("number"!==typeof e||e<0||e>=_||e%1)&&x.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}},72294:function(e,t,n){"use strict";n.r(t),n.d(t,{decryptCrowdsale:function(){return w},decryptJsonWallet:function(){return U},decryptJsonWalletSync:function(){return Z},decryptKeystore:function(){return L},decryptKeystoreSync:function(){return F},encryptKeystore:function(){return j},getJsonWalletAddress:function(){return E},isCrowdsaleWallet:function(){return x},isKeystoreWallet:function(){return A}});var r=n(78826),i=n.n(r),o=n(66379),s=n(93667),a=n(88017),c=n(76447),u=n(84804),l=n(97208),d=n(168);const f="json-wallets/5.7.0";function p(e){return"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,s.arrayify)(e)}function h(e,t){for(e=String(e);e.length{const n=(t=(0,s.arrayify)(t)).slice(0,16),r=t.slice(16,32),o=t.slice(32,64),u=new(i().Counter)(b),m=new(i().ModeOfOperation.ctr)(n,u),E=(0,s.arrayify)(m.encrypt(c)),_=(0,a.keccak256)((0,s.concat)([r,E])),k={address:e.address.substring(2).toLowerCase(),id:y(v),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,s.hexlify)(b).substring(2)},ciphertext:(0,s.hexlify)(E).substring(2),kdf:"scrypt",kdfparams:{salt:(0,s.hexlify)(g).substring(2),n:w,dklen:32,p:A,r:x},mac:_.substring(2)}};if(l){const e=(0,S.O)(16),t=new(i().Counter)(e),n=new(i().ModeOfOperation.ctr)(o,t),r=(0,s.arrayify)(n.encrypt(l)),a=new Date,c=a.getUTCFullYear()+"-"+h(a.getUTCMonth()+1,2)+"-"+h(a.getUTCDate(),2)+"T"+h(a.getUTCHours(),2)+"-"+h(a.getUTCMinutes(),2)+"-"+h(a.getUTCSeconds(),2)+".0Z";k["x-ethers"]={client:p,gethFilename:"UTC--"+c+"--"+k.address,mnemonicCounter:(0,s.hexlify)(e).substring(2),mnemonicCiphertext:(0,s.hexlify)(r).substring(2),path:d,locale:f,version:"0.1"}}return JSON.stringify(k)}))}function U(e,t,n){if(x(e)){n&&n(0);const r=w(e,t);return n&&n(1),Promise.resolve(r)}return A(e)?L(e,t,n):Promise.reject(new Error("invalid JSON wallet"))}function Z(e,t){if(x(e))return w(e,t);if(A(e))return F(e,t);throw new Error("invalid JSON wallet")}},88017:function(e,t,n){"use strict";n.r(t),n.d(t,{keccak256:function(){return s}});var r=n(91094),i=n.n(r),o=n(93667);function s(e){return"0x"+i().keccak_256((0,o.arrayify)(e))}},168:function(e,t,n){"use strict";n.r(t),n.d(t,{ErrorCode:function(){return l},LogLevel:function(){return u},Logger:function(){return f}});let r=!1,i=!1;const o={debug:1,default:2,info:2,warning:3,error:4,off:5};let s=o.default,a=null;const c=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var u,l;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(u||(u={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(l||(l={}));const d="0123456789abcdef";class f{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==o[n]&&this.throwArgumentError("invalid log level name","logLevel",e),s>o[n]||console.log.apply(console,t)}debug(...e){this._log(f.levels.DEBUG,e)}info(...e){this._log(f.levels.INFO,e)}warn(...e){this._log(f.levels.WARNING,e)}makeError(e,t,n){if(i)return this.makeError("censored error",t,{});t||(t=f.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e>4],n+=d[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(a){r.push(e+"="+JSON.stringify(n[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const o=e;let s="";switch(t){case l.NUMERIC_FAULT:{s="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case l.CALL_EXCEPTION:case l.INSUFFICIENT_FUNDS:case l.MISSING_NEW:case l.NONCE_EXPIRED:case l.REPLACEMENT_UNDERPRICED:case l.TRANSACTION_REPLACED:case l.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const a=new Error(e);return a.reason=o,a.code=t,Object.keys(n).forEach((function(e){a[e]=n[e]})),a}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,f.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),c&&this.throwError("platform missing String.prototype.normalize",f.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:c})}checkSafeUint53(e,t){"number"===typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",et&&this.throwError("too many arguments"+n,f.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",f.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",f.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",f.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return a||(a=new f("logger/5.7.0")),a}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),r){if(!e)return;this.globalLogger().throwError("error censorship permanent",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!e,r=!!t}static setLogLevel(e){const t=o[e.toLowerCase()];null!=t?s=t:f.globalLogger().warn("invalid log level - "+e)}static from(e){return new f(e)}}f.errors=l,f.levels=u},76447:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(93667),i=n(19763);function o(e,t,n,o,s){let a;e=(0,r.arrayify)(e),t=(0,r.arrayify)(t);let c=1;const u=new Uint8Array(o),l=new Uint8Array(t.length+4);let d,f;l.set(t);for(let p=1;p<=c;p++){l[t.length]=p>>24&255,l[t.length+1]=p>>16&255,l[t.length+2]=p>>8&255,l[t.length+3]=255&p;let h=(0,r.arrayify)((0,i.Gy)(s,e,l));a||(a=h.length,f=new Uint8Array(a),c=Math.ceil(o/a),d=o-(c-1)*a),f.set(h);for(let t=1;t{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function u(e,t){e&&"object"===typeof e||o.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((n=>{t[n]||o.throwArgumentError("invalid object key - "+n,"transaction:"+n,e)}))}function l(e){const t={};for(const n in e)t[n]=e[n];return t}const d={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function f(e){if(void 0===e||null===e||d[typeof e])return!0;if(Array.isArray(e)||"object"===typeof e){if(!Object.isFrozen(e))return!1;const n=Object.keys(e);for(let r=0;rh(e))));if("object"===typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&s(t,n,h(r))}return t}return o.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function h(e){return p(e)}class m{constructor(e){for(const t in e)this[t]=h(e[t])}}},52989:function(e,t,n){"use strict";n.r(t),n.d(t,{randomBytes:function(){return r.O},shuffled:function(){return i.y}});var r=n(66207),i=n(34952)},66207:function(e,t,n){"use strict";n.d(t,{O:function(){return c}});var r=n(93667),i=n(168);const o=new i.Logger("random/5.7.0");const s=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof n.g)return n.g;throw new Error("unable to locate global object")}();let a=s.crypto||s.msCrypto;function c(e){(e<=0||e>1024||e%1||e!=e)&&o.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return a.getRandomValues(t),(0,r.arrayify)(t)}a&&a.getRandomValues||(o.warn("WARNING: Missing strong random number source"),a={getRandomValues:function(e){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},34952:function(e,t,n){"use strict";function r(e){for(let t=(e=e.slice()).length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}n.d(t,{y:function(){return r}})},66906:function(e,t,n){"use strict";n.r(t),n.d(t,{decode:function(){return f},encode:function(){return u}});var r=n(93667),i=n(168);const o=new i.Logger("rlp/5.7.0");function s(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function a(e,t,n){let r=0;for(let i=0;it+1+r&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:s}}function d(e,t){if(0===e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){const n=e[t]-247;t+1+n>e.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});const r=a(e,t+1,n);return t+1+n+r>e.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1+n,n+r)}if(e[t]>=192){const n=e[t]-192;return t+1+n>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1,n)}if(e[t]>=184){const n=e[t]-183;t+1+n>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});const s=a(e,t+1,n);t+1+n+s>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+n+s,result:(0,r.hexlify)(e.slice(t+1+n,t+1+n+s))}}if(e[t]>=128){const n=e[t]-128;t+1+n>e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:(0,r.hexlify)(e.slice(t+1,t+1+n))}}return{consumed:1,result:(0,r.hexlify)(e[t])}}function f(e){const t=(0,r.arrayify)(e),n=d(t,0);return n.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),n.result}},8894:function(e,t,n){"use strict";n.r(t),n.d(t,{computeHmac:function(){return r.Gy},ripemd160:function(){return r.bP},sha256:function(){return r.JQ},sha512:function(){return r.o},SupportedAlgorithm:function(){return i.p}});var r=n(19763),i=n(6648)},19763:function(e,t,n){"use strict";n.d(t,{Gy:function(){return f},bP:function(){return u},JQ:function(){return l},o:function(){return d}});var r=n(33715),i=n.n(r),o=n(93667),s=n(6648),a=n(168);const c=new a.Logger("sha2/5.7.0");function u(e){return"0x"+i().ripemd160().update((0,o.arrayify)(e)).digest("hex")}function l(e){return"0x"+i().sha256().update((0,o.arrayify)(e)).digest("hex")}function d(e){return"0x"+i().sha512().update((0,o.arrayify)(e)).digest("hex")}function f(e,t,n){return s.p[e]||c.throwError("unsupported algorithm "+e,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+i().hmac(i()[e],(0,o.arrayify)(t)).update((0,o.arrayify)(n)).digest("hex")}},6648:function(e,t,n){"use strict";var r;n.d(t,{p:function(){return r}}),function(e){e.sha256="sha256",e.sha512="sha512"}(r||(r={}))},70184:function(e,t,n){"use strict";n.r(t),n.d(t,{SigningKey:function(){return $},computePublicKey:function(){return Y},recoverPublicKey:function(){return K}});var r=n(41257),i=n.n(r),o=n(33715),s=n.n(o);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self&&self;function a(e,t,n){return n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&n.path)}},e(n,n.exports),n.exports}var c=u;function u(e,t){if(!e)throw new Error(t||"Assertion failed")}u.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var l=a((function(e,t){var n=t;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",n=0;n>8,s=255&i;o?n.push(o,s):n.push(s)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}})),d=a((function(e,t){var n=t;n.assert=c,n.toArray=l.toArray,n.zero2=l.zero2,n.toHex=l.toHex,n.encode=l.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,r[s]=a,o.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0===(1&c)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==u?c:-c,n[0].push(s),a=0===(1&u)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==c?u:-u,n[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new(i())(e,"hex","le")}})),f=d.getNAF,p=d.getJSF,h=d.assert;function m(e,t){this.type=e,this.p=new(i())(t.p,16),this.red=t.prime?i().red(t.prime):i().mont(this.p),this.zero=new(i())(0).toRed(this.red),this.one=new(i())(1).toRed(this.red),this.two=new(i())(2).toRed(this.red),this.n=t.n&&new(i())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var g=m;function y(e,t){this.curve=e,this.type=t,this.precomputed=null}m.prototype.point=function(){throw new Error("Not implemented")},m.prototype.validate=function(){throw new Error("Not implemented")},m.prototype._fixedNafMul=function(e,t){h(e.precomputed);var n=e._getDoubles(),r=f(t,1,this._bitLength),i=(1<=o;c--)s=(s<<1)+r[c];a.push(s)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;a--){for(var c=0;a>=0&&0===o[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var u=o[a];h(0!==u),s="affine"===e.type?u>0?s.mixedAdd(i[u-1>>1]):s.mixedAdd(i[-u-1>>1].neg()):u>0?s.add(i[u-1>>1]):s.add(i[-u-1>>1].neg())}return"affine"===e.type?s.toP():s},m.prototype._wnafMulAdd=function(e,t,n,r,i){var o,s,a,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,d=0;for(o=0;o=1;o-=2){var m=o-1,g=o;if(1===c[m]&&1===c[g]){var y=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(y[1]=t[m].add(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].add(t[g].neg())):(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=p(n[m],n[g]);for(d=Math.max(v[0].length,d),l[m]=new Array(d),l[g]=new Array(d),s=0;s=0;o--){for(var _=0;o>=0;){var k=!0;for(s=0;s=0&&_++,A=A.dblp(_),o<0)break;for(s=0;s0?a=u[s][T-1>>1]:T<0&&(a=u[s][-T-1>>1].neg()),A="affine"===a.type?A.mixedAdd(a):A.add(a))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},y.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i=0&&(s=t,a=n),r.negative&&(r=r.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:r,b:o},{a:s,b:a}]},w.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),s=i.mul(n.a),a=o.mul(r.a),c=i.mul(n.b),u=o.mul(r.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},w.prototype.pointFromX=function(e,t){(e=new(i())(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var o=r.fromRed().isOdd();return(t&&!o||!t&&o)&&(r=r.redNeg()),this.point(e,r)},w.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},w.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},A.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(e){return e=new(i())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},A.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},A.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},A.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},A.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},b(E,g.BasePoint),w.prototype.jpoint=function(e,t,n){return new E(this,e,t,n)},E.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},E.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},E.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(n.redMul(this.z)),a=r.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=r.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),p=c.redMul(d.redISub(f)).redISub(o.redMul(l)),h=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,p,h)},E.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=n.redSub(r),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=n.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),f=a.redMul(l.redISub(d)).redISub(i.redMul(u)),p=this.z.redMul(s);return this.curve.jpoint(d,f,p)},E.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},E.prototype.inspect=function(){return this.isInfinity()?"":""},E.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var _=a((function(e,t){var n=t;n.base=g,n.short=x,n.mont=null,n.edwards=null})),k=a((function(e,t){var n,r=t,i=d.assert;function o(e){"short"===e.type?this.curve=new _.short(e):"edwards"===e.type?this.curve=new _.edwards(e):this.curve=new _.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new o(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(c){n=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function T(e){if(!(this instanceof T))return new T(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=l.toArray(e.entropy,e.entropyEnc||"hex"),n=l.toArray(e.nonce,e.nonceEnc||"hex"),r=l.toArray(e.pers,e.persEnc||"hex");c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var S=T;T.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},T.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=n,n=t,t=null),n&&(n=l.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"};var R=d.assert;function D(e,t){if(e instanceof D)return e;this._importDER(e,t)||(R(e.r&&e.s,"Signature without r or s"),this.r=new(i())(e.r,16),this.s=new(i())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var P=D;function B(){this.place=0}function M(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,s=t.place;o>>=0;return!(i<=127)&&(t.place=s,i)}function N(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}D.prototype._importDER=function(e,t){e=d.toArray(e,t);var n=new B;if(48!==e[n.place++])return!1;var r=M(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var o=M(e,n);if(!1===o)return!1;var s=e.slice(n.place,o+n.place);if(n.place+=o,2!==e[n.place++])return!1;var a=M(e,n);if(!1===a)return!1;if(e.length!==a+n.place)return!1;var c=e.slice(n.place,a+n.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new(i())(s),this.s=new(i())(c),this.recoveryParam=null,!0},D.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=N(t),n=N(n);!n[0]&&!(128&n[1]);)n=n.slice(1);var r=[2];F(r,t.length),(r=r.concat(t)).push(2),F(r,n.length);var i=r.concat(n),o=[48];return F(o,i.length),o=o.concat(i),d.encode(o,e)};var L=function(){throw new Error("unsupported")},j=d.assert;function U(e){if(!(this instanceof U))return new U(e);"string"===typeof e&&(j(Object.prototype.hasOwnProperty.call(k,e),"Unknown curve "+e),e=k[e]),e instanceof k.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Z=U;U.prototype.keyPair=function(e){return new O(this,e)},U.prototype.keyFromPrivate=function(e,t){return O.fromPrivate(this,e,t)},U.prototype.keyFromPublic=function(e,t){return O.fromPublic(this,e,t)},U.prototype.genKeyPair=function(e){e||(e={});for(var t=new S({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||L(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new(i())(2));;){var o=new(i())(t.generate(n));if(!(o.cmp(r)>0))return o.iaddn(1),this.keyFromPrivate(o)}},U.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},U.prototype.sign=function(e,t,n,r){"object"===typeof n&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new(i())(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),a=e.toArray("be",o),c=new S({hash:this.hash,entropy:s,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new(i())(1)),l=0;;l++){var d=r.k?r.k(l):new(i())(c.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(u)>=0)){var f=this.g.mul(d);if(!f.isInfinity()){var p=f.getX(),h=p.umod(this.n);if(0!==h.cmpn(0)){var m=d.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var g=(f.getY().isOdd()?1:0)|(0!==p.cmp(h)?2:0);return r.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new P({r:h,s:m,recoveryParam:g})}}}}}},U.prototype.verify=function(e,t,n,r){e=this._truncateToN(new(i())(e,16)),n=this.keyFromPublic(n,r);var o=(t=new P(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(e).umod(this.n),l=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,n.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},U.prototype.recoverPubKey=function(e,t,n,r){j((3&n)===n,"The recovery param is more than two bits"),t=new P(t,r);var o=this.n,s=new(i())(e),a=t.r,c=t.s,u=1&n,l=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var d=t.r.invm(o),f=o.sub(s).mul(d).umod(o),p=c.mul(d).umod(o);return this.g.mulAdd(f,a,p)},U.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new P(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var H=a((function(e,t){var n=t;n.version="6.5.4",n.utils=d,n.rand=function(){throw new Error("unsupported")},n.curve=_,n.curves=k,n.ec=Z,n.eddsa=null})).ec,z=n(93667),G=n(97208);const V=new(n(168).Logger)("signing-key/5.7.0");let W=null;function q(){return W||(W=new H("secp256k1")),W}class ${constructor(e){(0,G.defineReadOnly)(this,"curve","secp256k1"),(0,G.defineReadOnly)(this,"privateKey",(0,z.hexlify)(e)),32!==(0,z.hexDataLength)(this.privateKey)&&V.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=q().keyFromPrivate((0,z.arrayify)(this.privateKey));(0,G.defineReadOnly)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,G.defineReadOnly)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,G.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(e){const t=q().keyFromPublic((0,z.arrayify)(this.publicKey)),n=q().keyFromPublic((0,z.arrayify)(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const t=q().keyFromPrivate((0,z.arrayify)(this.privateKey)),n=(0,z.arrayify)(e);32!==n.length&&V.throwArgumentError("bad digest length","digest",e);const r=t.sign(n,{canonical:!0});return(0,z.splitSignature)({recoveryParam:r.recoveryParam,r:(0,z.hexZeroPad)("0x"+r.r.toString(16),32),s:(0,z.hexZeroPad)("0x"+r.s.toString(16),32)})}computeSharedSecret(e){const t=q().keyFromPrivate((0,z.arrayify)(this.privateKey)),n=q().keyFromPublic((0,z.arrayify)(Y(e)));return(0,z.hexZeroPad)("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function K(e,t){const n=(0,z.splitSignature)(t),r={r:(0,z.arrayify)(n.r),s:(0,z.arrayify)(n.s)};return"0x"+q().recoverPubKey((0,z.arrayify)(e),r,n.recoveryParam).encode("hex",!1)}function Y(e,t){const n=(0,z.arrayify)(e);if(32===n.length){const e=new $(n);return t?"0x"+q().keyFromPrivate(n).getPublic(!0,"hex"):e.publicKey}return 33===n.length?t?(0,z.hexlify)(n):"0x"+q().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?t?"0x"+q().keyFromPublic(n).getPublic(!0,"hex"):(0,z.hexlify)(n):V.throwArgumentError("invalid public or private key","key","[REDACTED]")}},20510:function(e,t,n){"use strict";n.r(t),n.d(t,{UnicodeNormalizationForm:function(){return o.Uj},Utf8ErrorFuncs:function(){return o.te},Utf8ErrorReason:function(){return o.Uw},_toEscapedUtf8String:function(){return o.U$},formatBytes32String:function(){return s},nameprep:function(){return b},parseBytes32String:function(){return a},toUtf8Bytes:function(){return o.Y0},toUtf8CodePoints:function(){return o.XL},toUtf8String:function(){return o.ZN}});var r=n(7529),i=n(93667),o=n(84804);function s(e){const t=(0,o.Y0)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([t,r.R]).slice(0,32))}function a(e){const t=(0,i.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let n=31;for(;0===t[n-1];)n--;return(0,o.ZN)(t.slice(0,n))}function c(e,t){t||(t=function(e){return[parseInt(e,16)]});let n=0,r={};return e.split(",").forEach((e=>{let i=e.split(":");n+=parseInt(i[0],16),r[n]=t(i[1])})),r}function u(e){let t=0;return e.split(",").map((e=>{let n=e.split("-");1===n.length?n[1]="0":""===n[1]&&(n[1]="1");let r=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:r,h:t}}))}function l(e,t){let n=0;for(let r=0;r=n&&e<=n+i.h&&(e-n)%(i.d||1)===0){if(i.e&&-1!==i.e.indexOf(e-n))continue;return i}}return null}const d=u("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),f="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),p=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],h=c("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),m=c("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),g=c("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!==0)throw new Error("bad data");let t=[];for(let n=0;n{if(f.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=l(e,p);if(t)return[e+t.s];let n=h[e];if(n)return n;let r=m[e];return r?[e+r[0]]:g[e]||null}(e);return t||[e]})),t=n.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=(0,o.XL)((0,o.uu)(t),o.Uj.NFKC),t.forEach((e=>{if(l(e,y))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(l(e,d))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let r=(0,o.uu)(t);if("-"===r.substring(0,1)||"--"===r.substring(2,4)||"-"===r.substring(r.length-1))throw new Error("invalid hyphen");return r}},84804:function(e,t,n){"use strict";n.d(t,{Uj:function(){return o},te:function(){return c},Uw:function(){return s},U$:function(){return f},uu:function(){return p},Y0:function(){return l},XL:function(){return m},ZN:function(){return h}});var r=n(93667);const i=new(n(168).Logger)("strings/5.7.0");var o,s;function a(e,t,n,r,i){if(e===s.BAD_PREFIX||e===s.UNEXPECTED_CONTINUE){let e=0;for(let r=t+1;r>6===2;r++)e++;return e}return e===s.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(o||(o={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(s||(s={}));const c=Object.freeze({error:function(e,t,n,r,o){return i.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:a,replace:function(e,t,n,r,i){return e===s.OVERLONG?(r.push(i),0):(r.push(65533),a(e,t,n))}});function u(e,t){null==t&&(t=c.error),e=(0,r.arrayify)(e);const n=[];let i=0;for(;i>7===0){n.push(r);continue}let o=null,a=null;if(192===(224&r))o=1,a=127;else if(224===(240&r))o=2,a=2047;else{if(240!==(248&r)){i+=t(128===(192&r)?s.UNEXPECTED_CONTINUE:s.BAD_PREFIX,i-1,e,n);continue}o=3,a=65535}if(i-1+o>=e.length){i+=t(s.OVERRUN,i-1,e,n);continue}let c=r&(1<<8-o-1)-1;for(let u=0;u1114111?i+=t(s.OUT_OF_RANGE,i-1-o,e,n,c):c>=55296&&c<=57343?i+=t(s.UTF16_SURROGATE,i-1-o,e,n,c):c<=a?i+=t(s.OVERLONG,i-1-o,e,n,c):n.push(c))}return n}function l(e,t=o.current){t!=o.current&&(i.checkNormalize(),e=e.normalize(t));let n=[];for(let r=0;r>6|192),n.push(63&t|128);else if(55296==(64512&t)){r++;const i=e.charCodeAt(r);if(r>=e.length||56320!==(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&t)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(t>>12|224),n.push(t>>6&63|128),n.push(63&t|128)}return(0,r.arrayify)(n)}function d(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function f(e,t){return'"'+u(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?d(e):d(55296+((e-=65536)>>10&1023))+d(56320+(1023&e))})).join("")+'"'}function p(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function h(e,t){return p(u(e,t))}function m(e,t=o.current){return u(l(e,t))}},60561:function(e,t,n){"use strict";n.r(t),n.d(t,{TransactionTypes:function(){return p},accessListify:function(){return A},computeAddress:function(){return b},parse:function(){return C},recoverAddress:function(){return v},serialize:function(){return T}});var r=n(66379),i=n(2593),o=n(93667);const s=i.O$.from(0);var a=n(88017),c=n(97208),u=n(66906),l=n(70184),d=n(168);const f=new d.Logger("transactions/5.7.0");var p;function h(e){return"0x"===e?null:(0,r.getAddress)(e)}function m(e){return"0x"===e?s:i.O$.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(p||(p={}));const g=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],y={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function b(e){const t=(0,l.computePublicKey)(e);return(0,r.getAddress)((0,o.hexDataSlice)((0,a.keccak256)((0,o.hexDataSlice)(t,1)),12))}function v(e,t){return b((0,l.recoverPublicKey)((0,o.arrayify)(e),t))}function w(e,t){const n=(0,o.stripZeros)(i.O$.from(e).toHexString());return n.length>32&&f.throwArgumentError("invalid length for "+t,"transaction:"+t,e),n}function x(e,t){return{address:(0,r.getAddress)(e),storageKeys:(t||[]).map(((t,n)=>(32!==(0,o.hexDataLength)(t)&&f.throwArgumentError("invalid access list storageKey",`accessList[${e}:${n}]`,t),t.toLowerCase())))}}function A(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&f.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),x(e[0],e[1])):x(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const n=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return x(t,Object.keys(n).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function E(e){return A(e).map((e=>[e.address,e.storageKeys]))}function _(e,t){if(null!=e.gasPrice){const t=i.O$.from(e.gasPrice),n=i.O$.from(e.maxFeePerGas||0);t.eq(n)||f.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:n})}const n=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),w(e.maxFeePerGas||0,"maxFeePerGas"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,r.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",E(e.accessList||[])];if(t){const e=(0,o.splitSignature)(t);n.push(w(e.recoveryParam,"recoveryParam")),n.push((0,o.stripZeros)(e.r)),n.push((0,o.stripZeros)(e.s))}return(0,o.hexConcat)(["0x02",u.encode(n)])}function k(e,t){const n=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.gasPrice||0,"gasPrice"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,r.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",E(e.accessList||[])];if(t){const e=(0,o.splitSignature)(t);n.push(w(e.recoveryParam,"recoveryParam")),n.push((0,o.stripZeros)(e.r)),n.push((0,o.stripZeros)(e.s))}return(0,o.hexConcat)(["0x01",u.encode(n)])}function T(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&f.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,c.checkProperties)(e,y);const n=[];g.forEach((function(t){let r=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),r=(0,o.arrayify)((0,o.hexlify)(r,i)),t.length&&r.length!==t.length&&r.length>0&&f.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),t.maxLength&&(r=(0,o.stripZeros)(r),r.length>t.maxLength&&f.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r)),n.push((0,o.hexlify)(r))}));let r=0;if(null!=e.chainId?(r=e.chainId,"number"!==typeof r&&f.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!(0,o.isBytesLike)(t)&&t.v>28&&(r=Math.floor((t.v-35)/2)),0!==r&&(n.push((0,o.hexlify)(r)),n.push("0x"),n.push("0x")),!t)return u.encode(n);const i=(0,o.splitSignature)(t);let s=27+i.recoveryParam;return 0!==r?(n.pop(),n.pop(),n.pop(),s+=2*r+8,i.v>28&&i.v!==s&&f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==s&&f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),n.push((0,o.hexlify)(s)),n.push((0,o.stripZeros)((0,o.arrayify)(i.r))),n.push((0,o.stripZeros)((0,o.arrayify)(i.s))),u.encode(n)}(e,t);switch(e.type){case 1:return k(e,t);case 2:return _(e,t)}return f.throwError(`unsupported transaction type: ${e.type}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function S(e,t,n){try{const n=m(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(r){f.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,o.hexZeroPad)(t[1],32),e.s=(0,o.hexZeroPad)(t[2],32);try{const t=(0,a.keccak256)(n(e));e.from=v(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(r){}}function C(e){const t=(0,o.arrayify)(e);if(t[0]>127)return function(e){const t=u.decode(e);9!==t.length&&6!==t.length&&f.throwArgumentError("invalid raw transaction","rawTransaction",e);const n={nonce:m(t[0]).toNumber(),gasPrice:m(t[1]),gasLimit:m(t[2]),to:h(t[3]),value:m(t[4]),data:t[5],chainId:0};if(6===t.length)return n;try{n.v=i.O$.from(t[6]).toNumber()}catch(r){return n}if(n.r=(0,o.hexZeroPad)(t[7],32),n.s=(0,o.hexZeroPad)(t[8],32),i.O$.from(n.r).isZero()&&i.O$.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let i=n.v-27;const s=t.slice(0,6);0!==n.chainId&&(s.push((0,o.hexlify)(n.chainId)),s.push("0x"),s.push("0x"),i-=2*n.chainId+8);const c=(0,a.keccak256)(u.encode(s));try{n.from=v(c,{r:(0,o.hexlify)(n.r),s:(0,o.hexlify)(n.s),recoveryParam:i})}catch(r){}n.hash=(0,a.keccak256)(e)}return n.type=null,n}(t);switch(t[0]){case 1:return function(e){const t=u.decode(e.slice(1));8!==t.length&&11!==t.length&&f.throwArgumentError("invalid component count for transaction type: 1","payload",(0,o.hexlify)(e));const n={type:1,chainId:m(t[0]).toNumber(),nonce:m(t[1]).toNumber(),gasPrice:m(t[2]),gasLimit:m(t[3]),to:h(t[4]),value:m(t[5]),data:t[6],accessList:A(t[7])};return 8===t.length||(n.hash=(0,a.keccak256)(e),S(n,t.slice(8),k)),n}(t);case 2:return function(e){const t=u.decode(e.slice(1));9!==t.length&&12!==t.length&&f.throwArgumentError("invalid component count for transaction type: 2","payload",(0,o.hexlify)(e));const n=m(t[2]),r=m(t[3]),i={type:2,chainId:m(t[0]).toNumber(),nonce:m(t[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:m(t[4]),to:h(t[5]),value:m(t[6]),data:t[7],accessList:A(t[8])};return 9===t.length||(i.hash=(0,a.keccak256)(e),S(i,t.slice(9),_)),i}(t)}return f.throwError(`unsupported transaction type: ${t[0]}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},81202:function(e,t,n){"use strict";n.r(t),n.d(t,{commify:function(){return A},formatEther:function(){return k},formatUnits:function(){return E},parseEther:function(){return T},parseUnits:function(){return _}});var r=n(93667),i=n(85694),o=n(48794),s=n(2593);const a=new i.Yd(o.i),c={},u=s.O$.from(0),l=s.O$.from(-1);function d(e,t,n,r){const o={fault:t,operation:n};return void 0!==r&&(o.value=r),a.throwError(e,i.Yd.errors.NUMERIC_FAULT,o)}let f="0";for(;f.length<256;)f+=f;function p(e){if("number"!==typeof e)try{e=s.O$.from(e).toNumber()}catch(t){}return"number"===typeof e&&e>=0&&e<=256&&!(e%1)?"1"+f.substring(0,e):a.throwArgumentError("invalid decimal size","decimals",e)}function h(e,t){null==t&&(t=0);const n=p(t),r=(e=s.O$.from(e)).lt(u);r&&(e=e.mul(l));let i=e.mod(n).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",e);let o=i[0],c=i[1];for(o||(o="0"),c||(c="0");"0"===c[c.length-1];)c=c.substring(0,c.length-1);for(c.length>n.length-1&&d("fractional component exceeds decimals","underflow","parseFixed"),""===c&&(c="0");c.lengthnull==e[t]?r:(typeof e[t]!==n&&a.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new g(c,t,n,r)}}class y{constructor(e,t,n,r){e!==c&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(b.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(b.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&a.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=y.from("1"+f.substring(0,e),this.format),r=v.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&a.throwArgumentError("invalid byte width","width",e);const t=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,r.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return y.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||(0,s.Zm)(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),y.fromString(h(e,t),g.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=g.from(t),i=m(e,n.decimals);!n.signed&&i.lt(u)&&d("unsigned value cannot be negative","overflow","value",e);let o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=(0,r.hexZeroPad)(o,n.width/8));const s=h(i,n.decimals);return new y(c,o,s,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=g.from(t);if((0,r.arrayify)(e).length>n.width/8)throw new Error("overflow");let i=s.O$.from(e);n.signed&&(i=i.fromTwos(n.width));const o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=h(i,n.decimals);return new y(c,o,a,n)}static from(e,t){if("string"===typeof e)return y.fromString(e,t);if((0,r.isBytes)(e))return y.fromBytes(e,t);try{return y.fromValue(e,0,t)}catch(n){if(n.code!==i.Yd.errors.INVALID_ARGUMENT)throw n}return a.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const b=y.from(1),v=y.from("0.5");const w=new(n(168).Logger)("units/5.7.0"),x=["wei","kwei","mwei","gwei","szabo","finney","ether"];function A(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&w.throwArgumentError("invalid value","value",e);let n=t[0],r="";for("-"===n.substring(0,1)&&(r="-",n=n.substring(1));"0"===n.substring(0,1);)n=n.substring(1);""===n&&(n="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;n.length;){if(n.length<=3){o.unshift(n);break}{const e=n.length-3;o.unshift(n.substring(e)),n=n.substring(0,e)}}return r+o.join(",")+i}function E(e,t){if("string"===typeof t){const e=x.indexOf(t);-1!==e&&(t=3*e)}return h(e,null!=t?t:18)}function _(e,t){if("string"!==typeof e&&w.throwArgumentError("value must be a string","value",e),"string"===typeof t){const e=x.indexOf(t);-1!==e&&(t=3*e)}return m(e,null!=t?t:18)}function k(e){return E(e,18)}function T(e){return _(e,18)}},51880:function(e,t,n){"use strict";n.r(t),n.d(t,{_fetchData:function(){return h},fetchJson:function(){return m},poll:function(){return g}});var r=n(59567),i=n(93667),o=n(97208),s=n(84804),a=n(168);var c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};function u(e,t){return c(this,void 0,void 0,(function*(){null==t&&(t={});const n={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(n.mode=e.mode),e.cache&&(n.cache=e.cache),e.credentials&&(n.credentials=e.credentials),e.redirect&&(n.redirect=e.redirect),e.referrer&&(n.referrer=e.referrer)}const r=yield fetch(e,n),o=yield r.arrayBuffer(),s={};return r.headers.forEach?r.headers.forEach(((e,t)=>{s[t.toLowerCase()]=e})):r.headers.keys().forEach((e=>{s[e.toLowerCase()]=r.headers.get(e)})),{headers:s,statusCode:r.status,statusMessage:r.statusText,body:(0,i.arrayify)(new Uint8Array(o))}}))}var l=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const d=new a.Logger("web/5.7.1");function f(e){return new Promise((t=>{setTimeout(t,e)}))}function p(e,t){if(null==e)return null;if("string"===typeof e)return e;if((0,i.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,s.ZN)(e)}catch(n){}return(0,i.hexlify)(e)}return e}function h(e,t,n){const i="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;d.assertArgument(i>0&&i%1===0,"invalid connection throttle limit","connection.throttleLimit",i);const c="object"===typeof e?e.throttleCallback:null,h="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;d.assertArgument(h>0&&h%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",h);const m="object"===typeof e&&!!e.errorPassThrough,g={};let y=null;const b={method:"GET"};let v=!1,w=12e4;if("string"===typeof e)y=e;else if("object"===typeof e){if(null!=e&&null!=e.url||d.throwArgumentError("missing URL","connection.url",e),y=e.url,"number"===typeof e.timeout&&e.timeout>0&&(w=e.timeout),e.headers)for(const t in e.headers)g[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(v=!0);if(b.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==y.substring(0,6)&&!0!==e.allowInsecureAuthentication&&d.throwError("basic authentication requires a secure https url",a.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:y,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;g.authorization={key:"Authorization",value:"Basic "+(0,r.c)((0,s.Y0)(t))}}null!=e.skipFetchSetup&&(b.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(b.fetchOptions=(0,o.shallowCopy)(e.fetchOptions))}const x=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),A=y?y.match(x):null;if(A)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":A[1]||"text/plain"},body:A[2]?(0,r.J)(A[3]):(E=A[3],(0,s.Y0)(E.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return n&&(t=n(e.body,e)),Promise.resolve(t)}catch(S){d.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:p(A[1],A[2]),error:S,requestBody:null,requestMethod:"GET",url:y})}var E;t&&(b.method="POST",b.body=t,null==g["content-type"]&&(g["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==g["content-length"]&&(g["content-length"]={key:"Content-Length",value:String(t.length)}));const _={};Object.keys(g).forEach((e=>{const t=g[e];_[t.key]=t.value})),b.headers=_;const k=function(){let e=null;return{promise:new Promise((function(t,n){w&&(e=setTimeout((()=>{null!=e&&(e=null,n(d.makeError("timeout",a.Logger.errors.TIMEOUT,{requestBody:p(b.body,_["content-type"]),requestMethod:b.method,timeout:w,url:y})))}),w))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),T=function(){return l(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(k.cancel(),d.throwError("bad response",a.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:p(r,t.headers?t.headers["content-type"]:null),requestBody:p(b.body,_["content-type"]),requestMethod:b.method,url:y})),n)try{const e=yield n(r,t);return k.cancel(),e}catch(S){if(S.throttleRetry&&e"content-type"===e.toLowerCase())).length||(n.headers=(0,o.shallowCopy)(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return h(e,r,((e,t)=>{let r=null;if(null!=e)try{r=JSON.parse((0,s.ZN)(e))}catch(i){d.throwError("invalid JSON",a.Logger.errors.SERVER_ERROR,{body:e,error:i})}return n&&(r=n(r,t)),r}))}function g(e,t){return t||(t={}),null==(t=(0,o.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(n,r){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{s()&&r(new Error("timeout"))}),t.timeout));const a=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)s()&&n(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>a)return void(s()&&r(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){s()&&r(e)}))}()}))}},41257:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(94083).Buffer}catch(C){}function a(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,n,i){for(var o=0,s=0,a=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,s=o%r,a=Math.min(o,o-s)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(C){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?""}var f=["","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"],p=[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],h=[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];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?f[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=p[e],l=h[e];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(l).toString(e);n=(d=d.idivn(l)).isZero()?m+n:f[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;n.words[0]=a;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=f;p++){var h=u-p|0;l+=(s=(i=0|e.words[h])*(o=0|t.words[p])+d)/67108864|0,d=67108863&s}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(e[n--]=s>>8&255),n>=0&&(e[n--]=s>>16&255),6===o?(n>=0&&(e[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,p=0|s[1],h=8191&p,m=p>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,A=0|s[4],E=8191&A,_=A>>>13,k=0|s[5],T=8191&k,S=k>>>13,C=0|s[6],I=8191&C,O=C>>>13,R=0|s[7],D=8191&R,P=R>>>13,B=0|s[8],M=8191&B,N=B>>>13,F=0|s[9],L=8191&F,j=F>>>13,U=0|a[0],Z=8191&U,H=U>>>13,z=0|a[1],G=8191&z,V=z>>>13,W=0|a[2],q=8191&W,$=W>>>13,K=0|a[3],Y=8191&K,X=K>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],ne=8191&te,re=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,pe=0|a[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(d,Z))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,Z)|0))<<13)|0;u=((o=Math.imul(f,H))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,H))+Math.imul(m,Z)|0,o=Math.imul(m,H);var ye=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,H))+Math.imul(b,Z)|0,o=Math.imul(b,H),r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0;var be=(u+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,H))+Math.imul(x,Z)|0,o=Math.imul(x,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,V)|0,r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0;var ve=(u+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(E,Z),i=(i=Math.imul(E,H))+Math.imul(_,Z)|0,o=Math.imul(_,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,$)|0,r=r+Math.imul(h,Y)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,X)|0;var we=(u+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,H))+Math.imul(S,Z)|0,o=Math.imul(S,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,$)|0,r=r+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,X)|0,r=r+Math.imul(h,Q)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var xe=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(I,Z),i=(i=Math.imul(I,H))+Math.imul(O,Z)|0,o=Math.imul(O,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,X)|0,r=r+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(u+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,H))+Math.imul(P,Z)|0,o=Math.imul(P,H),r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Ee=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,H))+Math.imul(N,Z)|0,o=Math.imul(N,H),r=r+Math.imul(D,G)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,r=r+Math.imul(h,ce)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var _e=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,H))+Math.imul(j,Z)|0,o=Math.imul(j,H),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(D,q)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,r=r+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var ke=(u+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,he)|0))<<13)|0;u=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(j,G)|0,o=Math.imul(j,V),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,r=r+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var Te=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,$))+Math.imul(j,q)|0,o=Math.imul(j,$),r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Se=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,Y),i=(i=Math.imul(L,X))+Math.imul(j,Y)|0,o=Math.imul(j,X),r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(D,ne)|0,i=(i=i+Math.imul(D,re)|0)+Math.imul(P,ne)|0,o=o+Math.imul(P,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var Ce=(u+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,r=r+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ie=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(_,he)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(j,ne)|0,o=Math.imul(j,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,r=r+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,fe)|0;var Oe=(u+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,oe),i=(i=Math.imul(L,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,r=r+Math.imul(D,de)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Re=(u+(r=r+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(O,he)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,ce),i=(i=Math.imul(L,ue))+Math.imul(j,ce)|0,o=Math.imul(j,ue),r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var De=(u+(r=r+Math.imul(D,he)|0)|0)+((8191&(i=(i=i+Math.imul(D,me)|0)+Math.imul(P,he)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,fe))+Math.imul(j,de)|0,o=Math.imul(j,fe);var Pe=(u+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(N,he)|0))<<13)|0;u=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Be=(u+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(j,he)|0))<<13)|0;return u=((o=Math.imul(j,me))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ae,c[7]=Ee,c[8]=_e,c[9]=ke,c[10]=Te,c[11]=Se,c[12]=Ce,c[13]=Ie,c[14]=Oe,c[15]=Re,c[16]=De,c[17]=Pe,c[18]=Be,0!==u&&(c[19]=u,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function b(e,t,n){return y(e,t,n)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=m),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?m(this,e,t):n<1024?y(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},v.prototype.permute=function(e,t,n,r,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,s=0|i.words[i.length-1];0!==(n=26-this._countBits(s))&&(i=i.ushln(n),r.iushln(n),s=0|i.words[i.length-1]);var a,c=r.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);a&&(a.words[d]=f)}return a&&a._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new T(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(A,x),A.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return w[e]=t,t},T.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=s;0!==p.cmp(a);){for(var m=p,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===r&&0===l)&&(i=this.mul(i,n[s]),a=0,s=0)):a=0}c=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,T),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},47796:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var s=n(83893);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return s.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return s.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return s.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return s.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return s.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return s.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return s.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return s.TransactionDescription}});var a=n(66379);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var c=o(n(4089));t.base64=c;var u=n(14694);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return u.Base58}});var l=n(93667);Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return l.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return l.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return l.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return l.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return l.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return l.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return l.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return l.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return l.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return l.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return l.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return l.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return l.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return l.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return l.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return l.stripZeros}});var d=n(25385);Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return d._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return d.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return d.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return d.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return d.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return d.namehash}});var f=n(4682);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return f.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return f.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return f.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return f.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return f.mnemonicToSeed}});var p=n(72294);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return p.getJsonWalletAddress}});var h=n(88017);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var m=n(168);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return m.Logger}});var g=n(8894);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return g.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return g.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return g.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return g.sha512}});var y=n(67996);Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return y.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return y.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return y.sha256}});var b=n(52989);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return b.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return b.shuffled}});var v=n(97208);Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return v.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return v.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return v.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return v.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return v.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return v.shallowCopy}});var w=o(n(66906));t.RLP=w;var x=n(70184);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return x.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return x.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return x.SigningKey}});var A=n(20510);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var E=n(60561);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return E.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return E.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return E.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return E.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return E.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return E.TransactionTypes}});var _=n(81202);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return _.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return _.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return _.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return _.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return _.parseUnits}});var k=n(18940);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return k.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return k.verifyTypedData}});var T=n(51880);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return T._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return T.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return T.poll}});var S=n(8894);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return S.SupportedAlgorithm}});var C=n(20510);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return C.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return C.Utf8ErrorReason}})},62863:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});const r="ethers/5.5.4"},91023:function(e,t,n){"use strict";n.r(t),n.d(t,{Signer:function(){return s.E},Wallet:function(){return a.Wallet},VoidSigner:function(){return s.b},getDefaultProvider:function(){return u.getDefaultProvider},providers:function(){return u},BaseContract:function(){return r.VZ},Contract:function(){return r.CH},ContractFactory:function(){return r.lV},BigNumber:function(){return i.O$},FixedNumber:function(){return o.xs},constants:function(){return c},errors:function(){return p.ErrorCode},logger:function(){return m},utils:function(){return f},wordlists:function(){return l.E},version:function(){return h.i},Wordlist:function(){return d.D}});var r=n(11466),i=n(91747),o=n(43698),s=n(64758),a=n(81502),c=n(21815),u=n(24946),l=n(10234),d=n(48812),f=n(86494),p=n(1581),h=n(62863);const m=new p.Logger(h.i)},86623:function(e,t,n){"use strict";n.r(t),n.d(t,{ethers:function(){return r},Signer:function(){return i.E},Wallet:function(){return o.Wallet},VoidSigner:function(){return i.b},getDefaultProvider:function(){return s.getDefaultProvider},providers:function(){return s},BaseContract:function(){return a.VZ},Contract:function(){return a.CH},ContractFactory:function(){return a.lV},BigNumber:function(){return c.O$},FixedNumber:function(){return u.xs},constants:function(){return l},errors:function(){return d.ErrorCode},logger:function(){return r.logger},utils:function(){return f},wordlists:function(){return p.E},version:function(){return h.i},Wordlist:function(){return m.D}});var r=n(91023),i=n(64758),o=n(81502),s=n(24946),a=n(11466),c=n(91747),u=n(43698),l=n(21815),d=n(1581),f=n(86494),p=n(10234),h=n(62863),m=n(48812);try{const e=window;null==e._ethers&&(e._ethers=r)}catch(g){}},86494:function(e,t,n){"use strict";n.r(t),n.d(t,{AbiCoder:function(){return r.R},defaultAbiCoder:function(){return r.$},Fragment:function(){return i.HY},ConstructorFragment:function(){return i.Xg},ErrorFragment:function(){return i.IC},EventFragment:function(){return i.QV},FunctionFragment:function(){return i.YW},ParamType:function(){return i._R},FormatTypes:function(){return i.pc},checkResultErrors:function(){return o.BR},Logger:function(){return b.Logger},RLP:function(){return _},_fetchData:function(){return D._fetchData},fetchJson:function(){return D.fetchJson},poll:function(){return D.poll},checkProperties:function(){return E.checkProperties},deepCopy:function(){return E.deepCopy},defineReadOnly:function(){return E.defineReadOnly},getStatic:function(){return E.getStatic},resolveProperties:function(){return E.resolveProperties},shallowCopy:function(){return E.shallowCopy},arrayify:function(){return l.arrayify},concat:function(){return l.concat},stripZeros:function(){return l.stripZeros},zeroPad:function(){return l.zeroPad},isBytes:function(){return l.isBytes},isBytesLike:function(){return l.isBytesLike},defaultPath:function(){return m.defaultPath},HDNode:function(){return m.HDNode},SigningKey:function(){return k.SigningKey},Interface:function(){return s.vU},LogDescription:function(){return s.CC},TransactionDescription:function(){return s.vk},base58:function(){return u.Base58},base64:function(){return c},hexlify:function(){return l.hexlify},isHexString:function(){return l.isHexString},hexConcat:function(){return l.hexConcat},hexStripZeros:function(){return l.hexStripZeros},hexValue:function(){return l.hexValue},hexZeroPad:function(){return l.hexZeroPad},hexDataLength:function(){return l.hexDataLength},hexDataSlice:function(){return l.hexDataSlice},nameprep:function(){return T.Ll},_toEscapedUtf8String:function(){return S.U$},toUtf8Bytes:function(){return S.Y0},toUtf8CodePoints:function(){return S.XL},toUtf8String:function(){return S.ZN},Utf8ErrorFuncs:function(){return S.te},formatBytes32String:function(){return C.s},parseBytes32String:function(){return C.F},hashMessage:function(){return d.r},namehash:function(){return f.V},isValidName:function(){return f.r},id:function(){return p.id},_TypedDataEncoder:function(){return h.E},getAddress:function(){return a.getAddress},getIcapAddress:function(){return a.getIcapAddress},getContractAddress:function(){return a.getContractAddress},getCreate2Address:function(){return a.getCreate2Address},isAddress:function(){return a.isAddress},formatEther:function(){return O.formatEther},parseEther:function(){return O.parseEther},formatUnits:function(){return O.formatUnits},parseUnits:function(){return O.parseUnits},commify:function(){return O.commify},computeHmac:function(){return v.Gy},keccak256:function(){return y.keccak256},ripemd160:function(){return v.bP},sha256:function(){return v.JQ},sha512:function(){return v.o},randomBytes:function(){return x.O},shuffled:function(){return A.y},solidityPack:function(){return w.pack},solidityKeccak256:function(){return w.keccak256},soliditySha256:function(){return w.sha256},splitSignature:function(){return l.splitSignature},joinSignature:function(){return l.joinSignature},accessListify:function(){return I.accessListify},parseTransaction:function(){return I.parse},serializeTransaction:function(){return I.serialize},TransactionTypes:function(){return I.TransactionTypes},getJsonWalletAddress:function(){return g.Rb},computeAddress:function(){return I.computeAddress},recoverAddress:function(){return I.recoverAddress},computePublicKey:function(){return k.computePublicKey},recoverPublicKey:function(){return k.recoverPublicKey},verifyMessage:function(){return R.verifyMessage},verifyTypedData:function(){return R.verifyTypedData},getAccountPath:function(){return m.getAccountPath},mnemonicToEntropy:function(){return m.mnemonicToEntropy},entropyToMnemonic:function(){return m.entropyToMnemonic},isValidMnemonic:function(){return m.isValidMnemonic},mnemonicToSeed:function(){return m.mnemonicToSeed},SupportedAlgorithm:function(){return P.p},UnicodeNormalizationForm:function(){return S.Uj},Utf8ErrorReason:function(){return S.Uw},Indexed:function(){return s.Hk}});var r=n(69820),i=n(23034),o=n(67072),s=n(39786),a=n(46126),c=n(58037),u=n(10692),l=n(45703),d=n(93684),f=n(84706),p=n(32046),h=n(34120),m=n(84204),g=n(67949),y=n(9341),b=n(1581),v=n(90229),w=n(46352),x=n(66869),A=n(52472),E=n(6881),_=n(48644),k=n(43705),T=n(35637),S=n(29251),C=n(86237),I=n(3451),O=n(59386),R=n(81502),D=n(98580),P=n(21261)},56371:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.parseBytes32String=void 0;var s=n(80801);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return s.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return s.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return s.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return s.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return s.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return s.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return s.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return s.TransactionDescription}});var a=n(46126);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var c=o(n(58037));t.base64=c;var u=n(10692);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return u.Base58}});var l=n(45703);Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return l.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return l.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return l.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return l.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return l.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return l.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return l.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return l.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return l.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return l.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return l.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return l.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return l.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return l.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return l.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return l.stripZeros}});var d=n(75931);Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return d._TypedDataEncoder}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return d.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return d.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return d.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return d.namehash}});var f=n(84204);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return f.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return f.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return f.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return f.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return f.mnemonicToSeed}});var p=n(64341);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return p.getJsonWalletAddress}});var h=n(9341);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var m=n(1581);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return m.Logger}});var g=n(91278);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return g.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return g.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return g.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return g.sha512}});var y=n(46352);Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return y.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return y.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return y.sha256}});var b=n(22118);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return b.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return b.shuffled}});var v=n(6881);Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return v.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return v.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return v.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return v.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return v.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return v.shallowCopy}});var w=o(n(48644));t.RLP=w;var x=n(43705);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return x.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return x.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return x.SigningKey}});var A=n(62741);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var E=n(3451);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return E.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return E.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return E.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return E.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return E.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return E.TransactionTypes}});var _=n(59386);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return _.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return _.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return _.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return _.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return _.parseUnits}});var k=n(81502);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return k.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return k.verifyTypedData}});var T=n(98580);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return T._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return T.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return T.poll}});var S=n(91278);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return S.SupportedAlgorithm}});var C=n(62741);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return C.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return C.Utf8ErrorReason}})},79048:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});const r="abi/5.5.0"},69820:function(e,t,n){"use strict";n.d(t,{R:function(){return O},$:function(){return R}});var r=n(45703),i=n(6881),o=n(1581),s=n(79048),a=n(67072),c=n(46126);class u extends a.XI{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=(0,c.getAddress)(t)}catch(n){this._throwError(n.message,t)}return e.writeValue(t)}decode(e){return(0,c.getAddress)((0,r.hexZeroPad)(e.readValue().toHexString(),20))}}class l extends a.XI{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const d=new o.Logger(s.i);function f(e,t,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"===typeof n){let e={};r=t.map((t=>{const r=t.localName;return r||d.throwError("cannot encode object for signature with missing names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]&&d.throwError("cannot encode object for signature with duplicate names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]=!0,n[r]}))}else d.throwArgumentError("invalid tuple value","tuple",n);t.length!==r.length&&d.throwArgumentError("types/value length mismatch","tuple",n);let i=new a.QV(e.wordSize),s=new a.QV(e.wordSize),c=[];t.forEach(((e,t)=>{let n=r[t];if(e.dynamic){let t=s.length;e.encode(s,n);let r=i.writeUpdatableValue();c.push((e=>{r(e+t)}))}else e.encode(i,n)})),c.forEach((e=>{e(i.length)}));let u=e.appendWriter(i);return u+=e.appendWriter(s),u}function p(e,t){let n=[],r=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let n=e.readValue(),a=r.subReader(n.toNumber());try{i=t.decode(a)}catch(s){if(s.code===o.Logger.errors.BUFFER_OVERRUN)throw s;i=s,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(s){if(s.code===o.Logger.errors.BUFFER_OVERRUN)throw s;i=s,i.baseType=t.name,i.name=t.localName,i.type=t.type}void 0!=i&&n.push(i)}));const i=t.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach(((e,t)=>{let r=e.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[t];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let o=0;o{throw e}})}return Object.freeze(n)}class h extends a.XI{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;ne._data.length&&d.throwError("insufficient data length",o.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let r=0;r{e.dynamic&&(n=!0),r.push(e.type)}));super("tuple","tuple("+r.join(",")+")",t,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[r]))})),Object.freeze(e)}encode(e,t){return f(e,this.coders,t)}decode(e){return e.coerce(this.name,p(e,this.coders))}}var T=n(23034);const S=new o.Logger(s.i),C=new RegExp(/^bytes([0-9]*)$/),I=new RegExp(/^(u?int)([0-9]*)$/);class O{constructor(e){S.checkNew(new.target,O),(0,i.defineReadOnly)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new u(e.name);case"bool":return new m(e.name);case"string":return new _(e.name);case"bytes":return new y(e.name);case"array":return new h(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new k((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new v(e.name)}let t=e.type.match(I);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!==0)&&S.throwArgumentError("invalid "+t[1]+" bit length","param",e),new A(n/8,"int"===t[1],e.name)}if(t=e.type.match(C),t){let n=parseInt(t[1]);return(0===n||n>32)&&S.throwArgumentError("invalid bytes length","param",e),new b(n,e.name)}return S.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new a.Ej(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new a.QV(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(T._R.from(e))));return new k(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&S.throwError("types/values length mismatch",o.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(T._R.from(e)))),r=new k(n,"_"),i=this._getWriter();return r.encode(i,t),i.data}decode(e,t,n){const i=e.map((e=>this._getCoder(T._R.from(e))));return new k(i,"_").decode(this._getReader((0,r.arrayify)(t),n))}}const R=new O},67072:function(e,t,n){"use strict";n.d(t,{BR:function(){return u},XI:function(){return l},QV:function(){return d},Ej:function(){return f}});var r=n(45703),i=n(91747),o=n(6881),s=n(1581),a=n(79048);const c=new s.Logger(a.i);function u(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let o in r){const s=e.slice();s.push(o);try{n(s,r[o])}catch(i){t.push({path:s,error:i})}}};return n([],e),t}class l{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){c.throwArgumentError(e,this.localName,t)}}class d{constructor(e){(0,o.defineReadOnly)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,r.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,r.concat)(e._data))}writeBytes(e){let t=(0,r.arrayify)(e);const n=t.length%this.wordSize;return n&&(t=(0,r.concat)([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=(0,r.arrayify)(i.O$.from(e));return t.length>this.wordSize&&c.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,r.concat)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class f{constructor(e,t,n,i){(0,o.defineReadOnly)(this,"_data",(0,r.arrayify)(e)),(0,o.defineReadOnly)(this,"wordSize",t||32),(0,o.defineReadOnly)(this,"_coerceFunc",n),(0,o.defineReadOnly)(this,"allowLoose",i),this._offset=0}get data(){return(0,r.hexlify)(this._data)}get consumed(){return this._offset}static coerce(e,t){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):f.coerce(e,t)}_peekBytes(e,t,n){let r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&n&&this._offset+t<=this._data.length?r=t:c.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}subReader(e){return new f(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let n=this._peekBytes(0,e,!!t);return this._offset+=n.length,n.slice(0,e)}readValue(){return i.O$.from(this.readBytes(this.wordSize))}}},23034:function(e,t,n){"use strict";n.d(t,{pc:function(){return p},_R:function(){return m},HY:function(){return y},QV:function(){return b},Xg:function(){return A},YW:function(){return E},IC:function(){return k}});var r=n(91747),i=n(6881),o=n(1581),s=n(79048);const a=new o.Logger(s.i),c={};let u={calldata:!0,memory:!0,storage:!0},l={calldata:!0,memory:!0};function d(e,t){if("bytes"===e||"string"===e){if(u[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&l[t])return!0;return(u[t]||"payable"===t)&&a.throwArgumentError("invalid modifier","name",t),!1}function f(e,t){for(let n in t)(0,i.defineReadOnly)(e,n,t[n])}const p=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),h=new RegExp(/^(.*)\[([0-9]*)\]$/);class m{constructor(e,t){e!==c&&a.throwError("use fromString",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),f(this,t);let n=this.type.match(h);f(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:m.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==p.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===p.full?", ":",")+")"):t+=this.type,e!==p.sighash&&(!0===this.indexed&&(t+=" indexed"),e===p.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"===typeof e?m.fromString(e,t):m.fromObject(e)}static fromObject(e){return m.isParamType(e)?e:new m(c,{name:e.name||null,type:T(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(m.fromObject):null})}static fromString(e,t){return function(e){return m.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}(function(e,t){let n=e;function r(t){a.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let a=0;am.fromString(e,t)))}class y{constructor(e,t){e!==c&&a.throwError("use a static from method",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),f(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return y.isFragment(e)?e:"string"===typeof e?y.fromString(e):y.fromObject(e)}static fromObject(e){if(y.isFragment(e))return e;switch(e.type){case"function":return E.fromObject(e);case"event":return b.fromObject(e);case"constructor":return A.fromObject(e);case"error":return k.fromObject(e);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?b.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?E.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?A.fromString(e.trim()):"error"===e.split(" ")[0]?k.fromString(e.substring(5).trim()):a.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class b extends y{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==p.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ",e!==p.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"===typeof e?b.fromString(e):b.fromObject(e)}static fromObject(e){if(b.isEventFragment(e))return e;"event"!==e.type&&a.throwArgumentError("invalid event object","value",e);const t={name:C(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(m.fromObject):[],type:"event"};return new b(c,t)}static fromString(e){let t=e.match(I);t||a.throwArgumentError("invalid event string","value",e);let n=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:a.warn("unknown modifier: "+e)}})),b.fromObject({name:t[1].trim(),anonymous:n,inputs:g(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function v(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=r.O$.from(n[1]),n[0]):e}function w(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function x(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&a.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&a.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||a.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&a.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&a.throwArgumentError("unable to determine stateMutability","value",e),t}class A extends y{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===p.sighash&&a.throwError("cannot format a constructor for sighash",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"===typeof e?A.fromString(e):A.fromObject(e)}static fromObject(e){if(A.isConstructorFragment(e))return e;"constructor"!==e.type&&a.throwArgumentError("invalid constructor object","value",e);let t=x(e);t.constant&&a.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(m.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?r.O$.from(e.gas):null};return new A(c,n)}static fromString(e){let t={type:"constructor"},n=(e=v(e,t)).match(I);return n&&"constructor"===n[1].trim()||a.throwArgumentError("invalid constructor string","value",e),t.inputs=g(n[2].trim(),!1),w(n[3].trim(),t),A.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class E extends A{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==p.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ",e!==p.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"===typeof e?E.fromString(e):E.fromObject(e)}static fromObject(e){if(E.isFunctionFragment(e))return e;"function"!==e.type&&a.throwArgumentError("invalid function object","value",e);let t=x(e);const n={type:e.type,name:C(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(m.fromObject):[],outputs:e.outputs?e.outputs.map(m.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?r.O$.from(e.gas):null};return new E(c,n)}static fromString(e){let t={type:"function"},n=(e=v(e,t)).split(" returns ");n.length>2&&a.throwArgumentError("invalid function string","value",e);let r=n[0].match(I);if(r||a.throwArgumentError("invalid function signature","value",e),t.name=r[1].trim(),t.name&&C(t.name),t.inputs=g(r[2],!1),w(r[3].trim(),t),n.length>1){let r=n[1].match(I);""==r[1].trim()&&""==r[3].trim()||a.throwArgumentError("unexpected tokens","value",e),t.outputs=g(r[2],!1)}else t.outputs=[];return E.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function _(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||a.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class k extends y{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==p.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ",t.trim()}static from(e){return"string"===typeof e?k.fromString(e):k.fromObject(e)}static fromObject(e){if(k.isErrorFragment(e))return e;"error"!==e.type&&a.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:C(e.name),inputs:e.inputs?e.inputs.map(m.fromObject):[]};return _(new k(c,t))}static fromString(e){let t={type:"error"},n=e.match(I);return n||a.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&C(t.name),t.inputs=g(n[2],!1),_(k.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function T(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const S=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function C(e){return e&&e.match(S)||a.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const I=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},80801:function(e,t,n){"use strict";n.r(t),n.d(t,{ConstructorFragment:function(){return r.Xg},ErrorFragment:function(){return r.IC},EventFragment:function(){return r.QV},Fragment:function(){return r.HY},FunctionFragment:function(){return r.YW},ParamType:function(){return r._R},FormatTypes:function(){return r.pc},AbiCoder:function(){return i.R},defaultAbiCoder:function(){return i.$},Interface:function(){return o.vU},Indexed:function(){return o.Hk},checkResultErrors:function(){return s.BR},LogDescription:function(){return o.CC},TransactionDescription:function(){return o.vk}});var r=n(23034),i=n(69820),o=n(39786),s=n(67072)},39786:function(e,t,n){"use strict";n.d(t,{CC:function(){return h},vk:function(){return m},Hk:function(){return y},vU:function(){return w}});var r=n(46126),i=n(91747),o=n(45703),s=n(32046),a=n(9341),c=n(6881),u=n(69820),l=n(23034),d=n(1581),f=n(79048);const p=new d.Logger(f.i);class h extends c.Description{}class m extends c.Description{}class g extends c.Description{}class y extends c.Description{static isIndexed(e){return!(!e||!e._isIndexed)}}const b={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function v(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return n.error=t,n}class w{constructor(e){p.checkNew(new.target,w);let t=[];t="string"===typeof e?JSON.parse(e):e,(0,c.defineReadOnly)(this,"fragments",t.map((e=>l.HY.from(e))).filter((e=>null!=e))),(0,c.defineReadOnly)(this,"_abiCoder",(0,c.getStatic)(new.target,"getAbiCoder")()),(0,c.defineReadOnly)(this,"functions",{}),(0,c.defineReadOnly)(this,"errors",{}),(0,c.defineReadOnly)(this,"events",{}),(0,c.defineReadOnly)(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void p.warn("duplicate definition - constructor"):void(0,c.defineReadOnly)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let n=e.format();t[n]?p.warn("duplicate definition - "+n):t[n]=e})),this.deploy||(0,c.defineReadOnly)(this,"deploy",l.Xg.from({payable:!1,type:"constructor"})),(0,c.defineReadOnly)(this,"_isInterface",!0)}format(e){e||(e=l.pc.full),e===l.pc.sighash&&p.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===l.pc.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return u.$}static getAddress(e){return(0,r.getAddress)(e)}static getSighash(e){return(0,o.hexDataSlice)((0,s.id)(e.format()),0,4)}static getEventTopic(e){return(0,s.id)(e.format())}getFunction(e){if((0,o.isHexString)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];p.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===n.length?p.throwArgumentError("no matching function","name",t):n.length>1&&p.throwArgumentError("multiple matching functions","name",t),this.functions[n[0]]}const t=this.functions[l.YW.fromString(e).format()];return t||p.throwArgumentError("no matching function","signature",e),t}getEvent(e){if((0,o.isHexString)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];p.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===n.length?p.throwArgumentError("no matching event","name",t):n.length>1&&p.throwArgumentError("multiple matching events","name",t),this.events[n[0]]}const t=this.events[l.QV.fromString(e).format()];return t||p.throwArgumentError("no matching event","signature",e),t}getError(e){if((0,o.isHexString)(e)){const t=(0,c.getStatic)(this.constructor,"getSighash");for(const n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}p.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===n.length?p.throwArgumentError("no matching error","name",t):n.length>1&&p.throwArgumentError("multiple matching errors","name",t),this.errors[n[0]]}const t=this.errors[l.YW.fromString(e).format()];return t||p.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"===typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(n){throw t}}return(0,c.getStatic)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"===typeof e&&(e=this.getEvent(e)),(0,c.getStatic)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"===typeof e&&(e=this.getError(e));const n=(0,o.arrayify)(t);return(0,o.hexlify)(n.slice(0,4))!==this.getSighash(e)&&p.throwArgumentError(`data signature does not match error ${e.name}.`,"data",(0,o.hexlify)(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,t){return"string"===typeof e&&(e=this.getError(e)),(0,o.hexlify)((0,o.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"===typeof e&&(e=this.getFunction(e));const n=(0,o.arrayify)(t);return(0,o.hexlify)(n.slice(0,4))!==this.getSighash(e)&&p.throwArgumentError(`data signature does not match function ${e.name}.`,"data",(0,o.hexlify)(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,o.hexlify)((0,o.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"===typeof e&&(e=this.getFunction(e));let n=(0,o.arrayify)(t),r=null,i=null,s=null,a=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch(c){}break;case 4:{const e=(0,o.hexlify)(n.slice(0,4)),t=b[e];if(t)i=this._abiCoder.decode(t.inputs,n.slice(4)),s=t.name,a=t.signature,t.reason&&(r=i[0]);else try{const t=this.getError(e);i=this._abiCoder.decode(t.inputs,n.slice(4)),s=t.name,a=t.format()}catch(c){console.log(c)}break}}return p.throwError("call revert exception",d.Logger.errors.CALL_EXCEPTION,{method:e.format(),errorArgs:i,errorName:s,errorSignature:a,reason:r})}encodeFunctionResult(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,o.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&p.throwError("too many arguments for "+e.format(),d.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let n=[];e.anonymous||n.push(this.getEventTopic(e));const r=(e,t)=>"string"===e.type?(0,s.id)(t):"bytes"===e.type?(0,a.keccak256)((0,o.hexlify)(t)):("address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,o.hexZeroPad)((0,o.hexlify)(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?p.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((e=>r(o,e)))):n.push(r(o,t)):null!=t&&p.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(e,t){"string"===typeof e&&(e=this.getEvent(e));const n=[],r=[],i=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&p.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const c=t[o];if(e.indexed)if("string"===e.type)n.push((0,s.id)(c));else if("bytes"===e.type)n.push((0,a.keccak256)(c));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([e.type],[c]))}else r.push(e),i.push(c)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(e,t,n){if("string"===typeof e&&(e=this.getEvent(e)),null!=n&&!e.anonymous){let t=this.getEventTopic(e);(0,o.isHexString)(n[0],32)&&n[0].toLowerCase()===t||p.throwError("fragment/topic mismatch",d.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:n[0]}),n=n.slice(1)}let r=[],i=[],s=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(r.push(l._R.fromObject({type:"bytes32",name:e.name})),s.push(!0)):(r.push(e),s.push(!1)):(i.push(e),s.push(!1))}));let a=null!=n?this._abiCoder.decode(r,(0,o.concat)(n)):null,c=this._abiCoder.decode(i,t,!0),u=[],f=0,h=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)u[t]=new y({_isIndexed:!0,hash:null});else if(s[t])u[t]=new y({_isIndexed:!0,hash:a[h++]});else try{u[t]=a[h++]}catch(n){u[t]=n}else try{u[t]=c[f++]}catch(n){u[t]=n}if(e.name&&null==u[e.name]){const n=u[t];n instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:()=>{throw v(`property ${JSON.stringify(e.name)}`,n)}}):u[e.name]=n}}));for(let o=0;o{throw v(`index ${o}`,e)}})}return Object.freeze(u)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new m({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:i.O$.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new h({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=(0,o.hexlify)(e);let n=this.getError(t.substring(0,10).toLowerCase());return n?new g({args:this._abiCoder.decode(n.inputs,"0x"+t.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!(!e||!e._isInterface)}}},64758:function(e,t,n){"use strict";n.d(t,{E:function(){return u},b:function(){return l}});var r=n(6881),i=n(1581);var o=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const s=new i.Logger("abstract-signer/5.5.0"),a=["accessList","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],c=[i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED];class u{constructor(){s.checkAbstract(new.target,u),(0,r.defineReadOnly)(this,"_isSigner",!0)}getBalance(e){return o(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return o(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return o(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield(0,r.resolveProperties)(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return o(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield(0,r.resolveProperties)(this.checkTransaction(e));return yield this.provider.call(n,t)}))}sendTransaction(e){return o(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),n=yield this.signTransaction(t);return yield this.provider.sendTransaction(n)}))}getChainId(){return o(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return o(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return o(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return o(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const n in e)-1===a.indexOf(n)&&s.throwArgumentError("invalid transaction key: "+n,"transaction",e);const t=(0,r.shallowCopy)(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&s.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return o(this,void 0,void 0,(function*(){const t=yield(0,r.resolveProperties)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>o(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&s.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const n=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!n?0!==t.type&&1!==t.type||!n||s.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):s.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(n&&s.throwError("network does not support EIP-1559",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):s.throwError("failed to get consistent fee data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(c.indexOf(e.code)>=0)throw e;return s.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&s.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield(0,r.resolveProperties)(t)}))}_checkProvider(e){this.provider||s.throwError("missing provider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class l extends u{constructor(e,t){s.checkNew(new.target,l),super(),(0,r.defineReadOnly)(this,"address",e),(0,r.defineReadOnly)(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{s.throwError(e,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new l(this.address,e)}}},46126:function(e,t,n){"use strict";n.r(t),n.d(t,{getAddress:function(){return p},getContractAddress:function(){return g},getCreate2Address:function(){return y},getIcapAddress:function(){return m},isAddress:function(){return h}});var r=n(45703),i=n(91747),o=n(9341),s=n(48644);const a=new(n(1581).Logger)("address/5.5.0");function c(e){(0,r.isHexString)(e,20)||a.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let r=0;r<40;r++)n[r]=t[r].charCodeAt(0);const i=(0,r.arrayify)((0,o.keccak256)(n));for(let r=0;r<40;r+=2)i[r>>1]>>4>=8&&(t[r]=t[r].toUpperCase()),(15&i[r>>1])>=8&&(t[r+1]=t[r+1].toUpperCase());return"0x"+t.join("")}const u={};for(let b=0;b<10;b++)u[String(b)]=String(b);for(let b=0;b<26;b++)u[String.fromCharCode(65+b)]=String(10+b);const l=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/Math.LN10));var d;function f(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>u[e])).join("");for(;t.length>=l;){let e=t.substring(0,l);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}function p(e){let t=null;if("string"!==typeof e&&a.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=c(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&a.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==f(e)&&a.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=c("0x"+t)}else a.throwArgumentError("invalid address","address",e);return t}function h(e){try{return p(e),!0}catch(t){}return!1}function m(e){let t=(0,i.t2)(p(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+f("XE00"+t)+t}function g(e){let t=null;try{t=p(e.from)}catch(c){a.throwArgumentError("missing from address","transaction",e)}const n=(0,r.stripZeros)((0,r.arrayify)(i.O$.from(e.nonce).toHexString()));return p((0,r.hexDataSlice)((0,o.keccak256)((0,s.encode)([t,n])),12))}function y(e,t,n){return 32!==(0,r.hexDataLength)(t)&&a.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,r.hexDataLength)(n)&&a.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",n),p((0,r.hexDataSlice)((0,o.keccak256)((0,r.concat)(["0xff",p(e),t,n])),12))}},58037:function(e,t,n){"use strict";n.r(t),n.d(t,{decode:function(){return i},encode:function(){return o}});var r=n(45703);function i(e){e=atob(e);const t=[];for(let n=0;n0&&(10===arguments[0]?p||(p=!0,u.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?u.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):u.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),y(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof h)return e;if("string"===typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new h(l,m(e)):e.match(/^-?[0-9]+$/)?new h(l,m(new c(e))):u.throwArgumentError("invalid BigNumber string","value",e);if("number"===typeof e)return e%1&&b("underflow","BigNumber.from",e),(e>=d||e<=-d)&&b("overflow","BigNumber.from",e),h.from(String(e));const t=e;if("bigint"===typeof t)return h.from(t.toString());if((0,o.isBytes)(t))return h.from((0,o.hexlify)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"===typeof e)return h.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"===typeof e&&((0,o.isHexString)(e)||"-"===e[0]&&(0,o.isHexString)(e.substring(1))))return h.from(e)}return u.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function m(e){if("string"!==typeof e)return m(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&u.throwArgumentError("invalid hex","value",e),"0x00"===(e=m(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function g(e){return h.from(m(e))}function y(e){const t=h.from(e).toHexString();return"-"===t[0]?new c("-"+t.substring(3),16):new c(t.substring(2),16)}function b(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),u.throwError(e,s.Logger.errors.NUMERIC_FAULT,r)}function v(e){return new c(e,36).toString(16)}function w(e){return new c(e,16).toString(36)}},43698:function(e,t,n){"use strict";n.d(t,{xs:function(){return y}});var r=n(45703),i=n(1581),o=n(90099),s=n(91747);const a=new i.Logger(o.i),c={},u=s.O$.from(0),l=s.O$.from(-1);function d(e,t,n,r){const o={fault:t,operation:n};return void 0!==r&&(o.value=r),a.throwError(e,i.Logger.errors.NUMERIC_FAULT,o)}let f="0";for(;f.length<256;)f+=f;function p(e){if("number"!==typeof e)try{e=s.O$.from(e).toNumber()}catch(t){}return"number"===typeof e&&e>=0&&e<=256&&!(e%1)?"1"+f.substring(0,e):a.throwArgumentError("invalid decimal size","decimals",e)}function h(e,t){null==t&&(t=0);const n=p(t),r=(e=s.O$.from(e)).lt(u);r&&(e=e.mul(l));let i=e.mod(n).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",e);let o=i[0],c=i[1];for(o||(o="0"),c||(c="0");"0"===c[c.length-1];)c=c.substring(0,c.length-1);for(c.length>n.length-1&&d("fractional component exceeds decimals","underflow","parseFixed"),""===c&&(c="0");c.lengthnull==e[t]?r:(typeof e[t]!==n&&a.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new g(c,t,n,r)}}class y{constructor(e,t,n,r){a.checkNew(new.target,y),e!==c&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(b.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(b.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&a.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=y.from("1"+f.substring(0,e),this.format),r=v.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&a.throwArgumentError("invalid byte width","width",e);const t=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,r.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return y.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||(0,s.Zm)(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),y.fromString(h(e,t),g.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=g.from(t),i=m(e,n.decimals);!n.signed&&i.lt(u)&&d("unsigned value cannot be negative","overflow","value",e);let o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=(0,r.hexZeroPad)(o,n.width/8));const s=h(i,n.decimals);return new y(c,o,s,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=g.from(t);if((0,r.arrayify)(e).length>n.width/8)throw new Error("overflow");let i=s.O$.from(e);n.signed&&(i=i.fromTwos(n.width));const o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=h(i,n.decimals);return new y(c,o,a,n)}static from(e,t){if("string"===typeof e)return y.fromString(e,t);if((0,r.isBytes)(e))return y.fromBytes(e,t);try{return y.fromValue(e,0,t)}catch(n){if(n.code!==i.Logger.errors.INVALID_ARGUMENT)throw n}return a.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const b=y.from(1),v=y.from("0.5")},45703:function(e,t,n){"use strict";n.r(t),n.d(t,{arrayify:function(){return u},concat:function(){return l},hexConcat:function(){return b},hexDataLength:function(){return g},hexDataSlice:function(){return y},hexStripZeros:function(){return w},hexValue:function(){return v},hexZeroPad:function(){return x},hexlify:function(){return m},isBytes:function(){return c},isBytesLike:function(){return s},isHexString:function(){return p},joinSignature:function(){return E},splitSignature:function(){return A},stripZeros:function(){return d},zeroPad:function(){return f}});const r=new(n(1581).Logger)("bytes/5.5.0");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function s(e){return p(e)&&!(e.length%2)||c(e)}function a(e){return"number"===typeof e&&e==e&&e%1===0}function c(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!a(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function u(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),o(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),p(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0x0"+n.substring(2):"right"===t.hexPad?n+="0":r.throwArgumentError("hex data is odd-length","value",e));const i=[];for(let e=0;eu(e))),n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),o(r)}function d(e){let t=u(e);if(0===t.length)return t;let n=0;for(;nt&&r.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),o(n)}function p(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const h="0123456789abcdef";function m(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(p(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":r.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(c(e)){let t="0x";for(let n=0;n>4]+h[15&r]}return t}return r.throwArgumentError("invalid hexlify value","value",e)}function g(e){if("string"!==typeof e)e=m(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function y(e,t,n){return"string"!==typeof e?e=m(e):(!p(e)||e.length%2)&&r.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function b(e){let t="0x";return e.forEach((e=>{t+=m(e).substring(2)})),t}function v(e){const t=w(m(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function w(e){"string"!==typeof e&&(e=m(e)),p(e)||r.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&r.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function A(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(s(e)){const n=u(e);65!==n.length&&r.throwArgumentError("invalid signature string; must be 65 bytes","signature",e),t.r=m(n.slice(0,32)),t.s=m(n.slice(32,64)),t.v=n[64],t.v<27&&(0===t.v||1===t.v?t.v+=27:r.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=m(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=f(u(t._vs),32);t._vs=m(n);const i=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&r.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const o=m(n);null==t.s?t.s=o:t.s!==o&&r.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?r.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&r.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&p(t.r)?t.r=x(t.r,32):r.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&p(t.s)?t.s=x(t.s,32):r.throwArgumentError("signature missing or invalid s","signature",e);const n=u(t.s);n[0]>=128&&r.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const i=m(n);t._vs&&(p(t._vs)||r.throwArgumentError("signature invalid _vs","signature",e),t._vs=x(t._vs,32)),null==t._vs?t._vs=i:t._vs!==i&&r.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t}function E(e){return m(l([(e=A(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},11466:function(e,t,n){"use strict";n.d(t,{VZ:function(){return S},CH:function(){return C},lV:function(){return I}});var r=n(67072),i=n(39786),o=n(38190),s=n(64758),a=n(46126),c=n(91747),u=n(45703),l=n(6881),d=n(3451),f=n(1581);var p=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const h=new f.Logger("contracts/5.5.0"),m={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0};function g(e,t){return p(this,void 0,void 0,(function*(){const n=yield t;"string"!==typeof n&&h.throwArgumentError("invalid address or ENS name","name",n);try{return(0,a.getAddress)(n)}catch(i){}e||h.throwError("a provider or signer is needed to resolve ENS names",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield e.resolveName(n);return null==r&&h.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r}))}function y(e,t,n){return p(this,void 0,void 0,(function*(){return Array.isArray(n)?yield Promise.all(n.map(((n,r)=>y(e,Array.isArray(t)?t[r]:t[n.name],n)))):"address"===n.type?yield g(e,t):"tuple"===n.type?yield y(e,t,n.components):"array"===n.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>y(e,t,n.arrayChildren)))):Promise.reject(h.makeError("invalid value for array",f.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function b(e,t,n){return p(this,void 0,void 0,(function*(){let r={};n.length===t.inputs.length+1&&"object"===typeof n[n.length-1]&&(r=(0,l.shallowCopy)(n.pop())),h.checkArgumentCount(n.length,t.inputs.length,"passed to contract"),e.signer?r.from?r.from=(0,l.resolveProperties)({override:g(e.signer,r.from),signer:e.signer.getAddress()}).then((e=>p(this,void 0,void 0,(function*(){return(0,a.getAddress)(e.signer)!==e.override&&h.throwError("Contract with a Signer cannot override from",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):r.from=e.signer.getAddress():r.from&&(r.from=g(e.provider,r.from));const i=yield(0,l.resolveProperties)({args:y(e.signer||e.provider,n,t.inputs),address:e.resolvedAddress,overrides:(0,l.resolveProperties)(r)||{}}),o=e.interface.encodeFunctionData(t,i.args),s={data:o,to:i.address},m=i.overrides;if(null!=m.nonce&&(s.nonce=c.O$.from(m.nonce).toNumber()),null!=m.gasLimit&&(s.gasLimit=c.O$.from(m.gasLimit)),null!=m.gasPrice&&(s.gasPrice=c.O$.from(m.gasPrice)),null!=m.maxFeePerGas&&(s.maxFeePerGas=c.O$.from(m.maxFeePerGas)),null!=m.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=c.O$.from(m.maxPriorityFeePerGas)),null!=m.from&&(s.from=m.from),null!=m.type&&(s.type=m.type),null!=m.accessList&&(s.accessList=(0,d.accessListify)(m.accessList)),null==s.gasLimit&&null!=t.gas){let e=21e3;const n=(0,u.arrayify)(o);for(let t=0;tnull!=r[e]));return b.length&&h.throwError(`cannot override ${b.map((e=>JSON.stringify(e))).join(",")}`,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:b}),s}))}function v(e,t){const n=t.wait.bind(t);t.wait=t=>n(t).then((t=>(t.events=t.logs.map((n=>{let r=(0,l.deepCopy)(n),i=null;try{i=e.interface.parseLog(n)}catch(o){}return i&&(r.args=i.args,r.decode=(t,n)=>e.interface.decodeEventLog(i.eventFragment,t,n),r.event=i.name,r.eventSignature=i.signature),r.removeListener=()=>e.provider,r.getBlock=()=>e.provider.getBlock(t.blockHash),r.getTransaction=()=>e.provider.getTransaction(t.transactionHash),r.getTransactionReceipt=()=>Promise.resolve(t),r})),t)))}function w(e,t,n){const r=e.signer||e.provider;return function(...i){return p(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"===typeof i[i.length-1]){const e=(0,l.shallowCopy)(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const s=yield b(e,t,i),a=yield r.call(s,o);try{let r=e.interface.decodeFunctionResult(t,a);return n&&1===t.outputs.length&&(r=r[0]),r}catch(c){throw c.code===f.Logger.errors.CALL_EXCEPTION&&(c.address=e.address,c.args=i,c.transaction=s),c}}))}}function x(e,t,n){return t.constant?w(e,t,n):function(e,t){return function(...n){return p(this,void 0,void 0,(function*(){e.signer||h.throwError("sending a transaction requires a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const r=yield b(e,t,n),i=yield e.signer.sendTransaction(r);return v(e,i),i}))}}(e,t)}function A(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class E{constructor(e,t){(0,l.defineReadOnly)(this,"tag",e),(0,l.defineReadOnly)(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((n=>!(!t&&n.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const n=e.slice();return setTimeout((()=>{t.listener.apply(this,n)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class _ extends E{constructor(){super("error",null)}}class k extends E{constructor(e,t,n,r){const i={address:e};let o=t.getEventTopic(n);r?(o!==r[0]&&h.throwArgumentError("topic mismatch","topics",r),i.topics=r.slice()):i.topics=[o],super(A(i),i),(0,l.defineReadOnly)(this,"address",e),(0,l.defineReadOnly)(this,"interface",t),(0,l.defineReadOnly)(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=(0,r.BR)(e.args);if(t.length)throw t[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class T extends E{constructor(e,t){super("*",{address:e}),(0,l.defineReadOnly)(this,"address",e),(0,l.defineReadOnly)(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,n)=>this.interface.decodeEventLog(t.eventFragment,e,n),e.args=t.args}catch(t){}}}class S{constructor(e,t,n){h.checkNew(new.target,C),(0,l.defineReadOnly)(this,"interface",(0,l.getStatic)(new.target,"getInterface")(t)),null==n?((0,l.defineReadOnly)(this,"provider",null),(0,l.defineReadOnly)(this,"signer",null)):s.E.isSigner(n)?((0,l.defineReadOnly)(this,"provider",n.provider||null),(0,l.defineReadOnly)(this,"signer",n)):o.zt.isProvider(n)?((0,l.defineReadOnly)(this,"provider",n),(0,l.defineReadOnly)(this,"signer",null)):h.throwArgumentError("invalid signer or provider","signerOrProvider",n),(0,l.defineReadOnly)(this,"callStatic",{}),(0,l.defineReadOnly)(this,"estimateGas",{}),(0,l.defineReadOnly)(this,"functions",{}),(0,l.defineReadOnly)(this,"populateTransaction",{}),(0,l.defineReadOnly)(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const n=this.interface.events[t];(0,l.defineReadOnly)(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(n,e)}))),e[n.name]||(e[n.name]=[]),e[n.name].push(t)})),Object.keys(e).forEach((t=>{const n=e[t];1===n.length?(0,l.defineReadOnly)(this.filters,t,this.filters[n[0]]):h.warn(`Duplicate definition of ${t} (${n.join(", ")})`)}))}if((0,l.defineReadOnly)(this,"_runningEvents",{}),(0,l.defineReadOnly)(this,"_wrappedEmits",{}),null==e&&h.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,l.defineReadOnly)(this,"address",e),this.provider)(0,l.defineReadOnly)(this,"resolvedAddress",g(this.provider,e));else try{(0,l.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,a.getAddress)(e)))}catch(c){h.throwError("provider is required to use ENS name as contract address",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}const r={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])h.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const n=t.name;r[`%${n}`]||(r[`%${n}`]=[]),r[`%${n}`].push(e)}null==this[e]&&(0,l.defineReadOnly)(this,e,x(this,t,!0)),null==this.functions[e]&&(0,l.defineReadOnly)(this.functions,e,x(this,t,!1)),null==this.callStatic[e]&&(0,l.defineReadOnly)(this.callStatic,e,w(this,t,!0)),null==this.populateTransaction[e]&&(0,l.defineReadOnly)(this.populateTransaction,e,function(e,t){return function(...n){return b(e,t,n)}}(this,t)),null==this.estimateGas[e]&&(0,l.defineReadOnly)(this.estimateGas,e,function(e,t){const n=e.signer||e.provider;return function(...r){return p(this,void 0,void 0,(function*(){n||h.throwError("estimate require a provider or signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield b(e,t,r);return yield n.estimateGas(i)}))}}(this,t))}})),Object.keys(r).forEach((e=>{const t=r[e];if(t.length>1)return;e=e.substring(1);const n=t[0];try{null==this[e]&&(0,l.defineReadOnly)(this,e,this[n])}catch(i){}null==this.functions[e]&&(0,l.defineReadOnly)(this.functions,e,this.functions[n]),null==this.callStatic[e]&&(0,l.defineReadOnly)(this.callStatic,e,this.callStatic[n]),null==this.populateTransaction[e]&&(0,l.defineReadOnly)(this.populateTransaction,e,this.populateTransaction[n]),null==this.estimateGas[e]&&(0,l.defineReadOnly)(this.estimateGas,e,this.estimateGas[n])}))}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getInterface(e){return i.vU.isInterface(e)?e:new i.vU(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&h.throwError("contract not deployed",f.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||h.throwError("sending a transactions require a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=(0,l.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=t[e]&&h.throwError("cannot override "+e,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"===typeof e&&(e=new s.b(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,l.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return i.Hk.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"===typeof e){if("error"===e)return this._normalizeRunningEvent(new _);if("event"===e)return this._normalizeRunningEvent(new E("event",null));if("*"===e)return this._normalizeRunningEvent(new T(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new k(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!==typeof t)throw new Error("invalid topic");const n=this.interface.getEvent(t);return this._normalizeRunningEvent(new k(this.address,this.interface,n,e.topics))}catch(t){}const n={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new E(A(n),n))}return this._normalizeRunningEvent(new T(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,n){const r=(0,l.deepCopy)(t);return r.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},r.getBlock=()=>this.provider.getBlock(t.blockHash),r.getTransaction=()=>this.provider.getTransaction(t.transactionHash),r.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(r),r}_addEventListener(e,t,n){if(this.provider||h.throwError("events require a provider or a signer with a provider",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const n=n=>{let r=this._wrapEvent(e,n,t);if(null==r.decodeError)try{const t=e.getEmit(r);this.emit(e.filter,...t)}catch(i){r.decodeError=i.error}null!=e.filter&&this.emit("event",r),null!=r.decodeError&&this.emit("error",r.decodeError,r)};this._wrappedEmits[e.tag]=n,null!=e.filter&&this.provider.on(e.filter,n)}}queryFilter(e,t,n){const r=this._getRunningEvent(e),i=(0,l.shallowCopy)(r.filter);return"string"===typeof t&&(0,u.isHexString)(t,32)?(null!=n&&h.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(r,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const n=this._getRunningEvent(e),r=n.run(t)>0;return this._checkRunningEvents(n),r}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(t),this._checkRunningEvents(n),this}removeListener(e,t){return this.off(e,t)}}class C extends S{}class I{constructor(e,t,n){let r=null;r="string"===typeof t?t:(0,u.isBytes)(t)?(0,u.hexlify)(t):t&&"string"===typeof t.object?t.object:"!","0x"!==r.substring(0,2)&&(r="0x"+r),(!(0,u.isHexString)(r)||r.length%2)&&h.throwArgumentError("invalid bytecode","bytecode",t),n&&!s.E.isSigner(n)&&h.throwArgumentError("invalid signer","signer",n),(0,l.defineReadOnly)(this,"bytecode",r),(0,l.defineReadOnly)(this,"interface",(0,l.getStatic)(new.target,"getInterface")(e)),(0,l.defineReadOnly)(this,"signer",n||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"===typeof e[e.length-1]){t=(0,l.shallowCopy)(e.pop());for(const e in t)if(!m[e])throw new Error("unknown transaction override "+e)}if(["data","from","to"].forEach((e=>{null!=t[e]&&h.throwError("cannot override "+e,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value){c.O$.from(t.value).isZero()||this.interface.deploy.payable||h.throwError("non-payable constructor cannot override value",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return h.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=(0,u.hexlify)((0,u.concat)([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return p(this,void 0,void 0,(function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),h.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const n=yield y(this.signer,e,this.interface.deploy.inputs);n.push(t);const r=this.getDeployTransaction(...n),i=yield this.signer.sendTransaction(r),o=(0,l.getStatic)(this.constructor,"getContractAddress")(i),s=(0,l.getStatic)(this.constructor,"getContract")(o,this.interface,this.signer);return v(s,i),(0,l.defineReadOnly)(s,"deployTransaction",i),s}))}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,t){null==e&&h.throwError("missing compiler output",f.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"===typeof e&&(e=JSON.parse(e));const n=e.abi;let r=null;return e.bytecode?r=e.bytecode:e.evm&&e.evm.bytecode&&(r=e.evm.bytecode),new this(n,r,t)}static getInterface(e){return C.getInterface(e)}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getContract(e,t,n){return new C(e,t,n)}}},46352:function(e,t,n){"use strict";n.r(t),n.d(t,{keccak256:function(){return m},pack:function(){return h},sha256:function(){return g}});var r=n(91747),i=n(45703),o=n(9341),s=n(90229),a=n(29251),c=n(1581);const u=new RegExp("^bytes([0-9]+)$"),l=new RegExp("^(u?int)([0-9]*)$"),d=new RegExp("^(.*)\\[([0-9]*)\\]$"),f=new c.Logger("solidity/5.5.0");function p(e,t,n){switch(e){case"address":return n?(0,i.zeroPad)(t,32):(0,i.arrayify)(t);case"string":return(0,a.Y0)(t);case"bytes":return(0,i.arrayify)(t);case"bool":return t=t?"0x01":"0x00",n?(0,i.zeroPad)(t,32):(0,i.arrayify)(t)}let o=e.match(l);if(o){let s=parseInt(o[2]||"256");return(o[2]&&String(s)!==o[2]||s%8!==0||0===s||s>256)&&f.throwArgumentError("invalid number type","type",e),n&&(s=256),t=r.O$.from(t).toTwos(s),(0,i.zeroPad)(t,s/8)}if(o=e.match(u),o){const r=parseInt(o[1]);return(String(r)!==o[1]||0===r||r>32)&&f.throwArgumentError("invalid bytes type","type",e),(0,i.arrayify)(t).byteLength!==r&&f.throwArgumentError(`invalid value for ${e}`,"value",t),n?(0,i.arrayify)((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t}if(o=e.match(d),o&&Array.isArray(t)){const n=o[1];parseInt(o[2]||String(t.length))!=t.length&&f.throwArgumentError(`invalid array length for ${e}`,"value",t);const r=[];return t.forEach((function(e){r.push(p(n,e,!0))})),(0,i.concat)(r)}return f.throwArgumentError("invalid type","type",e)}function h(e,t){e.length!=t.length&&f.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const n=[];return e.forEach((function(e,r){n.push(p(e,t[r]))})),(0,i.hexlify)((0,i.concat)(n))}function m(e,t){return(0,o.keccak256)(h(e,t))}function g(e,t){return(0,s.JQ)(h(e,t))}},81502:function(e,t,n){"use strict";n.r(t),n.d(t,{Wallet:function(){return w},verifyMessage:function(){return x},verifyTypedData:function(){return A}});var r=n(46126),i=n(38190),o=n(64758),s=n(45703),a=n(93684),c=n(34120),u=n(84204),l=n(9341),d=n(6881),f=n(66869),p=n(43705),h=n(64341),m=n(81964),g=n(3451),y=n(1581);var b=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const v=new y.Logger("wallet/5.5.0");class w extends o.E{constructor(e,t){if(v.checkNew(new.target,w),super(),null!=(n=e)&&(0,s.isHexString)(n.privateKey,32)&&null!=n.address){const t=new p.SigningKey(e.privateKey);if((0,d.defineReadOnly)(this,"_signingKey",(()=>t)),(0,d.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey)),this.address!==(0,r.getAddress)(e.address)&&v.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;(0,d.defineReadOnly)(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||u.defaultPath,locale:t.locale||"en"})));const n=this.mnemonic,r=u.HDNode.fromMnemonic(n.phrase,null,n.locale).derivePath(n.path);(0,g.computeAddress)(r.privateKey)!==this.address&&v.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,d.defineReadOnly)(this,"_mnemonic",(()=>null))}else{if(p.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&v.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,d.defineReadOnly)(this,"_signingKey",(()=>e));else{"string"===typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new p.SigningKey(e);(0,d.defineReadOnly)(this,"_signingKey",(()=>t))}(0,d.defineReadOnly)(this,"_mnemonic",(()=>null)),(0,d.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey))}var n;t&&!i.zt.isProvider(t)&&v.throwArgumentError("invalid provider","provider",t),(0,d.defineReadOnly)(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new w(this,e)}signTransaction(e){return(0,d.resolveProperties)(e).then((t=>{null!=t.from&&((0,r.getAddress)(t.from)!==this.address&&v.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const n=this._signingKey().signDigest((0,l.keccak256)((0,g.serialize)(t)));return(0,g.serialize)(t,n)}))}signMessage(e){return b(this,void 0,void 0,(function*(){return(0,s.joinSignature)(this._signingKey().signDigest((0,a.r)(e)))}))}_signTypedData(e,t,n){return b(this,void 0,void 0,(function*(){const r=yield c.E.resolveNames(e,t,n,(e=>(null==this.provider&&v.throwError("cannot resolve ENS names without a provider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return(0,s.joinSignature)(this._signingKey().signDigest(c.E.hash(r.domain,t,r.value)))}))}encrypt(e,t,n){if("function"!==typeof t||n||(n=t,t={}),n&&"function"!==typeof n)throw new Error("invalid callback");return t||(t={}),(0,m.HI)(this,e,t,n)}static createRandom(e){let t=(0,f.O)(16);e||(e={}),e.extraEntropy&&(t=(0,s.arrayify)((0,s.hexDataSlice)((0,l.keccak256)((0,s.concat)([t,e.extraEntropy])),0,16)));const n=(0,u.entropyToMnemonic)(t,e.locale);return w.fromMnemonic(n,e.path,e.locale)}static fromEncryptedJson(e,t,n){return(0,h.decryptJsonWallet)(e,t,n).then((e=>new w(e)))}static fromEncryptedJsonSync(e,t){return new w((0,h.decryptJsonWalletSync)(e,t))}static fromMnemonic(e,t,n){return t||(t=u.defaultPath),new w(u.HDNode.fromMnemonic(e,null,n).derivePath(t))}}function x(e,t){return(0,g.recoverAddress)((0,a.r)(e),t)}function A(e,t,n,r){return(0,g.recoverAddress)(c.E.hash(e,t,n),r)}},26729:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,s){if("function"!==typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"===typeof c)r(c,this,t);else{var u=c.length,l=h(c,u);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},33715:function(e,t,n){var r=t;r.utils=n(26436),r.common=n(95772),r.sha=n(89041),r.ripemd=n(12949),r.hmac=n(52344),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},95772:function(e,t,n){"use strict";var r=n(26436),i=n(79746);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},26436:function(e,t,n){"use strict";var r=n(79746),i=n(35717);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i>6|192,n[r++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(i=0;i>>0}return s},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,s=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,o,s,a){var c=0,u=t;return c+=(u=u+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,i,o,s,a){return t+r+o+a>>>0},t.sum64_5_hi=function(e,t,n,r,i,o,s,a,c,u){var l=0,d=t;return l+=(d=d+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,i,o,s,a,c,u){return t+r+o+a+u>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},8679:function(e,t,n){"use strict";var r=n(21296),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(e){return r.isMemo(e)?s:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var u=Object.defineProperty,l=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var i=p(n);i&&i!==h&&e(t,i,r)}var s=l(n);d&&(s=s.concat(d(n)));for(var a=c(t),m=c(n),g=0;g>1,l=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=u}return(p?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+p]=255&a,p+=h,a/=256,i-=8);for(s=s<0;e[n+p]=255&s,p+=h,s/=256,u-=8);e[n+p-h]|=128*m}},35717:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},31198:function(e,t,n){"use strict";const r=n(74880).v4,i=n(17741),o=function(e,t){if(!(this instanceof o))return new o(e,t);t||(t={}),this.options={reviver:"undefined"!==typeof t.reviver?t.reviver:null,replacer:"undefined"!==typeof t.replacer?t.replacer:null,generator:"undefined"!==typeof t.generator?t.generator:function(){return r()},version:"undefined"!==typeof t.version?t.version:2,notificationIdNull:"boolean"===typeof t.notificationIdNull&&t.notificationIdNull},this.callServer=e};e.exports=o,o.prototype.request=function(e,t,n,r){const o=this;let s=null;const a=Array.isArray(e)&&"function"===typeof t;if(1===this.options.version&&a)throw new TypeError("JSON-RPC 1.0 does not support batching");if(a||!a&&e&&"object"===typeof e&&"function"===typeof t)r=t,s=e;else{"function"===typeof n&&(r=n,n=void 0);const o="function"===typeof r;try{s=i(e,t,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(u){if(o)return r(u);throw u}if(!o)return s}let c;try{c=JSON.stringify(s,this.options.replacer)}catch(u){return r(u)}return this.callServer(c,(function(e,t){o._parseResponse(e,t,r)})),s},o.prototype._parseResponse=function(e,t,n){if(e)return void n(e);if(!t)return n();let r;try{r=JSON.parse(t,this.options.reviver)}catch(e){return n(e)}if(3===n.length){if(Array.isArray(r)){const e=function(e){return"undefined"!==typeof e.error},t=function(t){return!e(t)};return n(null,r.filter(e),r.filter(t))}return n(null,r.error,r.result)}n(null,r)}},17741:function(e,t,n){"use strict";const r=n(74880).v4;e.exports=function(e,t,n,i){if("string"!==typeof e)throw new TypeError(e+" must be a string");const o="number"===typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw new TypeError(o+" must be 1 or 2");const s={method:e};if(2===o&&(s.jsonrpc="2.0"),t){if("object"!==typeof t&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");s.params=t}if("undefined"===typeof n){const e="function"===typeof i.generator?i.generator:function(){return r()};s.id=e(s,i)}else 2===o&&null===n?i.notificationIdNull&&(s.id=null):s.id=n;return s}},91094:function(e,t,n){var r,i=n(83454);!function(){"use strict";var o="input is invalid type",s="object"===typeof window,a=s?window:{};a.JS_SHA3_NO_WINDOW&&(s=!1);var c=!s&&"object"===typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"===typeof i&&i.versions&&i.versions.node?a=n.g:c&&(a=self);var u=!a.JS_SHA3_NO_COMMON_JS&&e.exports,l=n.amdO,d=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,f="0123456789abcdef".split(""),p=[4,1024,262144,67108864],h=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],g=[224,256,384,512],y=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!d||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var w=function(e,t,n){return function(r){return new M(e,t,e).update(r)[n]()}},x=function(e,t,n){return function(r,i){return new M(e,t,i).update(r)[n]()}},A=function(e,t,n){return function(t,r,i,o){return S["cshake"+e].update(t,r,i,o)[n]()}},E=function(e,t,n){return function(t,r,i,o){return S["kmac"+e].update(t,r,i,o)[n]()}},_=function(e,t,n,r){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function N(e,t,n){M.call(this,e,t,n)}M.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(o);if(null===e)throw new Error(o);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!d||!ArrayBuffer.isView(e)))throw new Error(o);t=!0}for(var r,i,s=this.blocks,a=this.byteCount,c=e.length,u=this.blockCount,l=0,f=this.s;l>2]|=e[l]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},M.prototype.encodeString=function(e){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(o);if(null===e)throw new Error(o);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!d||!ArrayBuffer.isView(e)))throw new Error(o);t=!0}var r=0,i=e.length;if(t)r=i;else for(var s=0;s=57344?r+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),r+=4)}return r+=this.encode(8*r),this.update(e),r},M.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];s%t===0&&(F(n),o=0)}return i&&(e=n[o],a+=f[e>>4&15]+f[15&e],i>1&&(a+=f[e>>12&15]+f[e>>8&15]),i>2&&(a+=f[e>>20&15]+f[e>>16&15])),a},M.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(e);s>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;a%n===0&&F(r)}return o&&(e=a<<2,t=r[s],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},N.prototype=new M,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),M.prototype.finalize.call(this)};var F=function(e){var t,n,r,i,o,s,a,c,u,l,d,f,p,h,g,y,b,v,w,x,A,E,_,k,T,S,C,I,O,R,D,P,B,M,N,F,L,j,U,Z,H,z,G,V,W,q,$,K,Y,X,J,Q,ee,te,ne,re,ie,oe,se,ae,ce,ue,le;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),n=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(c<<1|u>>>31),n=o^(u<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=s^(l<<1|d>>>31),n=a^(d<<1|l>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(f<<1|p>>>31),n=u^(p<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=l^(i<<1|o>>>31),n=d^(o<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,h=e[0],g=e[1],q=e[11]<<4|e[10]>>>28,$=e[10]<<4|e[11]>>>28,I=e[20]<<3|e[21]>>>29,O=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,M=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,K=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,P=e[45]<<29|e[44]>>>3,B=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,T=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,A=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,S=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,Z=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,_=e[49]<<14|e[48]>>>18,e[0]=h^~y&v,e[1]=g^~b&w,e[10]=k^~S&I,e[11]=T^~C&O,e[20]=M^~F&j,e[21]=N^~L&U,e[30]=V^~q&K,e[31]=W^~$&Y,e[40]=te^~re&oe,e[41]=ne^~ie&se,e[2]=y^~v&x,e[3]=b^~w&A,e[12]=S^~I&R,e[13]=C^~O&D,e[22]=F^~j&Z,e[23]=L^~U&H,e[32]=q^~K&X,e[33]=$^~Y&J,e[42]=re^~oe&ae,e[43]=ie^~se&ce,e[4]=v^~x&E,e[5]=w^~A&_,e[14]=I^~R&P,e[15]=O^~D&B,e[24]=j^~Z&z,e[25]=U^~H&G,e[34]=K^~X&Q,e[35]=Y^~J&ee,e[44]=oe^~ae&ue,e[45]=se^~ce&le,e[6]=x^~E&h,e[7]=A^~_&g,e[16]=R^~P&k,e[17]=D^~B&T,e[26]=Z^~z&M,e[27]=H^~G&N,e[36]=X^~Q&V,e[37]=J^~ee&W,e[46]=ae^~ue&te,e[47]=ce^~le&ne,e[8]=E^~h&y,e[9]=_^~g&b,e[18]=P^~k&S,e[19]=B^~T&C,e[28]=z^~M&F,e[29]=G^~N&L,e[38]=Q^~V&q,e[39]=ee^~W&$,e[48]=ue^~te&re,e[49]=le^~ne&ie,e[0]^=m[r],e[1]^=m[r+1]};if(u)e.exports=S;else{for(I=0;I=t||n<0||g&&e-h>=l}function x(){var e=i();if(w(e))return A(e);f=setTimeout(x,function(e){var n=t-(e-p);return g?a(n,l-(e-h)):n}(e))}function A(e){return f=void 0,y&&c?b(e):(c=u=void 0,d)}function E(){var e=i(),n=w(e);if(c=arguments,u=this,p=e,n){if(void 0===f)return v(p);if(g)return clearTimeout(f),f=setTimeout(x,t),b(p)}return void 0===f&&(f=setTimeout(x,t)),d}return t=o(t)||0,r(n)&&(m=!!n.leading,l=(g="maxWait"in n)?s(o(n.maxWait)||0,t):l,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==f&&clearTimeout(f),h=0,c=p=u=f=void 0},E.flush=function(){return void 0===f?d:A(i())},E}},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},33448:function(e,t,n){var r=n(44239),i=n(37005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},96486:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",c=16,u=32,l=64,d=128,f=256,p=1/0,h=9007199254740991,m=NaN,g=4294967295,y=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",u],["partialRight",l],["rearg",f]],b="[object Arguments]",v="[object Array]",w="[object Boolean]",x="[object Date]",A="[object Error]",E="[object Function]",_="[object GeneratorFunction]",k="[object Map]",T="[object Number]",S="[object Object]",C="[object Promise]",I="[object RegExp]",O="[object Set]",R="[object String]",D="[object Symbol]",P="[object WeakMap]",B="[object ArrayBuffer]",M="[object DataView]",N="[object Float32Array]",F="[object Float64Array]",L="[object Int8Array]",j="[object Int16Array]",U="[object Int32Array]",Z="[object Uint8Array]",H="[object Uint8ClampedArray]",z="[object Uint16Array]",G="[object Uint32Array]",V=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Y=RegExp($.source),X=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),se=/^\s+/,ae=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,be=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,_e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ke="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Oe="['\u2019]",Re="[\\ud800-\\udfff]",De="["+Ie+"]",Pe="["+_e+"]",Be="\\d+",Me="[\\u2700-\\u27bf]",Ne="["+Te+"]",Fe="[^\\ud800-\\udfff"+Ie+Be+ke+Te+Se+"]",Le="\\ud83c[\\udffb-\\udfff]",je="[^\\ud800-\\udfff]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",Ze="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+Se+"]",ze="(?:"+Ne+"|"+Fe+")",Ge="(?:"+He+"|"+Fe+")",Ve="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",We="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Pe+"|"+Le+")"+"?",$e="[\\ufe0e\\ufe0f]?",Ke=$e+qe+("(?:\\u200d(?:"+[je,Ue,Ze].join("|")+")"+$e+qe+")*"),Ye="(?:"+[Me,Ue,Ze].join("|")+")"+Ke,Xe="(?:"+[je+Pe+"?",Pe,Ue,Ze,Re].join("|")+")",Je=RegExp(Oe,"g"),Qe=RegExp(Pe,"g"),et=RegExp(Le+"(?="+Le+")|"+Xe+Ke,"g"),tt=RegExp([He+"?"+Ne+"+"+Ve+"(?="+[De,He,"$"].join("|")+")",Ge+"+"+We+"(?="+[De,He+ze,"$"].join("|")+")",He+"?"+ze+"+"+Ve,He+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Be,Ye].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+_e+Ce+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,st={};st[N]=st[F]=st[L]=st[j]=st[U]=st[Z]=st[H]=st[z]=st[G]=!0,st[b]=st[v]=st[B]=st[w]=st[M]=st[x]=st[A]=st[E]=st[k]=st[T]=st[S]=st[I]=st[O]=st[R]=st[P]=!1;var at={};at[b]=at[v]=at[B]=at[M]=at[w]=at[x]=at[N]=at[F]=at[L]=at[j]=at[U]=at[k]=at[T]=at[S]=at[I]=at[O]=at[R]=at[D]=at[Z]=at[H]=at[z]=at[G]=!0,at[A]=at[E]=at[P]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,lt=parseInt,dt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=dt||ft||Function("return this")(),ht=t&&!t.nodeType&&t,mt=ht&&e&&!e.nodeType&&e,gt=mt&&mt.exports===ht,yt=gt&&dt.process,bt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||yt&&yt.binding&&yt.binding("util")}catch(t){}}(),vt=bt&&bt.isArrayBuffer,wt=bt&&bt.isDate,xt=bt&&bt.isMap,At=bt&&bt.isRegExp,Et=bt&&bt.isSet,_t=bt&&bt.isTypedArray;function kt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Tt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Dt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function tn(e,t){for(var n=e.length;n--&&Zt(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=Wt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),on=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ct[e]}function an(e){return nt.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function ln(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var yn=function e(t){var n=(t=null==t?pt:yn.defaults(pt.Object(),t,yn.pick(pt,it))).Array,r=t.Date,ae=t.Error,_e=t.Function,ke=t.Math,Te=t.Object,Se=t.RegExp,Ce=t.String,Ie=t.TypeError,Oe=n.prototype,Re=_e.prototype,De=Te.prototype,Pe=t["__core-js_shared__"],Be=Re.toString,Me=De.hasOwnProperty,Ne=0,Fe=function(){var e=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Le=De.toString,je=Be.call(Te),Ue=pt._,Ze=Se("^"+Be.call(Me).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=gt?t.Buffer:i,ze=t.Symbol,Ge=t.Uint8Array,Ve=He?He.allocUnsafe:i,We=un(Te.getPrototypeOf,Te),qe=Te.create,$e=De.propertyIsEnumerable,Ke=Oe.splice,Ye=ze?ze.isConcatSpreadable:i,Xe=ze?ze.iterator:i,et=ze?ze.toStringTag:i,nt=function(){try{var e=po(Te,"defineProperty");return e({},"",{}),e}catch(t){}}(),ct=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,dt=r&&r.now!==pt.Date.now&&r.now,ft=t.setTimeout!==pt.setTimeout&&t.setTimeout,ht=ke.ceil,mt=ke.floor,yt=Te.getOwnPropertySymbols,bt=He?He.isBuffer:i,Lt=t.isFinite,Wt=Oe.join,bn=un(Te.keys,Te),vn=ke.max,wn=ke.min,xn=r.now,An=t.parseInt,En=ke.random,_n=Oe.reverse,kn=po(t,"DataView"),Tn=po(t,"Map"),Sn=po(t,"Promise"),Cn=po(t,"Set"),In=po(t,"WeakMap"),On=po(Te,"create"),Rn=In&&new In,Dn={},Pn=Uo(kn),Bn=Uo(Tn),Mn=Uo(Sn),Nn=Uo(Cn),Fn=Uo(In),Ln=ze?ze.prototype:i,jn=Ln?Ln.valueOf:i,Un=Ln?Ln.toString:i;function Zn(e){if(ra(e)&&!Ws(e)&&!(e instanceof Vn)){if(e instanceof Gn)return e;if(Me.call(e,"__wrapped__"))return Zo(e)}return new Gn(e)}var Hn=function(){function e(){}return function(t){if(!na(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function zn(){}function Gn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ur(e,t,n,r,o,s){var a,c=1&t,u=2&t,l=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!na(e))return e;var d=Ws(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!c)return Oi(e,a)}else{var f=go(e),p=f==E||f==_;if(Ys(e))return _i(e,c);if(f==S||f==b||p&&!o){if(a=u||p?{}:bo(e),!c)return u?function(e,t){return Ri(e,mo(e),t)}(e,function(e,t){return e&&Ri(t,Ba(t),e)}(a,e)):function(e,t){return Ri(e,ho(e),t)}(e,or(a,e))}else{if(!at[f])return o?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case B:return ki(e);case w:case x:return new r(+e);case M:return function(e,t){var n=t?ki(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case F:case L:case j:case U:case Z:case H:case z:case G:return Ti(e,n);case k:return new r;case T:case R:return new r(e);case I:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new r;case D:return i=e,jn?Te(jn.call(i)):{}}var i}(e,f,c)}}s||(s=new Yn);var h=s.get(e);if(h)return h;s.set(e,a),ca(e)?e.forEach((function(r){a.add(ur(r,t,n,r,e,s))})):ia(e)&&e.forEach((function(r,i){a.set(i,ur(r,t,n,i,e,s))}));var m=d?i:(l?u?oo:io:u?Ba:Pa)(e);return St(m||e,(function(r,i){m&&(r=e[i=r]),nr(a,i,ur(r,t,n,i,e,s))})),a}function lr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Te(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function dr(e,t,n){if("function"!=typeof e)throw new Ie(o);return Po((function(){e.apply(i,n)}),t)}function fr(e,t,n,r){var i=-1,o=Rt,s=!0,a=e.length,c=[],u=t.length;if(!a)return c;n&&(t=Pt(t,Xt(n))),r?(o=Dt,s=!1):t.length>=200&&(o=Qt,s=!1,t=new Kn(t));e:for(;++i-1},qn.prototype.set=function(e,t){var n=this.__data__,r=rr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$n.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Tn||qn),string:new Wn}},$n.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},$n.prototype.get=function(e){return lo(this,e).get(e)},$n.prototype.has=function(e){return lo(this,e).has(e)},$n.prototype.set=function(e,t){var n=lo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(e){return this.__data__.set(e,s),this},Kn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new qn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof qn){var r=n.__data__;if(!Tn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $n(r)}return n.set(e,t),this.size=n.size,this};var pr=Bi(xr),hr=Bi(Ar,!0);function mr(e,t){var n=!0;return pr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function gr(e,t,n){for(var r=-1,o=e.length;++r0&&n(a)?t>1?br(a,t-1,n,r,i):Bt(i,a):r||(i[i.length]=a)}return i}var vr=Mi(),wr=Mi(!0);function xr(e,t){return e&&vr(e,t,Pa)}function Ar(e,t){return e&&wr(e,t,Pa)}function Er(e,t){return Ot(t,(function(t){return Qs(e[t])}))}function _r(e,t){for(var n=0,r=(t=wi(t,e)).length;null!=e&&nt}function Cr(e,t){return null!=e&&Me.call(e,t)}function Ir(e,t){return null!=e&&t in Te(e)}function Or(e,t,r){for(var o=r?Dt:Rt,s=e[0].length,a=e.length,c=a,u=n(a),l=1/0,d=[];c--;){var f=e[c];c&&t&&(f=Pt(f,Xt(t))),l=wn(f.length,l),u[c]=!r&&(t||s>=120&&f.length>=120)?new Kn(c&&f):i}f=e[0];var p=-1,h=u[0];e:for(;++p=a?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Wr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&Ke.call(a,c,1),Ke.call(e,c,1);return e}function $r(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?Ke.call(e,i,1):fi(e,i)}}return e}function Kr(e,t){return e+mt(En()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Xr(e,t){return Bo(Co(e,t,oc),e+"")}function Jr(e){return Jn(Ha(e))}function Qr(e,t){var n=Ha(e);return Fo(n,cr(t,0,n.length))}function ei(e,t,n,r){if(!na(e))return e;for(var o=-1,s=(t=wi(t,e)).length,a=s-1,c=e;null!=c&&++oo?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=n(o);++i>>1,s=e[o];null!==s&&!la(s)&&(n?s<=t:s=200){var u=t?null:Yi(e);if(u)return dn(u);s=!1,i=Qt,c=new Kn}else c=t?[]:a;e:for(;++r=r?e:ii(e,t,n)}var Ei=ct||function(e){return pt.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function ki(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function Ti(e,t){var n=t?ki(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var n=e!==i,r=null===e,o=e===e,s=la(e),a=t!==i,c=null===t,u=t===t,l=la(t);if(!c&&!l&&!s&&e>t||s&&a&&u&&!c&&!l||r&&a&&u||!n&&u||!o)return 1;if(!r&&!s&&!l&&e1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&xo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Te(t);++r-1?o[s?t[a]:a]:i}}function Ui(e){return ro((function(t){var n=t.length,r=n,s=Gn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Ie(o);if(s&&!c&&"wrapper"==ao(a))var c=new Gn([],!0)}for(r=c?r:n;++r1&&v.reverse(),p&&lc))return!1;var l=s.get(e),d=s.get(t);if(l&&d)return l==t&&d==e;var f=-1,p=!0,h=2&n?new Kn:i;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ce,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return St(y,(function(n){var r="_."+n[0];t&n[1]&&!Rt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(le):[]}(r),n)))}function No(e){var t=0,n=0;return function(){var r=xn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Fo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,as(e,n)}));function hs(e){var t=Zn(e);return t.__chain__=!0,t}function ms(e,t){return t(e)}var gs=ro((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Vn&&wo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ms,args:[o],thisArg:i}),new Gn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var ys=Di((function(e,t,n){Me.call(e,n)?++e[n]:sr(e,n,1)}));var bs=ji(Vo),vs=ji(Wo);function ws(e,t){return(Ws(e)?St:pr)(e,uo(t,3))}function xs(e,t){return(Ws(e)?Ct:hr)(e,uo(t,3))}var As=Di((function(e,t,n){Me.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Es=Xr((function(e,t,r){var i=-1,o="function"==typeof t,s=$s(e)?n(e.length):[];return pr(e,(function(e){s[++i]=o?kt(t,e,r):Rr(e,t,r)})),s})),_s=Di((function(e,t,n){sr(e,n,t)}));function ks(e,t){return(Ws(e)?Pt:Ur)(e,uo(t,3))}var Ts=Di((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ss=Xr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&xo(e,t[0],t[1])?t=[]:n>2&&xo(t[0],t[1],t[2])&&(t=[t[0]]),Vr(e,br(t,1),[])})),Cs=dt||function(){return pt.Date.now()};function Is(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Ji(e,d,i,i,i,i,t)}function Os(e,t){var n;if("function"!=typeof t)throw new Ie(o);return e=ga(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Rs=Xr((function(e,t,n){var r=1;if(n.length){var i=ln(n,co(Rs));r|=u}return Ji(e,r,t,n,i)})),Ds=Xr((function(e,t,n){var r=3;if(n.length){var i=ln(n,co(Ds));r|=u}return Ji(t,r,e,n,i)}));function Ps(e,t,n){var r,s,a,c,u,l,d=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new Ie(o);function m(t){var n=r,o=s;return r=s=i,d=t,c=e.apply(o,n)}function g(e){return d=e,u=Po(b,t),f?m(e):c}function y(e){var n=e-l;return l===i||n>=t||n<0||p&&e-d>=a}function b(){var e=Cs();if(y(e))return v(e);u=Po(b,function(e){var n=t-(e-l);return p?wn(n,a-(e-d)):n}(e))}function v(e){return u=i,h&&r?m(e):(r=s=i,c)}function w(){var e=Cs(),n=y(e);if(r=arguments,s=this,l=e,n){if(u===i)return g(l);if(p)return Ei(u),u=Po(b,t),m(l)}return u===i&&(u=Po(b,t)),c}return t=ba(t)||0,na(n)&&(f=!!n.leading,a=(p="maxWait"in n)?vn(ba(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),w.cancel=function(){u!==i&&Ei(u),d=0,r=l=s=u=i},w.flush=function(){return u===i?c:v(Cs())},w}var Bs=Xr((function(e,t){return dr(e,1,t)})),Ms=Xr((function(e,t,n){return dr(e,ba(t)||0,n)}));function Ns(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ns.Cache||$n),n}function Fs(e){if("function"!=typeof e)throw new Ie(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ns.Cache=$n;var Ls=xi((function(e,t){var n=(t=1==t.length&&Ws(t[0])?Pt(t[0],Xt(uo())):Pt(br(t,1),Xt(uo()))).length;return Xr((function(r){for(var i=-1,o=wn(r.length,n);++i=t})),Vs=Dr(function(){return arguments}())?Dr:function(e){return ra(e)&&Me.call(e,"callee")&&!$e.call(e,"callee")},Ws=n.isArray,qs=vt?Xt(vt):function(e){return ra(e)&&Tr(e)==B};function $s(e){return null!=e&&ta(e.length)&&!Qs(e)}function Ks(e){return ra(e)&&$s(e)}var Ys=bt||bc,Xs=wt?Xt(wt):function(e){return ra(e)&&Tr(e)==x};function Js(e){if(!ra(e))return!1;var t=Tr(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!sa(e)}function Qs(e){if(!na(e))return!1;var t=Tr(e);return t==E||t==_||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ea(e){return"number"==typeof e&&e==ga(e)}function ta(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function na(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ra(e){return null!=e&&"object"==typeof e}var ia=xt?Xt(xt):function(e){return ra(e)&&go(e)==k};function oa(e){return"number"==typeof e||ra(e)&&Tr(e)==T}function sa(e){if(!ra(e)||Tr(e)!=S)return!1;var t=We(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Be.call(n)==je}var aa=At?Xt(At):function(e){return ra(e)&&Tr(e)==I};var ca=Et?Xt(Et):function(e){return ra(e)&&go(e)==O};function ua(e){return"string"==typeof e||!Ws(e)&&ra(e)&&Tr(e)==R}function la(e){return"symbol"==typeof e||ra(e)&&Tr(e)==D}var da=_t?Xt(_t):function(e){return ra(e)&&ta(e.length)&&!!st[Tr(e)]};var fa=qi(jr),pa=qi((function(e,t){return e<=t}));function ha(e){if(!e)return[];if($s(e))return ua(e)?hn(e):Oi(e);if(Xe&&e[Xe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Xe]());var t=go(e);return(t==k?cn:t==O?dn:Ha)(e)}function ma(e){return e?(e=ba(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function ga(e){var t=ma(e),n=t%1;return t===t?n?t-n:t:0}function ya(e){return e?cr(ga(e),0,g):0}function ba(e){if("number"==typeof e)return e;if(la(e))return m;if(na(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=na(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var n=ye.test(e);return n||ve.test(e)?lt(e.slice(2),n?2:8):ge.test(e)?m:+e}function va(e){return Ri(e,Ba(e))}function wa(e){return null==e?"":li(e)}var xa=Pi((function(e,t){if(ko(t)||$s(t))Ri(t,Pa(t),e);else for(var n in t)Me.call(t,n)&&nr(e,n,t[n])})),Aa=Pi((function(e,t){Ri(t,Ba(t),e)})),Ea=Pi((function(e,t,n,r){Ri(t,Ba(t),e,r)})),_a=Pi((function(e,t,n,r){Ri(t,Pa(t),e,r)})),ka=ro(ar);var Ta=Xr((function(e,t){e=Te(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&xo(t[0],t[1],o)&&(r=1);++n1),t})),Ri(e,oo(e),n),r&&(n=ur(n,7,to));for(var i=t.length;i--;)fi(n,t[i]);return n}));var La=ro((function(e,t){return null==e?{}:function(e,t){return Wr(e,t,(function(t,n){return Ia(e,n)}))}(e,t)}));function ja(e,t){if(null==e)return{};var n=Pt(oo(e),(function(e){return[e]}));return t=uo(t),Wr(e,n,(function(e,n){return t(e,n[0])}))}var Ua=Xi(Pa),Za=Xi(Ba);function Ha(e){return null==e?[]:Jt(e,Pa(e))}var za=Fi((function(e,t,n){return t=t.toLowerCase(),e+(n?Ga(t):t)}));function Ga(e){return Ja(wa(e).toLowerCase())}function Va(e){return(e=wa(e))&&e.replace(xe,rn).replace(Qe,"")}var Wa=Fi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),qa=Fi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),$a=Ni("toLowerCase");var Ka=Fi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ya=Fi((function(e,t,n){return e+(n?" ":"")+Ja(t)}));var Xa=Fi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ja=Ni("toUpperCase");function Qa(e,t,n){return e=wa(e),(t=n?i:t)===i?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var ec=Xr((function(e,t){try{return kt(e,i,t)}catch(n){return Js(n)?n:new ae(n)}})),tc=ro((function(e,t){return St(t,(function(t){t=jo(t),sr(e,t,Rs(e[t],e))})),e}));function nc(e){return function(){return e}}var rc=Ui(),ic=Ui(!0);function oc(e){return e}function sc(e){return Nr("function"==typeof e?e:ur(e,1))}var ac=Xr((function(e,t){return function(n){return Rr(n,e,t)}})),cc=Xr((function(e,t){return function(n){return Rr(e,n,t)}}));function uc(e,t,n){var r=Pa(t),i=Er(t,r);null!=n||na(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Er(t,Pa(t)));var o=!(na(n)&&"chain"in n)||!!n.chain,s=Qs(e);return St(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Oi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Bt([this.value()],arguments))})})),e}function lc(){}var dc=Gi(Pt),fc=Gi(It),pc=Gi(Ft);function hc(e){return Ao(e)?Vt(jo(e)):function(e){return function(t){return _r(t,e)}}(e)}var mc=Wi(),gc=Wi(!0);function yc(){return[]}function bc(){return!1}var vc=zi((function(e,t){return e+t}),0),wc=Ki("ceil"),xc=zi((function(e,t){return e/t}),1),Ac=Ki("floor");var Ec=zi((function(e,t){return e*t}),1),_c=Ki("round"),kc=zi((function(e,t){return e-t}),0);return Zn.after=function(e,t){if("function"!=typeof t)throw new Ie(o);return e=ga(e),function(){if(--e<1)return t.apply(this,arguments)}},Zn.ary=Is,Zn.assign=xa,Zn.assignIn=Aa,Zn.assignInWith=Ea,Zn.assignWith=_a,Zn.at=ka,Zn.before=Os,Zn.bind=Rs,Zn.bindAll=tc,Zn.bindKey=Ds,Zn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ws(e)?e:[e]},Zn.chain=hs,Zn.chunk=function(e,t,r){t=(r?xo(e,t,r):t===i)?1:vn(ga(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,c=n(ht(o/t));so?0:o+n),(r=r===i||r>o?o:ga(r))<0&&(r+=o),r=n>r?0:ya(r);n>>0)?(e=wa(e))&&("string"==typeof t||null!=t&&!aa(t))&&!(t=li(t))&&an(e)?Ai(hn(e),0,n):e.split(t,n):[]},Zn.spread=function(e,t){if("function"!=typeof e)throw new Ie(o);return t=null==t?0:vn(ga(t),0),Xr((function(n){var r=n[t],i=Ai(n,0,t);return r&&Bt(i,r),kt(e,this,i)}))},Zn.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},Zn.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===i?1:ga(t))<0?0:t):[]},Zn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ii(e,(t=r-(t=n||t===i?1:ga(t)))<0?0:t,r):[]},Zn.takeRightWhile=function(e,t){return e&&e.length?hi(e,uo(t,3),!1,!0):[]},Zn.takeWhile=function(e,t){return e&&e.length?hi(e,uo(t,3)):[]},Zn.tap=function(e,t){return t(e),e},Zn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ie(o);return na(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ps(e,t,{leading:r,maxWait:t,trailing:i})},Zn.thru=ms,Zn.toArray=ha,Zn.toPairs=Ua,Zn.toPairsIn=Za,Zn.toPath=function(e){return Ws(e)?Pt(e,jo):la(e)?[e]:Oi(Lo(wa(e)))},Zn.toPlainObject=va,Zn.transform=function(e,t,n){var r=Ws(e),i=r||Ys(e)||da(e);if(t=uo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:na(e)&&Qs(o)?Hn(We(e)):{}}return(i?St:xr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Zn.unary=function(e){return Is(e,1)},Zn.union=rs,Zn.unionBy=is,Zn.unionWith=os,Zn.uniq=function(e){return e&&e.length?di(e):[]},Zn.uniqBy=function(e,t){return e&&e.length?di(e,uo(t,2)):[]},Zn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?di(e,i,t):[]},Zn.unset=function(e,t){return null==e||fi(e,t)},Zn.unzip=ss,Zn.unzipWith=as,Zn.update=function(e,t,n){return null==e?e:pi(e,t,vi(n))},Zn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:pi(e,t,vi(n),r)},Zn.values=Ha,Zn.valuesIn=function(e){return null==e?[]:Jt(e,Ba(e))},Zn.without=cs,Zn.words=Qa,Zn.wrap=function(e,t){return js(vi(t),e)},Zn.xor=us,Zn.xorBy=ls,Zn.xorWith=ds,Zn.zip=fs,Zn.zipObject=function(e,t){return yi(e||[],t||[],nr)},Zn.zipObjectDeep=function(e,t){return yi(e||[],t||[],ei)},Zn.zipWith=ps,Zn.entries=Ua,Zn.entriesIn=Za,Zn.extend=Aa,Zn.extendWith=Ea,uc(Zn,Zn),Zn.add=vc,Zn.attempt=ec,Zn.camelCase=za,Zn.capitalize=Ga,Zn.ceil=wc,Zn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ba(n))===n?n:0),t!==i&&(t=(t=ba(t))===t?t:0),cr(ba(e),t,n)},Zn.clone=function(e){return ur(e,4)},Zn.cloneDeep=function(e){return ur(e,5)},Zn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:i)},Zn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:i)},Zn.conformsTo=function(e,t){return null==t||lr(e,t,Pa(t))},Zn.deburr=Va,Zn.defaultTo=function(e,t){return null==e||e!==e?t:e},Zn.divide=xc,Zn.endsWith=function(e,t,n){e=wa(e),t=li(t);var r=e.length,o=n=n===i?r:cr(ga(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Zn.eq=Hs,Zn.escape=function(e){return(e=wa(e))&&X.test(e)?e.replace(K,on):e},Zn.escapeRegExp=function(e){return(e=wa(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Zn.every=function(e,t,n){var r=Ws(e)?It:mr;return n&&xo(e,t,n)&&(t=i),r(e,uo(t,3))},Zn.find=bs,Zn.findIndex=Vo,Zn.findKey=function(e,t){return jt(e,uo(t,3),xr)},Zn.findLast=vs,Zn.findLastIndex=Wo,Zn.findLastKey=function(e,t){return jt(e,uo(t,3),Ar)},Zn.floor=Ac,Zn.forEach=ws,Zn.forEachRight=xs,Zn.forIn=function(e,t){return null==e?e:vr(e,uo(t,3),Ba)},Zn.forInRight=function(e,t){return null==e?e:wr(e,uo(t,3),Ba)},Zn.forOwn=function(e,t){return e&&xr(e,uo(t,3))},Zn.forOwnRight=function(e,t){return e&&Ar(e,uo(t,3))},Zn.get=Ca,Zn.gt=zs,Zn.gte=Gs,Zn.has=function(e,t){return null!=e&&yo(e,t,Cr)},Zn.hasIn=Ia,Zn.head=$o,Zn.identity=oc,Zn.includes=function(e,t,n,r){e=$s(e)?e:Ha(e),n=n&&!r?ga(n):0;var i=e.length;return n<0&&(n=vn(i+n,0)),ua(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Zt(e,t,n)>-1},Zn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ga(n);return i<0&&(i=vn(r+i,0)),Zt(e,t,i)},Zn.inRange=function(e,t,n){return t=ma(t),n===i?(n=t,t=0):n=ma(n),function(e,t,n){return e>=wn(t,n)&&e=-9007199254740991&&e<=h},Zn.isSet=ca,Zn.isString=ua,Zn.isSymbol=la,Zn.isTypedArray=da,Zn.isUndefined=function(e){return e===i},Zn.isWeakMap=function(e){return ra(e)&&go(e)==P},Zn.isWeakSet=function(e){return ra(e)&&"[object WeakSet]"==Tr(e)},Zn.join=function(e,t){return null==e?"":Wt.call(e,t)},Zn.kebabCase=Wa,Zn.last=Jo,Zn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ga(n))<0?vn(r+o,0):wn(o,r-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ut(e,zt,o,!0)},Zn.lowerCase=qa,Zn.lowerFirst=$a,Zn.lt=fa,Zn.lte=pa,Zn.max=function(e){return e&&e.length?gr(e,oc,Sr):i},Zn.maxBy=function(e,t){return e&&e.length?gr(e,uo(t,2),Sr):i},Zn.mean=function(e){return Gt(e,oc)},Zn.meanBy=function(e,t){return Gt(e,uo(t,2))},Zn.min=function(e){return e&&e.length?gr(e,oc,jr):i},Zn.minBy=function(e,t){return e&&e.length?gr(e,uo(t,2),jr):i},Zn.stubArray=yc,Zn.stubFalse=bc,Zn.stubObject=function(){return{}},Zn.stubString=function(){return""},Zn.stubTrue=function(){return!0},Zn.multiply=Ec,Zn.nth=function(e,t){return e&&e.length?Gr(e,ga(t)):i},Zn.noConflict=function(){return pt._===this&&(pt._=Ue),this},Zn.noop=lc,Zn.now=Cs,Zn.pad=function(e,t,n){e=wa(e);var r=(t=ga(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Vi(mt(i),n)+e+Vi(ht(i),n)},Zn.padEnd=function(e,t,n){e=wa(e);var r=(t=ga(t))?pn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=En();return wn(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return Kr(e,t)},Zn.reduce=function(e,t,n){var r=Ws(e)?Mt:qt,i=arguments.length<3;return r(e,uo(t,4),n,i,pr)},Zn.reduceRight=function(e,t,n){var r=Ws(e)?Nt:qt,i=arguments.length<3;return r(e,uo(t,4),n,i,hr)},Zn.repeat=function(e,t,n){return t=(n?xo(e,t,n):t===i)?1:ga(t),Yr(wa(e),t)},Zn.replace=function(){var e=arguments,t=wa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Zn.result=function(e,t,n){var r=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=i);++rh)return[];var n=g,r=wn(e,g);t=uo(t),e-=g;for(var i=Kt(r,t);++n=s)return e;var c=n-pn(r);if(c<1)return r;var u=a?Ai(a,0,c).join(""):e.slice(0,c);if(o===i)return u+r;if(a&&(c+=u.length-c),aa(o)){if(e.slice(c).search(o)){var l,d=u;for(o.global||(o=Se(o.source,wa(me.exec(o))+"g")),o.lastIndex=0;l=o.exec(d);)var f=l.index;u=u.slice(0,f===i?c:f)}}else if(e.indexOf(li(o),c)!=c){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+r},Zn.unescape=function(e){return(e=wa(e))&&Y.test(e)?e.replace($,gn):e},Zn.uniqueId=function(e){var t=++Ne;return wa(e)+t},Zn.upperCase=Xa,Zn.upperFirst=Ja,Zn.each=ws,Zn.eachRight=xs,Zn.first=$o,uc(Zn,function(){var e={};return xr(Zn,(function(t,n){Me.call(Zn.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Zn.VERSION="4.17.21",St(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Zn[e].placeholder=Zn})),St(["drop","take"],(function(e,t){Vn.prototype[e]=function(n){n=n===i?1:vn(ga(n),0);var r=this.__filtered__&&!t?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,g),type:e+(r.__dir__<0?"Right":"")}),r},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),St(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),St(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}})),St(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(oc)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=Xr((function(e,t){return"function"==typeof e?new Vn(this):this.map((function(n){return Rr(n,e,t)}))})),Vn.prototype.reject=function(e){return this.filter(Fs(uo(e)))},Vn.prototype.slice=function(e,t){e=ga(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=ga(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(g)},xr(Vn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Zn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Zn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,c=t instanceof Vn,u=a[0],l=c||Ws(t),d=function(e){var t=o.apply(Zn,Bt([e],a));return r&&f?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var f=this.__chain__,p=!!this.__actions__.length,h=s&&!f,m=c&&!p;if(!s&&l){t=m?t:new Vn(this);var g=e.apply(t,a);return g.__actions__.push({func:ms,args:[d],thisArg:i}),new Gn(g,f)}return h&&m?e.apply(this,a):(g=this.thru(d),h?r?g.value()[0]:g.value():g)})})),St(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Zn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ws(i)?i:[],e)}return this[n]((function(n){return t.apply(Ws(n)?n:[],e)}))}})),xr(Vn.prototype,(function(e,t){var n=Zn[t];if(n){var r=n.name+"";Me.call(Dn,r)||(Dn[r]=[]),Dn[r].push({name:t,func:n})}})),Dn[Zi(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ws(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Zn.prototype.plant=function(e){for(var t,n=this;n instanceof zn;){var r=Zo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Zn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:ms,args:[ns],thisArg:i}),new Gn(t,this.__chain__)}return this.thru(ns)},Zn.prototype.toJSON=Zn.prototype.valueOf=Zn.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},Zn.prototype.first=Zn.prototype.head,Xe&&(Zn.prototype[Xe]=function(){return this}),Zn}();pt._=yn,(r=function(){return yn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},14841:function(e,t,n){var r=n(27561),i=n(13218),o=n(33448),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):s.test(e)?NaN:+e}},53179:function(e){"use strict";function t(e,n,r,i){this.message=e,this.expected=n,this.found=r,this.location=i,this.name="SyntaxError","function"===typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}!function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(t,Error),t.buildMessage=function(e,t){var n={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t,n="";for(t=0;t0){for(t=1,r=1;tpe&&(pe=de,he=[]),he.push(e))}function Ae(e,n,r){return new t(t.buildMessage(e,n),e,n,r)}function Ee(){var e,t;for(e=[],t=_e();t!==i;)e.push(t),t=_e();return e}function _e(){var t,r,o;if(t=function(){var t,n,r,o;t=de,123===e.charCodeAt(de)?(n=l,de++):(n=i,0===me&&xe(d));n!==i&&Me()!==i&&(r=ke())!==i&&Me()!==i?(125===e.charCodeAt(de)?(o=f,de++):(o=i,0===me&&xe(p)),o!==i?(t,t=n={type:"argument",arg:r}):(de=t,t=i)):(de=t,t=i);return t}(),t===i&&(t=function(){var t,r,o,s,a,c,u,b,v,w;t=de,123===e.charCodeAt(de)?(r=l,de++):(r=i,0===me&&xe(d));if(r!==i)if(Me()!==i)if((o=ke())!==i)if(Me()!==i)if(44===e.charCodeAt(de)?(s=h,de++):(s=i,0===me&&xe(m)),s!==i)if(Me()!==i)if(a=de,e.substr(de,6)===g?(c=g,de+=6):(c=i,0===me&&xe(y)),c!==i&&(a,E=c,n.strict&&Ne.unshift(!1),c=E),(a=c)!==i)if((c=Me())!==i)if(44===e.charCodeAt(de)?(u=h,de++):(u=i,0===me&&xe(m)),u!==i)if(Me()!==i){if(b=[],(v=Te())!==i)for(;v!==i;)b.push(v),v=Te();else b=i;b!==i&&(v=Me())!==i?(125===e.charCodeAt(de)?(w=f,de++):(w=i,0===me&&xe(p)),w!==i?(t,x=o,A=b,n.strict&&Ne.shift(),t=r={type:"select",arg:x,cases:A}):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;var x,A;var E;return t}(),t===i&&(t=function(){var t,r,o,s,a,c,u,g,y,A,E;t=de,123===e.charCodeAt(de)?(r=l,de++):(r=i,0===me&&xe(d));if(r!==i)if(Me()!==i)if((o=ke())!==i)if(Me()!==i)if(44===e.charCodeAt(de)?(s=h,de++):(s=i,0===me&&xe(m)),s!==i)if(Me()!==i)if(a=de,e.substr(de,6)===b?(c=b,de+=6):(c=i,0===me&&xe(v)),c===i&&(e.substr(de,13)===w?(c=w,de+=13):(c=i,0===me&&xe(x))),c!==i&&(a,_=c,Ne.unshift(!0),c=_),(a=c)!==i)if((c=Me())!==i)if(44===e.charCodeAt(de)?(u=h,de++):(u=i,0===me&&xe(m)),u!==i)if(Me()!==i)if(g=function(){var t,n,r,o;me++,t=de,Me()!==i?(e.substr(de,6)===S?(n=S,de+=6):(n=i,0===me&&xe(C)),n!==i&&Me()!==i?(58===e.charCodeAt(de)?(r=":",de++):(r=i,0===me&&xe(I)),r!==i&&Me()!==i&&(o=Be())!==i&&Me()!==i?(t,t=o):(de=t,t=i)):(de=t,t=i)):(de=t,t=i);me--,t===i&&(i,0===me&&xe(T));return t}(),g===i&&(g=null),g!==i){if(y=[],(A=Se())!==i)for(;A!==i;)y.push(A),A=Se();else y=i;y!==i&&(A=Me())!==i?(125===e.charCodeAt(de)?(E=f,de++):(E=i,0===me&&xe(p)),E!==i?(t,t=r=function(e,t,r,i){var o=("selectordinal"===t?n.ordinal:n.cardinal)||["zero","one","two","few","many","other"];return o&&o.length&&i.forEach((function(n){if(isNaN(n.key)&&o.indexOf(n.key)<0)throw new Error("Invalid key `"+n.key+"` for argument `"+e+"`. Valid "+t+" keys for this locale are `"+o.join("`, `")+"`, and explicit keys like `=0`.")})),Ne.shift(),{type:t,arg:e,offset:r||0,cases:i}}(o,a,g,y)):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;var _;return t}(),t===i&&(t=function(){var t,r,o,s,a,c,u;t=de,123===e.charCodeAt(de)?(r=l,de++):(r=i,0===me&&xe(d));r!==i&&Me()!==i&&(o=ke())!==i&&Me()!==i?(44===e.charCodeAt(de)?(s=h,de++):(s=i,0===me&&xe(m)),s!==i&&Me()!==i?(a=function(){var t,r,o,s,a;e.substr(de,6)===R?(t=R,de+=6):(t=i,0===me&&xe(D));t===i&&(e.substr(de,4)===P?(t=P,de+=4):(t=i,0===me&&xe(B)),t===i&&(e.substr(de,4)===M?(t=M,de+=4):(t=i,0===me&&xe(N)),t===i&&(e.substr(de,8)===F?(t=F,de+=8):(t=i,0===me&&xe(L)),t===i&&(e.substr(de,7)===j?(t=j,de+=7):(t=i,0===me&&xe(U)),t===i&&(e.substr(de,8)===Z?(t=Z,de+=8):(t=i,0===me&&xe(H)),t===i&&(t=de,r=de,me++,e.substr(de,6)===g?(o=g,de+=6):(o=i,0===me&&xe(y)),me--,o===i?r=void 0:(de=r,r=i),r!==i?(o=de,me++,e.substr(de,6)===b?(s=b,de+=6):(s=i,0===me&&xe(v)),me--,s===i?o=void 0:(de=o,o=i),o!==i?(s=de,me++,e.substr(de,13)===w?(a=w,de+=13):(a=i,0===me&&xe(x)),me--,a===i?s=void 0:(de=s,s=i),s!==i&&(a=ke())!==i?(de,(function(e){if(n.strict||/^\d/.test(e))return!1;switch(e.toLowerCase()){case"select":case"plural":case"selectordinal":return!1;default:return!0}}(a)?void 0:i)!==i?(t,t=r=a):(de=t,t=i)):(de=t,t=i)):(de=t,t=i)):(de=t,t=i)))))));return t}(),a!==i&&Me()!==i?(c=function(){var t,r,o,s;if(t=de,Me()!==i)if(44===e.charCodeAt(de)?(r=h,de++):(r=i,0===me&&xe(m)),r!==i){for(o=[],s=_e();s!==i;)o.push(s),s=_e();o!==i?(de,(s=(s=!n.strict)?void 0:i)!==i?(t,t={tokens:o}):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;else de=t,t=i;if(t===i)if(t=de,Me()!==i)if(44===e.charCodeAt(de)?(r=h,de++):(r=i,0===me&&xe(m)),r!==i){for(o=[],s=Ie();s!==i;)o.push(s),s=Ie();o!==i?(t,t={tokens:[o.join("")]}):(de=t,t=i)}else de=t,t=i;else de=t,t=i;return t}(),c===i&&(c=null),c!==i?(125===e.charCodeAt(de)?(u=f,de++):(u=i,0===me&&xe(p)),u!==i?(t,t=r={type:"function",arg:o,key:a,param:c}):(de=t,t=i)):(de=t,t=i)):(de=t,t=i)):(de=t,t=i)):(de=t,t=i);return t}(),t===i&&(t=de,35===e.charCodeAt(de)?(r="#",de++):(r=i,0===me&&xe(a)),r!==i?(de,(o=(o=c())?void 0:i)!==i?(t,t=r={type:"octothorpe"}):(de=t,t=i)):(de=t,t=i),t===i))))){if(t=de,r=[],(o=Pe())!==i)for(;o!==i;)r.push(o),o=Pe();else r=i;r!==i&&(t,r=u(r)),t=r}return t}function ke(){var t,n,r;if(me++,t=de,n=[],E.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(_)),r!==i)for(;r!==i;)n.push(r),E.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(_));else n=i;return t=n!==i?e.substring(t,de):n,me--,t===i&&(n=i,0===me&&xe(A)),t}function Te(){var e,t,n;return e=de,Me()!==i&&(t=ke())!==i&&Me()!==i&&(n=Ce())!==i?(e,e=k(t,n)):(de=e,e=i),e}function Se(){var t,n,r;return t=de,Me()!==i?(n=function(){var t,n,r;(t=ke())===i&&(t=de,61===e.charCodeAt(de)?(n="=",de++):(n=i,0===me&&xe(O)),n!==i&&(r=Be())!==i?(t,t=n=r):(de=t,t=i));return t}(),n!==i&&Me()!==i&&(r=Ce())!==i?(t,t=k(n,r)):(de=t,t=i)):(de=t,t=i),t}function Ce(){var t,n,r,o,s,a;if(t=de,123===e.charCodeAt(de)?(n=l,de++):(n=i,0===me&&xe(d)),n!==i)if(r=de,(o=Me())!==i?(s=de,me++,123===e.charCodeAt(de)?(a=l,de++):(a=i,0===me&&xe(d)),me--,a!==i?(de=s,s=void 0):s=i,s!==i?r=o=[o,s]:(de=r,r=i)):(de=r,r=i),r===i&&(r=null),r!==i){for(o=[],s=_e();s!==i;)o.push(s),s=_e();o!==i&&(s=Me())!==i?(125===e.charCodeAt(de)?(a=f,de++):(a=i,0===me&&xe(p)),a!==i?(t,t=n=o):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;else de=t,t=i;return t}function Ie(){var t,n,r,o;if(me++,t=de,n=[],G.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(V)),r!==i)for(;r!==i;)n.push(r),G.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(V));else n=i;if(n!==i&&(t,n=n.join("")),(t=n)===i&&(t=Oe())===i&&(t=de,39===e.charCodeAt(de)?(n=W,de++):(n=i,0===me&&xe(q)),n!==i&&(r=Re())!==i?(39===e.charCodeAt(de)?(o=W,de++):(o=i,0===me&&xe(q)),o!==i?(t,t=n=r):(de=t,t=i)):(de=t,t=i),t===i))if(t=de,123===e.charCodeAt(de)?(n=l,de++):(n=i,0===me&&xe(d)),n!==i){for(r=[],o=Ie();o!==i;)r.push(o),o=Ie();r!==i?(125===e.charCodeAt(de)?(o=f,de++):(o=i,0===me&&xe(p)),o!==i?(t,n=function(e){return"{"+e.join("")+"}"}(r),t=n):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;return me--,t===i&&(n=i,0===me&&xe(z)),t}function Oe(){var t,n;return me++,t=de,"''"===e.substr(de,2)?(n="''",de+=2):(n=i,0===me&&xe(K)),n!==i&&(t,n="'"),me--,(t=n)===i&&(n=i,0===me&&xe($)),t}function Re(){var t,n,r;if((t=Oe())===i){if(t=de,n=[],Y.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(X)),r!==i)for(;r!==i;)n.push(r),Y.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(X));else n=i;n!==i&&(t,n=u(n)),t=n}return t}function De(){var t,n,r,o,s,a;if(me++,t=function(){var t,n,r,o;if(t=de,"'{"===e.substr(de,2)?(n="'{",de+=2):(n=i,0===me&&xe(J)),n!==i){for(r=[],o=Re();o!==i;)r.push(o),o=Re();r!==i?(39===e.charCodeAt(de)?(o=W,de++):(o=i,0===me&&xe(q)),o!==i?(t,t=n="{"+r.join("")):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;if(t===i)if(t=de,"'}"===e.substr(de,2)?(n="'}",de+=2):(n=i,0===me&&xe(Q)),n!==i){for(r=[],o=Re();o!==i;)r.push(o),o=Re();r!==i?(39===e.charCodeAt(de)?(o=W,de++):(o=i,0===me&&xe(q)),o!==i?(t,t=n="}"+r.join("")):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;return t}(),t===i){if(t=de,n=de,r=de,"'#"===e.substr(de,2)?(o="'#",de+=2):(o=i,0===me&&xe(te)),o!==i){for(s=[],a=Re();a!==i;)s.push(a),a=Re();s!==i?(39===e.charCodeAt(de)?(a=W,de++):(a=i,0===me&&xe(q)),a!==i?(r,r=o="#"+s.join("")):(de=r,r=i)):(de=r,r=i)}else de=r,r=i;r!==i?(de,(o=(o=c())?void 0:i)!==i?n=r=[r,o]:(de=n,n=i)):(de=n,n=i),n!==i&&(t,n=n[0]),(t=n)===i&&(39===e.charCodeAt(de)?(t=W,de++):(t=i,0===me&&xe(q)))}return me--,t===i&&(n=i,0===me&&xe(ee)),t}function Pe(){var t,n;return(t=Oe())===i&&(t=De())===i&&(t=de,35===e.charCodeAt(de)?(n="#",de++):(n=i,0===me&&xe(a)),n!==i?(de,(!Ne[0]?void 0:i)!==i?(t,t=n=n):(de=t,t=i)):(de=t,t=i),t===i&&(t=function(){var t;return me++,re.test(e.charAt(de))?(t=e.charAt(de),de++):(t=i,0===me&&xe(ie)),me--,t===i&&0===me&&xe(ne),t}())),t}function Be(){var t,n,r;if(me++,t=de,n=[],se.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(ae)),r!==i)for(;r!==i;)n.push(r),se.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(ae));else n=i;return t=n!==i?e.substring(t,de):n,me--,t===i&&(n=i,0===me&&xe(oe)),t}function Me(){var t,n,r;for(me++,t=de,n=[],ue.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(le));r!==i;)n.push(r),ue.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(le));return t=n!==i?e.substring(t,de):n,me--,t===i&&(n=i,0===me&&xe(ce)),t}var Ne=[!1];if((r=s())!==i&&de===e.length)return r;throw r!==i&&de0&&(t[n]=e)})),t},A.truncate=function(e,t){var n;return"string"===typeof e?n=e.slice(0,t):A.isArray(e)?(n=[],A.each(e,(function(e){n.push(A.truncate(e,t))}))):A.isObject(e)?(n={},A.each(e,(function(e,r){n[r]=A.truncate(e,t)}))):n=e,n},A.JSONEncode=function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,(function(e){var t=n[e];return"string"===typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'},n=function(e,r){var i="",o=0,s="",a="",l=0,d=i,f=[],p=r[e];switch(p&&"object"===typeof p&&"function"===typeof p.toJSON&&(p=p.toJSON(e)),typeof p){case"string":return t(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(i+=" ",f=[],"[object Array]"===c.apply(p)){for(l=p.length,o=0;o="0"&&t<="9";)n+=t,s();if("."===t)for(n+=".";s()&&t>="0"&&t<="9";)n+=t;if("e"===t||"E"===t)for(n+=t,s(),"-"!==t&&"+"!==t||(n+=t,s());t>="0"&&t<="9";)n+=t,s();if(e=+n,isFinite(e))return e;o("Bad number")},c=function(){var e,n,r,a="";if('"'===t)for(;s();){if('"'===t)return s(),a;if("\\"===t)if(s(),"u"===t){for(r=0,n=0;n<4&&(e=parseInt(s(),16),isFinite(e));n+=1)r=16*r+e;a+=String.fromCharCode(r)}else{if("string"!==typeof i[t])break;a+=i[t]}else a+=t}o("Bad string")},u=function(){for(;t&&t<=" ";)s()};return r=function(){switch(u(),t){case"{":return function(){var e,n={};if("{"===t){if(s("{"),u(),"}"===t)return s("}"),n;for(;t;){if(e=c(),u(),s(":"),Object.hasOwnProperty.call(n,e)&&o('Duplicate key "'+e+'"'),n[e]=r(),u(),"}"===t)return s("}"),n;s(","),u()}}o("Bad object")}();case"[":return function(){var e=[];if("["===t){if(s("["),u(),"]"===t)return s("]"),e;for(;t;){if(e.push(r()),u(),"]"===t)return s("]"),e;s(","),u()}}o("Bad array")}();case'"':return c();case"-":return a();default:return t>="0"&&t<="9"?a():function(){switch(t){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}o('Unexpected "'+t+'"')}()}},function(i){var s;return n=i,e=0,t=" ",s=r(),u(),t&&o("Syntax error"),s}}(),A.base64Encode=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,u="",l=[];if(!e)return e;e=A.utf8Encode(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[c++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},A.UUID=function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)};return function(){var t=(h.height*h.width).toString(16);return e()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=m,r=[],i=0;function o(e,t){var n,i=0;for(n=0;n=4&&(i=o(i,r),r=[]);return r.length>0&&(i=o(i,r)),i.toString(16)}()+"-"+t+"-"+e()}}();var T=["ahrefsbot","baiduspider","bingbot","bingpreview","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];A.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t=0}function r(t){if(!f.getElementsByTagName)return[];var r,i,o,s,a,c,u,l,d,p,h=t.split(" "),m=[f];for(c=0;c-1){o=(i=r.split("#"))[0];var g=i[1],y=f.getElementById(g);if(!y||o&&y.nodeName.toLowerCase()!=o)return[];m=[y]}else if(r.indexOf(".")>-1){o=(i=r.split("."))[0];var b=i[1];for(o||(o="*"),s=[],a=0,u=0;u-1};break;default:w=function(e){return e.getAttribute(x)}}for(m=[],p=0,u=0;u=3?t[2]:""},properties:function(){return A.extend(A.strip_empty_properties({$os:A.info.os(),$browser:A.info.browser(m,d.vendor,p),$referrer:f.referrer,$referring_domain:A.info.referringDomain(f.referrer),$device:A.info.device(m)}),{$current_url:t.location.href,$browser_version:A.info.browserVersion(m,d.vendor,p),$screen_height:h.height,$screen_width:h.width,mp_lib:"web",$lib_version:n.LIB_VERSION,$insert_id:O(),time:A.timestamp()/1e3})},people_properties:function(){return A.extend(A.strip_empty_properties({$os:A.info.os(),$browser:A.info.browser(m,d.vendor,p)}),{$browser_version:A.info.browserVersion(m,d.vendor,p)})},pageviewInfo:function(e){return A.strip_empty_properties({mp_page:e,mp_referrer:f.referrer,mp_browser:A.info.browser(m,d.vendor,p),mp_platform:A.info.os()})}};var O=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},R=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,D=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,P=function(e){var t=D,n=e.split("."),r=n[n.length-1];(r.length>4||"com"===r||"org"===r)&&(t=R);var i=e.match(t);return i?i[0]:""},B=null,M=null;"undefined"!==typeof JSON&&(B=JSON.stringify,M=JSON.parse),B=B||A.JSONEncode,M=M||A.JSONDecode,A.toArray=A.toArray,A.isObject=A.isObject,A.JSONEncode=A.JSONEncode,A.JSONDecode=A.JSONDecode,A.isBlockedUA=A.isBlockedUA,A.isEmptyObject=A.isEmptyObject,A.info=A.info,A.info.device=A.info.device,A.info.browser=A.info.browser,A.info.browserVersion=A.info.browserVersion,A.info.properties=A.info.properties;var N=function(){};N.prototype.create_properties=function(){},N.prototype.event_handler=function(){},N.prototype.after_track_handler=function(){},N.prototype.init=function(e){return this.mp=e,this},N.prototype.track=function(e,t,n,r){var i=this,o=A.dom_query(e);if(0!==o.length)return A.each(o,(function(e){A.register_event(e,this.override_event,(function(e){var o={},s=i.create_properties(n,this),a=i.mp.get_config("track_links_timeout");i.event_handler(e,this,o),window.setTimeout(i.track_callback(r,s,o,!0),a),i.mp.track(t,s,i.track_callback(r,s,o))}))}),this),!0;E.error("The DOM query ("+e+") returned 0 elements")},N.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(r,t)||i.after_track_handler(t,n,r))}},N.prototype.create_properties=function(e,t){return"function"===typeof e?e(t):A.extend({},e)};var F=function(){this.override_event="click"};A.inherit(F,N),F.prototype.create_properties=function(e,t){var n=F.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},F.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},F.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var L=function(){this.override_event="submit"};A.inherit(L,N),L.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},L.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var j=k("lock"),U=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};U.prototype.withLock=function(e,t,n){n||"function"===typeof t||(n=t,t=null);var r=n||(new Date).getTime()+"|"+Math.random(),i=(new Date).getTime(),o=this.storageKey,s=this.pollIntervalMS,a=this.timeoutMS,c=this.storage,u=o+":X",l=o+":Y",d=o+":Z",f=function(e){t&&t(e)},p=function(e){if((new Date).getTime()-i>a)return j.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+r+"]"),c.removeItem(d),c.removeItem(l),void g();setTimeout((function(){try{e()}catch(t){f(t)}}),s*(Math.random()+.1))},h=function(e,t){e()?t():p((function(){h(e,t)}))},m=function(){var e=c.getItem(l);if(e&&e!==r)return!1;if(c.setItem(l,r),c.getItem(l)===r)return!0;if(!C(c,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},g=function(){c.setItem(u,r),h(m,(function(){c.getItem(u)!==r?p((function(){c.getItem(l)===r?h((function(){return!c.getItem(d)}),y):g()})):y()}))},y=function(){c.setItem(d,"1");try{e()}finally{c.removeItem(d),c.getItem(l)===r&&c.removeItem(l),c.getItem(u)===r&&c.removeItem(u)}};try{if(!C(c,!0))throw new Error("localStorage support check failed");g()}catch(b){f(b)}};var Z=k("batch"),H=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||A.bind(Z.error,Z),this.lock=new U(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};H.prototype.enqueue=function(e,t,n){var r={id:O(),flushAfter:(new Date).getTime()+2*t,payload:e};this.lock.withLock(A.bind((function(){var t;try{var i=this.readFromStorage();i.push(r),(t=this.saveToStorage(i))&&this.memQueue.push(r)}catch(o){this.reportError("Error enqueueing item",e),t=!1}n&&n(t)}),this),A.bind((function(e){this.reportError("Error acquiring storage lock",e),n&&n(!1)}),this),this.pid)},H.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.lengtho.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}}return t};var z=function(e,t){var n=[];return A.each(e,(function(e){e.id&&!t[e.id]&&n.push(e)})),n};H.prototype.removeItemsByID=function(e,t){var n={};A.each(e,(function(e){n[e]=!0})),this.memQueue=z(this.memQueue,n);var r=A.bind((function(){var t;try{var r=this.readFromStorage();if(r=z(r,n),t=this.saveToStorage(r)){r=this.readFromStorage();for(var i=0;i=t)this.reportError("Network timeout; retrying"),this.flush();else if(A.isObject(o)&&o.xhr_req&&(o.xhr_req.status>=500||429===o.xhr_req.status||"timeout"===o.error)){var c=2*this.flushInterval,u=o.xhr_req.responseHeaders;if(u){var l=u["Retry-After"];l&&(c=1e3*parseInt(l,10)||c)}c=Math.min(6e5,c),this.reportError("Error; retry in "+c+" ms"),this.scheduleFlush(c)}else if(A.isObject(o)&&o.xhr_req&&413===o.xhr_req.status)if(i.length>1){var d=Math.max(1,Math.floor(r/2));this.batchSize=Math.min(this.batchSize,d,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),a=!0;else a=!0;a&&this.queue.removeItemsByID(A.map(i,(function(e){return e.id})),A.bind((function(e){e?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())}),this))}catch(f){this.reportError("Error handling API response",f),this.resetFlush()}}),this),c={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(c.transport="sendBeacon"),V.log("MIXPANEL REQUEST:",o),this.sendRequest(o,c,a)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}},W.prototype.reportError=function(e,t){if(V.error.apply(V.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(t){V.error(t)}};function q(e,t){ie(!0,e,t)}function $(e,t){ie(!1,e,t)}function K(e,t){return"1"===re(e,t)}function Y(e,n){if(function(e){if(e&&e.ignoreDnt)return!1;var n=e&&e.window||t,r=n.navigator||{},i=!1;return A.each([r.doNotTrack,r.msDoNotTrack,n.doNotTrack],(function(e){A.includes([!0,1,"1","yes"],e)&&(i=!0)})),i}(n))return E.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r="0"===re(e,n);return r&&E.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function X(e){return oe(e,(function(e){return this.get_config(e)}))}function J(e){return oe(e,(function(e){return this._get_config(e)}))}function Q(e){return oe(e,(function(e){return this._get_config(e)}))}function ee(e,t){te(t=t||{}).remove(ne(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function te(e){return"localStorage"===(e=e||{}).persistenceType?A.localStorage:A.cookie}function ne(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function re(e,t){return te(t).get(ne(e,t))}function ie(e,t,n){A.isString(t)&&t.length?(te(n=n||{}).set(ne(t,n),e?1:0,A.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):E.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function oe(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");r&&(n=Y(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(u){E.error("Unexpected error when checking tracking opt-out status: "+u)}if(!n)return e.apply(this,arguments);var c=arguments[arguments.length-1];"function"===typeof c&&c(0)}}var se="$set",ae="$set_once",ce="$unset",ue="$add",le="$append",de="$union",fe="$remove",pe={set_action:function(e,t){var n={},r={};return A.isObject(e)?A.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=e)}),this):r[e]=t,n.$set=r,n},unset_action:function(e){var t={},n=[];return A.isArray(e)||(e=[e]),A.each(e,(function(e){this._is_reserved_property(e)||n.push(e)}),this),t.$unset=n,t},set_once_action:function(e,t){var n={},r={};return A.isObject(e)?A.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=e)}),this):r[e]=t,n.$set_once=r,n},union_action:function(e,t){var n={},r={};return A.isObject(e)?A.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=A.isArray(e)?e:[e])}),this):r[e]=A.isArray(t)?t:[t],n.$union=r,n},append_action:function(e,t){var n={},r={};return A.isObject(e)?A.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=e)}),this):r[e]=t,n.$append=r,n},remove_action:function(e,t){var n={},r={};return A.isObject(e)?A.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=e)}),this):r[e]=t,n.$remove=r,n},delete_action:function(){var e={$delete:""};return e}},he=function(){};A.extend(he.prototype,pe),he.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},he.prototype.set=Q((function(e,t,n){var r=this.set_action(e,t);return A.isObject(e)&&(n=t),this._send_request(r,n)})),he.prototype.set_once=Q((function(e,t,n){var r=this.set_once_action(e,t);return A.isObject(e)&&(n=t),this._send_request(r,n)})),he.prototype.unset=Q((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),he.prototype.union=Q((function(e,t,n){A.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)})),he.prototype.delete=Q((function(e){var t=this.delete_action();return this._send_request(t,e)})),he.prototype.remove=Q((function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)})),he.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=A.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/groups/",batcher:this._mixpanel.request_batchers.groups},t)},he.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},he.prototype._get_config=function(e){return this._mixpanel.get_config(e)},he.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},he.prototype.remove=he.prototype.remove,he.prototype.set=he.prototype.set,he.prototype.set_once=he.prototype.set_once,he.prototype.union=he.prototype.union,he.prototype.unset=he.prototype.unset,he.prototype.toString=he.prototype.toString;var me=function(){};A.extend(me.prototype,pe),me.prototype._init=function(e){this._mixpanel=e},me.prototype.set=J((function(e,t,n){var r=this.set_action(e,t);return A.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r.$set=A.extend({},A.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),r.$set),this._send_request(r,n)})),me.prototype.set_once=J((function(e,t,n){var r=this.set_once_action(e,t);return A.isObject(e)&&(n=t),this._send_request(r,n)})),me.prototype.unset=J((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),me.prototype.increment=J((function(e,t,n){var r={},i={};return A.isObject(e)?(A.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void E.error("Invalid increment value passed to mixpanel.people.increment - must be a number");i[t]=e}}),this),n=t):(A.isUndefined(t)&&(t=1),i[e]=t),r.$add=i,this._send_request(r,n)})),me.prototype.append=J((function(e,t,n){A.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)})),me.prototype.remove=J((function(e,t,n){A.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)})),me.prototype.union=J((function(e,t,n){A.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)})),me.prototype.track_charge=J((function(e,t,n){if(A.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",A.extend({$amount:e},t),n);E.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),me.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},me.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}E.error("mixpanel.people.delete_user() requires you to call identify() first")},me.prototype.toString=function(){return this._mixpanel.toString()+".people"},me.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=A.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),A.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),A.truncate(o,255))},me.prototype._get_config=function(e){return this._mixpanel.get_config(e)},me.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},me.prototype._enqueue=function(e){se in e?this._mixpanel.persistence._add_to_people_queue(se,e):ae in e?this._mixpanel.persistence._add_to_people_queue(ae,e):ce in e?this._mixpanel.persistence._add_to_people_queue(ce,e):ue in e?this._mixpanel.persistence._add_to_people_queue(ue,e):le in e?this._mixpanel.persistence._add_to_people_queue(le,e):fe in e?this._mixpanel.persistence._add_to_people_queue(fe,e):de in e?this._mixpanel.persistence._add_to_people_queue(de,e):E.error("Invalid call to _enqueue():",e)},me.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=A.extend({},this._mixpanel.persistence._get_queue(e)),s=o;A.isUndefined(o)||!A.isObject(o)||A.isEmptyObject(o)||(i._mixpanel.persistence._pop_from_people_queue(e,o),r&&(s=r(o)),t.call(i,s,(function(t,r){0===t&&i._mixpanel.persistence._add_to_people_queue(e,o),A.isUndefined(n)||n(t,r)})))},me.prototype._flush=function(e,t,n,r,i,o,s){var a=this,c=this._mixpanel.persistence._get_queue(le),u=this._mixpanel.persistence._get_queue(fe);if(this._flush_one_queue(se,this.set,e),this._flush_one_queue(ae,this.set_once,r),this._flush_one_queue(ce,this.unset,o,(function(e){return A.keys(e)})),this._flush_one_queue(ue,this.increment,t),this._flush_one_queue(de,this.union,i),!A.isUndefined(c)&&A.isArray(c)&&c.length){for(var l,d=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(le,l),A.isUndefined(n)||n(e,t)},f=c.length-1;f>=0;f--)l=c.pop(),A.isEmptyObject(l)||a.append(l,d);a._mixpanel.persistence.save()}if(!A.isUndefined(u)&&A.isArray(u)&&u.length){for(var p,h=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(fe,p),A.isUndefined(s)||s(e,t)},m=u.length-1;m>=0;m--)p=u.pop(),A.isEmptyObject(p)||a.remove(p,h);a._mixpanel.persistence.save()}},me.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},me.prototype.set=me.prototype.set,me.prototype.set_once=me.prototype.set_once,me.prototype.unset=me.prototype.unset,me.prototype.increment=me.prototype.increment,me.prototype.append=me.prototype.append,me.prototype.remove=me.prototype.remove,me.prototype.union=me.prototype.union,me.prototype.track_charge=me.prototype.track_charge,me.prototype.clear_charges=me.prototype.clear_charges,me.prototype.delete_user=me.prototype.delete_user,me.prototype.toString=me.prototype.toString;var ge,ye,be="__mps",ve="__mpso",we="__mpus",xe="__mpa",Ae="__mpap",Ee="__mpr",_e="__mpu",ke="$people_distinct_id",Te="__alias",Se="__timers",Ce=[be,ve,we,xe,Ae,Ee,_e,ke,Te,Se],Ie=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(E.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&A.localStorage.is_supported()?this.storage=A.localStorage:this.storage=A.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};Ie.prototype.properties=function(){var e={};return A.each(this.props,(function(t,n){A.include(Ce,n)||(e[n]=t)})),e},Ie.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=A.extend({},e))}},Ie.prototype.upgrade=function(e){var t,n,r=e.upgrade;r&&(t="mp_super_properties","string"===typeof r&&(t=r),n=this.storage.parse(t),this.storage.remove(t),this.storage.remove(t,!0),n&&(this.props=A.extend(this.props,n.all,n.events))),e.cookie_name||"mixpanel"===e.name||(t="mp_"+e.token+"_"+e.name,(n=this.storage.parse(t))&&(this.storage.remove(t),this.storage.remove(t,!0),this.register_once(n))),this.storage===A.localStorage&&(n=A.cookie.parse(this.name),A.cookie.remove(this.name),A.cookie.remove(this.name,!0),n&&this.register_once(n))},Ie.prototype.save=function(){this.disabled||this.storage.set(this.name,A.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Ie.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Ie.prototype.clear=function(){this.remove(),this.props={}},Ie.prototype.register_once=function(e,t,n){return!!A.isObject(e)&&("undefined"===typeof t&&(t="None"),this.expire_days="undefined"===typeof n?this.default_expiry:n,A.each(e,(function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)}),this),this.save(),!0)},Ie.prototype.register=function(e,t){return!!A.isObject(e)&&(this.expire_days="undefined"===typeof t?this.default_expiry:t,A.extend(this.props,e),this.save(),!0)},Ie.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())},Ie.prototype.update_campaign_params=function(){this.campaign_params_saved||(this.register_once(A.info.campaignParams()),this.campaign_params_saved=!0)},Ie.prototype.update_search_keyword=function(e){this.register(A.info.searchInfo(e))},Ie.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:A.info.referringDomain(e)||"$direct"},"")},Ie.prototype.get_referrer_info=function(){return A.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Ie.prototype.safe_merge=function(e){return A.each(this.props,(function(t,n){n in e||(e[n]=t)})),e},Ie.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Ie.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Ie.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Ie.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Ie.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Ie.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Ie.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Ie.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(se),o=this._get_or_create_queue(ae),s=this._get_or_create_queue(ce),a=this._get_or_create_queue(ue),c=this._get_or_create_queue(de),u=this._get_or_create_queue(fe,[]),l=this._get_or_create_queue(le,[]);n===be?(A.extend(i,r),this._pop_from_people_queue(ue,r),this._pop_from_people_queue(de,r),this._pop_from_people_queue(ce,r)):n===ve?(A.each(r,(function(e,t){t in o||(o[t]=e)})),this._pop_from_people_queue(ce,r)):n===we?A.each(r,(function(e){A.each([i,o,a,c],(function(t){e in t&&delete t[e]})),A.each(l,(function(t){e in t&&delete t[e]})),s[e]=!0})):n===xe?(A.each(r,(function(e,t){t in i?i[t]+=e:(t in a||(a[t]=0),a[t]+=e)}),this),this._pop_from_people_queue(ce,r)):n===_e?(A.each(r,(function(e,t){A.isArray(e)&&(t in c||(c[t]=[]),c[t]=c[t].concat(e))})),this._pop_from_people_queue(ce,r)):n===Ee?(u.push(r),this._pop_from_people_queue(le,r)):n===Ae&&(l.push(r),this._pop_from_people_queue(ce,r)),E.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),E.log(t),this.save()},Ie.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);A.isUndefined(n)||(A.each(t,(function(t,r){e===le||e===fe?A.each(n,(function(e){e[r]===t&&delete e[r]})):delete n[r]}),this),this.save())},Ie.prototype._get_queue_key=function(e){return e===se?be:e===ae?ve:e===ce?we:e===ue?xe:e===le?Ae:e===fe?Ee:e===de?_e:void E.error("Invalid queue:",e)},Ie.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]},Ie.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=A.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},Ie.prototype.set_event_timer=function(e,t){var n=this.props.__timers||{};n[e]=t,this.props.__timers=n,this.save()},Ie.prototype.remove_event_timer=function(e){var t=(this.props.__timers||{})[e];return A.isUndefined(t)||(delete this.props.__timers[e],this.save()),t};var Oe=function(e){return e},Re=function(){},De="mixpanel",Pe="base64",Be=t.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Me=!Be&&-1===m.indexOf("MSIE")&&-1===m.indexOf("Mozilla"),Ne=null;d.sendBeacon&&(Ne=function(){return d.sendBeacon.apply(d,arguments)});var Fe={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:Pe,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Re,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Re,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{}},Le=!1,je=function(){},Ue=function(e,t,r){var i,o=r===De?ye:ye[r];if(o&&0===ge)i=o;else{if(o&&!A.isArray(o))return void E.error("You have already initialized "+r);i=new je}return i._cached_groups={},i._init(e,t,r),i.people=new me,i.people._init(i),n.DEBUG=n.DEBUG||i.get_config("debug"),!A.isUndefined(o)&&A.isArray(o)&&(i._execute_array.call(i.people,o.people),i._execute_array(o)),i};je.prototype.init=function(e,t,n){if(A.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==De){var r=Ue(e,t,n);return ye[n]=r,r._loaded(),r}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},je.prototype._init=function(e,n,r){n=n||{},this.__loaded=!0,this.config={};var i={};"api_payload_format"in n||(n.api_host||Fe.api_host).match(/\.mixpanel\.com$/)&&(i.api_payload_format="json");if(this.set_config(A.extend({},Fe,i,n,{name:r,token:e,callback_fn:(r===De?r:"mixpanel."+r)+"._jsc"})),this._jsc=Re,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(A.localStorage.is_supported(!0)&&Be){if(this.init_batchers(),Ne&&t.addEventListener){var o=A.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);t.addEventListener("pagehide",(function(e){e.persisted&&o()})),t.addEventListener("visibilitychange",(function(){"hidden"===f.visibilityState&&o()}))}}else this._batch_requests=!1,E.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");this.persistence=this.cookie=new Ie(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=A.UUID();this.get_distinct_id()||this.register_once({distinct_id:s,$device_id:s},"")},je.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()},je.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(f.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(f.referrer)},je.prototype._dom_loaded=function(){A.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||A.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},je.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!Le)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},je.prototype._prepare_callback=function(e,t){if(A.isUndefined(e))return null;if(Be){return function(n){e(n,t)}}var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i},je.prototype._send_request=function(e,t,n,r){var i=!0;if(Me)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;r||!A.isFunction(n)&&"string"!==typeof n||(r=n,n=null),n=A.extend(o,n||{}),Be||(n.method="GET");var a="POST"===n.method,c=Ne&&a&&"sendbeacon"===n.transport.toLowerCase(),u=n.verbose;t.verbose&&(u=!0),this.get_config("test")&&(t.test=1),u&&(t.verbose=1),this.get_config("img")&&(t.img=1),Be||(r?t.callback=r:(u||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),e+="?"+A.HTTPBuildQuery(t);var l=this;if("img"in t){var d=f.createElement("img");d.src=e,f.body.appendChild(d)}else if(c){try{i=Ne(e,s)}catch(b){l.report_error(b),i=!1}try{r&&r(i?1:0)}catch(b){l.report_error(b)}}else if(Be)try{var p=new XMLHttpRequest;p.open(n.method,e,!0);var h=this.get_config("xhr_headers");if(a&&(h["Content-Type"]="application/x-www-form-urlencoded"),A.each(h,(function(e,t){p.setRequestHeader(t,e)})),n.timeout_ms&&"undefined"!==typeof p.timeout){p.timeout=n.timeout_ms;var m=(new Date).getTime()}p.withCredentials=!0,p.onreadystatechange=function(){var e;if(4===p.readyState)if(200===p.status){if(r)if(u){var t;try{t=A.JSONDecode(p.responseText)}catch(b){if(l.report_error(b),!n.ignore_json_errors)return;t=p.responseText}r(t)}else r(Number(p.responseText))}else e=p.timeout&&!p.status&&(new Date).getTime()-m>=p.timeout?"timeout":"Bad HTTP status: "+p.status+" "+p.statusText,l.report_error(e),r&&r(u?{status:0,error:e,xhr_req:p}:0)},p.send(s)}catch(b){l.report_error(b),i=!1}else{var g=f.createElement("script");g.type="text/javascript",g.async=!0,g.defer=!0,g.src=e;var y=f.getElementsByTagName("script")[0];y.parentNode.insertBefore(g,y)}return i},je.prototype._execute_array=function(e){var t,n=[],r=[],i=[];A.each(e,(function(e){e&&(t=e[0],A.isArray(t)?i.push(e):"function"===typeof e?e.call(this):A.isArray(e)&&"alias"===t?n.push(e):A.isArray(e)&&-1!==t.indexOf("track")&&"function"===typeof this[t]?i.push(e):r.push(e))}),this);var o=function(e,t){A.each(e,(function(e){if(A.isArray(e[0])){var n=t;A.each(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(n,this),o(r,this),o(i,this)},je.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},je.prototype.init_batchers=function(){var e=this.get_config("token");if(!this.are_batchers_initialized()){var t=A.bind((function(t){return new W("__mpq_"+e+t.queue_suffix,{libConfig:this.config,sendRequestFunc:A.bind((function(e,n,r){this._send_request(this.get_config("api_host")+t.endpoint,this._encode_data_for_request(e),n,this._prepare_callback(r,e))}),this),beforeSendHook:A.bind((function(e){return this._run_hook("before_send_"+t.type,e)}),this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:A.bind(this.stop_batch_senders,this)})}),this);this.request_batchers={events:t({type:"events",endpoint:"/track/",queue_suffix:"_ev"}),people:t({type:"people",endpoint:"/engage/",queue_suffix:"_pp"}),groups:t({type:"groups",endpoint:"/groups/",queue_suffix:"_gr"})}}this.get_config("batch_autostart")&&this.start_batch_senders()},je.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,A.each(this.request_batchers,(function(e){e.start()})))},je.prototype.stop_batch_senders=function(){this._batch_requests=!1,A.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},je.prototype.push=function(e){this._execute_array([e])},je.prototype.disable=function(e){"undefined"===typeof e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},je.prototype._encode_data_for_request=function(e){var t=A.JSONEncode(e);return this.get_config("api_payload_format")===Pe&&(t=A.base64Encode(t)),{data:t}},je.prototype._track_or_batch=function(e,t){var n=A.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||Re;var a=!0,c=A.bind((function(){return s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(E.log("MIXPANEL REQUEST:"),E.log(n),this._send_request(r,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null}),this);return this._batch_requests&&!o?i.enqueue(n,(function(e){e?t(1,n):c()})):a=c(),a&&n},je.prototype.track=X((function(e,t,n,r){r||"function"!==typeof n||(r=n,n=null);var i=(n=n||{}).transport;i&&(n.transport=i);var o=n.send_immediately;if("function"!==typeof r&&(r=Re),A.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=t||{}).token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!A.isUndefined(s)){var a=(new Date).getTime()-s;t.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops(),t=A.extend({},A.info.properties(),this.persistence.properties(),this.unpersisted_superprops,t);var c=this.get_config("property_blacklist");A.isArray(c)?A.each(c,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+c);var u={event:e,properties:t};return this._track_or_batch({type:"events",data:u,endpoint:this.get_config("api_host")+"/track/",batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},r)}r(0)}})),je.prototype.set_group=X((function(e,t,n){A.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)})),je.prototype.add_group=X((function(e,t,n){var r=this.get_property(e);if(void 0===r){var i={};i[e]=[t],this.register(i)}else-1===r.indexOf(t)&&(r.push(t),this.register(i));return this.people.union(e,t,n)})),je.prototype.remove_group=X((function(e,t,n){var r=this.get_property(e);if(void 0!==r){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),0===r.length&&this.unregister(e)}return this.people.remove(e,t,n)})),je.prototype.track_with_groups=X((function(e,t,n,r){var i=A.extend({},t||{});return A.each(n,(function(e,t){null!==e&&void 0!==e&&(i[t]=e)})),this.track(e,i,r)})),je.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},je.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},je.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return void 0!==r&&r._group_key===e&&r._group_id===t||((r=new he)._init(this,e,t),this._cached_groups[n]=r),r},je.prototype.track_pageview=function(e){A.isUndefined(e)&&(e=f.location.href),this.track("mp_page_view",A.info.pageviewInfo(e))},je.prototype.track_links=function(){return this._track_dom.call(this,F,arguments)},je.prototype.track_forms=function(){return this._track_dom.call(this,L,arguments)},je.prototype.time_event=function(e){A.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var Ze={persistent:!0},He=function(e){var t;return t=A.isObject(e)?e:A.isUndefined(e)?{}:{days:e},A.extend({},Ze,t)};je.prototype.register=function(e,t){var n=He(t);n.persistent?this.persistence.register(e,n.days):A.extend(this.unpersisted_superprops,e)},je.prototype.register_once=function(e,t,n){var r=He(n);r.persistent?this.persistence.register_once(e,t,r.days):("undefined"===typeof t&&(t="None"),A.each(e,(function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)}),this))},je.prototype.unregister=function(e,t){(t=He(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},je.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},je.prototype.identify=function(e,t,n,r,i,o,s,a){var c=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var u=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==c&&e!==this.get_property(Te)&&(this.unregister(Te),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,s,a),e!==c&&this.track("$identify",{distinct_id:e,$anon_distinct_id:c},{skip_hooks:!0})},je.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=A.UUID();this.register_once({distinct_id:e,$device_id:e},"")},je.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},je.prototype.alias=function(e,t){if(e===this.get_property(ke))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return A.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Te,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},(function(){n.identify(e)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},je.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},je.prototype.set_config=function(e){A.isObject(e)&&(A.extend(this.config,e),e.batch_size&&A.each(this.request_batchers,(function(e){e.resetBatchSize()})),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),n.DEBUG=n.DEBUG||this.get_config("debug"))},je.prototype.get_config=function(e){return this.config[e]},je.prototype._run_hook=function(e){var t=(this.config.hooks[e]||Oe).apply(this,a.call(arguments,1));return"undefined"===typeof t&&(this.report_error(e+" hook did not return a value"),t=null),t},je.prototype.get_property=function(e){return this.persistence.props[e]},je.prototype.toString=function(){var e=this.get_config("name");return e!==De&&(e="mixpanel."+e),e},je.prototype._event_is_disabled=function(e){return A.isBlockedUA(m)||this._flags.disable_all_events||A.include(this.__disabled_events,e)},je.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&A.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!A.cookie.get("mp_optout")||(A.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},je.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t&&A.each(this.request_batchers,(function(e){e.clear()}))},je.prototype._gdpr_call_func=function(e,t){return t=A.extend({track:A.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),A.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},je.prototype.opt_in_tracking=function(e){e=A.extend({enable_persistence:!0},e),this._gdpr_call_func(q,e),this._gdpr_update_persistence(e)},je.prototype.opt_out_tracking=function(e){(e=A.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func($,e),this._gdpr_update_persistence(e)},je.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(K,e)},je.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(Y,e)},je.prototype.clear_opt_in_out_tracking=function(e){e=A.extend({enable_persistence:!0},e),this._gdpr_call_func(ee,e),this._gdpr_update_persistence(e)},je.prototype.report_error=function(e,t){E.error.apply(E.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(t){E.error(t)}},je.prototype.init=je.prototype.init,je.prototype.reset=je.prototype.reset,je.prototype.disable=je.prototype.disable,je.prototype.time_event=je.prototype.time_event,je.prototype.track=je.prototype.track,je.prototype.track_links=je.prototype.track_links,je.prototype.track_forms=je.prototype.track_forms,je.prototype.track_pageview=je.prototype.track_pageview,je.prototype.register=je.prototype.register,je.prototype.register_once=je.prototype.register_once,je.prototype.unregister=je.prototype.unregister,je.prototype.identify=je.prototype.identify,je.prototype.alias=je.prototype.alias,je.prototype.name_tag=je.prototype.name_tag,je.prototype.set_config=je.prototype.set_config,je.prototype.get_config=je.prototype.get_config,je.prototype.get_property=je.prototype.get_property,je.prototype.get_distinct_id=je.prototype.get_distinct_id,je.prototype.toString=je.prototype.toString,je.prototype.opt_out_tracking=je.prototype.opt_out_tracking,je.prototype.opt_in_tracking=je.prototype.opt_in_tracking,je.prototype.has_opted_out_tracking=je.prototype.has_opted_out_tracking,je.prototype.has_opted_in_tracking=je.prototype.has_opted_in_tracking,je.prototype.clear_opt_in_out_tracking=je.prototype.clear_opt_in_out_tracking,je.prototype.get_group=je.prototype.get_group,je.prototype.set_group=je.prototype.set_group,je.prototype.add_group=je.prototype.add_group,je.prototype.remove_group=je.prototype.remove_group,je.prototype.track_with_groups=je.prototype.track_with_groups,je.prototype.start_batch_senders=je.prototype.start_batch_senders,je.prototype.stop_batch_senders=je.prototype.stop_batch_senders,Ie.prototype.properties=Ie.prototype.properties,Ie.prototype.update_search_keyword=Ie.prototype.update_search_keyword,Ie.prototype.update_referrer_info=Ie.prototype.update_referrer_info,Ie.prototype.get_cross_subdomain=Ie.prototype.get_cross_subdomain,Ie.prototype.clear=Ie.prototype.clear;var ze={},Ge=function(){ye.init=function(e,n,r){if(r)return ye[r]||(ye[r]=ze[r]=Ue(e,n,r),ye[r]._loaded()),ye[r];var i=ye;ze.mixpanel?i=ze.mixpanel:e&&((i=Ue(e,n,De))._loaded(),ze.mixpanel=i),ye=i,1===ge&&(t.mixpanel=ye),A.each(ze,(function(e,t){t!==De&&(ye[t]=e)})),ye._=A}};var Ve=(ge=0,ye=new je,Ge(),ye.init(),function(){function e(){e.done||(e.done=!0,Le=!0,Me=!1,A.each(ze,(function(e){e._dom_loaded()})))}if(f.addEventListener)"complete"===f.readyState?e():f.addEventListener("DOMContentLoaded",e,!1);else if(f.attachEvent){f.attachEvent("onreadystatechange",e);var n=!1;try{n=null===t.frameElement}catch(r){}f.documentElement.doScroll&&n&&function t(){try{f.documentElement.doScroll("left")}catch(r){return void setTimeout(t,1)}e()}()}A.register_event(t,"load",e,!0)}(),ye);e.exports=Ve},77913:function(e,t,n){"use strict";var r=n(85696);t.default=void 0;var i,o=(i=n(67294))&&i.__esModule?i:{default:i},s=n(12199),a=n(61587),c=n(27215);var u={};function l(e,t,n,r){if(e&&s.isLocalURL(t)){e.prefetch(t,n,r).catch((function(e){0}));var i=r&&"undefined"!==typeof r.locale?r.locale:e&&e.locale;u[t+"%"+n+(i?"%"+i:"")]=!0}}var d=function(e){var t,n=!1!==e.prefetch,i=a.useRouter(),d=o.default.useMemo((function(){var t=s.resolveHref(i,e.href,!0),n=r(t,2),o=n[0],a=n[1];return{href:o,as:e.as?s.resolveHref(i,e.as):a||o}}),[i,e.href,e.as]),f=d.href,p=d.as,h=e.children,m=e.replace,g=e.shallow,y=e.scroll,b=e.locale;"string"===typeof h&&(h=o.default.createElement("a",null,h));var v=(t=o.default.Children.only(h))&&"object"===typeof t&&t.ref,w=c.useIntersection({rootMargin:"200px"}),x=r(w,2),A=x[0],E=x[1],_=o.default.useCallback((function(e){A(e),v&&("function"===typeof v?v(e):"object"===typeof v&&(v.current=e))}),[v,A]);o.default.useEffect((function(){var e=E&&n&&s.isLocalURL(f),t="undefined"!==typeof b?b:i&&i.locale,r=u[f+"%"+p+(t?"%"+t:"")];e&&!r&&l(i,f,p,{locale:t})}),[p,f,E,b,n,i]);var k={ref:_,onClick:function(e){t.props&&"function"===typeof t.props.onClick&&t.props.onClick(e),e.defaultPrevented||function(e,t,n,r,i,o,a,c){("A"!==e.currentTarget.nodeName.toUpperCase()||!function(e){var t=e.currentTarget.target;return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)&&s.isLocalURL(n))&&(e.preventDefault(),t[i?"replace":"push"](n,r,{shallow:o,locale:c,scroll:a}))}(e,i,f,p,m,g,y,b)},onMouseEnter:function(e){t.props&&"function"===typeof t.props.onMouseEnter&&t.props.onMouseEnter(e),s.isLocalURL(f)&&l(i,f,p,{priority:!0})}};if(e.passHref||"a"===t.type&&!("href"in t.props)){var T="undefined"!==typeof b?b:i&&i.locale,S=i&&i.isLocaleDomain&&s.getDomainLocale(p,T,i&&i.locales,i&&i.domainLocales);k.href=S||s.addBasePath(s.addLocale(p,T,i&&i.defaultLocale))}return o.default.cloneElement(t,k)};t.default=d},27215:function(e,t,n){"use strict";var r=n(85696);Object.defineProperty(t,"__esModule",{value:!0}),t.useIntersection=function(e){var t=e.rootRef,n=e.rootMargin,u=e.disabled||!s,l=i.useRef(),d=i.useState(!1),f=r(d,2),p=f[0],h=f[1],m=i.useState(t?t.current:null),g=r(m,2),y=g[0],b=g[1],v=i.useCallback((function(e){l.current&&(l.current(),l.current=void 0),u||p||e&&e.tagName&&(l.current=function(e,t,n){var r=function(e){var t,n={root:e.root||null,margin:e.rootMargin||""},r=c.find((function(e){return e.root===n.root&&e.margin===n.margin}));r?t=a.get(r):(t=a.get(n),c.push(n));if(t)return t;var i=new Map,o=new IntersectionObserver((function(e){e.forEach((function(e){var t=i.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)}))}),e);return a.set(n,t={id:n,observer:o,elements:i}),t}(n),i=r.id,o=r.observer,s=r.elements;return s.set(e,t),o.observe(e),function(){if(s.delete(e),o.unobserve(e),0===s.size){o.disconnect(),a.delete(i);var t=c.findIndex((function(e){return e.root===i.root&&e.margin===i.margin}));t>-1&&c.splice(t,1)}}}(e,(function(e){return e&&h(e)}),{root:y,rootMargin:n}))}),[u,y,n,p]);return i.useEffect((function(){if(!s&&!p){var e=o.requestIdleCallback((function(){return h(!0)}));return function(){return o.cancelIdleCallback(e)}}}),[p]),i.useEffect((function(){t&&b(t.current)}),[t]),[v,p]};var i=n(67294),o=n(98065),s="undefined"!==typeof IntersectionObserver;var a=new Map,c=[]},17285:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AmpStateContext=void 0;var i=((r=n(67294))&&r.__esModule?r:{default:r}).default.createContext({});t.AmpStateContext=i},49546:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInAmpMode=s,t.useAmp=function(){return s(i.default.useContext(o.AmpStateContext))};var r,i=(r=n(67294))&&r.__esModule?r:{default:r},o=n(17285);function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ampFirst,n=void 0!==t&&t,r=e.hybrid,i=void 0!==r&&r,o=e.hasQuery,s=void 0!==o&&o;return n||i&&s}},16505:function(e,t,n){"use strict";var r=n(930);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}Object.defineProperty(t,"__esModule",{value:!0}),t.defaultHead=d,t.default=void 0;var o,s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(67294)),a=(o=n(70148))&&o.__esModule?o:{default:o},c=n(17285),u=n(60523),l=n(49546);n(67206);function d(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[s.default.createElement("meta",{charSet:"utf-8"})];return e||t.push(s.default.createElement("meta",{name:"viewport",content:"width=device-width"})),t}function f(e,t){return"string"===typeof t||"number"===typeof t?e:t.type===s.default.Fragment?e.concat(s.default.Children.toArray(t.props.children).reduce((function(e,t){return"string"===typeof t||"number"===typeof t?e:e.concat(t)}),[])):e.concat(t)}var p=["name","httpEquiv","charSet","itemProp"];function h(e,t){return e.reduce((function(e,t){var n=s.default.Children.toArray(t.props.children);return e.concat(n)}),[]).reduce(f,[]).reverse().concat(d(t.inAmpMode)).filter(function(){var e=new Set,t=new Set,n=new Set,r={};return function(i){var o=!0,s=!1;if(i.key&&"number"!==typeof i.key&&i.key.indexOf("$")>0){s=!0;var a=i.key.slice(i.key.indexOf("$")+1);e.has(a)?o=!1:e.add(a)}switch(i.type){case"title":case"base":t.has(i.type)?o=!1:t.add(i.type);break;case"meta":for(var c=0,u=p.length;c>16&255)/255,(e>>8&255)/255,(255&e)/255]}["SCREEN","LINEAR_LIGHT"].reduce((function(e,t,n){return Object.assign(e,(0,i.Z)({},t,n))}),{});var p=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,c.Z)(this,e);var o=this,l=-1!==document.location.search.toLowerCase().indexOf("debug=webgl");o.canvas=t,o.gl=o.canvas.getContext("webgl",{antialias:!0}),o.meshes=[];var d=o.gl;n&&r&&this.setSize(n,r),o.lastDebugMsg,o.debug=i&&l?function(e){var t,n=new Date;n-o.lastDebugMsg>1e3&&console.log("---"),(t=console).log.apply(t,[n.toLocaleTimeString()+Array(Math.max(0,32-e.length)).join(" ")+e+": "].concat((0,a.Z)(Array.from(arguments).slice(1)))),o.lastDebugMsg=n}:function(){},Object.defineProperties(o,{Material:{enumerable:!1,value:function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,c.Z)(this,e);var i=this;function a(e,t){var n=d.createShader(e);return d.shaderSource(n,t),d.compileShader(n),d.getShaderParameter(n,d.COMPILE_STATUS)||console.error(d.getShaderInfoLog(n)),o.debug("Material.compileShaderSource",{source:t}),n}function u(e,t){return Object.entries(e).map((function(e){var n=(0,s.Z)(e,2),r=n[0];return n[1].getDeclaration(r,t)})).join("\n")}i.uniforms=r,i.uniformInstances=[];var l="\n precision highp float;\n ";i.vertexSource="\n ".concat(l,"\n attribute vec4 position;\n attribute vec2 uv;\n attribute vec2 uvNorm;\n ").concat(u(o.commonUniforms,"vertex"),"\n ").concat(u(r,"vertex"),"\n ").concat(t,"\n "),i.Source="\n ".concat(l,"\n ").concat(u(o.commonUniforms,"fragment"),"\n ").concat(u(r,"fragment"),"\n ").concat(n,"\n "),i.vertexShader=a(d.VERTEX_SHADER,i.vertexSource),i.fragmentShader=a(d.FRAGMENT_SHADER,i.Source),i.program=d.createProgram(),d.attachShader(i.program,i.vertexShader),d.attachShader(i.program,i.fragmentShader),d.linkProgram(i.program),d.getProgramParameter(i.program,d.LINK_STATUS)||console.error(d.getProgramInfoLog(i.program)),d.useProgram(i.program),i.attachUniforms(void 0,o.commonUniforms),i.attachUniforms(void 0,i.uniforms)}return(0,u.Z)(e,[{key:"attachUniforms",value:function(e,t){var n=this;void 0===e?Object.entries(t).forEach((function(e){var t=(0,s.Z)(e,2),r=t[0],i=t[1];n.attachUniforms(r,i)})):"array"==t.type?t.value.forEach((function(t,r){return n.attachUniforms("".concat(e,"[").concat(r,"]"),t)})):"struct"==t.type?Object.entries(t.value).forEach((function(t){var r=(0,s.Z)(t,2),i=r[0],o=r[1];return n.attachUniforms("".concat(e,".").concat(i),o)})):(o.debug("Material.attachUniforms",{name:e,uniform:t}),n.uniformInstances.push({uniform:t,location:d.getUniformLocation(n.program,e)}))}}]),e}()},Uniform:{enumerable:!1,value:function(){function e(t){(0,c.Z)(this,e),this.type="float",Object.assign(this,t),this.typeFn={float:"1f",int:"1i",vec2:"2fv",vec3:"3fv",vec4:"4fv",mat4:"Matrix4fv"}[this.type]||"1f",this.update()}return(0,u.Z)(e,[{key:"update",value:function(e){void 0!==this.value&&d["uniform".concat(this.typeFn)](e,0===this.typeFn.indexOf("Matrix")?this.transpose:this.value,0===this.typeFn.indexOf("Matrix")?this.value:null)}},{key:"getDeclaration",value:function(e,t,n){var r=this;if(r.excludeFrom!==t){if("array"===r.type)return r.value[0].getDeclaration(e,t,r.value.length)+"\nconst int ".concat(e,"_length = ").concat(r.value.length,";");if("struct"===r.type){var i=e.replace("u_","");return i=i.charAt(0).toUpperCase()+i.slice(1),"uniform struct ".concat(i,"\n {\n")+Object.entries(r.value).map((function(e){var n=(0,s.Z)(e,2),r=n[0];return n[1].getDeclaration(r,t).replace(/^uniform/,"")})).join("")+"\n} ".concat(e).concat(n>0?"[".concat(n,"]"):"",";")}return"uniform ".concat(r.type," ").concat(e).concat(n>0?"[".concat(n,"]"):"",";")}}}]),e}()},PlaneGeometry:{enumerable:!1,value:function(){function e(t,n,r,i,s){(0,c.Z)(this,e),d.createBuffer(),this.attributes={position:new o.Attribute({target:d.ARRAY_BUFFER,size:3}),uv:new o.Attribute({target:d.ARRAY_BUFFER,size:2}),uvNorm:new o.Attribute({target:d.ARRAY_BUFFER,size:2}),index:new o.Attribute({target:d.ELEMENT_ARRAY_BUFFER,size:3,type:d.UNSIGNED_SHORT})},this.setTopology(r,i),this.setSize(t,n,s)}return(0,u.Z)(e,[{key:"setTopology",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this;n.xSegCount=e,n.ySegCount=t,n.vertexCount=(n.xSegCount+1)*(n.ySegCount+1),n.quadCount=n.xSegCount*n.ySegCount*2,n.attributes.uv.values=new Float32Array(2*n.vertexCount),n.attributes.uvNorm.values=new Float32Array(2*n.vertexCount),n.attributes.index.values=new Uint16Array(3*n.quadCount);for(var r=0;r<=n.ySegCount;r++)for(var i=0;i<=n.xSegCount;i++){var s=r*(n.xSegCount+1)+i;if(n.attributes.uv.values[2*s]=i/n.xSegCount,n.attributes.uv.values[2*s+1]=1-r/n.ySegCount,n.attributes.uvNorm.values[2*s]=i/n.xSegCount*2-1,n.attributes.uvNorm.values[2*s+1]=1-r/n.ySegCount*2,i0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"xz",r=this;r.width=e,r.height=t,r.orientation=n,r.attributes.position.values&&r.attributes.position.values.length===3*r.vertexCount||(r.attributes.position.values=new Float32Array(3*r.vertexCount));for(var i=e/-2,s=t/-2,a=e/r.xSegCount,c=t/r.ySegCount,u=0;u<=r.ySegCount;u++)for(var l=s+u*c,d=0;d<=r.xSegCount;d++){var f=i+d*a,p=u*(r.xSegCount+1)+d;r.attributes.position.values[3*p+"xyz".indexOf(n[0])]=f,r.attributes.position.values[3*p+"xyz".indexOf(n[1])]=-l}r.attributes.position.update(),o.debug("Geometry.setSize",{position:r.attributes.position})}}]),e}()},Mesh:{enumerable:!1,value:function(){function e(t,n){(0,c.Z)(this,e);var r=this;r.geometry=t,r.material=n,r.wireframe=!1,r.attributeInstances=[],Object.entries(r.geometry.attributes).forEach((function(e){var t=(0,s.Z)(e,2),n=t[0],i=t[1];r.attributeInstances.push({attribute:i,location:i.attach(n,r.material.program)})})),o.meshes.push(r),o.debug("Mesh.constructor",{mesh:r})}return(0,u.Z)(e,[{key:"draw",value:function(){d.useProgram(this.material.program),this.material.uniformInstances.forEach((function(e){var t=e.uniform,n=e.location;return t.update(n)})),this.attributeInstances.forEach((function(e){var t=e.attribute,n=e.location;return t.use(n)})),d.drawElements(this.wireframe?d.LINES:d.TRIANGLES,this.geometry.attributes.index.values.length,d.UNSIGNED_SHORT,0)}},{key:"remove",value:function(){var e=this;o.meshes=o.meshes.filter((function(t){return t!=e}))}}]),e}()},Attribute:{enumerable:!1,value:function(){function e(t){(0,c.Z)(this,e),this.type=d.FLOAT,this.normalized=!1,this.buffer=d.createBuffer(),Object.assign(this,t),this.update()}return(0,u.Z)(e,[{key:"update",value:function(){void 0!==this.values&&(d.bindBuffer(this.target,this.buffer),d.bufferData(this.target,this.values,d.STATIC_DRAW))}},{key:"attach",value:function(e,t){var n=d.getAttribLocation(t,e);return this.target===d.ARRAY_BUFFER&&(d.enableVertexAttribArray(n),d.vertexAttribPointer(n,this.size,this.type,this.normalized,0,0)),n}},{key:"use",value:function(e){d.bindBuffer(this.target,this.buffer),this.target===d.ARRAY_BUFFER&&(d.enableVertexAttribArray(e),d.vertexAttribPointer(e,this.size,this.type,this.normalized,0,0))}}]),e}()}});var f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];o.commonUniforms={projectionMatrix:new o.Uniform({type:"mat4",value:f}),modelViewMatrix:new o.Uniform({type:"mat4",value:f}),resolution:new o.Uniform({type:"vec2",value:[1,1]}),aspectRatio:new o.Uniform({type:"float",value:1})}}return(0,u.Z)(e,[{key:"setSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:640,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:480;this.width=e,this.height=t,this.canvas.width=e,this.canvas.height=t,this.gl.viewport(0,0,e,t),this.commonUniforms.resolution.value=[e,t],this.commonUniforms.aspectRatio.value=e/t,this.debug("MiniGL.setSize",{width:e,height:t})}},{key:"setOrthographicCamera",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-2e3,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2e3;this.commonUniforms.projectionMatrix.value=[2/this.width,0,0,0,0,2/this.height,0,0,0,0,2/(r-i),0,e,t,n,1],this.debug("setOrthographicCamera",this.commonUniforms.projectionMatrix.value)}},{key:"render",value:function(){this.gl.clearColor(0,0,0,0),this.gl.clearDepth(1),this.meshes.forEach((function(e){return e.draw()}))}}]),e}();function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=function(){function e(){var t=this;(0,c.Z)(this,e),h(this,"el",void 0),h(this,"cssVarRetries",0),h(this,"maxCssVarRetries",200),h(this,"angle",0),h(this,"isLoadedClass",!1),h(this,"isScrolling",!1),h(this,"scrollingTimeout",void 0),h(this,"scrollingRefreshDelay",200),h(this,"isIntersecting",!1),h(this,"shaderFiles",void 0),h(this,"vertexShader",void 0),h(this,"sectionColors",void 0),h(this,"computedCanvasStyle",void 0),h(this,"conf",void 0),h(this,"uniforms",void 0),h(this,"t",1253106),h(this,"last",0),h(this,"width",void 0),h(this,"minWidth",1111),h(this,"height",600),h(this,"xSegCount",void 0),h(this,"ySegCount",void 0),h(this,"mesh",void 0),h(this,"material",void 0),h(this,"geometry",void 0),h(this,"minigl",void 0),h(this,"scrollObserver",void 0),h(this,"amp",320),h(this,"seed",5),h(this,"freqX",14e-5),h(this,"freqY",29e-5),h(this,"freqDelta",1e-5),h(this,"activeColors",[1,1,1,1]),h(this,"isMetaKey",!1),h(this,"isGradientLegendVisible",!1),h(this,"isMouseDown",!1),h(this,"handleScroll",(function(){clearTimeout(t.scrollingTimeout),t.scrollingTimeout=setTimeout(t.handleScrollEnd,t.scrollingRefreshDelay),t.isGradientLegendVisible&&t.hideGradientLegend(),t.conf.playing&&(t.isScrolling=!0,t.pause())})),h(this,"handleScrollEnd",(function(){t.isScrolling=!1,t.isIntersecting&&t.play()})),h(this,"resize",(function(){t.width=window.innerWidth,t.minigl.setSize(t.width,t.height),t.minigl.setOrthographicCamera(),t.xSegCount=Math.ceil(t.width*t.conf.density[0]),t.ySegCount=Math.ceil(t.height*t.conf.density[1]),t.mesh.geometry.setTopology(t.xSegCount,t.ySegCount),t.mesh.geometry.setSize(t.width,t.height),t.mesh.material.uniforms.u_shadow_power.value=t.width<600?5:6})),h(this,"handleMouseDown",(function(e){t.isGradientLegendVisible&&(t.isMetaKey=e.metaKey,t.isMouseDown=!0,!1===t.conf.playing&&requestAnimationFrame(t.animate))})),h(this,"handleMouseUp",(function(){t.isMouseDown=!1})),h(this,"animate",(function(e){if(!t.shouldSkipFrame(e)||t.isMouseDown){if(t.t+=Math.min(e-t.last,1e3/15),t.last=e,t.isMouseDown){var n=160;t.isMetaKey&&(n=-160),t.t+=n}t.mesh.material.uniforms.u_time.value=t.t,t.minigl.render()}if(0!==t.last&&t.isStatic)return t.minigl.render(),void t.disconnect();(t.conf.playing||t.isMouseDown)&&requestAnimationFrame(t.animate)})),h(this,"addIsLoadedClass",(function(){!t.isLoadedClass&&(t.isLoadedClass=!0,t.el.classList.add("isLoaded"),setTimeout((function(){t.el.parentElement.classList.add("isLoaded")}),3e3))})),h(this,"pause",(function(){t.conf.playing=!1})),h(this,"play",(function(){requestAnimationFrame(t.animate),t.conf.playing=!0})),h(this,"initGradient",(function(e){return t.el=document.querySelector(e),t.connect(),t}))}return(0,u.Z)(e,[{key:"connect",value:function(){var e=(0,o.Z)(d().mark((function e(){var t=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.shaderFiles={vertex:"varying vec3 v_color;\n\nvoid main() {\n float time = u_time * u_global.noiseSpeed;\n\n vec2 noiseCoord = resolution * uvNorm * u_global.noiseFreq;\n\n vec2 st = 1. - uvNorm.xy;\n\n //\n // Tilting the plane\n //\n\n // Front-to-back tilt\n float tilt = resolution.y / 2.0 * uvNorm.y;\n\n // Left-to-right angle\n float incline = resolution.x * uvNorm.x / 2.0 * u_vertDeform.incline;\n\n // Up-down shift to offset incline\n float offset = resolution.x / 2.0 * u_vertDeform.incline * mix(u_vertDeform.offsetBottom, u_vertDeform.offsetTop, uv.y);\n\n //\n // Vertex noise\n //\n\n float noise = snoise(vec3(\n noiseCoord.x * u_vertDeform.noiseFreq.x + time * u_vertDeform.noiseFlow,\n noiseCoord.y * u_vertDeform.noiseFreq.y,\n time * u_vertDeform.noiseSpeed + u_vertDeform.noiseSeed\n )) * u_vertDeform.noiseAmp;\n\n // Fade noise to zero at edges\n noise *= 1.0 - pow(abs(uvNorm.y), 2.0);\n\n // Clamp to 0\n noise = max(0.0, noise);\n\n vec3 pos = vec3(\n position.x,\n position.y + tilt + incline + noise - offset,\n position.z\n );\n\n //\n // Vertex color, to be passed to fragment shader\n //\n\n if (u_active_colors[0] == 1.) {\n v_color = u_baseColor;\n }\n\n for (int i = 0; i < u_waveLayers_length; i++) {\n if (u_active_colors[i + 1] == 1.) {\n WaveLayers layer = u_waveLayers[i];\n\n float noise = smoothstep(\n layer.noiseFloor,\n layer.noiseCeil,\n snoise(vec3(\n noiseCoord.x * layer.noiseFreq.x + time * layer.noiseFlow,\n noiseCoord.y * layer.noiseFreq.y,\n time * layer.noiseSpeed + layer.noiseSeed\n )) / 2.0 + 0.5\n );\n\n v_color = blendNormal(v_color, layer.color, pow(noise, 4.));\n }\n }\n\n //\n // Finish\n //\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}",noise:"//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : stegu\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n// https://github.com/stegu/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n{\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}",blend:"//\n// https://github.com/jamieowen/glsl-blend\n//\n\n// Normal\n\nvec3 blendNormal(vec3 base, vec3 blend) {\n\treturn blend;\n}\n\nvec3 blendNormal(vec3 base, vec3 blend, float opacity) {\n\treturn (blendNormal(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Screen\n\nfloat blendScreen(float base, float blend) {\n\treturn 1.0-((1.0-base)*(1.0-blend));\n}\n\nvec3 blendScreen(vec3 base, vec3 blend) {\n\treturn vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b));\n}\n\nvec3 blendScreen(vec3 base, vec3 blend, float opacity) {\n\treturn (blendScreen(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Multiply\n\nvec3 blendMultiply(vec3 base, vec3 blend) {\n\treturn base*blend;\n}\n\nvec3 blendMultiply(vec3 base, vec3 blend, float opacity) {\n\treturn (blendMultiply(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Overlay\n\nfloat blendOverlay(float base, float blend) {\n\treturn base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));\n}\n\nvec3 blendOverlay(vec3 base, vec3 blend) {\n\treturn vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));\n}\n\nvec3 blendOverlay(vec3 base, vec3 blend, float opacity) {\n\treturn (blendOverlay(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Hard light\n\nvec3 blendHardLight(vec3 base, vec3 blend) {\n\treturn blendOverlay(blend,base);\n}\n\nvec3 blendHardLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendHardLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Soft light\n\nfloat blendSoftLight(float base, float blend) {\n\treturn (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));\n}\n\nvec3 blendSoftLight(vec3 base, vec3 blend) {\n\treturn vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));\n}\n\nvec3 blendSoftLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendSoftLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Color dodge\n\nfloat blendColorDodge(float base, float blend) {\n\treturn (blend==1.0)?blend:min(base/(1.0-blend),1.0);\n}\n\nvec3 blendColorDodge(vec3 base, vec3 blend) {\n\treturn vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));\n}\n\nvec3 blendColorDodge(vec3 base, vec3 blend, float opacity) {\n\treturn (blendColorDodge(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Color burn\n\nfloat blendColorBurn(float base, float blend) {\n\treturn (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);\n}\n\nvec3 blendColorBurn(vec3 base, vec3 blend) {\n\treturn vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));\n}\n\nvec3 blendColorBurn(vec3 base, vec3 blend, float opacity) {\n\treturn (blendColorBurn(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Vivid Light\n\nfloat blendVividLight(float base, float blend) {\n\treturn (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));\n}\n\nvec3 blendVividLight(vec3 base, vec3 blend) {\n\treturn vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));\n}\n\nvec3 blendVividLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendVividLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Lighten\n\nfloat blendLighten(float base, float blend) {\n\treturn max(blend,base);\n}\n\nvec3 blendLighten(vec3 base, vec3 blend) {\n\treturn vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));\n}\n\nvec3 blendLighten(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLighten(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear burn\n\nfloat blendLinearBurn(float base, float blend) {\n\t// Note : Same implementation as BlendSubtractf\n\treturn max(base+blend-1.0,0.0);\n}\n\nvec3 blendLinearBurn(vec3 base, vec3 blend) {\n\t// Note : Same implementation as BlendSubtract\n\treturn max(base+blend-vec3(1.0),vec3(0.0));\n}\n\nvec3 blendLinearBurn(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLinearBurn(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear dodge\n\nfloat blendLinearDodge(float base, float blend) {\n\t// Note : Same implementation as BlendAddf\n\treturn min(base+blend,1.0);\n}\n\nvec3 blendLinearDodge(vec3 base, vec3 blend) {\n\t// Note : Same implementation as BlendAdd\n\treturn min(base+blend,vec3(1.0));\n}\n\nvec3 blendLinearDodge(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLinearDodge(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear light\n\nfloat blendLinearLight(float base, float blend) {\n\treturn blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5)));\n}\n\nvec3 blendLinearLight(vec3 base, vec3 blend) {\n\treturn vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b));\n}\n\nvec3 blendLinearLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLinearLight(base, blend) * opacity + base * (1.0 - opacity));\n}",fragment:"varying vec3 v_color;\n\nvoid main() {\n vec3 color = v_color;\n if (u_darken_top == 1.0) {\n vec2 st = gl_FragCoord.xy/resolution.xy;\n color.g -= pow(st.y + sin(-12.0) * st.x, u_shadow_power) * 0.4;\n }\n gl_FragColor = vec4(color, 1.0);\n}"},this.conf={presetName:"",wireframe:!1,density:[.06,.16],zoom:1,rotation:0,playing:!0},document.querySelectorAll("canvas").length<1?console.log("DID NOT LOAD HERO STRIPE CANVAS"):(this.minigl=new p(this.el,null,null,!0),requestAnimationFrame((function(){t.el&&(t.computedCanvasStyle=getComputedStyle(t.el),t.waitForCssVars())})));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){this.scrollObserver&&(window.removeEventListener("scroll",this.handleScroll),window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("mouseup",this.handleMouseUp),window.removeEventListener("keydown",this.handleKeyDown),this.scrollObserver.disconnect()),window.removeEventListener("resize",this.resize)}},{key:"initMaterial",value:function(){this.uniforms={u_time:new this.minigl.Uniform({value:0}),u_shadow_power:new this.minigl.Uniform({value:5}),u_darken_top:new this.minigl.Uniform({value:""===this.el.dataset.jsDarkenTop?1:0}),u_active_colors:new this.minigl.Uniform({value:this.activeColors,type:"vec4"}),u_global:new this.minigl.Uniform({value:{noiseFreq:new this.minigl.Uniform({value:[this.freqX,this.freqY],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:5e-6})},type:"struct"}),u_vertDeform:new this.minigl.Uniform({value:{incline:new this.minigl.Uniform({value:Math.sin(this.angle)/Math.cos(this.angle)}),offsetTop:new this.minigl.Uniform({value:-.5}),offsetBottom:new this.minigl.Uniform({value:-.5}),noiseFreq:new this.minigl.Uniform({value:[3,4],type:"vec2"}),noiseAmp:new this.minigl.Uniform({value:this.amp}),noiseSpeed:new this.minigl.Uniform({value:10}),noiseFlow:new this.minigl.Uniform({value:3}),noiseSeed:new this.minigl.Uniform({value:this.seed})},type:"struct",excludeFrom:"fragment"}),u_baseColor:new this.minigl.Uniform({value:this.sectionColors[0],type:"vec3",excludeFrom:"fragment"}),u_waveLayers:new this.minigl.Uniform({value:[],excludeFrom:"fragment",type:"array"})};for(var e=1;ethis.minWidth&&(this.isGradientLegendVisible=!0,document.body.classList.add("isGradientLegendVisible"))}},{key:"hideGradientLegend",value:function(){this.isGradientLegendVisible=!1,document.body.classList.remove("isGradientLegendVisible")}},{key:"init",value:function(){this.initGradientColors(),this.initMesh(),this.resize(),requestAnimationFrame(this.animate),window.addEventListener("resize",this.resize)}},{key:"waitForCssVars",value:function(){var e=this;if(this.computedCanvasStyle&&-1!==this.computedCanvasStyle.getPropertyValue("--gradient-color-1").indexOf("#"))this.init(),this.addIsLoadedClass();else{if(this.cssVarRetries+=1,this.cssVarRetries>this.maxCssVarRetries)return this.sectionColors=[16711680,16711680,16711935,65280,255],void this.init();requestAnimationFrame((function(){return e.waitForCssVars()}))}}},{key:"initGradientColors",value:function(){var e=this;this.sectionColors=["--gradient-color-1","--gradient-color-2","--gradient-color-3","--gradient-color-4"].map((function(t){var n=e.computedCanvasStyle.getPropertyValue(t).trim();if(4===n.length){var r=n.substr(1).split("").map((function(e){return e+e})).join("");n="#".concat(r)}return n&&"0x".concat(n.substr(1))})).filter(Boolean).map(f)}}]),e}();console.log("here");var g=new m;window.Gradient=m,g.initGradient("#gradient-canvas");var y=n(52443),b=n(32161);const v=console;var w=n(30081),x=n(72379);class A{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,b.PN)(this.cacheTime)&&(this.gcTimeout=setTimeout((()=>{this.optionalRemove()}),this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:b.sk?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class E extends A{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||v,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||function(e){const t="function"===typeof e.initialData?e.initialData():e.initialData,n="undefined"!==typeof t,r=n?"function"===typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?null!=r?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(e,t){const n=(0,b.oE)(this.state.data,e,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),n}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;const n=this.promise;return null==(t=this.retryer)||t.cancel(e),n?n.then(b.ZT).catch(b.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some((e=>!1!==e.options.enabled))}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some((e=>e.getCurrentResult().isStale))}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!(0,b.Kp)(this.state.dataUpdatedAt,e)}onFocus(){var e;const t=this.observers.find((e=>e.shouldFetchOnWindowFocus()));t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}onOnline(){var e;const t=this.observers.find((e=>e.shouldFetchOnReconnect()));t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}addObserver(e){-1===this.observers.indexOf(e)&&(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){-1!==this.observers.indexOf(e)&&(this.observers=this.observers.filter((t=>t!==e)),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var n,r;if("idle"!==this.state.fetchStatus)if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var i;return null==(i=this.retryer)||i.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find((e=>e.options.queryFn));e&&this.setOptions(e.options)}Array.isArray(this.options.queryKey);const o=(0,b.G9)(),s={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},a=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};a(s);const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(s)):Promise.reject("Missing queryFn")};var u;(a(c),null==(n=this.options.behavior)||n.onFetch(c),this.revertState=this.state,"idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(r=c.fetchOptions)?void 0:r.meta))&&this.dispatch({type:"fetch",meta:null==(u=c.fetchOptions)?void 0:u.meta});const l=e=>{var t,n,r,i;((0,x.DV)(e)&&e.silent||this.dispatch({type:"error",error:e}),(0,x.DV)(e))||(null==(t=(n=this.cache.config).onError)||t.call(n,e,this),null==(r=(i=this.cache.config).onSettled)||r.call(i,this.state.data,e,this));this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=(0,x.Mz)({fn:c.fetchFn,abort:null==o?void 0:o.abort.bind(o),onSuccess:e=>{var t,n,r,i;"undefined"!==typeof e?(this.setData(e),null==(t=(n=this.cache.config).onSuccess)||t.call(n,e,this),null==(r=(i=this.cache.config).onSettled)||r.call(i,e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1):l(new Error("undefined"))},onError:l,onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){this.state=(t=>{var n,r;switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(n=e.meta)?n:null,fetchStatus:(0,x.Kw)(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(r=e.dataUpdatedAt)?r:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return(0,x.DV)(i)&&i.revert&&this.revertState?{...this.revertState}:{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),w.V.batch((()=>{this.observers.forEach((t=>{t.onQueryUpdate(e)})),this.cache.notify({query:this,type:"updated",action:e})}))}}var _=n(33989);class k extends _.l{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,n){var r;const i=t.queryKey,o=null!=(r=t.queryHash)?r:(0,b.Rm)(i,t);let s=this.get(o);return s||(s=new E({cache:this,logger:e.getLogger(),queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter((t=>t!==e)),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){w.V.batch((()=>{this.queries.forEach((e=>{this.remove(e)}))}))}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){const[n]=(0,b.I6)(e,t);return"undefined"===typeof n.exact&&(n.exact=!0),this.queries.find((e=>(0,b._x)(n,e)))}findAll(e,t){const[n]=(0,b.I6)(e,t);return Object.keys(n).length>0?this.queries.filter((e=>(0,b._x)(n,e))):this.queries}notify(e){w.V.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){w.V.batch((()=>{this.queries.forEach((e=>{e.onFocus()}))}))}onOnline(){w.V.batch((()=>{this.queries.forEach((e=>{e.onOnline()}))}))}}class T extends A{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||v,this.observers=[],this.state=e.state||S(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){-1===this.observers.indexOf(e)&&(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter((t=>t!==e)),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,t;return null!=(e=null==(t=this.retryer)?void 0:t.continue())?e:this.execute()}async execute(){const e=()=>{var e;return this.retryer=(0,x.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},t="loading"===this.state.status;try{var n,r,i,o,s,a,c,u;if(!t){var l,d,f,p;this.dispatch({type:"loading",variables:this.options.variables}),await(null==(l=(d=this.mutationCache.config).onMutate)?void 0:l.call(d,this.state.variables,this));const e=await(null==(f=(p=this.options).onMutate)?void 0:f.call(p,this.state.variables));e!==this.state.context&&this.dispatch({type:"loading",context:e,variables:this.state.variables})}const h=await e();return await(null==(n=(r=this.mutationCache.config).onSuccess)?void 0:n.call(r,h,this.state.variables,this.state.context,this)),await(null==(i=(o=this.options).onSuccess)?void 0:i.call(o,h,this.state.variables,this.state.context)),await(null==(s=(a=this.mutationCache.config).onSettled)?void 0:s.call(a,h,null,this.state.variables,this.state.context,this)),await(null==(c=(u=this.options).onSettled)?void 0:c.call(u,h,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:h}),h}catch(E){try{var h,m,g,y,b,v,w,A;throw await(null==(h=(m=this.mutationCache.config).onError)?void 0:h.call(m,E,this.state.variables,this.state.context,this)),await(null==(g=(y=this.options).onError)?void 0:g.call(y,E,this.state.variables,this.state.context)),await(null==(b=(v=this.mutationCache.config).onSettled)?void 0:b.call(v,void 0,E,this.state.variables,this.state.context,this)),await(null==(w=(A=this.options).onSettled)?void 0:w.call(A,void 0,E,this.state.variables,this.state.context)),E}finally{this.dispatch({type:"error",error:E})}}}dispatch(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"loading":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!(0,x.Kw)(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...t,...e.state}}})(this.state),w.V.batch((()=>{this.observers.forEach((t=>{t.onMutationUpdate(e)})),this.mutationCache.notify({mutation:this,type:"updated",action:e})}))}}function S(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class C extends _.l{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,n){const r=new T({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:n,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0});return this.add(r),r}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter((t=>t!==e)),this.notify({type:"removed",mutation:e})}clear(){w.V.batch((()=>{this.mutations.forEach((e=>{this.remove(e)}))}))}getAll(){return this.mutations}find(e){return"undefined"===typeof e.exact&&(e.exact=!0),this.mutations.find((t=>(0,b.X7)(e,t)))}findAll(e){return this.mutations.filter((t=>(0,b.X7)(e,t)))}notify(e){w.V.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){var e;return this.resuming=(null!=(e=this.resuming)?e:Promise.resolve()).then((()=>{const e=this.mutations.filter((e=>e.state.isPaused));return w.V.batch((()=>e.reduce(((e,t)=>e.then((()=>t.continue().catch(b.ZT)))),Promise.resolve())))})).then((()=>{this.resuming=void 0})),this.resuming}}var I=n(15761),O=n(96474),R=n(9499);var D=n(85945);const P=function(){return null};var B=n(81088);const M="7.72.0",N=Object.prototype.toString;function F(e){switch(N.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return q(e,Error)}}function L(e,t){return N.call(e)===`[object ${t}]`}function j(e){return L(e,"ErrorEvent")}function U(e){return L(e,"DOMError")}function Z(e){return L(e,"String")}function H(e){return null===e||"object"!==typeof e&&"function"!==typeof e}function z(e){return L(e,"Object")}function G(e){return"undefined"!==typeof Event&&q(e,Event)}function V(e){return Boolean(e&&e.then&&"function"===typeof e.then)}function W(e){return"number"===typeof e&&e!==e}function q(e,t){try{return e instanceof t}catch(n){return!1}}function $(e){return!("object"!==typeof e||null===e||!e.__isVue&&!e._isVue)}var K=n(71235);const Y=(0,K.Rf)();function X(e,t={}){try{let n=e;const r=5,i=[];let o=0,s=0;const a=" > ",c=a.length;let u;const l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&o++1&&s+i.length*c+u.length>=d));)i.push(u),s+=u.length,n=n.parentNode;return i.reverse().join(a)}catch(n){return""}}function J(e,t){const n=e,r=[];let i,o,s,a,c;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const u=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(u&&u.length)u.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&Z(i))for(o=i.split(/\s+/),c=0;c{const r=ee[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}const ne=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?Q.forEach((n=>{t[n]=(...t)=>{e&&te((()=>{K.n2.console[n](`Sentry Logger [${n}]:`,...t)}))}})):Q.forEach((e=>{t[e]=()=>{}})),t}();function re(e,t=0){return"string"!==typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function ie(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;roe(e,t,n)))}function ae(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);"function"===typeof i&&ue(i,r),e[t]=i}function ce(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function ue(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,ce(e,"__sentry_original__",t)}catch(n){}}function le(e){return e.__sentry_original__}function de(e){if(F(e))return{message:e.message,name:e.name,stack:e.stack,...pe(e)};if(G(e)){const t={type:e.type,target:fe(e.target),currentTarget:fe(e.currentTarget),...pe(e)};return"undefined"!==typeof CustomEvent&&q(e,CustomEvent)&&(t.detail=e.detail),t}return e}function fe(e){try{return t=e,"undefined"!==typeof Element&&q(t,Element)?X(e):Object.prototype.toString.call(e)}catch(n){return""}var t}function pe(e){if("object"===typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function he(e){return me(e,new Map)}function me(e,t){if(z(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const i of Object.keys(e))"undefined"!==typeof e[i]&&(r[i]=me(e[i],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach((e=>{r.push(me(e,t))})),r}return e}function ge(){const e=K.n2,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>t.getRandomValues(new Uint8Array(1))[0])}catch(r){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function ye(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function be(e){const{message:t,event_id:n}=e;if(t)return t;const r=ye(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function ve(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=n||"Error")}function we(e,t){const n=ye(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r&&r.data,...t.data};n.mechanism.data=e}}function xe(e){if(e&&e.__sentry_captured__)return!0;try{ce(e,"__sentry_captured__",!0)}catch(t){}return!1}function Ae(e){return Array.isArray(e)?e:[e]}var Ee;function _e(e){return new Te((t=>{t(e)}))}function ke(e){return new Te(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Ee||(Ee={}));class Te{constructor(e){Te.prototype.__init.call(this),Te.prototype.__init2.call(this),Te.prototype.__init3.call(this),Te.prototype.__init4.call(this),this._state=Ee.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(h){this._reject(h)}}then(e,t){return new Te(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(h){r(h)}else n(t)},e=>{if(t)try{n(t(e))}catch(h){r(h)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new Te(((t,n)=>{let r,i;return this.then((t=>{i=!1,r=t,e&&e()}),(t=>{i=!0,r=t,e&&e()})).then((()=>{i?n(r):t(r)}))}))}__init(){this._resolve=e=>{this._setResult(Ee.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Ee.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===Ee.PENDING&&(V(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===Ee.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===Ee.RESOLVED&&e[1](this._value),this._state===Ee.REJECTED&&e[2](this._value),e[0]=!0)}))}}}function Se(){return(0,K.YO)("globalEventProcessors",(()=>[]))}function Ce(e){Se().push(e)}function Ie(e,t,n,r=0){return new Te(((i,o)=>{const s=e[r];if(null===t||"function"!==typeof s)i(t);else{const a=s({...t},n);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.id&&null===a&&ne.log(`Event processor "${s.id}" dropped event`),V(a)?a.then((t=>Ie(e,t,n,r+1).then(i))).then(null,o):Ie(e,a,n,r+1).then(i).then(null,o)}}))}var Oe=n(21170);const Re="production";function De(e){const t=(0,Oe.ph)(),n={sid:ge(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return he({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"===typeof e.did||"string"===typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&Pe(n,e),n}function Pe(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,Oe.ph)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ge()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"===typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"===typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"===typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class Be{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Me()}static clone(e){const t=new Be;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata={...e._sdkProcessingMetadata},t._propagationContext={...e._propagationContext}),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Pe(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"===typeof e){const t=e(this);return t instanceof Be?t:this}return e instanceof Be?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):z(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Me(),this}addBreadcrumb(e,t){const n="number"===typeof t?t:100;if(n<=0)return this;const r={timestamp:(0,Oe.yW)(),...e},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={},n){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};const t=this._span.transaction;if(t){e.sdkProcessingMetadata={dynamicSamplingContext:t.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const n=t.name;n&&(e.tags={transaction:n,...e.tags})}}this._applyFingerprint(e);const r=this._getBreadcrumbs(),i=[...e.breadcrumbs||[],...r];return e.breadcrumbs=i.length>0?i:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},Ie([...n||[],...Se(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Ae(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Me(){return{traceId:ge(),spanId:ge().substring(16)}}const Ne=100;class Fe{constructor(e,t=new Be,n=4){this._version=n,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version{i.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},o)})),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:ge(),i=new Error(e);return this._withClient(((o,s)=>{o.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},s)})),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:ge();return e.type||(this._lastEventId=n),this._withClient(((r,i)=>{r.captureEvent(e,{...t,event_id:n},i)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=Ne}=r.getOptions&&r.getOptions()||{};if(o<=0)return;const s={timestamp:(0,Oe.yW)(),...e},a=i?te((()=>i(s,t))):s;null!==a&&(r.emit&&r.emit("beforeAddBreadcrumb",a,t),n.addBreadcrumb(a,o))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=je(this);try{e(this)}finally{je(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(n){return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&!n){this.getClient()?console.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):console.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),Pe(e,n)}(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=Re}=n&&n.getOptions()||{},{userAgent:o}=K.n2.navigator||{},s=De({release:r,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),a=t.getSession&&t.getSession();return a&&"ok"===a.status&&Pe(a,{status:"exited"}),this.endSession(),t.setSession(s),s}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){const n=Le().__SENTRY__;if(n&&n.extensions&&"function"===typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Le(){return K.n2.__SENTRY__=K.n2.__SENTRY__||{extensions:{},hub:void 0},K.n2}function je(e){const t=Le(),n=ze(t);return Ge(t,e),n}function Ue(){const e=Le();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return Ze(e)}function Ze(e=Le()){return He(e)&&!ze(e).isOlderThan(4)||Ge(e,new Fe),ze(e)}function He(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function ze(e){return(0,K.YO)("hub",(()=>new Fe),e)}function Ge(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}const Ve=[];function We(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;t.forEach((e=>{e.isDefaultInstance=!0})),r=Array.isArray(n)?[...t,...n]:"function"===typeof n?Ae(n(t)):t;const i=function(e){const t={};return e.forEach((e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)})),Object.keys(t).map((e=>t[e]))}(r),o=function(e,t){for(let n=0;n"Debug"===e.name));if(-1!==o){const[e]=i.splice(o,1);i.push(e)}return i}function qe(e,t,n){if(n[t.name]=t,-1===Ve.indexOf(t.name)&&(t.setupOnce(Ce,Ue),Ve.push(t.name)),e.on&&"function"===typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,r)=>n(t,r,e)))}if(e.addEventProcessor&&"function"===typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign(((t,r)=>n(t,r,e)),{id:t.name});e.addEventProcessor(r)}("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`Integration installed: ${t.name}`)}const $e=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Ke=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class Ye{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=Ye.id,this._options=e}setupOnce(e,t){const n=e=>{const n=t();if(n){const t=n.getIntegration(Ye);if(t){const r=n.getClient(),i=r?r.getOptions():{},o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:$e],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Ke],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(t._options,i);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(h){}return!1}(e))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${be(e)}`),!0;if(function(e,t){if(e.type||!t||!t.length)return!1;return function(e){const t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch(h){}n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`));"undefined"!==typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__||0!==t.length||ne.error(`Could not extract message for event ${be(e)}`);return t}(e).some((e=>se(e,t)))}(e,t.ignoreErrors))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${be(e)}`),!0;if(function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&se(n,t)}(e,t.ignoreTransactions))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${be(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;const n=Xe(e);return!!n&&se(n,t)}(e,t.denyUrls))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${be(e)}.\nUrl: ${Xe(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=Xe(e);return!n||se(n,t)}(e,t.allowUrls))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${be(e)}.\nUrl: ${Xe(e)}`),!0;return!1}(e,o)?null:e}}return e};n.id=this.name,e(n)}}function Xe(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(h){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&""!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error(`Cannot extract url for event ${be(e)}`),null}}let Je;Ye.__initStatic();class Qe{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=Qe.id}setupOnce(){Je=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=le(this)||this;return Je.apply(t,e)}}catch(h){}}}Qe.__initStatic();const et=/\(error: (.*)\)/,tt=/captureMessage|captureException/;function nt(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,n=0)=>{const r=[],i=e.split("\n");for(let o=n;o1024)continue;const n=et.test(e)?e.replace(et,"$1"):e;if(!n.match(/\S*Error: /)){for(const e of t){const t=e(n);if(t){r.push(t);break}}if(r.length>=50)break}}return function(e){if(!e.length)return[];const t=Array.from(e);/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop();t.reverse(),tt.test(t[t.length-1].function||"")&&(t.pop(),tt.test(t[t.length-1].function||"")&&t.pop());return t.slice(0,50).map((e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"})))}(r)}}const rt="";function it(e){try{return e&&"function"===typeof e&&e.name||rt}catch(h){return rt}}const ot=(0,K.Rf)();function st(){if(!("fetch"in ot))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(h){return!1}}function at(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}const ct=(0,K.Rf)();const ut=(0,K.Rf)(),lt={},dt={};function ft(e){if(!dt[e])switch(dt[e]=!0,e){case"console":!function(){if(!("console"in K.n2))return;Q.forEach((function(e){e in K.n2.console&&ae(K.n2.console,e,(function(t){return ee[e]=t,function(...t){ht("console",{args:t,level:e});const n=ee[e];n&&n.apply(K.n2.console,t)}}))}))}();break;case"dom":!function(){if(!ut.document)return;const e=ht.bind(null,"dom"),t=wt(e,!0);ut.document.addEventListener("click",t,!1),ut.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=ut[t]&&ut[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(ae(n,"addEventListener",(function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,o=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},s=o[n]=o[n]||{refCount:0};if(!s.handler){const r=wt(e);s.handler=r,t.call(this,n,r,i)}s.refCount++}catch(h){}return t.call(this,n,r,i)}})),ae(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},o=i[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(h){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!ut.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;ae(e,"open",(function(e){return function(...t){const n=t[1],r=this.__sentry_xhr_v2__={method:Z(t[0])?t[0].toUpperCase():t[0],url:t[1],request_headers:{}};Z(n)&&"POST"===r.method&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const i=()=>{const e=this.__sentry_xhr_v2__;if(e&&4===this.readyState){try{e.status_code=this.status}catch(h){}ht("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&"function"===typeof this.onreadystatechange?ae(this,"onreadystatechange",(function(e){return function(...t){return i(),e.apply(this,t)}})):this.addEventListener("readystatechange",i),ae(this,"setRequestHeader",(function(e){return function(...t){const[n,r]=t,i=this.__sentry_xhr_v2__;return i&&(i.request_headers[n.toLowerCase()]=r),e.apply(this,t)}})),e.apply(this,t)}})),ae(e,"send",(function(e){return function(...t){const n=this.__sentry_xhr_v2__;return n&&void 0!==t[0]&&(n.body=t[0]),ht("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!function(){if(!st())return!1;if(at(ot.fetch))return!0;let e=!1;const t=ot.document;if(t&&"function"===typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=at(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}())return;ae(K.n2,"fetch",(function(e){return function(...t){const{method:n,url:r}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:gt(t),method:mt(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:gt(t),method:mt(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return ht("fetch",{...i}),e.apply(K.n2,t).then((e=>(ht("fetch",{...i,endTimestamp:Date.now(),response:e}),e)),(e=>{throw ht("fetch",{...i,endTimestamp:Date.now(),error:e}),e}))}}))}();break;case"history":!function(){if(!function(){const e=ct.chrome,t=e&&e.app&&e.app.runtime,n="history"in ct&&!!ct.history.pushState&&!!ct.history.replaceState;return!t&&n}())return;const e=ut.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=yt,t=String(n);yt=t,ht("history",{from:e,to:t})}return e.apply(this,t)}}ut.onpopstate=function(...t){const n=ut.location.href,r=yt;if(yt=n,ht("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(i){}},ae(ut.history,"pushState",t),ae(ut.history,"replaceState",t)}();break;case"error":xt=ut.onerror,ut.onerror=function(e,t,n,r,i){return ht("error",{column:r,error:i,line:n,msg:e,url:t}),!(!xt||xt.__SENTRY_LOADER__)&&xt.apply(this,arguments)},ut.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":At=ut.onunhandledrejection,ut.onunhandledrejection=function(e){return ht("unhandledrejection",e),!(At&&!At.__SENTRY_LOADER__)||At.apply(this,arguments)},ut.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("unknown instrumentation type:",e))}}function pt(e,t){lt[e]=lt[e]||[],lt[e].push(t),ft(e)}function ht(e,t){if(e&<[e])for(const n of lt[e]||[])try{n(t)}catch(h){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${it(n)}\nError:`,h)}}function mt(e,t){return!!e&&"object"===typeof e&&!!e[t]}function gt(e){return"string"===typeof e?e:e?mt(e,"url")?e.url:e.toString?e.toString():"":""}let yt;let bt,vt;function wt(e,t=!1){return n=>{if(!n||vt===n)return;if(function(e){if("keypress"!==e.type)return!1;try{const t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(h){}return!0}(n))return;const r="keypress"===n.type?"input":n.type;(void 0===bt||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(h){}return!1}(vt,n))&&(e({event:n,name:r,global:t}),vt=n),clearTimeout(bt),bt=ut.setTimeout((()=>{bt=void 0}),1e3)}}let xt=null;let At=null;const Et=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function _t(e,t=!1){const{host:n,path:r,pass:i,port:o,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r?`${r}/`:r}${s}`}function kt(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Tt(e){const t="string"===typeof e?function(e){const t=Et.exec(e);if(!t)return void console.error(`Invalid Sentry Dsn: ${e}`);const[n,r,i="",o,s="",a]=t.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return kt({host:o,pass:i,path:c,projectId:u,port:s,protocol:n,publicKey:r})}(e):kt(e);if(t&&function(e){if("undefined"!==typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return!0;const{port:t,projectId:n,protocol:r}=e;return!["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(ne.error(`Invalid Sentry Dsn: ${t} missing`),!0)))&&(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?!t||!isNaN(parseInt(t,10))||(ne.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):(ne.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(ne.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1))}(t))return t}function St(e,t=100,n=1/0){try{return It("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ct(e,t=3,n=102400){const r=St(e,t);return i=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(i))>n?Ct(e,t-1,n):r;var i}function It(e,t,r=1/0,i=1/0,o=function(){const e="function"===typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e=i){d[n]="[MaxProperties ~]";break}const e=p[n];d[n]=It(n,e,u-1,i,o),f++}return a(t),d}function Ot(e,t=[]){return[e,t]}function Rt(e,t){const[n,r]=e;return[n,[...r,t]]}function Dt(e,t){const n=e[1];for(const r of n){if(t(r,r[0].type))return!0}return!1}function Pt(e,t){return(t||new TextEncoder).encode(e)}function Bt(e,t){const[n,r]=e;let i=JSON.stringify(n);function o(e){"string"===typeof i?i="string"===typeof e?i+e:[Pt(i,t),e]:i.push("string"===typeof e?Pt(e,t):e)}for(const s of r){const[e,t]=s;if(o(`\n${JSON.stringify(e)}\n`),"string"===typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch(h){e=JSON.stringify(St(t))}o(e)}}return"string"===typeof i?i:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}(i)}function Mt(e,t){const n="string"===typeof e.data?Pt(e.data,t):e.data;return[he({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const Nt={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function Ft(e){return Nt[e]}function Lt(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function jt(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:_t(r)},...i&&{trace:he({...i})}}}class Ut extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function Zt(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Ht(e,t){return function(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}({sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}})}function zt(e,t={}){const n="string"===typeof t?t:t.tunnel,r="string"!==typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${Zt(e)}${e.projectId}/envelope/`}(e)}?${Ht(e,r)}`}function Gt(e,t,n){const r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=n&&n.getUser()||{},s=he({environment:r.environment||Re,release:r.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",s),s}function Vt(e,t,n,r,i){const{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,a={...t,event_id:t.event_id||n.event_id||ge(),timestamp:t.timestamp||(0,Oe.yW)()},c=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:Re);void 0===e.release&&void 0!==r&&(e.release=r);void 0===e.dist&&void 0!==i&&(e.dist=i);e.message&&(e.message=re(e.message,o));const s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=re(s.value,o));const a=e.request;a&&a.url&&(a.url=re(a.url,o))}(a,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(a,c),void 0===t.type&&function(e,t){const n=K.n2._sentryDebugIds;if(!n)return;let r;const i=Wt.get(t);i?r=i:(r=new Map,Wt.set(t,r));const o=Object.keys(n).reduce(((e,i)=>{let o;const s=r.get(i);s?o=s:(o=t(i),r.set(i,o));for(let t=o.length-1;t>=0;t--){const r=o[t];if(r.filename){e[r.filename]=n[i];break}}return e}),{});try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.filename&&(e.debug_id=o[e.filename])}))}))}catch(h){}}(a,e.stackParser);let u=r;n.captureContext&&(u=Be.clone(u).update(n.captureContext));let l=_e(a);const d=i&&i.getEventProcessors?i.getEventProcessors():[];if(u){if(u.getAttachments){const e=[...n.attachments||[],...u.getAttachments()];e.length&&(n.attachments=e)}l=u.applyToEvent(a,n,d)}else l=Ie([...d,...Se()],a,n);return l.then((e=>(e&&function(e){const t={};try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))}))}catch(h){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach((e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})}))}(e),"number"===typeof o&&o>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:St(e.data,t,n)}})))},...e.user&&{user:St(e.user,t,n)},...e.contexts&&{contexts:St(e.contexts,t,n)},...e.extra&&{extra:St(e.extra,t,n)}};e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=St(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=St(e.data,t,n)),e))));return r}(e,o,s):e)))}const Wt=new WeakMap;const qt="Not capturing exception because it's already been captured.";function $t(e){return void 0===e.type}function Kt(e){return"transaction"===e.type}var Yt=n(68518);function Xt(e,t){const n=Qt(e,t),r={type:t&&t.name,value:tn(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Jt(e,t){return{exception:{values:[Xt(e,t)]}}}function Qt(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"===typeof e.framesToPop)return e.framesToPop;if(en.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(h){}return[]}const en=/Minified React error #\d+;/i;function tn(e){const t=e&&e.message;return t?t.error&&"string"===typeof t.error.message?t.error.message:t:"No error message"}function nn(e,t,n,r,i){let o;if(j(t)&&t.error){return Jt(e,t.error)}if(U(t)||L(t,"DOMException")){const i=t;if("stack"in t)o=Jt(e,t);else{const t=i.name||(U(i)?"DOMError":"DOMException"),s=i.message?`${t}: ${i.message}`:t;o=rn(e,s,n,r),ve(o,s)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}if(F(t))return Jt(e,t);if(z(t)||G(t)){return o=function(e,t,n,r){const i=Ue().getClient(),o=i&&i.getOptions().normalizeDepth,s={exception:{values:[{type:G(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:on(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Ct(t,o)}};if(n){const t=Qt(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}(e,t,n,i),we(o,{synthetic:!0}),o}return o=rn(e,t,n,r),ve(o,`${t}`,void 0),we(o,{synthetic:!0}),o}function rn(e,t,n,r){const i={message:t};if(r&&n){const r=Qt(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}return i}function on(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(de(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return re(n[0],t);for(let r=n.length;r>0;r--){const e=n.slice(0,r).join(", ");if(!(e.length>t))return r===n.length?e:re(e,t)}return""}(e),r=t?"promise rejection":"exception";if(j(e))return`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``;if(G(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(h){}}(e)}\` (type=${e.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}function sn(e,t){return Ue().captureException(e,{captureContext:t})}function an(e){Ue().withScope(e)}const cn=K.n2;let un=0;function ln(){return un>0}function dn(){un++,setTimeout((()=>{un--}))}function fn(e,t={},n){if("function"!==typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(le(e))return e}catch(h){return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"===typeof n&&n.apply(this,arguments);const i=r.map((e=>fn(e,t)));return e.apply(this,i)}catch(i){throw dn(),an((e=>{e.addEventProcessor((e=>(t.mechanism&&(ve(e,void 0,void 0),we(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),sn(i)})),i}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(i){}ue(r,e),ce(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(i){}return r}class pn extends class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=Tt(e.dsn):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("No DSN provided, client will not do anything."),this._dsn){const t=zt(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(xe(e))return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(qt));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{r=e}))),r}captureMessage(e,t,n,r){let i=n&&n.event_id;const o=H(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(o.then((e=>this._captureEvent(e,n,r))).then((e=>{i=e}))),i}captureEvent(e,t,n){if(t&&t.originalException&&xe(t.originalException))return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(qt));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((e=>{r=e}))),r}captureSession(e){this._isEnabled()?"string"!==typeof e.release?("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Pe(e,{init:!1})):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e)))):_e(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,e)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e,t){const n={};return t.forEach((t=>{t&&qe(e,t,n)})),n}(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){qe(this,e,this._integrations)}sendEvent(e,t={}){if(this.emit("beforeSendEvent",e,t),this._dsn){let n=function(e,t,n,r){const i=Lt(n),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const s=jt(e,i,r,t);return delete e.sdkProcessingMetadata,Ot(s,[[{type:o},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Rt(n,Mt(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((t=>this.emit("afterSendEvent",e,t)),null)}}sendSession(e){if(this._dsn){const t=function(e,t,n,r){const i=Lt(n);return Ot({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&{dsn:_t(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach((e=>e(...t)))}_updateSessionFromEvent(e,t){let n=!1,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&n)&&(Pe(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Te((t=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){const r=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i.length>0&&(t.integrations=i),this.emit("preprocessEvent",e,t),Vt(r,e,t,n,this).then((e=>{if(null===e)return e;const{propagationContext:t}=e.sdkProcessingMetadata||{};if(!(e.contexts&&e.contexts.trace)&&t){const{traceId:r,spanId:i,parentSpanId:o,dsc:s}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:o},...e.contexts};const a=s||Gt(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:a,...e.sdkProcessingMetadata}}return e}))}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__){const t=e;"log"===t.logLevel?ne.log(t.message):ne.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r;if(!this._isEnabled())return ke(new Ut("SDK not enabled, will not capture event.","log"));const o=Kt(e),s=$t(e),a=e.type||"error",c=`before send for type \`${a}\``;if(s&&"number"===typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),ke(new Ut(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const u="replay_event"===a?"replay":a;return this._prepareEvent(e,t,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",u,e),new Ut("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const i=function(e,t,n){const{beforeSend:r,beforeSendTransaction:i}=e;if($t(t)&&r)return r(t,n);if(Kt(t)&&i)return i(t,n);return t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(V(e))return e.then((e=>{if(!z(e)&&null!==e)throw new Ut(n);return e}),(e=>{throw new Ut(`${t} rejected with ${e}`)}));if(!z(e)&&null!==e)throw new Ut(n);return e}(i,c)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",u,e),new Ut(`${c} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!o&&i&&this._updateSessionFromEvent(i,r);const s=r.transaction_info;if(o&&s&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...s,source:e}}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof Ut)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Ut(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_sendEnvelope(e){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,(e=>{("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("Error while sending event:",e)}));("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}}))}}{constructor(e){const t=cn.SENTRY_SDK_SOURCE||(0,Yt.S)();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:M}],version:M},super(e),e.sendClientReports&&cn.document&&cn.document.addEventListener("visibilitychange",(()=>{"hidden"===cn.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){const i=nn(e,t,n&&n.syntheticException||void 0,r);return we(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),_e(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const o=rn(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),_e(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:_t(r)}},o=function(e){return[{type:"user_report"},e]}(e);return Ot(i,[o])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("No outcomes to send"));if(!this._dsn)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("No dsn provided, will not send outcomes"));("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("Sending outcomes:",e);const t=(n=e,Ot((r=this._options.tunnel&&_t(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:i||(0,Oe.yW)(),discarded_events:n}]]));var n,r,i;this._sendEnvelope(t)}}class hn{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=hn.id,this._options={onerror:!0,onunhandledrejection:!0,...e},this._installFunc={onerror:mn,onunhandledrejection:gn}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const t in e){const n=this._installFunc[t];n&&e[t]&&(bn(t),n(),this._installFunc[t]=void 0)}}}function mn(){pt("error",(e=>{const[t,n,r]=wn();if(!t.getIntegration(hn))return;const{msg:i,url:o,line:s,column:a,error:c}=e;if(ln()||c&&c.__sentry_own_request__)return;const u=void 0===c&&Z(i)?function(e,t,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=j(e)?e.message:e,s="Error";const a=o.match(i);a&&(s=a[1],o=a[2]);return yn({exception:{values:[{type:s,value:o}]}},t,n,r)}(i,o,s,a):yn(nn(n,c||i,void 0,r,!1),o,s,a);u.level="error",vn(t,c,u,"onerror")}))}function gn(){pt("unhandledrejection",(e=>{const[t,n,r]=wn();if(!t.getIntegration(hn))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch(s){}if(ln()||i&&i.__sentry_own_request__)return!0;const o=H(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:nn(n,i,void 0,r,!0);o.level="error",vn(t,i,o,"onunhandledrejection")}))}function yn(e,t,n,r){const i=e.exception=e.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},c=a.frames=a.frames||[],u=isNaN(parseInt(r,10))?void 0:r,l=isNaN(parseInt(n,10))?void 0:n,d=Z(t)&&t.length>0?t:function(){try{return Y.document.location.href}catch(e){return""}}();return 0===c.length&&c.push({colno:u,filename:d,function:"?",in_app:!0,lineno:l}),e}function bn(e){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`Global Handler attached: ${e}`)}function vn(e,t,n,r){we(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function wn(){const e=Ue(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}hn.__initStatic();const xn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class An{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=An.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&ae(cn,"setTimeout",En),this._options.setInterval&&ae(cn,"setInterval",En),this._options.requestAnimationFrame&&ae(cn,"requestAnimationFrame",_n),this._options.XMLHttpRequest&&"XMLHttpRequest"in cn&&ae(XMLHttpRequest.prototype,"send",kn);const e=this._options.eventTarget;if(e){(Array.isArray(e)?e:xn).forEach(Tn)}}}function En(e){return function(...t){const n=t[0];return t[0]=fn(n,{mechanism:{data:{function:it(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function _n(e){return function(t){return e.apply(this,[fn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:it(e)},handled:!1,type:"instrument"}})])}}function kn(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"===typeof n[e]&&ae(n,e,(function(t){const n={mechanism:{data:{function:e,handler:it(t)},handled:!1,type:"instrument"}},r=le(t);return r&&(n.mechanism.data.handler=it(r)),fn(t,n)}))})),e.apply(this,t)}}function Tn(e){const t=cn,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(ae(n,"addEventListener",(function(t){return function(n,r,i){try{"function"===typeof r.handleEvent&&(r.handleEvent=fn(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:it(r),target:e},handled:!1,type:"instrument"}}))}catch(o){}return t.apply(this,[n,fn(r,{mechanism:{data:{function:"addEventListener",handler:it(r),target:e},handled:!1,type:"instrument"}}),i])}})),ae(n,"removeEventListener",(function(e){return function(t,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch(h){}return e.call(this,t,i,r)}})))}An.__initStatic();const Sn=["fatal","error","warning","log","info","debug"];function Cn(e){return"warn"===e?"warning":Sn.includes(e)?e:"log"}function In(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const On=1024;class Rn{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=Rn.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){if(this.options.console&&pt("console",Pn),this.options.dom&&pt("dom",function(e){function t(t){let n,r="object"===typeof e?e.serializeAttribute:void 0,i="object"===typeof e&&"number"===typeof e.maxStringLength?e.maxStringLength:void 0;i&&i>On&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=On),"string"===typeof r&&(r=[r]);try{const e=t.event;n=function(e){return!!e&&!!e.target}(e)?X(e.target,{keyAttrs:r,maxStringLength:i}):X(e,{keyAttrs:r,maxStringLength:i})}catch(h){n=""}0!==n.length&&Ue().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&pt("xhr",Bn),this.options.fetch&&pt("fetch",Mn),this.options.history&&pt("history",Nn),this.options.sentry){const e=Ue().getClient();e&&e.on&&e.on("beforeSendEvent",Dn)}}}function Dn(e){Ue().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:be(e)},{event:e})}function Pn(e){const t={category:"console",data:{arguments:e.args,logger:"console"},level:Cn(e.level),message:ie(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message=`Assertion failed: ${ie(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1)}Ue().addBreadcrumb(t,{input:e.args,level:e.level})}function Bn(e){const{startTimestamp:t,endTimestamp:n}=e,r=e.xhr.__sentry_xhr_v2__;if(!t||!n||!r)return;const{method:i,url:o,status_code:s,body:a}=r,c={method:i,url:o,status_code:s},u={xhr:e.xhr,input:a,startTimestamp:t,endTimestamp:n};Ue().addBreadcrumb({category:"xhr",data:c,type:"http"},u)}function Mn(e){const{startTimestamp:t,endTimestamp:n}=e;if(n&&(!e.fetchData.url.match(/sentry_key/)||"POST"!==e.fetchData.method))if(e.error){const r=e.fetchData,i={data:e.error,input:e.args,startTimestamp:t,endTimestamp:n};Ue().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{const r={...e.fetchData,status_code:e.response&&e.response.status},i={input:e.args,response:e.response,startTimestamp:t,endTimestamp:n};Ue().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function Nn(e){let t=e.from,n=e.to;const r=In(cn.location.href);let i=In(t);const o=In(n);i.path||(i=r),r.protocol===o.protocol&&r.host===o.host&&(n=o.relative),r.protocol===i.protocol&&r.host===i.host&&(t=i.relative),Ue().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}function Fn(e,t,n=250,r,i,o,s){if(!o.exception||!o.exception.values||!s||!q(s.originalException,Error))return;const a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;var c,u;a&&(o.exception.values=(c=Ln(e,t,i,s.originalException,r,o.exception.values,a,0),u=n,c.map((e=>(e.value&&(e.value=re(e.value,u)),e)))))}function Ln(e,t,n,r,i,o,s,a){if(o.length>=n+1)return o;let c=[...o];if(q(r[i],Error)){jn(s,a);const o=e(t,r[i]),u=c.length;Un(o,i,u,a),c=Ln(e,t,n,r[i],i,[o,...c],o,u)}return Array.isArray(r.errors)&&r.errors.forEach(((r,o)=>{if(q(r,Error)){jn(s,a);const u=e(t,r),l=c.length;Un(u,`errors[${o}]`,l,a),c=Ln(e,t,n,r,i,[u,...c],u,l)}})),c}function jn(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function Un(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}Rn.__initStatic();class Zn{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=Zn.id,this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){}preprocessEvent(e,t,n){const r=n.getOptions();Fn(Xt,r.stackParser,r.maxValueLength,this._key,this._limit,e,t)}}Zn.__initStatic();class Hn{static __initStatic(){this.id="HttpContext"}constructor(){this.name=Hn.id}setupOnce(){}preprocessEvent(e){if(!cn.navigator&&!cn.location&&!cn.document)return;const t=e.request&&e.request.url||cn.location&&cn.location.href,{referrer:n}=cn.document||{},{userAgent:r}=cn.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:i};e.request=o}}Hn.__initStatic();class zn{static __initStatic(){this.id="Dedupe"}constructor(){this.name=zn.id}setupOnce(e,t){}processEvent(e){if(e.type)return e;try{if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!Vn(e,t))return!1;if(!Gn(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=Wn(t),r=Wn(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!Vn(e,t))return!1;if(!Gn(e,t))return!1;return!0}(e,t))return!0;return!1}(e,this._previousEvent))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){}return this._previousEvent=e}}function Gn(e,t){let n=qn(e),r=qn(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,r=r,r.length!==n.length)return!1;for(let i=0;i|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Xn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Jn=[30,e=>{const t=Yn.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=Xn.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=ir(t[1]||$n,t[2]);return Kn(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Qn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,er=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tr=[50,e=>{const t=Qn.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=er.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||$n;return[n,e]=ir(n,e),Kn(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],nr=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,rr=nt(...[Jn,tr,[40,e=>{const t=nr.exec(e);return t?Kn(t[2],t[1]||$n,+t[3],t[4]?+t[4]:void 0):void 0}]]),ir=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:$n,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function or(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.lengthn(i))).then(null,(()=>n(i).then(null,(()=>{})))),i},drain:function(e){return new Te(((n,r)=>{let i=t.length;if(!i)return n(!0);const o=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{_e(e).then((()=>{--i||(clearTimeout(o),n(!0))}),r)}))}))}}}function sr(e,{statusCode:t,headers:n},r=Date.now()){const i={...e},o=n&&n["x-sentry-rate-limits"],s=n&&n["retry-after"];if(o)for(const a of o.trim().split(",")){const[e,t]=a.split(":",2),n=parseInt(e,10),o=1e3*(isNaN(n)?60:n);if(t)for(const s of t.split(";"))i[s]=r+o;else i.all=r+o}else s?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(s,r):429===t&&(i.all=r+6e4);return i}function ar(e,t,n=or(e.bufferSize||30)){let r={};function i(i){const o=[];if(Dt(i,((t,n)=>{const i=Ft(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,i)){const r=cr(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else o.push(t)})),0===o.length)return _e();const s=Ot(i[0],o),a=t=>{Dt(s,((n,r)=>{const i=cr(n,r);e.recordDroppedEvent(t,Ft(r),i)}))};return n.add((()=>t({body:Bt(s,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=sr(r,e),e)),(e=>{throw a("network_error"),e})))).then((e=>e),(e=>{if(e instanceof Ut)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("Skipped sending event because buffer is full."),a("queue_overflow"),_e();throw e}))}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>n.drain(e)}}function cr(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}let ur;function lr(e,t=function(){if(ur)return ur;if(at(cn.fetch))return ur=cn.fetch.bind(cn);const e=cn.document;let t=cn.fetch;if(e&&"function"===typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(h){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",h)}return ur=t.bind(cn)}()){let n=0,r=0;return ar(e,(function(i){const o=i.body.length;n+=o,r++;const s={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,s).then((e=>(n-=o,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(h){return ur=void 0,n-=o,r--,ke(h)}}))}function dr(e){return ar(e,(function(t){return new Te(((n,r)=>{const i=new XMLHttpRequest;i.onerror=r,i.onreadystatechange=()=>{4===i.readyState&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&i.setRequestHeader(t,e.headers[t]);i.send(t.body)}))}))}const fr=[new Ye,new Qe,new An,new Rn,new hn,new Zn,new zn,new Hn];function pr(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=fr),void 0===e.release&&("string"===typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),cn.SENTRY_RELEASE&&cn.SENTRY_RELEASE.id&&(e.release=cn.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:(n=e.stackParser||rr,Array.isArray(n)?nt(...n):n),integrations:We(e),transport:e.transport||(st()?lr:dr)};var n;!function(e,t){!0===t.debug&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?ne.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const n=Ue();n.getScope().update(t.initialScope);const r=new e(t);n.bindClient(r)}(pn,t),e.autoSessionTracking&&function(){if("undefined"===typeof cn.document)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));const e=Ue();if(!e.captureSession)return;hr(e),pt("history",(({from:e,to:t})=>{void 0!==e&&e!==t&&hr(Ue())}))}()}function hr(e){e.startSession({ignoreDuration:!0}),e.captureSession()}const mr="baggage",gr="sentry-",yr=/^sentry-/;function br(e){if(!e)return;return function(e){if(0===Object.keys(e).length)return;return Object.entries(e).reduce(((e,[t,n],r)=>{const i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,o=0===r?i:`${e},${i}`;return o.length>8192?(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):o}),"")}(Object.entries(e).reduce(((e,[t,n])=>(n&&(e[`sentry-${t}`]=n),e)),{}))}function vr(e){return e.split(",").map((e=>e.split("=").map((e=>decodeURIComponent(e.trim()))))).reduce(((e,[t,n])=>(e[t]=n,e)),{})}const wr=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function xr(e,t){const n=function(e){if(!e)return;const t=e.match(wr);if(!t)return;let n;return"1"===t[3]?n=!0:"0"===t[3]&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}(e),r=function(e){if(!Z(e)&&!Array.isArray(e))return;let t={};if(Array.isArray(e))t=e.reduce(((e,t)=>({...e,...vr(t)})),{});else{if(!e)return;t=vr(e)}const n=Object.entries(t).reduce(((e,[t,n])=>(t.match(yr)&&(e[t.slice(gr.length)]=n),e)),{});return Object.keys(n).length>0?n:void 0}(t),{traceId:i,parentSpanId:o,parentSampled:s}=n||{},a={traceId:i||ge(),spanId:ge().substring(16),sampled:s};return o&&(a.parentSpanId=o),r&&(a.dsc=r),{traceparentData:n,dynamicSamplingContext:r,propagationContext:a}}function Ar(e=ge(),t=ge().substring(16),n){let r="";return void 0!==n&&(r=n?"-1":"-0"),`${e}-${t}${r}`}class Er{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class _r{constructor(e={}){this.traceId=e.traceId||ge(),this.spanId=e.spanId||ge().substring(16),this.startTimestamp=e.startTimestamp||(0,Oe.ph)(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){const t=new _r({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(t.spanRecorder=this.spanRecorder,t.spanRecorder&&t.spanRecorder.add(t),t.transaction=this.transaction,("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&t.transaction){const n=`[Tracing] Starting '${e&&e.op||"< unknown op >"}' span on transaction '${t.transaction.name||"< unknown name >"}' (${t.transaction.spanId}).`;t.transaction.metadata.spanMetadata[t.spanId]={logMessage:n},ne.log(n)}return t}setTag(e,t){return this.tags={...this.tags,[e]:t},this}setData(e,t){return this.data={...this.data,[e]:t},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);const t=function(e){if(e<400&&e>=100)return"ok";if(e>=400&&e<500)switch(e){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(e>=500&&e<600)switch(e){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}(e);return"unknown_error"!==t&&this.setStatus(t),this}setName(e){this.description=e}isSuccess(){return"ok"===this.status}finish(e){if(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:e}=this.transaction.metadata.spanMetadata[this.spanId];e&&ne.log(e.replace("Starting","Finishing"))}this.endTimestamp="number"===typeof e?e:(0,Oe.ph)()}toTraceparent(){return Ar(this.traceId,this.spanId,this.sampled)}toContext(){return he({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return he({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return he({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}}class kr extends _r{constructor(e,t){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=t||Ue(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;const n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(e){this.setName(e)}setName(e,t="custom"){this._name=e,this.metadata.source=t}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Er(e)),this.spanRecorder.add(this)}setContext(e,t){null===t?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t,n=""){this._measurements[e]={value:t,unit:n}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){if(void 0!==this.endTimestamp)return;this.name||(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Transaction has no name, falling back to ``."),this.name=""),super.finish(e);const t=this._hub.getClient();if(t&&t.emit&&t.emit("finishTransaction",this),!0!==this.sampled)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(t&&t.recordDroppedEvent("sample_rate","transaction"));const n=this.spanRecorder?this.spanRecorder.spans.filter((e=>e!==this&&e.endTimestamp)):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce(((e,t)=>e.endTimestamp&&t.endTimestamp?e.endTimestamp>t.endTimestamp?e:t:e)).endTimestamp);const r=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...r,dynamicSamplingContext:this.getDynamicSamplingContext()},...r.source&&{transaction_info:{source:r.source}}};return Object.keys(this._measurements).length>0&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(i)}toContext(){return he({...super.toContext(),name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const e=this._hub||Ue(),t=e.getClient();if(!t)return{};const n=e.getScope(),r=Gt(this.traceId,t,n),i=this.metadata.sampleRate;void 0!==i&&(r.sample_rate=`${i}`);const o=this.metadata.source;return o&&"url"!==o&&(r.transaction=this.name),void 0!==this.sampled&&(r.sampled=String(this.sampled)),r}setHub(e){this._hub=e}}const Tr={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},Sr=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class Cr extends Er{constructor(e,t,n,r){super(r),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=n}add(e){e.spanId!==this.transactionSpanId&&(e.finish=t=>{e.endTimestamp="number"===typeof t?t:(0,Oe.ph)(),this._popActivity(e.spanId)},void 0===e.endTimestamp&&this._pushActivity(e.spanId)),super.add(e)}}class Ir extends kr{constructor(e,t,n=Tr.idleTimeout,r=Tr.finalTimeout,i=Tr.heartbeatInterval,o=!1){super(e,t),this._idleHub=t,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=i,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=Sr[4],o&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),t.configureScope((e=>e.setSpan(this)))),this._restartIdleTimeout(),setTimeout((()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Sr[3],this.finish())}),this._finalTimeout)}finish(e=(0,Oe.ph)()){if(this._finished=!0,this.activities={},"ui.action.click"===this.op&&this.setTag("finishReason",this._finishReason),this.spanRecorder){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] finishing IdleTransaction",new Date(1e3*e).toISOString(),this.op);for(const t of this._beforeFinishCallbacks)t(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter((t=>{if(t.spanId===this.spanId)return!0;t.endTimestamp||(t.endTimestamp=e,t.setStatus("cancelled"),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(t,void 0,2)));const n=t.startTimestamp{this._finished||this._pushActivity(e)},n=e=>{this._finished||this._popActivity(e)};this.spanRecorder=new Cr(t,n,this.spanId,e),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:t}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=!1===t,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,0===Object.keys(this.activities).length&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Sr[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout((()=>{this._finished||0!==Object.keys(this.activities).length||(this._finishReason=Sr[1],this.finish(e))}),this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] popActivity ${e}`),delete this.activities[e],("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){const e=(0,Oe.ph)();this._idleTimeoutCanceledPermanently?(this._finishReason=Sr[5],this.finish(e)):this._restartIdleTimeout(e+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Sr[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout((()=>{this._beat()}),this._heartbeatInterval)}}function Or(e){if("boolean"===typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=Ue().getClient(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function Rr(e){return(e||Ue()).getScope().getTransaction()}let Dr=!1;function Pr(){const e=Rr();if(e){const t="internal_error";("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}function Br(){const e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function Mr(e,t,n){if(!Or(t))return e.sampled=!1,e;if(void 0!==e.sampled)return e.setMetadata({sampleRate:Number(e.sampled)}),e;let r;return"function"===typeof t.tracesSampler?(r=t.tracesSampler(n),e.setMetadata({sampleRate:Number(r)})):void 0!==n.parentSampled?r=n.parentSampled:"undefined"!==typeof t.tracesSampleRate?(r=t.tracesSampleRate,e.setMetadata({sampleRate:Number(r)})):(r=1,e.setMetadata({sampleRate:r})),function(e){if(W(e)||"number"!==typeof e&&"boolean"!==typeof e)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1;if(e<0||e>1)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${e}.`),!1;return!0}(r)?r?(e.sampled=Math.random(){let r,i;return o=>{t.value>=0&&(o||n)&&(i=t.value-(r||0),(i||void 0===r)&&(r=t.value,t.delta=i,e(t)))}},Zr=()=>jr.__WEB_VITALS_POLYFILL__?jr.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||(()=>{const e=jr.performance.timing,t=jr.performance.navigation.type,n={entryType:"navigation",startTime:0,type:2==t?"back_forward":1===t?"reload":"navigate"};for(const r in e)"navigationStart"!==r&&"toJSON"!==r&&(n[r]=Math.max(e[r]-e.navigationStart,0));return n})()):jr.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],Hr=()=>{const e=Zr();return e&&e.activationStart||0},zr=(e,t)=>{const n=Zr();let r="navigate";return n&&(r=jr.document.prerendering||Hr()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:"undefined"===typeof t?-1:t,rating:"good",delta:0,entries:[],id:`v3-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},Gr=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((e=>{t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(h){}},Vr=(e,t)=>{const n=r=>{"pagehide"!==r.type&&"hidden"!==jr.document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)};let Wr=-1;const qr=()=>(Wr<0&&(Wr="hidden"!==jr.document.visibilityState||jr.document.prerendering?1/0:0,Vr((({timeStamp:e})=>{Wr=e}),!0)),{get firstHiddenTime(){return Wr}}),$r={};function Kr(e){return"number"===typeof e&&isFinite(e)}function Yr(e,{startTimestamp:t,...n}){return t&&e.startTimestamp>t&&(e.startTimestamp=t),e.startChild({startTimestamp:t,...n})}function Xr(e){return e/1e3}function Jr(){return jr&&jr.addEventListener&&jr.performance}let Qr,ei,ti=0,ni={};function ri(){const e=Jr();if(e&&Oe.Z1){e.mark&&jr.performance.mark("sentry-tracing-init"),(e=>{const t=qr(),n=zr("FID");let r;const i=e=>{e.startTime{e.forEach(i)},s=Gr("first-input",o);r=Ur(e,n),s&&Vr((()=>{o(s.takeRecords()),s.disconnect()}),!0)})((e=>{const t=e.entries.pop();if(!t)return;const n=Xr(Oe.Z1),r=Xr(t.startTime);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding FID"),ni.fid={value:e.value,unit:"millisecond"},ni["mark.fid"]={value:n+r,unit:"second"}}));const t=(e=>{const t=zr("CLS",0);let n,r=0,i=[];const o=e=>{e.forEach((e=>{if(!e.hadRecentInput){const o=i[0],s=i[i.length-1];r&&0!==i.length&&e.startTime-s.startTime<1e3&&e.startTime-o.startTime<5e3?(r+=e.value,i.push(e)):(r=e.value,i=[e]),r>t.value&&(t.value=r,t.entries=i,n&&n())}}))},s=Gr("layout-shift",o);if(s){n=Ur(e,t);const r=()=>{o(s.takeRecords()),n(!0)};return Vr(r),r}})((e=>{const t=e.entries.pop();t&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding CLS"),ni.cls={value:e.value,unit:""},ei=t)})),n=(e=>{const t=qr(),n=zr("LCP");let r;const i=e=>{const i=e[e.length-1];if(i){const e=Math.max(i.startTime-Hr(),0);e{$r[n.id]||(i(o.takeRecords()),o.disconnect(),$r[n.id]=!0,r(!0))};return["keydown","click"].forEach((e=>{addEventListener(e,t,{once:!0,capture:!0})})),Vr(t,!0),t}})((e=>{const t=e.entries.pop();t&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding LCP"),ni.lcp={value:e.value,unit:"millisecond"},Qr=t)}));return()=>{t&&t(),n&&n()}}return()=>{}}function ii(e){const t=Jr();if(!t||!jr.performance.getEntries||!Oe.Z1)return;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] Adding & adjusting spans using Performance API");const n=Xr(Oe.Z1),r=t.getEntries();let i,o;if(r.slice(ti).forEach((t=>{const r=Xr(t.startTime),s=Xr(t.duration);if(!("navigation"===e.op&&n+r{oi(e,t,r,n)})),oi(e,t,"secureConnection",n,"TLS/SSL","connectEnd"),oi(e,t,"fetch",n,"cache","domainLookupStart"),oi(e,t,"domainLookup",n,"DNS"),function(e,t,n){Yr(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+Xr(t.requestStart),endTimestamp:n+Xr(t.responseEnd)}),Yr(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+Xr(t.responseStart),endTimestamp:n+Xr(t.responseEnd)})}(e,t,n)}(e,t,n),i=n+Xr(t.responseStart),o=n+Xr(t.requestStart);break;case"mark":case"paint":case"measure":{!function(e,t,n,r,i){const o=i+n,s=o+r;Yr(e,{description:t.name,endTimestamp:s,op:t.entryType,origin:"auto.resource.browser.metrics",startTimestamp:o})}(e,t,r,s,n);const i=qr(),o=t.startTime{if(!ni[t]||n>=e.startTimestamp)return;const r=ni[t].value,i=n+Xr(r),o=Math.abs(1e3*(i-e.startTimestamp)),s=o-r;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Measurements] Normalized ${t} from ${r} to ${o} (${s})`),ni[t].value=o}));const t=ni["mark.fid"];t&&ni.fid&&(Yr(e,{description:"first input delay",endTimestamp:t.value+Xr(ni.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:t.value}),delete ni["mark.fid"]),"fcp"in ni||delete ni.cls,Object.keys(ni).forEach((t=>{e.setMeasurement(t,ni[t].value,ni[t].unit)})),function(e){Qr&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding LCP Data"),Qr.element&&e.setTag("lcp.element",X(Qr.element)),Qr.id&&e.setTag("lcp.id",Qr.id),Qr.url&&e.setTag("lcp.url",Qr.url.trim().slice(0,200)),e.setTag("lcp.size",Qr.size));ei&&ei.sources&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding CLS Data"),ei.sources.forEach(((t,n)=>e.setTag(`cls.source.${n+1}`,X(t.node)))))}(e)}Qr=void 0,ei=void 0,ni={}}function oi(e,t,n,r,i,o){const s=o?t[o]:t[`${n}End`],a=t[`${n}Start`];a&&s&&Yr(e,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+Xr(a),endTimestamp:r+Xr(s)})}const si=["localhost",/^\/(?!\/)/],ai={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:si,tracePropagationTargets:si};function ci(e){const{traceFetch:t,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:o,enableHTTPTimings:s}={traceFetch:ai.traceFetch,traceXHR:ai.traceXHR,...e},a="function"===typeof o?o:e=>!0,c=e=>function(e,t){return se(e,t||si)}(e,r||i),u={};t&&pt("fetch",(e=>{const t=function(e,t,n,r){if(!Or()||!e.fetchData)return;const i=t(e.fetchData.url);if(e.endTimestamp&&i){const t=e.fetchData.__span;if(!t)return;const n=r[t];if(n){if(e.response){n.setHttpStatus(e.response.status);const t=e.response&&e.response.headers&&e.response.headers.get("content-length"),r=parseInt(t);r>0&&n.setData("http.response_content_length",r)}else e.error&&n.setStatus("internal_error");n.finish(),delete r[t]}return}const o=Ue(),s=o.getScope(),a=o.getClient(),c=s.getSpan(),{method:u,url:l}=e.fetchData,d=i&&c?c.startChild({data:{url:l,type:"fetch","http.method":u},description:`${u} ${l}`,op:"http.client",origin:"auto.http.browser"}):void 0;d&&(e.fetchData.__span=d.spanId,r[d.spanId]=d);if(n(e.fetchData.url)&&a){const t=e.args[0];e.args[1]=e.args[1]||{};const n=e.args[1];n.headers=function(e,t,n,r,i){const o=i||n.getSpan(),s=o&&o.transaction,{traceId:a,sampled:c,dsc:u}=n.getPropagationContext(),l=o?o.toTraceparent():Ar(a,void 0,c),d=br(s?s.getDynamicSamplingContext():u||Gt(a,t,n)),f="undefined"!==typeof Request&&q(e,Request)?e.headers:r.headers;if(f){if("undefined"!==typeof Headers&&q(f,Headers)){const e=new Headers(f);return e.append("sentry-trace",l),d&&e.append(mr,d),e}if(Array.isArray(f)){const e=[...f,["sentry-trace",l]];return d&&e.push([mr,d]),e}{const e="baggage"in f?f.baggage:void 0,t=[];return Array.isArray(e)?t.push(...e):e&&t.push(e),d&&t.push(d),{...f,"sentry-trace":l,baggage:t.length>0?t.join(","):void 0}}}return{"sentry-trace":l,baggage:d}}(t,a,s,n,d)}return d}(e,a,c,u);s&&t&&ui(t)})),n&&pt("xhr",(e=>{const t=function(e,t,n,r){const i=e.xhr,o=i&&i.__sentry_xhr_v2__;if(!Or()||i&&i.__sentry_own_request__||!i||!o)return;const s=t(o.url);if(e.endTimestamp&&s){const e=i.__sentry_xhr_span_id__;if(!e)return;const t=r[e];return void(t&&(t.setHttpStatus(o.status_code),t.finish(),delete r[e]))}const a=Ue(),c=a.getScope(),u=c.getSpan(),l=s&&u?u.startChild({data:{...o.data,type:"xhr","http.method":o.method,url:o.url},description:`${o.method} ${o.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;l&&(i.__sentry_xhr_span_id__=l.spanId,r[i.__sentry_xhr_span_id__]=l);if(i.setRequestHeader&&n(o.url))if(l){const e=l&&l.transaction,t=br(e&&e.getDynamicSamplingContext());di(i,l.toTraceparent(),t)}else{const e=a.getClient(),{traceId:t,sampled:n,dsc:r}=c.getPropagationContext();di(i,Ar(t,void 0,n),br(r||(e?Gt(t,e,c):void 0)))}return l}(e,a,c,u);s&&t&&ui(t)}))}function ui(e){const t=e.data.url,n=new PerformanceObserver((r=>{r.getEntries().forEach((r=>{if(function(e){return"resource"===e.entryType&&"initiatorType"in e&&"string"===typeof e.nextHopProtocol&&("fetch"===e.initiatorType||"xmlhttprequest"===e.initiatorType)}(r)&&r.name.endsWith(t)){const t=function(e){const{name:t,version:n}=function(e){let t="unknown",n="unknown",r="";for(const i of e){if("/"===i){[t,n]=e.split("/");break}if(!isNaN(Number(i))){t="h"===r?"http":r,n=e.split(r)[1];break}r+=i}r===e&&(t=r);return{name:t,version:n}}(e.nextHopProtocol),r=[];if(r.push(["network.protocol.version",n],["network.protocol.name",t]),!Oe.Z1)return r;return[...r,["http.request.redirect_start",li(e.redirectStart)],["http.request.fetch_start",li(e.fetchStart)],["http.request.domain_lookup_start",li(e.domainLookupStart)],["http.request.domain_lookup_end",li(e.domainLookupEnd)],["http.request.connect_start",li(e.connectStart)],["http.request.secure_connection_start",li(e.secureConnectionStart)],["http.request.connection_end",li(e.connectEnd)],["http.request.request_start",li(e.requestStart)],["http.request.response_start",li(e.responseStart)],["http.request.response_end",li(e.responseEnd)]]}(r);t.forEach((t=>e.setData(...t))),n.disconnect()}}))}));n.observe({entryTypes:["resource"]})}function li(e=0){return((Oe.Z1||performance.timeOrigin)+e)/1e3}function di(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader(mr,n)}catch(r){}}const fi={...Tr,markBackgroundTransactions:!0,routingInstrumentation:function(e,t=!0,n=!0){if(!jr||!jr.location)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Could not initialize routing instrumentation due to invalid location"));let r,i=jr.location.href;t&&(r=e({name:jr.location.pathname,startTimestamp:Oe.Z1?Oe.Z1/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&pt("history",(({to:t,from:n})=>{void 0===n&&i&&-1!==i.indexOf(t)?i=void 0:n!==t&&(i=void 0,r&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.finish()),r=e({name:jr.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))}))},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...ai};class pi{constructor(e){this.name="BrowserTracing",this._hasSetTracePropagationTargets=!1,Lr(),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!(!e||!e.tracePropagationTargets&&!e.tracingOrigins)),this.options={...fi,...e},void 0!==this.options._experiments.enableLongTask&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=ri(),this.options.enableLongTask&&Gr("longtask",(e=>{for(const t of e){const e=Rr();if(!e)return;const n=Xr(Oe.Z1+t.startTime),r=Xr(t.duration);e.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+r})}})),this.options._experiments.enableInteractions&&Gr("event",(e=>{for(const t of e){const e=Rr();if(!e)return;if("click"===t.name){const n=Xr(Oe.Z1+t.startTime),r=Xr(t.duration);e.startChild({description:X(t.target),op:`ui.interaction.${t.name}`,origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+r})}}}),{durationThreshold:0})}setupOnce(e,t){this._getCurrentHub=t;const n=t().getClient(),r=n&&n.getOptions(),{routingInstrumentation:i,startTransactionOnLocationChange:o,startTransactionOnPageLoad:s,markBackgroundTransactions:a,traceFetch:c,traceXHR:u,shouldCreateSpanForRequest:l,enableHTTPTimings:d,_experiments:f}=this.options,p=r&&r.tracePropagationTargets,h=p||this.options.tracePropagationTargets;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&p&&ne.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),i((e=>{const n=this._createRouteTransaction(e);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,e,t),n}),s,o),a&&(jr&&jr.document?jr.document.addEventListener("visibilitychange",(()=>{const e=Rr();if(jr.document.hidden&&e){const t="cancelled";("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Transaction: ${t} -> since tab moved to the background, op: ${e.op}`),e.status||e.setStatus(t),e.setTag("visibilitychange","document.hidden"),e.finish()}})):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("[Tracing] Could not set up background tab detection due to lack of global document")),f.enableInteractions&&this._registerInteractionListener(),ci({traceFetch:c,traceXHR:u,tracePropagationTargets:h,shouldCreateSpanForRequest:l,enableHTTPTimings:d})}_createRouteTransaction(e){if(!this._getCurrentHub)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`));const t=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:r,finalTimeout:i,heartbeatInterval:o}=this.options,s="pageload"===e.op,a=s?hi("sentry-trace"):"",c=s?hi("baggage"):"",{traceparentData:u,dynamicSamplingContext:l,propagationContext:d}=xr(a,c),f={...e,...u,metadata:{...e.metadata,dynamicSamplingContext:u&&!l?{}:l},trimEnd:!0},p="function"===typeof n?n(f):f,h=void 0===p?{...f,sampled:!1}:p;h.metadata=h.name!==f.name?{...h.metadata,source:"custom"}:h.metadata,this._latestRouteName=h.name,this._latestRouteSource=h.metadata&&h.metadata.source,!1===h.sampled&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Will not send ${h.op} transaction because of beforeNavigate.`),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Starting ${h.op} transaction on scope`);const{location:m}=jr,g=Fr(t,h,r,i,!0,{location:m},o),y=t.getScope();return s&&u?y.setPropagationContext(d):y.setPropagationContext({traceId:g.traceId,spanId:g.spanId,parentSpanId:g.parentSpanId,sampled:g.sampled}),g.registerBeforeFinishCallback((e=>{this._collectWebVitals(),ii(e)})),g}_registerInteractionListener(){let e;const t=()=>{const{idleTimeout:t,finalTimeout:n,heartbeatInterval:r}=this.options,i="ui.action.click",o=Rr();if(o&&o.op&&["navigation","pageload"].includes(o.op))return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Did not create ${i} transaction because a pageload or navigation transaction is in progress.`));if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Did not create ${i} transaction because _getCurrentHub is invalid.`));if(!this._latestRouteName)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Did not create ${i} transaction because _latestRouteName is missing.`));const s=this._getCurrentHub(),{location:a}=jr,c={name:this._latestRouteName,op:i,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=Fr(s,c,t,n,!0,{location:a},r)};["click"].forEach((e=>{addEventListener(e,t,{once:!1,capture:!0})}))}}function hi(e){const t=(n=`meta[name=${e}]`,Y.document&&Y.document.querySelector?Y.document.querySelector(n):null);var n;return t?t.getAttribute("content"):void 0}var mi=n(61422),gi=n(83454);const yi=K.n2,bi="sentryReplaySession",vi="Unable to send Replay",wi=15e4,xi=5e3,Ai=2e7,Ei=36e5;var _i;function ki(e){const t=null===e||void 0===e?void 0:e.host;return Boolean(t&&t.shadowRoot&&t.shadowRoot===e)}function Ti({maskInputOptions:e,tagName:t,type:n}){"option"===t.toLowerCase()&&(t="select");const r="string"===typeof n?n.toLowerCase():void 0;return e[t.toLowerCase()]||r&&e[r]||"password"===r||"input"===t&&!n&&e.text}function Si({input:e,maskInputSelector:t,unmaskInputSelector:n,maskInputOptions:r,tagName:i,type:o,value:s,maskInputFn:a}){let c=s||"";return n&&e.matches(n)||(e.hasAttribute("data-rr-is-password")&&(o="password"),(Ti({maskInputOptions:r,tagName:i,type:o})||t&&e.matches(t))&&(c=a?a(c):"*".repeat(c.length))),c}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(_i||(_i={}));const Ci="__rrweb_original__";function Ii(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}function Oi(e,t,n){return"string"===typeof n&&n.toLowerCase(),"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}let Ri=1;const Di=new RegExp("[^a-z0-9-_:]");function Pi(e){return e?e.replace(/[\S]/g,"*"):""}function Bi(e){try{const t=e.rules||e.cssRules;return t?Array.from(t).map(Mi).join(""):null}catch(t){return null}}function Mi(e){let t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=Bi(e.styleSheet)||t}catch(n){}return Ni(t)}function Ni(e){if(e.indexOf(":")>-1){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}return e}let Fi,Li;const ji=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ui=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Zi=/^(data:)([^,]*),(.*)/i;function Hi(e,t){return(e||"").replace(ji,((e,n,r,i,o,s)=>{const a=r||o||s,c=n||i||"";if(!a)return e;if(!Ui.test(a))return`url(${c}${a}${c})`;if(Zi.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const u=t.split("/"),l=a.split("/");u.pop();for(const t of l)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${c}${u.join("/")}${c})`}))}const zi=/^[^ \t\n\r\u000c]+/,Gi=/^[, \t\n\r\u000c]+/;function Vi(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function Wi(){const e=document.createElement("a");return e.href="",e.href}function qi(e,t,n,r,i,o,s,a){if(!i)return i;const c=r.toLowerCase(),u=n.toLowerCase();return"src"===c||"href"===c||"xlink:href"===c&&"#"!==i[0]?Vi(e,i):"background"!==c||"table"!==u&&"td"!==u&&"th"!==u?"srcset"===c?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}let i=[];for(;r(Gi),!(n>=t.length);){let o=r(zi);if(","===o.slice(-1))o=Vi(e,o.substring(0,o.length-1)),i.push(o);else{let r="";o=Vi(e,o);let s=!1;for(;;){let e=t.charAt(n);if(""===e){i.push((o+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,i.push((o+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return i.join(", ")}(e,i):"style"===c?Hi(i,Wi()):"object"===u&&"data"===c?Vi(e,i):o&&function(e,t,n,r){if(r&&e.matches(r))return!1;return["placeholder","title","aria-label"].indexOf(t)>-1||"input"===n&&"value"===t&&e.hasAttribute("type")&&["submit","button"].indexOf(e.getAttribute("type").toLowerCase())>-1}(t,c,u,s)?a?a(i):Pi(i):i:Vi(e,i)}function $i(e,t,n,r,i){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return $i(e.parentNode,t,n,r,i);if(r&&(e.matches(r)||e.closest(r)))return!1;if(i)return!0;if("string"===typeof t){if(e.classList.contains(t))return!0}else for(let o=0;ot.href===e.href));let n=null;t&&(n=Bi(t)),n&&(delete T.rel,delete T.href,T._cssText=Hi(n,t.href))}if("style"===k&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=Bi(e.sheet);t&&(T._cssText=Hi(t,Wi()))}if("input"===k||"textarea"===k||"select"===k||"option"===k){const t=e,n=Ii(t),r=Oi(t,k.toUpperCase(),n),i=e.checked;"submit"!==n&&"button"!==n&&r&&(T.value=Si({input:t,type:n,tagName:k,value:r,maskInputSelector:d,unmaskInputSelector:f,maskInputOptions:h,maskInputFn:g})),i&&(T.checked=i)}if("option"===k&&(e.selected&&!h.select?T.selected=!0:delete T.selected),"canvas"===k&&v)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n0!==e)))return!1}return!0})(e)||(T.rr_dataURL=e.toDataURL(y.type,y.quality));else if(!("__context"in e)){const t=e.toDataURL(y.type,y.quality),n=document.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(y.type,y.quality)&&(T.rr_dataURL=t)}if("img"===k&&b){Fi||(Fi=r.createElement("canvas"),Li=Fi.getContext("2d"));const t=e,n=t.crossOrigin;t.crossOrigin="anonymous";const i=()=>{try{Fi.width=t.naturalWidth,Fi.height=t.naturalHeight,Li.drawImage(t,0,0),T.rr_dataURL=Fi.toDataURL(y.type,y.quality)}catch(e){console.warn(`Cannot inline img src=${t.currentSrc}! Error: ${e}`)}n?T.crossOrigin=n:delete T.crossOrigin};t.complete&&0!==t.naturalWidth?i():t.onload=i}if("audio"!==k&&"video"!==k||(T.rr_mediaState=e.paused?"paused":"played",T.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(T.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(T.rr_scrollTop=e.scrollTop),t){const{width:t,height:n}=e.getBoundingClientRect();T={class:T.class,rr_width:`${t}px`,rr_height:`${n}px`}}return"iframe"!==k||w(T.src)||(e.contentDocument||(T.rr_src=T.src),delete T.src),{type:_i.Element,tagName:k,attributes:T,childNodes:[],isSVG:(E=e,Boolean("svg"===E.tagName||E.ownerSVGElement)||void 0),needBlock:t,rootId:x};case e.TEXT_NODE:const S=e.parentNode&&e.parentNode.tagName;let C=e.textContent;const I="STYLE"===S||void 0,O="SCRIPT"===S||void 0;if(I&&C){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(C=(A=e.parentNode.sheet).cssRules?Array.from(A.cssRules).map((e=>e.cssText?Ni(e.cssText):"")).join(""):"")}catch(_){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${_}`,e)}C=Hi(C,Wi())}if(O&&(C="SCRIPT_PLACEHOLDER"),"TEXTAREA"===S&&C)C="";else if("OPTION"===S&&C){C=Si({input:e.parentNode,type:null,tagName:S,value:C,maskInputSelector:d,unmaskInputSelector:f,maskInputOptions:h,maskInputFn:g})}else!I&&!O&&$i(e,a,c,u,p)&&C&&(C=m?m(C):Pi(C));return{type:_i.Text,textContent:C||"",isStyle:I,rootId:x};case e.CDATA_SECTION_NODE:return{type:_i.CDATA,textContent:"",rootId:x};case e.COMMENT_NODE:return{type:_i.Comment,textContent:e.textContent||"",rootId:x};default:return!1}var A,E}function Yi(e){return void 0===e||null===e?"":e.toLowerCase()}function Xi(e,t){const{doc:n,map:r,blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:a,maskTextSelector:c,unmaskTextSelector:u,skipChild:l=!1,inlineStylesheet:d=!0,maskInputSelector:f,unmaskInputSelector:p,maskAllText:h,maskInputOptions:m={},maskTextFn:g,maskInputFn:y,slimDOMOptions:b,dataURLOptions:v={},inlineImages:w=!1,recordCanvas:x=!1,onSerialize:A,onIframeLoad:E,iframeLoadTimeout:_=5e3,keepIframeSrcFn:k=(()=>!1)}=t;let{preserveWhiteSpace:T=!0}=t;const S=Ki(e,{doc:n,blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:a,maskTextSelector:c,unmaskTextSelector:u,inlineStylesheet:d,maskInputSelector:f,unmaskInputSelector:p,maskAllText:h,maskInputOptions:m,maskTextFn:g,maskInputFn:y,dataURLOptions:v,inlineImages:w,recordCanvas:x,keepIframeSrcFn:k});if(!S)return console.warn(e,"not serialized"),null;let C;C="__sn"in e?e.__sn.id:!function(e,t){if(t.comment&&e.type===_i.Comment)return!0;if(e.type===_i.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"===typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Yi(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Yi(e.attributes.name)||"icon"===Yi(e.attributes.rel)||"apple-touch-icon"===Yi(e.attributes.rel)||"shortcut icon"===Yi(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Yi(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Yi(e.attributes.property).match(/^(og|twitter|fb):/)||Yi(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Yi(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Yi(e.attributes.name)||"googlebot"===Yi(e.attributes.name)||"bingbot"===Yi(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Yi(e.attributes.name)||"generator"===Yi(e.attributes.name)||"framework"===Yi(e.attributes.name)||"publisher"===Yi(e.attributes.name)||"progid"===Yi(e.attributes.name)||Yi(e.attributes.property).match(/^article:/)||Yi(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Yi(e.attributes.name)||"yandex-verification"===Yi(e.attributes.name)||"csrf-token"===Yi(e.attributes.name)||"p:domain_verify"===Yi(e.attributes.name)||"verify-v1"===Yi(e.attributes.name)||"verification"===Yi(e.attributes.name)||"shopify-checkout-api-token"===Yi(e.attributes.name)))return!0}}return!1}(S,b)&&(T||S.type!==_i.Text||S.isStyle||S.textContent.replace(/^\s+|\s+$/gm,"").length)?Ri++:-2;const I=Object.assign(S,{id:C});if(e.__sn=I,-2===C)return null;r[C]=e,A&&A(e);let O=!l;if(I.type===_i.Element&&(O=O&&!I.needBlock,delete I.needBlock,e.shadowRoot&&(I.isShadowHost=!0)),(I.type===_i.Document||I.type===_i.Element)&&O){b.headWhitespace&&S.type===_i.Element&&"head"===S.tagName&&(T=!1);const t={doc:n,map:r,blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:a,maskTextSelector:c,unmaskTextSelector:u,skipChild:l,inlineStylesheet:d,maskInputSelector:f,unmaskInputSelector:p,maskAllText:h,maskInputOptions:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:b,dataURLOptions:v,inlineImages:w,recordCanvas:x,preserveWhiteSpace:T,onSerialize:A,onIframeLoad:E,iframeLoadTimeout:_,keepIframeSrcFn:k};for(const n of Array.from(e.childNodes)){const e=Xi(n,t);e&&I.childNodes.push(e)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const e=Xi(n,t);e&&(e.isShadow=!0,I.childNodes.push(e))}}return e.parentNode&&ki(e.parentNode)&&(I.isShadow=!0),I.type===_i.Element&&"iframe"===I.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let i,o=!1;try{i=r.document.readyState}catch(a){return}if("complete"!==i){const r=setTimeout((()=>{o||(t(),o=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),o=!0,t()}))}const s="about:blank";r.location.href===s&&e.src!==s&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}(e,(()=>{const t=e.contentDocument;if(t&&E){const n=Xi(t,{doc:t,map:r,blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:a,maskTextSelector:c,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputSelector:f,unmaskInputSelector:p,maskAllText:h,maskInputOptions:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:b,dataURLOptions:v,inlineImages:w,recordCanvas:x,preserveWhiteSpace:T,onSerialize:A,onIframeLoad:E,iframeLoadTimeout:_,keepIframeSrcFn:k});n&&E(e,n)}}),_),I}function Ji(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}var Qi,eo,to,no,ro,io;function oo(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(Qi||(Qi={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration"}(eo||(eo={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}(to||(to={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(no||(no={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(ro||(ro={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(io||(io={}));const so="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let ao={map:{},getId:()=>(console.error(so),-1),getNode:()=>(console.error(so),null),removeNodeFromMap(){console.error(so)},has:()=>(console.error(so),!1),reset(){console.error(so)}};function co(e,t,n={}){let r=null,i=0;return function(o){let s=Date.now();i||!1!==n.leading||(i=s);let a=t-(s-i),c=this,u=arguments;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(c,u)):r||!1===n.trailing||(r=setTimeout((()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(c,u)}),a))}}function uo(e,t,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>uo(e,t,o||{},!0)}function lo(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"===typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(r){return()=>{}}}function fo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function po(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ho(e,t,n,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){let i=!1;const o=r&&e.matches(r);return"string"===typeof t?i=void 0!==e.closest?!o&&null!==e.closest("."+t):!o&&e.classList.contains(t):!o&&e.classList.forEach((e=>{t.test(e)&&(i=!0)})),!i&&n&&(i=e.matches(n)),!o&&i||ho(e.parentNode,t,n,r)}return e.nodeType,e.TEXT_NODE,ho(e.parentNode,t,n,r)}function mo(e){return"__sn"in e&&-2===e.__sn.id}function go(e,t){if(ki(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||go(e.parentNode,t))}function yo(e){return Boolean(e.changedTouches)}function bo(e){return"__sn"in e&&(e.__sn.type===_i.Element&&"iframe"===e.__sn.tagName)}function vo(e){return Boolean(null===e||void 0===e?void 0:e.shadowRoot)}function wo(e){return"__ln"in e}"undefined"!==typeof window&&window.Proxy&&window.Reflect&&(ao=new Proxy(ao,{get:(e,t,n)=>("map"===t&&console.error(so),Reflect.get(e,t,n))}));class xo{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n`${e}@${t}`;function Eo(e){return"__sn"in e}class _o{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new xo,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{var i,o,s,a,c;const u=r.getRootNode?null===(i=r.getRootNode())||void 0===i?void 0:i.host:null;let l=u;for(;null===(s=null===(o=null===l||void 0===l?void 0:l.getRootNode)||void 0===o?void 0:o.call(l))||void 0===s?void 0:s.host;)l=(null===(c=null===(a=null===l||void 0===l?void 0:l.getRootNode)||void 0===a?void 0:a.call(l))||void 0===c?void 0:c.host)||null;const d=!this.doc.contains(r)&&(!l||!this.doc.contains(l));if(!r.parentNode||d)return;const f=ki(r.parentNode)?this.mirror.getId(u):this.mirror.getId(r.parentNode),p=n(r);if(-1===f||-1===p)return t.addNode(r);let h=Xi(r,{doc:this.doc,map:this.mirror.map,blockClass:this.blockClass,blockSelector:this.blockSelector,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,maskInputSelector:this.maskInputSelector,unmaskInputSelector:this.unmaskInputSelector,skipChild:!0,inlineStylesheet:this.inlineStylesheet,maskAllText:this.maskAllText,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{bo(e)&&this.iframeManager.addIframe(e),vo(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,document)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)}});h&&e.push({parentId:f,nextId:p,node:h})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)To(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||r(s);for(const s of this.addedSet)So(this.droppedSet,s)||To(this.removes,s,this.mirror)?So(this.movedSet,s)?r(s):this.droppedSet.add(s):r(s);let i=null;for(;t.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),r=n(i.value);-1!==t&&-1!==r&&(e=i)}if(!e)for(let r=t.length-1;r>=0;r--){const i=t.get(r);if(i){const t=this.mirror.getId(i.value.parentNode),r=n(i.value);if(-1!==t&&-1!==r){e=i;break}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}i=e.previous,t.removeNode(e.value),r(e.value)}const o={texts:this.texts.map((e=>({id:this.mirror.getId(e.node),value:e.value}))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>({id:this.mirror.getId(e.node),attributes:e.attributes}))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!mo(e.target))switch(e.type){case"characterData":{const t=e.target.textContent;ho(e.target,this.blockClass,this.blockSelector,this.unblockSelector)||t===e.oldValue||this.texts.push({value:$i(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=n.getAttribute(e.attributeName);if("value"===e.attributeName&&(r=Si({input:n,maskInputSelector:this.maskInputSelector,unmaskInputSelector:this.unmaskInputSelector,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:n.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ho(e.target,this.blockClass,this.blockSelector,this.unblockSelector)||r===e.oldValue)return;let i=this.attributes.find((t=>t.node===e.target));if(i||(i={node:e.target,attributes:{}},this.attributes.push(i)),"type"===e.attributeName&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),"style"===e.attributeName){const r=this.doc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue),void 0!==i.attributes.style&&null!==i.attributes.style||(i.attributes.style={});try{const e=i.attributes.style;for(const t of Array.from(n.style)){const i=n.style.getPropertyValue(t),o=n.style.getPropertyPriority(t);i===r.style.getPropertyValue(t)&&o===r.style.getPropertyPriority(t)||(e[t]=""===o?i:[i,o])}for(const t of Array.from(r.style))""===n.style.getPropertyValue(t)&&(e[t]=!1)}catch(t){console.warn("[rrweb] Error when parsing update to style attribute:",t)}}else{const t=e.target;i.attributes[e.attributeName]=qi(this.doc,t,t.tagName,e.attributeName,r,this.maskAllText,this.unmaskTextSelector,this.maskTextFn)}break}case"childList":e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=ki(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);ho(e.target,this.blockClass,this.blockSelector,this.unblockSelector)||mo(t)||(this.addedSet.has(t)?(ko(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||go(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ao(n,r)]?ko(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!!ki(e.target)||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!t||!ho(t,this.blockClass,this.blockSelector,this.unblockSelector)){if(Eo(e)){if(mo(e))return;this.movedSet.add(e);let n=null;t&&Eo(t)&&(n=t.__sn.id),n&&(this.movedMap[Ao(e.__sn.id,n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ho(e,this.blockClass,this.blockSelector,this.unblockSelector)||e.childNodes.forEach((e=>this.genAdds(e)))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskTextClass","maskTextSelector","unmaskTextSelector","maskInputSelector","unmaskInputSelector","inlineStylesheet","maskAllText","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ko(e,t){e.delete(t),t.childNodes.forEach((t=>ko(e,t)))}function To(e,t,n){const{parentNode:r}=t;if(!r)return!1;const i=n.getId(r);return!!e.some((e=>e.id===i))||To(e,r,n)}function So(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||So(e,n))}const Co=e=>(...t)=>{try{return e(...t)}catch(n){try{n.__rrweb__=!0}catch(r){}throw n}},Io=[];function Oo(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function Ro(e,t){var n,r;const i=new _o;Io.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const s=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");s&&window[s]&&(o=window[s]);const a=new o(Co((t=>{e.onMutation&&!1===e.onMutation(t)||i.processMutations(t)})));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Do({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,c=[];return Object.keys(to).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((s=>{const a=s.toLowerCase(),u=Co((t=>s=>{const a=Oo(s);if(ho(a,r,i,o))return;const c=yo(s)?s.changedTouches[0]:s;if(!c)return;const u=n.getId(a),{clientX:l,clientY:d}=c;Co(e)({type:to[t],id:u,x:l,y:d})})(s));c.push(oo(a,u,t))})),Co((()=>{c.forEach((e=>e()))}))}function Po({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,sampling:s}){const a=co((s=>{const a=Oo(s);if(!a||ho(a,r,i,o))return;const c=n.getId(a);if(a===t){const n=t.scrollingElement||t.documentElement;Co(e)({id:c,x:n.scrollLeft,y:n.scrollTop})}else Co(e)({id:c,x:a.scrollLeft,y:a.scrollTop})}),s.scroll||100);return oo("scroll",Co(a),t)}function Bo(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Mo=["INPUT","TEXTAREA","SELECT"],No=new WeakMap;function Fo({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputSelector:c,unmaskInputSelector:u,maskInputOptions:l,maskInputFn:d,sampling:f,userTriggeredOnInput:p}){function h(e){let n=Oo(e);const f=n&&n.tagName,h=e.isTrusted;if("OPTION"===f&&(n=n.parentElement),!n||!f||Mo.indexOf(f)<0||ho(n,r,i,o))return;const g=n,y=Ii(g);if(g.classList.contains(s)||a&&g.matches(a))return;let b=Oi(g,f,y),v=!1;"radio"!==y&&"checkbox"!==y||(v=n.checked),function({tagName:e,type:t,maskInputOptions:n,maskInputSelector:r}){return r||Ti({maskInputOptions:n,tagName:e,type:t})}({maskInputOptions:l,maskInputSelector:c,tagName:f,type:y})&&(b=Si({input:g,maskInputOptions:l,maskInputSelector:c,unmaskInputSelector:u,tagName:f,type:y,value:b,maskInputFn:d})),m(n,Co(Bo)({text:b,isChecked:v,userTriggered:h},p));const w=n.name;"radio"===y&&w&&v&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach((e=>{if(e!==n){const t=Si({input:e,maskInputOptions:l,maskInputSelector:c,unmaskInputSelector:u,tagName:f,type:y,value:Oi(e,f,y),maskInputFn:d});m(e,Co(Bo)({text:t,isChecked:!v,userTriggered:!1},p))}}))}function m(t,r){const i=No.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){No.set(t,r);const i=n.getId(t);e(Object.assign(Object.assign({},r),{id:i}))}}const g=("last"===f.input?["change"]:["input","change"]).map((e=>oo(e,Co(h),t))),y=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),b=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return y&&y.set&&g.push(...b.map((e=>uo(e[0],e[1],{set(){Co(h)({target:this})}})))),Co((()=>{g.forEach((e=>e()))}))}function Lo(e){return function(e,t){if(Uo("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Uo("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Uo("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Uo("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function jo(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:l,canvasMutationCb:d,fontCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),l(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),f(...e)}}(e,t);const r=Ro(e,e.doc),i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const i="number"===typeof t.mousemove?t.mousemove:50,o="number"===typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=co((t=>{const n=Date.now()-s;Co(e)(a.map((e=>(e.timeOffset-=n,e))),t),a=[],s=null}),o),u=co((e=>{const t=Oo(e),{clientX:n,clientY:i}=yo(e)?e.changedTouches[0]:e;s||(s=Date.now()),a.push({x:n,y:i,id:r.getId(t),timeOffset:Date.now()-s}),c("undefined"!==typeof DragEvent&&e instanceof DragEvent?eo.Drag:e instanceof MouseEvent?eo.MouseMove:eo.TouchMove)}),i,{trailing:!1}),l=[oo("mousemove",Co(u),n),oo("touchmove",Co(u),n),oo("drag",Co(u),n)];return Co((()=>{l.forEach((e=>e()))}))}(e),o=Do(e),s=Po(e),a=function({viewportResizeCb:e}){let t=-1,n=-1;const r=co((()=>{const r=fo(),i=po();t===r&&n===i||(Co(e)({width:Number(i),height:Number(r)}),t=r,n=i)}),200);return oo("resize",Co(r),window)}(e),c=Fo(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:i,sampling:o}){const s=s=>co(Co((o=>{const a=Oo(o);if(!a||ho(a,t,n,r))return;const{currentTime:c,volume:u,muted:l}=a;e({type:s,id:i.getId(a),currentTime:c,volume:u,muted:l})})),o.media||500),a=[oo("play",s(0)),oo("pause",s(1)),oo("seeked",s(2)),oo("volumechange",s(3))];return Co((()=>{a.forEach((e=>e()))}))}(e),l=function({styleSheetRuleCb:e,mirror:t},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(r,{apply:Co(((n,r,i)=>{const[o,s]=i,a=t.getId(r.ownerNode);return-1!==a&&e({id:a,adds:[{rule:o,index:s}]}),n.apply(r,i)}))});const i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Co(((n,r,i)=>{const[o]=i,s=t.getId(r.ownerNode);return-1!==s&&e({id:s,removes:[{index:o}]}),n.apply(r,i)}))});const o={};Zo("CSSGroupingRule")?o.CSSGroupingRule=n.CSSGroupingRule:(Zo("CSSMediaRule")&&(o.CSSMediaRule=n.CSSMediaRule),Zo("CSSConditionRule")&&(o.CSSConditionRule=n.CSSConditionRule),Zo("CSSSupportsRule")&&(o.CSSSupportsRule=n.CSSSupportsRule));const s={};return Object.entries(o).forEach((([n,r])=>{s[n]={insertRule:r.prototype.insertRule,deleteRule:r.prototype.deleteRule},r.prototype.insertRule=new Proxy(s[n].insertRule,{apply:Co(((n,r,i)=>{const[o,s]=i,a=t.getId(r.parentStyleSheet.ownerNode);return-1!==a&&e({id:a,adds:[{rule:o,index:[...Lo(r),s||0]}]}),n.apply(r,i)}))}),r.prototype.deleteRule=new Proxy(s[n].deleteRule,{apply:Co(((n,r,i)=>{const[o]=i,s=t.getId(r.parentStyleSheet.ownerNode);return-1!==s&&e({id:s,removes:[{index:[...Lo(r),o]}]}),n.apply(r,i)}))})})),Co((()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=i,Object.entries(o).forEach((([e,t])=>{t.prototype.insertRule=s[e].insertRule,t.prototype.deleteRule=s[e].deleteRule}))}))}(e,{win:n}),d=function({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(r,{apply:Co(((n,r,i)=>{var o,s;const[a,c,u]=i,l=t.getId(null===(s=null===(o=r.parentRule)||void 0===o?void 0:o.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==l&&e({id:l,set:{property:a,value:c,priority:u},index:Lo(r.parentRule)}),n.apply(r,i)}))});const i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Co(((n,r,i)=>{var o,s;const[a]=i,c=t.getId(null===(s=null===(o=r.parentRule)||void 0===o?void 0:o.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==c&&e({id:c,remove:{property:a},index:Lo(r.parentRule)}),n.apply(r,i)}))}),Co((()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=i}))}(e,{win:n}),f=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){const r=new o(e,t,n);return i.set(r,{family:e,buffer:"string"!==typeof t,descriptors:n,fontSource:"string"===typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=lo(t.fonts,"add",(function(t){return function(n){return setTimeout((()=>{const t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=o})),r.push(s),Co((()=>{r.forEach((e=>e()))}))}(e):()=>{},p=[];for(const h of e.plugins)p.push(h.observer(h.callback,n,h.options));return Co((()=>{Io.forEach((e=>e.reset())),r.disconnect(),i(),o(),s(),a(),c(),u();try{l(),d()}catch(h){}f(),p.forEach((e=>e()))}))}function Uo(e){return"undefined"!==typeof window[e]}function Zo(e){return Boolean("undefined"!==typeof window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ho{constructor(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}addIframe(e){this.iframes.set(e,!0)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)}}class zo{constructor(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(lo(HTMLElement.prototype,"attachShadow",(function(e){return function(){const n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}addShadowRoot(e,t){Ro(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Po(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(lo(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){const r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}}reset(){this.restorePatches.forEach((e=>e()))}}for(var Go="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vo="undefined"===typeof Uint8Array?[]:new Uint8Array(256),Wo=0;Wo{if(!e||!Xo(e,t)&&"object"!==typeof e)return;const r=function(e,t){let n=qo.get(e);return n||(n=new Map,qo.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i};function Ko(e,t,n){if(e instanceof Array)return e.map((e=>Ko(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t>2],i+=Go[(3&n[t])<<4|n[t+1]>>4],i+=Go[(15&n[t+1])<<2|n[t+2]>>6],i+=Go[63&n[t+2]];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ko(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ko(e.data,t,n),e.width,e.height]}}if(Xo(e,t)||"object"===typeof e){return{rr_type:e.constructor.name,index:$o(e,t,n)}}return e}const Yo=(e,t,n)=>[...e].map((e=>Ko(e,t,n))),Xo=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"===typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Jo(e,t,n,r,i,o,s,a){const c=[],u=Object.getOwnPropertyNames(e);for(const d of u)try{if("function"!==typeof e[d])continue;const u=lo(e,d,(function(c){return function(...u){const l=c.apply(this,u);if($o(l,a,e),!ho(this.canvas,r,o,i)){s.getId(this.canvas);const r=Yo([...u],a,e),i={type:t,property:d,args:r};n(this.canvas,i)}return l}}));c.push(u)}catch(l){const r=uo(e,d,{set(e){n(this.canvas,{type:t,property:d,args:[e],setter:!0})}});c.push(r)}return c}class Qo{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass,e.blockSelector,e.unblockSelector)}initCanvasMutationObserver(e,t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=function(e,t,n,r){const i=[];try{const o=lo(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...o){return ho(this,t,n,r)||"__context"in this||(this.__context=i),e.apply(this,[i,...o])}}));i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}(e,t,r,n),o=function(e,t,n,r,i,o){const s=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const u of a)try{if("function"!==typeof t.CanvasRenderingContext2D.prototype[u])continue;const o=lo(t.CanvasRenderingContext2D.prototype,u,(function(t){return function(...o){return ho(this.canvas,n,i,r)||setTimeout((()=>{const t=[...o];if("drawImage"===u&&t[0]&&t[0]instanceof HTMLCanvasElement){const e=t[0],n=e.getContext("2d");let r=null===n||void 0===n?void 0:n.getImageData(0,0,e.width,e.height),i=null===r||void 0===r?void 0:r.data;t[0]=JSON.stringify(i)}e(this.canvas,{type:no["2D"],property:u,args:t})}),0),t.apply(this,o)}}));s.push(o)}catch(c){const n=uo(t.CanvasRenderingContext2D.prototype,u,{set(t){e(this.canvas,{type:no["2D"],property:u,args:[t],setter:!0})}});s.push(n)}return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n,this.mirror),s=function(e,t,n,r,i,o){const s=[];return s.push(...Jo(t.WebGLRenderingContext.prototype,no.WebGL,e,n,r,i,o,t)),"undefined"!==typeof t.WebGL2RenderingContext&&s.push(...Jo(t.WebGL2RenderingContext.prototype,no.WebGL2,e,n,r,i,o,t)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie&&e.__sn?e.__sn.id:-1,getNode(e){return this.map[e]||null},removeNodeFromMap(e){const t=e.__sn&&e.__sn.id;delete this.map[t],e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))},has(e){return this.map.hasOwnProperty(e)},reset(){this.map={}}};function is(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,unblockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:u="rr-mask",maskTextSelector:l=null,maskInputSelector:d=null,unmaskTextSelector:f=null,unmaskInputSelector:p=null,inlineStylesheet:h=!0,maskAllText:m=!1,maskAllInputs:g,maskInputOptions:y,slimDOMOptions:b,maskInputFn:v,maskTextFn:w,hooks:x,packFn:A,sampling:E={},mousemoveWait:_,recordCanvas:k=!1,userTriggeredOnInput:T=!1,collectFonts:S=!1,inlineImages:C=!1,plugins:I,keepIframeSrcFn:O=(()=>!1),onMutation:R}=e;if(!t)throw new Error("emit function is required");void 0!==_&&void 0===E.mousemove&&(E.mousemove=_);const D=!0===g?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==y?y:{},P=!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===b,headMetaDescKeywords:"all"===b}:b||{};let B;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();let M=0;ts=(e,i)=>{var o;if(!(null===(o=Io[0])||void 0===o?void 0:o.isFrozen())||e.type===Qi.FullSnapshot||e.type===Qi.IncrementalSnapshot&&e.data.source===eo.Mutation||Io.forEach((e=>e.unfreeze())),t((e=>{for(const t of I||[])t.eventProcessor&&(e=t.eventProcessor(e));return A&&(e=A(e)),e})(e),i),e.type===Qi.FullSnapshot)B=e,M=0;else if(e.type===Qi.IncrementalSnapshot){if(e.data.source===eo.Mutation&&e.data.isAttachIframe)return;M++;const t=r&&M>=r,i=n&&e.timestamp-B.timestamp>n;(t||i)&&ns(!0)}};const N=e=>{ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.Mutation},e)}))},F=e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.Scroll},e)})),L=e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.CanvasMutation},e)})),j=new Ho({mutationCb:N}),U=new Qo({recordCanvas:k,mutationCb:L,win:window,blockClass:i,blockSelector:o,unblockSelector:s,mirror:rs}),Z=new zo({mutationCb:N,scrollCb:F,bypassOptions:{onMutation:R,blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:u,maskTextSelector:l,unmaskTextSelector:f,maskInputSelector:d,unmaskInputSelector:p,inlineStylesheet:h,maskAllText:m,maskInputOptions:D,maskTextFn:w,maskInputFn:v,recordCanvas:k,inlineImages:C,sampling:E,slimDOMOptions:P,iframeManager:j,canvasManager:U},mirror:rs});ns=(e=!1)=>{var t,n,r,a;ts(es({type:Qi.Meta,data:{href:window.location.href,width:po(),height:fo()}}),e),Io.forEach((e=>e.lock()));const[c,g]=function(e,t){const{blockClass:n="rr-block",blockSelector:r=null,unblockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,unmaskTextSelector:a=null,inlineStylesheet:c=!0,inlineImages:u=!1,recordCanvas:l=!1,maskInputSelector:d=null,unmaskInputSelector:f=null,maskAllText:p=!1,maskAllInputs:h=!1,maskTextFn:m,maskInputFn:g,slimDOM:y=!1,dataURLOptions:b,preserveWhiteSpace:v,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:A,keepIframeSrcFn:E=(()=>!1)}=t||{},_={};return[Xi(e,{doc:e,map:_,blockClass:n,blockSelector:r,unblockSelector:i,maskTextClass:o,maskTextSelector:s,unmaskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputSelector:d,unmaskInputSelector:f,maskAllText:p,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===h?{}:h,maskTextFn:m,maskInputFn:g,slimDOMOptions:!0===y||"all"===y?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===y,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===y?{}:y,dataURLOptions:b,inlineImages:u,recordCanvas:l,preserveWhiteSpace:v,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:A,keepIframeSrcFn:E}),_]}(document,{blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:u,maskTextSelector:l,unmaskTextSelector:f,maskInputSelector:d,unmaskInputSelector:p,inlineStylesheet:h,maskAllText:m,maskAllInputs:D,maskTextFn:w,slimDOM:P,recordCanvas:k,inlineImages:C,onSerialize:e=>{bo(e)&&j.addIframe(e),vo(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{j.attachIframe(e,t),Z.observeAttachShadow(e)},keepIframeSrcFn:O});if(!c)return console.warn("Failed to snapshot the document");rs.map=g,ts(es({type:Qi.FullSnapshot,data:{node:c,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),Io.forEach((e=>e.unlock()))};try{const e=[];e.push(oo("DOMContentLoaded",(()=>{ts(es({type:Qi.DomContentLoaded,data:{}}))})));const t=e=>{var t;return Co(jo)({onMutation:R,mutationCb:N,mousemoveCb:(e,t)=>ts(es({type:Qi.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.MouseInteraction},e)})),scrollCb:F,viewportResizeCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.ViewportResize},e)})),inputCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.Input},e)})),mediaInteractionCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.MediaInteraction},e)})),styleSheetRuleCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.StyleSheetRule},e)})),styleDeclarationCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.StyleDeclaration},e)})),canvasMutationCb:L,fontCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.Font},e)})),blockClass:i,ignoreClass:a,ignoreSelector:c,maskTextClass:u,maskTextSelector:l,unmaskTextSelector:f,maskInputSelector:d,unmaskInputSelector:p,maskInputOptions:D,inlineStylesheet:h,sampling:E,recordCanvas:k,inlineImages:C,userTriggeredOnInput:T,collectFonts:S,doc:e,maskAllText:m,maskInputFn:v,maskTextFn:w,blockSelector:o,unblockSelector:s,slimDOMOptions:P,mirror:rs,iframeManager:j,shadowDomManager:Z,canvasManager:U,plugins:(null===(t=null===I||void 0===I?void 0:I.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>ts(es({type:Qi.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},x)};j.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{ns(),e.push(t(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(oo("load",(()=>{ts(es({type:Qi.Load,data:{}})),n()}),window)),()=>{e.forEach((e=>e()))}}catch(H){console.warn(H)}}function os(e){return e>9999999999?e:1e3*e}function ss(e,t){"sentry.transaction"!==t.category&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate((()=>(e.throttledAddEvent({type:Qi.Custom,timestamp:1e3*(t.timestamp||0),data:{tag:"breadcrumb",payload:St(t,10,1e3)}}),"console"===t.category))))}is.addCustomEvent=(e,t)=>{if(!ts)throw new Error("please add custom event after start recording");ts(es({type:Qi.Custom,data:{tag:e,payload:t}}))},is.freezePage=()=>{Io.forEach((e=>e.freeze()))},is.takeFullSnapshot=e=>{if(!ns)throw new Error("please take full snapshot after start recording");ns(e)},is.mirror=rs;function as(e){const t=cs(e);if(!t||!(t instanceof Element))return t;return t.closest("button,a")||t}function cs(e){return function(e){return"object"===typeof e&&!!e&&"target"in e}(e)?e.target:e}let us;function ls(e){return us||(us=[],ae(yi,"open",(function(e){return function(...t){if(us)try{us.forEach((e=>e()))}catch(h){}return e.apply(yi,t)}}))),us.push(e),()=>{const t=us?us.indexOf(e):-1;t>-1&&us.splice(t,1)}}class ds{constructor(e,t,n=ss){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const e=()=>{this._lastScroll=ps()},t=ls((()=>{this._lastMutation=ps()})),n=e=>{if(!e.target)return;const t=as(e);t&&this._handleMultiClick(t)},r=new MutationObserver((()=>{this._lastMutation=ps()}));r.observe(yi.document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),yi.addEventListener("scroll",e,{passive:!0}),yi.addEventListener("click",n,{passive:!0}),this._teardown=()=>{yi.removeEventListener("scroll",e),yi.removeEventListener("click",n),t(),r.disconnect(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(function(e,t){if(!fs.includes(e.tagName))return!0;if("INPUT"===e.tagName&&!["submit","button"].includes(e.getAttribute("type")||""))return!0;if("A"===e.tagName&&(e.hasAttribute("download")||e.hasAttribute("target")&&"_self"!==e.getAttribute("target")))return!0;if(t&&e.matches(t))return!0;return!1}(t,this._ignoreSelector)||!function(e){return!(!e.data||"number"!==typeof e.data.nodeId||!e.timestamp)}(e))return;const n={timestamp:(r=e.timestamp,r>9999999999?r/1e3:r),clickBreadcrumb:e,clickCount:0,node:t};var r;this._clicks.some((e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1))||(this._clicks.push(n),1===this._clicks.length&&this._scheduleCheckClicks())}_handleMultiClick(e){this._getClicks(e).forEach((e=>{e.clickCount++}))}_getClicks(e){return this._clicks.filter((t=>t.node===e))}_checkClicks(){const e=[],t=ps();this._clicks.forEach((n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)}));for(const n of e){const e=this._clicks.indexOf(n);e>-1&&(this._generateBreadcrumbs(n),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!n&&!r,{clickCount:o,clickBreadcrumb:s}=e;if(i){const n=1e3*Math.min(e.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",i={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.slowClickDetected",data:{...s.data,url:yi.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:o||1}};this._addBreadcrumbEvent(t,i)}else if(o>1){const e={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.multiClick",data:{...s.data,url:yi.location.href,route:t.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout((()=>this._checkClicks()),1e3)}}const fs=["A","BUTTON","INPUT"];function ps(){return Date.now()/1e3}function hs(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var ms;!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(ms||(ms={}));const gs=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled"]);function ys(e){const t={};for(const n in e)if(gs.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),t[r]=e[n]}return t}const bs=e=>t=>{if(!e.isEnabled())return;const n=function(e){const{target:t,message:n}=function(e){const t="click"===e.name;let n,r=null;try{r=t?as(e.event):cs(e.event),n=X(r,{maxStringLength:200})||""}catch(h){n=""}return{target:r,message:n}}(e);return hs({category:`ui.${e.name}`,...vs(t,n)})}(t);if(!n)return;const r="click"===t.name,i=r&&t.event;!(r&&e.clickDetector&&i)||i.altKey||i.metaKey||i.ctrlKey||i.shiftKey||function(e,t,n){e.handleClick(t,n)}(e.clickDetector,n,as(t.event)),ss(e,n)};function vs(e,t){const n=e&&function(e){return"__sn"in e}(e)&&e.__sn.type===ms.Element?e.__sn:null;return{message:t,data:n?{nodeId:n.id,node:{id:n.id,tagName:n.tagName,textContent:e?Array.from(e.childNodes).map((e=>"__sn"in e&&e.__sn.type===ms.Text&&e.__sn.textContent)).filter(Boolean).map((e=>e.trim())).join(""):"",attributes:ys(n.attributes)}}:{}}}function ws(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=function(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:o,target:s}=e;if(!s||function(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable}(s)||!o)return null;const a=t||r||i,c=1===o.length;if(!a&&c)return null;const u=X(s,{maxStringLength:200})||"",l=vs(s,u);return hs({category:"ui.keyDown",message:u,data:{...l.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:o}})}(t);n&&ss(e,n)}const xs=["name","type","startTime","transferSize","duration"];function As(e){return function(t){return xs.every((n=>e[n]===t[n]))}}function Es(e){const t=new PerformanceObserver((t=>{const n=function(e,t){const[n,r,i]=e.reduce(((e,t)=>("navigation"===t.entryType?e[0].push(t):"largest-contentful-paint"===t.entryType?e[1].push(t):e[2].push(t),e)),[[],[],[]]),o=[],s=[];let a=r.length?r[r.length-1]:void 0;return t.forEach((e=>{if("largest-contentful-paint"!==e.entryType)if("navigation"!==e.entryType)o.push(e);else{const t=e;e.duration>0&&!n.find(As(t))&&!s.find(As(t))&&s.push(t)}else(!a||a.startTimee.startTime-t.startTime))}(e.performanceEvents,t.getEntries());e.performanceEvents=n}));return["element","event","first-input","largest-contentful-paint","layout-shift","longtask","navigation","paint","resource"].forEach((e=>{try{t.observe({type:e,buffered:!0})}catch(h){}})),t}function _s(e,t){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(ne.info(e),t&&Ts(e))}function ks(e,t){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(ne.info(e),t&&setTimeout((()=>{Ts(e)}),0))}function Ts(e){Ue().addBreadcrumb({category:"console",data:{logger:"replay"},level:"info",message:e},{level:"info"})}class Ss extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class Cs{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>Ai)throw new Ss;this.events.push(e)}finish(){return new Promise((e=>{const t=this.events;this.clear(),e(JSON.stringify(t))}))}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map((e=>e.timestamp)).sort()[0];return e?os(e):null}}class Is{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise(((e,t)=>{this._worker.addEventListener("message",(({data:n})=>{n.success?e():t()}),{once:!0}),this._worker.addEventListener("error",(e=>{t(e)}),{once:!0})}))),this._ensureReadyPromise}destroy(){_s("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(e,t){const n=this._getAndIncrementId();return new Promise(((r,i)=>{const o=({data:t})=>{const s=t;if(s.method===e&&s.id===n){if(this._worker.removeEventListener("message",o),!s.success)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay]",s.response),void i(new Error("Error in compression worker"));r(s.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:n,method:e,arg:t})}))}_getAndIncrementId(){return this._id++}}class Os{constructor(e){this._worker=new Is(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const t=os(e.timestamp);(!this._earliestTimestamp||tAi?Promise.reject(new Ss):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear")}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class Rs{constructor(e){this._fallback=new Cs,this._compression=new Os(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){return void _s("[Replay] Failed to load the compression worker, falling back to simple buffer")}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:t}=this._fallback,n=[];for(const i of e)n.push(this._compression.addEvent(i));this._compression.hasCheckout=t,this._used=this._compression;try{await Promise.all(n)}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("[Replay] Failed to add events when switching buffers.",r)}}}function Ds({useCompression:e}){if(e&&window.Worker)try{const e=function(){const e=new Blob(['/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */\nfunction t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);const r=new Array(60);t(r);const o=new Array(512);t(o);const l=new Array(256);t(l);const h=new Array(29);t(h);const d=new Array(30);function _(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let f,c,u;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const m=t=>t<256?o[t]:o[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},g=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{g(t,a[2*e],a[2*e+1])},k=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},v=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=k(i[e]++,e))}},y=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let s,r,o,_,f=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+f++],s+=(255&t.pending_buf[t.sym_buf+f++])<<8,r=t.pending_buf[t.sym_buf+f++],0===s?p(t,r,i):(o=l[r],p(t,o+256+1,i),_=e[o],0!==_&&(r-=h[o],g(t,r,_)),s--,o=m(s),p(t,o,n),_=a[o],0!==_&&(s-=d[o],g(t,s,_)))}while(f{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r>1;r>=1;r--)A(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>l&&(f=l,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=o&&(c=r[d-o]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=l-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(f=l;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),v(a,h,t.bl_count)},Z=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o{g(t,0+(i?1:0),3),x(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var T=(t,e,a,i)=>{let o,l,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),h=(t=>{let e;for(Z(t,t.dyn_ltree,t.l_desc.max_code),Z(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,l=t.static_len+3+7>>>3,l<=o&&(o=l)):o=l=a+5,a+4<=o&&-1!==e?D(t,e,a,i):4===t.strategy||l===o?(g(t,2+(i?1:0),3),E(t,s,r)):(g(t,4+(i?1:0),3),((t,e,a,i)=>{let s;for(g(t,e-257,5),g(t,a-1,5),g(t,i-4,4),s=0;s{S||((()=>{let t,n,w,m,b;const g=new Array(16);for(w=0,m=0;m<28;m++)for(h[m]=w,t=0;t<1<>=7;m<30;m++)for(d[m]=b<<7,t=0;t<1<(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(l[a]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{g(t,2,3),p(t,256,s),(t=>{16===t.bi_valid?(b(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var F=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const L=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var N=(t,e,a,i)=>{const n=L,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return-1^t},I={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},B={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:C,_tr_stored_block:H,_tr_flush_block:M,_tr_tally:j,_tr_align:K}=O,{Z_NO_FLUSH:P,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:G,Z_FINISH:X,Z_BLOCK:W,Z_OK:q,Z_STREAM_END:J,Z_STREAM_ERROR:Q,Z_DATA_ERROR:V,Z_BUF_ERROR:$,Z_DEFAULT_COMPRESSION:tt,Z_FILTERED:et,Z_HUFFMAN_ONLY:at,Z_RLE:it,Z_FIXED:nt,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:rt,Z_DEFLATED:ot}=B,lt=(t,e)=>(t.msg=I[e],e),ht=t=>2*t-(t>4?9:0),dt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},_t=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let ft=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},ut=(t,e)=>{M(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ct(t.strm)},wt=(t,e)=>{t.pending_buf[t.pending++]=e},mt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=F(t.adler,e,n,a):2===t.state.wrap&&(t.adler=N(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},gt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+258;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>l&&0!=--n);return r<=t.lookahead?r:t.lookahead},pt=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),i+=e),0===t.strm.avail_in)break;if(a=bt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ft(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ft(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,ct(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(bt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_watern&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===X)&&e!==P&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===X&&0===t.strm.avail_in&&a===i?1:0,H(t,t.block_start,a,r),t.block_start+=a,ct(t.strm)),r?3:1)},vt=(t,e)=>{let a,i;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a)),t.match_length>=3)if(i=j(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ft(t,t.ins_h,t.window[t.strstart+1]);else i=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2},yt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=j(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(ut(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=j(t,0,t.window[t.strstart-1]),i&&ut(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=j(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2};function xt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const zt=[new xt(0,0,0,0,kt),new xt(4,4,8,4,vt),new xt(4,5,16,8,vt),new xt(4,6,32,32,vt),new xt(4,4,16,16,yt),new xt(8,16,32,32,yt),new xt(8,16,128,128,yt),new xt(8,32,128,256,yt),new xt(32,128,258,1024,yt),new xt(32,258,258,4096,yt)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),dt(this.dyn_ltree),dt(this.dyn_dtree),dt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),dt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),dt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Et=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Rt=t=>{if(Et(t))return lt(t,Q);t.total_in=t.total_out=0,t.data_type=rt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,C(e),q},Zt=t=>{const e=Rt(t);var a;return e===q&&((a=t.state).window_size=2*a.w_size,dt(a.head),a.max_lazy_match=zt[a.level].max_lazy,a.good_match=zt[a.level].good_length,a.nice_match=zt[a.level].nice_length,a.max_chain_length=zt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ut=(t,e,a,i,n,s)=>{if(!t)return Q;let r=1;if(e===tt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ot||i<8||i>15||e<0||e>9||s<0||s>nt||8===i&&1!==r)return lt(t,Q);8===i&&(i=9);const o=new At;return t.state=o,o.strm=t,o.status=42,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<Ut(t,e,ot,15,8,st),deflateInit2:Ut,deflateReset:Zt,deflateResetKeep:Rt,deflateSetHeader:(t,e)=>Et(t)||2!==t.state.wrap?Q:(t.state.gzhead=e,q),deflate:(t,e)=>{if(Et(t)||e>W||e<0)return t?lt(t,Q):Q;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===a.status&&e!==X)return lt(t,0===t.avail_out?$:Q);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(ct(t),0===t.avail_out)return a.last_flush=-1,q}else if(0===t.avail_in&&ht(e)<=ht(i)&&e!==X)return lt(t,$);if(666===a.status&&0!==t.avail_in)return lt(t,$);if(42===a.status&&0===a.wrap&&(a.status=113),42===a.status){let e=ot+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=at||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,mt(a,e),0!==a.strstart&&(mt(a,t.adler>>>16),mt(a,65535&t.adler)),t.adler=1,a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(57===a.status)if(t.adler=0,wt(a,31),wt(a,139),wt(a,8),a.gzhead)wt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),wt(a,255&a.gzhead.time),wt(a,a.gzhead.time>>8&255),wt(a,a.gzhead.time>>16&255),wt(a,a.gzhead.time>>24&255),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(wt(a,255&a.gzhead.extra.length),wt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=N(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,3),a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,ct(t),0!==a.pending)return a.last_flush=-1,q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindexi&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindexi&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(ct(t),0!==a.pending))return a.last_flush=-1,q;wt(a,255&t.adler),wt(a,t.adler>>8&255),t.adler=0}if(a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(0!==t.avail_in||0!==a.lookahead||e!==P&&666!==a.status){let i=0===a.level?kt(a,e):a.strategy===at?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(pt(t),0===t.lookahead)){if(e===P)return 1;break}if(t.match_length=0,a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===it?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=258){if(pt(t),t.lookahead<=258&&e===P)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+258;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=j(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):zt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=666),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),q;if(2===i&&(e===Y?K(a):e!==W&&(H(a,0,0,!1),e===G&&(dt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ct(t),0===t.avail_out))return a.last_flush=-1,q}return e!==X?q:a.wrap<=0?J:(2===a.wrap?(wt(a,255&t.adler),wt(a,t.adler>>8&255),wt(a,t.adler>>16&255),wt(a,t.adler>>24&255),wt(a,255&t.total_in),wt(a,t.total_in>>8&255),wt(a,t.total_in>>16&255),wt(a,t.total_in>>24&255)):(mt(a,t.adler>>>16),mt(a,65535&t.adler)),ct(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?q:J)},deflateEnd:t=>{if(Et(t))return Q;const e=t.state.status;return t.state=null,113===e?lt(t,V):q},deflateSetDictionary:(t,e)=>{let a=e.length;if(Et(t))return Q;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return Q;if(1===n&&(t.adler=F(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(dt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,pt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=ft(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,pt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,q},deflateInfo:"pako deflate (from Nodeca project)"};const Dt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Tt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Dt(a,e)&&(t[e]=a[e])}}return t},Ot=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Lt[254]=Lt[254]=1;var Nt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},It=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ft)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Lt[t[a]]>e?a:e};var Ct=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ht=Object.prototype.toString,{Z_NO_FLUSH:Mt,Z_SYNC_FLUSH:jt,Z_FULL_FLUSH:Kt,Z_FINISH:Pt,Z_OK:Yt,Z_STREAM_END:Gt,Z_DEFAULT_COMPRESSION:Xt,Z_DEFAULT_STRATEGY:Wt,Z_DEFLATED:qt}=B;function Jt(t){this.options=Tt({level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=St.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Yt)throw new Error(I[a]);if(e.header&&St.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Nt(e.dictionary):"[object ArrayBuffer]"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=St.deflateSetDictionary(this.strm,t),a!==Yt)throw new Error(I[a]);this._dict_set=!0}}function Qt(t,e){const a=new Jt(e);if(a.push(t,!0),a.err)throw a.msg||I[a.err];return a.result}Jt.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Pt:Mt,"string"==typeof t?a.input=Nt(t):"[object ArrayBuffer]"===Ht.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===jt||s===Kt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=St.deflate(a,s),n===Gt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=St.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Yt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===Yt&&(this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Vt={Deflate:Jt,deflate:Qt,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Qt(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Qt(t,e)},constants:B};var $t=function(t,e){let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=u[(65535&g)+(f&(1<>>=p,c-=p),c<15&&(f+=z[a++]<>>24,f>>>=p,c-=p,p=g>>>16&255,!(16&p)){if(0==(64&p)){g=w[(65535&g)+(f&(1<o){t.msg="invalid distance too far back",E.mode=16209;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg="invalid distance too far back",E.mode=16209;break t}if(y=0,x=_,0===d){if(y+=l-p,p2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,a-=k,c-=k<<3,f&=(1<{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(m=0;m=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(m=0;m852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<>v)+d]=Z<<24|U<<16|S|0}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0==--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=b,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),o.bits=p,0};const{Z_FINISH:se,Z_BLOCK:re,Z_TREES:oe,Z_OK:le,Z_STREAM_END:he,Z_NEED_DICT:de,Z_STREAM_ERROR:_e,Z_DATA_ERROR:fe,Z_MEM_ERROR:ce,Z_BUF_ERROR:ue,Z_DEFLATED:we}=B,me=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ge(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const pe=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(pe(t))return _e;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},ve=t=>{if(pe(t))return _e;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},ye=(t,e)=>{let a;if(pe(t))return _e;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_e:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,ve(t))},xe=(t,e)=>{if(!t)return _e;const a=new ge;t.state=a,a.strm=t,a.window=null,a.mode=16180;const i=ye(t,e);return i!==le&&(t.state=null),i};let ze,Ae,Ee=!0;const Re=t=>{if(Ee){ze=new Int32Array(512),Ae=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ne(1,t.lens,0,288,ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ne(2,t.lens,0,32,Ae,0,t.work,{bits:5}),Ee=!1}t.lencode=ze,t.lenbits=9,t.distcode=Ae,t.distbits=5},Ze=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whavexe(t,15),inflateInit2:xe,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pe(t)||!t.output||!t.input&&0!==t.avail_in)return _e;a=t.state,16191===a.mode&&(a.mode=16192),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=le;t:for(;;)switch(a.mode){case 16180:if(0===a.wrap){a.mode=16192;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>>8&255,a.check=N(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=me;break}if((15&h)!==we){t.msg="unknown compression method",a.mode=me;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=me;break}a.dmax=1<>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=N(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>o&&(c=o),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=16191;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=16206;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(Re(a),a.mode=16199,e===oe){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=me}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=me;break}if(a.length=65535&h,h=0,d=0,a.mode=16194,e===oe)break t;case 16194:a.mode=16195;case 16195:if(c=a.length,c){if(c>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=16191;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=me;break}a.have=0,a.mode=16197;case 16197:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=ne(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=me;break}a.have=0,a.mode=16198;case 16198:for(;a.have>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=me;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d>>=m,d-=m,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d>>=m,d-=m,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=me;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===me)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=me;break}if(a.lenbits=9,E={bits:a.lenbits},x=ne(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=me;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=ne(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=me;break}if(a.mode=16199,e===oe)break t;case 16199:a.mode=16200;case 16200:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,$t(t,f),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,16191===a.mode&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=16191;break}if(64&b){t.msg="invalid literal/length code",a.mode=me;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=me;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=me;break}a.mode=16204;case 16204:if(0===l)break t;if(c=f-l,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=me;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=16200);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=16200;break;case 16206:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<{if(pe(t))return _e;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(pe(t))return _e;const a=t.state;return 0==(2&a.wrap)?_e:(a.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return pe(t)?_e:(i=t.state,0!==i.wrap&&16190!==i.mode?_e:16190===i.mode&&(n=1,n=F(n,e,a,0),n!==i.check)?fe:(s=Ze(t,e,a,a),s?(i.mode=16210,ce):(i.havedict=1,le)))},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const De=Object.prototype.toString,{Z_NO_FLUSH:Te,Z_FINISH:Oe,Z_OK:Fe,Z_STREAM_END:Le,Z_NEED_DICT:Ne,Z_STREAM_ERROR:Ie,Z_DATA_ERROR:Be,Z_MEM_ERROR:Ce}=B;function He(t){this.options=Tt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=Ue.inflateInit2(this.strm,e.windowBits);if(a!==Fe)throw new Error(I[a]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Nt(e.dictionary):"[object ArrayBuffer]"===De.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ue.inflateSetDictionary(this.strm,e.dictionary),a!==Fe)))throw new Error(I[a])}He.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Oe:Te,"[object ArrayBuffer]"===De.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Ue.inflate(a,r),s===Ne&&n&&(s=Ue.inflateSetDictionary(a,n),s===Fe?s=Ue.inflate(a,r):s===Be&&(s=Ne));a.avail_in>0&&s===Le&&a.state.wrap>0&&0!==t[a.next_in];)Ue.inflateReset(a),s=Ue.inflate(a,r);switch(s){case Ie:case Be:case Ne:case Ce:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===Le))if("string"===this.options.to){let t=Bt(a.output,a.next_out),e=a.next_out-t,n=It(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Fe||0!==o){if(s===Le)return s=Ue.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},He.prototype.onData=function(t){this.chunks.push(t)},He.prototype.onEnd=function(t){t===Fe&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:Me,deflate:je,deflateRaw:Ke,gzip:Pe}=Vt;var Ye=Me,Ge=je,Xe=B;const We=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const e=this._hasEvents?",":"";this.deflate.push(e+t,Xe.Z_SYNC_FLUSH),this._hasEvents=!0}finish(){if(this.deflate.push("]",Xe.Z_FINISH),this.deflate.err)throw this.deflate.err;const t=this.deflate.result;return this._init(),t}_init(){this._hasEvents=!1,this.deflate=new Ye,this.deflate.push("[",Xe.Z_NO_FLUSH)}},qe={clear:()=>{We.clear()},addEvent:t=>We.addEvent(t),finish:()=>We.finish(),compress:t=>function(t){return Ge(t)}(t)};addEventListener("message",(function(t){const e=t.data.method,a=t.data.id,i=t.data.arg;if(e in qe&&"function"==typeof qe[e])try{const t=qe[e](i);postMessage({id:a,method:e,success:!0,response:t})}catch(t){postMessage({id:a,method:e,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});']);return URL.createObjectURL(e)}();_s("[Replay] Using compression worker");const t=new Worker(e);return new Rs(t)}catch(t){_s("[Replay] Failed to create compression worker")}return _s("[Replay] Using simple buffer"),new Cs}function Ps(){try{return"sessionStorage"in yi&&!!yi.sessionStorage}catch(h){return!1}}function Bs(e){!function(){if(!Ps())return;try{yi.sessionStorage.removeItem(bi)}catch(h){}}(),e.session=void 0}function Ms(e){return void 0!==e&&Math.random()e.getContext().initialTimestamp+e.getOptions().maxReplayDuration)||(_s(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,e.getOptions()._experiments.traceInternals),!1))}function Ws(e){return!e.type}function qs(e){return"transaction"===e.type}function $s(e){const t=function(){const e=Ue().getClient();if(!e)return!1;const t=e.getTransport();if(!t)return!1;return t.send.__sentry__baseTransport__||!1}();return(n,r)=>{if(!e.isEnabled()||!Ws(n)&&!qs(n))return;const i=r&&r.statusCode;t&&(!i||i<200||i>=300)||(qs(n)?function(e,t){const n=e.getContext();t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}(e,n):function(e,t){const n=e.getContext();t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id);"buffer"===e.recordingMode&&t.tags&&t.tags.replayId&&setTimeout((()=>{e.sendBufferedReplayOrFlush()}))}(e,n))}}function Ks(e,t=!1){const n=t?$s(e):void 0;return Object.assign(((t,r)=>{if(!e.isEnabled())return t;if(function(e){return"replay_event"===e.type}(t))return delete t.breadcrumbs,t;if(!Ws(t)&&!qs(t))return t;if(!e.checkAndHandleExpiredSession())return t;if(function(e,t){return!(e.type||!e.exception||!e.exception.values||!e.exception.values.length)&&(!(!t.originalException||!t.originalException.__rrweb__)||e.exception.values.some((e=>!!(e.stacktrace&&e.stacktrace.frames&&e.stacktrace.frames.length)&&e.stacktrace.frames.some((e=>e.filename&&e.filename.includes("/rrweb/src/"))))))}(t,r)&&!e.getOptions()._experiments.captureExceptions)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Replay] Ignoring error from rrweb internals",t),null;const i=function(e,t){return"buffer"===e.recordingMode&&t.message!==vi&&!(!t.exception||t.type)&&Ms(e.getOptions().errorSampleRate)}(e,t);return(i||"session"===e.recordingMode)&&(t.tags={...t.tags,replayId:e.getSessionId()}),n&&n(t,{statusCode:200}),t}),{id:"Replay"})}function Ys(e,t){return t.map((({type:t,start:n,end:r,name:i,data:o})=>{const s=e.throttledAddEvent({type:Qi.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:t,description:i,startTimestamp:n,endTimestamp:r,data:o}}});return"string"===typeof s?Promise.resolve(null):s}))}function Xs(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}(t);null!==n&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate((()=>(Ys(e,[n]),!1))))}}function Js(e,t){return("undefined"!==typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__||!e.getOptions()._experiments.traceInternals)&&function(e){const t=Ue().getClient(),n=t&&t.getDsn();return!!n&&e.includes(n.host)}(t)}function Qs(e,t){e.isEnabled()&&null!==t&&(Js(e,t.name)||e.addUpdate((()=>(Ys(e,[t]),!0))))}const ea=10,ta=11,na=12,ra=13,ia=14,oa=15,sa=20,aa=21,ca=22,ua=23,la=["true","false","null"];function da(e,t){if(!t.length)return e;let n=e;const r=t.length-1;n=function(e,t){switch(t){case ea:return`${e}"~~":"~~"`;case 11:return`${e}:"~~"`;case 12:return`${e}~~":"~~"`;case ra:return function(e){const t=e.lastIndexOf(":"),n=e.slice(t+1);if(la.includes(n.trim()))return`${e},"~~":"~~"`;return`${e.slice(0,t+1)}"~~"`}(e);case 14:return`${e}~~"`;case oa:return`${e},"~~":"~~"`;case sa:return`${e}"~~"`;case aa:return function(e){const t=function(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(","===n||"["===n)return t}return-1}(e);if(t>-1){const n=e.slice(t+1);return la.includes(n.trim())?`${e},"~~"`:`${e.slice(0,t+1)}"~~"`}return e}(e);case 22:return`${e}~~"`;case ua:return`${e},"~~"`}return e}(n,t[r]);for(let i=r;i>=0;i--){switch(t[i]){case ea:n=`${n}}`;break;case sa:n=`${n}]`}}return n}function fa(e,t,n){const r=e[e.length-1],i=t[n];if(!/\s/.test(i))if('"'!==i||pa(t,n))switch(i){case"{":!function(e,t){if(!t)return void e.push(ea);if(t===ra)return void e.push(ea);t===aa&&e.push(ea);if(t===sa)e.push(ea)}(e,r);break;case"[":!function(e,t){if(!t)return e.push(sa),void e.push(aa);if(t===ra)return e.push(sa),void e.push(aa);t===aa&&(e.push(sa),e.push(aa));if(t===sa)e.push(sa),e.push(aa)}(e,r);break;case":":!function(e,t){t===ta&&(e.pop(),e.push(ra))}(e,r);break;case",":!function(e,t){if(t===ra)return void e.pop();if(t===oa)return e.pop(),void e.pop();if(t===aa)return;if(t===ua)e.pop()}(e,r);break;case"}":!function(e,t){t===ea&&e.pop();t===ra&&(e.pop(),e.pop());t===oa&&(e.pop(),e.pop(),e.pop());e[e.length-1]===ra&&e.push(oa);e[e.length-1]===aa&&e.push(ua)}(e,r);break;case"]":!function(e,t){t===sa&&e.pop();t===aa&&(e.pop(),e.pop());t===ua&&(e.pop(),e.pop(),e.pop());e[e.length-1]===ra&&e.push(oa);e[e.length-1]===aa&&e.push(ua)}(e,r)}else!function(e,t){if(t===ia)return e.pop(),void e.push(oa);if(t===ca)return e.pop(),void e.push(ua);if(t===ra)return void e.push(ia);if(t===aa)return void e.push(ca);if(t===ea)return void e.push(na);if(t===na)e.pop(),e.push(11)}(e,r)}function pa(e,t){return"\\"===e[t-1]&&!pa(e,t-1)}function ha(e){return da(e,function(e){const t=[];for(let n=0;nwi;if(function(e){const t=e[0],n=e[e.length-1];return"["===t&&"]"===n||"{"===t&&"}"===n}(e))try{const n=t?ha(e.slice(0,wi)):e;return{body:JSON.parse(n),warnings:t?["JSON_TRUNCATED"]:[]}}catch(n){return{body:t?`${e.slice(0,wi)}\u2026`:e,warnings:t?["INVALID_JSON","TEXT_TRUNCATED"]:["INVALID_JSON"]}}return{body:t?`${e.slice(0,wi)}\u2026`:e,warnings:t?["TEXT_TRUNCATED"]:[]}}(n);return r.body=i,o.length>0&&(r._meta={warnings:o}),r}function xa(e,t){return Object.keys(e).reduce(((n,r)=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=e[r]),n}),{})}function Aa(e){return new URLSearchParams(e).toString()}function Ea(e,t){const n=function(e,t=yi.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(yi.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;if(!e.endsWith("/")&&r.endsWith("/"))return r.slice(0,-1);return r}(e);return se(n,t)}async function _a(e,t,n){try{const r=await async function(e,t,n){const{startTimestamp:r,endTimestamp:i}=t,{url:o,method:s,status_code:a=0,request_body_size:c,response_body_size:u}=e.data,l=Ea(o,n.networkDetailAllowUrls)&&!Ea(o,n.networkDetailDenyUrls),d=l?function({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const i=function(e,t){if(1===e.length&&"string"!==typeof e[0])return Sa(e[0],t);if(2===e.length)return Sa(e[1],t);return{}}(n,t);if(!e)return wa(i,r,void 0);const o=ya(ka(n));return wa(i,r,o)}(n,t.input,c):va(c),f=await async function(e,{networkCaptureBodies:t,textEncoder:n,networkResponseHeaders:r},i,o){if(!e&&void 0!==o)return va(o);const s=Ta(i.headers,r);if(!t&&void 0!==o)return wa(s,o,void 0);try{const r=i.clone(),a=await async function(e){try{return await e.text()}catch(t){return}}(r),c=a&&a.length&&void 0===o?ma(a,n):o;return e?wa(s,c,t?a:void 0):va(c)}catch(h){return wa(s,o,void 0)}}(l,n,t.response,u);return{startTimestamp:r,endTimestamp:i,url:o,method:s,statusCode:a,request:d,response:f}}(e,t,n),i=ba("resource.fetch",r);Qs(n.replay,i)}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay] Failed to capture fetch breadcrumb",r)}}function ka(e=[]){if(2===e.length&&"object"===typeof e[1])return e[1].body}function Ta(e,t){const n={};return t.forEach((t=>{e.get(t)&&(n[t]=e.get(t))})),n}function Sa(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?Ta(n,t):Array.isArray(n)?{}:xa(n,t):{}}async function Ca(e,t,n){try{const r=function(e,t,n){const{startTimestamp:r,endTimestamp:i,input:o,xhr:s}=t,{url:a,method:c,status_code:u=0,request_body_size:l,response_body_size:d}=e.data;if(!a)return null;if(!Ea(a,n.networkDetailAllowUrls)||Ea(a,n.networkDetailDenyUrls)){return{startTimestamp:r,endTimestamp:i,url:a,method:c,statusCode:u,request:va(l),response:va(d)}}const f=s.__sentry_xhr_v2__,p=f?xa(f.request_headers,n.networkRequestHeaders):{},h=xa(function(e){const t=e.getAllResponseHeaders();if(!t)return{};return t.split("\r\n").reduce(((e,t)=>{const[n,r]=t.split(": ");return e[n.toLowerCase()]=r,e}),{})}(s),n.networkResponseHeaders),m=wa(p,l,n.networkCaptureBodies?ya(o):void 0),g=wa(h,d,n.networkCaptureBodies?t.xhr.responseText:void 0);return{startTimestamp:r,endTimestamp:i,url:a,method:c,statusCode:u,request:m,response:g}}(e,t,n),i=ba("resource.xhr",r);Qs(n.replay,i)}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay] Failed to capture fetch breadcrumb",r)}}function Ia(e){const t=Ue().getClient();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:a}=e.getOptions(),c={replay:e,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:a};t&&t.on?t.on("beforeAddBreadcrumb",((e,t)=>function(e,t,n){if(!t.data)return;try{(function(e){return"xhr"===e.category})(t)&&function(e){return e&&e.xhr}(n)&&(!function(e,t,n){const{xhr:r,input:i}=t,o=ma(i,n.textEncoder),s=r.getResponseHeader("content-length")?ga(r.getResponseHeader("content-length")):ma(r.response,n.textEncoder);void 0!==o&&(e.data.request_body_size=o),void 0!==s&&(e.data.response_body_size=s)}(t,n,e),Ca(t,n,e)),function(e){return"fetch"===e.category}(t)&&function(e){return e&&e.response}(n)&&(!function(e,t,n){const{input:r,response:i}=t,o=ma(ka(r),n.textEncoder),s=i?ga(i.headers.get("content-length")):void 0;void 0!==o&&(e.data.request_body_size=o),void 0!==s&&(e.data.response_body_size=s)}(t,n,e),_a(t,n,e))}catch(h){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Error when enriching network breadcrumb")}}(c,e,t))):(pt("fetch",function(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{startTimestamp:t,endTimestamp:n,fetchData:r,response:i}=e;if(!n)return null;const{method:o,url:s}=r;return{type:"resource.fetch",start:t/1e3,end:n/1e3,name:s,data:{method:o,statusCode:i?i.status:void 0}}}(t);Qs(e,n)}}(e)),pt("xhr",function(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{startTimestamp:t,endTimestamp:n,xhr:r}=e,i=r.__sentry_xhr_v2__;if(!t||!n||!i)return null;const{method:o,url:s,status_code:a}=i;return void 0===s?null:{type:"resource.xhr",name:s,start:t/1e3,end:n/1e3,data:{method:o,statusCode:a}}}(t);Qs(e,n)}}(e)))}catch(n){}}let Oa=null;const Ra=e=>t=>{if(!e.isEnabled())return;const n=function(e){const t=e.getLastBreadcrumb&&e.getLastBreadcrumb();if(Oa===t||!t)return null;if(Oa=t,!function(e){return!!e.category}(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui."))return null;if("console"===t.category)return function(e){const t=e.data&&e.data.arguments;if(!Array.isArray(t)||0===t.length)return hs(e);let n=!1;const r=t.map((e=>{if(!e)return e;if("string"===typeof e)return e.length>xi?(n=!0,`${e.slice(0,xi)}\u2026`):e;if("object"===typeof e)try{const t=St(e,7),r=JSON.stringify(t);if(r.length>xi){const e=ha(r.slice(0,xi)),t=JSON.parse(e);return n=!0,t}return t}catch(h){}return e}));return hs({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(t);return hs(t)}(t);n&&ss(e,n)};function Da(e){return!(!e||!e.on)}function Pa(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}const Ba={resource:function(e){const{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:o,decodedBodySize:s,encodedBodySize:a,responseStatus:c,transferSize:u}=e;if(["fetch","xmlhttprequest"].includes(n))return null;return{type:`${t}.${n}`,start:Na(o),end:Na(i),name:r,data:{size:u,statusCode:c,decodedBodySize:s,encodedBodySize:a}}},paint:function(e){const{duration:t,entryType:n,name:r,startTime:i}=e,o=Na(i);return{type:n,name:r,start:o,end:o+t,data:void 0}},navigation:function(e){const{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:o,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:l,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:h,type:m}=e;if(0===i)return null;return{type:`${t}.${m}`,start:Na(p),end:Na(o),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:s,duration:i,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:l,loadEventEnd:d,domComplete:o,redirectCount:f}}},"largest-contentful-paint":function(e){const{entryType:t,startTime:n,size:r}=e;let i=0;if(yi.performance){const e=yi.performance.getEntriesByType("navigation")[0];i=e&&e.activationStart||0}const o=Math.max(n-i,0),s=Na(i)+o/1e3;return{type:t,name:t,start:s,end:s,data:{value:o,size:r,nodeId:is.mirror.getId(e.element)}}}};function Ma(e){return void 0===Ba[e.entryType]?null:Ba[e.entryType](e)}function Na(e){return((Oe.Z1||yi.performance.timeOrigin)+e)/1e3}function Fa(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession())return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("[Replay] Received replay event after session expired."));const i=r||!t;t=!0,e.addUpdate((()=>{if("buffer"===e.recordingMode&&i&&e.setInitialState(),!zs(e,n,i))return!0;if(!i)return!1;if(function(e,t){if(!t||!e.session||0!==e.session.segmentId)return;zs(e,function(e){const t=e.getOptions();return{type:Qi.Custom,timestamp:Date.now(),data:{tag:"options",payload:{sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:!!e.eventBuffer&&"worker"===e.eventBuffer.type,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}(e),!1)}(e,i),e.session&&e.session.previousSessionId)return!0;if("buffer"===e.recordingMode&&e.session&&e.eventBuffer){const t=e.eventBuffer.getEarliestTimestamp();t&&(_s(`[Replay] Updating session start time to earliest event in buffer to ${new Date(t)}`,e.getOptions()._experiments.traceInternals),e.session.started=t,e.getOptions().stickySession&&Ns(e.session))}return"session"===e.recordingMode&&e.flush(),!0}))}}async function La({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:i,session:o}){const s=function({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}\n`;if("string"===typeof e)n=`${r}${e}`;else{const t=(new TextEncoder).encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:l}=r,d=Ue(),f=d.getClient(),p=d.getScope(),m=f&&f.getTransport(),g=f&&f.getDsn();if(!f||!m||!g||!o.sampled)return;const y={type:"replay_event",replay_start_timestamp:l/1e3,timestamp:i/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:t,segment_id:n,replay_type:o.sampled},b=await async function({client:e,scope:t,replayId:n,event:r}){const i={event_id:n,integrations:"object"!==typeof e._integrations||null===e._integrations||Array.isArray(e._integrations)?void 0:Object.keys(e._integrations)};e.emit&&e.emit("preprocessEvent",r,i);const o=await Vt(e.getOptions(),r,i,t,e);if(!o)return null;o.platform=o.platform||"javascript";const s=e.getSdkMetadata&&e.getSdkMetadata(),{name:a,version:c}=s&&s.sdk||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:c||"0.0.0"},o}({scope:p,client:f,replayId:t,event:y});if(!b)return f.recordDroppedEvent("event_processor","replay",y),void _s("An event processor returned `null`, will not send event.");delete b.sdkProcessingMetadata;const v=function(e,t,n,r){return Ot(jt(e,Lt(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:"string"===typeof t?(new TextEncoder).encode(t).length:t.length},t]])}(b,s,g,f.getOptions().tunnel);let w;try{w=await m.send(v)}catch(x){const e=new Error(vi);try{e.cause=x}catch(h){}throw e}if(!w)return w;if("number"===typeof w.statusCode&&(w.statusCode<200||w.statusCode>=300))throw new ja(w.statusCode);return w}class ja extends Error{constructor(e){super(`Transport returned status code ${e}`)}}async function Ua(e,t={count:0,interval:5e3}){const{recordingData:n,options:r}=e;if(n.length)try{return await La(e),!0}catch(i){if(i instanceof ja)throw i;if(function(e,t){Ue().setContext(e,t)}("Replays",{_retryCount:t.count}),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r._experiments&&r._experiments.captureExceptions&&sn(i),t.count>=3){const e=new Error("Unable to send Replay - max retries exceeded");try{e.cause=i}catch(h){}throw e}return t.interval*=++t.count,new Promise(((n,r)=>{setTimeout((async()=>{try{await Ua(e,t),n(!0)}catch(i){r(i)}}),t.interval)}))}}const Za="__THROTTLED";function Ha(e,t,n){const r=new Map;let i=!1;return(...o)=>{const s=Math.floor(Date.now()/1e3);if((e=>{const t=e-n;r.forEach(((e,n)=>{ne+t),0)>=t){const e=i;return i=!0,e?"__SKIPPED":Za}i=!1;const a=r.get(s)||0;return r.set(s,a+1),e(...o)}}class za{constructor({options:e,recordingOptions:t}){za.prototype.__init.call(this),za.prototype.__init2.call(this),za.prototype.__init3.call(this),za.prototype.__init4.call(this),za.prototype.__init5.call(this),za.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEvents=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=t,this._options=e,this._debouncedFlush=function(e,t,n){let r,i,o;const s=n&&n.maxWait?Math.max(n.maxWait,t):0;function a(){return c(),r=e(),r}function c(){void 0!==i&&clearTimeout(i),void 0!==o&&clearTimeout(o),i=o=void 0}function u(){return i&&clearTimeout(i),i=setTimeout(a,t),s&&void 0===o&&(o=setTimeout(a,s)),r}return u.cancel=c,u.flush=function(){return void 0!==i||void 0!==o?a():r},u}((()=>this._flush()),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Ha(((e,t)=>function(e,t,n){return Vs(e,t)?Gs(e,t,n):Promise.resolve(null)}(this,e,t)),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;i&&(this.clickDetector=new ds(this,i))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}getOptions(){return this._options}initializeSampling(e){const{errorSampleRate:t,sessionSampleRate:n}=this._options;t<=0&&n<=0||(this._initializeSessionForSampling(e),this.session?!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",ks(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording()):this._handleException(new Error("Unable to initialize and create session")))}start(){if(this._isEnabled&&"session"===this.recordingMode)throw new Error("Replay recording is already in progress");if(this._isEnabled&&"buffer"===this.recordingMode)throw new Error("Replay buffering is in progress, call `flush()` to save the replay");ks("[Replay] Starting replay in session mode",this._options._experiments.traceInternals);const e=Hs({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");ks("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const e=Hs({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{this._stopRecording=is({...this._recordingOptions,..."buffer"===this.recordingMode&&{checkoutEveryNms:6e4},emit:Fa(this),onMutation:this._onMutationHandler})}catch(e){this._handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this._handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(this._isEnabled){this._isEnabled=!1;try{_s("[Replay] Stopping Replay"+(t?` triggered by ${t}`:""),this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,Bs(this)}catch(n){this._handleException(n)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),_s("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),_s("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();const t=Date.now();_s("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const n=this.stopRecording();e&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const t=e();"buffer"!==this.recordingMode&&!0!==t&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),this._stopRecording)this.checkAndHandleExpiredSession(),this._updateSessionActivity();else{if(!this._checkSession())return;this.resume()}}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(!(this._lastActivity&&js(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled))return!!this._checkSession();this.pause()}setInitialState(){const e=`${yi.location.pathname}${yi.location.hash}${yi.location.search}`,t=`${yi.location.origin}${e}`;this.performanceEvents=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){const n=this._throttledAddEvent(e,t);if(n===Za){const e=hs({category:"replay.throttled"});this.addUpdate((()=>!zs(this,{type:5,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e,metric:!0}})))}return n}getCurrentRoute(){const e=this.lastTransaction||Ue().getScope().getTransaction();if(e&&["route","custom"].includes(e.metadata.source))return e.name}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Ds({useCompression:this._options.useCompression}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(e){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay]",e),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this._options._experiments&&this._options._experiments.captureExceptions&&sn(e)}_initializeSessionForSampling(e){const t=this._options.errorSampleRate>0,n=Hs({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;const e=this.session;return!Zs(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{yi.document.addEventListener("visibilitychange",this._handleVisibilityChange),yi.addEventListener("blur",this._handleWindowBlur),yi.addEventListener("focus",this._handleWindowFocus),yi.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(!function(e){const t=Ue().getScope(),n=Ue().getClient();t.addScopeListener(Ra(e)),pt("dom",bs(e)),pt("history",Xs(e)),Ia(e);const r=Ks(e,!Da(n));n&&n.addEventProcessor?n.addEventProcessor(r):Ce(r),Da(n)&&(n.on("afterSendEvent",$s(e)),n.on("createDsc",(t=>{const n=e.getSessionId();n&&e.isEnabled()&&"session"===e.recordingMode&&(t.replay_id=n)})),n.on("startTransaction",(t=>{e.lastTransaction=t})),n.on("finishTransaction",(t=>{e.lastTransaction=t})))}(this),this._hasInitializedCoreListeners=!0)}catch(e){this._handleException(e)}"PerformanceObserver"in yi&&(this._performanceObserver=Es(this))}_removeListeners(){try{yi.document.removeEventListener("visibilitychange",this._handleVisibilityChange),yi.removeEventListener("blur",this._handleWindowBlur),yi.removeEventListener("focus",this._handleWindowFocus),yi.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceObserver&&(this._performanceObserver.disconnect(),this._performanceObserver=void 0)}catch(e){this._handleException(e)}}__init(){this._handleVisibilityChange=()=>{"visible"===yi.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=hs({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=hs({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{ws(this,e)}}_doChangeToBackgroundTasks(e){if(!this.session)return;Us(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;this.checkAndHandleExpiredSession()?e&&this._createCustomBreadcrumb(e):_s("[Replay] Document has become active, but session has expired")}_triggerFullSnapshot(e=!0){try{_s("[Replay] Taking full rrweb snapshot"),is.takeFullSnapshot(e)}catch(t){this._handleException(t)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate((()=>{this.throttledAddEvent({type:Qi.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})}))}_addPerformanceEntries(){const e=[...this.performanceEvents];return this.performanceEvents=[],Promise.all(Ys(this,function(e){return e.map(Ma).filter(Boolean)}(e)))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:t}=this;if(!e||!t)return;if(e.segmentId)return;const n=t.getEarliestTimestamp();n&&nthis._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await Ua({replayId:e,recordingData:i,segmentId:r,eventContext:n,session:this.session,options:this.getOptions(),timestamp:t})}catch(t){this._handleException(t),this.stop({reason:"sendReplay"});const e=Ue().getClient();e&&e.recordDroppedEvent("send_error","replay")}}else("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay] No session or eventBuffer found to flush.")}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession())return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay] Attempting to finish replay event after session expired."));if(!this.session)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay] No session found to flush."));const t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();const r=nthis._options.maxReplayDuration+5e3;if(r||i)return _s(`[Replay] Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),void(r&&this._debouncedFlush());const o=this.eventBuffer;if(o&&0===this.session.segmentId&&!o.hasCheckout&&_s("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock)return this._flushLock=this._runFlush(),await this._flushLock,void(this._flushLock=void 0);try{await this._flushLock}catch(s){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error(s)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&Ns(this.session)}__init6(){this._onMutationHandler=e=>{const t=e.length,n=this._options.mutationLimit,r=n&&t>n;if(t>this._options.mutationBreadcrumbLimit||r){const e=hs({category:"replay.mutations",data:{count:t,limit:r}});this._createCustomBreadcrumb(e)}return!r||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}}function Ga(e,t,n,r){const i=[...e,..."string"===typeof r?r.split(","):[],...t];return"undefined"!==typeof n&&("string"===typeof n&&i.push(`.${n}`),console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")),i.join(",")}function Va({mask:e,unmask:t,block:n,unblock:r,ignore:i,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,ignoreClass:u}){const l=Ga(e,[".sentry-mask","[data-sentry-mask]"],a,c),d=Ga(t,[".sentry-unmask","[data-sentry-unmask]"]),f={maskTextSelector:l,unmaskTextSelector:d,maskInputSelector:l,unmaskInputSelector:d,blockSelector:Ga(n,[".sentry-block","[data-sentry-block]",'base[href="/"]'],o,s),unblockSelector:Ga(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:Ga(i,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],u)};return o instanceof RegExp&&(f.blockClass=o),a instanceof RegExp&&(f.maskTextClass=a),f}function Wa(){return"undefined"!==typeof window&&(!(0,mi.KV)()||"undefined"!==typeof gi&&"renderer"===gi.type)}const qa='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',$a=["content-length","content-type","accept"];let Ka=!1;class Ya{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=5e3,flushMaxDelay:t=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:i=!0,useCompression:o=!0,_experiments:s={},sessionSampleRate:a,errorSampleRate:c,maskAllText:u=!0,maskAllInputs:l=!0,blockAllMedia:d=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:g=[],networkDetailDenyUrls:y=[],networkCaptureBodies:b=!0,networkRequestHeaders:v=[],networkResponseHeaders:w=[],mask:x=[],unmask:A=[],block:E=[],unblock:_=[],ignore:k=[],maskFn:T,beforeAddRecordingEvent:S,blockClass:C,blockSelector:I,maskInputOptions:O,maskTextClass:R,maskTextSelector:D,ignoreClass:P}={}){if(this.name=Ya.id,this._recordingOptions={maskAllInputs:l,maskAllText:u,maskInputOptions:{...O||{},password:!0},maskTextFn:T,maskInputFn:T,...Va({mask:x,unmask:A,block:E,unblock:_,ignore:k,blockClass:C,blockSelector:I,maskTextClass:R,maskTextSelector:D,ignoreClass:P}),slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,15e3),maxReplayDuration:Math.min(r,Ei),stickySession:i,sessionSampleRate:a,errorSampleRate:c,useCompression:o,blockAllMedia:d,maskAllInputs:l,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:g,networkDetailDenyUrls:y,networkCaptureBodies:b,networkRequestHeaders:Xa(v),networkResponseHeaders:Xa(w),beforeAddRecordingEvent:S,_experiments:s},"number"===typeof a&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${a} })`),this._initialOptions.sessionSampleRate=a),"number"===typeof c&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${c} })`),this._initialOptions.errorSampleRate=c),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${qa}`:qa),this._isInitialized&&Wa())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Ka}set _isInitialized(e){Ka=e}setupOnce(){Wa()&&(this._setup(),setTimeout((()=>this._initialize())))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:"session"===this._replay.recordingMode}):Promise.resolve()}flush(e){return this._replay&&this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):Promise.resolve()}getReplayId(){if(this._replay&&this._replay.isEnabled())return this._replay.getSessionId()}_initialize(){this._replay&&this._replay.initializeSampling()}_setup(){const e=function(e){const t=Ue().getClient(),n=t&&t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...he(e)};if(!n)return console.warn("SDK client is not available."),r;null==e.sessionSampleRate&&null==e.errorSampleRate&&null==n.replaysSessionSampleRate&&null==n.replaysOnErrorSampleRate&&console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.");"number"===typeof n.replaysSessionSampleRate&&(r.sessionSampleRate=n.replaysSessionSampleRate);"number"===typeof n.replaysOnErrorSampleRate&&(r.errorSampleRate=n.replaysOnErrorSampleRate);return r}(this._initialOptions);this._replay=new za({options:e,recordingOptions:this._recordingOptions})}}function Xa(e){return[...$a,...e.map((e=>e.toLowerCase()))]}Ya.__initStatic();var Ja=n(241),Qa=n(9008),ec=n(67294),tc=n(40481),nc=n(83454),rc=n(56881),ic=n(77537),oc=n(63206),sc=n(49501),ac=n(13902);var cc=ec.forwardRef((function(e,t){return ec.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),ec.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"}))})),uc=n(30120),lc=n(81645),dc=n(29630),fc=n(75084),pc=n(31959),hc=n(85893),mc=function(e){var t=e.address,n=e.onDisconnectWallet;return(0,hc.jsx)(pc.P,{open:!0,withCloseButton:!1,setOpen:function(e){},children:(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,hc.jsx)(lc.Z,{sx:{fontSize:"24px",color:"warning.main",mb:2},children:(0,hc.jsx)(ac.Z,{})}),(0,hc.jsx)(dc.Z,{variant:"h2",children:(0,hc.jsx)(sc.cC,{id:"Blocked Address"})}),(0,hc.jsx)(dc.Z,{variant:"helperText",sx:{my:4},children:t}),(0,hc.jsxs)(fc.Z,{variant:"contained",onClick:n,children:[(0,hc.jsx)(lc.Z,{fontSize:"small",sx:{mx:1},children:(0,hc.jsx)(cc,{})}),(0,hc.jsx)(sc.cC,{id:"Disconnect Wallet"})]})]})})},gc=function(e){var t=e.children,n=(0,ic.Z)(),r=n.currentAccount,i=n.disconnectWallet,s=n.readOnlyMode,a=n.loading,c=function(e){var t=(0,ec.useState)(!0),n=t[0],r=t[1],i="".concat(nc.env.NEXT_PUBLIC_API_BASEURL,"/addresses/status"),s="?address=".concat(e),a=function(){var t=(0,o.Z)(d().mark((function t(){var n,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!i||!e){t.next=16;break}return t.prev=1,t.next=4,fetch(i+s);case 4:if(!(n=t.sent).ok){t.next=10;break}return t.next=8,n.json();case 8:o=t.sent,r(o.addressAllowed);case 10:t.next=14;break;case 12:t.prev=12,t.t0=t.catch(1);case 14:t.next=17;break;case 16:r(!0);case 17:case"end":return t.stop()}}),t,null,[[1,12]])})));return function(){return t.apply(this,arguments)}}();return(0,tc.W)(a,12e4,!1,[e]),{isAllowed:n}}(s||a||oc.p8?"":r);return c.isAllowed?(0,hc.jsx)(hc.Fragment,{children:t}):(0,hc.jsxs)(rc.Z,{children:[(0,hc.jsx)(mc,{address:r,onDisconnectWallet:i}),";"]})};function yc(e){var t=e.title,n=e.description,r=e.imageUrl,i=e.timestamp;return(0,hc.jsxs)(Qa.default,{children:[(0,hc.jsxs)("title",{children:["ZeroLend - ",t]}),(0,hc.jsx)("meta",{name:"description",content:n},"description"),(0,hc.jsx)("meta",{property:"og:title",content:"ZeroLend - ".concat(t)},"title"),(0,hc.jsx)("meta",{property:"og:description",content:n},"ogdescription"),r&&(0,hc.jsx)("meta",{property:"og:image",content:r},"ogimage"),r&&(0,hc.jsx)("meta",{name:"twitter:image",content:r},"twitterimage"),(0,hc.jsx)("meta",{name:"twitter:site",content:"@zerolendxyz"},"twittersite"),(0,hc.jsx)("meta",{property:"twitter:card",content:r?"summary_large_image":"summary"},"twittercard"),(0,hc.jsx)("meta",{name:"twitter:title",content:t},"twittertitle"),(0,hc.jsx)("meta",{name:"twitter:description",content:n},"twitterdescription"),i&&(0,hc.jsx)("meta",{name:"revised",content:i},"timestamp"),(0,hc.jsx)("meta",{name:"keywords",content:"Decentralized Finance, DeFi, lending, borrowing, stablecoins, Ethereum, assets, erc-20, smart contracts, open finance, trustless"},"keywords"),(0,hc.jsx)("meta",{name:"apple-mobile-web-app-title",content:"ZeroLend"}),(0,hc.jsx)("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),(0,hc.jsx)("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black"})]})}var bc=n(69311),vc=function(e){var t={};return Object.keys(e.transactions).forEach((function(n){var r=+n,i=Object.keys(e.transactions[r]).filter((function(t){return"success"===e.transactions[r][t].txState}));t[r]=i.reduce((function(t,n){return t[n]=e.transactions[r][n],t}),{})})),t},wc=n(57609);function xc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ac(e){for(var t=1;tthis.data(e,!0))),type:Wc.allowNull(a),accessList:Wc.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:t,topics:Wc.arrayOf(o),data:i,logIndex:a,blockHash:o},e.receipt={to:Wc.allowNull(this.address,null),from:Wc.allowNull(this.address,null),contractAddress:Wc.allowNull(t,null),transactionIndex:a,root:Wc.allowNull(s),gasUsed:n,logsBloom:Wc.allowNull(i),blockHash:o,transactionHash:o,logs:Wc.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:Wc.allowNull(a,null),cumulativeGasUsed:n,effectiveGasPrice:Wc.allowNull(n),status:Wc.allowNull(a),type:c},e.block={hash:Wc.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:Wc.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Wc.allowNull(t),extraData:i,transactions:Wc.allowNull(Wc.arrayOf(o)),baseFeePerGas:Wc.allowNull(n)},e.blockWithTransactions=(0,jc.shallowCopy)(e.block),e.blockWithTransactions.transactions=Wc.allowNull(Wc.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Wc.allowNull(r,void 0),toBlock:Wc.allowNull(r,void 0),blockHash:Wc.allowNull(o,void 0),address:Wc.allowNull(t,void 0),topics:Wc.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Wc.allowNull(a),blockHash:Wc.allowNull(o),transactionIndex:a,removed:Wc.allowNull(this.boolean.bind(this)),address:t,data:Wc.allowFalsish(i,"0x"),topics:Wc.arrayOf(o),transactionHash:o,logIndex:a},e}accessList(e){return(0,zc.accessListify)(e||[])}number(e){return"0x"===e?0:Cc.O$.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Cc.O$.from(e).toNumber()}bigNumber(e){return Cc.O$.from(e)}boolean(e){if("boolean"===typeof e)return e;if("string"===typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"===typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,Zc.isHexString)(e))?e.toLowerCase():Vc.throwArgumentError("invalid hash","value",e)}data(e,t){const n=this.hex(e,t);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return(0,Uc.getAddress)(e)}callAddress(e){if(!(0,Zc.isHexString)(e,32))return null;const t=(0,Uc.getAddress)((0,Zc.hexDataSlice)(e,12));return t===Hc?null:t}contractAddress(e){return(0,Uc.getContractAddress)(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"===typeof e||(0,Zc.isHexString)(e))return(0,Zc.hexValue)(e);throw new Error("invalid blockTag")}hash(e,t){const n=this.hex(e,t);return 32!==(0,Zc.hexDataLength)(n)?Vc.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(null==e)return null;const t=Cc.O$.from(e);try{return t.toNumber()}catch(n){}return null}uint256(e){if(!(0,Zc.isHexString)(e))throw new Error("invalid uint256");return(0,Zc.hexZeroPad)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const n=null!=e._difficulty?e._difficulty:e.difficulty,r=Wc.check(t,e);return r._difficulty=null==n?null:Cc.O$.from(n),r}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Wc.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Cc.O$.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Wc.check(this.formats.transaction,e);if(null!=e.chainId){let n=e.chainId;(0,Zc.isHexString)(n)&&(n=Cc.O$.from(n).toNumber()),t.chainId=n}else{let n=e.networkId;null==n&&null==t.v&&(n=e.chainId),(0,Zc.isHexString)(n)&&(n=Cc.O$.from(n).toNumber()),"number"!==typeof n&&null!=t.v&&(n=(t.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!==typeof n&&(n=0),t.chainId=n}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return(0,zc.parse)(e)}receiptLog(e){return Wc.check(this.formats.receiptLog,e)}receipt(e){const t=Wc.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Cc.O$.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Vc.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Vc.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Vc.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Wc.check(this.formats.filter,e)}filterLog(e){return Wc.check(this.formats.filterLog,e)}static check(e,t){const n={};for(const i in e)try{const r=e[i](t[i]);void 0!==r&&(n[i]=r)}catch(r){throw r.checkKey=i,r.checkValue=t[i],r}return n}static allowNull(e,t){return function(n){return null==n?t:e(n)}}static allowFalsish(e,t){return function(n){return n?e(n):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const n=[];return t.forEach((function(t){n.push(e(t))})),n}}}function qc(e){return function(e){return e&&"function"===typeof e.isCommunityResource}(e)&&e.isCommunityResource()}let $c=!1;function Kc(){$c||($c=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var Yc=n(99525),Xc=n(27771),Jc=n(84804),Qc=n(51880);var eu=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const tu=new Oc.Logger("abstract-provider/5.7.0");class nu extends jc.Description{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class ru{constructor(){tu.checkAbstract(new.target,ru),(0,jc.defineReadOnly)(this,"_isProvider",!0)}getFeeData(){return eu(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield(0,jc.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let n=null,r=null,i=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,i=Cc.O$.from("1500000000"),r=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:n,maxFeePerGas:r,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var iu=n(59567),ou=n(14694),su=n(7529),au=n(95964),cu=n(19763),uu=n(92882),lu=n.n(uu),du=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const fu=new Oc.Logger(Gc);function pu(e){return null==e?"null":(32!==(0,Zc.hexDataLength)(e)&&fu.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function hu(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[pu(e)]=!0}));const n=Object.keys(t);return n.sort(),n.join("|")}return pu(e)})).join("&")}function mu(e){if("string"===typeof e){if(e=e.toLowerCase(),32===(0,Zc.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+hu(e);if(nu.isForkEvent(e))throw fu.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+hu(e.topics||[])}throw new Error("invalid event - "+e)}function gu(){return(new Date).getTime()}function yu(e){return new Promise((t=>{setTimeout(t,e)}))}const bu=["block","network","pending","poll"];class vu{constructor(e,t,n){(0,jc.defineReadOnly)(this,"tag",e),(0,jc.defineReadOnly)(this,"listener",t),(0,jc.defineReadOnly)(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],n=""===(r=e[2])?[]:r.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var r;const i={};return n.length>0&&(i.topics=n),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||bu.indexOf(this.tag)>=0}}const wu={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function xu(e){return(0,Zc.hexZeroPad)(Cc.O$.from(e).toHexString(),32)}function Au(e){return ou.Base58.encode((0,Zc.concat)([e,(0,Zc.hexDataSlice)((0,cu.JQ)((0,cu.JQ)(e)),0,4)]))}const Eu=new RegExp("^(ipfs)://(.*)$","i"),_u=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Eu,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function ku(e,t){try{return(0,Jc.ZN)(Tu(e,t))}catch(n){}return null}function Tu(e,t){if("0x"===e)return null;const n=Cc.O$.from((0,Zc.hexDataSlice)(e,t,t+32)).toNumber(),r=Cc.O$.from((0,Zc.hexDataSlice)(e,n,n+32)).toNumber();return(0,Zc.hexDataSlice)(e,n+32,n+32+r)}function Su(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):fu.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function Cu(e){const t=(0,Zc.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(t,32-t.length),n}function Iu(e){if(e.length%32===0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Ou(e){const t=[];let n=0;for(let r=0;rCc.O$.from(e).eq(1))).catch((e=>{if(e.code===Oc.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return du(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:(0,Zc.hexConcat)([e,(0,au.VM)(this.name),t||"0x"])};let r=!1;(yield this.supportsWildcard())&&(r=!0,n.data=(0,Zc.hexConcat)(["0x9061b923",Ou([(0,au.Kn)(this.name),n.data])]));try{let e=yield this.provider.call(n);return(0,Zc.arrayify)(e).length%32===4&&fu.throwError("resolver threw error",Oc.Logger.errors.CALL_EXCEPTION,{transaction:n,data:e}),r&&(e=Tu(e,0)),e}catch(i){if(i.code===Oc.Logger.errors.CALL_EXCEPTION)return null;throw i}}))}_fetchBytes(e,t){return du(this,void 0,void 0,(function*(){const n=yield this._fetch(e,t);return null!=n?Tu(n,0):null}))}_getAddress(e,t){const n=wu[String(e)];if(null==n&&fu.throwError(`unsupported coin type: ${e}`,Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===n.ilk)return this.provider.formatter.address(t);const r=(0,Zc.arrayify)(t);if(null!=n.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Au((0,Zc.concat)([[n.p2pkh],"0x"+e[2]]))}}if(null!=n.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Au((0,Zc.concat)([[n.p2sh],"0x"+e[2]]))}}if(null!=n.prefix){const e=r[1];let t=r[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&r.length===2+e&&e>=1&&e<=75){const e=lu().toWords(r.slice(2));return e.unshift(t),lu().encode(n.prefix,e)}}return null}getAddress(e){return du(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===su.R?null:this.provider.formatter.callAddress(e)}catch(r){if(r.code===Oc.Logger.errors.CALL_EXCEPTION)return null;throw r}const t=yield this._fetchBytes("0xf1cb7e06",xu(e));if(null==t||"0x"===t)return null;const n=this._getAddress(e,t);return null==n&&fu.throwError("invalid or unsupported coin data",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),n}))}getAvatar(){return du(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let n=0;n<_u.length;n++){const r=t.match(_u[n]);if(null==r)continue;const i=r[1].toLowerCase();switch(i){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:Su(t)};case"erc721":case"erc1155":{const n="erc721"===i?"0xc87b56dd":"0x0e89341c";e.push({type:i,content:t});const o=this._resolvedAddress||(yield this.getAddress()),s=(r[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),c=(0,Zc.hexZeroPad)(Cc.O$.from(s[1]).toHexString(),32);if("erc721"===i){const t=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:(0,Zc.hexConcat)(["0x6352211e",c])}));if(o!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===i){const t=Cc.O$.from(yield this.provider.call({to:a,data:(0,Zc.hexConcat)(["0x00fdd58e",(0,Zc.hexZeroPad)(o,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const u={to:this.provider.formatter.address(s[0]),data:(0,Zc.hexConcat)([n,c])};let l=ku(yield this.provider.call(u),0);if(null==l)return null;e.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=Su(l)),e.push({type:"metadata-url",content:l});const d=yield(0,Qc.fetchJson)(l);if(!d)return null;e.push({type:"metadata",content:JSON.stringify(d)});let f=d.image;if("string"!==typeof f)return null;if(f.match(/^(https:\/\/|data:)/i));else{if(null==f.match(Eu))return null;e.push({type:"url-ipfs",content:f}),f=Su(f)}return e.push({type:"url",content:f}),{linkage:e,url:f}}}}}catch(t){}return null}))}getContentHash(){return du(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+ou.Base58.encode("0x"+t[1])}const n=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const e=parseInt(n[3],16);if(n[4].length===2*e)return"ipns://"+ou.Base58.encode("0x"+n[1])}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return"bzz://"+r[1];const i=e.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+(0,iu.c)("0x"+i[1]).replace(/[=+\/]/g,(t=>e[t]))}return fu.throwError("invalid or unsupported content hash data",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return du(this,void 0,void 0,(function*(){let t=(0,Jc.Y0)(e);t=(0,Zc.concat)([xu(64),xu(t.length),t]),t.length%32!==0&&(t=(0,Zc.concat)([t,(0,Zc.hexZeroPad)("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",(0,Zc.hexlify)(t));return null==n||"0x"===n?null:(0,Jc.ZN)(n)}))}}let Du=null,Pu=1;class Bu extends ru{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,jc.defineReadOnly)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=(0,jc.getStatic)(new.target,"getNetwork")(e);t?((0,jc.defineReadOnly)(this,"_network",t),this.emit("network",t,null)):fu.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return du(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(e){}null==t&&(t=yield this.detectNetwork()),t||fu.throwError("no network detected",Oc.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,jc.defineReadOnly)(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return(0,Qc.poll)((()=>this._ready().then((e=>e),(e=>{if(e.code!==Oc.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Du&&(Du=new Wc),Du}static getNetwork(e){return Lc(null==e?"homestead":e)}ccipReadFetch(e,t,n){return du(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:r}),c=yield(0,Qc.fetchJson)({url:s,errorPassThrough:!0},a,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return fu.throwError(`response not found during CCIP fetch: ${u}`,Oc.Logger.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return fu.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,Oc.Logger.errors.SERVER_ERROR,{urls:n,errorMessages:o})}))}_getInternalBlockNumber(e){return du(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const n=yield t;if(gu()-n.respTime<=e)return n.blockNumber;break}catch(r){if(this._internalBlockNumber===t)break}}const t=gu(),n=(0,jc.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const i=gu();return(e=Cc.O$.from(e).toNumber()){this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return du(this,void 0,void 0,(function*(){const e=Pu++,t=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(r){return void this.emit("error",r)}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)fu.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",fu.makeError("network block skew detected",Oc.Logger.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let e=this._emitted.block+1;e<=n;e++)this.emit("block",e);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&n-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((e=>{switch(e.type){case"tx":{const n=e.hash;let r=this.getTransactionReceipt(n).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+n]=e.blockNumber,this.emit(n,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(r);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);const r=e.filter;r.fromBlock=e._lastBlockNumber+1,r.toBlock=n;const i=r.toBlock-this._maxFilterBlockRange;i>r.fromBlock&&(r.fromBlock=i),r.fromBlock<0&&(r.fromBlock=0);const o=this.getLogs(r).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(r,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=n,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return du(this,void 0,void 0,(function*(){return fu.throwError("provider does not support network detection",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return du(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield yu(0),this._network;const n=fu.makeError("underlying network changed",Oc.Logger.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",n),n}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=gu();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,n){return du(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,n||0,null)}))}_waitForTransaction(e,t,n,r){return du(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const s=[];let a=!1;const c=function(){return!!a||(a=!0,s.forEach((e=>{e()})),!1)},u=e=>{e.confirmations{this.removeListener(e,u)})),r){let n=r.startBlock,i=null;const u=s=>du(this,void 0,void 0,(function*(){a||(yield yu(1e3),this.getTransactionCount(r.from).then((l=>du(this,void 0,void 0,(function*(){if(!a){if(l<=r.nonce)n=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=n-3,i{a||this.once("block",u)})))}));if(a)return;this.once("block",u),s.push((()=>{this.removeListener("block",u)}))}if("number"===typeof n&&n>0){const e=setTimeout((()=>{c()||o(fu.makeError("timeout exceeded",Oc.Logger.errors.TIMEOUT,{timeout:n}))}),n);e.unref&&e.unref(),s.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return du(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Cc.O$.from(e)}catch(t){return fu.throwError("bad result from backend",Oc.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,jc.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getBalance",n);try{return Cc.O$.from(r)}catch(i){return fu.throwError("bad result from backend",Oc.Logger.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:i})}}))}getTransactionCount(e,t){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,jc.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getTransactionCount",n);try{return Cc.O$.from(r).toNumber()}catch(i){return fu.throwError("bad result from backend",Oc.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:i})}}))}getCode(e,t){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,jc.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getCode",n);try{return(0,Zc.hexlify)(r)}catch(i){return fu.throwError("bad result from backend",Oc.Logger.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:i})}}))}getStorageAt(e,t,n){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,jc.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then((e=>(0,Zc.hexValue)(e)))}),i=yield this.perform("getStorageAt",r);try{return(0,Zc.hexlify)(i)}catch(o){return fu.throwError("bad result from backend",Oc.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:i,error:o})}}))}_wrapTransaction(e,t,n){if(null!=t&&32!==(0,Zc.hexDataLength)(t))throw new Error("invalid response - sendTransaction");const r=e;return null!=t&&e.hash!==t&&fu.throwError("Transaction hash mismatch from Provider.sendTransaction.",Oc.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),r.wait=(t,r)=>du(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==r&&(r=0),0!==t&&null!=n&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const o=yield this._waitForTransaction(e.hash,t,r,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&fu.throwError("transaction failed",Oc.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),r}sendTransaction(e){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>(0,Zc.hexlify)(e))),n=this.formatter.transaction(e);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(n,e,r)}catch(i){throw i.transaction=n,i.transactionHash=n.hash,i}}))}_getTransactionRequest(e){return du(this,void 0,void 0,(function*(){const t=yield e,n={};return["from","to"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?Cc.O$.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(n.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?(0,Zc.hexlify)(e):null)))})),this.formatter.transactionRequest(yield(0,jc.resolveProperties)(n))}))}_getFilter(e){return du(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((n=>{null!=e[n]&&(t[n]=e[n])})),["fromBlock","toBlock"].forEach((n=>{null!=e[n]&&(t[n]=this._getBlockTag(e[n]))})),this.formatter.filter(yield(0,jc.resolveProperties)(t))}))}_call(e,t,n){return du(this,void 0,void 0,(function*(){n>=10&&fu.throwError("CCIP read exceeded maximum redirections",Oc.Logger.errors.SERVER_ERROR,{redirects:n,transaction:e});const r=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(n>=0&&"latest"===t&&null!=r&&"0x556f1830"===i.substring(0,10)&&(0,Zc.hexDataLength)(i)%32===4)try{const o=(0,Zc.hexDataSlice)(i,4),s=(0,Zc.hexDataSlice)(o,0,32);Cc.O$.from(s).eq(r)||fu.throwError("CCIP Read sender did not match",Oc.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const a=[],c=Cc.O$.from((0,Zc.hexDataSlice)(o,32,64)).toNumber(),u=Cc.O$.from((0,Zc.hexDataSlice)(o,c,c+32)).toNumber(),l=(0,Zc.hexDataSlice)(o,c+32);for(let t=0;tdu(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",r);if(null==e)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;rthis._wrapTransaction(e))),n}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return du(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return(0,Qc.poll)((()=>du(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(e){return du(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return(0,Qc.poll)((()=>du(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return r}))),{oncePoll:this})}))}getLogs(e){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,jc.resolveProperties)({filter:this._getFilter(e)}),n=yield this.perform("getLogs",t);return n.forEach((e=>{null==e.removed&&(e.removed=!1)})),Wc.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return du(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return du(this,void 0,void 0,(function*(){if("number"===typeof(e=yield e)&&e<0){e%1&&fu.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return du(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const n=yield this._getResolver(t,"getResolver");if(null!=n){const r=new Ru(this,n,e);return t===e||(yield r.supportsWildcard())?r:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return du(this,void 0,void 0,(function*(){null==t&&(t="ENS");const n=yield this.getNetwork();n.ensAddress||fu.throwError("network does not support ENS",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name});try{const t=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+(0,au.VM)(e).substring(2)});return this.formatter.callAddress(t)}catch(r){}return null}))}resolveName(e){return du(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if((0,Zc.isHexString)(e))throw n}"string"!==typeof e&&fu.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return du(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(t,"lookupAddress");if(null==n)return null;const r=ku(yield this.call({to:n,data:"0x691f3431"+(0,au.VM)(t).substring(2)}),0);return(yield this.resolveName(r))!=e?null:r}))}getAvatar(e){return du(this,void 0,void 0,(function*(){let t=null;if((0,Zc.isHexString)(e)){const n=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",i=yield this._getResolver(n,"getAvatar");if(!i)return null;t=new Ru(this,i,n);try{const e=yield t.getAvatar();if(e)return e.url}catch(r){if(r.code!==Oc.Logger.errors.CALL_EXCEPTION)throw r}try{const e=ku(yield this.call({to:i,data:"0x691f3431"+(0,au.VM)(n).substring(2)}),0);t=yield this.getResolver(e)}catch(r){if(r.code!==Oc.Logger.errors.CALL_EXCEPTION)throw r;return null}}else if(t=yield this.getResolver(e),!t)return null;const n=yield t.getAvatar();return null==n?null:n.url}))}perform(e,t){return fu.throwError(e+" not implemented",Oc.Logger.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,n){const r=new vu(mu(e),t,n);return this._events.push(r),this._startEvent(r),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let n=!1,r=[],i=mu(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),n=!0,!e.once||(r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),n}listenerCount(e){if(!e)return this._events.length;let t=mu(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=mu(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const n=[];let r=!1,i=mu(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!r||(r=!0,n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const n=mu(e);this._events=this._events.filter((e=>e.tag!==n||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var Mu=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const Nu=new Oc.Logger(Gc),Fu=["call","estimateGas"];function Lu(e,t){if(null==e)return null;if("string"===typeof e.message&&e.message.match("reverted")){const n=(0,Zc.isHexString)(e.data)?e.data:null;if(!t||n)return{message:e.message,data:n}}if("object"===typeof e){for(const n in e){const r=Lu(e[n],t);if(r)return r}return null}if("string"===typeof e)try{return Lu(JSON.parse(e),t)}catch(n){}return null}function ju(e,t,n){const r=n.transaction||n.signedTransaction;if("call"===e){const e=Lu(t,!0);if(e)return e.data;Nu.throwError("missing revert data in call exception; Transaction reverted without a reason string",Oc.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:t})}if("estimateGas"===e){let n=Lu(t.body,!1);null==n&&(n=Lu(t,!1)),n&&Nu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Oc.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:e,transaction:r,error:t})}let i=t.message;throw t.code===Oc.Logger.errors.SERVER_ERROR&&t.error&&"string"===typeof t.error.message?i=t.error.message:"string"===typeof t.body?i=t.body:"string"===typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Nu.throwError("insufficient funds for intrinsic transaction cost",Oc.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),i.match(/nonce (is )?too low/i)&&Nu.throwError("nonce has already been used",Oc.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Nu.throwError("replacement fee too low",Oc.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),i.match(/only replay-protected/i)&&Nu.throwError("legacy pre-eip-155 transactions not supported",Oc.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:r}),Fu.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Nu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Oc.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}function Uu(e){return new Promise((function(t){setTimeout(t,e)}))}function Zu(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Hu(e){return e?e.toLowerCase():e}const zu={};class Gu extends Yc.E{constructor(e,t,n){if(super(),e!==zu)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,jc.defineReadOnly)(this,"provider",t),null==n&&(n=0),"string"===typeof n?((0,jc.defineReadOnly)(this,"_address",this.provider.formatter.address(n)),(0,jc.defineReadOnly)(this,"_index",null)):"number"===typeof n?((0,jc.defineReadOnly)(this,"_index",n),(0,jc.defineReadOnly)(this,"_address",null)):Nu.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return Nu.throwError("cannot alter JSON-RPC Signer connection",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Vu(zu,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&Nu.throwError("unknown account #"+this._index,Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=(0,jc.shallowCopy)(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const n=(0,jc.shallowCopy)(e);n.from=t,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>Mu(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&Nu.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),(0,jc.resolveProperties)({tx:(0,jc.resolveProperties)(e),sender:t}).then((({tx:t,sender:n})=>{null!=t.from?t.from.toLowerCase()!==n&&Nu.throwArgumentError("from address mismatch","transaction",e):t.from=n;const r=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((e=>e),(e=>("string"===typeof e.message&&e.message.match(/user denied/i)&&Nu.throwError("user rejected transaction",Oc.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),ju("sendTransaction",e,r))))}))}signTransaction(e){return Nu.throwError("signing transactions is unsupported",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Mu(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield(0,Qc.poll)((()=>Mu(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(n);if(null!==e)return this.provider._wrapTransaction(e,n,t)}))),{oncePoll:this.provider})}catch(r){throw r.transactionHash=n,r}}))}signMessage(e){return Mu(this,void 0,void 0,(function*(){const t="string"===typeof e?(0,Jc.Y0)(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,Zc.hexlify)(t),n.toLowerCase()])}catch(r){throw"string"===typeof r.message&&r.message.match(/user denied/i)&&Nu.throwError("user rejected signing",Oc.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),r}}))}_legacySignMessage(e){return Mu(this,void 0,void 0,(function*(){const t="string"===typeof e?(0,Jc.Y0)(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),(0,Zc.hexlify)(t)])}catch(r){throw"string"===typeof r.message&&r.message.match(/user denied/i)&&Nu.throwError("user rejected signing",Oc.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),r}}))}_signTypedData(e,t,n){return Mu(this,void 0,void 0,(function*(){const r=yield Xc.E.resolveNames(e,t,n,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Xc.E.getPayload(r.domain,t,r.value))])}catch(o){throw"string"===typeof o.message&&o.message.match(/user denied/i)&&Nu.throwError("user rejected signing",Oc.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:r.domain,types:t,value:r.value}}),o}}))}unlock(e){return Mu(this,void 0,void 0,(function*(){const t=this.provider,n=yield this.getAddress();return t.send("personal_unlockAccount",[n.toLowerCase(),e,null])}))}}class Vu extends Gu{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Wu={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class qu extends Bu{constructor(e,t){let n=t;null==n&&(n=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(n),e||(e=(0,jc.getStatic)(this.constructor,"defaultUrl")()),"string"===typeof e?(0,jc.defineReadOnly)(this,"connection",Object.freeze({url:e})):(0,jc.defineReadOnly)(this,"connection",Object.freeze((0,jc.shallowCopy)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Mu(this,void 0,void 0,(function*(){yield Uu(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(t){}}if(null!=e){const n=(0,jc.getStatic)(this.constructor,"getNetwork");try{return n(Cc.O$.from(e).toNumber())}catch(t){return Nu.throwError("could not detect network",Oc.Logger.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return Nu.throwError("could not detect network",Oc.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Gu(zu,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,jc.deepCopy)(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(r&&this._cache[e])return this._cache[e];const i=(0,Qc.fetchJson)(this.connection,JSON.stringify(n),Zu).then((e=>(this.emit("debug",{action:"response",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:n,provider:this}),e}));return r&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Hu(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Hu(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Hu(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Hu(t.address),(0,Zc.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,jc.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,jc.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Hu(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return Mu(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Cc.O$.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((t=(0,jc.shallowCopy)(t)).transaction=(0,jc.shallowCopy)(e),delete t.transaction.type)}}const n=this.prepareRequest(e,t);null==n&&Nu.throwError(e+" not implemented",Oc.Logger.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(r){return ju(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(n){return function r(){e.send("eth_getFilterChanges",[n]).then((function(n){if(e._pendingFilter!=t)return null;let r=Promise.resolve();return n.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return Uu(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[n])})).catch((e=>{}))}(),n})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const n=(0,jc.shallowCopy)(Wu);if(t)for(const i in t)t[i]&&(n[i]=!0);(0,jc.checkProperties)(e,n);const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const n=(0,Zc.hexValue)(Cc.O$.from(e[t]));"gasLimit"===t&&(t="gas"),r[t]=n})),["from","to","data"].forEach((function(t){null!=e[t]&&(r[t]=(0,Zc.hexlify)(e[t]))})),e.accessList&&(r.accessList=(0,zc.accessListify)(e.accessList)),r}}let $u=null;try{if($u=WebSocket,null==$u)throw new Error("inject please")}catch(IT){const e=new Oc.Logger(Gc);$u=function(){e.throwError("WebSockets not supported in this environment",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Ku=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const Yu=new Oc.Logger(Gc);let Xu=1;class Ju extends qu{constructor(e,t){"any"===t&&Yu.throwError("WebSocketProvider does not support 'any' network yet",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"===typeof e?e:"_websocket",t),this._pollingInterval=-1,this._wsReady=!1,"string"===typeof e?(0,jc.defineReadOnly)(this,"_websocket",new $u(this.connection.url)):(0,jc.defineReadOnly)(this,"_websocket",e),(0,jc.defineReadOnly)(this,"_requests",{}),(0,jc.defineReadOnly)(this,"_subs",{}),(0,jc.defineReadOnly)(this,"_subIds",{}),(0,jc.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this.websocket.send(this._requests[e].payload)}))},this.websocket.onmessage=e=>{const t=e.data,n=JSON.parse(t);if(null!=n.id){const e=String(n.id),r=this._requests[e];if(delete this._requests[e],void 0!==n.result)r.callback(null,n.result),this.emit("debug",{action:"response",request:JSON.parse(r.payload),response:n.result,provider:this});else{let e=null;n.error?(e=new Error(n.error.message||"unknown error"),(0,jc.defineReadOnly)(e,"code",n.error.code||null),(0,jc.defineReadOnly)(e,"response",t)):e=new Error("unknown error"),r.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(r.payload),provider:this})}}else if("eth_subscription"===n.method){const e=this._subs[n.params.subscription];e&&e.processFunc(n.params.result)}else console.warn("this should not happen")};const n=setInterval((()=>{this.emit("poll")}),1e3);n.unref&&n.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){Yu.throwError("cannot reset events block on WebSocketProvider",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){Yu.throwError("cannot set polling interval on WebSocketProvider",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return Ku(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&Yu.throwError("cannot set polling on WebSocketProvider",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const n=Xu++;return new Promise(((r,i)=>{const o=JSON.stringify({method:e,params:t,id:n,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(n)]={callback:function(e,t){return e?i(e):r(t)},payload:o},this._wsReady&&this.websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,n){return Ku(this,void 0,void 0,(function*(){let r=this._subIds[e];null==r&&(r=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=r);const i=yield r;this._subs[i]={tag:e,processFunc:n}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=Cc.O$.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const n=this._subIds[t];n&&(delete this._subIds[t],n.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return Ku(this,void 0,void 0,(function*(){this.websocket.readyState===$u.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}var Qu=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const el=new Oc.Logger(Gc);class tl extends qu{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return Qu(this,void 0,void 0,(function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||el.throwError("no network detected",Oc.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,jc.defineReadOnly)(this,"_network",t),this.emit("network",t,null))),t}))}}class nl extends tl{constructor(e,t){el.checkAbstract(new.target,nl),e=(0,jc.getStatic)(new.target,"getNetwork")(e),t=(0,jc.getStatic)(new.target,"getApiKey")(t);super((0,jc.getStatic)(new.target,"getUrl")(e,t),e),"string"===typeof t?(0,jc.defineReadOnly)(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{(0,jc.defineReadOnly)(this,e,t[e])}))}_startPending(){el.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return el.throwError("API provider does not support signing",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return el.throwError("not implemented; sub-classes must override getUrl",Oc.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const rl=new Oc.Logger(Gc),il="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class ol extends Ju{constructor(e,t){const n=new sl(e,t);super(n.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),n.network),(0,jc.defineReadOnly)(this,"apiKey",n.apiKey)}isCommunityResource(){return this.apiKey===il}}class sl extends nl{static getWebSocketProvider(e,t){return new ol(e,t)}static getApiKey(e){return null==e?il:(e&&"string"!==typeof e&&rl.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.g.alchemy.com/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":n="arb-goerli.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":n="opt-goerli.g.alchemy.com/v2/";break;default:rl.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+t,throttleCallback:(e,n)=>(t===il&&Kc(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===il}}const al=new Oc.Logger(Gc),cl="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function ul(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return al.throwArgumentError("unsupported network","name",e)}class ll extends nl{isCommunityResource(){return this.apiKey===cl}static getApiKey(e){return null==e?cl:e}static getUrl(e,t){null==t&&(t=cl);const n={allowGzip:!0,url:"https://"+ul(e.name)+t,throttleCallback:(e,n)=>(t.apiKey===cl&&Kc(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}}var dl=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const fl=new Oc.Logger(Gc);class pl extends nl{static getApiKey(e){return null!=e&&fl.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let n=null;if("homestead"===e.name)n="https://cloudflare-eth.com/";else fl.throwArgumentError("unsupported network","network",arguments[0]);return n}perform(e,t){const n=Object.create(null,{perform:{get:()=>super.perform}});return dl(this,void 0,void 0,(function*(){if("getBlockNumber"===e){return(yield n.perform.call(this,"getBlock",{blockTag:"latest"})).number}return n.perform.call(this,e,t)}))}}var hl=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const ml=new Oc.Logger(Gc);function gl(e){const t={};for(let n in e){if(null==e[n])continue;let r=e[n];"type"===n&&0===r||(r={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[n]?(0,Zc.hexValue)((0,Zc.hexlify)(r)):"accessList"===n?"["+(0,zc.accessListify)(r).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":(0,Zc.hexlify)(r),t[n]=r)}return t}function yl(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!==typeof e.message||!e.message.match(/^OK/)){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function bl(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function vl(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function wl(e,t,n){if("call"===e&&t.code===Oc.Logger.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let n=e.data;if(n&&(n="0x"+n.replace(/^.*0x/i,"")),(0,Zc.isHexString)(n))return n;ml.throwError("missing revert data in call exception",Oc.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let r=t.message;throw t.code===Oc.Logger.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?r=t.error.message:"string"===typeof t.body?r=t.body:"string"===typeof t.responseText&&(r=t.responseText)),r=(r||"").toLowerCase(),r.match(/insufficient funds/)&&ml.throwError("insufficient funds for intrinsic transaction cost",Oc.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),r.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ml.throwError("nonce has already been used",Oc.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),r.match(/another transaction with same nonce/)&&ml.throwError("replacement fee too low",Oc.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),r.match(/execution failed due to an exception|execution reverted/)&&ml.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Oc.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}class xl extends Bu{constructor(e,t){super(e),(0,jc.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,jc.defineReadOnly)(this,"apiKey",t||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return ml.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){const n=Object.keys(t).reduce(((e,n)=>{const r=t[n];return null!=r&&(e+=`&${n}=${r}`),e}),""),r=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${n}${r}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,n){return hl(this,void 0,void 0,(function*(){const r=n?this.getPostUrl():this.getUrl(e,t),i=n?this.getPostData(e,t):null,o="proxy"===e?bl:yl;this.emit("debug",{action:"request",request:r,provider:this});const s={url:r,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&Kc(),Promise.resolve(!0))};let a=null;i&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(i).map((e=>`${e}=${i[e]}`)).join("&"));const c=yield(0,Qc.fetchJson)(s,a,o||bl);return this.emit("debug",{action:"response",request:r,response:(0,jc.deepCopy)(c),provider:this}),c}))}detectNetwork(){return hl(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const n=Object.create(null,{perform:{get:()=>super.perform}});return hl(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>wl("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=gl(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(IT){return wl("call",IT,t.transaction)}}case"estimateGas":{const e=gl(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(IT){return wl("estimateGas",IT,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=vl(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=vl(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&ml.throwError("unsupported topic count",Oc.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const n=t.filter.topics[0];"string"===typeof n&&66===n.length||ml.throwError("unsupported topic format",Oc.Logger.errors.UNSUPPORTED_OPERATION,{topic0:n}),e.topic0=n}const n=yield this.fetch("logs",e);let r={};for(let t=0;t{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return null==this.apiKey}}var Al=n(34952),El=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const _l=new Oc.Logger(Gc);function kl(){return(new Date).getTime()}function Tl(e){let t=null;for(let n=0;nt?null:(r+i)/2}function Cl(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(Cc.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>Cl(e))));if("object"===typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let n=e[t];return n="function"===typeof n?"[function]":Cl(n),JSON.stringify(t)+":"+n})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let Il=1;function Ol(e){let t=null,n=null,r=new Promise((r=>{t=function(){n&&(clearTimeout(n),n=null),r()},n=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return r},wait:e=>(r=r.then(e),r)}}const Rl=[Oc.Logger.errors.CALL_EXCEPTION,Oc.Logger.errors.INSUFFICIENT_FUNDS,Oc.Logger.errors.NONCE_EXPIRED,Oc.Logger.errors.REPLACEMENT_UNDERPRICED,Oc.Logger.errors.UNPREDICTABLE_GAS_LIMIT],Dl=["address","args","errorArgs","errorSignature","method","transaction"];function Pl(e,t){const n={weight:e.weight};return Object.defineProperty(n,"provider",{get:()=>e.provider}),e.start&&(n.start=e.start),t&&(n.duration=t-e.start),e.done&&(e.error?n.error=e.error:n.result=e.result||null),n}function Bl(e,t,n){let r=Cl;switch(t){case"getBlockNumber":return function(t){const n=t.map((e=>e.result));let r=Sl(t.map((e=>e.result)),2);if(null!=r)return r=Math.ceil(r),n.indexOf(r+1)>=0&&r++,r>=e._highestBlockNumber&&(e._highestBlockNumber=r),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return Sl(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":r=function(e){return null==e?null:((e=(0,jc.shallowCopy)(e)).confirmations=-1,Cl(e))};break;case"getBlock":r=n.includeTransactions?function(e){return null==e?null:((e=(0,jc.shallowCopy)(e)).transactions=e.transactions.map((e=>((e=(0,jc.shallowCopy)(e)).confirmations=-1,e))),Cl(e))}:function(e){return null==e?null:Cl(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(n){const r={};n.forEach((t=>{const n=e(t.result);r[n]||(r[n]={count:0,result:t.result}),r[n].count++}));const i=Object.keys(r);for(let e=0;e=t)return n.result}}}(r,e.quorum)}function Ml(e,t){return El(this,void 0,void 0,(function*(){const n=e.provider;return null!=n.blockNumber&&n.blockNumber>=t||-1===t?n:(0,Qc.poll)((()=>new Promise(((r,i)=>{setTimeout((function(){return n.blockNumber>=t?r(n):e.cancelled?r(null):r(void 0)}),0)}))),{oncePoll:n})}))}function Nl(e,t,n,r){return El(this,void 0,void 0,(function*(){let i=e.provider;switch(n){case"getBlockNumber":case"getGasPrice":return i[n]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return r.blockTag&&(0,Zc.isHexString)(r.blockTag)&&(i=yield Ml(e,t)),i[n](r.address,r.blockTag||"latest");case"getStorageAt":return r.blockTag&&(0,Zc.isHexString)(r.blockTag)&&(i=yield Ml(e,t)),i.getStorageAt(r.address,r.position,r.blockTag||"latest");case"getBlock":return r.blockTag&&(0,Zc.isHexString)(r.blockTag)&&(i=yield Ml(e,t)),i[r.includeTransactions?"getBlockWithTransactions":"getBlock"](r.blockTag||r.blockHash);case"call":case"estimateGas":return r.blockTag&&(0,Zc.isHexString)(r.blockTag)&&(i=yield Ml(e,t)),"call"===n&&r.blockTag?i[n](r.transaction,r.blockTag):i[n](r.transaction);case"getTransaction":case"getTransactionReceipt":return i[n](r.transactionHash);case"getLogs":{let n=r.filter;return(n.fromBlock&&(0,Zc.isHexString)(n.fromBlock)||n.toBlock&&(0,Zc.isHexString)(n.toBlock))&&(i=yield Ml(e,t)),i.getLogs(n)}}return _l.throwError("unknown method error",Oc.Logger.errors.UNKNOWN_ERROR,{method:n,params:r})}))}class Fl extends Bu{constructor(e,t){0===e.length&&_l.throwArgumentError("missing providers","providers",e);const n=e.map(((e,t)=>{if(ru.isProvider(e)){const t=qc(e)?2e3:750,n=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:n})}const n=(0,jc.shallowCopy)(e);null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=qc(e)?2e3:750),null==n.weight&&(n.weight=1);const r=n.weight;return(r%1||r>512||r<1)&&_l.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,r),Object.freeze(n)})),r=n.reduce(((e,t)=>e+t.weight),0);null==t?t=r/2:t>r&&_l.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=Tl(n.map((e=>e.provider.network)));null==i&&(i=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(i),(0,jc.defineReadOnly)(this,"providerConfigs",Object.freeze(n)),(0,jc.defineReadOnly)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return El(this,void 0,void 0,(function*(){return Tl(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return El(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;te.priority-t.priority));const i=this._highestBlockNumber;let o=0,s=!0;for(;;){const a=kl();let c=r.filter((e=>e.runner&&a-e.starte+t.weight),0);for(;c{n.staller=null})),n.runner=Nl(n,i,e,t).then((r=>{n.done=!0,n.result=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Pl(n,kl()),request:{method:e,params:(0,jc.deepCopy)(t)},provider:this})}),(r=>{n.done=!0,n.error=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Pl(n,kl()),request:{method:e,params:(0,jc.deepCopy)(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Pl(n,null),request:{method:e,params:(0,jc.deepCopy)(t)},provider:this}),c+=n.weight}const u=[];r.forEach((e=>{!e.done&&e.runner&&(u.push(e.runner),e.staller&&u.push(e.staller.getPromise()))})),u.length&&(yield Promise.race(u));const l=r.filter((e=>e.done&&null==e.error));if(l.length>=this.quorum){const e=n(l);if(void 0!==e)return r.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;s||(yield Ol(100).getPromise()),s=!1}const d=r.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const n=t.error.code;return Rl.indexOf(n)>=0&&(e[n]||(e[n]={error:t.error,weight:0}),e[n].weight+=t.weight),e}),{});if(Object.keys(d).forEach((e=>{const t=d[e];if(t.weight{e.staller&&e.staller.cancel(),e.cancelled=!0}));const n=t.error,i={};Dl.forEach((e=>{null!=n[e]&&(i[e]=n[e])})),_l.throwError(n.reason||n.message,e,i)})),0===r.filter((e=>!e.done)).length)break}return r.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),_l.throwError("failed to meet quorum",Oc.Logger.errors.SERVER_ERROR,{method:e,params:t,results:r.map((e=>Pl(e))),provider:this})}))}}const Ll=new Oc.Logger(Gc),jl="84842078b09946638c03157f83405213";class Ul extends Ju{constructor(e,t){const n=new Zl(e,t),r=n.connection;r.password&&Ll.throwError("INFURA WebSocket project secrets unsupported",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});super(r.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),(0,jc.defineReadOnly)(this,"apiKey",n.projectId),(0,jc.defineReadOnly)(this,"projectId",n.projectId),(0,jc.defineReadOnly)(this,"projectSecret",n.projectSecret)}isCommunityResource(){return this.projectId===jl}}class Zl extends nl{static getWebSocketProvider(e,t){return new Ul(e,t)}static getApiKey(e){const t={apiKey:jl,projectId:jl,projectSecret:null};return null==e||("string"===typeof e?t.projectId=e:null!=e.projectSecret?(Ll.assertArgument("string"===typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Ll.assertArgument("string"===typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let n=null;switch(e?e.name:"unknown"){case"homestead":n="mainnet.infura.io";break;case"goerli":n="goerli.infura.io";break;case"sepolia":n="sepolia.infura.io";break;case"matic":n="polygon-mainnet.infura.io";break;case"maticmum":n="polygon-mumbai.infura.io";break;case"optimism":n="optimism-mainnet.infura.io";break;case"optimism-goerli":n="optimism-goerli.infura.io";break;case"arbitrum":n="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":n="arbitrum-goerli.infura.io";break;default:Ll.throwError("unsupported network",Oc.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const r={allowGzip:!0,url:"https://"+n+"/v3/"+t.projectId,throttleCallback:(e,n)=>(t.projectId===jl&&Kc(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}isCommunityResource(){return this.projectId===jl}}const Hl=new Oc.Logger(Gc);class zl extends nl{static getApiKey(e){return e&&"string"!==typeof e&&Hl.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){Hl.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let n=null;switch(e.name){case"homestead":n="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":n="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":n="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":n="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":n="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Hl.throwArgumentError("unsupported network","network",arguments[0])}return n+"?apiKey="+t}}const Gl=new Oc.Logger(Gc),Vl="62e1ad51b37b8e00394bda3b";class Wl extends nl{static getApiKey(e){const t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=Vl:"string"===typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:Gl.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let n=null;switch(e?e.name:"unknown"){case"goerli":n="eth-goerli.gateway.pokt.network";break;case"homestead":n="eth-mainnet.gateway.pokt.network";break;case"kovan":n="poa-kovan.gateway.pokt.network";break;case"matic":n="poly-mainnet.gateway.pokt.network";break;case"maticmum":n="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":n="eth-rinkeby.gateway.pokt.network";break;case"ropsten":n="eth-ropsten.gateway.pokt.network";break;default:Gl.throwError("unsupported network",Oc.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const r={headers:{},url:`https://${n}/v1/lb/${t.applicationId}`};return null!=t.applicationSecretKey&&(r.user="",r.password=t.applicationSecretKey),r}isCommunityResource(){return this.applicationId===Vl}}const ql=new Oc.Logger(Gc);let $l=1;function Kl(e,t){const n="Web3LegacyFetcher";return function(e,r){const i={method:e,params:r,id:$l++,jsonrpc:"2.0"};return new Promise(((e,r)=>{this.emit("debug",{action:"request",fetcher:n,request:(0,jc.deepCopy)(i),provider:this}),t(i,((t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:n,error:t,request:i,provider:this}),r(t);if(this.emit("debug",{action:"response",fetcher:n,request:i,response:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,r(e)}e(o.result)}))}))}}class Yl extends qu{constructor(e,t){null==e&&ql.throwArgumentError("missing provider","provider",e);let n=null,r=null,i=null;"function"===typeof e?(n="unknown:",r=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),i=e,e.request?(""===n&&(n="eip-1193:"),r=function(e){return function(t,n){null==n&&(n=[]);const r={method:t,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,jc.deepCopy)(r),provider:this}),e.request(r).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:e,provider:this}),e}))}}(e)):e.sendAsync?r=Kl(0,e.sendAsync.bind(e)):e.send?r=Kl(0,e.send.bind(e)):ql.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,t),(0,jc.defineReadOnly)(this,"jsonRpcFetchFunc",r),(0,jc.defineReadOnly)(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const Xl=new Oc.Logger(Gc);var Jl,Ql,ed=n(11871),td=n(47796);!function(e){e.web3="web3",e.ethers="ethers",e.customHttp="custom"}(Jl||(Jl={})),function(e){e[e.mainnet=1]="mainnet",e[e.ropsten=3]="ropsten",e[e.rinkeby=4]="rinkeby",e[e.goerli=5]="goerli",e[e.optimism=10]="optimism",e[e.kovan=42]="kovan",e[e.matic=137]="matic",e[e.kovanOptimism=69]="kovanOptimism",e[e.xdai=100]="xdai",e[e.xDaiTestnet=10200]="xDaiTestnet",e[e.goerliOptimism=420]="goerliOptimism",e[e.sepoliaOptimism=11155420]="sepoliaOptimism",e[e.arbitrum=42161]="arbitrum",e[e.rinkebyArbitrum=421611]="rinkebyArbitrum",e[e.goerliArbitrum=421613]="goerliArbitrum",e[e.sepoliaArbitrum=421614]="sepoliaArbitrum",e[e.mumbai=80001]="mumbai",e[e.sepolia=11155111]="sepolia",e[e.avalancheMainnet=43114]="avalancheMainnet",e[e.avalancheFuji=43113]="avalancheFuji",e[e.fantomTestnet=4002]="fantomTestnet",e[e.fantom=250]="fantom",e[e.bsc=56]="bsc",e[e.bsc_testnet=97]="bsc_testnet",e[e.moonbeam=1284]="moonbeam",e[e.moonriver=1285]="moonriver",e[e.moonbaseAlphaTestnet=1287]="moonbaseAlphaTestnet",e[e.harmony=16666e5]="harmony",e[e.cronos=25]="cronos",e[e.fuse=122]="fuse",e[e.songbirdCanaryNetwork=19]="songbirdCanaryNetwork",e[e.costonTestnet=16]="costonTestnet",e[e.boba=288]="boba",e[e.aurora=1313161554]="aurora",e[e.astar=592]="astar",e[e.okc=66]="okc",e[e.heco=128]="heco",e[e.metis=1088]="metis",e[e.rsk=30]="rsk",e[e.rskTestnet=31]="rskTestnet",e[e.evmos=9001]="evmos",e[e.evmosTestnet=9e3]="evmosTestnet",e[e.thundercore=108]="thundercore",e[e.thundercoreTestnet=18]="thundercoreTestnet",e[e.oasis=26863]="oasis",e[e.celo=42220]="celo",e[e.godwoken=71402]="godwoken",e[e.godwokentestnet=71401]="godwokentestnet",e[e.klatyn=8217]="klatyn",e[e.milkomeda=2001]="milkomeda",e[e.kcc=321]="kcc",e[e.etherlite=111]="etherlite",e[e.lineaTestnet=59140]="lineaTestnet",e[e.linea=59144]="linea",e[e.scroll=534352]="scroll",e[e.scrollSepolia=534351]="scrollSepolia",e[e.zkSyncEra=324]="zkSyncEra",e[e.zkSyncEraTestnet=280]="zkSyncEraTestnet",e[e.zkSyncEraSepoliaTestnet=300]="zkSyncEraSepoliaTestnet",e[e.starknet=300]="starknet",e[e.starknetTestnet=301]="starknetTestnet",e[e.shibarium=109]="shibarium",e[e.mantle=5e3]="mantle",e[e.mantleTestnet=5001]="mantleTestnet",e[e.base=8453]="base",e[e.baseTestnet=84531]="baseTestnet",e[e.blastSepolia=168587773]="blastSepolia",e[e.polygonZkEvm=1101]="polygonZkEvm",e[e.polygonZkEvmTestnet=1442]="polygonZkEvmTestnet",e[e.zora=7777777]="zora",e[e.zoraTestnet=999]="zoraTestnet",e[e.flare=14]="flare",e[e.pulsechain=369]="pulsechain",e[e.sapphire=23294]="sapphire",e[e.blast=81457]="blast",e[e.amoy=80002]="amoy"}(Ql||(Ql={}));var nd=function(){function e(){}return e.deepClone=function(e){return JSON.parse(JSON.stringify(e))},e}(),rd=function(){return rd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)try{f=td.defaultAbiCoder.decode(d,this.getReturnDataFromResult(u.result)),a.callsReturnContext.push(nd.deepClone({returnValues:this.formatReturnValues(f),decoded:!0,reference:l.reference,methodName:l.methodName,methodParameters:l.methodParameters,success:!0}))}catch(h){if(!this._options.tryAggregate)throw h;a.callsReturnContext.push(nd.deepClone({returnValues:[],decoded:!1,reference:l.reference,methodName:l.methodName,methodParameters:l.methodParameters,success:!1}))}else a.callsReturnContext.push(nd.deepClone({returnValues:this.getReturnDataFromResult(u.result),decoded:!1,reference:l.reference,methodName:l.methodName,methodParameters:l.methodParameters,success:!0}));else a.callsReturnContext.push(nd.deepClone({returnValues:[],decoded:!1,reference:l.reference,methodName:l.methodName,methodParameters:l.methodParameters,success:!1}));r.results[a.originalContractCallContext.reference]=a}return[2,r]}}))}))},e.prototype.getReturnDataFromResult=function(e){return this._options.tryAggregate?e.returnData:e},e.prototype.formatReturnValues=function(e){var t=e;return 1===e.length&&(t=e[0]),Array.isArray(t)?t:[t]},e.prototype.buildAggregateCallContext=function(e){for(var t=[],n=0;n=0||(i[n]=e[n]);return i}function rf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var of={exports:{}};!function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(R){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),s=new C(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=k(s,n);if(a){if(a===m)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?h:f,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,s),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(R){return{type:"throw",arg:R}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",h="completed",m={};function g(){}function y(){}function b(){}var v={};c(v,o,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(I([])));x&&x!==n&&r.call(x,o)&&(v=x);var A=b.prototype=g.prototype=Object.create(v);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function n(i,o,s,a){var c=l(e[i],e,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"===typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,a)}))}a(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=l(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function I(e){if(e){var n=e[o];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(c&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(n){"object"===typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(of);var sf=of.exports,af="https://api.paraswap.io";var cf=function(e){var t=function(e){return Object.entries(e).filter((function(e){return void 0!==e[1]})).map((function(e){var t=e[0],n=e[1];return[t,String(n)]}))}(e),n=new URLSearchParams(t).toString();return n&&"?"+n},uf=function(e){var t,n;function r(t){var n,i=t.code,o=t.request,s=t.response,a=t.isAxiosError,c=t.message;if((n=e.call(this)||this).code=void 0,n.status=void 0,n.request=void 0,n.response=void 0,n.isAxiosError=!1,Error.captureStackTrace&&Error.captureStackTrace(rf(n),r),n.name=n.constructor.name,n.code=i,n.request=o,n.isAxiosError=a,!s)return n.message=c,rf(n);n.response=s;var u=s.data,l=s.status;return n.status=l,n.message=lf(u)?u.error:c,n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Jd(t,n),r}(tf(Error));function lf(e){return!!(t=e)&&"object"===typeof t&&"string"===typeof e.error;var t}var df,ff=["srcToken","destToken"],pf=["route"],hf=["options"],mf=["excludePricingMethods","excludeContractMethods","includeContractMethods","adapterVersion","partner","includeDEXS","excludeDEXS","excludePools"];!function(e){e.megapath="megapath",e.multipath="multipath",e.simplepath="simplepath"}(df||(df={}));var gf=function(e){var t=e.apiURL,n=void 0===t?af:t,r=e.chainId,i=e.fetcher,o=n+"/prices",s=function(){var e=Kd(sf.mark((function e(t,n){var s,a,c,u,l,d,f;return sf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.srcToken,a=t.destToken,c=nf(t,ff),u=yf(c),l=cf(Yd({srcToken:s,destToken:a,network:r},u)),d=o+"/"+l,e.next=6,i({url:d,method:"GET",signal:n});case 6:return f=e.sent,e.abrupt("return",f.priceRoute);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),a=function(){var e=Kd(sf.mark((function e(t,n){var s,a,c,u,l,d,f;return sf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=t.route,a=nf(t,pf),!(s.length<2)){e.next=3;break}throw new Error("Invalid Route");case 3:return c=yf(a),u=s.join("-"),l=cf(Yd({route:u,network:r},c)),d=o+"/"+l,e.next=9,i({url:d,method:"GET",signal:n});case 9:return f=e.sent,e.abrupt("return",f.priceRoute);case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return{getRate:s,getRateByRoute:a}};function yf(e){var t=e.options,n=void 0===t?{}:t,r=nf(e,hf),i=n.excludePricingMethods,o=n.excludeContractMethods,s=n.includeContractMethods,a=n.adapterVersion,c=n.partner,u=void 0===c?"paraswap.io":c,l=n.includeDEXS,d=n.excludeDEXS,f=n.excludePools,p=nf(n,mf),h=[l,d,f,i,o,s].map((function(e){return(null==e?void 0:e.join(","))||void 0})),m=h[0],g=h[1],y=h[2];return Yd({version:a,excludePricingMethods:h[3],excludeContractMethods:h[4],includeContractMethods:h[5],partner:u,includeDEXS:m,excludeDEXS:g,excludePools:y},r,p)}function bf(e){return{nonceAndMeta:e.nonceAndMeta,expiry:e.expiry,makerAsset:e.makerAsset,takerAsset:e.takerAsset,maker:e.maker,taker:e.taker,makerAmount:e.makerAmount,takerAmount:e.takerAmount}}function vf(e,t){return(BigInt(e)+(BigInt(t)<0?Yd({},t,{orders:t.orders.map((function(e){var t=Yd({},"makerAssetId"in e?wf(e):bf(e),{signature:e.signature});return e.permitMakerAsset&&(t.permitMakerAsset=e.permitMakerAsset),t}))}):t,f={url:l,method:"POST",data:d,signal:r},e.next=8,i(f);case 8:return p=e.sent,e.abrupt("return",p);case 10:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();return{buildTx:s}};function Af(e){var t=e.queryParams,n=e.side,r=e.priceRoute;if(t.slippage)return n===Wd.PC.BUY&&t.destAmount===r.destAmount||n===Wd.PC.SELL&&t.srcAmount===r.srcAmount;var i=n===Wd.PC.SELL?[t.srcAmount,r.srcAmount]:[t.destAmount,r.destAmount];return i[0]===i[1]}var Ef=function(e){return function(){var t=Kd(sf.mark((function t(n){var r,i,o,s,a,c,u;return sf.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r=n.url,i=n.method,o=n.signal,s="POST"===i?JSON.stringify(n.data):null,a="POST"===i&&s?{"Content-Type":"application/json"}:void 0,t.next=6,e(r,{method:i,body:s,signal:o,headers:a});case 6:return c=t.sent,t.next=9,c.json();case 9:if(u=t.sent,c.ok){t.next=12;break}throw new uf({code:String(c.status),response:{data:u,status:c.status,statusText:c.statusText,headers:Object.fromEntries(c.headers.entries()),config:{url:r,method:i}},message:c.statusText,isAxiosError:!1});case 12:return t.abrupt("return",u);case 15:if(t.prev=15,t.t0=t.catch(0),!(t.t0 instanceof uf)){t.next=19;break}throw t.t0;case 19:throw new uf(t.t0);case 20:case"end":return t.stop()}}),t,null,[[0,15]])})));return function(e){return t.apply(this,arguments)}}()};var _f=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{var t,n,r,i;if(this.mutateOptions&&this.hasListeners())if(e.onSuccess)null==(t=(n=this.mutateOptions).onSuccess)||t.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(r=(i=this.mutateOptions).onSettled)||r.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context);else if(e.onError){var o,s,a,c;null==(o=(s=this.mutateOptions).onError)||o.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(c=this.mutateOptions).onSettled)||a.call(c,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}e.listeners&&this.listeners.forEach((e=>{e(this.currentResult)}))}))}}var $f=n(24798);function Kf(){}var Yf=n(9669),Xf=n.n(Yf),Jf=function(){var e=(0,o.Z)(d().mark((function e(t){var n,r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"https://api.odos.xyz/sor/quote/v2",e.next=3,Xf().post("https://api.odos.xyz/sor/quote/v2",t,{headers:{Accept:"application/json","Content-Type":"application/json"}});case 3:if(200!==(n=e.sent).status){e.next=11;break}return e.next=7,n.data;case 7:return r=e.sent,e.abrupt("return",r);case 11:400===n.status?console.log(n):console.error("Error in Quote:",n);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Qf=function(){var e=(0,o.Z)(d().mark((function e(t){var n,r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"https://api.odos.xyz/sor/assemble",e.next=3,Xf().post("https://api.odos.xyz/sor/assemble",t,{headers:{Accept:"application/json","Content-Type":"application/json"}});case 3:if(200!==(n=e.sent).status){e.next=11;break}return e.next=7,n.data;case 7:return r=e.sent,e.abrupt("return",r);case 11:console.error("Error in Quote:",n);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ep=n(91747);function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function np(e){for(var t=1;tnew qf(i,r)));ec.useEffect((()=>{o.setOptions(r)}),[o,r]);const s=(0,Wf.$)(ec.useCallback((e=>o.subscribe(w.V.batchCalls(e))),[o]),(()=>o.getCurrentResult()),(()=>o.getCurrentResult())),a=ec.useCallback(((e,t)=>{o.mutate(e,t).catch(Kf)}),[o]);if(s.error&&(0,$f.L)(o.options.useErrorBoundary,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}({mutationFn:function(){var e=(0,o.Z)(d().mark((function e(t){var n,r,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=rp(t),i=np(np({},r.data),{},{gasLimit:ep.O$.from("500000"),gasPrice:void 0,value:ep.O$.from((null===(n=r.data)||void 0===n?void 0:n.transaction.value)||"0")}),e.abrupt("return",i);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()})};function op(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sp(e){for(var t=1;tNumber(l)?i("-1"):i(e.target.value))},inputProps:{"aria-label":"amount input",style:{fontSize:"21px",lineHeight:"28,01px",padding:0,height:"28px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},inputComponent:_p}),""!==r&&!a&&(0,hc.jsx)(Ed.Z,{sx:{minWidth:0,p:0,left:8,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},onClick:function(){i&&i("")},disabled:o,children:(0,hc.jsx)(lp.Z,{height:16})}),(0,hc.jsxs)(fc.Z,{disableRipple:!0,onClick:function(){w(x.current)},"data-cy":"assetSelect",sx:{p:0,"&:hover":{backgroundColor:"transparent"}},endIcon:A?(0,hc.jsx)(fp,{}):(0,hc.jsx)(pp,{}),children:[(0,hc.jsx)(vp.UD,{symbol:h.symbol,logoURI:h.logoURI,sx:{mr:2,ml:3}}),(0,hc.jsx)(dc.Z,{"data-cy":"assetsSelectedOption_".concat(h.symbol.toUpperCase()),variant:"main16",color:"text.primary",children:h.symbol}),(null===(t=h.extensions)||void 0===t?void 0:t.isUserCustom)&&(0,hc.jsx)(lc.Z,{sx:{fontSize:14,ml:1},color:"warning",children:(0,hc.jsx)(up.Z,{})})]}),(0,hc.jsxs)(gp.Z,{anchorEl:v,open:A,onClose:E,PaperProps:{sx:{width:null===(n=x.current)||void 0===n?void 0:n.offsetWidth,border:"dark"===m.palette.mode?"1px solid #EBEBED1F":"unset",boxShadow:"0px 2px 10px 0px #0000001A",overflow:"hidden"}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[(0,hc.jsxs)(uc.Z,{sx:{p:2,px:3,borderBottom:"1px solid ".concat(m.palette.divider),top:0,zIndex:2},children:[(0,hc.jsx)(wp.M,{onSearchTermChange:function(e){var t=e.trim().toLowerCase(),n=u.filter((function(e){return e.symbol.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.address.toLowerCase()===t}));0===n.length&&(0,Uc.isAddress)(e)?I(!0):T(n)},placeholder:"Search name or paste address"}),(0,hc.jsx)(uc.Z,{sx:{display:"flex",justifyContent:"flex-start",overfloyY:"auto",alignItems:"flex-start",flexWrap:"wrap",mt:2,gap:2},children:O.map((function(e){return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"row",alignItems:"center",p:1,borderRadius:"16px",border:"1px solid",borderColor:m.palette.divider,cursor:"pointer","&:hover":{backgroundColor:m.palette.divider}},onClick:function(){return g(e)},children:[(0,hc.jsx)(vp.UD,{logoURI:e.logoURI,symbol:e.symbol,sx:{width:24,height:24,mr:1}}),(0,hc.jsx)(dc.Z,{variant:"main14",color:"text.primary",sx:{mr:1},children:e.symbol})]},e.symbol)}))})]}),(0,hc.jsx)(uc.Z,{sx:{overflow:"auto",maxHeight:"200px"},children:C?(0,hc.jsx)(uc.Z,{sx:{maxHeight:"178px",overflowY:"auto",display:"flex",flexDirection:"column",minHeight:"60px"},children:(0,hc.jsx)(_c.Z,{sx:{mx:"auto",my:"auto"}})}):k.length>0?k.map((function(e){var t;return(0,hc.jsxs)(Fd.Z,{value:e.symbol,"data-cy":"assetsSelectOption_".concat(e.symbol.toUpperCase()),sx:{backgroundColor:m.palette.background.paper},onClick:function(){return g(e)},children:[(0,hc.jsx)(vp.UD,{symbol:e.symbol,logoURI:e.logoURI,sx:{mr:2}}),(0,hc.jsx)(yp.Z,{sx:{flexGrow:0},children:e.symbol}),(null===(t=e.extensions)||void 0===t?void 0:t.isUserCustom)&&(0,hc.jsx)(lc.Z,{sx:{fontSize:14,ml:1},color:"warning",children:(0,hc.jsx)(up.Z,{})}),e.balance&&(0,hc.jsx)(kd.B,{sx:{ml:"auto"},value:e.balance,compact:!0})]},e.symbol)})):(0,hc.jsx)(dc.Z,{variant:"main14",color:"text.primary",sx:{width:"auto",textAlign:"center",m:4},children:(0,hc.jsx)(sc.cC,{id:"No results found. You can import a custom token with a contract address"})})})]})]}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",height:"16px"},children:[(0,hc.jsx)(uc.Z,{sx:{flex:1}}),h.balance&&i&&(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsxs)(dc.Z,{component:"div",variant:"secondary12",color:"text.secondary",children:[(0,hc.jsx)(sc.cC,{id:"Balance"}),(0,hc.jsx)(kd.B,{value:h.balance,compact:!0,variant:"secondary12",color:"text.secondary",symbolsColor:"text.disabled",sx:{ml:1}})]}),!a&&(0,hc.jsx)(fc.Z,{size:"small",sx:{minWidth:0,ml:"7px",p:0},onClick:function(){i("-1")},disabled:o||d,children:(0,hc.jsx)(sc.cC,{id:"Max"})})]})]})]})},Tp=function(e){var t=e.error;return(0,hc.jsx)(Sd.v,{severity:"error",icon:!1,sx:{mt:4},children:(0,hc.jsx)(dc.Z,{variant:"caption",children:t instanceof Error?"".concat(t.message):"There was an issue fetching data from Paraswap"})})},Sp=function(e){var t=e.ratesError,n=e.balance,r=e.inputAmount;return t?(0,hc.jsx)(Tp,{error:t}):Number(r)>Number(n)?(0,hc.jsx)(Sd.v,{severity:"error",sx:{mt:4},icon:!1,children:(0,hc.jsx)(dc.Z,{variant:"caption",children:(0,hc.jsx)(sc.cC,{id:"Your balance is lower than the selected amount."})})}):null},Cp=n(58364),Ip=n(83187),Op=n(41528),Rp=function(e){var t=e.rates,n=e.srcToken,r=e.destToken,i=(0,ec.useState)(!1),o=i[0],s=i[1],a=(0,ec.useMemo)((function(){var e=(0,xd.pV)(t.inAmounts[0],n.decimals),i=(0,xd.pV)(t.outAmounts[0],r.decimals);return o?e.div(i):i.div(e)}),[o,t.srcAmount,t.destAmount]),c=(0,ec.useMemo)((function(){var e=(0,xd.hE)(t.srcUSD);return(0,xd.hE)(t.destUSD).minus(e).div(e)}),[t.srcUSD,t.destUSD]);return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",mt:6},children:[(0,hc.jsx)(kd.B,{visibleDecimals:0,variant:"main12",symbol:o?r.symbol:n.symbol,symbolsVariant:"secondary12",symbolsColor:"text.secondary",value:"1"}),(0,hc.jsx)(Ip.Z,{onClick:function(){return s((function(e){return!e}))},disableTouchRipple:!0,sx:{mx:1},children:(0,hc.jsx)(lc.Z,{sx:{fontSize:"12px"},children:(0,hc.jsx)(Cp.Z,{})})}),(0,hc.jsx)(kd.B,{variant:"main12",symbol:o?n.symbol:r.symbol,symbolsVariant:"secondary12",symbolsColor:"text.secondary",value:a.toString(),visibleDecimals:3}),(0,hc.jsx)(Op.y,{title:(0,hc.jsx)(dc.Z,{variant:"caption",children:(0,hc.jsx)(sc.cC,{id:"Price impact"})}),children:(0,hc.jsxs)(uc.Z,{sx:{display:"flex",cursor:"pointer"},children:[(0,hc.jsx)(dc.Z,{variant:"caption",children:"("}),(0,hc.jsx)(kd.B,{variant:"caption",value:c.toString(),percent:!0}),(0,hc.jsx)(dc.Z,{variant:"caption",children:")"})]})})]})},Dp=n(22659),Pp=n(85390),Bp=n(87054),Mp=["0.001","0.005","0.01"],Np=function(e){var t=e.slippage,n=e.setSlippage,r=(0,ec.useState)(),i=r[0],o=r[1],s=Boolean(i);return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,hc.jsxs)(dc.Z,{variant:"caption",color:"text.secondary",children:[(0,hc.jsx)(sc.cC,{id:"Slippage"}),(0,hc.jsxs)(gp.Z,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:i,id:"switch-slippage-selector",MenuListProps:{"aria-labelledby":"switch-slippage-selector-button",sx:{py:3,px:4}},open:s,onClose:function(){o(null)},children:[(0,hc.jsx)(dc.Z,{variant:"subheader2",mb:5,children:(0,hc.jsx)(sc.cC,{id:"Max slippage"})}),(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:(0,hc.jsx)(Pp.Z,{sx:{backgroundColor:"background.surface",borderRadius:"6px",p:"2px"},exclusive:!0,onChange:function(e,t){return n(t)},children:Mp.map((function(e){return(0,hc.jsx)(Bp.Z,{sx:{borderRadius:1,py:1,px:2,borderColor:"transparent",backgroundColor:e===t?"background.paper":"transparent"},value:e,children:(0,hc.jsx)(kd.B,{value:e,percent:!0,variant:"subheader2",color:"primary.main",symbolsColor:"primary.main"})},e)}))})})]})]}),(0,hc.jsx)(kd.B,{variant:"caption",color:"text.primary",value:t,visibleDecimals:2,percent:!0}),(0,hc.jsx)(fc.Z,{id:"switch-slippage-selector-button",sx:{padding:0,minWidth:0},onClick:function(e){o(e.currentTarget)},"aria-controls":"switch-slippage-selector",children:(0,hc.jsx)(lc.Z,{sx:{fontSize:"16px"},children:(0,hc.jsx)(Dp.Z,{})})})]})};var Fp=ec.forwardRef((function(e,t){return ec.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),ec.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 5l7 7m0 0l-7 7m7-7H3"}))})),Lp=n(56365),jp=n(58057),Up=n(68346),Zp=function(){return(0,hc.jsx)(lc.Z,{sx:{ml:"2px",fontSize:"11px"},children:(0,hc.jsx)(Lp.Z,{})})},Hp=function(e){var t=e.explorer,n=e.txHash,r=e.children,i=e.hideTx,o=(0,dd.vR)(),s=o.close,a=o.mainTxState;return(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,hc.jsx)(uc.Z,{sx:{width:"48px",height:"48px",bgcolor:"success.200",borderRadius:"50%",mt:14,mx:"auto",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,hc.jsx)(lc.Z,{sx:{color:"success.main",fontSize:"32px"},children:(0,hc.jsx)(jp.Z,{})})}),(0,hc.jsx)(dc.Z,{sx:{mt:4},variant:"h2",children:(0,hc.jsx)(sc.cC,{id:"All done!"})}),r]}),!i&&(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,hc.jsxs)(Up.Z,{variant:"helperText",href:"".concat(t).concat(n||a.txHash),sx:{display:"inline-flex",alignItems:"center",justifyContent:"right",mt:6,mb:3},underline:"hover",target:"_blank",rel:"noreferrer noopener",children:[(0,hc.jsx)(sc.cC,{id:"Review tx details"}),(0,hc.jsx)(Zp,{})]}),(0,hc.jsx)(fc.Z,{onClick:s,variant:"contained",size:"large",sx:{minHeight:"44px"},"data-cy":"closeButton",children:(0,hc.jsx)(sc.cC,{id:"Ok, Close"})})]})]})},zp=function(e){var t=e.txHash,n=e.amount,r=e.symbol,i=e.iconSymbol,o=e.outAmount,s=e.outSymbol,a=e.outIconSymbol,c=e.iconUri,u=e.outIconUri;return(0,hc.jsx)(Hp,{explorer:"",txHash:t,children:(0,hc.jsxs)(uc.Z,{sx:{mt:2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"},children:[(0,hc.jsx)(dc.Z,{children:(0,hc.jsx)(sc.cC,{id:"You've successfully switched tokens."})}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",gap:2,mt:3},children:[(0,hc.jsx)(vp.UD,{sx:{fontSize:"20px"},logoURI:c,symbol:i}),(0,hc.jsx)(kd.B,{value:Number(n),compact:!0,variant:"main14"}),(0,hc.jsx)(dc.Z,{variant:"secondary14",children:r}),(0,hc.jsx)(lc.Z,{sx:{fontSize:"14px"},children:(0,hc.jsx)(Fp,{fontSize:"14px"})}),(0,hc.jsx)(vp.UD,{sx:{fontSize:"20px"},logoURI:u,symbol:a}),(0,hc.jsx)(kd.B,{value:Number(o),variant:"main14"}),(0,hc.jsx)(dc.Z,{variant:"secondary14",children:s})]})]})})},Gp=function(e){var t,n,r,i=e.supportedNetworks,o=e.selectedChainId,s=e.setSelectedChainId,a=e.defaultInputToken,c=e.defaultOutputToken,u=e.tokens,l=e.addNewToken,d=(0,ec.useState)("0.001"),f=d[0],p=d[1],h=(0,ec.useState)(""),m=h[0],g=h[1],y=(0,ec.useState)(""),b=y[0],v=y[1],w=(0,dd.vR)(),x=w.mainTxState,A=w.gasLimit,E=w.txError,_=w.setTxError,k=(0,bc.Yh)((function(e){return e.account})),T=(0,oc.Mo)(o),S=(0,ec.useState)(a),C=S[0],I=S[1],O=(0,ec.useState)(c),R=O[0],D=O[1],P=(0,ic.Z)().readOnlyModeAddress,B=(0,Cd.Q)(o),M=(0,ec.useMemo)((function(){return(0,_d.debounce)((function(e){v(e)}),300)}),[v]),N=function(e){var t=e.inputTokens;return(0,Sc.a)({queryFn:function(){return Jf(e)},queryKey:cd.Bd.odosswapQuote(e),enabled:0===t.filter((function(e){return"0"===e.amount})).length,retry:0})}({chainId:null!==(t=T.underlyingChainId)&&void 0!==t?t:o,inputTokens:[{tokenAddress:C.address,amount:""===b?"0":(0,xd.pV)(b,-1*C.decimals).toFixed(0)}],outputTokens:[{tokenAddress:R.address,proportion:1}],userAddr:k,slippageLimitPercent:Number(f)}),F=N.data,L=N.error,j=N.isFetching;if(F&&x.success)return(0,hc.jsx)(zp,{txHash:x.txHash,amount:b,symbol:C.symbol,iconSymbol:C.symbol,iconUri:C.logoURI,outSymbol:R.symbol,outIconSymbol:R.symbol,outIconUri:R.logoURI,outAmount:(Number((0,xd.Fv)(F.outAmounts[0],R.decimals))*(1-Number(f))).toString()});return(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Od.E,{title:"Swap Tokens"}),B.isWrongNetwork&&!P&&(0,hc.jsx)(Rd.I,{networkName:T.name,chainId:o,event:{eventName:wc.vh.SWITCH_NETWORK}}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,hc.jsx)(Zd,{networks:i,selectedNetwork:o,setSelectedNetwork:function(e){_(void 0),s(e)}}),(0,hc.jsx)(Np,{slippage:f,setSlippage:p})]}),C&&R?(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",gap:"15px",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative"},children:[(0,hc.jsx)(kp,{chainId:o,assets:u.filter((function(e){return e.address!==R.address})),value:m,onChange:function(e){_(void 0),"-1"===e?(g(C.balance),M(C.balance)):(g(e),M(e))},onSelect:function(e){u.find((function(t){return t.address===e.address}))?(I(e),_(void 0)):l(e).then((function(){I(e),_(void 0)}))},selectedAsset:C}),(0,hc.jsx)(Ed.Z,{onClick:function(){var e=C,t=R,n=F?(0,xd.pV)(F.outAmounts[0],R.decimals).toString():"0";I(t),D(e),g(n),v(n),_(void 0)},sx:{border:"1px solid",borderColor:"divider",position:"absolute",backgroundColor:"background.paper"},children:(0,hc.jsx)(lc.Z,{sx:{color:"primary.main",fontSize:"18px"},children:(0,hc.jsx)(Ad,{})})}),(0,hc.jsx)(kp,{chainId:o,assets:u.filter((function(e){return e.address!==C.address})),value:F?(0,xd.pV)(F.outAmounts[0],R.decimals).toString():"0",loading:"0"!==b&&""!==b&&j&&!L,onSelect:function(e){u.find((function(t){return t.address===e.address}))?(D(e),_(void 0)):l(e).then((function(){D(e),_(void 0)}))},disableInput:!0,selectedAsset:R})]}),F&&(0,hc.jsx)(hc.Fragment,{children:(0,hc.jsx)(Rp,{rates:F,srcToken:C,destToken:R})}),F&&k&&(0,hc.jsxs)(Id.m6,{gasLimit:A,chainId:o,children:[(0,hc.jsx)(Td.X,{caption:(0,hc.jsx)(sc.cC,{id:"Minimum {0} received",values:{0:R.symbol}}),captionVariant:"caption",children:(0,hc.jsx)(kd.B,{compact:!1,roundDown:!0,variant:"caption",value:Number((0,xd.Fv)(F.outAmounts[0],R.decimals))*(1-Number(f))})}),(0,hc.jsx)(Td.X,{sx:{mt:1},caption:(0,hc.jsx)(sc.cC,{id:"Minimum USD value received"}),captionVariant:"caption"})]}),k?(0,hc.jsxs)(hc.Fragment,{children:[((null===(n=C.extensions)||void 0===n?void 0:n.isUserCustom)||(null===(r=R.extensions)||void 0===r?void 0:r.isUserCustom))&&(0,hc.jsx)(Sd.v,{severity:"warning",icon:!1,sx:{mt:2,mb:2},children:(0,hc.jsx)(dc.Z,{variant:"caption",children:"You have selected a custom imported token."})}),(0,hc.jsx)(Sp,{ratesError:L,balance:C.balance,inputAmount:b}),E&&(0,hc.jsx)(Pd,{txError:E}),(0,hc.jsx)(ap,{isWrongNetwork:B.isWrongNetwork,inputAmount:b,inputToken:C,outputToken:R,slippage:f,blocked:!F||Number(b)>Number(C.balance)||!k,chainId:o,route:F})]}):(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:4,alignItems:"center"},children:[(0,hc.jsx)(dc.Z,{sx:{mb:6,textAlign:"center"},color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Please connect your wallet to be able to switch your tokens."})}),(0,hc.jsx)(kc.p,{})]})]}):(0,hc.jsx)(_c.Z,{})]})};function Vp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wp(e){for(var t=1;t0,queryFn:function(){var r=(0,o.Z)(d().mark((function r(){var i,o,a,c,u,l,f,p,h,m,g;return d().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=(0,oc.VH)(t),o=e.filter((function(e){var t;return!(null!==(t=e.extensions)&&void 0!==t&&t.isNative)})),a=e.find((function(e){var t;return null===(t=e.extensions)||void 0===t?void 0:t.isNative})),c=new sd({ethersProvider:i,tryAggregate:!0,multicallCustomContractAddress:ad.R[t]}),u=o.map((function(e){return{reference:e.address,contractAddress:e.address,abi:[{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"balance",type:"uint256"}]}],calls:[{reference:"balanceOfCall",methodName:"balanceOf",methodParameters:[n]}]}})),a){r.next=12;break}return r.next=8,c.call(u);case 8:return l=r.sent,f=l.results,console.log(f),r.abrupt("return",e.map((function(e,t){return ld(ld({},e),{},{balance:(0,Tc.formatUnits)(f[t].callsReturnContext[0].returnValues[0],e.decimals)})})).sort((function(e,t){return Number(t.balance)-Number(e.balance)})));case 12:return r.next=14,Promise.all([i.getBalance(n),c.call(u)]);case 14:return p=r.sent,h=(0,s.Z)(p,2),m=h[0],g=h[1],r.abrupt("return",e.map((function(e){var t;return ld(ld({},e),{},{balance:null!==(t=e.extensions)&&void 0!==t&&t.isNative?(0,Tc.formatUnits)(m,e.decimals):(0,Tc.formatUnits)(g.results[e.address].callsReturnContext[0].returnValues[0],e.decimals)})})).sort((function(e,t){return Number(t.balance)-Number(e.balance)})));case 19:case"end":return r.stop()}}),r)})));return function(){return r.apply(this,arguments)}}()})}(i,n,t),u=c.data,l=(0,ec.useMemo)((function(){if(u){var e=u.find((function(e){var t;return null===(t=e.extensions)||void 0===t?void 0:t.isNative}))||u[0],t=u.find((function(t){return"ZERO"==t.symbol&&t.address!==e.address}))||u.find((function(t){return t.address!==e.address}));return(0,yd.Z)(e&&t,"token list should have at least 2 assets"),{defaultInputToken:e,defaultOutputToken:t}}return{defaultInputToken:i[0],defaultOutputToken:i[1]}}),[u,i]),f=l.defaultInputToken,p=l.defaultOutputToken,h=(0,D.NL)(),m=function(){var e=(0,o.Z)(d().mark((function e(r){var o,s,c;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.setQueryData(cd.Bd.tokensBalance(i,n,t),(function(e){return e?[].concat((0,a.Z)(e),[r]).sort((function(e,t){return Number(t.balance)-Number(e.balance)})):[r]})),o=localStorage.getItem("customTokens"),s={address:r.address,symbol:r.symbol,decimals:r.decimals,chainId:r.chainId,name:r.name,logoURI:r.logoURI,extensions:{isUserCustom:!0}},o?((c=JSON.parse(o)).push(s),localStorage.setItem("customTokens",JSON.stringify(c))):localStorage.setItem("customTokens",JSON.stringify([s]));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return u?(0,hc.jsx)(Gp,{selectedChainId:n,setSelectedChainId:r,supportedNetworks:wd,defaultInputToken:f,defaultOutputToken:p,tokens:u,addNewToken:m},n):(0,hc.jsx)(uc.Z,{sx:{width:"100%",display:"flex",justifyContent:"center",my:"60px"},children:(0,hc.jsx)(_c.Z,{})})},Kp=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args.chainId,i=(0,bc.Yh)((function(e){return e.currentChainId})),o=(0,ic.Z)().chainId,s=(0,bc.Yh)((function(e){return e.account})),a=(0,ec.useState)((function(){return wd.find((function(e){return e.chainId===i}))?i:qp.chainId})),c=a[0],u=a[1];return(0,ec.useEffect)((function(){if(r&&wd.find((function(e){return e.chainId===r})))u(r);else if(o&&wd.find((function(e){return e.chainId===o}))){var e=wd.find((function(e){return e.underlyingChainId===o}));u(e?e.chainId:o)}else wd.find((function(e){return e.chainId===i}))?u(i):u(qp.chainId)}),[i,r,o]),(0,hc.jsx)(pc.P,{open:t===dd.w8.Switch,setOpen:n,children:s?(0,hc.jsx)($p,{user:s,chainId:c,setSelectedChainId:u}):(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:4,alignItems:"center"},children:[(0,hc.jsx)(dc.Z,{sx:{mb:6,textAlign:"center"},color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Please connect your wallet to be able to switch your tokens."})}),(0,hc.jsx)(kc.p,{})]})})},Yp=n(23286),Xp=n(46930),Jp=n(94635),Qp=n(82403),eh=n(20854),th=n(10766),nh=n(34637),rh=n(59379),ih=n(34220),oh=n(43629),sh=n(59286),ah=n(87385),ch=n(81902),uh=n(53601),lh=n(93608),dh=n(19419);function fh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ph(e){for(var t=1;t {symbol}",values:{action:n,symbol:i},components:{0:(0,hc.jsx)(kd.B,{value:Number(r),compact:!0,variant:"secondary14"})}})})}),(0,hc.jsx)(fc.Z,{sx:{mt:4},variant:"outlined",size:"small",endIcon:(0,hc.jsx)(Ih,{style:{fontSize:12}}),onClick:function(){return a(wc.Sd.GHO_BORROW_VIEW_TX_DETAILS)},href:s.explorerLinkBuilder({tx:t||o.txHash}),target:"_blank",children:(0,hc.jsx)(dc.Z,{variant:"buttonS",children:(0,hc.jsx)(sc.cC,{id:"Review tx details"})})})]})})};function Rh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dh(e){for(var t=1;t0,O=y(_),R=(0,sh.BC)(f),D=_===(R=Math.min(Number(R),h.aaveFacilitatorRemainingCapacity).toFixed(10)),P=(0,xd.hE)(_).multipliedBy(r.formattedPriceInMarketReferenceCurrency).multipliedBy(p).shiftedBy(-Qp.$3),B=(0,eh.L1)({collateralBalanceMarketReferenceCurrency:f.totalCollateralUSD,borrowBalanceMarketReferenceCurrency:(0,xd.hE)(f.totalBorrowsUSD).plus(P),currentLiquidationThreshold:f.currentLiquidationThreshold}),M=B.toNumber()<1.5&&"-1"!==B.toString(),N=(0,xd.hE)(_).multipliedBy(r.priceInUSD),F=m.userGhoBorrowBalance>=h.ghoMinDebtTokenBalanceForDiscount?m.userGhoAvailableToBorrowAtDiscount:0,L=(0,kh.li)(h.ghoVariableBorrowAPY,m.userGhoBorrowBalance,F,h.ghoBorrowAPYWithMaxDiscount),j=m.userGhoBorrowBalance+Number(_)>=h.ghoMinDebtTokenBalanceForDiscount?m.userGhoAvailableToBorrowAtDiscount:0,U=(0,kh.li)(h.ghoVariableBorrowAPY,m.userGhoBorrowBalance+Number(_),j,h.ghoBorrowAPYWithMaxDiscount),Z=void 0;x!==zd.tk.Stable||r.stableBorrowRateEnabled?x===zd.tk.Stable&&null!==i&&void 0!==i&&i.usageAsCollateralEnabledOnUser&&(0,xd.hE)(_).lt((null===i||void 0===i?void 0:i.underlyingBalance)||0)?Z=Ch.NOT_ENOUGH_BORROWED:r.borrowingEnabled||(Z=Ch.BORROWING_NOT_AVAILABLE):Z=Ch.STABLE_RATE_NOT_ENABLED;var H=function(){switch(Z){case Ch.BORROWING_NOT_AVAILABLE:return(0,hc.jsx)(sc.cC,{id:"Borrowing is currently unavailable for {0}.",values:{0:r.symbol}});case Ch.NOT_ENOUGH_BORROWED:return(0,hc.jsx)(sc.cC,{id:"You can borrow this asset with a stable rate only if you borrow more than the amount you are supplying as collateral."});case Ch.STABLE_RATE_NOT_ENABLED:return(0,hc.jsx)(sc.cC,{id:"The Stable Rate is not enabled for this currency"});default:return(0,hc.jsx)(hc.Fragment,{})}},z=r.iconSymbol;return a.success?(0,hc.jsx)(Oh,{action:(0,hc.jsx)(sc.cC,{id:"Minted"}),amount:_,symbol:z}):(0,hc.jsxs)(hc.Fragment,{children:[b.determineWarningDisplay({borrowCap:b}),r.stableBorrowRateEnabled&&(0,hc.jsx)(Ph,{interestRateMode:x,setInterestRateMode:A,variableRate:r.variableBorrowAPY,stableRate:r.stableBorrowAPY}),(0,hc.jsxs)(dc.Z,{sx:{mb:2},children:["You are going to mint ONEZ. Minted ONEZ needs to be repaid back with interest to release your locked collateral. To learn more about how ONEZ works, visit our"," ",(0,hc.jsx)("a",{href:"https://docs.zerolend.xyz/onez",target:"_blank",rel:"noreferrer",children:"documentation"}),"."]}),(0,hc.jsx)(uh.W,{value:_,onChange:function(e){if("-1"===e)k(R);else{var t=(0,ah.$w)(e,r.decimals);k(t)}},usdValue:N.toString(10),assets:[{balance:R,symbol:o,iconSymbol:z}],symbol:o,capType:ch.R.borrowCap,isMaxSelected:D,maxValue:R,balanceText:(0,hc.jsx)(sc.cC,{id:"Available"})}),void 0!==Z&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(H,{})}),(0,hc.jsxs)(Id.m6,{gasLimit:c,children:[(0,hc.jsx)(Id.jz,{visibleHfChange:!!_,healthFactor:f.healthFactor,futureHealthFactor:B.toString(10)}),(0,hc.jsx)(Td.X,{caption:(0,hc.jsx)(uc.Z,{children:(0,hc.jsx)(Ah.n,{text:(0,hc.jsx)(sc.cC,{id:"APY, fixed rate"}),variant:"subheader2",color:"text.secondary"})}),captionVariant:"description",mb:4,align:"flex-start",children:(0,hc.jsx)(uc.Z,{sx:{textAlign:"right"},children:(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:(0,hc.jsx)(Mh,{ghoLoadingData:g,hasGhoBorrowPositions:I,borrowAmount:_,discountAvailable:O,userDiscountTokenBalance:m.userDiscountTokenBalance,underlyingAsset:t,customMarket:v,currentBorrowAPY:L,futureBorrowAPY:U,onDetailsClick:function(){return l()}})})})})]}),u&&(0,hc.jsx)(Dd.Q,{txError:u}),M&&(0,hc.jsx)(yh,{riskCheckboxAccepted:S,onRiskCheckboxChange:function(){C(!S)}}),(0,hc.jsx)(mh,{poolReserve:r,amountToBorrow:_,poolAddress:r.underlyingAsset,interestRateMode:x,isWrongNetwork:n,symbol:o,blocked:void 0!==Z||M&&!S,sx:M?{mt:0}:{}})]})},Mh=function(e){var t=e.ghoLoadingData,n=e.hasGhoBorrowPositions,r=e.borrowAmount,i=e.discountAvailable,o=e.userDiscountTokenBalance,s=e.underlyingAsset,a=e.customMarket,c=e.currentBorrowAPY,u=e.futureBorrowAPY,l=e.onDetailsClick;if(t||!n&&""===r&&i)return(0,hc.jsx)(_h.J,{variant:"secondary14",color:"text.secondary"});var d={stkAaveBalance:o||0,ghoRoute:Eh.Z6.reserveOverview(s,a)+"/#discount",userQualifiesForDiscount:i,"data-cy":"apyType"};return n||""===r?n&&""===r?(0,hc.jsx)(xh.B,Dh({withTokenIcon:i,value:c,onMoreDetailsClick:l},d)):i?i?(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(xh.B,Dh({withTokenIcon:!0,value:c,onMoreDetailsClick:l},d)),!!r&&(0,hc.jsxs)(hc.Fragment,{children:[n&&(0,hc.jsx)(lc.Z,{color:"primary",sx:{fontSize:"14px",mx:1},children:(0,hc.jsx)(wh.Z,{})}),(0,hc.jsx)(xh.B,Dh({value:t?-1:u},d))]})]}):(0,hc.jsx)(_h.J,{variant:"secondary14",color:"text.secondary"}):(0,hc.jsx)(xh.B,Dh({value:c,onMoreDetailsClick:l},d)):(0,hc.jsx)(xh.B,Dh({withTokenIcon:i,value:u},d))};function Nh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fh(e){for(var t=1;t0)if(l.chainId===zd.a_.mainnet){var h=a.find((function(e){return"AAVE"===e.symbol}));p=h?Number(h.priceInUSD):0}else a.forEach((function(e){e.isWrappedBaseAsset&&(p=Number(e.priceInUSD))}));else p=Number(d.rewardPriceFeed);var m=Number(f)*p;m>0&&(d.assets.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),e.push({assets:d.assets,incentiveControllerAddress:d.incentiveControllerAddress,symbol:d.rewardTokenSymbol,balance:f,balanceUsd:m.toString(),rewardTokenAddress:c}),t+=Number(m))}})),1===e.length)v(e[0].symbol);else if(e.length>1&&!I){var r={assets:n,incentiveControllerAddress:e[0].incentiveControllerAddress,symbol:"all",balance:"0",balanceUsd:t.toString(),rewardTokenAddress:""};v("all"),k(r)}A(e),g(t.toString())}),[]);var S=void 0;"0"===m&&(S=Wh.NOT_ENOUGH_BALANCE);var C=u!==f,I="all"===b?_:x.find((function(e){return e.symbol===b}));return r&&r.blocking?(0,hc.jsx)(jh.D,{txError:r}):n.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"Claimed"}),amount:null===I||void 0===I?void 0:I.balanceUsd}):(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Od.E,{title:"Claim rewards"}),C&&!p&&(0,hc.jsx)(Rd.I,{networkName:T.name,chainId:u}),void 0!==S&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:S===Wh.NOT_ENOUGH_BALANCE?(0,hc.jsx)(sc.cC,{id:"Your reward balance is 0"}):null}),x.length>1&&(0,hc.jsx)(Jh,{rewards:x,selectedReward:b,setSelectedReward:v}),I&&(0,hc.jsxs)(Id.m6,{gasLimit:t,children:["all"===b&&(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Td.X,{caption:(0,hc.jsx)(sc.cC,{id:"Balance"}),captionVariant:"description",align:"flex-start",mb:"all"!==I.symbol?0:4,children:(0,hc.jsx)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:x.map((function(e){return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",mb:4},children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,hc.jsx)(vp.T1,{symbol:e.symbol,sx:{mr:1,fontSize:"16px"}}),(0,hc.jsx)(kd.B,{value:Number(e.balance),variant:"secondary14"}),(0,hc.jsx)(dc.Z,{ml:1,variant:"secondary14",children:e.symbol})]}),(0,hc.jsx)(kd.B,{value:Number(e.balanceUsd),variant:"helperText",compact:!0,symbol:"USD",color:"text.secondary"})]},"claim-".concat(e.symbol))}))})}),(0,hc.jsx)(Id.oD,{description:(0,hc.jsx)(sc.cC,{id:"Total worth"}),value:m})]}),"all"!==b&&(0,hc.jsx)(Id.XJ,{symbol:(0,hc.jsx)(vp.T1,{symbol:I.symbol}),futureValue:I.balance,futureValueUSD:I.balanceUsd,description:(0,hc.jsx)(sc.cC,{id:"{0} Balance",values:{0:I.symbol}})})]}),r&&(0,hc.jsx)(Dd.Q,{txError:r}),(0,hc.jsx)(Kh,{isWrongNetwork:C,selectedReward:null!==I&&void 0!==I?I:{},blocked:void 0!==S})]})},tm=function(){var e=(0,dd.vR)(),t=e.type,n=e.close;return(0,hc.jsx)(pc.P,{open:t===dd.w8.ClaimRewards,setOpen:n,children:(0,hc.jsx)(em,{})})},nm=n(18384),rm=function(e){var t=e.poolReserve,n=e.isWrongNetwork,r=e.usageAsCollateral,i=e.blocked,s=e.symbol,a=(0,bc.Yh)((function(e){return e.setUsageAsCollateral})),c=(0,Vd.Q)({tryPermit:!1,protocolAction:zd.UQ.setUsageAsCollateral,eventTxInfo:{assetName:t.name,asset:t.underlyingAsset,previousState:(!r).toString(),newState:r.toString()},handleGetTxns:function(){var e=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a({reserve:t.underlyingAsset,usageAsCollateral:r}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),skip:i}),u=c.action,l=c.loadingTxns,f=c.mainTxState,p=c.requiresApproval;return(0,hc.jsx)(Gf.B,{requiresApproval:p,blocked:i,preparingTransactions:l,mainTxState:f,isWrongNetwork:n,actionText:r?(0,hc.jsx)(sc.cC,{id:"Enable {symbol} as collateral",values:{symbol:s}}):(0,hc.jsx)(sc.cC,{id:"Disable {symbol} as collateral",values:{symbol:s}}),actionInProgressText:(0,hc.jsx)(sc.cC,{id:"Pending..."}),handleAction:u})};!function(e){e[e.DO_NOT_HAVE_SUPPLIES_IN_THIS_CURRENCY=0]="DO_NOT_HAVE_SUPPLIES_IN_THIS_CURRENCY",e[e.CAN_NOT_USE_THIS_CURRENCY_AS_COLLATERAL=1]="CAN_NOT_USE_THIS_CURRENCY_AS_COLLATERAL",e[e.CAN_NOT_SWITCH_USAGE_AS_COLLATERAL_MODE=2]="CAN_NOT_SWITCH_USAGE_AS_COLLATERAL_MODE",e[e.ZERO_LTV_WITHDRAW_BLOCKED=3]="ZERO_LTV_WITHDRAW_BLOCKED"}(Qh||(Qh={}));var im=function(e){var t=e.poolReserve,n=e.userReserve,r=e.isWrongNetwork,i=e.symbol,o=(0,dd.vR)(),s=o.gasLimit,a=o.mainTxState,c=o.txError,u=(0,ih.HT)().user,l=(0,oh.ov)().debtCeiling,d=!n.usageAsCollateralEnabledOnUser,f=(0,xd.hE)(u.totalCollateralMarketReferenceCurrency),p=!t.isIsolated&&d,h=!t.isIsolated&&!d,m=t.isIsolated&&d,g=t.isIsolated&&!d,y=f[d?"plus":"minus"](n.underlyingBalanceMarketReferenceCurrency),b=(0,eh.L1)({collateralBalanceMarketReferenceCurrency:y,borrowBalanceMarketReferenceCurrency:u.totalBorrowsMarketReferenceCurrency,currentLiquidationThreshold:u.currentLiquidationThreshold}),v=(0,Vf.Vc)(u),w=void 0;v.length>0&&!v.includes(t.symbol)?w=Qh.ZERO_LTV_WITHDRAW_BLOCKED:(0,xd.hE)(n.underlyingBalance).eq(0)?w=Qh.DO_NOT_HAVE_SUPPLIES_IN_THIS_CURRENCY:!n.usageAsCollateralEnabledOnUser&&"0"===t.reserveLiquidationThreshold||"0"===t.reserveLiquidationThreshold?w=Qh.CAN_NOT_USE_THIS_CURRENCY_AS_COLLATERAL:n.usageAsCollateralEnabledOnUser&&"0"!==u.totalBorrowsMarketReferenceCurrency&&b.lte("1")&&(w=Qh.CAN_NOT_SWITCH_USAGE_AS_COLLATERAL_MODE);var x=function(){switch(w){case Qh.DO_NOT_HAVE_SUPPLIES_IN_THIS_CURRENCY:return(0,hc.jsx)(sc.cC,{id:"You do not have supplies in this currency"});case Qh.CAN_NOT_USE_THIS_CURRENCY_AS_COLLATERAL:return(0,hc.jsx)(sc.cC,{id:"You can not use this currency as collateral"});case Qh.CAN_NOT_SWITCH_USAGE_AS_COLLATERAL_MODE:return(0,hc.jsx)(sc.cC,{id:"You can not switch usage as collateral mode for this currency, because it will cause collateral call"});case Qh.ZERO_LTV_WITHDRAW_BLOCKED:return(0,hc.jsx)(sc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:v}});default:return null}};return a.success?(0,hc.jsx)(lh.R,{collateral:d,symbol:t.symbol}):(0,hc.jsxs)(hc.Fragment,{children:[p&&(0,hc.jsx)(Sd.v,{severity:"warning",icon:!1,sx:{mb:3},children:(0,hc.jsx)(sc.cC,{id:"Enabling this asset as collateral increases your borrowing power and Health Factor. However, it can get liquidated if your health factor drops below 1."})}),h&&(0,hc.jsx)(Sd.v,{severity:"warning",icon:!1,sx:{mb:3},children:(0,hc.jsx)(sc.cC,{id:"Disabling this asset as collateral affects your borrowing power and Health Factor."})}),m&&(0,hc.jsx)(nm.i,{asset:t.symbol}),g&&(0,hc.jsx)(Sd.v,{severity:"info",icon:!1,sx:{mb:3},children:(0,hc.jsx)(sc.cC,{id:"You will exit isolation mode and other tokens can now be used as collateral"})}),t.isIsolated&&l.determineWarningDisplay({debtCeiling:l}),(0,hc.jsxs)(Id.m6,{gasLimit:s,children:[(0,hc.jsx)(Id.oD,{symbol:t.symbol,iconSymbol:t.iconSymbol,description:(0,hc.jsx)(sc.cC,{id:"Supply balance"}),value:n.underlyingBalance}),(0,hc.jsx)(Id.jz,{visibleHfChange:!0,healthFactor:u.healthFactor,futureHealthFactor:b.toString(10)})]}),void 0!==w&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(x,{})}),c&&(0,hc.jsx)(Dd.Q,{txError:c}),(0,hc.jsx)(rm,{symbol:i,poolReserve:t,usageAsCollateral:d,isWrongNetwork:r,blocked:void 0!==w})]})};function om(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var sm=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.CollateralChange,setOpen:n,children:(0,hc.jsx)(Jp.A,{title:(0,hc.jsx)(sc.cC,{id:"Review tx"}),underlyingAsset:r.underlyingAsset,children:function(e){return(0,hc.jsx)(im,function(e){for(var t=1;t{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${(0,gm.Z)(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})((({theme:e,ownerState:t})=>(0,dm.Z)({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},"primary"===t.color&&{color:(e.vars||e).palette.primary.main},"inherit"===t.color&&{color:"inherit"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.inset&&{paddingLeft:72},!t.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper})));var xm=ec.forwardRef((function(e,t){const n=(0,mm.Z)({props:e,name:"MuiListSubheader"}),{className:r,color:i="default",component:o="li",disableGutters:s=!1,disableSticky:a=!1,inset:c=!1}=n,u=(0,lm.Z)(n,vm),l=(0,dm.Z)({},n,{color:i,component:o,disableGutters:s,disableSticky:a,inset:c}),d=(e=>{const{classes:t,color:n,disableGutters:r,inset:i,disableSticky:o}=e,s={root:["root","default"!==n&&`color${(0,gm.Z)(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return(0,pm.Z)(s,bm,t)})(l);return(0,hc.jsx)(wm,(0,dm.Z)({as:o,className:(0,fm.default)(d.root,r),ref:t,ownerState:l},u))})),Am=n(70794),Em=n(91655),_m=n(58527),km=["loading","outputAmountUSD","inputAmountUSD"];function Tm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sm(e){for(var t=1;tSlippage tolerance <1>{selectedSlippage}% <2>{0}",values:{0:c?(0,hc.jsx)(Im.Z,{}):(0,hc.jsx)(Bd.Z,{}),selectedSlippage:n},components:{0:(0,hc.jsx)(dc.Z,{color:"text.secondary",variant:"description"}),1:(0,hc.jsx)(dc.Z,{color:"text.main",variant:"secondary14",sx:{px:"4px"}}),2:(0,hc.jsx)(lc.Z,{sx:{fontSize:"14px !important",mr:"4px"}})}})}),variant:"secondary14"}),disabled:!1,"data-cy":"slippageButton_".concat(n),sx:{mt:6}}),(0,hc.jsxs)(gp.Z,{anchorEl:o,open:c,onClose:l,MenuListProps:{"aria-labelledby":"basic-button"},keepMounted:!0,"data-cy":"slippageMenu_".concat(n),children:[(0,hc.jsx)(uc.Z,{sx:{px:"16px",py:"12px"},children:(0,hc.jsx)(dc.Z,{variant:"secondary12",color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Select slippage tolerance"})})}),["0.1","0.5","1"].map((function(e){var r=e===n;return(0,hc.jsxs)(Fd.Z,{selected:r,value:e,onClick:function(){t(e),u(wc.vh.SET_SLIPPAGE,{amount:e}),l()},children:[(0,hc.jsxs)(yp.Z,{primaryTypographyProps:{variant:"subheader1"},children:[e,"%"]}),(0,hc.jsx)(Rm.Z,{children:(0,hc.jsx)(lc.Z,{children:r&&(0,hc.jsx)(Om.Z,{})})})]},e)})),(0,hc.jsx)(Xh.Z,{}),(0,hc.jsxs)(uc.Z,{sx:{px:"16px",py:"12px",display:"inline-flex",alignItems:"center"},children:[(0,hc.jsxs)(dc.Z,{variant:"secondary12",color:"text.secondary",sx:{display:"flex",alignItems:"center"},children:[(0,hc.jsx)(sc.cC,{id:"Powered by"}),(0,hc.jsx)(lc.Z,{sx:{fontSize:"20px",width:"20px",color:"#2669F5",position:"relative",top:"5px",left:"5px"},children:(0,hc.jsx)(Lm,{})})]}),(0,hc.jsx)(dc.Z,{variant:"main12",color:"text.secondary",children:"Paraswap"})]})]})]})};function Um(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zm(e){for(var t=1;tNumber(c.availableBorrowsUSD),$=void 0;(0,Am.Z)(N).gt(z)&&($=Hm.INSUFFICIENT_LIQUIDITY);var K=function(){return $===Hm.INSUFFICIENT_LIQUIDITY?(0,hc.jsx)(sc.cC,{id:"There is not enough liquidity for the target asset to perform the switch. Try lowering the amount."}):null};return g.success?(0,hc.jsx)(lh.R,{customAction:(0,hc.jsxs)(um.Z,{gap:3,children:[(0,hc.jsx)(dc.Z,{variant:"description",color:"text.primary",children:(0,hc.jsx)(sc.cC,{id:"You've successfully switched borrow position."})}),(0,hc.jsxs)(um.Z,{direction:"row",alignItems:"center",justifyContent:"center",gap:1,children:[(0,hc.jsx)(vp.T1,{symbol:t.iconSymbol,sx:{mx:1}}),(0,hc.jsx)(kd.B,{value:E.current,compact:!0,variant:"subheader1"}),t.symbol,(0,hc.jsx)(lc.Z,{color:"primary",sx:{fontSize:"14px",mx:1},children:(0,hc.jsx)(wh.Z,{})}),(0,hc.jsx)(vp.T1,{symbol:O.reserve.symbol,sx:{mx:1}}),(0,hc.jsx)(kd.B,{value:M,compact:!0,variant:"subheader1"}),O.reserve.symbol]})]})}):(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uh.W,{value:P,onChange:function(e){var t="-1"===e;E.current=t?R:e,A(e),b(void 0)},usdValue:G.toString(),symbol:t.symbol,assets:[{balance:R,address:t.underlyingAsset,symbol:t.symbol,iconSymbol:t.iconSymbol}],maxValue:R,inputTitle:(0,hc.jsx)(sc.cC,{id:"Borrowed asset amount"}),balanceText:(0,hc.jsx)(ec.Fragment,{children:(0,hc.jsx)(sc.cC,{id:"Borrow balance"})}),isMaxSelected:D}),(0,hc.jsxs)(uc.Z,{sx:{padding:"18px",pt:"14px",display:"flex",justifyContent:"space-between"},children:[(0,hc.jsx)(lc.Z,{sx:{fontSize:"18px !important"},children:(0,hc.jsx)(cm,{})}),(0,hc.jsx)(Cm,{loading:Z,outputAmountUSD:V.toString(),inputAmountUSD:G.toString()})]}),(0,hc.jsx)(uh.W,{value:M,onSelect:T,usdValue:V.toString(),symbol:k.symbol,assets:v,inputTitle:(0,hc.jsx)(sc.cC,{id:"Switch to"}),balanceText:(0,hc.jsx)(sc.cC,{id:"Supply balance"}),disableInput:!0,loading:Z,selectOptionHeader:(0,hc.jsx)($m,{}),selectOption:function(e){return(0,hc.jsx)(Km,{asset:e})}}),L&&!Z&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:L}),!L&&void 0!==$&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(K,{})}),(0,hc.jsx)(Id.m6,{gasLimit:m,slippageSelector:(0,hc.jsx)(jm,{selectedSlippage:C,setSlippage:function(e){b(void 0),I(e)}}),children:(0,hc.jsx)(Gm,{switchSource:n,switchTarget:O,toAmount:M,fromAmount:""===P?"0":P,loading:Z,sourceBalance:R,sourceBorrowAPY:i===zd.tk.Variable?t.variableBorrowAPY:t.stableBorrowAPY,targetBorrowAPY:O.reserve.variableBorrowAPY,showAPYTypeChange:i===zd.tk.Stable})}),y&&(0,hc.jsx)(Pd,{txError:y}),q&&(0,hc.jsx)(Sd.v,{severity:"error",sx:{mt:4},children:(0,hc.jsx)(dc.Z,{variant:"caption",children:(0,hc.jsx)(sc.cC,{id:"Insufficient collateral to cover new borrow position. Wallet must have borrowing power remaining to perform debt switch."})})}),(0,hc.jsx)(zm,{isMaxSelected:D,poolReserve:t,amountToSwap:N,amountToReceive:M,isWrongNetwork:r,targetReserve:O.reserve,symbol:t.symbol,blocked:void 0!==$||""!==L||q,loading:j,buildTxFn:U,currentRateMode:i===zd.tk.Variable?2:1})]})},$m=function(){return(0,hc.jsx)(xm,{sx:function(e){return{borderBottom:"1px solid ".concat(e.palette.divider),mt:-1}},children:(0,hc.jsxs)(um.Z,{direction:"row",sx:{py:4},gap:14,children:[(0,hc.jsx)(dc.Z,{variant:"subheader2",children:(0,hc.jsx)(sc.cC,{id:"Select an asset"})}),(0,hc.jsx)(dc.Z,{variant:"subheader2",children:(0,hc.jsx)(sc.cC,{id:"Borrow APY, variable"})})]})})},Km=function(e){var t=e.asset;return(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(vp.T1,{aToken:t.aToken,symbol:t.iconSymbol||t.symbol,sx:{fontSize:"22px",mr:1}}),(0,hc.jsx)(yp.Z,{sx:{mr:6},children:t.symbol}),(0,hc.jsx)(kd.B,{value:t.variableApy,percent:!0,variant:"secondary14",color:"text.secondary"})]})};function Ym(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xm(e){for(var t=1;tNumber(V.amount)+.05*Number(V.amount))&&(h({success:!1}),w(void 0)),Number(l[1])0&&!fe.includes(A.symbol)?pe=Vf.NI.ZERO_LTV_WITHDRAW_BLOCKED:(0,xd.hE)(_).lt(q)&&(pe=Vf.NI.NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH);var he=function(){switch(pe){case Vf.NI.NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH:return(0,hc.jsx)(sc.cC,{id:"Not enough collateral to repay this amount of debt with"});case Vf.NI.ZERO_LTV_WITHDRAW_BLOCKED:return(0,hc.jsx)(sc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:fe}});default:return null}};return m.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"Repaid"}),amount:$,symbol:t.symbol}):(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uh.W,{value:le,onChange:ee,usdValue:de,symbol:t.symbol,assets:[{address:t.underlyingAsset,symbol:t.symbol,iconSymbol:t.iconSymbol,balance:N}],isMaxSelected:L,maxValue:N,inputTitle:(0,hc.jsx)(sc.cC,{id:"Expected amount to repay"}),balanceText:(0,hc.jsx)(sc.cC,{id:"Borrow balance"})}),(0,hc.jsxs)(uc.Z,{sx:{padding:"18px",pt:"14px",display:"flex",justifyContent:"space-between"},children:[(0,hc.jsx)(lc.Z,{sx:{fontSize:"18px !important"},children:(0,hc.jsx)(cm,{})}),(0,hc.jsx)(Cm,{loading:Q,outputAmountUSD:K,inputAmountUSD:W})]}),(0,hc.jsx)(uh.W,{value:"exactOut"===T?q:_,usdValue:W,symbol:A.symbol,assets:w,onSelect:E,onChange:ee,inputTitle:(0,hc.jsx)(sc.cC,{id:"Collateral to repay with"}),balanceText:(0,hc.jsx)(sc.cC,{id:"Borrow balance"}),maxValue:_,loading:Q,disableInput:!0}),X&&!Q&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:X}),void 0!==pe&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(he,{})}),(0,hc.jsxs)(Id.m6,{gasLimit:p,slippageSelector:(0,hc.jsx)(jm,{selectedSlippage:D,setSlippage:P}),children:[(0,hc.jsx)(Id.jz,{visibleHfChange:"exactOut"===T?!!I:!!q,healthFactor:null===c||void 0===c?void 0:c.healthFactor,futureHealthFactor:re.toString(10),loading:Q}),(0,hc.jsx)(Id.XJ,{description:(0,hc.jsx)(sc.cC,{id:"Borrow balance after repay"}),futureValue:se.toString(),futureValueUSD:ae.toString(),symbol:n,tokenIcon:t.iconSymbol,loading:Q,hideSymbolSuffix:!0}),(0,hc.jsx)(Id.XJ,{description:(0,hc.jsx)(sc.cC,{id:"Collateral balance after repay"}),futureValue:ce.toString(),futureValueUSD:ue.toString(),symbol:A.symbol,tokenIcon:A.iconSymbol,loading:Q,hideSymbolSuffix:!0})]}),h&&(0,hc.jsx)(Pd,{txError:h}),(0,hc.jsx)(gg,{poolReserve:t,fromAssetData:M,repayAmount:$,repayWithAmount:q,repayAllDebt:G,useFlashLoan:oe,isWrongNetwork:s,symbol:n,rateMode:r,blocked:void 0!==pe||""!==X,loading:Y,buildTxFn:J})]})}var wg=n(84707),xg=["amountToRepay","poolReserve","poolAddress","isWrongNetwork","sx","symbol","debtType","repayWithATokens","blocked"];function Ag(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Eg(e){for(var t=1;t0,ee=null===b||void 0===b?void 0:b.healthFactor;if(Y){var te=(null===b||void 0===b?void 0:b.totalCollateralUSD)||"0";G&&H&&(te=(0,xd.hE)((null===b||void 0===b?void 0:b.totalCollateralUSD)||"0").minus((0,xd.hE)(z.priceInUSD).multipliedBy(Y)));var ne=(0,xd.hE)((null===b||void 0===b?void 0:b.totalBorrowsUSD)||"0").minus((0,xd.hE)(z.priceInUSD).multipliedBy(Y)),re=Am.Z.max(ne,0),ie=(0,eh.L1)({collateralBalanceMarketReferenceCurrency:te,borrowBalanceMarketReferenceCurrency:re,currentLiquidationThreshold:(null===b||void 0===b?void 0:b.currentLiquidationThreshold)||"0"});ee=ie.isLessThan(0)&&!ie.eq(-1)?"0":ie.toString(10)}var oe=(0,xd.hE)(Y).multipliedBy(z.priceInUSD);return h.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"repaid"}),amount:j.current,symbol:C.symbol}):(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uh.W,{value:Y,onChange:function(e){var t="-1"===e;j.current=t?n.toString(10):e,L(e),t&&(G||n.eq(V))?C.address===fd.hP.toLowerCase()||wg.U[w]&&wg.U[w].toLowerCase()===z.underlyingAsset.toLowerCase()?M(q.toString(10)):M("-1"):M(q.lt(r)?q.toString(10):n.toString(10))},usdValue:oe.toString(10),symbol:C.symbol,assets:R,onSelect:I,isMaxSelected:K,maxValue:n.toString(10),balanceText:(0,hc.jsx)(sc.cC,{id:"Wallet balance"})}),Q&&(0,hc.jsx)(dc.Z,{color:"warning.main",variant:"helperText",children:(0,hc.jsx)(sc.cC,{id:"You don\u2019t have enough funds in your wallet to repay the full amount. If you proceed to repay with your current amount of funds, you will still have a small borrowing position in your dashboard."})}),(0,hc.jsxs)(Id.m6,{gasLimit:p,children:[(0,hc.jsx)(Id.XJ,{description:(0,hc.jsx)(sc.cC,{id:"Remaining debt"}),futureValue:X,futureValueUSD:J.toString(10),value:V,valueUSD:W.toString(),symbol:i.iconSymbol===U.wrappedBaseAssetSymbol?U.baseAssetSymbol:i.iconSymbol}),(0,hc.jsx)(Id.jz,{visibleHfChange:!!F,healthFactor:null===b||void 0===b?void 0:b.healthFactor,futureHealthFactor:ee})]}),m&&(0,hc.jsx)(Dd.Q,{txError:m}),(0,hc.jsx)(kg,{poolReserve:i,amountToRepay:K?B:Y,poolAddress:G?i.underlyingAsset:null!==(t=C.address)&&void 0!==t?t:"",isWrongNetwork:l,symbol:a,debtType:d,repayWithATokens:G})]})};function Sg(e){var t,n=e.repayType,r=e.setRepayType,i=(0,Xp.f)().currentMarketData,o=(0,bc.Yh)((function(e){return e.trackEvent}));return null!==(t=i.enabledFeatures)&&void 0!==t&&t.collateralRepay?(0,hc.jsxs)(uc.Z,{sx:{mb:6},children:[(0,hc.jsx)(dc.Z,{mb:1,color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Repay with"})}),(0,hc.jsxs)(rh.f,{color:"primary",value:n,exclusive:!0,onChange:function(e,t){return r(t)},children:[(0,hc.jsx)(nh.Y,{value:_g.BALANCE,disabled:n===_g.BALANCE,onClick:function(){return o(wc.rQ.SWITCH_REPAY_TYPE,{repayType:"Wallet Balance"})},children:(0,hc.jsx)(dc.Z,{variant:"buttonM",children:(0,hc.jsx)(sc.cC,{id:"Wallet balance"})})}),(0,hc.jsx)(nh.Y,{value:_g.COLLATERAL,disabled:n===_g.COLLATERAL,onClick:function(){return o(wc.rQ.SWITCH_REPAY_TYPE,{repayType:"Collateral"})},children:(0,hc.jsx)(dc.Z,{variant:"buttonM",children:(0,hc.jsx)(sc.cC,{id:"Collateral"})})})]})]}):null}function Cg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ig(e){for(var t=1;tNumber(F):Number(E)Number((0,xd.Fv)(M.toString(),Number(B.feeTokendecimals)))}return!1}),[E,B,D,M]);l&&(!l.isInIsolationMode&&!r.isIsolated||l.isInIsolationMode&&(null===(t=l.isolatedReserve)||void 0===t?void 0:t.underlyingAsset)===r.underlyingAsset)&&(J=(0,eh.L1)({collateralBalanceMarketReferenceCurrency:K,borrowBalanceMarketReferenceCurrency:(0,xd.hE)(l.totalBorrowsMarketReferenceCurrency),currentLiquidationThreshold:Y}));var ee=l.userReservesData.find((function(e){return e.usageAsCollateralEnabledOnUser&&e.reserve.id!==r.id})),te=!l.isInIsolationMode&&r.isIsolated&&!ee&&(!i||"0"===i.underlyingBalance||i.usageAsCollateralEnabledOnUser),ne={address:r.aTokenAddress,symbol:r.iconSymbol,decimals:r.decimals,aToken:!0},re=(0,Vf.yI)(i,l.totalCollateralUSD,l.isInIsolationMode,w.isMaxed),ie={amountToSupply:E,feeTokenAddress:T,isWrongNetwork:o,txHash:I,setTxHash:O,poolAddress:N?fd.hP:r.underlyingAsset,symbol:N?p.baseAssetSymbol:r.symbol,blocked:!1,decimals:r.decimals,isPaymaster:D,isBalanceSufficient:Q};return m.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"Supplied"}),amount:E,symbol:N?p.baseAssetSymbol:r.symbol,addToken:ne}):(0,hc.jsxs)(hc.Fragment,{children:[te&&(0,hc.jsx)(nm.i,{asset:r.symbol}),v.determineWarningDisplay({supplyCap:v}),w.determineWarningDisplay({debtCeiling:w}),"AMPL"===r.symbol&&(0,hc.jsx)(Sd.v,{sx:{mt:"16px",mb:"40px"},severity:"warning",children:(0,hc.jsx)(Rg.v,{})}),"true"===zg.env.NEXT_PUBLIC_ENABLE_STAKING&&"AAVE"===r.symbol&&oc.cr.staking(f)&&(0,hc.jsx)(Pg,{}),"SNX"===r.symbol&&"0"!==V&&(0,hc.jsx)(Bg,{}),(0,hc.jsx)(uh.W,{value:E,onChange:function(e){if("-1"===e)_(V);else{var t=(0,ah.$w)(e,r.decimals);_(t)}},usdValue:q.toString(10),symbol:N?p.baseAssetSymbol:r.symbol,assets:[{balance:V,symbol:N?p.baseAssetSymbol:r.symbol,iconSymbol:N?p.baseAssetSymbol:r.iconSymbol}],capType:ch.R.supplyCap,isMaxSelected:X,disabled:m.loading,maxValue:V,balanceText:(0,hc.jsx)(sc.cC,{id:"Wallet balance"}),event:{eventName:wc.vh.MAX_INPUT_SELECTION,eventParams:{asset:r.underlyingAsset,assetName:r.name}}}),(0,hc.jsxs)(Id.m6,{gasLimit:g,skipLoad:!0,disabled:0===Number(E),gaslessPossible:null===oc.cr||void 0===oc.cr?void 0:oc.cr.gasless(f),setFeeTokenAddress:S,paymasterData:B,amountInUsd:$,setPaymasterDisable:P,children:[(0,hc.jsx)(Id.oD,{description:(0,hc.jsx)(sc.cC,{id:"Supply APY"}),value:L,percent:!0}),(0,hc.jsx)(Id.aE,{incentives:r.aIncentivesData,symbol:r.symbol}),(0,hc.jsx)(Id.Bx,{collateralType:re}),(0,hc.jsx)(Id.jz,{visibleHfChange:!!E,healthFactor:l?l.healthFactor:"-1",futureHealthFactor:J.toString(10)})]}),y&&(0,hc.jsx)(Dd.Q,{txError:y}),(0,hc.jsx)(Ug,Vg({},ie))]})}));function qg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var $g=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.Supply,setOpen:n,children:(0,hc.jsx)(Jp.A,{action:"supply",title:(0,hc.jsx)(sc.cC,{id:"Supply"}),underlyingAsset:r.underlyingAsset,requiredPermission:Yp.g.DEPOSITOR,children:function(e){return(0,hc.jsx)(Wg,function(e){for(var t=1;t0&&!$.includes(t.symbol)?K=Vf.NI.ZERO_LTV_WITHDRAW_BLOCKED:!W.eq("-1")&&q.lt(F)?K=Vf.NI.SUPPLY_CAP_REACHED:!z.eq("-1")&&z.lt("1.01")&&(K=Vf.NI.HF_BELOW_ONE);var Y=function(){switch(K){case Vf.NI.SUPPLY_CAP_REACHED:return(0,hc.jsx)(sc.cC,{id:"Supply cap on target reserve reached. Try lowering the amount."});case Vf.NI.HF_BELOW_ONE:return(0,hc.jsx)(sc.cC,{id:"The effects on the health factor would cause liquidation. Try lowering the amount."});case Vf.NI.ZERO_LTV_WITHDRAW_BLOCKED:return(0,hc.jsx)(sc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:$}});default:return null}};if(g.success)return(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"Switched"}),amount:A.current,symbol:t.symbol});var X=a&&"0"!==a.totalBorrowsMarketReferenceCurrency&&"0"!==t.reserveLiquidationThreshold,J=(0,oh.wD)(I.reserve).debtCeilingReached,Q=(0,Vf.yI)(n,a.totalCollateralUSD,a.isInIsolationMode,J),ee=(0,oh.wD)(I.reserve).debtCeilingReached,te=(0,Vf.yI)(I,a.totalCollateralUSD,a.isInIsolationMode,ee);if(R&&Q===Yg.z.ISOLATED_ENABLED&&"0"===I.underlyingBalance&&(te=I.reserve.isIsolated?Yg.z.ISOLATED_ENABLED:Yg.z.ENABLED),R&&Q===Yg.z.ENABLED&&"0"===I.underlyingBalance&&I.reserve.isIsolated){var ne=a.userReservesData.filter((function(e){return e.usageAsCollateralEnabledOnUser}));1===ne.length&&ne[0].underlyingAsset===n.underlyingAsset&&(te=Yg.z.ISOLATED_ENABLED)}return(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uh.W,{value:D,onChange:function(e){var t="-1"===e;A.current=t?O:e,x(e)},usdValue:B,symbol:t.iconSymbol,assets:[{balance:O,address:t.underlyingAsset,symbol:t.symbol,iconSymbol:t.iconSymbol}],maxValue:O,inputTitle:(0,hc.jsx)(sc.cC,{id:"Supplied asset amount"}),balanceText:(0,hc.jsx)(sc.cC,{id:"Supply balance"}),isMaxSelected:R}),(0,hc.jsxs)(uc.Z,{sx:{padding:"18px",pt:"14px",display:"flex",justifyContent:"space-between"},children:[(0,hc.jsx)(lc.Z,{sx:{fontSize:"18px !important"},children:(0,hc.jsx)(Ad,{})}),(0,hc.jsx)(Cm,{loading:Z,outputAmountUSD:F,inputAmountUSD:B})]}),(0,hc.jsx)(uh.W,{value:N,onSelect:k,usdValue:F,symbol:_.symbol,assets:b,inputTitle:(0,hc.jsx)(sc.cC,{id:"Switch to"}),balanceText:(0,hc.jsx)(sc.cC,{id:"Supply balance"}),disableInput:!0,loading:Z}),L&&!Z&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:L}),!L&&void 0!==K&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(Y,{})}),"stETH"===I.reserve.symbol&&(0,hc.jsx)(Sd.v,{severity:"warning",sx:{mt:2,mb:0},children:(0,hc.jsx)(Kg.O,{})}),(0,hc.jsx)(Id.m6,{gasLimit:m,slippageSelector:(0,hc.jsx)(jm,{selectedSlippage:S,setSlippage:C}),children:(0,hc.jsx)(ty,{showHealthFactor:X,healthFactor:null===a||void 0===a?void 0:a.healthFactor,healthFactorAfterSwap:z.toString(10),swapSource:ry(ry({},n),{},{collateralType:Q}),swapTarget:ry(ry({},I),{},{collateralType:te}),toAmount:N,fromAmount:""===D?"0":D,loading:Z})}),y&&(0,hc.jsx)(Pd,{txError:y}),(0,hc.jsx)(Qg,{isMaxSelected:R,poolReserve:t,amountToSwap:M,amountToReceive:N,isWrongNetwork:r,targetReserve:I.reserve,symbol:t.symbol,blocked:void 0!==K||""!==L||"stETH"===I.reserve.symbol,useFlashLoan:V,loading:j,buildTxFn:U})]})};function oy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var sy,ay=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.Swap,setOpen:n,children:(0,hc.jsx)(Jp.A,{title:(0,hc.jsx)(sc.cC,{id:"Switch"}),underlyingAsset:r.underlyingAsset,children:function(e){return(0,hc.jsx)(iy,function(e){for(var t=1;t=1&&j.toNumber()<1.5&&n.usageAsCollateralEnabledOnUser,z=void 0;l.success||l.txHash||(U.length>0&&!U.includes(t.symbol)?z=sy.ZERO_LTV_WITHDRAW_BLOCKED:j.lt("1")&&"0"!==f.totalBorrowsMarketReferenceCurrency?z=sy.CAN_NOT_WITHDRAW_THIS_AMOUNT:z||!O.eq("0")&&!(0,xd.hE)(N).gt(t.unborrowedLiquidity)||(z=sy.POOL_DOES_NOT_HAVE_ENOUGH_LIQUIDITY));var G=function(){switch(z){case sy.CAN_NOT_WITHDRAW_THIS_AMOUNT:return(0,hc.jsx)(sc.cC,{id:"You can not withdraw this amount because it will cause collateral call"});case sy.POOL_DOES_NOT_HAVE_ENOUGH_LIQUIDITY:return(0,hc.jsx)(sc.cC,{id:"These funds have been borrowed and are not available for withdrawal at this time."});case sy.ZERO_LTV_WITHDRAW_BLOCKED:return(0,hc.jsx)(sc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:U}});default:return null}},V=(0,xd.hE)(N).multipliedBy((null===n||void 0===n?void 0:n.reserve.priceInUSD)||0);return l.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"withdrew"}),amount:E.current,symbol:r&&t.isWrappedBaseAsset?p.baseAssetSymbol:t.symbol}):(0,hc.jsxs)(uc.Z,{position:"relative",children:[!S&&(0,hc.jsxs)(uc.Z,{position:"absolute",zIndex:2,bgcolor:"#FFFFFF10",height:"100%",padding:"24px",sx:{backdropFilter:"blur(6px)"},children:[(0,hc.jsx)(dc.Z,{variant:"h2",textAlign:"center",children:"If you withdraw, you will stop earning future yields and points."}),(0,hc.jsxs)(uc.Z,{display:"flex",flexDirection:"column",mt:6,children:[(0,hc.jsx)(fc.Z,{variant:"contained",sx:{marginBottom:4},onClick:function(){return a(!1)},children:"Keep Earning"}),(0,hc.jsx)(fc.Z,{variant:"outlined",onClick:function(){console.log("change",S),C(!0),localStorage.setItem("dontShowWithdrawWarning","true")},children:"Withdraw Anyway"})]})]}),(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uh.W,{value:N,onChange:function(e){var t="-1"===e;E.current=t?R.toString(10):e,g(e),t&&R.eq(I)?(_(wc.vh.MAX_INPUT_SELECTION,{type:"withdraw"}),v("-1")):v(R.toString(10))},symbol:o,assets:[{balance:R.toString(10),symbol:o,iconSymbol:r&&t.isWrappedBaseAsset?p.baseAssetSymbol:t.iconSymbol}],usdValue:V.toString(10),isMaxSelected:M,disabled:l.loading,maxValue:R.toString(10),balanceText:O.lt(I)?(0,hc.jsx)(sc.cC,{id:"Available"}):(0,hc.jsx)(sc.cC,{id:"Supply balance"})}),void 0!==z&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(G,{})}),t.isWrappedBaseAsset&&(0,hc.jsx)(Id.Pu,{unwrapped:r,setUnWrapped:i,label:(0,hc.jsx)(dc.Z,{children:"Unwrap ".concat(t.symbol," (to withdraw ").concat(p.baseAssetSymbol,")")})}),(0,hc.jsxs)(Id.m6,{gasLimit:u,children:[(0,hc.jsx)(Id.oD,{description:(0,hc.jsx)(sc.cC,{id:"Remaining supply"}),value:I.minus(N||"0").toString(10),symbol:t.isWrappedBaseAsset?p.baseAssetSymbol:t.symbol}),(0,hc.jsx)(Id.jz,{visibleHfChange:!!m,healthFactor:f?f.healthFactor:"-1",futureHealthFactor:j.toString(10)})]}),d&&(0,hc.jsx)(Dd.Q,{txError:d}),H&&(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Sd.v,{severity:"error",sx:{my:6},children:(0,hc.jsx)(sc.cC,{id:"Withdrawing this amount will reduce your health factor and increase risk of liquidation."})}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",mx:"24px",mb:"12px"},children:[(0,hc.jsx)(gh.Z,{checked:x,onChange:function(){A(!x),_(wc.vh.ACCEPT_RISK,{modal:"Withdraw",riskCheckboxAccepted:x})},size:"small","data-cy":"risk-checkbox"}),(0,hc.jsx)(dc.Z,{variant:"description",children:(0,hc.jsx)(sc.cC,{id:"I acknowledge the risks involved."})})]})]}),(0,hc.jsx)(cy,{poolReserve:t,amountToWithdraw:M?b:N,poolAddress:r&&t.isWrappedBaseAsset?fd.hP:t.underlyingAsset,isWrongNetwork:s,symbol:o,blocked:void 0!==z||H&&!x,sx:H?{mt:0}:{}})]})]})};function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dy(e){for(var t=1;t0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Ey(e){if("function"!==typeof e||"function"!==typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");xy(e.outputLen),xy(e.blockLen)}function _y(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ky(e,t){Ay(e);const n=t.outputLen;if(e.lengthnew DataView(e.buffer,e.byteOffset,e.byteLength),Cy=(e,t)=>e<<32-t|e>>>t,Iy=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],Oy=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Ry(e){for(let t=0;te().update(Py(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Fy(e=32){if(Ty&&"function"===typeof Ty.getRandomValues)return Ty.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const Ly=(e,t,n)=>e&t^e&n^t&n;class jy extends My{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Sy(this.buffer)}update(e){_y(this);const{view:t,buffer:n,blockLen:r}=this,i=(e=Py(e)).length;for(let o=0;or-o&&(this.process(n,0),o=0);for(let l=o;l>i&o),a=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,s,r),e.setUint32(t+u,a,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);const s=Sy(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l>Zy&Uy)}:{h:0|Number(e>>Zy&Uy),l:0|Number(e&Uy)}}function zy(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;ie<>>32-n,Vy=(e,t,n)=>t<>>32-n,Wy=(e,t,n)=>t<>>64-n,qy=(e,t,n)=>e<>>64-n;var $y={fromBig:Hy,split:zy,toBig:(e,t)=>BigInt(e>>>0)<>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:Gy,rotlSL:Vy,rotlBH:Wy,rotlBL:qy,add:function(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,add5H:(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0,add5L:(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0)};const[Ky,Yy]=(()=>$y.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),Xy=new Uint32Array(80),Jy=new Uint32Array(80);class Qy extends jy{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:p,Hh:h,Hl:m}=this;return[e,t,n,r,i,o,s,a,c,u,l,d,f,p,h,m]}set(e,t,n,r,i,o,s,a,c,u,l,d,f,p,h,m){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|p,this.Hh=0|h,this.Hl=0|m}process(e,t){for(let b=0;b<16;b++,t+=4)Xy[b]=e.getUint32(t),Jy[b]=e.getUint32(t+=4);for(let b=16;b<80;b++){const e=0|Xy[b-15],t=0|Jy[b-15],n=$y.rotrSH(e,t,1)^$y.rotrSH(e,t,8)^$y.shrSH(e,t,7),r=$y.rotrSL(e,t,1)^$y.rotrSL(e,t,8)^$y.shrSL(e,t,7),i=0|Xy[b-2],o=0|Jy[b-2],s=$y.rotrSH(i,o,19)^$y.rotrBH(i,o,61)^$y.shrSH(i,o,6),a=$y.rotrSL(i,o,19)^$y.rotrBL(i,o,61)^$y.shrSL(i,o,6),c=$y.add4L(r,a,Jy[b-7],Jy[b-16]),u=$y.add4H(c,n,s,Xy[b-7],Xy[b-16]);Xy[b]=0|u,Jy[b]=0|c}let{Ah:n,Al:r,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:d,Fh:f,Fl:p,Gh:h,Gl:m,Hh:g,Hl:y}=this;for(let b=0;b<80;b++){const e=$y.rotrSH(l,d,14)^$y.rotrSH(l,d,18)^$y.rotrBH(l,d,41),t=$y.rotrSL(l,d,14)^$y.rotrSL(l,d,18)^$y.rotrBL(l,d,41),v=l&f^~l&h,w=d&p^~d&m,x=$y.add5L(y,t,w,Yy[b],Jy[b]),A=$y.add5H(x,g,e,v,Ky[b],Xy[b]),E=0|x,_=$y.rotrSH(n,r,28)^$y.rotrBH(n,r,34)^$y.rotrBH(n,r,39),k=$y.rotrSL(n,r,28)^$y.rotrBL(n,r,34)^$y.rotrBL(n,r,39),T=n&i^n&s^i&s,S=r&o^r&a^o&a;g=0|h,y=0|m,h=0|f,m=0|p,f=0|l,p=0|d,({h:l,l:d}=$y.add(0|c,0|u,0|A,0|E)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|n,o=0|r;const C=$y.add3L(E,k,S);n=$y.add3H(C,A,_,T),r=0|C}({h:n,l:r}=$y.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:o}=$y.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=$y.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=$y.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:d}=$y.add(0|this.Eh,0|this.El,0|l,0|d)),({h:f,l:p}=$y.add(0|this.Fh,0|this.Fl,0|f,0|p)),({h:h,l:m}=$y.add(0|this.Gh,0|this.Gl,0|h,0|m)),({h:g,l:y}=$y.add(0|this.Hh,0|this.Hl,0|g,0|y)),this.set(n,r,i,o,s,a,c,u,l,d,f,p,h,m,g,y)}roundClean(){Xy.fill(0),Jy.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)}}const eb=Ny((()=>new Qy)),tb=BigInt(0),nb=BigInt(1),rb=BigInt(2);function ib(e){return e instanceof Uint8Array||null!=e&&"object"===typeof e&&"Uint8Array"===e.constructor.name}function ob(e){if(!ib(e))throw new Error("Uint8Array expected")}const sb=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function ab(e){ob(e);let t="";for(let n=0;n=lb&&e<=db?e-lb:e>=fb&&e<=pb?e-(fb-10):e>=hb&&e<=mb?e-(hb-10):void 0}function yb(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let i=0,o=0;itb;e>>=nb,t+=1);return t}function Cb(e,t){return e>>BigInt(t)&nb}function Ib(e,t,n){return e|(n?nb:tb)<(rb<new Uint8Array(e),Db=e=>Uint8Array.from(e);function Pb(e,t,n){if("number"!==typeof e||e<2)throw new Error("hashLen must be a number");if("number"!==typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!==typeof n)throw new Error("hmacFn must be a function");let r=Rb(e),i=Rb(e),o=0;const s=()=>{r.fill(1),i.fill(0),o=0},a=(...e)=>n(i,r,...e),c=(e=Rb())=>{i=a(Db([0]),e),r=a(),0!==e.length&&(i=a(Db([1]),e),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e{let n;for(s(),c(e);!(n=t(u()));)c();return s(),n}}const Bb={bigint:e=>"bigint"===typeof e,function:e=>"function"===typeof e,boolean:e=>"boolean"===typeof e,string:e=>"string"===typeof e,stringOrUint8Array:e=>"string"===typeof e||ib(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"===typeof e&&Number.isSafeInteger(e.outputLen)};function Mb(e,t,n={}){const r=(t,n,r)=>{const i=Bb[n];if("function"!==typeof i)throw new Error(`Invalid validator "${n}", expected function`);const o=e[t];if((!r||void 0!==o)&&!i(o,e))throw new Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${n}`)};for(const[i,o]of Object.entries(t))r(i,o,!1);for(const[i,o]of Object.entries(n))r(i,o,!0);return e}const Nb=BigInt(0),Fb=BigInt(1),Lb=BigInt(2),jb=BigInt(3),Ub=BigInt(4),Zb=BigInt(5),Hb=BigInt(8);BigInt(9),BigInt(16);function zb(e,t){const n=e%t;return n>=Nb?n:t+n}function Gb(e,t,n){if(n<=Nb||t 0");if(n===Fb)return Nb;let r=Fb;for(;t>Nb;)t&Fb&&(r=r*e%n),e=e*e%n,t>>=Fb;return r}function Vb(e,t,n){let r=e;for(;t-- >Nb;)r*=r,r%=n;return r}function Wb(e,t){if(e===Nb||t<=Nb)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=zb(e,t),r=t,i=Nb,o=Fb,s=Fb,a=Nb;for(;n!==Nb;){const e=r/n,t=r%n,c=i-s*e,u=o-a*e;r=n,n=t,i=s,o=a,s=c,a=u}if(r!==Fb)throw new Error("invert: does not exist");return zb(i,t)}function qb(e){if(e%Ub===jb){const t=(e+Fb)/Ub;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%Hb===Zb){const t=(e-Zb)/Hb;return function(e,n){const r=e.mul(n,Lb),i=e.pow(r,t),o=e.mul(n,i),s=e.mul(e.mul(o,Lb),i),a=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),n))throw new Error("Cannot find square root");return a}}return function(e){const t=(e-Fb)/Lb;let n,r,i;for(n=e-Fb,r=0;n%Lb===Nb;n/=Lb,r++);for(i=Lb;i 0, got ${e}`);const{nBitLength:i,nByteLength:o}=Kb(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=qb(e),a=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:Ob(i),ZERO:Nb,ONE:Fb,create:t=>zb(t,e),isValid:t=>{if("bigint"!==typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return Nb<=t&&te===Nb,isOdd:e=>(e&Fb)===Fb,neg:t=>zb(-t,e),eql:(e,t)=>e===t,sqr:t=>zb(t*t,e),add:(t,n)=>zb(t+n,e),sub:(t,n)=>zb(t-n,e),mul:(t,n)=>zb(t*n,e),pow:(e,t)=>function(e,t,n){if(n 0");if(n===Nb)return e.ONE;if(n===Fb)return t;let r=e.ONE,i=t;for(;n>Nb;)n&Fb&&(r=e.mul(r,i)),i=e.sqr(i),n>>=Fb;return r}(a,e,t),div:(t,n)=>zb(t*Wb(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Wb(t,e),sqrt:r.sqrt||(e=>s(a,e)),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce(((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r))),e.ONE),i=e.inv(r);return t.reduceRight(((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r))),i),n}(a,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?xb(e,o):wb(e,o),fromBytes:e=>{if(e.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${e.length}`);return n?vb(e):bb(e)}});return Object.freeze(a)}function Xb(e){if("bigint"!==typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Jb(e){const t=Xb(e);return t+Math.ceil(t/2)}const Qb=BigInt(0),ev=BigInt(1);function tv(e,t){const n=(e,t)=>{const n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;for(;n>Qb;)n&ev&&(r=r.add(i)),i=i.double(),n>>=ev;return r},precomputeWindow(e,t){const{windows:n,windowSize:i}=r(t),o=[];let s=e,a=s;for(let r=0;r>=f,r>a&&(r-=d,o+=ev);const s=t,p=t+Math.abs(r)-1,h=e%2!==0,m=r<0;0===r?u=u.add(n(h,i[s])):c=c.add(n(m,i[p]))}return{p:c,f:u}},wNAFCached(e,t,n,r){const i=e._WINDOW_SIZE||1;let o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,r(o))),this.wNAF(i,o,n)}}}function nv(e){return function(e){const t=$b.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});Mb(e,t)}(e.Fp),Mb(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Kb(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const rv=BigInt(0),iv=BigInt(1),ov=BigInt(2),sv=BigInt(8),av={zip215:!0};function cv(e){const t=function(e){const t=nv(e);return Mb(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:n,n:r,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=t,u=ov<{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch(h){return{isValid:!1,value:rv}}}),f=t.adjustScalarBytes||(e=>e),p=t.domain||((e,t,n)=>{if(t.length||n)throw new Error("Contexts/pre-hash are not supported");return e}),m=e=>"bigint"===typeof e&&rvm(e)&&m(t)&&ee===rv||g(e,u);function b(e,t){if(g(e,t))return e;throw new Error(`Expected valid scalar < ${t}, got ${typeof e} ${e}`)}function v(e){return e===rv?e:b(e,r)}const w=new Map;function x(e){if(!(e instanceof A))throw new Error("ExtendedPoint expected")}class A{constructor(e,t,n,r){if(this.ex=e,this.ey=t,this.ez=n,this.et=r,!y(e))throw new Error("x required");if(!y(t))throw new Error("y required");if(!y(n))throw new Error("z required");if(!y(r))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof A)throw new Error("extended point not allowed");const{x:t,y:n}=e||{};if(!y(t)||!y(n))throw new Error("invalid affine point");return new A(t,n,iv,l(t*n))}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.ez)));return e.map(((e,n)=>e.toAffine(t[n]))).map(A.fromAffine)}_setWindowSize(e){this._WINDOW_SIZE=e,w.delete(this)}assertValidity(){const{a:e,d:n}=t;if(this.is0())throw new Error("bad point: ZERO");const{ex:r,ey:i,ez:o,et:s}=this,a=l(r*r),c=l(i*i),u=l(o*o),d=l(u*u),f=l(a*e);if(l(u*l(f+c))!==l(d+l(n*l(a*c))))throw new Error("bad point: equation left != right (1)");if(l(r*i)!==l(o*s))throw new Error("bad point: equation left != right (2)")}equals(e){x(e);const{ex:t,ey:n,ez:r}=this,{ex:i,ey:o,ez:s}=e,a=l(t*s),c=l(i*r),u=l(n*s),d=l(o*r);return a===c&&u===d}is0(){return this.equals(A.ZERO)}negate(){return new A(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:e}=t,{ex:n,ey:r,ez:i}=this,o=l(n*n),s=l(r*r),a=l(ov*l(i*i)),c=l(e*o),u=n+r,d=l(l(u*u)-o-s),f=c+s,p=f-a,h=c-s,m=l(d*p),g=l(f*h),y=l(d*h),b=l(p*f);return new A(m,g,b,y)}add(e){x(e);const{a:n,d:r}=t,{ex:i,ey:o,ez:s,et:a}=this,{ex:c,ey:u,ez:d,et:f}=e;if(n===BigInt(-1)){const e=l((o-i)*(u+c)),t=l((o+i)*(u-c)),n=l(t-e);if(n===rv)return this.double();const r=l(s*ov*f),p=l(a*ov*d),h=p+r,m=t+e,g=p-r,y=l(h*n),b=l(m*g),v=l(h*g),w=l(n*m);return new A(y,b,w,v)}const p=l(i*c),h=l(o*u),m=l(a*r*f),g=l(s*d),y=l((i+o)*(c+u)-p-h),b=g-m,v=g+m,w=l(h-n*p),E=l(y*b),_=l(v*w),k=l(y*w),T=l(b*v);return new A(E,_,T,k)}subtract(e){return this.add(e.negate())}wNAF(e){return k.wNAFCached(this,w,e,A.normalizeZ)}multiply(e){const{p:t,f:n}=this.wNAF(b(e,r));return A.normalizeZ([t,n])[0]}multiplyUnsafe(e){let t=v(e);return t===rv?_:this.equals(_)||t===iv?this:this.equals(E)?this.wNAF(t).p:k.unsafeLadder(this,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return k.unsafeLadder(this,r).is0()}toAffine(e){const{ex:t,ey:r,ez:i}=this,o=this.is0();null==e&&(e=o?sv:n.inv(i));const s=l(t*e),a=l(r*e),c=l(i*e);if(o)return{x:rv,y:iv};if(c!==iv)throw new Error("invZ was invalid");return{x:s,y:a}}clearCofactor(){const{h:e}=t;return e===iv?this:this.multiplyUnsafe(e)}static fromHex(e,r=!1){const{d:i,a:o}=t,s=n.BYTES,a=(e=Eb("pointHex",e,s)).slice(),c=e[s-1];a[s-1]=-129&c;const f=vb(a);f===rv||b(f,r?u:n.ORDER);const p=l(f*f),h=l(p-iv),m=l(i*p-o);let{isValid:g,value:y}=d(h,m);if(!g)throw new Error("Point.fromHex: invalid y coordinate");const v=(y&iv)===iv,w=0!==(128&c);if(!r&&y===rv&&w)throw new Error("Point.fromHex: x=0 and x_0=1");return w!==v&&(y=l(-y)),A.fromAffine({x:y,y:f})}static fromPrivateKey(e){return C(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),r=xb(t,n.BYTES);return r[r.length-1]|=e&iv?128:0,r}toHex(){return ab(this.toRawBytes())}}A.BASE=new A(t.Gx,t.Gy,iv,l(t.Gx*t.Gy)),A.ZERO=new A(rv,iv,iv,rv);const{BASE:E,ZERO:_}=A,k=tv(A,8*a);function T(e){return zb(e,r)}function S(e){return T(vb(e))}function C(e){const t=a;e=Eb("private key",e,t);const n=Eb("hashed private key",o(e),2*t),r=f(n.slice(0,t)),i=n.slice(t,2*t),s=S(r),c=E.multiply(s),u=c.toRawBytes();return{head:r,prefix:i,scalar:s,point:c,pointBytes:u}}function I(e=new Uint8Array,...t){const n=_b(...t);return S(o(p(n,Eb("context",e),!!i)))}const O=av;E._setWindowSize(8);return{CURVE:t,getPublicKey:function(e){return C(e).pointBytes},sign:function(e,t,r={}){e=Eb("message",e),i&&(e=i(e));const{prefix:o,scalar:s,pointBytes:c}=C(t),u=I(r.context,o,e),l=E.multiply(u).toRawBytes(),d=T(u+I(r.context,l,c,e)*s);return v(d),Eb("result",_b(l,xb(d,n.BYTES)),2*a)},verify:function(e,t,r,o=O){const{context:s,zip215:a}=o,c=n.BYTES;e=Eb("signature",e,2*c),t=Eb("message",t),i&&(t=i(t));const u=vb(e.slice(c,2*c));let l,d,f;try{l=A.fromHex(r,a),d=A.fromHex(e.slice(0,c),a),f=E.multiplyUnsafe(u)}catch(IT){return!1}if(!a&&l.isSmallOrder())return!1;const p=I(s,d.toRawBytes(),l.toRawBytes(),t);return d.add(l.multiplyUnsafe(p)).subtract(f).clearCofactor().equals(A.ZERO)},ExtendedPoint:A,utils:{getExtendedPublicKey:C,randomPrivateKey:()=>s(n.BYTES),precompute:(e=8,t=A.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}const uv=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),lv=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),dv=(BigInt(0),BigInt(1)),fv=BigInt(2),pv=BigInt(5),hv=BigInt(10),mv=BigInt(20),gv=BigInt(40),yv=BigInt(80);function bv(e){const t=uv,n=e*e%t*e%t,r=Vb(n,fv,t)*n%t,i=Vb(r,dv,t)*e%t,o=Vb(i,pv,t)*i%t,s=Vb(o,hv,t)*o%t,a=Vb(s,mv,t)*s%t,c=Vb(a,gv,t)*a%t,u=Vb(c,yv,t)*c%t,l=Vb(u,yv,t)*c%t,d=Vb(l,hv,t)*o%t;return{pow_p_5_8:Vb(d,fv,t)*e%t,b2:n}}function vv(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function wv(e,t){const n=uv,r=zb(t*t*t,n),i=zb(r*r*t,n);let o=zb(e*r*bv(e*i).pow_p_5_8,n);const s=zb(t*o*o,n),a=o,c=zb(o*lv,n),u=s===e,l=s===zb(-e,n),d=s===zb(-e*lv,n);return u&&(o=a),(l||d)&&(o=c),(zb(o,n)&Fb)===Fb&&(o=zb(-o,n)),{isValid:u||l,value:o}}const xv=Yb(uv,void 0,!0),Av={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:xv,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:eb,randomBytes:Fy,adjustScalarBytes:vv,uvRatio:wv},Ev=cv(Av);function _v(e,t,n){if(t.length>255)throw new Error("Context is too big");return By(Dy("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,t.length]),t,e)}const kv=(xv.ORDER+BigInt(3))/BigInt(8);xv.pow(fv,kv),xv.sqrt(xv.neg(xv.ONE)),xv.ORDER,BigInt(5),BigInt(8),BigInt(486662);!function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);e.isOdd(n)&&e.neg(n)}(xv,xv.neg(BigInt(486664)));BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Tv=n(13384),Sv=n.n(Tv),Cv=n(77191),Iv=n.n(Cv);const Ov=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Rv=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Dv=new Uint32Array(64);class Pv extends jy{constructor(){super(64,32,8,!1),this.A=0|Rv[0],this.B=0|Rv[1],this.C=0|Rv[2],this.D=0|Rv[3],this.E=0|Rv[4],this.F=0|Rv[5],this.G=0|Rv[6],this.H=0|Rv[7]}get(){const{A:e,B:t,C:n,D:r,E:i,F:o,G:s,H:a}=this;return[e,t,n,r,i,o,s,a]}set(e,t,n,r,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let d=0;d<16;d++,t+=4)Dv[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){const e=Dv[d-15],t=Dv[d-2],n=Cy(e,7)^Cy(e,18)^e>>>3,r=Cy(t,17)^Cy(t,19)^t>>>10;Dv[d]=r+Dv[d-7]+n+Dv[d-16]|0}let{A:n,B:r,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let d=0;d<64;d++){const e=u+(Cy(s,6)^Cy(s,11)^Cy(s,25))+((l=s)&a^~l&c)+Ov[d]+Dv[d]|0,t=(Cy(n,2)^Cy(n,13)^Cy(n,22))+Ly(n,r,i)|0;u=c,c=a,a=s,s=o+e|0,o=i,i=r,r=n,n=e+t|0}var l;n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,r,i,o,s,a,c,u)}roundClean(){Dv.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Bv=Ny((()=>new Pv));var Mv=n(25532),Nv=n(39386),Fv=n(40475);class Lv extends TypeError{constructor(e,t){let n;const{message:r,...i}=e,{path:o}=e;super(0===o.length?r:"At path: "+o.join(".")+" -- "+r),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var r;return null!=(r=n)?r:n=[e,...t()]}}}function jv(e){return"object"===typeof e&&null!=e}function Uv(e){return"string"===typeof e?JSON.stringify(e):""+e}function Zv(e,t,n,r){if(!0===e)return;!1===e?e={}:"string"===typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:s}=n,{refinement:a,message:c="Expected a value of type `"+s+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+Uv(r)+"`"}=e;return{value:r,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...e,message:c}}function*Hv(e,t,n,r){var i;jv(i=e)&&"function"===typeof i[Symbol.iterator]||(e=[e]);for(const o of e){const e=Zv(o,t,n,r);e&&(yield e)}}function*zv(e,t,n={}){const{path:r=[],branch:i=[e],coerce:o=!1,mask:s=!1}=n,a={path:r,branch:i};if(o&&(e=t.coercer(e,a),s&&"type"!==t.type&&jv(t.schema)&&jv(e)&&!Array.isArray(e)))for(const u in e)void 0===t.schema[u]&&delete e[u];let c=!0;for(const u of t.validator(e,a))c=!1,yield[u,void 0];for(let[u,l,d]of t.entries(e,a)){const t=zv(l,d,{path:void 0===u?r:[...r,u],branch:void 0===u?i:[...i,l],coerce:o,mask:s});for(const n of t)n[0]?(c=!1,yield[n[0],void 0]):o&&(l=n[1],void 0===u?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):jv(e)&&(e[u]=l))}if(c)for(const u of t.refiner(e,a))c=!1,yield[u,void 0];c&&(yield[void 0,e])}class Gv{constructor(e){const{type:t,schema:n,validator:r,refiner:i,coercer:o=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=n,this.entries=s,this.coercer=o,this.validator=r?(e,t)=>Hv(r(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>Hv(i(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const n=qv(e,t);if(n[0])throw n[0]}(e,this)}create(e){return Vv(e,this)}is(e){return Wv(e,this)}mask(e){return function(e,t){const n=qv(e,t,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}(e,this)}validate(e,t={}){return qv(e,this,t)}}function Vv(e,t){const n=qv(e,t,{coerce:!0});if(n[0])throw n[0];return n[1]}function Wv(e,t){return!qv(e,t)[0]}function qv(e,t,n={}){const r=zv(e,t,n),i=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(r);if(i[0]){return[new Lv(i[0],(function*(){for(const e of r)e[0]&&(yield e[0])})),void 0]}return[void 0,i[1]]}function $v(e,t){return new Gv({type:e,schema:null,validator:t})}function Kv(e){return new Gv({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+Uv(e)})}function Yv(){return $v("boolean",(e=>"boolean"===typeof e))}function Xv(e){return $v("instance",(t=>t instanceof e||"Expected a `"+e.name+"` instance, but received: "+Uv(t)))}function Jv(e){const t=Uv(e),n=typeof e;return new Gv({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:n=>n===e||"Expected the literal `"+t+"`, but received: "+Uv(n)})}function Qv(){return $v("never",(()=>!1))}function ew(e){return new Gv({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})}function tw(){return $v("number",(e=>"number"===typeof e&&!isNaN(e)||"Expected a number, but received: "+Uv(e)))}function nw(e){return new Gv({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function rw(e,t){return new Gv({type:"record",schema:null,*entries(n){if(jv(n))for(const r in n){const i=n[r];yield[r,r,e],yield[r,i,t]}},validator:e=>jv(e)||"Expected an object, but received: "+Uv(e)})}function iw(){return $v("string",(e=>"string"===typeof e||"Expected a string, but received: "+Uv(e)))}function ow(e){const t=Qv();return new Gv({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(e.length,n.length);for(let i=0;iArray.isArray(e)||"Expected an array, but received: "+Uv(e)})}function sw(e){const t=Object.keys(e);return new Gv({type:"type",schema:e,*entries(n){if(jv(n))for(const r of t)yield[r,n[r],e[r]]},validator:e=>jv(e)||"Expected an object, but received: "+Uv(e)})}function aw(e){const t=e.map((e=>e.type)).join(" | ");return new Gv({type:"union",schema:null,validator(n,r){const i=[];for(const t of e){const[...e]=zv(n,t,r),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return["Expected the value to satisfy a union of `"+t+"`, but received: "+Uv(n),...i]}})}function cw(){return $v("unknown",(()=>!0))}function uw(e,t,n){return new Gv({...e,coercer:(r,i)=>Wv(r,t)?e.coercer(n(r,i),i):e.coercer(r,i)})}n(31198),n(66855),n(89062);const lw=[],dw=[],fw=[],pw=BigInt(0),hw=BigInt(1),mw=BigInt(2),gw=BigInt(7),yw=BigInt(256),bw=BigInt(113);for(let OT=0,RT=hw,DT=1,PT=0;OT<24;OT++){[DT,PT]=[PT,(2*DT+3*PT)%5],lw.push(2*(5*PT+DT)),dw.push((OT+1)*(OT+2)/2%64);let e=pw;for(let t=0;t<7;t++)RT=(RT<>gw)*bw)%yw,RT&mw&&(e^=hw<<(hw<n>32?Wy(e,t,n):Gy(e,t,n),Aw=(e,t,n)=>n>32?qy(e,t,n):Vy(e,t,n);class Ew extends My{constructor(e,t,n,r=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,xy(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}keccak(){Iy||Ry(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let r=0;r<10;r++)n[r]=e[r]^e[r+10]^e[r+20]^e[r+30]^e[r+40];for(let r=0;r<10;r+=2){const t=(r+8)%10,i=(r+2)%10,o=n[i],s=n[i+1],a=xw(o,s,1)^n[t],c=Aw(o,s,1)^n[t+1];for(let n=0;n<50;n+=10)e[r+n]^=a,e[r+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=dw[n],o=xw(t,i,r),s=Aw(t,i,r),a=lw[n];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let r=0;r<50;r+=10){for(let t=0;t<10;t++)n[t]=e[r+t];for(let t=0;t<10;t++)e[r+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=vw[r],e[1]^=ww[r]}n.fill(0)}(this.state32,this.rounds),Iy||Ry(this.state32),this.posOut=0,this.pos=0}update(e){_y(this);const{blockLen:t,state:n}=this,r=(e=Py(e)).length;for(let i=0;i=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return xy(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ky(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new Ew(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}const _w=(e,t,n)=>Ny((()=>new Ew(t,e,n))),kw=_w(1,136,32);class Tw extends My{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Ey(e);const n=Py(t);if(this.iHash=e.create(),"function"!==typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let o=0;onew Tw(e,t).update(n).digest();Sw.create=(e,t)=>new Tw(e,t);const{bytesToNumberBE:Cw,hexToBytes:Iw}=r,Ow={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=Ow;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(128&r[0])throw new t("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Cw(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Ow,n="string"===typeof e?Iw(e):e;ob(n);let r=n.length;if(r<2||48!=n[0])throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:i,l:o}=Ow._parseInt(n.subarray(2)),{d:s,l:a}=Ow._parseInt(o);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:s}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,n=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},r=t(n(e.s)),i=t(n(e.r)),o=r.length/2,s=i.length/2,a=n(o),c=n(s);return`30${n(s+o+4)}02${c}${i}02${a}${r}`}},Rw=BigInt(0),Dw=BigInt(1),Pw=(BigInt(2),BigInt(3));BigInt(4);function Bw(e){const t=function(e){const t=nv(e);Mb(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!==typeof n||"bigint"!==typeof n.beta||"function"!==typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{const i=t.toAffine();return _b(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),i=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function o(e){const{a:r,b:i}=t,o=n.sqr(e),s=n.mul(o,e);return n.add(n.add(s,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function s(e){return"bigint"===typeof e&&Rwn.eql(e,n.ZERO);return i(t)&&i(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(i(Eb("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw new Error("bad point: x or y not FE");const i=n.sqr(r),s=o(e);if(!n.eql(i,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){l(e);const{px:t,py:r,pz:i}=this,{px:o,py:s,pz:a}=e,c=n.eql(n.mul(t,a),n.mul(o,i)),u=n.eql(n.mul(r,a),n.mul(s,i));return c&&u}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,i=n.mul(r,Pw),{px:o,py:s,pz:a}=this;let c=n.ZERO,u=n.ZERO,l=n.ZERO,f=n.mul(o,o),p=n.mul(s,s),h=n.mul(a,a),m=n.mul(o,s);return m=n.add(m,m),l=n.mul(o,a),l=n.add(l,l),c=n.mul(e,l),u=n.mul(i,h),u=n.add(c,u),c=n.sub(p,u),u=n.add(p,u),u=n.mul(c,u),c=n.mul(m,c),l=n.mul(i,l),h=n.mul(e,h),m=n.sub(f,h),m=n.mul(e,m),m=n.add(m,l),l=n.add(f,f),f=n.add(l,f),f=n.add(f,h),f=n.mul(f,m),u=n.add(u,f),h=n.mul(s,a),h=n.add(h,h),f=n.mul(h,m),c=n.sub(c,f),l=n.mul(h,p),l=n.add(l,l),l=n.add(l,l),new d(c,u,l)}add(e){l(e);const{px:r,py:i,pz:o}=this,{px:s,py:a,pz:c}=e;let u=n.ZERO,f=n.ZERO,p=n.ZERO;const h=t.a,m=n.mul(t.b,Pw);let g=n.mul(r,s),y=n.mul(i,a),b=n.mul(o,c),v=n.add(r,i),w=n.add(s,a);v=n.mul(v,w),w=n.add(g,y),v=n.sub(v,w),w=n.add(r,o);let x=n.add(s,c);return w=n.mul(w,x),x=n.add(g,b),w=n.sub(w,x),x=n.add(i,o),u=n.add(a,c),x=n.mul(x,u),u=n.add(y,b),x=n.sub(x,u),p=n.mul(h,w),u=n.mul(m,b),p=n.add(u,p),u=n.sub(y,p),p=n.add(y,p),f=n.mul(u,p),y=n.add(g,g),y=n.add(y,g),b=n.mul(h,b),w=n.mul(m,w),y=n.add(y,b),b=n.sub(g,b),b=n.mul(h,b),w=n.add(w,b),g=n.mul(y,w),f=n.add(f,g),g=n.mul(x,w),u=n.mul(v,u),u=n.sub(u,g),g=n.mul(v,y),p=n.mul(x,p),p=n.add(p,g),new d(u,f,p)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return p.wNAFCached(this,u,e,(e=>{const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}))}multiplyUnsafe(e){const r=d.ZERO;if(e===Rw)return r;if(a(e),e===Dw)return this;const{endo:i}=t;if(!i)return p.unsafeLadder(this,e);let{k1neg:o,k1:s,k2neg:c,k2:u}=i.splitScalar(e),l=r,f=r,h=this;for(;s>Rw||u>Rw;)s&Dw&&(l=l.add(h)),u&Dw&&(f=f.add(h)),h=h.double(),s>>=Dw,u>>=Dw;return o&&(l=l.negate()),c&&(f=f.negate()),f=new d(n.mul(f.px,i.beta),f.py,f.pz),l.add(f)}multiply(e){a(e);let r,i,o=e;const{endo:s}=t;if(s){const{k1neg:e,k1:t,k2neg:a,k2:c}=s.splitScalar(o);let{p:u,f:l}=this.wNAF(t),{p:f,f:h}=this.wNAF(c);u=p.constTimeNegate(e,u),f=p.constTimeNegate(a,f),f=new d(n.mul(f.px,s.beta),f.py,f.pz),r=u.add(f),i=l.add(h)}else{const{p:e,f:t}=this.wNAF(o);r=e,i=t}return d.normalizeZ([r,i])[0]}multiplyAndAddUnsafe(e,t,n){const r=d.BASE,i=(e,t)=>t!==Rw&&t!==Dw&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,n));return o.is0()?void 0:o}toAffine(e){const{px:t,py:r,pz:i}=this,o=this.is0();null==e&&(e=o?n.ONE:n.inv(i));const s=n.mul(t,e),a=n.mul(r,e),c=n.mul(i,e);if(o)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw new Error("invZ was invalid");return{x:s,y:a}}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===Dw)return!0;if(n)return n(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===Dw?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return ab(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const f=t.nBitLength,p=tv(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:s}}function Mw(e){const t=function(e){const t=nv(e);return Mb(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r}=t,i=n.BYTES+1,o=2*n.BYTES+1;function s(e){return zb(e,r)}function a(e){return Wb(e,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:d}=Bw({...t,toBytes(e,t,r){const i=t.toAffine(),o=n.toBytes(i.x),s=_b;return r?s(Uint8Array.from([t.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,n.toBytes(i.y))},fromBytes(e){const t=e.length,r=e[0],s=e.subarray(1);if(t!==i||2!==r&&3!==r){if(t===o&&4===r){return{x:n.fromBytes(s.subarray(0,n.BYTES)),y:n.fromBytes(s.subarray(n.BYTES,2*n.BYTES))}}throw new Error(`Point of length ${t} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}{const e=bb(s);if(!(Rw<(a=e)&&aab(wb(e,t.nByteLength));function p(e){return e>r>>Dw}const h=(e,t,n)=>bb(e.slice(t,n));class m{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=Eb("compactSignature",e,2*n),new m(h(e,0,n),h(e,n,2*n))}static fromDER(e){const{r:t,s:n}=Ow.toSig(Eb("DER",e));return new m(t,n)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){const{r:r,s:i,recovery:o}=this,u=v(Eb("msgHash",e));if(null==o||![0,1,2,3].includes(o))throw new Error("recovery id invalid");const l=2===o||3===o?r+t.n:r;if(l>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=0===(1&o)?"02":"03",p=c.fromHex(d+f(l)),h=a(l),m=s(-u*h),g=s(i*h),y=c.BASE.multiplyAndAddUnsafe(p,m,g);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return yb(this.toDERHex())}toDERHex(){return Ow.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return yb(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const g={isValidPrivateKey(e){try{return u(e),!0}catch(IT){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const e=Jb(t.n);return function(e,t,n=!1){const r=e.length,i=Xb(t),o=Jb(t);if(r<16||r1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const s=zb(n?bb(e):vb(e),t-Fb)+Fb;return n?xb(s,i):wb(s,i)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function y(e){const t=ib(e),n="string"===typeof e,r=(t||n)&&e.length;return t?r===i||r===o:n?r===2*i||r===2*o:e instanceof c}const b=t.bits2int||function(e){const n=bb(e),r=8*e.length-t.nBitLength;return r>0?n>>BigInt(r):n},v=t.bits2int_modN||function(e){return s(b(e))},w=Ob(t.nBitLength);function x(e){if("bigint"!==typeof e)throw new Error("bigint expected");if(!(Rw<=e&&ee in i)))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:l}=t;let{lowS:f,prehash:h,extraEntropy:g}=i;null==f&&(f=!0),e=Eb("msgHash",e),h&&(e=Eb("prehashed msgHash",o(e)));const y=v(e),w=u(r),A=[x(w),x(y)];if(null!=g&&!1!==g){const e=!0===g?l(n.BYTES):g;A.push(Eb("extraEntropy",e))}const _=_b(...A),k=y;return{seed:_,k2sig:function(e){const t=b(e);if(!d(t))return;const n=a(t),r=c.BASE.multiply(t).toAffine(),i=s(r.x);if(i===Rw)return;const o=s(n*s(k+i*w));if(o===Rw)return;let u=(r.x===i?0:2)|Number(r.y&Dw),l=o;return f&&p(o)&&(l=function(e){return p(e)?s(-e):e}(o),u^=1),new m(i,l,u)}}}const E={lowS:t.lowS,prehash:!1},_={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(y(e))throw new Error("first arg must be private key");if(!y(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(u(e)).toRawBytes(n)},sign:function(e,n,r=E){const{seed:i,k2sig:o}=A(e,n,r),s=t;return Pb(s.hash.outputLen,s.nByteLength,s.hmac)(i,o)},verify:function(e,n,r,i=_){const o=e;if(n=Eb("msgHash",n),r=Eb("publicKey",r),"strict"in i)throw new Error("options.strict was renamed to lowS");const{lowS:u,prehash:l}=i;let d,f;try{if("string"===typeof o||ib(o))try{d=m.fromDER(o)}catch(A){if(!(A instanceof Ow.Err))throw A;d=m.fromCompact(o)}else{if("object"!==typeof o||"bigint"!==typeof o.r||"bigint"!==typeof o.s)throw new Error("PARSE");{const{r:e,s:t}=o;d=new m(e,t)}}f=c.fromHex(r)}catch(IT){if("PARSE"===IT.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&d.hasHighS())return!1;l&&(n=t.hash(n));const{r:p,s:h}=d,g=v(n),y=a(h),b=s(g*y),w=s(p*y),x=c.BASE.multiplyAndAddUnsafe(f,b,w)?.toAffine();return!!x&&s(x.x)===p},ProjectivePoint:c,Signature:m,utils:g}}function Nw(e){return{hash:e,hmac:(t,...n)=>Sw(e,t,By(...n)),randomBytes:Fy}}const Fw=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Lw=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),jw=BigInt(1),Uw=BigInt(2),Zw=(e,t)=>(e+t/Uw)/t;function Hw(e){const t=Fw,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,d=Vb(l,n,t)*l%t,f=Vb(d,n,t)*l%t,p=Vb(f,Uw,t)*u%t,h=Vb(p,i,t)*p%t,m=Vb(h,o,t)*h%t,g=Vb(m,a,t)*m%t,y=Vb(g,c,t)*g%t,b=Vb(y,a,t)*m%t,v=Vb(b,n,t)*l%t,w=Vb(v,s,t)*h%t,x=Vb(w,r,t)*u%t,A=Vb(x,Uw,t);if(!zw.eql(zw.sqr(A),e))throw new Error("Cannot find square root");return A}const zw=Yb(Fw,void 0,void 0,{sqrt:Hw}),Gw=function(e,t){const n=t=>Mw({...e,...Nw(t)});return Object.freeze({...n(t),create:n})}({a:BigInt(0),b:BigInt(7),Fp:zw,n:Lw,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Lw,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-jw*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,s=BigInt("0x100000000000000000000000000000000"),a=Zw(o*e,t),c=Zw(-r*e,t);let u=zb(e-a*n-c*i,t),l=zb(-a*r-c*o,t);const d=u>s,f=l>s;if(d&&(u=t-u),f&&(l=t-l),u>s||l>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:f,k2:l}}}},Bv);BigInt(0);Gw.ProjectivePoint;Ev.utils.randomPrivateKey;const Vw=()=>{const e=Ev.utils.randomPrivateKey(),t=Ww(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),{publicKey:t,secretKey:n}},Ww=Ev.getPublicKey;function qw(e){try{return Ev.ExtendedPoint.fromHex(e),!0}catch{return!1}}const $w=(e,t)=>Ev.sign(e,t.slice(0,32)),Kw=Ev.verify,Yw=e=>wy.lW.isBuffer(e)?e:e instanceof Uint8Array?wy.lW.from(e.buffer,e.byteOffset,e.byteLength):wy.lW.from(e);class Xw{constructor(e){Object.assign(this,e)}encode(){return wy.lW.from((0,Mv.serialize)(Jw,this))}static decode(e){return(0,Mv.deserialize)(Jw,this,e)}static decodeUnchecked(e){return(0,Mv.deserializeUnchecked)(Jw,this,e)}}const Jw=new Map;var Qw;const ex=32;let tx=1;class nx extends Xw{constructor(e){if(super({}),this._bn=void 0,function(e){return void 0!==e._bn}(e))this._bn=e._bn;else{if("string"===typeof e){const t=Iv().decode(e);if(t.length!=ex)throw new Error("Invalid public key input");this._bn=new(Sv())(t)}else this._bn=new(Sv())(e);if(this._bn.byteLength()>ex)throw new Error("Invalid public key input")}}static unique(){const e=new nx(tx);return tx+=1,new nx(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return Iv().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(wy.lW);if(e.length===ex)return e;const t=wy.lW.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,n){const r=wy.lW.concat([e.toBuffer(),wy.lW.from(t),n.toBuffer()]),i=Bv(r);return new nx(i)}static createProgramAddressSync(e,t){let n=wy.lW.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");n=wy.lW.concat([n,Yw(e)])})),n=wy.lW.concat([n,t.toBuffer(),wy.lW.from("ProgramDerivedAddress")]);const r=Bv(n);if(qw(r))throw new Error("Invalid seeds, address must fall off the curve");return new nx(r)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let n,r=255;for(;0!=r;){try{const i=e.concat(wy.lW.from([r]));n=this.createProgramAddressSync(i,t)}catch(i){if(i instanceof TypeError)throw i;r--;continue}return[n,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return qw(new nx(e).toBytes())}}Qw=nx,nx.default=new Qw("11111111111111111111111111111111"),Jw.set(nx,{kind:"struct",fields:[["_bn","u256"]]});new nx("BPFLoader1111111111111111111111111111111111");const rx=1232;class ix extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(ix.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class ox extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(ox.prototype,"name",{value:"TransactionExpiredTimeoutError"});class sx extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(sx.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class ax{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e256)throw new Error("Account index overflow encountered during compilation");const t=new Map;this.keySegments().flat().forEach(((e,n)=>{t.set(e.toBase58(),n)}));const n=e=>{const n=t.get(e.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return e.map((e=>({programIdIndex:n(e.programId),accountKeyIndexes:e.keys.map((e=>n(e.pubkey))),data:e.data})))}}const cx=(e="publicKey")=>Nv.Ik(32,e),ux=(e="string")=>{const t=Nv.n_([Nv.Jq("length"),Nv.Jq("lengthPadding"),Nv.Ik(Nv.cv(Nv.Jq(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t),i=t;return i.decode=(e,t)=>n(e,t).chars.toString(),i.encode=(e,t,n)=>{const i={chars:wy.lW.from(e,"utf8")};return r(i,t,n)},i.alloc=e=>Nv.Jq().span+Nv.Jq().span+wy.lW.from(e,"utf8").length,i};function lx(e,t){const n=e=>{if(e.span>=0)return e.span;if("function"===typeof e.alloc)return e.alloc(t[e.property]);if("count"in e&&"elementLayout"in e){const r=t[e.property];if(Array.isArray(r))return r.length*n(e.elementLayout)}else if("fields"in e)return lx({layout:e},t[e.property]);return 0};let r=0;return e.layout.fields.forEach((e=>{r+=n(e)})),r}function dx(e){let t=0,n=0;for(;;){let r=e.shift();if(t|=(127&r)<<7*n,n+=1,0===(128&r))break}return t}function fx(e,t){let n=t;for(;;){let t=127&n;if(n>>=7,0==n){e.push(t);break}t|=128,e.push(t)}}function px(e,t){if(!e)throw new Error(t||"Assertion failed")}class hx{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const n=new Map,r=e=>{const t=e.toBase58();let r=n.get(t);return void 0===r&&(r={isSigner:!1,isWritable:!1,isInvoked:!1},n.set(t,r)),r},i=r(t);i.isSigner=!0,i.isWritable=!0;for(const o of e){r(o.programId).isInvoked=!0;for(const e of o.keys){const t=r(e.pubkey);t.isSigner||=e.isSigner,t.isWritable||=e.isWritable}}return new hx(t,n)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];px(e.length<=256,"Max static account keys length exceeded");const t=e.filter((([,e])=>e.isSigner&&e.isWritable)),n=e.filter((([,e])=>e.isSigner&&!e.isWritable)),r=e.filter((([,e])=>!e.isSigner&&e.isWritable)),i=e.filter((([,e])=>!e.isSigner&&!e.isWritable)),o={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};{px(t.length>0,"Expected at least one writable signer key");const[e]=t[0];px(e===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...t.map((([e])=>new nx(e))),...n.map((([e])=>new nx(e))),...r.map((([e])=>new nx(e))),...i.map((([e])=>new nx(e)))]]}extractTableLookup(e){const[t,n]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&e.isWritable)),[r,i]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&!e.isWritable));if(0!==t.length||0!==r.length)return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:r},{writable:n,readonly:i}]}drainKeysFoundInLookupTable(e,t){const n=new Array,r=new Array;for(const[i,o]of this.keyMetaMap.entries())if(t(o)){const t=new nx(i),o=e.findIndex((e=>e.equals(t)));o>=0&&(px(o<256,"Max lookup table index exceeded"),n.push(o),r.push(t),this.keyMetaMap.delete(i))}return[n,r]}}const mx="Reached end of buffer unexpectedly";function gx(e){if(0===e.length)throw new Error(mx);return e.shift()}function yx(e,...t){const[n]=t;if(2===t.length?n+(t[1]??0)>e.length:n>=e.length)throw new Error(mx);return e.splice(...t)}class bx{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map((e=>new nx(e))),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach((e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex])))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map((e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:Iv().decode(e.data)})))}get addressTableLookups(){return[]}getAccountKeys(){return new ax(this.staticAccountKeys)}static compile(e){const t=hx.compile(e.instructions,e.payerKey),[n,r]=t.getMessageComponents(),i=new ax(r).compileInstructions(e.instructions).map((e=>({programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:Iv().encode(e.data)})));return new bx({header:n,accountKeys:r,recentBlockhash:e.recentBlockhash,instructions:i})}isAccountSigner(e){return e=this.header.numRequiredSignatures){return e-t!this.isProgramId(t)))}serialize(){const e=this.accountKeys.length;let t=[];fx(t,e);const n=this.instructions.map((e=>{const{accounts:t,programIdIndex:n}=e,r=Array.from(Iv().decode(e.data));let i=[];fx(i,t.length);let o=[];return fx(o,r.length),{programIdIndex:n,keyIndicesCount:wy.lW.from(i),keyIndices:t,dataLength:wy.lW.from(o),data:r}}));let r=[];fx(r,n.length);let i=wy.lW.alloc(rx);wy.lW.from(r).copy(i);let o=r.length;n.forEach((e=>{const t=Nv.n_([Nv.u8("programIdIndex"),Nv.Ik(e.keyIndicesCount.length,"keyIndicesCount"),Nv.A9(Nv.u8("keyIndex"),e.keyIndices.length,"keyIndices"),Nv.Ik(e.dataLength.length,"dataLength"),Nv.A9(Nv.u8("userdatum"),e.data.length,"data")]).encode(e,i,o);o+=t})),i=i.slice(0,o);const s=Nv.n_([Nv.Ik(1,"numRequiredSignatures"),Nv.Ik(1,"numReadonlySignedAccounts"),Nv.Ik(1,"numReadonlyUnsignedAccounts"),Nv.Ik(t.length,"keyCount"),Nv.A9(cx("key"),e,"keys"),cx("recentBlockhash")]),a={numRequiredSignatures:wy.lW.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:wy.lW.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:wy.lW.from([this.header.numReadonlyUnsignedAccounts]),keyCount:wy.lW.from(t),keys:this.accountKeys.map((e=>Yw(e.toBytes()))),recentBlockhash:Iv().decode(this.recentBlockhash)};let c=wy.lW.alloc(2048);const u=s.encode(a,c);return i.copy(c,u),c.slice(0,u+i.length)}static from(e){let t=[...e];const n=gx(t);if(n!==(127&n))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const r=gx(t),i=gx(t),o=dx(t);let s=[];for(let d=0;d({pubkey:e.toJSON(),isSigner:t,isWritable:n}))),programId:this.programId.toJSON(),data:[...this.data]}}}class xx{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){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,e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:n}=e;this.minNonceContextSlot=t,this.nonceInfo=n}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:n}=e;this.recentBlockhash=t,this.lastValidBlockHeight=n}else{const{recentBlockhash:t,nonceInfo:n}=e;n&&(this.nonceInfo=n),this.recentBlockhash=t}}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((e=>e.toJSON())),signers:this.signatures.map((({publicKey:e})=>e.toJSON()))}}add(...e){if(0===e.length)throw new Error("No instructions");return e.forEach((e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new wx(e))})),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t,n;if(this.nonceInfo?(e=this.nonceInfo.nonce,t=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");if(t.length<1&&console.warn("No instructions provided"),this.feePayer)n=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(let h=0;h{e.keys.forEach((e=>{i.push({...e})}));const t=e.programId.toString();r.includes(t)||r.push(t)})),r.forEach((e=>{i.push({pubkey:new nx(e),isSigner:!1,isWritable:!1})}));const o=[];i.forEach((e=>{const t=e.pubkey.toString(),n=o.findIndex((e=>e.pubkey.toString()===t));n>-1?(o[n].isWritable=o[n].isWritable||e.isWritable,o[n].isSigner=o[n].isSigner||e.isSigner):o.push(e)})),o.sort((function(e,t){if(e.isSigner!==t.isSigner)return e.isSigner?-1:1;if(e.isWritable!==t.isWritable)return e.isWritable?-1:1;return e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})}));const s=o.findIndex((e=>e.pubkey.equals(n)));if(s>-1){const[e]=o.splice(s,1);e.isSigner=!0,e.isWritable=!0,o.unshift(e)}else o.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(const h of this.signatures){const e=o.findIndex((e=>e.pubkey.equals(h.publicKey)));if(!(e>-1))throw new Error(`unknown signer: ${h.publicKey.toString()}`);o[e].isSigner||(o[e].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."))}let a=0,c=0,u=0;const l=[],d=[];o.forEach((({pubkey:e,isSigner:t,isWritable:n})=>{t?(l.push(e.toString()),a+=1,n||(c+=1)):(d.push(e.toString()),n||(u+=1))}));const f=l.concat(d),p=t.map((e=>{const{data:t,programId:n}=e;return{programIdIndex:f.indexOf(n.toString()),accounts:e.keys.map((e=>f.indexOf(e.pubkey.toString()))),data:Iv().encode(t)}}));return p.forEach((e=>{px(e.programIdIndex>=0),e.accounts.forEach((e=>px(e>=0)))})),new bx({header:{numRequiredSignatures:a,numReadonlySignedAccounts:c,numReadonlyUnsignedAccounts:u},accountKeys:f,recentBlockhash:e,instructions:p})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length){if(this.signatures.every(((e,n)=>t[n].equals(e.publicKey))))return e}return this.signatures=t.map((e=>({signature:null,publicKey:e}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(0===e.length)throw new Error("No signers");const t=new Set;this.signatures=e.filter((e=>{const n=e.toString();return!t.has(n)&&(t.add(n),!0)})).map((e=>({signature:null,publicKey:e})))}sign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,n=[];for(const i of e){const e=i.publicKey.toString();t.has(e)||(t.add(e),n.push(i))}this.signatures=n.map((e=>({signature:null,publicKey:e.publicKey})));const r=this._compile();this._partialSign(r,...n)}partialSign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,n=[];for(const i of e){const e=i.publicKey.toString();t.has(e)||(t.add(e),n.push(i))}const r=this._compile();this._partialSign(r,...n)}_partialSign(e,...t){const n=e.serialize();t.forEach((e=>{const t=$w(n,e.secretKey);this._addSignature(e.publicKey,Yw(t))}))}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){px(64===t.length);const n=this.signatures.findIndex((t=>e.equals(t.publicKey)));if(n<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[n].signature=wy.lW.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const n={};for(const{signature:r,publicKey:i}of this.signatures)null===r?t&&(n.missing||=[]).push(i):Kw(r,e,i.toBytes())||(n.invalid||=[]).push(i);return n.invalid||n.missing?n:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),r=this.serializeMessage();if(n){const e=this._getMessageSignednessErrors(r,t);if(e){let t="Signature verification failed.";throw e.invalid&&(t+=`\nInvalid signature for public key${1===e.invalid.length?"":"(s)"} [\`${e.invalid.map((e=>e.toBase58())).join("`, `")}\`].`),e.missing&&(t+=`\nMissing signature for public key${1===e.missing.length?"":"(s)"} [\`${e.missing.map((e=>e.toBase58())).join("`, `")}\`].`),new Error(t)}}return this._serialize(r)}_serialize(e){const{signatures:t}=this,n=[];fx(n,t.length);const r=n.length+64*t.length+e.length,i=wy.lW.alloc(r);return px(t.length<256),wy.lW.from(n).copy(i,0),t.forEach((({signature:e},t)=>{null!==e&&(px(64===e.length,"signature has invalid length"),wy.lW.from(e).copy(i,n.length+64*t))})),e.copy(i,n.length+64*t.length),px(i.length<=rx,`Transaction too large: ${i.length} > 1232`),i}get keys(){return px(1===this.instructions.length),this.instructions[0].keys.map((e=>e.pubkey))}get programId(){return px(1===this.instructions.length),this.instructions[0].programId}get data(){return px(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e];const n=dx(t);let r=[];for(let i=0;i0&&(n.feePayer=e.accountKeys[0]),t.forEach(((t,r)=>{const i={signature:t==Iv().encode(vx)?null:Iv().decode(t),publicKey:e.accountKeys[r]};n.signatures.push(i)})),e.instructions.forEach((t=>{const r=t.accounts.map((t=>{const r=e.accountKeys[t];return{pubkey:r,isSigner:n.signatures.some((e=>e.publicKey.toString()===r.toString()))||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}}));n.instructions.push(new wx({keys:r,programId:e.accountKeys[t.programIdIndex],data:Iv().decode(t.data)}))})),n._message=e,n._json=n.toJSON(),n}}const Ax=new nx("SysvarC1ock11111111111111111111111111111111"),Ex=(new nx("SysvarEpochSchedu1e111111111111111111111111"),new nx("Sysvar1nstructions1111111111111111111111111"),new nx("SysvarRecentB1ockHashes11111111111111111111")),_x=new nx("SysvarRent111111111111111111111111111111111"),kx=(new nx("SysvarRewards111111111111111111111111111111"),new nx("SysvarS1otHashes111111111111111111111111111"),new nx("SysvarS1otHistory11111111111111111111111111"),new nx("SysvarStakeHistory1111111111111111111111111"));async function Tx(e,t,n,r){const i=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},o=await e.sendTransaction(t,n,i);let s;if(null!=t.recentBlockhash&&null!=t.lastValidBlockHeight)s=(await e.confirmTransaction({abortSignal:r?.abortSignal,signature:o,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},r&&r.commitment)).value;else if(null!=t.minNonceContextSlot&&null!=t.nonceInfo){const{nonceInstruction:n}=t.nonceInfo,i=n.keys[0].pubkey;s=(await e.confirmTransaction({abortSignal:r?.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:i,nonceValue:t.nonceInfo.nonce,signature:o},r&&r.commitment)).value}else null!=r?.abortSignal&&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."),s=(await e.confirmTransaction(o,r&&r.commitment)).value;if(s.err)throw new Error(`Transaction ${o} failed (${JSON.stringify(s)})`);return o}function Sx(e){return new Promise((t=>setTimeout(t,e)))}function Cx(e,t){const n=e.layout.span>=0?e.layout.span:lx(e,t),r=wy.lW.alloc(n),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,r),r}const Ix=Nv._O("lamportsPerSignature"),Ox=Nv.n_([Nv.Jq("version"),Nv.Jq("state"),cx("authorizedPubkey"),cx("nonce"),Nv.n_([Ix],"feeCalculator")]),Rx=Ox.span;const Dx=(Px=8,e=>{const t=(0,Nv.Ik)(Px,e),{encode:n,decode:r}=(e=>({decode:e.decode.bind(e),encode:e.encode.bind(e)}))(t),i=t;return i.decode=(e,t)=>{const n=r(e,t);return(0,Fv.oU)(wy.lW.from(n))},i.encode=(e,t,r)=>{const i=(0,Fv.k$)(e,Px);return n(i,t,r)},i});var Px;const Bx=Object.freeze({Create:{index:0,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("lamports"),Nv.gM("space"),cx("programId")])},Assign:{index:1,layout:Nv.n_([Nv.Jq("instruction"),cx("programId")])},Transfer:{index:2,layout:Nv.n_([Nv.Jq("instruction"),Dx("lamports")])},CreateWithSeed:{index:3,layout:Nv.n_([Nv.Jq("instruction"),cx("base"),ux("seed"),Nv.gM("lamports"),Nv.gM("space"),cx("programId")])},AdvanceNonceAccount:{index:4,layout:Nv.n_([Nv.Jq("instruction")])},WithdrawNonceAccount:{index:5,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("lamports")])},InitializeNonceAccount:{index:6,layout:Nv.n_([Nv.Jq("instruction"),cx("authorized")])},AuthorizeNonceAccount:{index:7,layout:Nv.n_([Nv.Jq("instruction"),cx("authorized")])},Allocate:{index:8,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("space")])},AllocateWithSeed:{index:9,layout:Nv.n_([Nv.Jq("instruction"),cx("base"),ux("seed"),Nv.gM("space"),cx("programId")])},AssignWithSeed:{index:10,layout:Nv.n_([Nv.Jq("instruction"),cx("base"),ux("seed"),cx("programId")])},TransferWithSeed:{index:11,layout:Nv.n_([Nv.Jq("instruction"),Dx("lamports"),ux("seed"),cx("programId")])},UpgradeNonceAccount:{index:12,layout:Nv.n_([Nv.Jq("instruction")])}});class Mx{constructor(){}static createAccount(e){const t=Cx(Bx.Create,{lamports:e.lamports,space:e.space,programId:Yw(e.programId.toBuffer())});return new wx({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}static transfer(e){let t,n;if("basePubkey"in e){t=Cx(Bx.TransferWithSeed,{lamports:BigInt(e.lamports),seed:e.seed,programId:Yw(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{t=Cx(Bx.Transfer,{lamports:BigInt(e.lamports)}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new wx({keys:n,programId:this.programId,data:t})}static assign(e){let t,n;if("basePubkey"in e){t=Cx(Bx.AssignWithSeed,{base:Yw(e.basePubkey.toBuffer()),seed:e.seed,programId:Yw(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{t=Cx(Bx.Assign,{programId:Yw(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new wx({keys:n,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=Cx(Bx.CreateWithSeed,{base:Yw(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:Yw(e.programId.toBuffer())});let n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey!=e.fromPubkey&&n.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new wx({keys:n,programId:this.programId,data:t})}static createNonceAccount(e){const t=new xx;"basePubkey"in e&&"seed"in e?t.add(Mx.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:Rx,programId:this.programId})):t.add(Mx.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:Rx,programId:this.programId}));const n={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(n)),t}static nonceInitialize(e){const t=Cx(Bx.InitializeNonceAccount,{authorized:Yw(e.authorizedPubkey.toBuffer())}),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Ex,isSigner:!1,isWritable:!1},{pubkey:_x,isSigner:!1,isWritable:!1}],programId:this.programId,data:t};return new wx(n)}static nonceAdvance(e){const t=Cx(Bx.AdvanceNonceAccount),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Ex,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t};return new wx(n)}static nonceWithdraw(e){const t=Cx(Bx.WithdrawNonceAccount,{lamports:e.lamports});return new wx({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Ex,isSigner:!1,isWritable:!1},{pubkey:_x,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static nonceAuthorize(e){const t=Cx(Bx.AuthorizeNonceAccount,{authorized:Yw(e.newAuthorizedPubkey.toBuffer())});return new wx({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static allocate(e){let t,n;if("basePubkey"in e){t=Cx(Bx.AllocateWithSeed,{base:Yw(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:Yw(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{t=Cx(Bx.Allocate,{space:e.space}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new wx({keys:n,programId:this.programId,data:t})}}Mx.programId=new nx("11111111111111111111111111111111");class Nx{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/Nx.chunkSize)+1+1)}static async load(e,t,n,r,i){{const o=await e.getMinimumBalanceForRentExemption(i.length),s=await e.getAccountInfo(n.publicKey,"confirmed");let a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==i.length&&(a=a||new xx,a.add(Mx.allocate({accountPubkey:n.publicKey,space:i.length}))),s.owner.equals(r)||(a=a||new xx,a.add(Mx.assign({accountPubkey:n.publicKey,programId:r}))),s.lamports0?o:1,space:i.length,programId:r}));null!==a&&await Tx(e,a,[t,n],{commitment:"confirmed"})}const o=Nv.n_([Nv.Jq("instruction"),Nv.Jq("offset"),Nv.Jq("bytesLength"),Nv.Jq("bytesLengthPadding"),Nv.A9(Nv.u8("byte"),Nv.cv(Nv.Jq(),-8),"bytes")]),s=Nx.chunkSize;let a=0,c=i,u=[];for(;c.length>0;){const i=c.slice(0,s),l=wy.lW.alloc(s+16);o.encode({instruction:0,offset:a,bytes:i,bytesLength:0,bytesLengthPadding:0},l);const d=(new xx).add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0}],programId:r,data:l});if(u.push(Tx(e,d,[t,n],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")){const e=4;await Sx(1e3/e)}a+=s,c=c.slice(s)}await Promise.all(u);{const i=Nv.n_([Nv.Jq("instruction")]),o=wy.lW.alloc(i.span);i.encode({instruction:1},o);const s=(new xx).add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0},{pubkey:_x,isSigner:!1,isWritable:!1}],programId:r,data:o}),a="processed",c=await e.sendTransaction(s,[t,n],{preflightCommitment:a}),{context:u,value:l}=await e.confirmTransaction({signature:c,lastValidBlockHeight:s.lastValidBlockHeight,blockhash:s.recentBlockhash},a);if(l.err)throw new Error(`Transaction ${c} failed (${JSON.stringify(l)})`);for(;;){try{if(await e.getSlot({commitment:a})>u.slot)break}catch{}await new Promise((e=>setTimeout(e,Math.round(200))))}}return!0}}Nx.chunkSize=932;new nx("BPFLoader2111111111111111111111111111111111");Object.prototype.toString,Object.keys;Error;Error;globalThis.fetch;Nv.n_([Nv.Jq("typeIndex"),Dx("deactivationSlot"),Nv._O("lastExtendedSlot"),Nv.u8("lastExtendedStartIndex"),Nv.u8(),Nv.A9(cx(),Nv.cv(Nv.u8(),-1),"authority")]);const Fx=uw(Xv(nx),iw(),(e=>new nx(e))),Lx=ow([iw(),Jv("base64")]),jx=uw(Xv(wy.lW),Lx,(e=>wy.lW.from(e[0],"base64")));function Ux(e){return aw([sw({jsonrpc:Jv("2.0"),id:iw(),result:e}),sw({jsonrpc:Jv("2.0"),id:iw(),error:sw({code:cw(),message:iw(),data:nw($v("any",(()=>!0)))})})])}const Zx=Ux(cw());function Hx(e){return uw(Ux(e),Zx,(t=>"error"in t?t:{...t,result:Vv(t.result,e)}))}function zx(e){return Hx(sw({context:sw({slot:tw()}),value:e}))}function Gx(e){return sw({context:sw({slot:tw()}),value:e})}const Vx=sw({foundation:tw(),foundationTerm:tw(),initial:tw(),taper:tw(),terminal:tw()}),Wx=(Hx(Kv(ew(sw({epoch:tw(),effectiveSlot:tw(),amount:tw(),postBalance:tw(),commission:nw(ew(tw()))})))),Kv(sw({slot:tw(),prioritizationFee:tw()}))),qx=sw({total:tw(),validator:tw(),foundation:tw(),epoch:tw()}),$x=sw({epoch:tw(),slotIndex:tw(),slotsInEpoch:tw(),absoluteSlot:tw(),blockHeight:nw(tw()),transactionCount:nw(tw())}),Kx=sw({slotsPerEpoch:tw(),leaderScheduleSlotOffset:tw(),warmup:Yv(),firstNormalEpoch:tw(),firstNormalSlot:tw()}),Yx=rw(iw(),Kv(tw())),Xx=ew(aw([sw({}),iw()])),Jx=sw({err:Xx}),Qx=Jv("receivedSignature");sw({"solana-core":iw(),"feature-set":nw(tw())}),zx(sw({err:ew(aw([sw({}),iw()])),logs:ew(Kv(iw())),accounts:nw(ew(Kv(ew(sw({executable:Yv(),owner:iw(),lamports:tw(),data:Kv(iw()),rentEpoch:nw(tw())}))))),unitsConsumed:nw(tw()),returnData:nw(ew(sw({programId:iw(),data:ow([iw(),Jv("base64")])})))})),zx(sw({byIdentity:rw(iw(),Kv(tw())),range:sw({firstSlot:tw(),lastSlot:tw()})}));Hx(Vx),Hx(qx),Hx(Wx),Hx($x),Hx(Kx),Hx(Yx),Hx(tw()),zx(sw({total:tw(),circulating:tw(),nonCirculating:tw(),nonCirculatingAccounts:Kv(Fx)}));const eA=sw({amount:iw(),uiAmount:ew(tw()),decimals:tw(),uiAmountString:nw(iw())}),tA=(zx(Kv(sw({address:Fx,amount:iw(),uiAmount:ew(tw()),decimals:tw(),uiAmountString:nw(iw())}))),zx(Kv(sw({pubkey:Fx,account:sw({executable:Yv(),owner:Fx,lamports:tw(),data:jx,rentEpoch:tw()})}))),sw({program:iw(),parsed:cw(),space:tw()})),nA=(zx(Kv(sw({pubkey:Fx,account:sw({executable:Yv(),owner:Fx,lamports:tw(),data:tA,rentEpoch:tw()})}))),zx(Kv(sw({lamports:tw(),address:Fx}))),sw({executable:Yv(),owner:Fx,lamports:tw(),data:jx,rentEpoch:tw()})),rA=(sw({pubkey:Fx,account:nA}),uw(aw([Xv(wy.lW),tA]),aw([Lx,tA]),(e=>Array.isArray(e)?Vv(e,jx):e))),iA=sw({executable:Yv(),owner:Fx,lamports:tw(),data:rA,rentEpoch:tw()}),oA=(sw({pubkey:Fx,account:iA}),sw({state:aw([Jv("active"),Jv("inactive"),Jv("activating"),Jv("deactivating")]),active:tw(),inactive:tw()}),Hx(Kv(sw({signature:iw(),slot:tw(),err:Xx,memo:ew(iw()),blockTime:nw(ew(tw()))}))),Hx(Kv(sw({signature:iw(),slot:tw(),err:Xx,memo:ew(iw()),blockTime:nw(ew(tw()))}))),sw({subscription:tw(),result:Gx(nA)}),sw({pubkey:Fx,account:nA})),sA=(sw({subscription:tw(),result:Gx(oA)}),sw({parent:tw(),slot:tw(),root:tw()})),aA=(sw({subscription:tw(),result:sA}),aw([sw({type:aw([Jv("firstShredReceived"),Jv("completed"),Jv("optimisticConfirmation"),Jv("root")]),slot:tw(),timestamp:tw()}),sw({type:Jv("createdBank"),parent:tw(),slot:tw(),timestamp:tw()}),sw({type:Jv("frozen"),slot:tw(),timestamp:tw(),stats:sw({numTransactionEntries:tw(),numSuccessfulTransactions:tw(),numFailedTransactions:tw(),maxTransactionsPerEntry:tw()})}),sw({type:Jv("dead"),slot:tw(),timestamp:tw(),err:iw()})])),cA=(sw({subscription:tw(),result:aA}),sw({subscription:tw(),result:Gx(aw([Jx,Qx]))}),sw({subscription:tw(),result:tw()}),sw({pubkey:iw(),gossip:ew(iw()),tpu:ew(iw()),rpc:ew(iw()),version:ew(iw())}),sw({votePubkey:iw(),nodePubkey:iw(),activatedStake:tw(),epochVoteAccount:Yv(),epochCredits:Kv(ow([tw(),tw(),tw()])),commission:tw(),lastVote:tw(),rootSlot:ew(tw())})),uA=(Hx(sw({current:Kv(cA),delinquent:Kv(cA)})),aw([Jv("processed"),Jv("confirmed"),Jv("finalized")])),lA=sw({slot:tw(),confirmations:ew(tw()),err:Xx,confirmationStatus:nw(uA)}),dA=(zx(Kv(ew(lA))),Hx(tw()),sw({accountKey:Fx,writableIndexes:Kv(tw()),readonlyIndexes:Kv(tw())})),fA=sw({signatures:Kv(iw()),message:sw({accountKeys:Kv(iw()),header:sw({numRequiredSignatures:tw(),numReadonlySignedAccounts:tw(),numReadonlyUnsignedAccounts:tw()}),instructions:Kv(sw({accounts:Kv(tw()),data:iw(),programIdIndex:tw()})),recentBlockhash:iw(),addressTableLookups:nw(Kv(dA))})}),pA=sw({pubkey:Fx,signer:Yv(),writable:Yv(),source:nw(aw([Jv("transaction"),Jv("lookupTable")]))}),hA=sw({accountKeys:Kv(pA),signatures:Kv(iw())}),mA=sw({parsed:cw(),program:iw(),programId:Fx}),gA=sw({accounts:Kv(Fx),data:iw(),programId:Fx}),yA=uw(aw([gA,mA]),aw([sw({parsed:cw(),program:iw(),programId:iw()}),sw({accounts:Kv(iw()),data:iw(),programId:iw()})]),(e=>Vv(e,"accounts"in e?gA:mA))),bA=sw({signatures:Kv(iw()),message:sw({accountKeys:Kv(pA),instructions:Kv(yA),recentBlockhash:iw(),addressTableLookups:nw(ew(Kv(dA)))})}),vA=sw({accountIndex:tw(),mint:iw(),owner:nw(iw()),uiTokenAmount:eA}),wA=sw({writable:Kv(Fx),readonly:Kv(Fx)}),xA=sw({err:Xx,fee:tw(),innerInstructions:nw(ew(Kv(sw({index:tw(),instructions:Kv(sw({accounts:Kv(tw()),data:iw(),programIdIndex:tw()}))})))),preBalances:Kv(tw()),postBalances:Kv(tw()),logMessages:nw(ew(Kv(iw()))),preTokenBalances:nw(ew(Kv(vA))),postTokenBalances:nw(ew(Kv(vA))),loadedAddresses:nw(wA),computeUnitsConsumed:nw(tw())}),AA=sw({err:Xx,fee:tw(),innerInstructions:nw(ew(Kv(sw({index:tw(),instructions:Kv(yA)})))),preBalances:Kv(tw()),postBalances:Kv(tw()),logMessages:nw(ew(Kv(iw()))),preTokenBalances:nw(ew(Kv(vA))),postTokenBalances:nw(ew(Kv(vA))),loadedAddresses:nw(wA),computeUnitsConsumed:nw(tw())}),EA=aw([Jv(0),Jv("legacy")]),_A=sw({pubkey:iw(),lamports:tw(),postBalance:ew(tw()),rewardType:ew(iw()),commission:nw(ew(tw()))}),kA=(Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),transactions:Kv(sw({transaction:fA,meta:ew(xA),version:nw(EA)})),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),transactions:Kv(sw({transaction:hA,meta:ew(xA),version:nw(EA)})),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),transactions:Kv(sw({transaction:bA,meta:ew(AA),version:nw(EA)})),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),transactions:Kv(sw({transaction:hA,meta:ew(AA),version:nw(EA)})),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),transactions:Kv(sw({transaction:fA,meta:ew(xA)})),rewards:nw(Kv(_A)),blockTime:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),signatures:Kv(iw()),blockTime:ew(tw())}))),Hx(ew(sw({slot:tw(),meta:ew(xA),blockTime:nw(ew(tw())),transaction:fA,version:nw(EA)}))),Hx(ew(sw({slot:tw(),transaction:bA,meta:ew(AA),blockTime:nw(ew(tw())),version:nw(EA)}))),zx(sw({blockhash:iw(),feeCalculator:sw({lamportsPerSignature:tw()})})),zx(sw({blockhash:iw(),lastValidBlockHeight:tw()})),zx(Yv()),Hx(Kv(sw({slot:tw(),numTransactions:tw(),numSlots:tw(),samplePeriodSecs:tw()}))),zx(ew(sw({feeCalculator:sw({lamportsPerSignature:tw()})}))),Hx(iw()),Hx(iw()),sw({err:Xx,logs:Kv(iw()),signature:iw()}));sw({result:Gx(kA),subscription:tw()});class TA{constructor(e){this._keypair=void 0,this._keypair=e??Vw()}static generate(){return new TA(Vw())}static fromSecretKey(e,t){if(64!==e.byteLength)throw new Error("bad secret key size");const n=e.slice(32,64);if(!t||!t.skipValidation){const t=e.slice(0,32),r=Ww(t);for(let e=0;e<32;e++)if(n[e]!==r[e])throw new Error("provided secretKey is invalid")}return new TA({publicKey:n,secretKey:e})}static fromSeed(e){const t=Ww(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),new TA({publicKey:t,secretKey:n})}get publicKey(){return new nx(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const SA=Object.freeze({CreateLookupTable:{index:0,layout:Nv.n_([Nv.Jq("instruction"),Dx("recentSlot"),Nv.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:Nv.n_([Nv.Jq("instruction")])},ExtendLookupTable:{index:2,layout:Nv.n_([Nv.Jq("instruction"),Dx(),Nv.A9(cx(),Nv.cv(Nv.Jq(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Nv.n_([Nv.Jq("instruction")])},CloseLookupTable:{index:4,layout:Nv.n_([Nv.Jq("instruction")])}});class CA{constructor(){}static createLookupTable(e){const[t,n]=nx.findProgramAddressSync([e.authority.toBuffer(),(0,Fv.k$)(BigInt(e.recentSlot),8)],this.programId),r=Cx(SA.CreateLookupTable,{recentSlot:BigInt(e.recentSlot),bumpSeed:n}),i=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Mx.programId,isSigner:!1,isWritable:!1}];return[new wx({programId:this.programId,keys:i,data:r}),t]}static freezeLookupTable(e){const t=Cx(SA.FreezeLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new wx({programId:this.programId,keys:n,data:t})}static extendLookupTable(e){const t=Cx(SA.ExtendLookupTable,{addresses:e.addresses.map((e=>e.toBytes()))}),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&n.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Mx.programId,isSigner:!1,isWritable:!1}),new wx({programId:this.programId,keys:n,data:t})}static deactivateLookupTable(e){const t=Cx(SA.DeactivateLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new wx({programId:this.programId,keys:n,data:t})}static closeLookupTable(e){const t=Cx(SA.CloseLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new wx({programId:this.programId,keys:n,data:t})}}CA.programId=new nx("AddressLookupTab1e1111111111111111111111111");const IA=Object.freeze({RequestUnits:{index:0,layout:Nv.n_([Nv.u8("instruction"),Nv.Jq("units"),Nv.Jq("additionalFee")])},RequestHeapFrame:{index:1,layout:Nv.n_([Nv.u8("instruction"),Nv.Jq("bytes")])},SetComputeUnitLimit:{index:2,layout:Nv.n_([Nv.u8("instruction"),Nv.Jq("units")])},SetComputeUnitPrice:{index:3,layout:Nv.n_([Nv.u8("instruction"),Dx("microLamports")])}});class OA{constructor(){}static requestUnits(e){const t=Cx(IA.RequestUnits,e);return new wx({keys:[],programId:this.programId,data:t})}static requestHeapFrame(e){const t=Cx(IA.RequestHeapFrame,e);return new wx({keys:[],programId:this.programId,data:t})}static setComputeUnitLimit(e){const t=Cx(IA.SetComputeUnitLimit,e);return new wx({keys:[],programId:this.programId,data:t})}static setComputeUnitPrice(e){const t=Cx(IA.SetComputeUnitPrice,{microLamports:BigInt(e.microLamports)});return new wx({keys:[],programId:this.programId,data:t})}}OA.programId=new nx("ComputeBudget111111111111111111111111111111");const RA=Nv.n_([Nv.u8("numSignatures"),Nv.u8("padding"),Nv.KB("signatureOffset"),Nv.KB("signatureInstructionIndex"),Nv.KB("publicKeyOffset"),Nv.KB("publicKeyInstructionIndex"),Nv.KB("messageDataOffset"),Nv.KB("messageDataSize"),Nv.KB("messageInstructionIndex")]);class DA{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:n,signature:r,instructionIndex:i}=e;px(32===t.length,`Public Key must be 32 bytes but received ${t.length} bytes`),px(64===r.length,`Signature must be 64 bytes but received ${r.length} bytes`);const o=RA.span,s=o+t.length,a=s+r.length,c=wy.lW.alloc(a+n.length),u=null==i?65535:i;return RA.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:u,publicKeyOffset:o,publicKeyInstructionIndex:u,messageDataOffset:a,messageDataSize:n.length,messageInstructionIndex:u},c),c.fill(t,o),c.fill(r,s),c.fill(n,a),new wx({keys:[],programId:DA.programId,data:c})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:n,instructionIndex:r}=e;px(64===t.length,`Private key must be 64 bytes but received ${t.length} bytes`);try{const e=TA.fromSecretKey(t),i=e.publicKey.toBytes(),o=$w(n,e.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:o,instructionIndex:r})}catch(IT){throw new Error(`Error creating instruction; ${IT}`)}}}DA.programId=new nx("Ed25519SigVerify111111111111111111111111111");Gw.utils.isValidPrivateKey;const PA=Gw.getPublicKey,BA=Nv.n_([Nv.u8("numSignatures"),Nv.KB("signatureOffset"),Nv.u8("signatureInstructionIndex"),Nv.KB("ethAddressOffset"),Nv.u8("ethAddressInstructionIndex"),Nv.KB("messageDataOffset"),Nv.KB("messageDataSize"),Nv.u8("messageInstructionIndex"),Nv.Ik(20,"ethAddress"),Nv.Ik(64,"signature"),Nv.u8("recoveryId")]);class MA{constructor(){}static publicKeyToEthAddress(e){px(64===e.length,`Public key must be 64 bytes but received ${e.length} bytes`);try{return wy.lW.from(kw(Yw(e))).slice(-20)}catch(IT){throw new Error(`Error constructing Ethereum address: ${IT}`)}}static createInstructionWithPublicKey(e){const{publicKey:t,message:n,signature:r,recoveryId:i,instructionIndex:o}=e;return MA.createInstructionWithEthAddress({ethAddress:MA.publicKeyToEthAddress(t),message:n,signature:r,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:n,signature:r,recoveryId:i,instructionIndex:o=0}=e;let s;s="string"===typeof t?t.startsWith("0x")?wy.lW.from(t.substr(2),"hex"):wy.lW.from(t,"hex"):t,px(20===s.length,`Address must be 20 bytes but received ${s.length} bytes`);const a=12+s.length,c=a+r.length+1,u=wy.lW.alloc(BA.span+n.length);return BA.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:o,ethAddressOffset:12,ethAddressInstructionIndex:o,messageDataOffset:c,messageDataSize:n.length,messageInstructionIndex:o,signature:Yw(r),ethAddress:Yw(s),recoveryId:i},u),u.fill(Yw(n),BA.span),new wx({keys:[],programId:MA.programId,data:u})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:n,instructionIndex:r}=e;px(32===t.length,`Private key must be 32 bytes but received ${t.length} bytes`);try{const e=Yw(t),i=PA(e,!1).slice(1),o=wy.lW.from(kw(Yw(n))),[s,a]=((e,t)=>{const n=Gw.sign(e,t);return[n.toCompactRawBytes(),n.recovery]})(o,e);return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:s,recoveryId:a,instructionIndex:r})}catch(IT){throw new Error(`Error creating instruction; ${IT}`)}}}var NA;MA.programId=new nx("KeccakSecp256k11111111111111111111111111111");const FA=new nx("StakeConfig11111111111111111111111111111111");class LA{constructor(e,t,n){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=n}}NA=LA,LA.default=new NA(0,0,nx.default);const jA=Object.freeze({Initialize:{index:0,layout:Nv.n_([Nv.Jq("instruction"),((e="authorized")=>Nv.n_([cx("staker"),cx("withdrawer")],e))(),((e="lockup")=>Nv.n_([Nv.gM("unixTimestamp"),Nv.gM("epoch"),cx("custodian")],e))()])},Authorize:{index:1,layout:Nv.n_([Nv.Jq("instruction"),cx("newAuthorized"),Nv.Jq("stakeAuthorizationType")])},Delegate:{index:2,layout:Nv.n_([Nv.Jq("instruction")])},Split:{index:3,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("lamports")])},Withdraw:{index:4,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("lamports")])},Deactivate:{index:5,layout:Nv.n_([Nv.Jq("instruction")])},Merge:{index:7,layout:Nv.n_([Nv.Jq("instruction")])},AuthorizeWithSeed:{index:8,layout:Nv.n_([Nv.Jq("instruction"),cx("newAuthorized"),Nv.Jq("stakeAuthorizationType"),ux("authoritySeed"),cx("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class UA{constructor(){}static initialize(e){const{stakePubkey:t,authorized:n,lockup:r}=e,i=r||LA.default,o=Cx(jA.Initialize,{authorized:{staker:Yw(n.staker.toBuffer()),withdrawer:Yw(n.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:Yw(i.custodian.toBuffer())}}),s={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:_x,isSigner:!1,isWritable:!1}],programId:this.programId,data:o};return new wx(s)}static createAccountWithSeed(e){const t=new xx;t.add(Mx.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:n,authorized:r,lockup:i}=e;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static createAccount(e){const t=new xx;t.add(Mx.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:n,authorized:r,lockup:i}=e;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:n,votePubkey:r}=e,i=Cx(jA.Delegate);return(new xx).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:kx,isSigner:!1,isWritable:!1},{pubkey:FA,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(e){const{stakePubkey:t,authorizedPubkey:n,newAuthorizedPubkey:r,stakeAuthorizationType:i,custodianPubkey:o}=e,s=Cx(jA.Authorize,{newAuthorized:Yw(r.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),(new xx).add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:n,authoritySeed:r,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=e,c=Cx(jA.AuthorizeWithSeed,{newAuthorized:Yw(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:r,authorityOwner:Yw(i.toBuffer())}),u=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:Ax,isSigner:!1,isWritable:!1}];return a&&u.push({pubkey:a,isSigner:!0,isWritable:!1}),(new xx).add({keys:u,programId:this.programId,data:c})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:i}=e,o=Cx(jA.Split,{lamports:i});return new wx({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(e,t){const n=new xx;return n.add(Mx.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space:this.space,programId:this.programId})),n.add(this.splitInstruction(e))}static splitWithSeed(e,t){const{stakePubkey:n,authorizedPubkey:r,splitStakePubkey:i,basePubkey:o,seed:s,lamports:a}=e,c=new xx;return c.add(Mx.allocate({accountPubkey:i,basePubkey:o,seed:s,space:this.space,programId:this.programId})),t&&t>0&&c.add(Mx.transfer({fromPubkey:e.authorizedPubkey,toPubkey:i,lamports:t})),c.add(this.splitInstruction({stakePubkey:n,authorizedPubkey:r,splitStakePubkey:i,lamports:a}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:n,authorizedPubkey:r}=e,i=Cx(jA.Merge);return(new xx).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:kx,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:n,toPubkey:r,lamports:i,custodianPubkey:o}=e,s=Cx(jA.Withdraw,{lamports:i}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:kx,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),(new xx).add({keys:a,programId:this.programId,data:s})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:n}=e,r=Cx(jA.Deactivate);return(new xx).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}UA.programId=new nx("Stake11111111111111111111111111111111111111"),UA.space=200;const ZA=Object.freeze({InitializeAccount:{index:0,layout:Nv.n_([Nv.Jq("instruction"),((e="voteInit")=>Nv.n_([cx("nodePubkey"),cx("authorizedVoter"),cx("authorizedWithdrawer"),Nv.u8("commission")],e))()])},Authorize:{index:1,layout:Nv.n_([Nv.Jq("instruction"),cx("newAuthorized"),Nv.Jq("voteAuthorizationType")])},Withdraw:{index:3,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("lamports")])},UpdateValidatorIdentity:{index:4,layout:Nv.n_([Nv.Jq("instruction")])},AuthorizeWithSeed:{index:10,layout:Nv.n_([Nv.Jq("instruction"),((e="voteAuthorizeWithSeedArgs")=>Nv.n_([Nv.Jq("voteAuthorizationType"),cx("currentAuthorityDerivedKeyOwnerPubkey"),ux("currentAuthorityDerivedKeySeed"),cx("newAuthorized")],e))()])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class HA{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:n,voteInit:r}=e,i=Cx(ZA.InitializeAccount,{voteInit:{nodePubkey:Yw(r.nodePubkey.toBuffer()),authorizedVoter:Yw(r.authorizedVoter.toBuffer()),authorizedWithdrawer:Yw(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:_x,isSigner:!1,isWritable:!1},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new wx(o)}static createAccount(e){const t=new xx;return t.add(Mx.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:t,authorizedPubkey:n,newAuthorizedPubkey:r,voteAuthorizationType:i}=e,o=Cx(ZA.Authorize,{newAuthorized:Yw(r.toBuffer()),voteAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new xx).add({keys:s,programId:this.programId,data:o})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:s}=e,a=Cx(ZA.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Yw(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:Yw(i.toBuffer()),voteAuthorizationType:o.index}}),c=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new xx).add({keys:c,programId:this.programId,data:a})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:n,lamports:r,toPubkey:i}=e,o=Cx(ZA.Withdraw,{lamports:r}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new xx).add({keys:s,programId:this.programId,data:o})}static safeWithdraw(e,t,n){if(e.lamports>t-n)throw new Error("Withdraw will leave vote account with insufficient funds.");return HA.withdraw(e)}static updateValidatorIdentity(e){const{votePubkey:t,authorizedWithdrawerPubkey:n,nodePubkey:r}=e,i=Cx(ZA.UpdateValidatorIdentity),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new xx).add({keys:o,programId:this.programId,data:i})}}HA.programId=new nx("Vote111111111111111111111111111111111111111"),HA.space=3762;new nx("Va1idator1nfo111111111111111111111111111111"),sw({name:iw(),website:nw(iw()),details:nw(iw()),keybaseUsername:nw(iw())});new nx("Vote111111111111111111111111111111111111111"),Nv.n_([cx("nodePubkey"),cx("authorizedWithdrawer"),Nv.u8("commission"),Nv._O(),Nv.A9(Nv.n_([Nv._O("slot"),Nv.Jq("confirmationCount")]),Nv.cv(Nv.Jq(),-8),"votes"),Nv.u8("rootSlotValid"),Nv._O("rootSlot"),Nv._O(),Nv.A9(Nv.n_([Nv._O("epoch"),cx("authorizedVoter")]),Nv.cv(Nv.Jq(),-8),"authorizedVoters"),Nv.n_([Nv.A9(Nv.n_([cx("authorizedPubkey"),Nv._O("epochOfLastAuthorizedSwitch"),Nv._O("targetEpoch")]),32,"buf"),Nv._O("idx"),Nv.u8("isEmpty")],"priorVoters"),Nv._O(),Nv.A9(Nv.n_([Nv._O("epoch"),Nv._O("credits"),Nv._O("prevCredits")]),Nv.cv(Nv.Jq(),-8),"epochCredits"),Nv.n_([Nv._O("slot"),Nv._O("timestamp")],"lastTimestamp")]);var zA=n(67996),GA=n(48764).Buffer;function VA(e){return e.replace(/^0x/,"")}function WA(e){if(function(e){return qA.test(e)}(e))return new nx(e).toBytes();if(e.startsWith("0x")&&e.length<=66)return(0,Zc.arrayify)((t=e,(0,Zc.hexZeroPad)(t,32)));var t;throw new Error("Invalid address")}var qA=/^([1-9A-HJ-NP-Za-km-z]{32,44})$/;var $A=Cc.O$.from("0xffffffffffffffffffffffffffffffff");var KA=class e{workerOptions=[];constructor(){}static newOptions(){return new e}static fromOptions(t){const n=new e,r=(0,Zc.arrayify)(t),i=Cc.O$.from(r.slice(0,2)).toNumber();if(3===i){let e=2;for(;e{for(const n of t.options)if(1===t.workerId)e+=VA((0,zA.pack)(["uint8","uint16","uint8","bytes"],[t.workerId,VA(n.params).length/2+1,n.type,n.params]));else if(2===t.workerId){const r=n;e+=VA((0,zA.pack)(["uint8","uint16","uint8","uint8","bytes"],[t.workerId,VA(n.params).length/2+2,r.index,r.type,r.params]))}})),e}toBytes(){return(0,Zc.arrayify)(this.toHex())}addOption(e,t){const n=this.workerOptions.find((t=>t.workerId===e));n?n.options.push(t):this.workerOptions.push({workerId:e,options:[t]})}decodeExecutorLzReceiveOption(){let e=this.findOptions(1,1);if(void 0===e||Array.isArray(e)&&0===e.length)return;let t=Cc.O$.from(0).toBigInt(),n=Cc.O$.from(0).toBigInt();e=Array.isArray(e)?e:[e];for(const r of e){const e=GA.from(VA(r.params),"hex");t+=Cc.O$.from(e.subarray(0,16)).toBigInt(),n+=Cc.O$.from(16===e.length?0:e.subarray(16,32)).toBigInt()}return{gas:t,value:n}}decodeExecutorNativeDropOption(){const e=this.findOptions(1,2);if(!e||0===e.length)return[];const t=e.reduce(((e,t)=>{const n=GA.from(VA(t.params),"hex"),r=Cc.O$.from(n.subarray(0,16)).toBigInt(),i=(0,Zc.hexlify)(n.subarray(16,48));return e[i]?e[i].amount=e[i].amount+r:e[i]={amount:r,receiver:i},e}),{});return Object.values(t)}decodeExecutorComposeOption(){const e=this.findOptions(1,3);if(!e||0===e.length)return[];const t=e.reduce(((e,t)=>{const n=GA.from(VA(t.params),"hex"),r=Cc.O$.from(n.subarray(0,2)).toNumber(),i=Cc.O$.from(n.subarray(2,18)).toBigInt(),o=(34===n.length?Cc.O$.from(n.subarray(18,34)):Cc.O$.from(0)).toBigInt();return e[r]?(e[r].gas=e[r].gas+i,e[r].value=e[r].value+o):e[r]={index:r,gas:i,value:o},e}),{});return Object.values(t)}decodeExecutorOrderedExecutionOption(){return void 0!==this.findOptions(1,4)}findOptions(e,t){const n=this.workerOptions.find((t=>t.workerId===e));if(n)return 4===t?n.options.find((e=>e.type===t)):n.options.filter((e=>e.type===t))}findVerifierOption(e,t){const n=this.workerOptions.find((e=>2===e.workerId));if(n){const r=n.options.find((n=>n.type===t&&n.index===e));if(r)return r}}};var YA=n(45703);function XA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function JA(e){for(var t=1;tNumber(c)?r("-1"):r(e.target.value))},inputProps:{"aria-label":"amount input",style:{fontSize:"21px",lineHeight:"28,01px",padding:0,height:"28px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},inputComponent:iE}),""!==t&&!o&&(0,hc.jsx)(Ed.Z,{sx:{minWidth:0,p:0,left:8,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},onClick:function(){r&&r("")},disabled:i,children:(0,hc.jsx)(lp.Z,{height:16})}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center"},"data-cy":"assetsSelectedOption_".concat(w.symbol.toUpperCase()),children:[(0,hc.jsx)(vp.UD,{symbol:w.symbol,logoURI:w.logoURI,sx:{mr:2,ml:4}}),(0,hc.jsx)(dc.Z,{variant:"main16",color:"text.primary",children:n})]})]}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",height:"16px"},children:[(0,hc.jsx)(uc.Z,{sx:{flex:1}}),w.balance&&(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsxs)(dc.Z,{component:"div",variant:"secondary12",color:"text.secondary",children:[d&&""!==d?d:(0,hc.jsx)(sc.cC,{id:"Balance"})," ",(0,hc.jsx)(kd.B,{value:w.balance,compact:!0,variant:"secondary12",color:"text.secondary",symbolsColor:"text.disabled"})]}),!o&&r&&(0,hc.jsx)(fc.Z,{size:"small",sx:{minWidth:0,ml:"7px",p:0},onClick:function(){h&&b(h.eventName,rE({},h.eventParams)),r("-1")},disabled:i||u,children:(0,hc.jsx)(sc.cC,{id:"Max"})})]})]})]})]})):null},sE=function(e){var t=e.balance,n=e.inputAmount;return Number(n)>Number(t)?(0,hc.jsx)(Sd.v,{severity:"error",sx:{mt:4},icon:!1,children:(0,hc.jsx)(dc.Z,{variant:"caption",children:(0,hc.jsx)(sc.cC,{id:"Your balance is lower than the selected amount."})})}):null},aE=function(e){var t=e.txHash,n=e.amount,r=e.symbol,i=e.iconSymbol,o=e.outAmount,s=e.outSymbol,a=e.outIconSymbol,c=e.iconUri,u=e.outIconUri;return(0,hc.jsx)(Hp,{explorer:"https://layerzeroscan.com/tx/",txHash:t,children:(0,hc.jsxs)(uc.Z,{sx:{mt:2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"},children:[(0,hc.jsx)(dc.Z,{children:(0,hc.jsx)(sc.cC,{id:"You've successfully bridged tokens."})}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",gap:2,mt:3},children:[(0,hc.jsx)(vp.UD,{sx:{fontSize:"20px"},logoURI:c,symbol:i}),(0,hc.jsx)(kd.B,{value:Number(n),compact:!0,variant:"main14"}),(0,hc.jsx)(dc.Z,{variant:"secondary14",children:r}),(0,hc.jsx)(lc.Z,{sx:{fontSize:"14px"},children:(0,hc.jsx)(Fp,{fontSize:"14px"})}),(0,hc.jsx)(vp.UD,{sx:{fontSize:"20px"},logoURI:u,symbol:a}),(0,hc.jsx)(kd.B,{value:Number(o),variant:"main14"}),(0,hc.jsx)(dc.Z,{variant:"secondary14",children:s})]})]})})},cE=function(e){var t=e.supportedNetworks,n=e.sourceChainId,r=e.setSourceChainId,i=e.destChainId,o=e.setDestChainId,s=e.tokens,a=e.selectedNetworkConfig,c=e.destNetworkConfig,u=(0,ec.useState)(""),l=u[0],d=u[1],f=(0,dd.vR)(),p=f.mainTxState,h=f.txError,m=f.setTxError,g=(0,bc.Yh)((function(e){return e.account})),y=function(){var e=s.find((function(e){return e.chainId===n}));return null!==e&&void 0!==e?e:s[0]},b=(0,ec.useState)((function(){return y()})),v=b[0],w=b[1],x=(0,ec.useState)(0),A=x[0],E=x[1];(0,ec.useEffect)((function(){var e;w(y());var t=s.find((function(e){return e.chainId===i}));E(null!==(e=null===t||void 0===t?void 0:t.eId)&&void 0!==e?e:0)}),[s]),(0,ec.useEffect)((function(){var e,t=s.find((function(e){return e.chainId===i}));E(null!==(e=null===t||void 0===t?void 0:t.eId)&&void 0!==e?e:0)}),[i,n]);var _=(0,ic.Z)().readOnlyModeAddress,k=(0,Cd.Q)(n);if(p.success)return(0,hc.jsx)(aE,{txHash:p.txHash,amount:l,symbol:v.symbol,iconSymbol:v.symbol,iconUri:a.networkLogoPath,outSymbol:v.symbol,outIconSymbol:v.symbol,outIconUri:c.networkLogoPath,outAmount:l});return(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(dc.Z,{variant:"h2",sx:{mb:3},children:"Bridge ZERO"}),(0,hc.jsx)(dc.Z,{variant:"description",sx:{mb:3},children:"Bridge ZERO to other networks using LayerZero."}),k.isWrongNetwork&&!_&&(0,hc.jsx)(Rd.I,{networkName:(0,oc.Mo)(n).name,chainId:n,event:{eventName:wc.vh.SWITCH_NETWORK}}),v?(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"left"},children:(0,hc.jsx)(vy,{networks:t,selectedNetwork:n,setSelectedNetwork:function(e){m(void 0),r(e)},isSource:!0})}),(0,hc.jsx)(uc.Z,{sx:{display:"flex",gap:"15px",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative"},children:(0,hc.jsx)(oE,{assets:s,value:l,onChange:function(e){m(void 0),d("-1"===e?v.balance:e)},usdValue:"0",symbol:v.symbol,inputTitle:" ",sx:{width:"100%"},chainId:n})}),(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"left",mt:4},children:(0,hc.jsx)(vy,{networks:t,selectedNetwork:i,setSelectedNetwork:function(e){m(void 0),o(e)},isSource:!1,sourceChainId:n})}),(0,hc.jsx)(uc.Z,{sx:{display:"flex",gap:"15px",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative"},children:(0,hc.jsx)(oE,{assets:s,value:l,usdValue:"0",symbol:v.symbol,disableInput:!0,inputTitle:" ",sx:{width:"100%"},chainId:i})}),g?(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(sE,{balance:v.balance,inputAmount:l}),h&&(0,hc.jsx)(Dd.Q,{txError:h}),(0,hc.jsx)(QA,{isWrongNetwork:k.isWrongNetwork,inputAmount:l,inputToken:v.address,outputToken:v.address,inputName:v.name,outputName:v.name,blocked:Number(l)>Number(v.balance)||!g,chainId:n,targetEId:A})]}):(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:4,alignItems:"center"},children:[(0,hc.jsx)(dc.Z,{sx:{mb:6,textAlign:"center"},color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Please connect your wallet to be able to bridge ZERO."})}),(0,hc.jsx)(kc.p,{})]})]}):(0,hc.jsx)(_c.Z,{})]})};function uE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lE(e){for(var t=1;t=1?(0,hc.jsx)(cE,{sourceChainId:c,setSourceChainId:u,destChainId:f,setDestChainId:p,supportedNetworks:gy,tokens:x,selectedNetworkConfig:y,destNetworkConfig:b},c):s?(0,hc.jsx)(uc.Z,{sx:{width:"100%",display:"flex",justifyContent:"center",my:"60px"},children:(0,hc.jsx)(_c.Z,{})}):(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:4,alignItems:"center"},children:[(0,hc.jsx)(dc.Z,{sx:{mb:6,mt:4,textAlign:"center"},color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Please connect your wallet to be able to bridge ZERO."})}),(0,hc.jsx)(kc.p,{})]})})},hE=n(90452),mE=n(31041),gE=n(31630),yE=n(97452),bE=n(52864),vE=n(65637),wE=n(5906),xE=["from"],AE=["from"];function EE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _E(e){for(var t=1;t(0,dm.Z)({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},t&&!e.vars&&{colorScheme:e.palette.mode}),OE=e=>(0,dm.Z)({color:(e.vars||e).palette.text.primary},e.typography.body1,{backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}});var RE=function(e){const t=(0,mm.Z)({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=t;return(0,hc.jsxs)(ec.Fragment,{children:[(0,hc.jsx)(CE.Z,{styles:e=>((e,t=!1)=>{var n,r;const i={};t&&e.colorSchemes&&Object.entries(e.colorSchemes).forEach((([t,n])=>{var r;i[e.getColorSchemeSelector(t).replace(/\s*&/,"")]={colorScheme:null==(r=n.palette)?void 0:r.mode}}));let o=(0,dm.Z)({html:IE(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:(0,dm.Z)({margin:0},OE(e),{"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}})},i);const s=null==(n=e.components)||null==(r=n.MuiCssBaseline)?void 0:r.styleOverrides;return s&&(o=[o,s]),o})(e,r)}),n]})},DE=n(19762),PE=n(44819),BE=n(56760);var ME="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";var NE=function(e){const{children:t,theme:n}=e,r=(0,BE.Z)(),i=ec.useMemo((()=>{const e=null===r?n:function(e,t){if("function"===typeof t)return t(e);return(0,dm.Z)({},e,t)}(r,n);return null!=e&&(e[ME]=null!==r),e}),[n,r]);return(0,hc.jsx)(PE.Z.Provider,{value:i,children:t})},FE=n(96682);function LE(e){const t=(0,FE.Z)();return(0,hc.jsx)(y.T.Provider,{value:"object"===typeof t?t:{},children:e.children})}var jE=function(e){const{children:t,theme:n}=e;return(0,hc.jsx)(NE,{theme:n,children:(0,hc.jsx)(LE,{children:t})})},UE=n(59766),ZE=n(38264);var HE=ec.forwardRef((function(e,t){return ec.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),ec.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))}));function zE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function GE(e){for(var t=1;t div:first-of-type":{minHeight:"100vh",display:"flex",flexDirection:"column"}}}},MuiSvgIcon:{styleOverrides:{colorPrimary:{color:e.palette.primary.light}}},MuiSelect:{defaultProps:{IconComponent:function(e){return(0,hc.jsx)(lc.Z,GE(GE({sx:{fontSize:"16px"}},e),{},{children:(0,hc.jsx)(Bd.Z,{})}))}},styleOverrides:{outlined:GE(GE({backgroundColor:e.palette.background.surface},e.typography.buttonM),{},{padding:"6px 12px",color:e.palette.primary.light})}},MuiLinearProgress:{styleOverrides:{bar1Indeterminate:{background:e.palette.gradients.aaveGradient},bar2Indeterminate:{background:e.palette.gradients.aaveGradient}}}}}}(e))}),[r]);return(0,hc.jsx)(qE.Provider,{value:s,children:(0,hc.jsxs)(jE,{theme:a,children:[(0,hc.jsx)(RE,{}),t]})})}var KE,YE=n(35683),XE=n(4298),JE=function(e){var t=e.isApproved,n=e.handleLockAction,r=e.mainTxState,i=e.approvalTxState,o=e.vest,s=(0,ic.Z)().readOnlyModeAddress;var a=null!==r&&void 0!==r&&r.loading?{loading:!0,disabled:!0,content:o.penalty.gt(0)&&o.hasPenalty?"Exit Early":"Claim ZERO"}:null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:"Approving Vest"}:t||null!==i&&void 0!==i&&i.success?t?{loading:!1,disabled:!1,content:o.penalty.gt(0)&&o.hasPenalty?"Exit Early":"Claim ZERO"}:{content:o.penalty.gt(0)&&o.hasPenalty?"Exit Early":"Claim ZERO",handleClick:n}:{disabled:!1,content:"Approve Vest"},c=a.loading,u=a.disabled,l=a.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==s||u||c,onClick:n,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[c&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),l]}),s&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})};function QE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function e_(e){for(var t=1;t1&&(0,hc.jsx)(v_,{vests:f,selectedVest:l,setSelectedVest:function(e){return d(e)}})}),(0,hc.jsxs)(uc.Z,{children:[(0,hc.jsx)(Yh.Z,{sx:{mb:1,color:"text.secondary"},children:(0,hc.jsx)(sc.cC,{id:"Enter Wallet Address"})}),(0,hc.jsx)(mp.ZP,{sx:function(e){return{py:1,px:3,border:"1px solid ".concat(e.palette.divider),borderRadius:"6px",mb:1,overflow:"show",fontSize:y?"16px":"14px"}},placeholder:"Enter ethereum address or username",fullWidth:!0,value:h,onChange:function(e){return m(e.target.value)},inputProps:{"aria-label":"read-only mode address"}}),(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:function(){switch(v){case h_.ALREADY_STAKE:return(0,hc.jsx)(sc.cC,{id:"This vest is already staked"});case h_.NOT_A_VALID_ADDRESS:return(0,hc.jsx)(sc.cC,{id:"Not a valid address"});default:return null}}()})]}),l&&(0,hc.jsxs)(Id.m6,{gasLimit:n,children:[(0,hc.jsx)(Id.aY,{description:"Vest ID",value:"#".concat(l.toString())}),(0,hc.jsx)(Id.aY,{description:"Transfer To",value:(0,hc.jsx)(w_.E,{compact:!0,loading:!1,children:h})})]}),i&&(0,hc.jsx)(Dd.Q,{txError:i}),(0,hc.jsx)(b_,{isWrongNetwork:w,selectedReward:{},blocked:void 0!==v})]})},T_=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.TransferVest,setOpen:n,children:(0,hc.jsx)(k_,{vestId:r.vestId})})},S_=function(e){var t=e.isApproved,n=e.handleLockAction,r=e.mainTxState,i=e.approvalTxState,o=e.vestId,s=e.isClaimable,a=(0,ic.Z)().readOnlyModeAddress;var c=s?null!==r&&void 0!==r&&r.loading?{loading:!0,disabled:!0,content:"Claiming Vest #".concat(o)}:null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:"Approving ZERO"}:t||null!==i&&void 0!==i&&i.success?t?{loading:!1,disabled:!1,content:"Claim Vest #".concat(o)}:{content:"Claim Vest",handleClick:n}:{disabled:!1,content:"Approve ZERO"}:{disabled:!0,content:"Not enough to Claim"},u=c.loading,l=c.disabled,d=c.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==a||l||u,onClick:n,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[u&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),d]}),a&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})},C_=function(e){var t=e.vests,n=e.setSelectedVest,r=e.selectedVest;return(0,hc.jsxs)(Md.Z,{sx:{mb:1,width:"100%"},children:[(0,hc.jsx)(Yh.Z,{sx:{mb:1,color:"text.secondary"},children:(0,hc.jsx)(sc.cC,{id:"All your vests"})}),(0,hc.jsx)(Nd.Z,{value:r,onChange:function(e){return n(Number(e.target.value))},sx:{width:"100%",height:"44px",borderRadius:"6px",borderColor:"divider",outline:"none !important",color:"text.primary",".MuiOutlinedInput-input":{backgroundColor:"transparent"},"&:hover .MuiOutlinedInput-notchedOutline, .MuiOutlinedInput-notchedOutline":{borderColor:"divider",outline:"none !important",borderWidth:"1px"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"},".MuiSelect-icon":{color:"text.primary"}},native:!1,renderValue:function(e){var n=Number(e),r=t.find((function(e){return e.id===n}));return(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:(0,hc.jsx)(dc.Z,{color:"text.primary",children:r.id})})},children:t.map((function(e){return(0,hc.jsx)(Fd.Z,{value:e.id,children:(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:(0,hc.jsxs)(dc.Z,{variant:"subheader1",sx:{mr:1},children:["Vest id: ",e.id]})})},"vest-id-".concat(e.id))}))})]})};function I_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O_(e){for(var t=1;t1&&(0,hc.jsx)(C_,{vests:w,selectedVest:b,setSelectedVest:function(e){return v(e)}}),b&&(0,hc.jsxs)(Id.m6,{gasLimit:n,children:[(0,hc.jsx)(Id.aY,{description:"Vest ID #",value:b}),(0,hc.jsx)(Id.oD,{description:"Claimable Amount",value:e.claimableAmount,symbol:"ZERO"})]}),a&&(0,hc.jsx)(Dd.Q,{txError:a}),(0,hc.jsx)(S_,{mainTxState:r,approvalTxState:u,isApproved:!0,handleLockAction:T,vestId:e.vestId,isClaimable:Number(e.claimableAmount)>0})]})},P_=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.ClaimVestedTokens,setOpen:n,children:(0,hc.jsx)(D_,{vestId:r.vestId,claimableAmount:r.amount})})},B_=function(e){var t=e.isWrongNetwork,n=e.isApproved,r=e.handleVestAction,i=e.mainTxState,o=e.approvalTxState,s=e.isClaimed,a=e.text,c=(0,ic.Z)().readOnlyModeAddress;var u=null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:a}:s?{disabled:!0,content:"Already claimed"}:t?{disabled:!0}:n?{loading:!1,disabled:!1,content:a}:n||null!==o&&void 0!==o&&o.success?{disabled:!1,content:a,handleClick:r}:{disabled:!1,content:"Approve EZERO"},l=u.loading,d=u.disabled,f=u.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==c||d||l,onClick:r,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[l&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),f]}),c&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})},M_=n(18377);function N_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function F_(e){for(var t=1;t0)if(u.chainId===zd.a_.mainnet){var f=s.find((function(e){return"AAVE"===e.symbol}));d=f?Number(f.priceInUSD):0}else s.forEach((function(e){e.isWrappedBaseAsset&&(d=Number(e.priceInUSD))}));else d=Number(c.rewardPriceFeed);var p=Number(l)*d;p>0&&(c.assets.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),e.push({assets:c.assets,incentiveControllerAddress:c.incentiveControllerAddress,symbol:c.rewardTokenSymbol,balance:l,balanceUsd:p.toString(),rewardTokenAddress:r}),t+=Number(p))}})),1===e.length)b(e[0].symbol);else if(e.length>1&&!C){var r={assets:n,incentiveControllerAddress:e[0].incentiveControllerAddress,symbol:"all",balance:"0",balanceUsd:t.toString(),rewardTokenAddress:""};b("all"),_(r)}x(e),m(t.toString())}),[]);var T=void 0;"0"===h&&(T=rk.NOT_ENOUGH_BALANCE);var S=c!==d,C="all"===y?E:w.find((function(e){return e.symbol===y}));return r&&r.blocking?(0,hc.jsx)(jh.D,{txError:r}):n.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"Claimed"}),amount:null===C||void 0===C?void 0:C.balanceUsd}):(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Od.E,{title:"Claim rewards "}),S&&!f&&(0,hc.jsx)(Rd.I,{networkName:k.name,chainId:c}),void 0!==T&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:T===rk.NOT_ENOUGH_BALANCE?(0,hc.jsx)(sc.cC,{id:"Your reward balance is 0"}):null}),w.length>1&&(0,hc.jsx)(ak,{rewards:w,selectedReward:y,setSelectedReward:b}),C&&(0,hc.jsxs)(Id.m6,{gasLimit:t,children:["all"===y&&(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Td.X,{caption:(0,hc.jsx)(sc.cC,{id:"Balance"}),captionVariant:"description",align:"flex-start",mb:"all"!==C.symbol?0:4,children:(0,hc.jsx)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:w.map((function(e){return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",mb:4},children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,hc.jsx)(vp.T1,{symbol:e.symbol,sx:{mr:1,fontSize:"16px"}}),(0,hc.jsx)(kd.B,{value:Number(e.balance),variant:"secondary14"}),(0,hc.jsx)(dc.Z,{ml:1,variant:"secondary14",children:e.symbol})]}),(0,hc.jsx)(kd.B,{value:Number(e.balanceUsd),variant:"helperText",compact:!0,symbol:"USD",color:"text.secondary"})]},"claim-".concat(e.symbol))}))})}),(0,hc.jsx)(Id.oD,{description:(0,hc.jsx)(sc.cC,{id:"Total worth"}),value:h})]}),"all"!==y&&(0,hc.jsx)(Id.XJ,{symbol:(0,hc.jsx)(vp.T1,{symbol:C.symbol}),futureValue:C.balance,futureValueUSD:C.balanceUsd,description:(0,hc.jsx)(sc.cC,{id:"{0} Balance",values:{0:C.symbol}})})]}),r&&(0,hc.jsx)(Dd.Q,{txError:r}),(0,hc.jsx)(sk,{isWrongNetwork:S,selectedReward:null!==C&&void 0!==C?C:{},blocked:void 0!==T})]})},lk=function(){var e=(0,dd.vR)(),t=e.type,n=e.close;return(0,hc.jsx)(pc.P,{open:t===dd.w8.ClaimZEROLpIncentives,setOpen:n,children:(0,hc.jsx)(uk,{})})},dk=function(e){var t=e.isApproved,n=e.handleLockAction,r=e.mainTxState,i=e.approvalTxState,o=e.isClaimable,s=(0,ic.Z)().readOnlyModeAddress;var a=o?null!==r&&void 0!==r&&r.loading?{loading:!0,disabled:!0,content:"Claiming Incentives"}:null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:"Approving ZERO"}:t||null!==i&&void 0!==i&&i.success?t?{loading:!1,disabled:!1,content:"Claim Staking Rewards"}:{content:"Claim Staking Rewards",handleClick:n}:{disabled:!1,content:"Approve ZERO"}:{disabled:!0,content:"Not enough to Claim"},c=a.loading,u=a.disabled,l=a.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==s||u||c,onClick:n,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[c&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),l]}),s&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})};function fk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pk(e){for(var t=1;t0})]})},gk=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.ClaimZEROLockerIncentives,setOpen:n,children:(0,hc.jsx)(mk,{amount:r.amount||""})})},yk=function(e){var t=e.isApproved,n=e.handleLockAction,r=e.mainTxState,i=e.approvalTxState,o=e.vestId,s=e.isVests,a=e.isClaimableSufficient,c=(0,ic.Z)().readOnlyModeAddress;var u=a?s?null!==r&&void 0!==r&&r.loading?{loading:!0,disabled:!0,content:0===o?"Claiming All Vests":"Claiming Vest #".concat(o)}:null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:"Approving ZERO"}:t||null!==i&&void 0!==i&&i.success?t?{loading:!1,disabled:!1,content:0===o?"Claim All Vests":"Claim Vest #".concat(o)}:{content:"Stake ZERO",handleClick:n}:{disabled:!1,content:"Approve ZERO"}:{disabled:!0,content:"Not Vests Available"}:{disabled:!0,content:"Insufficient Amount"},l=u.loading,d=u.disabled,f=u.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==c||d||l,onClick:n,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[l&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),f]}),c&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})},bk=function(e){var t=e.nfts,n=e.selectedNFT,r=e.setSelectedNFT;return(0,hc.jsxs)(Md.Z,{sx:{mb:1,width:"100%"},children:[(0,hc.jsx)(Yh.Z,{sx:{mb:1,color:"text.secondary"},children:"Unlocked Vest".concat("0"===n?"(s)":""," to claim")}),(0,hc.jsxs)(Nd.Z,{value:n,onChange:function(e){r(e.target.value)},sx:{width:"100%",height:"44px",borderRadius:"6px",borderColor:"divider",outline:"none !important",color:"text.primary",".MuiOutlinedInput-input":{backgroundColor:"transparent"},"&:hover .MuiOutlinedInput-notchedOutline, .MuiOutlinedInput-notchedOutline":{borderColor:"divider",outline:"none !important",borderWidth:"1px"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"},".MuiSelect-icon":{color:"text.primary"}},native:!1,renderValue:function(e){if("0"===e)return(0,hc.jsx)(dc.Z,{color:"text.primary",children:(0,hc.jsx)(sc.cC,{id:"Claim all Vests"})});var n=t.find((function(t){return t.id.toString()===e}));return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,hc.jsx)(vp.T1,{symbol:"ZERO",sx:{mr:2,fontSize:"16px"}}),(0,hc.jsxs)(dc.Z,{color:"text.primary",children:["Vest #",n.id.toString()]})]})},children:[(0,hc.jsx)(Fd.Z,{value:"0",children:(0,hc.jsx)(dc.Z,{variant:"subheader1",children:(0,hc.jsx)(sc.cC,{id:"Claim all Vests"})})}),(0,hc.jsx)(Xh.Z,{}),t.map((function(e,t){return(0,hc.jsx)(Fd.Z,{value:e.id.toString(),children:(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},width:"100%",children:[(0,hc.jsxs)(dc.Z,{variant:"subheader1",sx:{mr:1},flex:1,children:["Vest #",e.id.toString()]}),(0,hc.jsxs)(uc.Z,{children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[(0,hc.jsx)(kd.B,{value:(0,xd.Fv)(e.claimable.toString(),18).toString(),variant:"h4",compact:!0}),(0,hc.jsx)(vp.T1,{symbol:"zero",sx:{ml:1,fontSize:"16px"}})]}),(0,hc.jsxs)(uc.Z,{children:[(0,hc.jsx)(dc.Z,{component:"span",sx:{display:"inline-flex",alignItems:"center"},variant:"caption",color:"text.muted",children:"~"}),(0,hc.jsx)(kd.B,{value:(0,xd.Fv)(e.claimable.toString(),18).toString(),variant:"caption",compact:!0,symbol:"USD",symbolsColor:"text.muted",color:"text.muted"})]})]})]})},t)}))]})]})};function vk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wk(e){for(var t=1;t1&&(0,hc.jsx)(bk,{nfts:t,selectedNFT:0===v?"0":v.toString(),setSelectedNFT:function(e){w(Number(e))}}),(0,hc.jsxs)(Id.m6,{gasLimit:r,children:[0===v&&(0,hc.jsx)(hc.Fragment,{children:t&&t.filter((function(e){return e.claimable.gt(0)})).map((function(e,t){return(0,hc.jsx)(Td.X,{caption:(0,hc.jsx)(sc.cC,{id:"Vest #{0}",values:{0:e.id.toString()}}),captionVariant:"description",align:"flex-start",mb:0!==v?0:4,children:(0,hc.jsx)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",mb:4},children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,hc.jsx)(dc.Z,{ml:1,variant:"secondary14"}),(0,hc.jsx)(kd.B,{value:(0,xd.Fv)(e.claimable.toString(),18),variant:"secondary14",symbol:"ZERO"})]}),(0,hc.jsx)(kd.B,{value:(0,xd.Fv)(e.claimable.toString(),18),variant:"helperText",compact:!0,symbol:"USD",color:"text.secondary"})]},"claim-".concat(e.id.toString()))})},t)}))}),0!==v&&O&&(0,hc.jsx)(Id.XJ,{symbol:(0,hc.jsx)(vp.T1,{symbol:"ZERO"}),futureValue:(0,xd.Fv)(O.claimable.toString(),18),futureValueUSD:(0,xd.Fv)(O.claimable.toString(),18),description:(0,hc.jsx)(sc.cC,{id:"Vest #{0} Claimable Amount",values:{0:O.id.toString()}})}),0===v&&(0,hc.jsx)(Id.XJ,{symbol:(0,hc.jsx)(vp.T1,{symbol:"ZERO"}),futureValue:(0,xd.Fv)(T.toString(),18),futureValueUSD:(0,xd.Fv)(T.toString(),18),description:(0,hc.jsx)(sc.cC,{id:"Total Claimable Amount"})})]}),a&&(0,hc.jsx)(Dd.Q,{txError:a}),(0,hc.jsx)(yk,{mainTxState:i,approvalTxState:u,isApproved:!0,handleLockAction:S,vestId:v,isVests:t.length>0,isClaimableSufficient:0===v||(null===O||void 0===O?void 0:O.claimable.gt(0))})]})},Ek=function(){var e,t,n,r=(0,dd.vR)(),i=r.type,o=r.close,s=r.args;return(0,hc.jsx)(pc.P,{open:i===dd.w8.ClaimZEROVestsRewards,setOpen:o,children:(0,hc.jsx)(Ak,{vests:null!==(e=null===(t=s.vests)||void 0===t?void 0:t.filter((function(e){return!e.claimable.eq(0)&&!e.hasPenalty})))&&void 0!==e?e:[],vestLoading:null!==(n=s.vestLoading)&&void 0!==n&&n})})},_k=function(e){var t=e.isWrongNetwork,n=e.isApproved,r=e.handleVestAction,i=e.mainTxState,o=e.approvalTxState,s=e.isClaimed,a=e.text,c=(0,ic.Z)().readOnlyModeAddress;var u=null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:a}:s?{disabled:!0,content:"Already claimed"}:t?{disabled:!0}:n?{loading:!1,disabled:!1,content:a}:n||null!==o&&void 0!==o&&o.success?{disabled:!1,content:a,handleClick:r}:{disabled:!1,content:"Approve EZERO"},l=u.loading,d=u.disabled,f=u.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==c||d||l,onClick:r,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[l&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),f]}),c&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})},kk=function(){var e=(0,TE.z)().airdropDataService,t=(0,ic.Z)().currentAccount;return(0,Sc.a)({queryFn:function(){var n=(0,o.Z)(d().mark((function n(){return d().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.getUserRewardClaimed(t);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),queryKey:["USER_REWARD_CLAIMED"],enabled:!!t,refetchInterval:cd.g_})};function Tk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sk(e){for(var t=1;t0&&(0,hc.jsx)(Sd.v,{severity:"error",sx:{mb:2},children:(0,hc.jsx)(dc.Z,{variant:"caption",children:c})}),"not-successful"===o&&(0,hc.jsx)(Sd.v,{severity:"error",sx:{mb:2},children:(0,hc.jsx)(dc.Z,{variant:"caption",children:"Something Went Wrong"})}),r&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mb:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to link referral code."})}),(0,hc.jsxs)(fc.Z,{variant:"contained",fullWidth:!0,disabled:!!r||0===t.length||"in-progress"===o,onClick:function(){l((function(){return s("in-progress")}),(function(){n(!1),s("successful")}),(function(e){u(e),s("not-successful")}))},children:["in-progress"===o&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),"Verify Wallet"]})]})]})},Fk=n(11163),Lk=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args,i=bc.Yh.getState().setInvite;return(0,hc.jsx)(pc.P,{open:t===dd.w8.LinkReferralCode,setOpen:function(){localStorage.setItem("invite",""),i(""),Fk.default.push({pathname:"/gravity"},void 0,{shallow:!0}),n()},children:(0,hc.jsx)(Nk,{inviteReferrerCode:r.referrerCode||"",setOpen:n})})},jk=n(81374),Uk=function(e){var t=e.amount,n=e.isApproved,r=e.handleLockAction,i=e.mainTxState,o=e.approvalTxState,s=e.text,a=e.loadingText,c=(0,ic.Z)().readOnlyModeAddress;var u=!t||Number(t)<.1?{disabled:!0,content:s}:null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:a}:null!==o&&void 0!==o&&o.loading?{loading:!0,disabled:!0,content:"Approving ZERO"}:n||null!==o&&void 0!==o&&o.success?n?{loading:!1,disabled:!1,content:s}:{content:s,handleClick:r}:{disabled:!1,content:"Approve ZERO"},l=u.loading,d=u.disabled,f=u.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==c||d||l,onClick:r,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[l&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),f]}),c&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})},Zk=n(82482);function Hk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zk(e){for(var t=1;t0})]})},AT=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.ClaimLPLockerIncentives,setOpen:n,children:(0,hc.jsx)(xT,{amount:r.amount||""})})};function ET(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _T(e){for(var t=1;t{I.j.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())})),this.unsubscribeOnline=O.N.subscribe((()=>{O.N.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())})))}unmount(){var e,t;this.mountCount--,0===this.mountCount&&(null==(e=this.unsubscribeFocus)||e.call(this),this.unsubscribeFocus=void 0,null==(t=this.unsubscribeOnline)||t.call(this),this.unsubscribeOnline=void 0)}isFetching(e,t){const[n]=(0,b.I6)(e,t);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var n;return null==(n=this.queryCache.find(e,t))?void 0:n.state.data}ensureQueryData(e,t,n){const r=(0,b._v)(e,t,n),i=this.getQueryData(r.queryKey);return i?Promise.resolve(i):this.fetchQuery(r)}getQueriesData(e){return this.getQueryCache().findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,n){const r=this.queryCache.find(e),i=null==r?void 0:r.state.data,o=(0,b.SE)(t,i);if("undefined"===typeof o)return;const s=(0,b._v)(e),a=this.defaultQueryOptions(s);return this.queryCache.build(this,a).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return w.V.batch((()=>this.getQueryCache().findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,n)]))))}getQueryState(e,t){var n;return null==(n=this.queryCache.find(e,t))?void 0:n.state}removeQueries(e,t){const[n]=(0,b.I6)(e,t),r=this.queryCache;w.V.batch((()=>{r.findAll(n).forEach((e=>{r.remove(e)}))}))}resetQueries(e,t,n){const[r,i]=(0,b.I6)(e,t,n),o=this.queryCache,s={type:"active",...r};return w.V.batch((()=>(o.findAll(r).forEach((e=>{e.reset()})),this.refetchQueries(s,i))))}cancelQueries(e,t,n){const[r,i={}]=(0,b.I6)(e,t,n);"undefined"===typeof i.revert&&(i.revert=!0);const o=w.V.batch((()=>this.queryCache.findAll(r).map((e=>e.cancel(i)))));return Promise.all(o).then(b.ZT).catch(b.ZT)}invalidateQueries(e,t,n){const[r,i]=(0,b.I6)(e,t,n);return w.V.batch((()=>{var e,t;if(this.queryCache.findAll(r).forEach((e=>{e.invalidate()})),"none"===r.refetchType)return Promise.resolve();const n={...r,type:null!=(e=null!=(t=r.refetchType)?t:r.type)?e:"active"};return this.refetchQueries(n,i)}))}refetchQueries(e,t,n){const[r,i]=(0,b.I6)(e,t,n),o=w.V.batch((()=>this.queryCache.findAll(r).filter((e=>!e.isDisabled())).map((e=>{var t;return e.fetch(void 0,{...i,cancelRefetch:null==(t=null==i?void 0:i.cancelRefetch)||t,meta:{refetchPage:r.refetchPage}})}))));let s=Promise.all(o).then(b.ZT);return null!=i&&i.throwOnError||(s=s.catch(b.ZT)),s}fetchQuery(e,t,n){const r=(0,b._v)(e,t,n),i=this.defaultQueryOptions(r);"undefined"===typeof i.retry&&(i.retry=!1);const o=this.queryCache.build(this,i);return o.isStaleByTime(i.staleTime)?o.fetch(i):Promise.resolve(o.state.data)}prefetchQuery(e,t,n){return this.fetchQuery(e,t,n).then(b.ZT).catch(b.ZT)}fetchInfiniteQuery(e,t,n){const r=(0,b._v)(e,t,n);return r.behavior=(0,R.Gm)(),this.fetchQuery(r)}prefetchInfiniteQuery(e,t,n){return this.fetchInfiniteQuery(e,t,n).then(b.ZT).catch(b.ZT)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){const n=this.queryDefaults.find((t=>(0,b.yF)(e)===(0,b.yF)(t.queryKey)));n?n.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;const t=this.queryDefaults.find((t=>(0,b.to)(e,t.queryKey)));return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){const n=this.mutationDefaults.find((t=>(0,b.yF)(e)===(0,b.yF)(t.mutationKey)));n?n.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;const t=this.mutationDefaults.find((t=>(0,b.to)(e,t.mutationKey)));return null==t?void 0:t.defaultOptions}defaultQueryOptions(e){if(null!=e&&e._defaulted)return e;const t={...this.defaultOptions.queries,...this.getQueryDefaults(null==e?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=(0,b.Rm)(t.queryKey,t)),"undefined"===typeof t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),"undefined"===typeof t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==e?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}};function CT(e){var t,n=e.Component,r=e.emotionCache,i=void 0===r?kT:r,o=e.pageProps,s=null!==(t=n.getLayout)&&void 0!==t?t:function(e){return e},a=(0,bc.Yh)((function(e){return e.initializeMixpanel})),c="56a73cd233d8c404b823d000f9a807c3";(0,ec.useEffect)((function(){var e;(e={dsn:"https://629466fb3bc0091f0af74dbf30bb0a76@o4505951646121984.ingest.sentry.io/4505963347312640",integrations:[new pi({}),new Ya],tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1})._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:M}],version:M},pr(e)}),[]),(0,ec.useEffect)((function(){a()}),[c,a]);var u=(0,jk.ce)("invite");return(0,ec.useEffect)((function(){u&&localStorage.setItem("invite",u)}),[u]),(0,hc.jsxs)(y.C,{value:i,children:[(0,hc.jsx)(Qa.default,{children:(0,hc.jsx)("meta",{name:"viewport",content:"initial-scale=1, width=device-width"})}),(0,hc.jsx)(yc,{title:"Open Source Liquidity Protocol on Layer 2s",description:"ZeroLend is an Open Source Protocol to create Non-Custodial Liquidity Markets to earn interest on supplying and borrowing assets with a variable or stable interest rate.",imageUrl:"https://i.imgur.com/KaP3sNh.png"}),(0,hc.jsx)(YE.iL,{children:(0,hc.jsxs)(D.aH,{client:ST,children:[(0,hc.jsx)(B.Web3ReactProvider,{getLibrary:TT,children:(0,hc.jsx)(kE,{children:(0,hc.jsx)($E,{children:(0,hc.jsx)(gc,{children:(0,hc.jsx)(hE.W,{children:(0,hc.jsx)(dd.ny,{children:(0,hc.jsx)(dh.R,{children:(0,hc.jsx)(ih.GM,{children:(0,hc.jsx)(rg.Wv,{children:(0,hc.jsxs)(TE._,{children:[(0,hc.jsx)(XE.default,{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=G-4BXYGRCH1M"}),(0,hc.jsx)(XE.default,{src:"https://attribution.metacrm.inc/tracking-1-1-1.js\u201d data-entity-id=\u201c661662c4265d2715bc8a1b19",id:"metacrm-tracking",integrity:"sha384-KVT0cdwbRt/fjdhbbEcHAVvFdtrAkBuvoip0q/+NDjPC73iAPNEkAXLkGOre5AUP",crossOrigin:"anonymous",apiKey:"mjrsl5d8kun"}),(0,hc.jsx)(XE.default,{id:"google-analytics",children:"window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-4BXYGRCH1M');"}),(0,hc.jsx)(XE.default,{id:"heap-analytics",children:'window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o=3?y.success.main:b<1.1?y.error.main:y.warning.main,(0,p.jsxs)(c.Z,{sx:{display:"inline-flex",alignItems:{xs:"flex-start",xsm:"center"},flexDirection:{xs:"column",xsm:"row"}},"data-cy":"HealthFactorTopPannel",children:["-1"===t?(0,p.jsx)(u.Z,{variant:"secondary14",color:y.success.main,children:"\u221e"}):(0,p.jsx)(f.B,g({value:b,sx:g({color:v},m.sx),visibleDecimals:2,compact:!0},m)),n&&(0,p.jsx)(l.Z,{onClick:n,variant:"surface",size:"small",sx:{minWidth:"unset",ml:{xs:0,xsm:2}},children:(0,p.jsx)(o.cC,{id:"Risk details"})}),r&&(0,p.jsx)(c.Z,{ml:{xs:0,xsm:2},mt:{xs:1,xsm:0},children:r})]})}},16693:function(e,t,n){"use strict";n.d(t,{gO:function(){return oe},tF:function(){return se},St:function(){return ie},hu:function(){return re}});var r=n(59499),i=n(49501),o=n(61782),s=n(87462),a=n(63366),c=n(67294),u=n(86010),l=n(94780),d=n(57579),f=n(81719),p=n(78884),h=n(96480),m=n(37630),g=n(84246),y=n(56594),b=n(59711),v=n(47546),w=n(65410),x=n(34867),A=n(1588);function E(e){return(0,x.Z)("MuiInputLabel",e)}(0,A.Z)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);var _=n(85893);const k=["disableAnimation","margin","shrink","variant","className"],T=(0,f.ZP)(v.Z,{shouldForwardProp:e=>(0,f.FO)(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${w.Z.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,"small"===n.size&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,t[n.variant]]}})((({theme:e,ownerState:t})=>(0,s.Z)({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},t.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},"small"===t.size&&{transform:"translate(0, 17px) scale(1)"},t.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!t.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},"filled"===t.variant&&(0,s.Z)({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===t.size&&{transform:"translate(12px, 13px) scale(1)"},t.shrink&&(0,s.Z)({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},"small"===t.size&&{transform:"translate(12px, 4px) scale(0.75)"})),"outlined"===t.variant&&(0,s.Z)({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===t.size&&{transform:"translate(14px, 9px) scale(1)"},t.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 24px)",transform:"translate(14px, -9px) scale(0.75)"}))));var S=c.forwardRef((function(e,t){const n=(0,p.Z)({name:"MuiInputLabel",props:e}),{disableAnimation:r=!1,shrink:i,className:o}=n,c=(0,a.Z)(n,k),d=(0,b.Z)();let f=i;"undefined"===typeof f&&d&&(f=d.filled||d.focused||d.adornedStart);const h=(0,y.Z)({props:n,muiFormControl:d,states:["size","variant","required"]}),m=(0,s.Z)({},n,{disableAnimation:r,formControl:d,shrink:f,size:h.size,variant:h.variant,required:h.required}),g=(e=>{const{classes:t,formControl:n,size:r,shrink:i,disableAnimation:o,variant:a,required:c}=e,u={root:["root",n&&"formControl",!o&&"animated",i&&"shrink","small"===r&&"sizeSmall",a],asterisk:[c&&"asterisk"]},d=(0,l.Z)(u,E,t);return(0,s.Z)({},t,d)})(m);return(0,_.jsx)(T,(0,s.Z)({"data-shrink":f,ownerState:m,ref:t,className:(0,u.default)(g.root,o)},c,{classes:g}))})),C=n(55343),I=n(36622);function O(e){return(0,x.Z)("MuiFormHelperText",e)}var R,D=(0,A.Z)("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);const P=["children","className","component","disabled","error","filled","focused","margin","required","variant"],B=(0,f.ZP)("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${(0,I.Z)(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})((({theme:e,ownerState:t})=>(0,s.Z)({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${D.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${D.error}`]:{color:(e.vars||e).palette.error.main}},"small"===t.size&&{marginTop:4},t.contained&&{marginLeft:14,marginRight:14})));var M=c.forwardRef((function(e,t){const n=(0,p.Z)({props:e,name:"MuiFormHelperText"}),{children:r,className:i,component:o="p"}=n,c=(0,a.Z)(n,P),d=(0,b.Z)(),f=(0,y.Z)({props:n,muiFormControl:d,states:["variant","size","disabled","error","filled","focused","required"]}),h=(0,s.Z)({},n,{component:o,contained:"filled"===f.variant||"outlined"===f.variant,variant:f.variant,size:f.size,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required}),m=(e=>{const{classes:t,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:c}=e,u={root:["root",i&&"disabled",o&&"error",r&&`size${(0,I.Z)(r)}`,n&&"contained",a&&"focused",s&&"filled",c&&"required"]};return(0,l.Z)(u,O,t)})(h);return(0,_.jsx)(B,(0,s.Z)({as:o,ownerState:h,className:(0,u.default)(m.root,i),ref:t},c,{children:" "===r?R||(R=(0,_.jsx)("span",{className:"notranslate",children:"\u200b"})):r}))})),N=n(46541);function F(e){return(0,x.Z)("MuiTextField",e)}(0,A.Z)("MuiTextField",["root"]);const L=["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"],j={standard:h.Z,filled:m.Z,outlined:g.Z},U=(0,f.ZP)(C.Z,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({});var Z=c.forwardRef((function(e,t){const n=(0,p.Z)({props:e,name:"MuiTextField"}),{autoComplete:r,autoFocus:i=!1,children:o,className:c,color:f="primary",defaultValue:h,disabled:m=!1,error:g=!1,FormHelperTextProps:y,fullWidth:b=!1,helperText:v,id:w,InputLabelProps:x,inputProps:A,InputProps:E,inputRef:k,label:T,maxRows:C,minRows:I,multiline:O=!1,name:R,onBlur:D,onChange:P,onFocus:B,placeholder:Z,required:H=!1,rows:z,select:G=!1,SelectProps:V,type:W,value:q,variant:$="outlined"}=n,K=(0,a.Z)(n,L),Y=(0,s.Z)({},n,{autoFocus:i,color:f,disabled:m,error:g,fullWidth:b,multiline:O,required:H,select:G,variant:$}),X=(e=>{const{classes:t}=e;return(0,l.Z)({root:["root"]},F,t)})(Y);const J={};"outlined"===$&&(x&&"undefined"!==typeof x.shrink&&(J.notched=x.shrink),J.label=T),G&&(V&&V.native||(J.id=void 0),J["aria-describedby"]=void 0);const Q=(0,d.Z)(w),ee=v&&Q?`${Q}-helper-text`:void 0,te=T&&Q?`${Q}-label`:void 0,ne=j[$],re=(0,_.jsx)(ne,(0,s.Z)({"aria-describedby":ee,autoComplete:r,autoFocus:i,defaultValue:h,fullWidth:b,multiline:O,name:R,rows:z,maxRows:C,minRows:I,type:W,value:q,id:Q,inputRef:k,onBlur:D,onChange:P,onFocus:B,placeholder:Z,inputProps:A},J,E));return(0,_.jsxs)(U,(0,s.Z)({className:(0,u.default)(X.root,c),disabled:m,error:g,fullWidth:b,ref:t,required:H,color:f,variant:$,ownerState:Y},K,{children:[null!=T&&""!==T&&(0,_.jsx)(S,(0,s.Z)({htmlFor:Q,id:te},x,{children:T})),G?(0,_.jsx)(N.Z,(0,s.Z)({"aria-describedby":ee,id:Q,labelId:te,value:q,input:re},V,{children:o})):re,v&&(0,_.jsx)(M,(0,s.Z)({id:ee},y,{children:v}))]}))})),H=n(30120),z=n(72389),G=n(62097),V=n(61225),W=n(81645),q=n(29630),$=n(31538),K=n(61702),Y=n(69311),X=n(57609),J=n(46930),Q=n(63206);function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function te(e){for(var t=1;t-1}));return{name:n.filter((function(e){return!r.includes(e)})).join(" "),testChainName:r[0]}},oe=function(e){var t=e.size,n=e.logo,r=e.testChainName;return(0,_.jsxs)(H.Z,{sx:{mr:2,width:t,height:t,position:"relative"},children:[(0,_.jsx)("img",{src:n,alt:"",width:"100%",height:"100%"}),r&&(0,_.jsx)(z.Z,{title:r,arrow:!0,children:(0,_.jsx)(H.Z,{sx:{bgcolor:"#29B6F6",width:"16px",height:"16px",borderRadius:"50%",color:"common.white",fontSize:"12px",lineHeight:"16px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",right:"-2px",bottom:"-2px"},children:r.split("")[0]})})]})};!function(e){e[e.V2=0]="V2",e[e.V3=1]="V3"}(ne||(ne={}));var se=function(){var e=(0,J.f)(),t=e.currentMarket,n=e.setCurrentMarket,r=(0,c.useState)(ne.V3)[0],s=(0,G.Z)(),a=(0,V.Z)(s.breakpoints.up("lg")),u=(0,V.Z)(s.breakpoints.down("xsm")),l=(0,Y.Yh)((function(e){return e.trackEvent}));return(0,_.jsxs)(Z,{select:!0,"aria-label":"select market","data-cy":"marketSelector",value:t,onChange:function(e){l(X.h1.CHANGE_MARKET,{market:e.target.value}),n(e.target.value)},sx:{mr:2,"& .MuiOutlinedInput-notchedOutline":{border:"none"}},SelectProps:{native:!1,className:"MarketSwitcher__select",IconComponent:function(e){return(0,_.jsx)(W.Z,te(te({fontSize:"medium"},e),{},{children:(0,_.jsx)(o.Z,{})}))},renderValue:function(e){var t=re(e),n=t.market,r=t.network;return(0,_.jsxs)(H.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,_.jsx)(oe,{size:a?32:28,logo:r.networkLogoPath,testChainName:ie(n.marketTitle).testChainName}),(0,_.jsx)(H.Z,{sx:{mr:1,display:"inline-flex",alignItems:"flex-start"},children:(0,_.jsxs)(q.Z,{variant:a?"display1":"h1",sx:{fontSize:u?"1.55rem":void 0,color:"common.white",mr:1},children:[ie(n.marketTitle).name," ",n.isFork?"Fork":"",a&&" Market"]})})]})},sx:{"&.MarketSwitcher__select .MuiSelect-outlined":{pl:0,py:0,backgroundColor:"transparent !important"},".MuiSelect-icon":{color:"#F1F1F3"}},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},PaperProps:{style:{minWidth:240},variant:"outlined",elevation:0}}},children:[(0,_.jsx)(H.Z,{children:(0,_.jsx)(q.Z,{variant:"subheader2",color:"text.secondary",sx:{px:4,pt:2},children:(0,_.jsx)(i.cC,{id:"{0}",values:{0:Q.p8||Q.aV?"Select ZeroLend Testnet Market":"Select ZeroLend Market"}})})}),Q.z2.map((function(e){var t=re(e),n=t.market,i=t.network,o=ie(n.marketTitle);return null!==n&&void 0!==n&&n.hideInMarketSwitcher?(0,_.jsx)("div",{}):(0,_.jsxs)($.Z,{"data-cy":"marketSelector_".concat(e),value:e,sx:{".MuiListItemIcon-root":{minWidth:"unset"},display:n.v3&&r===ne.V2||!n.v3&&r===ne.V3?"none":"flex"},children:[(0,_.jsx)(oe,{size:32,logo:i.networkLogoPath,testChainName:o.testChainName}),(0,_.jsxs)(K.Z,{sx:{mr:0},children:[o.name," ",n.isFork?"Fork":""]}),(0,_.jsx)(K.Z,{sx:{textAlign:"right"},children:(0,_.jsx)(q.Z,{color:"text.muted",variant:"description",children:o.testChainName})})]},e)}))]})}},8403:function(e,t,n){"use strict";n.d(t,{M:function(){return g}});var r=n(59499),i=n(53737),o=n(33740),s=n(62097),a=n(61225),c=n(30120),u=n(81011),l=n(80562),d=n(23279),f=n.n(d),p=n(67294),h=n(85893);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var g=function(e){var t=e.onSearchTermChange,n=e.wrapperSx,d=e.placeholder,g=e.disableFocus,y=(0,p.useRef)(null),b=(0,p.useState)(""),v=b[0],w=b[1],x=(0,s.Z)().breakpoints,A=(0,a.Z)(x.down("sm")),E=(0,p.useMemo)((function(){return f()((function(e){t(e)}),300)}),[t]);return(0,h.jsxs)(c.Z,{sx:function(e){return function(e){for(var t=1;t18),C=!b||S,I=(0,u.Yh)((function(e){return e.trackEvent}));return(0,p.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,p.jsx)(d.E,g(g({compactMode:b?m:n,compact:C,loading:y},T),{},{children:b||v})),w&&(0,p.jsx)(f.y,{title:k,children:(0,p.jsx)(a.Z,{href:w,target:"_blank",sx:{display:"flex"},onClick:function(){return I(l.vh.EXTERNAL_LINK,{funnel:E,Link:"Etherscan"})},children:(0,p.jsx)(c.Z,{sx:{fontSize:A},children:(0,p.jsx)(o.Z,{})})})})]})}},3765:function(e,t,n){"use strict";n.d(t,{p:function(){return l}});var r=n(49501),i=n(75084),o=n(26074),s=n(69311),a=n(57609),c=n(58294),u=n(85893),l=function(e){var t=e.funnel,n=(0,o.q)().setWalletModalOpen,l=(0,s.Yh)((function(e){return e.trackEvent}));return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i.Z,{variant:"gradient",onClick:function(){l(a.Bp.CONNECT_WALLET,{funnel:t}),n(!0)},children:(0,u.jsx)(r.cC,{id:"Connect wallet"})}),(0,u.jsx)(c.x,{})]})}},58294:function(e,t,n){"use strict";n.d(t,{x:function(){return L}});var r=n(26074),i=n(31959),o=n(50029),s=n(87794),a=n.n(s),c=n(49501),u=n(75084),l=n(62097),d=n(61225),f=n(30120),p=n(29630),h=n(81011),m=n(68346),g=n(81088),y=n(30950),b=n(46126),v=n(67294),w=n(59499),x=n(36864),A=n(58527),E=n(85893);function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;tJoin our Discord",components:{0:(0,E.jsx)(m.Z,{href:"https://discord.gg/zerolend",underline:"always"})}})}),(0,E.jsx)(p.Z,{variant:"helperText",children:(0,E.jsx)(c.cC,{id:"Wallets are provided by External Providers and by selecting you agree to Terms of those Providers. Your access to the wallet might be reliant on the External Provider being operational."})})]})},L=function(){var e=(0,r.q)(),t=e.isWalletModalOpen,n=e.setWalletModalOpen;return(0,E.jsx)(i.P,{open:t,setOpen:n,children:(0,E.jsx)(F,{})})}},84734:function(e,t,n){"use strict";n.d(t,{v:function(){return s}});var r=n(49501),i=n(68861),o=n(85893),s=function(){return(0,o.jsx)(r.cC,{id:"<0>Ampleforth is a rebasing asset. Visit the<1>discordto learn more.",components:{0:(0,o.jsx)("b",{}),1:(0,o.jsx)(i.rU,{href:"https://discord.gg/zerolend",underline:"always"})}})}},1252:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(49501),i=n(85893),o=function(){return(0,i.jsx)(r.cC,{id:"Due to internal stETH mechanics required for rebasing support, it is not possible to perform a collateral switch where stETH is the source token."})}},81902:function(e,t,n){"use strict";var r;n.d(t,{R:function(){return r}}),function(e){e.supplyCap="supplyCap",e.borrowCap="borrowCap"}(r||(r={}))},29002:function(e,t,n){"use strict";n.d(t,{o:function(){return l}});var r=n(59499),i=n(4730),o=n(81645),s=n(85893),a=["sx"];function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t1?2:0},children:[(0,g.jsx)(p.T1,{symbol:e.rewardTokenSymbol,sx:{fontSize:"20px",mr:1}}),(0,g.jsx)(a.Z,{variant:i,children:e.rewardTokenSymbol})]}),width:"100%",children:e.rewardTokenSymbol.includes("BLAST")?(0,g.jsxs)("div",{children:[(0,g.jsx)(f.B,{value:Math.floor(1e8*Number(e.incentiveAPR)),compact:!0,variant:i}),"\xa0Points/$"]}):(0,g.jsx)(o,{incentiveAPR:e.incentiveAPR})},e.rewardTokenAddress)})),t.length>1&&(0,g.jsx)(s.Z,{sx:function(e){return{pt:1,mt:1,border:"1px solid ".concat(e.palette.divider)}},children:(0,g.jsx)(m.X,{caption:(0,g.jsx)(h.cC,{id:"Net APR"}),height:32,children:(0,g.jsx)(o,{incentiveAPR:n})})})]})]})},b=n(46930),v=function(){return(0,g.jsx)(s.Z,{sx:{p:{xs:"0 4px",xsm:"3.625px 4px"},display:"flex",alignItems:"center",justifyContent:"center"},children:(0,g.jsx)(a.Z,{variant:"main12",color:"text.secondary",children:"\xa0"})})},w=function(e){var t=e.incentives,n=e.symbol,h=e.displayBlank,m=(0,i.useState)(!1),w=m[0],x=m[1],A=(0,u.Yh)((function(e){return e.trackEvent})),E=(0,b.f)().currentMarketData,_=(0,i.useMemo)((function(){return(null===t||void 0===t?void 0:t.filter((function(e){return E.whiteListedIncentives.includes(e.rewardTokenSymbol.toLowerCase())})))||t}),[t]);if(!(_&&_.length>0))return h?(0,g.jsx)(v,{}):null;var k=_.some((function(e){return"Infinity"===e.incentiveAPR})),T=k?"Infinity":_.reduce((function(e,t){return e+ +t.incentiveAPR}),0),S=k?"Infinity":"Infinity"!==T?(0,r.hE)(T||0).toNumber():"Infinity";if(0===S)return h?(0,g.jsx)(v,{}):null;return(0,g.jsx)(d.a,{placement:"bottom",tooltipContent:(0,g.jsx)(y,{incentives:_,incentivesNetAPR:S,symbol:n}),withoutHover:!0,setOpen:x,open:w,children:(0,g.jsxs)(s.Z,{sx:function(e){return{p:{xs:"0 4px",xsm:"2px 4px"},border:"1px solid ".concat(w?e.palette.action.disabled:e.palette.divider),borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s ease",bgcolor:w?"action.hover":"transparent","&:hover":{bgcolor:"action.hover",borderColor:"action.disabled"}}},onClick:function(){A(l.h1.VIEW_LM_DETAILS_DASHBOARD,{}),x(!w)},children:[(0,g.jsx)(s.Z,{sx:{mr:2},children:"Infinity"!==S&&S<1e4?(0,g.jsx)(f.B,{value:S,percent:!0,variant:"secondary12",color:"text.secondary"}):"Infinity"!==S&&S>9999?(0,g.jsx)(f.B,{value:S,percent:!0,compact:!0,variant:"secondary12",color:"text.secondary"}):"Infinity"===S?(0,g.jsx)(a.Z,{variant:"main12",color:"text.secondary",children:"\u221e"}):void 0}),(0,g.jsx)(s.Z,{sx:{display:"inline-flex"},children:(0,g.jsx)(g.Fragment,{children:_.length<5?(0,g.jsx)(g.Fragment,{children:_.filter((function(e){return"WETH"!==e.rewardTokenSymbol})).map((function(e){return(0,g.jsx)(p.T1,{symbol:e.rewardTokenSymbol,sx:{fontSize:"".concat(12,"px"),ml:-1}},e.rewardTokenSymbol)}))}):(0,g.jsxs)(g.Fragment,{children:[_.slice(0,3).filter((function(e){return"WETH"!==e.rewardTokenSymbol})).map((function(e){return(0,g.jsx)(p.T1,{symbol:e.rewardTokenSymbol,sx:{fontSize:"".concat(12,"px"),ml:-1}},e.rewardTokenSymbol)})),(0,g.jsx)(c.Z,{sx:{fontSize:"".concat(12,"px"),borderRadius:"50%",bgcolor:"common.white",color:"common.black",ml:-1,zIndex:5},children:(0,g.jsx)(o,{})})]})})})]})})}},14098:function(e,t,n){"use strict";n.d(t,{s:function(){return c}});var r=n(30120),i=n(29630),o=n(67294),s=n(4132),a=n(85893),c=function(e){var t=(0,o.useState)(!1),n=t[0],c=t[1];return(0,a.jsx)(r.Z,{display:"flex",alignItems:"center",position:"relative",children:(0,a.jsx)(s.a,{placement:"bottom",tooltipContent:(0,a.jsx)(i.Z,{children:(null===e||void 0===e?void 0:e.tooltip)||""}),withoutHover:!0,setOpen:c,open:n,children:(0,a.jsx)(r.Z,{children:e.pointsIcon?(0,a.jsx)(r.Z,{borderRadius:"50%",height:"22px",onClick:function(){e.link?window.open(e.link,"_blank"):null!==e&&void 0!==e&&e.tooltip&&c(!n)},children:(0,a.jsx)(r.Z,{border:"1px solid white",borderRadius:"50%",height:"20px",children:(0,a.jsx)("img",{src:e.pointsIcon,alt:".",width:"18px",height:"18px",style:{borderRadius:"50%"}})})}):(0,a.jsx)(r.Z,{sx:function(e){return{p:{xs:"4px",xsm:"2px 4px"},border:"1px solid ".concat(n?e.palette.action.disabled:e.palette.divider),borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s ease"}},onClick:function(){e.link?window.open(e.link,"_blank"):null!==e&&void 0!==e&&e.tooltip&&c(!n)},children:(0,a.jsx)(i.Z,{variant:"main12",color:"text.secondary",sx:{textWrap:"nowrap"},children:e.text})})})})})}},10766:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(59499),i=n(36864),o=n(49501),s=n(58527),a=n(85893);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;tvariable and <1>stable interest rates, where variable rate can increase and decrease depending on the amount of liquidity in the reserve, and stable rate will stay the same for the duration of your loan.",components:{0:(0,a.jsx)("b",{}),1:(0,a.jsx)("b",{})}})}))}},25049:function(e,t,n){"use strict";n.d(t,{Y:function(){return f}});var r=n(59499),i=n(4730),o=n(49501),s=n(81902),a=n(58527),c=n(85893),u=["capType"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;tLearn more",components:{0:(0,c.jsx)(s.rU,{href:"https://docs.gho.xyz/concepts/how-gho-works/interest-rate-discount-model#interest-rate-model",underline:"always"})}}),f=function(e){return(0,c.jsx)(a.G,l(l({event:{eventName:o.vh.TOOL_TIP,eventParams:{tooltip:"ONEZ APY"}}},e),{},{children:d}))}},44749:function(e,t,n){"use strict";n.d(t,{Ch:function(){return g},r$:function(){return y},a9:function(){return b}});var r=n(59499),i=n(49501),o=n(38264),s=n(81645),a=n(30120),c=n(29630),u=n(68346),l=n(4132),d=n(85893);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;tdiscord",components:{0:(0,d.jsx)(u.Z,{href:"https://discord.gg/zerolend",fontWeight:500})}})})]})}},45556:function(e,t,n){"use strict";n.d(t,{l:function(){return m}});var r=n(59499),i=n(49501),o=n(70918),s=n(30120),a=n(29630),c=n(67294),u=n(69311),l=n(57609),d=n(92381),f=n(85893);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t1||u||"USD"===n?2:7);var v=Math.pow(10,-b),w=0!==y&&Math.abs(y)99999);return h&&!A&&(x=Math.trunc(Number(x)*Math.pow(10,b))/Math.pow(10,b)),(0,a.jsxs)(s.Z,l(l({},g),{},{sx:l({display:"inline-flex",flexDirection:"row",alignItems:"center",position:"relative"},g.sx),noWrap:!0,children:[w&&(0,a.jsx)(s.Z,{component:"span",sx:{mr:.5},variant:d||g.variant,color:p||"text.secondary",children:"<"}),"usd"===(null===n||void 0===n?void 0:n.toLowerCase())&&!u&&(0,a.jsx)(s.Z,{component:"span",sx:{mr:.5},variant:d||g.variant,color:p||"text.secondary",children:"$"}),A?(0,a.jsx)(f,{value:x,visibleDecimals:b,roundDown:h,compactThreshold:m}):new Intl.NumberFormat("en-US",{maximumFractionDigits:b,minimumFractionDigits:b}).format(x),u&&(0,a.jsx)(s.Z,{component:"span",sx:{ml:.5},variant:d||g.variant,color:p||"text.secondary",children:"%"}),"usd"!==(null===n||void 0===n?void 0:n.toLowerCase())&&"undefined"!==typeof n&&(0,a.jsx)(s.Z,{component:"span",sx:{ml:.5},variant:d||g.variant,color:p||"text.secondary",children:n})]}))}},68861:function(e,t,n){"use strict";n.d(t,{rU:function(){return b},Z6:function(){return v}});var r=n(59499),i=n(4730),o=n(68346),s=n(81719),a=n(86010),c=n(41664),u=n(11163),l=n(67294),d=n(85893),f=["to","linkAs","href","replace","scroll","shallow","prefetch","locale"],p=["as","className","href","noLinkStyle","role"];function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${(0,g.Z)(n.color)}`],t[`fontSize${(0,g.Z)(n.fontSize)}`]]}})((({theme:e,ownerState:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,fontSize:{inherit:"inherit",small:e.typography.pxToRem(20),medium:e.typography.pxToRem(24),large:e.typography.pxToRem(36)}[t.fontSize],color:{primary:(e.vars||e).palette.primary.main,secondary:(e.vars||e).palette.secondary.main,info:(e.vars||e).palette.info.main,success:(e.vars||e).palette.success.main,warning:(e.vars||e).palette.warning.main,action:(e.vars||e).palette.action.active,error:(e.vars||e).palette.error.main,disabled:(e.vars||e).palette.action.disabled,inherit:void 0}[t.color]}))),A=d.forwardRef((function(e,t){const n=(0,m.Z)({props:e,name:"MuiIcon"}),{baseClassName:r="material-icons",className:i,color:o="inherit",component:s="span",fontSize:a="medium"}=n,c=(0,l.Z)(n,w),d=(0,u.Z)({},n,{baseClassName:r,color:o,component:s,fontSize:a}),h=(e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root","inherit"!==t&&`color${(0,g.Z)(t)}`,`fontSize${(0,g.Z)(n)}`]};return(0,p.Z)(i,b,r)})(d);return(0,v.jsx)(x,(0,u.Z)({as:s,className:(0,f.default)(r,"notranslate",h.root,i),ownerState:d,"aria-hidden":!0,ref:t},c))}));A.muiName="Icon";var E=A,_=n(30120),k=n(60082),T=Object.defineProperty,S=(e,t,n)=>(((e,t,n)=>{t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const C=(e,t)=>typeof getComputedStyle<"u"?getComputedStyle(e,null).getPropertyValue(t):e.style.getPropertyValue(t),I=e=>C(e,"overflow")+C(e,"overflow-y")+C(e,"overflow-x");class O extends d.Component{constructor(e){super(e),S(this,"elementObserver"),S(this,"wrapper"),S(this,"lazyLoadHandler",(e=>{var t,n;const{onContentVisible:r}=this.props,[i]=e,{isIntersecting:o}=i;if(o){this.setState({visible:!0},(()=>{r&&r()}));const e=null==(t=this.wrapper)?void 0:t.current;e&&e instanceof HTMLElement&&(null==(n=this.elementObserver)||n.unobserve(e))}})),this.elementObserver=null,this.wrapper=d.createRef(),this.state={visible:!1}}componentDidMount(){var e;this.getEventNode();const{offset:t,threshold:n}=this.props,r={rootMargin:"number"==typeof t?`${t}px`:t||"0px",threshold:n||0};this.elementObserver=new IntersectionObserver(this.lazyLoadHandler,r);const i=null==(e=this.wrapper)?void 0:e.current;i instanceof HTMLElement&&this.elementObserver.observe(i)}shouldComponentUpdate(e,t){return t.visible}componentWillUnmount(){var e,t;const n=null==(e=this.wrapper)?void 0:e.current;n&&n instanceof HTMLElement&&(null==(t=this.elementObserver)||t.unobserve(n))}getEventNode(){var e;return(e=>{if(!(e instanceof HTMLElement))return window;let t=e;for(;t&&t!==document.body&&t!==document.documentElement&&t.parentNode;){if(/(scroll|auto)/.test(I(t)))return t;t=t.parentNode}return window})(null==(e=this.wrapper)?void 0:e.current)}render(){const{children:e,className:t,height:n,width:r,elementType:i}=this.props,{visible:o}=this.state,s={height:n,width:r},a=`LazyLoad${o?" is-visible":""}${t?` ${t}`:""}`;return(0,d.createElement)(i||"div",{className:a,style:s,ref:this.wrapper},o&&d.Children.only(e))}}S(O,"defaultProps",{elementType:"div",className:"",offset:0,threshold:0,width:null,onContentVisible:null,height:null});var R=["symbol","aToken"],D=["symbol","logoURI"],P=["symbols","badgeSymbol"],B=["symbol"];function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t1){var l=(t=u,(0,r.Z)(t)||(0,i.Z)(t)||(0,o.Z)(t)||(0,s.Z)()),d=l[0],f=l.slice(1);return(0,v.jsx)(Z,N(N({},a),{},{symbols:f,badgeSymbol:"/pools/"+d}))}return(0,v.jsx)(j,N({symbol:n},a))}L.displayName="ATokenIcon"},19952:function(e,t,n){"use strict";n.d(t,{v:function(){return F}});var r=n(59499),i=n(4730),o=n(63366),s=n(87462),a=n(67294),c=n(86010),u=n(94780),l=n(41796),d=n(81719),f=n(78884),p=n(36622),h=n(70918),m=n(34867);function g(e){return(0,m.Z)("MuiAlert",e)}var y,b=(0,n(1588).Z)("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),v=n(80562),w=n(54235),x=n(85893),A=(0,w.Z)((0,x.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),E=(0,w.Z)((0,x.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),_=(0,w.Z)((0,x.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 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),k=(0,w.Z)((0,x.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),T=(0,w.Z)((0,x.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");const S=["action","children","className","closeText","color","icon","iconMapping","onClose","role","severity","variant"],C=(0,d.ZP)(h.Z,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${(0,p.Z)(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?l._j:l.$n,r="light"===e.palette.mode?l.$n:l._j,i=t.color||t.severity;return(0,s.Z)({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},i&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${i}Color`]:n(e.palette[i].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${i}StandardBg`]:r(e.palette[i].light,.9),[`& .${b.icon}`]:e.vars?{color:e.vars.palette.Alert[`${i}IconColor`]}:{color:"dark"===e.palette.mode?e.palette[i].main:e.palette[i].light}},i&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${i}Color`]:n(e.palette[i].light,.6),border:`1px solid ${(e.vars||e).palette[i].light}`,[`& .${b.icon}`]:e.vars?{color:e.vars.palette.Alert[`${i}IconColor`]}:{color:"dark"===e.palette.mode?e.palette[i].main:e.palette[i].light}},i&&"filled"===t.variant&&(0,s.Z)({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${i}FilledColor`],backgroundColor:e.vars.palette.Alert[`${i}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[i].dark:e.palette[i].main,color:e.palette.getContrastText("dark"===e.palette.mode?e.palette[i].dark:e.palette[i].main)}))})),I=(0,d.ZP)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),O=(0,d.ZP)("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),R=(0,d.ZP)("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),D={success:(0,x.jsx)(A,{fontSize:"inherit"}),warning:(0,x.jsx)(E,{fontSize:"inherit"}),error:(0,x.jsx)(_,{fontSize:"inherit"}),info:(0,x.jsx)(k,{fontSize:"inherit"})};var P=a.forwardRef((function(e,t){const n=(0,f.Z)({props:e,name:"MuiAlert"}),{action:r,children:i,className:a,closeText:l="Close",color:d,icon:h,iconMapping:m=D,onClose:b,role:w="alert",severity:A="success",variant:E="standard"}=n,_=(0,o.Z)(n,S),k=(0,s.Z)({},n,{color:d,severity:A,variant:E}),P=(e=>{const{variant:t,color:n,severity:r,classes:i}=e,o={root:["root",`${t}${(0,p.Z)(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return(0,u.Z)(o,g,i)})(k);return(0,x.jsxs)(C,(0,s.Z)({role:w,elevation:0,ownerState:k,className:(0,c.default)(P.root,a),ref:t},_,{children:[!1!==h?(0,x.jsx)(I,{ownerState:k,className:P.icon,children:h||m[A]||D[A]}):null,(0,x.jsx)(O,{ownerState:k,className:P.message,children:i}),null!=r?(0,x.jsx)(R,{ownerState:k,className:P.action,children:r}):null,null==r&&b?(0,x.jsx)(R,{ownerState:k,className:P.action,children:(0,x.jsx)(v.Z,{size:"small","aria-label":l,title:l,color:"inherit",onClick:b,children:y||(y=(0,x.jsx)(T,{fontSize:"small"}))})}):null]}))})),B=["children","sx"];function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;tNumber(R)?i("-1"):i(e.target.value))},inputProps:{"aria-label":"amount input",style:{fontSize:"21px",lineHeight:"28,01px",padding:0,height:"28px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},inputComponent:I}),""!==t&&!v&&(0,k.jsx)(f.Z,{sx:{minWidth:0,p:0,left:8,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},onClick:function(){i&&i("")},disabled:b,children:(0,k.jsx)(s.Z,{height:16})}),T&&1!==S.length?(0,k.jsx)(p.Z,{children:(0,k.jsxs)(h.Z,{disabled:b,value:G.symbol,onChange:function(e){var t=S.find((function(t){return t.symbol===e.target.value}));T&&T(t),i&&i("")},variant:"outlined",className:"AssetInput__select","data-cy":"assetSelect",MenuProps:{sx:{maxHeight:"240px",".MuiPaper-root":{border:"dark"===H.palette.mode?"1px solid #EBEBED1F":"unset",boxShadow:"0px 2px 10px 0px #0000001A"}}},sx:{p:0,"&.AssetInput__select .MuiOutlinedInput-input":{p:0,backgroundColor:"transparent",pr:"24px !important"},"&.AssetInput__select .MuiOutlinedInput-notchedOutline":{display:"none"},"&.AssetInput__select .MuiSelect-icon":{color:"text.primary",right:"0%"}},renderValue:function(e){var t=1===S.length?S[0]:S&&S.find((function(t){return t.symbol===e}));return(0,k.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center"},"data-cy":"assetsSelectedOption_".concat(t.symbol.toUpperCase()),children:[(0,k.jsx)(E.T1,{symbol:t.iconSymbol||t.symbol,aToken:t.aToken,sx:{mr:2,ml:4}}),(0,k.jsx)(u.Z,{variant:"main16",color:"text.primary",children:e})]})},children:[U||void 0,S.map((function(e){return(0,k.jsx)(m.Z,{value:e.symbol,"data-cy":"assetsSelectOption_".concat(e.symbol.toUpperCase()),children:Z?Z(e):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(E.T1,{aToken:e.aToken,symbol:e.iconSymbol||e.symbol,sx:{fontSize:"22px",mr:1}}),(0,k.jsx)(g.Z,{sx:{mr:6},children:e.symbol}),e.balance&&(0,k.jsx)(A.B,{value:e.balance,compact:!0})]})},e.symbol)}))]})}):(0,k.jsxs)(c.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[!(0,_.M)(G.iconSymbol||G.symbol)&&(0,k.jsx)(E.T1,{aToken:G.aToken,symbol:G.iconSymbol||G.symbol,sx:(0,_.M)(G.iconSymbol||G.symbol)?{}:{mr:2,ml:4},fontSize:(0,_.M)(G.iconSymbol||G.symbol)?"large":"inherit"}),(0,k.jsx)(u.Z,{variant:"h3",sx:{lineHeight:"28px"},"data-cy":"inputAsset",children:r})]})]}),(0,k.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",height:"16px"},children:[L?(0,k.jsx)(c.Z,{sx:{flex:1}}):(0,k.jsx)(A.B,{value:isNaN(Number(n))?0:Number(n),compact:!0,symbol:"USD",variant:"secondary12",color:"text.muted",symbolsColor:"text.muted",flexGrow:1}),G.balance&&i&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(u.Z,{component:"div",variant:"secondary12",color:"text.secondary",children:[N&&""!==N?N:(0,k.jsx)(o.cC,{id:"Balance"})," ",(0,k.jsx)(A.B,{value:G.balance,compact:!0,variant:"secondary12",color:"text.secondary",symbolsColor:"text.disabled"})]}),!v&&(0,k.jsx)(y.Z,{size:"small",sx:{minWidth:0,ml:"7px",p:0},onClick:function(){j&&z(j.eventName,C({},j.eventParams)),i("-1")},disabled:b||B,children:(0,k.jsx)(o.cC,{id:"Max"})})]})]})]})]})}},60008:function(e,t,n){"use strict";n.d(t,{Fy:function(){return G},_h:function(){return i}});var r,i,o=n(49501),s=n(48949),a=n(80227),c=n(29630),u=n(81645),l=n(68346),d=n(30120),f=n(67294),p=n(41024),h=n(92391),m=n(19952),g=n(34220),y=n(43478),b=n(8195),v=n(46930),w=n(77537),x=n(63206),A=n(76920),E=n(63491),_=n(67916),k=n(93608),T=n(57824),S=n(78944),C=n(10343),I=n(50029),O=n(87794),R=n.n(O),D=n(75331),P=n(89291),B=n(69311),M=n(67489),N=n(32667),F=n(85893),L=function(e){var t=e.isWrongNetwork,n=e.blocked,r=e.selectedEmode,i=e.activeEmode,s=e.eModes,a=(0,B.Yh)((function(e){return e.setUserEMode})),c=(0,P.Q)({tryPermit:!1,handleGetTxns:function(){var e=(0,I.Z)(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a(r));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),skip:n,deps:[r],protocolAction:D.UQ.setEModeUsage,eventTxInfo:{previousState:(0,N.U)(s[i].label),newState:(0,N.U)(s[r].label)}}),u=c.action,l=c.loadingTxns,d=c.mainTxState,f=c.requiresApproval;return(0,F.jsx)(M.B,{requiresApproval:f,blocked:n,mainTxState:d,preparingTransactions:l,handleAction:u,actionText:0===i?(0,F.jsx)(o.cC,{id:"Enable E-Mode"}):0!==r?(0,F.jsx)(o.cC,{id:"Switch E-Mode"}):(0,F.jsx)(o.cC,{id:"Disable E-Mode"}),actionInProgressText:0===i?(0,F.jsx)(o.cC,{id:"Enabling E-Mode"}):0!==r?(0,F.jsx)(o.cC,{id:"Switching E-Mode"}):(0,F.jsx)(o.cC,{id:"Disabling E-Mode"}),isWrongNetwork:t})},j=n(47546),U=n(55343),Z=n(31538),H=n(46541),z=function(e){var t=e.emodeCategories,n=e.selectedEmode,r=e.setSelectedEmode,i=e.userEmode;return(0,F.jsxs)(U.Z,{sx:{mb:1,width:"100%"},children:[(0,F.jsx)(j.Z,{sx:{mb:1,color:"text.secondary"},children:(0,F.jsx)(o.cC,{id:"Asset category"})}),(0,F.jsx)(H.Z,{defaultValue:0,value:n,onChange:function(e){r(t[Number(e.target.value)])},className:"EmodeSelect","data-cy":"EmodeSelect",sx:{width:"100%",height:"44px",borderRadius:"6px",borderColor:"divider",outline:"none !important",color:"text.primary",".MuiOutlinedInput-input":{backgroundColor:"transparent"},".MuiOutlinedInput-notchedOutline, .MuiOutlinedInput-notchedOutline":{borderColor:"divider",outline:"none !important",borderWidth:"1px"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"},"&.EmodeSelect .MuiSelect-icon":{color:"text.primary"}},native:!1,renderValue:function(e){return 0!==e?(0,F.jsx)(c.Z,{color:"text.primary",children:(0,N.U)(t[e].label)}):(0,F.jsx)(c.Z,{color:"text.muted",children:(0,F.jsx)(o.cC,{id:"Select"})})},children:Object.keys(t).map((function(e){if(i!==Number(e)&&0!==Number(e))return(0,F.jsx)(Z.Z,{value:t[Number(e)].id,children:(0,F.jsx)(c.Z,{color:"text.primary",children:(0,N.U)(t[Number(e)].label)})},"emode-".concat(t[Number(e)].id))}))})]})};!function(e){e[e.EMODE_DISABLED_LIQUIDATION=0]="EMODE_DISABLED_LIQUIDATION",e[e.CLOSE_POSITIONS_BEFORE_SWITCHING=1]="CLOSE_POSITIONS_BEFORE_SWITCHING"}(r||(r={})),function(e){e.ENABLE="Enable",e.DISABLE="Disable",e.SWITCH="Switch"}(i||(i={}));var G=function(e){var t=e.mode,n=(0,g.HT)(),I=n.user,O=n.reserves,R=n.eModes,D=n.marketReferenceCurrencyDecimals,P=n.marketReferencePriceInUsd,B=n.userReserves,M=(0,v.f)().currentChainId,j=(0,w.Z)(),U=j.chainId,Z=j.readOnlyModeAddress,H=(0,y.p)(1),G=(0,b.vR)(),V=G.gasLimit,W=G.mainTxState,q=G.txError,$=(0,f.useState)(function(e,t,n){var r=Object.keys(t).length;if(e===i.ENABLE){if(r>2)return;return t[1]}if(e===i.SWITCH){if(r>3)return;return 1===n?t[2]:t[1]}return t[0]}(t,R,I.userEmodeCategoryId)),K=$[0],Y=$[1],X=(0,x.Mo)(M),J=(0,s.G)({currentTimestamp:H,userReserves:B,formattedReserves:O,userEmodeCategoryId:K?K.id:0,marketReferenceCurrencyDecimals:D,marketReferencePriceInUsd:P}),Q=void 0;if(I.isInEmode&&0===(null===K||void 0===K?void 0:K.id))Number(J.healthFactor)<1.01&&"-1"!==J.healthFactor&&(Q=r.EMODE_DISABLED_LIQUIDATION);else if(K&&I.userEmodeCategoryId!==(null===K||void 0===K?void 0:K.id)){I.userReservesData.some((function(e){return(Number(e.scaledVariableDebt)>0||Number(e.principalStableDebt)>0)&&e.reserve.eModeCategoryId!==(null===K||void 0===K?void 0:K.id)}))&&(Q=r.CLOSE_POSITIONS_BEFORE_SWITCHING)}var ee=function(){switch(Q){case r.CLOSE_POSITIONS_BEFORE_SWITCHING:return(0,F.jsx)(m.v,{severity:"info",sx:{mt:6,alignItems:"center"},children:(0,F.jsx)(c.Z,{variant:"caption",children:(0,F.jsx)(o.cC,{id:"To enable E-mode for the {0} category, all borrow positions outside of this category must be closed.",values:{0:K&&(0,N.U)(K.label)}})})});case r.EMODE_DISABLED_LIQUIDATION:return(0,F.jsxs)(m.v,{severity:"error",sx:{mt:6,alignItems:"center"},children:[(0,F.jsx)(c.Z,{variant:"subheader1",color:"#4F1919",children:(0,F.jsx)(o.cC,{id:"Cannot disable E-Mode"})}),(0,F.jsx)(c.Z,{variant:"caption",children:(0,F.jsx)(o.cC,{id:"You can not disable E-Mode as your current collateralization level is above 80%, disabling E-Mode can cause liquidation. To exit E-Mode supply or repay borrowed positions."})})]});default:return null}},te=Object.keys(R).length>=3&&t===i.ENABLE||Object.keys(R).length>=4&&t===i.SWITCH,ne=M!==U,re=function(){return(0,F.jsx)(u.Z,{color:"primary",sx:{fontSize:"14px",mx:1},children:(0,F.jsx)(a.Z,{})})},ie=!!K&&0===K.id&&void 0===Q&&Number(J.healthFactor).toFixed(3)discord to learn more about how it works and the applied restrictions.",components:{0:(0,F.jsx)(l.Z,{href:"https://discord.gg/zerolend",target:"_blank",rel:"noopener"})}})})}),te&&(0,F.jsx)(z,{emodeCategories:R,selectedEmode:null===K||void 0===K?void 0:K.id,setSelectedEmode:Y,userEmode:I.userEmodeCategoryId}),Q===r.EMODE_DISABLED_LIQUIDATION&&(0,F.jsx)(ee,{}),ie&&(0,F.jsxs)(m.v,{severity:"error",sx:{mt:6,alignItems:"center"},children:[(0,F.jsx)(c.Z,{variant:"subheader1",color:"#4F1919",children:(0,F.jsx)(o.cC,{id:"Liquidation risk"})}),(0,F.jsx)(c.Z,{variant:"caption",children:(0,F.jsx)(o.cC,{id:"This action will reduce your health factor. Please be mindful of the increased risk of collateral liquidation."})})]}),(0,F.jsxs)(T.m6,{gasLimit:V,children:[!te&&(0,F.jsx)(h.X,{caption:(0,F.jsx)(o.cC,{id:"E-Mode category"}),captionVariant:"description",mb:4,children:(0,F.jsxs)(d.Z,{sx:{display:"flex",justifyContent:"right",alignItems:"center"},children:[(0,F.jsx)(d.Z,{sx:{display:"inline-flex",alignItems:"center",mx:1},children:0!==I.userEmodeCategoryId?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(u.Z,{sx:{fontSize:"12px"},children:(0,F.jsx)(A.Z,{})}),(0,F.jsx)(c.Z,{variant:"subheader1",children:(0,N.U)(R[I.userEmodeCategoryId].label)})]}):(0,F.jsx)(c.Z,{variant:"subheader1",children:(0,F.jsx)(o.cC,{id:"None"})})}),K&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(re,{}),(0,F.jsx)(d.Z,{sx:{display:"inline-flex",alignItems:"center"},children:0!==K.id?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(u.Z,{sx:{fontSize:"12px",mr:.5},children:(0,F.jsx)(A.Z,{})}),(0,F.jsx)(c.Z,{variant:"subheader1",children:(0,N.U)(R[K.id].label)})]}):(0,F.jsx)(c.Z,{variant:"subheader1",children:(0,F.jsx)(o.cC,{id:"None"})})})]})]})}),(0,F.jsx)(h.X,{caption:(0,F.jsx)(o.cC,{id:"Available assets"}),captionVariant:"description",mb:4,sx:{alignContent:"flex-end"},children:(0,F.jsxs)(d.Z,{sx:{display:"flex",justifyContent:"right",alignItems:"center"},children:[R[I.userEmodeCategoryId]&&(0,F.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",textAlign:"end"},children:0!==I.userEmodeCategoryId?(0,F.jsx)(c.Z,{sx:{textAlign:"end"},children:R[I.userEmodeCategoryId].assets.join(", ")}):(0,F.jsx)(c.Z,{children:(0,F.jsx)(o.cC,{id:"All Assets"})})}),K&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(re,{}),(0,F.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",textAlign:"end"},children:0!==(null===K||void 0===K?void 0:K.id)?(0,F.jsx)(c.Z,{sx:{textAlign:"end"},children:K.assets.join(", ")}):(0,F.jsx)(c.Z,{children:(0,F.jsx)(o.cC,{id:"All Assets"})})})]})]})}),(0,F.jsx)(T.jz,{visibleHfChange:!!K,healthFactor:I.healthFactor,futureHealthFactor:J.healthFactor}),oe&&(0,F.jsx)(h.X,{caption:(0,F.jsx)(o.cC,{id:"Maximum loan to value"}),captionVariant:"description",mb:4,align:"flex-start",children:(0,F.jsx)(d.Z,{sx:{textAlign:"right"},children:(0,F.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[(0,F.jsx)(p.B,{value:I.currentLoanToValue,sx:{color:"text.primary"},visibleDecimals:2,compact:!0,percent:!0,variant:"secondary14"}),void 0!==K&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(re,{}),(0,F.jsx)(p.B,{value:J.currentLoanToValue,sx:{color:"text.primary"},visibleDecimals:2,compact:!0,percent:!0,variant:"secondary14"})]})]})})})]}),Q===r.CLOSE_POSITIONS_BEFORE_SWITCHING&&(0,F.jsx)(ee,{}),q&&(0,F.jsx)(_.Q,{txError:q}),(0,F.jsx)(L,{isWrongNetwork:ne,blocked:void 0!==Q||!K,selectedEmode:(null===K||void 0===K?void 0:K.id)||0,activeEmode:I.userEmodeCategoryId,eModes:R})]})}},32667:function(e,t,n){"use strict";n.d(t,{U:function(){return r}});var r=function(e){return""===e?"Disabled":e}},3336:function(e,t,n){"use strict";n.d(t,{F:function(){return Z}});var r,i,o=n(59499),s=n(49501),a=n(67294),c=n(8195),u=n(69311),l=n(31959),d=n(94635),f=n(50029),p=n(87794),h=n.n(p),m=n(29630),g=n(30120),y=n(75084),b=n(90149),v=n(77537),w=n(83601),x=n(93608),A=n(57824),E=n(85893),_=null!==globalThis&&void 0!==globalThis?globalThis:window,k="undefined"!==typeof _.turnstile?"ready":"unloaded",T="cf__reactTurnstileOnLoad",S=new Promise((function(e,t){i={resolve:e,reject:t},"ready"===k&&e(void 0)}));function C(e){var t=e.id,n=e.ref,i=e.className,o=e.style,s=e.sitekey,c=e.action,u=e.cData,l=e.theme,d=e.size,p=e.tabIndex,m=e.responseField,g=e.responseFieldName,y=e.retry,b=e.retryInterval,v=e.autoResetOnExpire,w=e.onVerify,x=e.onLoad,A=e.onError,_=e.onExpire,T=e.onTimeout,S=(0,a.useRef)(null),C=(0,a.useState)({onVerify:w})[0],I=null!==n&&void 0!==n?n:S;return(0,a.useEffect)((function(){if(I.current){var e=!1,t="";return(0,f.Z)(h().mark((function n(){var i,o,a;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("ready"===k){n.next=10;break}return n.prev=1,n.next=4,r();case 4:n.next=10;break;case 6:return n.prev=6,n.t0=n.catch(1),null===(o=C.onError)||void 0===o||o.call(C,n.t0),n.abrupt("return");case 10:if(!e&&I.current){n.next=12;break}return n.abrupt("return");case 12:a={sitekey:s,action:c,cData:u,theme:l,size:d,tabindex:p,callback:function(e){return C.onVerify(e)},"error-callback":function(){var e;return null===(e=C.onError)||void 0===e?void 0:e.call(C)},"expired-callback":function(){var e;null===(e=C.onExpire)||void 0===e||e.call(C),v&&window.turnstile.reset(t)},"timeout-callback":function(){var e;return null===(e=C.onTimeout)||void 0===e?void 0:e.call(C)},"response-field":m,"response-field-name":g,retry:y,"retry-interval":b},t=window.turnstile.render(I.current,a),null===(i=C.onLoad)||void 0===i||i.call(C,t);case 15:case"end":return n.stop()}}),n,null,[[1,6]])})))(),function(){e=!0,t&&window.turnstile.remove(t)}}}),[s,c,u,l,d,p,m,g,y,b,v]),(0,a.useEffect)((function(){C.onVerify=w,C.onLoad=x,C.onError=A,C.onExpire=_}),[w,x,A,_,T]),(0,E.jsx)("div",{ref:I,id:t,className:i,style:o})}_.cf__reactTurnstileOnLoad=function(){i.resolve(),k="ready"},r=function(){if("unloaded"===k){k="loading";var e="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(T,"&render=explicit"),t=document.createElement("script");t.src=e,t.async=!0,t.addEventListener("error",(function(){i.reject("Failed to load Turnstile.")})),document.head.appendChild(t)}return S};var I,O=n(80854),R=n(1279),D=function(e,t){var n=(0,O.gU)("1000",18),r=O.Ry[e.toUpperCase()]?O.Ry[e.toUpperCase()]:n;return(0,R.Fv)(r,t)},P=n(83454),B=function(e){var t=e.underlyingAsset,n=(0,v.Z)().readOnlyModeAddress,r=(0,u.Yh)(),i=r.account,o=r.currentMarket,c=r.currentMarketData,l=(0,u.Yh)((function(e){return(0,w.Rp)(e)})),d=(0,a.useState)(""),p=d[0],_=d[1],k=(0,a.useState)(!1),T=k[0],S=k[1],I=(0,a.useState)(!0),O=I[0],R=I[1],B=(0,a.useState)(""),M=B[0],N=B[1],F=(0,a.useState)(""),L=F[0],j=F[1],U="".concat(P.env.NEXT_PUBLIC_API_BASEURL,"/faucet"),Z=P.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY,H=l.find((function(e){return e.underlyingAsset===t})),z=D(H.symbol,H.decimals),G=function(){var e=(0,f.Z)(h().mark((function e(){var t,n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,N(""),S(!0),j(""),e.next=6,fetch(U,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:i,captchaToken:p,market:o,tokenAddress:H.underlyingAsset,tokenSymbol:H.symbol,faucetAddress:c.addresses.FAUCET})});case 6:return t=e.sent,e.next=9,t.json();case 9:if(n=e.sent,t.ok){e.next=12;break}throw new Error(n.msg);case 12:N(n.msg),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),e.t0 instanceof Error&&e.t0.message?j(e.t0.message):j("An error occurred trying to send the transaction");case 18:return e.prev=18,S(!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[0,15,18,21]])})));return function(){return e.apply(this,arguments)}}();return M?(0,E.jsx)(x.R,{txHash:M,action:(0,E.jsx)(s.cC,{id:"will receive"}),symbol:H.symbol,amount:z}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(C,{sitekey:Z,onVerify:function(e){_(e),R(!1)},autoResetOnExpire:!0}),(0,E.jsxs)(m.Z,{variant:"h2",sx:{mb:6},children:[(0,E.jsx)(s.cC,{id:"Faucet"})," ",H.symbol]}),(0,E.jsx)(g.Z,{sx:function(e){return{p:3,border:"1px solid ".concat(e.palette.divider),borderRadius:"4px",".MuiBox-root:last-of-type":{mb:0}}},children:(0,E.jsx)(A.oD,{description:(0,E.jsx)(s.cC,{id:"Amount"}),iconSymbol:H.symbol,symbol:H.symbol,value:z})}),(0,E.jsx)(m.Z,{variant:"helperText",color:"error.main",children:L}),(0,E.jsx)(g.Z,{sx:{display:"flex",flexDirection:"column",mt:12},children:(0,E.jsxs)(y.Z,{variant:"contained",disabled:T||!p||void 0!==n,onClick:G,size:"large",sx:{minHeight:"44px"},children:[(T||O)&&(0,E.jsx)(b.Z,{color:"inherit",size:"16px",sx:{mr:2}}),(0,E.jsx)(s.cC,{id:"Faucet {0}",values:{0:H.symbol}})]})})]})},M=n(67916),N=n(89291),F=n(67489),L=function(e){var t=e.poolReserve,n=e.isWrongNetwork,r=e.blocked,i=(0,u.Yh)((function(e){return e.mint})),o=(0,N.Q)({tryPermit:!1,handleGetTxns:function(){var e=(0,f.Z)(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i({tokenSymbol:t.symbol,reserve:t.underlyingAsset}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),skip:r}),a=o.action,c=o.loadingTxns,l=o.mainTxState,d=o.requiresApproval;return(0,E.jsx)(F.B,{requiresApproval:d,blocked:r,preparingTransactions:c,handleAction:a,actionText:(0,E.jsx)(s.cC,{id:"Faucet {0}",values:{0:t.symbol}}),actionInProgressText:(0,E.jsx)(s.cC,{id:"Pending..."}),mainTxState:l,isWrongNetwork:n})};I||(I={});var j=function(e){var t=e.poolReserve,n=e.isWrongNetwork,r=(0,c.vR)(),i=r.gasLimit,o=r.mainTxState,a=r.txError,u=D(t.symbol,t.decimals);return o.success?(0,E.jsx)(x.R,{action:(0,E.jsx)(s.cC,{id:"Received"}),symbol:t.symbol,amount:u}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(A.m6,{gasLimit:i,children:(0,E.jsx)(A.oD,{description:(0,E.jsx)(s.cC,{id:"Amount"}),iconSymbol:t.symbol,symbol:t.symbol,value:u})}),a&&(0,E.jsx)(M.Q,{txError:a}),(0,E.jsx)(L,{poolReserve:t,isWrongNetwork:n,blocked:!1})]})};function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Z=function(){var e=(0,c.vR)(),t=e.type,n=e.close,r=e.args,i=(0,u.Yh)().isFaucetPermissioned;return(0,E.jsx)(l.P,{open:t===c.w8.Faucet,setOpen:n,children:i?(0,E.jsx)(B,{underlyingAsset:r.underlyingAsset}):(0,E.jsx)(d.A,{title:(0,E.jsx)(s.cC,{id:"Faucet"}),underlyingAsset:r.underlyingAsset,children:function(e){return(0,E.jsx)(j,function(e){for(var t=1;tDiscord .",components:{0:(0,f.jsx)(u.Z,{href:"https://discord.gg/zerolend"})}})}),(0,f.jsxs)(l.Z,{variant:"outlined",onClick:function(){return navigator.clipboard.writeText(t.rawError.message.toString())},size:"small",sx:{mt:6},children:[(0,f.jsx)(r.cC,{id:"Copy error text"}),(0,f.jsx)(a.Z,{sx:{ml:.5,fontSize:"12px"},children:(0,f.jsx)(o.Z,{})})]})]}),(0,f.jsx)(s.Z,{sx:{display:"flex",flexDirection:"column",mt:12},children:(0,f.jsx)(l.Z,{onClick:n,variant:"contained",size:"large",sx:{minHeight:"44px"},children:(0,f.jsx)(r.cC,{id:"Close"})})})]})}},68206:function(e,t,n){"use strict";n.d(t,{Z:function(){return z},_:function(){return H}});var r=n(30120),i=n(67294),o=n(49501),s=n(62753),a=n(16247),c=n(62097),u=n(29630),l=n(80562),d=n(90149),f=n(55343),p=n(46541),h=n(31538),m=n(61702),g=n(41024),y=n(52526),b=n(58527),v=n(65856),w=n(1279),x=n(85893),A=function(e){var t=e.paymasterData,n=e.symbol,i=e.totalGasCostsUsd,A=void 0===i?0:i,E=e.onSelect,_=e.assets,k=e.selectOptionHeader,T=e.selectOption,S=e.amountInUSD,C=(0,c.Z)(),I="ETH"===n?A.toFixed(3):t&&t.estimatedFinalFeeUSD?Number(t.estimatedFinalFeeUSD).toFixed(3):"-",O=1===_.length?_[0]:_&&_.find((function(e){return e.symbol===n}));return(0,x.jsxs)(r.Z,{sx:{background:"#f6f6f6",borderRadius:"6px",border:"1px solid ".concat(C.palette.divider)},children:[(0,x.jsxs)(r.Z,{sx:{display:"flex",flex:1,color:"#999",p:2},children:[(0,x.jsx)(u.Z,{variant:"caption",children:(0,x.jsx)(o.cC,{id:"Transaction Cost"})}),(0,x.jsx)(b.G,{children:(0,x.jsx)(o.cC,{id:"You can choose a different asset other than ETH to pay your transaction fees. This can be any supported ERC20 token."})})]}),(0,x.jsxs)(r.Z,{sx:{p:"0 12px 8px 12px"},children:[t&&(0,x.jsxs)(r.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,x.jsx)(l.Z,{sx:{minWidth:0,p:0,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},children:(0,x.jsx)(a.Z,{color:"primary",sx:{fontSize:"16px",mr:1.5}})}),(0,x.jsx)(u.Z,{sx:{fontSize:"14px",flex:1,lineHeight:"2",padding:0,height:"28px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:null===t||void 0===t?void 0:t.markup})]}),(0,x.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",mb:.5,justifyContent:"space-between"},children:[(0,x.jsxs)(r.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,x.jsx)(l.Z,{sx:{minWidth:0,p:0,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},children:(0,x.jsx)(s.Z,{color:"primary",sx:{fontSize:"16px",mr:1.5}})}),t||"-"!==I?(0,x.jsxs)(r.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,x.jsx)(g.B,{value:I,symbol:"USD",color:"text.secondary"}),(0,x.jsx)(u.Z,{sx:{ml:2},children:"(Approx)"})]}):0===S?(0,x.jsx)(u.Z,{sx:{fontSize:"14px",flex:1,lineHeight:"2",padding:0,height:"28px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:"-"}):(0,x.jsx)(d.Z,{color:"inherit",size:"16px",sx:{mr:2}})]}),E&&1!==_.length?(0,x.jsx)(f.Z,{children:(0,x.jsxs)(p.Z,{value:O.symbol,onChange:function(e){var t=_.find((function(t){return t.symbol===e.target.value}));E&&E(t)},variant:"outlined",className:"AssetInput__select","data-cy":"assetSelect",MenuProps:{sx:{maxHeight:"240px",".MuiPaper-root":{border:"dark"===C.palette.mode?"1px solid #EBEBED1F":"unset",boxShadow:"0px 2px 10px 0px #0000001A"}}},sx:{p:0,"&.AssetInput__select .MuiOutlinedInput-input":{p:0,backgroundColor:"transparent",pr:"24px !important"},"&.AssetInput__select .MuiOutlinedInput-notchedOutline":{display:"none"},"&.AssetInput__select .MuiSelect-icon":{color:"text.primary",right:"0%"}},renderValue:function(e){var t=1===_.length?_[0]:_&&_.find((function(t){return t.symbol===e}));return(0,x.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center"},"data-cy":"assetsSelectedOption_".concat(t.symbol.toUpperCase()),children:[(0,x.jsx)(y.T1,{symbol:t.iconSymbol||t.symbol,aToken:t.aToken,sx:{mr:2,ml:4}}),(0,x.jsx)(u.Z,{variant:"main16",color:"text.primary",children:e})]})},children:[k||void 0,_.map((function(e){return(0,x.jsx)(h.Z,{value:e.symbol,"data-cy":"assetsSelectOption_".concat(e.symbol.toUpperCase()),children:T?T(e):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(y.T1,{aToken:e.aToken,symbol:e.iconSymbol||e.symbol,sx:{fontSize:"22px",mr:1}}),(0,x.jsx)(m.Z,{sx:{mr:6},children:e.symbol}),(0,x.jsx)(g.B,{value:(0,w.pV)((0,v.Z)(e.address).toString(),e.decimals||18).toString(),compact:!0})]})},e.symbol)}))]})}):(0,x.jsxs)(r.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,x.jsx)(y.T1,{aToken:O.aToken,symbol:O.iconSymbol||O.symbol,sx:{mr:2,ml:4},fontSize:"inherit"}),(0,x.jsx)(u.Z,{variant:"h3",sx:{lineHeight:"28px"},"data-cy":"inputAsset",children:n})]})]})]}),(0,x.jsx)(r.Z,{sx:{display:"flex",textAlign:"center",flex:1,background:C.palette.divider,p:2},children:(0,x.jsxs)(u.Z,{variant:"caption",sx:{margin:"auto",color:"#333"},children:["Paymasters are an experimental feature. Use it at you own risk. Paymaster integration is powered by zyfi.org. You are paying transaction fees in ",O.iconSymbol,"."]})})]})},E=n(46930),_=n(80854),k=n(9144),T=n(56371),S=n(59499),C=n(36864),I=n(57609);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t5&&(0,x.jsx)(Z,{})]}):(0,x.jsx)(U,{gasLimit:p,skipLoad:e.skipLoad,disabled:e.disabled})}},67916:function(e,t,n){"use strict";n.d(t,{Q:function(){return c}});var r=n(49501),i=n(29630),o=n(75084),s=n(19952),a=n(85893),c=function(e){var t=e.txError;return(0,a.jsx)(s.v,{severity:"error",sx:{mt:4,mb:0},children:(0,a.jsx)(i.Z,{variant:"description",children:t.error?(0,a.jsxs)(a.Fragment,{children:[t.error," ",(0,a.jsx)(o.Z,{sx:{verticalAlign:"top"},variant:"text",onClick:function(){return navigator.clipboard.writeText(t.rawError.message.toString())},children:(0,a.jsx)(i.Z,{variant:"description",children:(0,a.jsx)(r.cC,{id:"copy the error"})})})]}):(0,a.jsx)(r.cC,{id:"There was some error. Please try changing the parameters or <0><1>copy the error",components:{0:(0,a.jsx)(o.Z,{sx:{verticalAlign:"top"},onClick:function(){return navigator.clipboard.writeText(t.rawError.message.toString())}}),1:(0,a.jsx)(i.Z,{variant:"description"})}})})})}},94635:function(e,t,n){"use strict";n.d(t,{A:function(){return b}});var r=n(80854),i=(n(67294),n(34220)),o=n(82482),s=n(43629),a=n(66209),c=n(8195),u=n(90452),l=n(46930),d=n(77537),f=n(63206),p=n(57609),h=n(78944),m=n(10343),g=n(63491),y=n(85893),b=function(e){var t,n,b=e.hideTitleSymbol,v=e.underlyingAsset,w=e.children,x=e.requiredChainId,A=e.title,E=e.requiredPermission,_=e.keepWrappedSymbol,k=(0,d.Z)().readOnlyModeAddress,T=(0,o.P)().walletBalances,S=(0,l.f)(),C=S.currentNetworkConfig,I=S.currentMarketData,O=(0,i.HT)(),R=O.user,D=O.reserves,P=(0,c.vR)(),B=P.txError,M=P.mainTxState,N=(0,u.T)().permissions,F=(0,a.Q)(x),L=F.isWrongNetwork,j=F.requiredChainId;if(B&&B.blocking)return(0,y.jsx)(g.D,{txError:B});if(E&&f.cr.permissions(I)&&!N.includes(E)&&I.permissionComponent)return(0,y.jsx)(y.Fragment,{children:I.permissionComponent});var U=D.find((function(e){return v.toLowerCase()===r.hP.toLowerCase()?e.isWrappedBaseAsset:v===e.underlyingAsset})),Z=null===R||void 0===R?void 0:R.userReservesData.find((function(e){return v.toLowerCase()===r.hP.toLowerCase()?e.reserve.isWrappedBaseAsset:v===e.underlyingAsset})),H=U.isWrappedBaseAsset&&!_?C.baseAssetSymbol:U.symbol;return(0,y.jsxs)(s.hv,{asset:U,children:[!M.success&&(0,y.jsx)(h.E,{title:A,symbol:b?void 0:H}),L&&!k&&(0,y.jsx)(m.I,{networkName:(0,f.Mo)(j).name,chainId:j,event:{eventName:p.vh.SWITCH_NETWORK,eventParams:{asset:v}}}),w({isWrongNetwork:L,nativeBalance:(null===(t=T[r.hP.toLowerCase()])||void 0===t?void 0:t.amount)||"0",tokenBalance:(null===(n=T[U.underlyingAsset.toLowerCase()])||void 0===n?void 0:n.amount)||"0",poolReserve:U,symbol:H,underlyingAsset:v,userReserve:Z})]})}},93608:function(e,t,n){"use strict";n.d(t,{R:function(){return A}});var r=n(49501),i=n(75331),o=n(56365),s=n(58057),a=n(81645),c=n(62097),u=n(30120),l=n(29630),d=n(75084),f=n(68346),p=n(67294),h=n(29002),m=n(41024),g=n(52526),y=n(8195),b=n(46930),v=n(77537),w=n(85893),x=function(){return(0,w.jsx)(a.Z,{sx:{ml:"2px",fontSize:"11px"},children:(0,w.jsx)(o.Z,{})})},A=function(e){var t=e.txHash,n=e.action,o=e.amount,A=e.symbol,E=e.collateral,_=e.rate,k=e.addToken,T=e.customAction,S=e.customText,C=e.joinDiscord,I=void 0!==C&&C,O=(0,y.vR)(),R=O.close,D=O.mainTxState,P=(0,v.Z)().addERC20Token,B=(0,b.f)().currentNetworkConfig,M=(0,p.useState)(""),N=M[0],F=M[1],L=(0,c.Z)();return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(u.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,w.jsx)(u.Z,{sx:{width:"48px",height:"48px",bgcolor:"success.200",borderRadius:"50%",mt:14,mx:"auto",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,w.jsx)(a.Z,{sx:{color:"success.main",fontSize:"32px"},children:(0,w.jsx)(s.Z,{})})}),(0,w.jsx)(l.Z,{sx:{mt:4},variant:"h2",children:(0,w.jsx)(r.cC,{id:"All done!"})}),(0,w.jsxs)(u.Z,{sx:{mt:2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"},children:[n&&o&&A&&(0,w.jsx)(l.Z,{children:(0,w.jsx)(r.cC,{id:"You {action} <0/> {symbol}",values:{action:n,symbol:A},components:{0:(0,w.jsx)(m.B,{value:Number(o),compact:!0,variant:"secondary14"})}})}),T&&(0,w.jsxs)(l.Z,{children:[S,T]}),!n&&!o&&A&&(0,w.jsxs)(l.Z,{children:["Your ",A," ",E?"now":"is not"," used as collateral"]}),_&&(0,w.jsx)(l.Z,{children:(0,w.jsx)(r.cC,{id:"You switched to {0} rate",values:{0:_===i.tk.Variable?"variable":"stable"}})}),k&&A&&(0,w.jsxs)(u.Z,{sx:function(e){return{border:"dark"===e.palette.mode?"1px solid ".concat(e.palette.divider):"none",background:"dark"===e.palette.mode?"none":"#F7F7F9",borderRadius:"12px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",mt:"24px"}},children:[(0,w.jsx)(g.T1,{symbol:k.symbol,aToken:!(!k||!k.aToken),sx:{fontSize:"32px",mt:"12px",mb:"8px"}}),(0,w.jsx)(l.Z,{variant:"description",color:"text.primary",sx:{mx:"24px"},children:(0,w.jsx)(r.cC,{id:"Add {0} to wallet to track your balance.",values:{0:k&&k.aToken?"z0Token ":"token "}})}),(0,w.jsxs)(d.Z,{onClick:function(){P({address:k.address,decimals:k.decimals,symbol:k.aToken?"z0".concat(k.symbol.slice(0,11)):k.symbol.slice(0,11),image:/_/.test(k.symbol)?void 0:N})},variant:"dark"===L.palette.mode?"outlined":"contained",size:"medium",sx:{mt:"8px",mb:"12px"},children:[k.symbol&&!/_/.test(k.symbol)&&(0,w.jsx)(g.Js,{symbol:k.symbol,onImageGenerated:F,aToken:k.aToken}),(0,w.jsx)(h.o,{sx:{width:"20px",height:"20px"}}),(0,w.jsx)(l.Z,{variant:"buttonM",color:"white",ml:"4px",children:(0,w.jsx)(r.cC,{id:"Add to wallet"})})]})]}),I&&(0,w.jsxs)(u.Z,{sx:function(e){return{border:"dark"===e.palette.mode?"1px solid ".concat(e.palette.divider):"none",background:"dark"===e.palette.mode?"none":"#F7F7F9",borderRadius:"12px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",mt:"24px",pt:"8px"}},children:[(0,w.jsx)(l.Z,{variant:"description",color:"text.primary",sx:{mx:"24px"},children:(0,w.jsx)(r.cC,{id:"Your transaction is through! Join our discord to get special roles."})}),(0,w.jsx)(d.Z,{variant:"outlined",size:"medium",href:"https://discord.gg/zerolend",target:"_blank",sx:{mt:"8px",mb:"12px"},children:(0,w.jsx)(l.Z,{variant:"buttonM",ml:"4px",children:"Join our Discord"})})]})]})]}),(0,w.jsxs)(u.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,w.jsxs)(f.Z,{variant:"helperText",href:B.explorerLinkBuilder({tx:t||D.txHash}),sx:{display:"inline-flex",alignItems:"center",justifyContent:"right",mt:6,mb:3},underline:"hover",target:"_blank",rel:"noreferrer noopener",children:[(0,w.jsx)(r.cC,{id:"Review tx details"}),(0,w.jsx)(x,{})]}),(0,w.jsx)(d.Z,{onClick:R,variant:"contained",size:"large",sx:{minHeight:"44px"},"data-cy":"closeButton",children:(0,w.jsx)(r.cC,{id:"Ok, Close"})})]})]})}},57824:function(e,t,n){"use strict";n.d(t,{m6:function(){return S},oD:function(){return C},aY:function(){return I},XJ:function(){return O},Bx:function(){return R},JV:function(){return D},aE:function(){return P},jz:function(){return B},Pu:function(){return M}});var r=n(59499),i=n(4730),o=n(49501),s=n(80227),a=n(81645),c=n(30120),u=n(29630),l=n(54181),d=n(91655),f=n(22841),p=n(67294),h=n(44749),m=n(92391),g=n(29946),y=n(41024),b=n(96875),v=n(17218),w=n(52526),x=n(68206),A=n(85893),E=["description","value","futureValue","numberPrefix","iconSymbol","usdValue","loading"];function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;tLearn more",components:{0:(0,v.jsx)(y.rU,{href:"https://eips.ethereum.org/EIPS/eip-2612",underline:"always"})}})}))},E=n(56365),_=n(68346),k=n(17674),T=n(64343),S=n(22659),C=n(73812),I=n(31538),O=n(61702),R=n(29894),D=n(32113),P=function(e){var t=e.currentMethod,n=e.setMethod,r=f.useState(null),i=(0,k.Z)(r,2),s=i[0],u=i[1],l=Boolean(s),p=function(){u(null)};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(c.Z,{onClick:function(e){u(e.currentTarget)},sx:{display:"flex",alignItems:"center",cursor:"pointer"},"data-cy":"approveButtonChange",children:[(0,v.jsx)(d.Z,{variant:"subheader2",color:"info.main",children:(0,v.jsx)(o.cC,{id:"{currentMethod}",values:{currentMethod:t}})}),(0,v.jsx)(a.Z,{sx:{fontSize:16,ml:1,color:"info.main"},children:(0,v.jsx)(S.Z,{})})]}),(0,v.jsxs)(C.Z,{anchorEl:s,open:l,onClose:p,MenuListProps:{"aria-labelledby":"basic-button"},keepMounted:!0,"data-cy":"approveMenu_".concat(t),children:[(0,v.jsxs)(I.Z,{"data-cy":"approveOption_".concat(D.n.PERMIT),selected:t===D.n.PERMIT,value:D.n.PERMIT,onClick:function(){t===D.n.APPROVE&&n(D.n.PERMIT),p()},children:[(0,v.jsx)(O.Z,{primaryTypographyProps:{variant:"subheader1"},children:(0,v.jsx)(o.cC,{id:"{0}",values:{0:D.n.PERMIT}})}),(0,v.jsx)(R.Z,{children:(0,v.jsx)(a.Z,{children:t===D.n.PERMIT&&(0,v.jsx)(T.Z,{})})})]}),(0,v.jsxs)(I.Z,{"data-cy":"approveOption_".concat(D.n.APPROVE),selected:t===D.n.APPROVE,value:D.n.APPROVE,onClick:function(){t===D.n.PERMIT&&n(D.n.APPROVE),p()},children:[(0,v.jsx)(O.Z,{primaryTypographyProps:{variant:"subheader1"},children:(0,v.jsx)(o.cC,{id:"{0}",values:{0:D.n.APPROVE}})}),(0,v.jsx)(R.Z,{children:(0,v.jsx)(a.Z,{children:t===D.n.APPROVE&&(0,v.jsx)(T.Z,{})})})]})]})]})},B=n(89291),M=n(46930),N=n(69311),F=function(){return(0,v.jsx)(a.Z,{sx:{ml:"2px",fontSize:"11px"},children:(0,v.jsx)(E.Z,{})})},L=function(e){var t=e.approvalHash,n=e.tryPermit,r=(0,N.Yh)(),i=r.walletApprovalMethodPreference,s=r.setWalletApprovalMethodPreference,a=n&&i,u=(0,M.f)().currentNetworkConfig,l=t===B.Z;return t||l||!n?t&&!a?(0,v.jsx)(c.Z,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",pb:1},children:t&&(0,v.jsxs)(_.Z,{variant:"helperText",href:u.explorerLinkBuilder({tx:t}),sx:{display:"inline-flex",alignItems:"center"},underline:"hover",target:"_blank",rel:"noreferrer noopener",children:[(0,v.jsx)(o.cC,{id:"Review approval tx details"}),(0,v.jsx)(F,{})]})}):(0,v.jsx)(v.Fragment,{}):(0,v.jsxs)(c.Z,{sx:{display:"inline-flex",alignItems:"center",mb:2},children:[(0,v.jsxs)(d.Z,{variant:"subheader2",color:"text.secondary",children:[(0,v.jsx)(o.cC,{id:"Approve with"}),"\xa0"]}),(0,v.jsx)(P,{currentMethod:i,setMethod:function(e){return s(e)}})]})},j=["actionInProgressText","actionText","amount","approvalTxState","handleApproval","handleAction","isWrongNetwork","mainTxState","preparingTransactions","requiresAmount","requiresApproval","sx","symbol","blocked","fetchingData","errorParams","tryPermit","event","isBalance","isPaymaster","paymasterData","feeTokenAddress","isStrategy"];function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;tDiscord",values:{0:t||""},components:{0:(0,a.jsx)(o.rU,{href:"https://discord.gg/zerolend",underline:"always"})}})})]})}},94671:function(e,t,n){"use strict";n.d(t,{NI:function(){return r},gK:function(){return s},pQ:function(){return a},Fi:function(){return c},iv:function(){return u},Vc:function(){return l},yI:function(){return d}});var r,i=n(70794),o=n(29946);!function(e){e[e.SUPPLY_CAP_REACHED=0]="SUPPLY_CAP_REACHED",e[e.HF_BELOW_ONE=1]="HF_BELOW_ONE",e[e.NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH=2]="NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH",e[e.ZERO_LTV_WITHDRAW_BLOCKED=3]="ZERO_LTV_WITHDRAW_BLOCKED"}(r||(r={}));var s=function(e,t){return"-1"!==e&&new i.O(e).minus(new i.O(t)).lt("1.05")},a=65e3,c=55e3,u=function(e){var t=e.approvedAmount,n=e.signedAmount,r=e.amount;return!("-1"===t||"0"!==t&&Number(t)>=Number(r)||Number(n)>=Number(r))},l=function(e){var t=[];return e.userReservesData.forEach((function(e){Number(e.scaledATokenBalance)>0&&"0"===e.reserve.baseLTVasCollateral&&e.usageAsCollateralEnabledOnUser&&"0"!==e.reserve.reserveLiquidationThreshold&&t.push(e.reserve.symbol)})),t},d=function(e,t,n,r){var i=e.reserve;if(!i.usageAsCollateralEnabled)return o.z.UNAVAILABLE;var s=o.z.ENABLED,a=e&&"0"!==e.scaledATokenBalance,c="0"!==t;return i.isIsolated?r?s=o.z.UNAVAILABLE:n?a?s=e.usageAsCollateralEnabledOnUser?o.z.ISOLATED_ENABLED:o.z.DISABLED:c&&(s=o.z.UNAVAILABLE_DUE_TO_ISOLATION):s=c?o.z.ISOLATED_DISABLED:o.z.ISOLATED_ENABLED:s=n?o.z.UNAVAILABLE_DUE_TO_ISOLATION:a?e.usageAsCollateralEnabledOnUser?o.z.ENABLED:o.z.DISABLED:o.z.ENABLED,s}},92381:function(e,t,n){"use strict";n.d(t,{e:function(){return r}});var r=function(e,t,n){e?(localStorage.setItem(n,"false"),t(!1)):(localStorage.setItem(n,"true"),t(!0))}},29946:function(e,t,n){"use strict";var r,i;n.d(t,{z:function(){return i}}),function(e){e.VOTING="0",e.PROPOSITION_POWER="1",e.BOTH="2"}(r||(r={})),function(e){e[e.ENABLED=0]="ENABLED",e[e.ISOLATED_ENABLED=1]="ISOLATED_ENABLED",e[e.DISABLED=2]="DISABLED",e[e.ISOLATED_DISABLED=3]="ISOLATED_DISABLED",e[e.UNAVAILABLE=4]="UNAVAILABLE",e[e.UNAVAILABLE_DUE_TO_ISOLATION=5]="UNAVAILABLE_DUE_TO_ISOLATION"}(i||(i={}))},89291:function(e,t,n){"use strict";n.d(t,{Z:function(){return _},Q:function(){return k}});var r=n(90116),i=n(59499),o=n(50029),s=n(17674),a=n(87794),c=n.n(a),u=n(75331),l=n(80854),d=n(20169),f=n(67294),p=n(19419),h=n(8195),m=n(77537),g=n(69311),y=n(32113),b=n(39771),v=n(31001);function w(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)){e.next=59;break}R(E(E({},O),{},{loading:!0})),e.prev=3,n=Math.floor(Date.now()/1e3+3600).toString(),r=[],i=w(t);try{for(i.s();!(s=i.n()).done;)(a=s.value).permitType&&"POOL"!=a.permitType?"SUPPLY_MIGRATOR_V3"===a.permitType?r.push(re(E(E({},a),{},{deadline:n}))):"BORROW_MIGRATOR_V3"===a.permitType&&r.push(ne(E(E({},a),{},{deadline:n,spender:oe.addresses.V3_MIGRATOR||""}))):r.push(ee({reserve:a.underlyingAsset,amount:a.amount,deadline:n}))}catch(x){i.e(x)}finally{i.f()}return e.prev=8,u=[],e.next=12,Promise.all(r);case 12:l=e.sent,d=w(l),e.prev=14,d.s();case 16:if((f=d.n()).done){e.next=25;break}return p=f.value,e.t0=u,e.next=21,j(p);case 21:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 23:e.next=16;break;case 25:e.next=30;break;case 27:e.prev=27,e.t2=e.catch(14),d.e(e.t2);case 30:return e.prev=30,d.f(),e.finish(30);case 33:if(me.current){e.next=35;break}return e.abrupt("return");case 35:$(u),X(n),R({txHash:_,loading:!1,success:!0}),F(void 0),e.next=48;break;case 41:if(e.prev=41,e.t3=e.catch(8),me.current){e.next=45;break}return e.abrupt("return");case 45:h=(0,b.WG)(e.t3,b.aD.APPROVAL,!1),F(h),R({txHash:void 0,loading:!1});case 48:e.next=57;break;case 50:if(e.prev=50,e.t4=e.catch(3),me.current){e.next=54;break}return e.abrupt("return");case 54:m=(0,b.WG)(e.t4,b.aD.GAS_ESTIMATION,!1),F(m),R({txHash:void 0,loading:!1});case 57:e.next=77;break;case 59:return e.prev=59,R(E(E({},O),{},{loading:!0})),e.next=63,Promise.all(ae.map((function(e){return e.tx()})));case 63:return g=e.sent,e.next=66,Promise.all(g.map((function(e){return new Promise(function(){var t=(0,o.Z)(c().mark((function t(n,r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:delete e.gasPrice,ge({tx:function(){return U(e)},successCallback:function(e){n(e)},errorCallback:function(e,t){var n=(0,b.WG)(e,b.aD.APPROVAL,!1);F(n),R({txHash:t,loading:!1}),r()},approval:!0});case 2:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())})));case 66:y=e.sent,R({txHash:y[0].hash,loading:!1,success:!0}),e.next=77;break;case 70:if(e.prev=70,e.t5=e.catch(59),me.current){e.next=74;break}return e.abrupt("return");case 74:v=(0,b.WG)(e.t5,b.aD.GAS_ESTIMATION,!1),F(v),R({txHash:void 0,loading:!1});case 77:case"end":return e.stop()}}),e,null,[[3,50],[8,41],[14,27,30,33],[59,70]])})));return function(t){return e.apply(this,arguments)}}(),be=function(){var e=(0,o.Z)(c().mark((function e(){var t,r,i,o,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!pe||!n){e.next=21;break}if(q.length&&Y){e.next=3;break}throw new Error("signature needed");case 3:return e.prev=3,P(E(E({},D),{},{loading:!0})),e.next=7,n(q,Y);case 7:return t=e.sent,e.next=10,t[0].tx();case 10:return delete(r=e.sent).gasPrice,e.abrupt("return",ge({tx:function(){return U(r)},successCallback:function(e){P({txHash:e.hash,loading:!1,success:!0}),F(void 0)},errorCallback:function(e,t){var n=(0,b.WG)(e,b.aD.MAIN_ACTION);F(n),P({txHash:t,loading:!1})}}));case 15:e.prev=15,e.t0=e.catch(3),console.log(e.t0,"error"),i=(0,b.WG)(e.t0,b.aD.GAS_ESTIMATION,!1),F(i),P({txHash:void 0,loading:!1});case 21:if(pe&&ae||!le){e.next=37;break}return e.prev=22,P(E(E({},D),{},{loading:!0})),e.next=26,le.tx();case 26:return delete(o=e.sent).gasPrice,e.abrupt("return",ge({tx:function(){return U(o)},successCallback:function(e){P({txHash:e.hash,loading:!1,success:!0}),F(void 0)},errorCallback:function(e,t){var n=(0,b.WG)(e,b.aD.MAIN_ACTION);F(n),P({txHash:t,loading:!1})}}));case 31:e.prev=31,e.t1=e.catch(22),s=(0,b.WG)(e.t1,b.aD.GAS_ESTIMATION,!1),console.log(e.t1,s),F(s),P({txHash:void 0,loading:!1});case 37:case"end":return e.stop()}}),e,null,[[3,15],[22,31]])})));return function(){return e.apply(this,arguments)}}();return(0,f.useEffect)((function(){if(!A){N(!0);var e=setTimeout((function(){return N(!0),t().then(function(){var e=(0,o.Z)(c().mark((function e(t){var r,i,o,s,u,d,f,p,h;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(me.current){e.next=2;break}return e.abrupt("return");case 2:if(r=t.filter((function(e){return"ERC20_APPROVAL"==e.txType})),r.length>0&&ce(r),i=a&&te===y.n.PERMIT&&n&&x,!(r.length>0&&i)){e.next=14;break}he(!0),o=l.eB[x],B(o.limit||""),P({txHash:void 0}),F(void 0),N(!1),e.next=48;break;case 14:he(!1),r.length>0&&ce(r),de(t.find((function(e){return["DLP_ACTION","REWARD_ACTION","FAUCET_V2_MINT","FAUCET_MINT","STAKE_ACTION","GOV_DELEGATION_ACTION","GOVERNANCE_ACTION","V3_MIGRATION_ACTION"].includes(e.txType)}))),P({txHash:void 0}),F(void 0),s=0,e.prev=20,u=w(t),e.prev=22,u.s();case 24:if((d=u.n()).done){e.next=32;break}return f=d.value,e.next=28,f.gas();case 28:(p=e.sent)&&p.gasLimit&&(s+=Number(p.gasLimit));case 30:e.next=24;break;case 32:e.next=37;break;case 34:e.prev=34,e.t0=e.catch(22),u.e(e.t0);case 37:return e.prev=37,u.f(),e.finish(37);case 40:e.next=46;break;case 42:e.prev=42,e.t1=e.catch(20),h=(0,b.WG)(e.t1,b.aD.GAS_ESTIMATION,!1),F(h);case 46:B(s.toString()||""),N(!1);case 48:case"end":return e.stop()}}),e,null,[[20,42],[22,34,37,40]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){if(me.current){P({txHash:void 0});var t=(0,b.WG)(e,b.aD.GAS_ESTIMATION,!1);F(t),N(!1)}}))}),1e3);return function(){return clearTimeout(e)}}ce(void 0),de(void 0)}),[A].concat((0,r.Z)(S),[a,te])),{approval:ye,action:be,loadingTxns:M,setUsePermit:he,requiresApproval:!!ae||pe,approvalTxState:O,mainTxState:D,usePermit:pe}}},19419:function(e,t,n){"use strict";n.d(t,{R:function(){return a},n:function(){return c}});var r=n(67294),i=n(69311),o=n(85893),s=r.createContext({}),a=function(e){var t=e.children,n=(0,i.p4)(),r=(0,i.Qb)(),a=(0,i.DP)(),c=(0,i.IP)(),u=(0,i.Fp)(),l=(0,i.n7)(),d=(0,i.HL)();return(0,o.jsx)(s.Provider,{value:{refetchIncentiveData:r,refetchPoolData:n,refetchGhoData:a,refetchOracle:c,refetchRewardRates:u,refetchLPRewardRates:l,refetchIsClaimed:d},children:t})},c=function(){return(0,r.useContext)(s)}},34220:function(e,t,n){"use strict";n.d(t,{GM:function(){return _},cp:function(){return A},HT:function(){return k}});var r=n(59499),i=n(17674),o=n(1279),s=n(82403),a=n(20854),c=n(59148),u=n(75148);var l=n(70794),d=n(56371),f=n(67294),p=n(77537),h=n(69311),m=n(69125),g=n(83601),y=n(43478),b=n(46930),v=n(85893);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t0){var L=function({userGhoDiscountedInterest:e,user:t,marketReferenceCurrencyPriceUSD:n}){const r=Number(t.totalBorrowsUSD)-e,i=Number(t.availableBorrowsUSD)+e,o=Number(t.totalBorrowsMarketReferenceCurrency)-e/n,s=0===o?"-1":Number(t.totalCollateralMarketReferenceCurrency)*Number(t.currentLiquidationThreshold)/o;return Object.assign(Object.assign({},t),{totalBorrowsMarketReferenceCurrency:o.toString(),totalBorrowsUSD:r.toString(),netWorthUSD:(Number(t.netWorthUSD)+e).toString(),availableBorrowsUSD:i.toString(),availableBorrowsMarketReferenceCurrency:(i/n).toString(),healthFactor:s.toString()})}({userGhoDiscountedInterest:N.userDiscountedGhoInterest,user:F,marketReferenceCurrencyPriceUSD:Number((0,d.formatUnits)(k.marketReferenceCurrencyPriceInUsd,s.$3))});F=x(x({},F),L)}var j=F.userReservesData.reduce((function(e,t){var n=D.find((function(e){return e.underlyingAsset===t.reserve.underlyingAsset}));if(!n)throw new Error("no possible to calculate net apy");if("0"!==t.underlyingBalanceUSD&&(e.positiveProportion=e.positiveProportion.plus(new l.Z(n.supplyAPY).multipliedBy(t.underlyingBalanceUSD)),n.aIncentivesData&&n.aIncentivesData.forEach((function(n){e.positiveProportion=e.positiveProportion.plus(new l.Z(n.incentiveAPR).multipliedBy(t.underlyingBalanceUSD))}))),"0"!==t.variableBorrowsUSD)if(B({symbol:n.symbol,currentMarket:f})){var r=(0,m.li)(M.ghoVariableBorrowAPY,N.userGhoBorrowBalance,N.userGhoAvailableToBorrowAtDiscount,M.ghoBorrowAPYWithMaxDiscount);e.negativeProportion=e.negativeProportion.plus(new l.Z(r).multipliedBy(N.userGhoBorrowBalance)),n.vIncentivesData&&n.vIncentivesData.forEach((function(t){e.positiveProportion=e.positiveProportion.plus(new l.Z(t.incentiveAPR).multipliedBy(N.userGhoBorrowBalance))}))}else e.negativeProportion=e.negativeProportion.plus(new l.Z(n.variableBorrowAPY).multipliedBy(t.variableBorrowsUSD)),n.vIncentivesData&&n.vIncentivesData.forEach((function(n){e.positiveProportion=e.positiveProportion.plus(new l.Z(n.incentiveAPR).multipliedBy(t.variableBorrowsUSD))}));return"0"!==t.stableBorrowsUSD&&(e.negativeProportion=e.negativeProportion.plus(new l.Z(t.stableBorrowAPY).multipliedBy(t.stableBorrowsUSD)),n.sIncentivesData&&n.sIncentivesData.forEach((function(n){e.positiveProportion=e.positiveProportion.plus(new l.Z(n.incentiveAPR).multipliedBy(t.stableBorrowsUSD))}))),e}),{positiveProportion:new l.Z(0),negativeProportion:new l.Z(0)}),U=F.userReservesData.some((function(e){return"0"!==e.scaledATokenBalance})),Z=j.positiveProportion.dividedBy(F.totalLiquidityUSD).toNumber(),H=j.negativeProportion.dividedBy(F.totalBorrowsUSD).toNumber(),z=(Z||0)*(Number(F.totalLiquidityUSD)/Number("0"!==F.netWorthUSD?F.netWorthUSD:"1"))-(H||0)*(Number(F.totalBorrowsUSD)/Number("0"!==F.netWorthUSD?F.netWorthUSD:"1"));return(0,v.jsx)(E.Provider,{value:{loading:!_.length||!!r&&!T.length,reserves:D,eModes:C,user:x(x({},F),{},{totalBorrowsUSD:F.totalBorrowsUSD,totalBorrowsMarketReferenceCurrency:F.totalBorrowsMarketReferenceCurrency,userEmodeCategoryId:S,isInEmode:0!==S,userReservesData:F.userReservesData.sort((function(e,t){return(0,g.uk)(e.reserve,t.reserve)})),earnedAPY:Z,debtAPY:H,netAPY:z}),userReserves:T,isUserHasDeposits:U,marketReferencePriceInUsd:k.marketReferenceCurrencyPriceInUsd,marketReferenceCurrencyDecimals:k.marketReferenceCurrencyDecimals,ghoReserveData:x(x({},M),{},{aaveFacilitatorRemainingCapacity:Math.max(M.aaveFacilitatorRemainingCapacity-1e-6,0)}),ghoUserData:N,ghoLoadingData:!R},children:t})},k=function(){return(0,f.useContext)(E)}},82482:function(e,t,n){"use strict";n.d(t,{P:function(){return m}});var r=n(17674),i=n(80854),o=n(1279),s=n(81206),a=n(82403),c=n(70794),u=n(69311),l=n(83601),d=n(36492),f=n(31001),p=n(30449),h=n(46930),m=function(){var e=(0,h.f)().currentNetworkConfig,t=function(){var e=(0,p.z)().poolTokensBalanceService,t=(0,u.Yh)((function(e){return e.currentMarketData})),n=(0,u.Yh)((function(e){return e.account})),r=t.addresses.LENDING_POOL_ADDRESS_PROVIDER,i=t.addresses.LENDING_POOL;return(0,d.a)({queryFn:function(){return e.getPoolTokensBalances({user:n,lendingPoolAddressProvider:r})},queryKey:[f.iP.POOL_TOKENS,n,r,i,e.toHash()],enabled:!!n,refetchInterval:f.g_})}(),n=t.data,m=t.isLoading,g=(0,u.Yh)((function(e){return[(0,l.Rp)(e),(0,l.Fb)(e)]})),y=(0,r.Z)(g,2),b=y[0],v=y[1],w=!0;return{walletBalances:(null!==n&&void 0!==n?n:[]).reduce((function(t,n){var r=b.find((function(t){var r;return n.address===i.hP.toLowerCase()?t.symbol.toLowerCase()===(null===(r=e.wrappedBaseAssetSymbol)||void 0===r?void 0:r.toLowerCase()):t.underlyingAsset.toLowerCase()===n.address}));return"0"!==n.amount&&(w=!1),r&&(t[n.address]={amount:(0,o.Fv)(n.amount,r.decimals),amountUSD:(0,s.Z)({amount:new c.O(n.amount),currencyDecimals:r.decimals,priceInMarketReferenceCurrency:r.priceInMarketReferenceCurrency,marketReferenceCurrencyDecimals:v.marketReferenceCurrencyDecimals,normalizedMarketReferencePriceInUsd:(0,o.Fv)(v.marketReferenceCurrencyPriceInUsd,a.$3)})}),t}),{}),hasEmptyWallet:w,loading:m||!b.length}}},61038:function(e,t,n){"use strict";var r=n(50029),i=n(59499),o=n(87794),s=n.n(o),a=n(67294),c=n(77537),u=n(21036),l=n(82828);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;tLearn more",components:{0:(0,d.jsx)(w.rU,{href:"https://discord.gg/zerolend",underline:"always"})}})," "]})}))}):null},k=n(19952),T=["borrowCap","icon"];function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t was not given a valid reserve asset to parse"),null;var r=function(e){var t=W(e),n=t.supplyCapUsage,r=t.supplyCapReached,o=q(e),s=o.borrowCapUsage,a=o.borrowCapReached,c=$(e);return{reserve:e,supplyCap:{percentUsed:n,isMaxed:r,determineWarningDisplay:function(e){var t=e.supplyCap,n=e.icon,r=(0,i.Z)(e,L);return t?(0,d.jsx)(F,H({supplyCap:t,icon:n},r)):null},displayMaxedTooltip:function(e){var t=e.supplyCap;return t?(0,d.jsx)(_,{supplyCap:t}):null}},borrowCap:{percentUsed:s,isMaxed:a,determineWarningDisplay:function(e){var t=e.borrowCap,n=e.icon,r=(0,i.Z)(e,j);return t?(0,d.jsx)(I,H({borrowCap:t,icon:n},r)):null},displayMaxedTooltip:function(e){var t=e.borrowCap;return t?(0,d.jsx)(m,{borrowCap:t}):null}},debtCeiling:{percentUsed:c.debtCeilingUsage,isMaxed:c.debtCeilingReached,determineWarningDisplay:function(e){var t=e.debtCeiling,n=e.icon,r=(0,i.Z)(e,U);return t?(0,d.jsx)(P,H({debtCeiling:t,icon:n},r)):null},displayMaxedTooltip:function(e){var t=e.debtCeiling;return t?(0,d.jsx)(v,{debtCeiling:t}):null}}}}(n);return(0,d.jsx)(z.Provider,{value:r,children:t})},V=function(){var e=(0,s.useContext)(z);if(void 0===e)throw new Error("useAssetCaps() can only be used inside of , please declare it at a higher level.");return e},W=function(e){var t=e?100*(0,o.hE)(e.totalLiquidity).dividedBy(e.supplyCap).toNumber():0;return{supplyCapUsage:t=t===1/0?0:t,supplyCapReached:t>=99.99}},q=function(e){var t=e?100*(0,o.hE)(e.totalDebt).dividedBy(e.borrowCap).toNumber():0;return{borrowCapUsage:t=t===1/0?0:t,borrowCapReached:t>=99.99}},$=function(e){var t=e?100*(0,o.hE)(e.isolationModeTotalDebt).dividedBy(e.debtCeiling).toNumber():0;return{debtCeilingUsage:t=t===1/0?0:t,debtCeilingReached:t>=99.99}}},43478:function(e,t,n){"use strict";n.d(t,{p:function(){return s}});var r=n(27484),i=n.n(r),o=n(67294);function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15,t=(0,o.useState)(0),n=t[0],r=t[1],s=(0,o.useState)(0),a=s[0],c=s[1];return(0,o.useEffect)((function(){var t=setInterval((function(){return c(i()().unix()+n)}),1e3*e);return function(){return clearInterval(t)}}),[e,n]),(0,o.useEffect)((function(){var e=Number(localStorage.getItem("forkTimeAhead")||0);r(e),c(i()().unix()+e)}),[]),a}},48618:function(e,t,n){"use strict";n.d(t,{i:function(){return d}});var r=n(50029),i=n(17674),o=n(87794),s=n.n(o),a=n(80854),c=n(1279),u=n(67294),l=n(69311);function d(e,t){var n=(0,u.useState)(0),o=n[0],d=n[1],f=(0,l.Yh)((function(e){return[e.LPrewardRate,e.LPtotalSupply]})),p=(0,i.Z)(f,2),h=p[0],m=p[1],g=(0,a.gU)("1",18),y=(0,u.useCallback)((0,r.Z)(s().mark((function n(){var r,i,o,u;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("0"!==h.toString()&&"0"!==m.toString()){n.next=2;break}return n.abrupt("return",d(0));case 2:if("0"!==(null===e||void 0===e?void 0:e.toString())&&"0"!==(null===t||void 0===t?void 0:t.toString())){n.next=4;break}return n.abrupt("return",d(0));case 4:if("0"!==(null===e||void 0===e?void 0:e.toString())&&"0"!==(null===t||void 0===t?void 0:t.toString())){n.next=6;break}return n.abrupt("return",d(0));case 6:r=e&&t?(0,c.hE)(e).multipliedBy(g).dividedBy(t):(0,a.gU)("1",18),i=(0,c.hE)(h.toString()).multipliedBy(31536e3).multipliedBy(6753941),o=i.multipliedBy(1e3).div(m.toString()),u=o.multipliedBy(r).div(g).toNumber()/1e3,d(u);case 11:case"end":return n.stop()}}),n)}))),[e,m,h]);return(0,u.useEffect)((function(){y().catch((function(e){console.error("Failed to fetch Apr Values: ".concat(e.stack))}))}),[y]),o}},47850:function(e,t,n){"use strict";n.d(t,{A:function(){return d}});var r=n(50029),i=n(17674),o=n(87794),s=n.n(o),a=n(80854),c=n(91747),u=n(67294),l=n(69311);function d(e,t){var n=(0,u.useState)(0),o=n[0],d=n[1],f=(0,l.Yh)((function(e){return[e.rewardRate,e.totalSupply]})),p=(0,i.Z)(f,2),h=p[0],m=p[1],g=(0,a.gU)("1",18),y=(0,u.useCallback)((0,r.Z)(s().mark((function n(){var r,i,o,u;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("0"!==h.toString()&&"0"!==m.toString()){n.next=2;break}return n.abrupt("return",d(0));case 2:if("0"!==(null===e||void 0===e?void 0:e.toString())&&"0"!==(null===t||void 0===t?void 0:t.toString())){n.next=4;break}return n.abrupt("return",d(0));case 4:if("0"!==(null===e||void 0===e?void 0:e.toString())&&"0"!==(null===t||void 0===t?void 0:t.toString())){n.next=6;break}return n.abrupt("return",d(0));case 6:r=e&&t?c.O$.from(e).mul(g).div(t):(0,a.gU)("1",18),i=h.mul(31536e3),o=i.mul(1e3).div(m),u=o.mul(r).div(g).toNumber()/1e3,d(u);case 11:case"end":return n.stop()}}),n)}))),[e,m,h]);return(0,u.useEffect)((function(){y().catch((function(e){console.error("Failed to fetch Apr Values: ".concat(e.stack))}))}),[y]),o}},66209:function(e,t,n){"use strict";n.d(t,{Q:function(){return o}});var r=n(77537),i=n(46930);function o(e){var t=(0,i.f)().currentChainId,n=e||t;return{isWrongNetwork:(0,r.Z)().chainId!==n,requiredChainId:n}}},8195:function(e,t,n){"use strict";n.d(t,{w8:function(){return r},ny:function(){return l},vR:function(){return d}});var r,i=n(67294),o=n(77537),s=n(69311),a=n(57609),c=n(85893);!function(e){e[e.Supply=0]="Supply",e[e.Withdraw=1]="Withdraw",e[e.Borrow=2]="Borrow",e[e.Repay=3]="Repay",e[e.CollateralChange=4]="CollateralChange",e[e.RateSwitch=5]="RateSwitch",e[e.Stake=6]="Stake",e[e.Unstake=7]="Unstake",e[e.StakeCooldown=8]="StakeCooldown",e[e.StakeRewardClaim=9]="StakeRewardClaim",e[e.ClaimRewards=10]="ClaimRewards",e[e.ClaimZEROLpIncentives=11]="ClaimZEROLpIncentives",e[e.ClaimZEROLockerIncentives=12]="ClaimZEROLockerIncentives",e[e.ClaimZEROLpLockerETHIncentives=13]="ClaimZEROLpLockerETHIncentives",e[e.ClaimLPLockerIncentives=14]="ClaimLPLockerIncentives",e[e.ClaimZEROVestsRewards=15]="ClaimZEROVestsRewards",e[e.Emode=16]="Emode",e[e.Faucet=17]="Faucet",e[e.Swap=18]="Swap",e[e.DebtSwitch=19]="DebtSwitch",e[e.GovDelegation=20]="GovDelegation",e[e.GovVote=21]="GovVote",e[e.V3Migration=22]="V3Migration",e[e.RevokeGovDelegation=23]="RevokeGovDelegation",e[e.StakeRewardsClaimRestake=24]="StakeRewardsClaimRestake",e[e.Switch=25]="Switch",e[e.Bridge=26]="Bridge",e[e.StakeZERO=27]="StakeZERO",e[e.ExitEarly=28]="ExitEarly",e[e.WithdrawVestZERO=29]="WithdrawVestZERO",e[e.StakeVest=30]="StakeVest",e[e.TransferVest=31]="TransferVest",e[e.ClaimVestedTokens=32]="ClaimVestedTokens",e[e.ConvertEZero=33]="ConvertEZero",e[e.ConvertGravity=34]="ConvertGravity",e[e.StakeEZero=35]="StakeEZero",e[e.LockZero=36]="LockZero",e[e.NewLockZero=37]="NewLockZero",e[e.LockLP=38]="LockLP",e[e.WithdrawLockZero=39]="WithdrawLockZero",e[e.UnstakeZero=40]="UnstakeZero",e[e.LinkReferralCode=41]="LinkReferralCode",e[e.LockedDLP=42]="LockedDLP"}(r||(r={}));var u=(0,i.createContext)({}),l=function(e){var t=e.children,n=(0,o.Z)().setSwitchNetworkError,l=(0,i.useState)(),d=l[0],f=l[1],p=(0,i.useState)({}),h=p[0],m=p[1],g=(0,i.useState)({}),y=g[0],b=g[1],v=(0,i.useState)({}),w=v[0],x=v[1],A=(0,i.useState)(""),E=A[0],_=A[1],k=(0,i.useState)(!1),T=k[0],S=k[1],C=(0,i.useState)(),I=C[0],O=C[1],R=(0,s.Yh)((function(e){return e.trackEvent}));return(0,c.jsx)(u.Provider,{value:{openSupply:function(e,t,n,i,o){f(r.Supply),m({underlyingAsset:e}),R(a.vh.OPEN_MODAL,{modal:"Supply",market:t,assetName:n,asset:e,funnel:i})},openWithdraw:function(e,t,n,i){f(r.Withdraw),m({underlyingAsset:e}),R(a.vh.OPEN_MODAL,{modal:"Withdraw",market:t,assetName:n,asset:e,funnel:i})},openBorrow:function(e,t,n,i,o){f(r.Borrow),m({underlyingAsset:e}),R(a.vh.OPEN_MODAL,{modal:"Borrow",market:t,assetName:n,asset:e,funnel:i})},openRepay:function(e,t,n,i,o,s){f(r.Repay),m({underlyingAsset:e,currentRateMode:t,isFrozen:n}),R(a.vh.OPEN_MODAL,{modal:"Repay",asset:e,assetName:o,market:i,funnel:s})},openCollateralChange:function(e,t,n,i,o){f(r.CollateralChange),m({underlyingAsset:e}),R(a.vh.OPEN_MODAL,{modal:"Toggle Collateral",market:t,assetName:n,asset:e,usageAsCollateralEnabledOnUser:o,funnel:i})},openRateSwitch:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Rate Switch"}),f(r.RateSwitch),m({underlyingAsset:e,currentRateMode:t})},openStake:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Stake",assetName:e}),f(r.Stake),m({stakeAssetName:e,icon:t})},openUnstake:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Untake",assetName:e}),f(r.Unstake),m({stakeAssetName:e,icon:t})},openStakeCooldown:function(e){R(a.vh.OPEN_MODAL,{modal:"Cooldown",assetName:e}),f(r.StakeCooldown),m({stakeAssetName:e})},openStakeRewardsClaim:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Stake Rewards",assetName:e}),f(r.StakeRewardClaim),m({stakeAssetName:e,icon:t})},openStakeRewardsRestakeClaim:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Restatke Stake Rewards",assetName:e}),f(r.StakeRewardsClaimRestake),m({stakeAssetName:e,icon:t})},openClaimRewards:function(){R(a.vh.OPEN_MODAL,{modal:"Claim"}),f(r.ClaimRewards)},openZEROLpIncentivesRewards:function(){R(a.vh.OPEN_MODAL,{modal:"ClaimZEROLpIncentives"}),f(r.ClaimZEROLpIncentives)},openZEROLPETHLockerIncentives:function(e){R(a.vh.OPEN_MODAL,{modal:"ClaimZEROLpLockerETHIncentives"}),f(r.ClaimZEROLpLockerETHIncentives),m({amount:e})},openZEROLockerIncentives:function(e){R(a.vh.OPEN_MODAL,{modal:"ClaimZEROLockerIncentives"}),f(r.ClaimZEROLockerIncentives),m({amount:e})},openLPLockerIncentives:function(e){R(a.vh.OPEN_MODAL,{modal:"ClaimLPLockerIncentives"}),f(r.ClaimLPLockerIncentives),m({amount:e})},openZEROVestsRewards:function(e,t){R(a.vh.OPEN_MODAL,{modal:"ClaimZEROVestsRewards"}),f(r.ClaimZEROVestsRewards),m({vests:e,vestLoading:t})},openEmode:function(e){R(a.vh.OPEN_MODAL,{modal:"eMode"}),f(r.Emode),m({emode:e})},openFaucet:function(e){R(a.vh.OPEN_MODAL,{modal:"Faucet"}),f(r.Faucet),m({underlyingAsset:e})},openSwap:function(e){R(a.vh.OPEN_MODAL,{modal:"Swap"}),f(r.Swap),m({underlyingAsset:e})},openDebtSwitch:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Debt Switch"}),f(r.DebtSwitch),m({underlyingAsset:e,currentRateMode:t})},openGovDelegation:function(){R(a.vh.OPEN_MODAL,{modal:"Governance Delegation"}),f(r.GovDelegation)},openRevokeGovDelegation:function(){R(a.vh.OPEN_MODAL,{modal:"Revoke Governance Delegation"}),f(r.RevokeGovDelegation)},openGovVote:function(e,t,n){R(a.vh.OPEN_MODAL,{modal:"Vote",proposalId:e,voteSide:t}),f(r.GovVote),m({proposalId:e,support:t,power:n})},openV3Migration:function(){R(a.vh.OPEN_MODAL,{modal:"V2->V3 Migration"}),f(r.V3Migration)},openSwitch:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Switch"}),f(r.Switch),m({underlyingAsset:e,chainId:t})},openBridge:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Bridge"}),f(r.Bridge),m({underlyingAsset:e,chainId:t})},openExitEarly:function(e){R(a.vh.OPEN_MODAL,{modal:"Exit Early"}),f(r.ExitEarly),m({vest:e})},openWithdrawVestZero:function(e){R(a.vh.OPEN_MODAL,{modal:"Withdraw vest zero"}),f(r.WithdrawVestZERO),m({underlyingAsset:e})},openStakeVestModal:function(e){f(r.StakeVest),m({vest:e})},openTransferVestModal:function(e){f(r.TransferVest),m({vestId:e})},openClaimVestedTokensModal:function(e,t){f(r.ClaimVestedTokens),m({vestId:e,amount:t})},openStakeEZeroModal:function(){f(r.StakeEZero)},openConvertEZeroModal:function(e,t){f(r.ConvertEZero),m({merkleData:e,isClaimed:t})},openConvertGravityModal:function(e){f(r.ConvertGravity),m({gravityMerkleData:e})},openLockZeroModal:function(e,t,n){R(a.vh.OPEN_MODAL,{modal:"Lock Zero"}),f(r.LockZero),m({amount:e,duration:t,stakeNFT:n})},openNewLockZeroModal:function(){R(a.vh.OPEN_MODAL,{modal:"Lock Zero"}),f(r.NewLockZero)},openLockLPModal:function(){R(a.vh.OPEN_MODAL,{modal:"Lock LP"}),f(r.LockLP)},openStakeZero:function(e){R(a.vh.OPEN_MODAL,{modal:"Stake Zero"}),f(r.StakeZERO),m({nftId:e})},openWithdrawLockZeroModal:function(e,t,n){R(a.vh.OPEN_MODAL,{modal:"Withdraw Zero"}),f(r.WithdrawLockZero),m({icon:e,nftId:t,amount:n})},openUnstakeZero:function(e){R(a.vh.OPEN_MODAL,{modal:"Unstake Zero"}),f(r.UnstakeZero),m({nftId:e})},openLinkReferralModal:function(e){f(r.LinkReferralCode),m({referrerCode:e})},openLockedDLP:function(){R(a.vh.OPEN_MODAL,{modal:"Locked DLP"}),f(r.LockedDLP)},close:function(){f(void 0),m({}),x({}),b({}),_(""),O(void 0),n(void 0)},type:d,args:h,approvalTxState:y,mainTxState:w,setApprovalTxState:b,setMainTxState:x,gasLimit:E,setGasLimit:_,loadingTxns:T,setLoadingTxns:S,txError:I,setTxError:O},children:t})},d=function(){var e=(0,i.useContext)(u);if(void 0===e)throw new Error("useModalContext must be used within a ModalProvider");return e}},90452:function(e,t,n){"use strict";n.d(t,{W:function(){return v},T:function(){return w}});var r=n(50029),i=n(87794),o=n.n(i),s=n(56371),a=n(58342);class c extends a.lV{constructor(e){super(u,l,e)}static connect(e,t){return new a.CH(e,u,t)}}const u=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"bool",name:"set",type:"bool"}],name:"PermissionsAdminSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"role",type:"uint256"},{indexed:!0,internalType:"address",name:"whiteLister",type:"address"},{indexed:!1,internalType:"bool",name:"set",type:"bool"}],name:"RoleSet",type:"event"},{inputs:[{internalType:"address[]",name:"admins",type:"address[]"}],name:"addPermissionAdmins",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"roles",type:"uint256[]"},{internalType:"address[]",name:"users",type:"address[]"}],name:"addPermissions",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserPermissionAdmin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserPermissions",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256[]",name:"roles",type:"uint256[]"}],name:"isInAllRoles",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256[]",name:"roles",type:"uint256[]"}],name:"isInAnyRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"role",type:"uint256"}],name:"isInRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"isPermissionsAdmin",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"isUserPermissionAdminValid",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"admins",type:"address[]"}],name:"removePermissionAdmins",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"roles",type:"uint256[]"},{internalType:"address[]",name:"users",type:"address[]"}],name:"removePermissions",outputs:[],stateMutability:"nonpayable",type:"function"}],l="0x608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b6111488061007d6000396000f3fe608060405234801561001057600080fd5b50600436106100d55760003560e01c80638857a624116100875780638857a624146102fd5780638cadc3341461036b5780638da5cb5b14610429578063be5de6af14610431578063c9c8836014610457578063ca553a7a1461047d578063ea6c64fb146104eb578063f2fde38b146105a9576100d5565b80631cea0e8c146100da57806325fde6631461011c5780633e734f551461019d578063643148251461022f5780636d38f7841461025b578063715018a6146102d957806377133d81146102e3575b600080fd5b610100600480360360208110156100f057600080fd5b50356001600160a01b03166105cf565b604080516001600160a01b039092168252519081900360200190f35b6101426004803603602081101561013257600080fd5b50356001600160a01b03166105f1565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b83811015610188578181015183820152602001610170565b50505050905001935050505060405180910390f35b61021b600480360360408110156101b357600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156101dd57600080fd5b8201836020820111156101ef57600080fd5b803590602001918460208302840111600160201b8311171561021057600080fd5b509092509050610680565b604080519115158252519081900360200190f35b61021b6004803603604081101561024557600080fd5b506001600160a01b0381351690602001356106f4565b61021b6004803603604081101561027157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561029b57600080fd5b8201836020820111156102ad57600080fd5b803590602001918460208302840111600160201b831117156102ce57600080fd5b50909250905061071b565b6102e161078d565b005b6102eb61082f565b60408051918252519081900360200190f35b6102e16004803603602081101561031357600080fd5b810190602081018135600160201b81111561032d57600080fd5b82018360208201111561033f57600080fd5b803590602001918460208302840111600160201b8311171561036057600080fd5b509092509050610835565b6102e16004803603604081101561038157600080fd5b810190602081018135600160201b81111561039b57600080fd5b8201836020820111156103ad57600080fd5b803590602001918460208302840111600160201b831117156103ce57600080fd5b919390929091602081019035600160201b8111156103eb57600080fd5b8201836020820111156103fd57600080fd5b803590602001918460208302840111600160201b8311171561041e57600080fd5b50909250905061094a565b610100610be0565b61021b6004803603602081101561044757600080fd5b50356001600160a01b0316610bef565b61021b6004803603602081101561046d57600080fd5b50356001600160a01b0316610c0c565b6102e16004803603602081101561049357600080fd5b810190602081018135600160201b8111156104ad57600080fd5b8201836020820111156104bf57600080fd5b803590602001918460208302840111600160201b831117156104e057600080fd5b509092509050610c3d565b6102e16004803603604081101561050157600080fd5b810190602081018135600160201b81111561051b57600080fd5b82018360208201111561052d57600080fd5b803590602001918460208302840111600160201b8311171561054e57600080fd5b919390929091602081019035600160201b81111561056b57600080fd5b82018360208201111561057d57600080fd5b803590602001918460208302840111600160201b8311171561059e57600080fd5b509092509050610d4d565b6102e1600480360360208110156105bf57600080fd5b50356001600160a01b0316610fd0565b6001600160a01b03908116600090815260016020819052604090912001541690565b604080516101008082526120208201909252606091600091839160208201612000803683375050506001600160a01b03851660009081526001602052604081205491925090815b61010081101561067457600182821c161561066c578084848151811061065a57fe5b60209081029190910101526001909201915b600101610638565b50919350915050915091565b6000805b828110156106e75783838281811061069857fe5b9050602002013560016000876001600160a01b03166001600160a01b0316815260200190815260200160002060000154901c600116600014156106df5760009150506106ed565b600101610684565b50600190505b9392505050565b6001600160a01b038216600090815260016020819052604090912054821c16151592915050565b6000805b8281101561078257600084848381811061073557fe5b9050602002013560016000886001600160a01b03166001600160a01b0316815260200190815260200160002060000154901c600116111561077a5760019150506106ed565b60010161071f565b506000949350505050565b6107956110c8565b6000546001600160a01b039081169116146107e5576040805162461bcd60e51b815260206004820181905260248201526000805160206110f3833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b61010081565b61083d6110c8565b6000546001600160a01b0390811691161461088d576040805162461bcd60e51b815260206004820181905260248201526000805160206110f3833981519152604482015290519081900360640190fd5b60005b81811015610945576001600260008585858181106108aa57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055508282828181106108ea57fe5b905060200201356001600160a01b03166001600160a01b03167fce25e05cb98afcaf8f38f5668e4b0edc9248a8e1993151d180aa2f1823f4c79c600160405180821515815260200191505060405180910390a2600101610890565b505050565b336000818152600260205260409020546109ab576040805162461bcd60e51b815260206004820152601c60248201527f43414c4c45525f4e4f545f5045524d495353494f4e535f41444d494e00000000604482015290519081900360640190fd5b8382146109fc576040805162461bcd60e51b815260206004820152601a6024820152790929c869e9ca692a6a88a9ca8be82a4a482b2a6be988a9c8ea8960331b604482015290519081900360640190fd5b60005b82811015610bd8576000868683818110610a1557fe5b9050602002013590506000858584818110610a2c57fe5b905060200201356001600160a01b031690506101008210610a83576040805162461bcd60e51b815260206004820152600c60248201526b494e56414c49445f524f4c4560a01b604482015290519081900360640190fd5b6001600160a01b03808216600090815260016020819052604090912080549101549091168115801590610abe57506001600160a01b03811633145b80610ae557506001600160a01b038381166000908152600160208190526040909120015416155b610b30576040805162461bcd60e51b815260206004820152601760248201527624a72b20a624a22fa822a926a4a9a9a4a7a720a226a4a760491b604482015290519081900360640190fd5b6001600160a01b038316600090815260016020819052604090912090851b19831690819055610b84576001600160a01b03831660009081526001602081905260409091200180546001600160a01b03191690555b60408051600081529051339186916001600160a01b038716917fcd20d6b081e97182a607d072021b5e830136ec08ba1b05aeb25859a6a6649c94919081900360200190a45050600190920191506109ff9050565b505050505050565b6000546001600160a01b031690565b6001600160a01b0316600090815260026020526040902054151590565b6001600160a01b03908116600090815260016020818152604080842090920154909316825260029092522054151590565b610c456110c8565b6000546001600160a01b03908116911614610c95576040805162461bcd60e51b815260206004820181905260248201526000805160206110f3833981519152604482015290519081900360640190fd5b60005b8181101561094557600060026000858585818110610cb257fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002081905550828282818110610cf257fe5b905060200201356001600160a01b03166001600160a01b03167fce25e05cb98afcaf8f38f5668e4b0edc9248a8e1993151d180aa2f1823f4c79c600060405180821515815260200191505060405180910390a2600101610c98565b33600081815260026020526040902054610dae576040805162461bcd60e51b815260206004820152601c60248201527f43414c4c45525f4e4f545f5045524d495353494f4e535f41444d494e00000000604482015290519081900360640190fd5b838214610dff576040805162461bcd60e51b815260206004820152601a6024820152790929c869e9ca692a6a88a9ca8be82a4a482b2a6be988a9c8ea8960331b604482015290519081900360640190fd5b60005b82811015610bd8576000868683818110610e1857fe5b9050602002013590506000858584818110610e2f57fe5b905060200201356001600160a01b031690506101008210610e86576040805162461bcd60e51b815260206004820152600c60248201526b494e56414c49445f524f4c4560a01b604482015290519081900360640190fd5b6001600160a01b03808216600090815260016020819052604090912080549101549091168115801590610ec157506001600160a01b03811633145b80610ee857506001600160a01b038381166000908152600160208190526040909120015416155b610f33576040805162461bcd60e51b815260206004820152601760248201527624a72b20a624a22fa822a926a4a9a9a4a7a720a226a4a760491b604482015290519081900360640190fd5b81610f65576001600160a01b03831660009081526001602081905260409091200180546001600160a01b031916331790555b6001600160a01b03831660008181526001602081815260409283902082891b87179055825191825291513393889390927fcd20d6b081e97182a607d072021b5e830136ec08ba1b05aeb25859a6a6649c94929081900390910190a4505060019092019150610e029050565b610fd86110c8565b6000546001600160a01b03908116911614611028576040805162461bcd60e51b815260206004820181905260248201526000805160206110f3833981519152604482015290519081900360640190fd5b6001600160a01b03811661106d5760405162461bcd60e51b81526004018080602001828103825260268152602001806110cd6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220aee55fd2ffe4c1ae4ebcf66d0cd51779458160aebfc82117874fa1cd3a9ae4b664736f6c634300060c0033";var d=n(23286);class f{constructor(e){if(!(0,s.isAddress)(e.permissionManagerAddress))throw new Error("contract address is not valid");this._contract=c.connect(e.permissionManagerAddress,e.provider)}async getUserPermissions(e){if(!(0,s.isAddress)(e))throw new Error("User address is not a valid ethereum address");return this._contract.getUserPermissions(e)}async getHumanizedUserPermissions(e){const{0:t,1:n}=await this.getUserPermissions(e),r=[];return t.forEach(((e,t)=>{if(t4)throw new Error("Error parsing permission");r[t]=d.Z[n]}})),r}}var p=n(67294),h=n(77537),m=n(63206),g=n(46930),y=n(85893),b=p.createContext({permissions:[],isPermissionsLoading:!1}),v=function(e){var t=e.children,n=(0,g.f)(),i=n.currentChainId,s=n.currentMarketData,a=(0,h.Z)().currentAccount,c=(0,p.useState)(!0),u=c[0],l=c[1],d=(0,p.useState)([]),v=d[0],w=d[1];function x(){return(x=(0,r.Z)(o().mark((function e(t){var n,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=new f({provider:(0,m.VH)(i),permissionManagerAddress:t}),e.next=4,n.getHumanizedUserPermissions(a);case 4:r=e.sent,l(!0),w(r),e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(0),new Error("there was an error fetching your permissions");case 12:l(!1);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}return(0,p.useEffect)((function(){m.cr.permissions(s)&&a&&s.addresses.PERMISSION_MANAGER?function(e){x.apply(this,arguments)}(s.addresses.PERMISSION_MANAGER):l(!1)}),[a,s.addresses.PERMISSION_MANAGER]),(0,y.jsx)(b.Provider,{value:{permissions:v,isPermissionsLoading:u},children:t})},w=function(){return(0,p.useContext)(b)}},40481:function(e,t,n){"use strict";n.d(t,{W:function(){return o}});var r=n(90116),i=n(67294),o=function(e,t,n,o){var s=(0,i.useState)(0),a=s[0],c=s[1],u=(0,i.useRef)(e);(0,i.useEffect)((function(){u.current=e}),[e]),(0,i.useEffect)((function(){n||e()}),(0,r.Z)(o)),(0,i.useEffect)((function(){var e;return n||(e=window.setTimeout((function(){var e=u.current();e instanceof Promise?e.then((function(){c(a+1)})):(e(),c(a+1))}),t)),function(){return clearTimeout(e)}}),[a].concat((0,r.Z)(o)))}},46930:function(e,t,n){"use strict";n.d(t,{f:function(){return i}});var r=n(69311),i=function(){return(0,r.Yh)((function(e){return{currentChainId:e.currentChainId,currentMarket:e.currentMarket,currentMarketData:e.currentMarketData,currentNetworkConfig:e.currentNetworkConfig,jsonRpcProvider:e.jsonRpcProvider,setCurrentMarket:e.setCurrentMarket}}))}},26074:function(e,t,n){"use strict";n.d(t,{q:function(){return i}});var r=n(69311),i=function(){return(0,r.Yh)((function(e){return{isWalletModalOpen:e.isWalletModalOpen,setWalletModalOpen:e.setWalletModalOpen}}))}},56881:function(e,t,n){"use strict";n.d(t,{Z:function(){return ln}});var r,i=n(30120),o=n(67294),s=n(49501),a=n(54235),c=n(85893),u=(0,a.Z)((0,c.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"}),"Twitter"),l=(0,a.Z)((0,c.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"),d=n(81719),f=n(29630),p=n(81645),h=n(68861);function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;tr}const L="undefined"!==typeof window?window:null;var j=n(8662),U=n(75400),Z=n(84771),H=n(53566),z=n(57577);const G=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function V(e,t,n){var r;const i=function(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=(0,z.Z)(t);let s;if(t.fakeTransform)s=t.fakeTransform;else{const e=o.getComputedStyle(t);s=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let a=0,c=0;if(s&&"none"!==s&&"string"===typeof s){const e=s.split("(")[1].split(")")[0].split(",");a=parseInt(e[4],10),c=parseInt(e[5],10)}return"left"===e?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:"right"===e?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:"up"===e?i?`translateY(${i.bottom+c-r.top}px)`:`translateY(${o.innerHeight+c-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-c}px)`:`translateY(-${r.top+r.height-c}px)`}(e,t,"function"===typeof(r=n)?r():r);i&&(t.style.webkitTransform=i,t.style.transform=i)}var W=o.forwardRef((function(e,t){const n=(0,D.Z)(),r={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:u,container:l,direction:d="down",easing:f=r,in:p,onEnter:h,onEntered:m,onEntering:g,onExit:y,onExited:b,onExiting:v,style:w,timeout:x=i,TransitionComponent:A=j.ZP}=e,E=(0,M.Z)(e,G),_=o.useRef(null),k=(0,Z.Z)(u.ref,_,t),T=e=>t=>{e&&(void 0===t?e(_.current):e(_.current,t))},S=T(((e,t)=>{V(d,e,l),(0,H.n)(e),h&&h(e,t)})),C=T(((e,t)=>{const r=(0,H.C)({timeout:x,style:w,easing:f},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",(0,B.Z)({},r)),e.style.transition=n.transitions.create("transform",(0,B.Z)({},r)),e.style.webkitTransform="none",e.style.transform="none",g&&g(e,t)})),I=T(m),O=T(v),R=T((e=>{const t=(0,H.C)({timeout:x,style:w,easing:f},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),V(d,e,l),y&&y(e)})),P=T((e=>{e.style.webkitTransition="",e.style.transition="",b&&b(e)})),N=o.useCallback((()=>{_.current&&V(d,_.current,l)}),[d,l]);return o.useEffect((()=>{if(p||"down"===d||"right"===d)return;const e=(0,U.Z)((()=>{_.current&&V(d,_.current,l)})),t=(0,z.Z)(_.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[d,p,l]),o.useEffect((()=>{p||N()}),[p,N]),(0,c.jsx)(A,(0,B.Z)({nodeRef:_,onEnter:S,onEntered:I,onEntering:C,onExit:R,onExited:P,onExiting:O,addEndListener:e=>{s&&s(_.current,e)},appear:a,in:p,timeout:x},E,{children:(e,t)=>o.cloneElement(u,(0,B.Z)({ref:k,style:(0,B.Z)({visibility:"exited"!==e||p?void 0:"hidden"},w,u.props.style)},t))}))})),q=n(16600);var $=function(e){const{children:t,defer:n=!1,fallback:r=null}=e,[i,s]=o.useState(!1);return(0,q.Z)((()=>{n||s(!0)}),[n]),o.useEffect((()=>{n&&s(!0)}),[n]),(0,c.jsx)(o.Fragment,{children:i?t:r})},K=n(4132),Y=n(8195),X=n(69311),J=n(63206),Q=n(85214),ee=n(86010),te=n(94780),ne=n(28442),re=n(41796),ie=n(78884),oe=n(83187),se=n(7335),ae=n(63289),ce=n(57742),ue=n(34867),le=n(1588);function de(e){return(0,ue.Z)("MuiListItem",e)}var fe=(0,le.Z)("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]);var pe=(0,le.Z)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function he(e){return(0,ue.Z)("MuiListItemSecondaryAction",e)}(0,le.Z)("MuiListItemSecondaryAction",["root","disableGutters"]);const me=["className"],ge=(0,d.ZP)("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})((({ownerState:e})=>(0,B.Z)({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},e.disableGutters&&{right:0}))),ye=o.forwardRef((function(e,t){const n=(0,ie.Z)({props:e,name:"MuiListItemSecondaryAction"}),{className:r}=n,i=(0,M.Z)(n,me),s=o.useContext(ce.Z),a=(0,B.Z)({},n,{disableGutters:s.disableGutters}),u=(e=>{const{disableGutters:t,classes:n}=e,r={root:["root",t&&"disableGutters"]};return(0,te.Z)(r,he,n)})(a);return(0,c.jsx)(ge,(0,B.Z)({className:(0,ee.default)(u.root,r),ownerState:a,ref:t},i))}));ye.muiName="ListItemSecondaryAction";var be=ye;const ve=["className"],we=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected"],xe=(0,d.ZP)("div",{name:"MuiListItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.button&&t.button,n.hasSecondaryAction&&t.secondaryAction]}})((({theme:e,ownerState:t})=>(0,B.Z)({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!t.disablePadding&&(0,B.Z)({paddingTop:8,paddingBottom:8},t.dense&&{paddingTop:4,paddingBottom:4},!t.disableGutters&&{paddingLeft:16,paddingRight:16},!!t.secondaryAction&&{paddingRight:48}),!!t.secondaryAction&&{[`& > .${pe.root}`]:{paddingRight:48}},{[`&.${fe.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${fe.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,re.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${fe.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,re.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${fe.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},"flex-start"===t.alignItems&&{alignItems:"flex-start"},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},t.button&&{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${fe.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,re.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,re.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity)}}},t.hasSecondaryAction&&{paddingRight:48}))),Ae=(0,d.ZP)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"});var Ee=o.forwardRef((function(e,t){const n=(0,ie.Z)({props:e,name:"MuiListItem"}),{alignItems:r="center",autoFocus:i=!1,button:s=!1,children:a,className:u,component:l,components:d={},componentsProps:f={},ContainerComponent:p="li",ContainerProps:{className:h}={},dense:m=!1,disabled:g=!1,disableGutters:y=!1,disablePadding:b=!1,divider:v=!1,focusVisibleClassName:w,secondaryAction:x,selected:A=!1}=n,E=(0,M.Z)(n.ContainerProps,ve),_=(0,M.Z)(n,we),k=o.useContext(ce.Z),T={dense:m||k.dense||!1,alignItems:r,disableGutters:y},S=o.useRef(null);(0,ae.Z)((()=>{i&&S.current&&S.current.focus()}),[i]);const C=o.Children.toArray(a),I=C.length&&(0,se.Z)(C[C.length-1],["ListItemSecondaryAction"]),O=(0,B.Z)({},n,{alignItems:r,autoFocus:i,button:s,dense:T.dense,disabled:g,disableGutters:y,disablePadding:b,divider:v,hasSecondaryAction:I,selected:A}),R=(e=>{const{alignItems:t,button:n,classes:r,dense:i,disabled:o,disableGutters:s,disablePadding:a,divider:c,hasSecondaryAction:u,selected:l}=e,d={root:["root",i&&"dense",!s&&"gutters",!a&&"padding",c&&"divider",o&&"disabled",n&&"button","flex-start"===t&&"alignItemsFlexStart",u&&"secondaryAction",l&&"selected"],container:["container"]};return(0,te.Z)(d,de,r)})(O),D=(0,Z.Z)(S,t),P=d.Root||xe,N=f.root||{},F=(0,B.Z)({className:(0,ee.default)(R.root,N.className,u),disabled:g},_);let L=l||"li";return s&&(F.component=l||"div",F.focusVisibleClassName=(0,ee.default)(fe.focusVisible,w),L=oe.Z),I?(L=F.component||l?L:"div","li"===p&&("li"===L?L="div":"li"===F.component&&(F.component="div")),(0,c.jsx)(ce.Z.Provider,{value:T,children:(0,c.jsxs)(Ae,(0,B.Z)({as:p,className:(0,ee.default)(R.container,h),ref:D,ownerState:O},E,{children:[(0,c.jsx)(P,(0,B.Z)({},N,!(0,ne.Z)(P)&&{as:L,ownerState:(0,B.Z)({},O,N.ownerState)},F,{children:C})),C.pop()]}))})):(0,c.jsx)(ce.Z.Provider,{value:T,children:(0,c.jsxs)(P,(0,B.Z)({},N,{as:L,ref:D,ownerState:O},!(0,ne.Z)(P)&&{ownerState:(0,B.Z)({},O,N.ownerState)},F,{children:[C,x&&(0,c.jsx)(be,{children:x})]}))})})),_e=n(57609),ke=n(46930),Te=n(6022),Se=n(83454),Ce=(Se.env.NEXT_PUBLIC_FIAT_ON_RAMP,[].concat([])),Ie=function(e){var t,n=e.setOpen,r=(0,s.mV)().i18n,i=(0,ke.f)(),o=i.currentNetworkConfig,a=i.currentMarketData,u=(0,D.Z)().breakpoints,l=(0,P.Z)(u.down("md")),d=(0,X.Yh)((function(e){return e.trackEvent})),p=function(e,t){t&&n?(d(_e.uh.MAIN_MENU,{nav_link:e}),n(!1)):d(_e.uh.MAIN_MENU,{nav_link:e})};return(0,c.jsx)(Q.Z,{sx:{display:"flex",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},disablePadding:!0,children:(null===(t=o.bridge)||void 0===t||t.url,[{link:h.Z6.markets,title:Te.ag._("Home"),dataCy:"menuMarkets"},{link:h.Z6.dashboard,title:Te.ag._("Dashboard"),dataCy:"menuDashboard"},{link:h.Z6.rewards,title:Te.ag._("Rewards"),dataCy:"menuMarkets"},{link:h.Z6.stake,title:Te.ag._("Stake"),dataCy:"menuMarkets"},{link:h.Z6.gravity,title:Te.ag._("Gravity \ud83d\ude80"),dataCy:"menuMarkets"},{link:h.Z6.faucet,title:Te.ag._("Faucet"),isVisible:function(){return"staging"===Se.env.NEXT_PUBLIC_ENV||J.p8}},{link:h.Z6.strategy,title:Te.ag._("Strategy"),dataCy:"menuMarkets",isVisible:function(){return!1}}]).filter((function(e){return!e.isVisible||e.isVisible(a)})).map((function(e,t){return""===e.link?(0,c.jsx)("div",{},t):(0,c.jsx)(Ee,{sx:{width:{xs:"100%",md:"unset"},mr:{xs:0,md:2}},"data-cy":e.dataCy,disablePadding:!0,children:l?(0,c.jsx)(f.Z,{component:h.rU,href:e.link,variant:"h2",color:"#F1F1F3",sx:{width:"100%",p:4},onClick:function(){return p(e.title,!0)},children:r._(e.title)}):(0,c.jsx)(v.Z,{component:h.rU,onClick:function(){return p(e.title,!1)},href:e.link,sx:function(){return{color:"#F1F1F3",p:"6px 8px",position:"relative",".active&:after, &:hover&:after":{transform:"scaleX(1)",transformOrigin:"bottom left"},"&:after":{content:"''",position:"absolute",width:"100%",transform:"scaleX(0)",height:"2px",bottom:"-6px",left:"0",background:"#fff",transformOrigin:"bottom right",transition:"transform 0.25s ease-out"}}},children:r._(e.title)})},t)}))})};var Oe=o.forwardRef((function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"}))})),Re=n(29894),De=n(72553),Pe=n(70918),Be=n(36622);function Me(e){return(0,ue.Z)("MuiDrawer",e)}(0,le.Z)("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const Ne=["BackdropProps"],Fe=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],Le=(e,t)=>{const{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},je=(0,d.ZP)(De.Z,{name:"MuiDrawer",slot:"Root",overridesResolver:Le})((({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),Ue=(0,d.ZP)("div",{shouldForwardProp:d.FO,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:Le})({flex:"0 0 auto"}),Ze=(0,d.ZP)(Pe.Z,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,Be.Z)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,Be.Z)(n.anchor)}`]]}})((({theme:e,ownerState:t})=>(0,B.Z)({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},"left"===t.anchor&&{left:0},"top"===t.anchor&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},"right"===t.anchor&&{right:0},"bottom"===t.anchor&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},"left"===t.anchor&&"temporary"!==t.variant&&{borderRight:`1px solid ${(e.vars||e).palette.divider}`},"top"===t.anchor&&"temporary"!==t.variant&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`},"right"===t.anchor&&"temporary"!==t.variant&&{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},"bottom"===t.anchor&&"temporary"!==t.variant&&{borderTop:`1px solid ${(e.vars||e).palette.divider}`}))),He={left:"right",right:"left",top:"down",bottom:"up"};var ze=o.forwardRef((function(e,t){const n=(0,ie.Z)({props:e,name:"MuiDrawer"}),r=(0,D.Z)(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{anchor:s="left",BackdropProps:a,children:u,className:l,elevation:d=16,hideBackdrop:f=!1,ModalProps:{BackdropProps:p}={},onClose:h,open:m=!1,PaperProps:g={},SlideProps:y,TransitionComponent:b=W,transitionDuration:v=i,variant:w="temporary"}=n,x=(0,M.Z)(n.ModalProps,Ne),A=(0,M.Z)(n,Fe),E=o.useRef(!1);o.useEffect((()=>{E.current=!0}),[]);const _=function(e,t){return"rtl"===e.direction&&function(e){return-1!==["left","right"].indexOf(e)}(t)?He[t]:t}(r,s),k=s,T=(0,B.Z)({},n,{anchor:k,elevation:d,open:m,variant:w},A),S=(e=>{const{classes:t,anchor:n,variant:r}=e,i={root:["root"],docked:[("permanent"===r||"persistent"===r)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,Be.Z)(n)}`,"temporary"!==r&&`paperAnchorDocked${(0,Be.Z)(n)}`]};return(0,te.Z)(i,Me,t)})(T),C=(0,c.jsx)(Ze,(0,B.Z)({elevation:"temporary"===w?d:0,square:!0},g,{className:(0,ee.default)(S.paper,g.className),ownerState:T,children:u}));if("permanent"===w)return(0,c.jsx)(Ue,(0,B.Z)({className:(0,ee.default)(S.root,S.docked,l),ownerState:T,ref:t},A,{children:C}));const I=(0,c.jsx)(b,(0,B.Z)({in:m,direction:He[_],timeout:v,appear:E.current},y,{children:C}));return"persistent"===w?(0,c.jsx)(Ue,(0,B.Z)({className:(0,ee.default)(S.root,S.docked,l),ownerState:T,ref:t},A,{children:I})):(0,c.jsx)(je,(0,B.Z)({BackdropProps:(0,B.Z)({},a,p,{transitionDuration:v}),className:(0,ee.default)(S.root,S.modal,l),open:m,ownerState:T,onClose:h,hideBackdrop:f,ref:t},A,x,{children:I}))})),Ge=function(e){var t=e.open,n=e.setOpen,r=e.children,i=e.headerHeight;return(0,c.jsx)(ze,{"data-cy":"mobile-menu",anchor:"top",open:t,onClose:function(){return n(!1)},hideBackdrop:!0,sx:{top:"".concat(i,"px")},PaperProps:{sx:{background:"rgba(27, 32, 48, 0.98)",backdropFilter:"blur(20px)",boxShadow:"none",borderRadius:"unset",width:"100%",top:"".concat(i+20,"px"),pt:6,pb:15,minHeight:"100vh"}},children:r})};var Ve=o.forwardRef((function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"}))}));var We=o.forwardRef((function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"}))})),qe=n(58057),$e=n(35683),Ke={en:Te.ag._("English"),es:Te.ag._("Spanish"),fr:Te.ag._("French"),el:Te.ag._("Greek"),zh:Te.ag._("Chinese"),jp:Te.ag._("Japanese")},Ye=function(e){var t=e.component,n=void 0===t?Ee:t,r=e.onClick,o=(0,s.mV)().i18n;return(0,c.jsxs)(i.Z,{component:n,onClick:r,sx:{color:{xs:"#F1F1F3",md:"text.primary"}},children:[(0,c.jsx)(A.Z,{children:(0,c.jsx)(s.cC,{id:"Language"})}),(0,c.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center"},children:[o._(Ke[o.locale])," ",(0,c.jsx)(p.Z,{fontSize:"small",sx:{color:{xs:"#F1F1F3",md:"text.primary"},ml:1},children:(0,c.jsx)(Ve,{})})]})]})},Xe=function(e){var t=e.component,n=void 0===t?Ee:t,r=e.onClick,o=(0,s.mV)().i18n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(i.Z,{component:n,sx:{color:{xs:"#F1F1F3",md:"text.primary"},mb:"4px"},onClick:r,children:[(0,c.jsx)(Re.Z,{sx:{minWidth:"unset !important",mr:2,color:{xs:"#F1F1F3",md:"primary.light"}},children:(0,c.jsx)(p.Z,{fontSize:"small",children:(0,c.jsx)(We,{})})}),(0,c.jsx)(A.Z,{disableTypography:!0,children:(0,c.jsx)(f.Z,{variant:"subheader2",children:(0,c.jsx)(s.cC,{id:"Select language"})})})]}),Object.keys(Ke).map((function(e){return(0,c.jsxs)(i.Z,{component:n,onClick:function(){return(0,$e.zl)(e)},sx:{color:{xs:"#F1F1F3",md:"text.primary"},".MuiListItemIcon-root":{minWidth:"unset"},".MuiMenuItemIcon-root":{minWidth:"unset"}},children:[(0,c.jsx)(Re.Z,{sx:{mr:3,borderRadius:"2px",overflow:"hidden",width:20,height:14},children:(0,c.jsx)("img",{src:"/icons/flags/".concat(e,".svg"),width:"100%",height:"100%",alt:"".concat(e," icon")})}),(0,c.jsx)(A.Z,{children:o._(Ke[e])}),e===o.locale&&(0,c.jsx)(Re.Z,{sx:{m:0},children:(0,c.jsx)(p.Z,{fontSize:"small",sx:{color:{xs:"#F1F1F3",md:"text.primary"}},children:(0,c.jsx)(qe.Z,{})})})]},e)}))]})},Je=n(5506),Qe=n(80562),et=function(e){var t=e.setOpen;return(0,c.jsx)(Qe.Z,{onClick:function(){return t(!1)},sx:{p:0,mr:{xs:-2,xsm:1}},children:(0,c.jsx)(p.Z,{sx:{color:"#F1F1F3",fontSize:"32px"},children:(0,c.jsx)(Je.Z,{})})})},tt=n(22841),nt=n(54181),rt=function(e){var t=e.component,n=void 0===t?Ee:t,r="testnetsEnabled",a="true"===localStorage.getItem(r)||!1,u=(0,o.useState)(a),l=u[0],d=u[1],f=(0,X.Yh)((function(e){return e.trackEvent}));return(0,c.jsxs)(i.Z,{component:n,onClick:function(){var e=!l;d(!l),localStorage.setItem(r,e?"true":"false"),window.location.href="/"},sx:{cursor:"pointer",color:{xs:"#F1F1F3",md:"text.primary"},py:{xs:1.5,md:2}},children:[(0,c.jsx)(A.Z,{children:(0,c.jsx)(s.cC,{id:"Testnet mode"})}),(0,c.jsx)(tt.Z,{sx:{mr:0},value:"testnetsMode",control:(0,c.jsx)(nt.Z,{disableRipple:!0,onClick:function(){return f(_e.L6.TESTNET_MODE)},checked:l,sx:{".MuiSwitch-track":{bgcolor:{xs:"#FFFFFF1F",md:"primary.light"}}}}),label:l?"On":"Off",labelPlacement:"start"})]})},it=function(e){var t=e.children,n=e.title;return(0,c.jsxs)(i.Z,{sx:{mb:6,"&:last-of-type":{mb:0,".MuiDivider-root":{display:"none"}}},children:[(0,c.jsxs)(i.Z,{sx:{px:2},children:[(0,c.jsx)(f.Z,{variant:"subheader2",sx:{color:"#A5A8B6",px:4,py:2},children:n}),t]}),(0,c.jsx)(E.Z,{sx:{borderColor:"#F2F3F729",mt:6}})]})},ot=function(e){var t=e.open,n=e.setOpen,r=e.headerHeight,i=(0,s.mV)().i18n,a=(0,o.useState)(!1),u=a[0],l=a[1];return(0,o.useEffect)((function(){return l(!1)}),[t]),(0,c.jsxs)(c.Fragment,{children:[t?(0,c.jsx)(et,{setOpen:n}):(0,c.jsx)(v.Z,{id:"settings-button-mobile",variant:"surface",sx:{p:"7px 8px",minWidth:"unset",ml:2},onClick:function(){return n(!0)},children:(0,c.jsx)(p.Z,{sx:{color:"#F1F1F3"},fontSize:"small",children:(0,c.jsx)(Oe,{})})}),(0,c.jsx)(Ge,{open:t,setOpen:n,headerHeight:r,children:u?(0,c.jsx)(Q.Z,{sx:{px:2},children:(0,c.jsx)(Xe,{onClick:function(){return l(!1)}})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(it,{title:(0,c.jsx)(s.cC,{id:"Menu"}),children:(0,c.jsx)(Ie,{setOpen:n})}),(0,c.jsx)(it,{title:(0,c.jsx)(s.cC,{id:"Global settings"}),children:(0,c.jsxs)(Q.Z,{children:[J.F3&&(0,c.jsx)(rt,{}),(0,c.jsx)(Ye,{onClick:function(){return l(!0)}})]})}),(0,c.jsx)(it,{title:(0,c.jsx)(s.cC,{id:"Links"}),children:(0,c.jsx)(Q.Z,{children:Ce.map((function(e,t){return(0,c.jsxs)(Ee,{component:h.rU,href:e.link,sx:{color:"#F1F1F3"},children:[(0,c.jsx)(Re.Z,{sx:{minWidth:"unset",mr:3},children:(0,c.jsx)(p.Z,{sx:{fontSize:"20px",color:"#F1F1F3"},children:e.icon})}),(0,c.jsx)(A.Z,{children:i._(e.title)})]},t)}))})})]})})]})},st=n(22659),at={en:"English",es:"Spanish",fr:"French",el:"Greek"};function ct(){var e=(0,o.useState)(!1),t=e[0],n=e[1],r=(0,o.useState)(!1),i=r[0],a=r[1],u=(0,o.useState)(null),l=u[0],d=u[1],h=(0,X.Yh)((function(e){return e.trackEvent})),m=function(){d(null),n(!1),a(!1)};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(v.Z,{variant:"surface","aria-label":"settings",id:"settings-button","aria-controls":t?"settings-menu":void 0,"aria-expanded":t?"true":void 0,"aria-haspopup":"true",onClick:function(e){d(e.currentTarget),n(!0),a(!1)},sx:{p:"7px 8px",minWidth:"unset",ml:2},children:(0,c.jsx)(p.Z,{sx:{color:"#F1F1F3"},fontSize:"small",children:(0,c.jsx)(st.Z,{})})}),(0,c.jsxs)(w.Z,{id:"settings-menu",MenuListProps:{"aria-labelledby":"settings-button"},anchorEl:l,open:t,onClose:m,sx:{".MuiMenuItem-root.Mui-disabled":{opacity:1}},keepMounted:!0,children:[(0,c.jsx)(x.Z,{disabled:!0,sx:{mb:"4px"},children:(0,c.jsx)(f.Z,{variant:"subheader2",color:"text.secondary",children:(0,c.jsx)(s.cC,{id:"Global settings"})})}),J.F3&&(0,c.jsx)(rt,{}),(0,c.jsx)(Ye,{onClick:function(){var e=localStorage.getItem("LOCALE")||$e.ZW;n(!1),a(!0),h(_e.L6.LANGUAGE,{language:at[e]})},component:x.Z})]}),(0,c.jsx)(w.Z,{id:"settings-menu",MenuListProps:{"aria-labelledby":"settings-button"},anchorEl:l,open:i,onClose:m,keepMounted:!0,children:(0,c.jsx)(Xe,{onClick:function(){n(!0),a(!1)},component:x.Z})})]})}var ut=n(59499),lt=n(50029),dt=n(87794),ft=n.n(dt),pt=n(64343),ht=n(52758),mt=n(84563);var gt=o.forwardRef((function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"}))})),yt=n(91655),bt=n(852),vt=n(17155),wt=n(4730),xt=(0,a.Z)((0,c.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function At(e){return(0,ue.Z)("MuiAvatar",e)}(0,le.Z)("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const Et=["alt","children","className","component","imgProps","sizes","src","srcSet","variant"],_t=(0,d.ZP)("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})((({theme:e,ownerState:t})=>(0,B.Z)({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},"rounded"===t.variant&&{borderRadius:(e.vars||e).shape.borderRadius},"square"===t.variant&&{borderRadius:0},t.colorDefault&&(0,B.Z)({color:(e.vars||e).palette.background.default},e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:"light"===e.palette.mode?e.palette.grey[400]:e.palette.grey[600]})))),kt=(0,d.ZP)("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Tt=(0,d.ZP)(xt,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});var St,Ct=o.forwardRef((function(e,t){const n=(0,ie.Z)({props:e,name:"MuiAvatar"}),{alt:r,children:i,className:s,component:a="div",imgProps:u,sizes:l,src:d,srcSet:f,variant:p="circular"}=n,h=(0,M.Z)(n,Et);let m=null;const g=function({crossOrigin:e,referrerPolicy:t,src:n,srcSet:r}){const[i,s]=o.useState(!1);return o.useEffect((()=>{if(!n&&!r)return;s(!1);let i=!0;const o=new Image;return o.onload=()=>{i&&s("loaded")},o.onerror=()=>{i&&s("error")},o.crossOrigin=e,o.referrerPolicy=t,o.src=n,r&&(o.srcset=r),()=>{i=!1}}),[e,t,n,r]),i}((0,B.Z)({},u,{src:d,srcSet:f})),y=d||f,b=y&&"error"!==g,v=(0,B.Z)({},n,{colorDefault:!b,component:a,variant:p}),w=(e=>{const{classes:t,variant:n,colorDefault:r}=e,i={root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]};return(0,te.Z)(i,At,t)})(v);return m=b?(0,c.jsx)(kt,(0,B.Z)({alt:r,src:d,srcSet:f,sizes:l,ownerState:v,className:w.img},u)):null!=i?i:y&&r?r[0]:(0,c.jsx)(Tt,{className:w.fallback}),(0,c.jsx)(_t,(0,B.Z)({as:a,ownerState:v,className:(0,ee.default)(w.root,s),ref:t},h,{children:m}))})),It=n(11288),Ot=n.n(It),Rt=["image","fallbackImage","size","sx","loading","invisibleBadge","badge"];function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;tt(i,r)));return o.useEffect((()=>{const e=()=>{a(t(i,(0,B.Z)({target:n},r)))};return e(),n.addEventListener("scroll",e,{passive:!0}),()=>{n.removeEventListener("scroll",e,{passive:!0})}}),[n,t,JSON.stringify(r)]),s}({threshold:(0,P.Z)(n.down("md"))?160:80});return(0,c.jsx)(W,{appear:!1,direction:"down",in:!r,children:t})}var rn="bridgeVisited";function on(){var e=(0,D.Z)().breakpoints,t=(0,P.Z)(e.down("md")),n=(0,P.Z)(e.down("sm")),r=(0,o.useState)((function(){return Boolean(localStorage.getItem(tn))})),a=(r[0],r[1],(0,o.useState)((function(){return Boolean(localStorage.getItem(rn))}))),u=a[0],l=a[1],d=(0,X.Yh)((function(e){return[e.mobileDrawerOpen,e.setMobileDrawerOpen]})),m=(0,C.Z)(d,2),g=m[0],y=m[1],b=(0,Y.vR)().openBridge,w=(0,o.useState)(!1),x=w[0],A=w[1],E=(0,o.useState)(!1),_=E[0],k=E[1];(0,Y.vR)().openSwitch;(0,o.useEffect)((function(){g&&!t&&y(!1),x&&A(!1)}),[t]);var T=(0,c.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"start",gap:1},children:[(0,c.jsx)(f.Z,{variant:"subheader1",children:(0,c.jsx)(s.cC,{id:"Testnet mode is ON"})}),(0,c.jsxs)(f.Z,{variant:"description",children:[(0,c.jsx)(s.cC,{id:"The app is running in testnet mode. Learn how it works in"})," ",(0,c.jsx)(h.rU,{href:"https://discord.gg/zerolend",underline:"always",children:(0,c.jsx)(s.cC,{id:"Discord"})})]}),(0,c.jsx)(v.Z,{variant:"outlined",sx:{mt:"12px"},onClick:function(){localStorage.setItem("testnetsEnabled","false"),window.location.href="/"},children:(0,c.jsx)(s.cC,{id:"Disable testnet"})})]});return(0,c.jsx)(nn,{children:(0,c.jsxs)(i.Z,{component:"header",sx:function(e){return{height:48,position:"sticky",top:0,transition:e.transitions.create("top"),zIndex:e.zIndex.appBar,bgcolor:e.palette.background.header,padding:{xs:_||x?"8px 20px":"8px 8px 8px 20px",xsm:"8px 20px"},display:"flex",alignItems:"center",flexDirection:"space-between",boxShadow:"inset 0px -1px 0px rgba(242, 243, 247, 0.16)"}},children:[(0,c.jsx)(i.Z,{sx:{mr:n?1:3},children:J.p8&&(0,c.jsx)(K.a,{tooltipContent:T,offset:[0,-4],withoutHover:!0,children:(0,c.jsxs)(v.Z,{variant:"surface",size:"small",color:"primary",sx:{backgroundColor:"#12152B","&:hover, &.Mui-focusVisible":{backgroundColor:"rgba(182, 80, 158, 0.7)"}},children:["TESTNET",(0,c.jsx)(p.Z,{sx:{marginLeft:"2px",fontSize:"16px"},children:(0,c.jsx)(I.Z,{})})]})})}),(0,c.jsx)(i.Z,{sx:{display:{xs:"none",md:"block"}},children:(0,c.jsx)(Ie,{})}),(0,c.jsx)(i.Z,{sx:{flexGrow:1}}),(0,c.jsx)($,{children:(0,c.jsx)(en,{invisible:u,variant:"dot",badgeContent:"",color:"secondary",sx:{mr:2},children:(0,c.jsxs)(v.Z,{onClick:function(){localStorage.setItem(rn,"true"),l(!0),b()},variant:"surface",sx:{p:"7px 8px",minWidth:"unset",gap:2,alignItems:"center"},"aria-label":"Switch tool",children:[!t&&(0,c.jsx)(f.Z,{component:"span",typography:"subheader1",children:"Bridge"}),(0,c.jsx)(p.Z,{fontSize:"small",children:(0,c.jsx)(O.Z,{})})]})})}),(0,c.jsx)($,{children:!1}),!_&&(0,c.jsx)(Qt,{open:x,setOpen:function(e){t&&y(e),A(e)},headerHeight:48}),(0,c.jsx)(i.Z,{sx:{display:{xs:"none",md:"block"}},children:(0,c.jsx)(ct,{})}),!x&&(0,c.jsx)(i.Z,{sx:{display:{xs:"flex",md:"none"}},children:(0,c.jsx)(ot,{open:_,setOpen:function(e){t&&y(e),k(e)},headerHeight:48})})]})})}var sn=n(68346),an=n(97005),cn=function(){return(0,c.jsx)(i.Z,{sx:{bgcolor:"#111",color:"#fff",display:"flex",justifyContent:"center",p:"3px"},children:(0,c.jsxs)(an.Z,{pauseOnHover:!0,children:[(0,c.jsxs)(sn.Z,{href:"https://github.com/zerolend/audits",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"VIEW OUR AUDITS"})]}),(0,c.jsxs)(sn.Z,{href:"https://guild.xyz/zerolend",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"JOIN OUR GUILD"})]}),(0,c.jsxs)(sn.Z,{href:"https://app.zerolend.xyz/stake/?marketName=proto_linea_v3",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"STAKING IS LIVE"})]}),(0,c.jsxs)(sn.Z,{href:"https://github.com/zerolend/audits",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"VIEW OUR AUDITS"})]}),(0,c.jsxs)(sn.Z,{href:"https://guild.xyz/zerolend",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"JOIN OUR GUILD"})]}),(0,c.jsxs)(sn.Z,{href:"https://app.zerolend.xyz/stake/?marketName=proto_linea_v3",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"STAKING IS LIVE"})]}),(0,c.jsxs)(sn.Z,{href:"https://github.com/zerolend/audits",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"VIEW OUR AUDITS"})]}),(0,c.jsxs)(sn.Z,{href:"https://guild.xyz/zerolend",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"JOIN OUR GUILD"})]}),(0,c.jsxs)(sn.Z,{href:"https://app.zerolend.xyz/stake/?marketName=proto_linea_v3",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"STAKING IS LIVE"})]})]})})},un=n(61038);function ln(e){var t,n=e.children,r=(0,Y.vR)().openLinkReferralModal,s=(0,un.ZP)(),a=X.Yh.getState().invite,u=(0,Ft.Z)().currentAccount;return(0,o.useEffect)((function(){var e;u&&void 0===(null===(e=s.value)||void 0===e?void 0:e.referrerCode)&&!s.isLoading&&""!==a&&r(a||"")}),[null===(t=s.value)||void 0===t?void 0:t.referrerCode,u,a,s.isLoading]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(cn,{}),(0,c.jsx)(on,{}),(0,c.jsx)(i.Z,{component:"main",sx:{display:"flex",flexDirection:"column",flex:1},children:n}),(0,c.jsx)(S,{})]})}},35683:function(e,t,n){"use strict";n.d(t,{ZW:function(){return g},iL:function(){return v},zl:function(){return y}});var r=n(50029),i=n(87794),o=n.n(i),s=n(6022),a=n(49501);function c(e,t){return t?"other":1==e?"one":"other"}function u(e,t){return"other"}const l=c;const d=c;const f=u;var p=n(67294),h=n(79958),m=n(85893);s.ag.loadLocaleData({en:{plurals:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,o=i&&n[0].slice(-1),s=i&&n[0].slice(-2);return t?1==o&&11!=s?"one":2==o&&12!=s?"two":3==o&&13!=s?"few":"other":1==e&&r?"one":"other"}},es:{plurals:d},fr:{plurals:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"}},el:{plurals:l},zh:{plurals:f}}),s.ag.load("en",h.messages),s.ag.activate("en");var g="en";function y(e){return b.apply(this,arguments)}function b(){return b=(0,r.Z)(o().mark((function e(t){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(50702)("./".concat(t,"/messages.js"));case 2:r=e.sent,i=r.messages,s.ag.load(t,i),s.ag.activate(t),localStorage.setItem("LOCALE",t);case 7:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}var v=function(e){return(0,p.useEffect)((function(){var e=localStorage.getItem("LOCALE")||g;s.ag._locale!==e&&y(e)}),[]),(0,m.jsx)(a.bd,{i18n:s.ag,forceRenderOnLocaleChange:!1,children:e.children})}},77537:function(e,t,n){"use strict";n.d(t,{S:function(){return i},Z:function(){return o}});var r=n(67294),i=r.createContext({}),o=function(){var e=(0,r.useContext)(i).web3ProviderData;if(0===Object.keys(e).length)throw new Error("useWeb3Context() can only be used inside of , please declare it at a higher level.");return e}},65637:function(e,t,n){"use strict";n.d(t,{ab:function(){return b},zw:function(){return v}});var r=n(50029),i=n(82262),o=n(10748),s=n(59499),a=n(92777),c=n(81531),u=n(63553),l=n(37247),d=n(46576),f=n(87794),p=n.n(f),h=n(26939),m=n(63206),g=n(38776);function y(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var b=function(e){(0,c.Z)(n,e);var t=y(n);function n(){var e;return(0,a.Z)(this,n),(e=t.call(this)).name=e.constructor.name,e.message="The user rejected the request.",e}return n}((0,d.Z)(Error)),v=function(e){(0,c.Z)(u,e);var t=y(u);function u(e){var n;(0,a.Z)(this,u),n=t.call(this),(0,s.Z)((0,o.Z)(n),"config",void 0),(0,s.Z)((0,o.Z)(n),"walletConnectProvider",void 0),(0,s.Z)((0,o.Z)(n),"handleDisplayURI",(function(e){n.emit("URI_AVAILABLE",e)}));var r=(0,m.c)(),i=r.reduce((function(e,t){var n=(0,m.Mo)(t);return e[t]=n.privateJsonRPCUrl||n.publicJsonRPCUrl[0],e}),{});return n.config={chains:[e],optionalChains:r,rpcMap:i,projectId:"9f8cf941224ba28f02be7c7dd755c78b",showQrModal:!0},n.handleChainChanged=n.handleChainChanged.bind((0,o.Z)(n)),n.handleAccountsChanged=n.handleAccountsChanged.bind((0,o.Z)(n)),n.handleDisconnect=n.handleDisconnect.bind((0,o.Z)(n)),n}return(0,i.Z)(u,[{key:"handleChainChanged",value:function(e){this.emitUpdate({chainId:e})}},{key:"handleAccountsChanged",value:function(e){this.emitUpdate({account:e[0]})}},{key:"handleDisconnect",value:function(){this.emitDeactivate()}},{key:"activate",value:function(){var e=(0,r.Z)(p().mark((function e(){var t,r,i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.walletConnectProvider){e.next=7;break}return e.next=3,n.e(327).then(n.bind(n,44327)).then((function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.default)&&void 0!==t?t:e}));case 3:return t=e.sent,e.next=6,t.init(this.config);case 6:this.walletConnectProvider=e.sent;case 7:return this.walletConnectProvider.on("chainChanged",this.handleChainChanged),this.walletConnectProvider.on("accountsChanged",this.handleAccountsChanged),this.walletConnectProvider.on("disconnect",this.handleDisconnect),this.walletConnectProvider.on("display_uri",this.handleDisplayURI),e.prev=11,e.next=14,this.walletConnectProvider.enable();case 14:return r=e.sent,i=r[0],e.abrupt("return",{provider:this.walletConnectProvider,account:i});case 19:if(e.prev=19,e.t0=e.catch(11),"Connection request reset. Please try again."!==e.t0.message){e.next=23;break}throw new b;case 23:throw e.t0;case 24:case"end":return e.stop()}}),e,this,[[11,19]])})));return function(){return e.apply(this,arguments)}}()},{key:"getProvider",value:function(){var e=(0,r.Z)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.walletConnectProvider);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getChainId",value:function(){var e=(0,r.Z)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,g.Z)(this.walletConnectProvider,"WalletConnectProvider should exists when calling getChainId"),e.abrupt("return",Promise.resolve(this.walletConnectProvider.chainId));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getAccount",value:function(){var e=(0,r.Z)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,g.Z)(this.walletConnectProvider,"WalletConnectProvider should exists when calling getAccount"),e.abrupt("return",Promise.resolve(this.walletConnectProvider.accounts).then((function(e){return e[0]})));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"deactivate",value:function(){this.walletConnectProvider&&(this.walletConnectProvider.removeListener("disconnect",this.handleDisconnect),this.walletConnectProvider.removeListener("chainChanged",this.handleChainChanged),this.walletConnectProvider.removeListener("accountsChanged",this.handleAccountsChanged),this.walletConnectProvider.removeListener("display_uri",this.handleDisplayURI),this.walletConnectProvider.disconnect(),this.walletConnectProvider=void 0,localStorage.removeItem("walletProvider"))}},{key:"close",value:function(){var e=(0,r.Z)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.emitDeactivate();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),u}(h.AbstractConnector)},5906:function(e,t,n){"use strict";n.d(t,{kn:function(){return ke},Sq:function(){return be},iL:function(){return Se}});var r=n(92777),i=n(82262),o=n(10748),s=n(81531),a=n(63553),c=n(37247),u=n(59499),l=n(75331),d=n(15495),f=n(26939),p=n(81088),h=n(36939),m=n.n(h),g="Invariant failed";function y(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function w(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(V){return!1}}function x(e,t,n){return x=w()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&v(i,n.prototype),i},x.apply(null,arguments)}function A(e){var t="function"===typeof Map?new Map:void 0;return A=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return x(e,arguments,b(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),v(r,e)},A(e)}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var _=function(e){function t(){var t;return(t=e.call(this)||this).name=t.constructor.name,t.message="The user rejected the request.",t}return y(t,e),t}(A(Error)),k=function(e){function t(t){var n;return 1!==t.supportedChainIds.length&&function(e,t){if(!e)throw new Error(g)}(!1),(n=e.call(this,t)||this).handleNetworkChanged=n.handleNetworkChanged.bind(E(n)),n.handleChainChanged=n.handleChainChanged.bind(E(n)),n.handleAccountsChanged=n.handleAccountsChanged.bind(E(n)),n.handleClose=n.handleClose.bind(E(n)),n}y(t,e);var n=t.prototype;return n.handleNetworkChanged=function(e){this.emitUpdate({provider:this.provider,chainId:e})},n.handleChainChanged=function(e){this.emitUpdate({chainId:e})},n.handleAccountsChanged=function(e){this.emitUpdate({account:0===e.length?null:e[0]})},n.handleClose=function(e,t){this.emitDeactivate()},n.activate=function(){try{var e=this;return e.provider||(e.provider=m()("frame")),e.provider.on("networkChanged",e.handleNetworkChanged).on("chainChanged",e.handleChainChanged).on("accountsChanged",e.handleAccountsChanged).on("close",e.handleClose),Promise.resolve(e.provider.enable().then((function(e){return e[0]})).catch((function(e){throw e&&4001===e.code?new _:e}))).then((function(t){return{provider:e.provider,account:t}}))}catch(V){return Promise.reject(V)}},n.getProvider=function(){try{return Promise.resolve(this.provider)}catch(V){return Promise.reject(V)}},n.getChainId=function(){try{return Promise.resolve(this.provider.send("eth_chainId"))}catch(V){return Promise.reject(V)}},n.getAccount=function(){try{return Promise.resolve(this.provider.send("eth_accounts").then((function(e){return e[0]})))}catch(V){return Promise.reject(V)}},n.deactivate=function(){this.provider.removeListener("networkChanged",this.handleNetworkChanged).removeListener("chainChanged",this.handleChainChanged).removeListener("accountsChanged",this.handleAccountsChanged).removeListener("close",this.handleClose)},t}(f.AbstractConnector),T=n(30950),S=n(31630),C=n(97452),I=n(63206),O=n(52864),R=n(65637),D=n(50029),P=n(46576),B=n(87794),M=n.n(B);var N=function(e,t){};function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t0}));case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(){return e.apply(this,arguments)}}()}]),n}(f.AbstractConnector),G=n(14094);function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function q(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){W(o,r,i,s,a,"next",e)}function a(e){W(o,r,i,s,a,"throw",e)}s(void 0)}))}}function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K(e,t,n){return K=se()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&re(i,n.prototype),i},K.apply(null,arguments)}function Y(e,t){for(var n=0;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0}))];case 2:return[2,e.sent()];case 3:return e.sent(),[2,!1];case 4:return[2]}}))}))()}}]),n}(f.AbstractConnector),ge=function(e){ee(n,e);var t=ae(n);function n(){var e;return $(this,n),(e=t.call(this)).name=e.constructor.name,e.message="The user rejected the request.",ne(e)}return n}(oe(Error));function ye(e){var t=e.supportedChainIds,n=e.rpc;return t||(n?Object.keys(n).map((function(e){return Number(e)})):void 0)}var be,ve=function(e){ee(r,e);var t=ae(r);function r(e){var n;return $(this,r),n=t.call(this,{supportedChainIds:ye(e)}),le(V(n),"binanceW3WProvider"),le(V(n),"config"),n.config=e,n.handleChainChanged=n.handleChainChanged.bind(V(n)),n.handleAccountsChanged=n.handleAccountsChanged.bind(V(n)),n.handleDisconnect=n.handleDisconnect.bind(V(n)),n}return X(r,[{key:"handleChainChanged",value:function(e){this.emitUpdate({chainId:e})}},{key:"handleAccountsChanged",value:function(e){this.emitUpdate({account:e[0]})}},{key:"handleDisconnect",value:function(){this.binanceW3WProvider&&(this.binanceW3WProvider.removeListener("chainChanged",this.handleChainChanged),this.binanceW3WProvider.removeListener("accountsChanged",this.handleAccountsChanged),this.binanceW3WProvider=void 0),this.emitDeactivate()}},{key:"activate",value:function(){var e=this;return q((function(){var t,r;return ce(this,(function(i){switch(i.label){case 0:return e.binanceW3WProvider?[3,2]:[4,n.e(728).then(n.bind(n,50888))];case 1:t=i.sent().default,e.binanceW3WProvider=new t(e.config),i.label=2;case 2:return[4,new Promise((function(t,n){var i=function(){e.binanceW3WProvider=void 0,n(new ge)};e.binanceW3WProvider.connector.on("disconnect",(function(){r||i()})),e.config.lng&&e.binanceW3WProvider.setLng(e.config.lng),e.binanceW3WProvider.enable(e.config.chainId).then((function(e){return t(e[0])})).catch((function(e){100001!==e.code?n(e):i()}))})).catch((function(e){throw e}))];case 3:return r=i.sent(),[2,(e.binanceW3WProvider.on("disconnect",e.handleDisconnect),e.binanceW3WProvider.on("chainChanged",e.handleChainChanged),e.binanceW3WProvider.on("accountsChanged",e.handleAccountsChanged),{provider:e.binanceW3WProvider,account:r})]}}))}))()}},{key:"getProvider",value:function(){var e=this;return q((function(){return ce(this,(function(t){return[2,e.binanceW3WProvider]}))}))()}},{key:"getChainId",value:function(){var e=this;return q((function(){return ce(this,(function(t){return[2,Promise.resolve(e.binanceW3WProvider.chainId)]}))}))()}},{key:"getAccount",value:function(){var e=this;return q((function(){return ce(this,(function(t){return[2,Promise.resolve(e.binanceW3WProvider.accounts).then((function(e){return e[0]}))]}))}))()}},{key:"deactivate",value:function(){this.binanceW3WProvider&&(this.binanceW3WProvider.removeListener("disconnect",this.handleDisconnect),this.binanceW3WProvider.removeListener("chainChanged",this.handleChainChanged),this.binanceW3WProvider.removeListener("accountsChanged",this.handleAccountsChanged),this.binanceW3WProvider.disconnect())}},{key:"close",value:function(){this.emitDeactivate()}}]),r}(f.AbstractConnector),we=function(){return(0,G.bD)()?me:ve};function xe(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(V){return!1}}();return function(){var n,r=(0,c.Z)(e);if(t){var i=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}!function(e){e.OKX="okx",e.BITGET="bitget",e.INJECTED="injected",e.WALLET_CONNECT="wallet_connect",e.WALLET_LINK="wallet_link",e.TORUS="torus",e.FRAME="frame",e.GNOSIS="gnosis",e.LEDGER="ledger",e.READ_ONLY_MODE="read_only_mode",e.BINANCE="binance"}(be||(be={}));var Ae="ZeroLend",Ee="https://app.zerolend.xyz/favicon.ico",_e={request:Promise.resolve(null)},ke=function(e){(0,s.Z)(n,e);var t=xe(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,s=new Array(i),a=0;a1&&void 0!==arguments[1]?arguments[1]:l.a_.mainnet,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.a_.mainnet;switch(e){case be.OKX:return new z({});case be.BITGET:return new Te({});case be.READ_ONLY_MODE:return new ke;case be.LEDGER:return new O.us({});case be.INJECTED:return new T._k({});case be.WALLET_LINK:var i=(0,I.Mo)(n);return new C.J({appName:Ae,appLogoUrl:Ee,url:i.privateJsonRPCUrl||i.publicJsonRPCUrl[0]});case be.WALLET_CONNECT:return new R.zw(r);case be.GNOSIS:if(window)return new d.P;throw new Error("Safe app not working");case be.TORUS:return new S.Q({chainId:n,initOptions:{network:{host:n===l.a_.polygon?"matic":n},showTorusButton:!1,enableLogging:!1,enabledVerifiers:!1}});case be.FRAME:if(n!==l.a_.mainnet)throw new p.UnsupportedChainIdError(n,[1]);return new k({supportedChainIds:[1]});case be.BINANCE:var o=we();return new o({rpc:(t={},(0,u.Z)(t,1,"https://cloudflare-eth.com/v1/mainnet"),(0,u.Z)(t,81457,"https://rpc.ankr.com/blast"),(0,u.Z)(t,324,"https://mainnet.era.zksync.io"),(0,u.Z)(t,280,"https://testnet.era.zksync.dev"),(0,u.Z)(t,59144,"https://linea.blockpi.network/v1/rpc/public"),(0,u.Z)(t,169,"https://pacific-rpc.manta.network/http"),(0,u.Z)(t,168587773,"https://sepolia.blast.io"),t),supportedChainIds:[1,81457,324,280,59144,169,168587773]});default:throw new Error("unsupported wallet")}}},79958:function(e){e.exports={messages:{".CSV":".CSV",".JSON":".JSON","<0><1><2/>Add <3/> stkZERO to borrow at <4/> (max discount)":"<0><1><2/>Add <3/> stkZERO to borrow at <4/> (max discount)","<0><1><2/>Add stkZERO to see borrow rate with discount":"<0><1><2/>Add stkZERO to see borrow rate with discount","<0>Ampleforth is a rebasing asset. Visit the <1>documentation to learn more.":"<0>Ampleforth is a rebasing asset. Visit the <1>documentation to learn more.","<0>Attention: Parameter changes via governance can alter your account health factor and risk of liquidation. Follow the <1>ZeroLend governance forum for updates.":"<0>Attention: Parameter changes via governance can alter your account health factor and risk of liquidation. Follow the <1>ZeroLend governance forum for updates.","<0>Slippage tolerance <1>{selectedSlippage}% <2>{0}":["<0>Slippage tolerance <1>",["selectedSlippage"],"% <2>",["0"],""],"ZERO holders (Ethereum network only) can stake their ZERO in the Safety Module to add more security to the protocol and earn Safety Incentives. In the case of a shortfall event, up to 30% of your stake can be slashed to cover the deficit, providing an additional layer of protection for the protocol.":"ZERO holders (Ethereum network only) can stake their ZERO in the Safety Module to add more security to the protocol and earn Safety Incentives. In the case of a shortfall event, up to 30% of your stake can be slashed to cover the deficit, providing an additional layer of protection for the protocol.",APR:"APR",APY:"APY","APY change":"APY change","APY type":"APY type","APY type change":"APY type change","APY with discount applied":"APY with discount applied","APY, fixed rate":"APY, fixed rate","APY, stable":"APY, stable","APY, variable":"APY, variable","AToken supply is not zero":"AToken supply is not zero","ZeroLend Governance":"ZeroLend Governance","ZeroLend aToken":"ZeroLend aToken","ZeroLend debt token":"ZeroLend debt token","ZeroLend is a fully decentralized, community governed protocol by the ZERO token-holders. ZERO token-holders collectively discuss, propose, and vote on upgrades to the protocol. ZERO token-holders (Ethereum network only) can either vote themselves on new proposals or delagate to an address of choice. To learn more check out the Governance":"ZeroLend is a fully decentralized, community governed protocol by the ZERO token-holders. ZERO token-holders collectively discuss, propose, and vote on upgrades to the protocol. ZERO token-holders (Ethereum network only) can either vote themselves on new proposals or delagate to an address of choice. To learn more check out the Governance","ZeroLend per month":"ZeroLend per month","About GHO":"About GHO",Account:"Account","Action cannot be performed because the reserve is frozen":"Action cannot be performed because the reserve is frozen","Action cannot be performed because the reserve is paused":"Action cannot be performed because the reserve is paused","Action requires an active reserve":"Action requires an active reserve","Activate Cooldown":"Activate Cooldown","Add stkZERO to see borrow APY with the discount":"Add stkZERO to see borrow APY with the discount","Add to wallet":"Add to wallet","Add {0} to wallet to track your balance.":["Add ",["0"]," to wallet to track your balance."],"Address is not a contract":"Address is not a contract",Addresses:"Addresses","Addresses ({0})":["Addresses (",["0"],")"],"All Assets":"All Assets","All done!":"All done!","All proposals":"All proposals","All transactions":"All transactions","Allowance required action":"Allowance required action","Allows you to decide whether to use a supplied asset as collateral. An asset used as collateral will affect your borrowing power and health factor.":"Allows you to decide whether to use a supplied asset as collateral. An asset used as collateral will affect your borrowing power and health factor.","Allows you to switch between <0>variable and <1>stable interest rates, where variable rate can increase and decrease depending on the amount of liquidity in the reserve, and stable rate will stay the same for the duration of your loan.":"Allows you to switch between <0>variable and <1>stable interest rates, where variable rate can increase and decrease depending on the amount of liquidity in the reserve, and stable rate will stay the same for the duration of your loan.",Amount:"Amount","Amount claimable":"Amount claimable","Amount in cooldown":"Amount in cooldown","Amount must be greater than 0":"Amount must be greater than 0","Amount to unstake":"Amount to unstake","An error has occurred fetching the proposal metadata from IPFS.":"An error has occurred fetching the proposal metadata from IPFS.","Approve Confirmed":"Approve Confirmed","Approve with":"Approve with","Approve {symbol} to continue":["Approve ",["symbol"]," to continue"],"Approving {symbol}...":["Approving ",["symbol"],"..."],"Array parameters that should be equal length are not":"Array parameters that should be equal length are not",Asset:"Asset","Asset can be only used as collateral in isolation mode with limited borrowing power. To enter isolation mode, disable all other collateral.":"Asset can be only used as collateral in isolation mode with limited borrowing power. To enter isolation mode, disable all other collateral.","Asset can only be used as collateral in isolation mode only.":"Asset can only be used as collateral in isolation mode only.","Asset cannot be migrated because you have isolated collateral in {marketName} v3 Market which limits borrowable assets. You can manage your collateral in <0>{marketName} V3 Dashboard":["Asset cannot be migrated because you have isolated collateral in ",["marketName"]," v3 Market which limits borrowable assets. You can manage your collateral in <0>",["marketName"]," V3 Dashboard"],"Asset cannot be migrated due to insufficient liquidity or borrow cap limitation in {marketName} v3 market.":["Asset cannot be migrated due to insufficient liquidity or borrow cap limitation in ",["marketName"]," v3 market."],"Asset cannot be migrated due to supply cap restriction in {marketName} v3 market.":["Asset cannot be migrated due to supply cap restriction in ",["marketName"]," v3 market."],"Asset cannot be migrated to {marketName} V3 Market due to E-mode restrictions. You can disable or manage E-mode categories in your <0>V3 Dashboard":["Asset cannot be migrated to ",["marketName"]," V3 Market due to E-mode restrictions. You can disable or manage E-mode categories in your <0>V3 Dashboard"],"Asset cannot be migrated to {marketName} v3 Market since collateral asset will enable isolation mode.":["Asset cannot be migrated to ",["marketName"]," v3 Market since collateral asset will enable isolation mode."],"Asset cannot be used as collateral.":"Asset cannot be used as collateral.","Asset category":"Asset category","Asset is frozen in {marketName} v3 market, hence this position cannot be migrated.":["Asset is frozen in ",["marketName"]," v3 market, hence this position cannot be migrated."],"Asset is not borrowable in isolation mode":"Asset is not borrowable in isolation mode","Asset is not listed":"Asset is not listed","Asset supply is limited to a certain amount to reduce protocol exposure to the asset and to help manage risks involved.":"Asset supply is limited to a certain amount to reduce protocol exposure to the asset and to help manage risks involved.",Assets:"Assets","Assets to borrow":"Assets to borrow","Assets to supply":"Assets to supply","Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action":["Assets with zero LTV (",["assetsBlockingWithdraw"],") must be withdrawn or disabled as collateral to perform this action"],"At a discount":"At a discount",Author:"Author",Available:"Available","Available assets":"Available assets","Available liquidity":"Available liquidity","Available on":"Available on","Available rewards":"Available rewards","Available to borrow":"Available to borrow","Available to supply":"Available to supply","Back to Dashboard":"Back to Dashboard",Balance:"Balance","Balance to revoke":"Balance to revoke","Be careful - You are very close to liquidation. Consider depositing more collateral or paying down some of your borrowed positions":"Be careful - You are very close to liquidation. Consider depositing more collateral or paying down some of your borrowed positions","Be mindful of the network congestion and gas prices.":"Be mindful of the network congestion and gas prices.","Because this asset is paused, no actions can be taken until further notice":"Because this asset is paused, no actions can be taken until further notice","Before supplying":"Before supplying","Blocked Address":"Blocked Address",Borrow:"Borrow","Borrow APY rate":"Borrow APY rate","Borrow APY, fixed rate":"Borrow APY, fixed rate","Borrow APY, stable":"Borrow APY, stable","Borrow APY, variable":"Borrow APY, variable","Borrow amount to reach {0}% utilization":["Borrow amount to reach ",["0"],"% utilization"],"Borrow and repay in same block is not allowed":"Borrow and repay in same block is not allowed","Borrow apy":"Borrow apy","Borrow balance":"Borrow balance","Borrow balance after repay":"Borrow balance after repay","Borrow balance after switch":"Borrow balance after switch","Borrow cap":"Borrow cap","Borrow cap is exceeded":"Borrow cap is exceeded","Borrow info":"Borrow info","Borrow power used":"Borrow power used","Borrow rate change":"Borrow rate change","Borrow {symbol}":["Borrow ",["symbol"]],Borrowed:"Borrowed","Borrowed asset amount":"Borrowed asset amount","Borrowing is currently unavailable for {0}.":["Borrowing is currently unavailable for ",["0"],"."],"Borrowing is disabled due to an ZeroLend community decision. <0>More details":"Borrowing is disabled due to an ZeroLend community decision. <0>More details","Borrowing is not enabled":"Borrowing is not enabled","Borrowing is unavailable because you\u2019re using Isolation mode. To manage Isolation mode visit your <0>Dashboard.":"Borrowing is unavailable because you\u2019re using Isolation mode. To manage Isolation mode visit your <0>Dashboard.","Borrowing is unavailable because you\u2019ve enabled Efficiency Mode (E-Mode) and Isolation mode. To manage E-Mode and Isolation mode visit your <0>Dashboard.":"Borrowing is unavailable because you\u2019ve enabled Efficiency Mode (E-Mode) and Isolation mode. To manage E-Mode and Isolation mode visit your <0>Dashboard.","Borrowing is unavailable because you\u2019ve enabled Efficiency Mode (E-Mode) for {0} category. To manage E-Mode categories visit your <0>Dashboard.":["Borrowing is unavailable because you\u2019ve enabled Efficiency Mode (E-Mode) for ",["0"]," category. To manage E-Mode categories visit your <0>Dashboard."],"Borrowing of this asset is limited to a certain amount to minimize liquidity pool insolvency.":"Borrowing of this asset is limited to a certain amount to minimize liquidity pool insolvency.","Borrowing power and assets are limited due to Isolation mode.":"Borrowing power and assets are limited due to Isolation mode.","Borrowing this amount will reduce your health factor and increase risk of liquidation.":"Borrowing this amount will reduce your health factor and increase risk of liquidation.","Borrowing {symbol}":["Borrowing ",["symbol"]],Both:"Both","Buy Crypto With Fiat":"Buy Crypto With Fiat","Buy Crypto with Fiat":"Buy Crypto with Fiat","Buy {cryptoSymbol} with Fiat":["Buy ",["cryptoSymbol"]," with Fiat"],"COPIED!":"COPIED!","COPY IMAGE":"COPY IMAGE","Can be collateral":"Can be collateral","Can be executed":"Can be executed",Cancel:"Cancel","Cannot disable E-Mode":"Cannot disable E-Mode","Choose how much voting/proposition power to give to someone else by delegating some of your ZERO or stkZERO balance. Your tokens will remain in your account, but your delegate will be able to vote or propose on your behalf. If your ZERO or stkZERO balance changes, your delegate's voting/proposition power will be automatically adjusted.":"Choose how much voting/proposition power to give to someone else by delegating some of your ZERO or stkZERO balance. Your tokens will remain in your account, but your delegate will be able to vote or propose on your behalf. If your ZERO or stkZERO balance changes, your delegate's voting/proposition power will be automatically adjusted.","Choose one of the on-ramp services":"Choose one of the on-ramp services",Claim:"Claim","Claim all":"Claim all","Claim all rewards":"Claim all rewards","Claim {0}":["Claim ",["0"]],"Claim {symbol}":["Claim ",["symbol"]],"Claimable ZERO":"Claimable ZERO",Claimed:"Claimed",Claiming:"Claiming","Claiming {symbol}":["Claiming ",["symbol"]],Close:"Close",Collateral:"Collateral","Collateral balance after repay":"Collateral balance after repay","Collateral change":"Collateral change","Collateral is (mostly) the same currency that is being borrowed":"Collateral is (mostly) the same currency that is being borrowed","Collateral to repay with":"Collateral to repay with","Collateral usage":"Collateral usage","Collateral usage is limited because of Isolation mode.":"Collateral usage is limited because of Isolation mode.","Collateral usage is limited because of isolation mode.":"Collateral usage is limited because of isolation mode.","Collateral usage is limited because of isolation mode. <0>Learn More":"Collateral usage is limited because of isolation mode. <0>Learn More",Collateralization:"Collateralization","Collector Contract":"Collector Contract","Collector Info":"Collector Info","Connect wallet":"Connect wallet","Cooldown period":"Cooldown period","Cooldown period warning":"Cooldown period warning","Cooldown time left":"Cooldown time left","Cooldown to unstake":"Cooldown to unstake","Cooling down...":"Cooling down...","Copy address":"Copy address","Copy error message":"Copy error message","Copy error text":"Copy error text","Covered debt":"Covered debt",Created:"Created","Current LTV":"Current LTV","Current differential":"Current differential","Current v2 Balance":"Current v2 Balance","Current v2 balance":"Current v2 balance","Current votes":"Current votes","Dark mode":"Dark mode",Dashboard:"Dashboard","Data couldn't be fetched, please reload graph.":"Data couldn't be fetched, please reload graph.",Debt:"Debt","Debt ceiling is exceeded":"Debt ceiling is exceeded","Debt ceiling is not zero":"Debt ceiling is not zero","Debt ceiling limits the amount possible to borrow against this asset by protocol users. Debt ceiling is specific to assets in isolation mode and is denoted in USD.":"Debt ceiling limits the amount possible to borrow against this asset by protocol users. Debt ceiling is specific to assets in isolation mode and is denoted in USD.","Delegated power":"Delegated power",Details:"Details",Developers:"Developers",Differential:"Differential","Disable E-Mode":"Disable E-Mode","Disable testnet":"Disable testnet","Disable {symbol} as collateral":["Disable ",["symbol"]," as collateral"],Disabled:"Disabled","Disabling E-Mode":"Disabling E-Mode","Disabling this asset as collateral affects your borrowing power and Health Factor.":"Disabling this asset as collateral affects your borrowing power and Health Factor.","Disconnect Wallet":"Disconnect Wallet","Discord channel":"Discord channel",Discount:"Discount","Discount applied for <0/> staking ZERO":"Discount applied for <0/> staking ZERO","Discount model parameters":"Discount model parameters","Discount parameters are decided by the ZeroLend community and may be changed over time. Check Governance for updates and vote to participate. <0>Learn more":"Discount parameters are decided by the ZeroLend community and may be changed over time. Check Governance for updates and vote to participate. <0>Learn more","Discountable amount":"Discountable amount",Docs:"Docs",Download:"Download","Due to internal stETH mechanics required for rebasing support, it is not possible to perform a collateral switch where stETH is the source token.":"Due to internal stETH mechanics required for rebasing support, it is not possible to perform a collateral switch where stETH is the source token.","Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the ZeroLend V3 Harmony market.":"Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the ZeroLend V3 Harmony market.","E-Mode":"E-Mode","E-Mode Category":"E-Mode Category","E-Mode category":"E-Mode category","E-Mode increases your LTV for a selected category of assets up to 97%. <0>Learn more":"E-Mode increases your LTV for a selected category of assets up to 97%. <0>Learn more","E-Mode increases your LTV for a selected category of assets up to<0/>. <1>Learn more":"E-Mode increases your LTV for a selected category of assets up to<0/>. <1>Learn more","E-Mode increases your LTV for a selected category of assets, meaning that when E-mode is enabled, you will have higher borrowing power over assets of the same E-mode category which are defined by ZeroLend Governance. You can enter E-Mode from your <0>Dashboard. To learn more about E-Mode and applied restrictions in <1>FAQ or <2>ZeroLend V3 Technical Paper.":"E-Mode increases your LTV for a selected category of assets, meaning that when E-mode is enabled, you will have higher borrowing power over assets of the same E-mode category which are defined by ZeroLend Governance. You can enter E-Mode from your <0>Dashboard. To learn more about E-Mode and applied restrictions in <1>FAQ or <2>ZeroLend V3 Technical Paper.","Effective interest rate":"Effective interest rate","Efficiency mode (E-Mode)":"Efficiency mode (E-Mode)",Emode:"Emode","Enable E-Mode":"Enable E-Mode","Enable {symbol} as collateral":["Enable ",["symbol"]," as collateral"],Enabled:"Enabled","Enabling E-Mode":"Enabling E-Mode","Enabling E-Mode only allows you to borrow assets belonging to the selected category. Please visit our <0>FAQ guide to learn more about how it works and the applied restrictions.":"Enabling E-Mode only allows you to borrow assets belonging to the selected category. Please visit our <0>FAQ guide to learn more about how it works and the applied restrictions.","Enabling this asset as collateral increases your borrowing power and Health Factor. However, it can get liquidated if your health factor drops below 1.":"Enabling this asset as collateral increases your borrowing power and Health Factor. However, it can get liquidated if your health factor drops below 1.",Ended:"Ended",Ends:"Ends",English:"English","Enter ETH address":"Enter ETH address","Enter an amount":"Enter an amount","Error connecting. Try refreshing the page.":"Error connecting. Try refreshing the page.","Estimated compounding interest, including discount for Staking {0}ZERO in Safety Module.":["Estimated compounding interest, including discount for Staking ",["0"],"ZERO in Safety Module."],"Exceeds the discount":"Exceeds the discount",Executed:"Executed","Expected amount to repay":"Expected amount to repay",Expires:"Expires","Export data to":"Export data to",FAQ:"FAQ",FAQS:"FAQS","Failed to load proposal voters. Please refresh the page.":"Failed to load proposal voters. Please refresh the page.",Faucet:"Faucet","Faucet {0}":["Faucet ",["0"]],"Fetching data...":"Fetching data...",Filter:"Filter","Flashloan is disabled for this asset, hence this position cannot be migrated.":"Flashloan is disabled for this asset, hence this position cannot be migrated.","For repayment of a specific type of debt, the user needs to have debt that type":"For repayment of a specific type of debt, the user needs to have debt that type","Forum discussion":"Forum discussion",French:"French","Frozen or paused assets":"Frozen or paused assets","Funds in the Safety Module":"Funds in the Safety Module","GHO is a native decentralized, collateral-backed digital asset pegged to USD. It is created by users via borrowing against multiple collateral. When user repays their GHO borrow position, the protocol burns that user's GHO. All the interest payments accrued by minters of GHO would be directly transferred to the ZeroLend treasury.":"GHO is a native decentralized, collateral-backed digital asset pegged to USD. It is created by users via borrowing against multiple collateral. When user repays their GHO borrow position, the protocol burns that user's GHO. All the interest payments accrued by minters of GHO would be directly transferred to the ZeroLend treasury.","Get ABP Token":"Get ABP Token","Global settings":"Global settings","Go Back":"Go Back","Go to Balancer Pool":"Go to Balancer Pool","Go to V3 Dashboard":"Go to V3 Dashboard",Governance:"Governance",Greek:"Greek","Health Factor ({0} v2)":["Health Factor (",["0"]," v2)"],"Health Factor ({0} v3)":["Health Factor (",["0"]," v3)"],"Health factor":"Health factor","Health factor is lesser than the liquidation threshold":"Health factor is lesser than the liquidation threshold","Health factor is not below the threshold":"Health factor is not below the threshold",Hide:"Hide","Holders of stkZERO receive a discount on the GHO borrowing rate":"Holders of stkZERO receive a discount on the GHO borrowing rate","I acknowledge the risks involved.":"I acknowledge the risks involved.","I fully understand the risks of migrating.":"I fully understand the risks of migrating.","I understand how cooldown ({0}) and unstaking ({1}) work":["I understand how cooldown (",["0"],") and unstaking (",["1"],") work"],"If the error continues to happen,<0/> you may report it to this":"If the error continues to happen,<0/> you may report it to this","If the health factor goes below 1, the liquidation of your collateral might be triggered.":"If the health factor goes below 1, the liquidation of your collateral might be triggered.","If you DO NOT unstake within {0} of unstake window, you will need to activate cooldown process again.":["If you DO NOT unstake within ",["0"]," of unstake window, you will need to activate cooldown process again."],"If your loan to value goes above the liquidation threshold your collateral supplied may be liquidated.":"If your loan to value goes above the liquidation threshold your collateral supplied may be liquidated.","In E-Mode some assets are not borrowable. Exit E-Mode to get access to all assets":"In E-Mode some assets are not borrowable. Exit E-Mode to get access to all assets","In Isolation mode, you cannot supply other assets as collateral. A global debt ceiling limits the borrowing power of the isolated asset. To exit isolation mode disable {0} as collateral before borrowing another asset. Read more in our <0>FAQ":["In Isolation mode, you cannot supply other assets as collateral. A global debt ceiling limits the borrowing power of the isolated asset. To exit isolation mode disable ",["0"]," as collateral before borrowing another asset. Read more in our <0>FAQ"],"Inconsistent flashloan parameters":"Inconsistent flashloan parameters","Insufficient collateral to cover new borrow position. Wallet must have borrowing power remaining to perform debt switch.":"Insufficient collateral to cover new borrow position. Wallet must have borrowing power remaining to perform debt switch.","Interest accrued":"Interest accrued","Interest rate rebalance conditions were not met":"Interest rate rebalance conditions were not met","Interest rate strategy":"Interest rate strategy","Invalid amount to burn":"Invalid amount to burn","Invalid amount to mint":"Invalid amount to mint","Invalid bridge protocol fee":"Invalid bridge protocol fee","Invalid expiration":"Invalid expiration","Invalid flashloan premium":"Invalid flashloan premium","Invalid return value of the flashloan executor function":"Invalid return value of the flashloan executor function","Invalid signature":"Invalid signature",Isolated:"Isolated","Isolated Debt Ceiling":"Isolated Debt Ceiling","Isolated assets have limited borrowing power and other assets cannot be used as collateral.":"Isolated assets have limited borrowing power and other assets cannot be used as collateral.","Join the community discussion":"Join the community discussion","LEARN MORE":"LEARN MORE",Language:"Language","Learn more":"Learn more","Learn more about risks involved":"Learn more about risks involved","Learn more in our <0>FAQ guide":"Learn more in our <0>FAQ guide","Learn more.":"Learn more.",Links:"Links",Liqudation:"Liqudation","Liquidated collateral":"Liquidated collateral",Liquidation:"Liquidation","Liquidation <0/> threshold":"Liquidation <0/> threshold","Liquidation Threshold":"Liquidation Threshold","Liquidation at":"Liquidation at","Liquidation penalty":"Liquidation penalty","Liquidation risk":"Liquidation risk","Liquidation risk parameters":"Liquidation risk parameters","Liquidation threshold":"Liquidation threshold","Liquidation value":"Liquidation value","Loading data...":"Loading data...","Ltv validation failed":"Ltv validation failed","MAI has been paused due to a community decision. Supply, borrows and repays are impacted. <0>More details":"MAI has been paused due to a community decision. Supply, borrows and repays are impacted. <0>More details",MAX:"MAX","Manage analytics":"Manage analytics",Market:"Market",Markets:"Markets",Max:"Max","Max LTV":"Max LTV","Max slashing":"Max slashing","Maximum amount available to borrow against this asset is limited because debt ceiling is at {0}%.":["Maximum amount available to borrow against this asset is limited because debt ceiling is at ",["0"],"%."],"Maximum amount available to borrow is <0/> {0} (<1/>).":["Maximum amount available to borrow is <0/> ",["0"]," (<1/>)."],"Maximum amount available to borrow is limited because protocol borrow cap is nearly reached.":"Maximum amount available to borrow is limited because protocol borrow cap is nearly reached.","Maximum amount available to supply is <0/> {0} (<1/>).":["Maximum amount available to supply is <0/> ",["0"]," (<1/>)."],"Maximum amount available to supply is limited because protocol supply cap is at {0}%.":["Maximum amount available to supply is limited because protocol supply cap is at ",["0"],"%."],"Maximum loan to value":"Maximum loan to value","Meet GHO":"Meet GHO",Menu:"Menu",Migrate:"Migrate","Migrate to V3":"Migrate to V3","Migrate to v3":"Migrate to v3","Migrate to {0} v3 Market":["Migrate to ",["0"]," v3 Market"],Migrated:"Migrated",Migrating:"Migrating","Migrating multiple collaterals and borrowed assets at the same time can be an expensive operation and might fail in certain situations.<0>Therefore it\u2019s not recommended to migrate positions with more than 5 assets (deposited + borrowed) at the same time.":"Migrating multiple collaterals and borrowed assets at the same time can be an expensive operation and might fail in certain situations.<0>Therefore it\u2019s not recommended to migrate positions with more than 5 assets (deposited + borrowed) at the same time.","Migration risks":"Migration risks","Minimum GHO borrow amount":"Minimum GHO borrow amount","Minimum staked ZeroLend amount":"Minimum staked ZeroLend amount",More:"More",NAY:"NAY","Need help connecting a wallet? <0>Read our FAQ":"Need help connecting a wallet? <0>Read our FAQ","Net APR":"Net APR","Net APY":"Net APY","Net APY is the combined effect of all supply and borrow positions on net worth, including incentives. It is possible to have a negative net APY if debt APY is higher than supply APY.":"Net APY is the combined effect of all supply and borrow positions on net worth, including incentives. It is possible to have a negative net APY if debt APY is higher than supply APY.","Net worth":"Net worth",Network:"Network","Network not supported for this wallet":"Network not supported for this wallet","New APY":"New APY","No assets selected to migrate.":"No assets selected to migrate.","No rewards to claim":"No rewards to claim","No search results{0}":["No search results",["0"]],"No transactions yet.":"No transactions yet.","No voting power":"No voting power",None:"None","Not a valid address":"Not a valid address","Not enough balance on your wallet":"Not enough balance on your wallet","Not enough collateral to repay this amount of debt with":"Not enough collateral to repay this amount of debt with","Not enough staked balance":"Not enough staked balance","Not enough voting power to participate in this proposal":"Not enough voting power to participate in this proposal","Not reached":"Not reached","Nothing borrowed yet":"Nothing borrowed yet","Nothing found":"Nothing found","Nothing staked":"Nothing staked","Nothing supplied yet":"Nothing supplied yet",Notify:"Notify","Ok, Close":"Ok, Close","Ok, I got it":"Ok, I got it","Operation not supported":"Operation not supported","Oracle price":"Oracle price",Overview:"Overview","Page not found":"Page not found","Participating in this {symbol} reserve gives annualized rewards.":["Participating in this ",["symbol"]," reserve gives annualized rewards."],"Pending...":"Pending...","Per the community, the Fantom market has been frozen.":"Per the community, the Fantom market has been frozen.","Per the community, the V2 AMM market has been deprecated.":"Per the community, the V2 AMM market has been deprecated.","Please always be aware of your <0>Health Factor (HF) when partially migrating a position and that your rates will be updated to V3 rates.":"Please always be aware of your <0>Health Factor (HF) when partially migrating a position and that your rates will be updated to V3 rates.","Please connect a wallet to view your personal information here.":"Please connect a wallet to view your personal information here.","Please connect your wallet to get free testnet assets.":"Please connect your wallet to get free testnet assets.","Please connect your wallet to see migration tool.":"Please connect your wallet to see migration tool.","Please connect your wallet to see your supplies, borrowings, and open positions.":"Please connect your wallet to see your supplies, borrowings, and open positions.","Please connect your wallet to view transaction history.":"Please connect your wallet to view transaction history.","Please enter a valid wallet address.":"Please enter a valid wallet address.","Please switch to {networkName}.":["Please switch to ",["networkName"],"."],"Please, connect your wallet":"Please, connect your wallet","Pool addresses provider is not registered":"Pool addresses provider is not registered","Powered by":"Powered by","Preview tx and migrate":"Preview tx and migrate",Price:"Price","Price data is not currently available for this reserve on the protocol subgraph":"Price data is not currently available for this reserve on the protocol subgraph","Price impact is the spread between the total value of the entry tokens switched and the destination tokens obtained (in USD), which results from the limited liquidity of the trading pair.":"Price impact is the spread between the total value of the entry tokens switched and the destination tokens obtained (in USD), which results from the limited liquidity of the trading pair.","Price impact {0}%":["Price impact ",["0"],"%"],Privacy:"Privacy","Proposal details":"Proposal details","Proposal overview":"Proposal overview",Proposals:"Proposals",Proposition:"Proposition","Protocol borrow cap at 100% for this asset. Further borrowing unavailable.":"Protocol borrow cap at 100% for this asset. Further borrowing unavailable.","Protocol borrow cap is at 100% for this asset. Further borrowing unavailable.":"Protocol borrow cap is at 100% for this asset. Further borrowing unavailable.","Protocol debt ceiling is at 100% for this asset. Further borrowing against this asset is unavailable.":"Protocol debt ceiling is at 100% for this asset. Further borrowing against this asset is unavailable.","Protocol debt ceiling is at 100% for this asset. Futher borrowing against this asset is unavailable.":"Protocol debt ceiling is at 100% for this asset. Futher borrowing against this asset is unavailable.","Protocol supply cap at 100% for this asset. Further supply unavailable.":"Protocol supply cap at 100% for this asset. Further supply unavailable.","Protocol supply cap is at 100% for this asset. Further supply unavailable.":"Protocol supply cap is at 100% for this asset. Further supply unavailable.",Quorum:"Quorum","Rate change":"Rate change","Raw-Ipfs":"Raw-Ipfs",Reached:"Reached","Reactivate cooldown period to unstake {0} {stakedToken}":["Reactivate cooldown period to unstake ",["0"]," ",["stakedToken"]],"Read more here.":"Read more here.","Read-only mode allows to see address positions in ZeroLend, but you won't be able to perform transactions.":"Read-only mode allows to see address positions in ZeroLend, but you won't be able to perform transactions.","Read-only mode.":"Read-only mode.","Read-only mode. Connect to a wallet to perform transactions.":"Read-only mode. Connect to a wallet to perform transactions.",Received:"Received","Recipient address":"Recipient address","Rejected connection request":"Rejected connection request",Reload:"Reload","Reload the page":"Reload the page","Remaining debt":"Remaining debt","Remaining supply":"Remaining supply",Repaid:"Repaid",Repay:"Repay","Repay with":"Repay with","Repay {symbol}":["Repay ",["symbol"]],"Repaying {symbol}":["Repaying ",["symbol"]],"Repayment amount to reach {0}% utilization":["Repayment amount to reach ",["0"],"% utilization"],"Reserve Size":"Reserve Size","Reserve factor":"Reserve factor","Reserve factor is a percentage of interest which goes to a {0} that is controlled by ZeroLend governance to promote ecosystem growth.":["Reserve factor is a percentage of interest which goes to a ",["0"]," that is controlled by ZeroLend governance to promote ecosystem growth."],"Reserve status & configuration":"Reserve status & configuration",Reset:"Reset",Restake:"Restake","Restake {symbol}":["Restake ",["symbol"]],Restaked:"Restaked","Restaking {symbol}":["Restaking ",["symbol"]],"Review approval tx details":"Review approval tx details","Review changes to continue":"Review changes to continue","Review tx":"Review tx","Review tx details":"Review tx details","Revoke power":"Revoke power","Reward(s) to claim":"Reward(s) to claim","Rewards APR":"Rewards APR","Risk details":"Risk details","SEE CHARTS":"SEE CHARTS","Safety of your deposited collateral against the borrowed assets and its underlying value.":"Safety of your deposited collateral against the borrowed assets and its underlying value.","Save and share":"Save and share","Seatbelt report":"Seatbelt report","Seems like we can't switch the network automatically. Please check if you can change it from the wallet.":"Seems like we can't switch the network automatically. Please check if you can change it from the wallet.",Select:"Select","Select APY type to switch":"Select APY type to switch","Select an asset":"Select an asset","Select language":"Select language","Select slippage tolerance":"Select slippage tolerance","Select v2 borrows to migrate":"Select v2 borrows to migrate","Select v2 supplies to migrate":"Select v2 supplies to migrate","Selected assets have successfully migrated. Visit the Market Dashboard to see them.":"Selected assets have successfully migrated. Visit the Market Dashboard to see them.","Selected borrow assets":"Selected borrow assets","Selected supply assets":"Selected supply assets","Send feedback":"Send feedback","Set up delegation":"Set up delegation","Setup notifications about your Health Factor using the Hal app.":"Setup notifications about your Health Factor using the Hal app.","Share on Lens":"Share on Lens","Share on twitter":"Share on twitter",Show:"Show","Show assets with 0 balance":"Show assets with 0 balance","Sign to continue":"Sign to continue","Signatures ready":"Signatures ready",Signing:"Signing","Since this asset is frozen, the only available actions are withdraw and repay which can be accessed from the <0>Dashboard":"Since this asset is frozen, the only available actions are withdraw and repay which can be accessed from the <0>Dashboard","Since this is a test network, you can get any of the assets if you have ETH on your wallet":"Since this is a test network, you can get any of the assets if you have ETH on your wallet","Slippage is the difference between the quoted and received amounts from changing market conditions between the moment the transaction is submitted and its verification.":"Slippage is the difference between the quoted and received amounts from changing market conditions between the moment the transaction is submitted and its verification.","Some migrated assets will not be used as collateral due to enabled isolation mode in {marketName} V3 Market. Visit <0>{marketName} V3 Dashboard to manage isolation mode.":["Some migrated assets will not be used as collateral due to enabled isolation mode in ",["marketName"]," V3 Market. Visit <0>",["marketName"]," V3 Dashboard to manage isolation mode."],"Something went wrong":"Something went wrong","Sorry, an unexpected error happened. In the meantime you may try reloading the page, or come back later.":"Sorry, an unexpected error happened. In the meantime you may try reloading the page, or come back later.","Sorry, we couldn't find the page you were looking for.":"Sorry, we couldn't find the page you were looking for.",Spanish:"Spanish",Stable:"Stable","Stable Interest Type is disabled for this currency":"Stable Interest Type is disabled for this currency","Stable borrowing is enabled":"Stable borrowing is enabled","Stable borrowing is not enabled":"Stable borrowing is not enabled","Stable debt supply is not zero":"Stable debt supply is not zero","Stable interest rate will <0>stay the same for the duration of your loan. Recommended for long-term loan periods and for users who prefer predictability.":"Stable interest rate will <0>stay the same for the duration of your loan. Recommended for long-term loan periods and for users who prefer predictability.",Stablecoin:"Stablecoin",Stake:"Stake","Stake ZERO":"Stake ZERO","Stake ABPT":"Stake ABPT","Stake cooldown activated":"Stake cooldown activated",Staked:"Staked",Staking:"Staking","Staking APR":"Staking APR","Staking Rewards":"Staking Rewards","Staking balance":"Staking balance","Staking discount":"Staking discount",Started:"Started",State:"State","Static interest rate that is determined by ZeroLend Governance. This rate may be changed over time depending on the need for the GHO supply to contract/expand. <0>Learn more":"Static interest rate that is determined by ZeroLend Governance. This rate may be changed over time depending on the need for the GHO supply to contract/expand. <0>Learn more",Supplied:"Supplied","Supplied asset amount":"Supplied asset amount",Supply:"Supply","Supply APY":"Supply APY","Supply apy":"Supply apy","Supply balance":"Supply balance","Supply balance after switch":"Supply balance after switch","Supply cap is exceeded":"Supply cap is exceeded","Supply cap on target reserve reached. Try lowering the amount.":"Supply cap on target reserve reached. Try lowering the amount.","Supply {symbol}":["Supply ",["symbol"]],"Supplying your":"Supplying your","Supplying {symbol}":["Supplying ",["symbol"]],Switch:"Switch","Switch APY type":"Switch APY type","Switch E-Mode":"Switch E-Mode","Switch E-Mode category":"Switch E-Mode category","Switch Network":"Switch Network","Switch borrow position":"Switch borrow position","Switch rate":"Switch rate","Switch to":"Switch to",Switched:"Switched",Switching:"Switching","Switching E-Mode":"Switching E-Mode","Switching rate":"Switching rate",Techpaper:"Techpaper",Terms:"Terms","Test Assets":"Test Assets","Testnet mode":"Testnet mode","Testnet mode is ON":"Testnet mode is ON","Thank you for voting!!":"Thank you for voting!!","The % of your total borrowing power used. This is based on the amount of your collateral supplied and the total amount that you can borrow.":"The % of your total borrowing power used. This is based on the amount of your collateral supplied and the total amount that you can borrow.","The ZeroLend Balancer Pool Token (ABPT) is a liquidity pool token. You can receive ABPT by depositing a combination of ZERO + ETH in the Balancer liquidity pool. You can then stake your BPT in the Safety Module to secure the protocol and earn Safety Incentives.":"The ZeroLend Balancer Pool Token (ABPT) is a liquidity pool token. You can receive ABPT by depositing a combination of ZERO + ETH in the Balancer liquidity pool. You can then stake your BPT in the Safety Module to secure the protocol and earn Safety Incentives.","The ZeroLend Protocol is programmed to always use the price of 1 GHO = $1. This is different from using market pricing via oracles for other crypto assets. This creates stabilizing arbitrage opportunities when the price of GHO fluctuates.":"The ZeroLend Protocol is programmed to always use the price of 1 GHO = $1. This is different from using market pricing via oracles for other crypto assets. This creates stabilizing arbitrage opportunities when the price of GHO fluctuates.","The Maximum LTV ratio represents the maximum borrowing power of a specific collateral. For example, if a collateral has an LTV of 75%, the user can borrow up to 0.75 worth of ETH in the principal currency for every 1 ETH worth of collateral.":"The Maximum LTV ratio represents the maximum borrowing power of a specific collateral. For example, if a collateral has an LTV of 75%, the user can borrow up to 0.75 worth of ETH in the principal currency for every 1 ETH worth of collateral.","The Stable Rate is not enabled for this currency":"The Stable Rate is not enabled for this currency","The address of the pool addresses provider is invalid":"The address of the pool addresses provider is invalid","The app is running in testnet mode. Learn how it works in":"The app is running in testnet mode. Learn how it works in","The caller of the function is not an AToken":"The caller of the function is not an AToken","The caller of this function must be a pool":"The caller of this function must be a pool","The collateral balance is 0":"The collateral balance is 0","The collateral chosen cannot be liquidated":"The collateral chosen cannot be liquidated","The cooldown period is the time required prior to unstaking your tokens (20 days). You can only withdraw your assets from the Security Module after the cooldown period and within the unstake window.<0>Learn more":"The cooldown period is the time required prior to unstaking your tokens (20 days). You can only withdraw your assets from the Security Module after the cooldown period and within the unstake window.<0>Learn more","The cooldown period is {0}. After {1} of cooldown, you will enter unstake window of {2}. You will continue receiving rewards during cooldown and unstake window.":["The cooldown period is ",["0"],". After ",["1"]," of cooldown, you will enter unstake window of ",["2"],". You will continue receiving rewards during cooldown and unstake window."],"The effects on the health factor would cause liquidation. Try lowering the amount.":"The effects on the health factor would cause liquidation. Try lowering the amount.","The loan to value of the migrated positions would cause liquidation. Increase migrated collateral or reduce migrated borrow to continue.":"The loan to value of the migrated positions would cause liquidation. Increase migrated collateral or reduce migrated borrow to continue.","The requested amount is greater than the max loan size in stable rate mode":"The requested amount is greater than the max loan size in stable rate mode","The total amount of your assets denominated in USD that can be used as collateral for borrowing assets.":"The total amount of your assets denominated in USD that can be used as collateral for borrowing assets.","The underlying asset cannot be rescued":"The underlying asset cannot be rescued","The underlying balance needs to be greater than 0":"The underlying balance needs to be greater than 0","The weighted average of APY for all borrowed assets, including incentives.":"The weighted average of APY for all borrowed assets, including incentives.","The weighted average of APY for all supplied assets, including incentives.":"The weighted average of APY for all supplied assets, including incentives.","There are not enough funds in the{0}reserve to borrow":["There are not enough funds in the",["0"],"reserve to borrow"],"There is not enough collateral to cover a new borrow":"There is not enough collateral to cover a new borrow","There is not enough liquidity for the target asset to perform the switch. Try lowering the amount.":"There is not enough liquidity for the target asset to perform the switch. Try lowering the amount.","There was some error. Please try changing the parameters or <0><1>copy the error":"There was some error. Please try changing the parameters or <0><1>copy the error","These assets are temporarily frozen or paused by ZeroLend community decisions, meaning that further supply / borrow, or rate swap of these assets are unavailable. Withdrawals and debt repayments are allowed. Follow the <0>ZeroLend governance forum for further updates.":"These assets are temporarily frozen or paused by ZeroLend community decisions, meaning that further supply / borrow, or rate swap of these assets are unavailable. Withdrawals and debt repayments are allowed. Follow the <0>ZeroLend governance forum for further updates.","These funds have been borrowed and are not available for withdrawal at this time.":"These funds have been borrowed and are not available for withdrawal at this time.","This action will reduce V2 health factor below liquidation threshold. retain collateral or migrate borrow position to continue.":"This action will reduce V2 health factor below liquidation threshold. retain collateral or migrate borrow position to continue.","This action will reduce health factor of V3 below liquidation threshold. Increase migrated collateral or reduce migrated borrow to continue.":"This action will reduce health factor of V3 below liquidation threshold. Increase migrated collateral or reduce migrated borrow to continue.","This action will reduce your health factor. Please be mindful of the increased risk of collateral liquidation.":"This action will reduce your health factor. Please be mindful of the increased risk of collateral liquidation.","This address is blocked on app.zerolend.xyz because it is associated with one or more":"This address is blocked on app.zerolend.xyz because it is associated with one or more","This asset has almost reached its borrow cap. There is only {messageValue} available to be borrowed from this market.":["This asset has almost reached its borrow cap. There is only ",["messageValue"]," available to be borrowed from this market."],"This asset has almost reached its supply cap. There can only be {messageValue} supplied to this market.":["This asset has almost reached its supply cap. There can only be ",["messageValue"]," supplied to this market."],"This asset has reached its borrow cap. Nothing is available to be borrowed from this market.":"This asset has reached its borrow cap. Nothing is available to be borrowed from this market.","This asset has reached its supply cap. Nothing is available to be supplied from this market.":"This asset has reached its supply cap. Nothing is available to be supplied from this market.","This asset is frozen due to an ZeroLend Protocol Governance decision. <0>More details":"This asset is frozen due to an ZeroLend Protocol Governance decision. <0>More details","This asset is frozen due to an ZeroLend Protocol Governance decision. On the 20th of December 2022, renFIL will no longer be supported and cannot be bridged back to its native network. It is recommended to withdraw supply positions and repay borrow positions so that renFIL can be bridged back to FIL before the deadline. After this date, it will no longer be possible to convert renFIL to FIL. <0>More details":"This asset is frozen due to an ZeroLend Protocol Governance decision. On the 20th of December 2022, renFIL will no longer be supported and cannot be bridged back to its native network. It is recommended to withdraw supply positions and repay borrow positions so that renFIL can be bridged back to FIL before the deadline. After this date, it will no longer be possible to convert renFIL to FIL. <0>More details","This asset is frozen due to an ZeroLend community decision. <0>More details":"This asset is frozen due to an ZeroLend community decision. <0>More details","This asset is planned to be offboarded due to an ZeroLend Protocol Governance decision. <0>More details":"This asset is planned to be offboarded due to an ZeroLend Protocol Governance decision. <0>More details","This gas calculation is only an estimation. Your wallet will set the price of the transaction. You can modify the gas settings directly from your wallet provider.":"This gas calculation is only an estimation. Your wallet will set the price of the transaction. You can modify the gas settings directly from your wallet provider.","This integration was<0>proposed and approvedby the community.":"This integration was<0>proposed and approvedby the community.","This is the total amount available for you to borrow. You can borrow based on your collateral and until the borrow cap is reached.":"This is the total amount available for you to borrow. You can borrow based on your collateral and until the borrow cap is reached.","This is the total amount that you are able to supply to in this reserve. You are able to supply your wallet balance up until the supply cap is reached.":"This is the total amount that you are able to supply to in this reserve. You are able to supply your wallet balance up until the supply cap is reached.","This represents the threshold at which a borrow position will be considered undercollateralized and subject to liquidation for each collateral. For example, if a collateral has a liquidation threshold of 80%, it means that the position will be liquidated when the debt value is worth 80% of the collateral value.":"This represents the threshold at which a borrow position will be considered undercollateralized and subject to liquidation for each collateral. For example, if a collateral has a liquidation threshold of 80%, it means that the position will be liquidated when the debt value is worth 80% of the collateral value.","Time left to be able to withdraw your staked asset.":"Time left to be able to withdraw your staked asset.","Time left to unstake":"Time left to unstake","Time left until the withdrawal window closes.":"Time left until the withdrawal window closes.","Tip: Try increasing slippage or reduce input amount":"Tip: Try increasing slippage or reduce input amount","To borrow you need to supply any asset to be used as collateral.":"To borrow you need to supply any asset to be used as collateral.","To continue, you need to grant ZeroLend smart contracts permission to move your funds from your wallet. Depending on the asset and wallet you use, it is done by signing the permission message (gas free), or by submitting an approval transaction (requires gas). <0>Learn more":"To continue, you need to grant ZeroLend smart contracts permission to move your funds from your wallet. Depending on the asset and wallet you use, it is done by signing the permission message (gas free), or by submitting an approval transaction (requires gas). <0>Learn more","To enable E-mode for the {0} category, all borrow positions outside of this category must be closed.":["To enable E-mode for the ",["0"]," category, all borrow positions outside of this category must be closed."],"To repay on behalf of a user an explicit amount to repay is needed":"To repay on behalf of a user an explicit amount to repay is needed","To request access for this permissioned market, please visit: <0>Acces Provider Name":"To request access for this permissioned market, please visit: <0>Acces Provider Name","To submit a proposal for minor changes to the protocol, you'll need at least 80.00K power. If you want to change the core code base, you'll need 320k power.<0>Learn more.":"To submit a proposal for minor changes to the protocol, you'll need at least 80.00K power. If you want to change the core code base, you'll need 320k power.<0>Learn more.","Top 10 addresses":"Top 10 addresses","Total available":"Total available","Total borrowed":"Total borrowed","Total borrows":"Total borrows","Total emission per day":"Total emission per day","Total interest accrued":"Total interest accrued","Total market size":"Total market size","Total supplied":"Total supplied","Total voting power":"Total voting power","Total worth":"Total worth","Track wallet":"Track wallet","Track wallet balance in read-only mode":"Track wallet balance in read-only mode","Transaction failed":"Transaction failed","Transaction history":"Transaction history","Transaction history is not currently available for this market":"Transaction history is not currently available for this market","Transaction overview":"Transaction overview",Transactions:"Transactions","UNSTAKE {symbol}":["UNSTAKE ",["symbol"]],Unavailable:"Unavailable",Unbacked:"Unbacked","Unbacked mint cap is exceeded":"Unbacked mint cap is exceeded","Underlying asset does not exist in {marketName} v3 Market, hence this position cannot be migrated.":["Underlying asset does not exist in ",["marketName"]," v3 Market, hence this position cannot be migrated."],"Underlying token":"Underlying token","Unstake now":"Unstake now","Unstake window":"Unstake window",Unstaked:"Unstaked","Unstaking {symbol}":["Unstaking ",["symbol"]],"Update: Disruptions reported for WETH, WBTC, WMATIC, and USDT. AIP 230 will resolve the disruptions and the market will be operating as normal on ~26th May 13h00 UTC.":"Update: Disruptions reported for WETH, WBTC, WMATIC, and USDT. AIP 230 will resolve the disruptions and the market will be operating as normal on ~26th May 13h00 UTC.","Use it to vote for or against active proposals.":"Use it to vote for or against active proposals.","Use your ZERO and stkZERO balance to delegate your voting and proposition powers. You will not be sending any tokens, only the rights to vote and propose changes to the protocol. You can re-delegate or revoke power to self at any time.":"Use your ZERO and stkZERO balance to delegate your voting and proposition powers. You will not be sending any tokens, only the rights to vote and propose changes to the protocol. You can re-delegate or revoke power to self at any time.","Used as collateral":"Used as collateral","User cannot withdraw more than the available balance":"User cannot withdraw more than the available balance","User did not borrow the specified currency":"User did not borrow the specified currency","User does not have outstanding stable rate debt on this reserve":"User does not have outstanding stable rate debt on this reserve","User does not have outstanding variable rate debt on this reserve":"User does not have outstanding variable rate debt on this reserve","User is in isolation mode":"User is in isolation mode","User is trying to borrow multiple assets including a siloed one":"User is trying to borrow multiple assets including a siloed one","Users who stake ZERO in Safety Module (i.e. stkZERO holders) receive a discount on GHO borrow interest rate. The discount applies to 100 GHO for every 1 stkZERO held. Use the calculator below to see GHO borrow rate with the discount applied.":"Users who stake ZERO in Safety Module (i.e. stkZERO holders) receive a discount on GHO borrow interest rate. The discount applies to 100 GHO for every 1 stkZERO held. Use the calculator below to see GHO borrow rate with the discount applied.","Utilization Rate":"Utilization Rate","VIEW TX":"VIEW TX","VOTE NAY":"VOTE NAY","VOTE YAE":"VOTE YAE",Variable:"Variable","Variable debt supply is not zero":"Variable debt supply is not zero","Variable interest rate will <0>fluctuate based on the market conditions. Recommended for short-term positions.":"Variable interest rate will <0>fluctuate based on the market conditions. Recommended for short-term positions.","Version 2":"Version 2","Version 3":"Version 3",View:"View","View all votes":"View all votes","View contract":"View contract","View details":"View details","View on Explorer":"View on Explorer","Vote NAY":"Vote NAY","Vote YAE":"Vote YAE","Voted NAY":"Voted NAY","Voted YAE":"Voted YAE",Votes:"Votes",Voting:"Voting","Voting power":"Voting power","Voting results":"Voting results","Wallet Balance":"Wallet Balance","Wallet balance":"Wallet balance","Wallet not detected. Connect or install wallet and retry":"Wallet not detected. Connect or install wallet and retry","Wallets are provided by External Providers and by selecting you agree to Terms of those Providers. Your access to the wallet might be reliant on the External Provider being operational.":"Wallets are provided by External Providers and by selecting you agree to Terms of those Providers. Your access to the wallet might be reliant on the External Provider being operational.","We couldn't find any assets related to your search. Try again with a different asset name, symbol, or address.":"We couldn't find any assets related to your search. Try again with a different asset name, symbol, or address.","We couldn't find any transactions related to your search. Try again with a different asset name, or reset filters.":"We couldn't find any transactions related to your search. Try again with a different asset name, or reset filters.","We couldn\u2019t detect a wallet. Connect a wallet to stake and view your balance.":"We couldn\u2019t detect a wallet. Connect a wallet to stake and view your balance.","We suggest you go back to the Dashboard.":"We suggest you go back to the Dashboard.",Website:"Website","When a liquidation occurs, liquidators repay up to 50% of the outstanding borrowed amount on behalf of the borrower. In return, they can buy the collateral at a discount and keep the difference (liquidation penalty) as a bonus.":"When a liquidation occurs, liquidators repay up to 50% of the outstanding borrowed amount on behalf of the borrower. In return, they can buy the collateral at a discount and keep the difference (liquidation penalty) as a bonus.","With a voting power of <0/>":"With a voting power of <0/>","With testnet Faucet you can get free assets to test the ZeroLend Protocol. Make sure to switch your wallet provider to the appropriate testnet network, select desired asset, and click \u2018Faucet\u2019 to get tokens transferred to your wallet. The assets on a testnet are not \u201creal,\u201d meaning they have no monetary value. <0>Learn more":"With testnet Faucet you can get free assets to test the ZeroLend Protocol. Make sure to switch your wallet provider to the appropriate testnet network, select desired asset, and click \u2018Faucet\u2019 to get tokens transferred to your wallet. The assets on a testnet are not \u201creal,\u201d meaning they have no monetary value. <0>Learn more",Withdraw:"Withdraw","Withdraw {symbol}":["Withdraw ",["symbol"]],"Withdrawing this amount will reduce your health factor and increase risk of liquidation.":"Withdrawing this amount will reduce your health factor and increase risk of liquidation.","Withdrawing {symbol}":["Withdrawing ",["symbol"]],"Wrong Network":"Wrong Network",YAE:"YAE","You are entering Isolation mode":"You are entering Isolation mode","You can borrow this asset with a stable rate only if you borrow more than the amount you are supplying as collateral.":"You can borrow this asset with a stable rate only if you borrow more than the amount you are supplying as collateral.","You can not change Interest Type to stable as your borrowings are higher than your collateral":"You can not change Interest Type to stable as your borrowings are higher than your collateral","You can not disable E-Mode as your current collateralization level is above 80%, disabling E-Mode can cause liquidation. To exit E-Mode supply or repay borrowed positions.":"You can not disable E-Mode as your current collateralization level is above 80%, disabling E-Mode can cause liquidation. To exit E-Mode supply or repay borrowed positions.","You can not switch usage as collateral mode for this currency, because it will cause collateral call":"You can not switch usage as collateral mode for this currency, because it will cause collateral call","You can not use this currency as collateral":"You can not use this currency as collateral","You can not withdraw this amount because it will cause collateral call":"You can not withdraw this amount because it will cause collateral call","You can only switch to tokens with variable APY types. After this transaction, you may change the variable rate to a stable one if available.":"You can only switch to tokens with variable APY types. After this transaction, you may change the variable rate to a stable one if available.","You can only withdraw your assets from the Security Module after the cooldown period ends and the unstake window is active.":"You can only withdraw your assets from the Security Module after the cooldown period ends and the unstake window is active.","You can report incident to our <0>Discord or <1>Github.":"You can report incident to our <0>Discord or <1>Github.","You cancelled the transaction.":"You cancelled the transaction.","You did not participate in this proposal":"You did not participate in this proposal","You do not have supplies in this currency":"You do not have supplies in this currency","You don\u2019t have enough funds in your wallet to repay the full amount. If you proceed to repay with your current amount of funds, you will still have a small borrowing position in your dashboard.":"You don\u2019t have enough funds in your wallet to repay the full amount. If you proceed to repay with your current amount of funds, you will still have a small borrowing position in your dashboard.","You have no ZERO/stkZERO balance to delegate.":"You have no ZERO/stkZERO balance to delegate.","You have not borrow yet using this currency":"You have not borrow yet using this currency","You may borrow up to <0/> GHO at <1/> (max discount)":"You may borrow up to <0/> GHO at <1/> (max discount)","You may enter a custom amount in the field.":"You may enter a custom amount in the field.","You switched to {0} rate":["You switched to ",["0"]," rate"],"You unstake here":"You unstake here","You voted {0}":["You voted ",["0"]],"You will exit isolation mode and other tokens can now be used as collateral":"You will exit isolation mode and other tokens can now be used as collateral","You {action} <0/> {symbol}":["You ",["action"]," <0/> ",["symbol"]],"You've successfully switched borrow position.":"You've successfully switched borrow position.","Your borrows":"Your borrows","Your current loan to value based on your collateral supplied.":"Your current loan to value based on your collateral supplied.","Your health factor and loan to value determine the assurance of your collateral. To avoid liquidations you can supply more collateral or repay borrow positions.":"Your health factor and loan to value determine the assurance of your collateral. To avoid liquidations you can supply more collateral or repay borrow positions.","Your info":"Your info","Your proposition power is based on your ZERO/stkZERO balance and received delegations.":"Your proposition power is based on your ZERO/stkZERO balance and received delegations.","Your reward balance is 0":"Your reward balance is 0","Your supplies":"Your supplies","Your voting info":"Your voting info","Your voting power is based on your ZERO/stkZERO balance and received delegations.":"Your voting power is based on your ZERO/stkZERO balance and received delegations.","Your {name} wallet is empty. Purchase or transfer assets or use <0>{0} to transfer your {network} assets.":["Your ",["name"]," wallet is empty. Purchase or transfer assets or use <0>",["0"]," to transfer your ",["network"]," assets."],"Your {name} wallet is empty. Purchase or transfer assets.":["Your ",["name"]," wallet is empty. Purchase or transfer assets."],"Your {networkName} wallet is empty. Get free test assets at":["Your ",["networkName"]," wallet is empty. Get free test assets at"],"Your {networkName} wallet is empty. Get free test {0} at":["Your ",["networkName"]," wallet is empty. Get free test ",["0"]," at"],"Zero address not valid":"Zero address not valid",assets:"assets","blocked activities":"blocked activities","copy the error":"copy the error",disabled:"disabled",documentation:"documentation",enabled:"enabled",ends:"ends",for:"for",of:"of",on:"on","please check that the amount you want to supply is not currently being used for staking. If it is being used for staking, your transaction might fail.":"please check that the amount you want to supply is not currently being used for staking. If it is being used for staking, your transaction might fail.",repaid:"repaid","stETH supplied as collateral will continue to accrue staking rewards provided by daily rebases.":"stETH supplied as collateral will continue to accrue staking rewards provided by daily rebases.","stETH tokens will be migrated to Wrapped stETH using Lido Protocol wrapper which leads to supply balance change after migration: {0}":["stETH tokens will be migrated to Wrapped stETH using Lido Protocol wrapper which leads to supply balance change after migration: ",["0"]],"staking view":"staking view",starts:"starts","stkZERO holders get a discount on GHO borrow rate":"stkZERO holders get a discount on GHO borrow rate",to:"to","tokens is not the same as staking them. If you wish to stake your":"tokens is not the same as staking them. If you wish to stake your","tokens, please go to the":"tokens, please go to the","will receive":"will receive",withdrew:"withdrew","{0}":[["0"]],"{0} Balance":[["0"]," Balance"],"{0} Faucet":[["0"]," Faucet"],"{0} on-ramp service is provided by External Provider and by selecting you agree to Terms of the Provider. Your access to the service might be reliant on the External Provider being operational.":[["0"]," on-ramp service is provided by External Provider and by selecting you agree to Terms of the Provider. Your access to the service might be reliant on the External Provider being operational."],"{0}{name}":[["0"],["name"]],"{currentMethod}":[["currentMethod"]],"{d}d":[["d"],"d"],"{h}h":[["h"],"h"],"{m}m":[["m"],"m"],"{networkName} Faucet":[["networkName"]," Faucet"],"{notifyText}":[["notifyText"]],"{numSelected}/{numAvailable} assets selected":[["numSelected"],"/",["numAvailable"]," assets selected"],"{s}s":[["s"],"s"],"{title}":[["title"]],"{tooltipText}":[["tooltipText"]]}}},87940:function(e,t,n){"use strict";n.d(t,{K:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[{internalType:"address",name:"target",type:"address"}],name:"AddressEmptyCode",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"AddressInsufficientBalance",type:"error"},{inputs:[],name:"FailedInnerCall",type:"error"},{inputs:[],name:"InvalidAddress",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"InvalidLockDuration",type:"error"},{inputs:[{internalType:"bytes32[]",name:"",type:"bytes32[]"}],name:"InvalidMerkleProof",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"RewardsAlreadyClaimed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"SafeERC20FailedOperation",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldLocker",type:"address"},{indexed:!1,internalType:"address",name:"newLocker",type:"address"}],name:"LockerSet",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"oldMerkleRoot",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"newMerkleRoot",type:"bytes32"}],name:"MerkleRootSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[],name:"RewardTerminated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRewardToken",type:"address"},{indexed:!1,internalType:"address",name:"newRewardToken",type:"address"}],name:"RewardTokenSet",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"_user",type:"address"},{indexed:!1,internalType:"uint256",name:"_rewardsAmount",type:"uint256"}],name:"RewardsClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"_user",type:"address"},{indexed:!1,internalType:"uint256",name:"_lockAmount",type:"uint256"}],name:"RewardsLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"_user",type:"address"},{indexed:!1,internalType:"uint256",name:"_transferAmount",type:"uint256"}],name:"RewardsTransferred",type:"event"},{inputs:[],name:"adminWithdrawal",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_user",type:"address"},{internalType:"uint256",name:"_claimAmount",type:"uint256"},{internalType:"bytes32[]",name:"_merkleProofs",type:"bytes32[]"},{internalType:"bool",name:"_lockAndStake",type:"bool"},{internalType:"uint256",name:"lockUntil",type:"uint256"}],name:"claim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_rewardToken",type:"address"},{internalType:"address",name:"_locker",type:"address"},{internalType:"address",name:"_vestedZeroNFT",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"locker",outputs:[{internalType:"contract IZeroLocker",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rewardToken",outputs:[{internalType:"contract ERC20Upgradeable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"rewardsClaimed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_locker",type:"address"}],name:"setLocker",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"_merkleRoot",type:"bytes32"}],name:"setMerkleRoot",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_rewardToken",type:"address"}],name:"setRewardToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_locker",type:"address"}],name:"setVestedZeroNFT",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"vestedZeroNFT",outputs:[{internalType:"contract IVestedZeroNFT",name:"",type:"address"}],stateMutability:"view",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"getUserClaimed",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.rewardsClaimed(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setClaimReward",value:function(){var e=(0,r.Z)(c().mark((function e(t,n,r,i,o){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.claim(t,n,r,i,o);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,o){return e.apply(this,arguments)}}()}]),e}(),b=function(){function e(t,n,r){(0,i.Z)(this,e),this.chainId=r,(0,s.Z)(this,"airdropDataService",void 0),this.airdropDataService=new y({uiStakeDataProvider:n,provider:t})}return(0,o.Z)(e,[{key:"getUserRewardClaimed",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.airdropDataService.getUserClaimed(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setClaimRewards",value:function(){var e=(0,r.Z)(c().mark((function e(t){var n,r,i,o,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.user,r=t.claimAmount,i=t.merkleProofs,o=t.stakeNFT,s=t.lockUntil,e.next=3,this.airdropDataService.setClaimReward(n,r,i,o,s);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}()},21380:function(e,t,n){"use strict";n.d(t,{s:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[],name:"ERC721EnumerableForbiddenBatchMint",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"owner",type:"address"}],name:"ERC721IncorrectOwner",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC721InsufficientApproval",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC721InvalidApprover",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC721InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"ERC721InvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC721InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC721InvalidSender",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC721NonexistentToken",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"ERC721OutOfBoundsIndex",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"provider",type:"address"},{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!0,internalType:"uint256",name:"locktime",type:"uint256"},{indexed:!1,internalType:"enum IZeroLocker.DepositType",name:"deposit_type",type:"uint8"},{indexed:!1,internalType:"uint256",name:"ts",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"prevSupply",type:"uint256"},{indexed:!1,internalType:"uint256",name:"supply",type:"uint256"}],name:"Supply",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"provider",type:"address"},{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!1,internalType:"uint256",name:"ts",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"balanceOfNFT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_value",type:"uint256"},{internalType:"uint256",name:"_lockDuration",type:"uint256"},{internalType:"bool",name:"_stakeNFT",type:"bool"}],name:"createLock",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_value",type:"uint256"},{internalType:"uint256",name:"_lockDuration",type:"uint256"},{internalType:"address",name:"_to",type:"address"},{internalType:"bool",name:"_stakeNFT",type:"bool"}],name:"createLockFor",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"},{internalType:"uint256",name:"_value",type:"uint256"}],name:"depositFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"},{internalType:"uint256",name:"_value",type:"uint256"}],name:"increaseAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"},{internalType:"uint256",name:"_lockDuration",type:"uint256"}],name:"increaseUnlockTime",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"address",name:"_staking",type:"address"},{internalType:"address",name:"_stakingBonus",type:"address"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"locked",outputs:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"power",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"lockedEnd",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_from",type:"uint256"},{internalType:"uint256",name:"_to",type:"uint256"}],name:"merge",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"staking",outputs:[{internalType:"contract IOmnichainStaking",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"supply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"_interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"underlying",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_owner",type:"address"}],name:"votingPowerOf",outputs:[{internalType:"uint256",name:"_power",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"getUserLockBalance",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.balanceOf(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"generateNFTAllowance",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getApproved(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setCreateLock",value:function(){var e=(0,r.Z)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.createLock(t,n,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"setWithdrawLock",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.withdraw(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setApproveNFT",value:function(){var e=(0,r.Z)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.approve(t,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setStakeNFT",value:function(){var e=(0,r.Z)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction["safeTransferFrom(address,address,uint256)"](t,n,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()}]),e}(),b=function(){function e(t,n,r){(0,i.Z)(this,e),this.chainId=r,(0,s.Z)(this,"lockDataService",void 0),this.lockDataService=new y({uiStakeDataProvider:n,provider:t})}return(0,o.Z)(e,[{key:"setGeneralCreateLock",value:function(){var e=(0,r.Z)(c().mark((function e(t){var n,r,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.amount,r=t.duration,i=t.stakeNFT,e.abrupt("return",this.lockDataService.setCreateLock(n,r,i));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setGeneralWithdrawLock",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.lockDataService.setWithdrawLock(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getNFTAllowance",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.lockDataService.generateNFTAllowance(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setNFTApproval",value:function(){var e=(0,r.Z)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.lockDataService.setApproveNFT(t,n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setStakeNFT",value:function(){var e=(0,r.Z)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.lockDataService.setStakeNFT(t,n,r));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}()},59027:function(e,t,n){"use strict";n.d(t,{T:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[],name:"CheckpointUnorderedInsertion",type:"error"},{inputs:[],name:"ECDSAInvalidSignature",type:"error"},{inputs:[{internalType:"uint256",name:"length",type:"uint256"}],name:"ECDSAInvalidSignatureLength",type:"error"},{inputs:[{internalType:"bytes32",name:"s",type:"bytes32"}],name:"ECDSAInvalidSignatureS",type:"error"},{inputs:[{internalType:"uint256",name:"increasedSupply",type:"uint256"},{internalType:"uint256",name:"cap",type:"uint256"}],name:"ERC20ExceededSafeSupply",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"allowance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientAllowance",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC20InvalidApprover",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC20InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC20InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"}],name:"ERC20InvalidSpender",type:"error"},{inputs:[{internalType:"uint256",name:"timepoint",type:"uint256"},{internalType:"uint48",name:"clock",type:"uint48"}],name:"ERC5805FutureLookup",type:"error"},{inputs:[],name:"ERC6372InconsistentClock",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"currentNonce",type:"uint256"}],name:"InvalidAccountNonce",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"InvalidUnstaker",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{internalType:"uint8",name:"bits",type:"uint8"},{internalType:"uint256",name:"value",type:"uint256"}],name:"SafeCastOverflowedUintDowncast",type:"error"},{inputs:[{internalType:"uint256",name:"expiry",type:"uint256"}],name:"VotesExpiredSignature",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegator",type:"address"},{indexed:!0,internalType:"address",name:"fromDelegate",type:"address"},{indexed:!0,internalType:"address",name:"toDelegate",type:"address"}],name:"DelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!1,internalType:"uint256",name:"previousVotes",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newVotes",type:"uint256"}],name:"DelegateVotesChanged",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldLpOracle",type:"address"},{indexed:!0,internalType:"address",name:"newLpOracle",type:"address"}],name:"LpOracleSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"token",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Recovered",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardPaid",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newDuration",type:"uint256"}],name:"RewardsDurationUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousToken",type:"address"},{indexed:!1,internalType:"address",name:"_zeroToken",type:"address"}],name:"RewardsTokenUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousLocker",type:"address"},{indexed:!1,internalType:"address",name:"_tokenLocker",type:"address"}],name:"TokenLockerUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousVotingPowerCombined",type:"address"},{indexed:!1,internalType:"address",name:"_votingPowerCombined",type:"address"}],name:"VotingPowerCombinedUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldZeroAggregator",type:"address"},{indexed:!0,internalType:"address",name:"newZeroAggregator",type:"address"}],name:"ZeroAggregatorSet",type:"event"},{inputs:[],name:"CLOCK_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"__",outputs:[{internalType:"contract ILocker",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint32",name:"pos",type:"uint32"}],name:"checkpoints",outputs:[{components:[{internalType:"uint48",name:"_key",type:"uint48"},{internalType:"uint208",name:"_value",type:"uint208"}],internalType:"struct Checkpoints.Checkpoint208",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"clock",outputs:[{internalType:"uint48",name:"",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"}],name:"delegate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"delegates",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"distributor",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"earned",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_user",type:"address"}],name:"getLockedNftDetails",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"power",type:"uint256"}],internalType:"struct ILocker.LockedBalance[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"timepoint",type:"uint256"}],name:"getPastTotalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"timepoint",type:"uint256"}],name:"getPastVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getReward",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getRewardETH",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"getTokenPower",outputs:[{internalType:"uint256",name:"power",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"newLockAmount",type:"uint256"}],name:"increaseLockAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"newLockDuration",type:"uint256"}],name:"increaseLockDuration",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_locker",type:"address"},{internalType:"address",name:"_zeroToken",type:"address"},{internalType:"address",name:"_poolVoter",type:"address"},{internalType:"uint256",name:"_rewardsDuration",type:"uint256"},{internalType:"address",name:"_owner",type:"address"},{internalType:"address",name:"_distributor",type:"address"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"who",type:"address[]"}],name:"initDelegates",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"lastTimeRewardApplicable",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"lastUpdateTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"lockedByToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"lockedTokenIdNfts",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"locker",outputs:[{internalType:"contract ILocker",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"lpPower",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"reward",type:"uint256"}],name:"notifyRewardAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"numCheckpoints",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"periodFinish",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"uint256",name:"tokenAmount",type:"uint256"}],name:"recoverERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rewardPerToken",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardPerTokenStored",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardRate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"rewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardsDuration",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardsToken",outputs:[{internalType:"contract IZeroLend",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"what",type:"address"}],name:"setRewardDistributor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"what",type:"address"}],name:"setVotingPowerCombined",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokenPower",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"who",type:"address"}],name:"totalNFTStaked",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeAndWithdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"updateRewardFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"userRewardPerTokenPaid",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPowerCombined",outputs:[{internalType:"contract IVotingPowerCombined",name:"",type:"address"}],stateMutability:"view",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"unStakeandWithdraw",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.unstakeAndWithdraw(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRewardRate",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.rewardRate();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getBalanceOf",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.balanceOf(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getTotalSupply",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.totalSupply();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getEarnedValue",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.earned(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRewardETH",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.getRewardETH();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getStakedSupply",value:function(){var e=(0,r.Z)(c().mark((function e(t){var n,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getBalanceOf(t);case 2:return n=e.sent,e.next=5,this.getTotalSupply();case 5:return r=e.sent,e.abrupt("return",n.mul(1e8).div(r));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),b=function(){function e(t,n,r){(0,i.Z)(this,e),this.chainId=r,(0,s.Z)(this,"omniLPStakingDataService",void 0),this.omniLPStakingDataService=new y({uiStakeDataProvider:n,provider:t})}return(0,o.Z)(e,[{key:"setUnstakeandWithdraw",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.unStakeandWithdraw(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRewardRate",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getRewardRate();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTotalSupply",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getTotalSupply();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getEarnedValue",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getEarnedValue(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"claimReward",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getRewardETH();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}},{key:"claimRewardETH",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getRewardETH();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getVotingPower",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getBalanceOf(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getStakedSupply",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getStakedSupply(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}()},67724:function(e,t,n){"use strict";n.d(t,{y:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[],name:"CheckpointUnorderedInsertion",type:"error"},{inputs:[],name:"ECDSAInvalidSignature",type:"error"},{inputs:[{internalType:"uint256",name:"length",type:"uint256"}],name:"ECDSAInvalidSignatureLength",type:"error"},{inputs:[{internalType:"bytes32",name:"s",type:"bytes32"}],name:"ECDSAInvalidSignatureS",type:"error"},{inputs:[{internalType:"uint256",name:"increasedSupply",type:"uint256"},{internalType:"uint256",name:"cap",type:"uint256"}],name:"ERC20ExceededSafeSupply",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"allowance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientAllowance",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC20InvalidApprover",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC20InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC20InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"}],name:"ERC20InvalidSpender",type:"error"},{inputs:[{internalType:"uint256",name:"timepoint",type:"uint256"},{internalType:"uint48",name:"clock",type:"uint48"}],name:"ERC5805FutureLookup",type:"error"},{inputs:[],name:"ERC6372InconsistentClock",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"currentNonce",type:"uint256"}],name:"InvalidAccountNonce",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"InvalidUnstaker",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{internalType:"uint8",name:"bits",type:"uint8"},{internalType:"uint256",name:"value",type:"uint256"}],name:"SafeCastOverflowedUintDowncast",type:"error"},{inputs:[{internalType:"uint256",name:"expiry",type:"uint256"}],name:"VotesExpiredSignature",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegator",type:"address"},{indexed:!0,internalType:"address",name:"fromDelegate",type:"address"},{indexed:!0,internalType:"address",name:"toDelegate",type:"address"}],name:"DelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!1,internalType:"uint256",name:"previousVotes",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newVotes",type:"uint256"}],name:"DelegateVotesChanged",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldLpOracle",type:"address"},{indexed:!0,internalType:"address",name:"newLpOracle",type:"address"}],name:"LpOracleSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"token",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Recovered",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardPaid",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newDuration",type:"uint256"}],name:"RewardsDurationUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousToken",type:"address"},{indexed:!1,internalType:"address",name:"_zeroToken",type:"address"}],name:"RewardsTokenUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousLocker",type:"address"},{indexed:!1,internalType:"address",name:"_tokenLocker",type:"address"}],name:"TokenLockerUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousVotingPowerCombined",type:"address"},{indexed:!1,internalType:"address",name:"_votingPowerCombined",type:"address"}],name:"VotingPowerCombinedUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldZeroAggregator",type:"address"},{indexed:!0,internalType:"address",name:"newZeroAggregator",type:"address"}],name:"ZeroAggregatorSet",type:"event"},{inputs:[],name:"CLOCK_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"__",outputs:[{internalType:"contract ILocker",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint32",name:"pos",type:"uint32"}],name:"checkpoints",outputs:[{components:[{internalType:"uint48",name:"_key",type:"uint48"},{internalType:"uint208",name:"_value",type:"uint208"}],internalType:"struct Checkpoints.Checkpoint208",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"clock",outputs:[{internalType:"uint48",name:"",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"}],name:"delegate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"delegates",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"distributor",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"earned",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_user",type:"address"}],name:"getLockedNftDetails",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"power",type:"uint256"}],internalType:"struct ILocker.LockedBalance[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"timepoint",type:"uint256"}],name:"getPastTotalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"timepoint",type:"uint256"}],name:"getPastVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getReward",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getRewardETH",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"getTokenPower",outputs:[{internalType:"uint256",name:"power",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"newLockAmount",type:"uint256"}],name:"increaseLockAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"newLockDuration",type:"uint256"}],name:"increaseLockDuration",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_locker",type:"address"},{internalType:"address",name:"_zeroToken",type:"address"},{internalType:"address",name:"_poolVoter",type:"address"},{internalType:"uint256",name:"_rewardsDuration",type:"uint256"},{internalType:"address",name:"_owner",type:"address"},{internalType:"address",name:"_distributor",type:"address"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"who",type:"address[]"}],name:"initDelegates",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"lastTimeRewardApplicable",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"lastUpdateTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"lockedByToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"lockedTokenIdNfts",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"locker",outputs:[{internalType:"contract ILocker",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"lpPower",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"reward",type:"uint256"}],name:"notifyRewardAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"numCheckpoints",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"periodFinish",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"uint256",name:"tokenAmount",type:"uint256"}],name:"recoverERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rewardPerToken",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardPerTokenStored",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardRate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"rewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardsDuration",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardsToken",outputs:[{internalType:"contract IZeroLend",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"what",type:"address"}],name:"setRewardDistributor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"what",type:"address"}],name:"setVotingPowerCombined",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokenPower",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"who",type:"address"}],name:"totalNFTStaked",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeAndWithdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"updateRewardFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"userRewardPerTokenPaid",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPowerCombined",outputs:[{internalType:"contract IVotingPowerCombined",name:"",type:"address"}],stateMutability:"view",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"getRewardRate",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.rewardRate();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTotalSupply",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.totalSupply();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getBalanceOf",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.balanceOf(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unStake",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.unstakeToken(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unStakeandWithdraw",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.unstakeAndWithdraw(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getEarnedValue",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.earned(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getReward",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.getReward();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRewardETH",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.getRewardETH();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getStakedSupply",value:function(){var e=(0,r.Z)(c().mark((function e(t){var n,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getBalanceOf(t);case 2:return n=e.sent,e.next=5,this.getTotalSupply();case 5:return r=e.sent,e.abrupt("return",n.mul(1e8).div(r));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),b=function(){function e(t,n,r){(0,i.Z)(this,e),this.chainId=r,(0,s.Z)(this,"omniStakingDataService",void 0),this.omniStakingDataService=new y({uiStakeDataProvider:n,provider:t})}return(0,o.Z)(e,[{key:"getRewardRate",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getRewardRate();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTotalSupply",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getTotalSupply();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setUnstakeNFT",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.unStake(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setUnstakeandWithdraw",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.unStakeandWithdraw(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getEarnedValue",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getEarnedValue(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"claimReward",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getReward();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getVotingPower",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getBalanceOf(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getStakedSupply",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getStakedSupply(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}()},16649:function(e,t,n){"use strict";n.d(t,{w:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[{internalType:"int256",name:"_answer",type:"int256"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"pure",type:"function"},{inputs:[],name:"latestAnswer",outputs:[{internalType:"int256",name:"",type:"int256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int256",name:"_answer",type:"int256"}],name:"setAnswer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"getLatestAnswer",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.latestAnswer();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),b=function(){function e(t,n,r){(0,i.Z)(this,e),this.chainId=r,(0,s.Z)(this,"oracleDataService",void 0),this.oracleDataService=new y({uiStakeDataProvider:n,provider:t})}return(0,o.Z)(e,[{key:"getLatestAnswer",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.oracleDataService.getLatestAnswer();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}()},3408:function(e,t,n){"use strict";n.d(t,{n:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[{internalType:"address",name:"target",type:"address"}],name:"AddressEmptyCode",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"AddressInsufficientBalance",type:"error"},{inputs:[],name:"FailedInnerCall",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"SafeERC20FailedOperation",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"bribes",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"claimable",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"_gauges",type:"address[]"}],name:"distribute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_gauge",type:"address"}],name:"distribute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"finish",type:"uint256"}],name:"distribute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"distribute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"gauges",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getPoolWeights",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserVotes",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"index",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_staking",type:"address"},{internalType:"address",name:"_reward",type:"address"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isPool",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"length",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"lzEndpoint",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"mainnetEmissions",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"notifyRewardAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"who",type:"address"}],name:"poke",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"poolForGauge",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"poolVote",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pools",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_asset",type:"address"},{internalType:"address",name:"_gauge",type:"address"}],name:"registerGauge",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"reset",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"reward",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"gauge",type:"address"},{internalType:"address",name:"bribe",type:"address"}],name:"setBribe",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"weight",type:"uint256"}],name:"setTotalWeight",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"usedWeight",type:"uint256"}],name:"setUsedWeight",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"address[]",name:"_pool",type:"address[]"},{internalType:"uint256[]",name:"_weights",type:"uint256[]"}],name:"setVotes",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"pool",type:"address"},{internalType:"uint256",name:"weight",type:"uint256"}],name:"setWeight",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"staking",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"supplyIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalWeight",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_gauge",type:"address"}],name:"updateFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"usedWeights",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"_poolVote",type:"address[]"},{internalType:"uint256[]",name:"_weights",type:"uint256[]"}],name:"vote",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"votes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"weights",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"getPoolWeights",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getPoolWeights();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getUserVotes",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getUserVotes(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPools",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.pools();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTotalWeight",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.totalWeight();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getAllPools",value:function(){var e=(0,r.Z)(c().mark((function e(t){var n,r,i,o,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],e.next=3,this.getPoolWeights();case 3:return r=e.sent,e.next=6,this.getUserVotes(t);case 6:return i=e.sent,e.next=9,this.getPools();case 9:for(o=e.sent,s=0;st.iconSymbol.toUpperCase()?1:-1},x=function(e,t){var n=y(e),r=v(e),o=e.currentNetworkConfig;return(0,i.vl)({reserves:n,currentTimestamp:t,marketReferenceCurrencyDecimals:r.marketReferenceCurrencyDecimals,marketReferencePriceInUsd:r.marketReferenceCurrencyPriceInUsd,reserveIncentives:e.reserveIncentiveData||[]}).map((function(e){var t;return u(u(u({},e),(0,s.QD)(e)),{},{isEmodeEnabled:0!==e.eModeCategoryId,isWrappedBaseAsset:e.symbol.toLowerCase()===(null===(t=o.wrappedBaseAssetSymbol)||void 0===t?void 0:t.toLowerCase()),borrowAPY1D:(Number(e.variableBorrowAPY)/365).toString(),supplyMaxAPY:Number(e.supplyAPY).toString()})})).sort(w)},A=function(e,t){var n=v(e),r=m(e),i=x(e,t),s=h(e),a=e.reserveIncentiveData,c=e.userIncentiveData;return(0,o.n)({currentTimestamp:t,marketReferencePriceInUsd:n.marketReferenceCurrencyPriceInUsd,marketReferenceCurrencyDecimals:n.marketReferenceCurrencyDecimals,userReserves:r,formattedReserves:i,userEmodeCategoryId:s,reserveIncentives:a||[],userIncentives:c||[]})},E=function(e){return null===e||void 0===e?void 0:e.reduce((function(e,t){return e[t.eModeCategoryId]?e[t.eModeCategoryId].assets.push(t.symbol):e[t.eModeCategoryId]={liquidationBonus:t.eModeLiquidationBonus,id:t.eModeCategoryId,label:t.eModeLabel,liquidationThreshold:t.eModeLiquidationThreshold,ltv:t.eModeLtv,priceSource:t.eModePriceSource,assets:[t.symbol]},e}),{})},_=function(e){var t=y(e);return E(t)}},69311:function(e,t,n){"use strict";n.d(t,{DP:function(){return ei},Qb:function(){return Qr},HL:function(){return ii},n7:function(){return ri},IP:function(){return ti},p4:function(){return Xr},Xh:function(){return Jr},Fp:function(){return ni},Yh:function(){return Kr}});var r=n(50029),i=n(59499),o=n(87794),s=n.n(o),a=n(70655),c=n(27627),u=n(75331),l=n(80854),d=n(29897),f=n(55206),p=n(11466);const h=[{inputs:[],name:"isPermissioned",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bool",name:"value",type:"bool"}],name:"setPermissioned",outputs:[],stateMutability:"nonpayable",type:"function"}];class m{static connect(e,t){return new p.CH(e,h,t)}}m.abi=h;class g extends c.Z{constructor(e,t){super(e,m),this.faucetAddress=null!==t&&void 0!==t?t:""}mint({userAddress:e,reserve:t,tokenSymbol:n,owner:r}){const i=(0,l.gU)("1000",18),o=l.Ry[n]?l.Ry[n]:i,s=this.getContractInstance(this.faucetAddress),a=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.mint(t,e,o),from:null!==r&&void 0!==r?r:e,value:l.k8});return[{tx:a,txType:u.ns.FAUCET_V2_MINT,gas:this.generateTxPriceEstimation([],a)}]}async isPermissioned(){return this.getContractInstance(this.faucetAddress).isPermissioned()}}function y(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:T(e)?2:S(e)?3:0}function A(e,t){return 2===x(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function E(e,t){return 2===x(e)?e.get(t):e[t]}function _(e,t,n){var r=x(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function k(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function T(e){return ne&&e instanceof Map}function S(e){return re&&e instanceof Set}function C(e){return e.o||e.t}function I(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=de(e);delete t[ae];for(var n=le(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=R),Object.freeze(e),t&&w(e,(function(e,t){return O(t,!0)}),!0)),e}function R(){y(2)}function D(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function P(e){var t=fe[e];return t||y(18,e),t}function B(e,t){fe[e]||(fe[e]=t)}function M(){return ee}function N(e,t){t&&(P("Patches"),e.u=[],e.s=[],e.v=t)}function F(e){L(e),e.p.forEach(U),e.p=null}function L(e){e===ee&&(ee=e.l)}function j(e){return ee={p:[],l:ee,h:e,m:!0,_:0}}function U(e){var t=e[ae];0===t.i||1===t.i?t.j():t.O=!0}function Z(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||P("ES5").S(t,e,r),r?(n[ae].P&&(F(t),y(4)),v(e)&&(e=H(t,e),t.l||G(t,e)),t.u&&P("Patches").M(n[ae].t,e,t.u,t.s)):e=H(t,n,[]),F(t),t.u&&t.v(t.u,t.s),e!==oe?e:void 0}function H(e,t,n){if(D(t))return t;var r=t[ae];if(!r)return w(t,(function(i,o){return z(e,r,t,i,o,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return G(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=I(r.k):r.o;w(3===r.i?new Set(i):i,(function(t,o){return z(e,r,i,t,o,n)})),G(e,i,!1),n&&e.u&&P("Patches").R(r,n,e.u,e.s)}return r.o}function z(e,t,n,r,i,o){if(b(i)){var s=H(e,i,o&&t&&3!==t.i&&!A(t.D,r)?o.concat(r):void 0);if(_(n,r,s),!b(s))return;e.m=!1}if(v(i)&&!D(i)){if(!e.h.F&&e._<1)return;H(e,i),t&&t.A.l||G(e,i)}}function G(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&O(t,n)}function V(e,t){var n=e[ae];return(n?C(n):e)[t]}function W(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function q(e){e.P||(e.P=!0,e.l&&q(e.l))}function $(e){e.o||(e.o=I(e.t))}function K(e,t,n){var r=T(t)?P("MapSet").N(t,n):S(t)?P("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:M(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,o=pe;n&&(i=[r],o=he);var s=Proxy.revocable(i,o),a=s.revoke,c=s.proxy;return r.k=c,r.j=a,c}(t,n):P("ES5").J(t,n);return(n?n.A:M()).p.push(r),r}function Y(e){return b(e)||y(22,e),function e(t){if(!v(t))return t;var n,r=t[ae],i=x(t);if(r){if(!r.P&&(r.i<4||!P("ES5").K(r)))return r.t;r.I=!0,n=X(t,i),r.I=!1}else n=X(t,i);return w(n,(function(t,i){r&&E(r.t,t)===i||_(n,t,e(i))})),3===i?new Set(n):n}(e)}function X(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return I(e)}function J(){function e(e,t){function n(){this.constructor=e}i(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function n(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(v(t)){var n=K(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)})))}function r(e){e.O&&y(3,JSON.stringify(C(e)))}var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},o=function(){function n(e,t){return this[ae]={i:2,l:t,A:t?t.A:M(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(n,Map);var i=n.prototype;return Object.defineProperty(i,"size",{get:function(){return C(this[ae]).size}}),i.has=function(e){return C(this[ae]).has(e)},i.set=function(e,n){var i=this[ae];return r(i),C(i).has(e)&&C(i).get(e)===n||(t(i),q(i),i.D.set(e,!0),i.o.set(e,n),i.D.set(e,!0)),this},i.delete=function(e){if(!this.has(e))return!1;var n=this[ae];return r(n),t(n),q(n),n.t.has(e)?n.D.set(e,!1):n.D.delete(e),n.o.delete(e),!0},i.clear=function(){var e=this[ae];r(e),C(e).size&&(t(e),q(e),e.D=new Map,w(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},i.forEach=function(e,t){var n=this;C(this[ae]).forEach((function(r,i){e.call(t,n.get(i),i,n)}))},i.get=function(e){var n=this[ae];r(n);var i=C(n).get(e);if(n.I||!v(i))return i;if(i!==n.t.get(e))return i;var o=K(n.A.h,i,n);return t(n),n.o.set(e,o),o},i.keys=function(){return C(this[ae]).keys()},i.values=function(){var e,t=this,n=this.keys();return(e={})[ce]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},i.entries=function(){var e,t=this,n=this.keys();return(e={})[ce]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},i[ce]=function(){return this.entries()},n}(),s=function(){function t(e,t){return this[ae]={i:3,l:t,A:t?t.A:M(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,O:!1,C:!1},this}e(t,Set);var i=t.prototype;return Object.defineProperty(i,"size",{get:function(){return C(this[ae]).size}}),i.has=function(e){var t=this[ae];return r(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},i.add=function(e){var t=this[ae];return r(t),this.has(e)||(n(t),q(t),t.o.add(e)),this},i.delete=function(e){if(!this.has(e))return!1;var t=this[ae];return r(t),n(t),q(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},i.clear=function(){var e=this[ae];r(e),C(e).size&&(n(e),q(e),e.o.clear())},i.values=function(){var e=this[ae];return r(e),n(e),e.o.values()},i.entries=function(){var e=this[ae];return r(e),n(e),e.o.entries()},i.keys=function(){return this.values()},i[ce]=function(){return this.values()},i.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();B("MapSet",{N:function(e,t){return new o(e,t)},T:function(e,t){return new s(e,t)}})}(0,a.__decorate)([d.QL,(0,a.__param)(0,(0,f.Oh)("userAddress")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],g.prototype,"mint",null);var Q,ee,te="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),ne="undefined"!=typeof Map,re="undefined"!=typeof Set,ie="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,oe=te?Symbol.for("immer-nothing"):((Q={})["immer-nothing"]=!0,Q),se=te?Symbol.for("immer-draftable"):"__$immer_draftable",ae=te?Symbol.for("immer-state"):"__$immer_state",ce="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",ue=""+Object.prototype.constructor,le="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,de=Object.getOwnPropertyDescriptors||function(e){var t={};return le(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},fe={},pe={get:function(e,t){if(t===ae)return e;var n=C(e);if(!A(n,t))return function(e,t,n){var r,i=W(t,n);return i?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!v(r)?r:r===V(e.t,t)?($(e),e.o[t]=K(e.A.h,r,e)):r},has:function(e,t){return t in C(e)},ownKeys:function(e){return Reflect.ownKeys(C(e))},set:function(e,t,n){var r=W(C(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=V(C(e),t),o=null==i?void 0:i[ae];if(o&&o.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(k(n,i)&&(void 0!==n||A(e.t,t)))return!0;$(e),q(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==V(e.t,t)||t in e.t?(e.D[t]=!1,$(e),q(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=C(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){y(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){y(12)}},he={};w(pe,(function(e,t){he[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),he.deleteProperty=function(e,t){return he.set.call(this,e,t,void 0)},he.set=function(e,t,n){return pe.set.call(this,e[0],t,n,e[0])};var me=function(){function e(e){var t=this;this.g=ie,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var i=n;n=e;var o=t;return function(e){var t=this;void 0===e&&(e=i);for(var r=arguments.length,s=Array(r>1?r-1:0),a=1;a1?r-1:0),o=1;o=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var i=P("Patches").$;return b(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}(),ge=new me,ye=ge.produce,be=(ge.produceWithPatches.bind(ge),ge.setAutoFreeze.bind(ge),ge.setUseProxies.bind(ge),ge.applyPatches.bind(ge),ge.createDraft.bind(ge),ge.finishDraft.bind(ge),ye),ve=n(63206);const we=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"===typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!==typeof i)?i:Object.assign({},t,i),n.forEach((n=>n(t,e)))}},i=()=>t,o={setState:r,getState:i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,i,o),o};var xe=n(67294),Ae=n(52798);const{useSyncExternalStoreWithSelector:Ee}=Ae;const _e=e=>{const t="function"===typeof e?(e=>e?we(e):we)(e):e,n=(e,n)=>function(e,t=e.getState,n){const r=Ee(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return(0,xe.useDebugValue)(r),r}(t,e,n);return Object.assign(n,t),n},ke=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,...a}=t;let c;try{c=(null==o||o)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const u=c.connect(a);let l=!0;i.setState=(e,t,i)=>{const o=n(e,t);return l?(u.send(void 0===i?{type:s||"anonymous"}:"string"===typeof i?{type:i}:i,r()),o):o};const d=(...e)=>{const t=l;l=!1,n(...e),l=t},f=e(i.setState,r,i);if(u.init(f),i.dispatchFromDevtools&&"function"===typeof i.dispatch){let e=!1;const t=i.dispatch;i.dispatch=(...n)=>{"__setState"!==n[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...n)}}return u.subscribe((e=>{var t;switch(e.type){case"ACTION":return"string"!==typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):Te(e.payload,(e=>{"__setState"!==e.type?i.dispatchFromDevtools&&"function"===typeof i.dispatch&&i.dispatch(e):d(e.state)}));case"DISPATCH":switch(e.payload.type){case"RESET":return d(f),u.init(i.getState());case"COMMIT":return u.init(i.getState());case"ROLLBACK":return Te(e.state,(e=>{d(e),u.init(i.getState())}));case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Te(e.state,(e=>{d(e)}));case"IMPORT_STATE":{const{nextLiftedState:n}=e.payload,r=null==(t=n.computedStates.slice(-1)[0])?void 0:t.state;if(!r)return;return d(r),void u.send(null,n)}case"PAUSE_RECORDING":return l=!l}return}})),f},Te=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}void 0!==n&&t(n)},Se=e=>(t,n,r)=>{const i=r.subscribe;r.subscribe=(e,t,n)=>{let o=e;if(t){const i=(null==n?void 0:n.equalityFn)||Object.is;let s=e(r.getState());o=n=>{const r=e(n);if(!i(s,r)){const e=s;t(s=r,e)}},(null==n?void 0:n.fireImmediately)&&t(s,s)}return i(o)};return e(t,n,r)};var Ce=n(8891),Ie=n.n(Ce);function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Re(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"0",n=t().ghoReserveDataFetched,r=t().ghoUserDataFetched;if(!n||!r)return!1;var i=t().ghoReserveData,o=t().ghoUserData,s=Number((0,Ue.Fv)(o.userGhoScaledBorrowBalance,18)),a=Number((0,Ue.Fv)(i.ghoMinDebtTokenBalanceForDiscount,18)),c=Number((0,Ue.Fv)(o.userDiscountTokenBalance,18)),u=Number((0,Ue.Fv)(i.ghoMinDiscountTokenBalanceForDiscount,18));return s+Number(e)>=a&&c>=u},ghoMarketConfig:function(){var e=t().currentMarket;if(Ze.uF.includes(e)){var n=t().currentMarketData.addresses,r=n.GHO_TOKEN_ADDRESS,i=n.GHO_UI_DATA_PROVIDER;if(r&&i)return{ghoTokenAddress:r,uiGhoDataProviderAddress:i}}},refreshGhoData:function(){var n=(0,r.Z)(s().mark((function n(){var r,i,o,a,c,u,l,d;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t().ghoMarketConfig()){n.next=3;break}return n.abrupt("return");case 3:if(i=t().account,o=new je({provider:(0,ve.VH)(t().currentMarketData.chainId),uiGhoDataProviderAddress:r.uiGhoDataProviderAddress}),!i){n.next=21;break}return n.prev=6,n.next=9,Promise.all([o.getGhoReserveData(),o.getGhoUserData(i)]);case 9:a=n.sent,c=(0,Be.Z)(a,2),u=c[0],l=c[1],e({ghoReserveData:u,ghoUserData:l,ghoReserveDataFetched:!0,ghoUserDataFetched:!0}),n.next=19;break;case 16:n.prev=16,n.t0=n.catch(6),console.log("error",n.t0);case 19:n.next=31;break;case 21:return n.prev=21,n.next=24,o.getGhoReserveData();case 24:d=n.sent,e({ghoReserveData:d,ghoReserveDataFetched:!0,ghoUserDataFetched:!1}),n.next=31;break;case 28:n.prev=28,n.t1=n.catch(21),console.log("error",n.t1);case 31:case"end":return n.stop()}}),n,null,[[6,16],[21,28]])})));return function(){return n.apply(this,arguments)}}()}},ze=n(93667);class Ge{static connect(e,t){return new p.CH(e,Ve,t)}}const Ve=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegator",type:"address"},{indexed:!0,internalType:"address",name:"delegatee",type:"address"},{indexed:!1,internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"DelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"DelegatedPowerChanged",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"_nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"}],name:"delegate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"delegateByType",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateByTypeBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegator",type:"address"},{internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"getDelegateeByType",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"getPowerAtBlock",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"getPowerCurrent",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"totalSupplyAt",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}];class We extends c.Z{constructor(e){super(e,Ge)}async delegate({user:e,delegatee:t,governanceToken:n}){const r=[],i=this.getContractInstance(n),o=await this.getDelegateeAddress(t),s=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.delegate(o),from:e});return r.push({tx:s,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(r,s)}),r}async delegateByType({user:e,delegatee:t,delegationType:n,governanceToken:r}){const i=[],o=this.getContractInstance(r),s=await this.getDelegateeAddress(t),a=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.delegateByType(s,n),from:e});return i.push({tx:a,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(i,a)}),i}async delegateBySig({user:e,delegatee:t,expiry:n,signature:r,governanceToken:i}){const o=[],s=this.getContractInstance(i),a=await this.getNonce({user:e,governanceToken:i}),{v:c,r:l,s:d}=(0,ze.splitSignature)(r),f=await this.getDelegateeAddress(t),p=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.delegateBySig(f,a,n,c,l,d),from:e});return o.push({tx:p,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(o,p)}),o}async delegateByTypeBySig({user:e,delegatee:t,delegationType:n,expiry:r,signature:i,governanceToken:o}){const s=[],a=this.getContractInstance(o),c=await this.getNonce({user:e,governanceToken:o}),{v:l,r:d,s:f}=(0,ze.splitSignature)(i),p=await this.getDelegateeAddress(t),h=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.delegateByTypeBySig(p,n,c,r,l,d,f),from:e});return s.push({tx:h,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(s,h)}),s}async prepareDelegateSignature({delegatee:e,nonce:t,expiry:n,governanceTokenName:r,governanceToken:i}){const o=await this.getDelegateeAddress(e),{chainId:s}=await this.provider.getNetwork(),a={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Delegate:[{name:"delegatee",type:"address"},{name:"nonce",type:"uint256"},{name:"expiry",type:"uint256"}]},primaryType:"Delegate",domain:{name:r,version:"1",chainId:s,verifyingContract:i},message:{delegatee:o,nonce:t,expiry:n}};return JSON.stringify(a)}async prepareDelegateByTypeSignature({delegatee:e,type:t,nonce:n,expiry:r,governanceTokenName:i,governanceToken:o}){const s=await this.getDelegateeAddress(e),{chainId:a}=await this.provider.getNetwork(),c={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],DelegateByType:[{name:"delegatee",type:"address"},{name:"type",type:"uint256"},{name:"nonce",type:"uint256"},{name:"expiry",type:"uint256"}]},primaryType:"DelegateByType",domain:{name:i,version:"1",chainId:a,verifyingContract:o},message:{delegatee:s,type:t,nonce:n,expiry:r}};return JSON.stringify(c)}async getDelegateeByType({delegator:e,delegationType:t,governanceToken:n}){return this.getContractInstance(n).getDelegateeByType(e,t)}async getPowerCurrent({user:e,delegationType:t,governanceToken:n}){const r=this.getContractInstance(n);return(await r.getPowerCurrent(e,t)).toString()}async getPowerAtBlock({user:e,blockNumber:t,delegationType:n,governanceToken:r}){const i=this.getContractInstance(r);return(await i.getPowerAtBlock(e,t,n)).toString()}async getNonce({user:e,governanceToken:t}){const n=this.getContractInstance(t);return(await n._nonces(e)).toString()}async getDelegateeAddress(e){if((0,l.Nv)(e)){const t=await this.provider.resolveName(e);if(!t)throw new Error(`Address: ${e} is not a valid ENS address`);return t}return e}}(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"delegate",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"delegateByType",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"delegateBySig",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"delegateByTypeBySig",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__param)(0,(0,f.rX)("nonce")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"prepareDelegateSignature",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__param)(0,(0,f.rX)("nonce")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"prepareDelegateByTypeSignature",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("delegator")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"getDelegateeByType",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"getPowerCurrent",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__param)(0,(0,f.K5)("blockNumber")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"getPowerAtBlock",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"getNonce",null);var qe=n(24387);const $e=[{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"_nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}];class Ke{static createInterface(){return new Ne.vU($e)}static connect(e,t){return new p.CH(e,$e,t)}}Ke.abi=$e;class Ye extends c.Z{constructor(e){super(e,Ke),this.getNonce=this.getNonce.bind(this)}async getNonce({token:e,owner:t}){const n=this.getContractInstance(e);let r;try{return r=await n.nonces(t),r.toNumber()}catch(M){}try{return r=await n._nonces(t),r.toNumber()}catch(M){console.log(`Token ${e} does not implement nonces or _nonces method`)}return null}}(0,a.__decorate)([d.JZ,(0,a.__param)(0,(0,f.Oh)("token")),(0,a.__param)(0,(0,f.Oh)("owner")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ye.prototype,"getNonce",null);var Xe=n(45626);function Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qe(e){for(var t=1;t{if(!(0,Me.isAddress)(e))throw new Error("tokenAddress is not valid");return this._registryContract.latestRoundData(e,rt[t])},this.decimals=async(e,t)=>{if(!(0,Me.isAddress)(e))throw new Error("tokenAddress is not valid");return this._registryContract.decimals(e,rt[t])},this.getPriceFeed=async(e,t)=>{const n=await this.latestRoundData(e,t),r=await this.decimals(e,t);return{answer:n[1].toString(),updatedAt:n[3].toNumber(),decimals:r}},!(0,Me.isAddress)(t))throw new Error("contract address is not valid");this._registryContract=class{static connect(e,t){return new p.CH(e,tt,t)}}.connect(t,e)}}const ot=[{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"getFullReservesIncentiveData",outputs:[{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"aIncentiveData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"vIncentiveData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"sIncentiveData",type:"tuple"}],internalType:"struct IUiIncentiveDataProviderV3.AggregatedReserveIncentiveData[]",name:"",type:"tuple[]"},{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"aTokenIncentivesUserData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"vTokenIncentivesUserData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"sTokenIncentivesUserData",type:"tuple"}],internalType:"struct IUiIncentiveDataProviderV3.UserReserveIncentiveData[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"}],name:"getReservesIncentivesData",outputs:[{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"aIncentiveData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"vIncentiveData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"sIncentiveData",type:"tuple"}],internalType:"struct IUiIncentiveDataProviderV3.AggregatedReserveIncentiveData[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"getUserReservesIncentivesData",outputs:[{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"aTokenIncentivesUserData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"vTokenIncentivesUserData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"sTokenIncentivesUserData",type:"tuple"}],internalType:"struct IUiIncentiveDataProviderV3.UserReserveIncentiveData[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"}];class st{static createInterface(){return new Ne.vU(ot)}static connect(e,t){return new p.CH(e,ot,t)}}st.abi=ot;class at extends c.Z{constructor({provider:e,uiIncentiveDataProviderAddress:t,chainId:n}){super(e,st),this._getFeed=async(e,t,n)=>{const r=await this._chainlinkFeedsRegistries[t].getPriceFeed(e,n);return Object.assign(Object.assign({},r),{rewardTokenAddress:e})},this.uiIncentiveDataProviderAddress=t,this._chainlinkFeedsRegistries={},this.chainId=n}async getFullReservesIncentiveData({user:e,lendingPoolAddressProvider:t}){return this.getContractInstance(this.uiIncentiveDataProviderAddress).getFullReservesIncentiveData(t,e)}async getReservesIncentivesData({lendingPoolAddressProvider:e}){return this.getContractInstance(this.uiIncentiveDataProviderAddress).getReservesIncentivesData(e)}async getUserReservesIncentivesData({user:e,lendingPoolAddressProvider:t}){return this.getContractInstance(this.uiIncentiveDataProviderAddress).getUserReservesIncentivesData(t,e)}async getReservesIncentivesDataHumanized({lendingPoolAddressProvider:e}){return(await this.getReservesIncentivesData({lendingPoolAddressProvider:e})).map((t=>({id:`${this.chainId}-${t.underlyingAsset}-${e}`.toLowerCase(),underlyingAsset:t.underlyingAsset.toLowerCase(),aIncentiveData:this._formatIncentiveData(t.aIncentiveData),vIncentiveData:this._formatIncentiveData(t.vIncentiveData),sIncentiveData:this._formatIncentiveData(t.sIncentiveData)})))}async getUserReservesIncentivesDataHumanized({user:e,lendingPoolAddressProvider:t}){return(await this.getUserReservesIncentivesData({user:e,lendingPoolAddressProvider:t})).map((n=>({id:`${this.chainId}-${e}-${n.underlyingAsset}-${t}`.toLowerCase(),underlyingAsset:n.underlyingAsset.toLowerCase(),aTokenIncentivesUserData:this._formatUserIncentiveData(n.aTokenIncentivesUserData),vTokenIncentivesUserData:this._formatUserIncentiveData(n.vTokenIncentivesUserData),sTokenIncentivesUserData:this._formatUserIncentiveData(n.sTokenIncentivesUserData)})))}async getIncentivesDataWithPriceLegacy({lendingPoolAddressProvider:e,chainlinkFeedsRegistry:t,quote:n=nt.eth}){const r=await this.getReservesIncentivesDataHumanized({lendingPoolAddressProvider:e}),i=[];if(t&&(0,Me.isAddress)(t)){this._chainlinkFeedsRegistries[t]||(this._chainlinkFeedsRegistries[t]=new it({provider:this.provider,chainlinkFeedsRegistry:t}));const e=new Set;r.forEach((t=>{t.aIncentiveData.rewardsTokenInformation.map((t=>e.add(t.rewardTokenAddress))),t.vIncentiveData.rewardsTokenInformation.map((t=>e.add(t.rewardTokenAddress))),t.sIncentiveData.rewardsTokenInformation.map((t=>e.add(t.rewardTokenAddress)))}));const o=Array.from(e).map((e=>this._getFeed(e,t,n)));(await Promise.allSettled(o)).forEach((e=>{"fulfilled"===e.status&&i.push(e.value)}))}return r.map((t=>({id:`${this.chainId}-${t.underlyingAsset}-${e}`.toLowerCase(),underlyingAsset:t.underlyingAsset,aIncentiveData:Object.assign(Object.assign({},t.aIncentiveData),{rewardsTokenInformation:t.aIncentiveData.rewardsTokenInformation.map((e=>{const t=i.find((t=>t.rewardTokenAddress===e.rewardTokenAddress));return Object.assign(Object.assign({},e),{rewardPriceFeed:(null===t||void 0===t?void 0:t.answer)?t.answer:e.rewardPriceFeed,priceFeedDecimals:(null===t||void 0===t?void 0:t.decimals)?t.decimals:e.priceFeedDecimals})}))}),vIncentiveData:Object.assign(Object.assign({},t.vIncentiveData),{rewardsTokenInformation:t.vIncentiveData.rewardsTokenInformation.map((e=>{const t=i.find((t=>t.rewardTokenAddress===e.rewardTokenAddress));return Object.assign(Object.assign({},e),{rewardPriceFeed:(null===t||void 0===t?void 0:t.answer)?t.answer:e.rewardPriceFeed,priceFeedDecimals:(null===t||void 0===t?void 0:t.decimals)?t.decimals:e.priceFeedDecimals})}))}),sIncentiveData:Object.assign(Object.assign({},t.sIncentiveData),{rewardsTokenInformation:t.sIncentiveData.rewardsTokenInformation.map((e=>{const t=i.find((t=>t.rewardTokenAddress===e.rewardTokenAddress));return Object.assign(Object.assign({},e),{rewardPriceFeed:(null===t||void 0===t?void 0:t.answer)?t.answer:e.rewardPriceFeed,priceFeedDecimals:(null===t||void 0===t?void 0:t.decimals)?t.decimals:e.priceFeedDecimals})}))})})))}_formatIncentiveData(e){return{tokenAddress:e.tokenAddress,incentiveControllerAddress:e.incentiveControllerAddress,rewardsTokenInformation:e.rewardsTokenInformation.map((e=>({precision:e.precision,rewardTokenAddress:e.rewardTokenAddress,rewardTokenDecimals:e.rewardTokenDecimals,emissionPerSecond:e.emissionPerSecond.toString(),incentivesLastUpdateTimestamp:e.incentivesLastUpdateTimestamp.toNumber(),tokenIncentivesIndex:e.tokenIncentivesIndex.toString(),emissionEndTimestamp:e.emissionEndTimestamp.toNumber(),rewardTokenSymbol:e.rewardTokenSymbol,rewardOracleAddress:e.rewardOracleAddress,rewardPriceFeed:e.rewardPriceFeed.toString(),priceFeedDecimals:e.priceFeedDecimals})))}}_formatUserIncentiveData(e){return{tokenAddress:e.tokenAddress,incentiveControllerAddress:e.incentiveControllerAddress,userRewardsInformation:e.userRewardsInformation.map((e=>({rewardTokenAddress:e.rewardTokenAddress,rewardTokenDecimals:e.rewardTokenDecimals,tokenIncentivesUserIndex:e.tokenIncentivesUserIndex.toString(),userUnclaimedRewards:e.userUnclaimedRewards.toString(),rewardTokenSymbol:e.rewardTokenSymbol,rewardOracleAddress:e.rewardOracleAddress,rewardPriceFeed:e.rewardPriceFeed.toString(),priceFeedDecimals:e.priceFeedDecimals})))}}}function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ut(e){for(var t=1;t0})).map((function(e){return"GOLD"===e.rewardTokenSymbol&&(e.rewardTokenSymbol="zBLAST-GOLD"),"BLAST"===e.rewardTokenSymbol&&(e.rewardTokenSymbol="zBLAST"),e}))};return e.map((function(e){return ut(ut({},e),{},{aIncentiveData:ut(ut({},e.aIncentiveData),{},{rewardsTokenInformation:t(e.aIncentiveData.rewardsTokenInformation)}),vIncentiveData:ut(ut({},e.vIncentiveData),{},{rewardsTokenInformation:t(e.vIncentiveData.rewardsTokenInformation)})})}))})).then((function(t){return e({reserveIncentiveData:t})}))),r&&c.push(a.getUserReservesIncentivesDataHumanized({lendingPoolAddressProvider:i.addresses.LENDING_POOL_ADDRESS_PROVIDER,user:r}).then((function(t){return e({userIncentiveData:t})}))),n.next=12,Promise.all(c);case 12:n.next=17;break;case 14:n.prev=14,n.t0=n.catch(7),console.log("error fetching incentives");case 17:case"end":return n.stop()}}),n,null,[[7,14]])})));return function(){return n.apply(this,arguments)}}()}},dt=function(e){return{mobileDrawerOpen:!1,setMobileDrawerOpen:function(t){e({mobileDrawerOpen:t})},gaslessEnabled:!0,setGaslessEnabled:function(t){e({gaslessEnabled:t})}}},ft=n(69820),pt=n(21921),ht=n(24243);class mt{static connect(e,t){return new p.CH(e,gt,t)}}const gt=[{inputs:[{internalType:"address",name:"assetToSwapFrom",type:"address"},{internalType:"address",name:"assetToSwapTo",type:"address"},{internalType:"uint256",name:"amountToSwap",type:"uint256"},{internalType:"uint256",name:"minAmountToReceive",type:"uint256"},{internalType:"uint256",name:"swapAllBalanceOffset",type:"uint256"},{internalType:"bytes",name:"swapCalldata",type:"bytes"},{internalType:"address",name:"augustus",type:"address"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct IParaSwapLiquiditySwapAdapter.PermitSignature",name:"permitParams",type:"tuple"}],name:"swapAndDeposit",outputs:[],stateMutability:"nonpayable",type:"function"}];function yt(e){switch(e.slice(0,10)){case"0xda8567c8":return 100;case"0x58b9d179":case"0x54840d1a":return 4;case"0x0863b7ac":case"0x8f00eccb":case"0xec1d21dd":case"0xf5661034":case"0x64466805":case"0xa94e78ef":case"0x46c67b6d":case"0xb22f4db8":case"0x19fc5be0":case"0x3865bde6":case"0x58f15100":case"0xa6866da9":return 68;case"0x0b86a4c1":return 36;default:throw new Error("Unrecognized function selector for Augustus")}}class bt extends c.Z{constructor(e,t){super(e,mt),this.liquiditySwapAdapterAddress=null!==t&&void 0!==t?t:"",this.swapAndDeposit=this.swapAndDeposit.bind(this)}swapAndDeposit({user:e,assetToSwapFrom:t,assetToSwapTo:n,amountToSwap:r,minAmountToReceive:i,permitParams:o,augustus:s,swapCallData:a,swapAll:c},l){const d=this.getContractInstance(this.liquiditySwapAdapterAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.swapAndDeposit(t,n,r,i,c?yt(a):0,a,s,o),from:e});return{tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(null!==l&&void 0!==l?l:[],f,u.UQ.swapCollateral)}}}(0,a.__decorate)([d.cJ,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("assetToSwapFrom")),(0,a.__param)(0,(0,f.Oh)("assetToSwapTo")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__param)(0,(0,f.K5)("amountToSwap")),(0,a.__param)(0,(0,f.K5)("minAmountToReceive")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Object)],bt.prototype,"swapAndDeposit",null);const vt=[{inputs:[{internalType:"contract IPoolAddressesProvider",name:"addressesProvider",type:"address"},{internalType:"contract IParaSwapAugustusRegistry",name:"augustusRegistry",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"fromAsset",type:"address"},{indexed:!0,internalType:"address",name:"toAsset",type:"address"},{indexed:!1,internalType:"uint256",name:"amountSold",type:"uint256"},{indexed:!1,internalType:"uint256",name:"receivedAmount",type:"uint256"}],name:"Bought",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"fromAsset",type:"address"},{indexed:!0,internalType:"address",name:"toAsset",type:"address"},{indexed:!1,internalType:"uint256",name:"fromAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"receivedAmount",type:"uint256"}],name:"Swapped",type:"event"},{inputs:[],name:"ADDRESSES_PROVIDER",outputs:[{internalType:"contract IPoolAddressesProvider",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"AUGUSTUS_REGISTRY",outputs:[{internalType:"contract IParaSwapAugustusRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_SLIPPAGE_PERCENT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ORACLE",outputs:[{internalType:"contract IPriceOracleGetter",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"POOL",outputs:[{internalType:"contract IPool",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"uint256[]",name:"premiums",type:"uint256[]"},{internalType:"address",name:"initiator",type:"address"},{internalType:"bytes",name:"params",type:"bytes"}],name:"executeOperation",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20",name:"token",type:"address"}],name:"rescueTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20Detailed",name:"collateralAsset",type:"address"},{internalType:"contract IERC20Detailed",name:"debtAsset",type:"address"},{internalType:"uint256",name:"collateralAmount",type:"uint256"},{internalType:"uint256",name:"debtRepayAmount",type:"uint256"},{internalType:"uint256",name:"debtRateMode",type:"uint256"},{internalType:"uint256",name:"buyAllBalanceOffset",type:"uint256"},{internalType:"bytes",name:"paraswapData",type:"bytes"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct BaseParaSwapAdapter.PermitSignature",name:"permitSignature",type:"tuple"}],name:"swapAndRepay",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],wt="0x6101006040523480156200001257600080fd5b506040516200333638038062003336833981016040819052620000359162000263565b81818180806001600160a01b03166080816001600160a01b031681525050806001600160a01b031663026b1d5f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000092573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b89190620002a2565b6001600160a01b031660a05250600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350806001600160a01b031663fca513a86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000145573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016b9190620002a2565b6001600160a01b0390811660c05260405163fb04e17b60e01b815260006004820152908316915063fb04e17b90602401602060405180830381865afa158015620001b9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001df9190620002c9565b15620002315760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420612076616c6964204175677573747573206164647265737300000000604482015260640160405180910390fd5b6001600160a01b031660e05250506001805550620002ed565b6001600160a01b03811681146200026057600080fd5b50565b600080604083850312156200027757600080fd5b825162000284816200024a565b602084015190925062000297816200024a565b809150509250929050565b600060208284031215620002b557600080fd5b8151620002c2816200024a565b9392505050565b600060208284031215620002dc57600080fd5b81518015158114620002c257600080fd5b60805160a05160c05160e051612fa06200039660003960008181610176015261111801526000818161014f015261237b0152600081816101b8015281816104bb015281816105750152818161064b015281816106e50152818161079f0152818161087501528181610a7001528181611a6801528181611b2601528181611bfe01528181611cc301528181611d5e01528181611fc6015261217b0152600060e70152612fa06000f3fe608060405234801561001057600080fd5b50600436106100c85760003560e01c80634db9dc97116100815780638da5cb5b1161005b5780638da5cb5b146101da578063920f5c84146101f8578063f2fde38b1461021b57600080fd5b80634db9dc9714610198578063715018a6146101ab5780637535d246146101b357600080fd5b806332e4b286116100b257806332e4b2861461013357806338013f021461014a5780633a8298671461017157600080fd5b8062ae3bf8146100cd5780630542975c146100e2575b600080fd5b6100e06100db366004612585565b61022e565b005b6101097f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61013c610bb881565b60405190815260200161012a565b6101097f000000000000000000000000000000000000000000000000000000000000000081565b6101097f000000000000000000000000000000000000000000000000000000000000000081565b6100e06101a63660046125eb565b610385565b6100e06108f4565b6101097f000000000000000000000000000000000000000000000000000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff16610109565b61020b6102063660046126f9565b6109e4565b604051901515815260200161012a565b6100e0610229366004612585565b610c31565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103826102d660005473ffffffffffffffffffffffffffffffffffffffff1690565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610340573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036491906127d4565b73ffffffffffffffffffffffffffffffffffffffff84169190610de2565b50565b600260015414156103f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ab565b60026001556104048886868933610ebb565b955061042089338961041b3686900386018661291f565b61108e565b60006104688585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e91508d90508c6110b4565b90506000610476828a61296a565b905080156106a8576040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301528c169063095ea7b3906044016020604051808303816000875af1158015610513573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105379190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390528c169063095ea7b3906044016020604051808303816000875af11580156105cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f19190612981565b506040517fe8eda9df00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8c8116600483015260248201839052336044830152600060648301527f0000000000000000000000000000000000000000000000000000000000000000169063e8eda9df90608401600060405180830381600087803b15801561068f57600080fd5b505af11580156106a3573d6000803e3d6000fd5b505050505b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301528b169063095ea7b3906044016020604051808303816000875af115801561073d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107619190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018a90528b169063095ea7b3906044016020604051808303816000875af11580156107f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081b9190612981565b506040517f573ade8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152602482018a9052604482018990523360648301527f0000000000000000000000000000000000000000000000000000000000000000169063573ade81906084016020604051808303816000875af11580156108be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e291906127d4565b50506001805550505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102ab565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600060026001541415610a53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ab565b60026001553373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610af7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f43414c4c45525f4d5553545f42455f504f4f4c0000000000000000000000000060448201526064016102ab565b600189148015610b075750600187145b8015610b135750600185145b610b9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f464c4153484c4f414e5f4d554c5449504c455f4153534554535f4e4f545f535560448201527f50504f525445440000000000000000000000000000000000000000000000000060648201526084016102ab565b600088886000818110610bb457610bb46129a3565b905060200201359050600087876000818110610bd257610bd26129a3565b905060200201359050600086905060008d8d6000818110610bf557610bf56129a3565b9050602002016020810190610c0a9190612585565b9050610c1a8787858585896119ed565b505060018080559c9b505050505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610cb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102ab565b73ffffffffffffffffffffffffffffffffffffffff8116610d55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102ab565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff84166004830152602482018390529060008060448382895af1610e45573d6000803e3d6000fd5b50610e4f84611e35565b610eb5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f475076323a206661696c6564207472616e73666572000000000000000000000060448201526064016102ab565b50505050565b600080610ec787611f01565b905060006001876002811115610edf57610edf6129d2565b6002811115610ef057610ef06129d2565b14610f0057816101400151610f07565b8161012001515b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301529192506000918316906370a0823190602401602060405180830381865afa158015610f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9d91906127d4565b90508615611017578581111561100f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f494e53554646494349454e545f414d4f554e545f544f5f52455041590000000060448201526064016102ab565b809550611081565b80861115611081576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f494e56414c49445f444542545f52455041595f414d4f554e540000000000000060448201526064016102ab565b5093979650505050505050565b600061109985611f01565b610100015190506110ad8582868686612038565b5050505050565b6000806000878060200190518101906110cd9190612a73565b6040517ffb04e17b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301529294509092507f00000000000000000000000000000000000000000000000000000000000000009091169063fb04e17b90602401602060405180830381865afa158015611161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111859190612981565b6111eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f494e56414c49445f41554755535455530000000000000000000000000000000060448201526064016102ab565b60006111f688612251565b60ff169050600061120688612251565b60ff16905060006112168a612333565b905060006112238a612333565b9050600061127b611238612710610bb86123e8565b61127561125061124988600a612c26565b87906123f8565b61126f6112686112618b600a612c26565b88906123f8565b8e906123f8565b90612422565b90612435565b9050808a111561130d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f6d6178416d6f756e74546f5377617020657863656564206d617820736c69707060448201527f616765000000000000000000000000000000000000000000000000000000000060648201526084016102ab565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000935073ffffffffffffffffffffffffffffffffffffffff8b1692506370a082319150602401602060405180830381865afa15801561137f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a391906127d4565b90508581101561140f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f494e53554646494349454e545f42414c414e43455f4245464f52455f5357415060448201526064016102ab565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8916906370a0823190602401602060405180830381865afa15801561147c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a091906127d4565b905060008373ffffffffffffffffffffffffffffffffffffffff1663d2c4b5986040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115139190612c42565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808316600483015260006024830152919250908b169063095ea7b3906044016020604051808303816000875af115801561158c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b09190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152602482018a90528b169063095ea7b3906044016020604051808303816000875af1158015611626573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164a9190612981565b508b156116dd5760048c1015801561166e5750845161166a906020612478565b8c11155b6116d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f544f5f414d4f554e545f4f46465345545f4f55545f4f465f52414e474500000060448201526064016102ab565b8660208d018601525b60008473ffffffffffffffffffffffffffffffffffffffff16866040516117049190612c5f565b6000604051808303816000865af19150503d8060008114611741576040519150601f19603f3d011682016040523d82523d6000602084013e611746565b606091505b5050905080611759573d6000803e3d6000fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8d16906370a0823190602401602060405180830381865afa1580156117c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ea91906127d4565b90506117f6818661296a565b975089881115611862576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f57524f4e475f42414c414e43455f41465445525f53574150000000000000000060448201526064016102ab565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906118ff90869073ffffffffffffffffffffffffffffffffffffffff8f16906370a0823190602401602060405180830381865afa1580156118d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f991906127d4565b90612478565b90508981101561196b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f494e53554646494349454e545f414d4f554e545f52454345495645440000000060448201526064016102ab565b8b73ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff167fbf77fd13a39d14dc0da779342c14105c38d9a5d0c60f2caa22f5fd1d5525416d8b846040516119d3929190918252602082015260400190565b60405180910390a350505050505050509695505050505050565b60008080808080611a008b8d018d612c7b565b955095509550955095509550611a19868486888d610ebb565b94506000611a2b85848b8a8c8b6110b4565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301529192509088169063095ea7b3906044016020604051808303816000875af1158015611ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae89190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660048301526024820188905288169063095ea7b3906044016020604051808303816000875af1158015611b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba29190612981565b506040517f573ade8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015260248201889052604482018690528b811660648301527f0000000000000000000000000000000000000000000000000000000000000000169063573ade81906084016020604051808303816000875af1158015611c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6b91906127d4565b506000611c78828d6123e8565b9050611c868a8c838661108e565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301528b169063095ea7b3906044016020604051808303816000875af1158015611d1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d3f9190612981565b508973ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f0000000000000000000000000000000000000000000000000000000000000000611d908f8d6123e890919063ffffffff16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044016020604051808303816000875af1158015611e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e249190612981565b505050505050505050505050505050565b6000611e75565b7f08c379a00000000000000000000000000000000000000000000000000000000060005260206004528060245250806044525060646000fd5b3d8015611eb45760208114611eee57611eaf7f475076323a206d616c666f726d6564207472616e7366657220726573756c7400601f611e3c565b611efb565b823b611ee557611ee57f475076323a206e6f74206120636f6e74726163740000000000000000000000006014611e3c565b60019150611efb565b3d6000803e600051151591505b50919050565b604080516102008101825260006101e08201818152825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c08101919091526040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa15801561200e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120329190612dc0565b92915050565b60208101511561210557805160208201516040808401516060850151608086015192517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301523060248301526044820196909652606481019490945260ff909116608484015260a483015260c48201529085169063d505accf9060e401600060405180830381600087803b1580156120ec57600080fd5b505af1158015612100573d6000803e3d6000fd5b505050505b61212773ffffffffffffffffffffffffffffffffffffffff8516843085612488565b6040517f69328dec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301526024820184905230604483015283917f0000000000000000000000000000000000000000000000000000000000000000909116906369328dec906064016020604051808303816000875af11580156121c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121ea91906127d4565b146110ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f554e45585045435445445f414d4f554e545f57495448445241574e000000000060448201526064016102ab565b6000808273ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561229f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c39190612ee3565b9050604d8160ff161115612032576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f544f4f5f4d414e595f444543494d414c535f4f4e5f544f4b454e00000000000060448201526064016102ab565b6040517fb3596f0700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063b3596f0790602401602060405180830381865afa1580156123c4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203291906127d4565b8082018281101561203257600080fd5b60008215806124195750508181028183828161241657612416612f00565b04145b61203257600080fd5b600061242e8284612f2f565b9392505050565b600081157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec778390048411151761246a57600080fd5b506127109102611388010490565b8082038281111561203257600080fd5b6040517f23b872dd0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8581166004840152841660248301526044820183905290600080606483828a5af16124f3573d6000803e3d6000fd5b506124fd85611e35565b6110ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a206661696c6564207472616e7366657246726f6d0000000000000060448201526064016102ab565b73ffffffffffffffffffffffffffffffffffffffff8116811461038257600080fd5b60006020828403121561259757600080fd5b813561242e81612563565b60008083601f8401126125b457600080fd5b50813567ffffffffffffffff8111156125cc57600080fd5b6020830191508360208285010111156125e457600080fd5b9250929050565b6000806000806000806000806000898b0361018081121561260b57600080fd5b8a3561261681612563565b995060208b013561262681612563565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b013567ffffffffffffffff81111561265e57600080fd5b61266a8d828e016125a2565b90955093505060a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20820112156126a057600080fd5b5060e08a0190509295985092959850929598565b60008083601f8401126126c657600080fd5b50813567ffffffffffffffff8111156126de57600080fd5b6020830191508360208260051b85010111156125e457600080fd5b600080600080600080600080600060a08a8c03121561271757600080fd5b893567ffffffffffffffff8082111561272f57600080fd5b61273b8d838e016126b4565b909b50995060208c013591508082111561275457600080fd5b6127608d838e016126b4565b909950975060408c013591508082111561277957600080fd5b6127858d838e016126b4565b909750955060608c0135915061279a82612563565b90935060808b013590808211156127b057600080fd5b506127bd8c828d016125a2565b915080935050809150509295985092959850929598565b6000602082840312156127e657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516101e0810167ffffffffffffffff81118282101715612840576128406127ed565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561288d5761288d6127ed565b604052919050565b60ff8116811461038257600080fd5b600060a082840312156128b657600080fd5b60405160a0810181811067ffffffffffffffff821117156128d9576128d96127ed565b8060405250809150823581526020830135602082015260408301356128fd81612895565b8060408301525060608301356060820152608083013560808201525092915050565b600060a0828403121561293157600080fd5b61242e83836128a4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561297c5761297c61293b565b500390565b60006020828403121561299357600080fd5b8151801515811461242e57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600067ffffffffffffffff821115612a1b57612a1b6127ed565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60005b83811015612a62578181015183820152602001612a4a565b83811115610eb55750506000910152565b60008060408385031215612a8657600080fd5b825167ffffffffffffffff811115612a9d57600080fd5b8301601f81018513612aae57600080fd5b8051612ac1612abc82612a01565b612846565b818152866020838501011115612ad657600080fd5b612ae7826020830160208601612a47565b8094505050506020830151612afb81612563565b809150509250929050565b600181815b80851115612b5f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612b4557612b4561293b565b80851615612b5257918102915b93841c9390800290612b0b565b509250929050565b600082612b7657506001612032565b81612b8357506000612032565b8160018114612b995760028114612ba357612bbf565b6001915050612032565b60ff841115612bb457612bb461293b565b50506001821b612032565b5060208310610133831016604e8410600b8410161715612be2575081810a612032565b612bec8383612b06565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612c1e57612c1e61293b565b029392505050565b600061242e8383612b67565b8051612c3d81612563565b919050565b600060208284031215612c5457600080fd5b815161242e81612563565b60008251612c71818460208701612a47565b9190910192915050565b6000806000806000806101408789031215612c9557600080fd5b8635612ca081612563565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff811115612cd157600080fd5b8701601f81018913612ce257600080fd5b8035612cf0612abc82612a01565b8181528a6020838501011115612d0557600080fd5b81602084016020830137600060208383010152809450505050612d2b8860a089016128a4565b90509295509295509295565b600060208284031215612d4957600080fd5b6040516020810181811067ffffffffffffffff82111715612d6c57612d6c6127ed565b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114612c3d57600080fd5b805164ffffffffff81168114612c3d57600080fd5b805161ffff81168114612c3d57600080fd5b60006101e08284031215612dd357600080fd5b612ddb61281c565b612de58484612d37565b8152612df360208401612d79565b6020820152612e0460408401612d79565b6040820152612e1560608401612d79565b6060820152612e2660808401612d79565b6080820152612e3760a08401612d79565b60a0820152612e4860c08401612d99565b60c0820152612e5960e08401612dae565b60e0820152610100612e6c818501612c32565b90820152610120612e7e848201612c32565b90820152610140612e90848201612c32565b90820152610160612ea2848201612c32565b90820152610180612eb4848201612d79565b908201526101a0612ec6848201612d79565b908201526101c0612ed8848201612d79565b908201529392505050565b600060208284031215612ef557600080fd5b815161242e81612895565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612f65577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea26469706673582212201ae79dd35f34ecf1387bee8e87022a83fa61b3a7ba8b1ecade15267edadaceb264736f6c634300080a0033";class xt extends p.lV{constructor(e){super(vt,wt,e)}deploy(e,t,n){return super.deploy(e,t,n||{})}getDeployTransaction(e,t,n){return super.getDeployTransaction(e,t,n||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static createInterface(){return new Ne.vU(vt)}static connect(e,t){return new p.CH(e,vt,t)}}xt.bytecode=wt,xt.abi=vt;class At extends c.Z{constructor(e,t){super(e,xt),this.repayWithCollateralAddress=null!==t&&void 0!==t?t:"",this.swapAndRepay=this.swapAndRepay.bind(this)}swapAndRepay({collateralAsset:e,debtAsset:t,collateralAmount:n,debtRepayAmount:r,debtRateMode:i,repayAll:o,permitParams:s,swapAndRepayCallData:a,user:c,augustus:d},f){const p=i===u.tk.Stable?1:2,h=this.getContractInstance(this.repayWithCollateralAddress),m=ft.$.encode(["bytes","address"],[a,d]),g=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.swapAndRepay(e,t,n,r,p,o?(0,l.mz)(a):0,m,s),from:c});return{tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(null!==f&&void 0!==f?f:[],g,u.UQ.repayCollateral)}}}(0,a.__decorate)([d.mB,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("collateralAsset")),(0,a.__param)(0,(0,f.Oh)("debtAsset")),(0,a.__param)(0,(0,f.K5)("collateralAmount")),(0,a.__param)(0,(0,f.K5)("debtRepayAmount")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Object)],At.prototype,"swapAndRepay",null);var Et=n(84707),_t=n(91747);const kt=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"backer",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"fee",type:"uint256"}],name:"BackUnbacked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!1,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"onBehalfOf",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"enum DataTypes.InterestRateMode",name:"interestRateMode",type:"uint8"},{indexed:!1,internalType:"uint256",name:"borrowRate",type:"uint256"},{indexed:!0,internalType:"uint16",name:"referral",type:"uint16"}],name:"Borrow",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"target",type:"address"},{indexed:!0,internalType:"address",name:"initiator",type:"address"},{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"enum DataTypes.InterestRateMode",name:"interestRateMode",type:"uint8"},{indexed:!1,internalType:"uint256",name:"premium",type:"uint256"},{indexed:!1,internalType:"uint16",name:"referralCode",type:"uint16"}],name:"FlashLoan",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"totalDebt",type:"uint256"}],name:"IsolationModeTotalDebtUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"collateralAsset",type:"address"},{indexed:!0,internalType:"address",name:"debtAsset",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint256",name:"debtToCover",type:"uint256"},{indexed:!1,internalType:"uint256",name:"liquidatedCollateralAmount",type:"uint256"},{indexed:!1,internalType:"address",name:"liquidator",type:"address"},{indexed:!1,internalType:"bool",name:"receiveAToken",type:"bool"}],name:"LiquidationCall",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!1,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"onBehalfOf",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!0,internalType:"uint16",name:"referral",type:"uint16"}],name:"MintUnbacked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!1,internalType:"uint256",name:"amountMinted",type:"uint256"}],name:"MintedToTreasury",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"}],name:"RebalanceStableBorrowRate",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"repayer",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bool",name:"useATokens",type:"bool"}],name:"Repay",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!1,internalType:"uint256",name:"liquidityRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"stableBorrowRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"variableBorrowRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"liquidityIndex",type:"uint256"},{indexed:!1,internalType:"uint256",name:"variableBorrowIndex",type:"uint256"}],name:"ReserveDataUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"}],name:"ReserveUsedAsCollateralDisabled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"}],name:"ReserveUsedAsCollateralEnabled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!1,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"onBehalfOf",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!0,internalType:"uint16",name:"referralCode",type:"uint16"}],name:"Supply",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"enum DataTypes.InterestRateMode",name:"interestRateMode",type:"uint8"}],name:"SwapBorrowRateMode",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint8",name:"categoryId",type:"uint8"}],name:"UserEModeSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[],name:"ADDRESSES_PROVIDER",outputs:[{internalType:"contract IPoolAddressesProvider",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"BRIDGE_PROTOCOL_FEE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"FLASHLOAN_PREMIUM_TOTAL",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"FLASHLOAN_PREMIUM_TO_PROTOCOL",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_NUMBER_RESERVES",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_STABLE_RATE_BORROW_SIZE_PERCENT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"fee",type:"uint256"}],name:"backUnbacked",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"borrow",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint8",name:"id",type:"uint8"},{components:[{internalType:"uint16",name:"ltv",type:"uint16"},{internalType:"uint16",name:"liquidationThreshold",type:"uint16"},{internalType:"uint16",name:"liquidationBonus",type:"uint16"},{internalType:"address",name:"priceSource",type:"address"},{internalType:"string",name:"label",type:"string"}],internalType:"struct DataTypes.EModeCategory",name:"config",type:"tuple"}],name:"configureEModeCategory",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"deposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"dropReserve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"balanceFromBefore",type:"uint256"},{internalType:"uint256",name:"balanceToBefore",type:"uint256"}],name:"finalizeTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiverAddress",type:"address"},{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"uint256[]",name:"interestRateModes",type:"uint256[]"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"bytes",name:"params",type:"bytes"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"flashLoan",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiverAddress",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"params",type:"bytes"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"flashLoanSimple",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"getConfiguration",outputs:[{components:[{internalType:"uint256",name:"data",type:"uint256"}],internalType:"struct DataTypes.ReserveConfigurationMap",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint8",name:"id",type:"uint8"}],name:"getEModeCategoryData",outputs:[{components:[{internalType:"uint16",name:"ltv",type:"uint16"},{internalType:"uint16",name:"liquidationThreshold",type:"uint16"},{internalType:"uint16",name:"liquidationBonus",type:"uint16"},{internalType:"address",name:"priceSource",type:"address"},{internalType:"string",name:"label",type:"string"}],internalType:"struct DataTypes.EModeCategory",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"getReserveData",outputs:[{components:[{components:[{internalType:"uint256",name:"data",type:"uint256"}],internalType:"struct DataTypes.ReserveConfigurationMap",name:"configuration",type:"tuple"},{internalType:"uint128",name:"liquidityIndex",type:"uint128"},{internalType:"uint128",name:"currentLiquidityRate",type:"uint128"},{internalType:"uint128",name:"variableBorrowIndex",type:"uint128"},{internalType:"uint128",name:"currentVariableBorrowRate",type:"uint128"},{internalType:"uint128",name:"currentStableBorrowRate",type:"uint128"},{internalType:"uint40",name:"lastUpdateTimestamp",type:"uint40"},{internalType:"uint16",name:"id",type:"uint16"},{internalType:"address",name:"aTokenAddress",type:"address"},{internalType:"address",name:"stableDebtTokenAddress",type:"address"},{internalType:"address",name:"variableDebtTokenAddress",type:"address"},{internalType:"address",name:"interestRateStrategyAddress",type:"address"},{internalType:"uint128",name:"accruedToTreasury",type:"uint128"},{internalType:"uint128",name:"unbacked",type:"uint128"},{internalType:"uint128",name:"isolationModeTotalDebt",type:"uint128"}],internalType:"struct DataTypes.ReserveData",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"getReserveNormalizedIncome",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"getReserveNormalizedVariableDebt",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getReservesList",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserAccountData",outputs:[{internalType:"uint256",name:"totalCollateralBase",type:"uint256"},{internalType:"uint256",name:"totalDebtBase",type:"uint256"},{internalType:"uint256",name:"availableBorrowsBase",type:"uint256"},{internalType:"uint256",name:"currentLiquidationThreshold",type:"uint256"},{internalType:"uint256",name:"ltv",type:"uint256"},{internalType:"uint256",name:"healthFactor",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserConfiguration",outputs:[{components:[{internalType:"uint256",name:"data",type:"uint256"}],internalType:"struct DataTypes.UserConfigurationMap",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserEMode",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"aTokenAddress",type:"address"},{internalType:"address",name:"stableDebtAddress",type:"address"},{internalType:"address",name:"variableDebtAddress",type:"address"},{internalType:"address",name:"interestRateStrategyAddress",type:"address"}],name:"initReserve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"collateralAsset",type:"address"},{internalType:"address",name:"debtAsset",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"debtToCover",type:"uint256"},{internalType:"bool",name:"receiveAToken",type:"bool"}],name:"liquidationCall",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"}],name:"mintToTreasury",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"mintUnbacked",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"rebalanceStableBorrowRate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"repay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"}],name:"repayWithATokens",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"permitV",type:"uint8"},{internalType:"bytes32",name:"permitR",type:"bytes32"},{internalType:"bytes32",name:"permitS",type:"bytes32"}],name:"repayWithPermit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"configuration",type:"uint256"}],name:"setConfiguration",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"rateStrategyAddress",type:"address"}],name:"setReserveInterestRateStrategyAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint8",name:"categoryId",type:"uint8"}],name:"setUserEMode",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"bool",name:"useAsCollateral",type:"bool"}],name:"setUserUseReserveAsCollateral",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"supply",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"permitV",type:"uint8"},{internalType:"bytes32",name:"permitR",type:"bytes32"},{internalType:"bytes32",name:"permitS",type:"bytes32"}],name:"supplyWithPermit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"interestRateMode",type:"uint256"}],name:"swapBorrowRateMode",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"bridgeProtocolFee",type:"uint256"}],name:"updateBridgeProtocolFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"flashLoanPremiumTotal",type:"uint256"},{internalType:"uint256",name:"flashLoanPremiumToProtocol",type:"uint256"}],name:"updateFlashloanPremiums",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"to",type:"address"}],name:"withdraw",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"}];class Tt{static createInterface(){return new Ne.vU(kt)}static connect(e,t){return new p.CH(e,kt,t)}}Tt.abi=kt;const St=[{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"borrow",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args1",type:"bytes32"},{internalType:"bytes32",name:"args2",type:"bytes32"}],name:"liquidationCall",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"rebalanceStableBorrowRate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"repay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"repayWithATokens",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"repayWithPermit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"setUserUseReserveAsCollateral",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"supply",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"supplyWithPermit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"swapBorrowRateMode",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}];class Ct{static createInterface(){return new Ne.vU(St)}static connect(e,t){return new p.CH(e,St,t)}}Ct.abi=St;const It=[{inputs:[{internalType:"contract IPool",name:"pool",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"POOL",outputs:[{internalType:"contract IPool",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"encodeBorrowParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"collateralAsset",type:"address"},{internalType:"address",name:"debtAsset",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"debtToCover",type:"uint256"},{internalType:"bool",name:"receiveAToken",type:"bool"}],name:"encodeLiquidationCall",outputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"encodeRebalanceStableBorrowRate",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"}],name:"encodeRepayParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"}],name:"encodeRepayWithATokensParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"permitV",type:"uint8"},{internalType:"bytes32",name:"permitR",type:"bytes32"},{internalType:"bytes32",name:"permitS",type:"bytes32"}],name:"encodeRepayWithPermitParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"bool",name:"useAsCollateral",type:"bool"}],name:"encodeSetUserUseReserveAsCollateral",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"encodeSupplyParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"permitV",type:"uint8"},{internalType:"bytes32",name:"permitR",type:"bytes32"},{internalType:"bytes32",name:"permitS",type:"bytes32"}],name:"encodeSupplyWithPermitParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"interestRateMode",type:"uint256"}],name:"encodeSwapBorrowRateMode",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"encodeWithdrawParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"}],Ot="0x60a060405234801561001057600080fd5b5060405161143138038061143183398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516113606100d16000396000818161016b0152818161027e015281816103760152818161043f015281816105180152818161062e0152818161073c015281816107fc0152818161094101528181610a700152610b5501526113606000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806388d5185211610081578063b76398e41161005b578063b76398e414610200578063fc0eed8514610213578063fed63a931461022157600080fd5b806388d51852146101b25780638da7fb18146101da5780639d2ffc1b146101ed57600080fd5b80635cc7bc10116100b25780635cc7bc1014610125578063671a7fae146101385780637535d2461461016657600080fd5b80631a64acf2146100d95780631a8f6dee146100ff5780631fd3479714610112575b600080fd5b6100ec6100e7366004610e66565b610234565b6040519081526020015b60405180910390f35b6100ec61010d366004610eb0565b61032c565b6100ec610120366004610ee9565b6103f5565b6100ec610133366004610ee9565b6104ce565b61014b610146366004610f2b565b6105e0565b604080519384526020840192909252908201526060016100f6565b61018d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f6565b6101c56101c0366004610fa9565b6106f0565b604080519283526020830191909152016100f6565b6100ec6101e836600461100d565b6108e2565b6100ec6101fb36600461100d565b6108f7565b6100ec61020e366004611042565b610a26565b6100ec61010d366004611084565b61014b61022f3660046110b9565b610b07565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff858116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ea9190611207565b60e081015190915060006102fd87610c5d565b9050600061030a87610d08565b60109290921b60909290921b60989690961b9590950101019695505050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa1580156103be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e29190611207565b60e00151601084901b0191505092915050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610487573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ab9190611207565b60e081015190915060006104be85610d08565b60101b9190910195945050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105849190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85146105c3576105be85610c5d565b6104be565b5071ffffffffffffffffffffffffffffffff000001949350505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301526000918291829182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069a9190611207565b60e081015190915060006106ad8c610c5d565b905060006106ba8b610d9b565b905060008a60c01b8260a01b018d60901b018360101b0184019050808a8a97509750975050505050509750975097945050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152600091829182917f0000000000000000000000000000000000000000000000000000000000000000909116906335ea6a75906024016101e060405180830381865afa158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa9190611207565b60e08101516040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015292935090916000917f0000000000000000000000000000000000000000000000000000000000000000909116906335ea6a75906024016101e060405180830381865afa158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a9190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff89146108a9576108a489610c5d565b6108bb565b6fffffffffffffffffffffffffffffffff5b60109290921b9390930160208a901b019550608087901b0193505050509550959350505050565b60006108ef8484846108f7565b949350505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ad9190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86146109ec576109e786610c5d565b6109fe565b6fffffffffffffffffffffffffffffffff5b90506000610a0b86610d08565b60901b60109290921b91909101919091019695505050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610ab8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610adc9190611207565b60e08101519091506000610aef86610c5d565b60101b609086901b0191909101925050509392505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301526000918291829182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610b9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc19190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8c14610c0057610bfb8c610c5d565b610c12565b6fffffffffffffffffffffffffffffffff5b90506000610c1f8c610d08565b90506000610c2c8c610d9b565b60b89b909b1b60989b909b1b9a909a0160909190911b0160109190911b01019b959a50939850939650505050505050565b60006fffffffffffffffffffffffffffffffff821115610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f323820626974730000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5090565b600060ff821115610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203860448201527f20626974730000000000000000000000000000000000000000000000000000006064820152608401610cfb565b600063ffffffff821115610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610cfb565b73ffffffffffffffffffffffffffffffffffffffff81168114610e5357600080fd5b50565b61ffff81168114610e5357600080fd5b60008060008060808587031215610e7c57600080fd5b8435610e8781610e31565b935060208501359250604085013591506060850135610ea581610e56565b939692955090935050565b60008060408385031215610ec357600080fd5b8235610ece81610e31565b91506020830135610ede81610e31565b809150509250929050565b60008060408385031215610efc57600080fd5b8235610f0781610e31565b946020939093013593505050565b803560ff81168114610f2657600080fd5b919050565b600080600080600080600060e0888a031215610f4657600080fd5b8735610f5181610e31565b9650602088013595506040880135610f6881610e56565b945060608801359350610f7d60808901610f15565b925060a0880135915060c0880135905092959891949750929550565b80358015158114610f2657600080fd5b600080600080600060a08688031215610fc157600080fd5b8535610fcc81610e31565b94506020860135610fdc81610e31565b93506040860135610fec81610e31565b92506060860135915061100160808701610f99565b90509295509295909350565b60008060006060848603121561102257600080fd5b833561102d81610e31565b95602085013595506040909401359392505050565b60008060006060848603121561105757600080fd5b833561106281610e31565b925060208401359150604084013561107981610e56565b809150509250925092565b6000806040838503121561109757600080fd5b82356110a281610e31565b91506110b060208401610f99565b90509250929050565b600080600080600080600060e0888a0312156110d457600080fd5b87356110df81610e31565b9650602088013595506040880135945060608801359350610f7d60808901610f15565b6040516101e0810167ffffffffffffffff8111828210171561114d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b60006020828403121561116557600080fd5b6040516020810181811067ffffffffffffffff821117156111af577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114610f2657600080fd5b805164ffffffffff81168114610f2657600080fd5b8051610f2681610e56565b8051610f2681610e31565b60006101e0828403121561121a57600080fd5b611222611102565b61122c8484611153565b815261123a602084016111bc565b602082015261124b604084016111bc565b604082015261125c606084016111bc565b606082015261126d608084016111bc565b608082015261127e60a084016111bc565b60a082015261128f60c084016111dc565b60c08201526112a060e084016111f1565b60e08201526101006112b38185016111fc565b908201526101206112c58482016111fc565b908201526101406112d78482016111fc565b908201526101606112e98482016111fc565b908201526101806112fb8482016111bc565b908201526101a061130d8482016111bc565b908201526101c061131f8482016111bc565b90820152939250505056fea2646970667358221220550a5d1ca13779d56fd6a3f9cf5cee982d93d61310d74a95690bcec9ee75ab4a64736f6c634300080a0033";class Rt extends p.lV{constructor(...e){1===e.length?super(It,Ot,e[0]):super(...e)}deploy(e,t){return super.deploy(e,t||{})}getDeployTransaction(e,t){return super.getDeployTransaction(e,t||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static createInterface(){return new Ne.vU(It)}static connect(e,t){return new p.CH(e,It,t)}}Rt.bytecode=Ot,Rt.abi=It;class Dt extends c.Z{constructor(e,t){super(e,Ct);const{l2PoolAddress:n,encoderAddress:r}=null!==t&&void 0!==t?t:{};this.l2PoolAddress=null!==n&&void 0!==n?n:"",this.encoderAddress=null!==r&&void 0!==r?r:"",this.encoderInterface=Rt.createInterface(),this.l2PoolContractInstance=Ct.createInterface(),this.poolContractInstance=Tt.createInterface(),this.generateSupplyTxData=({user:e,reserve:t,onBehalfOf:n,amount:r,referralCode:i})=>{const o={},s=this.poolContractInstance.encodeFunctionData("supply",[t,r,null!==n&&void 0!==n?n:e,null!==i&&void 0!==i?i:"0"]);return o.to=this.l2PoolAddress,o.from=e,o.data=s,o},this.generateBorrowTxData=({user:e,reserve:t,amount:n,numericRateMode:r,referralCode:i,onBehalfOf:o})=>{const s={},a=this.poolContractInstance.encodeFunctionData("borrow",[t,n,r,null!==i&&void 0!==i?i:"0",null!==o&&void 0!==o?o:e]);return s.to=this.l2PoolAddress,s.from=e,s.data=a,s.gasLimit=_t.O$.from(l.eB[u.UQ.borrow].limit),s},this.generateSupplyWithPermitTxData=({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i,deadline:o,permitR:s,permitS:a,permitV:c})=>{const u={},l=this.poolContractInstance.encodeFunctionData("supplyWithPermit",[t,n,null!==r&&void 0!==r?r:e,null!==i&&void 0!==i?i:"0",o,c,s,a]);return u.to=this.l2PoolAddress,u.from=e,u.data=l,u},this.generateEncodedSupplyTxData=({encodedTxData:e,user:t})=>{const n={},r=this.l2PoolContractInstance.encodeFunctionData("supply",[e]);return n.to=this.l2PoolAddress,n.data=r,n.from=t,n.gasLimit=_t.O$.from(l.eB[u.UQ.supply].limit),n},this.generateEncodedBorrowTxData=({encodedTxData:e,user:t})=>{const n={},r=this.l2PoolContractInstance.encodeFunctionData("borrow",[e]);return n.to=this.l2PoolAddress,n.data=r,n.from=t,n.gasLimit=_t.O$.from(l.eB[u.UQ.borrow].limit),n},this.generateEncodedSupplyWithPermitTxData=({encodedTxData:e,signature:t,user:n})=>{const r={},i=(0,Me.splitSignature)(t),o=this.l2PoolContractInstance.encodeFunctionData("supplyWithPermit",[e,i.r,i.s]);return r.to=this.l2PoolAddress,r.data=o,r.from=n,r.gasLimit=_t.O$.from(l.eB[u.UQ.supplyWithPermit].limit),r}}async supply({user:e,reserve:t,amount:n,referralCode:r},i){const o=this.getEncoder(),s=await o.encodeSupplyParams(t,n,null!==r&&void 0!==r?r:0),a=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.supply(s),from:e,value:(0,l.oC)(t,n)});return i.push({tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(i,c,u.UQ.supply)}),i}async supplyWithPermit({user:e,reserve:t,amount:n,deadline:r,referralCode:i,permitR:o,permitS:s,permitV:a},c){const l=this.getEncoder(),d=await l.encodeSupplyWithPermitParams(t,n,null!==i&&void 0!==i?i:0,r,a,o,s),f=this.getContractInstance(this.l2PoolAddress),p=this.generateTxCallback({rawTxMethod:async()=>f.populateTransaction.supplyWithPermit(d[0],o,s),from:e});return c.push({tx:p,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,p)}),c}async withdraw({user:e,reserve:t,amount:n}){const r=this.getEncoder(),i=await r.encodeWithdrawParams(t,n),o=this.getContractInstance(this.l2PoolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.withdraw(i),from:e,action:u.UQ.withdraw});return[{tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],s,u.UQ.supply)}]}async borrow({user:e,reserve:t,amount:n,numericRateMode:r,referralCode:i}){const o=this.getEncoder(),s=await o.encodeBorrowParams(t,n,r,null!==i&&void 0!==i?i:0),a=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.borrow(s),from:e});return[{tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],c)}]}async repay({reserve:e,user:t,amount:n,numericRateMode:r},i){const o=this.getEncoder(),s=await o.encodeRepayParams(e,n,r),a=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.repay(s),from:t,value:(0,l.oC)(e,n)});return i.push({tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(i,c,u.UQ.repay)}),i}async repayWithPermit({user:e,reserve:t,amount:n,numericRateMode:r,permitR:i,permitS:o,permitV:s,deadline:a},c){const d=this.getEncoder(),f=await d.encodeRepayWithPermitParams(t,n,r,a,s,i,o),p=this.getContractInstance(this.l2PoolAddress),h=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.repayWithPermit(f[0],i,o),from:e,value:(0,l.oC)(t,n)});return c.push({tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,h,u.UQ.repay)}),c}async repayWithATokens({reserve:e,user:t,amount:n,numericRateMode:r},i){const o=this.getEncoder(),s=await o.encodeRepayWithATokensParams(e,n,r),a=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.repayWithATokens(s),from:t,value:(0,l.oC)(e,n)});return i.push({tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(i,c,u.UQ.repay)}),i}async swapBorrowRateMode({reserve:e,numericRateMode:t,user:n}){const r=this.getEncoder(),i=await r.encodeSwapBorrowRateMode(e,t),o=this.getContractInstance(this.l2PoolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.swapBorrowRateMode(i),from:n});return[{tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],s)}]}async setUserUseReserveAsCollateral({reserve:e,usageAsCollateral:t,user:n}){const r=this.getEncoder(),i=await r.encodeSetUserUseReserveAsCollateral(e,t),o=this.getContractInstance(this.l2PoolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.setUserUseReserveAsCollateral(i),from:n});return[{tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],s)}]}async liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,debtToCover:i,getAToken:o},s){const a=this.getEncoder(),c=await a.encodeLiquidationCall(r,n,t,i,null!==o&&void 0!==o&&o),d=this.getContractInstance(this.l2PoolAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.liquidationCall(c[0],c[1]),from:e,value:(0,l.oC)(n,i)});return s.push({tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],f,u.UQ.liquidationCall)}),s}getEncoder(){return this.encoderContract||""===this.encoderAddress||(this.encoderContract=Rt.connect(this.encoderAddress,this.provider)),this.encoderContract}}(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"supply",null),(0,a.__decorate)([d.pv,(0,a.__param)(0,(0,f.f1)("deadline")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"supplyWithPermit",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"withdraw",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"borrow",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"repay",null),(0,a.__decorate)([d.pv,(0,a.__param)(0,(0,f.f1)("deadline")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"repayWithPermit",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"repayWithATokens",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"swapBorrowRateMode",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"setUserUseReserveAsCollateral",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"liquidationCall",null);var Pt=n(59386);class Bt{static connect(e,t){return new p.CH(e,Mt,t)}static createInterface(){return new Ne.vU(Mt)}}const Mt=[{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approveDelegation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"fromUser",type:"address"},{internalType:"address",name:"toUser",type:"address"}],name:"borrowAllowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}];class Nt extends c.Z{constructor(e,t){super(e,Bt),this.erc20Service=t,this.debtTokenInterface=Bt.createInterface()}approveDelegation({user:e,delegatee:t,debtTokenAddress:n,amount:r}){const i=this.getContractInstance(n),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.approveDelegation(t,r),from:e});return{tx:o,txType:u.ns.ERC20_APPROVAL,gas:this.generateTxPriceEstimation([],o)}}async approvedDelegationAmount({user:e,delegatee:t,debtTokenAddress:n}){const r=this.getContractInstance(n),i=await r.borrowAllowance(e,t),o=await this.erc20Service.decimalsOf(n);return Number(Pt.formatUnits(i,o))}generateApproveDelegationTxData({user:e,delegatee:t,debtTokenAddress:n,amount:r}){return{data:this.debtTokenInterface.encodeFunctionData("approveDelegation",[t,r]),to:n,from:e,gasLimit:_t.O$.from(l.eB[u.UQ.creditDelegationApproval].recommended)}}async isDelegationApproved({debtTokenAddress:e,allowanceGiver:t,allowanceReceiver:n,amount:r,nativeDecimals:i}){const o=await this.erc20Service.decimalsOf(e),s=this.getContractInstance(e),a=await s.borrowAllowance(t,n),c=i?_t.O$.from(r):_t.O$.from((0,l.gU)(r,o));return a.gte(c)}}(0,a.__decorate)([d.EB,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("delegatee")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Object)],Nt.prototype,"approveDelegation",null),(0,a.__decorate)([d.EB,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("delegatee")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Nt.prototype,"approvedDelegationAmount",null),(0,a.__decorate)([d.EB,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("delegatee")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Object)],Nt.prototype,"generateApproveDelegationTxData",null),(0,a.__decorate)([d.EB,(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.Oh)("allowanceGiver")),(0,a.__param)(0,(0,f.Oh)("allowanceReceiver")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Nt.prototype,"isDelegationApproved",null);class Ft{static connect(e,t){return new p.CH(e,Lt,t)}static createInterface(){return new Ne.vU(Lt)}}const Lt=[{inputs:[{internalType:"address",name:"lendingPool",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interesRateMode",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"borrowETH",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"lendingPool",type:"address"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"depositETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"lendingPool",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"rateMode",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"repayETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"lendingPool",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"withdrawETH",outputs:[],stateMutability:"nonpayable",type:"function"}];class jt extends c.Z{constructor(e,t,n){super(e,Ft),this.erc20Service=t,this.baseDebtTokenService=new Nt(this.provider,this.erc20Service),this.wethGatewayAddress=null!==n&&void 0!==n?n:"",this.depositETH=this.depositETH.bind(this),this.withdrawETH=this.withdrawETH.bind(this),this.repayETH=this.repayETH.bind(this),this.borrowETH=this.borrowETH.bind(this),this.wethGatewayInstance=Ft.createInterface(),this.generateDepositEthTxData=e=>{var t,n;return{data:this.wethGatewayInstance.encodeFunctionData("depositETH",[e.lendingPool,null!==(t=e.onBehalfOf)&&void 0!==t?t:e.user,null!==(n=e.referralCode)&&void 0!==n?n:"0"]),to:this.wethGatewayAddress,from:e.user,value:_t.O$.from(e.amount),gasLimit:_t.O$.from(l.eB[u.UQ.deposit].limit)}},this.generateBorrowEthTxData=e=>{var t;const n=e.interestRateMode===u.tk.Variable?2:1;return{data:this.wethGatewayInstance.encodeFunctionData("borrowETH",[e.lendingPool,e.amount,n,null!==(t=e.referralCode)&&void 0!==t?t:"0"]),to:this.wethGatewayAddress,from:e.user,gasLimit:_t.O$.from(l.eB[u.UQ.borrowETH].limit)}}}depositETH({lendingPool:e,user:t,amount:n,onBehalfOf:r,referralCode:i}){const o=(0,l.gU)(n,18),s=this.getContractInstance(this.wethGatewayAddress),a=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.depositETH(e,null!==r&&void 0!==r?r:t,null!==i&&void 0!==i?i:"0"),from:t,value:o});return[{tx:a,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],a)}]}async borrowETH({lendingPool:e,user:t,amount:n,debtTokenAddress:r,interestRateMode:i,referralCode:o}){const s=[],a=(0,l.gU)(n,18),c=i===u.tk.Variable?2:1;if(!r)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");if(!(await this.baseDebtTokenService.isDelegationApproved({debtTokenAddress:r,allowanceGiver:t,allowanceReceiver:this.wethGatewayAddress,amount:n}))){const e=this.baseDebtTokenService.approveDelegation({user:t,delegatee:this.wethGatewayAddress,debtTokenAddress:r,amount:pt.Bz.toString()});s.push(e)}const d=this.getContractInstance(this.wethGatewayAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.borrowETH(e,a,c,null!==o&&void 0!==o?o:"0"),from:t});return s.push({tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(s,f,u.UQ.borrowETH)}),s}async withdrawETH({lendingPool:e,user:t,amount:n,onBehalfOf:r,aTokenAddress:i}){const o=[],{isApproved:s,approve:a}=this.erc20Service,c="-1"===n?pt.Bz.toString():(0,l.gU)(n,18);if(!(await s({token:i,user:t,spender:this.wethGatewayAddress,amount:n}))){const e=a({user:t,token:i,spender:this.wethGatewayAddress,amount:pt.Bz.toString()});o.push(e)}const d=this.getContractInstance(this.wethGatewayAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.withdrawETH(e,c,null!==r&&void 0!==r?r:t),from:t});return o.push({tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(o,f,u.UQ.withdrawETH)}),o}repayETH({lendingPool:e,user:t,amount:n,interestRateMode:r,onBehalfOf:i}){const o=(0,l.gU)(n,18),s=r===u.tk.Variable?2:1,a=this.getContractInstance(this.wethGatewayAddress),c=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.repayETH(e,o,s,null!==i&&void 0!==i?i:t),gasSurplus:30,from:t,value:o});return[{tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],c)}]}}(0,a.__decorate)([d.N,(0,a.__param)(0,(0,f.Oh)("lendingPool")),(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.rX)("referralCode")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],jt.prototype,"depositETH",null),(0,a.__decorate)([d.N,(0,a.__param)(0,(0,f.Oh)("lendingPool")),(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.rX)("referralCode")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],jt.prototype,"borrowETH",null),(0,a.__decorate)([d.N,(0,a.__param)(0,(0,f.Oh)("lendingPool")),(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("aTokenAddress")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],jt.prototype,"withdrawETH",null),(0,a.__decorate)([d.N,(0,a.__param)(0,(0,f.Oh)("lendingPool")),(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],jt.prototype,"repayETH",null);class Ut extends c.Z{constructor(e,t){super(e,Tt);const{POOL:n,FLASH_LIQUIDATION_ADAPTER:r,REPAY_WITH_COLLATERAL_ADAPTER:i,SWAP_COLLATERAL_ADAPTER:o,WETH_GATEWAY:s,L2_ENCODER:a}=null!==t&&void 0!==t?t:{};this.poolAddress=null!==n&&void 0!==n?n:"",this.flashLiquidationAddress=null!==r&&void 0!==r?r:"",this.swapCollateralAddress=null!==o&&void 0!==o?o:"",this.repayWithCollateralAddress=null!==i&&void 0!==i?i:"",this.l2EncoderAddress=null!==a&&void 0!==a?a:"",this.erc20_2612Service=new Ye(e),this.erc20Service=new ht.A(e),this.synthetixService=new Et.K(e),this.wethGatewayService=new jt(e,this.erc20Service,s),this.liquiditySwapAdapterService=new bt(e,o),this.paraswapRepayWithCollateralAdapterService=new At(e,i),this.l2PoolService=new Dt(e,{l2PoolAddress:this.poolAddress,encoderAddress:this.l2EncoderAddress})}async getReserveData(e){return this.getContractInstance(this.poolAddress).getReserveData(e)}async deposit({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.depositETH({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:r,referralCode:i});const{isApproved:o,approve:s,decimalsOf:a}=this.erc20Service,c=[],d=await a(t),f=(0,l.gU)(n,d);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:f})))throw new Error("Not enough funds to execute operation");if(!(await o({token:t,user:e,spender:this.poolAddress,amount:n}))){const n=s({user:e,token:t,spender:this.poolAddress,amount:l.zn});c.push(n)}const p=this.getContractInstance(this.poolAddress),h=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.deposit(t,f,null!==r&&void 0!==r?r:e,null!==i&&void 0!==i?i:"0"),from:e,value:(0,l.oC)(t,f),action:u.UQ.supply});return c.push({tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,h,u.UQ.supply)}),c}async supply({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i,useOptimizedPath:o}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.depositETH({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:r,referralCode:i});const{isApproved:s,approve:a,decimalsOf:c}=this.erc20Service,d=[],f=await c(t),p=(0,l.gU)(n,f);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:p})))throw new Error("Not enough funds to execute operation");if(!(await s({token:t,user:e,spender:this.poolAddress,amount:n}))){const n=a({user:e,token:t,spender:this.poolAddress,amount:l.zn});d.push(n)}const h=this.getContractInstance(this.poolAddress);if(o)return this.l2PoolService.supply({user:e,reserve:t,amount:p,referralCode:i},d);const m=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.supply(t,p,null!==r&&void 0!==r?r:e,null!==i&&void 0!==i?i:"0"),from:e,value:(0,l.oC)(t,p),action:u.UQ.supply});return d.push({tx:m,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(d,m,u.UQ.supply)}),d}async signERC20Approval({user:e,reserve:t,amount:n,deadline:r}){const{getTokenData:i,isApproved:o}=this.erc20Service,{name:s,decimals:a}=await i(t),c="-1"===n?pt.Bz.toString():(0,l.gU)(n,a);if(await o({token:t,user:e,spender:this.poolAddress,amount:n}))return"";const{chainId:u}=await this.provider.getNetwork(),d=await this.erc20_2612Service.getNonce({token:t,owner:e});if(null===d)return"";const f={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},primaryType:"Permit",domain:{name:s,version:"1",chainId:u,verifyingContract:t},message:{owner:e,spender:this.poolAddress,value:c,nonce:d,deadline:r}};return JSON.stringify(f)}async supplyWithPermit({user:e,reserve:t,onBehalfOf:n,amount:r,referralCode:i,signature:o,useOptimizedPath:s,deadline:a}){const c=[],{decimalsOf:d}=this.erc20Service,f=this.getContractInstance(this.poolAddress),p=await d(t),h=(0,l.gU)(r,p),m=(0,ze.splitSignature)(o);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:h})))throw new Error("Not enough funds to execute operation");if(s)return this.l2PoolService.supplyWithPermit({user:e,reserve:t,amount:h,referralCode:i,deadline:a,permitV:m.v,permitR:m.r,permitS:m.s},c);const g=this.generateTxCallback({rawTxMethod:async()=>f.populateTransaction.supplyWithPermit(t,h,null!==n&&void 0!==n?n:e,null!==i&&void 0!==i?i:0,a,m.v,m.r,m.s),from:e,action:u.UQ.supplyWithPermit});return c.push({tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,g,u.UQ.supplyWithPermit)}),c}async withdraw({user:e,reserve:t,amount:n,onBehalfOf:r,aTokenAddress:i,useOptimizedPath:o}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To withdraw ETH you need to pass the aWETH token address");return this.wethGatewayService.withdrawETH({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:r,aTokenAddress:i})}const{decimalsOf:s}=this.erc20Service,a=await s(t),c="-1"===n?pt.Bz.toString():(0,l.gU)(n,a);if(o)return this.l2PoolService.withdraw({user:e,reserve:t,amount:c});const d=this.getContractInstance(this.poolAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.withdraw(t,c,null!==r&&void 0!==r?r:e),from:e,action:u.UQ.withdraw});return[{tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],f,u.UQ.withdraw)}]}async borrow({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:i,onBehalfOf:o,referralCode:s,useOptimizedPath:a}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");return this.wethGatewayService.borrowETH({lendingPool:this.poolAddress,user:e,amount:n,debtTokenAddress:i,interestRateMode:r,referralCode:s})}const{decimalsOf:c}=this.erc20Service,d=await c(t),f=(0,l.gU)(n,d),p=r===u.tk.Variable?2:1;if(a)return this.l2PoolService.borrow({user:e,reserve:t,amount:f,numericRateMode:p,referralCode:s});const h=this.getContractInstance(this.poolAddress),m=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.borrow(t,f,p,null!==s&&void 0!==s?s:0,null!==o&&void 0!==o?o:e),from:e,action:u.UQ.borrow});return[{tx:m,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],m,u.UQ.borrow)}]}async repay({user:e,reserve:t,amount:n,interestRateMode:r,onBehalfOf:i,useOptimizedPath:o}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.repayETH({lendingPool:this.poolAddress,user:e,amount:n,interestRateMode:r,onBehalfOf:i});const s=[],{isApproved:a,approve:c,decimalsOf:d}=this.erc20Service,f=this.getContractInstance(this.poolAddress),{populateTransaction:p}=f,h=r===u.tk.Variable?2:1,m=await d(t),g="-1"===n?pt.Bz.toString():(0,l.gU)(n,m);if("-1"!==n){if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:g})))throw new Error("Not enough funds to execute operation")}if(!(await a({token:t,user:e,spender:this.poolAddress,amount:n}))){const n=c({user:e,token:t,spender:this.poolAddress,amount:l.zn});s.push(n)}if(o)return this.l2PoolService.repay({user:e,reserve:t,amount:g,numericRateMode:h},s);const y=this.generateTxCallback({rawTxMethod:async()=>p.repay(t,g,h,null!==i&&void 0!==i?i:e),from:e,value:(0,l.oC)(t,g),action:u.UQ.repay});return s.push({tx:y,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(s,y,u.UQ.repay)}),s}async repayWithPermit({user:e,reserve:t,amount:n,interestRateMode:r,onBehalfOf:i,signature:o,useOptimizedPath:s,deadline:a}){const c=[],{decimalsOf:d}=this.erc20Service,f=this.getContractInstance(this.poolAddress),{populateTransaction:p}=f,h=r===u.tk.Variable?2:1,m=await d(t),g=(0,ze.splitSignature)(o),y="-1"===n?pt.Bz.toString():(0,l.gU)(n,m);if("-1"!==n){if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:y})))throw new Error("Not enough funds to execute operation")}if(s)return this.l2PoolService.repayWithPermit({user:e,reserve:t,amount:y,numericRateMode:h,deadline:a,permitR:g.r,permitS:g.s,permitV:g.v},c);const b=this.generateTxCallback({rawTxMethod:async()=>p.repayWithPermit(t,y,h,null!==i&&void 0!==i?i:e,a,g.v,g.r,g.s),from:e,value:(0,l.oC)(t,y),action:u.UQ.repayWithPermit});return c.push({tx:b,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,b,u.UQ.repayWithPermit)}),c}async swapBorrowRateMode({user:e,reserve:t,interestRateMode:n,useOptimizedPath:r}){const i=n===u.tk.Variable?2:1;if(r)return this.l2PoolService.swapBorrowRateMode({user:e,reserve:t,numericRateMode:i});const o=this.getContractInstance(this.poolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.swapBorrowRateMode(t,i),from:e});return[{txType:u.ns.DLP_ACTION,tx:s,gas:this.generateTxPriceEstimation([],s)}]}async setUsageAsCollateral({user:e,reserve:t,usageAsCollateral:n,useOptimizedPath:r}){const i=this.getContractInstance(this.poolAddress);if(r)return this.l2PoolService.setUserUseReserveAsCollateral({user:e,reserve:t,usageAsCollateral:n});const o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.setUserUseReserveAsCollateral(t,n),from:e});return[{tx:o,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],o)}]}async liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,purchaseAmount:i,getAToken:o,liquidateAll:s,useOptimizedPath:a}){const c=[],{isApproved:d,approve:f,decimalsOf:p}=this.erc20Service;if(!(await d({token:n,user:e,spender:this.poolAddress,amount:i}))){const t=f({user:e,token:n,spender:this.poolAddress,amount:l.zn});c.push(t)}let h=pt.Bz.toString();if(!s){const e=await p(n);h=(0,l.gU)(i,e)}if(a)return this.l2PoolService.liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,debtToCover:h,getAToken:o},c);const m=this.getContractInstance(this.poolAddress),g=this.generateTxCallback({rawTxMethod:async()=>m.populateTransaction.liquidationCall(r,n,t,h,null!==o&&void 0!==o&&o),from:e,value:(0,l.oC)(n,h)});return c.push({tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,g,u.UQ.liquidationCall)}),c}async swapCollateral({user:e,flash:t,fromAsset:n,fromAToken:r,toAsset:i,fromAmount:o,minToAmount:s,permitSignature:a,swapAll:c,referralCode:d,augustus:f,swapCallData:p}){const h=[],m=null!==a&&void 0!==a?a:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:r,user:e,spender:this.swapCollateralAddress,amount:o}))){const t=this.erc20Service.approve({user:e,token:r,spender:this.swapCollateralAddress,amount:pt.Bz.toString()});h.push(t)}const g=await this.erc20Service.decimalsOf(n),y=(0,l.gU)(o,g),b=await this.erc20Service.decimalsOf(i),v=(0,l.gU)(s,b),w=this.getContractInstance(this.poolAddress);if(t){const t=((e,t,n,r,i,o,s,a,c,u)=>ft.$.encode(["address","uint256","uint256","bytes","address","tuple(uint256,uint256,uint8,bytes32,bytes32)"],[e,t,n,r,i,[o,s,a,c,u]]))(i,v,c?yt(p):0,p,f,m.amount,m.deadline,m.v,m.r,m.s),r=(Number(o)+Number(o)*Number(l.zp)/100).toString(),s=(0,l.gU)(r,g),a=this.generateTxCallback({rawTxMethod:async()=>w.populateTransaction.flashLoanSimple(this.swapCollateralAddress,n,c?s:y,t,null!==d&&void 0!==d?d:"0"),from:e,action:u.UQ.swapCollateral});return h.push({tx:a,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(h,a,u.UQ.swapCollateral)}),h}const x=this.liquiditySwapAdapterService.swapAndDeposit({user:e,assetToSwapFrom:n,assetToSwapTo:i,amountToSwap:y,minAmountToReceive:v,swapAll:c,swapCallData:p,augustus:f,permitParams:m},h);return h.push(x),h}async paraswapRepayWithCollateral({user:e,fromAsset:t,fromAToken:n,assetToRepay:r,repayWithAmount:i,repayAmount:o,permitSignature:s,repayAllDebt:a,rateMode:c,referralCode:d,flash:f,swapAndRepayCallData:p,augustus:h}){const m=[],g=null!==s&&void 0!==s?s:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:n,user:e,spender:this.repayWithCollateralAddress,amount:i}))){const t=this.erc20Service.approve({user:e,token:n,spender:this.repayWithCollateralAddress,amount:pt.Bz.toString()});m.push(t)}const y=await this.erc20Service.decimalsOf(t),b=(0,l.gU)(i,y),v=(Number(i)+Number(i)*Number(l.zp)/100).toString(),w=(0,l.gU)(v,y),x=await this.erc20Service.decimalsOf(r),A=(0,l.gU)(o,x),E=c===u.tk.Stable?1:2;if(f){const n=ft.$.encode(["bytes","address"],[p,h]),i=ft.$.encode(["address","uint256","uint256","uint256","bytes","uint256","uint256","uint8","bytes32","bytes32"],[r,A,a?(0,l.mz)(p):0,E,n,g.amount,g.deadline,g.v,g.r,g.s]),o=this.getContractInstance(this.poolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.flashLoanSimple(this.repayWithCollateralAddress,t,a?w:b,i,null!==d&&void 0!==d?d:"0"),from:e,action:u.UQ.repayCollateral});return m.push({tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(m,s,u.UQ.repayCollateral)}),m}const _=this.paraswapRepayWithCollateralAdapterService.swapAndRepay({user:e,collateralAsset:t,debtAsset:r,collateralAmount:b,debtRepayAmount:A,debtRateMode:c,permitParams:g,repayAll:null!==a&&void 0!==a&&a,swapAndRepayCallData:p,augustus:h},m);return m.push(_),m}async flashLiquidation({user:e,collateralAsset:t,borrowedAsset:n,debtTokenCover:r,liquidateAll:i,initiator:o,useEthPath:s}){const a=[],c=this.getContractInstance(this.poolAddress),d=await this.erc20Service.decimalsOf(n),f=(0,l.gU)(r,d),p=i?pt.Bz.toString():f,h=i?(0,l.gU)((m=r,(Number(m)+Number(m)*Number(m)/100).toString()),d):f;var m;const g=ft.$.encode(["address","address","address","uint256","bool"],[t,n,e,p,null!==s&&void 0!==s&&s]),y=this.generateTxCallback({rawTxMethod:async()=>c.populateTransaction.flashLoanSimple(this.flashLiquidationAddress,n,h,g,"0"),from:o});return a.push({tx:y,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(a,y,u.UQ.liquidationFlash)}),a}async repayWithATokens({user:e,amount:t,reserve:n,rateMode:r,useOptimizedPath:i}){if(n.toLowerCase()===l.hP.toLowerCase())throw new Error("Can not repay with aTokens with eth. Should be WETH instead");const o=[],{decimalsOf:s}=this.erc20Service,a=this.getContractInstance(this.poolAddress),{populateTransaction:c}=a,d=r===u.tk.Variable?2:1,f=await s(n),p="-1"===t?pt.Bz.toString():(0,l.gU)(t,f);if(i)return this.l2PoolService.repayWithATokens({user:e,reserve:n,amount:p,numericRateMode:d},o);const h=this.generateTxCallback({rawTxMethod:async()=>c.repayWithATokens(n,p,d),from:e,value:(0,l.oC)(n,p)});return o.push({tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(o,h,u.UQ.repay)}),o}setUserEMode({user:e,categoryId:t}){const n=this.getContractInstance(this.poolAddress),r=this.generateTxCallback({rawTxMethod:async()=>n.populateTransaction.setUserEMode(t),from:e});return[{tx:r,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],r,u.UQ.repay)}]}async migrateV3({migrator:e,borrowedAssets:t,borrowedAmounts:n,interestRatesModes:r,user:i,suppliedPositions:o,borrowedPositions:s,permits:a}){const c=this.getContractInstance(this.poolAddress),u=s.map((e=>[e.address,e.amount,e.rateMode.toString()])),l=a.map((e=>[e.aToken,e.value,e.deadline,e.v,e.r,e.s])),d=ft.$.encode(["address[]","(address, uint256, uint256)[]","(address, uint256, uint256, uint8, bytes32, bytes32)[]"],[o,u,l]);return c.populateTransaction.flashLoan(e,t,n,r,i,d,"0")}}(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[String]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"getReserveData",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"deposit",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"supply",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"signERC20Approval",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.K5)("referralCode")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"supplyWithPermit",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.Oh)("aTokenAddress")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"withdraw",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"borrow",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"repay",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"repayWithPermit",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"swapBorrowRateMode",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"setUsageAsCollateral",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("liquidator")),(0,a.__param)(0,(0,f.Oh)("liquidatedUser")),(0,a.__param)(0,(0,f.Oh)("debtReserve")),(0,a.__param)(0,(0,f.Oh)("collateralReserve")),(0,a.__param)(0,(0,f.K5)("purchaseAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"liquidationCall",null),(0,a.__decorate)([d.Gv,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("fromAsset")),(0,a.__param)(0,(0,f.Oh)("fromAToken")),(0,a.__param)(0,(0,f.Oh)("toAsset")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__param)(0,(0,f.K5)("fromAmount")),(0,a.__param)(0,(0,f.K5)("minToAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"swapCollateral",null),(0,a.__decorate)([d.M9,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("fromAsset")),(0,a.__param)(0,(0,f.Oh)("fromAToken")),(0,a.__param)(0,(0,f.Oh)("assetToRepay")),(0,a.__param)(0,(0,f.K5)("repayWithAmount")),(0,a.__param)(0,(0,f.K5)("repayAmount")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"paraswapRepayWithCollateral",null),(0,a.__decorate)([d.yZ,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("collateralAsset")),(0,a.__param)(0,(0,f.Oh)("borrowedAsset")),(0,a.__param)(0,(0,f.K5)("debtTokenCover")),(0,a.__param)(0,(0,f.Oh)("initiator")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"flashLiquidation",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"repayWithATokens",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.rX)("categoryId")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],Ut.prototype,"setUserEMode",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("migrator")),(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Gq)("borrowedAssets")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"migrateV3",null);class Zt{static connect(e,t){return new p.CH(e,Ht,t)}}const Ht=[{inputs:[{internalType:"address",name:"collateralAsset",type:"address"},{internalType:"address",name:"debtAsset",type:"address"},{internalType:"uint256",name:"collateralAmount",type:"uint256"},{internalType:"uint256",name:"debtRepayAmount",type:"uint256"},{internalType:"uint256",name:"debtRateMode",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct IRepayWithCollateral.PermitSignature",name:"permitSignature",type:"tuple"},{internalType:"bool",name:"useEthPath",type:"bool"}],name:"swapAndRepay",outputs:[],stateMutability:"nonpayable",type:"function"}];class zt extends c.Z{constructor(e,t){super(e,Zt),this.repayWithCollateralAddress=null!==t&&void 0!==t?t:"",this.swapAndRepay=this.swapAndRepay.bind(this)}swapAndRepay({user:e,collateralAsset:t,debtAsset:n,collateralAmount:r,debtRepayAmount:i,debtRateMode:o,permit:s,useEthPath:a},c){const l=o===u.tk.Stable?1:2,d=this.getContractInstance(this.repayWithCollateralAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.swapAndRepay(t,n,r,i,l,s,null!==a&&void 0!==a&&a),from:e});return{tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(null!==c&&void 0!==c?c:[],f,u.UQ.repayCollateral)}}}(0,a.__decorate)([d.mB,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("collateralAsset")),(0,a.__param)(0,(0,f.Oh)("debtAsset")),(0,a.__param)(0,(0,f.K5)("collateralAmount")),(0,a.__param)(0,(0,f.K5)("debtRepayAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Object)],zt.prototype,"swapAndRepay",null);class Gt{static connect(e,t){return new p.CH(e,Vt,t)}static createInterface(){return new Ne.vU(Vt)}}const Vt=[{inputs:[],name:"FLASHLOAN_PREMIUM_TOTAL",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"borrow",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"deposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"uint256[]",name:"modes",type:"uint256[]"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"bytes",name:"params",type:"bytes"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"flashLoan",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"collateral",type:"address"},{internalType:"address",name:"reserve",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"purchaseAmount",type:"uint256"},{internalType:"bool",name:"receiveAToken",type:"bool"}],name:"liquidationCall",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"rateMode",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"repay",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"bool",name:"useAsCollateral",type:"bool"}],name:"setUserUseReserveAsCollateral",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"uint256",name:"rateMode",type:"uint256"}],name:"swapBorrowRateMode",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"to",type:"address"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}];class Wt extends c.Z{constructor(e,t){super(e,Gt);const{LENDING_POOL:n,FLASH_LIQUIDATION_ADAPTER:r,REPAY_WITH_COLLATERAL_ADAPTER:i,SWAP_COLLATERAL_ADAPTER:o,WETH_GATEWAY:s}=null!==t&&void 0!==t?t:{};this.lendingPoolAddress=null!==n&&void 0!==n?n:"",this.flashLiquidationAddress=null!==r&&void 0!==r?r:"",this.swapCollateralAddress=null!==o&&void 0!==o?o:"",this.repayWithCollateralAddress=null!==i&&void 0!==i?i:"",this.erc20Service=new ht.A(e),this.synthetixService=new Et.K(e),this.wethGatewayService=new jt(e,this.erc20Service,s),this.liquiditySwapAdapterService=new bt(e,o),this.repayWithCollateralAdapterService=new zt(e,i),this.paraswapRepayWithCollateralAdapterService=new At(e,i)}async deposit({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.depositETH({lendingPool:this.lendingPoolAddress,user:e,amount:n,onBehalfOf:r,referralCode:i});const{isApproved:o,approve:s,decimalsOf:a}=this.erc20Service,c=[],d=await a(t),f=(0,l.gU)(n,d);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:f})))throw new Error("Not enough funds to execute operation");if(!(await o({token:t,user:e,spender:this.lendingPoolAddress,amount:n}))){const n=s({user:e,token:t,spender:this.lendingPoolAddress,amount:l.zn});c.push(n)}const p=this.getContractInstance(this.lendingPoolAddress),h=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.deposit(t,f,null!==r&&void 0!==r?r:e,null!==i&&void 0!==i?i:"0"),from:e,value:(0,l.oC)(t,f),action:u.UQ.deposit});return c.push({tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,h,u.UQ.deposit)}),c}async withdraw({user:e,reserve:t,amount:n,onBehalfOf:r,aTokenAddress:i}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To withdraw ETH you need to pass the aWETH token address");return this.wethGatewayService.withdrawETH({lendingPool:this.lendingPoolAddress,user:e,amount:n,onBehalfOf:r,aTokenAddress:i})}const{decimalsOf:o}=this.erc20Service,s=await o(t),a="-1"===n?pt.Bz.toString():(0,l.gU)(n,s),c=this.getContractInstance(this.lendingPoolAddress),d=this.generateTxCallback({rawTxMethod:async()=>c.populateTransaction.withdraw(t,a,null!==r&&void 0!==r?r:e),from:e,action:u.UQ.withdraw});return[{tx:d,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],d,u.UQ.withdraw)}]}async borrow({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:i,onBehalfOf:o,referralCode:s}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");return this.wethGatewayService.borrowETH({lendingPool:this.lendingPoolAddress,user:e,amount:n,debtTokenAddress:i,interestRateMode:r,referralCode:s})}const{decimalsOf:a}=this.erc20Service,c=await a(t),d=(0,l.gU)(n,c),f=r===u.tk.Variable?2:1,p=this.getContractInstance(this.lendingPoolAddress),h=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.borrow(t,d,f,null!==s&&void 0!==s?s:0,null!==o&&void 0!==o?o:e),from:e,action:u.UQ.borrow});return[{tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],h,u.UQ.borrow)}]}async repay({user:e,reserve:t,amount:n,interestRateMode:r,onBehalfOf:i}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.repayETH({lendingPool:this.lendingPoolAddress,user:e,amount:n,interestRateMode:r,onBehalfOf:i});const o=[],{isApproved:s,approve:a,decimalsOf:c}=this.erc20Service,d=this.getContractInstance(this.lendingPoolAddress),{populateTransaction:f}=d,p=r===u.tk.Variable?2:1,h=await c(t),m="-1"===n?pt.Bz.toString():(0,l.gU)(n,h);if("-1"!==n){if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:m})))throw new Error("Not enough funds to execute operation")}if(!(await s({token:t,user:e,spender:this.lendingPoolAddress,amount:n}))){const n=a({user:e,token:t,spender:this.lendingPoolAddress,amount:l.zn});o.push(n)}const g=this.generateTxCallback({rawTxMethod:async()=>f.repay(t,m,p,null!==i&&void 0!==i?i:e),from:e,value:(0,l.oC)(t,m),action:u.UQ.repay});return o.push({tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(o,g,u.UQ.repay)}),o}swapBorrowRateMode({user:e,reserve:t,interestRateMode:n}){const r=n===u.tk.Variable?2:1,i=this.getContractInstance(this.lendingPoolAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.swapBorrowRateMode(t,r),from:e});return[{txType:u.ns.DLP_ACTION,tx:o,gas:this.generateTxPriceEstimation([],o)}]}setUsageAsCollateral({user:e,reserve:t,usageAsCollateral:n}){const r=this.getContractInstance(this.lendingPoolAddress),i=this.generateTxCallback({rawTxMethod:async()=>r.populateTransaction.setUserUseReserveAsCollateral(t,n),from:e,action:u.UQ.setUsageAsCollateral});return[{tx:i,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],i,u.UQ.setUsageAsCollateral)}]}async liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,purchaseAmount:i,getAToken:o,liquidateAll:s}){const a=[],{isApproved:c,approve:d,decimalsOf:f}=this.erc20Service;if(!(await c({token:n,user:e,spender:this.lendingPoolAddress,amount:i}))){const t=d({user:e,token:n,spender:this.lendingPoolAddress,amount:l.zn});a.push(t)}let p=pt.Bz.toString();if(!s){const e=await f(n);p=(0,l.gU)(i,e)}const h=this.getContractInstance(this.lendingPoolAddress),m=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.liquidationCall(r,n,t,p,null!==o&&void 0!==o&&o),from:e,value:(0,l.oC)(n,p)});return a.push({tx:m,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(a,m,u.UQ.liquidationCall)}),a}async swapCollateral({user:e,flash:t,fromAsset:n,fromAToken:r,toAsset:i,fromAmount:o,minToAmount:s,permitSignature:a,swapAll:c,onBehalfOf:d,referralCode:f,augustus:p,swapCallData:h}){const m=[],g=null!==a&&void 0!==a?a:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:r,user:e,spender:this.swapCollateralAddress,amount:o}))){const t=this.erc20Service.approve({user:e,token:r,spender:this.swapCollateralAddress,amount:pt.Bz.toString()});m.push(t)}const y=await this.erc20Service.decimalsOf(n),b=(0,l.gU)(o,y),v=await this.erc20Service.decimalsOf(i),w=(0,l.gU)(s,v),x=this.getContractInstance(this.lendingPoolAddress);if(t){const t=((e,t,n,r,i,o,s,a,c,u)=>ft.$.encode(["address","uint256","uint256","bytes","address","tuple(uint256,uint256,uint8,bytes32,bytes32)"],[e,t,n,r,i,[o,s,a,c,u]]))(i,w,c?yt(h):0,h,p,g.amount,g.deadline,g.v,g.r,g.s),r=(Number(o)+Number(o)*Number(l.zp)/100).toString(),s=(0,l.gU)(r,y),a=this.generateTxCallback({rawTxMethod:async()=>x.populateTransaction.flashLoan(this.swapCollateralAddress,[n],c?[s]:[b],[0],null!==d&&void 0!==d?d:e,t,null!==f&&void 0!==f?f:"0"),from:e,action:u.UQ.swapCollateral});return m.push({tx:a,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(m,a,u.UQ.swapCollateral)}),m}const A=this.liquiditySwapAdapterService.swapAndDeposit({user:e,assetToSwapFrom:n,assetToSwapTo:i,amountToSwap:b,minAmountToReceive:w,swapAll:c,swapCallData:h,augustus:p,permitParams:g},m);return m.push(A),m}async repayWithCollateral({user:e,fromAsset:t,fromAToken:n,assetToRepay:r,repayWithAmount:i,repayAmount:o,permitSignature:s,repayAllDebt:a,rateMode:c,onBehalfOf:d,referralCode:f,flash:p,useEthPath:h}){const m=[],g=null!==s&&void 0!==s?s:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:n,user:e,spender:this.repayWithCollateralAddress,amount:i}))){const t=this.erc20Service.approve({user:e,token:n,spender:this.repayWithCollateralAddress,amount:pt.Bz.toString()});m.push(t)}const y=await this.erc20Service.decimalsOf(t),b=(0,l.gU)(i,y),v=(Number(o)+Number(o)*Number(l.zp)/100).toString(),w=await this.erc20Service.decimalsOf(r),x=a?(0,l.gU)(v,w):(0,l.gU)(o,w),A=c===u.tk.Stable?1:2;if(p){const n=ft.$.encode(["address","uint256","uint256","uint256","uint256","uint8","bytes32","bytes32","bool"],[t,b,A,g.amount,g.deadline,g.v,g.r,g.s,null!==h&&void 0!==h&&h]),i=this.getContractInstance(this.lendingPoolAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.flashLoan(this.repayWithCollateralAddress,[r],[x],[0],null!==d&&void 0!==d?d:e,n,null!==f&&void 0!==f?f:"0"),from:e,action:u.UQ.repayCollateral});return m.push({tx:o,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(m,o,u.UQ.repayCollateral)}),m}const E=this.repayWithCollateralAdapterService.swapAndRepay({user:e,collateralAsset:t,debtAsset:r,collateralAmount:b,debtRepayAmount:x,debtRateMode:c,permit:g,useEthPath:h},m);return m.push(E),m}async paraswapRepayWithCollateral({user:e,fromAsset:t,fromAToken:n,assetToRepay:r,repayWithAmount:i,repayAmount:o,permitSignature:s,repayAllDebt:a,rateMode:c,onBehalfOf:d,referralCode:f,flash:p,swapAndRepayCallData:h,augustus:m}){const g=[],y=null!==s&&void 0!==s?s:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:n,user:e,spender:this.repayWithCollateralAddress,amount:i}))){const t=this.erc20Service.approve({user:e,token:n,spender:this.repayWithCollateralAddress,amount:pt.Bz.toString()});g.push(t)}const b=await this.erc20Service.decimalsOf(t),v=(0,l.gU)(i,b),w=(Number(i)+Number(i)*Number(l.zp)/100).toString(),x=(0,l.gU)(w,b),A=await this.erc20Service.decimalsOf(r),E=(0,l.gU)(o,A),_=c===u.tk.Stable?1:2;if(p){const n=ft.$.encode(["bytes","address"],[h,m]),i=ft.$.encode(["address","uint256","uint256","uint256","bytes","uint256","uint256","uint8","bytes32","bytes32"],[r,E,a?(0,l.mz)(h):0,_,n,y.amount,y.deadline,y.v,y.r,y.s]),o=this.getContractInstance(this.lendingPoolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.flashLoan(this.repayWithCollateralAddress,[t],a?[x]:[v],[0],null!==d&&void 0!==d?d:e,i,null!==f&&void 0!==f?f:"0"),from:e,action:u.UQ.repayCollateral});return g.push({tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(g,s,u.UQ.repayCollateral)}),g}const k=this.paraswapRepayWithCollateralAdapterService.swapAndRepay({user:e,collateralAsset:t,debtAsset:r,collateralAmount:v,debtRepayAmount:E,debtRateMode:c,permitParams:y,repayAll:null!==a&&void 0!==a&&a,swapAndRepayCallData:h,augustus:m},g);return g.push(k),g}async flashLiquidation({user:e,collateralAsset:t,borrowedAsset:n,debtTokenCover:r,liquidateAll:i,initiator:o,useEthPath:s}){const a=[],c=this.getContractInstance(this.lendingPoolAddress),d=await this.erc20Service.decimalsOf(n),f=(0,l.gU)(r,d),p=i?pt.Bz.toString():f,h=i?(0,l.gU)((m=r,(Number(m)+Number(m)*Number(m)/100).toString()),d):f;var m;const g=ft.$.encode(["address","address","address","uint256","bool"],[t,n,e,p,null!==s&&void 0!==s&&s]),y=this.generateTxCallback({rawTxMethod:async()=>c.populateTransaction.flashLoan(this.flashLiquidationAddress,[n],[h],[0],o,g,"0"),from:o});return a.push({tx:y,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(a,y,u.UQ.liquidationFlash)}),a}}(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"deposit",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.Oh)("aTokenAddress")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"withdraw",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"borrow",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"repay",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],Wt.prototype,"swapBorrowRateMode",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],Wt.prototype,"setUsageAsCollateral",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("liquidator")),(0,a.__param)(0,(0,f.Oh)("liquidatedUser")),(0,a.__param)(0,(0,f.Oh)("debtReserve")),(0,a.__param)(0,(0,f.Oh)("collateralReserve")),(0,a.__param)(0,(0,f.K5)("purchaseAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"liquidationCall",null),(0,a.__decorate)([d.Yr,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("fromAsset")),(0,a.__param)(0,(0,f.Oh)("fromAToken")),(0,a.__param)(0,(0,f.Oh)("toAsset")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__param)(0,(0,f.K5)("fromAmount")),(0,a.__param)(0,(0,f.K5)("minToAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"swapCollateral",null),(0,a.__decorate)([d.j7,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("fromAsset")),(0,a.__param)(0,(0,f.Oh)("fromAToken")),(0,a.__param)(0,(0,f.Oh)("assetToRepay")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.K5)("repayWithAmount")),(0,a.__param)(0,(0,f.K5)("repayAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"repayWithCollateral",null),(0,a.__decorate)([d.j7,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("fromAsset")),(0,a.__param)(0,(0,f.Oh)("fromAToken")),(0,a.__param)(0,(0,f.Oh)("assetToRepay")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.K5)("repayWithAmount")),(0,a.__param)(0,(0,f.K5)("repayAmount")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"paraswapRepayWithCollateral",null),(0,a.__decorate)([d.bt,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("collateralAsset")),(0,a.__param)(0,(0,f.Oh)("borrowedAsset")),(0,a.__param)(0,(0,f.K5)("debtTokenCover")),(0,a.__param)(0,(0,f.Oh)("initiator")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"flashLiquidation",null);class qt extends c.Z{constructor(e,t){super(e,Tt);const{POOL:n,WETH_GATEWAY:r,L2_ENCODER:i}=null!==t&&void 0!==t?t:{};this.poolAddress=null!==n&&void 0!==n?n:"",this.l2EncoderAddress=null!==i&&void 0!==i?i:"",this.wethGatewayAddress=null!==r&&void 0!==r?r:"",this.v3PoolService=new Ut(e,t),this.erc20_2612Service=new Ye(e),this.erc20Service=new ht.A(e),this.synthetixService=new Et.K(e),this.wethGatewayService=new jt(e,this.erc20Service,r),this.l2PoolService=new Dt(e,{l2PoolAddress:this.poolAddress,encoderAddress:this.l2EncoderAddress}),this.contractInterface=Tt.createInterface(),this.supplyTxBuilder={getApprovedAmount:async e=>{const t=e.token.toLowerCase()===l.hP.toLowerCase()?this.wethGatewayAddress:this.poolAddress,n=await this.erc20Service.approvedAmount(Object.assign(Object.assign({},e),{spender:t}));return Object.assign(Object.assign({},e),{spender:t,amount:n.toString()})},generateTxData:({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i,useOptimizedPath:o,encodedTxData:s})=>{let a={};const c=null!==r&&void 0!==r?r:e,d=null!==i&&void 0!==i?i:"0";if(t.toLowerCase()===l.hP.toLowerCase())a=this.wethGatewayService.generateDepositEthTxData({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:c,referralCode:d});else if(o)if(s)a=this.l2PoolService.generateEncodedSupplyTxData({encodedTxData:s,user:e});else{const r={user:e,reserve:t,amount:n,onBehalfOf:c,referralCode:d};a=this.l2PoolService.generateSupplyTxData(r)}else{const r=this.contractInterface.encodeFunctionData("supply",[t,n,c,d]);a.to=this.poolAddress,a.from=e,a.data=r,a.gasLimit=_t.O$.from(l.eB[u.UQ.supply].recommended)}return a},generateSignedTxData:({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i,useOptimizedPath:o,signature:s,deadline:a,encodedTxData:c})=>{const d=(0,ze.splitSignature)(s);let f={};const p=null!==r&&void 0!==r?r:e,h=null!==i&&void 0!==i?i:"0";if(o)if(c)f=this.l2PoolService.generateEncodedSupplyWithPermitTxData({encodedTxData:c,user:e,signature:s});else{const r={user:e,reserve:t,amount:n,referralCode:h,onBehalfOf:p,permitR:d.r,permitS:d.s,permitV:d.v,deadline:Number(a)};f=this.l2PoolService.generateSupplyWithPermitTxData(r)}else{const r=this.contractInterface.encodeFunctionData("supplyWithPermit",[t,n,p,h,a,d.v,d.r,d.s]);f.to=this.poolAddress,f.from=e,f.data=r,f.gasLimit=_t.O$.from(l.eB[u.UQ.supplyWithPermit].recommended)}return f}},this.borrowTxBuilder={generateTxData:({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:i,onBehalfOf:o,referralCode:s,useOptimizedPath:a,encodedTxData:c})=>{let d={};const f=null!==s&&void 0!==s?s:"0",p=null!==o&&void 0!==o?o:e,h=r===u.tk.Variable?2:1;if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");d=this.wethGatewayService.generateBorrowEthTxData({lendingPool:this.poolAddress,user:e,amount:n,debtTokenAddress:i,interestRateMode:r,referralCode:f})}else if(a)if(c)d=this.l2PoolService.generateEncodedBorrowTxData({encodedTxData:c,user:e});else{const r={user:e,reserve:t,amount:n,onBehalfOf:p,referralCode:f,numericRateMode:h};d=this.l2PoolService.generateBorrowTxData(r)}else{const r=this.contractInterface.encodeFunctionData("borrow",[t,n,h,f,p]);d.to=this.poolAddress,d.from=e,d.data=r,d.gasLimit=_t.O$.from(l.eB[u.UQ.borrow].recommended)}return d}}}}class $t extends c.Z{constructor(e,t){super(e,Gt);const{LENDING_POOL:n,WETH_GATEWAY:r}=null!==t&&void 0!==t?t:{};this.lendingPoolAddress=null!==n&&void 0!==n?n:"",this.wethGatewayAddress=null!==r&&void 0!==r?r:"",this.erc20Service=new ht.A(e),this.synthetixService=new Et.K(e),this.wethGatewayService=new jt(e,this.erc20Service,r),this.contractInterface=Gt.createInterface(),this.depositTxBuilder={getApprovedAmount:async e=>{const t=e.token.toLowerCase()===l.hP.toLowerCase()?this.wethGatewayAddress:this.lendingPoolAddress,n=await this.erc20Service.approvedAmount(Object.assign(Object.assign({},e),{spender:t}));return Object.assign(Object.assign({},e),{spender:t,amount:n.toString()})},generateTxData:({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i})=>{let o={};if(t.toLowerCase()===l.hP.toLowerCase())o=this.wethGatewayService.generateDepositEthTxData({lendingPool:this.lendingPoolAddress,user:e,amount:n,onBehalfOf:r,referralCode:i});else{const s=this.contractInterface.encodeFunctionData("deposit",[t,n,null!==r&&void 0!==r?r:e,null!==i&&void 0!==i?i:"0"]);o.to=this.lendingPoolAddress,o.from=e,o.data=s,o.gasLimit=_t.O$.from(l.eB[u.UQ.deposit].recommended)}return o}},this.borrowTxBuilder={generateTxData:({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:i,onBehalfOf:o,referralCode:s})=>{let a={};const c=null!==s&&void 0!==s?s:"0",d=null!==o&&void 0!==o?o:e,f=r===u.tk.Variable?2:1;if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");a=this.wethGatewayService.generateBorrowEthTxData({lendingPool:this.lendingPoolAddress,user:e,amount:n,debtTokenAddress:i,interestRateMode:r,referralCode:c})}else{const r=this.contractInterface.encodeFunctionData("borrow",[t,n,f,c,d]);a.to=this.lendingPoolAddress,a.from=e,a.data=r,a.gasLimit=_t.O$.from(l.eB[u.UQ.borrow].recommended)}return a}}}}const Kt=[{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"}],name:"getReservesData",outputs:[{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"baseLTVasCollateral",type:"uint256"},{internalType:"uint256",name:"reserveLiquidationThreshold",type:"uint256"},{internalType:"uint256",name:"reserveLiquidationBonus",type:"uint256"},{internalType:"uint256",name:"reserveFactor",type:"uint256"},{internalType:"bool",name:"usageAsCollateralEnabled",type:"bool"},{internalType:"bool",name:"borrowingEnabled",type:"bool"},{internalType:"bool",name:"stableBorrowRateEnabled",type:"bool"},{internalType:"bool",name:"isActive",type:"bool"},{internalType:"bool",name:"isFrozen",type:"bool"},{internalType:"uint128",name:"liquidityIndex",type:"uint128"},{internalType:"uint128",name:"variableBorrowIndex",type:"uint128"},{internalType:"uint128",name:"liquidityRate",type:"uint128"},{internalType:"uint128",name:"variableBorrowRate",type:"uint128"},{internalType:"uint128",name:"stableBorrowRate",type:"uint128"},{internalType:"uint40",name:"lastUpdateTimestamp",type:"uint40"},{internalType:"address",name:"aTokenAddress",type:"address"},{internalType:"address",name:"stableDebtTokenAddress",type:"address"},{internalType:"address",name:"variableDebtTokenAddress",type:"address"},{internalType:"address",name:"interestRateStrategyAddress",type:"address"},{internalType:"uint256",name:"availableLiquidity",type:"uint256"},{internalType:"uint256",name:"totalPrincipalStableDebt",type:"uint256"},{internalType:"uint256",name:"averageStableRate",type:"uint256"},{internalType:"uint256",name:"stableDebtLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"totalScaledVariableDebt",type:"uint256"},{internalType:"uint256",name:"priceInMarketReferenceCurrency",type:"uint256"},{internalType:"address",name:"priceOracle",type:"address"},{internalType:"uint256",name:"variableRateSlope1",type:"uint256"},{internalType:"uint256",name:"variableRateSlope2",type:"uint256"},{internalType:"uint256",name:"stableRateSlope1",type:"uint256"},{internalType:"uint256",name:"stableRateSlope2",type:"uint256"},{internalType:"uint256",name:"baseStableBorrowRate",type:"uint256"},{internalType:"uint256",name:"baseVariableBorrowRate",type:"uint256"},{internalType:"uint256",name:"optimalUsageRatio",type:"uint256"},{internalType:"bool",name:"isPaused",type:"bool"},{internalType:"bool",name:"isSiloedBorrowing",type:"bool"},{internalType:"uint128",name:"accruedToTreasury",type:"uint128"},{internalType:"uint128",name:"unbacked",type:"uint128"},{internalType:"uint128",name:"isolationModeTotalDebt",type:"uint128"},{internalType:"bool",name:"flashLoanEnabled",type:"bool"},{internalType:"uint256",name:"debtCeiling",type:"uint256"},{internalType:"uint256",name:"debtCeilingDecimals",type:"uint256"},{internalType:"uint8",name:"eModeCategoryId",type:"uint8"},{internalType:"uint256",name:"borrowCap",type:"uint256"},{internalType:"uint256",name:"supplyCap",type:"uint256"},{internalType:"uint16",name:"eModeLtv",type:"uint16"},{internalType:"uint16",name:"eModeLiquidationThreshold",type:"uint16"},{internalType:"uint16",name:"eModeLiquidationBonus",type:"uint16"},{internalType:"address",name:"eModePriceSource",type:"address"},{internalType:"string",name:"eModeLabel",type:"string"},{internalType:"bool",name:"borrowableInIsolation",type:"bool"}],internalType:"struct IUiPoolDataProviderV3.AggregatedReserveData[]",name:"",type:"tuple[]"},{components:[{internalType:"uint256",name:"marketReferenceCurrencyUnit",type:"uint256"},{internalType:"int256",name:"marketReferenceCurrencyPriceInUsd",type:"int256"},{internalType:"int256",name:"networkBaseTokenPriceInUsd",type:"int256"},{internalType:"uint8",name:"networkBaseTokenPriceDecimals",type:"uint8"}],internalType:"struct IUiPoolDataProviderV3.BaseCurrencyInfo",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"}],name:"getReservesList",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"getUserReservesData",outputs:[{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{internalType:"uint256",name:"scaledATokenBalance",type:"uint256"},{internalType:"bool",name:"usageAsCollateralEnabledOnUser",type:"bool"},{internalType:"uint256",name:"stableBorrowRate",type:"uint256"},{internalType:"uint256",name:"scaledVariableDebt",type:"uint256"},{internalType:"uint256",name:"principalStableDebt",type:"uint256"},{internalType:"uint256",name:"stableBorrowLastUpdateTimestamp",type:"uint256"}],internalType:"struct IUiPoolDataProviderV3.UserReserveData[]",name:"",type:"tuple[]"},{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"}];class Yt{static createInterface(){return new Ne.vU(Kt)}static connect(e,t){return new p.CH(e,Kt,t)}}Yt.abi=Kt;const Xt={"0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5":"UNIDAIUSDC","0x004375dff511095cc5a197a54140a24efef3a416":"UNIWBTCUSDC","0xa478c2975ab1ea89e8196811f51a7b7ade33eb11":"UNIDAIWETH","0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc":"UNIUSDCWETH","0xdfc14d2af169b0d36c4eff567ada9b2e0cae044f":"UNIAAVEWETH","0xb6909b960dbbe7392d405429eb2b3649752b4838":"UNIBATWETH","0x3da1313ae46132a397d90d95b1424a9a7e3e0fce":"UNICRVWETH","0xa2107fa5b38d9bbd2c461d6edf11b11a50f6b974":"UNILINKWETH","0xc2adda861f89bbb333c90c492cb837741916a225":"UNIMKRWETH","0x8bd1661da98ebdd3bd080f0be4e6d9be8ce9858c":"UNIRENWETH","0x43ae24960e5534731fc831386c07755a2dc33d47":"UNISNXWETH","0xd3d2e2692501a5c9ca623199d38826e513033a17":"UNIUNIWETH","0xbb2b8038a1640196fbe3e38816f3e67cba72d940":"UNIWBTCWETH","0x2fdbadf3c4d5a8666bc06645b8358ab803996e28":"UNIYFIWETH","0x1eff8af5d577060ba4ac8a29a13525bb0ee2a3d5":"BPTWBTCWETH","0x59a19d8c652fa0284f44113d0ff9aba70bd46fb4":"BPTBALWETH"};class Jt{constructor(e){if(!(0,Me.isAddress)(e.uiPoolDataProviderAddress))throw new Error("contract address is not valid");this._contract=Yt.connect(e.uiPoolDataProviderAddress,e.provider),this.chainId=e.chainId}async getReservesList({lendingPoolAddressProvider:e}){if(!(0,Me.isAddress)(e))throw new Error("Lending pool address is not valid");return this._contract.getReservesList(e)}async getReservesData({lendingPoolAddressProvider:e}){if(!(0,Me.isAddress)(e))throw new Error("Lending pool address is not valid");return this._contract.getReservesData(e)}async getUserReservesData({lendingPoolAddressProvider:e,user:t}){if(!(0,Me.isAddress)(e))throw new Error("Lending pool address is not valid");if(!(0,Me.isAddress)(t))throw new Error("User address is not a valid ethereum address");return this._contract.getUserReservesData(e,t)}async getReservesHumanized({lendingPoolAddressProvider:e}){const{0:t,1:n}=await this.getReservesData({lendingPoolAddressProvider:e});return{reservesData:t.map((t=>({id:`${this.chainId}-${t.underlyingAsset}-${e}`.toLowerCase(),underlyingAsset:t.underlyingAsset.toLowerCase(),name:t.name,symbol:Xt[t.underlyingAsset.toLowerCase()]?Xt[t.underlyingAsset.toLowerCase()]:t.symbol,decimals:t.decimals.toNumber(),baseLTVasCollateral:t.baseLTVasCollateral.toString(),reserveLiquidationThreshold:t.reserveLiquidationThreshold.toString(),reserveLiquidationBonus:t.reserveLiquidationBonus.toString(),reserveFactor:t.reserveFactor.toString(),usageAsCollateralEnabled:t.usageAsCollateralEnabled,borrowingEnabled:t.borrowingEnabled,stableBorrowRateEnabled:t.stableBorrowRateEnabled,isActive:t.isActive,isFrozen:t.isFrozen,liquidityIndex:t.liquidityIndex.toString(),variableBorrowIndex:t.variableBorrowIndex.toString(),liquidityRate:t.liquidityRate.toString(),variableBorrowRate:t.variableBorrowRate.toString(),stableBorrowRate:t.stableBorrowRate.toString(),lastUpdateTimestamp:t.lastUpdateTimestamp,aTokenAddress:t.aTokenAddress.toString(),stableDebtTokenAddress:t.stableDebtTokenAddress.toString(),variableDebtTokenAddress:t.variableDebtTokenAddress.toString(),interestRateStrategyAddress:t.interestRateStrategyAddress.toString(),availableLiquidity:t.availableLiquidity.toString(),totalPrincipalStableDebt:t.totalPrincipalStableDebt.toString(),averageStableRate:t.averageStableRate.toString(),stableDebtLastUpdateTimestamp:t.stableDebtLastUpdateTimestamp.toNumber(),totalScaledVariableDebt:t.totalScaledVariableDebt.toString(),priceInMarketReferenceCurrency:t.priceInMarketReferenceCurrency.toString(),priceOracle:t.priceOracle,variableRateSlope1:t.variableRateSlope1.toString(),variableRateSlope2:t.variableRateSlope2.toString(),stableRateSlope1:t.stableRateSlope1.toString(),stableRateSlope2:t.stableRateSlope2.toString(),baseStableBorrowRate:t.baseStableBorrowRate.toString(),baseVariableBorrowRate:t.baseVariableBorrowRate.toString(),optimalUsageRatio:t.optimalUsageRatio.toString(),isPaused:t.isPaused,debtCeiling:t.debtCeiling.toString(),eModeCategoryId:t.eModeCategoryId,borrowCap:t.borrowCap.toString(),supplyCap:t.supplyCap.toString(),eModeLtv:t.eModeLtv,eModeLiquidationThreshold:t.eModeLiquidationThreshold,eModeLiquidationBonus:t.eModeLiquidationBonus,eModePriceSource:t.eModePriceSource.toString(),eModeLabel:t.eModeLabel.toString(),borrowableInIsolation:t.borrowableInIsolation,accruedToTreasury:t.accruedToTreasury.toString(),unbacked:t.unbacked.toString(),isolationModeTotalDebt:t.isolationModeTotalDebt.toString(),debtCeilingDecimals:t.debtCeilingDecimals.toNumber(),isSiloedBorrowing:t.isSiloedBorrowing,flashLoanEnabled:t.flashLoanEnabled}))),baseCurrencyData:{marketReferenceCurrencyDecimals:n.marketReferenceCurrencyUnit.toString().length-1,marketReferenceCurrencyPriceInUsd:n.marketReferenceCurrencyPriceInUsd.toString(),networkBaseTokenPriceInUsd:n.networkBaseTokenPriceInUsd.toString(),networkBaseTokenPriceDecimals:n.networkBaseTokenPriceDecimals}}}async getUserReservesHumanized({lendingPoolAddressProvider:e,user:t}){const{0:n,1:r}=await this.getUserReservesData({lendingPoolAddressProvider:e,user:t});return{userReserves:n.map((n=>({id:`${this.chainId}-${t}-${n.underlyingAsset}-${e}`.toLowerCase(),underlyingAsset:n.underlyingAsset.toLowerCase(),scaledATokenBalance:n.scaledATokenBalance.toString(),usageAsCollateralEnabledOnUser:n.usageAsCollateralEnabledOnUser,stableBorrowRate:n.stableBorrowRate.toString(),scaledVariableDebt:n.scaledVariableDebt.toString(),principalStableDebt:n.principalStableDebt.toString(),stableBorrowLastUpdateTimestamp:n.stableBorrowLastUpdateTimestamp.toNumber()}))),userEmodeCategoryId:r}}}class Qt{static connect(e,t){return new p.CH(e,en,t)}}const en=[{inputs:[{internalType:"address",name:"_token",type:"address"}],name:"getMinter",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"}],name:"mint",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"}];class tn extends c.Z{constructor(e,t){super(e,Qt),this.faucetAddress=null!==t&&void 0!==t?t:""}mint({userAddress:e,reserve:t,tokenSymbol:n}){const r=(0,l.gU)("1000",18),i=l.Ry[n]?l.Ry[n]:r,o=this.getContractInstance(this.faucetAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.mint(t,i),from:e,value:l.k8});return[{tx:s,txType:u.ns.FAUCET_MINT,gas:this.generateTxPriceEstimation([],s)}]}}(0,a.__decorate)([d.QL,(0,a.__param)(0,(0,f.Oh)("userAddress")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],tn.prototype,"mint",null);const nn=[{inputs:[{internalType:"contract IPoolAddressesProvider",name:"addressesProvider",type:"address"},{internalType:"address",name:"pool",type:"address"},{internalType:"contract IParaSwapAugustusRegistry",name:"augustusRegistry",type:"address"},{internalType:"address",name:"owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"fromAsset",type:"address"},{indexed:!0,internalType:"address",name:"toAsset",type:"address"},{indexed:!1,internalType:"uint256",name:"amountSold",type:"uint256"},{indexed:!1,internalType:"uint256",name:"receivedAmount",type:"uint256"}],name:"Bought",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"fromAsset",type:"address"},{indexed:!0,internalType:"address",name:"toAsset",type:"address"},{indexed:!1,internalType:"uint256",name:"fromAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"receivedAmount",type:"uint256"}],name:"Swapped",type:"event"},{inputs:[],name:"ADDRESSES_PROVIDER",outputs:[{internalType:"contract IPoolAddressesProvider",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"AUGUSTUS_REGISTRY",outputs:[{internalType:"contract IParaSwapAugustusRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_SLIPPAGE_PERCENT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ORACLE",outputs:[{internalType:"contract IPriceOracleGetter",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"POOL",outputs:[{internalType:"contract IPool",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"REFERRER",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"cacheReserves",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"address",name:"initiator",type:"address"},{internalType:"bytes",name:"params",type:"bytes"}],name:"executeOperation",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"}],name:"renewAllowance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20",name:"token",type:"address"}],name:"rescueTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"debtAsset",type:"address"},{internalType:"uint256",name:"debtRepayAmount",type:"uint256"},{internalType:"uint256",name:"debtRateMode",type:"uint256"},{internalType:"address",name:"newDebtAsset",type:"address"},{internalType:"uint256",name:"maxNewDebtAmount",type:"uint256"},{internalType:"uint256",name:"offset",type:"uint256"},{internalType:"bytes",name:"paraswapData",type:"bytes"}],internalType:"struct ParaSwapDebtSwapAdapter.DebtSwapParams",name:"debtSwapParams",type:"tuple"},{components:[{internalType:"contract ICreditDelegationToken",name:"debtToken",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct ParaSwapDebtSwapAdapter.CreditDelegationInput",name:"creditDelegationPermit",type:"tuple"}],name:"swapDebt",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],rn="0x6101006040523480156200001257600080fd5b5060405162003410380380620034108339810160408190526200003591620007c5565b838383838383838282600033600080546001600160a01b0319166001600160a01b038316908117825560405192935091600080516020620033f0833981519152908290a350816001600160a01b031663fca513a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000b9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000df91906200082d565b6001600160a01b0390811660805291821660a052811660c05260405163fb04e17b60e01b8152600060048201529082169063fb04e17b90602401602060405180830381865afa15801562000137573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015d919062000854565b15620001b05760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420612076616c696420417567757374757320616464726573730000000060448201526064015b60405180910390fd5b6001600160a01b031660e052505060018055620001cd81620001e5565b620001d7620002f2565b505050505050505062000a40565b6000546001600160a01b03163314620002415760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620001a7565b6001600160a01b038116620002a85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620001a7565b600080546040516001600160a01b0380851693921691600080516020620033f083398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600060c0516001600160a01b031663d1946dbc6040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000335573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200035f91908101906200088e565b905060005b8151811015620003c857620003b360c0516000198484815181106200038d576200038d62000960565b60200260200101516001600160a01b0316620003cc60201b62000cf6179092919060201c565b80620003bf8162000976565b91505062000364565b5050565b8015806200044a5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801562000422573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004489190620009a0565b155b620004be5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401620001a7565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b17909152620005169185916200051b16565b505050565b600062000577826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620005f960201b62000e32179092919060201c565b80519091501562000516578080602001905181019062000598919062000854565b620005165760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401620001a7565b60606200060a848460008562000612565b949350505050565b606082471015620006755760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620001a7565b600080866001600160a01b03168587604051620006939190620009ed565b60006040518083038185875af1925050503d8060008114620006d2576040519150601f19603f3d011682016040523d82523d6000602084013e620006d7565b606091505b509092509050620006eb87838387620006f6565b979650505050505050565b60608315620007675782516200075f576001600160a01b0385163b6200075f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620001a7565b50816200060a565b6200060a83838151156200077e5781518083602001fd5b8060405162461bcd60e51b8152600401620001a7919062000a0b565b6001600160a01b0381168114620007b057600080fd5b50565b8051620007c0816200079a565b919050565b60008060008060808587031215620007dc57600080fd5b8451620007e9816200079a565b6020860151909450620007fc816200079a565b60408601519093506200080f816200079a565b606086015190925062000822816200079a565b939692955090935050565b6000602082840312156200084057600080fd5b81516200084d816200079a565b9392505050565b6000602082840312156200086757600080fd5b815180151581146200084d57600080fd5b634e487b7160e01b600052604160045260246000fd5b60006020808385031215620008a257600080fd5b82516001600160401b0380821115620008ba57600080fd5b818501915085601f830112620008cf57600080fd5b815181811115620008e457620008e462000878565b8060051b604051601f19603f830116810181811085821117156200090c576200090c62000878565b6040529182528482019250838101850191888311156200092b57600080fd5b938501935b8285101562000954576200094485620007b3565b8452938501939285019262000930565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b60006000198214156200099957634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208284031215620009b357600080fd5b5051919050565b60005b83811015620009d7578181015183820152602001620009bd565b83811115620009e7576000848401525b50505050565b6000825162000a01818460208701620009ba565b9190910192915050565b602081526000825180602084015262000a2c816040850160208701620009ba565b601f01601f19169190910160400192915050565b60805160a05160c05160e05161291b62000ad56000396000818161019d01526113b20152600081816101e70152818161033f015281816103740152818161071801528181610834015281816108f8015281816109ee01528181610a8501528181610afc01528181610f0001528181610fd401526110a6015260006101080152600081816101760152611c05015261291b6000f3fe608060405234801561001057600080fd5b50600436106100e95760003560e01c8063715018a61161008c5780638da5cb5b116100665780638da5cb5b14610209578063920f5c841461021a578063c05603741461023d578063f2fde38b1461025957600080fd5b8063715018a6146101d257806371f893ea146101da5780637535d246146101e257600080fd5b806332e4b286116100c857806332e4b2861461015a57806338013f02146101715780633a82986714610198578063636aa619146101bf57600080fd5b8062ae3bf8146100ee5780630542975c146101035780630a03635114610147575b600080fd5b6101016100fc366004611d34565b61026c565b005b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b610101610155366004611d34565b610330565b610163610bb881565b60405190815260200161013e565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b6101016101cd366004611f13565b61039b565b610101610976565b6101016109ea565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031661012a565b61022d61022836600461202a565b610aef565b604051901515815260200161013e565b61024661173081565b60405161ffff909116815260200161013e565b610101610267366004611d34565b610c0c565b6000546001600160a01b0316331461029f5760405162461bcd60e51b81526004016102969061212f565b60405180910390fd5b61032d6102b46000546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156102f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031c9190612164565b6001600160a01b0384169190610e49565b50565b6103656001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000006000610cf6565b61032d6001600160a01b0382167f0000000000000000000000000000000000000000000000000000000000000000600019610cf6565b60608201516040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156103e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040a9190612164565b905081604001516000146104b657815160208301516040808501516060860151608087015160a0880151935163016a5aab60e31b81523360048201523060248201526044810195909552606485019290925260ff16608484015260a483015260c48201526001600160a01b0390911690630b52d5589060e401600060405180830381600087803b15801561049d57600080fd5b505af11580156104b1573d6000803e3d6000fd5b505050505b600019836020015114156105c1576000806104d48560000151610eda565b915091508460400151600214610551576040516370a0823160e01b81523360048201526001600160a01b038216906370a0823190602401602060405180830381865afa158015610528573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054c9190612164565b6105b9565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610595573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b99190612164565b602086015250505b6040805160c0808201835285516001600160a01b0316825260208087015181840152868401518385015290860151606083015260a0808701516080840152339083015291519091600091610617918491016121d5565b60408051601f1981840301815260018084528383019092529250600091906020808301908036833701905050905085606001518160008151811061065d5761065d61223b565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090508660800151816000815181106106b2576106b261223b565b60209081029190910101526040805160018082528183019092526000918160200160208202803683370190505090506002816000815181106106f6576106f661223b565b602090810291909101015260405163ab9c4b5d60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ab9c4b5d9061075b90309087908790879033908c906117309060040161228c565b600060405180830381600087803b15801561077557600080fd5b505af1158015610789573d6000803e3d6000fd5b5050505060608801516040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156107d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fc9190612164565b9050600061080a888361235e565b9050801561096a5760608a0151604051636eb1769f60e11b81523060048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152600092169063dd62ed3e90604401602060405180830381865afa158015610885573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a99190612164565b9050818110156108c0576108c08b60600151610330565b60608b015160405163573ade8160e01b81526001600160a01b03918216600482015260248101849052600260448201523360648201527f00000000000000000000000000000000000000000000000000000000000000009091169063573ade81906084016020604051808303816000875af1158015610943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109679190612164565b50505b50505050505050505050565b6000546001600160a01b031633146109a05760405162461bcd60e51b81526004016102969061212f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d1946dbc6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610a4a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a729190810190612380565b905060005b8151811015610aeb57610ad97f0000000000000000000000000000000000000000000000000000000000000000600019848481518110610ab957610ab961223b565b60200260200101516001600160a01b0316610cf69092919063ffffffff16565b80610ae381612426565b915050610a77565b5050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b5f5760405162461bcd60e51b815260206004820152601360248201527210d05313115497d35554d517d09157d413d3d3606a1b6044820152606401610296565b6001600160a01b0384163014610bb05760405162461bcd60e51b8152602060048201526016602482015275494e49544941544f525f4d5553545f42455f5448495360501b6044820152606401610296565b610bfc83838c8c6000818110610bc857610bc861223b565b9050602002016020810190610bdd9190611d34565b8b8b6000818110610bf057610bf061223b565b90506020020135610f86565b5060019998505050505050505050565b6000546001600160a01b03163314610c365760405162461bcd60e51b81526004016102969061212f565b6001600160a01b038116610c9b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610296565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b801580610d705750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e9190612164565b155b610ddb5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610296565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052610e2d90849061111e565b505050565b6060610e4184846000856111f0565b949350505050565b60405163a9059cbb60e01b8082526001600160a01b0384166004830152602482018390529060008060448382895af1610e86573d6000803e3d6000fd5b50610e90846112cb565b610ed45760405162461bcd60e51b815260206004820152601560248201527423a83b191d103330b4b632b2103a3930b739b332b960591b6044820152606401610296565b50505050565b6040516335ea6a7560e01b81526001600160a01b038281166004830152600091829182917f0000000000000000000000000000000000000000000000000000000000000000909116906335ea6a75906024016101e060405180830381865afa158015610f4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6e91906124ca565b90508061014001518161012001519250925050915091565b6000610f94848601866125ed565b9050610fb481608001518260600151858460000151868660200151611374565b508051604051636eb1769f60e11b81523060048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152600092169063dd62ed3e90604401602060405180830381865afa158015611025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110499190612164565b9050816020015181101561106257815161106290610330565b8151602083015160408085015160a0860151915163573ade8160e01b81526001600160a01b03948516600482015260248101939093526044830152821660648201527f00000000000000000000000000000000000000000000000000000000000000009091169063573ade81906084016020604051808303816000875af11580156110f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111159190612164565b50505050505050565b6000611173826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e329092919063ffffffff16565b805190915015610e2d578080602001905181019061119191906126a4565b610e2d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610296565b6060824710156112515760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610296565b600080866001600160a01b0316858760405161126d91906126c6565b60006040518083038185875af1925050503d80600081146112aa576040519150601f19603f3d011682016040523d82523d6000602084013e6112af565b606091505b50915091506112c087838387611aac565b979650505050505050565b60006112f1565b62461bcd60e51b60005260206004528060245250806044525060646000fd5b3d801561133057602081146113615761132b7f475076323a206d616c666f726d6564207472616e7366657220726573756c7400601f6112d2565b61136e565b823b611358576113587311d41d8c8e881b9bdd08184818dbdb9d1c9858dd60621b60146112d2565b6001915061136e565b3d6000803e600051151591505b50919050565b60008060008780602001905181019061138d91906126e2565b60405163fb04e17b60e01b81526001600160a01b0380831660048301529294509092507f00000000000000000000000000000000000000000000000000000000000000009091169063fb04e17b90602401602060405180830381865afa1580156113fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141f91906126a4565b61145e5760405162461bcd60e51b815260206004820152601060248201526f494e56414c49445f415547555354555360801b6044820152606401610296565b600061146988611b22565b60ff169050600061147988611b22565b60ff16905060006114898a611be3565b905060006114968a611be3565b905060006114ee6114ab612710610bb8611c72565b6114e86114c36114bc88600a612854565b8790611c82565b6114e26114db6114d48b600a612854565b8890611c82565b8e90611c82565b90611cac565b90611cbf565b9050808a111561154c5760405162461bcd60e51b815260206004820152602360248201527f6d6178416d6f756e74546f5377617020657863656564206d617820736c69707060448201526261676560e81b6064820152608401610296565b50506040516370a0823160e01b8152306004820152600093506001600160a01b038b1692506370a082319150602401602060405180830381865afa158015611598573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bc9190612164565b90508581101561160e5760405162461bcd60e51b815260206004820181905260248201527f494e53554646494349454e545f42414c414e43455f4245464f52455f535741506044820152606401610296565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa158015611655573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116799190612164565b90506000836001600160a01b031663d2c4b5986040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df9190612860565b60405163095ea7b360e01b81526001600160a01b03808316600483015260006024830152919250908b169063095ea7b3906044016020604051808303816000875af1158015611732573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175691906126a4565b5060405163095ea7b360e01b81526001600160a01b038281166004830152602482018a90528b169063095ea7b3906044016020604051808303816000875af11580156117a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ca91906126a4565b508b156118435760048c101580156117ee575084516117ea906020611ce5565b8c11155b61183a5760405162461bcd60e51b815260206004820152601d60248201527f544f5f414d4f554e545f4f46465345545f4f55545f4f465f52414e47450000006044820152606401610296565b8660208d018601525b6000846001600160a01b03168660405161185d91906126c6565b6000604051808303816000865af19150503d806000811461189a576040519150601f19603f3d011682016040523d82523d6000602084013e61189f565b606091505b50509050806118b2573d6000803e3d6000fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038d16906370a0823190602401602060405180830381865afa1580156118f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191d9190612164565b9050611929818661235e565b97508988111561197b5760405162461bcd60e51b815260206004820152601860248201527f57524f4e475f42414c414e43455f41465445525f5357415000000000000000006044820152606401610296565b6040516370a0823160e01b81523060048201526000906119f29086906001600160a01b038f16906370a0823190602401602060405180830381865afa1580156119c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ec9190612164565b90611ce5565b905089811015611a445760405162461bcd60e51b815260206004820152601c60248201527f494e53554646494349454e545f414d4f554e545f5245434549564544000000006044820152606401610296565b8b6001600160a01b03168d6001600160a01b03167fbf77fd13a39d14dc0da779342c14105c38d9a5d0c60f2caa22f5fd1d5525416d8b84604051611a92929190918252602082015260400190565b60405180910390a350505050505050509695505050505050565b60608315611b18578251611b11576001600160a01b0385163b611b115760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610296565b5081610e41565b610e418383611cf5565b600080826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b87919061287d565b9050604d8160ff161115611bdd5760405162461bcd60e51b815260206004820152601a60248201527f544f4f5f4d414e595f444543494d414c535f4f4e5f544f4b454e0000000000006044820152606401610296565b92915050565b60405163b3596f0760e01b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063b3596f0790602401602060405180830381865afa158015611c4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bdd9190612164565b80820182811015611bdd57600080fd5b6000821580611ca357505081810281838281611ca057611ca061289a565b04145b611bdd57600080fd5b6000611cb882846128b0565b9392505050565b600081156113881983900484111517611cd757600080fd5b506127109102611388010490565b80820382811115611bdd57600080fd5b815115611d055781518083602001fd5b8060405162461bcd60e51b815260040161029691906128d2565b6001600160a01b038116811461032d57600080fd5b600060208284031215611d4657600080fd5b8135611cb881611d1f565b8035611d5c81611d1f565b919050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715611d9a57611d9a611d61565b60405290565b60405160e0810167ffffffffffffffff81118282101715611d9a57611d9a611d61565b6040516101e0810167ffffffffffffffff81118282101715611d9a57611d9a611d61565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e1057611e10611d61565b604052919050565b600067ffffffffffffffff821115611e3257611e32611d61565b50601f01601f191660200190565b600082601f830112611e5157600080fd5b8135611e64611e5f82611e18565b611de7565b818152846020838601011115611e7957600080fd5b816020850160208301376000918101602001919091529392505050565b60ff8116811461032d57600080fd5b600060c08284031215611eb757600080fd5b611ebf611d77565b90508135611ecc81611d1f565b8082525060208201356020820152604082013560408201526060820135611ef281611e96565b806060830152506080820135608082015260a082013560a082015292915050565b60008060e08385031215611f2657600080fd5b823567ffffffffffffffff80821115611f3e57600080fd5b9084019060e08287031215611f5257600080fd5b611f5a611da0565b611f6383611d51565b81526020830135602082015260408301356040820152611f8560608401611d51565b60608201526080830135608082015260a083013560a082015260c083013582811115611fb057600080fd5b611fbc88828601611e40565b60c083015250809450505050611fd58460208501611ea5565b90509250929050565b60008083601f840112611ff057600080fd5b50813567ffffffffffffffff81111561200857600080fd5b6020830191508360208260051b850101111561202357600080fd5b9250929050565b600080600080600080600080600060a08a8c03121561204857600080fd5b893567ffffffffffffffff8082111561206057600080fd5b61206c8d838e01611fde565b909b50995060208c013591508082111561208557600080fd5b6120918d838e01611fde565b909950975060408c01359150808211156120aa57600080fd5b6120b68d838e01611fde565b909750955060608c013591506120cb82611d1f565b90935060808b013590808211156120e157600080fd5b818c0191508c601f8301126120f557600080fd5b81358181111561210457600080fd5b8d602082850101111561211657600080fd5b6020830194508093505050509295985092959850929598565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561217657600080fd5b5051919050565b60005b83811015612198578181015183820152602001612180565b83811115610ed45750506000910152565b600081518084526121c181602086016020860161217d565b601f01601f19169290920160200192915050565b60208152600060018060a01b038084511660208401526020840151604084015260408401516060840152606084015160c0608085015261221860e08501826121a9565b9050608085015160a08501528160a08601511660c0850152809250505092915050565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b8381101561228157815187529582019590820190600101612265565b509495945050505050565b6001600160a01b03888116825260e0602080840182905289519184018290526000928a820192909190610100860190855b818110156122db5785518516835294830194918301916001016122bd565b505085810360408701526122ef818c612251565b935050505082810360608401526123068188612251565b6001600160a01b0387166080850152905082810360a084015261232981866121a9565b91505061233c60c083018461ffff169052565b98975050505050505050565b634e487b7160e01b600052601160045260246000fd5b60008282101561237057612370612348565b500390565b8051611d5c81611d1f565b6000602080838503121561239357600080fd5b825167ffffffffffffffff808211156123ab57600080fd5b818501915085601f8301126123bf57600080fd5b8151818111156123d1576123d1611d61565b8060051b91506123e2848301611de7565b81815291830184019184810190888411156123fc57600080fd5b938501935b8385101561233c578451925061241683611d1f565b8282529385019390850190612401565b600060001982141561243a5761243a612348565b5060010190565b60006020828403121561245357600080fd5b6040516020810181811067ffffffffffffffff8211171561247657612476611d61565b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114611d5c57600080fd5b805164ffffffffff81168114611d5c57600080fd5b805161ffff81168114611d5c57600080fd5b60006101e082840312156124dd57600080fd5b6124e5611dc3565b6124ef8484612441565b81526124fd60208401612483565b602082015261250e60408401612483565b604082015261251f60608401612483565b606082015261253060808401612483565b608082015261254160a08401612483565b60a082015261255260c084016124a3565b60c082015261256360e084016124b8565b60e0820152610100612576818501612375565b90820152610120612588848201612375565b9082015261014061259a848201612375565b908201526101606125ac848201612375565b908201526101806125be848201612483565b908201526101a06125d0848201612483565b908201526101c06125e2848201612483565b908201529392505050565b6000602082840312156125ff57600080fd5b813567ffffffffffffffff8082111561261757600080fd5b9083019060c0828603121561262b57600080fd5b612633611d77565b823561263e81611d1f565b80825250602083013560208201526040830135604082015260608301358281111561266857600080fd5b61267487828601611e40565b6060830152506080830135608082015260a0830135925061269483611d1f565b60a0810192909252509392505050565b6000602082840312156126b657600080fd5b81518015158114611cb857600080fd5b600082516126d881846020870161217d565b9190910192915050565b600080604083850312156126f557600080fd5b825167ffffffffffffffff81111561270c57600080fd5b8301601f8101851361271d57600080fd5b805161272b611e5f82611e18565b81815286602083850101111561274057600080fd5b61275182602083016020860161217d565b809450505050602083015161276581611d1f565b809150509250929050565b600181815b808511156127ab57816000190482111561279157612791612348565b8085161561279e57918102915b93841c9390800290612775565b509250929050565b6000826127c257506001611bdd565b816127cf57506000611bdd565b81600181146127e557600281146127ef5761280b565b6001915050611bdd565b60ff84111561280057612800612348565b50506001821b611bdd565b5060208310610133831016604e8410600b841016171561282e575081810a611bdd565b6128388383612770565b806000190482111561284c5761284c612348565b029392505050565b6000611cb883836127b3565b60006020828403121561287257600080fd5b8151611cb881611d1f565b60006020828403121561288f57600080fd5b8151611cb881611e96565b634e487b7160e01b600052601260045260246000fd5b6000826128cd57634e487b7160e01b600052601260045260246000fd5b500490565b602081526000611cb860208301846121a956fea264697066735822122083916c2e867ffe5cc5586626cf69491670775747aa658d7b03240abbbe94052f64736f6c634300080a00338be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0";class on extends p.lV{constructor(...e){e.length>1?super(...e):super(nn,rn,e[0])}deploy(e,t,n,r,i){return super.deploy(e,t,n,r,i||{})}getDeployTransaction(e,t,n,r,i){return super.getDeployTransaction(e,t,n,r,i||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static createInterface(){return new Ne.vU(nn)}static connect(e,t){return new p.CH(e,nn,t)}}on.bytecode=rn,on.abi=nn;class sn extends c.Z{constructor(e,t){super(e,on),this.debtSwitchAddress=null!==t&&void 0!==t?t:"",this.contractInterface=on.createInterface(),this.debtSwitch=this.debtSwitch.bind(this)}debtSwitch({user:e,debtAssetUnderlying:t,debtRepayAmount:n,debtRateMode:r,newAssetDebtToken:i,newAssetUnderlying:o,maxNewDebtAmount:s,repayAll:a,txCalldata:c,augustus:u,deadline:d,sigV:f,sigR:p,sigS:h,signedAmount:m}){const g=ft.$.encode(["bytes","address"],[c,u]),y={debtAsset:t,debtRepayAmount:n,debtRateMode:r,newDebtAsset:o,maxNewDebtAmount:s,offset:a?(0,l.mz)(c):0,paraswapData:g},b={debtToken:i,value:m,deadline:d,v:f,r:p,s:h},v={},w=this.contractInterface.encodeFunctionData("swapDebt",[y,b]);return v.to=this.debtSwitchAddress,v.data=w,v.from=e,v}}class an{static connect(e,t){return new p.CH(e,cn,t)}}const cn=[{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"to",type:"address"}],name:"claimRewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"}];class un extends c.Z{constructor(e){super(e,an)}claimRewards({user:e,assets:t,to:n,incentivesControllerAddress:r}){const i=this.getContractInstance(r),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.claimRewards(t,pt.Bz.toString(),null!==n&&void 0!==n?n:e),from:e});return[{tx:o,txType:u.ns.REWARD_ACTION,gas:this.generateTxPriceEstimation([],o)}]}}(0,a.__decorate)([d.nX,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("incentivesControllerAddress")),(0,a.__param)(0,(0,f.Oh)("to")),(0,a.__param)(0,(0,f.Gq)("assets")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],un.prototype,"claimRewards",null);const ln=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!1,internalType:"uint256",name:"emission",type:"uint256"},{indexed:!1,internalType:"uint256",name:"distributionEnd",type:"uint256"}],name:"AssetConfigUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"AssetIndexUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"claimer",type:"address"}],name:"ClaimerSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!0,internalType:"address",name:"rewardOracle",type:"address"}],name:"RewardOracleUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"RewardsAccrued",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"address",name:"claimer",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"RewardsClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!0,internalType:"address",name:"transferStrategy",type:"address"}],name:"TransferStrategyInstalled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"UserIndexUpdated",type:"event"},{inputs:[],name:"PRECISION",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"address",name:"to",type:"address"}],name:"claimAllRewards",outputs:[{internalType:"address[]",name:"rewardsList",type:"address[]"},{internalType:"uint256[]",name:"claimedAmounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"to",type:"address"}],name:"claimAllRewardsOnBehalf",outputs:[{internalType:"address[]",name:"rewardsList",type:"address[]"},{internalType:"uint256[]",name:"claimedAmounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"}],name:"claimAllRewardsToSelf",outputs:[{internalType:"address[]",name:"rewardsList",type:"address[]"},{internalType:"uint256[]",name:"claimedAmounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"claimRewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"claimRewardsOnBehalf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"reward",type:"address"}],name:"claimRewardsToSelf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint104",name:"emissionPerSecond",type:"uint104"},{internalType:"uint256",name:"totalSupply",type:"uint256"},{internalType:"uint40",name:"distributionEnd",type:"uint40"},{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"reward",type:"address"},{internalType:"contract ITransferStrategy",name:"transferStrategy",type:"address"},{internalType:"bytes",name:"transferStrategyParams",type:"bytes"},{internalType:"contract IEACAggregatorProxy",name:"rewardOracle",type:"address"}],internalType:"struct DistributionTypesV2.RewardsConfigInput[]",name:"config",type:"tuple[]"}],name:"configureAssets",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"address",name:"user",type:"address"}],name:"getAllUserRewardsBalance",outputs:[{internalType:"address[]",name:"",type:"address[]"},{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getClaimer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"getDistributionEnd",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"reward",type:"address"}],name:"getRewardOracle",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"getRewardsByAsset",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"getRewardsData",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getRewardsList",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"reward",type:"address"}],name:"getTransferStrategy",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"getUserAssetData",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"getUserRewardsBalance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"getUserUnclaimedRewardsFromStorage",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"userBalance",type:"uint256"},{internalType:"uint256",name:"totalSupply",type:"uint256"}],name:"handleAction",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"claimer",type:"address"}],name:"setClaimer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"reward",type:"address"},{internalType:"uint40",name:"distributionEnd",type:"uint40"}],name:"setDistributionEnd",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reward",type:"address"},{internalType:"contract IEACAggregatorProxy",name:"rewardOracle",type:"address"}],name:"setRewardOracle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reward",type:"address"},{internalType:"contract ITransferStrategy",name:"transferStrategy",type:"address"},{internalType:"bytes",name:"params",type:"bytes"}],name:"setTransferStrategy",outputs:[],stateMutability:"nonpayable",type:"function"}];class dn{static createInterface(){return new Ne.vU(ln)}static connect(e,t){return new p.CH(e,ln,t)}}dn.abi=ln;class fn extends c.Z{constructor(e){super(e,dn)}claimRewards({user:e,assets:t,to:n,incentivesControllerAddress:r,reward:i}){const o=this.getContractInstance(r),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.claimRewards(t,pt.Bz.toString(),null!==n&&void 0!==n?n:e,i),from:e});return[{tx:s,txType:u.ns.REWARD_ACTION,gas:this.generateTxPriceEstimation([],s)}]}claimAllRewards({user:e,assets:t,to:n,incentivesControllerAddress:r}){const i=this.getContractInstance(r),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.claimAllRewards(t,null!==n&&void 0!==n?n:e),from:e});return[{tx:o,txType:u.ns.REWARD_ACTION,gas:this.generateTxPriceEstimation([],o)}]}}(0,a.__decorate)([d.nX,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("incentivesControllerAddress")),(0,a.__param)(0,(0,f.Oh)("to")),(0,a.__param)(0,(0,f.Oh)("reward")),(0,a.__param)(0,(0,f.Gq)("assets")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],fn.prototype,"claimRewards",null),(0,a.__decorate)([d.nX,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("incentivesControllerAddress")),(0,a.__param)(0,(0,f.Oh)("to")),(0,a.__param)(0,(0,f.Gq)("assets")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],fn.prototype,"claimAllRewards",null);var pn=n(27484),hn=n.n(pn),mn=n(45703),gn=n(87385),yn=n(83601),bn=JSON.parse('{"Mt":[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"AddressZero","type":"error"},{"inputs":[],"name":"ETHTransferFailed","type":"error"},{"inputs":[],"name":"EthTransferFailed","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"FallbackNotAllowed","type":"error"},{"inputs":[],"name":"InsufficientPermission","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidLoopCount","type":"error"},{"inputs":[],"name":"InvalidRatio","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReceiveNotAllowed","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_feePercent","type":"uint256"}],"name":"FeePercentUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_treasury","type":"address"}],"name":"TreasuryUpdated","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"MAX_REASONABLE_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RATIO_DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TWO_POW_16","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getConfiguration","outputs":[{"components":[{"internalType":"uint256","name":"data","type":"uint256"}],"internalType":"struct DataTypes.ReserveConfigurationMap","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"borrowRatio","type":"uint256"},{"internalType":"uint256","name":"loopCount","type":"uint256"},{"internalType":"bool","name":"isBorrow","type":"bool"}],"name":"getSupplyBorrowAmount","outputs":[{"internalType":"uint256","name":"aTokenAmount","type":"uint256"},{"internalType":"uint256","name":"debtTokenAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getVDebtToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IPool","name":"_pool","type":"address"},{"internalType":"contract IWETH","name":"_weth","type":"address"},{"internalType":"uint256","name":"_feePercent","type":"uint256"},{"internalType":"address","name":"_treasury","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"interestRateMode","type":"uint256"},{"internalType":"uint256","name":"borrowRatio","type":"uint256"},{"internalType":"uint256","name":"loopCount","type":"uint256"},{"internalType":"bool","name":"isBorrow","type":"bool"}],"name":"loop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"interestRateMode","type":"uint256"},{"internalType":"uint256","name":"borrowRatio","type":"uint256"},{"internalType":"uint256","name":"loopCount","type":"uint256"}],"name":"loopETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"interestRateMode","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"borrowRatio","type":"uint256"},{"internalType":"uint256","name":"loopCount","type":"uint256"}],"name":"loopETHFromBorrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"ltv","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"contract IPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feePercent","type":"uint256"}],"name":"setFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]}');function vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t0&&c.push(e.aTokenAddress),e.vIncentivesData&&e.vIncentivesData.length>0&&c.push(e.variableDebtTokenAddress),e.sIncentivesData&&e.sIncentivesData.length>0&&c.push(e.stableDebtTokenAddress)})),u=new un(t().jsonRpcProvider()),l=new fn(t().jsonRpcProvider()),!t().currentMarketData.v3){e.next=16;break}if("all"!==r.symbol){e.next=13;break}return e.abrupt("return",l.claimAllRewards({user:a,assets:c,to:a,incentivesControllerAddress:r.incentiveControllerAddress}));case 13:return e.abrupt("return",l.claimRewards({user:a,assets:c,to:a,incentivesControllerAddress:r.incentiveControllerAddress,reward:r.rewardTokenAddress}));case 14:e.next=17;break;case 16:return e.abrupt("return",u.claimRewards({user:a,assets:r.assets,to:a,incentivesControllerAddress:r.incentiveControllerAddress}));case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),useOptimizedPath:function(){return t().currentMarketData.v3&&(0,gn.eH)(t().currentChainId)},poolComputed:{get minRemainingBaseTokenBalance(){if(!t())return"0.001";var e=wn({},t()),n=e.currentNetworkConfig,r=e.currentChainId,i=n.underlyingChainId||r;return gn.AU[i]||"0.001"}},generateSignatureRequest:function(){var e=(0,r.Z)(s().mark((function e(n){var r,i,o,a,c,u,l,d,f,p,h,m,g;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.token,i=n.amount,o=n.deadline,a=n.spender,c=t().jsonRpcProvider(),u=new ht.A(c),l=new Ye(c),e.next=6,u.getTokenData(r);case 6:return d=e.sent,f=d.name,e.next=10,c.getNetwork();case 10:return p=e.sent,h=p.chainId,e.next=14,l.getNonce({token:r,owner:t().account});case 14:return m=e.sent,g={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},primaryType:"Permit",domain:{name:f,version:"1",chainId:h,verifyingContract:r},message:{owner:t().account,spender:a,value:i,nonce:m,deadline:o}},e.abrupt("return",JSON.stringify(g));case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),estimateGasLimit:function(){var e=(0,r.Z)(s().mark((function e(n){var r,i,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t().jsonRpcProvider(),i=n.gasLimit?n.gasLimit:_t.O$.from("0"),delete n.gasLimit,e.next=5,r.estimateGas(n);case 5:return o=(o=e.sent).mul(115).div(100),n.gasLimit=o.gt(i)?o:i,e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getLoopApprovedAmount:function(){var e=(0,r.Z)(s().mark((function e(n){var r,i,o,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t().jsonRpcProvider(),i=new ht.A(r),o=t().account,e.next=5,i.approvedAmount({user:o,token:n.token,spender:n.spender});case 5:return a=e.sent,e.abrupt("return",wn({user:o,amount:a.toString()},n));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),loop:function(e){var n=t().account,r={},i=new Ne.vU(bn.Mt).encodeFunctionData("loop",[e.asset,e.amount,e.interestRateMode,e.borrowRatio,e.loopCount,e.isBorrow]);return r.to=e.contract,r.from=n,r.data=i,r.gasLimit=_t.O$.from(l.eB[u.UQ.default].recommended),r},loopETH:function(e){var n=t().account,r={},i=new Ne.vU(bn.Mt),o=e.isSupply?i.encodeFunctionData("loopETH",[e.interestRateMode,e.borrowRatio,e.loopCount]):i.encodeFunctionData("loopETHFromBorrow",[e.interestRateMode,e.amount,e.borrowRatio,e.loopCount]);return r.to=e.contract,r.from=n,r.data=o,e.isSupply&&(r.value=_t.O$.from(e.amount)),r.gasLimit=_t.O$.from(l.eB[u.UQ.supply].recommended),r}}},An=n(81374),En=function(e,t){var n=ve.z2[0],r=ve.ei[n];return{currentMarket:n,currentMarketData:ve.ei[n],currentChainId:r.chainId,currentNetworkConfig:(0,ve.Mo)(r.chainId),jsonRpcProvider:function(){return(0,ve.VH)(t().currentChainId)},setCurrentMarket:function(t,n){if(ve.z2.includes(t)){var r=ve.ei[t];localStorage.setItem("selectedMarket",t),n||(0,An.Qw)("marketName",t),e({currentMarket:t,currentMarketData:r,currentChainId:r.chainId,currentNetworkConfig:(0,ve.Mo)(r.chainId)})}},tryPermit:function(){return!1},invite:"",setInvite:function(t){e({invite:t})}}};function _n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kn(e){for(var t=1;t0?a=this.splitSignedPermits(r):s=await this.approveSupplyAssets(t,e);let c=[];if(i&&i.length>0)c=this.splitSignedCreditDelegationPermits(i);else{const e=await this.approveDelegationTokens(t,o);s.push(...e)}const l=e.map((e=>e.underlyingAsset)),d=n.map((e=>({asset:e.underlyingAsset,rateMode:e.rateMode===u.tk.Stable?1:2}))),f=this.getContractInstance(this.MIGRATOR_ADDRESS),p=this.generateTxCallback({rawTxMethod:async()=>f.populateTransaction.migrate(l,d,a,c),from:t});return s.push({tx:p,txType:u.ns.V3_MIGRATION_ACTION,gas:this.generateTxPriceEstimation(a.length>0?[]:s,p,u.UQ.migrateV3)}),s}async approveDelegationTokens(e,t){return(await Promise.all(t.map((async({amount:t,debtTokenAddress:n})=>this.baseDebtTokenService.isDelegationApproved({debtTokenAddress:n,allowanceGiver:e,allowanceReceiver:this.MIGRATOR_ADDRESS,amount:t,nativeDecimals:!0}))))).map(((n,r)=>{if(n)return;const i=t[r],o=new In.Z(i.amount),s=o.dividedBy(10),a=o.plus(s).toFixed(0);return this.baseDebtTokenService.approveDelegation({user:e,delegatee:this.MIGRATOR_ADDRESS,debtTokenAddress:i.debtTokenAddress,amount:a})})).filter((e=>Boolean(e)))}async approveSupplyAssets(e,t){return(await Promise.all(t.map((async({amount:t,aToken:n})=>this.erc20Service.isApproved({amount:t,spender:this.MIGRATOR_ADDRESS,token:n,user:e,nativeDecimals:!0}))))).map(((n,r)=>{if(n)return;const i=t[r];return this.erc20Service.approve({user:e,token:i.aToken,spender:this.MIGRATOR_ADDRESS,amount:pt.Bz.toString()})})).filter((e=>Boolean(e)))}splitSignedPermits(e){return e.map((e=>{const{aToken:t,deadline:n,value:r,signedPermit:i}=e,o=mn.splitSignature(i);return{aToken:t,deadline:n,value:r,v:o.v,r:o.r,s:o.s}}))}splitSignedCreditDelegationPermits(e){return e.map((e=>{const{debtToken:t,deadline:n,value:r,signedPermit:i}=e,o=mn.splitSignature(i);return{debtToken:t,deadline:n,value:r,v:o.v,r:o.r,s:o.s}}))}}(0,a.__decorate)([d.Wt,(0,a.__param)(0,(0,f.Oh)("asset")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dn.prototype,"getMigrationSupply",null),(0,a.__decorate)([d.Wt,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dn.prototype,"migrate",null);var Pn=n(67728);function Bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mn(e){for(var t=1;t=0?e.selectedMigrationSupplyAssets.splice(n,1):e.selectedMigrationSupplyAssets.push({underlyingAsset:t,enforced:!1})}))}))},toggleMigrationSelectedBorrowAsset:function(t){e((function(e){return ye(e,(function(e){var n=e.selectedMigrationBorrowAssets.findIndex((function(e){return t.debtKey==e.debtKey}));n>=0?e.selectedMigrationBorrowAssets.splice(n,1):e.selectedMigrationBorrowAssets.push(t)}))}))},enforceAsCollateral:function(n){e((function(e){return ye(e,(function(e){var r,i=(0,Pn.Wx)(t(),n),o=null===(r=e.selectedMigrationSupplyAssets[i])||void 0===r?void 0:r.enforced;i>=0&&(e.selectedMigrationSupplyAssets.forEach((function(e){e.enforced=!1})),e.selectedMigrationSupplyAssets[i].enforced=!o)}))}))},resetMigrationSelectedAssets:function(){e({selectedMigrationBorrowAssets:[],selectedMigrationSupplyAssets:[]})},selectAllSupply:function(n){var r=(0,Pn.xk)(t(),n).supplyReserves;if(t().selectedMigrationSupplyAssets.length==r.length||0!=t().selectedMigrationSupplyAssets.length)e({selectedMigrationSupplyAssets:[]});else{var i=r.filter((function(e){return void 0===e.migrationDisabled})).filter((function(e){var n=e.underlyingAsset;return(0,Pn.Wx)(t(),n)<0})).map((function(e){return{underlyingAsset:e.underlyingAsset,enforced:!1}}));e({selectedMigrationSupplyAssets:[].concat((0,Cn.Z)(t().selectedMigrationSupplyAssets),(0,Cn.Z)(i))})}},selectAllBorrow:function(n){var r=(0,Pn.xk)(t(),n).borrowReserves;if(t().selectedMigrationBorrowAssets.length==r.length||0!=t().selectedMigrationBorrowAssets.length)e({selectedMigrationBorrowAssets:[]});else{var i=r.filter((function(e){return void 0===e.migrationDisabled})).filter((function(e){return(0,Pn.Z4)(t().selectedMigrationBorrowAssets,e)<0}));e({selectedMigrationBorrowAssets:[].concat((0,Cn.Z)(t().selectedMigrationBorrowAssets),(0,Cn.Z)(i))})}},getApprovePermitsForSelectedAssets:function(){var n=hn()().unix(),r=(0,Pn.Bx)(t(),n,!0),i=(0,Pn.OH)(t(),n).map((function(e){var t=e.reserve;return{amount:e.increasedAmount,underlyingAsset:t.aTokenAddress,permitType:"SUPPLY_MIGRATOR_V3"}})),o=[].concat((0,Cn.Z)(i),(0,Cn.Z)(r));return e({approvalPermitsForMigrationAssets:o}),o},migrateWithoutPermits:function(){var n=hn()().unix();e({timestamp:n});var r=(0,Pn.rB)(t(),n),i=(0,Pn.k6)(t(),n),o=t().account,s=(0,Pn.Bx)(t(),n).map((function(e){return{debtTokenAddress:e.underlyingAsset,amount:e.amount}}));return t().getMigrationServiceInstance().migrate({repayAssets:i,supplyAssets:r,user:o,creditDelegationApprovals:s,signedCreditDelegationPermits:[],signedSupplyPermits:[]})},migrateWithPermits:function(){var n=(0,r.Z)(s().mark((function n(r,i){var o,a,c,u,l,d,f,p,h;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=hn()().unix(),e({timestamp:o}),a=(0,Pn.Gc)(t(),r,i),c=a.creditDelegationPermits,u=a.supplyPermits,l=(0,Pn.rB)(t(),o),d=(0,Pn.k6)(t(),o),f=t().account,p=(0,Pn.Bx)(t(),o,!0),h=p.map((function(e){return{debtTokenAddress:e.underlyingAsset,amount:e.amount}})),n.abrupt("return",t().getMigrationServiceInstance().migrate({repayAssets:d,supplyAssets:l,user:f,creditDelegationApprovals:h,signedCreditDelegationPermits:c,signedSupplyPermits:u}));case 9:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),getMigratorAddress:function(){return t().currentMarketData.addresses.V3_MIGRATOR||""},getMigrationServiceInstance:function(){var n=t().getMigratorAddress(),r=t().migrationServiceInstances[n];if(r)return r;var o=t().jsonRpcProvider(),s=t().getMigratorAddress(),a=(0,yn.xI)(t()),c=new Ut(o,{POOL:a.addresses.LENDING_POOL,REPAY_WITH_COLLATERAL_ADAPTER:a.addresses.REPAY_WITH_COLLATERAL_ADAPTER,SWAP_COLLATERAL_ADAPTER:a.addresses.SWAP_COLLATERAL_ADAPTER,WETH_GATEWAY:a.addresses.WETH_GATEWAY,L2_ENCODER:a.addresses.L2_ENCODER}),u=t().migrationServiceInstances,l=new Dn(o,s,c);return e({migrationServiceInstances:Mn(Mn({},u),{},(0,i.Z)({},n,l))}),l},getMigrationExceptionSupplyBalances:function(){var n=(0,r.Z)(s().mark((function n(r){var i,o,a,c,u;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=t().currentNetworkConfig.underlyingChainId||t().currentChainId,!((o=Fn[i])&&o.length>0)||t().exceptionsBalancesLoading||0!=Object.keys(t().migrationExceptions).length){n.next=12;break}if(e({exceptionsBalancesLoading:!0}),!((a=r.filter((function(e){return o.indexOf(e.underlyingAsset)>=0&&"0"!==e.scaledATokenBalance}))).length>0)){n.next=12;break}return e({exceptionsBalancesLoading:!0}),c=a.map((function(e){var n=e.scaledATokenBalance,r=e.underlyingAsset;return t().getMigrationServiceInstance().getMigrationSupply({amount:n,asset:r})})),n.next=10,Promise.all(c);case 10:u=n.sent,e((function(e){return ye(e,(function(e){u.forEach((function(t,n){var r=(0,Be.Z)(t,2),i=r[0],o=r[1],s=a[n].underlyingAsset;e.migrationExceptions[s]={v2UnderlyingAsset:s,v3UnderlyingAsset:i.toLowerCase(),amount:o.toString()}})),e.exceptionsBalancesLoading=!1}))}));case 12:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}},jn=function(e,t){return fetch(e,t).then((function(e){if(!e.ok)throw new Error(e.statusText);return"HEAD"===(null===t||void 0===t?void 0:t.method)?Promise.resolve():e.json()}))},Un=(0,ve.Zs)(),Zn=[{inputs:[{internalType:"address",name:"_address",type:"address"}],name:"getL2ReverseRecord",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],Hn=function(){var e=(0,r.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new p.CH("0x135a32c16765cef67dec3ae53b03f8c21feec0d8",Zn,Un),e.prev=1,e.next=4,n.getL2ReverseRecord(t);case 4:return e.abrupt("return",e.sent);case 7:if(e.prev=7,e.t0=e.catch(1),"CALL_EXCEPTION"!==e.t0.code){e.next=11;break}return e.abrupt("return",null);case 11:throw e.t0;case 12:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}(),zn=function(){var e=(0,r.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Hn(t);case 3:return n=e.sent,e.abrupt("return",n);case 7:e.prev=7,e.t0=e.catch(0),console.error("ENS name lookup error",e.t0);case 10:return e.abrupt("return",null);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),Gn=function(){var e=(0,r.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n="https://metadata.ens.domains/mainnet/avatar/".concat(t,"/"),e.next=4,jn(n,{method:"HEAD"});case 4:return e.abrupt("return",n);case 7:e.prev=7,e.t0=e.catch(0),console.error("ENS avatar lookup error",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),Vn=function(){var e=(0,r.Z)(s().mark((function e(t){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zn(t);case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.next=7,Gn(n);case 7:return r=e.sent,e.abrupt("return",{name:n,avatar:r,type:Nn.ENS});case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Wn=(0,ve.Zs)(),qn=[{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"name",outputs:[{name:"ret",type:"string"}],payable:!1,type:"function"}],$n=function(){var e=(0,r.Z)(s().mark((function e(t){var n,r,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new p.CH("0xCE70B7f5BB44BE2f8A7f37f8c162240440Fc6218",qn,Wn),r=(0,Me.namehash)(t.substring(2)+".addr.reverse"),e.prev=2,e.next=5,n.name(r);case 5:return i=e.sent,e.abrupt("return",i);case 9:if(e.prev=9,e.t0=e.catch(2),"CALL_EXCEPTION"!==e.t0.code){e.next=13;break}return e.abrupt("return",null);case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),Kn=function(){var e=(0,r.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,$n(t);case 3:return n=e.sent,e.abrupt("return",n);case 7:e.prev=7,e.t0=e.catch(0),console.error("ENS name lookup error",e.t0);case 10:return e.abrupt("return",null);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),Yn=function(){var e=(0,r.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n="https://metadata.ens.domains/mainnet/avatar/".concat(t,"/"),e.next=4,jn(n,{method:"HEAD"});case 4:return e.abrupt("return",n);case 7:e.prev=7,e.t0=e.catch(0),console.error("ENS avatar lookup error",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),Xn=function(){var e=(0,r.Z)(s().mark((function e(t){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kn(t);case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.next=7,Yn(n);case 7:return r=e.sent,e.abrupt("return",{name:n,avatar:r,type:Nn.ENS});case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Jn=[Xn,Vn];!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ENS=1]="ENS"}(Nn||(Nn={}));var Qn=function(e,t){return{defaultDomain:null,domainsLoading:!1,userDomains:[],fetchConnectedWalletDomains:function(){var n=(0,r.Z)(s().mark((function n(){var r,i,o,a;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e({domainsLoading:!0}),i=t().account,n.next=4,Promise.all(Jn.map((function(e){return e(i)})));case 4:o=n.sent,a=o.filter((function(e){return null!==e})),e({userDomains:a,defaultDomain:null!==(r=a[0])&&void 0!==r?r:null,domainsLoading:!1});case 7:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),clearWalletDomains:function(){e({userDomains:[],defaultDomain:null})}}},er=n(32113),tr=n(9669),nr=n.n(tr);function rr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ir(e){for(var t=1;t0)return n;var r=e.selectedMigrationSupplyAssets.filter((function(n){var r=w(e,n),i=t[r],o=x(e,i);return!!i&&"0"==o&&!i.reserve.isIsolated}));return r.length>0?r:e.selectedMigrationSupplyAssets.filter((function(n){var r=w(e,n),i=t[r];return"0"==x(e,i)&&i.reserve.isIsolated}))}(e,A);if(E.length>0){var _=w(e,E[0]),k=A[_];"0"!==k.reserve.reserveLiquidationThreshold&&k.reserve.isIsolated&&(v=g(g({},k.reserve),{},{enteringIsolationMode:!0}))}}var T=l.filter((function(e){return"0"!==e.underlyingBalance})),S=function(e){var t=[];return e.forEach((function(e){"0"!==e.stableBorrows&&t.push(g(g({},e),{},{interestRate:o.tk.Stable,increasedStableBorrows:e.stableBorrows,increasedVariableBorrows:"0",debtKey:e.reserve.stableDebtTokenAddress})),"0"!==e.variableBorrows&&t.push(g(g({},e),{},{interestRate:o.tk.Variable,increasedStableBorrows:"0",increasedVariableBorrows:e.variableBorrows,debtKey:e.reserve.variableDebtTokenAddress}))})),t}(l),C=T.map((function(t){var n,r,i,o,s=!0,c=w(e,t),u=null===(n=A[c])||void 0===n?void 0:n.reserve.isIsolated,l="0"==(null===(r=A[c])||void 0===r?void 0:r.underlyingBalance),d=A[c];if(d){var f=(0,a.hE)(d.reserve.supplyCap).minus(d.reserve.totalLiquidity),p=d.reserve.formattedBaseLTVasCollateral;0!==b&&d.reserve.eModeCategoryId!==b&&(p=d.reserve.formattedEModeLtv),o={stableBorrowAPY:d.stableBorrowAPY,variableBorrowAPY:d.reserve.variableBorrowAPY,supplyAPY:d.reserve.supplyAPY,aIncentivesData:d.reserve.aIncentivesData,vIncentivesData:d.reserve.vIncentivesData,sIncentivesData:d.reserve.sIncentivesData,priceInUSD:d.reserve.priceInUSD,ltv:p},d.reserve.isFrozen?i=y.ReserveFrozen:f.isGreaterThan(t.underlyingBalance)||(i=y.NotEnoughtSupplies)}else i=y.V3AssetMissing;return s=v?t.underlyingAsset==v.underlyingAsset:"0"!==(null===d||void 0===d?void 0:d.underlyingBalance)?null===d||void 0===d?void 0:d.usageAsCollateralEnabledOnUser:!u,g(g({},t),{},{usageAsCollateralEnabledOnUserV3:s,isolatedOnV3:u,canBeEnforced:l,migrationDisabled:i,v3Rates:o})})),I=S.map((function(e){var t,n,r,i=null===(t=A[e.underlyingAsset])||void 0===t?void 0:t.reserve;v&&!i.borrowableInIsolation&&(n=y.IsolationModeBorrowDisabled);var o=A[e.underlyingAsset];if(o){var c=o.reserve.formattedReserveLiquidationThreshold;0!==b&&(null===i||void 0===i?void 0:i.eModeCategoryId)!==b&&(n=y.EModeBorrowDisabled,c=o.reserve.formattedEModeLiquidationThreshold),r={stableBorrowAPY:o.stableBorrowAPY,variableBorrowAPY:o.reserve.variableBorrowAPY,supplyAPY:o.reserve.stableBorrowAPY,aIncentivesData:o.reserve.aIncentivesData,vIncentivesData:o.reserve.vIncentivesData,sIncentivesData:o.reserve.sIncentivesData,priceInUSD:o.reserve.priceInUSD,liquidationThreshold:c},(0,a.hE)((0,s.gU)(e.increasedStableBorrows,e.reserve.decimals)).plus((0,s.gU)(e.increasedVariableBorrows,e.reserve.decimals)).isGreaterThan(o.reserve.availableLiquidity)?n=y.InsufficientLiquidity:o.reserve.flashLoanEnabled?o.reserve.isFrozen&&(n=y.ReserveFrozen):n=y.AssetNotFlashloanable}else n=y.V3AssetMissing;return g(g({},e),{},{v3Rates:r,migrationDisabled:n})}));return{totalCollateralUSD:d.totalCollateralUSD,totalBorrowsUSD:d.totalBorrowsUSD,healthFactor:d.healthFactor,borrowReserves:I,supplyReserves:C,isolatedReserveV3:v}},E=function(e,t){var n=A(e,t),r=n.supplyReserves,i=n.isolatedReserveV3,o=r.filter((function(t){return b(e,t.underlyingAsset)>=0}));return o.sort((function(e){return i?i.underlyingAsset==e.underlyingAsset?-1:1:e.isolatedOnV3?1:-1})),o},_=function(e,t){return E(e,t).map((function(e){var t=C(e.underlyingBalance),n=(0,s.gU)(t,e.reserve.decimals);return g(g({},e),{},{increasedAmount:n})}))},k=function(e,t){return _(e,t).map((function(e){var t=e.underlyingAsset,n=e.reserve,r=e.increasedAmount,i=Math.floor(Date.now()/1e3+3600);return{amount:r,aToken:n.aTokenAddress,underlyingAsset:t,deadline:i}}))},T=function(e,t){var n=Math.floor(Date.now()/1e3+3600);return I(e,t).map((function(e){return{underlyingAsset:e.underlyingAsset,amount:e.interestRate==o.tk.Stable?e.increasedStableBorrows:e.increasedVariableBorrows,deadline:n,debtToken:e.debtKey,rateMode:e.interestRate}}))},S=function(e,t,n){var r=e.approvalPermitsForMigrationAssets.map((function(e,n){return g(g({},e),{},{signedPermit:t[n]})}));return{supplyPermits:r.filter((function(e){return"SUPPLY_MIGRATOR_V3"===e.permitType})).map((function(e){var t=e.signedPermit,r=e.underlyingAsset,i=e.amount;return{deadline:n,aToken:r,value:i,signedPermit:t}})),creditDelegationPermits:r.filter((function(e){return"BORROW_MIGRATOR_V3"===e.permitType})).map((function(e){var t=e.amount,r=e.signedPermit,i=e.underlyingAsset;return{deadline:n,debtToken:i,signedPermit:r,value:t}}))}},C=function(e){var t=(0,a.hE)(e);return t.plus(t.div(1e3)).toString()},I=function(e,t){return A(e,t).borrowReserves.filter((function(t){return v(e.selectedMigrationBorrowAssets,t)>=0}))},O=function(e,t){var n=M(e,t).userReservesData;return I(e,t).filter((function(e){return void 0===e.migrationDisabled})).map((function(e){var t=e.debtKey,r=n.find((function(t){return t.underlyingAsset==e.underlyingAsset}));return r&&(t=e.interestRate==o.tk.Variable?r.reserve.variableDebtTokenAddress:r.reserve.stableDebtTokenAddress),g(g({},e),{},{debtKey:t})}))},R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=r.marketReferenceCurrencyDecimals,a=r.marketReferenceCurrencyPriceInUsd,l=(0,c.vl)({reserves:e,reserveIncentives:t,currentTimestamp:i,marketReferenceCurrencyDecimals:s,marketReferencePriceInUsd:a}),d=(0,u.G)({currentTimestamp:i,formattedReserves:l,marketReferenceCurrencyDecimals:s,marketReferencePriceInUsd:a,userReserves:n,userEmodeCategoryId:o});return d},D=function(e,t){var n,r=(0,f.qY)(e),i=A(e,t).borrowReserves,s=(null===r||void 0===r||null===(n=r.userReserves)||void 0===n?void 0:n.map((function(t){var n=t.scaledATokenBalance,r=t.principalStableDebt,s=t.scaledVariableDebt;return b(e,t.underlyingAsset)>=0&&(n="0"),e.selectedMigrationBorrowAssets.filter((function(e){return e.underlyingAsset==t.underlyingAsset})).filter((function(e){var t=i.find((function(t){return t.underlyingAsset==e.underlyingAsset}));return!!t&&void 0===t.migrationDisabled})).forEach((function(e){e.interestRate==o.tk.Stable?r="0":s="0"})),g(g({},t),{},{principalStableDebt:r,scaledATokenBalance:n,scaledVariableDebt:s})})))||[],a=(0,f.To)(r);return R(null===r||void 0===r?void 0:r.reserves,null===r||void 0===r?void 0:r.reserveIncentives,s,a,t,null===r||void 0===r?void 0:r.userEmodeCategoryId)},P=function(e,t,n){var r=M(e,t).userReservesData,i=I(e,t),c={};return i.filter((function(e){return void 0===e.migrationDisabled})).forEach((function(e){var t=r.find((function(t){return t.underlyingAsset===e.underlyingAsset}));if(t){c[e.underlyingAsset]||(c[e.underlyingAsset]={variableDebtTokenAddress:t.reserve.variableDebtTokenAddress,decimals:t.reserve.decimals,stableDebtAmount:"0",variableDebtAmount:"0"});var n=c[e.underlyingAsset];e.interestRate===o.tk.Stable?n.stableDebtAmount=(0,a.hE)(n.stableDebtAmount).plus((0,a.hE)(e.increasedStableBorrows)).toString():e.interestRate===o.tk.Variable&&(n.variableDebtAmount=(0,a.hE)(n.variableDebtAmount).plus((0,a.hE)(e.increasedVariableBorrows)).toString())}})),Object.keys(c).map((function(e){var t=c[e],r=(0,a.hE)(t.stableDebtAmount).plus(t.variableDebtAmount),i=(0,s.gU)(r.toString(),t.decimals);if(n){var o=new d.Z(i),u=o.dividedBy(10);i=o.plus(u).toFixed(0)}return{amount:i,underlyingAsset:t.variableDebtTokenAddress,permitType:"BORROW_MIGRATOR_V3"}}))},B=function(e,t){var n=M(e,t),r=(0,f.$)(e),i=E(e,t),o=O(e,t),c=i.reduce((function(e,t){return e[t.underlyingAsset]=t,e}),{}),u=o.reduce((function(e,t){return e[t.debtKey]=t,e}),{}),d=n.userReservesData.map((function(t){var n=u[t.reserve.stableDebtTokenAddress],r=u[t.reserve.variableDebtTokenAddress],i=function(e,t){var n=Object.values(e.migrationExceptions).find((function(e){return e.v3UnderlyingAsset==t.underlyingAsset}));return(null===n||void 0===n?void 0:n.v2UnderlyingAsset)||t.underlyingAsset}(e,t),o=c[i],d=t.scaledVariableDebt,f=t.scaledATokenBalance,p=t.usageAsCollateralEnabledOnUser,h=(0,a.hE)(t.reserve.variableBorrowIndex);if(r&&void 0===r.migrationDisabled){var m=(0,l.e9)((0,s.gU)(r.increasedVariableBorrows,t.reserve.decimals),h);d=(0,a.hE)(d).plus(m).toString()}if(n&&void 0===n.migrationDisabled){var y=(0,l.e9)((0,s.gU)(n.increasedStableBorrows,t.reserve.decimals),h);d=(0,a.hE)(d).plus(y).toString()}if(o){var b;p=o.usageAsCollateralEnabledOnUserV3;var v=(0,a.hE)(t.scaledATokenBalance),w=(0,a.hE)(t.reserve.liquidityIndex),x=(null===(b=e.migrationExceptions[i])||void 0===b?void 0:b.amount)||(0,s.gU)(o.underlyingBalance,t.reserve.decimals),A=(0,l.e9)(x,w);f=v.plus(A).toString()}return g(g({},t),{},{id:t.reserve.id,scaledVariableDebt:d,scaledATokenBalance:f,usageAsCollateralEnabledOnUser:p})})),p=(0,f.To)(r),h=R(null===r||void 0===r?void 0:r.reserves,null===r||void 0===r?void 0:r.reserveIncentives,d,p,t,null===r||void 0===r?void 0:r.userEmodeCategoryId);return{healthFactor:h.healthFactor,currentLoanToValue:h.currentLoanToValue,totalCollateralMarketReferenceCurrency:h.totalCollateralMarketReferenceCurrency,totalBorrowsMarketReferenceCurrency:h.totalBorrowsMarketReferenceCurrency}},M=function(e,t){var n=(0,f.$)(e),r=(0,f.To)(n);return R(null===n||void 0===n?void 0:n.reserves,null===n||void 0===n?void 0:n.reserveIncentives,null===n||void 0===n?void 0:n.userReserves,r,t,null===n||void 0===n?void 0:n.userEmodeCategoryId)},N=function(e){return Boolean(e.currentMarketData.addresses.V3_MIGRATOR)},F=function(e,t){return void 0!==t.find((function(t){return t.underlyingAsset===e.underlyingAsset}))},L=function(e,t){var n=e.filter((function(e){return void 0===e.migrationDisabled}));return{activeSelections:n.filter((function(e){return F(e,t)})),activeUnselected:n.filter((function(e){return!F(e,t)}))}}},32113:function(e,t,n){"use strict";var r;n.d(t,{n:function(){return r},h:function(){return o}}),function(e){e.APPROVE="Transaction",e.PERMIT="Signed message"}(r||(r={}));var i=function(){var e=localStorage.getItem("walletApprovalPreferences");return e?JSON.parse(e):{}},o=function(e,t){return{account:"",accountLoading:!1,walletType:void 0,setWalletType:function(t){e({walletType:t})},setAccount:function(n){e({account:n||"",isWalletModalOpen:!1}),(0,t().refreshWalletApprovalMethod)()},setAccountLoading:function(t){e({accountLoading:t})},isWalletModalOpen:!1,setWalletModalOpen:function(t){e({isWalletModalOpen:t})},walletApprovalMethodPreference:r.PERMIT,setWalletApprovalMethodPreference:function(n){var r=t().account;if(""!==r){var o=i();o[r.toLowerCase()]=n,localStorage.setItem("walletApprovalPreferences",JSON.stringify(o)),e((function(){return{walletApprovalMethodPreference:n}}))}},refreshWalletApprovalMethod:function(){var n=t().account;if(""!==n){var o=i()[n.toLowerCase()];e((function(){return{walletApprovalMethodPreference:o||r.PERMIT}}))}}}}},30449:function(e,t,n){"use strict";n.d(t,{_:function(){return q},z:function(){return $}});var r=n(67294),i=n(17674),o=n(50029),s=n(92777),a=n(82262),c=n(59499),u=n(87794),l=n.n(u),d=n(24387),f=n(1279),p=n(45626),h=function(e,t){return e.toLocaleLowerCase()===t.toLocaleLowerCase()?"":e},m=function(){function e(t,n){(0,s.Z)(this,e),this.chainId=n,(0,c.Z)(this,"governanceService",void 0),this.governanceService=new d.d(t,{GOVERNANCE_ADDRESS:p.d.addresses.AAVE_GOVERNANCE_V2,GOVERNANCE_HELPER_ADDRESS:p.d.addresses.AAVE_GOVERNANCE_V2_HELPER,ipfsGateway:p.d.ipfsGateway})}return(0,a.Z)(e,[{key:"getVotingPowerAt",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.governanceService.getVotingPowerAt(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getVoteOnProposal",value:function(){var e=(0,o.Z)(l().mark((function e(t){var n,r,i;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.governanceService.getVoteOnProposal(t);case 2:return n=e.sent,r=n.votingPower,i=n.support,e.abrupt("return",{votingPower:(0,f.Fv)(r.toString(),18),support:i});case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPowers",value:function(){var e=(0,o.Z)(l().mark((function e(t){var n,r,o,s,a,c,u,d;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.user,r=p.d.aaveTokenAddress,o=p.d.stkAaveTokenAddress,e.next=4,this.governanceService.getTokensPower({user:n,tokens:[r,o]});case 4:return s=e.sent,a=(0,i.Z)(s,2),c=a[0],u=a[1],d={votingPower:(0,f.Fv)((0,f.hE)(c.votingPower.toString()).plus(u.votingPower.toString()).toString(),18),aaveTokenPower:c,stkAaveTokenPower:u,propositionPower:(0,f.Fv)((0,f.hE)(c.propositionPower.toString()).plus(u.propositionPower.toString()).toString(),18),aaveVotingDelegatee:h(c.delegatedAddressVotingPower,n),aavePropositionDelegatee:h(c.delegatedAddressPropositionPower,n),stkAaveVotingDelegatee:h(u.delegatedAddressVotingPower,n),stkAavePropositionDelegatee:h(u.delegatedAddressPropositionPower,n)},e.abrupt("return",d);case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}(),g=n(56371),y=n(58342);class b extends y.lV{constructor(e){super(v,w,e)}static connect(e,t){return new y.CH(e,v,t)}}const v=[{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"token",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"users",type:"address[]"},{internalType:"address[]",name:"tokens",type:"address[]"}],name:"batchBalanceOf",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"provider",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"getUserWalletBalances",outputs:[{internalType:"address[]",name:"",type:"address[]"},{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}],w="0x608060405234801561001057600080fd5b50610a63806100206000396000f3fe6080604052600436106100385760003560e01c80630240534314610072578063b59b28ef146100a9578063f7888aec146100d65761006d565b3661006d5761004633610103565b61006b5760405162461bcd60e51b8152600401610062906109c9565b60405180910390fd5b005b600080fd5b34801561007e57600080fd5b5061009261008d366004610758565b61013f565b6040516100a092919061092f565b60405180910390f35b3480156100b557600080fd5b506100c96100c4366004610790565b6104b1565b6040516100a0919061098f565b3480156100e257600080fd5b506100f66100f1366004610758565b61058d565b6040516100a091906109e5565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061013757508115155b949350505050565b6060806000846001600160a01b0316630261bf8b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561017d57600080fd5b505afa158015610191573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b5919061073c565b90506060816001600160a01b031663d1946dbc6040518163ffffffff1660e01b815260040160006040518083038186803b1580156101f257600080fd5b505afa158015610206573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261022e91908101906107f9565b90506060815160010167ffffffffffffffff8111801561024d57600080fd5b50604051908082528060200260200182016040528015610277578160200160208202803683370190505b50905060005b82518110156102c65782818151811061029257fe5b60200260200101518282815181106102a657fe5b6001600160a01b039092166020928302919091019091015260010161027d565b5073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee818351815181106102e957fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506060815167ffffffffffffffff8111801561032357600080fd5b5060405190808252806020026020018201604052801561034d578160200160208202803683370190505b50905060005b835181101561046b576103646106b9565b856001600160a01b031663c44b11f785848151811061037f57fe5b60200260200101516040518263ffffffff1660e01b81526004016103a3919061091b565b60206040518083038186803b1580156103bb57600080fd5b505afa1580156103cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f391906108a4565b905060006104008261067d565b50505090508061042b57600084848151811061041857fe5b6020026020010181815250505050610463565b6104488a86858151811061043b57fe5b602002602001015161058d565b84848151811061045457fe5b60200260200101818152505050505b600101610353565b5061048a8773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61058d565b8184518151811061049757fe5b6020908102919091010152909450925050505b9250929050565b60608084830267ffffffffffffffff811180156104cd57600080fd5b506040519080825280602002602001820160405280156104f7578160200160208202803683370190505b50905060005b858110156105835760005b8481101561057a5761055588888481811061051f57fe5b90506020020160208101906105349190610719565b87878481811061054057fe5b90506020020160208101906100f19190610719565b83518490848802840190811061056757fe5b6020908102919091010152600101610508565b506001016104fd565b5095945050505050565b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156105c557506001600160a01b03821631610677565b6105d7826001600160a01b0316610103565b1561065f576040516370a0823160e01b81526001600160a01b038316906370a082319061060890869060040161091b565b60206040518083038186803b15801561062057600080fd5b505afa158015610634573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065891906108c9565b9050610677565b60405162461bcd60e51b8152600401610062906109a2565b92915050565b51670100000000000000811615159167020000000000000082161515916704000000000000008116151591670800000000000000909116151590565b6040518060200160405280600081525090565b805161067781610a15565b60008083601f8401126106e8578182fd5b50813567ffffffffffffffff8111156106ff578182fd5b60208301915083602080830285010111156104aa57600080fd5b60006020828403121561072a578081fd5b813561073581610a15565b9392505050565b60006020828403121561074d578081fd5b815161073581610a15565b6000806040838503121561076a578081fd5b823561077581610a15565b9150602083013561078581610a15565b809150509250929050565b600080600080604085870312156107a5578182fd5b843567ffffffffffffffff808211156107bc578384fd5b6107c8888389016106d7565b909650945060208701359150808211156107e0578384fd5b506107ed878288016106d7565b95989497509550505050565b6000602080838503121561080b578182fd5b825167ffffffffffffffff80821115610822578384fd5b818501915085601f830112610835578384fd5b815181811115610843578485fd5b83810291506108538483016109ee565b8181528481019084860184860187018a101561086d578788fd5b8795505b83861015610897576108838a826106cc565b835260019590950194918601918601610871565b5098975050505050505050565b6000602082840312156108b5578081fd5b6108bf60206109ee565b9151825250919050565b6000602082840312156108da578081fd5b5051919050565b6000815180845260208085019450808401835b83811015610910578151875295820195908201906001016108f4565b509495945050505050565b6001600160a01b0391909116815260200190565b604080825283519082018190526000906020906060840190828701845b828110156109715781516001600160a01b03168452928401929084019060010161094c565b5050508381038285015261098581866108e1565b9695505050505050565b60006020825261073560208301846108e1565b6020808252600d908201526c24a72b20a624a22faa27a5a2a760991b604082015260600190565b602080825260029082015261191960f11b604082015260600190565b90815260200190565b60405181810167ffffffffffffffff81118282101715610a0d57600080fd5b604052919050565b6001600160a01b0381168114610a2a57600080fd5b5056fea26469706673582212207ae67703d49267c117fb5657d5acf71315b42fa382a2989a68cd98ccc5351bc964736f6c634300060c0033";class x{constructor(e){this._contract=b.connect(e.walletBalanceProviderAddress,e.provider)}async balanceOf(e,t){if(!(0,g.isAddress)(e))throw new Error("User address is not a valid ethereum address");if(!(0,g.isAddress)(t))throw new Error("Token address is not a valid ethereum address");return this._contract.balanceOf(e,t)}async batchBalanceOf(e,t){if(!e.every((e=>(0,g.isAddress)(e))))throw new Error("One of the user address is not a valid ethereum address");if(!t.every((e=>(0,g.isAddress)(e))))throw new Error("One of the token address is not a valid ethereum address");return this._contract.batchBalanceOf(e,t)}async getUserWalletBalancesForLendingPoolProvider(e,t){if(!(0,g.isAddress)(e))throw new Error("User address is not a valid ethereum address");if(!(0,g.isAddress)(t))throw new Error("Lending pool address provider is not a valid ethereum address");return this._contract.getUserWalletBalances(t,e)}}var A=function(){function e(t,n,r){var i=this;(0,s.Z)(this,e),this.chainId=r,(0,c.Z)(this,"walletBalanceService",void 0),(0,c.Z)(this,"getTokenBalanceOf",function(){var e=(0,o.Z)(l().mark((function e(t){var n,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.tokenAddress,r=t.user,e.next=3,i.walletBalanceService.balanceOf(r,n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.walletBalanceService=new x({walletBalanceProviderAddress:n,provider:t})}return(0,a.Z)(e,[{key:"getGovernanceTokensBalance",value:function(){var e=(0,o.Z)(l().mark((function e(t){var n,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.user,e.next=3,this.walletBalanceService.batchBalanceOf([n],[p.d.aaveTokenAddress,p.d.aAaveTokenAddress,p.d.stkAaveTokenAddress]);case 3:return r=e.sent,e.abrupt("return",{aave:(0,f.Fv)(r[0].toString(),18),aAave:(0,f.Fv)(r[1].toString(),18),stkAave:(0,f.Fv)(r[2].toString(),18)});case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPoolTokensBalances",value:function(){var e=(0,o.Z)(l().mark((function e(t){var n,r,i,o,s,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.user,r=t.lendingPoolAddressProvider,e.next=3,this.walletBalanceService.getUserWalletBalancesForLendingPoolProvider(n,r);case 3:return i=e.sent,o=i[0],s=i[1],a=o.map((function(e,t){return{address:e.toLowerCase(),amount:s[t].toString()}})),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}(),E=n(69311),_=n(63206),k=n(38776),T=n(59370),S=n(9704),C=n(21380),I=n(3408),O=n(67724),R=n(87940),D=n(16649),P=n(74450),B=n(81531),M=n(63553),N=n(37247),F=n(11466);function L(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,N.Z)(e);if(t){var i=(0,N.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,M.Z)(this,n)}}var j=function(e){(0,B.Z)(n,e);var t=L(n);function n(){return(0,s.Z)(this,n),t.apply(this,arguments)}return(0,a.Z)(n,[{key:"connect",value:function(e){return(0,P.Z)((0,N.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new F.CH(e,U,t)}}]),n}(F.CH),U=[{inputs:[{internalType:"address",name:"_userAddress",type:"address"}],name:"getLPLockDetails",outputs:[{components:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"power",type:"uint256"},{internalType:"uint256",name:"apr",type:"uint256"}],internalType:"struct VestedZeroUiHelper.LockedBalanceWithApr[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_userAddress",type:"address"}],name:"getLockDetails",outputs:[{components:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"power",type:"uint256"},{internalType:"uint256",name:"apr",type:"uint256"}],internalType:"struct VestedZeroUiHelper.LockedBalanceWithApr[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_userAddress",type:"address"}],name:"getVestedNFTData",outputs:[{components:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"cliffDuration",type:"uint256"},{internalType:"uint256",name:"unlockDate",type:"uint256"},{internalType:"uint256",name:"pendingClaimed",type:"uint256"},{internalType:"uint256",name:"pending",type:"uint256"},{internalType:"uint256",name:"upfrontClaimed",type:"uint256"},{internalType:"uint256",name:"upfront",type:"uint256"},{internalType:"uint256",name:"linearDuration",type:"uint256"},{internalType:"uint256",name:"createdAt",type:"uint256"},{internalType:"bool",name:"hasPenalty",type:"bool"},{internalType:"enum IVestedZeroNFT.VestCategory",name:"category",type:"uint8"},{internalType:"uint256",name:"claimable",type:"uint256"},{internalType:"uint256",name:"unClaimed",type:"uint256"},{internalType:"uint256",name:"penalty",type:"uint256"},{internalType:"bool",name:"isFrozen",type:"bool"}],internalType:"struct VestedZeroUiHelper.VestDetails[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_vestedZeroNFT",type:"address"},{internalType:"address",name:"_omnichainStakingToken",type:"address"},{internalType:"address",name:"_omnichainStakingLP",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"}],Z=function(){function e(t){(0,s.Z)(this,e),(0,c.Z)(this,"_contract",void 0),this._contract=j.connect(t.uiStakeDataProvider,t.provider)}return(0,a.Z)(e,[{key:"getUserVestingData",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getVestedNFTData(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getUserLockData",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getLockDetails(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getUserLPLockData",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getLPLockDetails(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),H=function(){function e(t,n,r){(0,s.Z)(this,e),this.chainId=r,(0,c.Z)(this,"vestUIDataService",void 0),this.vestUIDataService=new Z({uiStakeDataProvider:n,provider:t})}return(0,a.Z)(e,[{key:"getGeneralVestUIDataHumanized",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.vestUIDataService.getUserVestingData(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getGenralStakeUIDataHumanized",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.vestUIDataService.getUserLockData(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getGenralLPLockUIDataHumanized",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.vestUIDataService.getUserLPLockData(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}(),z=n(59027),G=n(24243),V=n(85893),W=(0,r.createContext)(null),q=function(e){var t=e.children,n=(0,E.Yh)((function(e){return e.currentNetworkConfig})),r=(0,E.Yh)((function(e){return e.currentMarketData})),i=n.isFork&&n.underlyingChainId===p.d.chainId?r.chainId:p.d.chainId,o=(0,_.VH)(r.chainId),s=o,a=(0,_.VH)(T.H.chainId),c=(0,_.VH)(T.H.chainId),u=(0,_.VH)(T.H.chainId),l=(0,_.VH)(T.H.chainId),d=(0,_.VH)(T.H.chainId),f=(0,_.VH)(T.H.chainId),h=(0,_.VH)(T.H.chainId),g=(0,_.VH)(T.H.chainId),y=new m(s,i),b=new A(s,p.d.walletBalanceProvider,i),v=new G.A(o),w=new A(o,r.addresses.WALLET_BALANCE_PROVIDER,r.chainId),x=new A(o,r.addresses.WALLET_BALANCE_PROVIDER,r.chainId),k=new S.N(a,T.H.crossChainAddresses[T.H.chainId].VESTING_ADDRESS,T.H.chainId),P=new C.s(c,T.H.crossChainAddresses[T.H.chainId].LOCKER_TOKEN,T.H.chainId),B=new I.n(u,T.H.governance.POOL_VOTER,T.H.chainId),M=new O.y(l,T.H.crossChainAddresses[T.H.chainId].OMNI_STAKING,T.H.chainId),N=new R.K(d,T.H.governance.ZERO_AIRDROP,T.H.chainId),F=new D.w(f,T.H.crossChainAddresses[T.H.chainId].ORACLE_ADDRESS,T.H.chainId),L=new H(h,T.H.crossChainAddresses[T.H.chainId].VESTING_UI_PROVIDER,r.chainId),j=new z.T(g,T.H.crossChainAddresses[T.H.chainId].OMNI_STAKING_LP,T.H.chainId);return(0,V.jsx)(W.Provider,{value:{governanceService:y,governanceWalletBalanceService:b,poolTokensBalanceService:w,tokenBalanceService:x,vestingDataService:k,lockDataService:P,poolVotingDataService:B,omniStakingDataService:M,airdropDataService:N,oracleDataService:F,erc20Service:v,vestUIDataService:L,omniLPStakingDataService:j},children:t})},$=function(){var e=(0,r.useContext)(W);return(0,k.Z)(e,"Component should be wrapper inside a "),e}},39771:function(e,t,n){"use strict";n.d(t,{aD:function(){return r},WG:function(){return s}});var r,i=n(49501),o=n(85893);!function(e){e[e.APPROVAL=0]="APPROVAL",e[e.MAIN_ACTION=1]="MAIN_ACTION",e[e.GAS_ESTIMATION=2]="GAS_ESTIMATION"}(r||(r={}));var s=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=1;if("MetaMask Tx Signature: User denied transaction signature."===e.message||"MetaMask Message Signature: User denied message signature."===e.message)return{error:a[4001],blocking:!1,actionBlocked:!1,rawError:e,txAction:t};if(e.message.includes("insufficient funds for intrinsic transaction cost"))return{error:a[4002],blocking:!1,actionBlocked:!1,rawError:e,txAction:t};try{var i,o=JSON.parse(null===e||void 0===e||null===(i=e.error)||void 0===i?void 0:i.body),s=Number(o.error.message.split(": ")[1]);isNaN(s)||(r=s)}catch(u){}var c=a[r];return c?{error:c,blocking:n,actionBlocked:!0,rawError:e,txAction:t}:{error:void 0,blocking:n,actionBlocked:!0,rawError:e,txAction:t}},a={7:(0,o.jsx)(i.cC,{id:"Pool addresses provider is not registered"}),9:(0,o.jsx)(i.cC,{id:"Address is not a contract"}),11:(0,o.jsx)(i.cC,{id:"The caller of the function is not an AToken"}),12:(0,o.jsx)(i.cC,{id:"The address of the pool addresses provider is invalid"}),13:(0,o.jsx)(i.cC,{id:"Invalid return value of the flashloan executor function"}),19:(0,o.jsx)(i.cC,{id:"Invalid flashloan premium"}),22:(0,o.jsx)(i.cC,{id:"Invalid bridge protocol fee"}),23:(0,o.jsx)(i.cC,{id:"The caller of this function must be a pool"}),24:(0,o.jsx)(i.cC,{id:"Invalid amount to mint"}),25:(0,o.jsx)(i.cC,{id:"Invalid amount to burn"}),26:(0,o.jsx)(i.cC,{id:"Amount must be greater than 0"}),27:(0,o.jsx)(i.cC,{id:"Action requires an active reserve"}),28:(0,o.jsx)(i.cC,{id:"Action cannot be performed because the reserve is frozen"}),29:(0,o.jsx)(i.cC,{id:"Action cannot be performed because the reserve is paused"}),30:(0,o.jsx)(i.cC,{id:"Borrowing is not enabled"}),31:(0,o.jsx)(i.cC,{id:"Stable borrowing is not enabled"}),32:(0,o.jsx)(i.cC,{id:"User cannot withdraw more than the available balance"}),34:(0,o.jsx)(i.cC,{id:"The collateral balance is 0"}),35:(0,o.jsx)(i.cC,{id:"Health factor is lesser than the liquidation threshold"}),36:(0,o.jsx)(i.cC,{id:"There is not enough collateral to cover a new borrow"}),37:(0,o.jsx)(i.cC,{id:"Collateral is (mostly) the same currency that is being borrowed"}),38:(0,o.jsx)(i.cC,{id:"The requested amount is greater than the max loan size in stable rate mode"}),39:(0,o.jsx)(i.cC,{id:"For repayment of a specific type of debt, the user needs to have debt that type"}),40:(0,o.jsx)(i.cC,{id:"To repay on behalf of a user an explicit amount to repay is needed"}),41:(0,o.jsx)(i.cC,{id:"User does not have outstanding stable rate debt on this reserve"}),42:(0,o.jsx)(i.cC,{id:"User does not have outstanding variable rate debt on this reserve"}),43:(0,o.jsx)(i.cC,{id:"The underlying balance needs to be greater than 0"}),44:(0,o.jsx)(i.cC,{id:"Interest rate rebalance conditions were not met"}),45:(0,o.jsx)(i.cC,{id:"Health factor is not below the threshold"}),46:(0,o.jsx)(i.cC,{id:"The collateral chosen cannot be liquidated"}),47:(0,o.jsx)(i.cC,{id:"User did not borrow the specified currency"}),48:(0,o.jsx)(i.cC,{id:"Borrow and repay in same block is not allowed"}),49:(0,o.jsx)(i.cC,{id:"Inconsistent flashloan parameters"}),50:(0,o.jsx)(i.cC,{id:"Borrow cap is exceeded"}),51:(0,o.jsx)(i.cC,{id:"Supply cap is exceeded"}),52:(0,o.jsx)(i.cC,{id:"Unbacked mint cap is exceeded"}),53:(0,o.jsx)(i.cC,{id:"Debt ceiling is exceeded"}),54:(0,o.jsx)(i.cC,{id:"AToken supply is not zero"}),55:(0,o.jsx)(i.cC,{id:"Stable debt supply is not zero"}),56:(0,o.jsx)(i.cC,{id:"Variable debt supply is not zero"}),57:(0,o.jsx)(i.cC,{id:"Ltv validation failed"}),60:(0,o.jsx)(i.cC,{id:"Asset is not borrowable in isolation mode"}),62:(0,o.jsx)(i.cC,{id:"User is in isolation mode"}),76:(0,o.jsx)(i.cC,{id:"Array parameters that should be equal length are not"}),77:(0,o.jsx)(i.cC,{id:"Zero address not valid"}),78:(0,o.jsx)(i.cC,{id:"Invalid expiration"}),79:(0,o.jsx)(i.cC,{id:"Invalid signature"}),80:(0,o.jsx)(i.cC,{id:"Operation not supported"}),81:(0,o.jsx)(i.cC,{id:"Debt ceiling is not zero"}),82:(0,o.jsx)(i.cC,{id:"Asset is not listed"}),85:(0,o.jsx)(i.cC,{id:"The underlying asset cannot be rescued"}),88:(0,o.jsx)(i.cC,{id:"Stable borrowing is enabled"}),89:(0,o.jsx)(i.cC,{id:"User is trying to borrow multiple assets including a siloed one"}),4001:(0,o.jsx)(i.cC,{id:"You cancelled the transaction."}),4002:(0,o.jsx)(i.cC,{id:"Insufficient funds for intrinsic transaction cost"})}},45626:function(e,t,n){"use strict";n.d(t,{d:function(){return r}});var r={chainId:n(75331).a_.mainnet,votingAssetName:"AAVE + stkAAVE",averageNetworkBlockTime:13.5,queryGovernanceDataUrl:"https://api.thegraph.com/subgraphs/name/aave/governance-v2",wsGovernanceDataUrl:"wss://api.thegraph.com/subgraphs/name/aave/governance-v2",aaveTokenAddress:"0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",aAaveTokenAddress:"0xDa5E8e1C3596D3Cc11a4dd5aD66b8f03B5410F8C",stkAaveTokenAddress:"0x4da27a545c0c5b758a6ba100e3a049001de870f5",governanceForumLink:"https://governance.aave.com",governanceFAQLink:"https://docs.aave.com/faq/governance",walletBalanceProvider:"0x8E8dAd5409E0263a51C0aB5055dA66Be28cFF922",governanceSnapshotLink:"https://snapshot.org/#/aave.eth",addresses:{AAVE_GOVERNANCE_V2:"0xEC568fffba86c094cf06b22134B23074DFE2252c",AAVE_GOVERNANCE_V2_EXECUTOR_SHORT:"0x61910EcD7e8e942136CE7Fe7943f956cea1CC2f7",AAVE_GOVERNANCE_V2_EXECUTOR_LONG:"0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",AAVE_GOVERNANCE_V2_HELPER:"0xBb7baf0534423e3108E1D03c259104cDba2C1cB7"},ipfsGateway:"https://cloudflare-ipfs.com/ipfs",fallbackIpfsGateway:"https://ipfs.io/ipfs"}},34314:function(e,t,n){"use strict";n.d(t,{z:function(){return r},M:function(){return i}});var r={KNC_USDC_USDT:{liquidityPoolLink:"https://kyberswap.com/zksync/add/0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4/0x493257fD37EDB34451f62EDf8D2a0C418852bA4C/0x4d321cd88c5680ce4f85bb58c578dfe9c2cc1ef6"},VAMM_AERO_USDC:{liquidityPoolLink:"https://aerodrome.finance/deposit?token0=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&token1=0x940181a94A35A4569E4529A3CDfB74e38FD98631&type=-1"},VAMM_USDZ_USDC:{liquidityPoolLink:"https://app.maha.xyz/earn/pool/8453/0x1097dFe9539350cb466dF9CA89A5e61195A520B0/"},NYLE_ETH_ZERO:{liquidityPoolLink:"https://www.nile.build/manage/v1/0x0040f36784dda0821e74ba67f86e084d70d67a3a"}};function i(e){return!!r[e]}},57014:function(e,t,n){"use strict";n.d(t,{el:function(){return i},ei:function(){return a}});var r,i,o=n(59499),s=n(75331);new Date("May 6, 2024 8:00:00 UTC").getTime(),new Date("May 6, 2024 7:30:00 UTC").getTime();!function(e){e.proto_zksync_era_v3="proto_zksync_era_v3",e.proto_linea_v3="proto_linea_v3",e.proto_base_v3="proto_base_v3",e.proto_linea_croak_v3="proto_linea_croak_v3",e.proto_linea_foxy_v3="proto_linea_foxy_v3",e.proto_manta_v3="proto_manta_v3",e.proto_linea_sepolia_v3="proto_linea_sepolia_v3",e.proto_blast_v3="proto_blast_v3",e.proto_zircuit_v3="proto_zircuit_v3",e.proto_mainnet_lrt_v3="proto_mainnet_lrt_v3",e.proto_mainnet_btc_v3="proto_mainnet_btc_v3",e.proto_mainnet_rwa_v3="proto_mainnet_rwa_v3",e.proto_layerx_v3="proto_layerx_v3"}(i||(i={}));var a=(r={},(0,o.Z)(r,i.proto_linea_v3,{marketTitle:"Linea",marketAltName:"Linea Main Market",grpKey:"linea",chainId:59144,v3:!0,enabledFeatures:{governance:!0,staking:!0,collateralRepay:!1,incentives:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xC44827C51d00381ed4C52646aeAB45b455d200eB",LENDING_POOL:"0x2f9bB73a8e98793e26Cb2F6C4ad037BDf1C6B269",WETH_GATEWAY:"0x5d50bE703836C330Fc2d147a631CDd7bb8D7171c",WALLET_BALANCE_PROVIDER:"0xE05361EA51E20118072aec0fB0FD178e8b09D69e",UI_POOL_DATA_PROVIDER:"0x81b3184A3B5d4612F2c26A53Da8D99474B91B2D2",UI_INCENTIVE_DATA_PROVIDER:"0xCbDc0aeD7CDf2472784068abEf23a902CafABb98",OFT_ADAPTER:"0x671FbC39D7C99735E99Ce6918ff0666E88971D45",STAKING_BONUS:"0xD676c56A93Fe2a05233Ce6EAFEfDe2bd4017B3eA",OMNI_STAKING:"0xf374229a18ff691406f99CCBD93e8a3f16B68888",LOCKER_TOKEN:"0x08D5FEA625B1dBf9Bae0b97437303a0374ee02F8",ZERO_ADDRESS:"0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7",VESTING_ADDRESS:"0x9FA72ea96591e486FF065E7C8A89282dEDfA6C12",POOL_VOTER:"0x5346e9ab27D7874Db95993667D1Cb8338913f0aF",ORACLE_ADDRESS:"0x1C2B983E1FE9830B80c315b7dd2A331960C842DC",ZERO_AIRDROP:"0x569982A604cA61fa425fD924ADF08BE9e4f3035f"}}),(0,o.Z)(r,i.proto_base_v3,{marketTitle:"Base",chainId:8453,v3:!0,disableCharts:!0,enabledFeatures:{incentives:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0x5213ab3997a596c75Ac6ebF81f8aEb9cf9A31007",LENDING_POOL:"0x766f21277087E18967c1b10bF602d8Fe56d0c671",WETH_GATEWAY:"0x11CCDcFb19151FEb086ee6F1f62bfA0940C85612",WALLET_BALANCE_PROVIDER:"0x6eA9d99c6653DF987bDEa11ffcd56DFB4B5d38b4",COLLECTOR:"0x6F5Ae60d89dbbc4EeD4B08d08A68dD5679Ac61B4",UI_POOL_DATA_PROVIDER:"0x0A1198DDb5247a283F76077Bb1E45e5858ee100b",UI_INCENTIVE_DATA_PROVIDER:"0xa1e6BcDab01B9d7De83647d1Bbd4113c6c2B4e0d",OFT:"0x458AD5B487F4442245E4C5eA7249009E607A5583",VESTING_ADDRESS:"",ZERO_ADDRESS:"0x458AD5B487F4442245E4C5eA7249009E607A5583"}}),(0,o.Z)(r,i.proto_mainnet_lrt_v3,{marketTitle:"Ethereum LRTs",chainId:s.a_.mainnet,v3:!0,disableCharts:!0,description:"The Ethereum LRT Market is a ETH-focused market that allows users to lend/borrow ETH-corelated assets at high LTVs. This market also supports Pendle PT tokens as collateral.",marketAltName:"Ethereum LRTs",grpKey:"ethereum",enabledFeatures:{staking:!1,liquiditySwap:!0,debtSwitch:!0,withdrawAndSwitch:!0,incentives:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xFD856E1a33225B86f70D686f9280435E3fF75FCF",LENDING_POOL:"0x3BC3D34C32cc98bf098D832364Df8A222bBaB4c0",WETH_GATEWAY:"0x6eA9d99c6653DF987bDEa11ffcd56DFB4B5d38b4",WALLET_BALANCE_PROVIDER:"0xa1e6BcDab01B9d7De83647d1Bbd4113c6c2B4e0d",SWAP_COLLATERAL_ADAPTER:"0x189cfdb4d7a08D926CA209D84a713c4c629645aF",DEBT_SWITCH_ADAPTER:"0x80Ce5A187E477663fcFE99A108eefd9FBf0acC18",UI_POOL_DATA_PROVIDER:"0xa6EA08D16d47feE408505fda73520EbefC68Ef01",UI_INCENTIVE_DATA_PROVIDER:"0x0A1198DDb5247a283F76077Bb1E45e5858ee100b",OFT:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22",VESTING_ADDRESS:"",ZERO_ADDRESS:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22"}}),(0,o.Z)(r,i.proto_mainnet_btc_v3,{marketTitle:"Bitcoin LRTs",chainId:s.a_.mainnet,description:"The Bitcoin LRT Market is a BTC-focused market that allows users to lend/borrow BTC-corelated assets at high LTVs. This market also supports Pendle PT tokens as collateral.",v3:!0,disableCharts:!0,marketAltName:"Bitcoin LRTs",grpKey:"ethereum",enabledFeatures:{staking:!1,liquiditySwap:!0,debtSwitch:!1,incentives:!0,withdrawAndSwitch:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0x17878AFdD5772F4Ec93c265Ac7Ad8E2b29abB857",LENDING_POOL:"0xCD2b31071119D7eA449a9D211AC8eBF7Ee97F987",WETH_GATEWAY:"0x2787c0cb2F20010Ae2814Da9Ef20E04bb64B2466",WALLET_BALANCE_PROVIDER:"0xa1e6BcDab01B9d7De83647d1Bbd4113c6c2B4e0d",COLLECTOR:"0x4e88e72bd81c7ea394cb410296d99987c3a242fe",SWAP_COLLATERAL_ADAPTER:"0x189cfdb4d7a08D926CA209D84a713c4c629645aF",DEBT_SWITCH_ADAPTER:"0x80Ce5A187E477663fcFE99A108eefd9FBf0acC18",UI_POOL_DATA_PROVIDER:"0xa6EA08D16d47feE408505fda73520EbefC68Ef01",UI_INCENTIVE_DATA_PROVIDER:"0x0A1198DDb5247a283F76077Bb1E45e5858ee100b",OFT:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22",VESTING_ADDRESS:"",ZERO_ADDRESS:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22"}}),(0,o.Z)(r,i.proto_zircuit_v3,{marketTitle:"Zircuit",chainId:48900,isAlpha:!0,v3:!0,disableCharts:!0,enabledFeatures:{staking:!1,incentives:!0,bridge:!0},whiteListedIncentives:[],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xFF679e5B4178A2f74A56f0e2c0e1FA1C80579385",LENDING_POOL:"0x2774C8B95CaB474D0d21943d83b9322Fb1cE9cF5",WETH_GATEWAY:"0x6eA9d99c6653DF987bDEa11ffcd56DFB4B5d38b4",WALLET_BALANCE_PROVIDER:"0xa1e6BcDab01B9d7De83647d1Bbd4113c6c2B4e0d",UI_POOL_DATA_PROVIDER:"0x189cfdb4d7a08D926CA209D84a713c4c629645aF",UI_INCENTIVE_DATA_PROVIDER:"0xa6EA08D16d47feE408505fda73520EbefC68Ef01",OFT:"0x458AD5B487F4442245E4C5eA7249009E607A5583",ZERO_ADDRESS:"0x458AD5B487F4442245E4C5eA7249009E607A5583"}}),(0,o.Z)(r,i.proto_layerx_v3,{marketTitle:"X Layer",chainId:196,v3:!0,enabledFeatures:{staking:!1,incentives:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0x2f7e54ff5d45f77bFfa11f2aee67bD7621Eb8a93",LENDING_POOL:"0xfFd79D05D5dc37E221ed7d3971E75ed5930c6580",WETH_GATEWAY:"0x0f9bfa294bE6e3CA8c39221Bb5DFB88032C8936E",WALLET_BALANCE_PROVIDER:"0xaa999eA356F925BF1e856038c5D182Ae5E8A4973",UI_POOL_DATA_PROVIDER:"0xFaDFb0BC400427663020887e7c8073D03A35dc3c",UI_INCENTIVE_DATA_PROVIDER:"0x33B13F46a25D836CC0ce91B370305902aB6CF1Be",OFT:"0x98D56d03be3C0B9C58C67b209cA557d7DA9eb611",ZERO_ADDRESS:"0x98D56d03be3C0B9C58C67b209cA557d7DA9eb611"}}),(0,o.Z)(r,i.proto_linea_croak_v3,{marketTitle:"Croak",marketAltName:"Croak Market",grpKey:"linea",description:"The CROAK Market is an experimental isolated market designed to support the CROAK community. It allows users to lend/borrow CROAK with stablecoins and other assets.",hideInMarketSwitcher:!0,chainId:59144,v3:!0,show1DBorrowAPR:!0,enabledFeatures:{staking:!1,incentives:!0},whiteListedIncentives:["croak"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xf38B16FA3FC809d40F568BFe5B092AD9Ef4E15ed",LENDING_POOL:"0xc6ff96AefD1cC757d56e1E8Dcc4633dD7AA5222D",WETH_GATEWAY:"0x60F97315200815DbdD003fAC19E94E68CaCB6230",WALLET_BALANCE_PROVIDER:"0xE1a4e28fF7515E8eC7CaDa5fCf583cd47698e826",UI_POOL_DATA_PROVIDER:"0x19dD9E60198D1a1b2f531005592222ed8DfdD826",UI_INCENTIVE_DATA_PROVIDER:"0xBbb913D8adaE54E34dA336EA5218432001292df2",ZERO_ADDRESS:"0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7"}}),(0,o.Z)(r,i.proto_linea_foxy_v3,{marketTitle:"Foxy",marketAltName:"Foxy Market",grpKey:"linea",description:"The FOXY Market is an experimental isolated market designed to support the FOXY community. It allows users to lend/borrow FOXY with stablecoins and other assets.",hideInMarketSwitcher:!0,chainId:59144,v3:!0,enabledFeatures:{staking:!1,incentives:!0},show1DBorrowAPR:!0,whiteListedIncentives:[],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xaF9aB0C286a36A430C9bB7C58Ebf0BF075DDE595",LENDING_POOL:"0xbDAa004A456E7f2dAff00FfcDCbEaD5da27B7966",WETH_GATEWAY:"0x405BDA48cAB999865688eB1F5129C29a9cB0cDe1",WALLET_BALANCE_PROVIDER:"0xA770AF819A74BDB8a00e6C2aE19c4e434D276752",UI_POOL_DATA_PROVIDER:"0xa160571E7074EaC9652c0289C2969942Fc5CcA45",UI_INCENTIVE_DATA_PROVIDER:"0xbbe9548C50Db58cBEd8EbC2343fba02d3F8A5Af8",ZERO_ADDRESS:"0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7"}}),(0,o.Z)(r,i.proto_blast_v3,{marketTitle:"Blast",chainId:81457,v3:!0,enabledFeatures:{staking:!1,incentives:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xb0811a1FC9Fb9972ee683Ba04c32Cb828Bcf587B",LENDING_POOL:"0xa70B0F3C2470AbBE104BdB3F3aaa9C7C54BEA7A8",WETH_GATEWAY:"0xFaDFb0BC400427663020887e7c8073D03A35dc3c",WALLET_BALANCE_PROVIDER:"0x4Fcb7F18FA9255B52793dfd865d245bcec871468",UI_POOL_DATA_PROVIDER:"0xE230cF9Cee7b299F69778EF950A61de0dE520ba7",UI_INCENTIVE_DATA_PROVIDER:"0x66f3015534fae808773422e32b74f5732668dD5b",EARLYZERO_ADDRESS:"0x81b3184A3B5d4612F2c26A53Da8D99474B91B2D2",VESTING_ADDRESS:"",OFT:"0x6195FDA19376d2A3B3F7ED552247272308c644Dd",ZERO_ADDRESS:"0x6195FDA19376d2A3B3F7ED552247272308c644Dd"}}),(0,o.Z)(r,i.proto_mainnet_rwa_v3,{marketTitle:"RWA Stablecoins",chainId:s.a_.mainnet,v3:!0,disableCharts:!0,description:"The RWA Stablecoin is a stablecoin-focused market that allows users to lend/borrow stablecoins backed by real-world assets at high LTVs.",marketAltName:"RWA Stablecoins",grpKey:"ethereum",isAlpha:!0,enabledFeatures:{staking:!1,liquiditySwap:!0,debtSwitch:!1,incentives:!0,withdrawAndSwitch:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xe3c3c5ead58fc2bed4e577e38985b8f7f1ddff00",LENDING_POOL:"0xD3a4DA66EC15a001466F324FA08037f3272BDbE8",WETH_GATEWAY:"0x2787c0cb2F20010Ae2814Da9Ef20E04bb64B2466",WALLET_BALANCE_PROVIDER:"0xa1e6BcDab01B9d7De83647d1Bbd4113c6c2B4e0d",COLLECTOR:"0x4e88e72bd81c7ea394cb410296d99987c3a242fe",SWAP_COLLATERAL_ADAPTER:"0x189cfdb4d7a08D926CA209D84a713c4c629645aF",DEBT_SWITCH_ADAPTER:"0x80Ce5A187E477663fcFE99A108eefd9FBf0acC18",UI_POOL_DATA_PROVIDER:"0xa6EA08D16d47feE408505fda73520EbefC68Ef01",UI_INCENTIVE_DATA_PROVIDER:"0x0A1198DDb5247a283F76077Bb1E45e5858ee100b",OFT:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22",VESTING_ADDRESS:"",ZERO_ADDRESS:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22"}}),(0,o.Z)(r,i.proto_zksync_era_v3,{marketTitle:"zkSync",chainId:324,v3:!0,disableCharts:!0,enabledFeatures:{paymasters:!0,staking:!1,incentives:!0,isGasless:!0,debtSwitch:!0,switch:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0x4f285Ea117eF0067B59853D6d16a5dE8088bA259",LENDING_POOL:"0x4d9429246EA989C9CeE203B43F6d1C7D83e3B8F8",WETH_GATEWAY:"0x767b4A087c11d7581Ac95eaFfc1FeBFA26bad3d2",PAYMASTER:"0x03173eFe71e4201FDb439e716C801E41A239d58c",WALLET_BALANCE_PROVIDER:"0xdeEa10da04D867e3303AB6E50FA26C2d8a5e9f70",UI_POOL_DATA_PROVIDER:"0x8FE0ac76b634B7D343Bd32282B98E9f271B43367",UI_INCENTIVE_DATA_PROVIDER:"0x91ccF57c1E9A7F5A9537eE59306faF8dA3b7e960",GHO_TOKEN_ADDRESS:"0x90059C32Eeeb1A2aa1351a58860d98855f3655aD",GHO_UI_DATA_PROVIDER:"0x3d65cEDCb8Bbf19b477e5FF09057567F3B052b1f",VESTING_ADDRESS:"",ZERO_ADDRESS:"0x27d0A2b5316b98088294378692F4EAbfB3222e36"}}),(0,o.Z)(r,i.proto_manta_v3,{marketTitle:"Manta",chainId:169,v3:!0,disableCharts:!0,enabledFeatures:{governance:!0,staking:!0,liquiditySwap:!0,collateralRepay:!0,incentives:!0,withdrawAndSwitch:!0,debtSwitch:!0,switch:!0,bridge:!0},whiteListedIncentives:["zero"],subgraphUrl:"https://api.thegraph.com/subgraphs/name/aave/protocol-v3",addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xC44827C51d00381ed4C52646aeAB45b455d200eB",LENDING_POOL:"0x2f9bB73a8e98793e26Cb2F6C4ad037BDf1C6B269",WETH_GATEWAY:"0xE05361EA51E20118072aec0fB0FD178e8b09D69e",WALLET_BALANCE_PROVIDER:"0xCbDc0aeD7CDf2472784068abEf23a902CafABb98",UI_POOL_DATA_PROVIDER:"0xa32Eb787F2A3DC1F2c2da0E5d8caE7Ff74E6fD32",UI_INCENTIVE_DATA_PROVIDER:"0x81b3184A3B5d4612F2c26A53Da8D99474B91B2D2",EARLYZERO_ADDRESS:"0x642ce49f36f74fcc430ff79a76eb984737a7672d",VESTING_ADDRESS:"",OFT:"0xFCCa0098e740CE6D87e372717B210f5e2c27159D",ZERO_ADDRESS:"0xFCCa0098e740CE6D87e372717B210f5e2c27159D"}}),(0,o.Z)(r,i.proto_linea_sepolia_v3,{marketTitle:"Linea Sepolia",chainId:168587773,v3:!0,disableCharts:!0,enabledFeatures:{staking:!1,incentives:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xa9eE3E04F102c6ba1A6468d641094A0BB83d6D2c",LENDING_POOL:"0x2B6106B5e7b01042f9039f75CEeEAEca69Fc0ab7",WETH_GATEWAY:"0xe165750b9882E9AF6A76082996392d0592A5CF16",WALLET_BALANCE_PROVIDER:"0xA79641b126194929C9c959794A24A77913D3502C",UI_POOL_DATA_PROVIDER:"0x7cf23595BA89D309983B9dDbe617B3892DF24a9A",UI_INCENTIVE_DATA_PROVIDER:"0x8a209c303FebE28569404C1435f282543fE65c0D",STAKING_BONUS:"0xe5ccA68b9E1D5575B7e3062fA34B0C725B003a69",OMNI_STAKING:"0xC35022eCbb36D81b9c92AD13f8e2D417e7F7a1C3",LOCKER_TOKEN:"0x1Fe7E6Cc96f9DA66b803E9573c083427b13C4370",LOCKER_LP:"0x6850E5D5396e4ce3CB6919E790b8Fce2Ebdf49eC",EARLYZERO_ADDRESS:"0x0082f3184a0b36c957F38f19fBdD3570ad9F095f",EARLY_ZERO_VESTING:"0xaBeD86D5eEe2Bf39A7d389B95bd4b92aAE24D04D",ZERO_ADDRESS:"0xA386758Dfb9B695c8C21245f61Fb71c38d045169",VESTING_ADDRESS:"0x1Ac68a3141745AA3c835fA518d2bAf70fDCE9F4B",POOL_VOTER:"0x8bf50096aA1ddBc7930d726F9d3a67EA138F010A",ZERO_AIRDROP:"0x56b83bc8886274DC0bE2273FbBc985710099D5C4"}}),r)},91555:function(e,t,n){"use strict";n.d(t,{m:function(){return s},R:function(){return a}});var r,i,o=n(59499),s=(r={},(0,o.Z)(r,1,{name:"Ethereum",publicJsonRPCUrl:["https://rpc.ankr.com/eth","https://rpc.flashbots.net","https://eth-mainnet.public.blastapi.io","https://cloudflare-eth.com/v1/mainnet"],baseUniswapAdapter:"0xc3efa200a60883a96ffe3d5b492b121d6e9a1f3f",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://etherscan.io",networkLogoPath:"/icons/networks/ethereum.svg"}),(0,o.Z)(r,196,{name:"X Layer",publicJsonRPCUrl:["https://xlayerrpc.okx.com"],baseAssetSymbol:"OKB",wrappedBaseAssetSymbol:"WOKB",explorerLink:"https://www.okx.com/explorer/xlayer",baseAssetDecimals:18,networkLogoPath:"/icons/networks/okb.svg",bridge:{icon:"/icons/networks/okb.svg",name:"OKX Bridge",url:"https://www.okx.com/xlayer/bridge"}}),(0,o.Z)(r,48900,{name:"Zircuit",publicJsonRPCUrl:["https://zircuit1-mainnet.p2pify.com/","https://zircuit-mainnet.drpc.org","https://zircuit1-mainnet.liquify.com"],baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",explorerLink:"https://explorer.zircuit.com/",baseAssetDecimals:18,networkLogoPath:"/icons/networks/zircuit.svg",bridge:{icon:"/icons/networks/zircuit.svg",name:"Zircuit Bridge",url:"https://bridge.zircuit.com/"}}),(0,o.Z)(r,81457,{name:"Blast",publicJsonRPCUrl:["https://rpc.blast.io"],baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://blastscan.io",networkLogoPath:"/icons/networks/blast.svg",bridge:{icon:"/icons/networks/blast.svg",name:"Blast Bridge",url:"https://docs.blast.io/building/bridges/mainnet"}}),(0,o.Z)(r,324,{name:"zkSync Era",publicJsonRPCUrl:["https://mainnet.era.zksync.io"],baseUniswapAdapter:"0x0",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://era.zksync.network/",isTestnet:!1,bridge:{icon:"/icons/networks/zksync.svg",name:"zkSync Bridge",url:"https://portal.zksync.io/bridge/"},networkLogoPath:"/icons/networks/zksync.svg"}),(0,o.Z)(r,59144,{name:"Linea",publicJsonRPCUrl:["https://rpc.linea.build"],baseUniswapAdapter:"0x0",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://lineascan.build",networkLogoPath:"/icons/networks/linea.svg",bridge:{icon:"/icons/networks/linea.svg",name:"Linea Bridge",url:"https://linea.build/apps?types=bridge",oftAdapter:!0}}),(0,o.Z)(r,8453,{name:"Base",publicJsonRPCUrl:["https://mainnet.base.org"],baseUniswapAdapter:"0x0",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://basescan.org",networkLogoPath:"/icons/networks/base.svg",bridge:{icon:"/icons/networks/base.svg",name:"Base Bridge",url:"https://bridge.base.org/deposit",oftAdapter:!0}}),(0,o.Z)(r,169,{name:"Manta",publicJsonRPCUrl:["https://pacific-rpc.manta.network/http","https://1rpc.io/manta"],baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://pacific-explorer.manta.network",networkLogoPath:"/icons/networks/manta.svg",bridge:{icon:"/icons/networks/manta.svg",name:"Manta Bridge",url:"https://pacific-bridge.manta.network/"}}),(0,o.Z)(r,11155111,{name:"Ethereum Sepolia",privateJsonRPCUrl:"https://eth-sepolia.g.alchemy.com/v2/VAfNJrTN-TopQjFDwcdLeeDOLDiFQcBP",publicJsonRPCUrl:["https://eth-sepolia.public.blastapi.io","https://rpc.sepolia.org","https://rpc2.sepolia.org","https://rpc.sepolia.online","https://www.sepoliarpc.space"],baseUniswapAdapter:"0x0",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://sepolia.etherscan.io",isTestnet:!0,networkLogoPath:"/icons/networks/ethereum.svg"}),(0,o.Z)(r,168587773,{name:"Blast Sepolia",publicJsonRPCUrl:["https://sepolia.blast.io"],baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,isTestnet:!0,explorerLink:"https://testnet.blastscan.io",networkLogoPath:"/icons/networks/blast.svg",bridge:{icon:"/icons/networks/blast.svg",name:"Blast Bridge",url:"https://docs.blast.io/building/bridges/mainnet"}}),(0,o.Z)(r,280,{name:"zkSync Goerli",publicJsonRPCUrl:["https://testnet.era.zksync.dev"],baseUniswapAdapter:"0x0",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://goerli.explorer.zksync.io/",isTestnet:!0,networkLogoPath:"/icons/networks/zksync.svg"}),(0,o.Z)(r,11155420,{name:"Optimism Sepolia",publicJsonRPCUrl:["https://sepolia.optimism.io/"],baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,isTestnet:!0,explorerLink:"https://optimism-sepolia.blockscout.com/",networkLogoPath:"/icons/networks/optimism.svg"}),r),a=(i={},(0,o.Z)(i,1,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,11155111,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,59144,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,42,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,169,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,168587773,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,81457,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,324,"0xF9cda624FBC7e059355ce98a31693d299FACd963"),(0,o.Z)(i,280,"0xF9cda624FBC7e059355ce98a31693d299FACd963"),i)},90187:function(e,t,n){"use strict";n.d(t,{fc:function(){return E},aj:function(){return _},Op:function(){return k}});var r,i,o,s=n(59499),a=n(68346),c=n(85893),u=function(e,t){return{text:"".concat(e,"x-").concat(t,"x Gravity Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x-",t,"x points/USD/day. Visit"," ",(0,c.jsx)(a.Z,{href:"/gravity",target:"_blank",children:"Gravity Page"})," ","for more info"]}),pointsIcon:"/icons/tokens/zero.svg"}},l={text:"4x-20x Gravity Points ",tooltip:(0,c.jsxs)("span",{children:["Borrowing this collateral will give you 4x-20x points/USD/day. Visit"," ",(0,c.jsx)(a.Z,{href:"/gravity",target:"_blank",children:"Gravity Page"})," ","for more info"]}),pointsIcon:"/icons/tokens/zero.svg"},d=function(){return{color:"#c2eeff",text:"LXP-L Points",tooltip:(0,c.jsxs)("span",{children:["Supplying this asset will give you will get you LXP-L points from linea. Visit the"," ",(0,c.jsx)(a.Z,{href:"https://referrals.linea.build/?refCode=vhN04mGePq",target:"_blank",children:"LXP-L Campaign page"})," ","for more info"]}),pointsIcon:"/icons/tokens/lxp-l.svg"}},f={text:"ZL LXP-L Referral Points",tooltip:"Referral points earned by ZeroLend, distributed back to borrowers",link:"/rewards",pointsIcon:"/icons/tokens/lxp-l.svg"},p={text:"Turtle Points",tooltip:(0,c.jsxs)("span",{children:["Users get boosted points if they are part of"," ",(0,c.jsx)(a.Z,{href:"https://turtle.club/dashboard/?ref=ZEROLEND",target:"_blank",children:"turtle.club"})," "]}),pointsIcon:"/icons/tokens/turtle.svg"},h={text:"1x Blast Points",pointsIcon:"/icons/tokens/blast.svg"},m=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Loyalty Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Loyalty points from ether.fi. You can get more points (upto ",t,"x) by leveraging on your deposit. ",(0,c.jsx)("br",{}),(0,c.jsx)("br",{}),"(Points are added retroactively by the points issuer)."]}),pointsIcon:"/icons/tokens/weeth.svg"}},g=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Veda Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Veda points from Veda. You can get more points (upto ",t,"x) by leveraging on your deposit. ",(0,c.jsx)("br",{}),(0,c.jsx)("br",{}),"(Points are added retroactively by the points issuer)."]}),pointsIcon:"/icons/tokens/veda.svg"}},y=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Babylon Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Babylon points from Babylon. You can get more points (upto ",t,"x) by leveraging on your deposit. ",(0,c.jsx)("br",{}),(0,c.jsx)("br",{}),"(Points are added retroactively by the points issuer)."]}),pointsIcon:"/icons/tokens/babylon.svg"}},b=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x ezPoints"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x ezPoints on Renzo. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/ezeth.svg"}},v=function(e,t,n){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Lombard Points"),tooltip:(0,c.jsx)("span",{children:n||(0,c.jsxs)(c.Fragment,{children:["Supplying this collateral will give you ",e,"x Lombard Points on Lombard. You can get more points (upto ",t,"x) by leveraging on your deposit."]})}),pointsIcon:"/icons/tokens/lombard.svg"}},w=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Symbiotic Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Symbiotic Points on Symbiotic. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/symbiotic.svg"}},x=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x EIGEN Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x EIGEN Points on EignerLayer. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/eigenlayer.svg"}},A=function(e,t){return{color:"#D8F0F0",text:"".concat(e,"-").concat(t,"x Kelp Miles"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Kelp Miles on KelpDao. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/rseth.svg"}},E=[{text:"LXP-L Points",tooltip:"",link:"https://referrals.linea.build/?refCode=vhN04mGePq"},{text:"Gravity Points"}],_={proto_mainnet_lrt_v3:{eth:[u(2,10),p],weth:[u(2,10),p],ezeth:[u(2,10),p,b(2,6),x(1,3)],pzeth:[u(2,10),p,(i=2,o=6,{color:"#fa849c",text:"".concat(i,"-").concat(o,"x Mellow Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",i,"x Mellow Points on Mellow Protocol. You can get more points (upto ",o,"x) by leveraging on your deposit. ",(0,c.jsx)("br",{}),(0,c.jsx)("br",{}),"(Points are added retroactively by the points issuer)."]}),pointsIcon:"/icons/tokens/pzeth.svg"}),b(2,6),w(1,3)],"pt-rseth-26sep2024":[u(1,5),p],pufeth:[u(2,10),p,function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Puffer Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Puffer Points on Puffer. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/pufeth.svg"}}(2,6)],rseth:[u(2,10),p,A(3,9),x(1,3)],weeth:[u(1,5),p,m(2,6),x(1,3)]},proto_linea_v3:(r={eth:[u(2,10),d(),p],weth:[u(2,10),d(),p],usdc:[u(1,5),d(),p],dai:[u(1,5),d(),p]},(0,s.Z)(r,"m-btc",[u(1,5),d(),p]),(0,s.Z)(r,"solvbtc.m",[u(1,5),d(),p]),(0,s.Z)(r,"usdt",[u(1,5),d(),p]),(0,s.Z)(r,"ezeth",[b(2,6),u(2,10),d(),p,x(1,3)]),(0,s.Z)(r,"grai",[u(1,5),d(),p]),(0,s.Z)(r,"wbtc",[u(1,5),d(),p]),(0,s.Z)(r,"weeth",[u(1,5),d(),p,m(2,6),x(1,3)]),(0,s.Z)(r,"wrseth",[u(3,15),d(),p,A(3,9),x(1,3)]),(0,s.Z)(r,"unieth",[u(1,5),d(),p,function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Bedrock Diamonds"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Bedrock Daimonds from Bedrock. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/unieth.svg"}}(3,6)]),(0,s.Z)(r,"stone",[u(1,5),d(),function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x ezPoints"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x StakeStone Points on StakeStone. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/stone-points.svg"}}(2,6),p]),(0,s.Z)(r,"wsteth",[u(1,5),d(),p]),(0,s.Z)(r,"frxeth",[u(1,5),d(),p]),(0,s.Z)(r,"ineth",[u(1,5),d(),p,function(e,t){return{text:"".concat(e,"-").concat(t,"x Inception Totem"),color:"#ACE731",tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x InceptionLRT Totems from InceptionLRT. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/unieth.svg"}}(15,30)]),(0,s.Z)(r,"susde",[u(1,5),d(),p]),(0,s.Z)(r,"usde",[u(1,5),d(),p]),r),proto_linea_foxy_v3:{eth:[u(1,5),d()],usdc:[u(1,5),d()],foxy:[u(1,5),d()]},proto_blast_v3:{eth:[u(2,10),h,p],weth:[u(2,10),h,p],ezeth:[u(1,5),p,b(2,6),x(1,3)],usdb:[u(1,5),h,p],weeth:[u(1,5),p,m(2,6),x(1,3)]},proto_zksync_era_v3:{eth:[u(2,10)],weth:[u(2,10)],dai:[u(1,5)],lusd:[u(1,5)],usdt:[u(1,5)],"usdc.e":[u(1,5)],wbtc:[u(1,5)]},proto_mainnet_btc_v3:{ebtc:[y(1,10),v(2,20),w(1,10),m(3,30),g(3,30),p,u(3,30),x("TBD","?"),function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Karak Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Karak Points on Karak. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/karak.svg"}}("TBD","?")],lbtc:[y(1,10),v(2,20),p,u(2,30)],wbtc:[u(2,10),p],"pt-ebtc-26dec2024":[u(1,5),p],"pt-cornlbtc-26dec2024":[u(1,5),p]},proto_layerx_v3:{eth:[u(2,10)],weth:[u(2,10)],usdc:[u(1,5)],usdz:[u(1,5)],usdt:[u(1,5)],wbtc:[u(1,5)],dai:[u(1,5)],okb:[u(1,5)]},proto_mainnet_rwa_v3:{usdc:[u(1,5),p],usdz:[u(1,5),p],usds:[u(1,5),p],eusd:[m(3,30),function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Ethena Sats"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Sats from Ethena. You can get more points (upto"," ",t,"x) by leveraging on your deposit. ",(0,c.jsx)("br",{}),(0,c.jsx)("br",{}),"(Points are added retroactively by the points issuer)."]}),pointsIcon:"/icons/tokens/usde.svg"}}(20,200),g(3,30),u(1,5),p],usdt:[u(1,5),p]},proto_base_v3:{usdc:[u(1,5),p],xusdz:[u(1,5),p],aero:[u(1,5),p],cbbtc:[u(1,5),p],cbeth:[u(1,5),p],"vamm-usdc/aero":[u(1,5),p],susdzusdc:[u(1,5),p],eth:[u(1,5),p],weth:[u(1,5),p]}},k={proto_mainnet_lrt_v3:{eth:[l],weth:[l],pzeth:[l],ezeth:[l],rseth:[l],weeth:[l]},proto_linea_v3:{eth:[l,f],usdc:[l,f],dai:[l,f],usdt:[l,f],wbtc:[l,f],wrseth:[l,f],ezeth:[l,f],usde:[l,f],weeth:[l,f],wsteth:[l,f]},proto_blast_v3:{eth:[l],usdb:[l]},proto_zksync_era_v3:{eth:[l],dai:[l],lusd:[l],usdt:[l],"usdc.e":[l],wbtc:[l]},proto_mainnet_btc_v3:{ebtc:[l],wbtc:[l],lbtc:[l,v(0,0,"Borrowing this collateral will give you 3x Lombard Lux Points if you borrow LBTC against the PT-cornLBTC-26DEC2024 token as collateral")]},proto_mainnet_rwa_v3:{usdc:[l],usdt:[l],eusd:[l],usds:[l],usdz:[l]},proto_layerx_v3:{eth:[l],weth:[l],usdc:[l],usdt:[l],wbtc:[l],dai:[l],okb:[l],usdz:[l]},proto_base_v3:{usdc:[l],xusdz:[l],aero:[l],cbbtc:[l],cbeth:[l],eth:[l],weth:[l]}}},31001:function(e,t,n){"use strict";n.d(t,{iP:function(){return r},Bd:function(){return o},g_:function(){return s}});var r,i=n(90116);!function(e){e.USE_POWERS="USE_POWERS",e.TOKEN_BALANCE="TOKEN_BALANCE",e.POWERS="POWERS",e.VOTE_ON_PROPOSAL="VOTE_ON_PROPOSAL",e.VOTING_POWER_AT="VOTING_POWER_AT",e.GOVERNANCE_TOKENS="GOVERNANCE_TOKENS",e.TRANSACTION_HISTORY="TRANSACTION_HISTORY",e.POOL_TOKENS="POOL_TOKENS",e.GENERAL_STAKE_UI_DATA="GENERAL_STAKE_UI_DATA",e.USER_STAKE_UI_DATA="USER_STAKE_UI_DATA",e.USER_VEST_UI_DATA="USER_VEST_UI_DATA",e.USER_LOCK_UI_DATA="USER_LOCK_UI_DATA",e.USER_POOL_VOTE="USER_POOL_VOTE",e.GENERAL_NFT_UI_DATA="GENERAL_NFT_UI_DATA",e.USER_REWARD_CLAIMED="USER_REWARD_CLAIMED"}(r||(r={}));var o={governance:["governance"],staking:["staking"],pool:["pool"],incentives:["incentives"],gho:["gho"],market:function(e){return[e.chainId,!!e.isFork,e.market]},user:function(e){return[e]},powers:function(e,t){return[].concat((0,i.Z)(o.governance),(0,i.Z)(o.user(e)),[t,"powers"])},voteOnProposal:function(e,t,n){return[].concat((0,i.Z)(o.governance),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(n)),[t,"voteOnProposal"])},votingPowerAt:function(e,t,n){return[].concat((0,i.Z)(o.governance),(0,i.Z)(o.user(e)),(0,i.Z)(n),[t,"votingPowerAt"])},governanceRepresentatives:function(e){return[].concat((0,i.Z)(o.governance),(0,i.Z)(o.user(e)),["representatives"])},governanceTokens:function(e,t){return[].concat((0,i.Z)(o.governance),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),["governanceTokens"])},transactionHistory:function(e,t){return[].concat((0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),["transactionHistory"])},poolTokens:function(e,t){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),["poolTokens"])},poolReservesDataHumanized:function(e){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.market(e)),["poolReservesDataHumanized"])},userPoolReservesDataHumanized:function(e,t){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),["userPoolReservesDataHumanized"])},generalStakeUiData:function(e,t,n){return[].concat((0,i.Z)(o.staking),(0,i.Z)(o.market(e)),[t,n,"generalStakeUiData"])},userStakeUiData:function(e,t,n,r){return[].concat((0,i.Z)(o.staking),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),[n,r,"userStakeUiData"])},paraswapRates:function(e,t,n,r,s){return[].concat((0,i.Z)(o.user(s)),[e,t,n,r,"paraswapRates"])},odosswapQuote:function(e){var t=e.chainId,n=e.inputTokens,r=e.outputTokens,s=e.userAddr,a=e.slippageLimitPercent,c=e.referralCode,u=e.disableRFQs,l=e.compact;return[].concat((0,i.Z)(o.user(s)),[t,n,r,s,a,c,u,l,"odosswapQuote"])},odosswapAssemble:function(e){var t=e.pathId,n=e.simulate,r=e.userAddr;return[].concat((0,i.Z)(o.user(r)),[t,n,r,"odosswapAssemble"])},gasPrices:function(e){return[e,"gasPrices"]},poolReservesIncentiveDataHumanized:function(e){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.incentives),(0,i.Z)(o.market(e)),["poolReservesIncentiveDataHumanized"])},userPoolReservesIncentiveDataHumanized:function(e,t){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.incentives),(0,i.Z)(o.market(t)),(0,i.Z)(o.user(e)),["userPoolReservesIncentiveDataHumanized"])},ghoReserveData:function(e){return[].concat((0,i.Z)(o.gho),(0,i.Z)(o.market(e)),["ghoReserveData"])},ghoUserReserveData:function(e,t){return[].concat((0,i.Z)(o.gho),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),["ghoUserReserveData"])},poolApprovedAmount:function(e,t,n){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(n)),[t,"poolApprovedAmount"])},approvedAmount:function(e,t,n,r){return[].concat((0,i.Z)(o.user(e)),(0,i.Z)(o.market(r)),[t,n,"approvedAmount"])},tokenPowers:function(e,t,n){return[].concat((0,i.Z)(o.user(e)),[t,n,"tokenPowers"])},tokenDelegatees:function(e,t,n){return[].concat((0,i.Z)(o.user(e)),[t,n,"tokenDelegatees"])},migrationExceptions:function(e,t,n){return[].concat((0,i.Z)(e.map((function(e){return e.underlyingAsset}))),(0,i.Z)(o.market(t)),(0,i.Z)(o.market(n)))},tokensBalance:function(e,t,n){return[].concat((0,i.Z)(o.user(n)),[e.map((function(e){return e.address})),t,"tokensBalance"])}},s=1e4},41551:function(e,t,n){"use strict";n.d(t,{QD:function(){return c},S0:function(){return u}});var r=n(59499),i=n(34220);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var s={BPTBALWETH:"BPT_BAL_WETH",BPTWBTCWETH:"BPT_WBTC_WETH",UNIAAVEWETH:"UNI_AAVE_WETH",UNIBATWETH:"UNI_BAT_WETH",UNICRVWETH:"UNI_CRV_WETH",UNIDAIUSDC:"UNI_DAI_USDC",UNIDAIWETH:"UNI_DAI_WETH",UNILINKWETH:"UNI_LINK_WETH",UNIMKRWETH:"UNI_MKR_WETH",UNIRENWETH:"UNI_REN_WETH",UNISNXWETH:"UNI_SNX_WETH",UNIUNIWETH:"UNI_UNI_WETH",UNIUSDCWETH:"UNI_USDC_WETH",UNIWBTCUSDC:"UNI_WBTC_USDC",UNIWBTCWETH:"UNI_WBTC_WETH",UNIYFIWETH:"UNI_YFI_WETH","vAMM-USDC/AERO":"VAMM_AERO_USDC",sUSDZUSDC:"VAMM_USDZ_USDC","KS-LP USDC-USDT":"KNC_USDC_USDT",fUSDT:"USDT","1DAI":"DAI","1USDC":"USDC","1USDT":"USDT","1AAVE":"AAVE","1ETH":"ETH","1WBTC":"WBTC","DAI.e":"DAI","LINK.e":"LINK","WBTC.e":"WBTC","WETH.e":"WETH","AAVE.e":"AAVE","USDT.e":"USDT","USDC.e":"USDC","BTC.b":"BTC",miMATIC:"MAI","m.USDC":"USDC","m.USDT":"USDT","m.DAI":"DAI",NYLEETHZERO:"NYLE_ETH_ZERO"},a={"1INCH":"1inch Network","PT-CORNLBTC-26DEC2024":"LBTC PT 26DEC24","PT-EBTC-26DEC2024":"eBTC PT 26DEC24",AVAX:"Avalanche",CBBTC:"Coinbase BTC",CBETH:"Coinbase ETH",ETH:"Ethereum",EUROS:"STASIS EURO",EZETH:"Renzo ezETH",FAI:"Fei USD",GHST:"Aavegotchi GHST",GRAI:"Gravita",GUSD:"Gemini Dollar",KNC_USDC_USDT:"Kyberswap USDT/USDT",KNC:"Kyber Legacy",LBTC:"Lombard LBTC",LINK:"ChainLink",LUSD:"LUSD Stablecoin",MAI:"MAI",MANA:"Decentraland",MKR:"Maker",PAX:"Paxos Standard",PUFETH:"Puffer.fi ETH",PZETH:"Renzo pzETH",RAI:"Rai Reflex Index",REP:"Augur",RSETH:"Kelp rsETH",SAVAX:"Benqi Staked Avalanche",STETH:"Lido Staked Ether",STKAAVE:"Stake ZeroLend",TUSD:"TrueUSD",UNI:"Uniswap",UNIDAIWETH:"UNI DAI/WETH",UNIWBTCUSDC:"UNI WBTC/USDC",USDT:"Tether",USDZ:"ZAI Stablecoin",WAVAX:"Wrapped Avalanche",WBTC:"Wrapped BTC",WEETH:"Etherfi weETH",WETH:"Wrapped ETH",WFTM:"Wrapped FTM",WMATIC:"Wrapped Matic",WONE:"Wrapped ONE",WRSETH:"Kelp wrsETH",YFI:"yearn.finance",ZRX:"0x Coin"};function c(e){var t=e.underlyingAsset,n=e.symbol,c=e.name,u={"0xff970a61a04b1ca14834a43f5de4533ebddb5cc8":{name:"Bridged USDC",symbol:"USDC.e",iconSymbol:"USDC"},"0x5d83c0850570de35eaf5c9d6215bf2e8020f656b":{iconSymbol:"KNC_USDC_USDT",name:"Kyberswap USDC/USDT"},"0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d":{iconSymbol:"VAMM_AERO_USDC",name:"USDC/AERO LP (Aerodrome)"},"0x1097dfe9539350cb466df9ca89a5e61195a520b0":{iconSymbol:"VAMM_USDZ_USDC",name:"USDz/USDC Staked LP (MAHA.xyz)"},"0xa693B19d2931d498c5B318dF961919BB4aee87a5":{iconSymbol:"UST",name:"UST (Wormhole)"},"0x59a19d8c652fa0284f44113d0ff9aba70bd46fb4":{iconSymbol:"BPT_BAL_WETH"},"0x1eff8af5d577060ba4ac8a29a13525bb0ee2a3d5":{iconSymbol:"BPT_WBTC_WETH"},"0xdfc14d2af169b0d36c4eff567ada9b2e0cae044f":{iconSymbol:"UNI_AAVE_WETH"},"0xb6909b960dbbe7392d405429eb2b3649752b4838":{iconSymbol:"UNI_BAT_WETH"},"0x3da1313ae46132a397d90d95b1424a9a7e3e0fce":{iconSymbol:"UNI_CRV_WETH"},"0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5":{iconSymbol:"UNI_DAI_USDC"},"0xa478c2975ab1ea89e8196811f51a7b7ade33eb11":{iconSymbol:"UNI_DAI_WETH"},"0xa2107fa5b38d9bbd2c461d6edf11b11a50f6b974":{iconSymbol:"UNI_LINK_WETH"},"0xc2adda861f89bbb333c90c492cb837741916a225":{iconSymbol:"UNI_MKR_WETH"},"0x8bd1661da98ebdd3bd080f0be4e6d9be8ce9858c":{iconSymbol:"UNI_REN_WETH"},"0x43ae24960e5534731fc831386c07755a2dc33d47":{iconSymbol:"UNI_SNX_WETH"},"0xd3d2e2692501a5c9ca623199d38826e513033a17":{iconSymbol:"UNI_UNI_WETH"},"0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc":{iconSymbol:"UNI_USDC_WETH"},"0x004375dff511095cc5a197a54140a24efef3a416":{iconSymbol:"UNI_BTC_USDC"},"0xbb2b8038a1640196fbe3e38816f3e67cba72d940":{iconSymbol:"UNI_WBTC_WETH"},"0x2fdbadf3c4d5a8666bc06645b8358ab803996e28":{iconSymbol:"UNI_YFI_WETH"},"0x0040F36784dDA0821E74BA67f86E084D70d67a3A":{iconSymbol:"ETH_ZERO"}},l=t.toLowerCase();if(u.hasOwnProperty(l))return function(e){for(var t=1;t1&&void 0!==v[1]?v[1]:"get",r=v.length>2?v[2]:void 0,i=v.length>3?v[3]:void 0,s=v.length>4?v[4]:void 0,a=v.length>5?v[5]:void 0,c="".concat(a||g,"/").concat(t),"get"===n&&i&&(c="".concat(c,"?").concat(i)),u={"content-type":"application/json","Access-Control-Allow-Origin":"*"},s&&(u["x-jwt"]=s),e.prev=9,e.next=12,h()({url:c,headers:u,method:n,data:r});case 12:if(l=e.sent,d=l.data,200===l.status){e.next=16;break}throw new y(d.error,l.status);case 16:return e.abrupt("return",l.data);case 19:return e.prev=19,e.t0=e.catch(9),b=e.t0,console.log("error",(null===(f=b.response)||void 0===f?void 0:f.data.message)||b.message,(null===(p=b.response)||void 0===p?void 0:p.status)||500),e.abrupt("return",null===(m=b.response)||void 0===m?void 0:m.data);case 24:case"end":return e.stop()}}),e,null,[[9,19]])}))),b.apply(this,arguments)}var v=function(e){return b.apply(this,arguments)},w=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("","get");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("","get",null,void 0,void 0,"https://api.zerolend.xyz/pendle/impliedApy");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),A=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("leaderBoardwithSortKeys","get",null);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("user/userInfo","get",null,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_=function(){var e=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("user/userCurrentPoints","get",null,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),k=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("globalData","get",null);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("referral/openBlock","get",null);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),S=function(){var e=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("linkReferral","patch",t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},82828:function(e,t,n){"use strict";n.d(t,{A:function(){return r},h:function(){return i}});var r={success:!1,error:void 0,isLoading:!1},i={success:!1,error:void 0,isLoading:!0}},59286:function(e,t,n){"use strict";n.d(t,{nG:function(){return c},BC:function(){return u},hF:function(){return l}});var r=n(75331),i=n(1279),o=n(70794),s=n(21921),a=n(87385);function c(e,t,n){var c,u,l,d,f=e.availableLiquidityUSD,p=o.Z.min(t.availableBorrowsUSD,f),h="0"===e.borrowCap?(0,i.hE)(s.Bz.toString()):(0,i.hE)(Number(e.borrowCap)).minus((0,i.hE)(e.totalDebt)),m=o.Z.max(o.Z.min(e.formattedAvailableLiquidity,h),0),g=(0,i.hE)((null===t||void 0===t?void 0:t.availableBorrowsMarketReferenceCurrency)||0).div(e.formattedPriceInMarketReferenceCurrency),y=o.Z.min(g,m);n===r.tk.Stable&&(y=o.Z.min(y,(0,i.hE)(e.formattedAvailableLiquidity).multipliedBy(.25)));var b=y.gte(g)||"0"!==t.totalBorrowsMarketReferenceCurrency&&p.lt(f)||p.eq(f)&&"0"!==e.totalDebt||e.borrowCapUSD&&"0"!==e.totalDebt&&p.gte(f)||t.isInIsolationMode&&"0"!==(null===(c=t.isolatedReserve)||void 0===c?void 0:c.isolationModeTotalDebt)&&(0,i.hE)((null===(u=t.isolatedReserve)||void 0===u?void 0:u.debtCeiling)||"0").minus((null===(l=t.isolatedReserve)||void 0===l?void 0:l.isolationModeTotalDebt)||"0").shiftedBy(-((null===(d=t.isolatedReserve)||void 0===d?void 0:d.debtCeilingDecimals)||0)).multipliedBy("0.99").lt(t.availableBorrowsUSD)?y.multipliedBy("0.99"):y;return(0,a.$w)(b.toString(10),e.decimals)}function u(e){var t,n,r,o,s=(0,i.hE)((null===e||void 0===e?void 0:e.availableBorrowsMarketReferenceCurrency)||0),c="0"!==e.totalBorrowsMarketReferenceCurrency||e.isInIsolationMode&&"0"!==(null===(t=e.isolatedReserve)||void 0===t?void 0:t.isolationModeTotalDebt)&&(0,i.hE)((null===(n=e.isolatedReserve)||void 0===n?void 0:n.debtCeiling)||"0").minus((null===(r=e.isolatedReserve)||void 0===r?void 0:r.isolationModeTotalDebt)||"0").shiftedBy(-((null===(o=e.isolatedReserve)||void 0===o?void 0:o.debtCeilingDecimals)||0)).multipliedBy("0.99").lt(e.availableBorrowsUSD)?s.multipliedBy("0.99"):s;return(0,a.$w)(c.toString(10),18)}function l(e,t){var n=e.borrowingEnabled,r=e.isActive,i=e.borrowableInIsolation,o=e.eModeCategoryId,s=e.isFrozen,a=e.isPaused;return!(!n||!r||s||a)&&((null===t||void 0===t||!t.isInEmode||o===t.userEmodeCategoryId)&&!(null!==t&&void 0!==t&&t.isInIsolationMode&&!i))}},94847:function(e,t,n){"use strict";n.d(t,{x:function(){return a},I:function(){return c}});var r=n(80854),i=n(1279),o=n(70794),s=n(87385);function a(e,t){return"0"===e?new o.Z(-1):new o.Z(e).minus(t)}function c(e,t,n,c){if(t.isFrozen)return"0";var u=(0,i.hE)(e);return u.gt(0)&&n.toLowerCase()===r.hP.toLowerCase()&&(u=u.minus(c)),"0"!==t.supplyCap&&(u=o.Z.min(u,a(t.supplyCap,t.totalLiquidity))),u.lte(0)?"0":(0,s.$w)(u.toString(10),t.decimals)}},69125:function(e,t,n){"use strict";n.d(t,{JP:function(){return s},uF:function(){return a},hN:function(){return c},li:function(){return u},aU:function(){return l}});var r=n(59499);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;tthis.maxRetries)){e.next=13;break}throw this.retries=0,new Error("RotationProvider exceeded max number of retries. Last error: ".concat(this.lastError));case 13:this.currentProviderIndex=0,e.next=17;break;case 16:this.currentProviderIndex+=1;case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"detectNetwork",value:function(){var e=(0,u.Z)(y().mark((function e(){var t;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providers.map((function(e){return e.getNetwork()})));case 2:return t=e.sent,e.abrupt("return",A(t));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"perform",value:function(){var e=(0,u.Z)(y().mark((function e(t,n){var r;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.currentProviderIndex,e.prev=1,e.next=4,this.providers[r].perform(t,n);case 4:case 16:return e.abrupt("return",e.sent);case 7:return e.prev=7,e.t0=e.catch(1),console.error(e.t0.message),this.lastError=e.t0.message,this.emit("debug",{action:"perform",provider:this.providers[r]}),e.next=14,this.rotateUrl(r);case 14:return e.next=16,this.perform(t,n);case 17:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(b.Zk),D=n(83454);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t1)for(var n=1;n
",s=``,a="";let c,u="";for(;Array.isArray(e)&&0!==e.length;){if("number"!==typeof t)throw new Error("abnfToHtml: beg must be type number");if(t>=e.length)break;c="number"!==typeof n||t+n>=e.length?e.length:t+n;let l=0;for(let n=t;n=32&&t<=126)switch(1===l?(u+=o,l=0):2===l&&(u+=a,l=0),t){case 32:u+=" ";break;case 60:u+="<";break;case 62:u+=">";break;case 38:u+="&";break;case 34:u+=""";break;case 39:u+="'";break;case 92:u+="\";break;default:u+=String.fromCharCode(t)}else 9===t||10===t||13===t?(0===l?(u+=r,l=1):2===l&&(u+=a+r,l=1),9===t&&(u+="TAB"),10===t&&(u+="LF"),13===t&&(u+="CR")):(0===l?(u+=s,l=2):1===l&&(u+=o+s,l=2),u+=`\\x${i.utils.charToHex(t)}`)}2===l&&(u+=a),1===l&&(u+=o);break}return u},h=function(e,t,n){let r="";for(let i=t;i=32&&t<=126)r+=String.fromCharCode(t);else switch(t){case 9:r+="\\t";break;case 10:r+="\\n";break;case 13:r+="\\r";break;default:r+="\\unknown"}}return r};let m,g=!1,y=!1,b=!1,v=!1,w=0;if(this.errors=[],t.isBuffer(e))this.chars=o.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else{if("string"!==typeof e)throw new Error("api.js: input source is not a string, byte Buffer or character array");this.chars=o.decode("STRING",e)}this.sabnf=o.encode("STRING",this.chars),this.scan=function(e,t){this.lines=s(this.chars,this.errors,e,t),g=!0},this.parse=function(e,t,n){if(!g)throw new Error("api.js: grammar not scanned");a.syntax(this.chars,this.lines,this.errors,e,t,n),y=!0},this.translate=function(){if(!y)throw new Error("api.js: grammar not scanned and parsed");const e=a.semantic(this.chars,this.lines,this.errors);0===this.errors.length&&(this.rules=e.rules,this.udts=e.udts,m=e.lineMap,b=!0)},this.attributes=function(){if(!b)throw new Error("api.js: grammar not scanned, parsed and translated");return w=c(this.rules,this.udts,m,this.errors),v=!0,w},this.generate=function(e){if(this.lines=s(this.chars,this.errors,e),this.errors.length)return;if(a.syntax(this.chars,this.lines,this.errors,e),this.errors.length)return;const t=a.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=t.rules,this.udts=t.udts,m=t.lineMap,w=c(this.rules,this.udts,m,this.errors),v=!0)},this.displayRules=function(e="index"){if(!b)throw new Error("api.js: grammar not scanned, parsed and translated");return f(this.rules,this.udts,e)},this.displayRuleDependencies=function(e="index"){if(!v)throw new Error("api.js: no attributes - must be preceeded by call to attributes()");return d(e)},this.displayAttributes=function(e="index"){if(!v)throw new Error("api.js: no attributes - must be preceeded by call to attributes()");return w&&l(e),u(e)},this.displayAttributeErrors=function(){if(!v)throw new Error("api.js: no attributes - must be preceeded by call to attributes()");return l()},this.toSource=function(e){if(!v)throw new Error("api.js: can't generate parser source - must be preceeded by call to attributes()");if(w)throw new Error(`api.js: can't generate parser source - attributes have ${w} errors`);return a.generateSource(this.chars,this.lines,this.rules,this.udts,e)},this.toObject=function(){if(!v)throw new Error("api.js: can't generate parser source - must be preceeded by call to attributes()");if(w)throw new Error(`api.js: can't generate parser source - attributes have ${w} errors`);return a.generateObject(this.sabnf,this.rules,this.udts)},this.errorsToAscii=function(){return function(e,t,n){let r,i,o,s;return r="",e.forEach((e=>{i=t[e.line],r+=`${i.lineNo}: `,r+=`${i.beginChar}: `,r+=e.char-i.beginChar+": ",o=i.beginChar,s=e.char-i.beginChar,r+=h(n,o,s),r+=" >> ",o=e.char,s=i.beginChar+i.length-e.char,r+=h(n,o,s),r+="\n",r+=`${i.lineNo}: `,r+=`${i.beginChar}: `,r+=e.char-i.beginChar+": ",r+="error: ",r+=e.msg,r+="\n"})),r}(this.errors,this.lines,this.chars)},this.errorsToHtml=function(e){return function(e,t,n,r){const[o]=i;let s="";const a=`»`;return s+=`

\n`,r&&"string"===typeof r&&(s+=`\n`),s+="\n",e.forEach((e=>{let r,o,c,u,l,d="",f="";0===t.length?(l=a,o=0):(r=t[e.line],c=r.beginChar,e.char>c&&(d=p(n,c,e.char-c)),c=e.char,u=r.beginChar+r.length,c",s+=``,s+="\n",s+="",s+=``,s+="\n")})),s+="
${r}
line
no.
line
offset
error
offset

text
${e.line}${r.beginChar}${o}${l}
↑: ${i.utils.stringToAsciiHtml(e.msg)}

\n",s}(this.errors,this.lines,this.chars,e)},this.linesToAscii=function(){return function(e){let t="Annotated Input Grammar";return e.forEach((e=>{t+="\n",t+=`line no: ${e.lineNo}`,t+=` : char index: ${e.beginChar}`,t+=` : length: ${e.length}`,t+=` : abnf: ${h(r.chars,e.beginChar,e.length)}`})),t+="\n",t}(this.lines)},this.linesToHtml=function(){return function(e){let t="";return t+=`\n`,t+="\n",t+="",t+="",t+="\n",e.forEach((e=>{t+="",t+=`",t+="\n"})),t+="
Annotated Input Grammar
line
no.
first
char

length

text
${e.lineNo}`,t+=`${e.beginChar}`,t+=`${e.length}`,t+=`${p(r.chars,e.beginChar,e.length)}`,t+="
\n",t}(this.lines)}}},68862:function(e,t,n){e.exports=function(){const e=n(58276),{ruleAttributes:t,showAttributes:r,showAttributeErrors:i}=n(94246),{ruleDependencies:o,showRuleDependencies:s}=n(37008);class a{constructor(e,t){this.rules=e,this.udts=t,this.ruleCount=e.length,this.udtCount=t.length,this.startRule=0,this.dependenciesComplete=!1,this.attributesComplete=!1,this.isMutuallyRecursive=!1,this.ruleIndexes=this.indexArray(this.ruleCount),this.ruleAlphaIndexes=this.indexArray(this.ruleCount),this.ruleTypeIndexes=this.indexArray(this.ruleCount),this.udtIndexes=this.indexArray(this.udtCount),this.udtAlphaIndexes=this.indexArray(this.udtCount),this.attrsErrorCount=0,this.attrs=[],this.attrsErrors=[],this.attrsWorking=[],this.ruleDeps=[];for(let n=0;n0)for(let n=0;n0)for(let n=0;nthis.rules[t].lower?1:0}compUdtsAlpha(e,t){return this.udts[e].lowerthis.udts[t].lower?1:0}compRulesType(e,t){return this.ruleDeps[e].recursiveTypethis.ruleDeps[t].recursiveType?1:0}compRulesGroup(t,n){if(this.ruleDeps[t].recursiveType===e.ATTR_MR&&this.ruleDeps[n].recursiveType===e.ATTR_MR){if(this.ruleDeps[t].groupNumberthis.ruleDeps[n].groupNumber)return 1}return 0}}return{attributes:function(e=[],n=[],r=[],i=[]){const s=new a(e,n);return o(s),t(s),s.attrsErrorCount&&i.push({line:0,char:0,msg:`${s.attrsErrorCount} attribute errors`}),s.attrsErrorCount},showAttributes:r,showAttributeErrors:i,showRuleDependencies:s}}()},73737:function(e,t,n){e.exports=function(){const e=n(28737),t=e.ids,r=new(n(74216)),i=new(n(11832)),o=new(n(33610)),s=new e.parser;s.ast=new e.ast,s.callbacks=r.callbacks,s.ast.callbacks=i.callbacks;const a=function(e,t,n){if(t<0||t>=n)return-1;for(let r=0;r=e[r].beginChar&&t{const n=[],r=[];let i=0;e.opcodes.forEach((e=>{e.type===t.ALT&&1===e.children.length||e.type===t.CAT&&1===e.children.length||e.type===t.REP&&1===e.min&&1===e.max?r.push(null):(r.push(i),n.push(e),i+=1)})),r.push(i),n.forEach((e=>{if(e.type===t.ALT||e.type===t.CAT)for(let t=0;t{m.push(e.lower),f+=e.opcodes.length,e.opcodes.forEach((e=>{switch(e.type){case t.ALT:b+=1;break;case t.CAT:v+=1;break;case t.RNM:w+=1;break;case t.UDT:x+=1;break;case t.REP:A+=1;break;case t.AND:E+=1;break;case t.NOT:_+=1;break;case t.BKA:I+=1;break;case t.BKN:O+=1;break;case t.BKR:C+=1;break;case t.ABG:R+=1;break;case t.AEN:D+=1;break;case t.TLS:for(k+=1,s=0;sh&&(h=e.string[s]);break;case t.TBS:for(T+=1,s=0;sh&&(h=e.string[s]);break;case t.TRG:S+=1,e.minh&&(h=e.max);break;default:throw new Error("generateSource: unrecognized opcode")}}))})),m.sort(),i.length>0&&(i.forEach((e=>{g.push(e.lower)})),g.sort()),u+="// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved
\n",u+="// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)
\n",u+="//\n",u+="// Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)\n",o?o.funcName?u+=`const ${o.funcName} = function grammar(){\n`:u+=l?"export function grammar(){\n":d?"export default function grammar(){\n":"module.exports = function grammar(){\n":u+="module.exports = function grammar(){\n",u+=" // ```\n",u+=" // SUMMARY\n",u+=` // rules = ${r.length}\n`,u+=` // udts = ${i.length}\n`,u+=` // opcodes = ${f}\n`,u+=" // --- ABNF original opcodes\n",u+=` // ALT = ${b}\n`,u+=` // CAT = ${v}\n`,u+=` // REP = ${A}\n`,u+=` // RNM = ${w}\n`,u+=` // TLS = ${k}\n`,u+=` // TBS = ${T}\n`,u+=` // TRG = ${S}\n`,u+=" // --- SABNF superset opcodes\n",u+=` // UDT = ${x}\n`,u+=` // AND = ${E}\n`,u+=` // NOT = ${_}\n`,d||(u+=` // BKA = ${I}\n`,u+=` // BKN = ${O}\n`,u+=` // BKR = ${C}\n`,u+=` // ABG = ${R}\n`,u+=` // AEN = ${D}\n`),u+=" // characters = [",u+=k+T+S===0?" none defined ]":`${p} - ${h}]`,x>0&&(u+=" + user defined"),u+="\n",u+=" // ```\n",u+=" /* OBJECT IDENTIFIER (for internal parser use) */\n",u+=" this.grammarObject = 'grammarObject';\n",u+="\n",u+=" /* RULES */\n",u+=" this.rules = [];\n",r.forEach(((e,t)=>{let n=" this.rules[";n+=t,n+="] = { name: '",n+=e.name,n+="', lower: '",n+=e.lower,n+="', index: ",n+=e.index,n+=", isBkr: ",n+=e.isBkr,n+=" };\n",u+=n})),u+="\n",u+=" /* UDTS */\n",u+=" this.udts = [];\n",i.length>0&&i.forEach(((e,t)=>{let n=" this.udts[";n+=t,n+="] = { name: '",n+=e.name,n+="', lower: '",n+=e.lower,n+="', index: ",n+=e.index,n+=", empty: ",n+=e.empty,n+=", isBkr: ",n+=e.isBkr,n+=" };\n",u+=n})),u+="\n",u+=" /* OPCODES */\n",r.forEach(((e,n)=>{n>0&&(u+="\n"),u+=` /* ${e.name} */\n`,u+=` this.rules[${n}].opcodes = [];\n`,e.opcodes.forEach(((e,o)=>{let s;switch(e.type){case t.ALT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, children: [${e.children.toString()}] };// ALT\n`;break;case t.CAT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, children: [${e.children.toString()}] };// CAT\n`;break;case t.RNM:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, index: ${e.index} };// RNM(${r[e.index].name})\n`;break;case t.BKR:e.index>=r.length?(a=i[e.index-r.length].name,c=i[e.index-r.length].lower):(a=r[e.index].name,c=r[e.index].lower),s="%i",e.bkrCase===t.BKR_MODE_CS&&(s="%s"),e.bkrMode===t.BKR_MODE_UM?s+="%u":s+="%p",a=s+a,u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, index: ${e.index}, lower: '${c}', bkrCase: ${e.bkrCase}, bkrMode: ${e.bkrMode} };// BKR(\\${a})\n`;break;case t.UDT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, empty: ${e.empty}, index: ${e.index} };// UDT(${i[e.index].name})\n`;break;case t.REP:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, min: ${e.min}, max: ${e.max} };// REP\n`;break;case t.AND:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// AND\n`;break;case t.NOT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// NOT\n`;break;case t.ABG:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// ABG(%^)\n`;break;case t.AEN:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// AEN(%$)\n`;break;case t.BKA:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// BKA\n`;break;case t.BKN:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// BKN\n`;break;case t.TLS:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, string: [${e.string.toString()}] };// TLS\n`;break;case t.TBS:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, string: [${e.string.toString()}] };// TBS\n`;break;case t.TRG:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, min: ${e.min}, max: ${e.max} };// TRG\n`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}}))})),u+="\n",u+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",u+=" this.toString = function toString(){\n",u+=' let str = "";\n',n.forEach((t=>{const n=t.beginChar+t.length;y="",u+=' str += "';for(let r=t.beginChar;r{i.push(e.lower)})),i.sort(),n.length>0&&(n.forEach((e=>{o.push(e.lower)})),o.sort()),r.callbacks=[],i.forEach((e=>{r.callbacks[e]=!1})),n.length>0&&o.forEach((e=>{r.callbacks[e]=!1})),r.rules=t,r.udts=n,r.toString=function(){return s},r}}},94246:function(e,t,n){e.exports=function(){const e=n(58276);let t=null;function r(e){return!(e.left||e.nested||e.right||e.cyclic)&&e.empty}function i(e){return!!(e.left||e.nested||e.right||e.cyclic)}function o(e,t,n,o){let a=0;const c=t[n],u=c.children.length,l=[];for(a=0;a=0;n-=1){if(e[n].right)return!0;if(!e[n].empty)return!1}return!1}(l,u),o.nested=function(e,t){let n=0,o=0,s=0;for(n=0;n=0;n-=1)if(e[n].left&&!e[n].leaf)for(o=n-1;o>=0;o-=1)if(!r(e[o]))return!0;for(n=0;n=e.ruleCount?(r.empty=e.udts[i.index-e.ruleCount].empty,r.finite=!0):(a(e,i.index,r),r.left=!1,r.nested=!1,r.right=!1,r.cyclic=!1)}(t,n,r,i);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:s(t,n,r+1,i),i.empty=!0;break;case e.TLS:i.empty=!n[r].string.length,i.finite=!0,i.cyclic=!1;break;case e.TBS:case e.TRG:i.empty=!1,i.finite=!0,i.cyclic=!1;break;case e.UDT:i.empty=c.empty,i.finite=!0,i.cyclic=!1;break;case e.ABG:case e.AEN:i.empty=!0,i.finite=!0,i.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${c}`)}}function a(e,t,n){const r=e.attrsWorking[t];r.isComplete?e.attrCopy(n,r):r.isOpen?t===e.startRule?t===e.startRule&&(n.left=!0,n.right=!0,n.cyclic=!0,n.leaf=!0):n.finite=!0:(r.isOpen=!0,s(e,r.rule.opcodes,0,n),r.left=n.left,r.right=n.right,r.nested=n.nested,r.empty=n.empty,r.finite=n.finite,r.cyclic=n.cyclic,r.leaf=!1,r.isOpen=!1,r.isComplete=!0)}const c=e=>e?"t":"f",u=e=>e?"e":"f",l=(n,r,i,o)=>{let s=`${n}:${r}:`;return s+=`${u(i.left)} `,s+=`${c(i.nested)} `,s+=`${c(i.right)} `,s+=`${u(i.cyclic)} `,s+=(i.finite?"t":"e")+" ",s+=`${c(i.empty)}:`,s+=`${t.typeToString(o.recursiveType)}:`,s+=o.recursiveType===e.ATTR_MR?o.groupNumber:"-",s+=`:${i.rule.name}\n`,s},d=()=>{let e="LEGEND - t=true, f=false, e=error\n";return e+="sequence:rule index:left nested right cyclic finite empty:type:group number:rule name\n","LEGEND - t=true, f=false, e=error\nsequence:rule index:left nested right cyclic finite empty:type:group number:rule name\n"},f=e=>{let n=0,r=0,i=null,o=null,s="",{ruleIndexes:a}=t;for(97===e?a=t.ruleAlphaIndexes:116===e&&(a=t.ruleTypeIndexes),n=0;n{t=e;let n=0,r=0;const i=t.attrGen();for(n=0;n{if(!t.attributesComplete)throw new Error("rule-attributes.js:showAttributes: attributes not available");let n="";const r="RULE ATTRIBUTES\n";return 97===e.charCodeAt(0)?(n+="alphabetical by rule name\n",n+=r,n+=d(),n+=f(97)):116===e.charCodeAt(0)?(n+="ordered by rule type\n",n+=r,n+=d(),n+=f(116)):(n+="ordered by rule index\n",n+=r,n+=d(),n+=f()),n},showAttributeErrors:()=>{let e=null,n=null,r="";if(r+="RULE ATTRIBUTES WITH ERRORS\n",r+=d(),t.attrsErrorCount)for(let i=0;i{const e=n(58276);let t=null;const r=(t,n,i,o)=>{let s=0,a=0;const c=n[i];o[i]=!0;const u=c.rule.opcodes;for(s=0;s{let n=0,r=0,i=0,o=0;const s=t.ruleCount-1,a=t.udtCount-1;let c="",u="";const l="=> ";let d=!1,f=null,{ruleIndexes:p}=t,{udtIndexes:h}=t;for(97===e?(p=t.ruleAlphaIndexes,h=t.udtAlphaIndexes):116===e&&(p=t.ruleTypeIndexes,h=t.udtAlphaIndexes),n=0;n-1?f.groupNumber:"-",u+=":"),u+=" ",c+=`${u+t.rules[p[n]].name}\n`,d=!0,i=0,o=c.length,c+=u,r=0;r100&&r!==s&&(c+=`\n${u}=> `,o=c.length);if(t.udtCount)for(r=0;r100&&r!==a&&(c+=`\n${u}=> `,o=c.length);for(0===i&&(c+="=> \n"),!1===d&&(c+="\n"),d=!0,i=0,o=c.length,c+=u,r=0;r100&&r!==s&&(c+=`\n${u}=> `,o=c.length);0===i&&(c+="<= \n"),!1===d&&(c+="\n"),c+="\n"}return c};return{ruleDependencies:n=>{t=n;let i=0,o=0,s=0,a=null,c=null,u=!1;t.dependenciesComplete=!1;const l=t.falseArray(t.ruleCount);for(i=0;i-1,t.ruleAlphaIndexes.sort(t.compRulesAlpha),t.ruleTypeIndexes.sort(t.compRulesAlpha),t.ruleTypeIndexes.sort(t.compRulesType),t.isMutuallyRecursive&&t.ruleTypeIndexes.sort(t.compRulesGroup),t.udtCount&&t.udtAlphaIndexes.sort(t.compUdtsAlpha),t.dependenciesComplete=!0},showRuleDependencies:(e="index")=>{let n="RULE DEPENDENCIES(index:type:[group number:])\n";return n+="=> refers to rule names\n",n+="<= referenced by rule names\n",t.dependenciesComplete?(97===e.charCodeAt(0)?(n+="alphabetical by rule name\n",n+=i(97)):116===e.charCodeAt(0)?(n+="ordered by rule type\n",n+=i(116)):(n+="ordered by rule index\n",n+=i(null)),n):n}}})()},33610:function(e){e.exports=function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=function(){let e="";return e+=";\n",e+="; ABNF for JavaScript APG 2.0 SABNF\n",e+="; RFC 5234 with some restrictions and additions.\n",e+="; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation\n",e+='; - accepts %s"string" as a case-sensitive string\n',e+='; - accepts %i"string" as a case-insensitive string\n',e+='; - accepts "string" as a case-insensitive string\n',e+=";\n",e+="; Some restrictions:\n",e+="; 1. Rules must begin at first character of each line.\n",e+="; Indentations on first rule and rules thereafter are not allowed.\n",e+="; 2. Relaxed line endings. CRLF, LF or CR are accepted as valid line ending.\n",e+="; 3. Prose values, i.e. , are accepted as valid grammar syntax.\n",e+="; However, a working parser cannot be generated from them.\n",e+=";\n",e+="; Super set (SABNF) additions:\n",e+="; 1. Look-ahead (syntactic predicate) operators are accepted as element prefixes.\n",e+="; & is the positive look-ahead operator, succeeds and backtracks if the look-ahead phrase is found\n",e+="; ! is the negative look-ahead operator, succeeds and backtracks if the look-ahead phrase is NOT found\n",e+="; e.g. &%d13 or &rule or !(A / B)\n",e+="; 2. User-Defined Terminals (UDT) of the form, u_name and e_name are accepted.\n",e+="; 'name' is alpha followed by alpha/num/hyphen just like a rule name.\n",e+="; u_name may be used as an element but no rule definition is given.\n",e+="; e.g. rule = A / u_myUdt\n",e+='; A = "a"\n',e+="; would be a valid grammar.\n",e+="; 3. Case-sensitive, single-quoted strings are accepted.\n",e+="; e.g. 'abc' would be equivalent to %d97.98.99\n",e+='; (kept for backward compatibility, but superseded by %s"abc") \n',e+="; New 12/26/2015\n",e+="; 4. Look-behind operators are accepted as element prefixes.\n",e+="; && is the positive look-behind operator, succeeds and backtracks if the look-behind phrase is found\n",e+="; !! is the negative look-behind operator, succeeds and backtracks if the look-behind phrase is NOT found\n",e+="; e.g. &&%d13 or &&rule or !!(A / B)\n",e+="; 5. Back reference operators, i.e. \\rulename, are accepted.\n",e+="; A back reference operator acts like a TLS or TBS terminal except that the phrase it attempts\n",e+="; to match is a phrase previously matched by the rule 'rulename'.\n",e+="; There are two modes of previous phrase matching - the parent-frame mode and the universal mode.\n",e+="; In universal mode, \\rulename matches the last match to 'rulename' regardless of where it was found.\n",e+="; In parent-frame mode, \\rulename matches only the last match found on the parent's frame or parse tree level.\n",e+="; Back reference modifiers can be used to specify case and mode.\n",e+="; \\A defaults to case-insensitive and universal mode, e.g. \\A === \\%i%uA\n",e+="; Modifiers %i and %s determine case-insensitive and case-sensitive mode, respectively.\n",e+="; Modifiers %u and %p determine universal mode and parent frame mode, respectively.\n",e+="; Case and mode modifiers can appear in any order, e.g. \\%s%pA === \\%p%sA. \n",e+="; 7. String begin anchor, ABG(%^) matches the beginning of the input string location.\n",e+="; Returns EMPTY or NOMATCH. Never consumes any characters.\n",e+="; 8. String end anchor, AEN(%$) matches the end of the input string location.\n",e+="; Returns EMPTY or NOMATCH. Never consumes any characters.\n",e+=";\n",e+="File = *(BlankLine / Rule / RuleError)\n",e+="BlankLine = *(%d32/%d9) [comment] LineEnd\n",e+="Rule = RuleLookup owsp Alternation ((owsp LineEnd)\n",e+=" / (LineEndError LineEnd))\n",e+="RuleLookup = RuleNameTest owsp DefinedAsTest\n",e+="RuleNameTest = RuleName/RuleNameError\n",e+="RuleName = alphanum\n",e+="RuleNameError = 1*(%d33-60/%d62-126)\n",e+="DefinedAsTest = DefinedAs / DefinedAsError\n",e+="DefinedAsError = 1*2%d33-126\n",e+="DefinedAs = IncAlt / Defined\n",e+="Defined = %d61\n",e+="IncAlt = %d61.47\n",e+="RuleError = 1*(%d32-126 / %d9 / LineContinue) LineEnd\n",e+="LineEndError = 1*(%d32-126 / %d9 / LineContinue)\n",e+="Alternation = Concatenation *(owsp AltOp Concatenation)\n",e+="Concatenation = Repetition *(CatOp Repetition)\n",e+="Repetition = [Modifier] (Group / Option / BasicElement / BasicElementErr)\n",e+="Modifier = (Predicate [RepOp])\n",e+=" / RepOp\n",e+="Predicate = BkaOp\n",e+=" / BknOp\n",e+=" / AndOp\n",e+=" / NotOp\n",e+="BasicElement = UdtOp\n",e+=" / RnmOp\n",e+=" / TrgOp\n",e+=" / TbsOp\n",e+=" / TlsOp\n",e+=" / ClsOp\n",e+=" / BkrOp\n",e+=" / AbgOp\n",e+=" / AenOp\n",e+=" / ProsVal\n",e+="BasicElementErr = 1*(%d33-40/%d42-46/%d48-92/%d94-126)\n",e+="Group = GroupOpen Alternation (GroupClose / GroupError)\n",e+="GroupError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\n",e+="GroupOpen = %d40 owsp\n",e+="GroupClose = owsp %d41\n",e+="Option = OptionOpen Alternation (OptionClose / OptionError)\n",e+="OptionError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\n",e+="OptionOpen = %d91 owsp\n",e+="OptionClose = owsp %d93\n",e+="RnmOp = alphanum\n",e+="BkrOp = %d92 [bkrModifier] bkr-name\n",e+="bkrModifier = (cs [um / pm]) / (ci [um / pm]) / (um [cs /ci]) / (pm [cs / ci])\n",e+="cs = '%s'\n",e+="ci = '%i'\n",e+="um = '%u'\n",e+="pm = '%p'\n",e+="bkr-name = uname / ename / rname\n",e+="rname = alphanum\n",e+="uname = %d117.95 alphanum\n",e+="ename = %d101.95 alphanum\n",e+="UdtOp = udt-empty\n",e+=" / udt-non-empty\n",e+="udt-non-empty = %d117.95 alphanum\n",e+="udt-empty = %d101.95 alphanum\n",e+="RepOp = (rep-min StarOp rep-max)\n",e+=" / (rep-min StarOp)\n",e+=" / (StarOp rep-max)\n",e+=" / StarOp\n",e+=" / rep-min-max\n",e+="AltOp = %d47 owsp\n",e+="CatOp = wsp\n",e+="StarOp = %d42\n",e+="AndOp = %d38\n",e+="NotOp = %d33\n",e+="BkaOp = %d38.38\n",e+="BknOp = %d33.33\n",e+="AbgOp = %d37.94\n",e+="AenOp = %d37.36\n",e+="TrgOp = %d37 ((Dec dmin %d45 dmax) / (Hex xmin %d45 xmax) / (Bin bmin %d45 bmax))\n",e+="TbsOp = %d37 ((Dec dString *(%d46 dString)) / (Hex xString *(%d46 xString)) / (Bin bString *(%d46 bString)))\n",e+="TlsOp = TlsCase TlsOpen TlsString TlsClose\n",e+='TlsCase = ["%i" / "%s"]\n',e+="TlsOpen = %d34\n",e+="TlsClose = %d34\n",e+="TlsString = *(%d32-33/%d35-126/StringTab)\n",e+="StringTab = %d9\n",e+="ClsOp = ClsOpen ClsString ClsClose\n",e+="ClsOpen = %d39\n",e+="ClsClose = %d39\n",e+="ClsString = *(%d32-38/%d40-126/StringTab)\n",e+="ProsVal = ProsValOpen ProsValString ProsValClose\n",e+="ProsValOpen = %d60\n",e+="ProsValString = *(%d32-61/%d63-126/StringTab)\n",e+="ProsValClose = %d62\n",e+="rep-min = rep-num\n",e+="rep-min-max = rep-num\n",e+="rep-max = rep-num\n",e+="rep-num = 1*(%d48-57)\n",e+="dString = dnum\n",e+="xString = xnum\n",e+="bString = bnum\n",e+="Dec = (%d68/%d100)\n",e+="Hex = (%d88/%d120)\n",e+="Bin = (%d66/%d98)\n",e+="dmin = dnum\n",e+="dmax = dnum\n",e+="bmin = bnum\n",e+="bmax = bnum\n",e+="xmin = xnum\n",e+="xmax = xnum\n",e+="dnum = 1*(%d48-57)\n",e+="bnum = 1*%d48-49\n",e+="xnum = 1*(%d48-57 / %d65-70 / %d97-102)\n",e+=";\n",e+="; Basics\n",e+="alphanum = (%d97-122/%d65-90) *(%d97-122/%d65-90/%d48-57/%d45)\n",e+="owsp = *space\n",e+="wsp = 1*space\n",e+="space = %d32\n",e+=" / %d9\n",e+=" / comment\n",e+=" / LineContinue\n",e+="comment = %d59 *(%d32-126 / %d9)\n",e+="LineEnd = %d13.10\n",e+=" / %d10\n",e+=" / %d13\n",e+="LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)\n",";\n; ABNF for JavaScript APG 2.0 SABNF\n; RFC 5234 with some restrictions and additions.\n; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation\n; - accepts %s\"string\" as a case-sensitive string\n; - accepts %i\"string\" as a case-insensitive string\n; - accepts \"string\" as a case-insensitive string\n;\n; Some restrictions:\n; 1. Rules must begin at first character of each line.\n; Indentations on first rule and rules thereafter are not allowed.\n; 2. Relaxed line endings. CRLF, LF or CR are accepted as valid line ending.\n; 3. Prose values, i.e. , are accepted as valid grammar syntax.\n; However, a working parser cannot be generated from them.\n;\n; Super set (SABNF) additions:\n; 1. Look-ahead (syntactic predicate) operators are accepted as element prefixes.\n; & is the positive look-ahead operator, succeeds and backtracks if the look-ahead phrase is found\n; ! is the negative look-ahead operator, succeeds and backtracks if the look-ahead phrase is NOT found\n; e.g. &%d13 or &rule or !(A / B)\n; 2. User-Defined Terminals (UDT) of the form, u_name and e_name are accepted.\n; 'name' is alpha followed by alpha/num/hyphen just like a rule name.\n; u_name may be used as an element but no rule definition is given.\n; e.g. rule = A / u_myUdt\n; A = \"a\"\n; would be a valid grammar.\n; 3. Case-sensitive, single-quoted strings are accepted.\n; e.g. 'abc' would be equivalent to %d97.98.99\n; (kept for backward compatibility, but superseded by %s\"abc\") \n; New 12/26/2015\n; 4. Look-behind operators are accepted as element prefixes.\n; && is the positive look-behind operator, succeeds and backtracks if the look-behind phrase is found\n; !! is the negative look-behind operator, succeeds and backtracks if the look-behind phrase is NOT found\n; e.g. &&%d13 or &&rule or !!(A / B)\n; 5. Back reference operators, i.e. \\rulename, are accepted.\n; A back reference operator acts like a TLS or TBS terminal except that the phrase it attempts\n; to match is a phrase previously matched by the rule 'rulename'.\n; There are two modes of previous phrase matching - the parent-frame mode and the universal mode.\n; In universal mode, \\rulename matches the last match to 'rulename' regardless of where it was found.\n; In parent-frame mode, \\rulename matches only the last match found on the parent's frame or parse tree level.\n; Back reference modifiers can be used to specify case and mode.\n; \\A defaults to case-insensitive and universal mode, e.g. \\A === \\%i%uA\n; Modifiers %i and %s determine case-insensitive and case-sensitive mode, respectively.\n; Modifiers %u and %p determine universal mode and parent frame mode, respectively.\n; Case and mode modifiers can appear in any order, e.g. \\%s%pA === \\%p%sA. \n; 7. String begin anchor, ABG(%^) matches the beginning of the input string location.\n; Returns EMPTY or NOMATCH. Never consumes any characters.\n; 8. String end anchor, AEN(%$) matches the end of the input string location.\n; Returns EMPTY or NOMATCH. Never consumes any characters.\n;\nFile = *(BlankLine / Rule / RuleError)\nBlankLine = *(%d32/%d9) [comment] LineEnd\nRule = RuleLookup owsp Alternation ((owsp LineEnd)\n / (LineEndError LineEnd))\nRuleLookup = RuleNameTest owsp DefinedAsTest\nRuleNameTest = RuleName/RuleNameError\nRuleName = alphanum\nRuleNameError = 1*(%d33-60/%d62-126)\nDefinedAsTest = DefinedAs / DefinedAsError\nDefinedAsError = 1*2%d33-126\nDefinedAs = IncAlt / Defined\nDefined = %d61\nIncAlt = %d61.47\nRuleError = 1*(%d32-126 / %d9 / LineContinue) LineEnd\nLineEndError = 1*(%d32-126 / %d9 / LineContinue)\nAlternation = Concatenation *(owsp AltOp Concatenation)\nConcatenation = Repetition *(CatOp Repetition)\nRepetition = [Modifier] (Group / Option / BasicElement / BasicElementErr)\nModifier = (Predicate [RepOp])\n / RepOp\nPredicate = BkaOp\n / BknOp\n / AndOp\n / NotOp\nBasicElement = UdtOp\n / RnmOp\n / TrgOp\n / TbsOp\n / TlsOp\n / ClsOp\n / BkrOp\n / AbgOp\n / AenOp\n / ProsVal\nBasicElementErr = 1*(%d33-40/%d42-46/%d48-92/%d94-126)\nGroup = GroupOpen Alternation (GroupClose / GroupError)\nGroupError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\nGroupOpen = %d40 owsp\nGroupClose = owsp %d41\nOption = OptionOpen Alternation (OptionClose / OptionError)\nOptionError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\nOptionOpen = %d91 owsp\nOptionClose = owsp %d93\nRnmOp = alphanum\nBkrOp = %d92 [bkrModifier] bkr-name\nbkrModifier = (cs [um / pm]) / (ci [um / pm]) / (um [cs /ci]) / (pm [cs / ci])\ncs = '%s'\nci = '%i'\num = '%u'\npm = '%p'\nbkr-name = uname / ename / rname\nrname = alphanum\nuname = %d117.95 alphanum\nename = %d101.95 alphanum\nUdtOp = udt-empty\n / udt-non-empty\nudt-non-empty = %d117.95 alphanum\nudt-empty = %d101.95 alphanum\nRepOp = (rep-min StarOp rep-max)\n / (rep-min StarOp)\n / (StarOp rep-max)\n / StarOp\n / rep-min-max\nAltOp = %d47 owsp\nCatOp = wsp\nStarOp = %d42\nAndOp = %d38\nNotOp = %d33\nBkaOp = %d38.38\nBknOp = %d33.33\nAbgOp = %d37.94\nAenOp = %d37.36\nTrgOp = %d37 ((Dec dmin %d45 dmax) / (Hex xmin %d45 xmax) / (Bin bmin %d45 bmax))\nTbsOp = %d37 ((Dec dString *(%d46 dString)) / (Hex xString *(%d46 xString)) / (Bin bString *(%d46 bString)))\nTlsOp = TlsCase TlsOpen TlsString TlsClose\nTlsCase = [\"%i\" / \"%s\"]\nTlsOpen = %d34\nTlsClose = %d34\nTlsString = *(%d32-33/%d35-126/StringTab)\nStringTab = %d9\nClsOp = ClsOpen ClsString ClsClose\nClsOpen = %d39\nClsClose = %d39\nClsString = *(%d32-38/%d40-126/StringTab)\nProsVal = ProsValOpen ProsValString ProsValClose\nProsValOpen = %d60\nProsValString = *(%d32-61/%d63-126/StringTab)\nProsValClose = %d62\nrep-min = rep-num\nrep-min-max = rep-num\nrep-max = rep-num\nrep-num = 1*(%d48-57)\ndString = dnum\nxString = xnum\nbString = bnum\nDec = (%d68/%d100)\nHex = (%d88/%d120)\nBin = (%d66/%d98)\ndmin = dnum\ndmax = dnum\nbmin = bnum\nbmax = bnum\nxmin = xnum\nxmax = xnum\ndnum = 1*(%d48-57)\nbnum = 1*%d48-49\nxnum = 1*(%d48-57 / %d65-70 / %d97-102)\n;\n; Basics\nalphanum = (%d97-122/%d65-90) *(%d97-122/%d65-90/%d48-57/%d45)\nowsp = *space\nwsp = 1*space\nspace = %d32\n / %d9\n / comment\n / LineContinue\ncomment = %d59 *(%d32-126 / %d9)\nLineEnd = %d13.10\n / %d10\n / %d13\nLineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)\n"}}},73479:function(e,t,n){const r=n(58276),i=n(8544);const o=[];o.line=function(e,t,n,i,o){return e===r.SEM_PRE?(o.endLength=0,o.textLength=0,o.invalidCount=0):o.lines.push({lineNo:o.lines.length,beginChar:n,length:i,textLength:o.textLength,endType:o.endType,invalidChars:o.invalidCount}),r.SEM_OK},o["line-text"]=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.textLength=i),r.SEM_OK},o["last-line"]=function(e,t,n,i,o){return e===r.SEM_PRE?(o.endLength=0,o.textLength=0,o.invalidCount=0):o.strict?(o.lines.push({lineNo:o.lines.length,beginChar:n,length:i,textLength:i,endType:"none",invalidChars:o.invalidCount}),o.errors.push({line:o.lineNo,char:n+i,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(t.push(10),o.lines.push({lineNo:o.lines.length,beginChar:n,length:i+1,textLength:i,endType:"LF",invalidChars:o.invalidCount})),r.SEM_OK},o.invalid=function(e,t,n,o,s){return e===r.SEM_PRE&&s.errors.push({line:s.lineNo,char:n,msg:`invalid character found '\\x${i.charToHex(t[n])}'`}),r.SEM_OK},o.end=function(e,t,n,i,o){return e===r.SEM_POST&&(o.lineNo+=1),r.SEM_OK},o.lf=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.endType="LF",o.strict&&o.errors.push({line:o.lineNo,char:n,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),r.SEM_OK},o.cr=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.endType="CR",o.strict&&o.errors.push({line:o.lineNo,char:n,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),r.SEM_OK},o.crlf=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.endType="CRLF"),r.SEM_OK},t.callbacks=o},66410:function(e){e.exports=function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"file",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"line",lower:"line",index:1,isBkr:!1},this.rules[2]={name:"line-text",lower:"line-text",index:2,isBkr:!1},this.rules[3]={name:"last-line",lower:"last-line",index:3,isBkr:!1},this.rules[4]={name:"valid",lower:"valid",index:4,isBkr:!1},this.rules[5]={name:"invalid",lower:"invalid",index:5,isBkr:!1},this.rules[6]={name:"end",lower:"end",index:6,isBkr:!1},this.rules[7]={name:"CRLF",lower:"crlf",index:7,isBkr:!1},this.rules[8]={name:"LF",lower:"lf",index:8,isBkr:!1},this.rules[9]={name:"CR",lower:"cr",index:9,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,3]},this.rules[0].opcodes[1]={type:3,min:0,max:1/0},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:3,min:0,max:1},this.rules[0].opcodes[4]={type:4,index:3},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2]},this.rules[1].opcodes[1]={type:4,index:2},this.rules[1].opcodes[2]={type:4,index:6},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:0,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:4},this.rules[2].opcodes[3]={type:4,index:5},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:1,max:1/0},this.rules[3].opcodes[1]={type:1,children:[2,3]},this.rules[3].opcodes[2]={type:4,index:4},this.rules[3].opcodes[3]={type:4,index:5},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:5,min:32,max:126},this.rules[4].opcodes[2]={type:6,string:[9]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[5].opcodes[1]={type:5,min:0,max:8},this.rules[5].opcodes[2]={type:5,min:11,max:12},this.rules[5].opcodes[3]={type:5,min:14,max:31},this.rules[5].opcodes[4]={type:5,min:127,max:4294967295},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:1,children:[1,2,3]},this.rules[6].opcodes[1]={type:4,index:7},this.rules[6].opcodes[2]={type:4,index:8},this.rules[6].opcodes[3]={type:4,index:9},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:6,string:[13,10]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:6,string:[10]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:6,string:[13]},this.toString=function(){let e="";return e+="file = *line [last-line]\n",e+="line = line-text end\n",e+="line-text = *(valid/invalid)\n",e+="last-line = 1*(valid/invalid)\n",e+="valid = %d32-126 / %d9\n",e+="invalid = %d0-8 / %d11-12 /%d14-31 / %x7f-ffffffff\n",e+="end = CRLF / LF / CR\n",e+="CRLF = %d13.10\n",e+="LF = %d10\n",e+="CR = %d13\n","file = *line [last-line]\nline = line-text end\nline-text = *(valid/invalid)\nlast-line = 1*(valid/invalid)\nvalid = %d32-126 / %d9\ninvalid = %d0-8 / %d11-12 /%d14-31 / %x7f-ffffffff\nend = CRLF / LF / CR\nCRLF = %d13.10\nLF = %d10\nCR = %d13\n"}}},1789:function(e,t,n){e.exports=function(e,t,r,i){const o=n(28737),s=new(n(66410)),{callbacks:a}=n(73479),c=[],u=new o.parser;if(u.ast=new o.ast,u.ast.callbacks=a,i){if("traceObject"!==i.traceObject)throw new TypeError("scanner.js: trace argument is not a trace object");u.trace=i}if(!0!==u.parse(s,"file",e).success)return void t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});const l={lines:c,lineNo:0,errors:t,strict:!!r};return u.ast.translate(l),c}},11832:function(e,t,n){e.exports=function(){const e=n(28737),t=e.ids,r=function(){this.names=[],this.add=function(e){let t=-1;return-1===this.get(e)&&(t={name:e,lower:e.toLowerCase(),index:this.names.length},this.names.push(t)),t},this.get=function(e){let t=-1;const n=e.toLowerCase();for(let r=0;r=48&&t<=57)t-=48;else if(t>=65&&t<=70)t-=55;else{if(!(t>=97&&t<=102))throw new Error("hexnum out of range");t-=87}r=16*r+t}return r};this.callbacks=[],this.callbacks.abgop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.ABG}),s},this.callbacks.aenop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.AEN}),s},this.callbacks.alternation=function(e,n,r,i,o){let s=t.SEM_OK;if(e===t.SEM_PRE){const e=!0;for(;e;){if(null===o.definedas){s=t.SEM_SKIP;break}if(null===o.topStack){if("="===o.definedas){o.topStack={alt:{type:t.ALT,children:[]},cat:null},o.altStack.push(o.topStack),o.opcodes.push(o.topStack.alt);break}o.topStack={alt:o.opcodes[0],cat:null},o.altStack.push(o.topStack);break}o.topStack={alt:{type:t.ALT,children:[]},cat:null},o.altStack.push(o.topStack),o.opcodes.push(o.topStack.alt);break}}else e===t.SEM_POST&&(o.altStack.pop(),o.altStack.length>0?o.topStack=o.altStack[o.altStack.length-1]:o.topStack=null);return s},this.callbacks.andop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.AND}),s},this.callbacks.bmax=function(e,n,r,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=o(n,r,i)),a},this.callbacks.bmin=function(e,n,r,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=o(n,r,i)),a},this.callbacks.bkaop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.BKA}),s},this.callbacks.bknop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.BKN}),s},this.callbacks.bkrop=function(n,r,i,o,s){const a=t.SEM_OK;return n===t.SEM_PRE?(s.ci=!0,s.cs=!1,s.um=!0,s.pm=!1):n===t.SEM_POST&&s.opcodes.push({type:t.BKR,bkrCase:!0===s.cs?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:!0===s.pm?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:s.bkrname.phraseIndex,name:e.utils.charsToString(r,s.bkrname.phraseIndex,s.bkrname.phraseLength)}}),a},this.callbacks["bkr-name"]=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.bkrname={phraseIndex:r,phraseLength:i}),s},this.callbacks.bstring=function(e,n,r,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&s.tbsstr.push(o(n,r,i)),a},this.callbacks.clsop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(i<=2?o.opcodes.push({type:t.TLS,string:[]}):o.opcodes.push({type:t.TBS,string:n.slice(r+1,r+i-1)})),s},this.callbacks.ci=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.ci=!0),s},this.callbacks.cs=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.cs=!0),s},this.callbacks.um=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.um=!0),s},this.callbacks.pm=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.pm=!0),s},this.callbacks.concatenation=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.topStack.alt.children.push(o.opcodes.length),o.topStack.cat={type:t.CAT,children:[]},o.opcodes.push(o.topStack.cat)):e===t.SEM_POST&&(o.topStack.cat=null),s},this.callbacks.defined=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.definedas="="),s},this.callbacks.dmax=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=i(n,r,o)),a},this.callbacks.dmin=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=i(n,r,o)),a},this.callbacks.dstring=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&s.tbsstr.push(i(n,r,o)),a},this.callbacks.file=function(e,n,i,o,s){const a=t.SEM_OK;if(e===t.SEM_PRE)s.ruleNames=new r,s.udtNames=new r,s.rules=[],s.udts=[],s.rulesLineMap=[],s.opcodes=[],s.altStack=[],s.topStack=null,s.topRule=null;else if(e===t.SEM_POST){let e;s.rules.forEach((n=>{n.isBkr=!1,n.opcodes.forEach((n=>{n.type===t.RNM&&(e=s.ruleNames.get(n.index.name),-1===e?(s.errors.push({line:s.findLine(s.lines,n.index.phraseIndex,s.charsLength),char:n.index.phraseIndex,msg:`Rule name '${n.index.name}' used but not defined.`}),n.index=-1):n.index=e.index)}))})),s.udts.forEach((e=>{e.isBkr=!1})),s.rules.forEach((n=>{n.opcodes.forEach((r=>{r.type===t.BKR&&(n.hasBkr=!0,e=s.ruleNames.get(r.index.name),-1!==e?(s.rules[e.index].isBkr=!0,r.index=e.index):(e=s.udtNames.get(r.index.name),-1!==e?(s.udts[e.index].isBkr=!0,r.index=s.rules.length+e.index):(s.errors.push({line:s.findLine(s.lines,r.index.phraseIndex,s.charsLength),char:r.index.phraseIndex,msg:`Back reference name '${r.index.name}' refers to undefined rule or unamed UDT.`}),r.index=-1)))}))}))}return a},this.callbacks.incalt=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.definedas="=/"),s},this.callbacks.notop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.NOT}),s},this.callbacks.optionopen=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.REP,min:0,max:1,char:r}),s},this.callbacks["rep-max"]=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=i(n,r,o)),a},this.callbacks["rep-min"]=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=i(n,r,o)),a},this.callbacks["rep-min-max"]=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=i(n,r,o),s.min=s.max),a},this.callbacks.repetition=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&o.topStack.cat.children.push(o.opcodes.length),s},this.callbacks.repop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.min=0,o.max=1/0,o.topRep={type:t.REP,min:0,max:1/0},o.opcodes.push(o.topRep)):e===t.SEM_POST&&(o.min>o.max&&o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`repetition min cannot be greater than max: min: ${o.min}: max: ${o.max}`}),o.topRep.min=o.min,o.topRep.max=o.max),s},this.callbacks.rnmop=function(n,r,i,o,s){const a=t.SEM_OK;return n===t.SEM_POST&&s.opcodes.push({type:t.RNM,index:{phraseIndex:i,name:e.utils.charsToString(r,i,o)}}),a},this.callbacks.rule=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&(o.altStack.length=0,o.topStack=null,o.rulesLineMap.push({line:o.findLine(o.lines,r,o.charsLength),char:r})),s},this.callbacks.rulelookup=function(e,n,r,i,o){const s=t.SEM_OK;if(e===t.SEM_PRE)o.ruleName="",o.definedas="";else if(e===t.SEM_POST){let e;"="===o.definedas?(e=o.ruleNames.add(o.ruleName),-1===e?(o.definedas=null,o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`Rule name '${o.ruleName}' previously defined.`})):(o.topRule={name:e.name,lower:e.lower,opcodes:[],index:e.index},o.rules.push(o.topRule),o.opcodes=o.topRule.opcodes)):(e=o.ruleNames.get(o.ruleName),-1===e?(o.definedas=null,o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`Rule name '${o.ruleName}' for incremental alternate not previously defined.`})):(o.topRule=o.rules[e.index],o.opcodes=o.topRule.opcodes))}return s},this.callbacks.rulename=function(n,r,i,o,s){const a=t.SEM_OK;return n===t.SEM_PRE&&(s.ruleName=e.utils.charsToString(r,i,o)),a},this.callbacks.tbsop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?o.tbsstr=[]:e===t.SEM_POST&&o.opcodes.push({type:t.TBS,string:o.tbsstr}),s},this.callbacks.tlscase=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&i>0&&(83===n[r+1]||115===n[r+1])&&(o.tlscase=!1),s},this.callbacks.tlsstring=function(e,n,r,i,o){const s=t.SEM_OK;if(e===t.SEM_POST)if(o.tlscase){const e=n.slice(r,r+i);for(let t=0;t=65&&e[t]<=90&&(e[t]+=32);o.opcodes.push({type:t.TLS,string:e})}else o.opcodes.push({type:t.TBS,string:n.slice(r,r+i)});return s},this.callbacks.tlsop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&(o.tlscase=!0),s},this.callbacks.trgop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.min=0,o.max=0):e===t.SEM_POST&&(o.min>o.max&&o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${o.min}: max: ${o.max}`}),o.opcodes.push({type:t.TRG,min:o.min,max:o.max})),s},this.callbacks["udt-empty"]=function(n,r,i,o,s){const a=t.SEM_OK;if(n===t.SEM_POST){const n=e.utils.charsToString(r,i,o);let a=s.udtNames.add(n);if(-1===a){if(a=s.udtNames.get(n),-1===a)throw new Error("semUdtEmpty: name look up error")}else s.udts.push({name:a.name,lower:a.lower,index:a.index,empty:!0});s.opcodes.push({type:t.UDT,empty:!0,index:a.index})}return a},this.callbacks["udt-non-empty"]=function(n,r,i,o,s){const a=t.SEM_OK;if(n===t.SEM_POST){const n=e.utils.charsToString(r,i,o);let a=s.udtNames.add(n);if(-1===a){if(a=s.udtNames.get(n),-1===a)throw new Error("semUdtNonEmpty: name look up error")}else s.udts.push({name:a.name,lower:a.lower,index:a.index,empty:!1});s.opcodes.push({type:t.UDT,empty:!1,index:a.index,syntax:null,semantic:null})}return a},this.callbacks.xmax=function(e,n,r,i,o){const a=t.SEM_OK;return e===t.SEM_POST&&(o.max=s(n,r,i)),a},this.callbacks.xmin=function(e,n,r,i,o){const a=t.SEM_OK;return e===t.SEM_POST&&(o.min=s(n,r,i)),a},this.callbacks.xstring=function(e,n,r,i,o){const a=t.SEM_OK;return e===t.SEM_POST&&o.tbsstr.push(s(n,r,i)),a}}},2595:function(e){e.exports=function(e=[],t=[],n="index"){let r=[],i=[];const o=[],s=[],a=e,c=t,u=e.length,l=t.length;let d,f="RULE/UDT NAMES";if(!Array.isArray(e)||!e.length)throw new Error("show-rules.js:showRules: rules arg must be array with length > 0");if(!Array.isArray(t))throw new Error("show-rules.js:showRules: udts arg must be array");for(d=0;da[t].lower?1:0})),l){for(d=0;dc[t].lower?1:0}))}if(97===n.charCodeAt(0)){for(f+=" - alphabetical by rule/UDT name\n",d=0;d) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case r.MATCH:s.errors.push({line:s.findLine(s.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),i.prosValOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.prosvalopen=function(t,n,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:i.prosValOpen=o;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.prosvalstring=function(t,n,i,o){switch(t.state){case r.ACTIVE:o.stringTabChar=!1;break;case r.EMPTY:case r.NOMATCH:break;case r.MATCH:!1!==o.stringTabChar&&o.errors.push({line:o.findLine(o.lines,o.stringTabChar),char:o.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.repetition=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:case r.MATCH:o.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.rule=function(t,n,o,s){switch(t.state){case r.ACTIVE:s.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},s.altStack.push(i);break;case r.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case r.NOMATCH:break;case r.MATCH:s.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.ruleerror=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.rulenameerror=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.stringtab=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.stringTabChar=i;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.tlsclose=function(t,n,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:s.errors.push({line:s.findLine(s.lines,i.tlsOpen),char:i.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),i.basicError=!0,i.tlsOpen=null;break;case r.MATCH:i.tlsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.tlsopen=function(t,n,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:i.tlsOpen=o;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.tlsstring=function(t,n,i,o){switch(t.state){case r.ACTIVE:o.stringTabChar=!1;break;case r.EMPTY:case r.NOMATCH:break;case r.MATCH:!1!==o.stringTabChar&&o.errors.push({line:o.findLine(o.lines,o.stringTabChar),char:o.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.udtop=function(n,i,o,s){switch(n.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:if(s.strict){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`UDT operator found(${e}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.bkaop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Positive look-behind operator(&&) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Positive look-behind operator(&&) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.bknop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Negative look-behind operator(!!) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Negative look-behind operator(!!) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.bkrop=function(n,i,o,s){switch(n.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:if(s.strict){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`Back reference operator(${e}) found - strict ABNF specified.`})}else if(s.lite){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`Back reference operator(${e}) found - apg-lite specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.abgop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Beginning of string anchor(%^) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Beginning of string anchor(%^) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.aenop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"End of string anchor(%$) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"End of string anchor(%$) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}}},20979:function(e,t,n){const{Buffer:r}=n(48764),i=n(46322),o="UTF8",s="UTF16",a="UTF16BE",c="UTF16LE",u="UTF32",l="UTF32BE",d="UTF32LE",f="UINT7",p="ASCII",h="BINARY",m="UINT8",g="UINT16",y="UINT16LE",b="UINT16BE",v="UINT32",w="UINT32LE",x="UINT32BE",A="ESCAPED",E="STRING",_=function(e,t){const n=function(e){const t={type:"",base64:!1},n=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(e);return n&&(n[2]&&(t.type=n[2].toUpperCase()),n[1]&&(t.base64=!0)),t}(e.toUpperCase());if(n.base64){if(n.type===E)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type STRING`);if(r.isBuffer(t))n.data=i.base64.decode(t);else{if("string"!==typeof t)throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`);{const e=r.from(t,"ascii");n.data=i.base64.decode(e)}}}else n.data=t;switch(n.type){case o:!function(e){e.type=o;const t=e.data;e.bom=0,t.length>=3&&239===t[0]&&187===t[1]&&191===t[2]&&(e.bom=3)}(n);break;case s:case a:case c:!function(e){const t=e.data;switch(e.bom=0,e.type){case s:e.type=a,t.length>=2&&(254===t[0]&&255===t[1]?e.bom=2:255===t[0]&&254===t[1]&&(e.type=c,e.bom=2));break;case a:if(e.type=a,t.length>=2)if(254===t[0]&&255===t[1])e.bom=2;else if(255===t[0]&&254===t[1])throw new TypeError('src type: "UTF16BE" specified but BOM is for "UTF16LE"');break;case c:if(e.type=c,t.length>=0){if(254===t[0]&&255===t[1])throw new TypeError('src type: "UTF16LE" specified but BOM is for "UTF16BE"');255===t[0]&&254===t[1]&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}}(n);break;case u:case l:case d:!function(e){const t=e.data;switch(e.bom=0,e.type){case u:e.type=l,t.length>=4&&(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3]&&(e.bom=4),255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]&&(e.type=d,e.bom=4));break;case l:if(e.type=l,t.length>=4&&(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3]&&(e.bom=4),255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]))throw new TypeError('src type: UTF32BE specified but BOM is for UTF32LE"');break;case d:if(e.type=d,t.length>=4){if(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3])throw new TypeError('src type: "UTF32LE" specified but BOM is for "UTF32BE"');255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}}(n);break;case g:n.type=b;break;case v:n.type=x;break;case p:n.type=f;break;case h:n.type=m;break;case f:case m:case y:case b:case w:case x:case E:case A:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(n.type===E){if("string"!==typeof n.data)throw new TypeError(`type: "${e}" but data is not a string`)}else if(!r.isBuffer(n.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return n},k=function(e,t){switch(e){case o:return i.utf8.encode(t);case a:return i.utf16be.encode(t);case c:return i.utf16le.encode(t);case l:return i.utf32be.encode(t);case d:return i.utf32le.encode(t);case f:return i.uint7.encode(t);case m:return i.uint8.encode(t);case b:return i.uint16be.encode(t);case y:return i.uint16le.encode(t);case x:return i.uint32be.encode(t);case w:return i.uint32le.encode(t);case E:return i.string.encode(t);case A:return i.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}};t.decode=function(e,t){return function(e){switch(e.type){case o:return i.utf8.decode(e.data,e.bom);case c:return i.utf16le.decode(e.data,e.bom);case a:return i.utf16be.decode(e.data,e.bom);case l:return i.utf32be.decode(e.data,e.bom);case d:return i.utf32le.decode(e.data,e.bom);case f:return i.uint7.decode(e.data);case m:return i.uint8.decode(e.data);case b:return i.uint16be.decode(e.data);case y:return i.uint16le.decode(e.data);case x:return i.uint32be.decode(e.data);case w:return i.uint32le.decode(e.data);case E:return i.string.decode(e.data);case A:return i.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}}(_(e,t))},t.encode=function(e,t){let n,r;const _=function(e,t){if(!Array.isArray(t))throw new TypeError('dst chars: not array: "'+typeof t);if("string"!==typeof e)throw new TypeError('dst type: not string: "'+typeof e);const n=function(e){let t,n;const r={crlf:!1,lf:!1,base64:!1,type:""};for(;;){if(n=e,t=e.slice(0,5),"CRLF:"===t){r.crlf=!0,n=e.slice(5);break}if(t=e.slice(0,3),"LF:"===t){r.lf=!0,n=e.slice(3);break}break}return t=n.split(":"),1===t.length?r.type=t[0]:2===t.length&&"BASE64"===t[1]&&(r.base64=!0,r.type=t[0]),r}(e.toUpperCase());switch(n.type){case o:case a:case c:case l:case d:case f:case m:case y:case b:case w:case x:case A:break;case E:if(n.base64)throw new TypeError('":BASE64" suffix not allowed with type STRING');break;case p:n.type=f;break;case h:n.type=m;break;case s:n.type=a;break;case u:n.type=l;break;case g:n.type=b;break;case v:n.type=x;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return n}(e,t);return _.crlf?(n=i.lineEnds.crlf(t),r=k(_.type,n)):_.lf?(n=i.lineEnds.lf(t),r=k(_.type,n)):r=k(_.type,t),_.base64&&(r=i.base64.encode(r)),r};t.convert=function(e,n,r){return t.encode(r,t.decode(e,n))}},46322:function(e,t,n){const{Buffer:r}=n(48764),i=4294967292,o=4294967293,s=4294967294,a=4294967295,c=[0,1,3,7,15,31,63,127,255,511,1023],u=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),d=[];l.forEach((e=>{d.push(e.charCodeAt(0))})),t.utf8={encode(e){const t=[];return e.forEach((e=>{if(e>=0&&e<=127)t.push(e);else if(e<=2047)t.push(192+(e>>6&c[5])),t.push(128+(e&c[6]));else if(e<55296||e>57343&&e<=65535)t.push(224+(e>>12&c[4])),t.push(128+(e>>6&c[6])),t.push(128+(e&c[6]));else{if(!(e>=65536&&e<=1114111))throw new RangeError(`utf8.encode: character out of range: char: ${e}`);{const n=e>>16&c[5];t.push(240+(n>>2)),t.push(128+((n&c[2])<<4)+(e>>12&c[4])),t.push(128+(e>>6&c[6])),t.push(128+(e&c[6]))}}})),r.from(t)},decode(e,t){function n(e,t){if(128!==(192&t))return o;const n=((e&c[5])<<6)+(t&c[6]);return n<128?i:n}function r(e,t,n){if(128!==(192&n)||128!==(192&t))return o;const r=((e&c[4])<<12)+((t&c[6])<<6)+(n&c[6]);return r<2048?i:r>=55296&&r<=57343?s:r}function u(e,t,n,r){if(128!==(192&r)||128!==(192&n)||128!==(192&t))return o;const a=(((e&c[3])<<2)+(t>>4&c[2])<<16)+((t&c[4])<<12)+((n&c[6])<<6)+(r&c[6]);return a<65536?i:a>1114111?s:a}let l,d,f,p,h,m;const g=e.length;let y=t?3:0;const b=[];for(;y=0&&d<=127){l=d,m=1;break}if(f=y+1,f=194&&d<=223){l=n(d,e[f]),m=2;break}if(p=y+2,p=224&&d<=239){l=r(d,e[f],e[p]),m=3;break}if(h=y+3,h=240&&d<=244){l=u(d,e[f],e[p],e[h]),m=4;break}break}if(l>1114111){const e=`byte[${y}]`;if(l===a)throw new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${e}`);if(l===o)throw new RangeError(`utf8.decode: illegal trailing byte found at: ${e}`);if(l===s)throw new RangeError(`utf8.decode: code point out of range found at: ${e}`);if(l===i)throw new RangeError(`utf8.decode: non-shortest form found at: ${e}`);throw new RangeError(`utf8.decode: unrecognized error found at: ${e}`)}b.push(l),y+=m}return b}},t.utf16be={encode(e){const t=[];let n,i,o;for(let r=0;r=0&&n<=55295||n>=57344&&n<=65535)t.push(n>>8&c[8]),t.push(n&c[8]);else{if(!(n>=65536&&n<=1114111))throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${r}]: ${n}`);o=n-65536,i=55296+(o>>10),o=56320+(o&c[10]),t.push(i>>8&c[8]),t.push(i&c[8]),t.push(o>>8&c[8]),t.push(o&c[8])}return r.from(t)},decode(e,t){if(e.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${e.length}`);const n=[],r=e.length;let i,o,s,a,c,u,l=t?2:0,d=0;for(;l57343){i=c,o=2;break}if(a=l+3,a=56320&&u<=57343)){i=65536+(c-55296<<10)+(u-56320),o=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${l}]`)}n[d++]=i,l+=o}return n}},t.utf16le={encode(e){const t=[];let n,i,o;for(let r=0;r=0&&n<=55295||n>=57344&&n<=65535)t.push(n&c[8]),t.push(n>>8&c[8]);else{if(!(n>=65536&&n<=1114111))throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${r}]: ${n}`);o=n-65536,i=55296+(o>>10),o=56320+(o&c[10]),t.push(i&c[8]),t.push(i>>8&c[8]),t.push(o&c[8]),t.push(o>>8&c[8])}return r.from(t)},decode(e,t){if(e.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${e.length}`);const n=[],r=e.length;let i,o,s,a,c,u,l=t?2:0,d=0;for(;l57343){i=c,o=2;break}if(a=l+3,a=56320&&u<=57343)){i=65536+(c-55296<<10)+(u-56320),o=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${l}]`)}n[d++]=i,l+=o}return n}},t.utf32be={encode(e){const t=r.alloc(4*e.length);let n=0;return e.forEach((e=>{if(e>=55296&&e<=57343||e>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${n/4}]: ${e}`);t[n++]=e>>24&c[8],t[n++]=e>>16&c[8],t[n++]=e>>8&c[8],t[n++]=e&c[8]})),t},decode(e,t){if(e.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${e.length}`);const n=[];let r=t?4:0;for(;r=55296&&t<=57343||t>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${r/4}]: ${t}`);n.push(t)}return n}},t.utf32le={encode(e){const t=r.alloc(4*e.length);let n=0;return e.forEach((e=>{if(e>=55296&&e<=57343||e>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${e}`);t[n++]=e&c[8],t[n++]=e>>8&c[8],t[n++]=e>>16&c[8],t[n++]=e>>24&c[8]})),t},decode(e,t){if(e.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${e.length}`);const n=[];let r=t?4:0;for(;r=55296&&t<=57343||t>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${r/4}]: ${t}`);n.push(t)}return n}},t.uint7={encode(e){const t=r.alloc(e.length);for(let n=0;n127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${n}]: ${e[n]}`);t[n]=e[n]}return t},decode(e){const t=[];for(let n=0;n127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${n}]: ${e[n]}`);t[n]=e[n]}return t}},t.uint8={encode(e){const t=r.alloc(e.length);for(let n=0;n255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${n}]: ${e[n]}`);t[n]=e[n]}return t},decode(e){const t=[];for(let n=0;n{if(e>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${n/2}]: ${e}`);t[n++]=e>>8&c[8],t[n++]=e&c[8]})),t},decode(e){if(e.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${e.length}`);const t=[];for(let n=0;n{if(e>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${n/2}]: ${e}`);t[n++]=e&c[8],t[n++]=e>>8&c[8]})),t},decode(e){if(e.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${e.length}`);const t=[];for(let n=0;n{t[n++]=e>>24&c[8],t[n++]=e>>16&c[8],t[n++]=e>>8&c[8],t[n++]=e&c[8]})),t},decode(e){if(e.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${e.length}`);const t=[];for(let n=0;n{t[n++]=e&c[8],t[n++]=e>>8&c[8],t[n++]=e>>16&c[8],t[n++]=e>>24&c[8]})),t},decode(e){if(e.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${e.length}`);const t=[];for(let n=0;nt.utf16le.encode(e).toString("utf16le"),decode:e=>t.utf16le.decode(r.from(e,"utf16le"),0)},t.escaped={encode(e){const t=[];for(let n=0;n=32&&i<=126)t.push(i);else{let e="";if(i>=0&&i<=31)e+=`\`x${u[i]}`;else if(i>=127&&i<=255)e+=`\`x${u[i]}`;else if(i>=256&&i<=65535)e+=`\`u${u[i>>8&c[8]]}${u[i&c[8]]}`;else{if(!(i>=65536&&i<=4294967295))throw new Error("escape.encode(char): char > 0xffffffff not allowed");{e+="`u{";const t=i>>24&c[8];t>0&&(e+=u[t]),e+=`${u[i>>16&c[8]]+u[i>>8&c[8]]+u[i&c[8]]}}`}}r.from(e).forEach((e=>{t.push(e)}))}}return r.from(t)},decode(e){function t(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function n(e,n,r){const i={char:null,nexti:e+2,error:!0};if(e+1=s)break;if(96===e[a]){o.push(96),l+=2,u=!1;break}if(120===e[a]){if(c=n(a+1,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}if(117===e[a]){if(123===e[a+1]){if(c=i(a+2,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}if(c=r(a+1,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}break}if(u)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${l}]`)}return o}};const f=10;t.lineEnds={crlf(e){const t=[];let n=0;for(;n0&&t[t.length-1]!==f&&(t.push(13),t.push(f)),t},lf(e){const t=[];let n=0;for(;n0&&t[t.length-1]!==f&&t.push(f),t}},t.base64={encode(e){if(0===e.length)return r.alloc(0);let t,n,i,o=e.length%3;o=o>0?3-o:0;let s=(e.length+o)/3;const a=r.alloc(4*s);o>0&&(s-=1),t=0,n=0;for(let r=0;r>18&c[6]],a[n++]=d[i>>12&c[6]],a[n++]=d[i>>6&c[6]],a[n++]=d[i&c[6]];return 0===o?a:1===o?(i=e[t++]<<16,i+=e[t]<<8,a[n++]=d[i>>18&c[6]],a[n++]=d[i>>12&c[6]],a[n++]=d[i>>6&c[6]],a[n]=d[64],a):2===o?(i=e[t]<<16,a[n++]=d[i>>18&c[6]],a[n++]=d[i>>12&c[6]],a[n++]=d[64],a[n]=d[64],a):void 0},decode(e){if(0===e.length)return r.alloc(0);const t=function(e){const t=[];let n=0;for(let r=0;r=65&&i<=90){t.push(i-65);break}if(i>=97&&i<=122){t.push(i-71);break}if(i>=48&&i<=57){t.push(i+4);break}if(43===i){t.push(62);break}if(47===i){t.push(63);break}if(61===i){t.push(64),n+=1;break}throw new RangeError(`base64.decode: invalid character buf[${r}]: ${i}`)}}if(t.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${t.length}`);switch(n){case 0:break;case 1:if(64!==t[t.length-1])throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(64!==t[t.length-1]||64!==t[t.length-2])throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${n}`)}return{tail:n,buf:r.from(t)}}(e),{tail:n}=t,i=t.buf;let o,s,a,u=i.length/4;const l=r.alloc(3*u-n);n>0&&(u-=1),s=0,o=0;for(let r=0;r>16&c[8],l[s++]=a>>8&c[8],l[s++]=a&c[8];return 1===n&&(a=i[o++]<<18,a+=i[o++]<<12,a+=i[o]<<6,l[s++]=a>>16&c[8],l[s]=a>>8&c[8]),2===n&&(a=i[o++]<<18,a+=i[o++]<<12,l[s]=a>>16&c[8]),l},toString(e){if(e.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${e.length}`);let t="",n=0;function r(e,r,i,o){switch(n){case 76:t+=`\r\n${e}${r}${i}${o}`,n=4;break;case 75:t+=`${e}\r\n${r}${i}${o}`,n=3;break;case 74:t+=`${e+r}\r\n${i}${o}`,n=2;break;case 73:t+=`${e+r+i}\r\n${o}`,n=1;break;default:t+=e+r+i+o,n+=4}}for(let o=0;o=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||43===i||47===i||61===i))throw new RangeError(`base64.toString: buf[${t}]: ${e[t]} : not valid base64 character code`);r(String.fromCharCode(e[o]),String.fromCharCode(e[o+1]),String.fromCharCode(e[o+2]),String.fromCharCode(e[o+3]))}var i;return t}}},90580:function(e,t,n){e.exports=function(){const e=n(58276),t=n(8544),r=this;let i=null,o=null,s=null,a=0;const c=[],u=[],l=[],d=[];function f(e){let t="";for(let n=0;n0?d[e-1].stack:0},this.getLength=function(){return d.length},this.toXml=function(n){let r=t.charsToDec,i="decimal integer character codes";if("string"===typeof n&&n.length>=3){const e=n.slice(0,3).toLowerCase();"asc"===e?(r=t.charsToAscii,i="ASCII for printing characters, hex for non-printing"):"hex"===e?(r=t.charsToHex,i="hexadecimal integer character codes"):"uni"===e&&(r=t.charsToUnicode,i="Unicode UTF-32 integer character codes")}let o="",a=0;return o+='\n',o+=`\n`,o+=`\x3c!-- input string, ${i} --\x3e\n`,o+=f(a+2),o+=r(s),o+="\n",d.forEach((t=>{t.state===e.SEM_PRE?(a+=1,o+=f(a),o+=`\n`,o+=f(a+2),o+=r(s,t.phraseIndex,t.phraseLength),o+="\n"):(o+=f(a),o+=`\x3c!-- name="${t.name}" --\x3e\n`,a-=1)})),o+="\n",o},this.phrases=function(){const t={};let n,r;for(n=0;n 0");t=Math.ceil(n),e=-1},this.increment=function(){return e+=1,(e+t)%t},this.maxSize=function(){return t},this.items=function(){return e+1},this.getListIndex=function(n){return-1===e||n<0||n>e||e-n>=t?-1:(n+t)%t},this.forEach=function(n){if(-1!==e)if(e=g.length)throw new Error(`${o}rule index: ${t} out of range`);if(n>=a)throw new Error(`${o}phrase index: ${n} out of range`);const{length:s}=u;u.push({type:e.RNM,index:t}),i(s,n,r),u.pop()},E=function(t,n,r){const o="parser.js: evaluateUdt(): ";if(t>=y.length)throw new Error(`${o}udt index: ${t} out of range`);if(n>=a)throw new Error(`${o}phrase index: ${n} out of range`);const{length:s}=u;u.push({type:e.UDT,empty:y[t].empty,index:t}),i(s,n,r),u.pop()},_=function(){d=0,f=0,p=0,v=0,c=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],g=null,y=null,l=null,o=0,s=0,a=0,h=null,m=null,b=null,u=null},k=function(){const e=[];this.push=function(){e.push(function(){const t=e[e.length-1],n={};for(const e in t)n[e]=t[e];return n}())},this.pop=function(t){let n=t;if(n||(n=e.length-1),n<1||n>e.length)throw new Error(`parser.js: backRef.pop(): bad length: ${n}`);return e.length=n,e[e.length-1]},this.length=function(){return e.length},this.savePhrase=function(t,n,r){e[e.length-1][t]={phraseIndex:n,phraseLength:r}},this.getPhrase=function(t){return e[e.length-1][t]},function(){const t={};g.forEach((e=>{e.isBkr&&(t[e.lower]=null)})),y.length>0&&y.forEach((e=>{e.isBkr&&(t[e.lower]=null)})),e.push(t)}()},T=function(){const t=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=c[c.length-1],this.uFrame=new k,this.pFrame=new k,this.evaluateRule=A,this.evaluateUdt=E,this.refresh=function(){t.state=e.ACTIVE,t.phraseLength=0,t.lookAround=c[c.length-1]}},S=function(){return c[c.length-1]},C=function(){return c.length>1},I=function(e,n,r){const i="parser.js: initializeInputChars(): ";let c=e,u=n,d=r;if(void 0===c)throw new Error(`${i}input string is undefined`);if(null===c)throw new Error(`${i}input string is null`);if("string"===typeof c)c=t.stringToChars(c);else if(!Array.isArray(c))throw new Error(`${i}input string is not a string or array`);if(c.length>0&&"number"!==typeof c[0])throw new Error(`${i}input string not an array of integers`);if("number"!==typeof u)u=0;else if(u=Math.floor(u),u<0||u>c.length)throw new Error(`${i}input beginning index out of range: ${u}`);if("number"!==typeof d)d=c.length-u;else if(d=Math.floor(d),d<0||d>c.length-u)throw new Error(`${i}input length out of range: ${d}`);l=c,o=u,s=d,a=o+s};this.setMaxTreeDepth=function(e){if("number"!==typeof e)throw new Error(`parser: max tree depth must be integer > 0: ${e}`);if(w=Math.floor(e),w<=0)throw new Error(`parser: max tree depth must be integer > 0: ${e}`)},this.setMaxNodeHits=function(e){if("number"!==typeof e)throw new Error(`parser: max node hits must be integer > 0: ${e}`);if(x=Math.floor(e),x<=0)throw new Error(`parser: max node hits must be integer > 0: ${e}`)};const O=function(t,n,c){let d;!function(e){const t="parser.js: initializeGrammar(): ";if(!e)throw new Error(`${t}grammar object undefined`);if("grammarObject"!==e.grammarObject)throw new Error(`${t}bad grammar object`);g=e.rules,y=e.udts}(t);const w=function(e){const t="parser.js: initializeStartRule(): ";let n=null;if("number"===typeof e){if(e>=g.length)throw new Error(`${t}start rule index too large: max: ${g.length}: index: ${e}`);n=e}else{if("string"!==typeof e)throw new Error(`${t}type of start rule '${typeof e}' not recognized`);{const r=e.toLowerCase();for(let e=0;er){let e=`parser.js: opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${r}`,new Error(e)}switch(n.state){case e.ACTIVE:if(!0!==i)throw new Error(`parser.js: opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:n.phraseLength=0;break;case e.MATCH:0===n.phraseLength&&(n.state=e.EMPTY);break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`parser.js: opRNM(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}},P=function(t,n,o){let s,c,d,f,p,m;const y=u[t],v=g[y.index],w=h[v.index],x=!C();if(x&&(c=r.ast&&r.ast.ruleDefined(y.index),c&&(s=r.ast.getLength(),r.ast.down(y.index,g[y.index].name)),f=o.uFrame.length(),p=o.pFrame.length(),o.uFrame.push(),o.pFrame.push(),m=o.pFrame,o.pFrame=new k),null===w)d=u,u=v.opcodes,i(0,n,o),u=d;else{const t=a-n;o.ruleIndex=v.index,w(o,l,n,b),D(v,o,t,!0),o.state===e.ACTIVE&&(d=u,u=v.opcodes,i(0,n,o),u=d,o.ruleIndex=v.index,w(o,l,n,b),D(v,o,t,!1))}x&&(c&&(o.state===e.NOMATCH?r.ast.setLength(s):r.ast.up(y.index,v.name,n,o.phraseLength)),o.pFrame=m,o.state===e.NOMATCH?(o.uFrame.pop(f),o.pFrame.pop(p)):v.isBkr&&(o.pFrame.savePhrase(v.lower,n,o.phraseLength),o.uFrame.savePhrase(v.lower,n,o.phraseLength)))},B=function(t,n,i){let o,s,c,d,f,p;const h=u[t],v=y[h.index];i.UdtIndex=v.index;const w=!C();w&&(c=r.ast&&r.ast.udtDefined(h.index),c&&(s=g.length+h.index,o=r.ast.getLength(),r.ast.down(s,v.name)),d=i.uFrame.length(),f=i.pFrame.length(),i.uFrame.push(),i.pFrame.push(),p=i.pFrame,i.pFrame=new k);const x=a-n;m[h.index](i,l,n,b),function(t,n,r){if(n.phraseLength>r){let e=`parser.js: opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${r}`,new Error(e)}switch(n.state){case e.ACTIVE:throw new Error(`parser.js: opUDT(${t.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(!1===t.empty)throw new Error(`parser.js: opUDT(${t.name}): callback function return error. May not return EMPTY.`);n.phraseLength=0;break;case e.MATCH:if(0===n.phraseLength){if(!1===t.empty)throw new Error(`parser.js: opUDT(${t.name}): callback function return error. May not return EMPTY.`);n.state=e.EMPTY}break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`parser.js: opUDT(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}}(v,i,x),w&&(c&&(i.state===e.NOMATCH?r.ast.setLength(o):r.ast.up(s,v.name,n,i.phraseLength)),i.pFrame=p,i.state===e.NOMATCH?(i.uFrame.pop(d),i.pFrame.pop(f)):v.isBkr&&(i.pFrame.savePhrase(v.lower,n,i.phraseLength),i.uFrame.savePhrase(v.lower,n,i.phraseLength)))},M=function(t,n,r){c.push({lookAround:e.LOOKAROUND_AHEAD,anchor:n,charsEnd:a,charsLength:s}),a=l.length,s=l.length-o,i(t+1,n,r);const u=c.pop();switch(a=u.charsEnd,s=u.charsLength,r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.EMPTY;break;case e.NOMATCH:r.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${r.state}`)}},N=function(t,n,r){c.push({lookAround:e.LOOKAROUND_AHEAD,anchor:n,charsEnd:a,charsLength:s}),a=l.length,s=l.length-o,i(t+1,n,r);const u=c.pop();switch(a=u.charsEnd,s=u.charsLength,r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.NOMATCH;break;case e.NOMATCH:r.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${r.state}`)}},F=function(t,n,r){r.state=e.NOMATCH,r.phraseLength=0,r.state=0===n?e.EMPTY:e.NOMATCH},L=function(t,n,r){r.state=e.NOMATCH,r.phraseLength=0,r.state=n===l.length?e.EMPTY:e.NOMATCH},j=function(t,n,r){switch(c.push({lookAround:e.LOOKAROUND_BEHIND,anchor:n}),i(t+1,n,r),c.pop(),r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.EMPTY;break;case e.NOMATCH:r.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${r.state}`)}},U=function(t,n,r){switch(c.push({lookAround:e.LOOKAROUND_BEHIND,anchor:n}),i(t+1,n,r),c.pop(),r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.NOMATCH;break;case e.NOMATCH:r.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${r.state}`)}};i=function(t,n,o){let s=!0;const h=u[t];if(p+=1,p>x)throw new Error(`parser: maximum number of node hits exceeded: ${x}`);if(d+=1,d>f&&(f=d,f>w))throw new Error(`parser: maximum parse tree depth exceeded: ${w}`);if(o.refresh(),null!==r.trace){const e=S();r.trace.down(h,o.state,n,o.phraseLength,e.anchor,e.lookAround)}if(c[c.length-1].lookAround===e.LOOKAROUND_BEHIND)switch(h.type){case e.ALT:R(t,n,o);break;case e.CAT:!function(t,n,o){let s,a,c,l;const d=u[t],f=o.uFrame.length(),p=o.pFrame.length();r.ast&&(a=r.ast.getLength()),s=!0,c=n,l=0;for(let r=d.children.length-1;r>=0;r-=1)if(i(d.children[r],c,o),c-=o.phraseLength,l+=o.phraseLength,o.state===e.NOMATCH){s=!1;break}s?(o.state=0===l?e.EMPTY:e.MATCH,o.phraseLength=l):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(f),o.pFrame.pop(p),r.ast&&r.ast.setLength(a))}(t,n,o);break;case e.REP:!function(t,n,o){let s,a,c,l;const d=u[t];a=n,c=0,l=0;const f=o.uFrame.length(),p=o.pFrame.length();for(r.ast&&(s=r.ast.getLength());!(a<=0)&&(i(t+1,a,o),o.state!==e.NOMATCH)&&o.state!==e.EMPTY&&(l+=1,c+=o.phraseLength,a-=o.phraseLength,l!==d.max););o.state===e.EMPTY||l>=d.min?(o.state=0===c?e.EMPTY:e.MATCH,o.phraseLength=c):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(f),o.pFrame.pop(p),r.ast&&r.ast.setLength(s))}(t,n,o);break;case e.RNM:P(t,n,o);break;case e.UDT:B(t,n,o);break;case e.AND:M(t,n,o);break;case e.NOT:N(t,n,o);break;case e.TRG:!function(t,n,r){const i=u[t];if(r.state=e.NOMATCH,r.phraseLength=0,n>0){const t=l[n-1];i.min<=t&&t<=i.max&&(r.state=e.MATCH,r.phraseLength=1)}}(t,n,o);break;case e.TBS:!function(t,n,r){let i;const o=u[t];r.state=e.NOMATCH;const s=o.string.length,a=n-s;if(a>=0){for(i=0;i=0){for(let e=0;e=65&&i<=90&&(i+=32),i!==o.string[e])return;r.state=e.MATCH,r.phraseLength=s}}(t,n,o);break;case e.BKR:!function(t,n,r){let i,o,s,a;const c=u[t];r.state=e.NOMATCH,r.phraseLength=0,a=c.index=0){if(f){for(i=0;i=65&&o<=90&&(o+=32),s>=65&&s<=90&&(s+=32),o!==s)return;r.state=e.MATCH,r.phraseLength=h}else for(i=0;i=a)&&(i(t+1,c,o),o.state!==e.NOMATCH)&&o.state!==e.EMPTY&&(d+=1,l+=o.phraseLength,c+=o.phraseLength,d!==f.max););o.state===e.EMPTY||d>=f.min?(o.state=0===l?e.EMPTY:e.MATCH,o.phraseLength=l):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(p),o.pFrame.pop(h),r.ast&&r.ast.setLength(s))}(t,n,o);break;case e.RNM:P(t,n,o);break;case e.UDT:B(t,n,o);break;case e.AND:M(t,n,o);break;case e.NOT:N(t,n,o);break;case e.TRG:!function(t,n,r){const i=u[t];r.state=e.NOMATCH,n=65&&o<=90&&(o+=32),o!==s.string[i])return;r.state=e.MATCH,r.phraseLength=c}}else r.state=e.EMPTY}(t,n,o);break;case e.BKR:!function(t,n,r){let i,o,s,c;const d=u[t];r.state=e.NOMATCH,c=d.index=65&&o<=90&&(o+=32),s>=65&&s<=90&&(s+=32),o!==s)return;r.state=e.MATCH,r.phraseLength=m}else for(i=0;iv&&(v=n+o.phraseLength),null!==r.stats&&r.stats.collect(h,o),null!==r.trace){const e=S();r.trace.up(h,o.state,n,o.phraseLength,e.anchor,e.lookAround)}return d-=1,s}}},35403:function(e,t,n){e.exports=function(){const e=n(58276),t=n(8544),r=n(93932);let i=[],o=[];const s=[];let a;const c=[],u=[];this.statsObject="statsObject";const l=function(e,t){return e.lowert.lower?1:0},d=function(e,t){return e.totalt.total?-1:l(e,t)},f=function(e,t){return e.indext.index?1:0},p=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},h=function(t,n){switch(t.total+=1,n){case e.EMPTY:t.empty+=1;break;case e.MATCH:t.match+=1;break;case e.NOMATCH:t.nomatch+=1;break;default:throw new Error(`stats.js: collect(): incStat(): unrecognized state: ${n}`)}},m=function(e,t){let n="";return n+="",n+=`${e}`,n+=`${t.empty}`,n+=`${t.match}`,n+=`${t.nomatch}`,n+=`${t.total}`,n+="\n",n},g=function(){let t="";return t+=m("ALT",s[e.ALT]),t+=m("CAT",s[e.CAT]),t+=m("REP",s[e.REP]),t+=m("RNM",s[e.RNM]),t+=m("TRG",s[e.TRG]),t+=m("TBS",s[e.TBS]),t+=m("TLS",s[e.TLS]),t+=m("UDT",s[e.UDT]),t+=m("AND",s[e.AND]),t+=m("NOT",s[e.NOT]),t+=m("BKR",s[e.BKR]),t+=m("BKA",s[e.BKA]),t+=m("BKN",s[e.BKN]),t+=m("ABG",s[e.ABG]),t+=m("AEN",s[e.AEN]),t+=m("totals",a),t},y=function(){let e="";e+="\n",e+="rules\n";for(let t=0;t0&&(e+="",e+=`${c[t].name}`,e+=`${c[t].empty}`,e+=`${c[t].match}`,e+=`${c[t].nomatch}`,e+=`${c[t].total}`,e+="\n");if(o.length>0){e+="\n",e+="udts\n";for(let t=0;t0&&(e+="",e+=`${u[t].name}`,e+=`${u[t].empty}`,e+=`${u[t].match}`,e+=`${u[t].nomatch}`,e+=`${u[t].total}`,e+="\n")}return e};this.validate=function(e){let t=!1;return"string"===typeof e&&"stats"===e&&(t=!0),t},this.init=function(t,n){i=t,o=n,function(){s.length=0,a=new p,s[e.ALT]=new p,s[e.CAT]=new p,s[e.REP]=new p,s[e.RNM]=new p,s[e.TRG]=new p,s[e.TBS]=new p,s[e.TLS]=new p,s[e.UDT]=new p,s[e.AND]=new p,s[e.NOT]=new p,s[e.BKR]=new p,s[e.BKA]=new p,s[e.BKN]=new p,s[e.ABG]=new p,s[e.AEN]=new p,c.length=0;for(let e=0;e0){u.length=0;for(let e=0;e\n`,"string"===typeof t&&(n+=`${t}\n`),n+=`ops\n`,n+=`EMPTY\n`,n+=`MATCH\n`,n+=`NOMATCH\n`,n+=`totals\n`;for(;;){if(void 0===e){n+=g();break}if(null===e){n+=g();break}if("ops"===e){n+=g();break}if("index"===e){c.sort(f),u.length>0&&u.sort(f),n+=g(),n+=y();break}if("hits"===e){c.sort(d),u.length>0&&u.sort(f),n+=g(),n+=y();break}if("alpha"===e){c.sort(l),u.length>0&&u.sort(l),n+=g(),n+=y();break}break}return n+="\n",n},this.toHtmlPage=function(e,n,r){return t.htmlToPage(this.toHtml(e,n),r)}}},93932:function(e){e.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}},99290:function(e,t,n){e.exports=function(){const e=n(8544),t=n(93932),r=new(n(42761)),i=n(58276),o=this,s=16,a=80,c=[];let u=5e3,l=-1,d=0,f=0;const p=[];let h=null,m=null,g=null;const y=[],b=[],v=``,w=``,x=`𝜺`;this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(e,t){l=-1,"number"===typeof e&&e>0?(u=Math.ceil(e),"number"===typeof t&&(l=Math.floor(t),l<0&&(l=-1))):u=0},this.getMaxRecords=function(){return u},this.getLastRecord=function(){return l},this.init=function(e,t,n){c.length=0,p.length=0,d=0,f=0,h=n,m=e,g=t,function(){const e=function(e){y[i.ALT]=e,y[i.CAT]=e,y[i.REP]=e,y[i.TLS]=e,y[i.TBS]=e,y[i.TRG]=e,y[i.AND]=e,y[i.NOT]=e,y[i.BKR]=e,y[i.BKA]=e,y[i.BKN]=e,y[i.ABG]=e,y[i.AEN]=e};let t=0;for(const n in o.filter.operators)t+=1;if(0!==t){for(const t in o.filter.operators){const n=t.toUpperCase();if(""===n)return void e(!0);if(""===n)return void e(!1)}e(!1);for(const e in o.filter.operators){const t=e.toUpperCase();if("ALT"===t)y[i.ALT]=!0===o.filter.operators[e];else if("CAT"===t)y[i.CAT]=!0===o.filter.operators[e];else if("REP"===t)y[i.REP]=!0===o.filter.operators[e];else if("AND"===t)y[i.AND]=!0===o.filter.operators[e];else if("NOT"===t)y[i.NOT]=!0===o.filter.operators[e];else if("TLS"===t)y[i.TLS]=!0===o.filter.operators[e];else if("TBS"===t)y[i.TBS]=!0===o.filter.operators[e];else if("TRG"===t)y[i.TRG]=!0===o.filter.operators[e];else if("BKR"===t)y[i.BKR]=!0===o.filter.operators[e];else if("BKA"===t)y[i.BKA]=!0===o.filter.operators[e];else if("BKN"===t)y[i.BKN]=!0===o.filter.operators[e];else if("ABG"===t)y[i.ABG]=!0===o.filter.operators[e];else{if("AEN"!==t)throw new Error(`trace.js: initOpratorFilter: '${e}' not a valid operator name. Must be , , alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`);y[i.AEN]=!0===o.filter.operators[e]}}}else e(!1)}(),function(){const e=function(e){y[i.RNM]=e,y[i.UDT]=e;const t=m.length+g.length;b.length=0;for(let n=0;n"===n)return void e(!0);if(""===n)return void e(!1)}e(!1),y[i.RNM]=!0,y[i.UDT]=!0;for(const e in o.filter.rules){const t=e.toLowerCase();if(n=r.indexOf(t),n<0)throw new Error(`trace.js: initRuleFilter: '${e}' not a valid rule or udt name`);b[n]=!0===o.filter.rules[e]}}else e(!0)}(),r.init(u)};const A=function(e){let t=!1;return t=e.type===i.RNM?!(!y[e.type]||!b[e.index]):e.type===i.UDT?!(!y[e.type]||!b[m.length+e.index]):y[e.type],t},E=function(e){return-1===l||e<=l};this.down=function(e,t,n,i,o,s){E(d)&&A(e)&&(p.push(d),c[r.increment()]={dirUp:!1,depth:f,thisLine:d,thatLine:void 0,opcode:e,state:t,phraseIndex:n,phraseLength:i,lookAnchor:o,lookAround:s},d+=1,f+=1)},this.up=function(e,t,n,i,o,s){if(E(d)&&A(e)){const a=d,u=p.pop(),l=r.getListIndex(u);-1!==l&&(c[l].thatLine=a),f-=1,c[r.increment()]={dirUp:!0,depth:f,thisLine:a,thatLine:u,opcode:e,state:t,phraseIndex:n,phraseLength:i,lookAnchor:o,lookAround:s},d+=1}};this.toTree=function(t){const n=function(){function t(t,n){let r,o,s;if(n)switch(t.op={id:n.type,name:e.opcodeToString(n.type)},t.opData=void 0,n.type){case i.RNM:t.opData=m[n.index].name;break;case i.UDT:t.opData=g[n.index].name;break;case i.BKR:r=n.index{if(w=c[e],x&&(x=!1,w.depth>0)){const e=w.dirUp?w.depth+1:w.depth;for(let t=0;t1;)b=p.pop(),a(b,null);if(0===A.children.length)throw new Error("trace.toTree(): parse tree has no nodes");if(0===p.length)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");y=A.children[0];let E=y;for(;y&&!y.down&&!y.up;)E=y,y=y.children[0];y=E,y.leftMost=!0,y.rightMost=!0,function e(t){if(l+=1,t.branch=d,l>f&&(f=l),0===t.children.length)u+=1;else for(let n=0;n0&&(d+=1),t.children[n].leftMost=!1,t.children[n].rightMost=!1,t.leftMost&&(t.children[n].leftMost=0===n),t.rightMost&&(t.children[n].rightMost=n===t.children.length-1),e(t.children[n]);l-=1}(y),y.branch=0;const _={string:[]};for(let e=0;e`,g="
";let y=!1;switch(r){case i.EMPTY:p+=x;case i.NOMATCH:case i.ACTIVE:u=o,l=0,d=o,f=n.length-d;break;case i.MATCH:u=o,l=s,d=o+l,f=n.length-d;break;default:throw new Error("unrecognized state")}return h=v,l>a?(l=a,h=w,f=0):l+f>a&&(h=w,f=a-l),l>0&&(p+=c,p+=_(e,n,u,l,y),p+=g,y=!0),f>0&&(p+=m,p+=_(e,n,d,f,y),p+=g),p+h},T=function(n){if(null===m)return"";let u,l,d,f,p,y,b="";return b+="(a)(b)(c)(d)(e)(f)",b+="operatorphrase\n",r.forEach((r=>{const A=c[r];switch(u=A.thisLine,l=void 0!==A.thatLine?A.thatLine:"--",d=!1,f=!1,p=!1,A.lookAround===i.LOOKAROUND_AHEAD&&(d=!0,p=!0,y=A.lookAnchor),A.opcode.type!==i.AND&&A.opcode.type!==i.NOT||(d=!0,p=!0,y=A.phraseIndex),A.lookAround===i.LOOKAROUND_BEHIND&&(f=!0,p=!0,y=A.lookAnchor),A.opcode.type!==i.BKA&&A.opcode.type!==i.BKN||(f=!0,p=!0,y=A.phraseIndex),b+="",b+=`${u}${l}`,b+=`${A.phraseIndex}`,b+=`${A.phraseLength}`,b+=`${A.depth}`,b+="",A.state){case i.ACTIVE:b+=`↓ `;break;case i.MATCH:b+=`↑M`;break;case i.NOMATCH:b+=`↑N`;break;case i.EMPTY:b+=`↑E`;break;default:b+=`--`}if(b+="",b+="",b+=o.indent(A.depth),d?b+=``:f&&(b+=``),b+=e.opcodeToString(A.opcode.type),A.opcode.type===i.RNM&&(b+=`(${m[A.opcode.index].name}) `),A.opcode.type===i.BKR){const e=A.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",t=A.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";b+=`(\\${e}${t}${m[A.opcode.index].name}) `}A.opcode.type===i.UDT&&(b+=`(${g[A.opcode.index].name}) `),A.opcode.type===i.TRG&&(b+=`(${function(e,t){let n="";if(t.type===i.TRG)if(e===s||32===e){let r=t.min.toString(16).toUpperCase();r.length%2!==0&&(r=`0${r}`),n+=e===s?"%x":"U+",n+=r,r=t.max.toString(16).toUpperCase(),r.length%2!==0&&(r=`0${r}`),n+=`–${r}`}else n=`%d${t.min.toString(10)}–${t.max.toString(10)}`;return n}(n,A.opcode)}) `),A.opcode.type===i.TBS&&(b+=`(${function(e,t){let n="";if(t.type===i.TBS){const r=Math.min(t.string.length,10);if(e===s||32===e){n+=e===s?"%x":"U+";for(let e=0;e0&&(n+="."),r=t.string[e].toString(16).toUpperCase(),r.length%2!==0&&(r=`0${r}`),n+=r}}else{n="%d";for(let e=0;e0&&(n+="."),n+=t.string[e].toString(10)}r0&&(r+="."),o=n.string[t],o>=97&&o<=122?(e=o-32,r+=`${e.toString(a)}/${o.toString(a)}`.toUpperCase()):o>=65&&o<=90?(e=o,o+=32,r+=`${e.toString(a)}/${o.toString(a)}`.toUpperCase()):r+=o.toString(a).toUpperCase();i`,g=``,y="";let b=!1;switch(r){case i.EMPTY:p+=x;case i.NOMATCH:case i.MATCH:case i.ACTIVE:u=o-s,l=c-u,d=c,f=n.length-d;break;default:throw new Error("unrecognized state")}return h=v,l>a?(l=a,h=w,f=0):l+f>a&&(h=w,f=a-l),l>0&&(p+=m,p+=_(e,n,u,l,b),p+=y,b=!0),f>0&&(p+=g,p+=_(e,n,d,f,b),p+=y),p+h}(n,h,A.state,A.phraseIndex,A.phraseLength,y):d?function(e,n,r,i,o){const s=``;return k(e,n,r,i,o,s)}(n,h,A.state,A.phraseIndex,A.phraseLength):function(e,n,r,i,o){const s=``;return k(e,n,r,i,o,s)}(n,h,A.state,A.phraseIndex,A.phraseLength),b+="\n"})),b+="(a)(b)(c)(d)(e)(f)",b+="operatorphrase\n",b+="\n",b};this.toHtml=function(e,n){let r=8;if("string"===typeof e&&e.length>=3){const t=e.toLowerCase().slice(0,3);"hex"===t?r=s:"dec"===t?r=10:"uni"===t&&(r=32)}let i="";return i+=function(e,n){let r;switch(e){case s:r="hexadecimal";break;case 10:r="decimal";break;case 8:r="ASCII";break;case 32:r="UNICODE";break;default:throw new Error(`trace.js: htmlHeader: unrecognized mode: ${e}`)}let i="";return i+=`

display mode: ${r}

\n`,i+=`\n`,"string"===typeof n&&(i+=``),i}(r,n),i+=T(r),i+=function(){let e="";return e+="
${n}
\n",e+=`

legend:
\n`,e+="(a) - line number
\n",e+="(b) - matching line number
\n",e+="(c) - phrase offset
\n",e+="(d) - phrase length
\n",e+="(e) - tree depth
\n",e+="(f) - operator state
\n",e+=`    -   phrase opened
\n`,e+=`    - ↑M phrase matched
\n`,e+=`    - ↑E empty phrase matched
\n`,e+=`    - ↑N phrase not matched
\n`,e+="operator - ALT, CAT, REP, RNM, TRG, TLS, TBS, UDT, AND, NOT, BKA, BKN, BKR, ABG, AEN
\n",e+="phrase   - up to 80 characters of the phrase being matched
\n",e+=`         - matched characters
\n`,e+=`         - matched characters in look ahead mode
\n`,e+=`         - matched characters in look behind mode
\n`,e+=`         - remainder characters(not yet examined by parser)
\n`,e+=`         - control characters, TAB, LF, CR, etc. (ASCII mode only)
\n`,e+=`         - ${x} empty string
\n`,e+=`         - ${v} end of input string
\n`,e+=`         - ${w} input string display truncated
\n`,e+="

\n",e+=`

\n`,e+="original ABNF operators:
\n",e+="ALT - alternation
\n",e+="CAT - concatenation
\n",e+="REP - repetition
\n",e+="RNM - rule name
\n",e+="TRG - terminal range
\n",e+="TLS - terminal literal string (case insensitive)
\n",e+="TBS - terminal binary string (case sensitive)
\n",e+="
\n",e+="super set SABNF operators:
\n",e+="UDT - user-defined terminal
\n",e+="AND - positive look ahead
\n",e+="NOT - negative look ahead
\n",e+="BKA - positive look behind
\n",e+="BKN - negative look behind
\n",e+="BKR - back reference
\n",e+="ABG - anchor - begin of input string
\n",e+="AEN - anchor - end of input string
\n",e+="

\n",e}(),i}}},8544:function(e,t,n){const r=n(93932),i=n(20979),o=n(91593),s=n(58276),a=function(e,t,n){let r,i=t;for(;;){if(e<=0){i=0,r=0;break}if("number"!==typeof i){i=0,r=e;break}if(i>=e){i=e,r=e;break}if("number"!==typeof n){r=e;break}if(r=i+n,r>e){r=e;break}break}return{beg:i,end:r}};t.htmlToPage=function(e,t){let n;if("string"!==typeof e)throw new Error("utilities.js: htmlToPage: input HTML is not a string");n="string"!==typeof t?"htmlToPage":t;let r="";return r+="\n",r+='\n',r+="\n",r+='\n',r+=`${n}\n`,r+="\n",r+="\n\n",r+=`

${new Date}

\n`,r+=e,r+="\n\n",r},t.parserResultToHtml=function(e,t){let n,i,o=null;"string"===typeof t&&""!==t&&(o=t),n=!0===e.success?`true`:`false`,i=e.state===s.EMPTY?`EMPTY`:e.state===s.MATCH?`MATCH`:e.state===s.NOMATCH?`NOMATCH`:`unrecognized`;let a="";return a+=`\n`,o&&(a+=`\n`),a+="\n",a+=`\n`,a+=`\n",a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+=`\n`,a+="
${o}
state itemvaluedescription
parser success${n}true if the parse succeeded,\n`,a+=` false otherwise`,a+="
NOTE: for success, entire string must be matched
parser state${i}EMPTY, `,a+=`MATCH or \n`,a+=`NOMATCH
string length${e.length}length of the input (sub)string
matched length${e.matched}number of input string characters matched
max matched${e.maxMatched}maximum number of input string characters matched
max tree depth${e.maxTreeDepth}maximum depth of the parse tree reached
node hits${e.nodeHits}number of parse tree node hits (opcode function calls)
input length${e.inputLength}length of full input string
sub-string begin${e.subBegin}sub-string first character index
sub-string end${e.subEnd}sub-string end-of-string index
sub-string length${e.subLength}sub-string length
\n",a},t.charsToString=function(e,t,n){let r,o;if("number"===typeof t){if(t>=e.length)return"";r=t<0?0:t}else r=0;if("number"===typeof n){if(n<=0)return"";o=n>e.length-r?e.length:r+n}else o=e.length;return ri.beg){r+=e[i.beg];for(let t=i.beg+1;to.beg){i+=`\\x${t.charToHex(e[o.beg])}`;for(let n=o.beg+1;ni.beg)for(let o=i.beg;oo.beg)for(let a=o.beg;a=55296&&s<=57343||s>1114111?` U+${t.charToHex(e[a])}`:`&#${e[a]};`;var s;return i},t.charsToJsUnicode=function(e,n,r){let i="";if(!Array.isArray(e))throw new Error("utilities.js: charsToJsUnicode: input must be an array of integers");const o=a(e.length,n,r);if(o.end>o.beg){i+=`\\u${t.charToHex(e[o.beg])}`;for(let n=o.beg+1;n=32&&n<=126?String.fromCharCode(n):`\\x${t.charToHex(n)}`}return i},t.charsToAsciiHtml=function(e,n,i){if(!Array.isArray(e))throw new Error("utilities.js: charsToAsciiHtml: input must be an array of integers");let o,s="";const c=a(e.length,n,i);for(let a=c.beg;a${t.asciiChars[o]}
`:o>127?`U+${t.charToHex(o)}`:t.asciiChars[o];return s},t.stringToAsciiHtml=function(e){const t=i.decode("STRING",e);return this.charsToAsciiHtml(t)}},9669:function(e,t,n){e.exports=n(51609)},55448:function(e,t,n){"use strict";var r=n(64867),i=n(36026),o=n(4372),s=n(15327),a=n(94097),c=n(84109),u=n(67985),l=n(77874),d=n(82648),f=n(60644),p=n(90205);e.exports=function(e){return new Promise((function(t,n){var h,m=e.data,g=e.headers,y=e.responseType;function b(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}r.isFormData(m)&&r.isStandardBrowserEnv()&&delete g["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",x=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";g.Authorization="Basic "+btoa(w+":"+x)}var A=a(e.baseURL,e.url);function E(){if(v){var r="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,o={data:y&&"text"!==y&&"json"!==y?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:r,config:e,request:v};i((function(e){t(e),b()}),(function(e){n(e),b()}),o),v=null}}if(v.open(e.method.toUpperCase(),s(A,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=E:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(E)},v.onabort=function(){v&&(n(new d("Request aborted",d.ECONNABORTED,e,v)),v=null)},v.onerror=function(){n(new d("Network Error",d.ERR_NETWORK,e,v,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||l;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new d(t,r.clarifyTimeoutError?d.ETIMEDOUT:d.ECONNABORTED,e,v)),v=null},r.isStandardBrowserEnv()){var _=(e.withCredentials||u(A))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;_&&(g[e.xsrfHeaderName]=_)}"setRequestHeader"in v&&r.forEach(g,(function(e,t){"undefined"===typeof m&&"content-type"===t.toLowerCase()?delete g[t]:v.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),y&&"json"!==y&&(v.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){v&&(n(!e||e&&e.type?new f:e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),m||(m=null);var k=p(A);k&&-1===["http","https","file"].indexOf(k)?n(new d("Unsupported protocol "+k+":",d.ERR_BAD_REQUEST,e)):v.send(m)}))}},51609:function(e,t,n){"use strict";var r=n(64867),i=n(91849),o=n(30321),s=n(47185);var a=function e(t){var n=new o(t),a=i(o.prototype.request,n);return r.extend(a,o.prototype,n),r.extend(a,n),a.create=function(n){return e(s(t,n))},a}(n(45546));a.Axios=o,a.CanceledError=n(60644),a.CancelToken=n(14972),a.isCancel=n(26502),a.VERSION=n(97288).version,a.toFormData=n(47675),a.AxiosError=n(82648),a.Cancel=a.CanceledError,a.all=function(e){return Promise.all(e)},a.spread=n(8713),a.isAxiosError=n(16268),e.exports=a,e.exports.default=a},14972:function(e,t,n){"use strict";var r=n(60644);function i(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(e){d.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){d.headers[e]=i.merge(u)})),e.exports=d},77874:function(e){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},97288:function(e){e.exports={version:"0.27.2"}},91849:function(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},90205:function(e){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},8713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},47675:function(e,t,n){"use strict";var r=n(48764).Buffer,i=n(64867);e.exports=function(e,t){t=t||new FormData;var n=[];function o(e){return null===e?"":i.isDate(e)?e.toISOString():i.isArrayBuffer(e)||i.isTypedArray(e)?"function"===typeof Blob?new Blob([e]):r.from(e):e}return function e(r,s){if(i.isPlainObject(r)||i.isArray(r)){if(-1!==n.indexOf(r))throw Error("Circular reference detected in "+s);n.push(r),i.forEach(r,(function(n,r){if(!i.isUndefined(n)){var a,c=s?s+"."+r:r;if(n&&!s&&"object"===typeof n)if(i.endsWith(r,"{}"))n=JSON.stringify(n);else if(i.endsWith(r,"[]")&&(a=i.toArray(n)))return void a.forEach((function(e){!i.isUndefined(e)&&t.append(c,o(e))}));e(n,c)}})),n.pop()}else t.append(s,o(r))}(e),t}},54875:function(e,t,n){"use strict";var r=n(97288).version,i=n(82648),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var s={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new i(o(r," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!s[r]&&(s[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!==typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var s=r[o],a=t[s];if(a){var c=e[s],u=void 0===c||a(c,s,e);if(!0!==u)throw new i("option "+s+" must be "+u,i.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new i("Unknown option "+s,i.ERR_BAD_OPTION)}},validators:o}},64867:function(e,t,n){"use strict";var r,i=n(91849),o=Object.prototype.toString,s=(r=Object.create(null),function(e){var t=o.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function a(e){return e=e.toLowerCase(),function(t){return s(t)===e}}function c(e){return Array.isArray(e)}function u(e){return"undefined"===typeof e}var l=a("ArrayBuffer");function d(e){return null!==e&&"object"===typeof e}function f(e){if("object"!==s(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var p=a("Date"),h=a("File"),m=a("Blob"),g=a("FileList");function y(e){return"[object Function]"===o.call(e)}var b=a("URLSearchParams");function v(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),c(e))for(var n=0,r=e.length;n0;)s[o=r[i]]||(t[o]=e[o],s[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;var t=e.length;if(u(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:x,isFileList:g}},58162:function(e,t,n){"use strict";var r=n(89509).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,l=new Uint8Array(s);e[n];){var d=t[e.charCodeAt(n)];if(255===d)return;for(var f=0,p=s-1;(0!==d||f>>0,l[p]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error("Non-zero carry");o=f,n++}for(var h=s-o;h!==s&&0===l[h];)h++;var m=r.allocUnsafe(i+(s-h));m.fill(0,0,i);for(var g=i;h!==s;)m[g++]=l[h++];return m}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=r.from(t)),!r.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var n=0,i=0,o=0,s=t.length;o!==s&&0===t[o];)o++,n++;for(var u=(s-o)*l+1>>>0,d=new Uint8Array(u);o!==s;){for(var f=t[o],p=0,h=u-1;(0!==f||p>>0,d[h]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");i=p,o++}for(var m=u-i;m!==u&&0===d[m];)m++;for(var g=c.repeat(n);m0?s-4:s;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===a&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===a&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,c=r-i;ac?c:a+s));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],r=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,o,s=[],a=t;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},92882:function(e){"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={},r=0;r>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=o(t)^r>>5}for(t=o(t),n=0;nt)return"Exceeds length limit";var r=e.toLowerCase(),i=e.toUpperCase();if(e!==r&&e!==i)return"Mixed-case string "+e;var a=(e=r).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var c=e.slice(0,a),u=e.slice(a+1);if(u.length<6)return"Data too short";var l=s(c);if("string"===typeof l)return l;for(var d=[],f=0;f=u.length||d.push(h)}return 1!==l?"Invalid checksum for "+e:{prefix:c,words:d}}function c(e,t,n,r){for(var i=0,o=0,s=(1<=n;)o-=n,a.push(i>>o&s);if(r)o>0&&a.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var i=s(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var a=e+"1",c=0;c>5!==0)throw new Error("Non 5-bit word");i=o(i)^u,a+=t.charAt(u)}for(c=0;c<6;++c)i=o(i);for(i^=1,c=0;c<6;++c){a+=t.charAt(i>>5*(5-c)&31)}return a},toWordsUnsafe:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},40475:function(e,t,n){"use strict";var r=n(48764).Buffer;t.oU=function(e){{const t=r.from(e);t.reverse();const n=t.toString("hex");return 0===n.length?BigInt(0):BigInt(`0x${n}`)}},t.k$=function(e,t){{const n=e.toString(16),i=r.from(n.padStart(2*t,"0").slice(0,2*t),"hex");return i.reverse(),i}}},13550:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(46601).Buffer}catch(k){}function a(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function c(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,n,r){for(var i=0,o=Math.min(e.length,n),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,s=o%r,a=Math.min(o,o-s)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[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],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;n.words[0]=a;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=f;p++){var h=u-p|0;l+=(s=(i=0|e.words[h])*(o=0|t.words[p])+d)/67108864|0,d=67108863&s}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?l[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],p=f[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modn(p).toString(e);n=(h=h.idivn(p)).isZero()?m+n:l[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r("undefined"!==typeof s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,p=0|s[1],h=8191&p,m=p>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,A=0|s[4],E=8191&A,_=A>>>13,k=0|s[5],T=8191&k,S=k>>>13,C=0|s[6],I=8191&C,O=C>>>13,R=0|s[7],D=8191&R,P=R>>>13,B=0|s[8],M=8191&B,N=B>>>13,F=0|s[9],L=8191&F,j=F>>>13,U=0|a[0],Z=8191&U,H=U>>>13,z=0|a[1],G=8191&z,V=z>>>13,W=0|a[2],q=8191&W,$=W>>>13,K=0|a[3],Y=8191&K,X=K>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],ne=8191&te,re=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,pe=0|a[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(d,Z))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,Z)|0))<<13)|0;u=((o=Math.imul(f,H))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,H))+Math.imul(m,Z)|0,o=Math.imul(m,H);var ye=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,H))+Math.imul(b,Z)|0,o=Math.imul(b,H),r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0;var be=(u+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,H))+Math.imul(x,Z)|0,o=Math.imul(x,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,V)|0,r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0;var ve=(u+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(E,Z),i=(i=Math.imul(E,H))+Math.imul(_,Z)|0,o=Math.imul(_,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,$)|0,r=r+Math.imul(h,Y)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,X)|0;var we=(u+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,H))+Math.imul(S,Z)|0,o=Math.imul(S,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,$)|0,r=r+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,X)|0,r=r+Math.imul(h,Q)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var xe=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(I,Z),i=(i=Math.imul(I,H))+Math.imul(O,Z)|0,o=Math.imul(O,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,X)|0,r=r+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(u+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,H))+Math.imul(P,Z)|0,o=Math.imul(P,H),r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Ee=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,H))+Math.imul(N,Z)|0,o=Math.imul(N,H),r=r+Math.imul(D,G)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,r=r+Math.imul(h,ce)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var _e=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,H))+Math.imul(j,Z)|0,o=Math.imul(j,H),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(D,q)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,r=r+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var ke=(u+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,he)|0))<<13)|0;u=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(j,G)|0,o=Math.imul(j,V),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,r=r+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var Te=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,$))+Math.imul(j,q)|0,o=Math.imul(j,$),r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Se=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,Y),i=(i=Math.imul(L,X))+Math.imul(j,Y)|0,o=Math.imul(j,X),r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(D,ne)|0,i=(i=i+Math.imul(D,re)|0)+Math.imul(P,ne)|0,o=o+Math.imul(P,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var Ce=(u+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,r=r+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ie=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(_,he)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(j,ne)|0,o=Math.imul(j,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,r=r+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,fe)|0;var Oe=(u+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,oe),i=(i=Math.imul(L,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,r=r+Math.imul(D,de)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Re=(u+(r=r+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(O,he)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,ce),i=(i=Math.imul(L,ue))+Math.imul(j,ce)|0,o=Math.imul(j,ue),r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var De=(u+(r=r+Math.imul(D,he)|0)|0)+((8191&(i=(i=i+Math.imul(D,me)|0)+Math.imul(P,he)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,fe))+Math.imul(j,de)|0,o=Math.imul(j,fe);var Pe=(u+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(N,he)|0))<<13)|0;u=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Be=(u+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(j,he)|0))<<13)|0;return u=((o=Math.imul(j,me))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ae,c[7]=Ee,c[8]=_e,c[9]=ke,c[10]=Te,c[11]=Se,c[12]=Ce,c[13]=Ie,c[14]=Oe,c[15]=Re,c[16]=De,c[17]=Pe,c[18]=Be,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(h=p),o.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?h(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):m(this,e,t),n},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,s=0|i.words[i.length-1];0!==(n=26-this._countBits(s))&&(i=i.ushln(n),r.iushln(n),s=0|i.words[i.length-1]);var a,c=r.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);a&&(a.words[d]=f)}return a&&a.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=s;0!==p.cmp(a);){for(var m=p,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===r&&0===l)&&(i=this.mul(i,n[s]),a=0,s=0)):a=0}c=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new _(e)},i(_,E),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},25532:function(e,t,n){"use strict";var r=n(48764).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeUnchecked=t.deserialize=t.serialize=t.BinaryReader=t.BinaryWriter=t.BorshError=t.baseDecode=t.baseEncode=void 0;const u=c(n(70945)),l=c(n(77191)),d=a(n(21127)),f=new("function"!==typeof TextDecoder?d.TextDecoder:TextDecoder)("utf-8",{fatal:!0});t.baseEncode=function(e){return"string"===typeof e&&(e=r.from(e,"utf8")),l.default.encode(r.from(e))},t.baseDecode=function(e){return r.from(l.default.decode(e))};const p=1024;class h extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}t.BorshError=h;class m{constructor(){this.buf=r.alloc(p),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=r.concat([this.buf,r.alloc(p)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",64)))}writeBuffer(e){this.buf=r.concat([r.from(this.buf.subarray(0,this.length)),e,r.alloc(p)]),this.length+=e.length}writeString(e){this.maybeResize();const t=r.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(r.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(const n of e)this.maybeResize(),t(n)}toArray(){return this.buf.subarray(0,this.length)}}function g(e,t,n){const r=n.value;n.value=function(...e){try{return r.apply(this,e)}catch(t){if(t instanceof RangeError){const e=t.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(e)>=0)throw new h("Reached the end of buffer when deserializing")}throw t}}}t.BinaryWriter=m;class y{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new u.default(e,"le")}readU128(){const e=this.readBuffer(16);return new u.default(e,"le")}readU256(){const e=this.readBuffer(32);return new u.default(e,"le")}readU512(){const e=this.readBuffer(64);return new u.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new h(`Expected buffer length ${e} isn't within bounds`);const t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){const e=this.readU32(),t=this.readBuffer(e);try{return f.decode(t)}catch(n){throw new h(`Error decoding UTF-8 string: ${n}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const t=this.readU32(),n=Array();for(let r=0;r{v(e,t,n,r[0],i)}));else if(void 0!==r.kind)switch(r.kind){case"option":null===n||void 0===n?i.writeU8(0):(i.writeU8(1),v(e,t,n,r.type,i));break;case"map":i.writeU32(n.size),n.forEach(((n,o)=>{v(e,t,o,r.key,i),v(e,t,n,r.value,i)}));break;default:throw new h(`FieldType ${r} unrecognized`)}else w(e,n,i)}catch(o){throw o instanceof h&&o.addToFieldPath(t),o}}function w(e,t,n){if("function"===typeof t.borshSerialize)return void t.borshSerialize(n);const r=e.get(t.constructor);if(!r)throw new h(`Class ${t.constructor.name} is missing in schema`);if("struct"===r.kind)r.fields.map((([r,i])=>{v(e,r,t[r],i,n)}));else{if("enum"!==r.kind)throw new h(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`);{const i=t[r.field];for(let o=0;ox(e,t,n[0],r)))}if("option"===n.kind){return r.readU8()?x(e,t,n.type,r):void 0}if("map"===n.kind){let i=new Map;const o=r.readU32();for(let s=0;s=r.values.length)throw new h(`Enum index: ${i} is out of range`);const[o,s]=r.values[i];return new t({[o]:x(e,o,s,n)})}throw new h(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}s([g],y.prototype,"readU8",null),s([g],y.prototype,"readU16",null),s([g],y.prototype,"readU32",null),s([g],y.prototype,"readU64",null),s([g],y.prototype,"readU128",null),s([g],y.prototype,"readU256",null),s([g],y.prototype,"readU512",null),s([g],y.prototype,"readString",null),s([g],y.prototype,"readFixedArray",null),s([g],y.prototype,"readArray",null),t.BinaryReader=y,t.serialize=function(e,t,n=m){const r=new n;return w(e,t,r),r.toArray()},t.deserialize=function(e,t,n,r=y){const i=new r(n),o=A(e,t,i);if(i.offset=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,n,i){for(var o=0,s=0,a=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,s=o%r,a=Math.min(o,o-s)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(C){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?""}var f=["","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"],p=[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],h=[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];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?f[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=p[e],l=h[e];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(l).toString(e);n=(d=d.idivn(l)).isZero()?m+n:f[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;n.words[0]=a;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=f;p++){var h=u-p|0;l+=(s=(i=0|e.words[h])*(o=0|t.words[p])+d)/67108864|0,d=67108863&s}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(e[n--]=s>>8&255),n>=0&&(e[n--]=s>>16&255),6===o?(n>=0&&(e[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,p=0|s[1],h=8191&p,m=p>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,A=0|s[4],E=8191&A,_=A>>>13,k=0|s[5],T=8191&k,S=k>>>13,C=0|s[6],I=8191&C,O=C>>>13,R=0|s[7],D=8191&R,P=R>>>13,B=0|s[8],M=8191&B,N=B>>>13,F=0|s[9],L=8191&F,j=F>>>13,U=0|a[0],Z=8191&U,H=U>>>13,z=0|a[1],G=8191&z,V=z>>>13,W=0|a[2],q=8191&W,$=W>>>13,K=0|a[3],Y=8191&K,X=K>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],ne=8191&te,re=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,pe=0|a[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(d,Z))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,Z)|0))<<13)|0;u=((o=Math.imul(f,H))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,H))+Math.imul(m,Z)|0,o=Math.imul(m,H);var ye=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,H))+Math.imul(b,Z)|0,o=Math.imul(b,H),r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0;var be=(u+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,H))+Math.imul(x,Z)|0,o=Math.imul(x,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,V)|0,r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0;var ve=(u+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(E,Z),i=(i=Math.imul(E,H))+Math.imul(_,Z)|0,o=Math.imul(_,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,$)|0,r=r+Math.imul(h,Y)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,X)|0;var we=(u+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,H))+Math.imul(S,Z)|0,o=Math.imul(S,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,$)|0,r=r+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,X)|0,r=r+Math.imul(h,Q)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var xe=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(I,Z),i=(i=Math.imul(I,H))+Math.imul(O,Z)|0,o=Math.imul(O,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,X)|0,r=r+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(u+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,H))+Math.imul(P,Z)|0,o=Math.imul(P,H),r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Ee=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,H))+Math.imul(N,Z)|0,o=Math.imul(N,H),r=r+Math.imul(D,G)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,r=r+Math.imul(h,ce)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var _e=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,H))+Math.imul(j,Z)|0,o=Math.imul(j,H),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(D,q)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,r=r+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var ke=(u+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,he)|0))<<13)|0;u=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(j,G)|0,o=Math.imul(j,V),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,r=r+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var Te=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,$))+Math.imul(j,q)|0,o=Math.imul(j,$),r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Se=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,Y),i=(i=Math.imul(L,X))+Math.imul(j,Y)|0,o=Math.imul(j,X),r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(D,ne)|0,i=(i=i+Math.imul(D,re)|0)+Math.imul(P,ne)|0,o=o+Math.imul(P,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var Ce=(u+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,r=r+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ie=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(_,he)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(j,ne)|0,o=Math.imul(j,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,r=r+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,fe)|0;var Oe=(u+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,oe),i=(i=Math.imul(L,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,r=r+Math.imul(D,de)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Re=(u+(r=r+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(O,he)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,ce),i=(i=Math.imul(L,ue))+Math.imul(j,ce)|0,o=Math.imul(j,ue),r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var De=(u+(r=r+Math.imul(D,he)|0)|0)+((8191&(i=(i=i+Math.imul(D,me)|0)+Math.imul(P,he)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,fe))+Math.imul(j,de)|0,o=Math.imul(j,fe);var Pe=(u+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(N,he)|0))<<13)|0;u=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Be=(u+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(j,he)|0))<<13)|0;return u=((o=Math.imul(j,me))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ae,c[7]=Ee,c[8]=_e,c[9]=ke,c[10]=Te,c[11]=Se,c[12]=Ce,c[13]=Ie,c[14]=Oe,c[15]=Re,c[16]=De,c[17]=Pe,c[18]=Be,0!==u&&(c[19]=u,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function b(e,t,n){return y(e,t,n)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=m),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?m(this,e,t):n<1024?y(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},v.prototype.permute=function(e,t,n,r,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,s=0|i.words[i.length-1];0!==(n=26-this._countBits(s))&&(i=i.ushln(n),r.iushln(n),s=0|i.words[i.length-1]);var a,c=r.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);a&&(a.words[d]=f)}return a&&a._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new T(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(A,x),A.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return w[e]=t,t},T.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=s;0!==p.cmp(a);){for(var m=p,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===r&&0===l)&&(i=this.mul(i,n[s]),a=0,s=0)):a=0}c=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,T),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},77191:function(e,t,n){var r=n(58162);e.exports=r("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},48764:function(e,t,n){"use strict";var r=n(79742),i=n(80645),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50;var s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|m(e,t),r=a(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);var i=function(e){if(c.isBuffer(e)){var t=0|h(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||H(e.length)?a(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),a(e<0?0:0|h(e))}function f(e){for(var t=e.length<0?0:0|h(e.length),n=a(t),r=0;r=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(i)return r?-1:L(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),H(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;oa&&(n=a-c),o=n;o>=0;o--){for(var d=!0,f=0;fi&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+d<=n)switch(d){case 1:u<128&&(l=u);break;case 2:128===(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],s=e[i+2],128===(192&o)&&128===(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128===(192&o)&&128===(192&s)&&128===(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?c.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else{if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i)}i+=o.length}return r},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),l=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return A(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return t=+t,n>>>=0,o||B(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,o){return t=+t,n>>>=0,o||B(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function U(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!==e}var z=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},86010:function(e,t,n){"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t=t?e:""+Array(t+1-r.length).join(n)+e},b={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function e(t,n){if(t.date()1)return e(s[0])}else{var a=t.name;w[a]=t,i=a}return!r&&i&&(v=i),i||!r&&v},E=function(e,t){if(x(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new k(n)},_=b;_.l=A,_.i=x,_.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function g(e){this.$L=A(e.locale,null,!0),this.parse(e)}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(_.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return _},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(e,t){var n=E(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return E(e)>19^e^e>>8,(o[3]>>>0)/(1<<31>>>0)}function a(){return[Math.floor(360*s())/360,(60*s()+40)/100,25*(s()+s()+s()+s())/100]}function c(e,t,n,r,i,o){for(let s=0;s>24&255,e>>16&255,e>>8&255,255&e)}function o(e){return String.fromCharCode(255&e,e>>8&255)}this.width=e,this.height=t,this.depth=n,this.pix_size=t*(e+1),this.data_size=2+this.pix_size+5*Math.floor((65534+this.pix_size)/65535)+4,this.ihdr_offs=0,this.ihdr_size=25,this.plte_offs=this.ihdr_offs+this.ihdr_size,this.plte_size=8+3*n+4,this.trns_offs=this.plte_offs+this.plte_size,this.trns_size=8+n+4,this.idat_offs=this.trns_offs+this.trns_size,this.idat_size=8+this.data_size+4,this.iend_offs=this.idat_offs+this.idat_size,this.iend_size=12,this.buffer_size=this.iend_offs+this.iend_size,this.buffer=new Array,this.palette=new Object,this.pindex=0;for(var s=new Array,a=0;a>8&255,255&c))),a=0;(a<<16)-1>1&2147483647:f>>1&2147483647;s[a]=f}this.index=function(e,t){var n=t*(this.width+1)+e+1;return this.idat_offs+8+2+5*Math.floor(n/65535+1)+n},this.color=function(e,t,n,r){var i=(((r=r>=0?r:255)<<8|e)<<8|t)<<8|n;if("undefined"==typeof this.palette[i]){if(this.pindex==this.depth)return"\0";var o=this.plte_offs+8+3*this.pindex;this.buffer[o+0]=String.fromCharCode(e),this.buffer[o+1]=String.fromCharCode(t),this.buffer[o+2]=String.fromCharCode(n),this.buffer[this.trns_offs+8+this.pindex]=String.fromCharCode(r),this.palette[i]=String.fromCharCode(this.pindex++)}return this.palette[i]},this.getBase64=function(){var e,t,n,r,i,o,s,a=this.getDump(),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=a.length,l=0,d="";do{r=(e=a.charCodeAt(l))>>2,i=(3&e)<<4|(t=a.charCodeAt(l+1))>>4,n=a.charCodeAt(l+2),o=u>6,s=u>8&16777215;r(e,t+n-4,i(-1^o))}return t%=e,n%=e,r(this.buffer,this.idat_offs+this.idat_size-8,i(n<<16|t)),u(this.buffer,this.ihdr_offs,this.ihdr_size),u(this.buffer,this.plte_offs,this.plte_size),u(this.buffer,this.trns_offs,this.trns_size),u(this.buffer,this.idat_offs,this.idat_size),u(this.buffer,this.iend_offs,this.iend_size),"\x89PNG\r\n\x1a\n"+this.buffer.join("")}}},function(e,t){function n(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}e.exports=function(e,t,r){let i,o,s;if(0==t)i=o=s=r;else{const a=r<.5?r*(1+t):r+t-r*t,c=2*r-a;i=n(c,a,e+1/3),o=n(c,a,e),s=n(c,a,e-1/3)}return[Math.round(255*i),Math.round(255*o),Math.round(255*s),255]}}])},e.exports=t()},14694:function(e,t,n){"use strict";n.r(t),n.d(t,{BaseX:function(){return o},Base32:function(){return s},Base58:function(){return a}});var r=n(93667),i=n(97208);class o{constructor(e){(0,i.defineReadOnly)(this,"alphabet",e),(0,i.defineReadOnly)(this,"base",e.length),(0,i.defineReadOnly)(this,"_alphabetMap",{}),(0,i.defineReadOnly)(this,"_leader",e.charAt(0));for(let t=0;t0;)n.push(e%this.base),e=e/this.base|0}let i="";for(let r=0;0===t[r]&&r=0;--r)i+=this.alphabet[n[r]];return i}decode(e){if("string"!==typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let n=0;n>=8;for(;i>0;)t.push(255&i),i>>=8}for(let n=0;e[n]===this._leader&&n0&&Array.isArray(e)?i(e,t-1):n.push(e)}))};return i(e,t),n}function u(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),i=1,o=[0,1];for(let w=1;w>--c&1}const d=Math.pow(2,31),f=d>>>1,p=f>>1,h=d-1;let m=0;for(let w=0;w<31;w++)m=m<<1|l();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*i-1)/b),t=0,n=r;for(;n-t>1;){let r=t+n>>>1;e>>1|l(),s=s<<1^f,a=(a^f)<<1|f|1;y=s,b=1+a-s}let v=r-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return v+256+(e[a++]<<8|e[a++]);case 1:return v+e[a++];default:return t-1}}))}(e))}function l(e){return 1&e?~e>>1:e>>1}function d(e,t){let n=Array(e);for(let r=0,i=-1;rt[e])):n}function h(e,t,n){let r=Array(e).fill(void 0).map((()=>[]));for(let i=0;ir[t].push(e)));return r}function m(e,t){let n=1+t(),r=t(),i=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(n)}return t}(t);return c(h(i.length,1+e,t).map(((e,t)=>{const o=e[0],s=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*r;return[o+t*n,s.map((e=>e+i))]}))})))}function g(e,t){return h(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const y=u((0,n(59567).J)("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),b=new Set(p(y)),v=new Set(p(y)),w=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(m(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(g(n,e))}return function(e){const t={};for(let n=0;ne-t));return function n(){let r=[];for(;;){let i=p(e,t);if(0==i.length)break;r.push({set:new Set(i),node:n()})}r.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let s=!!(1&i);return i>>=1,{branches:r,valid:o,fe0f:s,save:1==i,check:2==i}}()}(y);function A(e){return(0,i.XL)(e)}function E(e){return e.filter((e=>65039!=e))}function _(e){for(let n of e.split(".")){let e=A(n);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&45===e[2]&&45===e[3])throw new Error("invalid label extension")}catch(t){throw new Error(`Invalid label "${n}": ${t.message}`)}}return e}function k(e){return _(function(e,t){let n=A(e).reverse(),r=[];for(;n.length;){let e=T(n);if(e){r.push(...t(e));continue}let i=n.pop();if(b.has(i)){r.push(i);continue}if(v.has(i))continue;let o=w[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);r.push(...o)}return _((i=String.fromCodePoint(...r),i.normalize("NFC")));var i}(e,E))}function T(e,t){var n;let r,i,o=x,s=[],a=e.length;for(t&&(t.length=0);a;){let c=e[--a];if(o=null===(n=o.branches.find((e=>e.set.has(c))))||void 0===n?void 0:n.node,!o)break;if(o.save)i=c;else if(o.check&&c===i)break;s.push(c),o.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),o.valid&&(r=s.slice(),2==o.valid&&r.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return r}const S=new s.Logger(a.i),C=new Uint8Array(32);function I(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function O(e){const t=(0,i.Y0)(k(e)),n=[];if(0===e.length)return n;let r=0;for(let i=0;i=t.length)throw new Error("invalid ENS name; empty component");return n.push(I(t.slice(r))),n}function R(e){return O(e).map((e=>(0,i.ZN)(e))).join(".")}function D(e){try{return 0!==O(e).length}catch(t){}return!1}function P(e){"string"!==typeof e&&S.throwArgumentError("invalid ENS name; not a string","name",e);let t=C;const n=O(e);for(;n.length;)t=(0,o.keccak256)((0,r.concat)([t,(0,o.keccak256)(n.pop())]));return(0,r.hexlify)(t)}function B(e){return(0,r.hexlify)((0,r.concat)(O(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}C.fill(0)},27771:function(e,t,n){"use strict";n.d(t,{E:function(){return T}});var r=n(66379),i=n(2593),o=n(93667),s=n(88017),a=n(97208),c=n(168),u=n(53736),l=n(83859),d=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const f=new c.Logger(u.i),p=new Uint8Array(32);p.fill(0);const h=i.O$.from(-1),m=i.O$.from(0),g=i.O$.from(1),y=i.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const b=(0,o.hexZeroPad)(g.toHexString(),32),v=(0,o.hexZeroPad)(m.toHexString(),32),w={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},x=["name","version","chainId","verifyingContract","salt"];function A(e){return function(t){return"string"!==typeof t&&f.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const E={name:A("name"),version:A("version"),chainId:function(e){try{return i.O$.from(e).toString()}catch(t){}return f.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,r.getAddress)(e).toLowerCase()}catch(t){}return f.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=(0,o.arrayify)(e);if(32!==t.length)throw new Error("bad length");return(0,o.hexlify)(t)}catch(t){}return f.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function _(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const n=""===t[1],r=parseInt(t[2]||"256");(r%8!==0||r>256||t[2]&&t[2]!==String(r))&&f.throwArgumentError("invalid numeric width","type",e);const s=y.mask(n?r-1:r),a=n?s.add(g).mul(h):m;return function(t){const n=i.O$.from(t);return(n.lt(a)||n.gt(s))&&f.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),(0,o.hexZeroPad)(n.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return(0===n||n>32||t[1]!==String(n))&&f.throwArgumentError("invalid bytes width","type",e),function(t){return(0,o.arrayify)(t).length!==n&&f.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=(0,o.arrayify)(e),n=t.length%32;return n?(0,o.hexConcat)([t,p.slice(n)]):(0,o.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,o.hexZeroPad)((0,r.getAddress)(e),32)};case"bool":return function(e){return e?b:v};case"bytes":return function(e){return(0,s.keccak256)(e)};case"string":return function(e){return(0,l.id)(e)}}return null}function k(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class T{constructor(e){(0,a.defineReadOnly)(this,"types",Object.freeze((0,a.deepCopy)(e))),(0,a.defineReadOnly)(this,"_encoderCache",{}),(0,a.defineReadOnly)(this,"_types",{});const t={},n={},r={};Object.keys(e).forEach((e=>{t[e]={},n[e]=[],r[e]={}}));for(const o in e){const r={};e[o].forEach((i=>{r[i.name]&&f.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(o)}`,"types",e),r[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===o&&f.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e);_(s)||(n[s]||f.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),n[s].push(o),t[o][s]=!0)}))}const i=Object.keys(n).filter((e=>0===n[e].length));0===i.length?f.throwArgumentError("missing primary type","types",e):i.length>1&&f.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,a.defineReadOnly)(this,"primaryType",i[0]),function i(o,s){s[o]&&f.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),s[o]=!0,Object.keys(t[o]).forEach((e=>{n[e]&&(i(e,s),Object.keys(s).forEach((t=>{r[t][e]=!0})))})),delete s[o]}(this.primaryType,{});for(const o in r){const t=Object.keys(r[o]);t.sort(),this._types[o]=k(o,e[o])+t.map((t=>k(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=_(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],n=this.getEncoder(e),r=parseInt(t[3]);return t=>{r>=0&&t.length!==r&&f.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(n);return this._types[e]&&(i=i.map(s.keccak256)),(0,s.keccak256)((0,o.hexConcat)(i))}}const n=this.types[e];if(n){const t=(0,l.id)(this._types[e]);return e=>{const r=n.map((({name:t,type:n})=>{const r=this.getEncoder(n)(e[t]);return this._types[n]?(0,s.keccak256)(r):r}));return r.unshift(t),(0,o.hexConcat)(r)}}return f.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||f.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,s.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(_(e))return n(e,t);const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const e=r[1],i=parseInt(r[3]);return i>=0&&t.length!==i&&f.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,n)))}const i=this.types[e];return i?i.reduce(((e,{name:r,type:i})=>(e[r]=this._visit(i,t[r],n),e)),{}):f.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new T(e)}static getPrimaryType(e){return T.from(e).primaryType}static hashStruct(e,t,n){return T.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){const r=w[n];r||f.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:r})}return t.sort(((e,t)=>x.indexOf(e.name)-x.indexOf(t.name))),T.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return(0,o.hexConcat)(["0x1901",T.hashDomain(e),T.from(t).hash(n)])}static hash(e,t,n){return(0,s.keccak256)(T.encode(e,t,n))}static resolveNames(e,t,n,r){return d(this,void 0,void 0,(function*(){e=(0,a.shallowCopy)(e);const i={};e.verifyingContract&&!(0,o.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const s=T.from(t);s.visit(n,((e,t)=>("address"!==e||(0,o.isHexString)(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield r(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=s.visit(n,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:n}}))}static getPayload(e,t,n){T.hashDomain(e);const r={},s=[];x.forEach((t=>{const n=e[t];null!=n&&(r[t]=E[t](n),s.push({name:t,type:w[t]}))}));const c=T.from(t),u=(0,a.shallowCopy)(t);return u.EIP712Domain?f.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):u.EIP712Domain=s,c.encode(n),{types:u,domain:r,primaryType:c.primaryType,message:c.visit(n,((e,t)=>{if(e.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.arrayify)(t));if(e.match(/^u?int/))return i.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&f.throwArgumentError("invalid string","value",t),t}return f.throwArgumentError("unsupported type","type",e)}))}}}},4682:function(e,t,n){"use strict";n.r(t),n.d(t,{HDNode:function(){return R},defaultPath:function(){return O},entropyToMnemonic:function(){return B},getAccountPath:function(){return N},isValidMnemonic:function(){return M},mnemonicToEntropy:function(){return P},mnemonicToSeed:function(){return D}});var r=n(14694),i=n(93667),o=n(2593),s=n(84804),a=n(76447),c=n(97208),u=n(70184),l=n(19763),d=n(6648),f=n(60561),p=n(83859),h=n(168);const m=new h.Logger("wordlists/5.7.0");class g{constructor(e){m.checkAbstract(new.target,g),(0,c.defineReadOnly)(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let n=0;n<2048;n++){const r=e.getWord(n);if(n!==e.getWordIndex(r))return"0x";t.push(r)}return(0,p.id)(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let y=null;function b(e){if(null==y&&(y="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==g.check(e)))throw y=null,new Error("BIP39 Wordlist for en (English) FAILED")}const v=new class extends g{constructor(){super("en")}getWord(e){return b(this),y[e]}getWordIndex(e){return b(this),y.indexOf(e)}};g.register(v);const w={en:v},x=new h.Logger("hdnode/5.7.0"),A=o.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),E=(0,s.Y0)("Bitcoin seed"),_=2147483648;function k(e){return(1<=256)throw new Error("Depth too large!");return S((0,i.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,i.hexlify)(this.depth),this.parentFingerprint,(0,i.hexZeroPad)((0,i.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,i.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new R(I,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const n=new Uint8Array(37);if(e&_){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set((0,i.arrayify)(this.privateKey),1),t&&(t+="'")}else n.set((0,i.arrayify)(this.publicKey));for(let i=24;i>=0;i-=8)n[33+(i>>3)]=e>>24-i&255;const r=(0,i.arrayify)((0,l.Gy)(d.p.sha512,this.chainCode,n)),s=r.slice(0,32),a=r.slice(32);let c=null,f=null;if(this.privateKey)c=T(o.O$.from(s).add(this.privateKey).mod(A));else{f=new u.SigningKey((0,i.hexlify)(s))._addPoint(this.publicKey)}let p=t;const h=this.mnemonic;return h&&(p=Object.freeze({phrase:h.phrase,path:t,locale:h.locale||"en"})),new R(I,c,f,this.fingerprint,T(a),e,this.depth+1,p)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let n=this;for(let r=0;r=_)throw new Error("invalid path index - "+e);n=n._derive(_+t)}else{if(!e.match(/^[0-9]+$/))throw new Error("invalid path component - "+e);{const t=parseInt(e);if(t>=_)throw new Error("invalid path index - "+e);n=n._derive(t)}}}return n}static _fromSeed(e,t){const n=(0,i.arrayify)(e);if(n.length<16||n.length>64)throw new Error("invalid seed");const r=(0,i.arrayify)((0,l.Gy)(d.p.sha512,E,n));return new R(I,T(r.slice(0,32)),null,"0x00000000",T(r.slice(32)),0,0,t)}static fromMnemonic(e,t,n){return e=B(P(e,n=C(n)),n),R._fromSeed(D(e,t),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return R._fromSeed(e,null)}static fromExtendedKey(e){const t=r.Base58.decode(e);82===t.length&&S(t.slice(0,78))===e||x.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=t[4],o=(0,i.hexlify)(t.slice(5,9)),s=parseInt((0,i.hexlify)(t.slice(9,13)).substring(2),16),a=(0,i.hexlify)(t.slice(13,45)),c=t.slice(45,78);switch((0,i.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new R(I,null,(0,i.hexlify)(c),o,a,s,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new R(I,(0,i.hexlify)(c.slice(1)),null,o,a,s,n,null)}return x.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function D(e,t){t||(t="");const n=(0,s.Y0)("mnemonic"+t,s.Uj.NFKD);return(0,a.n)((0,s.Y0)(e,s.Uj.NFKD),n,2048,64,"sha512")}function P(e,t){t=C(t),x.checkNormalize();const n=t.split(e);if(n.length%3!==0)throw new Error("invalid mnemonic");const r=(0,i.arrayify)(new Uint8Array(Math.ceil(11*n.length/8)));let o=0;for(let i=0;i>3]|=1<<7-o%8),o++}const s=32*n.length/3,a=k(n.length/3);if(((0,i.arrayify)((0,l.JQ)(r.slice(0,s/8)))[0]&a)!==(r[r.length-1]&a))throw new Error("invalid checksum");return(0,i.hexlify)(r.slice(0,s/8))}function B(e,t){if(t=C(t),(e=(0,i.arrayify)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");const n=[0];let r=11;for(let i=0;i8?(n[n.length-1]<<=8,n[n.length-1]|=e[i],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[i]>>8-r,n.push(e[i]&(1<<8-r)-1),r+=3);const o=e.length/4,s=(0,i.arrayify)((0,l.JQ)(e))[0]&k(o);return n[n.length-1]<<=o,n[n.length-1]|=s>>8-o,t.join(n.map((e=>t.getWord(e))))}function M(e,t){try{return P(e,t),!0}catch(n){}return!1}function N(e){return("number"!==typeof e||e<0||e>=_||e%1)&&x.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}},72294:function(e,t,n){"use strict";n.r(t),n.d(t,{decryptCrowdsale:function(){return w},decryptJsonWallet:function(){return U},decryptJsonWalletSync:function(){return Z},decryptKeystore:function(){return L},decryptKeystoreSync:function(){return F},encryptKeystore:function(){return j},getJsonWalletAddress:function(){return E},isCrowdsaleWallet:function(){return x},isKeystoreWallet:function(){return A}});var r=n(78826),i=n.n(r),o=n(66379),s=n(93667),a=n(88017),c=n(76447),u=n(84804),l=n(97208),d=n(168);const f="json-wallets/5.7.0";function p(e){return"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,s.arrayify)(e)}function h(e,t){for(e=String(e);e.length{const n=(t=(0,s.arrayify)(t)).slice(0,16),r=t.slice(16,32),o=t.slice(32,64),u=new(i().Counter)(b),m=new(i().ModeOfOperation.ctr)(n,u),E=(0,s.arrayify)(m.encrypt(c)),_=(0,a.keccak256)((0,s.concat)([r,E])),k={address:e.address.substring(2).toLowerCase(),id:y(v),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,s.hexlify)(b).substring(2)},ciphertext:(0,s.hexlify)(E).substring(2),kdf:"scrypt",kdfparams:{salt:(0,s.hexlify)(g).substring(2),n:w,dklen:32,p:A,r:x},mac:_.substring(2)}};if(l){const e=(0,S.O)(16),t=new(i().Counter)(e),n=new(i().ModeOfOperation.ctr)(o,t),r=(0,s.arrayify)(n.encrypt(l)),a=new Date,c=a.getUTCFullYear()+"-"+h(a.getUTCMonth()+1,2)+"-"+h(a.getUTCDate(),2)+"T"+h(a.getUTCHours(),2)+"-"+h(a.getUTCMinutes(),2)+"-"+h(a.getUTCSeconds(),2)+".0Z";k["x-ethers"]={client:p,gethFilename:"UTC--"+c+"--"+k.address,mnemonicCounter:(0,s.hexlify)(e).substring(2),mnemonicCiphertext:(0,s.hexlify)(r).substring(2),path:d,locale:f,version:"0.1"}}return JSON.stringify(k)}))}function U(e,t,n){if(x(e)){n&&n(0);const r=w(e,t);return n&&n(1),Promise.resolve(r)}return A(e)?L(e,t,n):Promise.reject(new Error("invalid JSON wallet"))}function Z(e,t){if(x(e))return w(e,t);if(A(e))return F(e,t);throw new Error("invalid JSON wallet")}},88017:function(e,t,n){"use strict";n.r(t),n.d(t,{keccak256:function(){return s}});var r=n(91094),i=n.n(r),o=n(93667);function s(e){return"0x"+i().keccak_256((0,o.arrayify)(e))}},168:function(e,t,n){"use strict";n.r(t),n.d(t,{ErrorCode:function(){return l},LogLevel:function(){return u},Logger:function(){return f}});let r=!1,i=!1;const o={debug:1,default:2,info:2,warning:3,error:4,off:5};let s=o.default,a=null;const c=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var u,l;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(u||(u={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(l||(l={}));const d="0123456789abcdef";class f{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==o[n]&&this.throwArgumentError("invalid log level name","logLevel",e),s>o[n]||console.log.apply(console,t)}debug(...e){this._log(f.levels.DEBUG,e)}info(...e){this._log(f.levels.INFO,e)}warn(...e){this._log(f.levels.WARNING,e)}makeError(e,t,n){if(i)return this.makeError("censored error",t,{});t||(t=f.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e>4],n+=d[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(a){r.push(e+"="+JSON.stringify(n[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const o=e;let s="";switch(t){case l.NUMERIC_FAULT:{s="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case l.CALL_EXCEPTION:case l.INSUFFICIENT_FUNDS:case l.MISSING_NEW:case l.NONCE_EXPIRED:case l.REPLACEMENT_UNDERPRICED:case l.TRANSACTION_REPLACED:case l.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const a=new Error(e);return a.reason=o,a.code=t,Object.keys(n).forEach((function(e){a[e]=n[e]})),a}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,f.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),c&&this.throwError("platform missing String.prototype.normalize",f.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:c})}checkSafeUint53(e,t){"number"===typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",et&&this.throwError("too many arguments"+n,f.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",f.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",f.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",f.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return a||(a=new f("logger/5.7.0")),a}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),r){if(!e)return;this.globalLogger().throwError("error censorship permanent",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!e,r=!!t}static setLogLevel(e){const t=o[e.toLowerCase()];null!=t?s=t:f.globalLogger().warn("invalid log level - "+e)}static from(e){return new f(e)}}f.errors=l,f.levels=u},76447:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(93667),i=n(19763);function o(e,t,n,o,s){let a;e=(0,r.arrayify)(e),t=(0,r.arrayify)(t);let c=1;const u=new Uint8Array(o),l=new Uint8Array(t.length+4);let d,f;l.set(t);for(let p=1;p<=c;p++){l[t.length]=p>>24&255,l[t.length+1]=p>>16&255,l[t.length+2]=p>>8&255,l[t.length+3]=255&p;let h=(0,r.arrayify)((0,i.Gy)(s,e,l));a||(a=h.length,f=new Uint8Array(a),c=Math.ceil(o/a),d=o-(c-1)*a),f.set(h);for(let t=1;t{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function u(e,t){e&&"object"===typeof e||o.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((n=>{t[n]||o.throwArgumentError("invalid object key - "+n,"transaction:"+n,e)}))}function l(e){const t={};for(const n in e)t[n]=e[n];return t}const d={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function f(e){if(void 0===e||null===e||d[typeof e])return!0;if(Array.isArray(e)||"object"===typeof e){if(!Object.isFrozen(e))return!1;const n=Object.keys(e);for(let r=0;rh(e))));if("object"===typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&s(t,n,h(r))}return t}return o.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function h(e){return p(e)}class m{constructor(e){for(const t in e)this[t]=h(e[t])}}},52989:function(e,t,n){"use strict";n.r(t),n.d(t,{randomBytes:function(){return r.O},shuffled:function(){return i.y}});var r=n(66207),i=n(34952)},66207:function(e,t,n){"use strict";n.d(t,{O:function(){return c}});var r=n(93667),i=n(168);const o=new i.Logger("random/5.7.0");const s=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof n.g)return n.g;throw new Error("unable to locate global object")}();let a=s.crypto||s.msCrypto;function c(e){(e<=0||e>1024||e%1||e!=e)&&o.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return a.getRandomValues(t),(0,r.arrayify)(t)}a&&a.getRandomValues||(o.warn("WARNING: Missing strong random number source"),a={getRandomValues:function(e){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},34952:function(e,t,n){"use strict";function r(e){for(let t=(e=e.slice()).length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}n.d(t,{y:function(){return r}})},66906:function(e,t,n){"use strict";n.r(t),n.d(t,{decode:function(){return f},encode:function(){return u}});var r=n(93667),i=n(168);const o=new i.Logger("rlp/5.7.0");function s(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function a(e,t,n){let r=0;for(let i=0;it+1+r&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:s}}function d(e,t){if(0===e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){const n=e[t]-247;t+1+n>e.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});const r=a(e,t+1,n);return t+1+n+r>e.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1+n,n+r)}if(e[t]>=192){const n=e[t]-192;return t+1+n>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1,n)}if(e[t]>=184){const n=e[t]-183;t+1+n>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});const s=a(e,t+1,n);t+1+n+s>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+n+s,result:(0,r.hexlify)(e.slice(t+1+n,t+1+n+s))}}if(e[t]>=128){const n=e[t]-128;t+1+n>e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:(0,r.hexlify)(e.slice(t+1,t+1+n))}}return{consumed:1,result:(0,r.hexlify)(e[t])}}function f(e){const t=(0,r.arrayify)(e),n=d(t,0);return n.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),n.result}},8894:function(e,t,n){"use strict";n.r(t),n.d(t,{computeHmac:function(){return r.Gy},ripemd160:function(){return r.bP},sha256:function(){return r.JQ},sha512:function(){return r.o},SupportedAlgorithm:function(){return i.p}});var r=n(19763),i=n(6648)},19763:function(e,t,n){"use strict";n.d(t,{Gy:function(){return f},bP:function(){return u},JQ:function(){return l},o:function(){return d}});var r=n(33715),i=n.n(r),o=n(93667),s=n(6648),a=n(168);const c=new a.Logger("sha2/5.7.0");function u(e){return"0x"+i().ripemd160().update((0,o.arrayify)(e)).digest("hex")}function l(e){return"0x"+i().sha256().update((0,o.arrayify)(e)).digest("hex")}function d(e){return"0x"+i().sha512().update((0,o.arrayify)(e)).digest("hex")}function f(e,t,n){return s.p[e]||c.throwError("unsupported algorithm "+e,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+i().hmac(i()[e],(0,o.arrayify)(t)).update((0,o.arrayify)(n)).digest("hex")}},6648:function(e,t,n){"use strict";var r;n.d(t,{p:function(){return r}}),function(e){e.sha256="sha256",e.sha512="sha512"}(r||(r={}))},70184:function(e,t,n){"use strict";n.r(t),n.d(t,{SigningKey:function(){return $},computePublicKey:function(){return Y},recoverPublicKey:function(){return K}});var r=n(41257),i=n.n(r),o=n(33715),s=n.n(o);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self&&self;function a(e,t,n){return n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&n.path)}},e(n,n.exports),n.exports}var c=u;function u(e,t){if(!e)throw new Error(t||"Assertion failed")}u.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var l=a((function(e,t){var n=t;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",n=0;n>8,s=255&i;o?n.push(o,s):n.push(s)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}})),d=a((function(e,t){var n=t;n.assert=c,n.toArray=l.toArray,n.zero2=l.zero2,n.toHex=l.toHex,n.encode=l.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,r[s]=a,o.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0===(1&c)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==u?c:-c,n[0].push(s),a=0===(1&u)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==c?u:-u,n[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new(i())(e,"hex","le")}})),f=d.getNAF,p=d.getJSF,h=d.assert;function m(e,t){this.type=e,this.p=new(i())(t.p,16),this.red=t.prime?i().red(t.prime):i().mont(this.p),this.zero=new(i())(0).toRed(this.red),this.one=new(i())(1).toRed(this.red),this.two=new(i())(2).toRed(this.red),this.n=t.n&&new(i())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var g=m;function y(e,t){this.curve=e,this.type=t,this.precomputed=null}m.prototype.point=function(){throw new Error("Not implemented")},m.prototype.validate=function(){throw new Error("Not implemented")},m.prototype._fixedNafMul=function(e,t){h(e.precomputed);var n=e._getDoubles(),r=f(t,1,this._bitLength),i=(1<=o;c--)s=(s<<1)+r[c];a.push(s)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;a--){for(var c=0;a>=0&&0===o[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var u=o[a];h(0!==u),s="affine"===e.type?u>0?s.mixedAdd(i[u-1>>1]):s.mixedAdd(i[-u-1>>1].neg()):u>0?s.add(i[u-1>>1]):s.add(i[-u-1>>1].neg())}return"affine"===e.type?s.toP():s},m.prototype._wnafMulAdd=function(e,t,n,r,i){var o,s,a,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,d=0;for(o=0;o=1;o-=2){var m=o-1,g=o;if(1===c[m]&&1===c[g]){var y=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(y[1]=t[m].add(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].add(t[g].neg())):(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=p(n[m],n[g]);for(d=Math.max(v[0].length,d),l[m]=new Array(d),l[g]=new Array(d),s=0;s=0;o--){for(var _=0;o>=0;){var k=!0;for(s=0;s=0&&_++,A=A.dblp(_),o<0)break;for(s=0;s0?a=u[s][T-1>>1]:T<0&&(a=u[s][-T-1>>1].neg()),A="affine"===a.type?A.mixedAdd(a):A.add(a))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},y.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i=0&&(s=t,a=n),r.negative&&(r=r.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:r,b:o},{a:s,b:a}]},w.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),s=i.mul(n.a),a=o.mul(r.a),c=i.mul(n.b),u=o.mul(r.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},w.prototype.pointFromX=function(e,t){(e=new(i())(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var o=r.fromRed().isOdd();return(t&&!o||!t&&o)&&(r=r.redNeg()),this.point(e,r)},w.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},w.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},A.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(e){return e=new(i())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},A.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},A.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},A.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},A.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},b(E,g.BasePoint),w.prototype.jpoint=function(e,t,n){return new E(this,e,t,n)},E.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},E.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},E.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(n.redMul(this.z)),a=r.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=r.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),p=c.redMul(d.redISub(f)).redISub(o.redMul(l)),h=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,p,h)},E.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=n.redSub(r),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=n.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),f=a.redMul(l.redISub(d)).redISub(i.redMul(u)),p=this.z.redMul(s);return this.curve.jpoint(d,f,p)},E.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},E.prototype.inspect=function(){return this.isInfinity()?"":""},E.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var _=a((function(e,t){var n=t;n.base=g,n.short=x,n.mont=null,n.edwards=null})),k=a((function(e,t){var n,r=t,i=d.assert;function o(e){"short"===e.type?this.curve=new _.short(e):"edwards"===e.type?this.curve=new _.edwards(e):this.curve=new _.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new o(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(c){n=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function T(e){if(!(this instanceof T))return new T(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=l.toArray(e.entropy,e.entropyEnc||"hex"),n=l.toArray(e.nonce,e.nonceEnc||"hex"),r=l.toArray(e.pers,e.persEnc||"hex");c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var S=T;T.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},T.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=n,n=t,t=null),n&&(n=l.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"};var R=d.assert;function D(e,t){if(e instanceof D)return e;this._importDER(e,t)||(R(e.r&&e.s,"Signature without r or s"),this.r=new(i())(e.r,16),this.s=new(i())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var P=D;function B(){this.place=0}function M(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,s=t.place;o>>=0;return!(i<=127)&&(t.place=s,i)}function N(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}D.prototype._importDER=function(e,t){e=d.toArray(e,t);var n=new B;if(48!==e[n.place++])return!1;var r=M(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var o=M(e,n);if(!1===o)return!1;var s=e.slice(n.place,o+n.place);if(n.place+=o,2!==e[n.place++])return!1;var a=M(e,n);if(!1===a)return!1;if(e.length!==a+n.place)return!1;var c=e.slice(n.place,a+n.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new(i())(s),this.s=new(i())(c),this.recoveryParam=null,!0},D.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=N(t),n=N(n);!n[0]&&!(128&n[1]);)n=n.slice(1);var r=[2];F(r,t.length),(r=r.concat(t)).push(2),F(r,n.length);var i=r.concat(n),o=[48];return F(o,i.length),o=o.concat(i),d.encode(o,e)};var L=function(){throw new Error("unsupported")},j=d.assert;function U(e){if(!(this instanceof U))return new U(e);"string"===typeof e&&(j(Object.prototype.hasOwnProperty.call(k,e),"Unknown curve "+e),e=k[e]),e instanceof k.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Z=U;U.prototype.keyPair=function(e){return new O(this,e)},U.prototype.keyFromPrivate=function(e,t){return O.fromPrivate(this,e,t)},U.prototype.keyFromPublic=function(e,t){return O.fromPublic(this,e,t)},U.prototype.genKeyPair=function(e){e||(e={});for(var t=new S({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||L(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new(i())(2));;){var o=new(i())(t.generate(n));if(!(o.cmp(r)>0))return o.iaddn(1),this.keyFromPrivate(o)}},U.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},U.prototype.sign=function(e,t,n,r){"object"===typeof n&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new(i())(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),a=e.toArray("be",o),c=new S({hash:this.hash,entropy:s,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new(i())(1)),l=0;;l++){var d=r.k?r.k(l):new(i())(c.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(u)>=0)){var f=this.g.mul(d);if(!f.isInfinity()){var p=f.getX(),h=p.umod(this.n);if(0!==h.cmpn(0)){var m=d.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var g=(f.getY().isOdd()?1:0)|(0!==p.cmp(h)?2:0);return r.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new P({r:h,s:m,recoveryParam:g})}}}}}},U.prototype.verify=function(e,t,n,r){e=this._truncateToN(new(i())(e,16)),n=this.keyFromPublic(n,r);var o=(t=new P(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(e).umod(this.n),l=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,n.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},U.prototype.recoverPubKey=function(e,t,n,r){j((3&n)===n,"The recovery param is more than two bits"),t=new P(t,r);var o=this.n,s=new(i())(e),a=t.r,c=t.s,u=1&n,l=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var d=t.r.invm(o),f=o.sub(s).mul(d).umod(o),p=c.mul(d).umod(o);return this.g.mulAdd(f,a,p)},U.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new P(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var H=a((function(e,t){var n=t;n.version="6.5.4",n.utils=d,n.rand=function(){throw new Error("unsupported")},n.curve=_,n.curves=k,n.ec=Z,n.eddsa=null})).ec,z=n(93667),G=n(97208);const V=new(n(168).Logger)("signing-key/5.7.0");let W=null;function q(){return W||(W=new H("secp256k1")),W}class ${constructor(e){(0,G.defineReadOnly)(this,"curve","secp256k1"),(0,G.defineReadOnly)(this,"privateKey",(0,z.hexlify)(e)),32!==(0,z.hexDataLength)(this.privateKey)&&V.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=q().keyFromPrivate((0,z.arrayify)(this.privateKey));(0,G.defineReadOnly)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,G.defineReadOnly)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,G.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(e){const t=q().keyFromPublic((0,z.arrayify)(this.publicKey)),n=q().keyFromPublic((0,z.arrayify)(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const t=q().keyFromPrivate((0,z.arrayify)(this.privateKey)),n=(0,z.arrayify)(e);32!==n.length&&V.throwArgumentError("bad digest length","digest",e);const r=t.sign(n,{canonical:!0});return(0,z.splitSignature)({recoveryParam:r.recoveryParam,r:(0,z.hexZeroPad)("0x"+r.r.toString(16),32),s:(0,z.hexZeroPad)("0x"+r.s.toString(16),32)})}computeSharedSecret(e){const t=q().keyFromPrivate((0,z.arrayify)(this.privateKey)),n=q().keyFromPublic((0,z.arrayify)(Y(e)));return(0,z.hexZeroPad)("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function K(e,t){const n=(0,z.splitSignature)(t),r={r:(0,z.arrayify)(n.r),s:(0,z.arrayify)(n.s)};return"0x"+q().recoverPubKey((0,z.arrayify)(e),r,n.recoveryParam).encode("hex",!1)}function Y(e,t){const n=(0,z.arrayify)(e);if(32===n.length){const e=new $(n);return t?"0x"+q().keyFromPrivate(n).getPublic(!0,"hex"):e.publicKey}return 33===n.length?t?(0,z.hexlify)(n):"0x"+q().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?t?"0x"+q().keyFromPublic(n).getPublic(!0,"hex"):(0,z.hexlify)(n):V.throwArgumentError("invalid public or private key","key","[REDACTED]")}},20510:function(e,t,n){"use strict";n.r(t),n.d(t,{UnicodeNormalizationForm:function(){return o.Uj},Utf8ErrorFuncs:function(){return o.te},Utf8ErrorReason:function(){return o.Uw},_toEscapedUtf8String:function(){return o.U$},formatBytes32String:function(){return s},nameprep:function(){return b},parseBytes32String:function(){return a},toUtf8Bytes:function(){return o.Y0},toUtf8CodePoints:function(){return o.XL},toUtf8String:function(){return o.ZN}});var r=n(7529),i=n(93667),o=n(84804);function s(e){const t=(0,o.Y0)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([t,r.R]).slice(0,32))}function a(e){const t=(0,i.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let n=31;for(;0===t[n-1];)n--;return(0,o.ZN)(t.slice(0,n))}function c(e,t){t||(t=function(e){return[parseInt(e,16)]});let n=0,r={};return e.split(",").forEach((e=>{let i=e.split(":");n+=parseInt(i[0],16),r[n]=t(i[1])})),r}function u(e){let t=0;return e.split(",").map((e=>{let n=e.split("-");1===n.length?n[1]="0":""===n[1]&&(n[1]="1");let r=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:r,h:t}}))}function l(e,t){let n=0;for(let r=0;r=n&&e<=n+i.h&&(e-n)%(i.d||1)===0){if(i.e&&-1!==i.e.indexOf(e-n))continue;return i}}return null}const d=u("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),f="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),p=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],h=c("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),m=c("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),g=c("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!==0)throw new Error("bad data");let t=[];for(let n=0;n{if(f.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=l(e,p);if(t)return[e+t.s];let n=h[e];if(n)return n;let r=m[e];return r?[e+r[0]]:g[e]||null}(e);return t||[e]})),t=n.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=(0,o.XL)((0,o.uu)(t),o.Uj.NFKC),t.forEach((e=>{if(l(e,y))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(l(e,d))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let r=(0,o.uu)(t);if("-"===r.substring(0,1)||"--"===r.substring(2,4)||"-"===r.substring(r.length-1))throw new Error("invalid hyphen");return r}},84804:function(e,t,n){"use strict";n.d(t,{Uj:function(){return o},te:function(){return c},Uw:function(){return s},U$:function(){return f},uu:function(){return p},Y0:function(){return l},XL:function(){return m},ZN:function(){return h}});var r=n(93667);const i=new(n(168).Logger)("strings/5.7.0");var o,s;function a(e,t,n,r,i){if(e===s.BAD_PREFIX||e===s.UNEXPECTED_CONTINUE){let e=0;for(let r=t+1;r>6===2;r++)e++;return e}return e===s.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(o||(o={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(s||(s={}));const c=Object.freeze({error:function(e,t,n,r,o){return i.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:a,replace:function(e,t,n,r,i){return e===s.OVERLONG?(r.push(i),0):(r.push(65533),a(e,t,n))}});function u(e,t){null==t&&(t=c.error),e=(0,r.arrayify)(e);const n=[];let i=0;for(;i>7===0){n.push(r);continue}let o=null,a=null;if(192===(224&r))o=1,a=127;else if(224===(240&r))o=2,a=2047;else{if(240!==(248&r)){i+=t(128===(192&r)?s.UNEXPECTED_CONTINUE:s.BAD_PREFIX,i-1,e,n);continue}o=3,a=65535}if(i-1+o>=e.length){i+=t(s.OVERRUN,i-1,e,n);continue}let c=r&(1<<8-o-1)-1;for(let u=0;u1114111?i+=t(s.OUT_OF_RANGE,i-1-o,e,n,c):c>=55296&&c<=57343?i+=t(s.UTF16_SURROGATE,i-1-o,e,n,c):c<=a?i+=t(s.OVERLONG,i-1-o,e,n,c):n.push(c))}return n}function l(e,t=o.current){t!=o.current&&(i.checkNormalize(),e=e.normalize(t));let n=[];for(let r=0;r>6|192),n.push(63&t|128);else if(55296==(64512&t)){r++;const i=e.charCodeAt(r);if(r>=e.length||56320!==(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&t)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(t>>12|224),n.push(t>>6&63|128),n.push(63&t|128)}return(0,r.arrayify)(n)}function d(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function f(e,t){return'"'+u(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?d(e):d(55296+((e-=65536)>>10&1023))+d(56320+(1023&e))})).join("")+'"'}function p(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function h(e,t){return p(u(e,t))}function m(e,t=o.current){return u(l(e,t))}},60561:function(e,t,n){"use strict";n.r(t),n.d(t,{TransactionTypes:function(){return p},accessListify:function(){return A},computeAddress:function(){return b},parse:function(){return C},recoverAddress:function(){return v},serialize:function(){return T}});var r=n(66379),i=n(2593),o=n(93667);const s=i.O$.from(0);var a=n(88017),c=n(97208),u=n(66906),l=n(70184),d=n(168);const f=new d.Logger("transactions/5.7.0");var p;function h(e){return"0x"===e?null:(0,r.getAddress)(e)}function m(e){return"0x"===e?s:i.O$.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(p||(p={}));const g=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],y={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function b(e){const t=(0,l.computePublicKey)(e);return(0,r.getAddress)((0,o.hexDataSlice)((0,a.keccak256)((0,o.hexDataSlice)(t,1)),12))}function v(e,t){return b((0,l.recoverPublicKey)((0,o.arrayify)(e),t))}function w(e,t){const n=(0,o.stripZeros)(i.O$.from(e).toHexString());return n.length>32&&f.throwArgumentError("invalid length for "+t,"transaction:"+t,e),n}function x(e,t){return{address:(0,r.getAddress)(e),storageKeys:(t||[]).map(((t,n)=>(32!==(0,o.hexDataLength)(t)&&f.throwArgumentError("invalid access list storageKey",`accessList[${e}:${n}]`,t),t.toLowerCase())))}}function A(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&f.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),x(e[0],e[1])):x(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const n=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return x(t,Object.keys(n).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function E(e){return A(e).map((e=>[e.address,e.storageKeys]))}function _(e,t){if(null!=e.gasPrice){const t=i.O$.from(e.gasPrice),n=i.O$.from(e.maxFeePerGas||0);t.eq(n)||f.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:n})}const n=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),w(e.maxFeePerGas||0,"maxFeePerGas"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,r.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",E(e.accessList||[])];if(t){const e=(0,o.splitSignature)(t);n.push(w(e.recoveryParam,"recoveryParam")),n.push((0,o.stripZeros)(e.r)),n.push((0,o.stripZeros)(e.s))}return(0,o.hexConcat)(["0x02",u.encode(n)])}function k(e,t){const n=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.gasPrice||0,"gasPrice"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,r.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",E(e.accessList||[])];if(t){const e=(0,o.splitSignature)(t);n.push(w(e.recoveryParam,"recoveryParam")),n.push((0,o.stripZeros)(e.r)),n.push((0,o.stripZeros)(e.s))}return(0,o.hexConcat)(["0x01",u.encode(n)])}function T(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&f.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,c.checkProperties)(e,y);const n=[];g.forEach((function(t){let r=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),r=(0,o.arrayify)((0,o.hexlify)(r,i)),t.length&&r.length!==t.length&&r.length>0&&f.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),t.maxLength&&(r=(0,o.stripZeros)(r),r.length>t.maxLength&&f.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r)),n.push((0,o.hexlify)(r))}));let r=0;if(null!=e.chainId?(r=e.chainId,"number"!==typeof r&&f.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!(0,o.isBytesLike)(t)&&t.v>28&&(r=Math.floor((t.v-35)/2)),0!==r&&(n.push((0,o.hexlify)(r)),n.push("0x"),n.push("0x")),!t)return u.encode(n);const i=(0,o.splitSignature)(t);let s=27+i.recoveryParam;return 0!==r?(n.pop(),n.pop(),n.pop(),s+=2*r+8,i.v>28&&i.v!==s&&f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==s&&f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),n.push((0,o.hexlify)(s)),n.push((0,o.stripZeros)((0,o.arrayify)(i.r))),n.push((0,o.stripZeros)((0,o.arrayify)(i.s))),u.encode(n)}(e,t);switch(e.type){case 1:return k(e,t);case 2:return _(e,t)}return f.throwError(`unsupported transaction type: ${e.type}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function S(e,t,n){try{const n=m(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(r){f.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,o.hexZeroPad)(t[1],32),e.s=(0,o.hexZeroPad)(t[2],32);try{const t=(0,a.keccak256)(n(e));e.from=v(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(r){}}function C(e){const t=(0,o.arrayify)(e);if(t[0]>127)return function(e){const t=u.decode(e);9!==t.length&&6!==t.length&&f.throwArgumentError("invalid raw transaction","rawTransaction",e);const n={nonce:m(t[0]).toNumber(),gasPrice:m(t[1]),gasLimit:m(t[2]),to:h(t[3]),value:m(t[4]),data:t[5],chainId:0};if(6===t.length)return n;try{n.v=i.O$.from(t[6]).toNumber()}catch(r){return n}if(n.r=(0,o.hexZeroPad)(t[7],32),n.s=(0,o.hexZeroPad)(t[8],32),i.O$.from(n.r).isZero()&&i.O$.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let i=n.v-27;const s=t.slice(0,6);0!==n.chainId&&(s.push((0,o.hexlify)(n.chainId)),s.push("0x"),s.push("0x"),i-=2*n.chainId+8);const c=(0,a.keccak256)(u.encode(s));try{n.from=v(c,{r:(0,o.hexlify)(n.r),s:(0,o.hexlify)(n.s),recoveryParam:i})}catch(r){}n.hash=(0,a.keccak256)(e)}return n.type=null,n}(t);switch(t[0]){case 1:return function(e){const t=u.decode(e.slice(1));8!==t.length&&11!==t.length&&f.throwArgumentError("invalid component count for transaction type: 1","payload",(0,o.hexlify)(e));const n={type:1,chainId:m(t[0]).toNumber(),nonce:m(t[1]).toNumber(),gasPrice:m(t[2]),gasLimit:m(t[3]),to:h(t[4]),value:m(t[5]),data:t[6],accessList:A(t[7])};return 8===t.length||(n.hash=(0,a.keccak256)(e),S(n,t.slice(8),k)),n}(t);case 2:return function(e){const t=u.decode(e.slice(1));9!==t.length&&12!==t.length&&f.throwArgumentError("invalid component count for transaction type: 2","payload",(0,o.hexlify)(e));const n=m(t[2]),r=m(t[3]),i={type:2,chainId:m(t[0]).toNumber(),nonce:m(t[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:m(t[4]),to:h(t[5]),value:m(t[6]),data:t[7],accessList:A(t[8])};return 9===t.length||(i.hash=(0,a.keccak256)(e),S(i,t.slice(9),_)),i}(t)}return f.throwError(`unsupported transaction type: ${t[0]}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},81202:function(e,t,n){"use strict";n.r(t),n.d(t,{commify:function(){return A},formatEther:function(){return k},formatUnits:function(){return E},parseEther:function(){return T},parseUnits:function(){return _}});var r=n(93667),i=n(85694),o=n(48794),s=n(2593);const a=new i.Yd(o.i),c={},u=s.O$.from(0),l=s.O$.from(-1);function d(e,t,n,r){const o={fault:t,operation:n};return void 0!==r&&(o.value=r),a.throwError(e,i.Yd.errors.NUMERIC_FAULT,o)}let f="0";for(;f.length<256;)f+=f;function p(e){if("number"!==typeof e)try{e=s.O$.from(e).toNumber()}catch(t){}return"number"===typeof e&&e>=0&&e<=256&&!(e%1)?"1"+f.substring(0,e):a.throwArgumentError("invalid decimal size","decimals",e)}function h(e,t){null==t&&(t=0);const n=p(t),r=(e=s.O$.from(e)).lt(u);r&&(e=e.mul(l));let i=e.mod(n).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",e);let o=i[0],c=i[1];for(o||(o="0"),c||(c="0");"0"===c[c.length-1];)c=c.substring(0,c.length-1);for(c.length>n.length-1&&d("fractional component exceeds decimals","underflow","parseFixed"),""===c&&(c="0");c.lengthnull==e[t]?r:(typeof e[t]!==n&&a.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new g(c,t,n,r)}}class y{constructor(e,t,n,r){e!==c&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(b.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(b.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&a.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=y.from("1"+f.substring(0,e),this.format),r=v.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&a.throwArgumentError("invalid byte width","width",e);const t=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,r.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return y.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||(0,s.Zm)(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),y.fromString(h(e,t),g.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=g.from(t),i=m(e,n.decimals);!n.signed&&i.lt(u)&&d("unsigned value cannot be negative","overflow","value",e);let o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=(0,r.hexZeroPad)(o,n.width/8));const s=h(i,n.decimals);return new y(c,o,s,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=g.from(t);if((0,r.arrayify)(e).length>n.width/8)throw new Error("overflow");let i=s.O$.from(e);n.signed&&(i=i.fromTwos(n.width));const o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=h(i,n.decimals);return new y(c,o,a,n)}static from(e,t){if("string"===typeof e)return y.fromString(e,t);if((0,r.isBytes)(e))return y.fromBytes(e,t);try{return y.fromValue(e,0,t)}catch(n){if(n.code!==i.Yd.errors.INVALID_ARGUMENT)throw n}return a.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const b=y.from(1),v=y.from("0.5");const w=new(n(168).Logger)("units/5.7.0"),x=["wei","kwei","mwei","gwei","szabo","finney","ether"];function A(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&w.throwArgumentError("invalid value","value",e);let n=t[0],r="";for("-"===n.substring(0,1)&&(r="-",n=n.substring(1));"0"===n.substring(0,1);)n=n.substring(1);""===n&&(n="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;n.length;){if(n.length<=3){o.unshift(n);break}{const e=n.length-3;o.unshift(n.substring(e)),n=n.substring(0,e)}}return r+o.join(",")+i}function E(e,t){if("string"===typeof t){const e=x.indexOf(t);-1!==e&&(t=3*e)}return h(e,null!=t?t:18)}function _(e,t){if("string"!==typeof e&&w.throwArgumentError("value must be a string","value",e),"string"===typeof t){const e=x.indexOf(t);-1!==e&&(t=3*e)}return m(e,null!=t?t:18)}function k(e){return E(e,18)}function T(e){return _(e,18)}},51880:function(e,t,n){"use strict";n.r(t),n.d(t,{_fetchData:function(){return h},fetchJson:function(){return m},poll:function(){return g}});var r=n(59567),i=n(93667),o=n(97208),s=n(84804),a=n(168);var c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};function u(e,t){return c(this,void 0,void 0,(function*(){null==t&&(t={});const n={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(n.mode=e.mode),e.cache&&(n.cache=e.cache),e.credentials&&(n.credentials=e.credentials),e.redirect&&(n.redirect=e.redirect),e.referrer&&(n.referrer=e.referrer)}const r=yield fetch(e,n),o=yield r.arrayBuffer(),s={};return r.headers.forEach?r.headers.forEach(((e,t)=>{s[t.toLowerCase()]=e})):r.headers.keys().forEach((e=>{s[e.toLowerCase()]=r.headers.get(e)})),{headers:s,statusCode:r.status,statusMessage:r.statusText,body:(0,i.arrayify)(new Uint8Array(o))}}))}var l=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const d=new a.Logger("web/5.7.1");function f(e){return new Promise((t=>{setTimeout(t,e)}))}function p(e,t){if(null==e)return null;if("string"===typeof e)return e;if((0,i.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,s.ZN)(e)}catch(n){}return(0,i.hexlify)(e)}return e}function h(e,t,n){const i="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;d.assertArgument(i>0&&i%1===0,"invalid connection throttle limit","connection.throttleLimit",i);const c="object"===typeof e?e.throttleCallback:null,h="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;d.assertArgument(h>0&&h%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",h);const m="object"===typeof e&&!!e.errorPassThrough,g={};let y=null;const b={method:"GET"};let v=!1,w=12e4;if("string"===typeof e)y=e;else if("object"===typeof e){if(null!=e&&null!=e.url||d.throwArgumentError("missing URL","connection.url",e),y=e.url,"number"===typeof e.timeout&&e.timeout>0&&(w=e.timeout),e.headers)for(const t in e.headers)g[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(v=!0);if(b.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==y.substring(0,6)&&!0!==e.allowInsecureAuthentication&&d.throwError("basic authentication requires a secure https url",a.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:y,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;g.authorization={key:"Authorization",value:"Basic "+(0,r.c)((0,s.Y0)(t))}}null!=e.skipFetchSetup&&(b.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(b.fetchOptions=(0,o.shallowCopy)(e.fetchOptions))}const x=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),A=y?y.match(x):null;if(A)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":A[1]||"text/plain"},body:A[2]?(0,r.J)(A[3]):(E=A[3],(0,s.Y0)(E.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return n&&(t=n(e.body,e)),Promise.resolve(t)}catch(S){d.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:p(A[1],A[2]),error:S,requestBody:null,requestMethod:"GET",url:y})}var E;t&&(b.method="POST",b.body=t,null==g["content-type"]&&(g["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==g["content-length"]&&(g["content-length"]={key:"Content-Length",value:String(t.length)}));const _={};Object.keys(g).forEach((e=>{const t=g[e];_[t.key]=t.value})),b.headers=_;const k=function(){let e=null;return{promise:new Promise((function(t,n){w&&(e=setTimeout((()=>{null!=e&&(e=null,n(d.makeError("timeout",a.Logger.errors.TIMEOUT,{requestBody:p(b.body,_["content-type"]),requestMethod:b.method,timeout:w,url:y})))}),w))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),T=function(){return l(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(k.cancel(),d.throwError("bad response",a.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:p(r,t.headers?t.headers["content-type"]:null),requestBody:p(b.body,_["content-type"]),requestMethod:b.method,url:y})),n)try{const e=yield n(r,t);return k.cancel(),e}catch(S){if(S.throttleRetry&&e"content-type"===e.toLowerCase())).length||(n.headers=(0,o.shallowCopy)(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return h(e,r,((e,t)=>{let r=null;if(null!=e)try{r=JSON.parse((0,s.ZN)(e))}catch(i){d.throwError("invalid JSON",a.Logger.errors.SERVER_ERROR,{body:e,error:i})}return n&&(r=n(r,t)),r}))}function g(e,t){return t||(t={}),null==(t=(0,o.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(n,r){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{s()&&r(new Error("timeout"))}),t.timeout));const a=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)s()&&n(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>a)return void(s()&&r(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){s()&&r(e)}))}()}))}},41257:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(94083).Buffer}catch(C){}function a(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,n,i){for(var o=0,s=0,a=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,s=o%r,a=Math.min(o,o-s)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(C){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?""}var f=["","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"],p=[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],h=[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];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?f[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=p[e],l=h[e];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(l).toString(e);n=(d=d.idivn(l)).isZero()?m+n:f[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;n.words[0]=a;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=f;p++){var h=u-p|0;l+=(s=(i=0|e.words[h])*(o=0|t.words[p])+d)/67108864|0,d=67108863&s}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(e[n--]=s>>8&255),n>=0&&(e[n--]=s>>16&255),6===o?(n>=0&&(e[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,p=0|s[1],h=8191&p,m=p>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,A=0|s[4],E=8191&A,_=A>>>13,k=0|s[5],T=8191&k,S=k>>>13,C=0|s[6],I=8191&C,O=C>>>13,R=0|s[7],D=8191&R,P=R>>>13,B=0|s[8],M=8191&B,N=B>>>13,F=0|s[9],L=8191&F,j=F>>>13,U=0|a[0],Z=8191&U,H=U>>>13,z=0|a[1],G=8191&z,V=z>>>13,W=0|a[2],q=8191&W,$=W>>>13,K=0|a[3],Y=8191&K,X=K>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],ne=8191&te,re=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,pe=0|a[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(d,Z))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,Z)|0))<<13)|0;u=((o=Math.imul(f,H))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,H))+Math.imul(m,Z)|0,o=Math.imul(m,H);var ye=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,Z),i=(i=Math.imul(y,H))+Math.imul(b,Z)|0,o=Math.imul(b,H),r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0;var be=(u+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,H))+Math.imul(x,Z)|0,o=Math.imul(x,H),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,V)|0,r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0;var ve=(u+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(E,Z),i=(i=Math.imul(E,H))+Math.imul(_,Z)|0,o=Math.imul(_,H),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,$)|0,r=r+Math.imul(h,Y)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,X)|0;var we=(u+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,Z),i=(i=Math.imul(T,H))+Math.imul(S,Z)|0,o=Math.imul(S,H),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,$)|0,r=r+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,X)|0,r=r+Math.imul(h,Q)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var xe=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(I,Z),i=(i=Math.imul(I,H))+Math.imul(O,Z)|0,o=Math.imul(O,H),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,X)|0,r=r+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Ae=(u+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,H))+Math.imul(P,Z)|0,o=Math.imul(P,H),r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Ee=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,H))+Math.imul(N,Z)|0,o=Math.imul(N,H),r=r+Math.imul(D,G)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,r=r+Math.imul(h,ce)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var _e=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,H))+Math.imul(j,Z)|0,o=Math.imul(j,H),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(D,q)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,r=r+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var ke=(u+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,he)|0))<<13)|0;u=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(j,G)|0,o=Math.imul(j,V),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,r=r+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var Te=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,$))+Math.imul(j,q)|0,o=Math.imul(j,$),r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Se=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,he)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,Y),i=(i=Math.imul(L,X))+Math.imul(j,Y)|0,o=Math.imul(j,X),r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(D,ne)|0,i=(i=i+Math.imul(D,re)|0)+Math.imul(P,ne)|0,o=o+Math.imul(P,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var Ce=(u+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,he)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,r=r+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ie=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(_,he)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(j,ne)|0,o=Math.imul(j,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,r=r+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,fe)|0;var Oe=(u+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,oe),i=(i=Math.imul(L,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,r=r+Math.imul(D,de)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Re=(u+(r=r+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(O,he)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,ce),i=(i=Math.imul(L,ue))+Math.imul(j,ce)|0,o=Math.imul(j,ue),r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var De=(u+(r=r+Math.imul(D,he)|0)|0)+((8191&(i=(i=i+Math.imul(D,me)|0)+Math.imul(P,he)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,fe))+Math.imul(j,de)|0,o=Math.imul(j,fe);var Pe=(u+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(N,he)|0))<<13)|0;u=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Be=(u+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(j,he)|0))<<13)|0;return u=((o=Math.imul(j,me))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ae,c[7]=Ee,c[8]=_e,c[9]=ke,c[10]=Te,c[11]=Se,c[12]=Ce,c[13]=Ie,c[14]=Oe,c[15]=Re,c[16]=De,c[17]=Pe,c[18]=Be,0!==u&&(c[19]=u,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function b(e,t,n){return y(e,t,n)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=m),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?m(this,e,t):n<1024?y(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},v.prototype.permute=function(e,t,n,r,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,s=0|i.words[i.length-1];0!==(n=26-this._countBits(s))&&(i=i.ushln(n),r.iushln(n),s=0|i.words[i.length-1]);var a,c=r.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);a&&(a.words[d]=f)}return a&&a._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var h=0,m=1;0===(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new T(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(A,x),A.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return w[e]=t,t},T.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=s;0!==p.cmp(a);){for(var m=p,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===r&&0===l)&&(i=this.mul(i,n[s]),a=0,s=0)):a=0}c=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,T),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},47796:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var s=n(83893);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return s.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return s.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return s.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return s.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return s.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return s.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return s.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return s.TransactionDescription}});var a=n(66379);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var c=o(n(4089));t.base64=c;var u=n(14694);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return u.Base58}});var l=n(93667);Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return l.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return l.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return l.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return l.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return l.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return l.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return l.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return l.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return l.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return l.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return l.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return l.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return l.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return l.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return l.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return l.stripZeros}});var d=n(25385);Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return d._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return d.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return d.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return d.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return d.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return d.namehash}});var f=n(4682);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return f.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return f.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return f.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return f.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return f.mnemonicToSeed}});var p=n(72294);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return p.getJsonWalletAddress}});var h=n(88017);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var m=n(168);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return m.Logger}});var g=n(8894);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return g.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return g.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return g.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return g.sha512}});var y=n(67996);Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return y.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return y.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return y.sha256}});var b=n(52989);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return b.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return b.shuffled}});var v=n(97208);Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return v.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return v.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return v.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return v.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return v.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return v.shallowCopy}});var w=o(n(66906));t.RLP=w;var x=n(70184);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return x.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return x.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return x.SigningKey}});var A=n(20510);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var E=n(60561);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return E.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return E.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return E.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return E.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return E.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return E.TransactionTypes}});var _=n(81202);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return _.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return _.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return _.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return _.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return _.parseUnits}});var k=n(18940);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return k.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return k.verifyTypedData}});var T=n(51880);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return T._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return T.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return T.poll}});var S=n(8894);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return S.SupportedAlgorithm}});var C=n(20510);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return C.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return C.Utf8ErrorReason}})},62863:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});const r="ethers/5.5.4"},91023:function(e,t,n){"use strict";n.r(t),n.d(t,{Signer:function(){return s.E},Wallet:function(){return a.Wallet},VoidSigner:function(){return s.b},getDefaultProvider:function(){return u.getDefaultProvider},providers:function(){return u},BaseContract:function(){return r.VZ},Contract:function(){return r.CH},ContractFactory:function(){return r.lV},BigNumber:function(){return i.O$},FixedNumber:function(){return o.xs},constants:function(){return c},errors:function(){return p.ErrorCode},logger:function(){return m},utils:function(){return f},wordlists:function(){return l.E},version:function(){return h.i},Wordlist:function(){return d.D}});var r=n(11466),i=n(91747),o=n(43698),s=n(64758),a=n(81502),c=n(21815),u=n(24946),l=n(10234),d=n(48812),f=n(86494),p=n(1581),h=n(62863);const m=new p.Logger(h.i)},86623:function(e,t,n){"use strict";n.r(t),n.d(t,{ethers:function(){return r},Signer:function(){return i.E},Wallet:function(){return o.Wallet},VoidSigner:function(){return i.b},getDefaultProvider:function(){return s.getDefaultProvider},providers:function(){return s},BaseContract:function(){return a.VZ},Contract:function(){return a.CH},ContractFactory:function(){return a.lV},BigNumber:function(){return c.O$},FixedNumber:function(){return u.xs},constants:function(){return l},errors:function(){return d.ErrorCode},logger:function(){return r.logger},utils:function(){return f},wordlists:function(){return p.E},version:function(){return h.i},Wordlist:function(){return m.D}});var r=n(91023),i=n(64758),o=n(81502),s=n(24946),a=n(11466),c=n(91747),u=n(43698),l=n(21815),d=n(1581),f=n(86494),p=n(10234),h=n(62863),m=n(48812);try{const e=window;null==e._ethers&&(e._ethers=r)}catch(g){}},86494:function(e,t,n){"use strict";n.r(t),n.d(t,{AbiCoder:function(){return r.R},defaultAbiCoder:function(){return r.$},Fragment:function(){return i.HY},ConstructorFragment:function(){return i.Xg},ErrorFragment:function(){return i.IC},EventFragment:function(){return i.QV},FunctionFragment:function(){return i.YW},ParamType:function(){return i._R},FormatTypes:function(){return i.pc},checkResultErrors:function(){return o.BR},Logger:function(){return b.Logger},RLP:function(){return _},_fetchData:function(){return D._fetchData},fetchJson:function(){return D.fetchJson},poll:function(){return D.poll},checkProperties:function(){return E.checkProperties},deepCopy:function(){return E.deepCopy},defineReadOnly:function(){return E.defineReadOnly},getStatic:function(){return E.getStatic},resolveProperties:function(){return E.resolveProperties},shallowCopy:function(){return E.shallowCopy},arrayify:function(){return l.arrayify},concat:function(){return l.concat},stripZeros:function(){return l.stripZeros},zeroPad:function(){return l.zeroPad},isBytes:function(){return l.isBytes},isBytesLike:function(){return l.isBytesLike},defaultPath:function(){return m.defaultPath},HDNode:function(){return m.HDNode},SigningKey:function(){return k.SigningKey},Interface:function(){return s.vU},LogDescription:function(){return s.CC},TransactionDescription:function(){return s.vk},base58:function(){return u.Base58},base64:function(){return c},hexlify:function(){return l.hexlify},isHexString:function(){return l.isHexString},hexConcat:function(){return l.hexConcat},hexStripZeros:function(){return l.hexStripZeros},hexValue:function(){return l.hexValue},hexZeroPad:function(){return l.hexZeroPad},hexDataLength:function(){return l.hexDataLength},hexDataSlice:function(){return l.hexDataSlice},nameprep:function(){return T.Ll},_toEscapedUtf8String:function(){return S.U$},toUtf8Bytes:function(){return S.Y0},toUtf8CodePoints:function(){return S.XL},toUtf8String:function(){return S.ZN},Utf8ErrorFuncs:function(){return S.te},formatBytes32String:function(){return C.s},parseBytes32String:function(){return C.F},hashMessage:function(){return d.r},namehash:function(){return f.V},isValidName:function(){return f.r},id:function(){return p.id},_TypedDataEncoder:function(){return h.E},getAddress:function(){return a.getAddress},getIcapAddress:function(){return a.getIcapAddress},getContractAddress:function(){return a.getContractAddress},getCreate2Address:function(){return a.getCreate2Address},isAddress:function(){return a.isAddress},formatEther:function(){return O.formatEther},parseEther:function(){return O.parseEther},formatUnits:function(){return O.formatUnits},parseUnits:function(){return O.parseUnits},commify:function(){return O.commify},computeHmac:function(){return v.Gy},keccak256:function(){return y.keccak256},ripemd160:function(){return v.bP},sha256:function(){return v.JQ},sha512:function(){return v.o},randomBytes:function(){return x.O},shuffled:function(){return A.y},solidityPack:function(){return w.pack},solidityKeccak256:function(){return w.keccak256},soliditySha256:function(){return w.sha256},splitSignature:function(){return l.splitSignature},joinSignature:function(){return l.joinSignature},accessListify:function(){return I.accessListify},parseTransaction:function(){return I.parse},serializeTransaction:function(){return I.serialize},TransactionTypes:function(){return I.TransactionTypes},getJsonWalletAddress:function(){return g.Rb},computeAddress:function(){return I.computeAddress},recoverAddress:function(){return I.recoverAddress},computePublicKey:function(){return k.computePublicKey},recoverPublicKey:function(){return k.recoverPublicKey},verifyMessage:function(){return R.verifyMessage},verifyTypedData:function(){return R.verifyTypedData},getAccountPath:function(){return m.getAccountPath},mnemonicToEntropy:function(){return m.mnemonicToEntropy},entropyToMnemonic:function(){return m.entropyToMnemonic},isValidMnemonic:function(){return m.isValidMnemonic},mnemonicToSeed:function(){return m.mnemonicToSeed},SupportedAlgorithm:function(){return P.p},UnicodeNormalizationForm:function(){return S.Uj},Utf8ErrorReason:function(){return S.Uw},Indexed:function(){return s.Hk}});var r=n(69820),i=n(23034),o=n(67072),s=n(39786),a=n(46126),c=n(58037),u=n(10692),l=n(45703),d=n(93684),f=n(84706),p=n(32046),h=n(34120),m=n(84204),g=n(67949),y=n(9341),b=n(1581),v=n(90229),w=n(46352),x=n(66869),A=n(52472),E=n(6881),_=n(48644),k=n(43705),T=n(35637),S=n(29251),C=n(86237),I=n(3451),O=n(59386),R=n(81502),D=n(98580),P=n(21261)},56371:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.parseBytes32String=void 0;var s=n(80801);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return s.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return s.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return s.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return s.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return s.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return s.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return s.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return s.TransactionDescription}});var a=n(46126);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var c=o(n(58037));t.base64=c;var u=n(10692);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return u.Base58}});var l=n(45703);Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return l.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return l.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return l.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return l.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return l.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return l.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return l.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return l.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return l.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return l.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return l.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return l.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return l.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return l.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return l.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return l.stripZeros}});var d=n(75931);Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return d._TypedDataEncoder}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return d.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return d.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return d.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return d.namehash}});var f=n(84204);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return f.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return f.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return f.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return f.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return f.mnemonicToSeed}});var p=n(64341);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return p.getJsonWalletAddress}});var h=n(9341);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var m=n(1581);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return m.Logger}});var g=n(91278);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return g.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return g.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return g.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return g.sha512}});var y=n(46352);Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return y.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return y.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return y.sha256}});var b=n(22118);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return b.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return b.shuffled}});var v=n(6881);Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return v.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return v.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return v.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return v.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return v.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return v.shallowCopy}});var w=o(n(48644));t.RLP=w;var x=n(43705);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return x.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return x.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return x.SigningKey}});var A=n(62741);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var E=n(3451);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return E.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return E.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return E.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return E.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return E.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return E.TransactionTypes}});var _=n(59386);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return _.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return _.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return _.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return _.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return _.parseUnits}});var k=n(81502);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return k.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return k.verifyTypedData}});var T=n(98580);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return T._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return T.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return T.poll}});var S=n(91278);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return S.SupportedAlgorithm}});var C=n(62741);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return C.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return C.Utf8ErrorReason}})},79048:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});const r="abi/5.5.0"},69820:function(e,t,n){"use strict";n.d(t,{R:function(){return O},$:function(){return R}});var r=n(45703),i=n(6881),o=n(1581),s=n(79048),a=n(67072),c=n(46126);class u extends a.XI{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=(0,c.getAddress)(t)}catch(n){this._throwError(n.message,t)}return e.writeValue(t)}decode(e){return(0,c.getAddress)((0,r.hexZeroPad)(e.readValue().toHexString(),20))}}class l extends a.XI{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const d=new o.Logger(s.i);function f(e,t,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"===typeof n){let e={};r=t.map((t=>{const r=t.localName;return r||d.throwError("cannot encode object for signature with missing names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]&&d.throwError("cannot encode object for signature with duplicate names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]=!0,n[r]}))}else d.throwArgumentError("invalid tuple value","tuple",n);t.length!==r.length&&d.throwArgumentError("types/value length mismatch","tuple",n);let i=new a.QV(e.wordSize),s=new a.QV(e.wordSize),c=[];t.forEach(((e,t)=>{let n=r[t];if(e.dynamic){let t=s.length;e.encode(s,n);let r=i.writeUpdatableValue();c.push((e=>{r(e+t)}))}else e.encode(i,n)})),c.forEach((e=>{e(i.length)}));let u=e.appendWriter(i);return u+=e.appendWriter(s),u}function p(e,t){let n=[],r=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let n=e.readValue(),a=r.subReader(n.toNumber());try{i=t.decode(a)}catch(s){if(s.code===o.Logger.errors.BUFFER_OVERRUN)throw s;i=s,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(s){if(s.code===o.Logger.errors.BUFFER_OVERRUN)throw s;i=s,i.baseType=t.name,i.name=t.localName,i.type=t.type}void 0!=i&&n.push(i)}));const i=t.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach(((e,t)=>{let r=e.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[t];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let o=0;o{throw e}})}return Object.freeze(n)}class h extends a.XI{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;ne._data.length&&d.throwError("insufficient data length",o.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let r=0;r{e.dynamic&&(n=!0),r.push(e.type)}));super("tuple","tuple("+r.join(",")+")",t,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[r]))})),Object.freeze(e)}encode(e,t){return f(e,this.coders,t)}decode(e){return e.coerce(this.name,p(e,this.coders))}}var T=n(23034);const S=new o.Logger(s.i),C=new RegExp(/^bytes([0-9]*)$/),I=new RegExp(/^(u?int)([0-9]*)$/);class O{constructor(e){S.checkNew(new.target,O),(0,i.defineReadOnly)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new u(e.name);case"bool":return new m(e.name);case"string":return new _(e.name);case"bytes":return new y(e.name);case"array":return new h(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new k((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new v(e.name)}let t=e.type.match(I);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!==0)&&S.throwArgumentError("invalid "+t[1]+" bit length","param",e),new A(n/8,"int"===t[1],e.name)}if(t=e.type.match(C),t){let n=parseInt(t[1]);return(0===n||n>32)&&S.throwArgumentError("invalid bytes length","param",e),new b(n,e.name)}return S.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new a.Ej(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new a.QV(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(T._R.from(e))));return new k(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&S.throwError("types/values length mismatch",o.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(T._R.from(e)))),r=new k(n,"_"),i=this._getWriter();return r.encode(i,t),i.data}decode(e,t,n){const i=e.map((e=>this._getCoder(T._R.from(e))));return new k(i,"_").decode(this._getReader((0,r.arrayify)(t),n))}}const R=new O},67072:function(e,t,n){"use strict";n.d(t,{BR:function(){return u},XI:function(){return l},QV:function(){return d},Ej:function(){return f}});var r=n(45703),i=n(91747),o=n(6881),s=n(1581),a=n(79048);const c=new s.Logger(a.i);function u(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let o in r){const s=e.slice();s.push(o);try{n(s,r[o])}catch(i){t.push({path:s,error:i})}}};return n([],e),t}class l{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){c.throwArgumentError(e,this.localName,t)}}class d{constructor(e){(0,o.defineReadOnly)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,r.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,r.concat)(e._data))}writeBytes(e){let t=(0,r.arrayify)(e);const n=t.length%this.wordSize;return n&&(t=(0,r.concat)([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=(0,r.arrayify)(i.O$.from(e));return t.length>this.wordSize&&c.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,r.concat)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class f{constructor(e,t,n,i){(0,o.defineReadOnly)(this,"_data",(0,r.arrayify)(e)),(0,o.defineReadOnly)(this,"wordSize",t||32),(0,o.defineReadOnly)(this,"_coerceFunc",n),(0,o.defineReadOnly)(this,"allowLoose",i),this._offset=0}get data(){return(0,r.hexlify)(this._data)}get consumed(){return this._offset}static coerce(e,t){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):f.coerce(e,t)}_peekBytes(e,t,n){let r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&n&&this._offset+t<=this._data.length?r=t:c.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}subReader(e){return new f(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let n=this._peekBytes(0,e,!!t);return this._offset+=n.length,n.slice(0,e)}readValue(){return i.O$.from(this.readBytes(this.wordSize))}}},23034:function(e,t,n){"use strict";n.d(t,{pc:function(){return p},_R:function(){return m},HY:function(){return y},QV:function(){return b},Xg:function(){return A},YW:function(){return E},IC:function(){return k}});var r=n(91747),i=n(6881),o=n(1581),s=n(79048);const a=new o.Logger(s.i),c={};let u={calldata:!0,memory:!0,storage:!0},l={calldata:!0,memory:!0};function d(e,t){if("bytes"===e||"string"===e){if(u[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&l[t])return!0;return(u[t]||"payable"===t)&&a.throwArgumentError("invalid modifier","name",t),!1}function f(e,t){for(let n in t)(0,i.defineReadOnly)(e,n,t[n])}const p=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),h=new RegExp(/^(.*)\[([0-9]*)\]$/);class m{constructor(e,t){e!==c&&a.throwError("use fromString",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),f(this,t);let n=this.type.match(h);f(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:m.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==p.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===p.full?", ":",")+")"):t+=this.type,e!==p.sighash&&(!0===this.indexed&&(t+=" indexed"),e===p.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"===typeof e?m.fromString(e,t):m.fromObject(e)}static fromObject(e){return m.isParamType(e)?e:new m(c,{name:e.name||null,type:T(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(m.fromObject):null})}static fromString(e,t){return function(e){return m.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}(function(e,t){let n=e;function r(t){a.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let a=0;am.fromString(e,t)))}class y{constructor(e,t){e!==c&&a.throwError("use a static from method",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),f(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return y.isFragment(e)?e:"string"===typeof e?y.fromString(e):y.fromObject(e)}static fromObject(e){if(y.isFragment(e))return e;switch(e.type){case"function":return E.fromObject(e);case"event":return b.fromObject(e);case"constructor":return A.fromObject(e);case"error":return k.fromObject(e);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?b.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?E.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?A.fromString(e.trim()):"error"===e.split(" ")[0]?k.fromString(e.substring(5).trim()):a.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class b extends y{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==p.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ",e!==p.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"===typeof e?b.fromString(e):b.fromObject(e)}static fromObject(e){if(b.isEventFragment(e))return e;"event"!==e.type&&a.throwArgumentError("invalid event object","value",e);const t={name:C(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(m.fromObject):[],type:"event"};return new b(c,t)}static fromString(e){let t=e.match(I);t||a.throwArgumentError("invalid event string","value",e);let n=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:a.warn("unknown modifier: "+e)}})),b.fromObject({name:t[1].trim(),anonymous:n,inputs:g(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function v(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=r.O$.from(n[1]),n[0]):e}function w(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function x(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&a.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&a.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||a.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&a.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&a.throwArgumentError("unable to determine stateMutability","value",e),t}class A extends y{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===p.sighash&&a.throwError("cannot format a constructor for sighash",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"===typeof e?A.fromString(e):A.fromObject(e)}static fromObject(e){if(A.isConstructorFragment(e))return e;"constructor"!==e.type&&a.throwArgumentError("invalid constructor object","value",e);let t=x(e);t.constant&&a.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(m.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?r.O$.from(e.gas):null};return new A(c,n)}static fromString(e){let t={type:"constructor"},n=(e=v(e,t)).match(I);return n&&"constructor"===n[1].trim()||a.throwArgumentError("invalid constructor string","value",e),t.inputs=g(n[2].trim(),!1),w(n[3].trim(),t),A.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class E extends A{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==p.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ",e!==p.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"===typeof e?E.fromString(e):E.fromObject(e)}static fromObject(e){if(E.isFunctionFragment(e))return e;"function"!==e.type&&a.throwArgumentError("invalid function object","value",e);let t=x(e);const n={type:e.type,name:C(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(m.fromObject):[],outputs:e.outputs?e.outputs.map(m.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?r.O$.from(e.gas):null};return new E(c,n)}static fromString(e){let t={type:"function"},n=(e=v(e,t)).split(" returns ");n.length>2&&a.throwArgumentError("invalid function string","value",e);let r=n[0].match(I);if(r||a.throwArgumentError("invalid function signature","value",e),t.name=r[1].trim(),t.name&&C(t.name),t.inputs=g(r[2],!1),w(r[3].trim(),t),n.length>1){let r=n[1].match(I);""==r[1].trim()&&""==r[3].trim()||a.throwArgumentError("unexpected tokens","value",e),t.outputs=g(r[2],!1)}else t.outputs=[];return E.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function _(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||a.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class k extends y{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==p.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ",t.trim()}static from(e){return"string"===typeof e?k.fromString(e):k.fromObject(e)}static fromObject(e){if(k.isErrorFragment(e))return e;"error"!==e.type&&a.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:C(e.name),inputs:e.inputs?e.inputs.map(m.fromObject):[]};return _(new k(c,t))}static fromString(e){let t={type:"error"},n=e.match(I);return n||a.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&C(t.name),t.inputs=g(n[2],!1),_(k.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function T(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const S=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function C(e){return e&&e.match(S)||a.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const I=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},80801:function(e,t,n){"use strict";n.r(t),n.d(t,{ConstructorFragment:function(){return r.Xg},ErrorFragment:function(){return r.IC},EventFragment:function(){return r.QV},Fragment:function(){return r.HY},FunctionFragment:function(){return r.YW},ParamType:function(){return r._R},FormatTypes:function(){return r.pc},AbiCoder:function(){return i.R},defaultAbiCoder:function(){return i.$},Interface:function(){return o.vU},Indexed:function(){return o.Hk},checkResultErrors:function(){return s.BR},LogDescription:function(){return o.CC},TransactionDescription:function(){return o.vk}});var r=n(23034),i=n(69820),o=n(39786),s=n(67072)},39786:function(e,t,n){"use strict";n.d(t,{CC:function(){return h},vk:function(){return m},Hk:function(){return y},vU:function(){return w}});var r=n(46126),i=n(91747),o=n(45703),s=n(32046),a=n(9341),c=n(6881),u=n(69820),l=n(23034),d=n(1581),f=n(79048);const p=new d.Logger(f.i);class h extends c.Description{}class m extends c.Description{}class g extends c.Description{}class y extends c.Description{static isIndexed(e){return!(!e||!e._isIndexed)}}const b={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function v(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return n.error=t,n}class w{constructor(e){p.checkNew(new.target,w);let t=[];t="string"===typeof e?JSON.parse(e):e,(0,c.defineReadOnly)(this,"fragments",t.map((e=>l.HY.from(e))).filter((e=>null!=e))),(0,c.defineReadOnly)(this,"_abiCoder",(0,c.getStatic)(new.target,"getAbiCoder")()),(0,c.defineReadOnly)(this,"functions",{}),(0,c.defineReadOnly)(this,"errors",{}),(0,c.defineReadOnly)(this,"events",{}),(0,c.defineReadOnly)(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void p.warn("duplicate definition - constructor"):void(0,c.defineReadOnly)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let n=e.format();t[n]?p.warn("duplicate definition - "+n):t[n]=e})),this.deploy||(0,c.defineReadOnly)(this,"deploy",l.Xg.from({payable:!1,type:"constructor"})),(0,c.defineReadOnly)(this,"_isInterface",!0)}format(e){e||(e=l.pc.full),e===l.pc.sighash&&p.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===l.pc.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return u.$}static getAddress(e){return(0,r.getAddress)(e)}static getSighash(e){return(0,o.hexDataSlice)((0,s.id)(e.format()),0,4)}static getEventTopic(e){return(0,s.id)(e.format())}getFunction(e){if((0,o.isHexString)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];p.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===n.length?p.throwArgumentError("no matching function","name",t):n.length>1&&p.throwArgumentError("multiple matching functions","name",t),this.functions[n[0]]}const t=this.functions[l.YW.fromString(e).format()];return t||p.throwArgumentError("no matching function","signature",e),t}getEvent(e){if((0,o.isHexString)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];p.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===n.length?p.throwArgumentError("no matching event","name",t):n.length>1&&p.throwArgumentError("multiple matching events","name",t),this.events[n[0]]}const t=this.events[l.QV.fromString(e).format()];return t||p.throwArgumentError("no matching event","signature",e),t}getError(e){if((0,o.isHexString)(e)){const t=(0,c.getStatic)(this.constructor,"getSighash");for(const n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}p.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===n.length?p.throwArgumentError("no matching error","name",t):n.length>1&&p.throwArgumentError("multiple matching errors","name",t),this.errors[n[0]]}const t=this.errors[l.YW.fromString(e).format()];return t||p.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"===typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(n){throw t}}return(0,c.getStatic)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"===typeof e&&(e=this.getEvent(e)),(0,c.getStatic)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"===typeof e&&(e=this.getError(e));const n=(0,o.arrayify)(t);return(0,o.hexlify)(n.slice(0,4))!==this.getSighash(e)&&p.throwArgumentError(`data signature does not match error ${e.name}.`,"data",(0,o.hexlify)(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,t){return"string"===typeof e&&(e=this.getError(e)),(0,o.hexlify)((0,o.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"===typeof e&&(e=this.getFunction(e));const n=(0,o.arrayify)(t);return(0,o.hexlify)(n.slice(0,4))!==this.getSighash(e)&&p.throwArgumentError(`data signature does not match function ${e.name}.`,"data",(0,o.hexlify)(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,o.hexlify)((0,o.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"===typeof e&&(e=this.getFunction(e));let n=(0,o.arrayify)(t),r=null,i=null,s=null,a=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch(c){}break;case 4:{const e=(0,o.hexlify)(n.slice(0,4)),t=b[e];if(t)i=this._abiCoder.decode(t.inputs,n.slice(4)),s=t.name,a=t.signature,t.reason&&(r=i[0]);else try{const t=this.getError(e);i=this._abiCoder.decode(t.inputs,n.slice(4)),s=t.name,a=t.format()}catch(c){console.log(c)}break}}return p.throwError("call revert exception",d.Logger.errors.CALL_EXCEPTION,{method:e.format(),errorArgs:i,errorName:s,errorSignature:a,reason:r})}encodeFunctionResult(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,o.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&p.throwError("too many arguments for "+e.format(),d.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let n=[];e.anonymous||n.push(this.getEventTopic(e));const r=(e,t)=>"string"===e.type?(0,s.id)(t):"bytes"===e.type?(0,a.keccak256)((0,o.hexlify)(t)):("address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,o.hexZeroPad)((0,o.hexlify)(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?p.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((e=>r(o,e)))):n.push(r(o,t)):null!=t&&p.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(e,t){"string"===typeof e&&(e=this.getEvent(e));const n=[],r=[],i=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&p.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const c=t[o];if(e.indexed)if("string"===e.type)n.push((0,s.id)(c));else if("bytes"===e.type)n.push((0,a.keccak256)(c));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([e.type],[c]))}else r.push(e),i.push(c)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(e,t,n){if("string"===typeof e&&(e=this.getEvent(e)),null!=n&&!e.anonymous){let t=this.getEventTopic(e);(0,o.isHexString)(n[0],32)&&n[0].toLowerCase()===t||p.throwError("fragment/topic mismatch",d.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:n[0]}),n=n.slice(1)}let r=[],i=[],s=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(r.push(l._R.fromObject({type:"bytes32",name:e.name})),s.push(!0)):(r.push(e),s.push(!1)):(i.push(e),s.push(!1))}));let a=null!=n?this._abiCoder.decode(r,(0,o.concat)(n)):null,c=this._abiCoder.decode(i,t,!0),u=[],f=0,h=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)u[t]=new y({_isIndexed:!0,hash:null});else if(s[t])u[t]=new y({_isIndexed:!0,hash:a[h++]});else try{u[t]=a[h++]}catch(n){u[t]=n}else try{u[t]=c[f++]}catch(n){u[t]=n}if(e.name&&null==u[e.name]){const n=u[t];n instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:()=>{throw v(`property ${JSON.stringify(e.name)}`,n)}}):u[e.name]=n}}));for(let o=0;o{throw v(`index ${o}`,e)}})}return Object.freeze(u)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new m({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:i.O$.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new h({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=(0,o.hexlify)(e);let n=this.getError(t.substring(0,10).toLowerCase());return n?new g({args:this._abiCoder.decode(n.inputs,"0x"+t.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!(!e||!e._isInterface)}}},64758:function(e,t,n){"use strict";n.d(t,{E:function(){return u},b:function(){return l}});var r=n(6881),i=n(1581);var o=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const s=new i.Logger("abstract-signer/5.5.0"),a=["accessList","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],c=[i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED];class u{constructor(){s.checkAbstract(new.target,u),(0,r.defineReadOnly)(this,"_isSigner",!0)}getBalance(e){return o(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return o(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return o(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield(0,r.resolveProperties)(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return o(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield(0,r.resolveProperties)(this.checkTransaction(e));return yield this.provider.call(n,t)}))}sendTransaction(e){return o(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),n=yield this.signTransaction(t);return yield this.provider.sendTransaction(n)}))}getChainId(){return o(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return o(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return o(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return o(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const n in e)-1===a.indexOf(n)&&s.throwArgumentError("invalid transaction key: "+n,"transaction",e);const t=(0,r.shallowCopy)(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&s.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return o(this,void 0,void 0,(function*(){const t=yield(0,r.resolveProperties)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>o(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&s.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const n=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!n?0!==t.type&&1!==t.type||!n||s.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):s.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(n&&s.throwError("network does not support EIP-1559",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):s.throwError("failed to get consistent fee data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(c.indexOf(e.code)>=0)throw e;return s.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&s.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield(0,r.resolveProperties)(t)}))}_checkProvider(e){this.provider||s.throwError("missing provider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class l extends u{constructor(e,t){s.checkNew(new.target,l),super(),(0,r.defineReadOnly)(this,"address",e),(0,r.defineReadOnly)(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{s.throwError(e,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new l(this.address,e)}}},46126:function(e,t,n){"use strict";n.r(t),n.d(t,{getAddress:function(){return p},getContractAddress:function(){return g},getCreate2Address:function(){return y},getIcapAddress:function(){return m},isAddress:function(){return h}});var r=n(45703),i=n(91747),o=n(9341),s=n(48644);const a=new(n(1581).Logger)("address/5.5.0");function c(e){(0,r.isHexString)(e,20)||a.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let r=0;r<40;r++)n[r]=t[r].charCodeAt(0);const i=(0,r.arrayify)((0,o.keccak256)(n));for(let r=0;r<40;r+=2)i[r>>1]>>4>=8&&(t[r]=t[r].toUpperCase()),(15&i[r>>1])>=8&&(t[r+1]=t[r+1].toUpperCase());return"0x"+t.join("")}const u={};for(let b=0;b<10;b++)u[String(b)]=String(b);for(let b=0;b<26;b++)u[String.fromCharCode(65+b)]=String(10+b);const l=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/Math.LN10));var d;function f(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>u[e])).join("");for(;t.length>=l;){let e=t.substring(0,l);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}function p(e){let t=null;if("string"!==typeof e&&a.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=c(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&a.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==f(e)&&a.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=c("0x"+t)}else a.throwArgumentError("invalid address","address",e);return t}function h(e){try{return p(e),!0}catch(t){}return!1}function m(e){let t=(0,i.t2)(p(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+f("XE00"+t)+t}function g(e){let t=null;try{t=p(e.from)}catch(c){a.throwArgumentError("missing from address","transaction",e)}const n=(0,r.stripZeros)((0,r.arrayify)(i.O$.from(e.nonce).toHexString()));return p((0,r.hexDataSlice)((0,o.keccak256)((0,s.encode)([t,n])),12))}function y(e,t,n){return 32!==(0,r.hexDataLength)(t)&&a.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,r.hexDataLength)(n)&&a.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",n),p((0,r.hexDataSlice)((0,o.keccak256)((0,r.concat)(["0xff",p(e),t,n])),12))}},58037:function(e,t,n){"use strict";n.r(t),n.d(t,{decode:function(){return i},encode:function(){return o}});var r=n(45703);function i(e){e=atob(e);const t=[];for(let n=0;n0&&(10===arguments[0]?p||(p=!0,u.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?u.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):u.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),y(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof h)return e;if("string"===typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new h(l,m(e)):e.match(/^-?[0-9]+$/)?new h(l,m(new c(e))):u.throwArgumentError("invalid BigNumber string","value",e);if("number"===typeof e)return e%1&&b("underflow","BigNumber.from",e),(e>=d||e<=-d)&&b("overflow","BigNumber.from",e),h.from(String(e));const t=e;if("bigint"===typeof t)return h.from(t.toString());if((0,o.isBytes)(t))return h.from((0,o.hexlify)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"===typeof e)return h.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"===typeof e&&((0,o.isHexString)(e)||"-"===e[0]&&(0,o.isHexString)(e.substring(1))))return h.from(e)}return u.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function m(e){if("string"!==typeof e)return m(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&u.throwArgumentError("invalid hex","value",e),"0x00"===(e=m(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function g(e){return h.from(m(e))}function y(e){const t=h.from(e).toHexString();return"-"===t[0]?new c("-"+t.substring(3),16):new c(t.substring(2),16)}function b(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),u.throwError(e,s.Logger.errors.NUMERIC_FAULT,r)}function v(e){return new c(e,36).toString(16)}function w(e){return new c(e,16).toString(36)}},43698:function(e,t,n){"use strict";n.d(t,{xs:function(){return y}});var r=n(45703),i=n(1581),o=n(90099),s=n(91747);const a=new i.Logger(o.i),c={},u=s.O$.from(0),l=s.O$.from(-1);function d(e,t,n,r){const o={fault:t,operation:n};return void 0!==r&&(o.value=r),a.throwError(e,i.Logger.errors.NUMERIC_FAULT,o)}let f="0";for(;f.length<256;)f+=f;function p(e){if("number"!==typeof e)try{e=s.O$.from(e).toNumber()}catch(t){}return"number"===typeof e&&e>=0&&e<=256&&!(e%1)?"1"+f.substring(0,e):a.throwArgumentError("invalid decimal size","decimals",e)}function h(e,t){null==t&&(t=0);const n=p(t),r=(e=s.O$.from(e)).lt(u);r&&(e=e.mul(l));let i=e.mod(n).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",e);let o=i[0],c=i[1];for(o||(o="0"),c||(c="0");"0"===c[c.length-1];)c=c.substring(0,c.length-1);for(c.length>n.length-1&&d("fractional component exceeds decimals","underflow","parseFixed"),""===c&&(c="0");c.lengthnull==e[t]?r:(typeof e[t]!==n&&a.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new g(c,t,n,r)}}class y{constructor(e,t,n,r){a.checkNew(new.target,y),e!==c&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),n=m(e._value,e.format.decimals);return y.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(b.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(b.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&a.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=y.from("1"+f.substring(0,e),this.format),r=v.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&a.throwArgumentError("invalid byte width","width",e);const t=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,r.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return y.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||(0,s.Zm)(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),y.fromString(h(e,t),g.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=g.from(t),i=m(e,n.decimals);!n.signed&&i.lt(u)&&d("unsigned value cannot be negative","overflow","value",e);let o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=(0,r.hexZeroPad)(o,n.width/8));const s=h(i,n.decimals);return new y(c,o,s,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=g.from(t);if((0,r.arrayify)(e).length>n.width/8)throw new Error("overflow");let i=s.O$.from(e);n.signed&&(i=i.fromTwos(n.width));const o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=h(i,n.decimals);return new y(c,o,a,n)}static from(e,t){if("string"===typeof e)return y.fromString(e,t);if((0,r.isBytes)(e))return y.fromBytes(e,t);try{return y.fromValue(e,0,t)}catch(n){if(n.code!==i.Logger.errors.INVALID_ARGUMENT)throw n}return a.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const b=y.from(1),v=y.from("0.5")},45703:function(e,t,n){"use strict";n.r(t),n.d(t,{arrayify:function(){return u},concat:function(){return l},hexConcat:function(){return b},hexDataLength:function(){return g},hexDataSlice:function(){return y},hexStripZeros:function(){return w},hexValue:function(){return v},hexZeroPad:function(){return x},hexlify:function(){return m},isBytes:function(){return c},isBytesLike:function(){return s},isHexString:function(){return p},joinSignature:function(){return E},splitSignature:function(){return A},stripZeros:function(){return d},zeroPad:function(){return f}});const r=new(n(1581).Logger)("bytes/5.5.0");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function s(e){return p(e)&&!(e.length%2)||c(e)}function a(e){return"number"===typeof e&&e==e&&e%1===0}function c(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!a(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function u(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),o(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),p(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0x0"+n.substring(2):"right"===t.hexPad?n+="0":r.throwArgumentError("hex data is odd-length","value",e));const i=[];for(let e=0;eu(e))),n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),o(r)}function d(e){let t=u(e);if(0===t.length)return t;let n=0;for(;nt&&r.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),o(n)}function p(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const h="0123456789abcdef";function m(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(p(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":r.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(c(e)){let t="0x";for(let n=0;n>4]+h[15&r]}return t}return r.throwArgumentError("invalid hexlify value","value",e)}function g(e){if("string"!==typeof e)e=m(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function y(e,t,n){return"string"!==typeof e?e=m(e):(!p(e)||e.length%2)&&r.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function b(e){let t="0x";return e.forEach((e=>{t+=m(e).substring(2)})),t}function v(e){const t=w(m(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function w(e){"string"!==typeof e&&(e=m(e)),p(e)||r.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&r.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function A(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(s(e)){const n=u(e);65!==n.length&&r.throwArgumentError("invalid signature string; must be 65 bytes","signature",e),t.r=m(n.slice(0,32)),t.s=m(n.slice(32,64)),t.v=n[64],t.v<27&&(0===t.v||1===t.v?t.v+=27:r.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=m(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=f(u(t._vs),32);t._vs=m(n);const i=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&r.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const o=m(n);null==t.s?t.s=o:t.s!==o&&r.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?r.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&r.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&p(t.r)?t.r=x(t.r,32):r.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&p(t.s)?t.s=x(t.s,32):r.throwArgumentError("signature missing or invalid s","signature",e);const n=u(t.s);n[0]>=128&&r.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const i=m(n);t._vs&&(p(t._vs)||r.throwArgumentError("signature invalid _vs","signature",e),t._vs=x(t._vs,32)),null==t._vs?t._vs=i:t._vs!==i&&r.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t}function E(e){return m(l([(e=A(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},11466:function(e,t,n){"use strict";n.d(t,{VZ:function(){return S},CH:function(){return C},lV:function(){return I}});var r=n(67072),i=n(39786),o=n(38190),s=n(64758),a=n(46126),c=n(91747),u=n(45703),l=n(6881),d=n(3451),f=n(1581);var p=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const h=new f.Logger("contracts/5.5.0"),m={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0};function g(e,t){return p(this,void 0,void 0,(function*(){const n=yield t;"string"!==typeof n&&h.throwArgumentError("invalid address or ENS name","name",n);try{return(0,a.getAddress)(n)}catch(i){}e||h.throwError("a provider or signer is needed to resolve ENS names",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield e.resolveName(n);return null==r&&h.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r}))}function y(e,t,n){return p(this,void 0,void 0,(function*(){return Array.isArray(n)?yield Promise.all(n.map(((n,r)=>y(e,Array.isArray(t)?t[r]:t[n.name],n)))):"address"===n.type?yield g(e,t):"tuple"===n.type?yield y(e,t,n.components):"array"===n.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>y(e,t,n.arrayChildren)))):Promise.reject(h.makeError("invalid value for array",f.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function b(e,t,n){return p(this,void 0,void 0,(function*(){let r={};n.length===t.inputs.length+1&&"object"===typeof n[n.length-1]&&(r=(0,l.shallowCopy)(n.pop())),h.checkArgumentCount(n.length,t.inputs.length,"passed to contract"),e.signer?r.from?r.from=(0,l.resolveProperties)({override:g(e.signer,r.from),signer:e.signer.getAddress()}).then((e=>p(this,void 0,void 0,(function*(){return(0,a.getAddress)(e.signer)!==e.override&&h.throwError("Contract with a Signer cannot override from",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):r.from=e.signer.getAddress():r.from&&(r.from=g(e.provider,r.from));const i=yield(0,l.resolveProperties)({args:y(e.signer||e.provider,n,t.inputs),address:e.resolvedAddress,overrides:(0,l.resolveProperties)(r)||{}}),o=e.interface.encodeFunctionData(t,i.args),s={data:o,to:i.address},m=i.overrides;if(null!=m.nonce&&(s.nonce=c.O$.from(m.nonce).toNumber()),null!=m.gasLimit&&(s.gasLimit=c.O$.from(m.gasLimit)),null!=m.gasPrice&&(s.gasPrice=c.O$.from(m.gasPrice)),null!=m.maxFeePerGas&&(s.maxFeePerGas=c.O$.from(m.maxFeePerGas)),null!=m.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=c.O$.from(m.maxPriorityFeePerGas)),null!=m.from&&(s.from=m.from),null!=m.type&&(s.type=m.type),null!=m.accessList&&(s.accessList=(0,d.accessListify)(m.accessList)),null==s.gasLimit&&null!=t.gas){let e=21e3;const n=(0,u.arrayify)(o);for(let t=0;tnull!=r[e]));return b.length&&h.throwError(`cannot override ${b.map((e=>JSON.stringify(e))).join(",")}`,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:b}),s}))}function v(e,t){const n=t.wait.bind(t);t.wait=t=>n(t).then((t=>(t.events=t.logs.map((n=>{let r=(0,l.deepCopy)(n),i=null;try{i=e.interface.parseLog(n)}catch(o){}return i&&(r.args=i.args,r.decode=(t,n)=>e.interface.decodeEventLog(i.eventFragment,t,n),r.event=i.name,r.eventSignature=i.signature),r.removeListener=()=>e.provider,r.getBlock=()=>e.provider.getBlock(t.blockHash),r.getTransaction=()=>e.provider.getTransaction(t.transactionHash),r.getTransactionReceipt=()=>Promise.resolve(t),r})),t)))}function w(e,t,n){const r=e.signer||e.provider;return function(...i){return p(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"===typeof i[i.length-1]){const e=(0,l.shallowCopy)(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const s=yield b(e,t,i),a=yield r.call(s,o);try{let r=e.interface.decodeFunctionResult(t,a);return n&&1===t.outputs.length&&(r=r[0]),r}catch(c){throw c.code===f.Logger.errors.CALL_EXCEPTION&&(c.address=e.address,c.args=i,c.transaction=s),c}}))}}function x(e,t,n){return t.constant?w(e,t,n):function(e,t){return function(...n){return p(this,void 0,void 0,(function*(){e.signer||h.throwError("sending a transaction requires a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const r=yield b(e,t,n),i=yield e.signer.sendTransaction(r);return v(e,i),i}))}}(e,t)}function A(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class E{constructor(e,t){(0,l.defineReadOnly)(this,"tag",e),(0,l.defineReadOnly)(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((n=>!(!t&&n.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const n=e.slice();return setTimeout((()=>{t.listener.apply(this,n)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class _ extends E{constructor(){super("error",null)}}class k extends E{constructor(e,t,n,r){const i={address:e};let o=t.getEventTopic(n);r?(o!==r[0]&&h.throwArgumentError("topic mismatch","topics",r),i.topics=r.slice()):i.topics=[o],super(A(i),i),(0,l.defineReadOnly)(this,"address",e),(0,l.defineReadOnly)(this,"interface",t),(0,l.defineReadOnly)(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=(0,r.BR)(e.args);if(t.length)throw t[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class T extends E{constructor(e,t){super("*",{address:e}),(0,l.defineReadOnly)(this,"address",e),(0,l.defineReadOnly)(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,n)=>this.interface.decodeEventLog(t.eventFragment,e,n),e.args=t.args}catch(t){}}}class S{constructor(e,t,n){h.checkNew(new.target,C),(0,l.defineReadOnly)(this,"interface",(0,l.getStatic)(new.target,"getInterface")(t)),null==n?((0,l.defineReadOnly)(this,"provider",null),(0,l.defineReadOnly)(this,"signer",null)):s.E.isSigner(n)?((0,l.defineReadOnly)(this,"provider",n.provider||null),(0,l.defineReadOnly)(this,"signer",n)):o.zt.isProvider(n)?((0,l.defineReadOnly)(this,"provider",n),(0,l.defineReadOnly)(this,"signer",null)):h.throwArgumentError("invalid signer or provider","signerOrProvider",n),(0,l.defineReadOnly)(this,"callStatic",{}),(0,l.defineReadOnly)(this,"estimateGas",{}),(0,l.defineReadOnly)(this,"functions",{}),(0,l.defineReadOnly)(this,"populateTransaction",{}),(0,l.defineReadOnly)(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const n=this.interface.events[t];(0,l.defineReadOnly)(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(n,e)}))),e[n.name]||(e[n.name]=[]),e[n.name].push(t)})),Object.keys(e).forEach((t=>{const n=e[t];1===n.length?(0,l.defineReadOnly)(this.filters,t,this.filters[n[0]]):h.warn(`Duplicate definition of ${t} (${n.join(", ")})`)}))}if((0,l.defineReadOnly)(this,"_runningEvents",{}),(0,l.defineReadOnly)(this,"_wrappedEmits",{}),null==e&&h.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,l.defineReadOnly)(this,"address",e),this.provider)(0,l.defineReadOnly)(this,"resolvedAddress",g(this.provider,e));else try{(0,l.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,a.getAddress)(e)))}catch(c){h.throwError("provider is required to use ENS name as contract address",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}const r={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])h.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const n=t.name;r[`%${n}`]||(r[`%${n}`]=[]),r[`%${n}`].push(e)}null==this[e]&&(0,l.defineReadOnly)(this,e,x(this,t,!0)),null==this.functions[e]&&(0,l.defineReadOnly)(this.functions,e,x(this,t,!1)),null==this.callStatic[e]&&(0,l.defineReadOnly)(this.callStatic,e,w(this,t,!0)),null==this.populateTransaction[e]&&(0,l.defineReadOnly)(this.populateTransaction,e,function(e,t){return function(...n){return b(e,t,n)}}(this,t)),null==this.estimateGas[e]&&(0,l.defineReadOnly)(this.estimateGas,e,function(e,t){const n=e.signer||e.provider;return function(...r){return p(this,void 0,void 0,(function*(){n||h.throwError("estimate require a provider or signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield b(e,t,r);return yield n.estimateGas(i)}))}}(this,t))}})),Object.keys(r).forEach((e=>{const t=r[e];if(t.length>1)return;e=e.substring(1);const n=t[0];try{null==this[e]&&(0,l.defineReadOnly)(this,e,this[n])}catch(i){}null==this.functions[e]&&(0,l.defineReadOnly)(this.functions,e,this.functions[n]),null==this.callStatic[e]&&(0,l.defineReadOnly)(this.callStatic,e,this.callStatic[n]),null==this.populateTransaction[e]&&(0,l.defineReadOnly)(this.populateTransaction,e,this.populateTransaction[n]),null==this.estimateGas[e]&&(0,l.defineReadOnly)(this.estimateGas,e,this.estimateGas[n])}))}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getInterface(e){return i.vU.isInterface(e)?e:new i.vU(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&h.throwError("contract not deployed",f.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||h.throwError("sending a transactions require a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=(0,l.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=t[e]&&h.throwError("cannot override "+e,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"===typeof e&&(e=new s.b(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,l.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return i.Hk.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"===typeof e){if("error"===e)return this._normalizeRunningEvent(new _);if("event"===e)return this._normalizeRunningEvent(new E("event",null));if("*"===e)return this._normalizeRunningEvent(new T(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new k(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!==typeof t)throw new Error("invalid topic");const n=this.interface.getEvent(t);return this._normalizeRunningEvent(new k(this.address,this.interface,n,e.topics))}catch(t){}const n={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new E(A(n),n))}return this._normalizeRunningEvent(new T(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,n){const r=(0,l.deepCopy)(t);return r.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},r.getBlock=()=>this.provider.getBlock(t.blockHash),r.getTransaction=()=>this.provider.getTransaction(t.transactionHash),r.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(r),r}_addEventListener(e,t,n){if(this.provider||h.throwError("events require a provider or a signer with a provider",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const n=n=>{let r=this._wrapEvent(e,n,t);if(null==r.decodeError)try{const t=e.getEmit(r);this.emit(e.filter,...t)}catch(i){r.decodeError=i.error}null!=e.filter&&this.emit("event",r),null!=r.decodeError&&this.emit("error",r.decodeError,r)};this._wrappedEmits[e.tag]=n,null!=e.filter&&this.provider.on(e.filter,n)}}queryFilter(e,t,n){const r=this._getRunningEvent(e),i=(0,l.shallowCopy)(r.filter);return"string"===typeof t&&(0,u.isHexString)(t,32)?(null!=n&&h.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(r,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const n=this._getRunningEvent(e),r=n.run(t)>0;return this._checkRunningEvents(n),r}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(t),this._checkRunningEvents(n),this}removeListener(e,t){return this.off(e,t)}}class C extends S{}class I{constructor(e,t,n){let r=null;r="string"===typeof t?t:(0,u.isBytes)(t)?(0,u.hexlify)(t):t&&"string"===typeof t.object?t.object:"!","0x"!==r.substring(0,2)&&(r="0x"+r),(!(0,u.isHexString)(r)||r.length%2)&&h.throwArgumentError("invalid bytecode","bytecode",t),n&&!s.E.isSigner(n)&&h.throwArgumentError("invalid signer","signer",n),(0,l.defineReadOnly)(this,"bytecode",r),(0,l.defineReadOnly)(this,"interface",(0,l.getStatic)(new.target,"getInterface")(e)),(0,l.defineReadOnly)(this,"signer",n||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"===typeof e[e.length-1]){t=(0,l.shallowCopy)(e.pop());for(const e in t)if(!m[e])throw new Error("unknown transaction override "+e)}if(["data","from","to"].forEach((e=>{null!=t[e]&&h.throwError("cannot override "+e,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value){c.O$.from(t.value).isZero()||this.interface.deploy.payable||h.throwError("non-payable constructor cannot override value",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return h.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=(0,u.hexlify)((0,u.concat)([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return p(this,void 0,void 0,(function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),h.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const n=yield y(this.signer,e,this.interface.deploy.inputs);n.push(t);const r=this.getDeployTransaction(...n),i=yield this.signer.sendTransaction(r),o=(0,l.getStatic)(this.constructor,"getContractAddress")(i),s=(0,l.getStatic)(this.constructor,"getContract")(o,this.interface,this.signer);return v(s,i),(0,l.defineReadOnly)(s,"deployTransaction",i),s}))}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,t){null==e&&h.throwError("missing compiler output",f.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"===typeof e&&(e=JSON.parse(e));const n=e.abi;let r=null;return e.bytecode?r=e.bytecode:e.evm&&e.evm.bytecode&&(r=e.evm.bytecode),new this(n,r,t)}static getInterface(e){return C.getInterface(e)}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getContract(e,t,n){return new C(e,t,n)}}},46352:function(e,t,n){"use strict";n.r(t),n.d(t,{keccak256:function(){return m},pack:function(){return h},sha256:function(){return g}});var r=n(91747),i=n(45703),o=n(9341),s=n(90229),a=n(29251),c=n(1581);const u=new RegExp("^bytes([0-9]+)$"),l=new RegExp("^(u?int)([0-9]*)$"),d=new RegExp("^(.*)\\[([0-9]*)\\]$"),f=new c.Logger("solidity/5.5.0");function p(e,t,n){switch(e){case"address":return n?(0,i.zeroPad)(t,32):(0,i.arrayify)(t);case"string":return(0,a.Y0)(t);case"bytes":return(0,i.arrayify)(t);case"bool":return t=t?"0x01":"0x00",n?(0,i.zeroPad)(t,32):(0,i.arrayify)(t)}let o=e.match(l);if(o){let s=parseInt(o[2]||"256");return(o[2]&&String(s)!==o[2]||s%8!==0||0===s||s>256)&&f.throwArgumentError("invalid number type","type",e),n&&(s=256),t=r.O$.from(t).toTwos(s),(0,i.zeroPad)(t,s/8)}if(o=e.match(u),o){const r=parseInt(o[1]);return(String(r)!==o[1]||0===r||r>32)&&f.throwArgumentError("invalid bytes type","type",e),(0,i.arrayify)(t).byteLength!==r&&f.throwArgumentError(`invalid value for ${e}`,"value",t),n?(0,i.arrayify)((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t}if(o=e.match(d),o&&Array.isArray(t)){const n=o[1];parseInt(o[2]||String(t.length))!=t.length&&f.throwArgumentError(`invalid array length for ${e}`,"value",t);const r=[];return t.forEach((function(e){r.push(p(n,e,!0))})),(0,i.concat)(r)}return f.throwArgumentError("invalid type","type",e)}function h(e,t){e.length!=t.length&&f.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const n=[];return e.forEach((function(e,r){n.push(p(e,t[r]))})),(0,i.hexlify)((0,i.concat)(n))}function m(e,t){return(0,o.keccak256)(h(e,t))}function g(e,t){return(0,s.JQ)(h(e,t))}},81502:function(e,t,n){"use strict";n.r(t),n.d(t,{Wallet:function(){return w},verifyMessage:function(){return x},verifyTypedData:function(){return A}});var r=n(46126),i=n(38190),o=n(64758),s=n(45703),a=n(93684),c=n(34120),u=n(84204),l=n(9341),d=n(6881),f=n(66869),p=n(43705),h=n(64341),m=n(81964),g=n(3451),y=n(1581);var b=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const v=new y.Logger("wallet/5.5.0");class w extends o.E{constructor(e,t){if(v.checkNew(new.target,w),super(),null!=(n=e)&&(0,s.isHexString)(n.privateKey,32)&&null!=n.address){const t=new p.SigningKey(e.privateKey);if((0,d.defineReadOnly)(this,"_signingKey",(()=>t)),(0,d.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey)),this.address!==(0,r.getAddress)(e.address)&&v.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;(0,d.defineReadOnly)(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||u.defaultPath,locale:t.locale||"en"})));const n=this.mnemonic,r=u.HDNode.fromMnemonic(n.phrase,null,n.locale).derivePath(n.path);(0,g.computeAddress)(r.privateKey)!==this.address&&v.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,d.defineReadOnly)(this,"_mnemonic",(()=>null))}else{if(p.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&v.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,d.defineReadOnly)(this,"_signingKey",(()=>e));else{"string"===typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new p.SigningKey(e);(0,d.defineReadOnly)(this,"_signingKey",(()=>t))}(0,d.defineReadOnly)(this,"_mnemonic",(()=>null)),(0,d.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey))}var n;t&&!i.zt.isProvider(t)&&v.throwArgumentError("invalid provider","provider",t),(0,d.defineReadOnly)(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new w(this,e)}signTransaction(e){return(0,d.resolveProperties)(e).then((t=>{null!=t.from&&((0,r.getAddress)(t.from)!==this.address&&v.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const n=this._signingKey().signDigest((0,l.keccak256)((0,g.serialize)(t)));return(0,g.serialize)(t,n)}))}signMessage(e){return b(this,void 0,void 0,(function*(){return(0,s.joinSignature)(this._signingKey().signDigest((0,a.r)(e)))}))}_signTypedData(e,t,n){return b(this,void 0,void 0,(function*(){const r=yield c.E.resolveNames(e,t,n,(e=>(null==this.provider&&v.throwError("cannot resolve ENS names without a provider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return(0,s.joinSignature)(this._signingKey().signDigest(c.E.hash(r.domain,t,r.value)))}))}encrypt(e,t,n){if("function"!==typeof t||n||(n=t,t={}),n&&"function"!==typeof n)throw new Error("invalid callback");return t||(t={}),(0,m.HI)(this,e,t,n)}static createRandom(e){let t=(0,f.O)(16);e||(e={}),e.extraEntropy&&(t=(0,s.arrayify)((0,s.hexDataSlice)((0,l.keccak256)((0,s.concat)([t,e.extraEntropy])),0,16)));const n=(0,u.entropyToMnemonic)(t,e.locale);return w.fromMnemonic(n,e.path,e.locale)}static fromEncryptedJson(e,t,n){return(0,h.decryptJsonWallet)(e,t,n).then((e=>new w(e)))}static fromEncryptedJsonSync(e,t){return new w((0,h.decryptJsonWalletSync)(e,t))}static fromMnemonic(e,t,n){return t||(t=u.defaultPath),new w(u.HDNode.fromMnemonic(e,null,n).derivePath(t))}}function x(e,t){return(0,g.recoverAddress)((0,a.r)(e),t)}function A(e,t,n,r){return(0,g.recoverAddress)(c.E.hash(e,t,n),r)}},26729:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,s){if("function"!==typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"===typeof c)r(c,this,t);else{var u=c.length,l=h(c,u);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},33715:function(e,t,n){var r=t;r.utils=n(26436),r.common=n(95772),r.sha=n(89041),r.ripemd=n(12949),r.hmac=n(52344),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},95772:function(e,t,n){"use strict";var r=n(26436),i=n(79746);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},26436:function(e,t,n){"use strict";var r=n(79746),i=n(35717);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i>6|192,n[r++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(i=0;i>>0}return s},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,s=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,o,s,a){var c=0,u=t;return c+=(u=u+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,i,o,s,a){return t+r+o+a>>>0},t.sum64_5_hi=function(e,t,n,r,i,o,s,a,c,u){var l=0,d=t;return l+=(d=d+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,i,o,s,a,c,u){return t+r+o+a+u>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},8679:function(e,t,n){"use strict";var r=n(21296),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(e){return r.isMemo(e)?s:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var u=Object.defineProperty,l=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var i=p(n);i&&i!==h&&e(t,i,r)}var s=l(n);d&&(s=s.concat(d(n)));for(var a=c(t),m=c(n),g=0;g>1,l=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=u}return(p?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+p]=255&a,p+=h,a/=256,i-=8);for(s=s<0;e[n+p]=255&s,p+=h,s/=256,u-=8);e[n+p-h]|=128*m}},35717:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},31198:function(e,t,n){"use strict";const r=n(74880).v4,i=n(17741),o=function(e,t){if(!(this instanceof o))return new o(e,t);t||(t={}),this.options={reviver:"undefined"!==typeof t.reviver?t.reviver:null,replacer:"undefined"!==typeof t.replacer?t.replacer:null,generator:"undefined"!==typeof t.generator?t.generator:function(){return r()},version:"undefined"!==typeof t.version?t.version:2,notificationIdNull:"boolean"===typeof t.notificationIdNull&&t.notificationIdNull},this.callServer=e};e.exports=o,o.prototype.request=function(e,t,n,r){const o=this;let s=null;const a=Array.isArray(e)&&"function"===typeof t;if(1===this.options.version&&a)throw new TypeError("JSON-RPC 1.0 does not support batching");if(a||!a&&e&&"object"===typeof e&&"function"===typeof t)r=t,s=e;else{"function"===typeof n&&(r=n,n=void 0);const o="function"===typeof r;try{s=i(e,t,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(u){if(o)return r(u);throw u}if(!o)return s}let c;try{c=JSON.stringify(s,this.options.replacer)}catch(u){return r(u)}return this.callServer(c,(function(e,t){o._parseResponse(e,t,r)})),s},o.prototype._parseResponse=function(e,t,n){if(e)return void n(e);if(!t)return n();let r;try{r=JSON.parse(t,this.options.reviver)}catch(e){return n(e)}if(3===n.length){if(Array.isArray(r)){const e=function(e){return"undefined"!==typeof e.error},t=function(t){return!e(t)};return n(null,r.filter(e),r.filter(t))}return n(null,r.error,r.result)}n(null,r)}},17741:function(e,t,n){"use strict";const r=n(74880).v4;e.exports=function(e,t,n,i){if("string"!==typeof e)throw new TypeError(e+" must be a string");const o="number"===typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw new TypeError(o+" must be 1 or 2");const s={method:e};if(2===o&&(s.jsonrpc="2.0"),t){if("object"!==typeof t&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");s.params=t}if("undefined"===typeof n){const e="function"===typeof i.generator?i.generator:function(){return r()};s.id=e(s,i)}else 2===o&&null===n?i.notificationIdNull&&(s.id=null):s.id=n;return s}},91094:function(e,t,n){var r,i=n(83454);!function(){"use strict";var o="input is invalid type",s="object"===typeof window,a=s?window:{};a.JS_SHA3_NO_WINDOW&&(s=!1);var c=!s&&"object"===typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"===typeof i&&i.versions&&i.versions.node?a=n.g:c&&(a=self);var u=!a.JS_SHA3_NO_COMMON_JS&&e.exports,l=n.amdO,d=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,f="0123456789abcdef".split(""),p=[4,1024,262144,67108864],h=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],g=[224,256,384,512],y=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!d||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var w=function(e,t,n){return function(r){return new M(e,t,e).update(r)[n]()}},x=function(e,t,n){return function(r,i){return new M(e,t,i).update(r)[n]()}},A=function(e,t,n){return function(t,r,i,o){return S["cshake"+e].update(t,r,i,o)[n]()}},E=function(e,t,n){return function(t,r,i,o){return S["kmac"+e].update(t,r,i,o)[n]()}},_=function(e,t,n,r){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function N(e,t,n){M.call(this,e,t,n)}M.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(o);if(null===e)throw new Error(o);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!d||!ArrayBuffer.isView(e)))throw new Error(o);t=!0}for(var r,i,s=this.blocks,a=this.byteCount,c=e.length,u=this.blockCount,l=0,f=this.s;l>2]|=e[l]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},M.prototype.encodeString=function(e){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(o);if(null===e)throw new Error(o);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!d||!ArrayBuffer.isView(e)))throw new Error(o);t=!0}var r=0,i=e.length;if(t)r=i;else for(var s=0;s=57344?r+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),r+=4)}return r+=this.encode(8*r),this.update(e),r},M.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];s%t===0&&(F(n),o=0)}return i&&(e=n[o],a+=f[e>>4&15]+f[15&e],i>1&&(a+=f[e>>12&15]+f[e>>8&15]),i>2&&(a+=f[e>>20&15]+f[e>>16&15])),a},M.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(e);s>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;a%n===0&&F(r)}return o&&(e=a<<2,t=r[s],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},N.prototype=new M,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),M.prototype.finalize.call(this)};var F=function(e){var t,n,r,i,o,s,a,c,u,l,d,f,p,h,g,y,b,v,w,x,A,E,_,k,T,S,C,I,O,R,D,P,B,M,N,F,L,j,U,Z,H,z,G,V,W,q,$,K,Y,X,J,Q,ee,te,ne,re,ie,oe,se,ae,ce,ue,le;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),n=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(c<<1|u>>>31),n=o^(u<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=s^(l<<1|d>>>31),n=a^(d<<1|l>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(f<<1|p>>>31),n=u^(p<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=l^(i<<1|o>>>31),n=d^(o<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,h=e[0],g=e[1],q=e[11]<<4|e[10]>>>28,$=e[10]<<4|e[11]>>>28,I=e[20]<<3|e[21]>>>29,O=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,M=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,K=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,P=e[45]<<29|e[44]>>>3,B=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,T=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,A=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,S=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,Z=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,_=e[49]<<14|e[48]>>>18,e[0]=h^~y&v,e[1]=g^~b&w,e[10]=k^~S&I,e[11]=T^~C&O,e[20]=M^~F&j,e[21]=N^~L&U,e[30]=V^~q&K,e[31]=W^~$&Y,e[40]=te^~re&oe,e[41]=ne^~ie&se,e[2]=y^~v&x,e[3]=b^~w&A,e[12]=S^~I&R,e[13]=C^~O&D,e[22]=F^~j&Z,e[23]=L^~U&H,e[32]=q^~K&X,e[33]=$^~Y&J,e[42]=re^~oe&ae,e[43]=ie^~se&ce,e[4]=v^~x&E,e[5]=w^~A&_,e[14]=I^~R&P,e[15]=O^~D&B,e[24]=j^~Z&z,e[25]=U^~H&G,e[34]=K^~X&Q,e[35]=Y^~J&ee,e[44]=oe^~ae&ue,e[45]=se^~ce&le,e[6]=x^~E&h,e[7]=A^~_&g,e[16]=R^~P&k,e[17]=D^~B&T,e[26]=Z^~z&M,e[27]=H^~G&N,e[36]=X^~Q&V,e[37]=J^~ee&W,e[46]=ae^~ue&te,e[47]=ce^~le&ne,e[8]=E^~h&y,e[9]=_^~g&b,e[18]=P^~k&S,e[19]=B^~T&C,e[28]=z^~M&F,e[29]=G^~N&L,e[38]=Q^~V&q,e[39]=ee^~W&$,e[48]=ue^~te&re,e[49]=le^~ne&ie,e[0]^=m[r],e[1]^=m[r+1]};if(u)e.exports=S;else{for(I=0;I=t||n<0||g&&e-h>=l}function x(){var e=i();if(w(e))return A(e);f=setTimeout(x,function(e){var n=t-(e-p);return g?a(n,l-(e-h)):n}(e))}function A(e){return f=void 0,y&&c?b(e):(c=u=void 0,d)}function E(){var e=i(),n=w(e);if(c=arguments,u=this,p=e,n){if(void 0===f)return v(p);if(g)return clearTimeout(f),f=setTimeout(x,t),b(p)}return void 0===f&&(f=setTimeout(x,t)),d}return t=o(t)||0,r(n)&&(m=!!n.leading,l=(g="maxWait"in n)?s(o(n.maxWait)||0,t):l,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==f&&clearTimeout(f),h=0,c=p=u=f=void 0},E.flush=function(){return void 0===f?d:A(i())},E}},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},33448:function(e,t,n){var r=n(44239),i=n(37005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},96486:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",c=16,u=32,l=64,d=128,f=256,p=1/0,h=9007199254740991,m=NaN,g=4294967295,y=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",u],["partialRight",l],["rearg",f]],b="[object Arguments]",v="[object Array]",w="[object Boolean]",x="[object Date]",A="[object Error]",E="[object Function]",_="[object GeneratorFunction]",k="[object Map]",T="[object Number]",S="[object Object]",C="[object Promise]",I="[object RegExp]",O="[object Set]",R="[object String]",D="[object Symbol]",P="[object WeakMap]",B="[object ArrayBuffer]",M="[object DataView]",N="[object Float32Array]",F="[object Float64Array]",L="[object Int8Array]",j="[object Int16Array]",U="[object Int32Array]",Z="[object Uint8Array]",H="[object Uint8ClampedArray]",z="[object Uint16Array]",G="[object Uint32Array]",V=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Y=RegExp($.source),X=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),se=/^\s+/,ae=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,be=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,_e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ke="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Oe="['\u2019]",Re="[\\ud800-\\udfff]",De="["+Ie+"]",Pe="["+_e+"]",Be="\\d+",Me="[\\u2700-\\u27bf]",Ne="["+Te+"]",Fe="[^\\ud800-\\udfff"+Ie+Be+ke+Te+Se+"]",Le="\\ud83c[\\udffb-\\udfff]",je="[^\\ud800-\\udfff]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",Ze="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+Se+"]",ze="(?:"+Ne+"|"+Fe+")",Ge="(?:"+He+"|"+Fe+")",Ve="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",We="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Pe+"|"+Le+")"+"?",$e="[\\ufe0e\\ufe0f]?",Ke=$e+qe+("(?:\\u200d(?:"+[je,Ue,Ze].join("|")+")"+$e+qe+")*"),Ye="(?:"+[Me,Ue,Ze].join("|")+")"+Ke,Xe="(?:"+[je+Pe+"?",Pe,Ue,Ze,Re].join("|")+")",Je=RegExp(Oe,"g"),Qe=RegExp(Pe,"g"),et=RegExp(Le+"(?="+Le+")|"+Xe+Ke,"g"),tt=RegExp([He+"?"+Ne+"+"+Ve+"(?="+[De,He,"$"].join("|")+")",Ge+"+"+We+"(?="+[De,He+ze,"$"].join("|")+")",He+"?"+ze+"+"+Ve,He+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Be,Ye].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+_e+Ce+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,st={};st[N]=st[F]=st[L]=st[j]=st[U]=st[Z]=st[H]=st[z]=st[G]=!0,st[b]=st[v]=st[B]=st[w]=st[M]=st[x]=st[A]=st[E]=st[k]=st[T]=st[S]=st[I]=st[O]=st[R]=st[P]=!1;var at={};at[b]=at[v]=at[B]=at[M]=at[w]=at[x]=at[N]=at[F]=at[L]=at[j]=at[U]=at[k]=at[T]=at[S]=at[I]=at[O]=at[R]=at[D]=at[Z]=at[H]=at[z]=at[G]=!0,at[A]=at[E]=at[P]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,lt=parseInt,dt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=dt||ft||Function("return this")(),ht=t&&!t.nodeType&&t,mt=ht&&e&&!e.nodeType&&e,gt=mt&&mt.exports===ht,yt=gt&&dt.process,bt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||yt&&yt.binding&&yt.binding("util")}catch(t){}}(),vt=bt&&bt.isArrayBuffer,wt=bt&&bt.isDate,xt=bt&&bt.isMap,At=bt&&bt.isRegExp,Et=bt&&bt.isSet,_t=bt&&bt.isTypedArray;function kt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Tt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Dt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function tn(e,t){for(var n=e.length;n--&&Zt(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=Wt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),on=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ct[e]}function an(e){return nt.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function ln(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var yn=function e(t){var n=(t=null==t?pt:yn.defaults(pt.Object(),t,yn.pick(pt,it))).Array,r=t.Date,ae=t.Error,_e=t.Function,ke=t.Math,Te=t.Object,Se=t.RegExp,Ce=t.String,Ie=t.TypeError,Oe=n.prototype,Re=_e.prototype,De=Te.prototype,Pe=t["__core-js_shared__"],Be=Re.toString,Me=De.hasOwnProperty,Ne=0,Fe=function(){var e=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Le=De.toString,je=Be.call(Te),Ue=pt._,Ze=Se("^"+Be.call(Me).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=gt?t.Buffer:i,ze=t.Symbol,Ge=t.Uint8Array,Ve=He?He.allocUnsafe:i,We=un(Te.getPrototypeOf,Te),qe=Te.create,$e=De.propertyIsEnumerable,Ke=Oe.splice,Ye=ze?ze.isConcatSpreadable:i,Xe=ze?ze.iterator:i,et=ze?ze.toStringTag:i,nt=function(){try{var e=po(Te,"defineProperty");return e({},"",{}),e}catch(t){}}(),ct=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,dt=r&&r.now!==pt.Date.now&&r.now,ft=t.setTimeout!==pt.setTimeout&&t.setTimeout,ht=ke.ceil,mt=ke.floor,yt=Te.getOwnPropertySymbols,bt=He?He.isBuffer:i,Lt=t.isFinite,Wt=Oe.join,bn=un(Te.keys,Te),vn=ke.max,wn=ke.min,xn=r.now,An=t.parseInt,En=ke.random,_n=Oe.reverse,kn=po(t,"DataView"),Tn=po(t,"Map"),Sn=po(t,"Promise"),Cn=po(t,"Set"),In=po(t,"WeakMap"),On=po(Te,"create"),Rn=In&&new In,Dn={},Pn=Uo(kn),Bn=Uo(Tn),Mn=Uo(Sn),Nn=Uo(Cn),Fn=Uo(In),Ln=ze?ze.prototype:i,jn=Ln?Ln.valueOf:i,Un=Ln?Ln.toString:i;function Zn(e){if(ra(e)&&!Ws(e)&&!(e instanceof Vn)){if(e instanceof Gn)return e;if(Me.call(e,"__wrapped__"))return Zo(e)}return new Gn(e)}var Hn=function(){function e(){}return function(t){if(!na(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function zn(){}function Gn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ur(e,t,n,r,o,s){var a,c=1&t,u=2&t,l=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!na(e))return e;var d=Ws(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!c)return Oi(e,a)}else{var f=go(e),p=f==E||f==_;if(Ys(e))return _i(e,c);if(f==S||f==b||p&&!o){if(a=u||p?{}:bo(e),!c)return u?function(e,t){return Ri(e,mo(e),t)}(e,function(e,t){return e&&Ri(t,Ba(t),e)}(a,e)):function(e,t){return Ri(e,ho(e),t)}(e,or(a,e))}else{if(!at[f])return o?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case B:return ki(e);case w:case x:return new r(+e);case M:return function(e,t){var n=t?ki(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case F:case L:case j:case U:case Z:case H:case z:case G:return Ti(e,n);case k:return new r;case T:case R:return new r(e);case I:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new r;case D:return i=e,jn?Te(jn.call(i)):{}}var i}(e,f,c)}}s||(s=new Yn);var h=s.get(e);if(h)return h;s.set(e,a),ca(e)?e.forEach((function(r){a.add(ur(r,t,n,r,e,s))})):ia(e)&&e.forEach((function(r,i){a.set(i,ur(r,t,n,i,e,s))}));var m=d?i:(l?u?oo:io:u?Ba:Pa)(e);return St(m||e,(function(r,i){m&&(r=e[i=r]),nr(a,i,ur(r,t,n,i,e,s))})),a}function lr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Te(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function dr(e,t,n){if("function"!=typeof e)throw new Ie(o);return Po((function(){e.apply(i,n)}),t)}function fr(e,t,n,r){var i=-1,o=Rt,s=!0,a=e.length,c=[],u=t.length;if(!a)return c;n&&(t=Pt(t,Xt(n))),r?(o=Dt,s=!1):t.length>=200&&(o=Qt,s=!1,t=new Kn(t));e:for(;++i-1},qn.prototype.set=function(e,t){var n=this.__data__,r=rr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$n.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Tn||qn),string:new Wn}},$n.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},$n.prototype.get=function(e){return lo(this,e).get(e)},$n.prototype.has=function(e){return lo(this,e).has(e)},$n.prototype.set=function(e,t){var n=lo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(e){return this.__data__.set(e,s),this},Kn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new qn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof qn){var r=n.__data__;if(!Tn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $n(r)}return n.set(e,t),this.size=n.size,this};var pr=Bi(xr),hr=Bi(Ar,!0);function mr(e,t){var n=!0;return pr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function gr(e,t,n){for(var r=-1,o=e.length;++r0&&n(a)?t>1?br(a,t-1,n,r,i):Bt(i,a):r||(i[i.length]=a)}return i}var vr=Mi(),wr=Mi(!0);function xr(e,t){return e&&vr(e,t,Pa)}function Ar(e,t){return e&&wr(e,t,Pa)}function Er(e,t){return Ot(t,(function(t){return Qs(e[t])}))}function _r(e,t){for(var n=0,r=(t=wi(t,e)).length;null!=e&&nt}function Cr(e,t){return null!=e&&Me.call(e,t)}function Ir(e,t){return null!=e&&t in Te(e)}function Or(e,t,r){for(var o=r?Dt:Rt,s=e[0].length,a=e.length,c=a,u=n(a),l=1/0,d=[];c--;){var f=e[c];c&&t&&(f=Pt(f,Xt(t))),l=wn(f.length,l),u[c]=!r&&(t||s>=120&&f.length>=120)?new Kn(c&&f):i}f=e[0];var p=-1,h=u[0];e:for(;++p=a?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Wr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&Ke.call(a,c,1),Ke.call(e,c,1);return e}function $r(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?Ke.call(e,i,1):fi(e,i)}}return e}function Kr(e,t){return e+mt(En()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Xr(e,t){return Bo(Co(e,t,oc),e+"")}function Jr(e){return Jn(Ha(e))}function Qr(e,t){var n=Ha(e);return Fo(n,cr(t,0,n.length))}function ei(e,t,n,r){if(!na(e))return e;for(var o=-1,s=(t=wi(t,e)).length,a=s-1,c=e;null!=c&&++oo?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=n(o);++i>>1,s=e[o];null!==s&&!la(s)&&(n?s<=t:s=200){var u=t?null:Yi(e);if(u)return dn(u);s=!1,i=Qt,c=new Kn}else c=t?[]:a;e:for(;++r=r?e:ii(e,t,n)}var Ei=ct||function(e){return pt.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function ki(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function Ti(e,t){var n=t?ki(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var n=e!==i,r=null===e,o=e===e,s=la(e),a=t!==i,c=null===t,u=t===t,l=la(t);if(!c&&!l&&!s&&e>t||s&&a&&u&&!c&&!l||r&&a&&u||!n&&u||!o)return 1;if(!r&&!s&&!l&&e1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&xo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Te(t);++r-1?o[s?t[a]:a]:i}}function Ui(e){return ro((function(t){var n=t.length,r=n,s=Gn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Ie(o);if(s&&!c&&"wrapper"==ao(a))var c=new Gn([],!0)}for(r=c?r:n;++r1&&v.reverse(),p&&lc))return!1;var l=s.get(e),d=s.get(t);if(l&&d)return l==t&&d==e;var f=-1,p=!0,h=2&n?new Kn:i;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ce,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return St(y,(function(n){var r="_."+n[0];t&n[1]&&!Rt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(le):[]}(r),n)))}function No(e){var t=0,n=0;return function(){var r=xn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Fo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,as(e,n)}));function hs(e){var t=Zn(e);return t.__chain__=!0,t}function ms(e,t){return t(e)}var gs=ro((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Vn&&wo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ms,args:[o],thisArg:i}),new Gn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var ys=Di((function(e,t,n){Me.call(e,n)?++e[n]:sr(e,n,1)}));var bs=ji(Vo),vs=ji(Wo);function ws(e,t){return(Ws(e)?St:pr)(e,uo(t,3))}function xs(e,t){return(Ws(e)?Ct:hr)(e,uo(t,3))}var As=Di((function(e,t,n){Me.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Es=Xr((function(e,t,r){var i=-1,o="function"==typeof t,s=$s(e)?n(e.length):[];return pr(e,(function(e){s[++i]=o?kt(t,e,r):Rr(e,t,r)})),s})),_s=Di((function(e,t,n){sr(e,n,t)}));function ks(e,t){return(Ws(e)?Pt:Ur)(e,uo(t,3))}var Ts=Di((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ss=Xr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&xo(e,t[0],t[1])?t=[]:n>2&&xo(t[0],t[1],t[2])&&(t=[t[0]]),Vr(e,br(t,1),[])})),Cs=dt||function(){return pt.Date.now()};function Is(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Ji(e,d,i,i,i,i,t)}function Os(e,t){var n;if("function"!=typeof t)throw new Ie(o);return e=ga(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Rs=Xr((function(e,t,n){var r=1;if(n.length){var i=ln(n,co(Rs));r|=u}return Ji(e,r,t,n,i)})),Ds=Xr((function(e,t,n){var r=3;if(n.length){var i=ln(n,co(Ds));r|=u}return Ji(t,r,e,n,i)}));function Ps(e,t,n){var r,s,a,c,u,l,d=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new Ie(o);function m(t){var n=r,o=s;return r=s=i,d=t,c=e.apply(o,n)}function g(e){return d=e,u=Po(b,t),f?m(e):c}function y(e){var n=e-l;return l===i||n>=t||n<0||p&&e-d>=a}function b(){var e=Cs();if(y(e))return v(e);u=Po(b,function(e){var n=t-(e-l);return p?wn(n,a-(e-d)):n}(e))}function v(e){return u=i,h&&r?m(e):(r=s=i,c)}function w(){var e=Cs(),n=y(e);if(r=arguments,s=this,l=e,n){if(u===i)return g(l);if(p)return Ei(u),u=Po(b,t),m(l)}return u===i&&(u=Po(b,t)),c}return t=ba(t)||0,na(n)&&(f=!!n.leading,a=(p="maxWait"in n)?vn(ba(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),w.cancel=function(){u!==i&&Ei(u),d=0,r=l=s=u=i},w.flush=function(){return u===i?c:v(Cs())},w}var Bs=Xr((function(e,t){return dr(e,1,t)})),Ms=Xr((function(e,t,n){return dr(e,ba(t)||0,n)}));function Ns(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ns.Cache||$n),n}function Fs(e){if("function"!=typeof e)throw new Ie(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ns.Cache=$n;var Ls=xi((function(e,t){var n=(t=1==t.length&&Ws(t[0])?Pt(t[0],Xt(uo())):Pt(br(t,1),Xt(uo()))).length;return Xr((function(r){for(var i=-1,o=wn(r.length,n);++i=t})),Vs=Dr(function(){return arguments}())?Dr:function(e){return ra(e)&&Me.call(e,"callee")&&!$e.call(e,"callee")},Ws=n.isArray,qs=vt?Xt(vt):function(e){return ra(e)&&Tr(e)==B};function $s(e){return null!=e&&ta(e.length)&&!Qs(e)}function Ks(e){return ra(e)&&$s(e)}var Ys=bt||bc,Xs=wt?Xt(wt):function(e){return ra(e)&&Tr(e)==x};function Js(e){if(!ra(e))return!1;var t=Tr(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!sa(e)}function Qs(e){if(!na(e))return!1;var t=Tr(e);return t==E||t==_||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ea(e){return"number"==typeof e&&e==ga(e)}function ta(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function na(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ra(e){return null!=e&&"object"==typeof e}var ia=xt?Xt(xt):function(e){return ra(e)&&go(e)==k};function oa(e){return"number"==typeof e||ra(e)&&Tr(e)==T}function sa(e){if(!ra(e)||Tr(e)!=S)return!1;var t=We(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Be.call(n)==je}var aa=At?Xt(At):function(e){return ra(e)&&Tr(e)==I};var ca=Et?Xt(Et):function(e){return ra(e)&&go(e)==O};function ua(e){return"string"==typeof e||!Ws(e)&&ra(e)&&Tr(e)==R}function la(e){return"symbol"==typeof e||ra(e)&&Tr(e)==D}var da=_t?Xt(_t):function(e){return ra(e)&&ta(e.length)&&!!st[Tr(e)]};var fa=qi(jr),pa=qi((function(e,t){return e<=t}));function ha(e){if(!e)return[];if($s(e))return ua(e)?hn(e):Oi(e);if(Xe&&e[Xe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Xe]());var t=go(e);return(t==k?cn:t==O?dn:Ha)(e)}function ma(e){return e?(e=ba(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function ga(e){var t=ma(e),n=t%1;return t===t?n?t-n:t:0}function ya(e){return e?cr(ga(e),0,g):0}function ba(e){if("number"==typeof e)return e;if(la(e))return m;if(na(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=na(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var n=ye.test(e);return n||ve.test(e)?lt(e.slice(2),n?2:8):ge.test(e)?m:+e}function va(e){return Ri(e,Ba(e))}function wa(e){return null==e?"":li(e)}var xa=Pi((function(e,t){if(ko(t)||$s(t))Ri(t,Pa(t),e);else for(var n in t)Me.call(t,n)&&nr(e,n,t[n])})),Aa=Pi((function(e,t){Ri(t,Ba(t),e)})),Ea=Pi((function(e,t,n,r){Ri(t,Ba(t),e,r)})),_a=Pi((function(e,t,n,r){Ri(t,Pa(t),e,r)})),ka=ro(ar);var Ta=Xr((function(e,t){e=Te(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&xo(t[0],t[1],o)&&(r=1);++n1),t})),Ri(e,oo(e),n),r&&(n=ur(n,7,to));for(var i=t.length;i--;)fi(n,t[i]);return n}));var La=ro((function(e,t){return null==e?{}:function(e,t){return Wr(e,t,(function(t,n){return Ia(e,n)}))}(e,t)}));function ja(e,t){if(null==e)return{};var n=Pt(oo(e),(function(e){return[e]}));return t=uo(t),Wr(e,n,(function(e,n){return t(e,n[0])}))}var Ua=Xi(Pa),Za=Xi(Ba);function Ha(e){return null==e?[]:Jt(e,Pa(e))}var za=Fi((function(e,t,n){return t=t.toLowerCase(),e+(n?Ga(t):t)}));function Ga(e){return Ja(wa(e).toLowerCase())}function Va(e){return(e=wa(e))&&e.replace(xe,rn).replace(Qe,"")}var Wa=Fi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),qa=Fi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),$a=Ni("toLowerCase");var Ka=Fi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ya=Fi((function(e,t,n){return e+(n?" ":"")+Ja(t)}));var Xa=Fi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ja=Ni("toUpperCase");function Qa(e,t,n){return e=wa(e),(t=n?i:t)===i?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var ec=Xr((function(e,t){try{return kt(e,i,t)}catch(n){return Js(n)?n:new ae(n)}})),tc=ro((function(e,t){return St(t,(function(t){t=jo(t),sr(e,t,Rs(e[t],e))})),e}));function nc(e){return function(){return e}}var rc=Ui(),ic=Ui(!0);function oc(e){return e}function sc(e){return Nr("function"==typeof e?e:ur(e,1))}var ac=Xr((function(e,t){return function(n){return Rr(n,e,t)}})),cc=Xr((function(e,t){return function(n){return Rr(e,n,t)}}));function uc(e,t,n){var r=Pa(t),i=Er(t,r);null!=n||na(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Er(t,Pa(t)));var o=!(na(n)&&"chain"in n)||!!n.chain,s=Qs(e);return St(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Oi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Bt([this.value()],arguments))})})),e}function lc(){}var dc=Gi(Pt),fc=Gi(It),pc=Gi(Ft);function hc(e){return Ao(e)?Vt(jo(e)):function(e){return function(t){return _r(t,e)}}(e)}var mc=Wi(),gc=Wi(!0);function yc(){return[]}function bc(){return!1}var vc=zi((function(e,t){return e+t}),0),wc=Ki("ceil"),xc=zi((function(e,t){return e/t}),1),Ac=Ki("floor");var Ec=zi((function(e,t){return e*t}),1),_c=Ki("round"),kc=zi((function(e,t){return e-t}),0);return Zn.after=function(e,t){if("function"!=typeof t)throw new Ie(o);return e=ga(e),function(){if(--e<1)return t.apply(this,arguments)}},Zn.ary=Is,Zn.assign=xa,Zn.assignIn=Aa,Zn.assignInWith=Ea,Zn.assignWith=_a,Zn.at=ka,Zn.before=Os,Zn.bind=Rs,Zn.bindAll=tc,Zn.bindKey=Ds,Zn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ws(e)?e:[e]},Zn.chain=hs,Zn.chunk=function(e,t,r){t=(r?xo(e,t,r):t===i)?1:vn(ga(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,c=n(ht(o/t));so?0:o+n),(r=r===i||r>o?o:ga(r))<0&&(r+=o),r=n>r?0:ya(r);n>>0)?(e=wa(e))&&("string"==typeof t||null!=t&&!aa(t))&&!(t=li(t))&&an(e)?Ai(hn(e),0,n):e.split(t,n):[]},Zn.spread=function(e,t){if("function"!=typeof e)throw new Ie(o);return t=null==t?0:vn(ga(t),0),Xr((function(n){var r=n[t],i=Ai(n,0,t);return r&&Bt(i,r),kt(e,this,i)}))},Zn.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},Zn.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===i?1:ga(t))<0?0:t):[]},Zn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ii(e,(t=r-(t=n||t===i?1:ga(t)))<0?0:t,r):[]},Zn.takeRightWhile=function(e,t){return e&&e.length?hi(e,uo(t,3),!1,!0):[]},Zn.takeWhile=function(e,t){return e&&e.length?hi(e,uo(t,3)):[]},Zn.tap=function(e,t){return t(e),e},Zn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ie(o);return na(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ps(e,t,{leading:r,maxWait:t,trailing:i})},Zn.thru=ms,Zn.toArray=ha,Zn.toPairs=Ua,Zn.toPairsIn=Za,Zn.toPath=function(e){return Ws(e)?Pt(e,jo):la(e)?[e]:Oi(Lo(wa(e)))},Zn.toPlainObject=va,Zn.transform=function(e,t,n){var r=Ws(e),i=r||Ys(e)||da(e);if(t=uo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:na(e)&&Qs(o)?Hn(We(e)):{}}return(i?St:xr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Zn.unary=function(e){return Is(e,1)},Zn.union=rs,Zn.unionBy=is,Zn.unionWith=os,Zn.uniq=function(e){return e&&e.length?di(e):[]},Zn.uniqBy=function(e,t){return e&&e.length?di(e,uo(t,2)):[]},Zn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?di(e,i,t):[]},Zn.unset=function(e,t){return null==e||fi(e,t)},Zn.unzip=ss,Zn.unzipWith=as,Zn.update=function(e,t,n){return null==e?e:pi(e,t,vi(n))},Zn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:pi(e,t,vi(n),r)},Zn.values=Ha,Zn.valuesIn=function(e){return null==e?[]:Jt(e,Ba(e))},Zn.without=cs,Zn.words=Qa,Zn.wrap=function(e,t){return js(vi(t),e)},Zn.xor=us,Zn.xorBy=ls,Zn.xorWith=ds,Zn.zip=fs,Zn.zipObject=function(e,t){return yi(e||[],t||[],nr)},Zn.zipObjectDeep=function(e,t){return yi(e||[],t||[],ei)},Zn.zipWith=ps,Zn.entries=Ua,Zn.entriesIn=Za,Zn.extend=Aa,Zn.extendWith=Ea,uc(Zn,Zn),Zn.add=vc,Zn.attempt=ec,Zn.camelCase=za,Zn.capitalize=Ga,Zn.ceil=wc,Zn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ba(n))===n?n:0),t!==i&&(t=(t=ba(t))===t?t:0),cr(ba(e),t,n)},Zn.clone=function(e){return ur(e,4)},Zn.cloneDeep=function(e){return ur(e,5)},Zn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:i)},Zn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:i)},Zn.conformsTo=function(e,t){return null==t||lr(e,t,Pa(t))},Zn.deburr=Va,Zn.defaultTo=function(e,t){return null==e||e!==e?t:e},Zn.divide=xc,Zn.endsWith=function(e,t,n){e=wa(e),t=li(t);var r=e.length,o=n=n===i?r:cr(ga(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Zn.eq=Hs,Zn.escape=function(e){return(e=wa(e))&&X.test(e)?e.replace(K,on):e},Zn.escapeRegExp=function(e){return(e=wa(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Zn.every=function(e,t,n){var r=Ws(e)?It:mr;return n&&xo(e,t,n)&&(t=i),r(e,uo(t,3))},Zn.find=bs,Zn.findIndex=Vo,Zn.findKey=function(e,t){return jt(e,uo(t,3),xr)},Zn.findLast=vs,Zn.findLastIndex=Wo,Zn.findLastKey=function(e,t){return jt(e,uo(t,3),Ar)},Zn.floor=Ac,Zn.forEach=ws,Zn.forEachRight=xs,Zn.forIn=function(e,t){return null==e?e:vr(e,uo(t,3),Ba)},Zn.forInRight=function(e,t){return null==e?e:wr(e,uo(t,3),Ba)},Zn.forOwn=function(e,t){return e&&xr(e,uo(t,3))},Zn.forOwnRight=function(e,t){return e&&Ar(e,uo(t,3))},Zn.get=Ca,Zn.gt=zs,Zn.gte=Gs,Zn.has=function(e,t){return null!=e&&yo(e,t,Cr)},Zn.hasIn=Ia,Zn.head=$o,Zn.identity=oc,Zn.includes=function(e,t,n,r){e=$s(e)?e:Ha(e),n=n&&!r?ga(n):0;var i=e.length;return n<0&&(n=vn(i+n,0)),ua(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Zt(e,t,n)>-1},Zn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ga(n);return i<0&&(i=vn(r+i,0)),Zt(e,t,i)},Zn.inRange=function(e,t,n){return t=ma(t),n===i?(n=t,t=0):n=ma(n),function(e,t,n){return e>=wn(t,n)&&e=-9007199254740991&&e<=h},Zn.isSet=ca,Zn.isString=ua,Zn.isSymbol=la,Zn.isTypedArray=da,Zn.isUndefined=function(e){return e===i},Zn.isWeakMap=function(e){return ra(e)&&go(e)==P},Zn.isWeakSet=function(e){return ra(e)&&"[object WeakSet]"==Tr(e)},Zn.join=function(e,t){return null==e?"":Wt.call(e,t)},Zn.kebabCase=Wa,Zn.last=Jo,Zn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ga(n))<0?vn(r+o,0):wn(o,r-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ut(e,zt,o,!0)},Zn.lowerCase=qa,Zn.lowerFirst=$a,Zn.lt=fa,Zn.lte=pa,Zn.max=function(e){return e&&e.length?gr(e,oc,Sr):i},Zn.maxBy=function(e,t){return e&&e.length?gr(e,uo(t,2),Sr):i},Zn.mean=function(e){return Gt(e,oc)},Zn.meanBy=function(e,t){return Gt(e,uo(t,2))},Zn.min=function(e){return e&&e.length?gr(e,oc,jr):i},Zn.minBy=function(e,t){return e&&e.length?gr(e,uo(t,2),jr):i},Zn.stubArray=yc,Zn.stubFalse=bc,Zn.stubObject=function(){return{}},Zn.stubString=function(){return""},Zn.stubTrue=function(){return!0},Zn.multiply=Ec,Zn.nth=function(e,t){return e&&e.length?Gr(e,ga(t)):i},Zn.noConflict=function(){return pt._===this&&(pt._=Ue),this},Zn.noop=lc,Zn.now=Cs,Zn.pad=function(e,t,n){e=wa(e);var r=(t=ga(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Vi(mt(i),n)+e+Vi(ht(i),n)},Zn.padEnd=function(e,t,n){e=wa(e);var r=(t=ga(t))?pn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=En();return wn(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return Kr(e,t)},Zn.reduce=function(e,t,n){var r=Ws(e)?Mt:qt,i=arguments.length<3;return r(e,uo(t,4),n,i,pr)},Zn.reduceRight=function(e,t,n){var r=Ws(e)?Nt:qt,i=arguments.length<3;return r(e,uo(t,4),n,i,hr)},Zn.repeat=function(e,t,n){return t=(n?xo(e,t,n):t===i)?1:ga(t),Yr(wa(e),t)},Zn.replace=function(){var e=arguments,t=wa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Zn.result=function(e,t,n){var r=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=i);++rh)return[];var n=g,r=wn(e,g);t=uo(t),e-=g;for(var i=Kt(r,t);++n=s)return e;var c=n-pn(r);if(c<1)return r;var u=a?Ai(a,0,c).join(""):e.slice(0,c);if(o===i)return u+r;if(a&&(c+=u.length-c),aa(o)){if(e.slice(c).search(o)){var l,d=u;for(o.global||(o=Se(o.source,wa(me.exec(o))+"g")),o.lastIndex=0;l=o.exec(d);)var f=l.index;u=u.slice(0,f===i?c:f)}}else if(e.indexOf(li(o),c)!=c){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+r},Zn.unescape=function(e){return(e=wa(e))&&Y.test(e)?e.replace($,gn):e},Zn.uniqueId=function(e){var t=++Ne;return wa(e)+t},Zn.upperCase=Xa,Zn.upperFirst=Ja,Zn.each=ws,Zn.eachRight=xs,Zn.first=$o,uc(Zn,function(){var e={};return xr(Zn,(function(t,n){Me.call(Zn.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Zn.VERSION="4.17.21",St(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Zn[e].placeholder=Zn})),St(["drop","take"],(function(e,t){Vn.prototype[e]=function(n){n=n===i?1:vn(ga(n),0);var r=this.__filtered__&&!t?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,g),type:e+(r.__dir__<0?"Right":"")}),r},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),St(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),St(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}})),St(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(oc)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=Xr((function(e,t){return"function"==typeof e?new Vn(this):this.map((function(n){return Rr(n,e,t)}))})),Vn.prototype.reject=function(e){return this.filter(Fs(uo(e)))},Vn.prototype.slice=function(e,t){e=ga(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=ga(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(g)},xr(Vn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Zn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Zn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,c=t instanceof Vn,u=a[0],l=c||Ws(t),d=function(e){var t=o.apply(Zn,Bt([e],a));return r&&f?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var f=this.__chain__,p=!!this.__actions__.length,h=s&&!f,m=c&&!p;if(!s&&l){t=m?t:new Vn(this);var g=e.apply(t,a);return g.__actions__.push({func:ms,args:[d],thisArg:i}),new Gn(g,f)}return h&&m?e.apply(this,a):(g=this.thru(d),h?r?g.value()[0]:g.value():g)})})),St(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Zn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ws(i)?i:[],e)}return this[n]((function(n){return t.apply(Ws(n)?n:[],e)}))}})),xr(Vn.prototype,(function(e,t){var n=Zn[t];if(n){var r=n.name+"";Me.call(Dn,r)||(Dn[r]=[]),Dn[r].push({name:t,func:n})}})),Dn[Zi(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ws(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Zn.prototype.plant=function(e){for(var t,n=this;n instanceof zn;){var r=Zo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Zn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:ms,args:[ns],thisArg:i}),new Gn(t,this.__chain__)}return this.thru(ns)},Zn.prototype.toJSON=Zn.prototype.valueOf=Zn.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},Zn.prototype.first=Zn.prototype.head,Xe&&(Zn.prototype[Xe]=function(){return this}),Zn}();pt._=yn,(r=function(){return yn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},14841:function(e,t,n){var r=n(27561),i=n(13218),o=n(33448),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):s.test(e)?NaN:+e}},53179:function(e){"use strict";function t(e,n,r,i){this.message=e,this.expected=n,this.found=r,this.location=i,this.name="SyntaxError","function"===typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}!function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(t,Error),t.buildMessage=function(e,t){var n={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t,n="";for(t=0;t0){for(t=1,r=1;tpe&&(pe=de,he=[]),he.push(e))}function Ae(e,n,r){return new t(t.buildMessage(e,n),e,n,r)}function Ee(){var e,t;for(e=[],t=_e();t!==i;)e.push(t),t=_e();return e}function _e(){var t,r,o;if(t=function(){var t,n,r,o;t=de,123===e.charCodeAt(de)?(n=l,de++):(n=i,0===me&&xe(d));n!==i&&Me()!==i&&(r=ke())!==i&&Me()!==i?(125===e.charCodeAt(de)?(o=f,de++):(o=i,0===me&&xe(p)),o!==i?(t,t=n={type:"argument",arg:r}):(de=t,t=i)):(de=t,t=i);return t}(),t===i&&(t=function(){var t,r,o,s,a,c,u,b,v,w;t=de,123===e.charCodeAt(de)?(r=l,de++):(r=i,0===me&&xe(d));if(r!==i)if(Me()!==i)if((o=ke())!==i)if(Me()!==i)if(44===e.charCodeAt(de)?(s=h,de++):(s=i,0===me&&xe(m)),s!==i)if(Me()!==i)if(a=de,e.substr(de,6)===g?(c=g,de+=6):(c=i,0===me&&xe(y)),c!==i&&(a,E=c,n.strict&&Ne.unshift(!1),c=E),(a=c)!==i)if((c=Me())!==i)if(44===e.charCodeAt(de)?(u=h,de++):(u=i,0===me&&xe(m)),u!==i)if(Me()!==i){if(b=[],(v=Te())!==i)for(;v!==i;)b.push(v),v=Te();else b=i;b!==i&&(v=Me())!==i?(125===e.charCodeAt(de)?(w=f,de++):(w=i,0===me&&xe(p)),w!==i?(t,x=o,A=b,n.strict&&Ne.shift(),t=r={type:"select",arg:x,cases:A}):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;var x,A;var E;return t}(),t===i&&(t=function(){var t,r,o,s,a,c,u,g,y,A,E;t=de,123===e.charCodeAt(de)?(r=l,de++):(r=i,0===me&&xe(d));if(r!==i)if(Me()!==i)if((o=ke())!==i)if(Me()!==i)if(44===e.charCodeAt(de)?(s=h,de++):(s=i,0===me&&xe(m)),s!==i)if(Me()!==i)if(a=de,e.substr(de,6)===b?(c=b,de+=6):(c=i,0===me&&xe(v)),c===i&&(e.substr(de,13)===w?(c=w,de+=13):(c=i,0===me&&xe(x))),c!==i&&(a,_=c,Ne.unshift(!0),c=_),(a=c)!==i)if((c=Me())!==i)if(44===e.charCodeAt(de)?(u=h,de++):(u=i,0===me&&xe(m)),u!==i)if(Me()!==i)if(g=function(){var t,n,r,o;me++,t=de,Me()!==i?(e.substr(de,6)===S?(n=S,de+=6):(n=i,0===me&&xe(C)),n!==i&&Me()!==i?(58===e.charCodeAt(de)?(r=":",de++):(r=i,0===me&&xe(I)),r!==i&&Me()!==i&&(o=Be())!==i&&Me()!==i?(t,t=o):(de=t,t=i)):(de=t,t=i)):(de=t,t=i);me--,t===i&&(i,0===me&&xe(T));return t}(),g===i&&(g=null),g!==i){if(y=[],(A=Se())!==i)for(;A!==i;)y.push(A),A=Se();else y=i;y!==i&&(A=Me())!==i?(125===e.charCodeAt(de)?(E=f,de++):(E=i,0===me&&xe(p)),E!==i?(t,t=r=function(e,t,r,i){var o=("selectordinal"===t?n.ordinal:n.cardinal)||["zero","one","two","few","many","other"];return o&&o.length&&i.forEach((function(n){if(isNaN(n.key)&&o.indexOf(n.key)<0)throw new Error("Invalid key `"+n.key+"` for argument `"+e+"`. Valid "+t+" keys for this locale are `"+o.join("`, `")+"`, and explicit keys like `=0`.")})),Ne.shift(),{type:t,arg:e,offset:r||0,cases:i}}(o,a,g,y)):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;else de=t,t=i;var _;return t}(),t===i&&(t=function(){var t,r,o,s,a,c,u;t=de,123===e.charCodeAt(de)?(r=l,de++):(r=i,0===me&&xe(d));r!==i&&Me()!==i&&(o=ke())!==i&&Me()!==i?(44===e.charCodeAt(de)?(s=h,de++):(s=i,0===me&&xe(m)),s!==i&&Me()!==i?(a=function(){var t,r,o,s,a;e.substr(de,6)===R?(t=R,de+=6):(t=i,0===me&&xe(D));t===i&&(e.substr(de,4)===P?(t=P,de+=4):(t=i,0===me&&xe(B)),t===i&&(e.substr(de,4)===M?(t=M,de+=4):(t=i,0===me&&xe(N)),t===i&&(e.substr(de,8)===F?(t=F,de+=8):(t=i,0===me&&xe(L)),t===i&&(e.substr(de,7)===j?(t=j,de+=7):(t=i,0===me&&xe(U)),t===i&&(e.substr(de,8)===Z?(t=Z,de+=8):(t=i,0===me&&xe(H)),t===i&&(t=de,r=de,me++,e.substr(de,6)===g?(o=g,de+=6):(o=i,0===me&&xe(y)),me--,o===i?r=void 0:(de=r,r=i),r!==i?(o=de,me++,e.substr(de,6)===b?(s=b,de+=6):(s=i,0===me&&xe(v)),me--,s===i?o=void 0:(de=o,o=i),o!==i?(s=de,me++,e.substr(de,13)===w?(a=w,de+=13):(a=i,0===me&&xe(x)),me--,a===i?s=void 0:(de=s,s=i),s!==i&&(a=ke())!==i?(de,(function(e){if(n.strict||/^\d/.test(e))return!1;switch(e.toLowerCase()){case"select":case"plural":case"selectordinal":return!1;default:return!0}}(a)?void 0:i)!==i?(t,t=r=a):(de=t,t=i)):(de=t,t=i)):(de=t,t=i)):(de=t,t=i)))))));return t}(),a!==i&&Me()!==i?(c=function(){var t,r,o,s;if(t=de,Me()!==i)if(44===e.charCodeAt(de)?(r=h,de++):(r=i,0===me&&xe(m)),r!==i){for(o=[],s=_e();s!==i;)o.push(s),s=_e();o!==i?(de,(s=(s=!n.strict)?void 0:i)!==i?(t,t={tokens:o}):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;else de=t,t=i;if(t===i)if(t=de,Me()!==i)if(44===e.charCodeAt(de)?(r=h,de++):(r=i,0===me&&xe(m)),r!==i){for(o=[],s=Ie();s!==i;)o.push(s),s=Ie();o!==i?(t,t={tokens:[o.join("")]}):(de=t,t=i)}else de=t,t=i;else de=t,t=i;return t}(),c===i&&(c=null),c!==i?(125===e.charCodeAt(de)?(u=f,de++):(u=i,0===me&&xe(p)),u!==i?(t,t=r={type:"function",arg:o,key:a,param:c}):(de=t,t=i)):(de=t,t=i)):(de=t,t=i)):(de=t,t=i)):(de=t,t=i);return t}(),t===i&&(t=de,35===e.charCodeAt(de)?(r="#",de++):(r=i,0===me&&xe(a)),r!==i?(de,(o=(o=c())?void 0:i)!==i?(t,t=r={type:"octothorpe"}):(de=t,t=i)):(de=t,t=i),t===i))))){if(t=de,r=[],(o=Pe())!==i)for(;o!==i;)r.push(o),o=Pe();else r=i;r!==i&&(t,r=u(r)),t=r}return t}function ke(){var t,n,r;if(me++,t=de,n=[],E.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(_)),r!==i)for(;r!==i;)n.push(r),E.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(_));else n=i;return t=n!==i?e.substring(t,de):n,me--,t===i&&(n=i,0===me&&xe(A)),t}function Te(){var e,t,n;return e=de,Me()!==i&&(t=ke())!==i&&Me()!==i&&(n=Ce())!==i?(e,e=k(t,n)):(de=e,e=i),e}function Se(){var t,n,r;return t=de,Me()!==i?(n=function(){var t,n,r;(t=ke())===i&&(t=de,61===e.charCodeAt(de)?(n="=",de++):(n=i,0===me&&xe(O)),n!==i&&(r=Be())!==i?(t,t=n=r):(de=t,t=i));return t}(),n!==i&&Me()!==i&&(r=Ce())!==i?(t,t=k(n,r)):(de=t,t=i)):(de=t,t=i),t}function Ce(){var t,n,r,o,s,a;if(t=de,123===e.charCodeAt(de)?(n=l,de++):(n=i,0===me&&xe(d)),n!==i)if(r=de,(o=Me())!==i?(s=de,me++,123===e.charCodeAt(de)?(a=l,de++):(a=i,0===me&&xe(d)),me--,a!==i?(de=s,s=void 0):s=i,s!==i?r=o=[o,s]:(de=r,r=i)):(de=r,r=i),r===i&&(r=null),r!==i){for(o=[],s=_e();s!==i;)o.push(s),s=_e();o!==i&&(s=Me())!==i?(125===e.charCodeAt(de)?(a=f,de++):(a=i,0===me&&xe(p)),a!==i?(t,t=n=o):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;else de=t,t=i;return t}function Ie(){var t,n,r,o;if(me++,t=de,n=[],G.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(V)),r!==i)for(;r!==i;)n.push(r),G.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(V));else n=i;if(n!==i&&(t,n=n.join("")),(t=n)===i&&(t=Oe())===i&&(t=de,39===e.charCodeAt(de)?(n=W,de++):(n=i,0===me&&xe(q)),n!==i&&(r=Re())!==i?(39===e.charCodeAt(de)?(o=W,de++):(o=i,0===me&&xe(q)),o!==i?(t,t=n=r):(de=t,t=i)):(de=t,t=i),t===i))if(t=de,123===e.charCodeAt(de)?(n=l,de++):(n=i,0===me&&xe(d)),n!==i){for(r=[],o=Ie();o!==i;)r.push(o),o=Ie();r!==i?(125===e.charCodeAt(de)?(o=f,de++):(o=i,0===me&&xe(p)),o!==i?(t,n=function(e){return"{"+e.join("")+"}"}(r),t=n):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;return me--,t===i&&(n=i,0===me&&xe(z)),t}function Oe(){var t,n;return me++,t=de,"''"===e.substr(de,2)?(n="''",de+=2):(n=i,0===me&&xe(K)),n!==i&&(t,n="'"),me--,(t=n)===i&&(n=i,0===me&&xe($)),t}function Re(){var t,n,r;if((t=Oe())===i){if(t=de,n=[],Y.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(X)),r!==i)for(;r!==i;)n.push(r),Y.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(X));else n=i;n!==i&&(t,n=u(n)),t=n}return t}function De(){var t,n,r,o,s,a;if(me++,t=function(){var t,n,r,o;if(t=de,"'{"===e.substr(de,2)?(n="'{",de+=2):(n=i,0===me&&xe(J)),n!==i){for(r=[],o=Re();o!==i;)r.push(o),o=Re();r!==i?(39===e.charCodeAt(de)?(o=W,de++):(o=i,0===me&&xe(q)),o!==i?(t,t=n="{"+r.join("")):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;if(t===i)if(t=de,"'}"===e.substr(de,2)?(n="'}",de+=2):(n=i,0===me&&xe(Q)),n!==i){for(r=[],o=Re();o!==i;)r.push(o),o=Re();r!==i?(39===e.charCodeAt(de)?(o=W,de++):(o=i,0===me&&xe(q)),o!==i?(t,t=n="}"+r.join("")):(de=t,t=i)):(de=t,t=i)}else de=t,t=i;return t}(),t===i){if(t=de,n=de,r=de,"'#"===e.substr(de,2)?(o="'#",de+=2):(o=i,0===me&&xe(te)),o!==i){for(s=[],a=Re();a!==i;)s.push(a),a=Re();s!==i?(39===e.charCodeAt(de)?(a=W,de++):(a=i,0===me&&xe(q)),a!==i?(r,r=o="#"+s.join("")):(de=r,r=i)):(de=r,r=i)}else de=r,r=i;r!==i?(de,(o=(o=c())?void 0:i)!==i?n=r=[r,o]:(de=n,n=i)):(de=n,n=i),n!==i&&(t,n=n[0]),(t=n)===i&&(39===e.charCodeAt(de)?(t=W,de++):(t=i,0===me&&xe(q)))}return me--,t===i&&(n=i,0===me&&xe(ee)),t}function Pe(){var t,n;return(t=Oe())===i&&(t=De())===i&&(t=de,35===e.charCodeAt(de)?(n="#",de++):(n=i,0===me&&xe(a)),n!==i?(de,(!Ne[0]?void 0:i)!==i?(t,t=n=n):(de=t,t=i)):(de=t,t=i),t===i&&(t=function(){var t;return me++,re.test(e.charAt(de))?(t=e.charAt(de),de++):(t=i,0===me&&xe(ie)),me--,t===i&&0===me&&xe(ne),t}())),t}function Be(){var t,n,r;if(me++,t=de,n=[],se.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(ae)),r!==i)for(;r!==i;)n.push(r),se.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(ae));else n=i;return t=n!==i?e.substring(t,de):n,me--,t===i&&(n=i,0===me&&xe(oe)),t}function Me(){var t,n,r;for(me++,t=de,n=[],ue.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(le));r!==i;)n.push(r),ue.test(e.charAt(de))?(r=e.charAt(de),de++):(r=i,0===me&&xe(le));return t=n!==i?e.substring(t,de):n,me--,t===i&&(n=i,0===me&&xe(ce)),t}var Ne=[!1];if((r=s())!==i&&de===e.length)return r;throw r!==i&&de0&&(t[n]=e)})),t},A.truncate=function(e,t){var n;return"string"===typeof e?n=e.slice(0,t):A.isArray(e)?(n=[],A.each(e,(function(e){n.push(A.truncate(e,t))}))):A.isObject(e)?(n={},A.each(e,(function(e,r){n[r]=A.truncate(e,t)}))):n=e,n},A.JSONEncode=function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,(function(e){var t=n[e];return"string"===typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'},n=function(e,r){var i="",o=0,s="",a="",l=0,d=i,f=[],p=r[e];switch(p&&"object"===typeof p&&"function"===typeof p.toJSON&&(p=p.toJSON(e)),typeof p){case"string":return t(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(i+=" ",f=[],"[object Array]"===c.apply(p)){for(l=p.length,o=0;o="0"&&t<="9";)n+=t,s();if("."===t)for(n+=".";s()&&t>="0"&&t<="9";)n+=t;if("e"===t||"E"===t)for(n+=t,s(),"-"!==t&&"+"!==t||(n+=t,s());t>="0"&&t<="9";)n+=t,s();if(e=+n,isFinite(e))return e;o("Bad number")},c=function(){var e,n,r,a="";if('"'===t)for(;s();){if('"'===t)return s(),a;if("\\"===t)if(s(),"u"===t){for(r=0,n=0;n<4&&(e=parseInt(s(),16),isFinite(e));n+=1)r=16*r+e;a+=String.fromCharCode(r)}else{if("string"!==typeof i[t])break;a+=i[t]}else a+=t}o("Bad string")},u=function(){for(;t&&t<=" ";)s()};return r=function(){switch(u(),t){case"{":return function(){var e,n={};if("{"===t){if(s("{"),u(),"}"===t)return s("}"),n;for(;t;){if(e=c(),u(),s(":"),Object.hasOwnProperty.call(n,e)&&o('Duplicate key "'+e+'"'),n[e]=r(),u(),"}"===t)return s("}"),n;s(","),u()}}o("Bad object")}();case"[":return function(){var e=[];if("["===t){if(s("["),u(),"]"===t)return s("]"),e;for(;t;){if(e.push(r()),u(),"]"===t)return s("]"),e;s(","),u()}}o("Bad array")}();case'"':return c();case"-":return a();default:return t>="0"&&t<="9"?a():function(){switch(t){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}o('Unexpected "'+t+'"')}()}},function(i){var s;return n=i,e=0,t=" ",s=r(),u(),t&&o("Syntax error"),s}}(),A.base64Encode=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,u="",l=[];if(!e)return e;e=A.utf8Encode(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[c++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},A.UUID=function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)};return function(){var t=(h.height*h.width).toString(16);return e()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=m,r=[],i=0;function o(e,t){var n,i=0;for(n=0;n=4&&(i=o(i,r),r=[]);return r.length>0&&(i=o(i,r)),i.toString(16)}()+"-"+t+"-"+e()}}();var T=["ahrefsbot","baiduspider","bingbot","bingpreview","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];A.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t=0}function r(t){if(!f.getElementsByTagName)return[];var r,i,o,s,a,c,u,l,d,p,h=t.split(" "),m=[f];for(c=0;c-1){o=(i=r.split("#"))[0];var g=i[1],y=f.getElementById(g);if(!y||o&&y.nodeName.toLowerCase()!=o)return[];m=[y]}else if(r.indexOf(".")>-1){o=(i=r.split("."))[0];var b=i[1];for(o||(o="*"),s=[],a=0,u=0;u-1};break;default:w=function(e){return e.getAttribute(x)}}for(m=[],p=0,u=0;u=3?t[2]:""},properties:function(){return A.extend(A.strip_empty_properties({$os:A.info.os(),$browser:A.info.browser(m,d.vendor,p),$referrer:f.referrer,$referring_domain:A.info.referringDomain(f.referrer),$device:A.info.device(m)}),{$current_url:t.location.href,$browser_version:A.info.browserVersion(m,d.vendor,p),$screen_height:h.height,$screen_width:h.width,mp_lib:"web",$lib_version:n.LIB_VERSION,$insert_id:O(),time:A.timestamp()/1e3})},people_properties:function(){return A.extend(A.strip_empty_properties({$os:A.info.os(),$browser:A.info.browser(m,d.vendor,p)}),{$browser_version:A.info.browserVersion(m,d.vendor,p)})},pageviewInfo:function(e){return A.strip_empty_properties({mp_page:e,mp_referrer:f.referrer,mp_browser:A.info.browser(m,d.vendor,p),mp_platform:A.info.os()})}};var O=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},R=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,D=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,P=function(e){var t=D,n=e.split("."),r=n[n.length-1];(r.length>4||"com"===r||"org"===r)&&(t=R);var i=e.match(t);return i?i[0]:""},B=null,M=null;"undefined"!==typeof JSON&&(B=JSON.stringify,M=JSON.parse),B=B||A.JSONEncode,M=M||A.JSONDecode,A.toArray=A.toArray,A.isObject=A.isObject,A.JSONEncode=A.JSONEncode,A.JSONDecode=A.JSONDecode,A.isBlockedUA=A.isBlockedUA,A.isEmptyObject=A.isEmptyObject,A.info=A.info,A.info.device=A.info.device,A.info.browser=A.info.browser,A.info.browserVersion=A.info.browserVersion,A.info.properties=A.info.properties;var N=function(){};N.prototype.create_properties=function(){},N.prototype.event_handler=function(){},N.prototype.after_track_handler=function(){},N.prototype.init=function(e){return this.mp=e,this},N.prototype.track=function(e,t,n,r){var i=this,o=A.dom_query(e);if(0!==o.length)return A.each(o,(function(e){A.register_event(e,this.override_event,(function(e){var o={},s=i.create_properties(n,this),a=i.mp.get_config("track_links_timeout");i.event_handler(e,this,o),window.setTimeout(i.track_callback(r,s,o,!0),a),i.mp.track(t,s,i.track_callback(r,s,o))}))}),this),!0;E.error("The DOM query ("+e+") returned 0 elements")},N.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(r,t)||i.after_track_handler(t,n,r))}},N.prototype.create_properties=function(e,t){return"function"===typeof e?e(t):A.extend({},e)};var F=function(){this.override_event="click"};A.inherit(F,N),F.prototype.create_properties=function(e,t){var n=F.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},F.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},F.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var L=function(){this.override_event="submit"};A.inherit(L,N),L.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},L.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var j=k("lock"),U=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};U.prototype.withLock=function(e,t,n){n||"function"===typeof t||(n=t,t=null);var r=n||(new Date).getTime()+"|"+Math.random(),i=(new Date).getTime(),o=this.storageKey,s=this.pollIntervalMS,a=this.timeoutMS,c=this.storage,u=o+":X",l=o+":Y",d=o+":Z",f=function(e){t&&t(e)},p=function(e){if((new Date).getTime()-i>a)return j.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+r+"]"),c.removeItem(d),c.removeItem(l),void g();setTimeout((function(){try{e()}catch(t){f(t)}}),s*(Math.random()+.1))},h=function(e,t){e()?t():p((function(){h(e,t)}))},m=function(){var e=c.getItem(l);if(e&&e!==r)return!1;if(c.setItem(l,r),c.getItem(l)===r)return!0;if(!C(c,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},g=function(){c.setItem(u,r),h(m,(function(){c.getItem(u)!==r?p((function(){c.getItem(l)===r?h((function(){return!c.getItem(d)}),y):g()})):y()}))},y=function(){c.setItem(d,"1");try{e()}finally{c.removeItem(d),c.getItem(l)===r&&c.removeItem(l),c.getItem(u)===r&&c.removeItem(u)}};try{if(!C(c,!0))throw new Error("localStorage support check failed");g()}catch(b){f(b)}};var Z=k("batch"),H=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||A.bind(Z.error,Z),this.lock=new U(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};H.prototype.enqueue=function(e,t,n){var r={id:O(),flushAfter:(new Date).getTime()+2*t,payload:e};this.lock.withLock(A.bind((function(){var t;try{var i=this.readFromStorage();i.push(r),(t=this.saveToStorage(i))&&this.memQueue.push(r)}catch(o){this.reportError("Error enqueueing item",e),t=!1}n&&n(t)}),this),A.bind((function(e){this.reportError("Error acquiring storage lock",e),n&&n(!1)}),this),this.pid)},H.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.lengtho.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}}return t};var z=function(e,t){var n=[];return A.each(e,(function(e){e.id&&!t[e.id]&&n.push(e)})),n};H.prototype.removeItemsByID=function(e,t){var n={};A.each(e,(function(e){n[e]=!0})),this.memQueue=z(this.memQueue,n);var r=A.bind((function(){var t;try{var r=this.readFromStorage();if(r=z(r,n),t=this.saveToStorage(r)){r=this.readFromStorage();for(var i=0;i=t)this.reportError("Network timeout; retrying"),this.flush();else if(A.isObject(o)&&o.xhr_req&&(o.xhr_req.status>=500||429===o.xhr_req.status||"timeout"===o.error)){var c=2*this.flushInterval,u=o.xhr_req.responseHeaders;if(u){var l=u["Retry-After"];l&&(c=1e3*parseInt(l,10)||c)}c=Math.min(6e5,c),this.reportError("Error; retry in "+c+" ms"),this.scheduleFlush(c)}else if(A.isObject(o)&&o.xhr_req&&413===o.xhr_req.status)if(i.length>1){var d=Math.max(1,Math.floor(r/2));this.batchSize=Math.min(this.batchSize,d,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),a=!0;else a=!0;a&&this.queue.removeItemsByID(A.map(i,(function(e){return e.id})),A.bind((function(e){e?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())}),this))}catch(f){this.reportError("Error handling API response",f),this.resetFlush()}}),this),c={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(c.transport="sendBeacon"),V.log("MIXPANEL REQUEST:",o),this.sendRequest(o,c,a)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}},W.prototype.reportError=function(e,t){if(V.error.apply(V.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(t){V.error(t)}};function q(e,t){ie(!0,e,t)}function $(e,t){ie(!1,e,t)}function K(e,t){return"1"===re(e,t)}function Y(e,n){if(function(e){if(e&&e.ignoreDnt)return!1;var n=e&&e.window||t,r=n.navigator||{},i=!1;return A.each([r.doNotTrack,r.msDoNotTrack,n.doNotTrack],(function(e){A.includes([!0,1,"1","yes"],e)&&(i=!0)})),i}(n))return E.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r="0"===re(e,n);return r&&E.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function X(e){return oe(e,(function(e){return this.get_config(e)}))}function J(e){return oe(e,(function(e){return this._get_config(e)}))}function Q(e){return oe(e,(function(e){return this._get_config(e)}))}function ee(e,t){te(t=t||{}).remove(ne(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function te(e){return"localStorage"===(e=e||{}).persistenceType?A.localStorage:A.cookie}function ne(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function re(e,t){return te(t).get(ne(e,t))}function ie(e,t,n){A.isString(t)&&t.length?(te(n=n||{}).set(ne(t,n),e?1:0,A.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):E.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function oe(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");r&&(n=Y(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(u){E.error("Unexpected error when checking tracking opt-out status: "+u)}if(!n)return e.apply(this,arguments);var c=arguments[arguments.length-1];"function"===typeof c&&c(0)}}var se="$set",ae="$set_once",ce="$unset",ue="$add",le="$append",de="$union",fe="$remove",pe={set_action:function(e,t){var n={},r={};return A.isObject(e)?A.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=e)}),this):r[e]=t,n.$set=r,n},unset_action:function(e){var t={},n=[];return A.isArray(e)||(e=[e]),A.each(e,(function(e){this._is_reserved_property(e)||n.push(e)}),this),t.$unset=n,t},set_once_action:function(e,t){var n={},r={};return A.isObject(e)?A.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=e)}),this):r[e]=t,n.$set_once=r,n},union_action:function(e,t){var n={},r={};return A.isObject(e)?A.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=A.isArray(e)?e:[e])}),this):r[e]=A.isArray(t)?t:[t],n.$union=r,n},append_action:function(e,t){var n={},r={};return A.isObject(e)?A.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=e)}),this):r[e]=t,n.$append=r,n},remove_action:function(e,t){var n={},r={};return A.isObject(e)?A.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=e)}),this):r[e]=t,n.$remove=r,n},delete_action:function(){var e={$delete:""};return e}},he=function(){};A.extend(he.prototype,pe),he.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},he.prototype.set=Q((function(e,t,n){var r=this.set_action(e,t);return A.isObject(e)&&(n=t),this._send_request(r,n)})),he.prototype.set_once=Q((function(e,t,n){var r=this.set_once_action(e,t);return A.isObject(e)&&(n=t),this._send_request(r,n)})),he.prototype.unset=Q((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),he.prototype.union=Q((function(e,t,n){A.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)})),he.prototype.delete=Q((function(e){var t=this.delete_action();return this._send_request(t,e)})),he.prototype.remove=Q((function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)})),he.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=A.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/groups/",batcher:this._mixpanel.request_batchers.groups},t)},he.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},he.prototype._get_config=function(e){return this._mixpanel.get_config(e)},he.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},he.prototype.remove=he.prototype.remove,he.prototype.set=he.prototype.set,he.prototype.set_once=he.prototype.set_once,he.prototype.union=he.prototype.union,he.prototype.unset=he.prototype.unset,he.prototype.toString=he.prototype.toString;var me=function(){};A.extend(me.prototype,pe),me.prototype._init=function(e){this._mixpanel=e},me.prototype.set=J((function(e,t,n){var r=this.set_action(e,t);return A.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r.$set=A.extend({},A.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),r.$set),this._send_request(r,n)})),me.prototype.set_once=J((function(e,t,n){var r=this.set_once_action(e,t);return A.isObject(e)&&(n=t),this._send_request(r,n)})),me.prototype.unset=J((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),me.prototype.increment=J((function(e,t,n){var r={},i={};return A.isObject(e)?(A.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void E.error("Invalid increment value passed to mixpanel.people.increment - must be a number");i[t]=e}}),this),n=t):(A.isUndefined(t)&&(t=1),i[e]=t),r.$add=i,this._send_request(r,n)})),me.prototype.append=J((function(e,t,n){A.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)})),me.prototype.remove=J((function(e,t,n){A.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)})),me.prototype.union=J((function(e,t,n){A.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)})),me.prototype.track_charge=J((function(e,t,n){if(A.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",A.extend({$amount:e},t),n);E.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),me.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},me.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}E.error("mixpanel.people.delete_user() requires you to call identify() first")},me.prototype.toString=function(){return this._mixpanel.toString()+".people"},me.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=A.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),A.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),A.truncate(o,255))},me.prototype._get_config=function(e){return this._mixpanel.get_config(e)},me.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},me.prototype._enqueue=function(e){se in e?this._mixpanel.persistence._add_to_people_queue(se,e):ae in e?this._mixpanel.persistence._add_to_people_queue(ae,e):ce in e?this._mixpanel.persistence._add_to_people_queue(ce,e):ue in e?this._mixpanel.persistence._add_to_people_queue(ue,e):le in e?this._mixpanel.persistence._add_to_people_queue(le,e):fe in e?this._mixpanel.persistence._add_to_people_queue(fe,e):de in e?this._mixpanel.persistence._add_to_people_queue(de,e):E.error("Invalid call to _enqueue():",e)},me.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=A.extend({},this._mixpanel.persistence._get_queue(e)),s=o;A.isUndefined(o)||!A.isObject(o)||A.isEmptyObject(o)||(i._mixpanel.persistence._pop_from_people_queue(e,o),r&&(s=r(o)),t.call(i,s,(function(t,r){0===t&&i._mixpanel.persistence._add_to_people_queue(e,o),A.isUndefined(n)||n(t,r)})))},me.prototype._flush=function(e,t,n,r,i,o,s){var a=this,c=this._mixpanel.persistence._get_queue(le),u=this._mixpanel.persistence._get_queue(fe);if(this._flush_one_queue(se,this.set,e),this._flush_one_queue(ae,this.set_once,r),this._flush_one_queue(ce,this.unset,o,(function(e){return A.keys(e)})),this._flush_one_queue(ue,this.increment,t),this._flush_one_queue(de,this.union,i),!A.isUndefined(c)&&A.isArray(c)&&c.length){for(var l,d=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(le,l),A.isUndefined(n)||n(e,t)},f=c.length-1;f>=0;f--)l=c.pop(),A.isEmptyObject(l)||a.append(l,d);a._mixpanel.persistence.save()}if(!A.isUndefined(u)&&A.isArray(u)&&u.length){for(var p,h=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(fe,p),A.isUndefined(s)||s(e,t)},m=u.length-1;m>=0;m--)p=u.pop(),A.isEmptyObject(p)||a.remove(p,h);a._mixpanel.persistence.save()}},me.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},me.prototype.set=me.prototype.set,me.prototype.set_once=me.prototype.set_once,me.prototype.unset=me.prototype.unset,me.prototype.increment=me.prototype.increment,me.prototype.append=me.prototype.append,me.prototype.remove=me.prototype.remove,me.prototype.union=me.prototype.union,me.prototype.track_charge=me.prototype.track_charge,me.prototype.clear_charges=me.prototype.clear_charges,me.prototype.delete_user=me.prototype.delete_user,me.prototype.toString=me.prototype.toString;var ge,ye,be="__mps",ve="__mpso",we="__mpus",xe="__mpa",Ae="__mpap",Ee="__mpr",_e="__mpu",ke="$people_distinct_id",Te="__alias",Se="__timers",Ce=[be,ve,we,xe,Ae,Ee,_e,ke,Te,Se],Ie=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(E.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&A.localStorage.is_supported()?this.storage=A.localStorage:this.storage=A.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};Ie.prototype.properties=function(){var e={};return A.each(this.props,(function(t,n){A.include(Ce,n)||(e[n]=t)})),e},Ie.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=A.extend({},e))}},Ie.prototype.upgrade=function(e){var t,n,r=e.upgrade;r&&(t="mp_super_properties","string"===typeof r&&(t=r),n=this.storage.parse(t),this.storage.remove(t),this.storage.remove(t,!0),n&&(this.props=A.extend(this.props,n.all,n.events))),e.cookie_name||"mixpanel"===e.name||(t="mp_"+e.token+"_"+e.name,(n=this.storage.parse(t))&&(this.storage.remove(t),this.storage.remove(t,!0),this.register_once(n))),this.storage===A.localStorage&&(n=A.cookie.parse(this.name),A.cookie.remove(this.name),A.cookie.remove(this.name,!0),n&&this.register_once(n))},Ie.prototype.save=function(){this.disabled||this.storage.set(this.name,A.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Ie.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Ie.prototype.clear=function(){this.remove(),this.props={}},Ie.prototype.register_once=function(e,t,n){return!!A.isObject(e)&&("undefined"===typeof t&&(t="None"),this.expire_days="undefined"===typeof n?this.default_expiry:n,A.each(e,(function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)}),this),this.save(),!0)},Ie.prototype.register=function(e,t){return!!A.isObject(e)&&(this.expire_days="undefined"===typeof t?this.default_expiry:t,A.extend(this.props,e),this.save(),!0)},Ie.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())},Ie.prototype.update_campaign_params=function(){this.campaign_params_saved||(this.register_once(A.info.campaignParams()),this.campaign_params_saved=!0)},Ie.prototype.update_search_keyword=function(e){this.register(A.info.searchInfo(e))},Ie.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:A.info.referringDomain(e)||"$direct"},"")},Ie.prototype.get_referrer_info=function(){return A.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Ie.prototype.safe_merge=function(e){return A.each(this.props,(function(t,n){n in e||(e[n]=t)})),e},Ie.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Ie.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Ie.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Ie.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Ie.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Ie.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Ie.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Ie.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(se),o=this._get_or_create_queue(ae),s=this._get_or_create_queue(ce),a=this._get_or_create_queue(ue),c=this._get_or_create_queue(de),u=this._get_or_create_queue(fe,[]),l=this._get_or_create_queue(le,[]);n===be?(A.extend(i,r),this._pop_from_people_queue(ue,r),this._pop_from_people_queue(de,r),this._pop_from_people_queue(ce,r)):n===ve?(A.each(r,(function(e,t){t in o||(o[t]=e)})),this._pop_from_people_queue(ce,r)):n===we?A.each(r,(function(e){A.each([i,o,a,c],(function(t){e in t&&delete t[e]})),A.each(l,(function(t){e in t&&delete t[e]})),s[e]=!0})):n===xe?(A.each(r,(function(e,t){t in i?i[t]+=e:(t in a||(a[t]=0),a[t]+=e)}),this),this._pop_from_people_queue(ce,r)):n===_e?(A.each(r,(function(e,t){A.isArray(e)&&(t in c||(c[t]=[]),c[t]=c[t].concat(e))})),this._pop_from_people_queue(ce,r)):n===Ee?(u.push(r),this._pop_from_people_queue(le,r)):n===Ae&&(l.push(r),this._pop_from_people_queue(ce,r)),E.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),E.log(t),this.save()},Ie.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);A.isUndefined(n)||(A.each(t,(function(t,r){e===le||e===fe?A.each(n,(function(e){e[r]===t&&delete e[r]})):delete n[r]}),this),this.save())},Ie.prototype._get_queue_key=function(e){return e===se?be:e===ae?ve:e===ce?we:e===ue?xe:e===le?Ae:e===fe?Ee:e===de?_e:void E.error("Invalid queue:",e)},Ie.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]},Ie.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=A.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},Ie.prototype.set_event_timer=function(e,t){var n=this.props.__timers||{};n[e]=t,this.props.__timers=n,this.save()},Ie.prototype.remove_event_timer=function(e){var t=(this.props.__timers||{})[e];return A.isUndefined(t)||(delete this.props.__timers[e],this.save()),t};var Oe=function(e){return e},Re=function(){},De="mixpanel",Pe="base64",Be=t.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Me=!Be&&-1===m.indexOf("MSIE")&&-1===m.indexOf("Mozilla"),Ne=null;d.sendBeacon&&(Ne=function(){return d.sendBeacon.apply(d,arguments)});var Fe={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:Pe,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Re,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Re,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{}},Le=!1,je=function(){},Ue=function(e,t,r){var i,o=r===De?ye:ye[r];if(o&&0===ge)i=o;else{if(o&&!A.isArray(o))return void E.error("You have already initialized "+r);i=new je}return i._cached_groups={},i._init(e,t,r),i.people=new me,i.people._init(i),n.DEBUG=n.DEBUG||i.get_config("debug"),!A.isUndefined(o)&&A.isArray(o)&&(i._execute_array.call(i.people,o.people),i._execute_array(o)),i};je.prototype.init=function(e,t,n){if(A.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==De){var r=Ue(e,t,n);return ye[n]=r,r._loaded(),r}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},je.prototype._init=function(e,n,r){n=n||{},this.__loaded=!0,this.config={};var i={};"api_payload_format"in n||(n.api_host||Fe.api_host).match(/\.mixpanel\.com$/)&&(i.api_payload_format="json");if(this.set_config(A.extend({},Fe,i,n,{name:r,token:e,callback_fn:(r===De?r:"mixpanel."+r)+"._jsc"})),this._jsc=Re,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(A.localStorage.is_supported(!0)&&Be){if(this.init_batchers(),Ne&&t.addEventListener){var o=A.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);t.addEventListener("pagehide",(function(e){e.persisted&&o()})),t.addEventListener("visibilitychange",(function(){"hidden"===f.visibilityState&&o()}))}}else this._batch_requests=!1,E.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");this.persistence=this.cookie=new Ie(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=A.UUID();this.get_distinct_id()||this.register_once({distinct_id:s,$device_id:s},"")},je.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()},je.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(f.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(f.referrer)},je.prototype._dom_loaded=function(){A.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||A.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},je.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!Le)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},je.prototype._prepare_callback=function(e,t){if(A.isUndefined(e))return null;if(Be){return function(n){e(n,t)}}var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i},je.prototype._send_request=function(e,t,n,r){var i=!0;if(Me)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;r||!A.isFunction(n)&&"string"!==typeof n||(r=n,n=null),n=A.extend(o,n||{}),Be||(n.method="GET");var a="POST"===n.method,c=Ne&&a&&"sendbeacon"===n.transport.toLowerCase(),u=n.verbose;t.verbose&&(u=!0),this.get_config("test")&&(t.test=1),u&&(t.verbose=1),this.get_config("img")&&(t.img=1),Be||(r?t.callback=r:(u||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),e+="?"+A.HTTPBuildQuery(t);var l=this;if("img"in t){var d=f.createElement("img");d.src=e,f.body.appendChild(d)}else if(c){try{i=Ne(e,s)}catch(b){l.report_error(b),i=!1}try{r&&r(i?1:0)}catch(b){l.report_error(b)}}else if(Be)try{var p=new XMLHttpRequest;p.open(n.method,e,!0);var h=this.get_config("xhr_headers");if(a&&(h["Content-Type"]="application/x-www-form-urlencoded"),A.each(h,(function(e,t){p.setRequestHeader(t,e)})),n.timeout_ms&&"undefined"!==typeof p.timeout){p.timeout=n.timeout_ms;var m=(new Date).getTime()}p.withCredentials=!0,p.onreadystatechange=function(){var e;if(4===p.readyState)if(200===p.status){if(r)if(u){var t;try{t=A.JSONDecode(p.responseText)}catch(b){if(l.report_error(b),!n.ignore_json_errors)return;t=p.responseText}r(t)}else r(Number(p.responseText))}else e=p.timeout&&!p.status&&(new Date).getTime()-m>=p.timeout?"timeout":"Bad HTTP status: "+p.status+" "+p.statusText,l.report_error(e),r&&r(u?{status:0,error:e,xhr_req:p}:0)},p.send(s)}catch(b){l.report_error(b),i=!1}else{var g=f.createElement("script");g.type="text/javascript",g.async=!0,g.defer=!0,g.src=e;var y=f.getElementsByTagName("script")[0];y.parentNode.insertBefore(g,y)}return i},je.prototype._execute_array=function(e){var t,n=[],r=[],i=[];A.each(e,(function(e){e&&(t=e[0],A.isArray(t)?i.push(e):"function"===typeof e?e.call(this):A.isArray(e)&&"alias"===t?n.push(e):A.isArray(e)&&-1!==t.indexOf("track")&&"function"===typeof this[t]?i.push(e):r.push(e))}),this);var o=function(e,t){A.each(e,(function(e){if(A.isArray(e[0])){var n=t;A.each(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(n,this),o(r,this),o(i,this)},je.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},je.prototype.init_batchers=function(){var e=this.get_config("token");if(!this.are_batchers_initialized()){var t=A.bind((function(t){return new W("__mpq_"+e+t.queue_suffix,{libConfig:this.config,sendRequestFunc:A.bind((function(e,n,r){this._send_request(this.get_config("api_host")+t.endpoint,this._encode_data_for_request(e),n,this._prepare_callback(r,e))}),this),beforeSendHook:A.bind((function(e){return this._run_hook("before_send_"+t.type,e)}),this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:A.bind(this.stop_batch_senders,this)})}),this);this.request_batchers={events:t({type:"events",endpoint:"/track/",queue_suffix:"_ev"}),people:t({type:"people",endpoint:"/engage/",queue_suffix:"_pp"}),groups:t({type:"groups",endpoint:"/groups/",queue_suffix:"_gr"})}}this.get_config("batch_autostart")&&this.start_batch_senders()},je.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,A.each(this.request_batchers,(function(e){e.start()})))},je.prototype.stop_batch_senders=function(){this._batch_requests=!1,A.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},je.prototype.push=function(e){this._execute_array([e])},je.prototype.disable=function(e){"undefined"===typeof e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},je.prototype._encode_data_for_request=function(e){var t=A.JSONEncode(e);return this.get_config("api_payload_format")===Pe&&(t=A.base64Encode(t)),{data:t}},je.prototype._track_or_batch=function(e,t){var n=A.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||Re;var a=!0,c=A.bind((function(){return s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(E.log("MIXPANEL REQUEST:"),E.log(n),this._send_request(r,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null}),this);return this._batch_requests&&!o?i.enqueue(n,(function(e){e?t(1,n):c()})):a=c(),a&&n},je.prototype.track=X((function(e,t,n,r){r||"function"!==typeof n||(r=n,n=null);var i=(n=n||{}).transport;i&&(n.transport=i);var o=n.send_immediately;if("function"!==typeof r&&(r=Re),A.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=t||{}).token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!A.isUndefined(s)){var a=(new Date).getTime()-s;t.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops(),t=A.extend({},A.info.properties(),this.persistence.properties(),this.unpersisted_superprops,t);var c=this.get_config("property_blacklist");A.isArray(c)?A.each(c,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+c);var u={event:e,properties:t};return this._track_or_batch({type:"events",data:u,endpoint:this.get_config("api_host")+"/track/",batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},r)}r(0)}})),je.prototype.set_group=X((function(e,t,n){A.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)})),je.prototype.add_group=X((function(e,t,n){var r=this.get_property(e);if(void 0===r){var i={};i[e]=[t],this.register(i)}else-1===r.indexOf(t)&&(r.push(t),this.register(i));return this.people.union(e,t,n)})),je.prototype.remove_group=X((function(e,t,n){var r=this.get_property(e);if(void 0!==r){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),0===r.length&&this.unregister(e)}return this.people.remove(e,t,n)})),je.prototype.track_with_groups=X((function(e,t,n,r){var i=A.extend({},t||{});return A.each(n,(function(e,t){null!==e&&void 0!==e&&(i[t]=e)})),this.track(e,i,r)})),je.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},je.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},je.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return void 0!==r&&r._group_key===e&&r._group_id===t||((r=new he)._init(this,e,t),this._cached_groups[n]=r),r},je.prototype.track_pageview=function(e){A.isUndefined(e)&&(e=f.location.href),this.track("mp_page_view",A.info.pageviewInfo(e))},je.prototype.track_links=function(){return this._track_dom.call(this,F,arguments)},je.prototype.track_forms=function(){return this._track_dom.call(this,L,arguments)},je.prototype.time_event=function(e){A.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var Ze={persistent:!0},He=function(e){var t;return t=A.isObject(e)?e:A.isUndefined(e)?{}:{days:e},A.extend({},Ze,t)};je.prototype.register=function(e,t){var n=He(t);n.persistent?this.persistence.register(e,n.days):A.extend(this.unpersisted_superprops,e)},je.prototype.register_once=function(e,t,n){var r=He(n);r.persistent?this.persistence.register_once(e,t,r.days):("undefined"===typeof t&&(t="None"),A.each(e,(function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)}),this))},je.prototype.unregister=function(e,t){(t=He(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},je.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},je.prototype.identify=function(e,t,n,r,i,o,s,a){var c=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var u=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==c&&e!==this.get_property(Te)&&(this.unregister(Te),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,s,a),e!==c&&this.track("$identify",{distinct_id:e,$anon_distinct_id:c},{skip_hooks:!0})},je.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=A.UUID();this.register_once({distinct_id:e,$device_id:e},"")},je.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},je.prototype.alias=function(e,t){if(e===this.get_property(ke))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return A.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Te,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},(function(){n.identify(e)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},je.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},je.prototype.set_config=function(e){A.isObject(e)&&(A.extend(this.config,e),e.batch_size&&A.each(this.request_batchers,(function(e){e.resetBatchSize()})),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),n.DEBUG=n.DEBUG||this.get_config("debug"))},je.prototype.get_config=function(e){return this.config[e]},je.prototype._run_hook=function(e){var t=(this.config.hooks[e]||Oe).apply(this,a.call(arguments,1));return"undefined"===typeof t&&(this.report_error(e+" hook did not return a value"),t=null),t},je.prototype.get_property=function(e){return this.persistence.props[e]},je.prototype.toString=function(){var e=this.get_config("name");return e!==De&&(e="mixpanel."+e),e},je.prototype._event_is_disabled=function(e){return A.isBlockedUA(m)||this._flags.disable_all_events||A.include(this.__disabled_events,e)},je.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&A.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!A.cookie.get("mp_optout")||(A.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},je.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t&&A.each(this.request_batchers,(function(e){e.clear()}))},je.prototype._gdpr_call_func=function(e,t){return t=A.extend({track:A.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),A.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},je.prototype.opt_in_tracking=function(e){e=A.extend({enable_persistence:!0},e),this._gdpr_call_func(q,e),this._gdpr_update_persistence(e)},je.prototype.opt_out_tracking=function(e){(e=A.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func($,e),this._gdpr_update_persistence(e)},je.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(K,e)},je.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(Y,e)},je.prototype.clear_opt_in_out_tracking=function(e){e=A.extend({enable_persistence:!0},e),this._gdpr_call_func(ee,e),this._gdpr_update_persistence(e)},je.prototype.report_error=function(e,t){E.error.apply(E.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(t){E.error(t)}},je.prototype.init=je.prototype.init,je.prototype.reset=je.prototype.reset,je.prototype.disable=je.prototype.disable,je.prototype.time_event=je.prototype.time_event,je.prototype.track=je.prototype.track,je.prototype.track_links=je.prototype.track_links,je.prototype.track_forms=je.prototype.track_forms,je.prototype.track_pageview=je.prototype.track_pageview,je.prototype.register=je.prototype.register,je.prototype.register_once=je.prototype.register_once,je.prototype.unregister=je.prototype.unregister,je.prototype.identify=je.prototype.identify,je.prototype.alias=je.prototype.alias,je.prototype.name_tag=je.prototype.name_tag,je.prototype.set_config=je.prototype.set_config,je.prototype.get_config=je.prototype.get_config,je.prototype.get_property=je.prototype.get_property,je.prototype.get_distinct_id=je.prototype.get_distinct_id,je.prototype.toString=je.prototype.toString,je.prototype.opt_out_tracking=je.prototype.opt_out_tracking,je.prototype.opt_in_tracking=je.prototype.opt_in_tracking,je.prototype.has_opted_out_tracking=je.prototype.has_opted_out_tracking,je.prototype.has_opted_in_tracking=je.prototype.has_opted_in_tracking,je.prototype.clear_opt_in_out_tracking=je.prototype.clear_opt_in_out_tracking,je.prototype.get_group=je.prototype.get_group,je.prototype.set_group=je.prototype.set_group,je.prototype.add_group=je.prototype.add_group,je.prototype.remove_group=je.prototype.remove_group,je.prototype.track_with_groups=je.prototype.track_with_groups,je.prototype.start_batch_senders=je.prototype.start_batch_senders,je.prototype.stop_batch_senders=je.prototype.stop_batch_senders,Ie.prototype.properties=Ie.prototype.properties,Ie.prototype.update_search_keyword=Ie.prototype.update_search_keyword,Ie.prototype.update_referrer_info=Ie.prototype.update_referrer_info,Ie.prototype.get_cross_subdomain=Ie.prototype.get_cross_subdomain,Ie.prototype.clear=Ie.prototype.clear;var ze={},Ge=function(){ye.init=function(e,n,r){if(r)return ye[r]||(ye[r]=ze[r]=Ue(e,n,r),ye[r]._loaded()),ye[r];var i=ye;ze.mixpanel?i=ze.mixpanel:e&&((i=Ue(e,n,De))._loaded(),ze.mixpanel=i),ye=i,1===ge&&(t.mixpanel=ye),A.each(ze,(function(e,t){t!==De&&(ye[t]=e)})),ye._=A}};var Ve=(ge=0,ye=new je,Ge(),ye.init(),function(){function e(){e.done||(e.done=!0,Le=!0,Me=!1,A.each(ze,(function(e){e._dom_loaded()})))}if(f.addEventListener)"complete"===f.readyState?e():f.addEventListener("DOMContentLoaded",e,!1);else if(f.attachEvent){f.attachEvent("onreadystatechange",e);var n=!1;try{n=null===t.frameElement}catch(r){}f.documentElement.doScroll&&n&&function t(){try{f.documentElement.doScroll("left")}catch(r){return void setTimeout(t,1)}e()}()}A.register_event(t,"load",e,!0)}(),ye);e.exports=Ve},77913:function(e,t,n){"use strict";var r=n(85696);t.default=void 0;var i,o=(i=n(67294))&&i.__esModule?i:{default:i},s=n(12199),a=n(61587),c=n(27215);var u={};function l(e,t,n,r){if(e&&s.isLocalURL(t)){e.prefetch(t,n,r).catch((function(e){0}));var i=r&&"undefined"!==typeof r.locale?r.locale:e&&e.locale;u[t+"%"+n+(i?"%"+i:"")]=!0}}var d=function(e){var t,n=!1!==e.prefetch,i=a.useRouter(),d=o.default.useMemo((function(){var t=s.resolveHref(i,e.href,!0),n=r(t,2),o=n[0],a=n[1];return{href:o,as:e.as?s.resolveHref(i,e.as):a||o}}),[i,e.href,e.as]),f=d.href,p=d.as,h=e.children,m=e.replace,g=e.shallow,y=e.scroll,b=e.locale;"string"===typeof h&&(h=o.default.createElement("a",null,h));var v=(t=o.default.Children.only(h))&&"object"===typeof t&&t.ref,w=c.useIntersection({rootMargin:"200px"}),x=r(w,2),A=x[0],E=x[1],_=o.default.useCallback((function(e){A(e),v&&("function"===typeof v?v(e):"object"===typeof v&&(v.current=e))}),[v,A]);o.default.useEffect((function(){var e=E&&n&&s.isLocalURL(f),t="undefined"!==typeof b?b:i&&i.locale,r=u[f+"%"+p+(t?"%"+t:"")];e&&!r&&l(i,f,p,{locale:t})}),[p,f,E,b,n,i]);var k={ref:_,onClick:function(e){t.props&&"function"===typeof t.props.onClick&&t.props.onClick(e),e.defaultPrevented||function(e,t,n,r,i,o,a,c){("A"!==e.currentTarget.nodeName.toUpperCase()||!function(e){var t=e.currentTarget.target;return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)&&s.isLocalURL(n))&&(e.preventDefault(),t[i?"replace":"push"](n,r,{shallow:o,locale:c,scroll:a}))}(e,i,f,p,m,g,y,b)},onMouseEnter:function(e){t.props&&"function"===typeof t.props.onMouseEnter&&t.props.onMouseEnter(e),s.isLocalURL(f)&&l(i,f,p,{priority:!0})}};if(e.passHref||"a"===t.type&&!("href"in t.props)){var T="undefined"!==typeof b?b:i&&i.locale,S=i&&i.isLocaleDomain&&s.getDomainLocale(p,T,i&&i.locales,i&&i.domainLocales);k.href=S||s.addBasePath(s.addLocale(p,T,i&&i.defaultLocale))}return o.default.cloneElement(t,k)};t.default=d},27215:function(e,t,n){"use strict";var r=n(85696);Object.defineProperty(t,"__esModule",{value:!0}),t.useIntersection=function(e){var t=e.rootRef,n=e.rootMargin,u=e.disabled||!s,l=i.useRef(),d=i.useState(!1),f=r(d,2),p=f[0],h=f[1],m=i.useState(t?t.current:null),g=r(m,2),y=g[0],b=g[1],v=i.useCallback((function(e){l.current&&(l.current(),l.current=void 0),u||p||e&&e.tagName&&(l.current=function(e,t,n){var r=function(e){var t,n={root:e.root||null,margin:e.rootMargin||""},r=c.find((function(e){return e.root===n.root&&e.margin===n.margin}));r?t=a.get(r):(t=a.get(n),c.push(n));if(t)return t;var i=new Map,o=new IntersectionObserver((function(e){e.forEach((function(e){var t=i.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)}))}),e);return a.set(n,t={id:n,observer:o,elements:i}),t}(n),i=r.id,o=r.observer,s=r.elements;return s.set(e,t),o.observe(e),function(){if(s.delete(e),o.unobserve(e),0===s.size){o.disconnect(),a.delete(i);var t=c.findIndex((function(e){return e.root===i.root&&e.margin===i.margin}));t>-1&&c.splice(t,1)}}}(e,(function(e){return e&&h(e)}),{root:y,rootMargin:n}))}),[u,y,n,p]);return i.useEffect((function(){if(!s&&!p){var e=o.requestIdleCallback((function(){return h(!0)}));return function(){return o.cancelIdleCallback(e)}}}),[p]),i.useEffect((function(){t&&b(t.current)}),[t]),[v,p]};var i=n(67294),o=n(98065),s="undefined"!==typeof IntersectionObserver;var a=new Map,c=[]},17285:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AmpStateContext=void 0;var i=((r=n(67294))&&r.__esModule?r:{default:r}).default.createContext({});t.AmpStateContext=i},49546:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInAmpMode=s,t.useAmp=function(){return s(i.default.useContext(o.AmpStateContext))};var r,i=(r=n(67294))&&r.__esModule?r:{default:r},o=n(17285);function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ampFirst,n=void 0!==t&&t,r=e.hybrid,i=void 0!==r&&r,o=e.hasQuery,s=void 0!==o&&o;return n||i&&s}},16505:function(e,t,n){"use strict";var r=n(930);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}Object.defineProperty(t,"__esModule",{value:!0}),t.defaultHead=d,t.default=void 0;var o,s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(67294)),a=(o=n(70148))&&o.__esModule?o:{default:o},c=n(17285),u=n(60523),l=n(49546);n(67206);function d(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[s.default.createElement("meta",{charSet:"utf-8"})];return e||t.push(s.default.createElement("meta",{name:"viewport",content:"width=device-width"})),t}function f(e,t){return"string"===typeof t||"number"===typeof t?e:t.type===s.default.Fragment?e.concat(s.default.Children.toArray(t.props.children).reduce((function(e,t){return"string"===typeof t||"number"===typeof t?e:e.concat(t)}),[])):e.concat(t)}var p=["name","httpEquiv","charSet","itemProp"];function h(e,t){return e.reduce((function(e,t){var n=s.default.Children.toArray(t.props.children);return e.concat(n)}),[]).reduce(f,[]).reverse().concat(d(t.inAmpMode)).filter(function(){var e=new Set,t=new Set,n=new Set,r={};return function(i){var o=!0,s=!1;if(i.key&&"number"!==typeof i.key&&i.key.indexOf("$")>0){s=!0;var a=i.key.slice(i.key.indexOf("$")+1);e.has(a)?o=!1:e.add(a)}switch(i.type){case"title":case"base":t.has(i.type)?o=!1:t.add(i.type);break;case"meta":for(var c=0,u=p.length;c>16&255)/255,(e>>8&255)/255,(255&e)/255]}["SCREEN","LINEAR_LIGHT"].reduce((function(e,t,n){return Object.assign(e,(0,i.Z)({},t,n))}),{});var p=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,c.Z)(this,e);var o=this,l=-1!==document.location.search.toLowerCase().indexOf("debug=webgl");o.canvas=t,o.gl=o.canvas.getContext("webgl",{antialias:!0}),o.meshes=[];var d=o.gl;n&&r&&this.setSize(n,r),o.lastDebugMsg,o.debug=i&&l?function(e){var t,n=new Date;n-o.lastDebugMsg>1e3&&console.log("---"),(t=console).log.apply(t,[n.toLocaleTimeString()+Array(Math.max(0,32-e.length)).join(" ")+e+": "].concat((0,a.Z)(Array.from(arguments).slice(1)))),o.lastDebugMsg=n}:function(){},Object.defineProperties(o,{Material:{enumerable:!1,value:function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,c.Z)(this,e);var i=this;function a(e,t){var n=d.createShader(e);return d.shaderSource(n,t),d.compileShader(n),d.getShaderParameter(n,d.COMPILE_STATUS)||console.error(d.getShaderInfoLog(n)),o.debug("Material.compileShaderSource",{source:t}),n}function u(e,t){return Object.entries(e).map((function(e){var n=(0,s.Z)(e,2),r=n[0];return n[1].getDeclaration(r,t)})).join("\n")}i.uniforms=r,i.uniformInstances=[];var l="\n precision highp float;\n ";i.vertexSource="\n ".concat(l,"\n attribute vec4 position;\n attribute vec2 uv;\n attribute vec2 uvNorm;\n ").concat(u(o.commonUniforms,"vertex"),"\n ").concat(u(r,"vertex"),"\n ").concat(t,"\n "),i.Source="\n ".concat(l,"\n ").concat(u(o.commonUniforms,"fragment"),"\n ").concat(u(r,"fragment"),"\n ").concat(n,"\n "),i.vertexShader=a(d.VERTEX_SHADER,i.vertexSource),i.fragmentShader=a(d.FRAGMENT_SHADER,i.Source),i.program=d.createProgram(),d.attachShader(i.program,i.vertexShader),d.attachShader(i.program,i.fragmentShader),d.linkProgram(i.program),d.getProgramParameter(i.program,d.LINK_STATUS)||console.error(d.getProgramInfoLog(i.program)),d.useProgram(i.program),i.attachUniforms(void 0,o.commonUniforms),i.attachUniforms(void 0,i.uniforms)}return(0,u.Z)(e,[{key:"attachUniforms",value:function(e,t){var n=this;void 0===e?Object.entries(t).forEach((function(e){var t=(0,s.Z)(e,2),r=t[0],i=t[1];n.attachUniforms(r,i)})):"array"==t.type?t.value.forEach((function(t,r){return n.attachUniforms("".concat(e,"[").concat(r,"]"),t)})):"struct"==t.type?Object.entries(t.value).forEach((function(t){var r=(0,s.Z)(t,2),i=r[0],o=r[1];return n.attachUniforms("".concat(e,".").concat(i),o)})):(o.debug("Material.attachUniforms",{name:e,uniform:t}),n.uniformInstances.push({uniform:t,location:d.getUniformLocation(n.program,e)}))}}]),e}()},Uniform:{enumerable:!1,value:function(){function e(t){(0,c.Z)(this,e),this.type="float",Object.assign(this,t),this.typeFn={float:"1f",int:"1i",vec2:"2fv",vec3:"3fv",vec4:"4fv",mat4:"Matrix4fv"}[this.type]||"1f",this.update()}return(0,u.Z)(e,[{key:"update",value:function(e){void 0!==this.value&&d["uniform".concat(this.typeFn)](e,0===this.typeFn.indexOf("Matrix")?this.transpose:this.value,0===this.typeFn.indexOf("Matrix")?this.value:null)}},{key:"getDeclaration",value:function(e,t,n){var r=this;if(r.excludeFrom!==t){if("array"===r.type)return r.value[0].getDeclaration(e,t,r.value.length)+"\nconst int ".concat(e,"_length = ").concat(r.value.length,";");if("struct"===r.type){var i=e.replace("u_","");return i=i.charAt(0).toUpperCase()+i.slice(1),"uniform struct ".concat(i,"\n {\n")+Object.entries(r.value).map((function(e){var n=(0,s.Z)(e,2),r=n[0];return n[1].getDeclaration(r,t).replace(/^uniform/,"")})).join("")+"\n} ".concat(e).concat(n>0?"[".concat(n,"]"):"",";")}return"uniform ".concat(r.type," ").concat(e).concat(n>0?"[".concat(n,"]"):"",";")}}}]),e}()},PlaneGeometry:{enumerable:!1,value:function(){function e(t,n,r,i,s){(0,c.Z)(this,e),d.createBuffer(),this.attributes={position:new o.Attribute({target:d.ARRAY_BUFFER,size:3}),uv:new o.Attribute({target:d.ARRAY_BUFFER,size:2}),uvNorm:new o.Attribute({target:d.ARRAY_BUFFER,size:2}),index:new o.Attribute({target:d.ELEMENT_ARRAY_BUFFER,size:3,type:d.UNSIGNED_SHORT})},this.setTopology(r,i),this.setSize(t,n,s)}return(0,u.Z)(e,[{key:"setTopology",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this;n.xSegCount=e,n.ySegCount=t,n.vertexCount=(n.xSegCount+1)*(n.ySegCount+1),n.quadCount=n.xSegCount*n.ySegCount*2,n.attributes.uv.values=new Float32Array(2*n.vertexCount),n.attributes.uvNorm.values=new Float32Array(2*n.vertexCount),n.attributes.index.values=new Uint16Array(3*n.quadCount);for(var r=0;r<=n.ySegCount;r++)for(var i=0;i<=n.xSegCount;i++){var s=r*(n.xSegCount+1)+i;if(n.attributes.uv.values[2*s]=i/n.xSegCount,n.attributes.uv.values[2*s+1]=1-r/n.ySegCount,n.attributes.uvNorm.values[2*s]=i/n.xSegCount*2-1,n.attributes.uvNorm.values[2*s+1]=1-r/n.ySegCount*2,i0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"xz",r=this;r.width=e,r.height=t,r.orientation=n,r.attributes.position.values&&r.attributes.position.values.length===3*r.vertexCount||(r.attributes.position.values=new Float32Array(3*r.vertexCount));for(var i=e/-2,s=t/-2,a=e/r.xSegCount,c=t/r.ySegCount,u=0;u<=r.ySegCount;u++)for(var l=s+u*c,d=0;d<=r.xSegCount;d++){var f=i+d*a,p=u*(r.xSegCount+1)+d;r.attributes.position.values[3*p+"xyz".indexOf(n[0])]=f,r.attributes.position.values[3*p+"xyz".indexOf(n[1])]=-l}r.attributes.position.update(),o.debug("Geometry.setSize",{position:r.attributes.position})}}]),e}()},Mesh:{enumerable:!1,value:function(){function e(t,n){(0,c.Z)(this,e);var r=this;r.geometry=t,r.material=n,r.wireframe=!1,r.attributeInstances=[],Object.entries(r.geometry.attributes).forEach((function(e){var t=(0,s.Z)(e,2),n=t[0],i=t[1];r.attributeInstances.push({attribute:i,location:i.attach(n,r.material.program)})})),o.meshes.push(r),o.debug("Mesh.constructor",{mesh:r})}return(0,u.Z)(e,[{key:"draw",value:function(){d.useProgram(this.material.program),this.material.uniformInstances.forEach((function(e){var t=e.uniform,n=e.location;return t.update(n)})),this.attributeInstances.forEach((function(e){var t=e.attribute,n=e.location;return t.use(n)})),d.drawElements(this.wireframe?d.LINES:d.TRIANGLES,this.geometry.attributes.index.values.length,d.UNSIGNED_SHORT,0)}},{key:"remove",value:function(){var e=this;o.meshes=o.meshes.filter((function(t){return t!=e}))}}]),e}()},Attribute:{enumerable:!1,value:function(){function e(t){(0,c.Z)(this,e),this.type=d.FLOAT,this.normalized=!1,this.buffer=d.createBuffer(),Object.assign(this,t),this.update()}return(0,u.Z)(e,[{key:"update",value:function(){void 0!==this.values&&(d.bindBuffer(this.target,this.buffer),d.bufferData(this.target,this.values,d.STATIC_DRAW))}},{key:"attach",value:function(e,t){var n=d.getAttribLocation(t,e);return this.target===d.ARRAY_BUFFER&&(d.enableVertexAttribArray(n),d.vertexAttribPointer(n,this.size,this.type,this.normalized,0,0)),n}},{key:"use",value:function(e){d.bindBuffer(this.target,this.buffer),this.target===d.ARRAY_BUFFER&&(d.enableVertexAttribArray(e),d.vertexAttribPointer(e,this.size,this.type,this.normalized,0,0))}}]),e}()}});var f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];o.commonUniforms={projectionMatrix:new o.Uniform({type:"mat4",value:f}),modelViewMatrix:new o.Uniform({type:"mat4",value:f}),resolution:new o.Uniform({type:"vec2",value:[1,1]}),aspectRatio:new o.Uniform({type:"float",value:1})}}return(0,u.Z)(e,[{key:"setSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:640,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:480;this.width=e,this.height=t,this.canvas.width=e,this.canvas.height=t,this.gl.viewport(0,0,e,t),this.commonUniforms.resolution.value=[e,t],this.commonUniforms.aspectRatio.value=e/t,this.debug("MiniGL.setSize",{width:e,height:t})}},{key:"setOrthographicCamera",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-2e3,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2e3;this.commonUniforms.projectionMatrix.value=[2/this.width,0,0,0,0,2/this.height,0,0,0,0,2/(r-i),0,e,t,n,1],this.debug("setOrthographicCamera",this.commonUniforms.projectionMatrix.value)}},{key:"render",value:function(){this.gl.clearColor(0,0,0,0),this.gl.clearDepth(1),this.meshes.forEach((function(e){return e.draw()}))}}]),e}();function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=function(){function e(){var t=this;(0,c.Z)(this,e),h(this,"el",void 0),h(this,"cssVarRetries",0),h(this,"maxCssVarRetries",200),h(this,"angle",0),h(this,"isLoadedClass",!1),h(this,"isScrolling",!1),h(this,"scrollingTimeout",void 0),h(this,"scrollingRefreshDelay",200),h(this,"isIntersecting",!1),h(this,"shaderFiles",void 0),h(this,"vertexShader",void 0),h(this,"sectionColors",void 0),h(this,"computedCanvasStyle",void 0),h(this,"conf",void 0),h(this,"uniforms",void 0),h(this,"t",1253106),h(this,"last",0),h(this,"width",void 0),h(this,"minWidth",1111),h(this,"height",600),h(this,"xSegCount",void 0),h(this,"ySegCount",void 0),h(this,"mesh",void 0),h(this,"material",void 0),h(this,"geometry",void 0),h(this,"minigl",void 0),h(this,"scrollObserver",void 0),h(this,"amp",320),h(this,"seed",5),h(this,"freqX",14e-5),h(this,"freqY",29e-5),h(this,"freqDelta",1e-5),h(this,"activeColors",[1,1,1,1]),h(this,"isMetaKey",!1),h(this,"isGradientLegendVisible",!1),h(this,"isMouseDown",!1),h(this,"handleScroll",(function(){clearTimeout(t.scrollingTimeout),t.scrollingTimeout=setTimeout(t.handleScrollEnd,t.scrollingRefreshDelay),t.isGradientLegendVisible&&t.hideGradientLegend(),t.conf.playing&&(t.isScrolling=!0,t.pause())})),h(this,"handleScrollEnd",(function(){t.isScrolling=!1,t.isIntersecting&&t.play()})),h(this,"resize",(function(){t.width=window.innerWidth,t.minigl.setSize(t.width,t.height),t.minigl.setOrthographicCamera(),t.xSegCount=Math.ceil(t.width*t.conf.density[0]),t.ySegCount=Math.ceil(t.height*t.conf.density[1]),t.mesh.geometry.setTopology(t.xSegCount,t.ySegCount),t.mesh.geometry.setSize(t.width,t.height),t.mesh.material.uniforms.u_shadow_power.value=t.width<600?5:6})),h(this,"handleMouseDown",(function(e){t.isGradientLegendVisible&&(t.isMetaKey=e.metaKey,t.isMouseDown=!0,!1===t.conf.playing&&requestAnimationFrame(t.animate))})),h(this,"handleMouseUp",(function(){t.isMouseDown=!1})),h(this,"animate",(function(e){if(!t.shouldSkipFrame(e)||t.isMouseDown){if(t.t+=Math.min(e-t.last,1e3/15),t.last=e,t.isMouseDown){var n=160;t.isMetaKey&&(n=-160),t.t+=n}t.mesh.material.uniforms.u_time.value=t.t,t.minigl.render()}if(0!==t.last&&t.isStatic)return t.minigl.render(),void t.disconnect();(t.conf.playing||t.isMouseDown)&&requestAnimationFrame(t.animate)})),h(this,"addIsLoadedClass",(function(){!t.isLoadedClass&&(t.isLoadedClass=!0,t.el.classList.add("isLoaded"),setTimeout((function(){t.el.parentElement.classList.add("isLoaded")}),3e3))})),h(this,"pause",(function(){t.conf.playing=!1})),h(this,"play",(function(){requestAnimationFrame(t.animate),t.conf.playing=!0})),h(this,"initGradient",(function(e){return t.el=document.querySelector(e),t.connect(),t}))}return(0,u.Z)(e,[{key:"connect",value:function(){var e=(0,o.Z)(d().mark((function e(){var t=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.shaderFiles={vertex:"varying vec3 v_color;\n\nvoid main() {\n float time = u_time * u_global.noiseSpeed;\n\n vec2 noiseCoord = resolution * uvNorm * u_global.noiseFreq;\n\n vec2 st = 1. - uvNorm.xy;\n\n //\n // Tilting the plane\n //\n\n // Front-to-back tilt\n float tilt = resolution.y / 2.0 * uvNorm.y;\n\n // Left-to-right angle\n float incline = resolution.x * uvNorm.x / 2.0 * u_vertDeform.incline;\n\n // Up-down shift to offset incline\n float offset = resolution.x / 2.0 * u_vertDeform.incline * mix(u_vertDeform.offsetBottom, u_vertDeform.offsetTop, uv.y);\n\n //\n // Vertex noise\n //\n\n float noise = snoise(vec3(\n noiseCoord.x * u_vertDeform.noiseFreq.x + time * u_vertDeform.noiseFlow,\n noiseCoord.y * u_vertDeform.noiseFreq.y,\n time * u_vertDeform.noiseSpeed + u_vertDeform.noiseSeed\n )) * u_vertDeform.noiseAmp;\n\n // Fade noise to zero at edges\n noise *= 1.0 - pow(abs(uvNorm.y), 2.0);\n\n // Clamp to 0\n noise = max(0.0, noise);\n\n vec3 pos = vec3(\n position.x,\n position.y + tilt + incline + noise - offset,\n position.z\n );\n\n //\n // Vertex color, to be passed to fragment shader\n //\n\n if (u_active_colors[0] == 1.) {\n v_color = u_baseColor;\n }\n\n for (int i = 0; i < u_waveLayers_length; i++) {\n if (u_active_colors[i + 1] == 1.) {\n WaveLayers layer = u_waveLayers[i];\n\n float noise = smoothstep(\n layer.noiseFloor,\n layer.noiseCeil,\n snoise(vec3(\n noiseCoord.x * layer.noiseFreq.x + time * layer.noiseFlow,\n noiseCoord.y * layer.noiseFreq.y,\n time * layer.noiseSpeed + layer.noiseSeed\n )) / 2.0 + 0.5\n );\n\n v_color = blendNormal(v_color, layer.color, pow(noise, 4.));\n }\n }\n\n //\n // Finish\n //\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}",noise:"//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : stegu\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n// https://github.com/stegu/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n{\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}",blend:"//\n// https://github.com/jamieowen/glsl-blend\n//\n\n// Normal\n\nvec3 blendNormal(vec3 base, vec3 blend) {\n\treturn blend;\n}\n\nvec3 blendNormal(vec3 base, vec3 blend, float opacity) {\n\treturn (blendNormal(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Screen\n\nfloat blendScreen(float base, float blend) {\n\treturn 1.0-((1.0-base)*(1.0-blend));\n}\n\nvec3 blendScreen(vec3 base, vec3 blend) {\n\treturn vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b));\n}\n\nvec3 blendScreen(vec3 base, vec3 blend, float opacity) {\n\treturn (blendScreen(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Multiply\n\nvec3 blendMultiply(vec3 base, vec3 blend) {\n\treturn base*blend;\n}\n\nvec3 blendMultiply(vec3 base, vec3 blend, float opacity) {\n\treturn (blendMultiply(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Overlay\n\nfloat blendOverlay(float base, float blend) {\n\treturn base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));\n}\n\nvec3 blendOverlay(vec3 base, vec3 blend) {\n\treturn vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));\n}\n\nvec3 blendOverlay(vec3 base, vec3 blend, float opacity) {\n\treturn (blendOverlay(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Hard light\n\nvec3 blendHardLight(vec3 base, vec3 blend) {\n\treturn blendOverlay(blend,base);\n}\n\nvec3 blendHardLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendHardLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Soft light\n\nfloat blendSoftLight(float base, float blend) {\n\treturn (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));\n}\n\nvec3 blendSoftLight(vec3 base, vec3 blend) {\n\treturn vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));\n}\n\nvec3 blendSoftLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendSoftLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Color dodge\n\nfloat blendColorDodge(float base, float blend) {\n\treturn (blend==1.0)?blend:min(base/(1.0-blend),1.0);\n}\n\nvec3 blendColorDodge(vec3 base, vec3 blend) {\n\treturn vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));\n}\n\nvec3 blendColorDodge(vec3 base, vec3 blend, float opacity) {\n\treturn (blendColorDodge(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Color burn\n\nfloat blendColorBurn(float base, float blend) {\n\treturn (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);\n}\n\nvec3 blendColorBurn(vec3 base, vec3 blend) {\n\treturn vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));\n}\n\nvec3 blendColorBurn(vec3 base, vec3 blend, float opacity) {\n\treturn (blendColorBurn(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Vivid Light\n\nfloat blendVividLight(float base, float blend) {\n\treturn (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));\n}\n\nvec3 blendVividLight(vec3 base, vec3 blend) {\n\treturn vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));\n}\n\nvec3 blendVividLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendVividLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Lighten\n\nfloat blendLighten(float base, float blend) {\n\treturn max(blend,base);\n}\n\nvec3 blendLighten(vec3 base, vec3 blend) {\n\treturn vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));\n}\n\nvec3 blendLighten(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLighten(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear burn\n\nfloat blendLinearBurn(float base, float blend) {\n\t// Note : Same implementation as BlendSubtractf\n\treturn max(base+blend-1.0,0.0);\n}\n\nvec3 blendLinearBurn(vec3 base, vec3 blend) {\n\t// Note : Same implementation as BlendSubtract\n\treturn max(base+blend-vec3(1.0),vec3(0.0));\n}\n\nvec3 blendLinearBurn(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLinearBurn(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear dodge\n\nfloat blendLinearDodge(float base, float blend) {\n\t// Note : Same implementation as BlendAddf\n\treturn min(base+blend,1.0);\n}\n\nvec3 blendLinearDodge(vec3 base, vec3 blend) {\n\t// Note : Same implementation as BlendAdd\n\treturn min(base+blend,vec3(1.0));\n}\n\nvec3 blendLinearDodge(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLinearDodge(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear light\n\nfloat blendLinearLight(float base, float blend) {\n\treturn blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5)));\n}\n\nvec3 blendLinearLight(vec3 base, vec3 blend) {\n\treturn vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b));\n}\n\nvec3 blendLinearLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLinearLight(base, blend) * opacity + base * (1.0 - opacity));\n}",fragment:"varying vec3 v_color;\n\nvoid main() {\n vec3 color = v_color;\n if (u_darken_top == 1.0) {\n vec2 st = gl_FragCoord.xy/resolution.xy;\n color.g -= pow(st.y + sin(-12.0) * st.x, u_shadow_power) * 0.4;\n }\n gl_FragColor = vec4(color, 1.0);\n}"},this.conf={presetName:"",wireframe:!1,density:[.06,.16],zoom:1,rotation:0,playing:!0},document.querySelectorAll("canvas").length<1?console.log("DID NOT LOAD HERO STRIPE CANVAS"):(this.minigl=new p(this.el,null,null,!0),requestAnimationFrame((function(){t.el&&(t.computedCanvasStyle=getComputedStyle(t.el),t.waitForCssVars())})));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){this.scrollObserver&&(window.removeEventListener("scroll",this.handleScroll),window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("mouseup",this.handleMouseUp),window.removeEventListener("keydown",this.handleKeyDown),this.scrollObserver.disconnect()),window.removeEventListener("resize",this.resize)}},{key:"initMaterial",value:function(){this.uniforms={u_time:new this.minigl.Uniform({value:0}),u_shadow_power:new this.minigl.Uniform({value:5}),u_darken_top:new this.minigl.Uniform({value:""===this.el.dataset.jsDarkenTop?1:0}),u_active_colors:new this.minigl.Uniform({value:this.activeColors,type:"vec4"}),u_global:new this.minigl.Uniform({value:{noiseFreq:new this.minigl.Uniform({value:[this.freqX,this.freqY],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:5e-6})},type:"struct"}),u_vertDeform:new this.minigl.Uniform({value:{incline:new this.minigl.Uniform({value:Math.sin(this.angle)/Math.cos(this.angle)}),offsetTop:new this.minigl.Uniform({value:-.5}),offsetBottom:new this.minigl.Uniform({value:-.5}),noiseFreq:new this.minigl.Uniform({value:[3,4],type:"vec2"}),noiseAmp:new this.minigl.Uniform({value:this.amp}),noiseSpeed:new this.minigl.Uniform({value:10}),noiseFlow:new this.minigl.Uniform({value:3}),noiseSeed:new this.minigl.Uniform({value:this.seed})},type:"struct",excludeFrom:"fragment"}),u_baseColor:new this.minigl.Uniform({value:this.sectionColors[0],type:"vec3",excludeFrom:"fragment"}),u_waveLayers:new this.minigl.Uniform({value:[],excludeFrom:"fragment",type:"array"})};for(var e=1;ethis.minWidth&&(this.isGradientLegendVisible=!0,document.body.classList.add("isGradientLegendVisible"))}},{key:"hideGradientLegend",value:function(){this.isGradientLegendVisible=!1,document.body.classList.remove("isGradientLegendVisible")}},{key:"init",value:function(){this.initGradientColors(),this.initMesh(),this.resize(),requestAnimationFrame(this.animate),window.addEventListener("resize",this.resize)}},{key:"waitForCssVars",value:function(){var e=this;if(this.computedCanvasStyle&&-1!==this.computedCanvasStyle.getPropertyValue("--gradient-color-1").indexOf("#"))this.init(),this.addIsLoadedClass();else{if(this.cssVarRetries+=1,this.cssVarRetries>this.maxCssVarRetries)return this.sectionColors=[16711680,16711680,16711935,65280,255],void this.init();requestAnimationFrame((function(){return e.waitForCssVars()}))}}},{key:"initGradientColors",value:function(){var e=this;this.sectionColors=["--gradient-color-1","--gradient-color-2","--gradient-color-3","--gradient-color-4"].map((function(t){var n=e.computedCanvasStyle.getPropertyValue(t).trim();if(4===n.length){var r=n.substr(1).split("").map((function(e){return e+e})).join("");n="#".concat(r)}return n&&"0x".concat(n.substr(1))})).filter(Boolean).map(f)}}]),e}();console.log("here");var g=new m;window.Gradient=m,g.initGradient("#gradient-canvas");var y=n(52443),b=n(32161);const v=console;var w=n(30081),x=n(72379);class A{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,b.PN)(this.cacheTime)&&(this.gcTimeout=setTimeout((()=>{this.optionalRemove()}),this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:b.sk?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class E extends A{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||v,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||function(e){const t="function"===typeof e.initialData?e.initialData():e.initialData,n="undefined"!==typeof t,r=n?"function"===typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?null!=r?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(e,t){const n=(0,b.oE)(this.state.data,e,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),n}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;const n=this.promise;return null==(t=this.retryer)||t.cancel(e),n?n.then(b.ZT).catch(b.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some((e=>!1!==e.options.enabled))}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some((e=>e.getCurrentResult().isStale))}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!(0,b.Kp)(this.state.dataUpdatedAt,e)}onFocus(){var e;const t=this.observers.find((e=>e.shouldFetchOnWindowFocus()));t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}onOnline(){var e;const t=this.observers.find((e=>e.shouldFetchOnReconnect()));t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}addObserver(e){-1===this.observers.indexOf(e)&&(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){-1!==this.observers.indexOf(e)&&(this.observers=this.observers.filter((t=>t!==e)),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var n,r;if("idle"!==this.state.fetchStatus)if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var i;return null==(i=this.retryer)||i.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find((e=>e.options.queryFn));e&&this.setOptions(e.options)}Array.isArray(this.options.queryKey);const o=(0,b.G9)(),s={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},a=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};a(s);const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(s)):Promise.reject("Missing queryFn")};var u;(a(c),null==(n=this.options.behavior)||n.onFetch(c),this.revertState=this.state,"idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(r=c.fetchOptions)?void 0:r.meta))&&this.dispatch({type:"fetch",meta:null==(u=c.fetchOptions)?void 0:u.meta});const l=e=>{var t,n,r,i;((0,x.DV)(e)&&e.silent||this.dispatch({type:"error",error:e}),(0,x.DV)(e))||(null==(t=(n=this.cache.config).onError)||t.call(n,e,this),null==(r=(i=this.cache.config).onSettled)||r.call(i,this.state.data,e,this));this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=(0,x.Mz)({fn:c.fetchFn,abort:null==o?void 0:o.abort.bind(o),onSuccess:e=>{var t,n,r,i;"undefined"!==typeof e?(this.setData(e),null==(t=(n=this.cache.config).onSuccess)||t.call(n,e,this),null==(r=(i=this.cache.config).onSettled)||r.call(i,e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1):l(new Error("undefined"))},onError:l,onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){this.state=(t=>{var n,r;switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(n=e.meta)?n:null,fetchStatus:(0,x.Kw)(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(r=e.dataUpdatedAt)?r:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return(0,x.DV)(i)&&i.revert&&this.revertState?{...this.revertState}:{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),w.V.batch((()=>{this.observers.forEach((t=>{t.onQueryUpdate(e)})),this.cache.notify({query:this,type:"updated",action:e})}))}}var _=n(33989);class k extends _.l{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,n){var r;const i=t.queryKey,o=null!=(r=t.queryHash)?r:(0,b.Rm)(i,t);let s=this.get(o);return s||(s=new E({cache:this,logger:e.getLogger(),queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter((t=>t!==e)),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){w.V.batch((()=>{this.queries.forEach((e=>{this.remove(e)}))}))}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){const[n]=(0,b.I6)(e,t);return"undefined"===typeof n.exact&&(n.exact=!0),this.queries.find((e=>(0,b._x)(n,e)))}findAll(e,t){const[n]=(0,b.I6)(e,t);return Object.keys(n).length>0?this.queries.filter((e=>(0,b._x)(n,e))):this.queries}notify(e){w.V.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){w.V.batch((()=>{this.queries.forEach((e=>{e.onFocus()}))}))}onOnline(){w.V.batch((()=>{this.queries.forEach((e=>{e.onOnline()}))}))}}class T extends A{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||v,this.observers=[],this.state=e.state||S(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){-1===this.observers.indexOf(e)&&(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter((t=>t!==e)),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,t;return null!=(e=null==(t=this.retryer)?void 0:t.continue())?e:this.execute()}async execute(){const e=()=>{var e;return this.retryer=(0,x.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},t="loading"===this.state.status;try{var n,r,i,o,s,a,c,u;if(!t){var l,d,f,p;this.dispatch({type:"loading",variables:this.options.variables}),await(null==(l=(d=this.mutationCache.config).onMutate)?void 0:l.call(d,this.state.variables,this));const e=await(null==(f=(p=this.options).onMutate)?void 0:f.call(p,this.state.variables));e!==this.state.context&&this.dispatch({type:"loading",context:e,variables:this.state.variables})}const h=await e();return await(null==(n=(r=this.mutationCache.config).onSuccess)?void 0:n.call(r,h,this.state.variables,this.state.context,this)),await(null==(i=(o=this.options).onSuccess)?void 0:i.call(o,h,this.state.variables,this.state.context)),await(null==(s=(a=this.mutationCache.config).onSettled)?void 0:s.call(a,h,null,this.state.variables,this.state.context,this)),await(null==(c=(u=this.options).onSettled)?void 0:c.call(u,h,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:h}),h}catch(E){try{var h,m,g,y,b,v,w,A;throw await(null==(h=(m=this.mutationCache.config).onError)?void 0:h.call(m,E,this.state.variables,this.state.context,this)),await(null==(g=(y=this.options).onError)?void 0:g.call(y,E,this.state.variables,this.state.context)),await(null==(b=(v=this.mutationCache.config).onSettled)?void 0:b.call(v,void 0,E,this.state.variables,this.state.context,this)),await(null==(w=(A=this.options).onSettled)?void 0:w.call(A,void 0,E,this.state.variables,this.state.context)),E}finally{this.dispatch({type:"error",error:E})}}}dispatch(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"loading":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!(0,x.Kw)(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...t,...e.state}}})(this.state),w.V.batch((()=>{this.observers.forEach((t=>{t.onMutationUpdate(e)})),this.mutationCache.notify({mutation:this,type:"updated",action:e})}))}}function S(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class C extends _.l{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,n){const r=new T({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:n,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0});return this.add(r),r}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter((t=>t!==e)),this.notify({type:"removed",mutation:e})}clear(){w.V.batch((()=>{this.mutations.forEach((e=>{this.remove(e)}))}))}getAll(){return this.mutations}find(e){return"undefined"===typeof e.exact&&(e.exact=!0),this.mutations.find((t=>(0,b.X7)(e,t)))}findAll(e){return this.mutations.filter((t=>(0,b.X7)(e,t)))}notify(e){w.V.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){var e;return this.resuming=(null!=(e=this.resuming)?e:Promise.resolve()).then((()=>{const e=this.mutations.filter((e=>e.state.isPaused));return w.V.batch((()=>e.reduce(((e,t)=>e.then((()=>t.continue().catch(b.ZT)))),Promise.resolve())))})).then((()=>{this.resuming=void 0})),this.resuming}}var I=n(15761),O=n(96474),R=n(9499);var D=n(85945);const P=function(){return null};var B=n(81088);const M="7.72.0",N=Object.prototype.toString;function F(e){switch(N.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return q(e,Error)}}function L(e,t){return N.call(e)===`[object ${t}]`}function j(e){return L(e,"ErrorEvent")}function U(e){return L(e,"DOMError")}function Z(e){return L(e,"String")}function H(e){return null===e||"object"!==typeof e&&"function"!==typeof e}function z(e){return L(e,"Object")}function G(e){return"undefined"!==typeof Event&&q(e,Event)}function V(e){return Boolean(e&&e.then&&"function"===typeof e.then)}function W(e){return"number"===typeof e&&e!==e}function q(e,t){try{return e instanceof t}catch(n){return!1}}function $(e){return!("object"!==typeof e||null===e||!e.__isVue&&!e._isVue)}var K=n(71235);const Y=(0,K.Rf)();function X(e,t={}){try{let n=e;const r=5,i=[];let o=0,s=0;const a=" > ",c=a.length;let u;const l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&o++1&&s+i.length*c+u.length>=d));)i.push(u),s+=u.length,n=n.parentNode;return i.reverse().join(a)}catch(n){return""}}function J(e,t){const n=e,r=[];let i,o,s,a,c;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const u=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(u&&u.length)u.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&Z(i))for(o=i.split(/\s+/),c=0;c{const r=ee[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}const ne=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?Q.forEach((n=>{t[n]=(...t)=>{e&&te((()=>{K.n2.console[n](`Sentry Logger [${n}]:`,...t)}))}})):Q.forEach((e=>{t[e]=()=>{}})),t}();function re(e,t=0){return"string"!==typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function ie(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;roe(e,t,n)))}function ae(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);"function"===typeof i&&ue(i,r),e[t]=i}function ce(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function ue(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,ce(e,"__sentry_original__",t)}catch(n){}}function le(e){return e.__sentry_original__}function de(e){if(F(e))return{message:e.message,name:e.name,stack:e.stack,...pe(e)};if(G(e)){const t={type:e.type,target:fe(e.target),currentTarget:fe(e.currentTarget),...pe(e)};return"undefined"!==typeof CustomEvent&&q(e,CustomEvent)&&(t.detail=e.detail),t}return e}function fe(e){try{return t=e,"undefined"!==typeof Element&&q(t,Element)?X(e):Object.prototype.toString.call(e)}catch(n){return""}var t}function pe(e){if("object"===typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function he(e){return me(e,new Map)}function me(e,t){if(z(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const i of Object.keys(e))"undefined"!==typeof e[i]&&(r[i]=me(e[i],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach((e=>{r.push(me(e,t))})),r}return e}function ge(){const e=K.n2,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>t.getRandomValues(new Uint8Array(1))[0])}catch(r){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function ye(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function be(e){const{message:t,event_id:n}=e;if(t)return t;const r=ye(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function ve(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=n||"Error")}function we(e,t){const n=ye(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r&&r.data,...t.data};n.mechanism.data=e}}function xe(e){if(e&&e.__sentry_captured__)return!0;try{ce(e,"__sentry_captured__",!0)}catch(t){}return!1}function Ae(e){return Array.isArray(e)?e:[e]}var Ee;function _e(e){return new Te((t=>{t(e)}))}function ke(e){return new Te(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Ee||(Ee={}));class Te{constructor(e){Te.prototype.__init.call(this),Te.prototype.__init2.call(this),Te.prototype.__init3.call(this),Te.prototype.__init4.call(this),this._state=Ee.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(h){this._reject(h)}}then(e,t){return new Te(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(h){r(h)}else n(t)},e=>{if(t)try{n(t(e))}catch(h){r(h)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new Te(((t,n)=>{let r,i;return this.then((t=>{i=!1,r=t,e&&e()}),(t=>{i=!0,r=t,e&&e()})).then((()=>{i?n(r):t(r)}))}))}__init(){this._resolve=e=>{this._setResult(Ee.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Ee.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===Ee.PENDING&&(V(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===Ee.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===Ee.RESOLVED&&e[1](this._value),this._state===Ee.REJECTED&&e[2](this._value),e[0]=!0)}))}}}function Se(){return(0,K.YO)("globalEventProcessors",(()=>[]))}function Ce(e){Se().push(e)}function Ie(e,t,n,r=0){return new Te(((i,o)=>{const s=e[r];if(null===t||"function"!==typeof s)i(t);else{const a=s({...t},n);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.id&&null===a&&ne.log(`Event processor "${s.id}" dropped event`),V(a)?a.then((t=>Ie(e,t,n,r+1).then(i))).then(null,o):Ie(e,a,n,r+1).then(i).then(null,o)}}))}var Oe=n(21170);const Re="production";function De(e){const t=(0,Oe.ph)(),n={sid:ge(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return he({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"===typeof e.did||"string"===typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&Pe(n,e),n}function Pe(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,Oe.ph)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ge()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"===typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"===typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"===typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class Be{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Me()}static clone(e){const t=new Be;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata={...e._sdkProcessingMetadata},t._propagationContext={...e._propagationContext}),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Pe(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"===typeof e){const t=e(this);return t instanceof Be?t:this}return e instanceof Be?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):z(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Me(),this}addBreadcrumb(e,t){const n="number"===typeof t?t:100;if(n<=0)return this;const r={timestamp:(0,Oe.yW)(),...e},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={},n){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};const t=this._span.transaction;if(t){e.sdkProcessingMetadata={dynamicSamplingContext:t.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const n=t.name;n&&(e.tags={transaction:n,...e.tags})}}this._applyFingerprint(e);const r=this._getBreadcrumbs(),i=[...e.breadcrumbs||[],...r];return e.breadcrumbs=i.length>0?i:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},Ie([...n||[],...Se(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Ae(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Me(){return{traceId:ge(),spanId:ge().substring(16)}}const Ne=100;class Fe{constructor(e,t=new Be,n=4){this._version=n,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version{i.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},o)})),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:ge(),i=new Error(e);return this._withClient(((o,s)=>{o.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},s)})),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:ge();return e.type||(this._lastEventId=n),this._withClient(((r,i)=>{r.captureEvent(e,{...t,event_id:n},i)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=Ne}=r.getOptions&&r.getOptions()||{};if(o<=0)return;const s={timestamp:(0,Oe.yW)(),...e},a=i?te((()=>i(s,t))):s;null!==a&&(r.emit&&r.emit("beforeAddBreadcrumb",a,t),n.addBreadcrumb(a,o))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=je(this);try{e(this)}finally{je(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(n){return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&!n){this.getClient()?console.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):console.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),Pe(e,n)}(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=Re}=n&&n.getOptions()||{},{userAgent:o}=K.n2.navigator||{},s=De({release:r,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),a=t.getSession&&t.getSession();return a&&"ok"===a.status&&Pe(a,{status:"exited"}),this.endSession(),t.setSession(s),s}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){const n=Le().__SENTRY__;if(n&&n.extensions&&"function"===typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Le(){return K.n2.__SENTRY__=K.n2.__SENTRY__||{extensions:{},hub:void 0},K.n2}function je(e){const t=Le(),n=ze(t);return Ge(t,e),n}function Ue(){const e=Le();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return Ze(e)}function Ze(e=Le()){return He(e)&&!ze(e).isOlderThan(4)||Ge(e,new Fe),ze(e)}function He(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function ze(e){return(0,K.YO)("hub",(()=>new Fe),e)}function Ge(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}const Ve=[];function We(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;t.forEach((e=>{e.isDefaultInstance=!0})),r=Array.isArray(n)?[...t,...n]:"function"===typeof n?Ae(n(t)):t;const i=function(e){const t={};return e.forEach((e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)})),Object.keys(t).map((e=>t[e]))}(r),o=function(e,t){for(let n=0;n"Debug"===e.name));if(-1!==o){const[e]=i.splice(o,1);i.push(e)}return i}function qe(e,t,n){if(n[t.name]=t,-1===Ve.indexOf(t.name)&&(t.setupOnce(Ce,Ue),Ve.push(t.name)),e.on&&"function"===typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,r)=>n(t,r,e)))}if(e.addEventProcessor&&"function"===typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign(((t,r)=>n(t,r,e)),{id:t.name});e.addEventProcessor(r)}("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`Integration installed: ${t.name}`)}const $e=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Ke=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class Ye{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=Ye.id,this._options=e}setupOnce(e,t){const n=e=>{const n=t();if(n){const t=n.getIntegration(Ye);if(t){const r=n.getClient(),i=r?r.getOptions():{},o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:$e],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Ke],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(t._options,i);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(h){}return!1}(e))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${be(e)}`),!0;if(function(e,t){if(e.type||!t||!t.length)return!1;return function(e){const t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch(h){}n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`));"undefined"!==typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__||0!==t.length||ne.error(`Could not extract message for event ${be(e)}`);return t}(e).some((e=>se(e,t)))}(e,t.ignoreErrors))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${be(e)}`),!0;if(function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&se(n,t)}(e,t.ignoreTransactions))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${be(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;const n=Xe(e);return!!n&&se(n,t)}(e,t.denyUrls))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${be(e)}.\nUrl: ${Xe(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=Xe(e);return!n||se(n,t)}(e,t.allowUrls))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${be(e)}.\nUrl: ${Xe(e)}`),!0;return!1}(e,o)?null:e}}return e};n.id=this.name,e(n)}}function Xe(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(h){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&""!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error(`Cannot extract url for event ${be(e)}`),null}}let Je;Ye.__initStatic();class Qe{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=Qe.id}setupOnce(){Je=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=le(this)||this;return Je.apply(t,e)}}catch(h){}}}Qe.__initStatic();const et=/\(error: (.*)\)/,tt=/captureMessage|captureException/;function nt(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,n=0)=>{const r=[],i=e.split("\n");for(let o=n;o1024)continue;const n=et.test(e)?e.replace(et,"$1"):e;if(!n.match(/\S*Error: /)){for(const e of t){const t=e(n);if(t){r.push(t);break}}if(r.length>=50)break}}return function(e){if(!e.length)return[];const t=Array.from(e);/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop();t.reverse(),tt.test(t[t.length-1].function||"")&&(t.pop(),tt.test(t[t.length-1].function||"")&&t.pop());return t.slice(0,50).map((e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"})))}(r)}}const rt="";function it(e){try{return e&&"function"===typeof e&&e.name||rt}catch(h){return rt}}const ot=(0,K.Rf)();function st(){if(!("fetch"in ot))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(h){return!1}}function at(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}const ct=(0,K.Rf)();const ut=(0,K.Rf)(),lt={},dt={};function ft(e){if(!dt[e])switch(dt[e]=!0,e){case"console":!function(){if(!("console"in K.n2))return;Q.forEach((function(e){e in K.n2.console&&ae(K.n2.console,e,(function(t){return ee[e]=t,function(...t){ht("console",{args:t,level:e});const n=ee[e];n&&n.apply(K.n2.console,t)}}))}))}();break;case"dom":!function(){if(!ut.document)return;const e=ht.bind(null,"dom"),t=wt(e,!0);ut.document.addEventListener("click",t,!1),ut.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=ut[t]&&ut[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(ae(n,"addEventListener",(function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,o=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},s=o[n]=o[n]||{refCount:0};if(!s.handler){const r=wt(e);s.handler=r,t.call(this,n,r,i)}s.refCount++}catch(h){}return t.call(this,n,r,i)}})),ae(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},o=i[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(h){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!ut.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;ae(e,"open",(function(e){return function(...t){const n=t[1],r=this.__sentry_xhr_v2__={method:Z(t[0])?t[0].toUpperCase():t[0],url:t[1],request_headers:{}};Z(n)&&"POST"===r.method&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const i=()=>{const e=this.__sentry_xhr_v2__;if(e&&4===this.readyState){try{e.status_code=this.status}catch(h){}ht("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&"function"===typeof this.onreadystatechange?ae(this,"onreadystatechange",(function(e){return function(...t){return i(),e.apply(this,t)}})):this.addEventListener("readystatechange",i),ae(this,"setRequestHeader",(function(e){return function(...t){const[n,r]=t,i=this.__sentry_xhr_v2__;return i&&(i.request_headers[n.toLowerCase()]=r),e.apply(this,t)}})),e.apply(this,t)}})),ae(e,"send",(function(e){return function(...t){const n=this.__sentry_xhr_v2__;return n&&void 0!==t[0]&&(n.body=t[0]),ht("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!function(){if(!st())return!1;if(at(ot.fetch))return!0;let e=!1;const t=ot.document;if(t&&"function"===typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=at(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}())return;ae(K.n2,"fetch",(function(e){return function(...t){const{method:n,url:r}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:gt(t),method:mt(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:gt(t),method:mt(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return ht("fetch",{...i}),e.apply(K.n2,t).then((e=>(ht("fetch",{...i,endTimestamp:Date.now(),response:e}),e)),(e=>{throw ht("fetch",{...i,endTimestamp:Date.now(),error:e}),e}))}}))}();break;case"history":!function(){if(!function(){const e=ct.chrome,t=e&&e.app&&e.app.runtime,n="history"in ct&&!!ct.history.pushState&&!!ct.history.replaceState;return!t&&n}())return;const e=ut.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=yt,t=String(n);yt=t,ht("history",{from:e,to:t})}return e.apply(this,t)}}ut.onpopstate=function(...t){const n=ut.location.href,r=yt;if(yt=n,ht("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(i){}},ae(ut.history,"pushState",t),ae(ut.history,"replaceState",t)}();break;case"error":xt=ut.onerror,ut.onerror=function(e,t,n,r,i){return ht("error",{column:r,error:i,line:n,msg:e,url:t}),!(!xt||xt.__SENTRY_LOADER__)&&xt.apply(this,arguments)},ut.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":At=ut.onunhandledrejection,ut.onunhandledrejection=function(e){return ht("unhandledrejection",e),!(At&&!At.__SENTRY_LOADER__)||At.apply(this,arguments)},ut.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("unknown instrumentation type:",e))}}function pt(e,t){lt[e]=lt[e]||[],lt[e].push(t),ft(e)}function ht(e,t){if(e&<[e])for(const n of lt[e]||[])try{n(t)}catch(h){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${it(n)}\nError:`,h)}}function mt(e,t){return!!e&&"object"===typeof e&&!!e[t]}function gt(e){return"string"===typeof e?e:e?mt(e,"url")?e.url:e.toString?e.toString():"":""}let yt;let bt,vt;function wt(e,t=!1){return n=>{if(!n||vt===n)return;if(function(e){if("keypress"!==e.type)return!1;try{const t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(h){}return!0}(n))return;const r="keypress"===n.type?"input":n.type;(void 0===bt||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(h){}return!1}(vt,n))&&(e({event:n,name:r,global:t}),vt=n),clearTimeout(bt),bt=ut.setTimeout((()=>{bt=void 0}),1e3)}}let xt=null;let At=null;const Et=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function _t(e,t=!1){const{host:n,path:r,pass:i,port:o,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r?`${r}/`:r}${s}`}function kt(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Tt(e){const t="string"===typeof e?function(e){const t=Et.exec(e);if(!t)return void console.error(`Invalid Sentry Dsn: ${e}`);const[n,r,i="",o,s="",a]=t.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return kt({host:o,pass:i,path:c,projectId:u,port:s,protocol:n,publicKey:r})}(e):kt(e);if(t&&function(e){if("undefined"!==typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return!0;const{port:t,projectId:n,protocol:r}=e;return!["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(ne.error(`Invalid Sentry Dsn: ${t} missing`),!0)))&&(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?!t||!isNaN(parseInt(t,10))||(ne.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):(ne.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(ne.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1))}(t))return t}function St(e,t=100,n=1/0){try{return It("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ct(e,t=3,n=102400){const r=St(e,t);return i=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(i))>n?Ct(e,t-1,n):r;var i}function It(e,t,r=1/0,i=1/0,o=function(){const e="function"===typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e=i){d[n]="[MaxProperties ~]";break}const e=p[n];d[n]=It(n,e,u-1,i,o),f++}return a(t),d}function Ot(e,t=[]){return[e,t]}function Rt(e,t){const[n,r]=e;return[n,[...r,t]]}function Dt(e,t){const n=e[1];for(const r of n){if(t(r,r[0].type))return!0}return!1}function Pt(e,t){return(t||new TextEncoder).encode(e)}function Bt(e,t){const[n,r]=e;let i=JSON.stringify(n);function o(e){"string"===typeof i?i="string"===typeof e?i+e:[Pt(i,t),e]:i.push("string"===typeof e?Pt(e,t):e)}for(const s of r){const[e,t]=s;if(o(`\n${JSON.stringify(e)}\n`),"string"===typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch(h){e=JSON.stringify(St(t))}o(e)}}return"string"===typeof i?i:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}(i)}function Mt(e,t){const n="string"===typeof e.data?Pt(e.data,t):e.data;return[he({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const Nt={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function Ft(e){return Nt[e]}function Lt(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function jt(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:_t(r)},...i&&{trace:he({...i})}}}class Ut extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function Zt(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Ht(e,t){return function(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}({sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}})}function zt(e,t={}){const n="string"===typeof t?t:t.tunnel,r="string"!==typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${Zt(e)}${e.projectId}/envelope/`}(e)}?${Ht(e,r)}`}function Gt(e,t,n){const r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=n&&n.getUser()||{},s=he({environment:r.environment||Re,release:r.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",s),s}function Vt(e,t,n,r,i){const{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,a={...t,event_id:t.event_id||n.event_id||ge(),timestamp:t.timestamp||(0,Oe.yW)()},c=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:Re);void 0===e.release&&void 0!==r&&(e.release=r);void 0===e.dist&&void 0!==i&&(e.dist=i);e.message&&(e.message=re(e.message,o));const s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=re(s.value,o));const a=e.request;a&&a.url&&(a.url=re(a.url,o))}(a,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(a,c),void 0===t.type&&function(e,t){const n=K.n2._sentryDebugIds;if(!n)return;let r;const i=Wt.get(t);i?r=i:(r=new Map,Wt.set(t,r));const o=Object.keys(n).reduce(((e,i)=>{let o;const s=r.get(i);s?o=s:(o=t(i),r.set(i,o));for(let t=o.length-1;t>=0;t--){const r=o[t];if(r.filename){e[r.filename]=n[i];break}}return e}),{});try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.filename&&(e.debug_id=o[e.filename])}))}))}catch(h){}}(a,e.stackParser);let u=r;n.captureContext&&(u=Be.clone(u).update(n.captureContext));let l=_e(a);const d=i&&i.getEventProcessors?i.getEventProcessors():[];if(u){if(u.getAttachments){const e=[...n.attachments||[],...u.getAttachments()];e.length&&(n.attachments=e)}l=u.applyToEvent(a,n,d)}else l=Ie([...d,...Se()],a,n);return l.then((e=>(e&&function(e){const t={};try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))}))}catch(h){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach((e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})}))}(e),"number"===typeof o&&o>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:St(e.data,t,n)}})))},...e.user&&{user:St(e.user,t,n)},...e.contexts&&{contexts:St(e.contexts,t,n)},...e.extra&&{extra:St(e.extra,t,n)}};e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=St(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=St(e.data,t,n)),e))));return r}(e,o,s):e)))}const Wt=new WeakMap;const qt="Not capturing exception because it's already been captured.";function $t(e){return void 0===e.type}function Kt(e){return"transaction"===e.type}var Yt=n(68518);function Xt(e,t){const n=Qt(e,t),r={type:t&&t.name,value:tn(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Jt(e,t){return{exception:{values:[Xt(e,t)]}}}function Qt(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"===typeof e.framesToPop)return e.framesToPop;if(en.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(h){}return[]}const en=/Minified React error #\d+;/i;function tn(e){const t=e&&e.message;return t?t.error&&"string"===typeof t.error.message?t.error.message:t:"No error message"}function nn(e,t,n,r,i){let o;if(j(t)&&t.error){return Jt(e,t.error)}if(U(t)||L(t,"DOMException")){const i=t;if("stack"in t)o=Jt(e,t);else{const t=i.name||(U(i)?"DOMError":"DOMException"),s=i.message?`${t}: ${i.message}`:t;o=rn(e,s,n,r),ve(o,s)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}if(F(t))return Jt(e,t);if(z(t)||G(t)){return o=function(e,t,n,r){const i=Ue().getClient(),o=i&&i.getOptions().normalizeDepth,s={exception:{values:[{type:G(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:on(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Ct(t,o)}};if(n){const t=Qt(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}(e,t,n,i),we(o,{synthetic:!0}),o}return o=rn(e,t,n,r),ve(o,`${t}`,void 0),we(o,{synthetic:!0}),o}function rn(e,t,n,r){const i={message:t};if(r&&n){const r=Qt(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}return i}function on(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(de(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return re(n[0],t);for(let r=n.length;r>0;r--){const e=n.slice(0,r).join(", ");if(!(e.length>t))return r===n.length?e:re(e,t)}return""}(e),r=t?"promise rejection":"exception";if(j(e))return`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``;if(G(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(h){}}(e)}\` (type=${e.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}function sn(e,t){return Ue().captureException(e,{captureContext:t})}function an(e){Ue().withScope(e)}const cn=K.n2;let un=0;function ln(){return un>0}function dn(){un++,setTimeout((()=>{un--}))}function fn(e,t={},n){if("function"!==typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(le(e))return e}catch(h){return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"===typeof n&&n.apply(this,arguments);const i=r.map((e=>fn(e,t)));return e.apply(this,i)}catch(i){throw dn(),an((e=>{e.addEventProcessor((e=>(t.mechanism&&(ve(e,void 0,void 0),we(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),sn(i)})),i}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(i){}ue(r,e),ce(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(i){}return r}class pn extends class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=Tt(e.dsn):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("No DSN provided, client will not do anything."),this._dsn){const t=zt(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(xe(e))return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(qt));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{r=e}))),r}captureMessage(e,t,n,r){let i=n&&n.event_id;const o=H(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(o.then((e=>this._captureEvent(e,n,r))).then((e=>{i=e}))),i}captureEvent(e,t,n){if(t&&t.originalException&&xe(t.originalException))return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(qt));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((e=>{r=e}))),r}captureSession(e){this._isEnabled()?"string"!==typeof e.release?("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Pe(e,{init:!1})):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e)))):_e(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,e)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e,t){const n={};return t.forEach((t=>{t&&qe(e,t,n)})),n}(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){qe(this,e,this._integrations)}sendEvent(e,t={}){if(this.emit("beforeSendEvent",e,t),this._dsn){let n=function(e,t,n,r){const i=Lt(n),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const s=jt(e,i,r,t);return delete e.sdkProcessingMetadata,Ot(s,[[{type:o},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Rt(n,Mt(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((t=>this.emit("afterSendEvent",e,t)),null)}}sendSession(e){if(this._dsn){const t=function(e,t,n,r){const i=Lt(n);return Ot({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&{dsn:_t(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach((e=>e(...t)))}_updateSessionFromEvent(e,t){let n=!1,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&n)&&(Pe(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Te((t=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){const r=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i.length>0&&(t.integrations=i),this.emit("preprocessEvent",e,t),Vt(r,e,t,n,this).then((e=>{if(null===e)return e;const{propagationContext:t}=e.sdkProcessingMetadata||{};if(!(e.contexts&&e.contexts.trace)&&t){const{traceId:r,spanId:i,parentSpanId:o,dsc:s}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:o},...e.contexts};const a=s||Gt(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:a,...e.sdkProcessingMetadata}}return e}))}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__){const t=e;"log"===t.logLevel?ne.log(t.message):ne.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r;if(!this._isEnabled())return ke(new Ut("SDK not enabled, will not capture event.","log"));const o=Kt(e),s=$t(e),a=e.type||"error",c=`before send for type \`${a}\``;if(s&&"number"===typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),ke(new Ut(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const u="replay_event"===a?"replay":a;return this._prepareEvent(e,t,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",u,e),new Ut("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const i=function(e,t,n){const{beforeSend:r,beforeSendTransaction:i}=e;if($t(t)&&r)return r(t,n);if(Kt(t)&&i)return i(t,n);return t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(V(e))return e.then((e=>{if(!z(e)&&null!==e)throw new Ut(n);return e}),(e=>{throw new Ut(`${t} rejected with ${e}`)}));if(!z(e)&&null!==e)throw new Ut(n);return e}(i,c)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",u,e),new Ut(`${c} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!o&&i&&this._updateSessionFromEvent(i,r);const s=r.transaction_info;if(o&&s&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...s,source:e}}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof Ut)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Ut(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_sendEnvelope(e){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,(e=>{("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("Error while sending event:",e)}));("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}}))}}{constructor(e){const t=cn.SENTRY_SDK_SOURCE||(0,Yt.S)();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:M}],version:M},super(e),e.sendClientReports&&cn.document&&cn.document.addEventListener("visibilitychange",(()=>{"hidden"===cn.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){const i=nn(e,t,n&&n.syntheticException||void 0,r);return we(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),_e(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const o=rn(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),_e(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:_t(r)}},o=function(e){return[{type:"user_report"},e]}(e);return Ot(i,[o])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("No outcomes to send"));if(!this._dsn)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("No dsn provided, will not send outcomes"));("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("Sending outcomes:",e);const t=(n=e,Ot((r=this._options.tunnel&&_t(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:i||(0,Oe.yW)(),discarded_events:n}]]));var n,r,i;this._sendEnvelope(t)}}class hn{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=hn.id,this._options={onerror:!0,onunhandledrejection:!0,...e},this._installFunc={onerror:mn,onunhandledrejection:gn}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const t in e){const n=this._installFunc[t];n&&e[t]&&(bn(t),n(),this._installFunc[t]=void 0)}}}function mn(){pt("error",(e=>{const[t,n,r]=wn();if(!t.getIntegration(hn))return;const{msg:i,url:o,line:s,column:a,error:c}=e;if(ln()||c&&c.__sentry_own_request__)return;const u=void 0===c&&Z(i)?function(e,t,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=j(e)?e.message:e,s="Error";const a=o.match(i);a&&(s=a[1],o=a[2]);return yn({exception:{values:[{type:s,value:o}]}},t,n,r)}(i,o,s,a):yn(nn(n,c||i,void 0,r,!1),o,s,a);u.level="error",vn(t,c,u,"onerror")}))}function gn(){pt("unhandledrejection",(e=>{const[t,n,r]=wn();if(!t.getIntegration(hn))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch(s){}if(ln()||i&&i.__sentry_own_request__)return!0;const o=H(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:nn(n,i,void 0,r,!0);o.level="error",vn(t,i,o,"onunhandledrejection")}))}function yn(e,t,n,r){const i=e.exception=e.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},c=a.frames=a.frames||[],u=isNaN(parseInt(r,10))?void 0:r,l=isNaN(parseInt(n,10))?void 0:n,d=Z(t)&&t.length>0?t:function(){try{return Y.document.location.href}catch(e){return""}}();return 0===c.length&&c.push({colno:u,filename:d,function:"?",in_app:!0,lineno:l}),e}function bn(e){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`Global Handler attached: ${e}`)}function vn(e,t,n,r){we(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function wn(){const e=Ue(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}hn.__initStatic();const xn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class An{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=An.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&ae(cn,"setTimeout",En),this._options.setInterval&&ae(cn,"setInterval",En),this._options.requestAnimationFrame&&ae(cn,"requestAnimationFrame",_n),this._options.XMLHttpRequest&&"XMLHttpRequest"in cn&&ae(XMLHttpRequest.prototype,"send",kn);const e=this._options.eventTarget;if(e){(Array.isArray(e)?e:xn).forEach(Tn)}}}function En(e){return function(...t){const n=t[0];return t[0]=fn(n,{mechanism:{data:{function:it(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function _n(e){return function(t){return e.apply(this,[fn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:it(e)},handled:!1,type:"instrument"}})])}}function kn(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"===typeof n[e]&&ae(n,e,(function(t){const n={mechanism:{data:{function:e,handler:it(t)},handled:!1,type:"instrument"}},r=le(t);return r&&(n.mechanism.data.handler=it(r)),fn(t,n)}))})),e.apply(this,t)}}function Tn(e){const t=cn,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(ae(n,"addEventListener",(function(t){return function(n,r,i){try{"function"===typeof r.handleEvent&&(r.handleEvent=fn(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:it(r),target:e},handled:!1,type:"instrument"}}))}catch(o){}return t.apply(this,[n,fn(r,{mechanism:{data:{function:"addEventListener",handler:it(r),target:e},handled:!1,type:"instrument"}}),i])}})),ae(n,"removeEventListener",(function(e){return function(t,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch(h){}return e.call(this,t,i,r)}})))}An.__initStatic();const Sn=["fatal","error","warning","log","info","debug"];function Cn(e){return"warn"===e?"warning":Sn.includes(e)?e:"log"}function In(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const On=1024;class Rn{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=Rn.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){if(this.options.console&&pt("console",Pn),this.options.dom&&pt("dom",function(e){function t(t){let n,r="object"===typeof e?e.serializeAttribute:void 0,i="object"===typeof e&&"number"===typeof e.maxStringLength?e.maxStringLength:void 0;i&&i>On&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=On),"string"===typeof r&&(r=[r]);try{const e=t.event;n=function(e){return!!e&&!!e.target}(e)?X(e.target,{keyAttrs:r,maxStringLength:i}):X(e,{keyAttrs:r,maxStringLength:i})}catch(h){n=""}0!==n.length&&Ue().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&pt("xhr",Bn),this.options.fetch&&pt("fetch",Mn),this.options.history&&pt("history",Nn),this.options.sentry){const e=Ue().getClient();e&&e.on&&e.on("beforeSendEvent",Dn)}}}function Dn(e){Ue().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:be(e)},{event:e})}function Pn(e){const t={category:"console",data:{arguments:e.args,logger:"console"},level:Cn(e.level),message:ie(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message=`Assertion failed: ${ie(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1)}Ue().addBreadcrumb(t,{input:e.args,level:e.level})}function Bn(e){const{startTimestamp:t,endTimestamp:n}=e,r=e.xhr.__sentry_xhr_v2__;if(!t||!n||!r)return;const{method:i,url:o,status_code:s,body:a}=r,c={method:i,url:o,status_code:s},u={xhr:e.xhr,input:a,startTimestamp:t,endTimestamp:n};Ue().addBreadcrumb({category:"xhr",data:c,type:"http"},u)}function Mn(e){const{startTimestamp:t,endTimestamp:n}=e;if(n&&(!e.fetchData.url.match(/sentry_key/)||"POST"!==e.fetchData.method))if(e.error){const r=e.fetchData,i={data:e.error,input:e.args,startTimestamp:t,endTimestamp:n};Ue().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{const r={...e.fetchData,status_code:e.response&&e.response.status},i={input:e.args,response:e.response,startTimestamp:t,endTimestamp:n};Ue().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function Nn(e){let t=e.from,n=e.to;const r=In(cn.location.href);let i=In(t);const o=In(n);i.path||(i=r),r.protocol===o.protocol&&r.host===o.host&&(n=o.relative),r.protocol===i.protocol&&r.host===i.host&&(t=i.relative),Ue().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}function Fn(e,t,n=250,r,i,o,s){if(!o.exception||!o.exception.values||!s||!q(s.originalException,Error))return;const a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;var c,u;a&&(o.exception.values=(c=Ln(e,t,i,s.originalException,r,o.exception.values,a,0),u=n,c.map((e=>(e.value&&(e.value=re(e.value,u)),e)))))}function Ln(e,t,n,r,i,o,s,a){if(o.length>=n+1)return o;let c=[...o];if(q(r[i],Error)){jn(s,a);const o=e(t,r[i]),u=c.length;Un(o,i,u,a),c=Ln(e,t,n,r[i],i,[o,...c],o,u)}return Array.isArray(r.errors)&&r.errors.forEach(((r,o)=>{if(q(r,Error)){jn(s,a);const u=e(t,r),l=c.length;Un(u,`errors[${o}]`,l,a),c=Ln(e,t,n,r,i,[u,...c],u,l)}})),c}function jn(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function Un(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}Rn.__initStatic();class Zn{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=Zn.id,this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){}preprocessEvent(e,t,n){const r=n.getOptions();Fn(Xt,r.stackParser,r.maxValueLength,this._key,this._limit,e,t)}}Zn.__initStatic();class Hn{static __initStatic(){this.id="HttpContext"}constructor(){this.name=Hn.id}setupOnce(){}preprocessEvent(e){if(!cn.navigator&&!cn.location&&!cn.document)return;const t=e.request&&e.request.url||cn.location&&cn.location.href,{referrer:n}=cn.document||{},{userAgent:r}=cn.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:i};e.request=o}}Hn.__initStatic();class zn{static __initStatic(){this.id="Dedupe"}constructor(){this.name=zn.id}setupOnce(e,t){}processEvent(e){if(e.type)return e;try{if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!Vn(e,t))return!1;if(!Gn(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=Wn(t),r=Wn(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!Vn(e,t))return!1;if(!Gn(e,t))return!1;return!0}(e,t))return!0;return!1}(e,this._previousEvent))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){}return this._previousEvent=e}}function Gn(e,t){let n=qn(e),r=qn(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,r=r,r.length!==n.length)return!1;for(let i=0;i|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Xn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Jn=[30,e=>{const t=Yn.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=Xn.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=ir(t[1]||$n,t[2]);return Kn(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Qn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,er=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tr=[50,e=>{const t=Qn.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=er.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||$n;return[n,e]=ir(n,e),Kn(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],nr=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,rr=nt(...[Jn,tr,[40,e=>{const t=nr.exec(e);return t?Kn(t[2],t[1]||$n,+t[3],t[4]?+t[4]:void 0):void 0}]]),ir=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:$n,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function or(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.lengthn(i))).then(null,(()=>n(i).then(null,(()=>{})))),i},drain:function(e){return new Te(((n,r)=>{let i=t.length;if(!i)return n(!0);const o=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{_e(e).then((()=>{--i||(clearTimeout(o),n(!0))}),r)}))}))}}}function sr(e,{statusCode:t,headers:n},r=Date.now()){const i={...e},o=n&&n["x-sentry-rate-limits"],s=n&&n["retry-after"];if(o)for(const a of o.trim().split(",")){const[e,t]=a.split(":",2),n=parseInt(e,10),o=1e3*(isNaN(n)?60:n);if(t)for(const s of t.split(";"))i[s]=r+o;else i.all=r+o}else s?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(s,r):429===t&&(i.all=r+6e4);return i}function ar(e,t,n=or(e.bufferSize||30)){let r={};function i(i){const o=[];if(Dt(i,((t,n)=>{const i=Ft(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,i)){const r=cr(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else o.push(t)})),0===o.length)return _e();const s=Ot(i[0],o),a=t=>{Dt(s,((n,r)=>{const i=cr(n,r);e.recordDroppedEvent(t,Ft(r),i)}))};return n.add((()=>t({body:Bt(s,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=sr(r,e),e)),(e=>{throw a("network_error"),e})))).then((e=>e),(e=>{if(e instanceof Ut)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("Skipped sending event because buffer is full."),a("queue_overflow"),_e();throw e}))}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>n.drain(e)}}function cr(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}let ur;function lr(e,t=function(){if(ur)return ur;if(at(cn.fetch))return ur=cn.fetch.bind(cn);const e=cn.document;let t=cn.fetch;if(e&&"function"===typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(h){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",h)}return ur=t.bind(cn)}()){let n=0,r=0;return ar(e,(function(i){const o=i.body.length;n+=o,r++;const s={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,s).then((e=>(n-=o,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(h){return ur=void 0,n-=o,r--,ke(h)}}))}function dr(e){return ar(e,(function(t){return new Te(((n,r)=>{const i=new XMLHttpRequest;i.onerror=r,i.onreadystatechange=()=>{4===i.readyState&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&i.setRequestHeader(t,e.headers[t]);i.send(t.body)}))}))}const fr=[new Ye,new Qe,new An,new Rn,new hn,new Zn,new zn,new Hn];function pr(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=fr),void 0===e.release&&("string"===typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),cn.SENTRY_RELEASE&&cn.SENTRY_RELEASE.id&&(e.release=cn.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:(n=e.stackParser||rr,Array.isArray(n)?nt(...n):n),integrations:We(e),transport:e.transport||(st()?lr:dr)};var n;!function(e,t){!0===t.debug&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?ne.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const n=Ue();n.getScope().update(t.initialScope);const r=new e(t);n.bindClient(r)}(pn,t),e.autoSessionTracking&&function(){if("undefined"===typeof cn.document)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));const e=Ue();if(!e.captureSession)return;hr(e),pt("history",(({from:e,to:t})=>{void 0!==e&&e!==t&&hr(Ue())}))}()}function hr(e){e.startSession({ignoreDuration:!0}),e.captureSession()}const mr="baggage",gr="sentry-",yr=/^sentry-/;function br(e){if(!e)return;return function(e){if(0===Object.keys(e).length)return;return Object.entries(e).reduce(((e,[t,n],r)=>{const i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,o=0===r?i:`${e},${i}`;return o.length>8192?(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):o}),"")}(Object.entries(e).reduce(((e,[t,n])=>(n&&(e[`sentry-${t}`]=n),e)),{}))}function vr(e){return e.split(",").map((e=>e.split("=").map((e=>decodeURIComponent(e.trim()))))).reduce(((e,[t,n])=>(e[t]=n,e)),{})}const wr=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function xr(e,t){const n=function(e){if(!e)return;const t=e.match(wr);if(!t)return;let n;return"1"===t[3]?n=!0:"0"===t[3]&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}(e),r=function(e){if(!Z(e)&&!Array.isArray(e))return;let t={};if(Array.isArray(e))t=e.reduce(((e,t)=>({...e,...vr(t)})),{});else{if(!e)return;t=vr(e)}const n=Object.entries(t).reduce(((e,[t,n])=>(t.match(yr)&&(e[t.slice(gr.length)]=n),e)),{});return Object.keys(n).length>0?n:void 0}(t),{traceId:i,parentSpanId:o,parentSampled:s}=n||{},a={traceId:i||ge(),spanId:ge().substring(16),sampled:s};return o&&(a.parentSpanId=o),r&&(a.dsc=r),{traceparentData:n,dynamicSamplingContext:r,propagationContext:a}}function Ar(e=ge(),t=ge().substring(16),n){let r="";return void 0!==n&&(r=n?"-1":"-0"),`${e}-${t}${r}`}class Er{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class _r{constructor(e={}){this.traceId=e.traceId||ge(),this.spanId=e.spanId||ge().substring(16),this.startTimestamp=e.startTimestamp||(0,Oe.ph)(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){const t=new _r({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(t.spanRecorder=this.spanRecorder,t.spanRecorder&&t.spanRecorder.add(t),t.transaction=this.transaction,("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&t.transaction){const n=`[Tracing] Starting '${e&&e.op||"< unknown op >"}' span on transaction '${t.transaction.name||"< unknown name >"}' (${t.transaction.spanId}).`;t.transaction.metadata.spanMetadata[t.spanId]={logMessage:n},ne.log(n)}return t}setTag(e,t){return this.tags={...this.tags,[e]:t},this}setData(e,t){return this.data={...this.data,[e]:t},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);const t=function(e){if(e<400&&e>=100)return"ok";if(e>=400&&e<500)switch(e){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(e>=500&&e<600)switch(e){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}(e);return"unknown_error"!==t&&this.setStatus(t),this}setName(e){this.description=e}isSuccess(){return"ok"===this.status}finish(e){if(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:e}=this.transaction.metadata.spanMetadata[this.spanId];e&&ne.log(e.replace("Starting","Finishing"))}this.endTimestamp="number"===typeof e?e:(0,Oe.ph)()}toTraceparent(){return Ar(this.traceId,this.spanId,this.sampled)}toContext(){return he({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return he({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return he({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}}class kr extends _r{constructor(e,t){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=t||Ue(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;const n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(e){this.setName(e)}setName(e,t="custom"){this._name=e,this.metadata.source=t}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Er(e)),this.spanRecorder.add(this)}setContext(e,t){null===t?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t,n=""){this._measurements[e]={value:t,unit:n}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){if(void 0!==this.endTimestamp)return;this.name||(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Transaction has no name, falling back to ``."),this.name=""),super.finish(e);const t=this._hub.getClient();if(t&&t.emit&&t.emit("finishTransaction",this),!0!==this.sampled)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(t&&t.recordDroppedEvent("sample_rate","transaction"));const n=this.spanRecorder?this.spanRecorder.spans.filter((e=>e!==this&&e.endTimestamp)):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce(((e,t)=>e.endTimestamp&&t.endTimestamp?e.endTimestamp>t.endTimestamp?e:t:e)).endTimestamp);const r=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...r,dynamicSamplingContext:this.getDynamicSamplingContext()},...r.source&&{transaction_info:{source:r.source}}};return Object.keys(this._measurements).length>0&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(i)}toContext(){return he({...super.toContext(),name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const e=this._hub||Ue(),t=e.getClient();if(!t)return{};const n=e.getScope(),r=Gt(this.traceId,t,n),i=this.metadata.sampleRate;void 0!==i&&(r.sample_rate=`${i}`);const o=this.metadata.source;return o&&"url"!==o&&(r.transaction=this.name),void 0!==this.sampled&&(r.sampled=String(this.sampled)),r}setHub(e){this._hub=e}}const Tr={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},Sr=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class Cr extends Er{constructor(e,t,n,r){super(r),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=n}add(e){e.spanId!==this.transactionSpanId&&(e.finish=t=>{e.endTimestamp="number"===typeof t?t:(0,Oe.ph)(),this._popActivity(e.spanId)},void 0===e.endTimestamp&&this._pushActivity(e.spanId)),super.add(e)}}class Ir extends kr{constructor(e,t,n=Tr.idleTimeout,r=Tr.finalTimeout,i=Tr.heartbeatInterval,o=!1){super(e,t),this._idleHub=t,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=i,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=Sr[4],o&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),t.configureScope((e=>e.setSpan(this)))),this._restartIdleTimeout(),setTimeout((()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Sr[3],this.finish())}),this._finalTimeout)}finish(e=(0,Oe.ph)()){if(this._finished=!0,this.activities={},"ui.action.click"===this.op&&this.setTag("finishReason",this._finishReason),this.spanRecorder){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] finishing IdleTransaction",new Date(1e3*e).toISOString(),this.op);for(const t of this._beforeFinishCallbacks)t(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter((t=>{if(t.spanId===this.spanId)return!0;t.endTimestamp||(t.endTimestamp=e,t.setStatus("cancelled"),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(t,void 0,2)));const n=t.startTimestamp{this._finished||this._pushActivity(e)},n=e=>{this._finished||this._popActivity(e)};this.spanRecorder=new Cr(t,n,this.spanId,e),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:t}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=!1===t,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,0===Object.keys(this.activities).length&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Sr[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout((()=>{this._finished||0!==Object.keys(this.activities).length||(this._finishReason=Sr[1],this.finish(e))}),this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] popActivity ${e}`),delete this.activities[e],("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){const e=(0,Oe.ph)();this._idleTimeoutCanceledPermanently?(this._finishReason=Sr[5],this.finish(e)):this._restartIdleTimeout(e+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Sr[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout((()=>{this._beat()}),this._heartbeatInterval)}}function Or(e){if("boolean"===typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=Ue().getClient(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function Rr(e){return(e||Ue()).getScope().getTransaction()}let Dr=!1;function Pr(){const e=Rr();if(e){const t="internal_error";("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}function Br(){const e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function Mr(e,t,n){if(!Or(t))return e.sampled=!1,e;if(void 0!==e.sampled)return e.setMetadata({sampleRate:Number(e.sampled)}),e;let r;return"function"===typeof t.tracesSampler?(r=t.tracesSampler(n),e.setMetadata({sampleRate:Number(r)})):void 0!==n.parentSampled?r=n.parentSampled:"undefined"!==typeof t.tracesSampleRate?(r=t.tracesSampleRate,e.setMetadata({sampleRate:Number(r)})):(r=1,e.setMetadata({sampleRate:r})),function(e){if(W(e)||"number"!==typeof e&&"boolean"!==typeof e)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1;if(e<0||e>1)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${e}.`),!1;return!0}(r)?r?(e.sampled=Math.random(){let r,i;return o=>{t.value>=0&&(o||n)&&(i=t.value-(r||0),(i||void 0===r)&&(r=t.value,t.delta=i,e(t)))}},Zr=()=>jr.__WEB_VITALS_POLYFILL__?jr.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||(()=>{const e=jr.performance.timing,t=jr.performance.navigation.type,n={entryType:"navigation",startTime:0,type:2==t?"back_forward":1===t?"reload":"navigate"};for(const r in e)"navigationStart"!==r&&"toJSON"!==r&&(n[r]=Math.max(e[r]-e.navigationStart,0));return n})()):jr.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],Hr=()=>{const e=Zr();return e&&e.activationStart||0},zr=(e,t)=>{const n=Zr();let r="navigate";return n&&(r=jr.document.prerendering||Hr()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:"undefined"===typeof t?-1:t,rating:"good",delta:0,entries:[],id:`v3-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},Gr=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((e=>{t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(h){}},Vr=(e,t)=>{const n=r=>{"pagehide"!==r.type&&"hidden"!==jr.document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)};let Wr=-1;const qr=()=>(Wr<0&&(Wr="hidden"!==jr.document.visibilityState||jr.document.prerendering?1/0:0,Vr((({timeStamp:e})=>{Wr=e}),!0)),{get firstHiddenTime(){return Wr}}),$r={};function Kr(e){return"number"===typeof e&&isFinite(e)}function Yr(e,{startTimestamp:t,...n}){return t&&e.startTimestamp>t&&(e.startTimestamp=t),e.startChild({startTimestamp:t,...n})}function Xr(e){return e/1e3}function Jr(){return jr&&jr.addEventListener&&jr.performance}let Qr,ei,ti=0,ni={};function ri(){const e=Jr();if(e&&Oe.Z1){e.mark&&jr.performance.mark("sentry-tracing-init"),(e=>{const t=qr(),n=zr("FID");let r;const i=e=>{e.startTime{e.forEach(i)},s=Gr("first-input",o);r=Ur(e,n),s&&Vr((()=>{o(s.takeRecords()),s.disconnect()}),!0)})((e=>{const t=e.entries.pop();if(!t)return;const n=Xr(Oe.Z1),r=Xr(t.startTime);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding FID"),ni.fid={value:e.value,unit:"millisecond"},ni["mark.fid"]={value:n+r,unit:"second"}}));const t=(e=>{const t=zr("CLS",0);let n,r=0,i=[];const o=e=>{e.forEach((e=>{if(!e.hadRecentInput){const o=i[0],s=i[i.length-1];r&&0!==i.length&&e.startTime-s.startTime<1e3&&e.startTime-o.startTime<5e3?(r+=e.value,i.push(e)):(r=e.value,i=[e]),r>t.value&&(t.value=r,t.entries=i,n&&n())}}))},s=Gr("layout-shift",o);if(s){n=Ur(e,t);const r=()=>{o(s.takeRecords()),n(!0)};return Vr(r),r}})((e=>{const t=e.entries.pop();t&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding CLS"),ni.cls={value:e.value,unit:""},ei=t)})),n=(e=>{const t=qr(),n=zr("LCP");let r;const i=e=>{const i=e[e.length-1];if(i){const e=Math.max(i.startTime-Hr(),0);e{$r[n.id]||(i(o.takeRecords()),o.disconnect(),$r[n.id]=!0,r(!0))};return["keydown","click"].forEach((e=>{addEventListener(e,t,{once:!0,capture:!0})})),Vr(t,!0),t}})((e=>{const t=e.entries.pop();t&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding LCP"),ni.lcp={value:e.value,unit:"millisecond"},Qr=t)}));return()=>{t&&t(),n&&n()}}return()=>{}}function ii(e){const t=Jr();if(!t||!jr.performance.getEntries||!Oe.Z1)return;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Tracing] Adding & adjusting spans using Performance API");const n=Xr(Oe.Z1),r=t.getEntries();let i,o;if(r.slice(ti).forEach((t=>{const r=Xr(t.startTime),s=Xr(t.duration);if(!("navigation"===e.op&&n+r{oi(e,t,r,n)})),oi(e,t,"secureConnection",n,"TLS/SSL","connectEnd"),oi(e,t,"fetch",n,"cache","domainLookupStart"),oi(e,t,"domainLookup",n,"DNS"),function(e,t,n){Yr(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+Xr(t.requestStart),endTimestamp:n+Xr(t.responseEnd)}),Yr(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+Xr(t.responseStart),endTimestamp:n+Xr(t.responseEnd)})}(e,t,n)}(e,t,n),i=n+Xr(t.responseStart),o=n+Xr(t.requestStart);break;case"mark":case"paint":case"measure":{!function(e,t,n,r,i){const o=i+n,s=o+r;Yr(e,{description:t.name,endTimestamp:s,op:t.entryType,origin:"auto.resource.browser.metrics",startTimestamp:o})}(e,t,r,s,n);const i=qr(),o=t.startTime{if(!ni[t]||n>=e.startTimestamp)return;const r=ni[t].value,i=n+Xr(r),o=Math.abs(1e3*(i-e.startTimestamp)),s=o-r;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Measurements] Normalized ${t} from ${r} to ${o} (${s})`),ni[t].value=o}));const t=ni["mark.fid"];t&&ni.fid&&(Yr(e,{description:"first input delay",endTimestamp:t.value+Xr(ni.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:t.value}),delete ni["mark.fid"]),"fcp"in ni||delete ni.cls,Object.keys(ni).forEach((t=>{e.setMeasurement(t,ni[t].value,ni[t].unit)})),function(e){Qr&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding LCP Data"),Qr.element&&e.setTag("lcp.element",X(Qr.element)),Qr.id&&e.setTag("lcp.id",Qr.id),Qr.url&&e.setTag("lcp.url",Qr.url.trim().slice(0,200)),e.setTag("lcp.size",Qr.size));ei&&ei.sources&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Measurements] Adding CLS Data"),ei.sources.forEach(((t,n)=>e.setTag(`cls.source.${n+1}`,X(t.node)))))}(e)}Qr=void 0,ei=void 0,ni={}}function oi(e,t,n,r,i,o){const s=o?t[o]:t[`${n}End`],a=t[`${n}Start`];a&&s&&Yr(e,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+Xr(a),endTimestamp:r+Xr(s)})}const si=["localhost",/^\/(?!\/)/],ai={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:si,tracePropagationTargets:si};function ci(e){const{traceFetch:t,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:o,enableHTTPTimings:s}={traceFetch:ai.traceFetch,traceXHR:ai.traceXHR,...e},a="function"===typeof o?o:e=>!0,c=e=>function(e,t){return se(e,t||si)}(e,r||i),u={};t&&pt("fetch",(e=>{const t=function(e,t,n,r){if(!Or()||!e.fetchData)return;const i=t(e.fetchData.url);if(e.endTimestamp&&i){const t=e.fetchData.__span;if(!t)return;const n=r[t];if(n){if(e.response){n.setHttpStatus(e.response.status);const t=e.response&&e.response.headers&&e.response.headers.get("content-length"),r=parseInt(t);r>0&&n.setData("http.response_content_length",r)}else e.error&&n.setStatus("internal_error");n.finish(),delete r[t]}return}const o=Ue(),s=o.getScope(),a=o.getClient(),c=s.getSpan(),{method:u,url:l}=e.fetchData,d=i&&c?c.startChild({data:{url:l,type:"fetch","http.method":u},description:`${u} ${l}`,op:"http.client",origin:"auto.http.browser"}):void 0;d&&(e.fetchData.__span=d.spanId,r[d.spanId]=d);if(n(e.fetchData.url)&&a){const t=e.args[0];e.args[1]=e.args[1]||{};const n=e.args[1];n.headers=function(e,t,n,r,i){const o=i||n.getSpan(),s=o&&o.transaction,{traceId:a,sampled:c,dsc:u}=n.getPropagationContext(),l=o?o.toTraceparent():Ar(a,void 0,c),d=br(s?s.getDynamicSamplingContext():u||Gt(a,t,n)),f="undefined"!==typeof Request&&q(e,Request)?e.headers:r.headers;if(f){if("undefined"!==typeof Headers&&q(f,Headers)){const e=new Headers(f);return e.append("sentry-trace",l),d&&e.append(mr,d),e}if(Array.isArray(f)){const e=[...f,["sentry-trace",l]];return d&&e.push([mr,d]),e}{const e="baggage"in f?f.baggage:void 0,t=[];return Array.isArray(e)?t.push(...e):e&&t.push(e),d&&t.push(d),{...f,"sentry-trace":l,baggage:t.length>0?t.join(","):void 0}}}return{"sentry-trace":l,baggage:d}}(t,a,s,n,d)}return d}(e,a,c,u);s&&t&&ui(t)})),n&&pt("xhr",(e=>{const t=function(e,t,n,r){const i=e.xhr,o=i&&i.__sentry_xhr_v2__;if(!Or()||i&&i.__sentry_own_request__||!i||!o)return;const s=t(o.url);if(e.endTimestamp&&s){const e=i.__sentry_xhr_span_id__;if(!e)return;const t=r[e];return void(t&&(t.setHttpStatus(o.status_code),t.finish(),delete r[e]))}const a=Ue(),c=a.getScope(),u=c.getSpan(),l=s&&u?u.startChild({data:{...o.data,type:"xhr","http.method":o.method,url:o.url},description:`${o.method} ${o.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;l&&(i.__sentry_xhr_span_id__=l.spanId,r[i.__sentry_xhr_span_id__]=l);if(i.setRequestHeader&&n(o.url))if(l){const e=l&&l.transaction,t=br(e&&e.getDynamicSamplingContext());di(i,l.toTraceparent(),t)}else{const e=a.getClient(),{traceId:t,sampled:n,dsc:r}=c.getPropagationContext();di(i,Ar(t,void 0,n),br(r||(e?Gt(t,e,c):void 0)))}return l}(e,a,c,u);s&&t&&ui(t)}))}function ui(e){const t=e.data.url,n=new PerformanceObserver((r=>{r.getEntries().forEach((r=>{if(function(e){return"resource"===e.entryType&&"initiatorType"in e&&"string"===typeof e.nextHopProtocol&&("fetch"===e.initiatorType||"xmlhttprequest"===e.initiatorType)}(r)&&r.name.endsWith(t)){const t=function(e){const{name:t,version:n}=function(e){let t="unknown",n="unknown",r="";for(const i of e){if("/"===i){[t,n]=e.split("/");break}if(!isNaN(Number(i))){t="h"===r?"http":r,n=e.split(r)[1];break}r+=i}r===e&&(t=r);return{name:t,version:n}}(e.nextHopProtocol),r=[];if(r.push(["network.protocol.version",n],["network.protocol.name",t]),!Oe.Z1)return r;return[...r,["http.request.redirect_start",li(e.redirectStart)],["http.request.fetch_start",li(e.fetchStart)],["http.request.domain_lookup_start",li(e.domainLookupStart)],["http.request.domain_lookup_end",li(e.domainLookupEnd)],["http.request.connect_start",li(e.connectStart)],["http.request.secure_connection_start",li(e.secureConnectionStart)],["http.request.connection_end",li(e.connectEnd)],["http.request.request_start",li(e.requestStart)],["http.request.response_start",li(e.responseStart)],["http.request.response_end",li(e.responseEnd)]]}(r);t.forEach((t=>e.setData(...t))),n.disconnect()}}))}));n.observe({entryTypes:["resource"]})}function li(e=0){return((Oe.Z1||performance.timeOrigin)+e)/1e3}function di(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader(mr,n)}catch(r){}}const fi={...Tr,markBackgroundTransactions:!0,routingInstrumentation:function(e,t=!0,n=!0){if(!jr||!jr.location)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Could not initialize routing instrumentation due to invalid location"));let r,i=jr.location.href;t&&(r=e({name:jr.location.pathname,startTimestamp:Oe.Z1?Oe.Z1/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&pt("history",(({to:t,from:n})=>{void 0===n&&i&&-1!==i.indexOf(t)?i=void 0:n!==t&&(i=void 0,r&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.finish()),r=e({name:jr.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))}))},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...ai};class pi{constructor(e){this.name="BrowserTracing",this._hasSetTracePropagationTargets=!1,Lr(),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!(!e||!e.tracePropagationTargets&&!e.tracingOrigins)),this.options={...fi,...e},void 0!==this.options._experiments.enableLongTask&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=ri(),this.options.enableLongTask&&Gr("longtask",(e=>{for(const t of e){const e=Rr();if(!e)return;const n=Xr(Oe.Z1+t.startTime),r=Xr(t.duration);e.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+r})}})),this.options._experiments.enableInteractions&&Gr("event",(e=>{for(const t of e){const e=Rr();if(!e)return;if("click"===t.name){const n=Xr(Oe.Z1+t.startTime),r=Xr(t.duration);e.startChild({description:X(t.target),op:`ui.interaction.${t.name}`,origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+r})}}}),{durationThreshold:0})}setupOnce(e,t){this._getCurrentHub=t;const n=t().getClient(),r=n&&n.getOptions(),{routingInstrumentation:i,startTransactionOnLocationChange:o,startTransactionOnPageLoad:s,markBackgroundTransactions:a,traceFetch:c,traceXHR:u,shouldCreateSpanForRequest:l,enableHTTPTimings:d,_experiments:f}=this.options,p=r&&r.tracePropagationTargets,h=p||this.options.tracePropagationTargets;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&p&&ne.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),i((e=>{const n=this._createRouteTransaction(e);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,e,t),n}),s,o),a&&(jr&&jr.document?jr.document.addEventListener("visibilitychange",(()=>{const e=Rr();if(jr.document.hidden&&e){const t="cancelled";("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Transaction: ${t} -> since tab moved to the background, op: ${e.op}`),e.status||e.setStatus(t),e.setTag("visibilitychange","document.hidden"),e.finish()}})):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("[Tracing] Could not set up background tab detection due to lack of global document")),f.enableInteractions&&this._registerInteractionListener(),ci({traceFetch:c,traceXHR:u,tracePropagationTargets:h,shouldCreateSpanForRequest:l,enableHTTPTimings:d})}_createRouteTransaction(e){if(!this._getCurrentHub)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`));const t=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:r,finalTimeout:i,heartbeatInterval:o}=this.options,s="pageload"===e.op,a=s?hi("sentry-trace"):"",c=s?hi("baggage"):"",{traceparentData:u,dynamicSamplingContext:l,propagationContext:d}=xr(a,c),f={...e,...u,metadata:{...e.metadata,dynamicSamplingContext:u&&!l?{}:l},trimEnd:!0},p="function"===typeof n?n(f):f,h=void 0===p?{...f,sampled:!1}:p;h.metadata=h.name!==f.name?{...h.metadata,source:"custom"}:h.metadata,this._latestRouteName=h.name,this._latestRouteSource=h.metadata&&h.metadata.source,!1===h.sampled&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Will not send ${h.op} transaction because of beforeNavigate.`),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log(`[Tracing] Starting ${h.op} transaction on scope`);const{location:m}=jr,g=Fr(t,h,r,i,!0,{location:m},o),y=t.getScope();return s&&u?y.setPropagationContext(d):y.setPropagationContext({traceId:g.traceId,spanId:g.spanId,parentSpanId:g.parentSpanId,sampled:g.sampled}),g.registerBeforeFinishCallback((e=>{this._collectWebVitals(),ii(e)})),g}_registerInteractionListener(){let e;const t=()=>{const{idleTimeout:t,finalTimeout:n,heartbeatInterval:r}=this.options,i="ui.action.click",o=Rr();if(o&&o.op&&["navigation","pageload"].includes(o.op))return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Did not create ${i} transaction because a pageload or navigation transaction is in progress.`));if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Did not create ${i} transaction because _getCurrentHub is invalid.`));if(!this._latestRouteName)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn(`[Tracing] Did not create ${i} transaction because _latestRouteName is missing.`));const s=this._getCurrentHub(),{location:a}=jr,c={name:this._latestRouteName,op:i,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=Fr(s,c,t,n,!0,{location:a},r)};["click"].forEach((e=>{addEventListener(e,t,{once:!1,capture:!0})}))}}function hi(e){const t=(n=`meta[name=${e}]`,Y.document&&Y.document.querySelector?Y.document.querySelector(n):null);var n;return t?t.getAttribute("content"):void 0}var mi=n(61422),gi=n(83454);const yi=K.n2,bi="sentryReplaySession",vi="Unable to send Replay",wi=15e4,xi=5e3,Ai=2e7,Ei=36e5;var _i;function ki(e){const t=null===e||void 0===e?void 0:e.host;return Boolean(t&&t.shadowRoot&&t.shadowRoot===e)}function Ti({maskInputOptions:e,tagName:t,type:n}){"option"===t.toLowerCase()&&(t="select");const r="string"===typeof n?n.toLowerCase():void 0;return e[t.toLowerCase()]||r&&e[r]||"password"===r||"input"===t&&!n&&e.text}function Si({input:e,maskInputSelector:t,unmaskInputSelector:n,maskInputOptions:r,tagName:i,type:o,value:s,maskInputFn:a}){let c=s||"";return n&&e.matches(n)||(e.hasAttribute("data-rr-is-password")&&(o="password"),(Ti({maskInputOptions:r,tagName:i,type:o})||t&&e.matches(t))&&(c=a?a(c):"*".repeat(c.length))),c}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(_i||(_i={}));const Ci="__rrweb_original__";function Ii(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}function Oi(e,t,n){return"string"===typeof n&&n.toLowerCase(),"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}let Ri=1;const Di=new RegExp("[^a-z0-9-_:]");function Pi(e){return e?e.replace(/[\S]/g,"*"):""}function Bi(e){try{const t=e.rules||e.cssRules;return t?Array.from(t).map(Mi).join(""):null}catch(t){return null}}function Mi(e){let t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=Bi(e.styleSheet)||t}catch(n){}return Ni(t)}function Ni(e){if(e.indexOf(":")>-1){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}return e}let Fi,Li;const ji=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ui=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Zi=/^(data:)([^,]*),(.*)/i;function Hi(e,t){return(e||"").replace(ji,((e,n,r,i,o,s)=>{const a=r||o||s,c=n||i||"";if(!a)return e;if(!Ui.test(a))return`url(${c}${a}${c})`;if(Zi.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const u=t.split("/"),l=a.split("/");u.pop();for(const t of l)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${c}${u.join("/")}${c})`}))}const zi=/^[^ \t\n\r\u000c]+/,Gi=/^[, \t\n\r\u000c]+/;function Vi(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function Wi(){const e=document.createElement("a");return e.href="",e.href}function qi(e,t,n,r,i,o,s,a){if(!i)return i;const c=r.toLowerCase(),u=n.toLowerCase();return"src"===c||"href"===c||"xlink:href"===c&&"#"!==i[0]?Vi(e,i):"background"!==c||"table"!==u&&"td"!==u&&"th"!==u?"srcset"===c?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}let i=[];for(;r(Gi),!(n>=t.length);){let o=r(zi);if(","===o.slice(-1))o=Vi(e,o.substring(0,o.length-1)),i.push(o);else{let r="";o=Vi(e,o);let s=!1;for(;;){let e=t.charAt(n);if(""===e){i.push((o+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,i.push((o+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return i.join(", ")}(e,i):"style"===c?Hi(i,Wi()):"object"===u&&"data"===c?Vi(e,i):o&&function(e,t,n,r){if(r&&e.matches(r))return!1;return["placeholder","title","aria-label"].indexOf(t)>-1||"input"===n&&"value"===t&&e.hasAttribute("type")&&["submit","button"].indexOf(e.getAttribute("type").toLowerCase())>-1}(t,c,u,s)?a?a(i):Pi(i):i:Vi(e,i)}function $i(e,t,n,r,i){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return $i(e.parentNode,t,n,r,i);if(r&&(e.matches(r)||e.closest(r)))return!1;if(i)return!0;if("string"===typeof t){if(e.classList.contains(t))return!0}else for(let o=0;ot.href===e.href));let n=null;t&&(n=Bi(t)),n&&(delete T.rel,delete T.href,T._cssText=Hi(n,t.href))}if("style"===k&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=Bi(e.sheet);t&&(T._cssText=Hi(t,Wi()))}if("input"===k||"textarea"===k||"select"===k||"option"===k){const t=e,n=Ii(t),r=Oi(t,k.toUpperCase(),n),i=e.checked;"submit"!==n&&"button"!==n&&r&&(T.value=Si({input:t,type:n,tagName:k,value:r,maskInputSelector:d,unmaskInputSelector:f,maskInputOptions:h,maskInputFn:g})),i&&(T.checked=i)}if("option"===k&&(e.selected&&!h.select?T.selected=!0:delete T.selected),"canvas"===k&&v)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n0!==e)))return!1}return!0})(e)||(T.rr_dataURL=e.toDataURL(y.type,y.quality));else if(!("__context"in e)){const t=e.toDataURL(y.type,y.quality),n=document.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(y.type,y.quality)&&(T.rr_dataURL=t)}if("img"===k&&b){Fi||(Fi=r.createElement("canvas"),Li=Fi.getContext("2d"));const t=e,n=t.crossOrigin;t.crossOrigin="anonymous";const i=()=>{try{Fi.width=t.naturalWidth,Fi.height=t.naturalHeight,Li.drawImage(t,0,0),T.rr_dataURL=Fi.toDataURL(y.type,y.quality)}catch(e){console.warn(`Cannot inline img src=${t.currentSrc}! Error: ${e}`)}n?T.crossOrigin=n:delete T.crossOrigin};t.complete&&0!==t.naturalWidth?i():t.onload=i}if("audio"!==k&&"video"!==k||(T.rr_mediaState=e.paused?"paused":"played",T.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(T.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(T.rr_scrollTop=e.scrollTop),t){const{width:t,height:n}=e.getBoundingClientRect();T={class:T.class,rr_width:`${t}px`,rr_height:`${n}px`}}return"iframe"!==k||w(T.src)||(e.contentDocument||(T.rr_src=T.src),delete T.src),{type:_i.Element,tagName:k,attributes:T,childNodes:[],isSVG:(E=e,Boolean("svg"===E.tagName||E.ownerSVGElement)||void 0),needBlock:t,rootId:x};case e.TEXT_NODE:const S=e.parentNode&&e.parentNode.tagName;let C=e.textContent;const I="STYLE"===S||void 0,O="SCRIPT"===S||void 0;if(I&&C){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(C=(A=e.parentNode.sheet).cssRules?Array.from(A.cssRules).map((e=>e.cssText?Ni(e.cssText):"")).join(""):"")}catch(_){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${_}`,e)}C=Hi(C,Wi())}if(O&&(C="SCRIPT_PLACEHOLDER"),"TEXTAREA"===S&&C)C="";else if("OPTION"===S&&C){C=Si({input:e.parentNode,type:null,tagName:S,value:C,maskInputSelector:d,unmaskInputSelector:f,maskInputOptions:h,maskInputFn:g})}else!I&&!O&&$i(e,a,c,u,p)&&C&&(C=m?m(C):Pi(C));return{type:_i.Text,textContent:C||"",isStyle:I,rootId:x};case e.CDATA_SECTION_NODE:return{type:_i.CDATA,textContent:"",rootId:x};case e.COMMENT_NODE:return{type:_i.Comment,textContent:e.textContent||"",rootId:x};default:return!1}var A,E}function Yi(e){return void 0===e||null===e?"":e.toLowerCase()}function Xi(e,t){const{doc:n,map:r,blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:a,maskTextSelector:c,unmaskTextSelector:u,skipChild:l=!1,inlineStylesheet:d=!0,maskInputSelector:f,unmaskInputSelector:p,maskAllText:h,maskInputOptions:m={},maskTextFn:g,maskInputFn:y,slimDOMOptions:b,dataURLOptions:v={},inlineImages:w=!1,recordCanvas:x=!1,onSerialize:A,onIframeLoad:E,iframeLoadTimeout:_=5e3,keepIframeSrcFn:k=(()=>!1)}=t;let{preserveWhiteSpace:T=!0}=t;const S=Ki(e,{doc:n,blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:a,maskTextSelector:c,unmaskTextSelector:u,inlineStylesheet:d,maskInputSelector:f,unmaskInputSelector:p,maskAllText:h,maskInputOptions:m,maskTextFn:g,maskInputFn:y,dataURLOptions:v,inlineImages:w,recordCanvas:x,keepIframeSrcFn:k});if(!S)return console.warn(e,"not serialized"),null;let C;C="__sn"in e?e.__sn.id:!function(e,t){if(t.comment&&e.type===_i.Comment)return!0;if(e.type===_i.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"===typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Yi(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Yi(e.attributes.name)||"icon"===Yi(e.attributes.rel)||"apple-touch-icon"===Yi(e.attributes.rel)||"shortcut icon"===Yi(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Yi(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Yi(e.attributes.property).match(/^(og|twitter|fb):/)||Yi(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Yi(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Yi(e.attributes.name)||"googlebot"===Yi(e.attributes.name)||"bingbot"===Yi(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Yi(e.attributes.name)||"generator"===Yi(e.attributes.name)||"framework"===Yi(e.attributes.name)||"publisher"===Yi(e.attributes.name)||"progid"===Yi(e.attributes.name)||Yi(e.attributes.property).match(/^article:/)||Yi(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Yi(e.attributes.name)||"yandex-verification"===Yi(e.attributes.name)||"csrf-token"===Yi(e.attributes.name)||"p:domain_verify"===Yi(e.attributes.name)||"verify-v1"===Yi(e.attributes.name)||"verification"===Yi(e.attributes.name)||"shopify-checkout-api-token"===Yi(e.attributes.name)))return!0}}return!1}(S,b)&&(T||S.type!==_i.Text||S.isStyle||S.textContent.replace(/^\s+|\s+$/gm,"").length)?Ri++:-2;const I=Object.assign(S,{id:C});if(e.__sn=I,-2===C)return null;r[C]=e,A&&A(e);let O=!l;if(I.type===_i.Element&&(O=O&&!I.needBlock,delete I.needBlock,e.shadowRoot&&(I.isShadowHost=!0)),(I.type===_i.Document||I.type===_i.Element)&&O){b.headWhitespace&&S.type===_i.Element&&"head"===S.tagName&&(T=!1);const t={doc:n,map:r,blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:a,maskTextSelector:c,unmaskTextSelector:u,skipChild:l,inlineStylesheet:d,maskInputSelector:f,unmaskInputSelector:p,maskAllText:h,maskInputOptions:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:b,dataURLOptions:v,inlineImages:w,recordCanvas:x,preserveWhiteSpace:T,onSerialize:A,onIframeLoad:E,iframeLoadTimeout:_,keepIframeSrcFn:k};for(const n of Array.from(e.childNodes)){const e=Xi(n,t);e&&I.childNodes.push(e)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const e=Xi(n,t);e&&(e.isShadow=!0,I.childNodes.push(e))}}return e.parentNode&&ki(e.parentNode)&&(I.isShadow=!0),I.type===_i.Element&&"iframe"===I.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let i,o=!1;try{i=r.document.readyState}catch(a){return}if("complete"!==i){const r=setTimeout((()=>{o||(t(),o=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),o=!0,t()}))}const s="about:blank";r.location.href===s&&e.src!==s&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}(e,(()=>{const t=e.contentDocument;if(t&&E){const n=Xi(t,{doc:t,map:r,blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:a,maskTextSelector:c,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputSelector:f,unmaskInputSelector:p,maskAllText:h,maskInputOptions:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:b,dataURLOptions:v,inlineImages:w,recordCanvas:x,preserveWhiteSpace:T,onSerialize:A,onIframeLoad:E,iframeLoadTimeout:_,keepIframeSrcFn:k});n&&E(e,n)}}),_),I}function Ji(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}var Qi,eo,to,no,ro,io;function oo(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(Qi||(Qi={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration"}(eo||(eo={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}(to||(to={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(no||(no={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(ro||(ro={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(io||(io={}));const so="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let ao={map:{},getId:()=>(console.error(so),-1),getNode:()=>(console.error(so),null),removeNodeFromMap(){console.error(so)},has:()=>(console.error(so),!1),reset(){console.error(so)}};function co(e,t,n={}){let r=null,i=0;return function(o){let s=Date.now();i||!1!==n.leading||(i=s);let a=t-(s-i),c=this,u=arguments;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(c,u)):r||!1===n.trailing||(r=setTimeout((()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(c,u)}),a))}}function uo(e,t,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>uo(e,t,o||{},!0)}function lo(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"===typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(r){return()=>{}}}function fo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function po(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ho(e,t,n,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){let i=!1;const o=r&&e.matches(r);return"string"===typeof t?i=void 0!==e.closest?!o&&null!==e.closest("."+t):!o&&e.classList.contains(t):!o&&e.classList.forEach((e=>{t.test(e)&&(i=!0)})),!i&&n&&(i=e.matches(n)),!o&&i||ho(e.parentNode,t,n,r)}return e.nodeType,e.TEXT_NODE,ho(e.parentNode,t,n,r)}function mo(e){return"__sn"in e&&-2===e.__sn.id}function go(e,t){if(ki(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||go(e.parentNode,t))}function yo(e){return Boolean(e.changedTouches)}function bo(e){return"__sn"in e&&(e.__sn.type===_i.Element&&"iframe"===e.__sn.tagName)}function vo(e){return Boolean(null===e||void 0===e?void 0:e.shadowRoot)}function wo(e){return"__ln"in e}"undefined"!==typeof window&&window.Proxy&&window.Reflect&&(ao=new Proxy(ao,{get:(e,t,n)=>("map"===t&&console.error(so),Reflect.get(e,t,n))}));class xo{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n`${e}@${t}`;function Eo(e){return"__sn"in e}class _o{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new xo,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{var i,o,s,a,c;const u=r.getRootNode?null===(i=r.getRootNode())||void 0===i?void 0:i.host:null;let l=u;for(;null===(s=null===(o=null===l||void 0===l?void 0:l.getRootNode)||void 0===o?void 0:o.call(l))||void 0===s?void 0:s.host;)l=(null===(c=null===(a=null===l||void 0===l?void 0:l.getRootNode)||void 0===a?void 0:a.call(l))||void 0===c?void 0:c.host)||null;const d=!this.doc.contains(r)&&(!l||!this.doc.contains(l));if(!r.parentNode||d)return;const f=ki(r.parentNode)?this.mirror.getId(u):this.mirror.getId(r.parentNode),p=n(r);if(-1===f||-1===p)return t.addNode(r);let h=Xi(r,{doc:this.doc,map:this.mirror.map,blockClass:this.blockClass,blockSelector:this.blockSelector,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,maskInputSelector:this.maskInputSelector,unmaskInputSelector:this.unmaskInputSelector,skipChild:!0,inlineStylesheet:this.inlineStylesheet,maskAllText:this.maskAllText,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{bo(e)&&this.iframeManager.addIframe(e),vo(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,document)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)}});h&&e.push({parentId:f,nextId:p,node:h})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)To(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||r(s);for(const s of this.addedSet)So(this.droppedSet,s)||To(this.removes,s,this.mirror)?So(this.movedSet,s)?r(s):this.droppedSet.add(s):r(s);let i=null;for(;t.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),r=n(i.value);-1!==t&&-1!==r&&(e=i)}if(!e)for(let r=t.length-1;r>=0;r--){const i=t.get(r);if(i){const t=this.mirror.getId(i.value.parentNode),r=n(i.value);if(-1!==t&&-1!==r){e=i;break}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}i=e.previous,t.removeNode(e.value),r(e.value)}const o={texts:this.texts.map((e=>({id:this.mirror.getId(e.node),value:e.value}))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>({id:this.mirror.getId(e.node),attributes:e.attributes}))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!mo(e.target))switch(e.type){case"characterData":{const t=e.target.textContent;ho(e.target,this.blockClass,this.blockSelector,this.unblockSelector)||t===e.oldValue||this.texts.push({value:$i(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=n.getAttribute(e.attributeName);if("value"===e.attributeName&&(r=Si({input:n,maskInputSelector:this.maskInputSelector,unmaskInputSelector:this.unmaskInputSelector,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:n.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ho(e.target,this.blockClass,this.blockSelector,this.unblockSelector)||r===e.oldValue)return;let i=this.attributes.find((t=>t.node===e.target));if(i||(i={node:e.target,attributes:{}},this.attributes.push(i)),"type"===e.attributeName&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),"style"===e.attributeName){const r=this.doc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue),void 0!==i.attributes.style&&null!==i.attributes.style||(i.attributes.style={});try{const e=i.attributes.style;for(const t of Array.from(n.style)){const i=n.style.getPropertyValue(t),o=n.style.getPropertyPriority(t);i===r.style.getPropertyValue(t)&&o===r.style.getPropertyPriority(t)||(e[t]=""===o?i:[i,o])}for(const t of Array.from(r.style))""===n.style.getPropertyValue(t)&&(e[t]=!1)}catch(t){console.warn("[rrweb] Error when parsing update to style attribute:",t)}}else{const t=e.target;i.attributes[e.attributeName]=qi(this.doc,t,t.tagName,e.attributeName,r,this.maskAllText,this.unmaskTextSelector,this.maskTextFn)}break}case"childList":e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=ki(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);ho(e.target,this.blockClass,this.blockSelector,this.unblockSelector)||mo(t)||(this.addedSet.has(t)?(ko(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||go(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ao(n,r)]?ko(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!!ki(e.target)||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!t||!ho(t,this.blockClass,this.blockSelector,this.unblockSelector)){if(Eo(e)){if(mo(e))return;this.movedSet.add(e);let n=null;t&&Eo(t)&&(n=t.__sn.id),n&&(this.movedMap[Ao(e.__sn.id,n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ho(e,this.blockClass,this.blockSelector,this.unblockSelector)||e.childNodes.forEach((e=>this.genAdds(e)))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskTextClass","maskTextSelector","unmaskTextSelector","maskInputSelector","unmaskInputSelector","inlineStylesheet","maskAllText","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ko(e,t){e.delete(t),t.childNodes.forEach((t=>ko(e,t)))}function To(e,t,n){const{parentNode:r}=t;if(!r)return!1;const i=n.getId(r);return!!e.some((e=>e.id===i))||To(e,r,n)}function So(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||So(e,n))}const Co=e=>(...t)=>{try{return e(...t)}catch(n){try{n.__rrweb__=!0}catch(r){}throw n}},Io=[];function Oo(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function Ro(e,t){var n,r;const i=new _o;Io.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const s=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");s&&window[s]&&(o=window[s]);const a=new o(Co((t=>{e.onMutation&&!1===e.onMutation(t)||i.processMutations(t)})));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Do({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,c=[];return Object.keys(to).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((s=>{const a=s.toLowerCase(),u=Co((t=>s=>{const a=Oo(s);if(ho(a,r,i,o))return;const c=yo(s)?s.changedTouches[0]:s;if(!c)return;const u=n.getId(a),{clientX:l,clientY:d}=c;Co(e)({type:to[t],id:u,x:l,y:d})})(s));c.push(oo(a,u,t))})),Co((()=>{c.forEach((e=>e()))}))}function Po({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,sampling:s}){const a=co((s=>{const a=Oo(s);if(!a||ho(a,r,i,o))return;const c=n.getId(a);if(a===t){const n=t.scrollingElement||t.documentElement;Co(e)({id:c,x:n.scrollLeft,y:n.scrollTop})}else Co(e)({id:c,x:a.scrollLeft,y:a.scrollTop})}),s.scroll||100);return oo("scroll",Co(a),t)}function Bo(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Mo=["INPUT","TEXTAREA","SELECT"],No=new WeakMap;function Fo({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputSelector:c,unmaskInputSelector:u,maskInputOptions:l,maskInputFn:d,sampling:f,userTriggeredOnInput:p}){function h(e){let n=Oo(e);const f=n&&n.tagName,h=e.isTrusted;if("OPTION"===f&&(n=n.parentElement),!n||!f||Mo.indexOf(f)<0||ho(n,r,i,o))return;const g=n,y=Ii(g);if(g.classList.contains(s)||a&&g.matches(a))return;let b=Oi(g,f,y),v=!1;"radio"!==y&&"checkbox"!==y||(v=n.checked),function({tagName:e,type:t,maskInputOptions:n,maskInputSelector:r}){return r||Ti({maskInputOptions:n,tagName:e,type:t})}({maskInputOptions:l,maskInputSelector:c,tagName:f,type:y})&&(b=Si({input:g,maskInputOptions:l,maskInputSelector:c,unmaskInputSelector:u,tagName:f,type:y,value:b,maskInputFn:d})),m(n,Co(Bo)({text:b,isChecked:v,userTriggered:h},p));const w=n.name;"radio"===y&&w&&v&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach((e=>{if(e!==n){const t=Si({input:e,maskInputOptions:l,maskInputSelector:c,unmaskInputSelector:u,tagName:f,type:y,value:Oi(e,f,y),maskInputFn:d});m(e,Co(Bo)({text:t,isChecked:!v,userTriggered:!1},p))}}))}function m(t,r){const i=No.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){No.set(t,r);const i=n.getId(t);e(Object.assign(Object.assign({},r),{id:i}))}}const g=("last"===f.input?["change"]:["input","change"]).map((e=>oo(e,Co(h),t))),y=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),b=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return y&&y.set&&g.push(...b.map((e=>uo(e[0],e[1],{set(){Co(h)({target:this})}})))),Co((()=>{g.forEach((e=>e()))}))}function Lo(e){return function(e,t){if(Uo("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Uo("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Uo("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Uo("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function jo(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:l,canvasMutationCb:d,fontCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),l(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),f(...e)}}(e,t);const r=Ro(e,e.doc),i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const i="number"===typeof t.mousemove?t.mousemove:50,o="number"===typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=co((t=>{const n=Date.now()-s;Co(e)(a.map((e=>(e.timeOffset-=n,e))),t),a=[],s=null}),o),u=co((e=>{const t=Oo(e),{clientX:n,clientY:i}=yo(e)?e.changedTouches[0]:e;s||(s=Date.now()),a.push({x:n,y:i,id:r.getId(t),timeOffset:Date.now()-s}),c("undefined"!==typeof DragEvent&&e instanceof DragEvent?eo.Drag:e instanceof MouseEvent?eo.MouseMove:eo.TouchMove)}),i,{trailing:!1}),l=[oo("mousemove",Co(u),n),oo("touchmove",Co(u),n),oo("drag",Co(u),n)];return Co((()=>{l.forEach((e=>e()))}))}(e),o=Do(e),s=Po(e),a=function({viewportResizeCb:e}){let t=-1,n=-1;const r=co((()=>{const r=fo(),i=po();t===r&&n===i||(Co(e)({width:Number(i),height:Number(r)}),t=r,n=i)}),200);return oo("resize",Co(r),window)}(e),c=Fo(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:i,sampling:o}){const s=s=>co(Co((o=>{const a=Oo(o);if(!a||ho(a,t,n,r))return;const{currentTime:c,volume:u,muted:l}=a;e({type:s,id:i.getId(a),currentTime:c,volume:u,muted:l})})),o.media||500),a=[oo("play",s(0)),oo("pause",s(1)),oo("seeked",s(2)),oo("volumechange",s(3))];return Co((()=>{a.forEach((e=>e()))}))}(e),l=function({styleSheetRuleCb:e,mirror:t},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(r,{apply:Co(((n,r,i)=>{const[o,s]=i,a=t.getId(r.ownerNode);return-1!==a&&e({id:a,adds:[{rule:o,index:s}]}),n.apply(r,i)}))});const i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Co(((n,r,i)=>{const[o]=i,s=t.getId(r.ownerNode);return-1!==s&&e({id:s,removes:[{index:o}]}),n.apply(r,i)}))});const o={};Zo("CSSGroupingRule")?o.CSSGroupingRule=n.CSSGroupingRule:(Zo("CSSMediaRule")&&(o.CSSMediaRule=n.CSSMediaRule),Zo("CSSConditionRule")&&(o.CSSConditionRule=n.CSSConditionRule),Zo("CSSSupportsRule")&&(o.CSSSupportsRule=n.CSSSupportsRule));const s={};return Object.entries(o).forEach((([n,r])=>{s[n]={insertRule:r.prototype.insertRule,deleteRule:r.prototype.deleteRule},r.prototype.insertRule=new Proxy(s[n].insertRule,{apply:Co(((n,r,i)=>{const[o,s]=i,a=t.getId(r.parentStyleSheet.ownerNode);return-1!==a&&e({id:a,adds:[{rule:o,index:[...Lo(r),s||0]}]}),n.apply(r,i)}))}),r.prototype.deleteRule=new Proxy(s[n].deleteRule,{apply:Co(((n,r,i)=>{const[o]=i,s=t.getId(r.parentStyleSheet.ownerNode);return-1!==s&&e({id:s,removes:[{index:[...Lo(r),o]}]}),n.apply(r,i)}))})})),Co((()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=i,Object.entries(o).forEach((([e,t])=>{t.prototype.insertRule=s[e].insertRule,t.prototype.deleteRule=s[e].deleteRule}))}))}(e,{win:n}),d=function({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(r,{apply:Co(((n,r,i)=>{var o,s;const[a,c,u]=i,l=t.getId(null===(s=null===(o=r.parentRule)||void 0===o?void 0:o.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==l&&e({id:l,set:{property:a,value:c,priority:u},index:Lo(r.parentRule)}),n.apply(r,i)}))});const i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Co(((n,r,i)=>{var o,s;const[a]=i,c=t.getId(null===(s=null===(o=r.parentRule)||void 0===o?void 0:o.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==c&&e({id:c,remove:{property:a},index:Lo(r.parentRule)}),n.apply(r,i)}))}),Co((()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=i}))}(e,{win:n}),f=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){const r=new o(e,t,n);return i.set(r,{family:e,buffer:"string"!==typeof t,descriptors:n,fontSource:"string"===typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=lo(t.fonts,"add",(function(t){return function(n){return setTimeout((()=>{const t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=o})),r.push(s),Co((()=>{r.forEach((e=>e()))}))}(e):()=>{},p=[];for(const h of e.plugins)p.push(h.observer(h.callback,n,h.options));return Co((()=>{Io.forEach((e=>e.reset())),r.disconnect(),i(),o(),s(),a(),c(),u();try{l(),d()}catch(h){}f(),p.forEach((e=>e()))}))}function Uo(e){return"undefined"!==typeof window[e]}function Zo(e){return Boolean("undefined"!==typeof window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ho{constructor(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}addIframe(e){this.iframes.set(e,!0)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)}}class zo{constructor(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(lo(HTMLElement.prototype,"attachShadow",(function(e){return function(){const n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}addShadowRoot(e,t){Ro(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Po(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(lo(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){const r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}}reset(){this.restorePatches.forEach((e=>e()))}}for(var Go="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vo="undefined"===typeof Uint8Array?[]:new Uint8Array(256),Wo=0;Wo{if(!e||!Xo(e,t)&&"object"!==typeof e)return;const r=function(e,t){let n=qo.get(e);return n||(n=new Map,qo.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i};function Ko(e,t,n){if(e instanceof Array)return e.map((e=>Ko(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t>2],i+=Go[(3&n[t])<<4|n[t+1]>>4],i+=Go[(15&n[t+1])<<2|n[t+2]>>6],i+=Go[63&n[t+2]];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ko(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ko(e.data,t,n),e.width,e.height]}}if(Xo(e,t)||"object"===typeof e){return{rr_type:e.constructor.name,index:$o(e,t,n)}}return e}const Yo=(e,t,n)=>[...e].map((e=>Ko(e,t,n))),Xo=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"===typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Jo(e,t,n,r,i,o,s,a){const c=[],u=Object.getOwnPropertyNames(e);for(const d of u)try{if("function"!==typeof e[d])continue;const u=lo(e,d,(function(c){return function(...u){const l=c.apply(this,u);if($o(l,a,e),!ho(this.canvas,r,o,i)){s.getId(this.canvas);const r=Yo([...u],a,e),i={type:t,property:d,args:r};n(this.canvas,i)}return l}}));c.push(u)}catch(l){const r=uo(e,d,{set(e){n(this.canvas,{type:t,property:d,args:[e],setter:!0})}});c.push(r)}return c}class Qo{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass,e.blockSelector,e.unblockSelector)}initCanvasMutationObserver(e,t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=function(e,t,n,r){const i=[];try{const o=lo(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...o){return ho(this,t,n,r)||"__context"in this||(this.__context=i),e.apply(this,[i,...o])}}));i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}(e,t,r,n),o=function(e,t,n,r,i,o){const s=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const u of a)try{if("function"!==typeof t.CanvasRenderingContext2D.prototype[u])continue;const o=lo(t.CanvasRenderingContext2D.prototype,u,(function(t){return function(...o){return ho(this.canvas,n,i,r)||setTimeout((()=>{const t=[...o];if("drawImage"===u&&t[0]&&t[0]instanceof HTMLCanvasElement){const e=t[0],n=e.getContext("2d");let r=null===n||void 0===n?void 0:n.getImageData(0,0,e.width,e.height),i=null===r||void 0===r?void 0:r.data;t[0]=JSON.stringify(i)}e(this.canvas,{type:no["2D"],property:u,args:t})}),0),t.apply(this,o)}}));s.push(o)}catch(c){const n=uo(t.CanvasRenderingContext2D.prototype,u,{set(t){e(this.canvas,{type:no["2D"],property:u,args:[t],setter:!0})}});s.push(n)}return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n,this.mirror),s=function(e,t,n,r,i,o){const s=[];return s.push(...Jo(t.WebGLRenderingContext.prototype,no.WebGL,e,n,r,i,o,t)),"undefined"!==typeof t.WebGL2RenderingContext&&s.push(...Jo(t.WebGL2RenderingContext.prototype,no.WebGL2,e,n,r,i,o,t)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie&&e.__sn?e.__sn.id:-1,getNode(e){return this.map[e]||null},removeNodeFromMap(e){const t=e.__sn&&e.__sn.id;delete this.map[t],e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))},has(e){return this.map.hasOwnProperty(e)},reset(){this.map={}}};function is(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,unblockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:u="rr-mask",maskTextSelector:l=null,maskInputSelector:d=null,unmaskTextSelector:f=null,unmaskInputSelector:p=null,inlineStylesheet:h=!0,maskAllText:m=!1,maskAllInputs:g,maskInputOptions:y,slimDOMOptions:b,maskInputFn:v,maskTextFn:w,hooks:x,packFn:A,sampling:E={},mousemoveWait:_,recordCanvas:k=!1,userTriggeredOnInput:T=!1,collectFonts:S=!1,inlineImages:C=!1,plugins:I,keepIframeSrcFn:O=(()=>!1),onMutation:R}=e;if(!t)throw new Error("emit function is required");void 0!==_&&void 0===E.mousemove&&(E.mousemove=_);const D=!0===g?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==y?y:{},P=!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===b,headMetaDescKeywords:"all"===b}:b||{};let B;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();let M=0;ts=(e,i)=>{var o;if(!(null===(o=Io[0])||void 0===o?void 0:o.isFrozen())||e.type===Qi.FullSnapshot||e.type===Qi.IncrementalSnapshot&&e.data.source===eo.Mutation||Io.forEach((e=>e.unfreeze())),t((e=>{for(const t of I||[])t.eventProcessor&&(e=t.eventProcessor(e));return A&&(e=A(e)),e})(e),i),e.type===Qi.FullSnapshot)B=e,M=0;else if(e.type===Qi.IncrementalSnapshot){if(e.data.source===eo.Mutation&&e.data.isAttachIframe)return;M++;const t=r&&M>=r,i=n&&e.timestamp-B.timestamp>n;(t||i)&&ns(!0)}};const N=e=>{ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.Mutation},e)}))},F=e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.Scroll},e)})),L=e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.CanvasMutation},e)})),j=new Ho({mutationCb:N}),U=new Qo({recordCanvas:k,mutationCb:L,win:window,blockClass:i,blockSelector:o,unblockSelector:s,mirror:rs}),Z=new zo({mutationCb:N,scrollCb:F,bypassOptions:{onMutation:R,blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:u,maskTextSelector:l,unmaskTextSelector:f,maskInputSelector:d,unmaskInputSelector:p,inlineStylesheet:h,maskAllText:m,maskInputOptions:D,maskTextFn:w,maskInputFn:v,recordCanvas:k,inlineImages:C,sampling:E,slimDOMOptions:P,iframeManager:j,canvasManager:U},mirror:rs});ns=(e=!1)=>{var t,n,r,a;ts(es({type:Qi.Meta,data:{href:window.location.href,width:po(),height:fo()}}),e),Io.forEach((e=>e.lock()));const[c,g]=function(e,t){const{blockClass:n="rr-block",blockSelector:r=null,unblockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,unmaskTextSelector:a=null,inlineStylesheet:c=!0,inlineImages:u=!1,recordCanvas:l=!1,maskInputSelector:d=null,unmaskInputSelector:f=null,maskAllText:p=!1,maskAllInputs:h=!1,maskTextFn:m,maskInputFn:g,slimDOM:y=!1,dataURLOptions:b,preserveWhiteSpace:v,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:A,keepIframeSrcFn:E=(()=>!1)}=t||{},_={};return[Xi(e,{doc:e,map:_,blockClass:n,blockSelector:r,unblockSelector:i,maskTextClass:o,maskTextSelector:s,unmaskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputSelector:d,unmaskInputSelector:f,maskAllText:p,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===h?{}:h,maskTextFn:m,maskInputFn:g,slimDOMOptions:!0===y||"all"===y?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===y,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===y?{}:y,dataURLOptions:b,inlineImages:u,recordCanvas:l,preserveWhiteSpace:v,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:A,keepIframeSrcFn:E}),_]}(document,{blockClass:i,blockSelector:o,unblockSelector:s,maskTextClass:u,maskTextSelector:l,unmaskTextSelector:f,maskInputSelector:d,unmaskInputSelector:p,inlineStylesheet:h,maskAllText:m,maskAllInputs:D,maskTextFn:w,slimDOM:P,recordCanvas:k,inlineImages:C,onSerialize:e=>{bo(e)&&j.addIframe(e),vo(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{j.attachIframe(e,t),Z.observeAttachShadow(e)},keepIframeSrcFn:O});if(!c)return console.warn("Failed to snapshot the document");rs.map=g,ts(es({type:Qi.FullSnapshot,data:{node:c,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),Io.forEach((e=>e.unlock()))};try{const e=[];e.push(oo("DOMContentLoaded",(()=>{ts(es({type:Qi.DomContentLoaded,data:{}}))})));const t=e=>{var t;return Co(jo)({onMutation:R,mutationCb:N,mousemoveCb:(e,t)=>ts(es({type:Qi.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.MouseInteraction},e)})),scrollCb:F,viewportResizeCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.ViewportResize},e)})),inputCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.Input},e)})),mediaInteractionCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.MediaInteraction},e)})),styleSheetRuleCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.StyleSheetRule},e)})),styleDeclarationCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.StyleDeclaration},e)})),canvasMutationCb:L,fontCb:e=>ts(es({type:Qi.IncrementalSnapshot,data:Object.assign({source:eo.Font},e)})),blockClass:i,ignoreClass:a,ignoreSelector:c,maskTextClass:u,maskTextSelector:l,unmaskTextSelector:f,maskInputSelector:d,unmaskInputSelector:p,maskInputOptions:D,inlineStylesheet:h,sampling:E,recordCanvas:k,inlineImages:C,userTriggeredOnInput:T,collectFonts:S,doc:e,maskAllText:m,maskInputFn:v,maskTextFn:w,blockSelector:o,unblockSelector:s,slimDOMOptions:P,mirror:rs,iframeManager:j,shadowDomManager:Z,canvasManager:U,plugins:(null===(t=null===I||void 0===I?void 0:I.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>ts(es({type:Qi.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},x)};j.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{ns(),e.push(t(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(oo("load",(()=>{ts(es({type:Qi.Load,data:{}})),n()}),window)),()=>{e.forEach((e=>e()))}}catch(H){console.warn(H)}}function os(e){return e>9999999999?e:1e3*e}function ss(e,t){"sentry.transaction"!==t.category&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate((()=>(e.throttledAddEvent({type:Qi.Custom,timestamp:1e3*(t.timestamp||0),data:{tag:"breadcrumb",payload:St(t,10,1e3)}}),"console"===t.category))))}is.addCustomEvent=(e,t)=>{if(!ts)throw new Error("please add custom event after start recording");ts(es({type:Qi.Custom,data:{tag:e,payload:t}}))},is.freezePage=()=>{Io.forEach((e=>e.freeze()))},is.takeFullSnapshot=e=>{if(!ns)throw new Error("please take full snapshot after start recording");ns(e)},is.mirror=rs;function as(e){const t=cs(e);if(!t||!(t instanceof Element))return t;return t.closest("button,a")||t}function cs(e){return function(e){return"object"===typeof e&&!!e&&"target"in e}(e)?e.target:e}let us;function ls(e){return us||(us=[],ae(yi,"open",(function(e){return function(...t){if(us)try{us.forEach((e=>e()))}catch(h){}return e.apply(yi,t)}}))),us.push(e),()=>{const t=us?us.indexOf(e):-1;t>-1&&us.splice(t,1)}}class ds{constructor(e,t,n=ss){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const e=()=>{this._lastScroll=ps()},t=ls((()=>{this._lastMutation=ps()})),n=e=>{if(!e.target)return;const t=as(e);t&&this._handleMultiClick(t)},r=new MutationObserver((()=>{this._lastMutation=ps()}));r.observe(yi.document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),yi.addEventListener("scroll",e,{passive:!0}),yi.addEventListener("click",n,{passive:!0}),this._teardown=()=>{yi.removeEventListener("scroll",e),yi.removeEventListener("click",n),t(),r.disconnect(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(function(e,t){if(!fs.includes(e.tagName))return!0;if("INPUT"===e.tagName&&!["submit","button"].includes(e.getAttribute("type")||""))return!0;if("A"===e.tagName&&(e.hasAttribute("download")||e.hasAttribute("target")&&"_self"!==e.getAttribute("target")))return!0;if(t&&e.matches(t))return!0;return!1}(t,this._ignoreSelector)||!function(e){return!(!e.data||"number"!==typeof e.data.nodeId||!e.timestamp)}(e))return;const n={timestamp:(r=e.timestamp,r>9999999999?r/1e3:r),clickBreadcrumb:e,clickCount:0,node:t};var r;this._clicks.some((e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1))||(this._clicks.push(n),1===this._clicks.length&&this._scheduleCheckClicks())}_handleMultiClick(e){this._getClicks(e).forEach((e=>{e.clickCount++}))}_getClicks(e){return this._clicks.filter((t=>t.node===e))}_checkClicks(){const e=[],t=ps();this._clicks.forEach((n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)}));for(const n of e){const e=this._clicks.indexOf(n);e>-1&&(this._generateBreadcrumbs(n),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!n&&!r,{clickCount:o,clickBreadcrumb:s}=e;if(i){const n=1e3*Math.min(e.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",i={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.slowClickDetected",data:{...s.data,url:yi.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:o||1}};this._addBreadcrumbEvent(t,i)}else if(o>1){const e={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.multiClick",data:{...s.data,url:yi.location.href,route:t.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout((()=>this._checkClicks()),1e3)}}const fs=["A","BUTTON","INPUT"];function ps(){return Date.now()/1e3}function hs(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var ms;!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(ms||(ms={}));const gs=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled"]);function ys(e){const t={};for(const n in e)if(gs.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),t[r]=e[n]}return t}const bs=e=>t=>{if(!e.isEnabled())return;const n=function(e){const{target:t,message:n}=function(e){const t="click"===e.name;let n,r=null;try{r=t?as(e.event):cs(e.event),n=X(r,{maxStringLength:200})||""}catch(h){n=""}return{target:r,message:n}}(e);return hs({category:`ui.${e.name}`,...vs(t,n)})}(t);if(!n)return;const r="click"===t.name,i=r&&t.event;!(r&&e.clickDetector&&i)||i.altKey||i.metaKey||i.ctrlKey||i.shiftKey||function(e,t,n){e.handleClick(t,n)}(e.clickDetector,n,as(t.event)),ss(e,n)};function vs(e,t){const n=e&&function(e){return"__sn"in e}(e)&&e.__sn.type===ms.Element?e.__sn:null;return{message:t,data:n?{nodeId:n.id,node:{id:n.id,tagName:n.tagName,textContent:e?Array.from(e.childNodes).map((e=>"__sn"in e&&e.__sn.type===ms.Text&&e.__sn.textContent)).filter(Boolean).map((e=>e.trim())).join(""):"",attributes:ys(n.attributes)}}:{}}}function ws(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=function(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:o,target:s}=e;if(!s||function(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable}(s)||!o)return null;const a=t||r||i,c=1===o.length;if(!a&&c)return null;const u=X(s,{maxStringLength:200})||"",l=vs(s,u);return hs({category:"ui.keyDown",message:u,data:{...l.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:o}})}(t);n&&ss(e,n)}const xs=["name","type","startTime","transferSize","duration"];function As(e){return function(t){return xs.every((n=>e[n]===t[n]))}}function Es(e){const t=new PerformanceObserver((t=>{const n=function(e,t){const[n,r,i]=e.reduce(((e,t)=>("navigation"===t.entryType?e[0].push(t):"largest-contentful-paint"===t.entryType?e[1].push(t):e[2].push(t),e)),[[],[],[]]),o=[],s=[];let a=r.length?r[r.length-1]:void 0;return t.forEach((e=>{if("largest-contentful-paint"!==e.entryType)if("navigation"!==e.entryType)o.push(e);else{const t=e;e.duration>0&&!n.find(As(t))&&!s.find(As(t))&&s.push(t)}else(!a||a.startTimee.startTime-t.startTime))}(e.performanceEvents,t.getEntries());e.performanceEvents=n}));return["element","event","first-input","largest-contentful-paint","layout-shift","longtask","navigation","paint","resource"].forEach((e=>{try{t.observe({type:e,buffered:!0})}catch(h){}})),t}function _s(e,t){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(ne.info(e),t&&Ts(e))}function ks(e,t){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(ne.info(e),t&&setTimeout((()=>{Ts(e)}),0))}function Ts(e){Ue().addBreadcrumb({category:"console",data:{logger:"replay"},level:"info",message:e},{level:"info"})}class Ss extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class Cs{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>Ai)throw new Ss;this.events.push(e)}finish(){return new Promise((e=>{const t=this.events;this.clear(),e(JSON.stringify(t))}))}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map((e=>e.timestamp)).sort()[0];return e?os(e):null}}class Is{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise(((e,t)=>{this._worker.addEventListener("message",(({data:n})=>{n.success?e():t()}),{once:!0}),this._worker.addEventListener("error",(e=>{t(e)}),{once:!0})}))),this._ensureReadyPromise}destroy(){_s("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(e,t){const n=this._getAndIncrementId();return new Promise(((r,i)=>{const o=({data:t})=>{const s=t;if(s.method===e&&s.id===n){if(this._worker.removeEventListener("message",o),!s.success)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay]",s.response),void i(new Error("Error in compression worker"));r(s.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:n,method:e,arg:t})}))}_getAndIncrementId(){return this._id++}}class Os{constructor(e){this._worker=new Is(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const t=os(e.timestamp);(!this._earliestTimestamp||tAi?Promise.reject(new Ss):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear")}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class Rs{constructor(e){this._fallback=new Cs,this._compression=new Os(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){return void _s("[Replay] Failed to load the compression worker, falling back to simple buffer")}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:t}=this._fallback,n=[];for(const i of e)n.push(this._compression.addEvent(i));this._compression.hasCheckout=t,this._used=this._compression;try{await Promise.all(n)}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("[Replay] Failed to add events when switching buffers.",r)}}}function Ds({useCompression:e}){if(e&&window.Worker)try{const e=function(){const e=new Blob(['/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */\nfunction t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);const r=new Array(60);t(r);const o=new Array(512);t(o);const l=new Array(256);t(l);const h=new Array(29);t(h);const d=new Array(30);function _(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let f,c,u;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const m=t=>t<256?o[t]:o[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},g=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{g(t,a[2*e],a[2*e+1])},k=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},v=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=k(i[e]++,e))}},y=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let s,r,o,_,f=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+f++],s+=(255&t.pending_buf[t.sym_buf+f++])<<8,r=t.pending_buf[t.sym_buf+f++],0===s?p(t,r,i):(o=l[r],p(t,o+256+1,i),_=e[o],0!==_&&(r-=h[o],g(t,r,_)),s--,o=m(s),p(t,o,n),_=a[o],0!==_&&(s-=d[o],g(t,s,_)))}while(f{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r>1;r>=1;r--)A(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>l&&(f=l,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=o&&(c=r[d-o]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=l-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(f=l;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),v(a,h,t.bl_count)},Z=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o{g(t,0+(i?1:0),3),x(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var T=(t,e,a,i)=>{let o,l,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),h=(t=>{let e;for(Z(t,t.dyn_ltree,t.l_desc.max_code),Z(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,l=t.static_len+3+7>>>3,l<=o&&(o=l)):o=l=a+5,a+4<=o&&-1!==e?D(t,e,a,i):4===t.strategy||l===o?(g(t,2+(i?1:0),3),E(t,s,r)):(g(t,4+(i?1:0),3),((t,e,a,i)=>{let s;for(g(t,e-257,5),g(t,a-1,5),g(t,i-4,4),s=0;s{S||((()=>{let t,n,w,m,b;const g=new Array(16);for(w=0,m=0;m<28;m++)for(h[m]=w,t=0;t<1<>=7;m<30;m++)for(d[m]=b<<7,t=0;t<1<(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(l[a]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{g(t,2,3),p(t,256,s),(t=>{16===t.bi_valid?(b(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var F=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const L=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var N=(t,e,a,i)=>{const n=L,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return-1^t},I={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},B={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:C,_tr_stored_block:H,_tr_flush_block:M,_tr_tally:j,_tr_align:K}=O,{Z_NO_FLUSH:P,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:G,Z_FINISH:X,Z_BLOCK:W,Z_OK:q,Z_STREAM_END:J,Z_STREAM_ERROR:Q,Z_DATA_ERROR:V,Z_BUF_ERROR:$,Z_DEFAULT_COMPRESSION:tt,Z_FILTERED:et,Z_HUFFMAN_ONLY:at,Z_RLE:it,Z_FIXED:nt,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:rt,Z_DEFLATED:ot}=B,lt=(t,e)=>(t.msg=I[e],e),ht=t=>2*t-(t>4?9:0),dt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},_t=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let ft=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},ut=(t,e)=>{M(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ct(t.strm)},wt=(t,e)=>{t.pending_buf[t.pending++]=e},mt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=F(t.adler,e,n,a):2===t.state.wrap&&(t.adler=N(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},gt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+258;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>l&&0!=--n);return r<=t.lookahead?r:t.lookahead},pt=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),i+=e),0===t.strm.avail_in)break;if(a=bt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ft(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ft(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,ct(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(bt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_watern&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===X)&&e!==P&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===X&&0===t.strm.avail_in&&a===i?1:0,H(t,t.block_start,a,r),t.block_start+=a,ct(t.strm)),r?3:1)},vt=(t,e)=>{let a,i;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a)),t.match_length>=3)if(i=j(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ft(t,t.ins_h,t.window[t.strstart+1]);else i=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2},yt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=j(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(ut(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=j(t,0,t.window[t.strstart-1]),i&&ut(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=j(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2};function xt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const zt=[new xt(0,0,0,0,kt),new xt(4,4,8,4,vt),new xt(4,5,16,8,vt),new xt(4,6,32,32,vt),new xt(4,4,16,16,yt),new xt(8,16,32,32,yt),new xt(8,16,128,128,yt),new xt(8,32,128,256,yt),new xt(32,128,258,1024,yt),new xt(32,258,258,4096,yt)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),dt(this.dyn_ltree),dt(this.dyn_dtree),dt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),dt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),dt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Et=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Rt=t=>{if(Et(t))return lt(t,Q);t.total_in=t.total_out=0,t.data_type=rt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,C(e),q},Zt=t=>{const e=Rt(t);var a;return e===q&&((a=t.state).window_size=2*a.w_size,dt(a.head),a.max_lazy_match=zt[a.level].max_lazy,a.good_match=zt[a.level].good_length,a.nice_match=zt[a.level].nice_length,a.max_chain_length=zt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ut=(t,e,a,i,n,s)=>{if(!t)return Q;let r=1;if(e===tt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ot||i<8||i>15||e<0||e>9||s<0||s>nt||8===i&&1!==r)return lt(t,Q);8===i&&(i=9);const o=new At;return t.state=o,o.strm=t,o.status=42,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<Ut(t,e,ot,15,8,st),deflateInit2:Ut,deflateReset:Zt,deflateResetKeep:Rt,deflateSetHeader:(t,e)=>Et(t)||2!==t.state.wrap?Q:(t.state.gzhead=e,q),deflate:(t,e)=>{if(Et(t)||e>W||e<0)return t?lt(t,Q):Q;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===a.status&&e!==X)return lt(t,0===t.avail_out?$:Q);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(ct(t),0===t.avail_out)return a.last_flush=-1,q}else if(0===t.avail_in&&ht(e)<=ht(i)&&e!==X)return lt(t,$);if(666===a.status&&0!==t.avail_in)return lt(t,$);if(42===a.status&&0===a.wrap&&(a.status=113),42===a.status){let e=ot+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=at||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,mt(a,e),0!==a.strstart&&(mt(a,t.adler>>>16),mt(a,65535&t.adler)),t.adler=1,a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(57===a.status)if(t.adler=0,wt(a,31),wt(a,139),wt(a,8),a.gzhead)wt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),wt(a,255&a.gzhead.time),wt(a,a.gzhead.time>>8&255),wt(a,a.gzhead.time>>16&255),wt(a,a.gzhead.time>>24&255),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(wt(a,255&a.gzhead.extra.length),wt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=N(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,3),a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,ct(t),0!==a.pending)return a.last_flush=-1,q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindexi&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindexi&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(ct(t),0!==a.pending))return a.last_flush=-1,q;wt(a,255&t.adler),wt(a,t.adler>>8&255),t.adler=0}if(a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(0!==t.avail_in||0!==a.lookahead||e!==P&&666!==a.status){let i=0===a.level?kt(a,e):a.strategy===at?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(pt(t),0===t.lookahead)){if(e===P)return 1;break}if(t.match_length=0,a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===it?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=258){if(pt(t),t.lookahead<=258&&e===P)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+258;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=j(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):zt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=666),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),q;if(2===i&&(e===Y?K(a):e!==W&&(H(a,0,0,!1),e===G&&(dt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ct(t),0===t.avail_out))return a.last_flush=-1,q}return e!==X?q:a.wrap<=0?J:(2===a.wrap?(wt(a,255&t.adler),wt(a,t.adler>>8&255),wt(a,t.adler>>16&255),wt(a,t.adler>>24&255),wt(a,255&t.total_in),wt(a,t.total_in>>8&255),wt(a,t.total_in>>16&255),wt(a,t.total_in>>24&255)):(mt(a,t.adler>>>16),mt(a,65535&t.adler)),ct(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?q:J)},deflateEnd:t=>{if(Et(t))return Q;const e=t.state.status;return t.state=null,113===e?lt(t,V):q},deflateSetDictionary:(t,e)=>{let a=e.length;if(Et(t))return Q;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return Q;if(1===n&&(t.adler=F(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(dt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,pt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=ft(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,pt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,q},deflateInfo:"pako deflate (from Nodeca project)"};const Dt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Tt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Dt(a,e)&&(t[e]=a[e])}}return t},Ot=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Lt[254]=Lt[254]=1;var Nt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},It=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ft)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Lt[t[a]]>e?a:e};var Ct=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ht=Object.prototype.toString,{Z_NO_FLUSH:Mt,Z_SYNC_FLUSH:jt,Z_FULL_FLUSH:Kt,Z_FINISH:Pt,Z_OK:Yt,Z_STREAM_END:Gt,Z_DEFAULT_COMPRESSION:Xt,Z_DEFAULT_STRATEGY:Wt,Z_DEFLATED:qt}=B;function Jt(t){this.options=Tt({level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=St.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Yt)throw new Error(I[a]);if(e.header&&St.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Nt(e.dictionary):"[object ArrayBuffer]"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=St.deflateSetDictionary(this.strm,t),a!==Yt)throw new Error(I[a]);this._dict_set=!0}}function Qt(t,e){const a=new Jt(e);if(a.push(t,!0),a.err)throw a.msg||I[a.err];return a.result}Jt.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Pt:Mt,"string"==typeof t?a.input=Nt(t):"[object ArrayBuffer]"===Ht.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===jt||s===Kt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=St.deflate(a,s),n===Gt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=St.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Yt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===Yt&&(this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Vt={Deflate:Jt,deflate:Qt,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Qt(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Qt(t,e)},constants:B};var $t=function(t,e){let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=u[(65535&g)+(f&(1<>>=p,c-=p),c<15&&(f+=z[a++]<>>24,f>>>=p,c-=p,p=g>>>16&255,!(16&p)){if(0==(64&p)){g=w[(65535&g)+(f&(1<o){t.msg="invalid distance too far back",E.mode=16209;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg="invalid distance too far back",E.mode=16209;break t}if(y=0,x=_,0===d){if(y+=l-p,p2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,a-=k,c-=k<<3,f&=(1<{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(m=0;m=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(m=0;m852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<>v)+d]=Z<<24|U<<16|S|0}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0==--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=b,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),o.bits=p,0};const{Z_FINISH:se,Z_BLOCK:re,Z_TREES:oe,Z_OK:le,Z_STREAM_END:he,Z_NEED_DICT:de,Z_STREAM_ERROR:_e,Z_DATA_ERROR:fe,Z_MEM_ERROR:ce,Z_BUF_ERROR:ue,Z_DEFLATED:we}=B,me=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ge(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const pe=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(pe(t))return _e;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},ve=t=>{if(pe(t))return _e;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},ye=(t,e)=>{let a;if(pe(t))return _e;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_e:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,ve(t))},xe=(t,e)=>{if(!t)return _e;const a=new ge;t.state=a,a.strm=t,a.window=null,a.mode=16180;const i=ye(t,e);return i!==le&&(t.state=null),i};let ze,Ae,Ee=!0;const Re=t=>{if(Ee){ze=new Int32Array(512),Ae=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ne(1,t.lens,0,288,ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ne(2,t.lens,0,32,Ae,0,t.work,{bits:5}),Ee=!1}t.lencode=ze,t.lenbits=9,t.distcode=Ae,t.distbits=5},Ze=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whavexe(t,15),inflateInit2:xe,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pe(t)||!t.output||!t.input&&0!==t.avail_in)return _e;a=t.state,16191===a.mode&&(a.mode=16192),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=le;t:for(;;)switch(a.mode){case 16180:if(0===a.wrap){a.mode=16192;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>>8&255,a.check=N(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=me;break}if((15&h)!==we){t.msg="unknown compression method",a.mode=me;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=me;break}a.dmax=1<>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=N(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>o&&(c=o),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=16191;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=16206;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(Re(a),a.mode=16199,e===oe){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=me}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=me;break}if(a.length=65535&h,h=0,d=0,a.mode=16194,e===oe)break t;case 16194:a.mode=16195;case 16195:if(c=a.length,c){if(c>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=16191;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=me;break}a.have=0,a.mode=16197;case 16197:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=ne(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=me;break}a.have=0,a.mode=16198;case 16198:for(;a.have>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=me;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d>>=m,d-=m,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d>>=m,d-=m,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=me;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===me)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=me;break}if(a.lenbits=9,E={bits:a.lenbits},x=ne(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=me;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=ne(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=me;break}if(a.mode=16199,e===oe)break t;case 16199:a.mode=16200;case 16200:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,$t(t,f),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,16191===a.mode&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=16191;break}if(64&b){t.msg="invalid literal/length code",a.mode=me;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=me;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=me;break}a.mode=16204;case 16204:if(0===l)break t;if(c=f-l,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=me;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=16200);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=16200;break;case 16206:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<{if(pe(t))return _e;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(pe(t))return _e;const a=t.state;return 0==(2&a.wrap)?_e:(a.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return pe(t)?_e:(i=t.state,0!==i.wrap&&16190!==i.mode?_e:16190===i.mode&&(n=1,n=F(n,e,a,0),n!==i.check)?fe:(s=Ze(t,e,a,a),s?(i.mode=16210,ce):(i.havedict=1,le)))},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const De=Object.prototype.toString,{Z_NO_FLUSH:Te,Z_FINISH:Oe,Z_OK:Fe,Z_STREAM_END:Le,Z_NEED_DICT:Ne,Z_STREAM_ERROR:Ie,Z_DATA_ERROR:Be,Z_MEM_ERROR:Ce}=B;function He(t){this.options=Tt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=Ue.inflateInit2(this.strm,e.windowBits);if(a!==Fe)throw new Error(I[a]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Nt(e.dictionary):"[object ArrayBuffer]"===De.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ue.inflateSetDictionary(this.strm,e.dictionary),a!==Fe)))throw new Error(I[a])}He.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Oe:Te,"[object ArrayBuffer]"===De.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Ue.inflate(a,r),s===Ne&&n&&(s=Ue.inflateSetDictionary(a,n),s===Fe?s=Ue.inflate(a,r):s===Be&&(s=Ne));a.avail_in>0&&s===Le&&a.state.wrap>0&&0!==t[a.next_in];)Ue.inflateReset(a),s=Ue.inflate(a,r);switch(s){case Ie:case Be:case Ne:case Ce:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===Le))if("string"===this.options.to){let t=Bt(a.output,a.next_out),e=a.next_out-t,n=It(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Fe||0!==o){if(s===Le)return s=Ue.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},He.prototype.onData=function(t){this.chunks.push(t)},He.prototype.onEnd=function(t){t===Fe&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:Me,deflate:je,deflateRaw:Ke,gzip:Pe}=Vt;var Ye=Me,Ge=je,Xe=B;const We=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const e=this._hasEvents?",":"";this.deflate.push(e+t,Xe.Z_SYNC_FLUSH),this._hasEvents=!0}finish(){if(this.deflate.push("]",Xe.Z_FINISH),this.deflate.err)throw this.deflate.err;const t=this.deflate.result;return this._init(),t}_init(){this._hasEvents=!1,this.deflate=new Ye,this.deflate.push("[",Xe.Z_NO_FLUSH)}},qe={clear:()=>{We.clear()},addEvent:t=>We.addEvent(t),finish:()=>We.finish(),compress:t=>function(t){return Ge(t)}(t)};addEventListener("message",(function(t){const e=t.data.method,a=t.data.id,i=t.data.arg;if(e in qe&&"function"==typeof qe[e])try{const t=qe[e](i);postMessage({id:a,method:e,success:!0,response:t})}catch(t){postMessage({id:a,method:e,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});']);return URL.createObjectURL(e)}();_s("[Replay] Using compression worker");const t=new Worker(e);return new Rs(t)}catch(t){_s("[Replay] Failed to create compression worker")}return _s("[Replay] Using simple buffer"),new Cs}function Ps(){try{return"sessionStorage"in yi&&!!yi.sessionStorage}catch(h){return!1}}function Bs(e){!function(){if(!Ps())return;try{yi.sessionStorage.removeItem(bi)}catch(h){}}(),e.session=void 0}function Ms(e){return void 0!==e&&Math.random()e.getContext().initialTimestamp+e.getOptions().maxReplayDuration)||(_s(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,e.getOptions()._experiments.traceInternals),!1))}function Ws(e){return!e.type}function qs(e){return"transaction"===e.type}function $s(e){const t=function(){const e=Ue().getClient();if(!e)return!1;const t=e.getTransport();if(!t)return!1;return t.send.__sentry__baseTransport__||!1}();return(n,r)=>{if(!e.isEnabled()||!Ws(n)&&!qs(n))return;const i=r&&r.statusCode;t&&(!i||i<200||i>=300)||(qs(n)?function(e,t){const n=e.getContext();t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}(e,n):function(e,t){const n=e.getContext();t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id);"buffer"===e.recordingMode&&t.tags&&t.tags.replayId&&setTimeout((()=>{e.sendBufferedReplayOrFlush()}))}(e,n))}}function Ks(e,t=!1){const n=t?$s(e):void 0;return Object.assign(((t,r)=>{if(!e.isEnabled())return t;if(function(e){return"replay_event"===e.type}(t))return delete t.breadcrumbs,t;if(!Ws(t)&&!qs(t))return t;if(!e.checkAndHandleExpiredSession())return t;if(function(e,t){return!(e.type||!e.exception||!e.exception.values||!e.exception.values.length)&&(!(!t.originalException||!t.originalException.__rrweb__)||e.exception.values.some((e=>!!(e.stacktrace&&e.stacktrace.frames&&e.stacktrace.frames.length)&&e.stacktrace.frames.some((e=>e.filename&&e.filename.includes("/rrweb/src/"))))))}(t,r)&&!e.getOptions()._experiments.captureExceptions)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.log("[Replay] Ignoring error from rrweb internals",t),null;const i=function(e,t){return"buffer"===e.recordingMode&&t.message!==vi&&!(!t.exception||t.type)&&Ms(e.getOptions().errorSampleRate)}(e,t);return(i||"session"===e.recordingMode)&&(t.tags={...t.tags,replayId:e.getSessionId()}),n&&n(t,{statusCode:200}),t}),{id:"Replay"})}function Ys(e,t){return t.map((({type:t,start:n,end:r,name:i,data:o})=>{const s=e.throttledAddEvent({type:Qi.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:t,description:i,startTimestamp:n,endTimestamp:r,data:o}}});return"string"===typeof s?Promise.resolve(null):s}))}function Xs(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}(t);null!==n&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate((()=>(Ys(e,[n]),!1))))}}function Js(e,t){return("undefined"!==typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__||!e.getOptions()._experiments.traceInternals)&&function(e){const t=Ue().getClient(),n=t&&t.getDsn();return!!n&&e.includes(n.host)}(t)}function Qs(e,t){e.isEnabled()&&null!==t&&(Js(e,t.name)||e.addUpdate((()=>(Ys(e,[t]),!0))))}const ea=10,ta=11,na=12,ra=13,ia=14,oa=15,sa=20,aa=21,ca=22,ua=23,la=["true","false","null"];function da(e,t){if(!t.length)return e;let n=e;const r=t.length-1;n=function(e,t){switch(t){case ea:return`${e}"~~":"~~"`;case 11:return`${e}:"~~"`;case 12:return`${e}~~":"~~"`;case ra:return function(e){const t=e.lastIndexOf(":"),n=e.slice(t+1);if(la.includes(n.trim()))return`${e},"~~":"~~"`;return`${e.slice(0,t+1)}"~~"`}(e);case 14:return`${e}~~"`;case oa:return`${e},"~~":"~~"`;case sa:return`${e}"~~"`;case aa:return function(e){const t=function(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(","===n||"["===n)return t}return-1}(e);if(t>-1){const n=e.slice(t+1);return la.includes(n.trim())?`${e},"~~"`:`${e.slice(0,t+1)}"~~"`}return e}(e);case 22:return`${e}~~"`;case ua:return`${e},"~~"`}return e}(n,t[r]);for(let i=r;i>=0;i--){switch(t[i]){case ea:n=`${n}}`;break;case sa:n=`${n}]`}}return n}function fa(e,t,n){const r=e[e.length-1],i=t[n];if(!/\s/.test(i))if('"'!==i||pa(t,n))switch(i){case"{":!function(e,t){if(!t)return void e.push(ea);if(t===ra)return void e.push(ea);t===aa&&e.push(ea);if(t===sa)e.push(ea)}(e,r);break;case"[":!function(e,t){if(!t)return e.push(sa),void e.push(aa);if(t===ra)return e.push(sa),void e.push(aa);t===aa&&(e.push(sa),e.push(aa));if(t===sa)e.push(sa),e.push(aa)}(e,r);break;case":":!function(e,t){t===ta&&(e.pop(),e.push(ra))}(e,r);break;case",":!function(e,t){if(t===ra)return void e.pop();if(t===oa)return e.pop(),void e.pop();if(t===aa)return;if(t===ua)e.pop()}(e,r);break;case"}":!function(e,t){t===ea&&e.pop();t===ra&&(e.pop(),e.pop());t===oa&&(e.pop(),e.pop(),e.pop());e[e.length-1]===ra&&e.push(oa);e[e.length-1]===aa&&e.push(ua)}(e,r);break;case"]":!function(e,t){t===sa&&e.pop();t===aa&&(e.pop(),e.pop());t===ua&&(e.pop(),e.pop(),e.pop());e[e.length-1]===ra&&e.push(oa);e[e.length-1]===aa&&e.push(ua)}(e,r)}else!function(e,t){if(t===ia)return e.pop(),void e.push(oa);if(t===ca)return e.pop(),void e.push(ua);if(t===ra)return void e.push(ia);if(t===aa)return void e.push(ca);if(t===ea)return void e.push(na);if(t===na)e.pop(),e.push(11)}(e,r)}function pa(e,t){return"\\"===e[t-1]&&!pa(e,t-1)}function ha(e){return da(e,function(e){const t=[];for(let n=0;nwi;if(function(e){const t=e[0],n=e[e.length-1];return"["===t&&"]"===n||"{"===t&&"}"===n}(e))try{const n=t?ha(e.slice(0,wi)):e;return{body:JSON.parse(n),warnings:t?["JSON_TRUNCATED"]:[]}}catch(n){return{body:t?`${e.slice(0,wi)}\u2026`:e,warnings:t?["INVALID_JSON","TEXT_TRUNCATED"]:["INVALID_JSON"]}}return{body:t?`${e.slice(0,wi)}\u2026`:e,warnings:t?["TEXT_TRUNCATED"]:[]}}(n);return r.body=i,o.length>0&&(r._meta={warnings:o}),r}function xa(e,t){return Object.keys(e).reduce(((n,r)=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=e[r]),n}),{})}function Aa(e){return new URLSearchParams(e).toString()}function Ea(e,t){const n=function(e,t=yi.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(yi.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;if(!e.endsWith("/")&&r.endsWith("/"))return r.slice(0,-1);return r}(e);return se(n,t)}async function _a(e,t,n){try{const r=await async function(e,t,n){const{startTimestamp:r,endTimestamp:i}=t,{url:o,method:s,status_code:a=0,request_body_size:c,response_body_size:u}=e.data,l=Ea(o,n.networkDetailAllowUrls)&&!Ea(o,n.networkDetailDenyUrls),d=l?function({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const i=function(e,t){if(1===e.length&&"string"!==typeof e[0])return Sa(e[0],t);if(2===e.length)return Sa(e[1],t);return{}}(n,t);if(!e)return wa(i,r,void 0);const o=ya(ka(n));return wa(i,r,o)}(n,t.input,c):va(c),f=await async function(e,{networkCaptureBodies:t,textEncoder:n,networkResponseHeaders:r},i,o){if(!e&&void 0!==o)return va(o);const s=Ta(i.headers,r);if(!t&&void 0!==o)return wa(s,o,void 0);try{const r=i.clone(),a=await async function(e){try{return await e.text()}catch(t){return}}(r),c=a&&a.length&&void 0===o?ma(a,n):o;return e?wa(s,c,t?a:void 0):va(c)}catch(h){return wa(s,o,void 0)}}(l,n,t.response,u);return{startTimestamp:r,endTimestamp:i,url:o,method:s,statusCode:a,request:d,response:f}}(e,t,n),i=ba("resource.fetch",r);Qs(n.replay,i)}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay] Failed to capture fetch breadcrumb",r)}}function ka(e=[]){if(2===e.length&&"object"===typeof e[1])return e[1].body}function Ta(e,t){const n={};return t.forEach((t=>{e.get(t)&&(n[t]=e.get(t))})),n}function Sa(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?Ta(n,t):Array.isArray(n)?{}:xa(n,t):{}}async function Ca(e,t,n){try{const r=function(e,t,n){const{startTimestamp:r,endTimestamp:i,input:o,xhr:s}=t,{url:a,method:c,status_code:u=0,request_body_size:l,response_body_size:d}=e.data;if(!a)return null;if(!Ea(a,n.networkDetailAllowUrls)||Ea(a,n.networkDetailDenyUrls)){return{startTimestamp:r,endTimestamp:i,url:a,method:c,statusCode:u,request:va(l),response:va(d)}}const f=s.__sentry_xhr_v2__,p=f?xa(f.request_headers,n.networkRequestHeaders):{},h=xa(function(e){const t=e.getAllResponseHeaders();if(!t)return{};return t.split("\r\n").reduce(((e,t)=>{const[n,r]=t.split(": ");return e[n.toLowerCase()]=r,e}),{})}(s),n.networkResponseHeaders),m=wa(p,l,n.networkCaptureBodies?ya(o):void 0),g=wa(h,d,n.networkCaptureBodies?t.xhr.responseText:void 0);return{startTimestamp:r,endTimestamp:i,url:a,method:c,statusCode:u,request:m,response:g}}(e,t,n),i=ba("resource.xhr",r);Qs(n.replay,i)}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay] Failed to capture fetch breadcrumb",r)}}function Ia(e){const t=Ue().getClient();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:a}=e.getOptions(),c={replay:e,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:a};t&&t.on?t.on("beforeAddBreadcrumb",((e,t)=>function(e,t,n){if(!t.data)return;try{(function(e){return"xhr"===e.category})(t)&&function(e){return e&&e.xhr}(n)&&(!function(e,t,n){const{xhr:r,input:i}=t,o=ma(i,n.textEncoder),s=r.getResponseHeader("content-length")?ga(r.getResponseHeader("content-length")):ma(r.response,n.textEncoder);void 0!==o&&(e.data.request_body_size=o),void 0!==s&&(e.data.response_body_size=s)}(t,n,e),Ca(t,n,e)),function(e){return"fetch"===e.category}(t)&&function(e){return e&&e.response}(n)&&(!function(e,t,n){const{input:r,response:i}=t,o=ma(ka(r),n.textEncoder),s=i?ga(i.headers.get("content-length")):void 0;void 0!==o&&(e.data.request_body_size=o),void 0!==s&&(e.data.response_body_size=s)}(t,n,e),_a(t,n,e))}catch(h){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("Error when enriching network breadcrumb")}}(c,e,t))):(pt("fetch",function(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{startTimestamp:t,endTimestamp:n,fetchData:r,response:i}=e;if(!n)return null;const{method:o,url:s}=r;return{type:"resource.fetch",start:t/1e3,end:n/1e3,name:s,data:{method:o,statusCode:i?i.status:void 0}}}(t);Qs(e,n)}}(e)),pt("xhr",function(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{startTimestamp:t,endTimestamp:n,xhr:r}=e,i=r.__sentry_xhr_v2__;if(!t||!n||!i)return null;const{method:o,url:s,status_code:a}=i;return void 0===s?null:{type:"resource.xhr",name:s,start:t/1e3,end:n/1e3,data:{method:o,statusCode:a}}}(t);Qs(e,n)}}(e)))}catch(n){}}let Oa=null;const Ra=e=>t=>{if(!e.isEnabled())return;const n=function(e){const t=e.getLastBreadcrumb&&e.getLastBreadcrumb();if(Oa===t||!t)return null;if(Oa=t,!function(e){return!!e.category}(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui."))return null;if("console"===t.category)return function(e){const t=e.data&&e.data.arguments;if(!Array.isArray(t)||0===t.length)return hs(e);let n=!1;const r=t.map((e=>{if(!e)return e;if("string"===typeof e)return e.length>xi?(n=!0,`${e.slice(0,xi)}\u2026`):e;if("object"===typeof e)try{const t=St(e,7),r=JSON.stringify(t);if(r.length>xi){const e=ha(r.slice(0,xi)),t=JSON.parse(e);return n=!0,t}return t}catch(h){}return e}));return hs({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(t);return hs(t)}(t);n&&ss(e,n)};function Da(e){return!(!e||!e.on)}function Pa(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}const Ba={resource:function(e){const{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:o,decodedBodySize:s,encodedBodySize:a,responseStatus:c,transferSize:u}=e;if(["fetch","xmlhttprequest"].includes(n))return null;return{type:`${t}.${n}`,start:Na(o),end:Na(i),name:r,data:{size:u,statusCode:c,decodedBodySize:s,encodedBodySize:a}}},paint:function(e){const{duration:t,entryType:n,name:r,startTime:i}=e,o=Na(i);return{type:n,name:r,start:o,end:o+t,data:void 0}},navigation:function(e){const{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:o,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:l,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:h,type:m}=e;if(0===i)return null;return{type:`${t}.${m}`,start:Na(p),end:Na(o),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:s,duration:i,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:l,loadEventEnd:d,domComplete:o,redirectCount:f}}},"largest-contentful-paint":function(e){const{entryType:t,startTime:n,size:r}=e;let i=0;if(yi.performance){const e=yi.performance.getEntriesByType("navigation")[0];i=e&&e.activationStart||0}const o=Math.max(n-i,0),s=Na(i)+o/1e3;return{type:t,name:t,start:s,end:s,data:{value:o,size:r,nodeId:is.mirror.getId(e.element)}}}};function Ma(e){return void 0===Ba[e.entryType]?null:Ba[e.entryType](e)}function Na(e){return((Oe.Z1||yi.performance.timeOrigin)+e)/1e3}function Fa(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession())return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.warn("[Replay] Received replay event after session expired."));const i=r||!t;t=!0,e.addUpdate((()=>{if("buffer"===e.recordingMode&&i&&e.setInitialState(),!zs(e,n,i))return!0;if(!i)return!1;if(function(e,t){if(!t||!e.session||0!==e.session.segmentId)return;zs(e,function(e){const t=e.getOptions();return{type:Qi.Custom,timestamp:Date.now(),data:{tag:"options",payload:{sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:!!e.eventBuffer&&"worker"===e.eventBuffer.type,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}(e),!1)}(e,i),e.session&&e.session.previousSessionId)return!0;if("buffer"===e.recordingMode&&e.session&&e.eventBuffer){const t=e.eventBuffer.getEarliestTimestamp();t&&(_s(`[Replay] Updating session start time to earliest event in buffer to ${new Date(t)}`,e.getOptions()._experiments.traceInternals),e.session.started=t,e.getOptions().stickySession&&Ns(e.session))}return"session"===e.recordingMode&&e.flush(),!0}))}}async function La({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:i,session:o}){const s=function({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}\n`;if("string"===typeof e)n=`${r}${e}`;else{const t=(new TextEncoder).encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:l}=r,d=Ue(),f=d.getClient(),p=d.getScope(),m=f&&f.getTransport(),g=f&&f.getDsn();if(!f||!m||!g||!o.sampled)return;const y={type:"replay_event",replay_start_timestamp:l/1e3,timestamp:i/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:t,segment_id:n,replay_type:o.sampled},b=await async function({client:e,scope:t,replayId:n,event:r}){const i={event_id:n,integrations:"object"!==typeof e._integrations||null===e._integrations||Array.isArray(e._integrations)?void 0:Object.keys(e._integrations)};e.emit&&e.emit("preprocessEvent",r,i);const o=await Vt(e.getOptions(),r,i,t,e);if(!o)return null;o.platform=o.platform||"javascript";const s=e.getSdkMetadata&&e.getSdkMetadata(),{name:a,version:c}=s&&s.sdk||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:c||"0.0.0"},o}({scope:p,client:f,replayId:t,event:y});if(!b)return f.recordDroppedEvent("event_processor","replay",y),void _s("An event processor returned `null`, will not send event.");delete b.sdkProcessingMetadata;const v=function(e,t,n,r){return Ot(jt(e,Lt(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:"string"===typeof t?(new TextEncoder).encode(t).length:t.length},t]])}(b,s,g,f.getOptions().tunnel);let w;try{w=await m.send(v)}catch(x){const e=new Error(vi);try{e.cause=x}catch(h){}throw e}if(!w)return w;if("number"===typeof w.statusCode&&(w.statusCode<200||w.statusCode>=300))throw new ja(w.statusCode);return w}class ja extends Error{constructor(e){super(`Transport returned status code ${e}`)}}async function Ua(e,t={count:0,interval:5e3}){const{recordingData:n,options:r}=e;if(n.length)try{return await La(e),!0}catch(i){if(i instanceof ja)throw i;if(function(e,t){Ue().setContext(e,t)}("Replays",{_retryCount:t.count}),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r._experiments&&r._experiments.captureExceptions&&sn(i),t.count>=3){const e=new Error("Unable to send Replay - max retries exceeded");try{e.cause=i}catch(h){}throw e}return t.interval*=++t.count,new Promise(((n,r)=>{setTimeout((async()=>{try{await Ua(e,t),n(!0)}catch(i){r(i)}}),t.interval)}))}}const Za="__THROTTLED";function Ha(e,t,n){const r=new Map;let i=!1;return(...o)=>{const s=Math.floor(Date.now()/1e3);if((e=>{const t=e-n;r.forEach(((e,n)=>{ne+t),0)>=t){const e=i;return i=!0,e?"__SKIPPED":Za}i=!1;const a=r.get(s)||0;return r.set(s,a+1),e(...o)}}class za{constructor({options:e,recordingOptions:t}){za.prototype.__init.call(this),za.prototype.__init2.call(this),za.prototype.__init3.call(this),za.prototype.__init4.call(this),za.prototype.__init5.call(this),za.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEvents=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=t,this._options=e,this._debouncedFlush=function(e,t,n){let r,i,o;const s=n&&n.maxWait?Math.max(n.maxWait,t):0;function a(){return c(),r=e(),r}function c(){void 0!==i&&clearTimeout(i),void 0!==o&&clearTimeout(o),i=o=void 0}function u(){return i&&clearTimeout(i),i=setTimeout(a,t),s&&void 0===o&&(o=setTimeout(a,s)),r}return u.cancel=c,u.flush=function(){return void 0!==i||void 0!==o?a():r},u}((()=>this._flush()),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Ha(((e,t)=>function(e,t,n){return Vs(e,t)?Gs(e,t,n):Promise.resolve(null)}(this,e,t)),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;i&&(this.clickDetector=new ds(this,i))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}getOptions(){return this._options}initializeSampling(e){const{errorSampleRate:t,sessionSampleRate:n}=this._options;t<=0&&n<=0||(this._initializeSessionForSampling(e),this.session?!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",ks(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording()):this._handleException(new Error("Unable to initialize and create session")))}start(){if(this._isEnabled&&"session"===this.recordingMode)throw new Error("Replay recording is already in progress");if(this._isEnabled&&"buffer"===this.recordingMode)throw new Error("Replay buffering is in progress, call `flush()` to save the replay");ks("[Replay] Starting replay in session mode",this._options._experiments.traceInternals);const e=Hs({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");ks("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const e=Hs({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{this._stopRecording=is({...this._recordingOptions,..."buffer"===this.recordingMode&&{checkoutEveryNms:6e4},emit:Fa(this),onMutation:this._onMutationHandler})}catch(e){this._handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this._handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(this._isEnabled){this._isEnabled=!1;try{_s("[Replay] Stopping Replay"+(t?` triggered by ${t}`:""),this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,Bs(this)}catch(n){this._handleException(n)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),_s("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),_s("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();const t=Date.now();_s("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const n=this.stopRecording();e&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const t=e();"buffer"!==this.recordingMode&&!0!==t&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),this._stopRecording)this.checkAndHandleExpiredSession(),this._updateSessionActivity();else{if(!this._checkSession())return;this.resume()}}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(!(this._lastActivity&&js(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled))return!!this._checkSession();this.pause()}setInitialState(){const e=`${yi.location.pathname}${yi.location.hash}${yi.location.search}`,t=`${yi.location.origin}${e}`;this.performanceEvents=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){const n=this._throttledAddEvent(e,t);if(n===Za){const e=hs({category:"replay.throttled"});this.addUpdate((()=>!zs(this,{type:5,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e,metric:!0}})))}return n}getCurrentRoute(){const e=this.lastTransaction||Ue().getScope().getTransaction();if(e&&["route","custom"].includes(e.metadata.source))return e.name}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Ds({useCompression:this._options.useCompression}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(e){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay]",e),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this._options._experiments&&this._options._experiments.captureExceptions&&sn(e)}_initializeSessionForSampling(e){const t=this._options.errorSampleRate>0,n=Hs({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;const e=this.session;return!Zs(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{yi.document.addEventListener("visibilitychange",this._handleVisibilityChange),yi.addEventListener("blur",this._handleWindowBlur),yi.addEventListener("focus",this._handleWindowFocus),yi.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(!function(e){const t=Ue().getScope(),n=Ue().getClient();t.addScopeListener(Ra(e)),pt("dom",bs(e)),pt("history",Xs(e)),Ia(e);const r=Ks(e,!Da(n));n&&n.addEventProcessor?n.addEventProcessor(r):Ce(r),Da(n)&&(n.on("afterSendEvent",$s(e)),n.on("createDsc",(t=>{const n=e.getSessionId();n&&e.isEnabled()&&"session"===e.recordingMode&&(t.replay_id=n)})),n.on("startTransaction",(t=>{e.lastTransaction=t})),n.on("finishTransaction",(t=>{e.lastTransaction=t})))}(this),this._hasInitializedCoreListeners=!0)}catch(e){this._handleException(e)}"PerformanceObserver"in yi&&(this._performanceObserver=Es(this))}_removeListeners(){try{yi.document.removeEventListener("visibilitychange",this._handleVisibilityChange),yi.removeEventListener("blur",this._handleWindowBlur),yi.removeEventListener("focus",this._handleWindowFocus),yi.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceObserver&&(this._performanceObserver.disconnect(),this._performanceObserver=void 0)}catch(e){this._handleException(e)}}__init(){this._handleVisibilityChange=()=>{"visible"===yi.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=hs({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=hs({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{ws(this,e)}}_doChangeToBackgroundTasks(e){if(!this.session)return;Us(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;this.checkAndHandleExpiredSession()?e&&this._createCustomBreadcrumb(e):_s("[Replay] Document has become active, but session has expired")}_triggerFullSnapshot(e=!0){try{_s("[Replay] Taking full rrweb snapshot"),is.takeFullSnapshot(e)}catch(t){this._handleException(t)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate((()=>{this.throttledAddEvent({type:Qi.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})}))}_addPerformanceEntries(){const e=[...this.performanceEvents];return this.performanceEvents=[],Promise.all(Ys(this,function(e){return e.map(Ma).filter(Boolean)}(e)))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:t}=this;if(!e||!t)return;if(e.segmentId)return;const n=t.getEarliestTimestamp();n&&nthis._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await Ua({replayId:e,recordingData:i,segmentId:r,eventContext:n,session:this.session,options:this.getOptions(),timestamp:t})}catch(t){this._handleException(t),this.stop({reason:"sendReplay"});const e=Ue().getClient();e&&e.recordDroppedEvent("send_error","replay")}}else("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay] No session or eventBuffer found to flush.")}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession())return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay] Attempting to finish replay event after session expired."));if(!this.session)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error("[Replay] No session found to flush."));const t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();const r=nthis._options.maxReplayDuration+5e3;if(r||i)return _s(`[Replay] Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),void(r&&this._debouncedFlush());const o=this.eventBuffer;if(o&&0===this.session.segmentId&&!o.hasCheckout&&_s("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock)return this._flushLock=this._runFlush(),await this._flushLock,void(this._flushLock=void 0);try{await this._flushLock}catch(s){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ne.error(s)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&Ns(this.session)}__init6(){this._onMutationHandler=e=>{const t=e.length,n=this._options.mutationLimit,r=n&&t>n;if(t>this._options.mutationBreadcrumbLimit||r){const e=hs({category:"replay.mutations",data:{count:t,limit:r}});this._createCustomBreadcrumb(e)}return!r||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}}function Ga(e,t,n,r){const i=[...e,..."string"===typeof r?r.split(","):[],...t];return"undefined"!==typeof n&&("string"===typeof n&&i.push(`.${n}`),console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")),i.join(",")}function Va({mask:e,unmask:t,block:n,unblock:r,ignore:i,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,ignoreClass:u}){const l=Ga(e,[".sentry-mask","[data-sentry-mask]"],a,c),d=Ga(t,[".sentry-unmask","[data-sentry-unmask]"]),f={maskTextSelector:l,unmaskTextSelector:d,maskInputSelector:l,unmaskInputSelector:d,blockSelector:Ga(n,[".sentry-block","[data-sentry-block]",'base[href="/"]'],o,s),unblockSelector:Ga(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:Ga(i,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],u)};return o instanceof RegExp&&(f.blockClass=o),a instanceof RegExp&&(f.maskTextClass=a),f}function Wa(){return"undefined"!==typeof window&&(!(0,mi.KV)()||"undefined"!==typeof gi&&"renderer"===gi.type)}const qa='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',$a=["content-length","content-type","accept"];let Ka=!1;class Ya{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=5e3,flushMaxDelay:t=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:i=!0,useCompression:o=!0,_experiments:s={},sessionSampleRate:a,errorSampleRate:c,maskAllText:u=!0,maskAllInputs:l=!0,blockAllMedia:d=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:g=[],networkDetailDenyUrls:y=[],networkCaptureBodies:b=!0,networkRequestHeaders:v=[],networkResponseHeaders:w=[],mask:x=[],unmask:A=[],block:E=[],unblock:_=[],ignore:k=[],maskFn:T,beforeAddRecordingEvent:S,blockClass:C,blockSelector:I,maskInputOptions:O,maskTextClass:R,maskTextSelector:D,ignoreClass:P}={}){if(this.name=Ya.id,this._recordingOptions={maskAllInputs:l,maskAllText:u,maskInputOptions:{...O||{},password:!0},maskTextFn:T,maskInputFn:T,...Va({mask:x,unmask:A,block:E,unblock:_,ignore:k,blockClass:C,blockSelector:I,maskTextClass:R,maskTextSelector:D,ignoreClass:P}),slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,15e3),maxReplayDuration:Math.min(r,Ei),stickySession:i,sessionSampleRate:a,errorSampleRate:c,useCompression:o,blockAllMedia:d,maskAllInputs:l,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:g,networkDetailDenyUrls:y,networkCaptureBodies:b,networkRequestHeaders:Xa(v),networkResponseHeaders:Xa(w),beforeAddRecordingEvent:S,_experiments:s},"number"===typeof a&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${a} })`),this._initialOptions.sessionSampleRate=a),"number"===typeof c&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${c} })`),this._initialOptions.errorSampleRate=c),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${qa}`:qa),this._isInitialized&&Wa())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Ka}set _isInitialized(e){Ka=e}setupOnce(){Wa()&&(this._setup(),setTimeout((()=>this._initialize())))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:"session"===this._replay.recordingMode}):Promise.resolve()}flush(e){return this._replay&&this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):Promise.resolve()}getReplayId(){if(this._replay&&this._replay.isEnabled())return this._replay.getSessionId()}_initialize(){this._replay&&this._replay.initializeSampling()}_setup(){const e=function(e){const t=Ue().getClient(),n=t&&t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...he(e)};if(!n)return console.warn("SDK client is not available."),r;null==e.sessionSampleRate&&null==e.errorSampleRate&&null==n.replaysSessionSampleRate&&null==n.replaysOnErrorSampleRate&&console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.");"number"===typeof n.replaysSessionSampleRate&&(r.sessionSampleRate=n.replaysSessionSampleRate);"number"===typeof n.replaysOnErrorSampleRate&&(r.errorSampleRate=n.replaysOnErrorSampleRate);return r}(this._initialOptions);this._replay=new za({options:e,recordingOptions:this._recordingOptions})}}function Xa(e){return[...$a,...e.map((e=>e.toLowerCase()))]}Ya.__initStatic();var Ja=n(241),Qa=n(9008),ec=n(67294),tc=n(40481),nc=n(83454),rc=n(56881),ic=n(77537),oc=n(63206),sc=n(49501),ac=n(13902);var cc=ec.forwardRef((function(e,t){return ec.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),ec.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"}))})),uc=n(30120),lc=n(81645),dc=n(29630),fc=n(75084),pc=n(31959),hc=n(85893),mc=function(e){var t=e.address,n=e.onDisconnectWallet;return(0,hc.jsx)(pc.P,{open:!0,withCloseButton:!1,setOpen:function(e){},children:(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,hc.jsx)(lc.Z,{sx:{fontSize:"24px",color:"warning.main",mb:2},children:(0,hc.jsx)(ac.Z,{})}),(0,hc.jsx)(dc.Z,{variant:"h2",children:(0,hc.jsx)(sc.cC,{id:"Blocked Address"})}),(0,hc.jsx)(dc.Z,{variant:"helperText",sx:{my:4},children:t}),(0,hc.jsxs)(fc.Z,{variant:"contained",onClick:n,children:[(0,hc.jsx)(lc.Z,{fontSize:"small",sx:{mx:1},children:(0,hc.jsx)(cc,{})}),(0,hc.jsx)(sc.cC,{id:"Disconnect Wallet"})]})]})})},gc=function(e){var t=e.children,n=(0,ic.Z)(),r=n.currentAccount,i=n.disconnectWallet,s=n.readOnlyMode,a=n.loading,c=function(e){var t=(0,ec.useState)(!0),n=t[0],r=t[1],i="".concat(nc.env.NEXT_PUBLIC_API_BASEURL,"/addresses/status"),s="?address=".concat(e),a=function(){var t=(0,o.Z)(d().mark((function t(){var n,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!i||!e){t.next=16;break}return t.prev=1,t.next=4,fetch(i+s);case 4:if(!(n=t.sent).ok){t.next=10;break}return t.next=8,n.json();case 8:o=t.sent,r(o.addressAllowed);case 10:t.next=14;break;case 12:t.prev=12,t.t0=t.catch(1);case 14:t.next=17;break;case 16:r(!0);case 17:case"end":return t.stop()}}),t,null,[[1,12]])})));return function(){return t.apply(this,arguments)}}();return(0,tc.W)(a,12e4,!1,[e]),{isAllowed:n}}(s||a||oc.p8?"":r);return c.isAllowed?(0,hc.jsx)(hc.Fragment,{children:t}):(0,hc.jsxs)(rc.Z,{children:[(0,hc.jsx)(mc,{address:r,onDisconnectWallet:i}),";"]})};function yc(e){var t=e.title,n=e.description,r=e.imageUrl,i=e.timestamp;return(0,hc.jsxs)(Qa.default,{children:[(0,hc.jsxs)("title",{children:["ZeroLend - ",t]}),(0,hc.jsx)("meta",{name:"description",content:n},"description"),(0,hc.jsx)("meta",{property:"og:title",content:"ZeroLend - ".concat(t)},"title"),(0,hc.jsx)("meta",{property:"og:description",content:n},"ogdescription"),r&&(0,hc.jsx)("meta",{property:"og:image",content:r},"ogimage"),r&&(0,hc.jsx)("meta",{name:"twitter:image",content:r},"twitterimage"),(0,hc.jsx)("meta",{name:"twitter:site",content:"@zerolendxyz"},"twittersite"),(0,hc.jsx)("meta",{property:"twitter:card",content:r?"summary_large_image":"summary"},"twittercard"),(0,hc.jsx)("meta",{name:"twitter:title",content:t},"twittertitle"),(0,hc.jsx)("meta",{name:"twitter:description",content:n},"twitterdescription"),i&&(0,hc.jsx)("meta",{name:"revised",content:i},"timestamp"),(0,hc.jsx)("meta",{name:"keywords",content:"Decentralized Finance, DeFi, lending, borrowing, stablecoins, Ethereum, assets, erc-20, smart contracts, open finance, trustless"},"keywords"),(0,hc.jsx)("meta",{name:"apple-mobile-web-app-title",content:"ZeroLend"}),(0,hc.jsx)("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),(0,hc.jsx)("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black"})]})}var bc=n(69311),vc=function(e){var t={};return Object.keys(e.transactions).forEach((function(n){var r=+n,i=Object.keys(e.transactions[r]).filter((function(t){return"success"===e.transactions[r][t].txState}));t[r]=i.reduce((function(t,n){return t[n]=e.transactions[r][n],t}),{})})),t},wc=n(57609);function xc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ac(e){for(var t=1;tthis.data(e,!0))),type:Wc.allowNull(a),accessList:Wc.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:t,topics:Wc.arrayOf(o),data:i,logIndex:a,blockHash:o},e.receipt={to:Wc.allowNull(this.address,null),from:Wc.allowNull(this.address,null),contractAddress:Wc.allowNull(t,null),transactionIndex:a,root:Wc.allowNull(s),gasUsed:n,logsBloom:Wc.allowNull(i),blockHash:o,transactionHash:o,logs:Wc.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:Wc.allowNull(a,null),cumulativeGasUsed:n,effectiveGasPrice:Wc.allowNull(n),status:Wc.allowNull(a),type:c},e.block={hash:Wc.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:Wc.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Wc.allowNull(t),extraData:i,transactions:Wc.allowNull(Wc.arrayOf(o)),baseFeePerGas:Wc.allowNull(n)},e.blockWithTransactions=(0,jc.shallowCopy)(e.block),e.blockWithTransactions.transactions=Wc.allowNull(Wc.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Wc.allowNull(r,void 0),toBlock:Wc.allowNull(r,void 0),blockHash:Wc.allowNull(o,void 0),address:Wc.allowNull(t,void 0),topics:Wc.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Wc.allowNull(a),blockHash:Wc.allowNull(o),transactionIndex:a,removed:Wc.allowNull(this.boolean.bind(this)),address:t,data:Wc.allowFalsish(i,"0x"),topics:Wc.arrayOf(o),transactionHash:o,logIndex:a},e}accessList(e){return(0,zc.accessListify)(e||[])}number(e){return"0x"===e?0:Cc.O$.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Cc.O$.from(e).toNumber()}bigNumber(e){return Cc.O$.from(e)}boolean(e){if("boolean"===typeof e)return e;if("string"===typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"===typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,Zc.isHexString)(e))?e.toLowerCase():Vc.throwArgumentError("invalid hash","value",e)}data(e,t){const n=this.hex(e,t);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return(0,Uc.getAddress)(e)}callAddress(e){if(!(0,Zc.isHexString)(e,32))return null;const t=(0,Uc.getAddress)((0,Zc.hexDataSlice)(e,12));return t===Hc?null:t}contractAddress(e){return(0,Uc.getContractAddress)(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"===typeof e||(0,Zc.isHexString)(e))return(0,Zc.hexValue)(e);throw new Error("invalid blockTag")}hash(e,t){const n=this.hex(e,t);return 32!==(0,Zc.hexDataLength)(n)?Vc.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(null==e)return null;const t=Cc.O$.from(e);try{return t.toNumber()}catch(n){}return null}uint256(e){if(!(0,Zc.isHexString)(e))throw new Error("invalid uint256");return(0,Zc.hexZeroPad)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const n=null!=e._difficulty?e._difficulty:e.difficulty,r=Wc.check(t,e);return r._difficulty=null==n?null:Cc.O$.from(n),r}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Wc.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Cc.O$.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Wc.check(this.formats.transaction,e);if(null!=e.chainId){let n=e.chainId;(0,Zc.isHexString)(n)&&(n=Cc.O$.from(n).toNumber()),t.chainId=n}else{let n=e.networkId;null==n&&null==t.v&&(n=e.chainId),(0,Zc.isHexString)(n)&&(n=Cc.O$.from(n).toNumber()),"number"!==typeof n&&null!=t.v&&(n=(t.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!==typeof n&&(n=0),t.chainId=n}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return(0,zc.parse)(e)}receiptLog(e){return Wc.check(this.formats.receiptLog,e)}receipt(e){const t=Wc.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Cc.O$.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Vc.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Vc.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Vc.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Wc.check(this.formats.filter,e)}filterLog(e){return Wc.check(this.formats.filterLog,e)}static check(e,t){const n={};for(const i in e)try{const r=e[i](t[i]);void 0!==r&&(n[i]=r)}catch(r){throw r.checkKey=i,r.checkValue=t[i],r}return n}static allowNull(e,t){return function(n){return null==n?t:e(n)}}static allowFalsish(e,t){return function(n){return n?e(n):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const n=[];return t.forEach((function(t){n.push(e(t))})),n}}}function qc(e){return function(e){return e&&"function"===typeof e.isCommunityResource}(e)&&e.isCommunityResource()}let $c=!1;function Kc(){$c||($c=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var Yc=n(99525),Xc=n(27771),Jc=n(84804),Qc=n(51880);var eu=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const tu=new Oc.Logger("abstract-provider/5.7.0");class nu extends jc.Description{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class ru{constructor(){tu.checkAbstract(new.target,ru),(0,jc.defineReadOnly)(this,"_isProvider",!0)}getFeeData(){return eu(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield(0,jc.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let n=null,r=null,i=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,i=Cc.O$.from("1500000000"),r=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:n,maxFeePerGas:r,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var iu=n(59567),ou=n(14694),su=n(7529),au=n(95964),cu=n(19763),uu=n(92882),lu=n.n(uu),du=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const fu=new Oc.Logger(Gc);function pu(e){return null==e?"null":(32!==(0,Zc.hexDataLength)(e)&&fu.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function hu(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[pu(e)]=!0}));const n=Object.keys(t);return n.sort(),n.join("|")}return pu(e)})).join("&")}function mu(e){if("string"===typeof e){if(e=e.toLowerCase(),32===(0,Zc.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+hu(e);if(nu.isForkEvent(e))throw fu.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+hu(e.topics||[])}throw new Error("invalid event - "+e)}function gu(){return(new Date).getTime()}function yu(e){return new Promise((t=>{setTimeout(t,e)}))}const bu=["block","network","pending","poll"];class vu{constructor(e,t,n){(0,jc.defineReadOnly)(this,"tag",e),(0,jc.defineReadOnly)(this,"listener",t),(0,jc.defineReadOnly)(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],n=""===(r=e[2])?[]:r.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var r;const i={};return n.length>0&&(i.topics=n),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||bu.indexOf(this.tag)>=0}}const wu={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function xu(e){return(0,Zc.hexZeroPad)(Cc.O$.from(e).toHexString(),32)}function Au(e){return ou.Base58.encode((0,Zc.concat)([e,(0,Zc.hexDataSlice)((0,cu.JQ)((0,cu.JQ)(e)),0,4)]))}const Eu=new RegExp("^(ipfs)://(.*)$","i"),_u=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Eu,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function ku(e,t){try{return(0,Jc.ZN)(Tu(e,t))}catch(n){}return null}function Tu(e,t){if("0x"===e)return null;const n=Cc.O$.from((0,Zc.hexDataSlice)(e,t,t+32)).toNumber(),r=Cc.O$.from((0,Zc.hexDataSlice)(e,n,n+32)).toNumber();return(0,Zc.hexDataSlice)(e,n+32,n+32+r)}function Su(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):fu.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function Cu(e){const t=(0,Zc.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(t,32-t.length),n}function Iu(e){if(e.length%32===0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Ou(e){const t=[];let n=0;for(let r=0;rCc.O$.from(e).eq(1))).catch((e=>{if(e.code===Oc.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return du(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:(0,Zc.hexConcat)([e,(0,au.VM)(this.name),t||"0x"])};let r=!1;(yield this.supportsWildcard())&&(r=!0,n.data=(0,Zc.hexConcat)(["0x9061b923",Ou([(0,au.Kn)(this.name),n.data])]));try{let e=yield this.provider.call(n);return(0,Zc.arrayify)(e).length%32===4&&fu.throwError("resolver threw error",Oc.Logger.errors.CALL_EXCEPTION,{transaction:n,data:e}),r&&(e=Tu(e,0)),e}catch(i){if(i.code===Oc.Logger.errors.CALL_EXCEPTION)return null;throw i}}))}_fetchBytes(e,t){return du(this,void 0,void 0,(function*(){const n=yield this._fetch(e,t);return null!=n?Tu(n,0):null}))}_getAddress(e,t){const n=wu[String(e)];if(null==n&&fu.throwError(`unsupported coin type: ${e}`,Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===n.ilk)return this.provider.formatter.address(t);const r=(0,Zc.arrayify)(t);if(null!=n.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Au((0,Zc.concat)([[n.p2pkh],"0x"+e[2]]))}}if(null!=n.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Au((0,Zc.concat)([[n.p2sh],"0x"+e[2]]))}}if(null!=n.prefix){const e=r[1];let t=r[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&r.length===2+e&&e>=1&&e<=75){const e=lu().toWords(r.slice(2));return e.unshift(t),lu().encode(n.prefix,e)}}return null}getAddress(e){return du(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===su.R?null:this.provider.formatter.callAddress(e)}catch(r){if(r.code===Oc.Logger.errors.CALL_EXCEPTION)return null;throw r}const t=yield this._fetchBytes("0xf1cb7e06",xu(e));if(null==t||"0x"===t)return null;const n=this._getAddress(e,t);return null==n&&fu.throwError("invalid or unsupported coin data",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),n}))}getAvatar(){return du(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let n=0;n<_u.length;n++){const r=t.match(_u[n]);if(null==r)continue;const i=r[1].toLowerCase();switch(i){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:Su(t)};case"erc721":case"erc1155":{const n="erc721"===i?"0xc87b56dd":"0x0e89341c";e.push({type:i,content:t});const o=this._resolvedAddress||(yield this.getAddress()),s=(r[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),c=(0,Zc.hexZeroPad)(Cc.O$.from(s[1]).toHexString(),32);if("erc721"===i){const t=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:(0,Zc.hexConcat)(["0x6352211e",c])}));if(o!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===i){const t=Cc.O$.from(yield this.provider.call({to:a,data:(0,Zc.hexConcat)(["0x00fdd58e",(0,Zc.hexZeroPad)(o,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const u={to:this.provider.formatter.address(s[0]),data:(0,Zc.hexConcat)([n,c])};let l=ku(yield this.provider.call(u),0);if(null==l)return null;e.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=Su(l)),e.push({type:"metadata-url",content:l});const d=yield(0,Qc.fetchJson)(l);if(!d)return null;e.push({type:"metadata",content:JSON.stringify(d)});let f=d.image;if("string"!==typeof f)return null;if(f.match(/^(https:\/\/|data:)/i));else{if(null==f.match(Eu))return null;e.push({type:"url-ipfs",content:f}),f=Su(f)}return e.push({type:"url",content:f}),{linkage:e,url:f}}}}}catch(t){}return null}))}getContentHash(){return du(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+ou.Base58.encode("0x"+t[1])}const n=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const e=parseInt(n[3],16);if(n[4].length===2*e)return"ipns://"+ou.Base58.encode("0x"+n[1])}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return"bzz://"+r[1];const i=e.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+(0,iu.c)("0x"+i[1]).replace(/[=+\/]/g,(t=>e[t]))}return fu.throwError("invalid or unsupported content hash data",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return du(this,void 0,void 0,(function*(){let t=(0,Jc.Y0)(e);t=(0,Zc.concat)([xu(64),xu(t.length),t]),t.length%32!==0&&(t=(0,Zc.concat)([t,(0,Zc.hexZeroPad)("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",(0,Zc.hexlify)(t));return null==n||"0x"===n?null:(0,Jc.ZN)(n)}))}}let Du=null,Pu=1;class Bu extends ru{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,jc.defineReadOnly)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=(0,jc.getStatic)(new.target,"getNetwork")(e);t?((0,jc.defineReadOnly)(this,"_network",t),this.emit("network",t,null)):fu.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return du(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(e){}null==t&&(t=yield this.detectNetwork()),t||fu.throwError("no network detected",Oc.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,jc.defineReadOnly)(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return(0,Qc.poll)((()=>this._ready().then((e=>e),(e=>{if(e.code!==Oc.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Du&&(Du=new Wc),Du}static getNetwork(e){return Lc(null==e?"homestead":e)}ccipReadFetch(e,t,n){return du(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:r}),c=yield(0,Qc.fetchJson)({url:s,errorPassThrough:!0},a,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return fu.throwError(`response not found during CCIP fetch: ${u}`,Oc.Logger.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return fu.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,Oc.Logger.errors.SERVER_ERROR,{urls:n,errorMessages:o})}))}_getInternalBlockNumber(e){return du(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const n=yield t;if(gu()-n.respTime<=e)return n.blockNumber;break}catch(r){if(this._internalBlockNumber===t)break}}const t=gu(),n=(0,jc.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const i=gu();return(e=Cc.O$.from(e).toNumber()){this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return du(this,void 0,void 0,(function*(){const e=Pu++,t=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(r){return void this.emit("error",r)}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)fu.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",fu.makeError("network block skew detected",Oc.Logger.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let e=this._emitted.block+1;e<=n;e++)this.emit("block",e);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&n-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((e=>{switch(e.type){case"tx":{const n=e.hash;let r=this.getTransactionReceipt(n).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+n]=e.blockNumber,this.emit(n,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(r);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);const r=e.filter;r.fromBlock=e._lastBlockNumber+1,r.toBlock=n;const i=r.toBlock-this._maxFilterBlockRange;i>r.fromBlock&&(r.fromBlock=i),r.fromBlock<0&&(r.fromBlock=0);const o=this.getLogs(r).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(r,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=n,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return du(this,void 0,void 0,(function*(){return fu.throwError("provider does not support network detection",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return du(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield yu(0),this._network;const n=fu.makeError("underlying network changed",Oc.Logger.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",n),n}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=gu();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,n){return du(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,n||0,null)}))}_waitForTransaction(e,t,n,r){return du(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const s=[];let a=!1;const c=function(){return!!a||(a=!0,s.forEach((e=>{e()})),!1)},u=e=>{e.confirmations{this.removeListener(e,u)})),r){let n=r.startBlock,i=null;const u=s=>du(this,void 0,void 0,(function*(){a||(yield yu(1e3),this.getTransactionCount(r.from).then((l=>du(this,void 0,void 0,(function*(){if(!a){if(l<=r.nonce)n=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=n-3,i{a||this.once("block",u)})))}));if(a)return;this.once("block",u),s.push((()=>{this.removeListener("block",u)}))}if("number"===typeof n&&n>0){const e=setTimeout((()=>{c()||o(fu.makeError("timeout exceeded",Oc.Logger.errors.TIMEOUT,{timeout:n}))}),n);e.unref&&e.unref(),s.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return du(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Cc.O$.from(e)}catch(t){return fu.throwError("bad result from backend",Oc.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,jc.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getBalance",n);try{return Cc.O$.from(r)}catch(i){return fu.throwError("bad result from backend",Oc.Logger.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:i})}}))}getTransactionCount(e,t){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,jc.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getTransactionCount",n);try{return Cc.O$.from(r).toNumber()}catch(i){return fu.throwError("bad result from backend",Oc.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:i})}}))}getCode(e,t){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,jc.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getCode",n);try{return(0,Zc.hexlify)(r)}catch(i){return fu.throwError("bad result from backend",Oc.Logger.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:i})}}))}getStorageAt(e,t,n){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,jc.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then((e=>(0,Zc.hexValue)(e)))}),i=yield this.perform("getStorageAt",r);try{return(0,Zc.hexlify)(i)}catch(o){return fu.throwError("bad result from backend",Oc.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:i,error:o})}}))}_wrapTransaction(e,t,n){if(null!=t&&32!==(0,Zc.hexDataLength)(t))throw new Error("invalid response - sendTransaction");const r=e;return null!=t&&e.hash!==t&&fu.throwError("Transaction hash mismatch from Provider.sendTransaction.",Oc.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),r.wait=(t,r)=>du(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==r&&(r=0),0!==t&&null!=n&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const o=yield this._waitForTransaction(e.hash,t,r,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&fu.throwError("transaction failed",Oc.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),r}sendTransaction(e){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>(0,Zc.hexlify)(e))),n=this.formatter.transaction(e);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(n,e,r)}catch(i){throw i.transaction=n,i.transactionHash=n.hash,i}}))}_getTransactionRequest(e){return du(this,void 0,void 0,(function*(){const t=yield e,n={};return["from","to"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?Cc.O$.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(n.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?(0,Zc.hexlify)(e):null)))})),this.formatter.transactionRequest(yield(0,jc.resolveProperties)(n))}))}_getFilter(e){return du(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((n=>{null!=e[n]&&(t[n]=e[n])})),["fromBlock","toBlock"].forEach((n=>{null!=e[n]&&(t[n]=this._getBlockTag(e[n]))})),this.formatter.filter(yield(0,jc.resolveProperties)(t))}))}_call(e,t,n){return du(this,void 0,void 0,(function*(){n>=10&&fu.throwError("CCIP read exceeded maximum redirections",Oc.Logger.errors.SERVER_ERROR,{redirects:n,transaction:e});const r=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(n>=0&&"latest"===t&&null!=r&&"0x556f1830"===i.substring(0,10)&&(0,Zc.hexDataLength)(i)%32===4)try{const o=(0,Zc.hexDataSlice)(i,4),s=(0,Zc.hexDataSlice)(o,0,32);Cc.O$.from(s).eq(r)||fu.throwError("CCIP Read sender did not match",Oc.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const a=[],c=Cc.O$.from((0,Zc.hexDataSlice)(o,32,64)).toNumber(),u=Cc.O$.from((0,Zc.hexDataSlice)(o,c,c+32)).toNumber(),l=(0,Zc.hexDataSlice)(o,c+32);for(let t=0;tdu(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",r);if(null==e)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;rthis._wrapTransaction(e))),n}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return du(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return(0,Qc.poll)((()=>du(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(e){return du(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return(0,Qc.poll)((()=>du(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return r}))),{oncePoll:this})}))}getLogs(e){return du(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,jc.resolveProperties)({filter:this._getFilter(e)}),n=yield this.perform("getLogs",t);return n.forEach((e=>{null==e.removed&&(e.removed=!1)})),Wc.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return du(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return du(this,void 0,void 0,(function*(){if("number"===typeof(e=yield e)&&e<0){e%1&&fu.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return du(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const n=yield this._getResolver(t,"getResolver");if(null!=n){const r=new Ru(this,n,e);return t===e||(yield r.supportsWildcard())?r:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return du(this,void 0,void 0,(function*(){null==t&&(t="ENS");const n=yield this.getNetwork();n.ensAddress||fu.throwError("network does not support ENS",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name});try{const t=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+(0,au.VM)(e).substring(2)});return this.formatter.callAddress(t)}catch(r){}return null}))}resolveName(e){return du(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if((0,Zc.isHexString)(e))throw n}"string"!==typeof e&&fu.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return du(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(t,"lookupAddress");if(null==n)return null;const r=ku(yield this.call({to:n,data:"0x691f3431"+(0,au.VM)(t).substring(2)}),0);return(yield this.resolveName(r))!=e?null:r}))}getAvatar(e){return du(this,void 0,void 0,(function*(){let t=null;if((0,Zc.isHexString)(e)){const n=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",i=yield this._getResolver(n,"getAvatar");if(!i)return null;t=new Ru(this,i,n);try{const e=yield t.getAvatar();if(e)return e.url}catch(r){if(r.code!==Oc.Logger.errors.CALL_EXCEPTION)throw r}try{const e=ku(yield this.call({to:i,data:"0x691f3431"+(0,au.VM)(n).substring(2)}),0);t=yield this.getResolver(e)}catch(r){if(r.code!==Oc.Logger.errors.CALL_EXCEPTION)throw r;return null}}else if(t=yield this.getResolver(e),!t)return null;const n=yield t.getAvatar();return null==n?null:n.url}))}perform(e,t){return fu.throwError(e+" not implemented",Oc.Logger.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,n){const r=new vu(mu(e),t,n);return this._events.push(r),this._startEvent(r),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let n=!1,r=[],i=mu(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),n=!0,!e.once||(r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),n}listenerCount(e){if(!e)return this._events.length;let t=mu(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=mu(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const n=[];let r=!1,i=mu(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!r||(r=!0,n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const n=mu(e);this._events=this._events.filter((e=>e.tag!==n||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var Mu=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const Nu=new Oc.Logger(Gc),Fu=["call","estimateGas"];function Lu(e,t){if(null==e)return null;if("string"===typeof e.message&&e.message.match("reverted")){const n=(0,Zc.isHexString)(e.data)?e.data:null;if(!t||n)return{message:e.message,data:n}}if("object"===typeof e){for(const n in e){const r=Lu(e[n],t);if(r)return r}return null}if("string"===typeof e)try{return Lu(JSON.parse(e),t)}catch(n){}return null}function ju(e,t,n){const r=n.transaction||n.signedTransaction;if("call"===e){const e=Lu(t,!0);if(e)return e.data;Nu.throwError("missing revert data in call exception; Transaction reverted without a reason string",Oc.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:t})}if("estimateGas"===e){let n=Lu(t.body,!1);null==n&&(n=Lu(t,!1)),n&&Nu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Oc.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:e,transaction:r,error:t})}let i=t.message;throw t.code===Oc.Logger.errors.SERVER_ERROR&&t.error&&"string"===typeof t.error.message?i=t.error.message:"string"===typeof t.body?i=t.body:"string"===typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Nu.throwError("insufficient funds for intrinsic transaction cost",Oc.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),i.match(/nonce (is )?too low/i)&&Nu.throwError("nonce has already been used",Oc.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Nu.throwError("replacement fee too low",Oc.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),i.match(/only replay-protected/i)&&Nu.throwError("legacy pre-eip-155 transactions not supported",Oc.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:r}),Fu.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Nu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Oc.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}function Uu(e){return new Promise((function(t){setTimeout(t,e)}))}function Zu(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Hu(e){return e?e.toLowerCase():e}const zu={};class Gu extends Yc.E{constructor(e,t,n){if(super(),e!==zu)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,jc.defineReadOnly)(this,"provider",t),null==n&&(n=0),"string"===typeof n?((0,jc.defineReadOnly)(this,"_address",this.provider.formatter.address(n)),(0,jc.defineReadOnly)(this,"_index",null)):"number"===typeof n?((0,jc.defineReadOnly)(this,"_index",n),(0,jc.defineReadOnly)(this,"_address",null)):Nu.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return Nu.throwError("cannot alter JSON-RPC Signer connection",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Vu(zu,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&Nu.throwError("unknown account #"+this._index,Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=(0,jc.shallowCopy)(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const n=(0,jc.shallowCopy)(e);n.from=t,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>Mu(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&Nu.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),(0,jc.resolveProperties)({tx:(0,jc.resolveProperties)(e),sender:t}).then((({tx:t,sender:n})=>{null!=t.from?t.from.toLowerCase()!==n&&Nu.throwArgumentError("from address mismatch","transaction",e):t.from=n;const r=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((e=>e),(e=>("string"===typeof e.message&&e.message.match(/user denied/i)&&Nu.throwError("user rejected transaction",Oc.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),ju("sendTransaction",e,r))))}))}signTransaction(e){return Nu.throwError("signing transactions is unsupported",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Mu(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield(0,Qc.poll)((()=>Mu(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(n);if(null!==e)return this.provider._wrapTransaction(e,n,t)}))),{oncePoll:this.provider})}catch(r){throw r.transactionHash=n,r}}))}signMessage(e){return Mu(this,void 0,void 0,(function*(){const t="string"===typeof e?(0,Jc.Y0)(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,Zc.hexlify)(t),n.toLowerCase()])}catch(r){throw"string"===typeof r.message&&r.message.match(/user denied/i)&&Nu.throwError("user rejected signing",Oc.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),r}}))}_legacySignMessage(e){return Mu(this,void 0,void 0,(function*(){const t="string"===typeof e?(0,Jc.Y0)(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),(0,Zc.hexlify)(t)])}catch(r){throw"string"===typeof r.message&&r.message.match(/user denied/i)&&Nu.throwError("user rejected signing",Oc.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),r}}))}_signTypedData(e,t,n){return Mu(this,void 0,void 0,(function*(){const r=yield Xc.E.resolveNames(e,t,n,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Xc.E.getPayload(r.domain,t,r.value))])}catch(o){throw"string"===typeof o.message&&o.message.match(/user denied/i)&&Nu.throwError("user rejected signing",Oc.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:r.domain,types:t,value:r.value}}),o}}))}unlock(e){return Mu(this,void 0,void 0,(function*(){const t=this.provider,n=yield this.getAddress();return t.send("personal_unlockAccount",[n.toLowerCase(),e,null])}))}}class Vu extends Gu{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Wu={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class qu extends Bu{constructor(e,t){let n=t;null==n&&(n=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(n),e||(e=(0,jc.getStatic)(this.constructor,"defaultUrl")()),"string"===typeof e?(0,jc.defineReadOnly)(this,"connection",Object.freeze({url:e})):(0,jc.defineReadOnly)(this,"connection",Object.freeze((0,jc.shallowCopy)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Mu(this,void 0,void 0,(function*(){yield Uu(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(t){}}if(null!=e){const n=(0,jc.getStatic)(this.constructor,"getNetwork");try{return n(Cc.O$.from(e).toNumber())}catch(t){return Nu.throwError("could not detect network",Oc.Logger.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return Nu.throwError("could not detect network",Oc.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Gu(zu,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,jc.deepCopy)(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(r&&this._cache[e])return this._cache[e];const i=(0,Qc.fetchJson)(this.connection,JSON.stringify(n),Zu).then((e=>(this.emit("debug",{action:"response",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:n,provider:this}),e}));return r&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Hu(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Hu(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Hu(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Hu(t.address),(0,Zc.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,jc.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,jc.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Hu(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return Mu(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Cc.O$.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((t=(0,jc.shallowCopy)(t)).transaction=(0,jc.shallowCopy)(e),delete t.transaction.type)}}const n=this.prepareRequest(e,t);null==n&&Nu.throwError(e+" not implemented",Oc.Logger.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(r){return ju(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(n){return function r(){e.send("eth_getFilterChanges",[n]).then((function(n){if(e._pendingFilter!=t)return null;let r=Promise.resolve();return n.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return Uu(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[n])})).catch((e=>{}))}(),n})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const n=(0,jc.shallowCopy)(Wu);if(t)for(const i in t)t[i]&&(n[i]=!0);(0,jc.checkProperties)(e,n);const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const n=(0,Zc.hexValue)(Cc.O$.from(e[t]));"gasLimit"===t&&(t="gas"),r[t]=n})),["from","to","data"].forEach((function(t){null!=e[t]&&(r[t]=(0,Zc.hexlify)(e[t]))})),e.accessList&&(r.accessList=(0,zc.accessListify)(e.accessList)),r}}let $u=null;try{if($u=WebSocket,null==$u)throw new Error("inject please")}catch(IT){const e=new Oc.Logger(Gc);$u=function(){e.throwError("WebSockets not supported in this environment",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Ku=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const Yu=new Oc.Logger(Gc);let Xu=1;class Ju extends qu{constructor(e,t){"any"===t&&Yu.throwError("WebSocketProvider does not support 'any' network yet",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"===typeof e?e:"_websocket",t),this._pollingInterval=-1,this._wsReady=!1,"string"===typeof e?(0,jc.defineReadOnly)(this,"_websocket",new $u(this.connection.url)):(0,jc.defineReadOnly)(this,"_websocket",e),(0,jc.defineReadOnly)(this,"_requests",{}),(0,jc.defineReadOnly)(this,"_subs",{}),(0,jc.defineReadOnly)(this,"_subIds",{}),(0,jc.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this.websocket.send(this._requests[e].payload)}))},this.websocket.onmessage=e=>{const t=e.data,n=JSON.parse(t);if(null!=n.id){const e=String(n.id),r=this._requests[e];if(delete this._requests[e],void 0!==n.result)r.callback(null,n.result),this.emit("debug",{action:"response",request:JSON.parse(r.payload),response:n.result,provider:this});else{let e=null;n.error?(e=new Error(n.error.message||"unknown error"),(0,jc.defineReadOnly)(e,"code",n.error.code||null),(0,jc.defineReadOnly)(e,"response",t)):e=new Error("unknown error"),r.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(r.payload),provider:this})}}else if("eth_subscription"===n.method){const e=this._subs[n.params.subscription];e&&e.processFunc(n.params.result)}else console.warn("this should not happen")};const n=setInterval((()=>{this.emit("poll")}),1e3);n.unref&&n.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){Yu.throwError("cannot reset events block on WebSocketProvider",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){Yu.throwError("cannot set polling interval on WebSocketProvider",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return Ku(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&Yu.throwError("cannot set polling on WebSocketProvider",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const n=Xu++;return new Promise(((r,i)=>{const o=JSON.stringify({method:e,params:t,id:n,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(n)]={callback:function(e,t){return e?i(e):r(t)},payload:o},this._wsReady&&this.websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,n){return Ku(this,void 0,void 0,(function*(){let r=this._subIds[e];null==r&&(r=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=r);const i=yield r;this._subs[i]={tag:e,processFunc:n}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=Cc.O$.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const n=this._subIds[t];n&&(delete this._subIds[t],n.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return Ku(this,void 0,void 0,(function*(){this.websocket.readyState===$u.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}var Qu=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const el=new Oc.Logger(Gc);class tl extends qu{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return Qu(this,void 0,void 0,(function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||el.throwError("no network detected",Oc.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,jc.defineReadOnly)(this,"_network",t),this.emit("network",t,null))),t}))}}class nl extends tl{constructor(e,t){el.checkAbstract(new.target,nl),e=(0,jc.getStatic)(new.target,"getNetwork")(e),t=(0,jc.getStatic)(new.target,"getApiKey")(t);super((0,jc.getStatic)(new.target,"getUrl")(e,t),e),"string"===typeof t?(0,jc.defineReadOnly)(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{(0,jc.defineReadOnly)(this,e,t[e])}))}_startPending(){el.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return el.throwError("API provider does not support signing",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return el.throwError("not implemented; sub-classes must override getUrl",Oc.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const rl=new Oc.Logger(Gc),il="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class ol extends Ju{constructor(e,t){const n=new sl(e,t);super(n.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),n.network),(0,jc.defineReadOnly)(this,"apiKey",n.apiKey)}isCommunityResource(){return this.apiKey===il}}class sl extends nl{static getWebSocketProvider(e,t){return new ol(e,t)}static getApiKey(e){return null==e?il:(e&&"string"!==typeof e&&rl.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.g.alchemy.com/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":n="arb-goerli.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":n="opt-goerli.g.alchemy.com/v2/";break;default:rl.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+t,throttleCallback:(e,n)=>(t===il&&Kc(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===il}}const al=new Oc.Logger(Gc),cl="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function ul(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return al.throwArgumentError("unsupported network","name",e)}class ll extends nl{isCommunityResource(){return this.apiKey===cl}static getApiKey(e){return null==e?cl:e}static getUrl(e,t){null==t&&(t=cl);const n={allowGzip:!0,url:"https://"+ul(e.name)+t,throttleCallback:(e,n)=>(t.apiKey===cl&&Kc(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}}var dl=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const fl=new Oc.Logger(Gc);class pl extends nl{static getApiKey(e){return null!=e&&fl.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let n=null;if("homestead"===e.name)n="https://cloudflare-eth.com/";else fl.throwArgumentError("unsupported network","network",arguments[0]);return n}perform(e,t){const n=Object.create(null,{perform:{get:()=>super.perform}});return dl(this,void 0,void 0,(function*(){if("getBlockNumber"===e){return(yield n.perform.call(this,"getBlock",{blockTag:"latest"})).number}return n.perform.call(this,e,t)}))}}var hl=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const ml=new Oc.Logger(Gc);function gl(e){const t={};for(let n in e){if(null==e[n])continue;let r=e[n];"type"===n&&0===r||(r={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[n]?(0,Zc.hexValue)((0,Zc.hexlify)(r)):"accessList"===n?"["+(0,zc.accessListify)(r).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":(0,Zc.hexlify)(r),t[n]=r)}return t}function yl(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!==typeof e.message||!e.message.match(/^OK/)){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function bl(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function vl(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function wl(e,t,n){if("call"===e&&t.code===Oc.Logger.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let n=e.data;if(n&&(n="0x"+n.replace(/^.*0x/i,"")),(0,Zc.isHexString)(n))return n;ml.throwError("missing revert data in call exception",Oc.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let r=t.message;throw t.code===Oc.Logger.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?r=t.error.message:"string"===typeof t.body?r=t.body:"string"===typeof t.responseText&&(r=t.responseText)),r=(r||"").toLowerCase(),r.match(/insufficient funds/)&&ml.throwError("insufficient funds for intrinsic transaction cost",Oc.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),r.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ml.throwError("nonce has already been used",Oc.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),r.match(/another transaction with same nonce/)&&ml.throwError("replacement fee too low",Oc.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),r.match(/execution failed due to an exception|execution reverted/)&&ml.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Oc.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}class xl extends Bu{constructor(e,t){super(e),(0,jc.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,jc.defineReadOnly)(this,"apiKey",t||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return ml.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){const n=Object.keys(t).reduce(((e,n)=>{const r=t[n];return null!=r&&(e+=`&${n}=${r}`),e}),""),r=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${n}${r}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,n){return hl(this,void 0,void 0,(function*(){const r=n?this.getPostUrl():this.getUrl(e,t),i=n?this.getPostData(e,t):null,o="proxy"===e?bl:yl;this.emit("debug",{action:"request",request:r,provider:this});const s={url:r,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&Kc(),Promise.resolve(!0))};let a=null;i&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(i).map((e=>`${e}=${i[e]}`)).join("&"));const c=yield(0,Qc.fetchJson)(s,a,o||bl);return this.emit("debug",{action:"response",request:r,response:(0,jc.deepCopy)(c),provider:this}),c}))}detectNetwork(){return hl(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const n=Object.create(null,{perform:{get:()=>super.perform}});return hl(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>wl("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=gl(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(IT){return wl("call",IT,t.transaction)}}case"estimateGas":{const e=gl(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(IT){return wl("estimateGas",IT,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=vl(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=vl(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&ml.throwError("unsupported topic count",Oc.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const n=t.filter.topics[0];"string"===typeof n&&66===n.length||ml.throwError("unsupported topic format",Oc.Logger.errors.UNSUPPORTED_OPERATION,{topic0:n}),e.topic0=n}const n=yield this.fetch("logs",e);let r={};for(let t=0;t{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return null==this.apiKey}}var Al=n(34952),El=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(h){o(h)}}function a(e){try{c(r.throw(e))}catch(h){o(h)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const _l=new Oc.Logger(Gc);function kl(){return(new Date).getTime()}function Tl(e){let t=null;for(let n=0;nt?null:(r+i)/2}function Cl(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(Cc.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>Cl(e))));if("object"===typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let n=e[t];return n="function"===typeof n?"[function]":Cl(n),JSON.stringify(t)+":"+n})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let Il=1;function Ol(e){let t=null,n=null,r=new Promise((r=>{t=function(){n&&(clearTimeout(n),n=null),r()},n=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return r},wait:e=>(r=r.then(e),r)}}const Rl=[Oc.Logger.errors.CALL_EXCEPTION,Oc.Logger.errors.INSUFFICIENT_FUNDS,Oc.Logger.errors.NONCE_EXPIRED,Oc.Logger.errors.REPLACEMENT_UNDERPRICED,Oc.Logger.errors.UNPREDICTABLE_GAS_LIMIT],Dl=["address","args","errorArgs","errorSignature","method","transaction"];function Pl(e,t){const n={weight:e.weight};return Object.defineProperty(n,"provider",{get:()=>e.provider}),e.start&&(n.start=e.start),t&&(n.duration=t-e.start),e.done&&(e.error?n.error=e.error:n.result=e.result||null),n}function Bl(e,t,n){let r=Cl;switch(t){case"getBlockNumber":return function(t){const n=t.map((e=>e.result));let r=Sl(t.map((e=>e.result)),2);if(null!=r)return r=Math.ceil(r),n.indexOf(r+1)>=0&&r++,r>=e._highestBlockNumber&&(e._highestBlockNumber=r),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return Sl(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":r=function(e){return null==e?null:((e=(0,jc.shallowCopy)(e)).confirmations=-1,Cl(e))};break;case"getBlock":r=n.includeTransactions?function(e){return null==e?null:((e=(0,jc.shallowCopy)(e)).transactions=e.transactions.map((e=>((e=(0,jc.shallowCopy)(e)).confirmations=-1,e))),Cl(e))}:function(e){return null==e?null:Cl(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(n){const r={};n.forEach((t=>{const n=e(t.result);r[n]||(r[n]={count:0,result:t.result}),r[n].count++}));const i=Object.keys(r);for(let e=0;e=t)return n.result}}}(r,e.quorum)}function Ml(e,t){return El(this,void 0,void 0,(function*(){const n=e.provider;return null!=n.blockNumber&&n.blockNumber>=t||-1===t?n:(0,Qc.poll)((()=>new Promise(((r,i)=>{setTimeout((function(){return n.blockNumber>=t?r(n):e.cancelled?r(null):r(void 0)}),0)}))),{oncePoll:n})}))}function Nl(e,t,n,r){return El(this,void 0,void 0,(function*(){let i=e.provider;switch(n){case"getBlockNumber":case"getGasPrice":return i[n]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return r.blockTag&&(0,Zc.isHexString)(r.blockTag)&&(i=yield Ml(e,t)),i[n](r.address,r.blockTag||"latest");case"getStorageAt":return r.blockTag&&(0,Zc.isHexString)(r.blockTag)&&(i=yield Ml(e,t)),i.getStorageAt(r.address,r.position,r.blockTag||"latest");case"getBlock":return r.blockTag&&(0,Zc.isHexString)(r.blockTag)&&(i=yield Ml(e,t)),i[r.includeTransactions?"getBlockWithTransactions":"getBlock"](r.blockTag||r.blockHash);case"call":case"estimateGas":return r.blockTag&&(0,Zc.isHexString)(r.blockTag)&&(i=yield Ml(e,t)),"call"===n&&r.blockTag?i[n](r.transaction,r.blockTag):i[n](r.transaction);case"getTransaction":case"getTransactionReceipt":return i[n](r.transactionHash);case"getLogs":{let n=r.filter;return(n.fromBlock&&(0,Zc.isHexString)(n.fromBlock)||n.toBlock&&(0,Zc.isHexString)(n.toBlock))&&(i=yield Ml(e,t)),i.getLogs(n)}}return _l.throwError("unknown method error",Oc.Logger.errors.UNKNOWN_ERROR,{method:n,params:r})}))}class Fl extends Bu{constructor(e,t){0===e.length&&_l.throwArgumentError("missing providers","providers",e);const n=e.map(((e,t)=>{if(ru.isProvider(e)){const t=qc(e)?2e3:750,n=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:n})}const n=(0,jc.shallowCopy)(e);null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=qc(e)?2e3:750),null==n.weight&&(n.weight=1);const r=n.weight;return(r%1||r>512||r<1)&&_l.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,r),Object.freeze(n)})),r=n.reduce(((e,t)=>e+t.weight),0);null==t?t=r/2:t>r&&_l.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=Tl(n.map((e=>e.provider.network)));null==i&&(i=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(i),(0,jc.defineReadOnly)(this,"providerConfigs",Object.freeze(n)),(0,jc.defineReadOnly)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return El(this,void 0,void 0,(function*(){return Tl(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return El(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;te.priority-t.priority));const i=this._highestBlockNumber;let o=0,s=!0;for(;;){const a=kl();let c=r.filter((e=>e.runner&&a-e.starte+t.weight),0);for(;c{n.staller=null})),n.runner=Nl(n,i,e,t).then((r=>{n.done=!0,n.result=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Pl(n,kl()),request:{method:e,params:(0,jc.deepCopy)(t)},provider:this})}),(r=>{n.done=!0,n.error=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Pl(n,kl()),request:{method:e,params:(0,jc.deepCopy)(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Pl(n,null),request:{method:e,params:(0,jc.deepCopy)(t)},provider:this}),c+=n.weight}const u=[];r.forEach((e=>{!e.done&&e.runner&&(u.push(e.runner),e.staller&&u.push(e.staller.getPromise()))})),u.length&&(yield Promise.race(u));const l=r.filter((e=>e.done&&null==e.error));if(l.length>=this.quorum){const e=n(l);if(void 0!==e)return r.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;s||(yield Ol(100).getPromise()),s=!1}const d=r.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const n=t.error.code;return Rl.indexOf(n)>=0&&(e[n]||(e[n]={error:t.error,weight:0}),e[n].weight+=t.weight),e}),{});if(Object.keys(d).forEach((e=>{const t=d[e];if(t.weight{e.staller&&e.staller.cancel(),e.cancelled=!0}));const n=t.error,i={};Dl.forEach((e=>{null!=n[e]&&(i[e]=n[e])})),_l.throwError(n.reason||n.message,e,i)})),0===r.filter((e=>!e.done)).length)break}return r.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),_l.throwError("failed to meet quorum",Oc.Logger.errors.SERVER_ERROR,{method:e,params:t,results:r.map((e=>Pl(e))),provider:this})}))}}const Ll=new Oc.Logger(Gc),jl="84842078b09946638c03157f83405213";class Ul extends Ju{constructor(e,t){const n=new Zl(e,t),r=n.connection;r.password&&Ll.throwError("INFURA WebSocket project secrets unsupported",Oc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});super(r.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),(0,jc.defineReadOnly)(this,"apiKey",n.projectId),(0,jc.defineReadOnly)(this,"projectId",n.projectId),(0,jc.defineReadOnly)(this,"projectSecret",n.projectSecret)}isCommunityResource(){return this.projectId===jl}}class Zl extends nl{static getWebSocketProvider(e,t){return new Ul(e,t)}static getApiKey(e){const t={apiKey:jl,projectId:jl,projectSecret:null};return null==e||("string"===typeof e?t.projectId=e:null!=e.projectSecret?(Ll.assertArgument("string"===typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Ll.assertArgument("string"===typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let n=null;switch(e?e.name:"unknown"){case"homestead":n="mainnet.infura.io";break;case"goerli":n="goerli.infura.io";break;case"sepolia":n="sepolia.infura.io";break;case"matic":n="polygon-mainnet.infura.io";break;case"maticmum":n="polygon-mumbai.infura.io";break;case"optimism":n="optimism-mainnet.infura.io";break;case"optimism-goerli":n="optimism-goerli.infura.io";break;case"arbitrum":n="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":n="arbitrum-goerli.infura.io";break;default:Ll.throwError("unsupported network",Oc.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const r={allowGzip:!0,url:"https://"+n+"/v3/"+t.projectId,throttleCallback:(e,n)=>(t.projectId===jl&&Kc(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}isCommunityResource(){return this.projectId===jl}}const Hl=new Oc.Logger(Gc);class zl extends nl{static getApiKey(e){return e&&"string"!==typeof e&&Hl.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){Hl.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let n=null;switch(e.name){case"homestead":n="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":n="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":n="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":n="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":n="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Hl.throwArgumentError("unsupported network","network",arguments[0])}return n+"?apiKey="+t}}const Gl=new Oc.Logger(Gc),Vl="62e1ad51b37b8e00394bda3b";class Wl extends nl{static getApiKey(e){const t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=Vl:"string"===typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:Gl.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let n=null;switch(e?e.name:"unknown"){case"goerli":n="eth-goerli.gateway.pokt.network";break;case"homestead":n="eth-mainnet.gateway.pokt.network";break;case"kovan":n="poa-kovan.gateway.pokt.network";break;case"matic":n="poly-mainnet.gateway.pokt.network";break;case"maticmum":n="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":n="eth-rinkeby.gateway.pokt.network";break;case"ropsten":n="eth-ropsten.gateway.pokt.network";break;default:Gl.throwError("unsupported network",Oc.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const r={headers:{},url:`https://${n}/v1/lb/${t.applicationId}`};return null!=t.applicationSecretKey&&(r.user="",r.password=t.applicationSecretKey),r}isCommunityResource(){return this.applicationId===Vl}}const ql=new Oc.Logger(Gc);let $l=1;function Kl(e,t){const n="Web3LegacyFetcher";return function(e,r){const i={method:e,params:r,id:$l++,jsonrpc:"2.0"};return new Promise(((e,r)=>{this.emit("debug",{action:"request",fetcher:n,request:(0,jc.deepCopy)(i),provider:this}),t(i,((t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:n,error:t,request:i,provider:this}),r(t);if(this.emit("debug",{action:"response",fetcher:n,request:i,response:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,r(e)}e(o.result)}))}))}}class Yl extends qu{constructor(e,t){null==e&&ql.throwArgumentError("missing provider","provider",e);let n=null,r=null,i=null;"function"===typeof e?(n="unknown:",r=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),i=e,e.request?(""===n&&(n="eip-1193:"),r=function(e){return function(t,n){null==n&&(n=[]);const r={method:t,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,jc.deepCopy)(r),provider:this}),e.request(r).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:e,provider:this}),e}))}}(e)):e.sendAsync?r=Kl(0,e.sendAsync.bind(e)):e.send?r=Kl(0,e.send.bind(e)):ql.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,t),(0,jc.defineReadOnly)(this,"jsonRpcFetchFunc",r),(0,jc.defineReadOnly)(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const Xl=new Oc.Logger(Gc);var Jl,Ql,ed=n(11871),td=n(47796);!function(e){e.web3="web3",e.ethers="ethers",e.customHttp="custom"}(Jl||(Jl={})),function(e){e[e.mainnet=1]="mainnet",e[e.ropsten=3]="ropsten",e[e.rinkeby=4]="rinkeby",e[e.goerli=5]="goerli",e[e.optimism=10]="optimism",e[e.kovan=42]="kovan",e[e.matic=137]="matic",e[e.kovanOptimism=69]="kovanOptimism",e[e.xdai=100]="xdai",e[e.xDaiTestnet=10200]="xDaiTestnet",e[e.goerliOptimism=420]="goerliOptimism",e[e.sepoliaOptimism=11155420]="sepoliaOptimism",e[e.arbitrum=42161]="arbitrum",e[e.rinkebyArbitrum=421611]="rinkebyArbitrum",e[e.goerliArbitrum=421613]="goerliArbitrum",e[e.sepoliaArbitrum=421614]="sepoliaArbitrum",e[e.mumbai=80001]="mumbai",e[e.sepolia=11155111]="sepolia",e[e.avalancheMainnet=43114]="avalancheMainnet",e[e.avalancheFuji=43113]="avalancheFuji",e[e.fantomTestnet=4002]="fantomTestnet",e[e.fantom=250]="fantom",e[e.bsc=56]="bsc",e[e.bsc_testnet=97]="bsc_testnet",e[e.moonbeam=1284]="moonbeam",e[e.moonriver=1285]="moonriver",e[e.moonbaseAlphaTestnet=1287]="moonbaseAlphaTestnet",e[e.harmony=16666e5]="harmony",e[e.cronos=25]="cronos",e[e.fuse=122]="fuse",e[e.songbirdCanaryNetwork=19]="songbirdCanaryNetwork",e[e.costonTestnet=16]="costonTestnet",e[e.boba=288]="boba",e[e.aurora=1313161554]="aurora",e[e.astar=592]="astar",e[e.okc=66]="okc",e[e.heco=128]="heco",e[e.metis=1088]="metis",e[e.rsk=30]="rsk",e[e.rskTestnet=31]="rskTestnet",e[e.evmos=9001]="evmos",e[e.evmosTestnet=9e3]="evmosTestnet",e[e.thundercore=108]="thundercore",e[e.thundercoreTestnet=18]="thundercoreTestnet",e[e.oasis=26863]="oasis",e[e.celo=42220]="celo",e[e.godwoken=71402]="godwoken",e[e.godwokentestnet=71401]="godwokentestnet",e[e.klatyn=8217]="klatyn",e[e.milkomeda=2001]="milkomeda",e[e.kcc=321]="kcc",e[e.etherlite=111]="etherlite",e[e.lineaTestnet=59140]="lineaTestnet",e[e.linea=59144]="linea",e[e.scroll=534352]="scroll",e[e.scrollSepolia=534351]="scrollSepolia",e[e.zkSyncEra=324]="zkSyncEra",e[e.zkSyncEraTestnet=280]="zkSyncEraTestnet",e[e.zkSyncEraSepoliaTestnet=300]="zkSyncEraSepoliaTestnet",e[e.starknet=300]="starknet",e[e.starknetTestnet=301]="starknetTestnet",e[e.shibarium=109]="shibarium",e[e.mantle=5e3]="mantle",e[e.mantleTestnet=5001]="mantleTestnet",e[e.base=8453]="base",e[e.baseTestnet=84531]="baseTestnet",e[e.blastSepolia=168587773]="blastSepolia",e[e.polygonZkEvm=1101]="polygonZkEvm",e[e.polygonZkEvmTestnet=1442]="polygonZkEvmTestnet",e[e.zora=7777777]="zora",e[e.zoraTestnet=999]="zoraTestnet",e[e.flare=14]="flare",e[e.pulsechain=369]="pulsechain",e[e.sapphire=23294]="sapphire",e[e.blast=81457]="blast",e[e.amoy=80002]="amoy"}(Ql||(Ql={}));var nd=function(){function e(){}return e.deepClone=function(e){return JSON.parse(JSON.stringify(e))},e}(),rd=function(){return rd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)try{f=td.defaultAbiCoder.decode(d,this.getReturnDataFromResult(u.result)),a.callsReturnContext.push(nd.deepClone({returnValues:this.formatReturnValues(f),decoded:!0,reference:l.reference,methodName:l.methodName,methodParameters:l.methodParameters,success:!0}))}catch(h){if(!this._options.tryAggregate)throw h;a.callsReturnContext.push(nd.deepClone({returnValues:[],decoded:!1,reference:l.reference,methodName:l.methodName,methodParameters:l.methodParameters,success:!1}))}else a.callsReturnContext.push(nd.deepClone({returnValues:this.getReturnDataFromResult(u.result),decoded:!1,reference:l.reference,methodName:l.methodName,methodParameters:l.methodParameters,success:!0}));else a.callsReturnContext.push(nd.deepClone({returnValues:[],decoded:!1,reference:l.reference,methodName:l.methodName,methodParameters:l.methodParameters,success:!1}));r.results[a.originalContractCallContext.reference]=a}return[2,r]}}))}))},e.prototype.getReturnDataFromResult=function(e){return this._options.tryAggregate?e.returnData:e},e.prototype.formatReturnValues=function(e){var t=e;return 1===e.length&&(t=e[0]),Array.isArray(t)?t:[t]},e.prototype.buildAggregateCallContext=function(e){for(var t=[],n=0;n=0||(i[n]=e[n]);return i}function rf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var of={exports:{}};!function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(R){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),s=new C(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=k(s,n);if(a){if(a===m)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?h:f,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,s),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(R){return{type:"throw",arg:R}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",h="completed",m={};function g(){}function y(){}function b(){}var v={};c(v,o,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(I([])));x&&x!==n&&r.call(x,o)&&(v=x);var A=b.prototype=g.prototype=Object.create(v);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function n(i,o,s,a){var c=l(e[i],e,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"===typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,a)}))}a(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=l(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function I(e){if(e){var n=e[o];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(c&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(n){"object"===typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(of);var sf=of.exports,af="https://api.paraswap.io";var cf=function(e){var t=function(e){return Object.entries(e).filter((function(e){return void 0!==e[1]})).map((function(e){var t=e[0],n=e[1];return[t,String(n)]}))}(e),n=new URLSearchParams(t).toString();return n&&"?"+n},uf=function(e){var t,n;function r(t){var n,i=t.code,o=t.request,s=t.response,a=t.isAxiosError,c=t.message;if((n=e.call(this)||this).code=void 0,n.status=void 0,n.request=void 0,n.response=void 0,n.isAxiosError=!1,Error.captureStackTrace&&Error.captureStackTrace(rf(n),r),n.name=n.constructor.name,n.code=i,n.request=o,n.isAxiosError=a,!s)return n.message=c,rf(n);n.response=s;var u=s.data,l=s.status;return n.status=l,n.message=lf(u)?u.error:c,n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Jd(t,n),r}(tf(Error));function lf(e){return!!(t=e)&&"object"===typeof t&&"string"===typeof e.error;var t}var df,ff=["srcToken","destToken"],pf=["route"],hf=["options"],mf=["excludePricingMethods","excludeContractMethods","includeContractMethods","adapterVersion","partner","includeDEXS","excludeDEXS","excludePools"];!function(e){e.megapath="megapath",e.multipath="multipath",e.simplepath="simplepath"}(df||(df={}));var gf=function(e){var t=e.apiURL,n=void 0===t?af:t,r=e.chainId,i=e.fetcher,o=n+"/prices",s=function(){var e=Kd(sf.mark((function e(t,n){var s,a,c,u,l,d,f;return sf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.srcToken,a=t.destToken,c=nf(t,ff),u=yf(c),l=cf(Yd({srcToken:s,destToken:a,network:r},u)),d=o+"/"+l,e.next=6,i({url:d,method:"GET",signal:n});case 6:return f=e.sent,e.abrupt("return",f.priceRoute);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),a=function(){var e=Kd(sf.mark((function e(t,n){var s,a,c,u,l,d,f;return sf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=t.route,a=nf(t,pf),!(s.length<2)){e.next=3;break}throw new Error("Invalid Route");case 3:return c=yf(a),u=s.join("-"),l=cf(Yd({route:u,network:r},c)),d=o+"/"+l,e.next=9,i({url:d,method:"GET",signal:n});case 9:return f=e.sent,e.abrupt("return",f.priceRoute);case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return{getRate:s,getRateByRoute:a}};function yf(e){var t=e.options,n=void 0===t?{}:t,r=nf(e,hf),i=n.excludePricingMethods,o=n.excludeContractMethods,s=n.includeContractMethods,a=n.adapterVersion,c=n.partner,u=void 0===c?"paraswap.io":c,l=n.includeDEXS,d=n.excludeDEXS,f=n.excludePools,p=nf(n,mf),h=[l,d,f,i,o,s].map((function(e){return(null==e?void 0:e.join(","))||void 0})),m=h[0],g=h[1],y=h[2];return Yd({version:a,excludePricingMethods:h[3],excludeContractMethods:h[4],includeContractMethods:h[5],partner:u,includeDEXS:m,excludeDEXS:g,excludePools:y},r,p)}function bf(e){return{nonceAndMeta:e.nonceAndMeta,expiry:e.expiry,makerAsset:e.makerAsset,takerAsset:e.takerAsset,maker:e.maker,taker:e.taker,makerAmount:e.makerAmount,takerAmount:e.takerAmount}}function vf(e,t){return(BigInt(e)+(BigInt(t)<0?Yd({},t,{orders:t.orders.map((function(e){var t=Yd({},"makerAssetId"in e?wf(e):bf(e),{signature:e.signature});return e.permitMakerAsset&&(t.permitMakerAsset=e.permitMakerAsset),t}))}):t,f={url:l,method:"POST",data:d,signal:r},e.next=8,i(f);case 8:return p=e.sent,e.abrupt("return",p);case 10:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();return{buildTx:s}};function Af(e){var t=e.queryParams,n=e.side,r=e.priceRoute;if(t.slippage)return n===Wd.PC.BUY&&t.destAmount===r.destAmount||n===Wd.PC.SELL&&t.srcAmount===r.srcAmount;var i=n===Wd.PC.SELL?[t.srcAmount,r.srcAmount]:[t.destAmount,r.destAmount];return i[0]===i[1]}var Ef=function(e){return function(){var t=Kd(sf.mark((function t(n){var r,i,o,s,a,c,u;return sf.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r=n.url,i=n.method,o=n.signal,s="POST"===i?JSON.stringify(n.data):null,a="POST"===i&&s?{"Content-Type":"application/json"}:void 0,t.next=6,e(r,{method:i,body:s,signal:o,headers:a});case 6:return c=t.sent,t.next=9,c.json();case 9:if(u=t.sent,c.ok){t.next=12;break}throw new uf({code:String(c.status),response:{data:u,status:c.status,statusText:c.statusText,headers:Object.fromEntries(c.headers.entries()),config:{url:r,method:i}},message:c.statusText,isAxiosError:!1});case 12:return t.abrupt("return",u);case 15:if(t.prev=15,t.t0=t.catch(0),!(t.t0 instanceof uf)){t.next=19;break}throw t.t0;case 19:throw new uf(t.t0);case 20:case"end":return t.stop()}}),t,null,[[0,15]])})));return function(e){return t.apply(this,arguments)}}()};var _f=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{var t,n,r,i;if(this.mutateOptions&&this.hasListeners())if(e.onSuccess)null==(t=(n=this.mutateOptions).onSuccess)||t.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(r=(i=this.mutateOptions).onSettled)||r.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context);else if(e.onError){var o,s,a,c;null==(o=(s=this.mutateOptions).onError)||o.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(c=this.mutateOptions).onSettled)||a.call(c,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}e.listeners&&this.listeners.forEach((e=>{e(this.currentResult)}))}))}}var $f=n(24798);function Kf(){}var Yf=n(9669),Xf=n.n(Yf),Jf=function(){var e=(0,o.Z)(d().mark((function e(t){var n,r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"https://api.odos.xyz/sor/quote/v2",e.next=3,Xf().post("https://api.odos.xyz/sor/quote/v2",t,{headers:{Accept:"application/json","Content-Type":"application/json"}});case 3:if(200!==(n=e.sent).status){e.next=11;break}return e.next=7,n.data;case 7:return r=e.sent,e.abrupt("return",r);case 11:400===n.status?console.log(n):console.error("Error in Quote:",n);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Qf=function(){var e=(0,o.Z)(d().mark((function e(t){var n,r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"https://api.odos.xyz/sor/assemble",e.next=3,Xf().post("https://api.odos.xyz/sor/assemble",t,{headers:{Accept:"application/json","Content-Type":"application/json"}});case 3:if(200!==(n=e.sent).status){e.next=11;break}return e.next=7,n.data;case 7:return r=e.sent,e.abrupt("return",r);case 11:console.error("Error in Quote:",n);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ep=n(91747);function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function np(e){for(var t=1;tnew qf(i,r)));ec.useEffect((()=>{o.setOptions(r)}),[o,r]);const s=(0,Wf.$)(ec.useCallback((e=>o.subscribe(w.V.batchCalls(e))),[o]),(()=>o.getCurrentResult()),(()=>o.getCurrentResult())),a=ec.useCallback(((e,t)=>{o.mutate(e,t).catch(Kf)}),[o]);if(s.error&&(0,$f.L)(o.options.useErrorBoundary,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}({mutationFn:function(){var e=(0,o.Z)(d().mark((function e(t){var n,r,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=rp(t),i=np(np({},r.data),{},{gasLimit:ep.O$.from("500000"),gasPrice:void 0,value:ep.O$.from((null===(n=r.data)||void 0===n?void 0:n.transaction.value)||"0")}),e.abrupt("return",i);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()})};function op(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sp(e){for(var t=1;tNumber(l)?i("-1"):i(e.target.value))},inputProps:{"aria-label":"amount input",style:{fontSize:"21px",lineHeight:"28,01px",padding:0,height:"28px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},inputComponent:_p}),""!==r&&!a&&(0,hc.jsx)(Ed.Z,{sx:{minWidth:0,p:0,left:8,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},onClick:function(){i&&i("")},disabled:o,children:(0,hc.jsx)(lp.Z,{height:16})}),(0,hc.jsxs)(fc.Z,{disableRipple:!0,onClick:function(){w(x.current)},"data-cy":"assetSelect",sx:{p:0,"&:hover":{backgroundColor:"transparent"}},endIcon:A?(0,hc.jsx)(fp,{}):(0,hc.jsx)(pp,{}),children:[(0,hc.jsx)(vp.UD,{symbol:h.symbol,logoURI:h.logoURI,sx:{mr:2,ml:3}}),(0,hc.jsx)(dc.Z,{"data-cy":"assetsSelectedOption_".concat(h.symbol.toUpperCase()),variant:"main16",color:"text.primary",children:h.symbol}),(null===(t=h.extensions)||void 0===t?void 0:t.isUserCustom)&&(0,hc.jsx)(lc.Z,{sx:{fontSize:14,ml:1},color:"warning",children:(0,hc.jsx)(up.Z,{})})]}),(0,hc.jsxs)(gp.Z,{anchorEl:v,open:A,onClose:E,PaperProps:{sx:{width:null===(n=x.current)||void 0===n?void 0:n.offsetWidth,border:"dark"===m.palette.mode?"1px solid #EBEBED1F":"unset",boxShadow:"0px 2px 10px 0px #0000001A",overflow:"hidden"}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[(0,hc.jsxs)(uc.Z,{sx:{p:2,px:3,borderBottom:"1px solid ".concat(m.palette.divider),top:0,zIndex:2},children:[(0,hc.jsx)(wp.M,{onSearchTermChange:function(e){var t=e.trim().toLowerCase(),n=u.filter((function(e){return e.symbol.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.address.toLowerCase()===t}));0===n.length&&(0,Uc.isAddress)(e)?I(!0):T(n)},placeholder:"Search name or paste address"}),(0,hc.jsx)(uc.Z,{sx:{display:"flex",justifyContent:"flex-start",overfloyY:"auto",alignItems:"flex-start",flexWrap:"wrap",mt:2,gap:2},children:O.map((function(e){return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"row",alignItems:"center",p:1,borderRadius:"16px",border:"1px solid",borderColor:m.palette.divider,cursor:"pointer","&:hover":{backgroundColor:m.palette.divider}},onClick:function(){return g(e)},children:[(0,hc.jsx)(vp.UD,{logoURI:e.logoURI,symbol:e.symbol,sx:{width:24,height:24,mr:1}}),(0,hc.jsx)(dc.Z,{variant:"main14",color:"text.primary",sx:{mr:1},children:e.symbol})]},e.symbol)}))})]}),(0,hc.jsx)(uc.Z,{sx:{overflow:"auto",maxHeight:"200px"},children:C?(0,hc.jsx)(uc.Z,{sx:{maxHeight:"178px",overflowY:"auto",display:"flex",flexDirection:"column",minHeight:"60px"},children:(0,hc.jsx)(_c.Z,{sx:{mx:"auto",my:"auto"}})}):k.length>0?k.map((function(e){var t;return(0,hc.jsxs)(Fd.Z,{value:e.symbol,"data-cy":"assetsSelectOption_".concat(e.symbol.toUpperCase()),sx:{backgroundColor:m.palette.background.paper},onClick:function(){return g(e)},children:[(0,hc.jsx)(vp.UD,{symbol:e.symbol,logoURI:e.logoURI,sx:{mr:2}}),(0,hc.jsx)(yp.Z,{sx:{flexGrow:0},children:e.symbol}),(null===(t=e.extensions)||void 0===t?void 0:t.isUserCustom)&&(0,hc.jsx)(lc.Z,{sx:{fontSize:14,ml:1},color:"warning",children:(0,hc.jsx)(up.Z,{})}),e.balance&&(0,hc.jsx)(kd.B,{sx:{ml:"auto"},value:e.balance,compact:!0})]},e.symbol)})):(0,hc.jsx)(dc.Z,{variant:"main14",color:"text.primary",sx:{width:"auto",textAlign:"center",m:4},children:(0,hc.jsx)(sc.cC,{id:"No results found. You can import a custom token with a contract address"})})})]})]}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",height:"16px"},children:[(0,hc.jsx)(uc.Z,{sx:{flex:1}}),h.balance&&i&&(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsxs)(dc.Z,{component:"div",variant:"secondary12",color:"text.secondary",children:[(0,hc.jsx)(sc.cC,{id:"Balance"}),(0,hc.jsx)(kd.B,{value:h.balance,compact:!0,variant:"secondary12",color:"text.secondary",symbolsColor:"text.disabled",sx:{ml:1}})]}),!a&&(0,hc.jsx)(fc.Z,{size:"small",sx:{minWidth:0,ml:"7px",p:0},onClick:function(){i("-1")},disabled:o||d,children:(0,hc.jsx)(sc.cC,{id:"Max"})})]})]})]})},Tp=function(e){var t=e.error;return(0,hc.jsx)(Sd.v,{severity:"error",icon:!1,sx:{mt:4},children:(0,hc.jsx)(dc.Z,{variant:"caption",children:t instanceof Error?"".concat(t.message):"There was an issue fetching data from Paraswap"})})},Sp=function(e){var t=e.ratesError,n=e.balance,r=e.inputAmount;return t?(0,hc.jsx)(Tp,{error:t}):Number(r)>Number(n)?(0,hc.jsx)(Sd.v,{severity:"error",sx:{mt:4},icon:!1,children:(0,hc.jsx)(dc.Z,{variant:"caption",children:(0,hc.jsx)(sc.cC,{id:"Your balance is lower than the selected amount."})})}):null},Cp=n(58364),Ip=n(83187),Op=n(41528),Rp=function(e){var t=e.rates,n=e.srcToken,r=e.destToken,i=(0,ec.useState)(!1),o=i[0],s=i[1],a=(0,ec.useMemo)((function(){var e=(0,xd.pV)(t.inAmounts[0],n.decimals),i=(0,xd.pV)(t.outAmounts[0],r.decimals);return o?e.div(i):i.div(e)}),[o,t.srcAmount,t.destAmount]),c=(0,ec.useMemo)((function(){var e=(0,xd.hE)(t.srcUSD);return(0,xd.hE)(t.destUSD).minus(e).div(e)}),[t.srcUSD,t.destUSD]);return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",mt:6},children:[(0,hc.jsx)(kd.B,{visibleDecimals:0,variant:"main12",symbol:o?r.symbol:n.symbol,symbolsVariant:"secondary12",symbolsColor:"text.secondary",value:"1"}),(0,hc.jsx)(Ip.Z,{onClick:function(){return s((function(e){return!e}))},disableTouchRipple:!0,sx:{mx:1},children:(0,hc.jsx)(lc.Z,{sx:{fontSize:"12px"},children:(0,hc.jsx)(Cp.Z,{})})}),(0,hc.jsx)(kd.B,{variant:"main12",symbol:o?n.symbol:r.symbol,symbolsVariant:"secondary12",symbolsColor:"text.secondary",value:a.toString(),visibleDecimals:3}),(0,hc.jsx)(Op.y,{title:(0,hc.jsx)(dc.Z,{variant:"caption",children:(0,hc.jsx)(sc.cC,{id:"Price impact"})}),children:(0,hc.jsxs)(uc.Z,{sx:{display:"flex",cursor:"pointer"},children:[(0,hc.jsx)(dc.Z,{variant:"caption",children:"("}),(0,hc.jsx)(kd.B,{variant:"caption",value:c.toString(),percent:!0}),(0,hc.jsx)(dc.Z,{variant:"caption",children:")"})]})})]})},Dp=n(22659),Pp=n(85390),Bp=n(87054),Mp=["0.001","0.005","0.01"],Np=function(e){var t=e.slippage,n=e.setSlippage,r=(0,ec.useState)(),i=r[0],o=r[1],s=Boolean(i);return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,hc.jsxs)(dc.Z,{variant:"caption",color:"text.secondary",children:[(0,hc.jsx)(sc.cC,{id:"Slippage"}),(0,hc.jsxs)(gp.Z,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:i,id:"switch-slippage-selector",MenuListProps:{"aria-labelledby":"switch-slippage-selector-button",sx:{py:3,px:4}},open:s,onClose:function(){o(null)},children:[(0,hc.jsx)(dc.Z,{variant:"subheader2",mb:5,children:(0,hc.jsx)(sc.cC,{id:"Max slippage"})}),(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:(0,hc.jsx)(Pp.Z,{sx:{backgroundColor:"background.surface",borderRadius:"6px",p:"2px"},exclusive:!0,onChange:function(e,t){return n(t)},children:Mp.map((function(e){return(0,hc.jsx)(Bp.Z,{sx:{borderRadius:1,py:1,px:2,borderColor:"transparent",backgroundColor:e===t?"background.paper":"transparent"},value:e,children:(0,hc.jsx)(kd.B,{value:e,percent:!0,variant:"subheader2",color:"primary.main",symbolsColor:"primary.main"})},e)}))})})]})]}),(0,hc.jsx)(kd.B,{variant:"caption",color:"text.primary",value:t,visibleDecimals:2,percent:!0}),(0,hc.jsx)(fc.Z,{id:"switch-slippage-selector-button",sx:{padding:0,minWidth:0},onClick:function(e){o(e.currentTarget)},"aria-controls":"switch-slippage-selector",children:(0,hc.jsx)(lc.Z,{sx:{fontSize:"16px"},children:(0,hc.jsx)(Dp.Z,{})})})]})};var Fp=ec.forwardRef((function(e,t){return ec.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),ec.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 5l7 7m0 0l-7 7m7-7H3"}))})),Lp=n(56365),jp=n(58057),Up=n(68346),Zp=function(){return(0,hc.jsx)(lc.Z,{sx:{ml:"2px",fontSize:"11px"},children:(0,hc.jsx)(Lp.Z,{})})},Hp=function(e){var t=e.explorer,n=e.txHash,r=e.children,i=e.hideTx,o=(0,dd.vR)(),s=o.close,a=o.mainTxState;return(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,hc.jsx)(uc.Z,{sx:{width:"48px",height:"48px",bgcolor:"success.200",borderRadius:"50%",mt:14,mx:"auto",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,hc.jsx)(lc.Z,{sx:{color:"success.main",fontSize:"32px"},children:(0,hc.jsx)(jp.Z,{})})}),(0,hc.jsx)(dc.Z,{sx:{mt:4},variant:"h2",children:(0,hc.jsx)(sc.cC,{id:"All done!"})}),r]}),!i&&(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,hc.jsxs)(Up.Z,{variant:"helperText",href:"".concat(t).concat(n||a.txHash),sx:{display:"inline-flex",alignItems:"center",justifyContent:"right",mt:6,mb:3},underline:"hover",target:"_blank",rel:"noreferrer noopener",children:[(0,hc.jsx)(sc.cC,{id:"Review tx details"}),(0,hc.jsx)(Zp,{})]}),(0,hc.jsx)(fc.Z,{onClick:s,variant:"contained",size:"large",sx:{minHeight:"44px"},"data-cy":"closeButton",children:(0,hc.jsx)(sc.cC,{id:"Ok, Close"})})]})]})},zp=function(e){var t=e.txHash,n=e.amount,r=e.symbol,i=e.iconSymbol,o=e.outAmount,s=e.outSymbol,a=e.outIconSymbol,c=e.iconUri,u=e.outIconUri;return(0,hc.jsx)(Hp,{explorer:"",txHash:t,children:(0,hc.jsxs)(uc.Z,{sx:{mt:2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"},children:[(0,hc.jsx)(dc.Z,{children:(0,hc.jsx)(sc.cC,{id:"You've successfully switched tokens."})}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",gap:2,mt:3},children:[(0,hc.jsx)(vp.UD,{sx:{fontSize:"20px"},logoURI:c,symbol:i}),(0,hc.jsx)(kd.B,{value:Number(n),compact:!0,variant:"main14"}),(0,hc.jsx)(dc.Z,{variant:"secondary14",children:r}),(0,hc.jsx)(lc.Z,{sx:{fontSize:"14px"},children:(0,hc.jsx)(Fp,{fontSize:"14px"})}),(0,hc.jsx)(vp.UD,{sx:{fontSize:"20px"},logoURI:u,symbol:a}),(0,hc.jsx)(kd.B,{value:Number(o),variant:"main14"}),(0,hc.jsx)(dc.Z,{variant:"secondary14",children:s})]})]})})},Gp=function(e){var t,n,r,i=e.supportedNetworks,o=e.selectedChainId,s=e.setSelectedChainId,a=e.defaultInputToken,c=e.defaultOutputToken,u=e.tokens,l=e.addNewToken,d=(0,ec.useState)("0.001"),f=d[0],p=d[1],h=(0,ec.useState)(""),m=h[0],g=h[1],y=(0,ec.useState)(""),b=y[0],v=y[1],w=(0,dd.vR)(),x=w.mainTxState,A=w.gasLimit,E=w.txError,_=w.setTxError,k=(0,bc.Yh)((function(e){return e.account})),T=(0,oc.Mo)(o),S=(0,ec.useState)(a),C=S[0],I=S[1],O=(0,ec.useState)(c),R=O[0],D=O[1],P=(0,ic.Z)().readOnlyModeAddress,B=(0,Cd.Q)(o),M=(0,ec.useMemo)((function(){return(0,_d.debounce)((function(e){v(e)}),300)}),[v]),N=function(e){var t=e.inputTokens;return(0,Sc.a)({queryFn:function(){return Jf(e)},queryKey:cd.Bd.odosswapQuote(e),enabled:0===t.filter((function(e){return"0"===e.amount})).length,retry:0})}({chainId:null!==(t=T.underlyingChainId)&&void 0!==t?t:o,inputTokens:[{tokenAddress:C.address,amount:""===b?"0":(0,xd.pV)(b,-1*C.decimals).toFixed(0)}],outputTokens:[{tokenAddress:R.address,proportion:1}],userAddr:k,slippageLimitPercent:Number(f)}),F=N.data,L=N.error,j=N.isFetching;if(F&&x.success)return(0,hc.jsx)(zp,{txHash:x.txHash,amount:b,symbol:C.symbol,iconSymbol:C.symbol,iconUri:C.logoURI,outSymbol:R.symbol,outIconSymbol:R.symbol,outIconUri:R.logoURI,outAmount:(Number((0,xd.Fv)(F.outAmounts[0],R.decimals))*(1-Number(f))).toString()});return(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Od.E,{title:"Swap Tokens"}),B.isWrongNetwork&&!P&&(0,hc.jsx)(Rd.I,{networkName:T.name,chainId:o,event:{eventName:wc.vh.SWITCH_NETWORK}}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,hc.jsx)(Zd,{networks:i,selectedNetwork:o,setSelectedNetwork:function(e){_(void 0),s(e)}}),(0,hc.jsx)(Np,{slippage:f,setSlippage:p})]}),C&&R?(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",gap:"15px",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative"},children:[(0,hc.jsx)(kp,{chainId:o,assets:u.filter((function(e){return e.address!==R.address})),value:m,onChange:function(e){_(void 0),"-1"===e?(g(C.balance),M(C.balance)):(g(e),M(e))},onSelect:function(e){u.find((function(t){return t.address===e.address}))?(I(e),_(void 0)):l(e).then((function(){I(e),_(void 0)}))},selectedAsset:C}),(0,hc.jsx)(Ed.Z,{onClick:function(){var e=C,t=R,n=F?(0,xd.pV)(F.outAmounts[0],R.decimals).toString():"0";I(t),D(e),g(n),v(n),_(void 0)},sx:{border:"1px solid",borderColor:"divider",position:"absolute",backgroundColor:"background.paper"},children:(0,hc.jsx)(lc.Z,{sx:{color:"primary.main",fontSize:"18px"},children:(0,hc.jsx)(Ad,{})})}),(0,hc.jsx)(kp,{chainId:o,assets:u.filter((function(e){return e.address!==C.address})),value:F?(0,xd.pV)(F.outAmounts[0],R.decimals).toString():"0",loading:"0"!==b&&""!==b&&j&&!L,onSelect:function(e){u.find((function(t){return t.address===e.address}))?(D(e),_(void 0)):l(e).then((function(){D(e),_(void 0)}))},disableInput:!0,selectedAsset:R})]}),F&&(0,hc.jsx)(hc.Fragment,{children:(0,hc.jsx)(Rp,{rates:F,srcToken:C,destToken:R})}),F&&k&&(0,hc.jsxs)(Id.m6,{gasLimit:A,chainId:o,children:[(0,hc.jsx)(Td.X,{caption:(0,hc.jsx)(sc.cC,{id:"Minimum {0} received",values:{0:R.symbol}}),captionVariant:"caption",children:(0,hc.jsx)(kd.B,{compact:!1,roundDown:!0,variant:"caption",value:Number((0,xd.Fv)(F.outAmounts[0],R.decimals))*(1-Number(f))})}),(0,hc.jsx)(Td.X,{sx:{mt:1},caption:(0,hc.jsx)(sc.cC,{id:"Minimum USD value received"}),captionVariant:"caption"})]}),k?(0,hc.jsxs)(hc.Fragment,{children:[((null===(n=C.extensions)||void 0===n?void 0:n.isUserCustom)||(null===(r=R.extensions)||void 0===r?void 0:r.isUserCustom))&&(0,hc.jsx)(Sd.v,{severity:"warning",icon:!1,sx:{mt:2,mb:2},children:(0,hc.jsx)(dc.Z,{variant:"caption",children:"You have selected a custom imported token."})}),(0,hc.jsx)(Sp,{ratesError:L,balance:C.balance,inputAmount:b}),E&&(0,hc.jsx)(Pd,{txError:E}),(0,hc.jsx)(ap,{isWrongNetwork:B.isWrongNetwork,inputAmount:b,inputToken:C,outputToken:R,slippage:f,blocked:!F||Number(b)>Number(C.balance)||!k,chainId:o,route:F})]}):(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:4,alignItems:"center"},children:[(0,hc.jsx)(dc.Z,{sx:{mb:6,textAlign:"center"},color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Please connect your wallet to be able to switch your tokens."})}),(0,hc.jsx)(kc.p,{})]})]}):(0,hc.jsx)(_c.Z,{})]})};function Vp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wp(e){for(var t=1;t0,queryFn:function(){var r=(0,o.Z)(d().mark((function r(){var i,o,a,c,u,l,f,p,h,m,g;return d().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=(0,oc.VH)(t),o=e.filter((function(e){var t;return!(null!==(t=e.extensions)&&void 0!==t&&t.isNative)})),a=e.find((function(e){var t;return null===(t=e.extensions)||void 0===t?void 0:t.isNative})),c=new sd({ethersProvider:i,tryAggregate:!0,multicallCustomContractAddress:ad.R[t]}),u=o.map((function(e){return{reference:e.address,contractAddress:e.address,abi:[{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"balance",type:"uint256"}]}],calls:[{reference:"balanceOfCall",methodName:"balanceOf",methodParameters:[n]}]}})),a){r.next=12;break}return r.next=8,c.call(u);case 8:return l=r.sent,f=l.results,console.log(f),r.abrupt("return",e.map((function(e,t){return ld(ld({},e),{},{balance:(0,Tc.formatUnits)(f[t].callsReturnContext[0].returnValues[0],e.decimals)})})).sort((function(e,t){return Number(t.balance)-Number(e.balance)})));case 12:return r.next=14,Promise.all([i.getBalance(n),c.call(u)]);case 14:return p=r.sent,h=(0,s.Z)(p,2),m=h[0],g=h[1],r.abrupt("return",e.map((function(e){var t;return ld(ld({},e),{},{balance:null!==(t=e.extensions)&&void 0!==t&&t.isNative?(0,Tc.formatUnits)(m,e.decimals):(0,Tc.formatUnits)(g.results[e.address].callsReturnContext[0].returnValues[0],e.decimals)})})).sort((function(e,t){return Number(t.balance)-Number(e.balance)})));case 19:case"end":return r.stop()}}),r)})));return function(){return r.apply(this,arguments)}}()})}(i,n,t),u=c.data,l=(0,ec.useMemo)((function(){if(u){var e=u.find((function(e){var t;return null===(t=e.extensions)||void 0===t?void 0:t.isNative}))||u[0],t=u.find((function(t){return"ZERO"==t.symbol&&t.address!==e.address}))||u.find((function(t){return t.address!==e.address}));return(0,yd.Z)(e&&t,"token list should have at least 2 assets"),{defaultInputToken:e,defaultOutputToken:t}}return{defaultInputToken:i[0],defaultOutputToken:i[1]}}),[u,i]),f=l.defaultInputToken,p=l.defaultOutputToken,h=(0,D.NL)(),m=function(){var e=(0,o.Z)(d().mark((function e(r){var o,s,c;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.setQueryData(cd.Bd.tokensBalance(i,n,t),(function(e){return e?[].concat((0,a.Z)(e),[r]).sort((function(e,t){return Number(t.balance)-Number(e.balance)})):[r]})),o=localStorage.getItem("customTokens"),s={address:r.address,symbol:r.symbol,decimals:r.decimals,chainId:r.chainId,name:r.name,logoURI:r.logoURI,extensions:{isUserCustom:!0}},o?((c=JSON.parse(o)).push(s),localStorage.setItem("customTokens",JSON.stringify(c))):localStorage.setItem("customTokens",JSON.stringify([s]));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return u?(0,hc.jsx)(Gp,{selectedChainId:n,setSelectedChainId:r,supportedNetworks:wd,defaultInputToken:f,defaultOutputToken:p,tokens:u,addNewToken:m},n):(0,hc.jsx)(uc.Z,{sx:{width:"100%",display:"flex",justifyContent:"center",my:"60px"},children:(0,hc.jsx)(_c.Z,{})})},Kp=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args.chainId,i=(0,bc.Yh)((function(e){return e.currentChainId})),o=(0,ic.Z)().chainId,s=(0,bc.Yh)((function(e){return e.account})),a=(0,ec.useState)((function(){return wd.find((function(e){return e.chainId===i}))?i:qp.chainId})),c=a[0],u=a[1];return(0,ec.useEffect)((function(){if(r&&wd.find((function(e){return e.chainId===r})))u(r);else if(o&&wd.find((function(e){return e.chainId===o}))){var e=wd.find((function(e){return e.underlyingChainId===o}));u(e?e.chainId:o)}else wd.find((function(e){return e.chainId===i}))?u(i):u(qp.chainId)}),[i,r,o]),(0,hc.jsx)(pc.P,{open:t===dd.w8.Switch,setOpen:n,children:s?(0,hc.jsx)($p,{user:s,chainId:c,setSelectedChainId:u}):(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:4,alignItems:"center"},children:[(0,hc.jsx)(dc.Z,{sx:{mb:6,textAlign:"center"},color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Please connect your wallet to be able to switch your tokens."})}),(0,hc.jsx)(kc.p,{})]})})},Yp=n(23286),Xp=n(46930),Jp=n(94635),Qp=n(82403),eh=n(20854),th=n(10766),nh=n(34637),rh=n(59379),ih=n(34220),oh=n(43629),sh=n(59286),ah=n(87385),ch=n(81902),uh=n(53601),lh=n(93608),dh=n(19419);function fh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ph(e){for(var t=1;t {symbol}",values:{action:n,symbol:i},components:{0:(0,hc.jsx)(kd.B,{value:Number(r),compact:!0,variant:"secondary14"})}})})}),(0,hc.jsx)(fc.Z,{sx:{mt:4},variant:"outlined",size:"small",endIcon:(0,hc.jsx)(Ih,{style:{fontSize:12}}),onClick:function(){return a(wc.Sd.GHO_BORROW_VIEW_TX_DETAILS)},href:s.explorerLinkBuilder({tx:t||o.txHash}),target:"_blank",children:(0,hc.jsx)(dc.Z,{variant:"buttonS",children:(0,hc.jsx)(sc.cC,{id:"Review tx details"})})})]})})};function Rh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dh(e){for(var t=1;t0,O=y(_),R=(0,sh.BC)(f),D=_===(R=Math.min(Number(R),h.aaveFacilitatorRemainingCapacity).toFixed(10)),P=(0,xd.hE)(_).multipliedBy(r.formattedPriceInMarketReferenceCurrency).multipliedBy(p).shiftedBy(-Qp.$3),B=(0,eh.L1)({collateralBalanceMarketReferenceCurrency:f.totalCollateralUSD,borrowBalanceMarketReferenceCurrency:(0,xd.hE)(f.totalBorrowsUSD).plus(P),currentLiquidationThreshold:f.currentLiquidationThreshold}),M=B.toNumber()<1.5&&"-1"!==B.toString(),N=(0,xd.hE)(_).multipliedBy(r.priceInUSD),F=m.userGhoBorrowBalance>=h.ghoMinDebtTokenBalanceForDiscount?m.userGhoAvailableToBorrowAtDiscount:0,L=(0,kh.li)(h.ghoVariableBorrowAPY,m.userGhoBorrowBalance,F,h.ghoBorrowAPYWithMaxDiscount),j=m.userGhoBorrowBalance+Number(_)>=h.ghoMinDebtTokenBalanceForDiscount?m.userGhoAvailableToBorrowAtDiscount:0,U=(0,kh.li)(h.ghoVariableBorrowAPY,m.userGhoBorrowBalance+Number(_),j,h.ghoBorrowAPYWithMaxDiscount),Z=void 0;x!==zd.tk.Stable||r.stableBorrowRateEnabled?x===zd.tk.Stable&&null!==i&&void 0!==i&&i.usageAsCollateralEnabledOnUser&&(0,xd.hE)(_).lt((null===i||void 0===i?void 0:i.underlyingBalance)||0)?Z=Ch.NOT_ENOUGH_BORROWED:r.borrowingEnabled||(Z=Ch.BORROWING_NOT_AVAILABLE):Z=Ch.STABLE_RATE_NOT_ENABLED;var H=function(){switch(Z){case Ch.BORROWING_NOT_AVAILABLE:return(0,hc.jsx)(sc.cC,{id:"Borrowing is currently unavailable for {0}.",values:{0:r.symbol}});case Ch.NOT_ENOUGH_BORROWED:return(0,hc.jsx)(sc.cC,{id:"You can borrow this asset with a stable rate only if you borrow more than the amount you are supplying as collateral."});case Ch.STABLE_RATE_NOT_ENABLED:return(0,hc.jsx)(sc.cC,{id:"The Stable Rate is not enabled for this currency"});default:return(0,hc.jsx)(hc.Fragment,{})}},z=r.iconSymbol;return a.success?(0,hc.jsx)(Oh,{action:(0,hc.jsx)(sc.cC,{id:"Minted"}),amount:_,symbol:z}):(0,hc.jsxs)(hc.Fragment,{children:[b.determineWarningDisplay({borrowCap:b}),r.stableBorrowRateEnabled&&(0,hc.jsx)(Ph,{interestRateMode:x,setInterestRateMode:A,variableRate:r.variableBorrowAPY,stableRate:r.stableBorrowAPY}),(0,hc.jsxs)(dc.Z,{sx:{mb:2},children:["You are going to mint ONEZ. Minted ONEZ needs to be repaid back with interest to release your locked collateral. To learn more about how ONEZ works, visit our"," ",(0,hc.jsx)("a",{href:"https://docs.zerolend.xyz/onez",target:"_blank",rel:"noreferrer",children:"documentation"}),"."]}),(0,hc.jsx)(uh.W,{value:_,onChange:function(e){if("-1"===e)k(R);else{var t=(0,ah.$w)(e,r.decimals);k(t)}},usdValue:N.toString(10),assets:[{balance:R,symbol:o,iconSymbol:z}],symbol:o,capType:ch.R.borrowCap,isMaxSelected:D,maxValue:R,balanceText:(0,hc.jsx)(sc.cC,{id:"Available"})}),void 0!==Z&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(H,{})}),(0,hc.jsxs)(Id.m6,{gasLimit:c,children:[(0,hc.jsx)(Id.jz,{visibleHfChange:!!_,healthFactor:f.healthFactor,futureHealthFactor:B.toString(10)}),(0,hc.jsx)(Td.X,{caption:(0,hc.jsx)(uc.Z,{children:(0,hc.jsx)(Ah.n,{text:(0,hc.jsx)(sc.cC,{id:"APY, fixed rate"}),variant:"subheader2",color:"text.secondary"})}),captionVariant:"description",mb:4,align:"flex-start",children:(0,hc.jsx)(uc.Z,{sx:{textAlign:"right"},children:(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:(0,hc.jsx)(Mh,{ghoLoadingData:g,hasGhoBorrowPositions:I,borrowAmount:_,discountAvailable:O,userDiscountTokenBalance:m.userDiscountTokenBalance,underlyingAsset:t,customMarket:v,currentBorrowAPY:L,futureBorrowAPY:U,onDetailsClick:function(){return l()}})})})})]}),u&&(0,hc.jsx)(Dd.Q,{txError:u}),M&&(0,hc.jsx)(yh,{riskCheckboxAccepted:S,onRiskCheckboxChange:function(){C(!S)}}),(0,hc.jsx)(mh,{poolReserve:r,amountToBorrow:_,poolAddress:r.underlyingAsset,interestRateMode:x,isWrongNetwork:n,symbol:o,blocked:void 0!==Z||M&&!S,sx:M?{mt:0}:{}})]})},Mh=function(e){var t=e.ghoLoadingData,n=e.hasGhoBorrowPositions,r=e.borrowAmount,i=e.discountAvailable,o=e.userDiscountTokenBalance,s=e.underlyingAsset,a=e.customMarket,c=e.currentBorrowAPY,u=e.futureBorrowAPY,l=e.onDetailsClick;if(t||!n&&""===r&&i)return(0,hc.jsx)(_h.J,{variant:"secondary14",color:"text.secondary"});var d={stkAaveBalance:o||0,ghoRoute:Eh.Z6.reserveOverview(s,a)+"/#discount",userQualifiesForDiscount:i,"data-cy":"apyType"};return n||""===r?n&&""===r?(0,hc.jsx)(xh.B,Dh({withTokenIcon:i,value:c,onMoreDetailsClick:l},d)):i?i?(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(xh.B,Dh({withTokenIcon:!0,value:c,onMoreDetailsClick:l},d)),!!r&&(0,hc.jsxs)(hc.Fragment,{children:[n&&(0,hc.jsx)(lc.Z,{color:"primary",sx:{fontSize:"14px",mx:1},children:(0,hc.jsx)(wh.Z,{})}),(0,hc.jsx)(xh.B,Dh({value:t?-1:u},d))]})]}):(0,hc.jsx)(_h.J,{variant:"secondary14",color:"text.secondary"}):(0,hc.jsx)(xh.B,Dh({value:c,onMoreDetailsClick:l},d)):(0,hc.jsx)(xh.B,Dh({withTokenIcon:i,value:u},d))};function Nh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fh(e){for(var t=1;t0)if(l.chainId===zd.a_.mainnet){var h=a.find((function(e){return"AAVE"===e.symbol}));p=h?Number(h.priceInUSD):0}else a.forEach((function(e){e.isWrappedBaseAsset&&(p=Number(e.priceInUSD))}));else p=Number(d.rewardPriceFeed);var m=Number(f)*p;m>0&&(d.assets.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),e.push({assets:d.assets,incentiveControllerAddress:d.incentiveControllerAddress,symbol:d.rewardTokenSymbol,balance:f,balanceUsd:m.toString(),rewardTokenAddress:c}),t+=Number(m))}})),1===e.length)v(e[0].symbol);else if(e.length>1&&!I){var r={assets:n,incentiveControllerAddress:e[0].incentiveControllerAddress,symbol:"all",balance:"0",balanceUsd:t.toString(),rewardTokenAddress:""};v("all"),k(r)}A(e),g(t.toString())}),[]);var S=void 0;"0"===m&&(S=Wh.NOT_ENOUGH_BALANCE);var C=u!==f,I="all"===b?_:x.find((function(e){return e.symbol===b}));return r&&r.blocking?(0,hc.jsx)(jh.D,{txError:r}):n.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"Claimed"}),amount:null===I||void 0===I?void 0:I.balanceUsd}):(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Od.E,{title:"Claim rewards"}),C&&!p&&(0,hc.jsx)(Rd.I,{networkName:T.name,chainId:u}),void 0!==S&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:S===Wh.NOT_ENOUGH_BALANCE?(0,hc.jsx)(sc.cC,{id:"Your reward balance is 0"}):null}),x.length>1&&(0,hc.jsx)(Jh,{rewards:x,selectedReward:b,setSelectedReward:v}),I&&(0,hc.jsxs)(Id.m6,{gasLimit:t,children:["all"===b&&(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Td.X,{caption:(0,hc.jsx)(sc.cC,{id:"Balance"}),captionVariant:"description",align:"flex-start",mb:"all"!==I.symbol?0:4,children:(0,hc.jsx)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:x.map((function(e){return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",mb:4},children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,hc.jsx)(vp.T1,{symbol:e.symbol,sx:{mr:1,fontSize:"16px"}}),(0,hc.jsx)(kd.B,{value:Number(e.balance),variant:"secondary14"}),(0,hc.jsx)(dc.Z,{ml:1,variant:"secondary14",children:e.symbol})]}),(0,hc.jsx)(kd.B,{value:Number(e.balanceUsd),variant:"helperText",compact:!0,symbol:"USD",color:"text.secondary"})]},"claim-".concat(e.symbol))}))})}),(0,hc.jsx)(Id.oD,{description:(0,hc.jsx)(sc.cC,{id:"Total worth"}),value:m})]}),"all"!==b&&(0,hc.jsx)(Id.XJ,{symbol:(0,hc.jsx)(vp.T1,{symbol:I.symbol}),futureValue:I.balance,futureValueUSD:I.balanceUsd,description:(0,hc.jsx)(sc.cC,{id:"{0} Balance",values:{0:I.symbol}})})]}),r&&(0,hc.jsx)(Dd.Q,{txError:r}),(0,hc.jsx)(Kh,{isWrongNetwork:C,selectedReward:null!==I&&void 0!==I?I:{},blocked:void 0!==S})]})},tm=function(){var e=(0,dd.vR)(),t=e.type,n=e.close;return(0,hc.jsx)(pc.P,{open:t===dd.w8.ClaimRewards,setOpen:n,children:(0,hc.jsx)(em,{})})},nm=n(18384),rm=function(e){var t=e.poolReserve,n=e.isWrongNetwork,r=e.usageAsCollateral,i=e.blocked,s=e.symbol,a=(0,bc.Yh)((function(e){return e.setUsageAsCollateral})),c=(0,Vd.Q)({tryPermit:!1,protocolAction:zd.UQ.setUsageAsCollateral,eventTxInfo:{assetName:t.name,asset:t.underlyingAsset,previousState:(!r).toString(),newState:r.toString()},handleGetTxns:function(){var e=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a({reserve:t.underlyingAsset,usageAsCollateral:r}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),skip:i}),u=c.action,l=c.loadingTxns,f=c.mainTxState,p=c.requiresApproval;return(0,hc.jsx)(Gf.B,{requiresApproval:p,blocked:i,preparingTransactions:l,mainTxState:f,isWrongNetwork:n,actionText:r?(0,hc.jsx)(sc.cC,{id:"Enable {symbol} as collateral",values:{symbol:s}}):(0,hc.jsx)(sc.cC,{id:"Disable {symbol} as collateral",values:{symbol:s}}),actionInProgressText:(0,hc.jsx)(sc.cC,{id:"Pending..."}),handleAction:u})};!function(e){e[e.DO_NOT_HAVE_SUPPLIES_IN_THIS_CURRENCY=0]="DO_NOT_HAVE_SUPPLIES_IN_THIS_CURRENCY",e[e.CAN_NOT_USE_THIS_CURRENCY_AS_COLLATERAL=1]="CAN_NOT_USE_THIS_CURRENCY_AS_COLLATERAL",e[e.CAN_NOT_SWITCH_USAGE_AS_COLLATERAL_MODE=2]="CAN_NOT_SWITCH_USAGE_AS_COLLATERAL_MODE",e[e.ZERO_LTV_WITHDRAW_BLOCKED=3]="ZERO_LTV_WITHDRAW_BLOCKED"}(Qh||(Qh={}));var im=function(e){var t=e.poolReserve,n=e.userReserve,r=e.isWrongNetwork,i=e.symbol,o=(0,dd.vR)(),s=o.gasLimit,a=o.mainTxState,c=o.txError,u=(0,ih.HT)().user,l=(0,oh.ov)().debtCeiling,d=!n.usageAsCollateralEnabledOnUser,f=(0,xd.hE)(u.totalCollateralMarketReferenceCurrency),p=!t.isIsolated&&d,h=!t.isIsolated&&!d,m=t.isIsolated&&d,g=t.isIsolated&&!d,y=f[d?"plus":"minus"](n.underlyingBalanceMarketReferenceCurrency),b=(0,eh.L1)({collateralBalanceMarketReferenceCurrency:y,borrowBalanceMarketReferenceCurrency:u.totalBorrowsMarketReferenceCurrency,currentLiquidationThreshold:u.currentLiquidationThreshold}),v=(0,Vf.Vc)(u),w=void 0;v.length>0&&!v.includes(t.symbol)?w=Qh.ZERO_LTV_WITHDRAW_BLOCKED:(0,xd.hE)(n.underlyingBalance).eq(0)?w=Qh.DO_NOT_HAVE_SUPPLIES_IN_THIS_CURRENCY:!n.usageAsCollateralEnabledOnUser&&"0"===t.reserveLiquidationThreshold||"0"===t.reserveLiquidationThreshold?w=Qh.CAN_NOT_USE_THIS_CURRENCY_AS_COLLATERAL:n.usageAsCollateralEnabledOnUser&&"0"!==u.totalBorrowsMarketReferenceCurrency&&b.lte("1")&&(w=Qh.CAN_NOT_SWITCH_USAGE_AS_COLLATERAL_MODE);var x=function(){switch(w){case Qh.DO_NOT_HAVE_SUPPLIES_IN_THIS_CURRENCY:return(0,hc.jsx)(sc.cC,{id:"You do not have supplies in this currency"});case Qh.CAN_NOT_USE_THIS_CURRENCY_AS_COLLATERAL:return(0,hc.jsx)(sc.cC,{id:"You can not use this currency as collateral"});case Qh.CAN_NOT_SWITCH_USAGE_AS_COLLATERAL_MODE:return(0,hc.jsx)(sc.cC,{id:"You can not switch usage as collateral mode for this currency, because it will cause collateral call"});case Qh.ZERO_LTV_WITHDRAW_BLOCKED:return(0,hc.jsx)(sc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:v}});default:return null}};return a.success?(0,hc.jsx)(lh.R,{collateral:d,symbol:t.symbol}):(0,hc.jsxs)(hc.Fragment,{children:[p&&(0,hc.jsx)(Sd.v,{severity:"warning",icon:!1,sx:{mb:3},children:(0,hc.jsx)(sc.cC,{id:"Enabling this asset as collateral increases your borrowing power and Health Factor. However, it can get liquidated if your health factor drops below 1."})}),h&&(0,hc.jsx)(Sd.v,{severity:"warning",icon:!1,sx:{mb:3},children:(0,hc.jsx)(sc.cC,{id:"Disabling this asset as collateral affects your borrowing power and Health Factor."})}),m&&(0,hc.jsx)(nm.i,{asset:t.symbol}),g&&(0,hc.jsx)(Sd.v,{severity:"info",icon:!1,sx:{mb:3},children:(0,hc.jsx)(sc.cC,{id:"You will exit isolation mode and other tokens can now be used as collateral"})}),t.isIsolated&&l.determineWarningDisplay({debtCeiling:l}),(0,hc.jsxs)(Id.m6,{gasLimit:s,children:[(0,hc.jsx)(Id.oD,{symbol:t.symbol,iconSymbol:t.iconSymbol,description:(0,hc.jsx)(sc.cC,{id:"Supply balance"}),value:n.underlyingBalance}),(0,hc.jsx)(Id.jz,{visibleHfChange:!0,healthFactor:u.healthFactor,futureHealthFactor:b.toString(10)})]}),void 0!==w&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(x,{})}),c&&(0,hc.jsx)(Dd.Q,{txError:c}),(0,hc.jsx)(rm,{symbol:i,poolReserve:t,usageAsCollateral:d,isWrongNetwork:r,blocked:void 0!==w})]})};function om(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var sm=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.CollateralChange,setOpen:n,children:(0,hc.jsx)(Jp.A,{title:(0,hc.jsx)(sc.cC,{id:"Review tx"}),underlyingAsset:r.underlyingAsset,children:function(e){return(0,hc.jsx)(im,function(e){for(var t=1;t{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${(0,gm.Z)(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})((({theme:e,ownerState:t})=>(0,dm.Z)({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},"primary"===t.color&&{color:(e.vars||e).palette.primary.main},"inherit"===t.color&&{color:"inherit"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.inset&&{paddingLeft:72},!t.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper})));var xm=ec.forwardRef((function(e,t){const n=(0,mm.Z)({props:e,name:"MuiListSubheader"}),{className:r,color:i="default",component:o="li",disableGutters:s=!1,disableSticky:a=!1,inset:c=!1}=n,u=(0,lm.Z)(n,vm),l=(0,dm.Z)({},n,{color:i,component:o,disableGutters:s,disableSticky:a,inset:c}),d=(e=>{const{classes:t,color:n,disableGutters:r,inset:i,disableSticky:o}=e,s={root:["root","default"!==n&&`color${(0,gm.Z)(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return(0,pm.Z)(s,bm,t)})(l);return(0,hc.jsx)(wm,(0,dm.Z)({as:o,className:(0,fm.default)(d.root,r),ref:t,ownerState:l},u))})),Am=n(70794),Em=n(91655),_m=n(58527),km=["loading","outputAmountUSD","inputAmountUSD"];function Tm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sm(e){for(var t=1;tSlippage tolerance <1>{selectedSlippage}% <2>{0}",values:{0:c?(0,hc.jsx)(Im.Z,{}):(0,hc.jsx)(Bd.Z,{}),selectedSlippage:n},components:{0:(0,hc.jsx)(dc.Z,{color:"text.secondary",variant:"description"}),1:(0,hc.jsx)(dc.Z,{color:"text.main",variant:"secondary14",sx:{px:"4px"}}),2:(0,hc.jsx)(lc.Z,{sx:{fontSize:"14px !important",mr:"4px"}})}})}),variant:"secondary14"}),disabled:!1,"data-cy":"slippageButton_".concat(n),sx:{mt:6}}),(0,hc.jsxs)(gp.Z,{anchorEl:o,open:c,onClose:l,MenuListProps:{"aria-labelledby":"basic-button"},keepMounted:!0,"data-cy":"slippageMenu_".concat(n),children:[(0,hc.jsx)(uc.Z,{sx:{px:"16px",py:"12px"},children:(0,hc.jsx)(dc.Z,{variant:"secondary12",color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Select slippage tolerance"})})}),["0.1","0.5","1"].map((function(e){var r=e===n;return(0,hc.jsxs)(Fd.Z,{selected:r,value:e,onClick:function(){t(e),u(wc.vh.SET_SLIPPAGE,{amount:e}),l()},children:[(0,hc.jsxs)(yp.Z,{primaryTypographyProps:{variant:"subheader1"},children:[e,"%"]}),(0,hc.jsx)(Rm.Z,{children:(0,hc.jsx)(lc.Z,{children:r&&(0,hc.jsx)(Om.Z,{})})})]},e)})),(0,hc.jsx)(Xh.Z,{}),(0,hc.jsxs)(uc.Z,{sx:{px:"16px",py:"12px",display:"inline-flex",alignItems:"center"},children:[(0,hc.jsxs)(dc.Z,{variant:"secondary12",color:"text.secondary",sx:{display:"flex",alignItems:"center"},children:[(0,hc.jsx)(sc.cC,{id:"Powered by"}),(0,hc.jsx)(lc.Z,{sx:{fontSize:"20px",width:"20px",color:"#2669F5",position:"relative",top:"5px",left:"5px"},children:(0,hc.jsx)(Lm,{})})]}),(0,hc.jsx)(dc.Z,{variant:"main12",color:"text.secondary",children:"Paraswap"})]})]})]})};function Um(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zm(e){for(var t=1;tNumber(c.availableBorrowsUSD),$=void 0;(0,Am.Z)(N).gt(z)&&($=Hm.INSUFFICIENT_LIQUIDITY);var K=function(){return $===Hm.INSUFFICIENT_LIQUIDITY?(0,hc.jsx)(sc.cC,{id:"There is not enough liquidity for the target asset to perform the switch. Try lowering the amount."}):null};return g.success?(0,hc.jsx)(lh.R,{customAction:(0,hc.jsxs)(um.Z,{gap:3,children:[(0,hc.jsx)(dc.Z,{variant:"description",color:"text.primary",children:(0,hc.jsx)(sc.cC,{id:"You've successfully switched borrow position."})}),(0,hc.jsxs)(um.Z,{direction:"row",alignItems:"center",justifyContent:"center",gap:1,children:[(0,hc.jsx)(vp.T1,{symbol:t.iconSymbol,sx:{mx:1}}),(0,hc.jsx)(kd.B,{value:E.current,compact:!0,variant:"subheader1"}),t.symbol,(0,hc.jsx)(lc.Z,{color:"primary",sx:{fontSize:"14px",mx:1},children:(0,hc.jsx)(wh.Z,{})}),(0,hc.jsx)(vp.T1,{symbol:O.reserve.symbol,sx:{mx:1}}),(0,hc.jsx)(kd.B,{value:M,compact:!0,variant:"subheader1"}),O.reserve.symbol]})]})}):(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uh.W,{value:P,onChange:function(e){var t="-1"===e;E.current=t?R:e,A(e),b(void 0)},usdValue:G.toString(),symbol:t.symbol,assets:[{balance:R,address:t.underlyingAsset,symbol:t.symbol,iconSymbol:t.iconSymbol}],maxValue:R,inputTitle:(0,hc.jsx)(sc.cC,{id:"Borrowed asset amount"}),balanceText:(0,hc.jsx)(ec.Fragment,{children:(0,hc.jsx)(sc.cC,{id:"Borrow balance"})}),isMaxSelected:D}),(0,hc.jsxs)(uc.Z,{sx:{padding:"18px",pt:"14px",display:"flex",justifyContent:"space-between"},children:[(0,hc.jsx)(lc.Z,{sx:{fontSize:"18px !important"},children:(0,hc.jsx)(cm,{})}),(0,hc.jsx)(Cm,{loading:Z,outputAmountUSD:V.toString(),inputAmountUSD:G.toString()})]}),(0,hc.jsx)(uh.W,{value:M,onSelect:T,usdValue:V.toString(),symbol:k.symbol,assets:v,inputTitle:(0,hc.jsx)(sc.cC,{id:"Switch to"}),balanceText:(0,hc.jsx)(sc.cC,{id:"Supply balance"}),disableInput:!0,loading:Z,selectOptionHeader:(0,hc.jsx)($m,{}),selectOption:function(e){return(0,hc.jsx)(Km,{asset:e})}}),L&&!Z&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:L}),!L&&void 0!==$&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(K,{})}),(0,hc.jsx)(Id.m6,{gasLimit:m,slippageSelector:(0,hc.jsx)(jm,{selectedSlippage:C,setSlippage:function(e){b(void 0),I(e)}}),children:(0,hc.jsx)(Gm,{switchSource:n,switchTarget:O,toAmount:M,fromAmount:""===P?"0":P,loading:Z,sourceBalance:R,sourceBorrowAPY:i===zd.tk.Variable?t.variableBorrowAPY:t.stableBorrowAPY,targetBorrowAPY:O.reserve.variableBorrowAPY,showAPYTypeChange:i===zd.tk.Stable})}),y&&(0,hc.jsx)(Pd,{txError:y}),q&&(0,hc.jsx)(Sd.v,{severity:"error",sx:{mt:4},children:(0,hc.jsx)(dc.Z,{variant:"caption",children:(0,hc.jsx)(sc.cC,{id:"Insufficient collateral to cover new borrow position. Wallet must have borrowing power remaining to perform debt switch."})})}),(0,hc.jsx)(zm,{isMaxSelected:D,poolReserve:t,amountToSwap:N,amountToReceive:M,isWrongNetwork:r,targetReserve:O.reserve,symbol:t.symbol,blocked:void 0!==$||""!==L||q,loading:j,buildTxFn:U,currentRateMode:i===zd.tk.Variable?2:1})]})},$m=function(){return(0,hc.jsx)(xm,{sx:function(e){return{borderBottom:"1px solid ".concat(e.palette.divider),mt:-1}},children:(0,hc.jsxs)(um.Z,{direction:"row",sx:{py:4},gap:14,children:[(0,hc.jsx)(dc.Z,{variant:"subheader2",children:(0,hc.jsx)(sc.cC,{id:"Select an asset"})}),(0,hc.jsx)(dc.Z,{variant:"subheader2",children:(0,hc.jsx)(sc.cC,{id:"Borrow APY, variable"})})]})})},Km=function(e){var t=e.asset;return(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(vp.T1,{aToken:t.aToken,symbol:t.iconSymbol||t.symbol,sx:{fontSize:"22px",mr:1}}),(0,hc.jsx)(yp.Z,{sx:{mr:6},children:t.symbol}),(0,hc.jsx)(kd.B,{value:t.variableApy,percent:!0,variant:"secondary14",color:"text.secondary"})]})};function Ym(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xm(e){for(var t=1;tNumber(V.amount)+.05*Number(V.amount))&&(h({success:!1}),w(void 0)),Number(l[1])0&&!fe.includes(A.symbol)?pe=Vf.NI.ZERO_LTV_WITHDRAW_BLOCKED:(0,xd.hE)(_).lt(q)&&(pe=Vf.NI.NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH);var he=function(){switch(pe){case Vf.NI.NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH:return(0,hc.jsx)(sc.cC,{id:"Not enough collateral to repay this amount of debt with"});case Vf.NI.ZERO_LTV_WITHDRAW_BLOCKED:return(0,hc.jsx)(sc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:fe}});default:return null}};return m.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"Repaid"}),amount:$,symbol:t.symbol}):(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uh.W,{value:le,onChange:ee,usdValue:de,symbol:t.symbol,assets:[{address:t.underlyingAsset,symbol:t.symbol,iconSymbol:t.iconSymbol,balance:N}],isMaxSelected:L,maxValue:N,inputTitle:(0,hc.jsx)(sc.cC,{id:"Expected amount to repay"}),balanceText:(0,hc.jsx)(sc.cC,{id:"Borrow balance"})}),(0,hc.jsxs)(uc.Z,{sx:{padding:"18px",pt:"14px",display:"flex",justifyContent:"space-between"},children:[(0,hc.jsx)(lc.Z,{sx:{fontSize:"18px !important"},children:(0,hc.jsx)(cm,{})}),(0,hc.jsx)(Cm,{loading:Q,outputAmountUSD:K,inputAmountUSD:W})]}),(0,hc.jsx)(uh.W,{value:"exactOut"===T?q:_,usdValue:W,symbol:A.symbol,assets:w,onSelect:E,onChange:ee,inputTitle:(0,hc.jsx)(sc.cC,{id:"Collateral to repay with"}),balanceText:(0,hc.jsx)(sc.cC,{id:"Borrow balance"}),maxValue:_,loading:Q,disableInput:!0}),X&&!Q&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:X}),void 0!==pe&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(he,{})}),(0,hc.jsxs)(Id.m6,{gasLimit:p,slippageSelector:(0,hc.jsx)(jm,{selectedSlippage:D,setSlippage:P}),children:[(0,hc.jsx)(Id.jz,{visibleHfChange:"exactOut"===T?!!I:!!q,healthFactor:null===c||void 0===c?void 0:c.healthFactor,futureHealthFactor:re.toString(10),loading:Q}),(0,hc.jsx)(Id.XJ,{description:(0,hc.jsx)(sc.cC,{id:"Borrow balance after repay"}),futureValue:se.toString(),futureValueUSD:ae.toString(),symbol:n,tokenIcon:t.iconSymbol,loading:Q,hideSymbolSuffix:!0}),(0,hc.jsx)(Id.XJ,{description:(0,hc.jsx)(sc.cC,{id:"Collateral balance after repay"}),futureValue:ce.toString(),futureValueUSD:ue.toString(),symbol:A.symbol,tokenIcon:A.iconSymbol,loading:Q,hideSymbolSuffix:!0})]}),h&&(0,hc.jsx)(Pd,{txError:h}),(0,hc.jsx)(gg,{poolReserve:t,fromAssetData:M,repayAmount:$,repayWithAmount:q,repayAllDebt:G,useFlashLoan:oe,isWrongNetwork:s,symbol:n,rateMode:r,blocked:void 0!==pe||""!==X,loading:Y,buildTxFn:J})]})}var wg=n(84707),xg=["amountToRepay","poolReserve","poolAddress","isWrongNetwork","sx","symbol","debtType","repayWithATokens","blocked"];function Ag(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Eg(e){for(var t=1;t0,ee=null===b||void 0===b?void 0:b.healthFactor;if(Y){var te=(null===b||void 0===b?void 0:b.totalCollateralUSD)||"0";G&&H&&(te=(0,xd.hE)((null===b||void 0===b?void 0:b.totalCollateralUSD)||"0").minus((0,xd.hE)(z.priceInUSD).multipliedBy(Y)));var ne=(0,xd.hE)((null===b||void 0===b?void 0:b.totalBorrowsUSD)||"0").minus((0,xd.hE)(z.priceInUSD).multipliedBy(Y)),re=Am.Z.max(ne,0),ie=(0,eh.L1)({collateralBalanceMarketReferenceCurrency:te,borrowBalanceMarketReferenceCurrency:re,currentLiquidationThreshold:(null===b||void 0===b?void 0:b.currentLiquidationThreshold)||"0"});ee=ie.isLessThan(0)&&!ie.eq(-1)?"0":ie.toString(10)}var oe=(0,xd.hE)(Y).multipliedBy(z.priceInUSD);return h.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"repaid"}),amount:j.current,symbol:C.symbol}):(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uh.W,{value:Y,onChange:function(e){var t="-1"===e;j.current=t?n.toString(10):e,L(e),t&&(G||n.eq(V))?C.address===fd.hP.toLowerCase()||wg.U[w]&&wg.U[w].toLowerCase()===z.underlyingAsset.toLowerCase()?M(q.toString(10)):M("-1"):M(q.lt(r)?q.toString(10):n.toString(10))},usdValue:oe.toString(10),symbol:C.symbol,assets:R,onSelect:I,isMaxSelected:K,maxValue:n.toString(10),balanceText:(0,hc.jsx)(sc.cC,{id:"Wallet balance"})}),Q&&(0,hc.jsx)(dc.Z,{color:"warning.main",variant:"helperText",children:(0,hc.jsx)(sc.cC,{id:"You don\u2019t have enough funds in your wallet to repay the full amount. If you proceed to repay with your current amount of funds, you will still have a small borrowing position in your dashboard."})}),(0,hc.jsxs)(Id.m6,{gasLimit:p,children:[(0,hc.jsx)(Id.XJ,{description:(0,hc.jsx)(sc.cC,{id:"Remaining debt"}),futureValue:X,futureValueUSD:J.toString(10),value:V,valueUSD:W.toString(),symbol:i.iconSymbol===U.wrappedBaseAssetSymbol?U.baseAssetSymbol:i.iconSymbol}),(0,hc.jsx)(Id.jz,{visibleHfChange:!!F,healthFactor:null===b||void 0===b?void 0:b.healthFactor,futureHealthFactor:ee})]}),m&&(0,hc.jsx)(Dd.Q,{txError:m}),(0,hc.jsx)(kg,{poolReserve:i,amountToRepay:K?B:Y,poolAddress:G?i.underlyingAsset:null!==(t=C.address)&&void 0!==t?t:"",isWrongNetwork:l,symbol:a,debtType:d,repayWithATokens:G})]})};function Sg(e){var t,n=e.repayType,r=e.setRepayType,i=(0,Xp.f)().currentMarketData,o=(0,bc.Yh)((function(e){return e.trackEvent}));return null!==(t=i.enabledFeatures)&&void 0!==t&&t.collateralRepay?(0,hc.jsxs)(uc.Z,{sx:{mb:6},children:[(0,hc.jsx)(dc.Z,{mb:1,color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Repay with"})}),(0,hc.jsxs)(rh.f,{color:"primary",value:n,exclusive:!0,onChange:function(e,t){return r(t)},children:[(0,hc.jsx)(nh.Y,{value:_g.BALANCE,disabled:n===_g.BALANCE,onClick:function(){return o(wc.rQ.SWITCH_REPAY_TYPE,{repayType:"Wallet Balance"})},children:(0,hc.jsx)(dc.Z,{variant:"buttonM",children:(0,hc.jsx)(sc.cC,{id:"Wallet balance"})})}),(0,hc.jsx)(nh.Y,{value:_g.COLLATERAL,disabled:n===_g.COLLATERAL,onClick:function(){return o(wc.rQ.SWITCH_REPAY_TYPE,{repayType:"Collateral"})},children:(0,hc.jsx)(dc.Z,{variant:"buttonM",children:(0,hc.jsx)(sc.cC,{id:"Collateral"})})})]})]}):null}function Cg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ig(e){for(var t=1;tNumber(F):Number(E)Number((0,xd.Fv)(M.toString(),Number(B.feeTokendecimals)))}return!1}),[E,B,D,M]);l&&(!l.isInIsolationMode&&!r.isIsolated||l.isInIsolationMode&&(null===(t=l.isolatedReserve)||void 0===t?void 0:t.underlyingAsset)===r.underlyingAsset)&&(J=(0,eh.L1)({collateralBalanceMarketReferenceCurrency:K,borrowBalanceMarketReferenceCurrency:(0,xd.hE)(l.totalBorrowsMarketReferenceCurrency),currentLiquidationThreshold:Y}));var ee=l.userReservesData.find((function(e){return e.usageAsCollateralEnabledOnUser&&e.reserve.id!==r.id})),te=!l.isInIsolationMode&&r.isIsolated&&!ee&&(!i||"0"===i.underlyingBalance||i.usageAsCollateralEnabledOnUser),ne={address:r.aTokenAddress,symbol:r.iconSymbol,decimals:r.decimals,aToken:!0},re=(0,Vf.yI)(i,l.totalCollateralUSD,l.isInIsolationMode,w.isMaxed),ie={amountToSupply:E,feeTokenAddress:T,isWrongNetwork:o,txHash:I,setTxHash:O,poolAddress:N?fd.hP:r.underlyingAsset,symbol:N?p.baseAssetSymbol:r.symbol,blocked:!1,decimals:r.decimals,isPaymaster:D,isBalanceSufficient:Q};return m.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"Supplied"}),amount:E,symbol:N?p.baseAssetSymbol:r.symbol,addToken:ne}):(0,hc.jsxs)(hc.Fragment,{children:[te&&(0,hc.jsx)(nm.i,{asset:r.symbol}),v.determineWarningDisplay({supplyCap:v}),w.determineWarningDisplay({debtCeiling:w}),"AMPL"===r.symbol&&(0,hc.jsx)(Sd.v,{sx:{mt:"16px",mb:"40px"},severity:"warning",children:(0,hc.jsx)(Rg.v,{})}),"true"===zg.env.NEXT_PUBLIC_ENABLE_STAKING&&"AAVE"===r.symbol&&oc.cr.staking(f)&&(0,hc.jsx)(Pg,{}),"SNX"===r.symbol&&"0"!==V&&(0,hc.jsx)(Bg,{}),(0,hc.jsx)(uh.W,{value:E,onChange:function(e){if("-1"===e)_(V);else{var t=(0,ah.$w)(e,r.decimals);_(t)}},usdValue:q.toString(10),symbol:N?p.baseAssetSymbol:r.symbol,assets:[{balance:V,symbol:N?p.baseAssetSymbol:r.symbol,iconSymbol:N?p.baseAssetSymbol:r.iconSymbol}],capType:ch.R.supplyCap,isMaxSelected:X,disabled:m.loading,maxValue:V,balanceText:(0,hc.jsx)(sc.cC,{id:"Wallet balance"}),event:{eventName:wc.vh.MAX_INPUT_SELECTION,eventParams:{asset:r.underlyingAsset,assetName:r.name}}}),(0,hc.jsxs)(Id.m6,{gasLimit:g,skipLoad:!0,disabled:0===Number(E),gaslessPossible:null===oc.cr||void 0===oc.cr?void 0:oc.cr.gasless(f),setFeeTokenAddress:S,paymasterData:B,amountInUsd:$,setPaymasterDisable:P,children:[(0,hc.jsx)(Id.oD,{description:(0,hc.jsx)(sc.cC,{id:"Supply APY"}),value:L,percent:!0}),(0,hc.jsx)(Id.aE,{incentives:r.aIncentivesData,symbol:r.symbol}),(0,hc.jsx)(Id.Bx,{collateralType:re}),(0,hc.jsx)(Id.jz,{visibleHfChange:!!E,healthFactor:l?l.healthFactor:"-1",futureHealthFactor:J.toString(10)})]}),y&&(0,hc.jsx)(Dd.Q,{txError:y}),(0,hc.jsx)(Ug,Vg({},ie))]})}));function qg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var $g=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.Supply,setOpen:n,children:(0,hc.jsx)(Jp.A,{action:"supply",title:(0,hc.jsx)(sc.cC,{id:"Supply"}),underlyingAsset:r.underlyingAsset,requiredPermission:Yp.g.DEPOSITOR,children:function(e){return(0,hc.jsx)(Wg,function(e){for(var t=1;t0&&!$.includes(t.symbol)?K=Vf.NI.ZERO_LTV_WITHDRAW_BLOCKED:!W.eq("-1")&&q.lt(F)?K=Vf.NI.SUPPLY_CAP_REACHED:!z.eq("-1")&&z.lt("1.01")&&(K=Vf.NI.HF_BELOW_ONE);var Y=function(){switch(K){case Vf.NI.SUPPLY_CAP_REACHED:return(0,hc.jsx)(sc.cC,{id:"Supply cap on target reserve reached. Try lowering the amount."});case Vf.NI.HF_BELOW_ONE:return(0,hc.jsx)(sc.cC,{id:"The effects on the health factor would cause liquidation. Try lowering the amount."});case Vf.NI.ZERO_LTV_WITHDRAW_BLOCKED:return(0,hc.jsx)(sc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:$}});default:return null}};if(g.success)return(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"Switched"}),amount:A.current,symbol:t.symbol});var X=a&&"0"!==a.totalBorrowsMarketReferenceCurrency&&"0"!==t.reserveLiquidationThreshold,J=(0,oh.wD)(I.reserve).debtCeilingReached,Q=(0,Vf.yI)(n,a.totalCollateralUSD,a.isInIsolationMode,J),ee=(0,oh.wD)(I.reserve).debtCeilingReached,te=(0,Vf.yI)(I,a.totalCollateralUSD,a.isInIsolationMode,ee);if(R&&Q===Yg.z.ISOLATED_ENABLED&&"0"===I.underlyingBalance&&(te=I.reserve.isIsolated?Yg.z.ISOLATED_ENABLED:Yg.z.ENABLED),R&&Q===Yg.z.ENABLED&&"0"===I.underlyingBalance&&I.reserve.isIsolated){var ne=a.userReservesData.filter((function(e){return e.usageAsCollateralEnabledOnUser}));1===ne.length&&ne[0].underlyingAsset===n.underlyingAsset&&(te=Yg.z.ISOLATED_ENABLED)}return(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uh.W,{value:D,onChange:function(e){var t="-1"===e;A.current=t?O:e,x(e)},usdValue:B,symbol:t.iconSymbol,assets:[{balance:O,address:t.underlyingAsset,symbol:t.symbol,iconSymbol:t.iconSymbol}],maxValue:O,inputTitle:(0,hc.jsx)(sc.cC,{id:"Supplied asset amount"}),balanceText:(0,hc.jsx)(sc.cC,{id:"Supply balance"}),isMaxSelected:R}),(0,hc.jsxs)(uc.Z,{sx:{padding:"18px",pt:"14px",display:"flex",justifyContent:"space-between"},children:[(0,hc.jsx)(lc.Z,{sx:{fontSize:"18px !important"},children:(0,hc.jsx)(Ad,{})}),(0,hc.jsx)(Cm,{loading:Z,outputAmountUSD:F,inputAmountUSD:B})]}),(0,hc.jsx)(uh.W,{value:N,onSelect:k,usdValue:F,symbol:_.symbol,assets:b,inputTitle:(0,hc.jsx)(sc.cC,{id:"Switch to"}),balanceText:(0,hc.jsx)(sc.cC,{id:"Supply balance"}),disableInput:!0,loading:Z}),L&&!Z&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:L}),!L&&void 0!==K&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(Y,{})}),"stETH"===I.reserve.symbol&&(0,hc.jsx)(Sd.v,{severity:"warning",sx:{mt:2,mb:0},children:(0,hc.jsx)(Kg.O,{})}),(0,hc.jsx)(Id.m6,{gasLimit:m,slippageSelector:(0,hc.jsx)(jm,{selectedSlippage:S,setSlippage:C}),children:(0,hc.jsx)(ty,{showHealthFactor:X,healthFactor:null===a||void 0===a?void 0:a.healthFactor,healthFactorAfterSwap:z.toString(10),swapSource:ry(ry({},n),{},{collateralType:Q}),swapTarget:ry(ry({},I),{},{collateralType:te}),toAmount:N,fromAmount:""===D?"0":D,loading:Z})}),y&&(0,hc.jsx)(Pd,{txError:y}),(0,hc.jsx)(Qg,{isMaxSelected:R,poolReserve:t,amountToSwap:M,amountToReceive:N,isWrongNetwork:r,targetReserve:I.reserve,symbol:t.symbol,blocked:void 0!==K||""!==L||"stETH"===I.reserve.symbol,useFlashLoan:V,loading:j,buildTxFn:U})]})};function oy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var sy,ay=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.Swap,setOpen:n,children:(0,hc.jsx)(Jp.A,{title:(0,hc.jsx)(sc.cC,{id:"Switch"}),underlyingAsset:r.underlyingAsset,children:function(e){return(0,hc.jsx)(iy,function(e){for(var t=1;t=1&&j.toNumber()<1.5&&n.usageAsCollateralEnabledOnUser,z=void 0;l.success||l.txHash||(U.length>0&&!U.includes(t.symbol)?z=sy.ZERO_LTV_WITHDRAW_BLOCKED:j.lt("1")&&"0"!==f.totalBorrowsMarketReferenceCurrency?z=sy.CAN_NOT_WITHDRAW_THIS_AMOUNT:z||!O.eq("0")&&!(0,xd.hE)(N).gt(t.unborrowedLiquidity)||(z=sy.POOL_DOES_NOT_HAVE_ENOUGH_LIQUIDITY));var G=function(){switch(z){case sy.CAN_NOT_WITHDRAW_THIS_AMOUNT:return(0,hc.jsx)(sc.cC,{id:"You can not withdraw this amount because it will cause collateral call"});case sy.POOL_DOES_NOT_HAVE_ENOUGH_LIQUIDITY:return(0,hc.jsx)(sc.cC,{id:"These funds have been borrowed and are not available for withdrawal at this time."});case sy.ZERO_LTV_WITHDRAW_BLOCKED:return(0,hc.jsx)(sc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:U}});default:return null}},V=(0,xd.hE)(N).multipliedBy((null===n||void 0===n?void 0:n.reserve.priceInUSD)||0);return l.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"withdrew"}),amount:E.current,symbol:r&&t.isWrappedBaseAsset?p.baseAssetSymbol:t.symbol}):(0,hc.jsxs)(uc.Z,{position:"relative",children:[!S&&(0,hc.jsxs)(uc.Z,{position:"absolute",zIndex:2,bgcolor:"#FFFFFF10",height:"100%",padding:"24px",sx:{backdropFilter:"blur(6px)"},children:[(0,hc.jsx)(dc.Z,{variant:"h2",textAlign:"center",children:"If you withdraw, you will stop earning future yields and points."}),(0,hc.jsxs)(uc.Z,{display:"flex",flexDirection:"column",mt:6,children:[(0,hc.jsx)(fc.Z,{variant:"contained",sx:{marginBottom:4},onClick:function(){return a(!1)},children:"Keep Earning"}),(0,hc.jsx)(fc.Z,{variant:"outlined",onClick:function(){console.log("change",S),C(!0),localStorage.setItem("dontShowWithdrawWarning","true")},children:"Withdraw Anyway"})]})]}),(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uh.W,{value:N,onChange:function(e){var t="-1"===e;E.current=t?R.toString(10):e,g(e),t&&R.eq(I)?(_(wc.vh.MAX_INPUT_SELECTION,{type:"withdraw"}),v("-1")):v(R.toString(10))},symbol:o,assets:[{balance:R.toString(10),symbol:o,iconSymbol:r&&t.isWrappedBaseAsset?p.baseAssetSymbol:t.iconSymbol}],usdValue:V.toString(10),isMaxSelected:M,disabled:l.loading,maxValue:R.toString(10),balanceText:O.lt(I)?(0,hc.jsx)(sc.cC,{id:"Available"}):(0,hc.jsx)(sc.cC,{id:"Supply balance"})}),void 0!==z&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:(0,hc.jsx)(G,{})}),t.isWrappedBaseAsset&&(0,hc.jsx)(Id.Pu,{unwrapped:r,setUnWrapped:i,label:(0,hc.jsx)(dc.Z,{children:"Unwrap ".concat(t.symbol," (to withdraw ").concat(p.baseAssetSymbol,")")})}),(0,hc.jsxs)(Id.m6,{gasLimit:u,children:[(0,hc.jsx)(Id.oD,{description:(0,hc.jsx)(sc.cC,{id:"Remaining supply"}),value:I.minus(N||"0").toString(10),symbol:t.isWrappedBaseAsset?p.baseAssetSymbol:t.symbol}),(0,hc.jsx)(Id.jz,{visibleHfChange:!!m,healthFactor:f?f.healthFactor:"-1",futureHealthFactor:j.toString(10)})]}),d&&(0,hc.jsx)(Dd.Q,{txError:d}),H&&(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Sd.v,{severity:"error",sx:{my:6},children:(0,hc.jsx)(sc.cC,{id:"Withdrawing this amount will reduce your health factor and increase risk of liquidation."})}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",mx:"24px",mb:"12px"},children:[(0,hc.jsx)(gh.Z,{checked:x,onChange:function(){A(!x),_(wc.vh.ACCEPT_RISK,{modal:"Withdraw",riskCheckboxAccepted:x})},size:"small","data-cy":"risk-checkbox"}),(0,hc.jsx)(dc.Z,{variant:"description",children:(0,hc.jsx)(sc.cC,{id:"I acknowledge the risks involved."})})]})]}),(0,hc.jsx)(cy,{poolReserve:t,amountToWithdraw:M?b:N,poolAddress:r&&t.isWrappedBaseAsset?fd.hP:t.underlyingAsset,isWrongNetwork:s,symbol:o,blocked:void 0!==z||H&&!x,sx:H?{mt:0}:{}})]})]})};function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dy(e){for(var t=1;t0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Ey(e){if("function"!==typeof e||"function"!==typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");xy(e.outputLen),xy(e.blockLen)}function _y(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ky(e,t){Ay(e);const n=t.outputLen;if(e.lengthnew DataView(e.buffer,e.byteOffset,e.byteLength),Cy=(e,t)=>e<<32-t|e>>>t,Iy=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],Oy=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Ry(e){for(let t=0;te().update(Py(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Fy(e=32){if(Ty&&"function"===typeof Ty.getRandomValues)return Ty.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const Ly=(e,t,n)=>e&t^e&n^t&n;class jy extends My{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Sy(this.buffer)}update(e){_y(this);const{view:t,buffer:n,blockLen:r}=this,i=(e=Py(e)).length;for(let o=0;or-o&&(this.process(n,0),o=0);for(let l=o;l>i&o),a=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,s,r),e.setUint32(t+u,a,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);const s=Sy(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l>Zy&Uy)}:{h:0|Number(e>>Zy&Uy),l:0|Number(e&Uy)}}function zy(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;ie<>>32-n,Vy=(e,t,n)=>t<>>32-n,Wy=(e,t,n)=>t<>>64-n,qy=(e,t,n)=>e<>>64-n;var $y={fromBig:Hy,split:zy,toBig:(e,t)=>BigInt(e>>>0)<>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:Gy,rotlSL:Vy,rotlBH:Wy,rotlBL:qy,add:function(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,add5H:(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0,add5L:(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0)};const[Ky,Yy]=(()=>$y.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),Xy=new Uint32Array(80),Jy=new Uint32Array(80);class Qy extends jy{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:p,Hh:h,Hl:m}=this;return[e,t,n,r,i,o,s,a,c,u,l,d,f,p,h,m]}set(e,t,n,r,i,o,s,a,c,u,l,d,f,p,h,m){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|p,this.Hh=0|h,this.Hl=0|m}process(e,t){for(let b=0;b<16;b++,t+=4)Xy[b]=e.getUint32(t),Jy[b]=e.getUint32(t+=4);for(let b=16;b<80;b++){const e=0|Xy[b-15],t=0|Jy[b-15],n=$y.rotrSH(e,t,1)^$y.rotrSH(e,t,8)^$y.shrSH(e,t,7),r=$y.rotrSL(e,t,1)^$y.rotrSL(e,t,8)^$y.shrSL(e,t,7),i=0|Xy[b-2],o=0|Jy[b-2],s=$y.rotrSH(i,o,19)^$y.rotrBH(i,o,61)^$y.shrSH(i,o,6),a=$y.rotrSL(i,o,19)^$y.rotrBL(i,o,61)^$y.shrSL(i,o,6),c=$y.add4L(r,a,Jy[b-7],Jy[b-16]),u=$y.add4H(c,n,s,Xy[b-7],Xy[b-16]);Xy[b]=0|u,Jy[b]=0|c}let{Ah:n,Al:r,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:d,Fh:f,Fl:p,Gh:h,Gl:m,Hh:g,Hl:y}=this;for(let b=0;b<80;b++){const e=$y.rotrSH(l,d,14)^$y.rotrSH(l,d,18)^$y.rotrBH(l,d,41),t=$y.rotrSL(l,d,14)^$y.rotrSL(l,d,18)^$y.rotrBL(l,d,41),v=l&f^~l&h,w=d&p^~d&m,x=$y.add5L(y,t,w,Yy[b],Jy[b]),A=$y.add5H(x,g,e,v,Ky[b],Xy[b]),E=0|x,_=$y.rotrSH(n,r,28)^$y.rotrBH(n,r,34)^$y.rotrBH(n,r,39),k=$y.rotrSL(n,r,28)^$y.rotrBL(n,r,34)^$y.rotrBL(n,r,39),T=n&i^n&s^i&s,S=r&o^r&a^o&a;g=0|h,y=0|m,h=0|f,m=0|p,f=0|l,p=0|d,({h:l,l:d}=$y.add(0|c,0|u,0|A,0|E)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|n,o=0|r;const C=$y.add3L(E,k,S);n=$y.add3H(C,A,_,T),r=0|C}({h:n,l:r}=$y.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:o}=$y.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=$y.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=$y.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:d}=$y.add(0|this.Eh,0|this.El,0|l,0|d)),({h:f,l:p}=$y.add(0|this.Fh,0|this.Fl,0|f,0|p)),({h:h,l:m}=$y.add(0|this.Gh,0|this.Gl,0|h,0|m)),({h:g,l:y}=$y.add(0|this.Hh,0|this.Hl,0|g,0|y)),this.set(n,r,i,o,s,a,c,u,l,d,f,p,h,m,g,y)}roundClean(){Xy.fill(0),Jy.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)}}const eb=Ny((()=>new Qy)),tb=BigInt(0),nb=BigInt(1),rb=BigInt(2);function ib(e){return e instanceof Uint8Array||null!=e&&"object"===typeof e&&"Uint8Array"===e.constructor.name}function ob(e){if(!ib(e))throw new Error("Uint8Array expected")}const sb=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function ab(e){ob(e);let t="";for(let n=0;n=lb&&e<=db?e-lb:e>=fb&&e<=pb?e-(fb-10):e>=hb&&e<=mb?e-(hb-10):void 0}function yb(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let i=0,o=0;itb;e>>=nb,t+=1);return t}function Cb(e,t){return e>>BigInt(t)&nb}function Ib(e,t,n){return e|(n?nb:tb)<(rb<new Uint8Array(e),Db=e=>Uint8Array.from(e);function Pb(e,t,n){if("number"!==typeof e||e<2)throw new Error("hashLen must be a number");if("number"!==typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!==typeof n)throw new Error("hmacFn must be a function");let r=Rb(e),i=Rb(e),o=0;const s=()=>{r.fill(1),i.fill(0),o=0},a=(...e)=>n(i,r,...e),c=(e=Rb())=>{i=a(Db([0]),e),r=a(),0!==e.length&&(i=a(Db([1]),e),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e{let n;for(s(),c(e);!(n=t(u()));)c();return s(),n}}const Bb={bigint:e=>"bigint"===typeof e,function:e=>"function"===typeof e,boolean:e=>"boolean"===typeof e,string:e=>"string"===typeof e,stringOrUint8Array:e=>"string"===typeof e||ib(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"===typeof e&&Number.isSafeInteger(e.outputLen)};function Mb(e,t,n={}){const r=(t,n,r)=>{const i=Bb[n];if("function"!==typeof i)throw new Error(`Invalid validator "${n}", expected function`);const o=e[t];if((!r||void 0!==o)&&!i(o,e))throw new Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${n}`)};for(const[i,o]of Object.entries(t))r(i,o,!1);for(const[i,o]of Object.entries(n))r(i,o,!0);return e}const Nb=BigInt(0),Fb=BigInt(1),Lb=BigInt(2),jb=BigInt(3),Ub=BigInt(4),Zb=BigInt(5),Hb=BigInt(8);BigInt(9),BigInt(16);function zb(e,t){const n=e%t;return n>=Nb?n:t+n}function Gb(e,t,n){if(n<=Nb||t 0");if(n===Fb)return Nb;let r=Fb;for(;t>Nb;)t&Fb&&(r=r*e%n),e=e*e%n,t>>=Fb;return r}function Vb(e,t,n){let r=e;for(;t-- >Nb;)r*=r,r%=n;return r}function Wb(e,t){if(e===Nb||t<=Nb)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=zb(e,t),r=t,i=Nb,o=Fb,s=Fb,a=Nb;for(;n!==Nb;){const e=r/n,t=r%n,c=i-s*e,u=o-a*e;r=n,n=t,i=s,o=a,s=c,a=u}if(r!==Fb)throw new Error("invert: does not exist");return zb(i,t)}function qb(e){if(e%Ub===jb){const t=(e+Fb)/Ub;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%Hb===Zb){const t=(e-Zb)/Hb;return function(e,n){const r=e.mul(n,Lb),i=e.pow(r,t),o=e.mul(n,i),s=e.mul(e.mul(o,Lb),i),a=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),n))throw new Error("Cannot find square root");return a}}return function(e){const t=(e-Fb)/Lb;let n,r,i;for(n=e-Fb,r=0;n%Lb===Nb;n/=Lb,r++);for(i=Lb;i 0, got ${e}`);const{nBitLength:i,nByteLength:o}=Kb(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=qb(e),a=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:Ob(i),ZERO:Nb,ONE:Fb,create:t=>zb(t,e),isValid:t=>{if("bigint"!==typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return Nb<=t&&te===Nb,isOdd:e=>(e&Fb)===Fb,neg:t=>zb(-t,e),eql:(e,t)=>e===t,sqr:t=>zb(t*t,e),add:(t,n)=>zb(t+n,e),sub:(t,n)=>zb(t-n,e),mul:(t,n)=>zb(t*n,e),pow:(e,t)=>function(e,t,n){if(n 0");if(n===Nb)return e.ONE;if(n===Fb)return t;let r=e.ONE,i=t;for(;n>Nb;)n&Fb&&(r=e.mul(r,i)),i=e.sqr(i),n>>=Fb;return r}(a,e,t),div:(t,n)=>zb(t*Wb(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Wb(t,e),sqrt:r.sqrt||(e=>s(a,e)),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce(((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r))),e.ONE),i=e.inv(r);return t.reduceRight(((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r))),i),n}(a,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?xb(e,o):wb(e,o),fromBytes:e=>{if(e.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${e.length}`);return n?vb(e):bb(e)}});return Object.freeze(a)}function Xb(e){if("bigint"!==typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Jb(e){const t=Xb(e);return t+Math.ceil(t/2)}const Qb=BigInt(0),ev=BigInt(1);function tv(e,t){const n=(e,t)=>{const n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;for(;n>Qb;)n&ev&&(r=r.add(i)),i=i.double(),n>>=ev;return r},precomputeWindow(e,t){const{windows:n,windowSize:i}=r(t),o=[];let s=e,a=s;for(let r=0;r>=f,r>a&&(r-=d,o+=ev);const s=t,p=t+Math.abs(r)-1,h=e%2!==0,m=r<0;0===r?u=u.add(n(h,i[s])):c=c.add(n(m,i[p]))}return{p:c,f:u}},wNAFCached(e,t,n,r){const i=e._WINDOW_SIZE||1;let o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,r(o))),this.wNAF(i,o,n)}}}function nv(e){return function(e){const t=$b.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});Mb(e,t)}(e.Fp),Mb(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Kb(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const rv=BigInt(0),iv=BigInt(1),ov=BigInt(2),sv=BigInt(8),av={zip215:!0};function cv(e){const t=function(e){const t=nv(e);return Mb(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:n,n:r,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=t,u=ov<{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch(h){return{isValid:!1,value:rv}}}),f=t.adjustScalarBytes||(e=>e),p=t.domain||((e,t,n)=>{if(t.length||n)throw new Error("Contexts/pre-hash are not supported");return e}),m=e=>"bigint"===typeof e&&rvm(e)&&m(t)&&ee===rv||g(e,u);function b(e,t){if(g(e,t))return e;throw new Error(`Expected valid scalar < ${t}, got ${typeof e} ${e}`)}function v(e){return e===rv?e:b(e,r)}const w=new Map;function x(e){if(!(e instanceof A))throw new Error("ExtendedPoint expected")}class A{constructor(e,t,n,r){if(this.ex=e,this.ey=t,this.ez=n,this.et=r,!y(e))throw new Error("x required");if(!y(t))throw new Error("y required");if(!y(n))throw new Error("z required");if(!y(r))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof A)throw new Error("extended point not allowed");const{x:t,y:n}=e||{};if(!y(t)||!y(n))throw new Error("invalid affine point");return new A(t,n,iv,l(t*n))}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.ez)));return e.map(((e,n)=>e.toAffine(t[n]))).map(A.fromAffine)}_setWindowSize(e){this._WINDOW_SIZE=e,w.delete(this)}assertValidity(){const{a:e,d:n}=t;if(this.is0())throw new Error("bad point: ZERO");const{ex:r,ey:i,ez:o,et:s}=this,a=l(r*r),c=l(i*i),u=l(o*o),d=l(u*u),f=l(a*e);if(l(u*l(f+c))!==l(d+l(n*l(a*c))))throw new Error("bad point: equation left != right (1)");if(l(r*i)!==l(o*s))throw new Error("bad point: equation left != right (2)")}equals(e){x(e);const{ex:t,ey:n,ez:r}=this,{ex:i,ey:o,ez:s}=e,a=l(t*s),c=l(i*r),u=l(n*s),d=l(o*r);return a===c&&u===d}is0(){return this.equals(A.ZERO)}negate(){return new A(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:e}=t,{ex:n,ey:r,ez:i}=this,o=l(n*n),s=l(r*r),a=l(ov*l(i*i)),c=l(e*o),u=n+r,d=l(l(u*u)-o-s),f=c+s,p=f-a,h=c-s,m=l(d*p),g=l(f*h),y=l(d*h),b=l(p*f);return new A(m,g,b,y)}add(e){x(e);const{a:n,d:r}=t,{ex:i,ey:o,ez:s,et:a}=this,{ex:c,ey:u,ez:d,et:f}=e;if(n===BigInt(-1)){const e=l((o-i)*(u+c)),t=l((o+i)*(u-c)),n=l(t-e);if(n===rv)return this.double();const r=l(s*ov*f),p=l(a*ov*d),h=p+r,m=t+e,g=p-r,y=l(h*n),b=l(m*g),v=l(h*g),w=l(n*m);return new A(y,b,w,v)}const p=l(i*c),h=l(o*u),m=l(a*r*f),g=l(s*d),y=l((i+o)*(c+u)-p-h),b=g-m,v=g+m,w=l(h-n*p),E=l(y*b),_=l(v*w),k=l(y*w),T=l(b*v);return new A(E,_,T,k)}subtract(e){return this.add(e.negate())}wNAF(e){return k.wNAFCached(this,w,e,A.normalizeZ)}multiply(e){const{p:t,f:n}=this.wNAF(b(e,r));return A.normalizeZ([t,n])[0]}multiplyUnsafe(e){let t=v(e);return t===rv?_:this.equals(_)||t===iv?this:this.equals(E)?this.wNAF(t).p:k.unsafeLadder(this,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return k.unsafeLadder(this,r).is0()}toAffine(e){const{ex:t,ey:r,ez:i}=this,o=this.is0();null==e&&(e=o?sv:n.inv(i));const s=l(t*e),a=l(r*e),c=l(i*e);if(o)return{x:rv,y:iv};if(c!==iv)throw new Error("invZ was invalid");return{x:s,y:a}}clearCofactor(){const{h:e}=t;return e===iv?this:this.multiplyUnsafe(e)}static fromHex(e,r=!1){const{d:i,a:o}=t,s=n.BYTES,a=(e=Eb("pointHex",e,s)).slice(),c=e[s-1];a[s-1]=-129&c;const f=vb(a);f===rv||b(f,r?u:n.ORDER);const p=l(f*f),h=l(p-iv),m=l(i*p-o);let{isValid:g,value:y}=d(h,m);if(!g)throw new Error("Point.fromHex: invalid y coordinate");const v=(y&iv)===iv,w=0!==(128&c);if(!r&&y===rv&&w)throw new Error("Point.fromHex: x=0 and x_0=1");return w!==v&&(y=l(-y)),A.fromAffine({x:y,y:f})}static fromPrivateKey(e){return C(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),r=xb(t,n.BYTES);return r[r.length-1]|=e&iv?128:0,r}toHex(){return ab(this.toRawBytes())}}A.BASE=new A(t.Gx,t.Gy,iv,l(t.Gx*t.Gy)),A.ZERO=new A(rv,iv,iv,rv);const{BASE:E,ZERO:_}=A,k=tv(A,8*a);function T(e){return zb(e,r)}function S(e){return T(vb(e))}function C(e){const t=a;e=Eb("private key",e,t);const n=Eb("hashed private key",o(e),2*t),r=f(n.slice(0,t)),i=n.slice(t,2*t),s=S(r),c=E.multiply(s),u=c.toRawBytes();return{head:r,prefix:i,scalar:s,point:c,pointBytes:u}}function I(e=new Uint8Array,...t){const n=_b(...t);return S(o(p(n,Eb("context",e),!!i)))}const O=av;E._setWindowSize(8);return{CURVE:t,getPublicKey:function(e){return C(e).pointBytes},sign:function(e,t,r={}){e=Eb("message",e),i&&(e=i(e));const{prefix:o,scalar:s,pointBytes:c}=C(t),u=I(r.context,o,e),l=E.multiply(u).toRawBytes(),d=T(u+I(r.context,l,c,e)*s);return v(d),Eb("result",_b(l,xb(d,n.BYTES)),2*a)},verify:function(e,t,r,o=O){const{context:s,zip215:a}=o,c=n.BYTES;e=Eb("signature",e,2*c),t=Eb("message",t),i&&(t=i(t));const u=vb(e.slice(c,2*c));let l,d,f;try{l=A.fromHex(r,a),d=A.fromHex(e.slice(0,c),a),f=E.multiplyUnsafe(u)}catch(IT){return!1}if(!a&&l.isSmallOrder())return!1;const p=I(s,d.toRawBytes(),l.toRawBytes(),t);return d.add(l.multiplyUnsafe(p)).subtract(f).clearCofactor().equals(A.ZERO)},ExtendedPoint:A,utils:{getExtendedPublicKey:C,randomPrivateKey:()=>s(n.BYTES),precompute:(e=8,t=A.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}const uv=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),lv=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),dv=(BigInt(0),BigInt(1)),fv=BigInt(2),pv=BigInt(5),hv=BigInt(10),mv=BigInt(20),gv=BigInt(40),yv=BigInt(80);function bv(e){const t=uv,n=e*e%t*e%t,r=Vb(n,fv,t)*n%t,i=Vb(r,dv,t)*e%t,o=Vb(i,pv,t)*i%t,s=Vb(o,hv,t)*o%t,a=Vb(s,mv,t)*s%t,c=Vb(a,gv,t)*a%t,u=Vb(c,yv,t)*c%t,l=Vb(u,yv,t)*c%t,d=Vb(l,hv,t)*o%t;return{pow_p_5_8:Vb(d,fv,t)*e%t,b2:n}}function vv(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function wv(e,t){const n=uv,r=zb(t*t*t,n),i=zb(r*r*t,n);let o=zb(e*r*bv(e*i).pow_p_5_8,n);const s=zb(t*o*o,n),a=o,c=zb(o*lv,n),u=s===e,l=s===zb(-e,n),d=s===zb(-e*lv,n);return u&&(o=a),(l||d)&&(o=c),(zb(o,n)&Fb)===Fb&&(o=zb(-o,n)),{isValid:u||l,value:o}}const xv=Yb(uv,void 0,!0),Av={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:xv,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:eb,randomBytes:Fy,adjustScalarBytes:vv,uvRatio:wv},Ev=cv(Av);function _v(e,t,n){if(t.length>255)throw new Error("Context is too big");return By(Dy("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,t.length]),t,e)}const kv=(xv.ORDER+BigInt(3))/BigInt(8);xv.pow(fv,kv),xv.sqrt(xv.neg(xv.ONE)),xv.ORDER,BigInt(5),BigInt(8),BigInt(486662);!function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);e.isOdd(n)&&e.neg(n)}(xv,xv.neg(BigInt(486664)));BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Tv=n(13384),Sv=n.n(Tv),Cv=n(77191),Iv=n.n(Cv);const Ov=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Rv=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Dv=new Uint32Array(64);class Pv extends jy{constructor(){super(64,32,8,!1),this.A=0|Rv[0],this.B=0|Rv[1],this.C=0|Rv[2],this.D=0|Rv[3],this.E=0|Rv[4],this.F=0|Rv[5],this.G=0|Rv[6],this.H=0|Rv[7]}get(){const{A:e,B:t,C:n,D:r,E:i,F:o,G:s,H:a}=this;return[e,t,n,r,i,o,s,a]}set(e,t,n,r,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let d=0;d<16;d++,t+=4)Dv[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){const e=Dv[d-15],t=Dv[d-2],n=Cy(e,7)^Cy(e,18)^e>>>3,r=Cy(t,17)^Cy(t,19)^t>>>10;Dv[d]=r+Dv[d-7]+n+Dv[d-16]|0}let{A:n,B:r,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let d=0;d<64;d++){const e=u+(Cy(s,6)^Cy(s,11)^Cy(s,25))+((l=s)&a^~l&c)+Ov[d]+Dv[d]|0,t=(Cy(n,2)^Cy(n,13)^Cy(n,22))+Ly(n,r,i)|0;u=c,c=a,a=s,s=o+e|0,o=i,i=r,r=n,n=e+t|0}var l;n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,r,i,o,s,a,c,u)}roundClean(){Dv.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Bv=Ny((()=>new Pv));var Mv=n(25532),Nv=n(39386),Fv=n(40475);class Lv extends TypeError{constructor(e,t){let n;const{message:r,...i}=e,{path:o}=e;super(0===o.length?r:"At path: "+o.join(".")+" -- "+r),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var r;return null!=(r=n)?r:n=[e,...t()]}}}function jv(e){return"object"===typeof e&&null!=e}function Uv(e){return"string"===typeof e?JSON.stringify(e):""+e}function Zv(e,t,n,r){if(!0===e)return;!1===e?e={}:"string"===typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:s}=n,{refinement:a,message:c="Expected a value of type `"+s+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+Uv(r)+"`"}=e;return{value:r,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...e,message:c}}function*Hv(e,t,n,r){var i;jv(i=e)&&"function"===typeof i[Symbol.iterator]||(e=[e]);for(const o of e){const e=Zv(o,t,n,r);e&&(yield e)}}function*zv(e,t,n={}){const{path:r=[],branch:i=[e],coerce:o=!1,mask:s=!1}=n,a={path:r,branch:i};if(o&&(e=t.coercer(e,a),s&&"type"!==t.type&&jv(t.schema)&&jv(e)&&!Array.isArray(e)))for(const u in e)void 0===t.schema[u]&&delete e[u];let c=!0;for(const u of t.validator(e,a))c=!1,yield[u,void 0];for(let[u,l,d]of t.entries(e,a)){const t=zv(l,d,{path:void 0===u?r:[...r,u],branch:void 0===u?i:[...i,l],coerce:o,mask:s});for(const n of t)n[0]?(c=!1,yield[n[0],void 0]):o&&(l=n[1],void 0===u?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):jv(e)&&(e[u]=l))}if(c)for(const u of t.refiner(e,a))c=!1,yield[u,void 0];c&&(yield[void 0,e])}class Gv{constructor(e){const{type:t,schema:n,validator:r,refiner:i,coercer:o=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=n,this.entries=s,this.coercer=o,this.validator=r?(e,t)=>Hv(r(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>Hv(i(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const n=qv(e,t);if(n[0])throw n[0]}(e,this)}create(e){return Vv(e,this)}is(e){return Wv(e,this)}mask(e){return function(e,t){const n=qv(e,t,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}(e,this)}validate(e,t={}){return qv(e,this,t)}}function Vv(e,t){const n=qv(e,t,{coerce:!0});if(n[0])throw n[0];return n[1]}function Wv(e,t){return!qv(e,t)[0]}function qv(e,t,n={}){const r=zv(e,t,n),i=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(r);if(i[0]){return[new Lv(i[0],(function*(){for(const e of r)e[0]&&(yield e[0])})),void 0]}return[void 0,i[1]]}function $v(e,t){return new Gv({type:e,schema:null,validator:t})}function Kv(e){return new Gv({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+Uv(e)})}function Yv(){return $v("boolean",(e=>"boolean"===typeof e))}function Xv(e){return $v("instance",(t=>t instanceof e||"Expected a `"+e.name+"` instance, but received: "+Uv(t)))}function Jv(e){const t=Uv(e),n=typeof e;return new Gv({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:n=>n===e||"Expected the literal `"+t+"`, but received: "+Uv(n)})}function Qv(){return $v("never",(()=>!1))}function ew(e){return new Gv({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})}function tw(){return $v("number",(e=>"number"===typeof e&&!isNaN(e)||"Expected a number, but received: "+Uv(e)))}function nw(e){return new Gv({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function rw(e,t){return new Gv({type:"record",schema:null,*entries(n){if(jv(n))for(const r in n){const i=n[r];yield[r,r,e],yield[r,i,t]}},validator:e=>jv(e)||"Expected an object, but received: "+Uv(e)})}function iw(){return $v("string",(e=>"string"===typeof e||"Expected a string, but received: "+Uv(e)))}function ow(e){const t=Qv();return new Gv({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(e.length,n.length);for(let i=0;iArray.isArray(e)||"Expected an array, but received: "+Uv(e)})}function sw(e){const t=Object.keys(e);return new Gv({type:"type",schema:e,*entries(n){if(jv(n))for(const r of t)yield[r,n[r],e[r]]},validator:e=>jv(e)||"Expected an object, but received: "+Uv(e)})}function aw(e){const t=e.map((e=>e.type)).join(" | ");return new Gv({type:"union",schema:null,validator(n,r){const i=[];for(const t of e){const[...e]=zv(n,t,r),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return["Expected the value to satisfy a union of `"+t+"`, but received: "+Uv(n),...i]}})}function cw(){return $v("unknown",(()=>!0))}function uw(e,t,n){return new Gv({...e,coercer:(r,i)=>Wv(r,t)?e.coercer(n(r,i),i):e.coercer(r,i)})}n(31198),n(66855),n(89062);const lw=[],dw=[],fw=[],pw=BigInt(0),hw=BigInt(1),mw=BigInt(2),gw=BigInt(7),yw=BigInt(256),bw=BigInt(113);for(let OT=0,RT=hw,DT=1,PT=0;OT<24;OT++){[DT,PT]=[PT,(2*DT+3*PT)%5],lw.push(2*(5*PT+DT)),dw.push((OT+1)*(OT+2)/2%64);let e=pw;for(let t=0;t<7;t++)RT=(RT<>gw)*bw)%yw,RT&mw&&(e^=hw<<(hw<n>32?Wy(e,t,n):Gy(e,t,n),Aw=(e,t,n)=>n>32?qy(e,t,n):Vy(e,t,n);class Ew extends My{constructor(e,t,n,r=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,xy(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}keccak(){Iy||Ry(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let r=0;r<10;r++)n[r]=e[r]^e[r+10]^e[r+20]^e[r+30]^e[r+40];for(let r=0;r<10;r+=2){const t=(r+8)%10,i=(r+2)%10,o=n[i],s=n[i+1],a=xw(o,s,1)^n[t],c=Aw(o,s,1)^n[t+1];for(let n=0;n<50;n+=10)e[r+n]^=a,e[r+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=dw[n],o=xw(t,i,r),s=Aw(t,i,r),a=lw[n];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let r=0;r<50;r+=10){for(let t=0;t<10;t++)n[t]=e[r+t];for(let t=0;t<10;t++)e[r+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=vw[r],e[1]^=ww[r]}n.fill(0)}(this.state32,this.rounds),Iy||Ry(this.state32),this.posOut=0,this.pos=0}update(e){_y(this);const{blockLen:t,state:n}=this,r=(e=Py(e)).length;for(let i=0;i=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return xy(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ky(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new Ew(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}const _w=(e,t,n)=>Ny((()=>new Ew(t,e,n))),kw=_w(1,136,32);class Tw extends My{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Ey(e);const n=Py(t);if(this.iHash=e.create(),"function"!==typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let o=0;onew Tw(e,t).update(n).digest();Sw.create=(e,t)=>new Tw(e,t);const{bytesToNumberBE:Cw,hexToBytes:Iw}=r,Ow={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=Ow;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(128&r[0])throw new t("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Cw(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Ow,n="string"===typeof e?Iw(e):e;ob(n);let r=n.length;if(r<2||48!=n[0])throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:i,l:o}=Ow._parseInt(n.subarray(2)),{d:s,l:a}=Ow._parseInt(o);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:s}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,n=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},r=t(n(e.s)),i=t(n(e.r)),o=r.length/2,s=i.length/2,a=n(o),c=n(s);return`30${n(s+o+4)}02${c}${i}02${a}${r}`}},Rw=BigInt(0),Dw=BigInt(1),Pw=(BigInt(2),BigInt(3));BigInt(4);function Bw(e){const t=function(e){const t=nv(e);Mb(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!==typeof n||"bigint"!==typeof n.beta||"function"!==typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{const i=t.toAffine();return _b(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),i=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function o(e){const{a:r,b:i}=t,o=n.sqr(e),s=n.mul(o,e);return n.add(n.add(s,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function s(e){return"bigint"===typeof e&&Rwn.eql(e,n.ZERO);return i(t)&&i(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(i(Eb("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw new Error("bad point: x or y not FE");const i=n.sqr(r),s=o(e);if(!n.eql(i,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){l(e);const{px:t,py:r,pz:i}=this,{px:o,py:s,pz:a}=e,c=n.eql(n.mul(t,a),n.mul(o,i)),u=n.eql(n.mul(r,a),n.mul(s,i));return c&&u}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,i=n.mul(r,Pw),{px:o,py:s,pz:a}=this;let c=n.ZERO,u=n.ZERO,l=n.ZERO,f=n.mul(o,o),p=n.mul(s,s),h=n.mul(a,a),m=n.mul(o,s);return m=n.add(m,m),l=n.mul(o,a),l=n.add(l,l),c=n.mul(e,l),u=n.mul(i,h),u=n.add(c,u),c=n.sub(p,u),u=n.add(p,u),u=n.mul(c,u),c=n.mul(m,c),l=n.mul(i,l),h=n.mul(e,h),m=n.sub(f,h),m=n.mul(e,m),m=n.add(m,l),l=n.add(f,f),f=n.add(l,f),f=n.add(f,h),f=n.mul(f,m),u=n.add(u,f),h=n.mul(s,a),h=n.add(h,h),f=n.mul(h,m),c=n.sub(c,f),l=n.mul(h,p),l=n.add(l,l),l=n.add(l,l),new d(c,u,l)}add(e){l(e);const{px:r,py:i,pz:o}=this,{px:s,py:a,pz:c}=e;let u=n.ZERO,f=n.ZERO,p=n.ZERO;const h=t.a,m=n.mul(t.b,Pw);let g=n.mul(r,s),y=n.mul(i,a),b=n.mul(o,c),v=n.add(r,i),w=n.add(s,a);v=n.mul(v,w),w=n.add(g,y),v=n.sub(v,w),w=n.add(r,o);let x=n.add(s,c);return w=n.mul(w,x),x=n.add(g,b),w=n.sub(w,x),x=n.add(i,o),u=n.add(a,c),x=n.mul(x,u),u=n.add(y,b),x=n.sub(x,u),p=n.mul(h,w),u=n.mul(m,b),p=n.add(u,p),u=n.sub(y,p),p=n.add(y,p),f=n.mul(u,p),y=n.add(g,g),y=n.add(y,g),b=n.mul(h,b),w=n.mul(m,w),y=n.add(y,b),b=n.sub(g,b),b=n.mul(h,b),w=n.add(w,b),g=n.mul(y,w),f=n.add(f,g),g=n.mul(x,w),u=n.mul(v,u),u=n.sub(u,g),g=n.mul(v,y),p=n.mul(x,p),p=n.add(p,g),new d(u,f,p)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return p.wNAFCached(this,u,e,(e=>{const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}))}multiplyUnsafe(e){const r=d.ZERO;if(e===Rw)return r;if(a(e),e===Dw)return this;const{endo:i}=t;if(!i)return p.unsafeLadder(this,e);let{k1neg:o,k1:s,k2neg:c,k2:u}=i.splitScalar(e),l=r,f=r,h=this;for(;s>Rw||u>Rw;)s&Dw&&(l=l.add(h)),u&Dw&&(f=f.add(h)),h=h.double(),s>>=Dw,u>>=Dw;return o&&(l=l.negate()),c&&(f=f.negate()),f=new d(n.mul(f.px,i.beta),f.py,f.pz),l.add(f)}multiply(e){a(e);let r,i,o=e;const{endo:s}=t;if(s){const{k1neg:e,k1:t,k2neg:a,k2:c}=s.splitScalar(o);let{p:u,f:l}=this.wNAF(t),{p:f,f:h}=this.wNAF(c);u=p.constTimeNegate(e,u),f=p.constTimeNegate(a,f),f=new d(n.mul(f.px,s.beta),f.py,f.pz),r=u.add(f),i=l.add(h)}else{const{p:e,f:t}=this.wNAF(o);r=e,i=t}return d.normalizeZ([r,i])[0]}multiplyAndAddUnsafe(e,t,n){const r=d.BASE,i=(e,t)=>t!==Rw&&t!==Dw&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,n));return o.is0()?void 0:o}toAffine(e){const{px:t,py:r,pz:i}=this,o=this.is0();null==e&&(e=o?n.ONE:n.inv(i));const s=n.mul(t,e),a=n.mul(r,e),c=n.mul(i,e);if(o)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw new Error("invZ was invalid");return{x:s,y:a}}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===Dw)return!0;if(n)return n(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===Dw?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return ab(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const f=t.nBitLength,p=tv(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:s}}function Mw(e){const t=function(e){const t=nv(e);return Mb(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r}=t,i=n.BYTES+1,o=2*n.BYTES+1;function s(e){return zb(e,r)}function a(e){return Wb(e,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:d}=Bw({...t,toBytes(e,t,r){const i=t.toAffine(),o=n.toBytes(i.x),s=_b;return r?s(Uint8Array.from([t.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,n.toBytes(i.y))},fromBytes(e){const t=e.length,r=e[0],s=e.subarray(1);if(t!==i||2!==r&&3!==r){if(t===o&&4===r){return{x:n.fromBytes(s.subarray(0,n.BYTES)),y:n.fromBytes(s.subarray(n.BYTES,2*n.BYTES))}}throw new Error(`Point of length ${t} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}{const e=bb(s);if(!(Rw<(a=e)&&aab(wb(e,t.nByteLength));function p(e){return e>r>>Dw}const h=(e,t,n)=>bb(e.slice(t,n));class m{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=Eb("compactSignature",e,2*n),new m(h(e,0,n),h(e,n,2*n))}static fromDER(e){const{r:t,s:n}=Ow.toSig(Eb("DER",e));return new m(t,n)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){const{r:r,s:i,recovery:o}=this,u=v(Eb("msgHash",e));if(null==o||![0,1,2,3].includes(o))throw new Error("recovery id invalid");const l=2===o||3===o?r+t.n:r;if(l>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=0===(1&o)?"02":"03",p=c.fromHex(d+f(l)),h=a(l),m=s(-u*h),g=s(i*h),y=c.BASE.multiplyAndAddUnsafe(p,m,g);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return yb(this.toDERHex())}toDERHex(){return Ow.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return yb(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const g={isValidPrivateKey(e){try{return u(e),!0}catch(IT){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const e=Jb(t.n);return function(e,t,n=!1){const r=e.length,i=Xb(t),o=Jb(t);if(r<16||r1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const s=zb(n?bb(e):vb(e),t-Fb)+Fb;return n?xb(s,i):wb(s,i)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function y(e){const t=ib(e),n="string"===typeof e,r=(t||n)&&e.length;return t?r===i||r===o:n?r===2*i||r===2*o:e instanceof c}const b=t.bits2int||function(e){const n=bb(e),r=8*e.length-t.nBitLength;return r>0?n>>BigInt(r):n},v=t.bits2int_modN||function(e){return s(b(e))},w=Ob(t.nBitLength);function x(e){if("bigint"!==typeof e)throw new Error("bigint expected");if(!(Rw<=e&&ee in i)))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:l}=t;let{lowS:f,prehash:h,extraEntropy:g}=i;null==f&&(f=!0),e=Eb("msgHash",e),h&&(e=Eb("prehashed msgHash",o(e)));const y=v(e),w=u(r),A=[x(w),x(y)];if(null!=g&&!1!==g){const e=!0===g?l(n.BYTES):g;A.push(Eb("extraEntropy",e))}const _=_b(...A),k=y;return{seed:_,k2sig:function(e){const t=b(e);if(!d(t))return;const n=a(t),r=c.BASE.multiply(t).toAffine(),i=s(r.x);if(i===Rw)return;const o=s(n*s(k+i*w));if(o===Rw)return;let u=(r.x===i?0:2)|Number(r.y&Dw),l=o;return f&&p(o)&&(l=function(e){return p(e)?s(-e):e}(o),u^=1),new m(i,l,u)}}}const E={lowS:t.lowS,prehash:!1},_={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(y(e))throw new Error("first arg must be private key");if(!y(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(u(e)).toRawBytes(n)},sign:function(e,n,r=E){const{seed:i,k2sig:o}=A(e,n,r),s=t;return Pb(s.hash.outputLen,s.nByteLength,s.hmac)(i,o)},verify:function(e,n,r,i=_){const o=e;if(n=Eb("msgHash",n),r=Eb("publicKey",r),"strict"in i)throw new Error("options.strict was renamed to lowS");const{lowS:u,prehash:l}=i;let d,f;try{if("string"===typeof o||ib(o))try{d=m.fromDER(o)}catch(A){if(!(A instanceof Ow.Err))throw A;d=m.fromCompact(o)}else{if("object"!==typeof o||"bigint"!==typeof o.r||"bigint"!==typeof o.s)throw new Error("PARSE");{const{r:e,s:t}=o;d=new m(e,t)}}f=c.fromHex(r)}catch(IT){if("PARSE"===IT.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&d.hasHighS())return!1;l&&(n=t.hash(n));const{r:p,s:h}=d,g=v(n),y=a(h),b=s(g*y),w=s(p*y),x=c.BASE.multiplyAndAddUnsafe(f,b,w)?.toAffine();return!!x&&s(x.x)===p},ProjectivePoint:c,Signature:m,utils:g}}function Nw(e){return{hash:e,hmac:(t,...n)=>Sw(e,t,By(...n)),randomBytes:Fy}}const Fw=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Lw=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),jw=BigInt(1),Uw=BigInt(2),Zw=(e,t)=>(e+t/Uw)/t;function Hw(e){const t=Fw,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,d=Vb(l,n,t)*l%t,f=Vb(d,n,t)*l%t,p=Vb(f,Uw,t)*u%t,h=Vb(p,i,t)*p%t,m=Vb(h,o,t)*h%t,g=Vb(m,a,t)*m%t,y=Vb(g,c,t)*g%t,b=Vb(y,a,t)*m%t,v=Vb(b,n,t)*l%t,w=Vb(v,s,t)*h%t,x=Vb(w,r,t)*u%t,A=Vb(x,Uw,t);if(!zw.eql(zw.sqr(A),e))throw new Error("Cannot find square root");return A}const zw=Yb(Fw,void 0,void 0,{sqrt:Hw}),Gw=function(e,t){const n=t=>Mw({...e,...Nw(t)});return Object.freeze({...n(t),create:n})}({a:BigInt(0),b:BigInt(7),Fp:zw,n:Lw,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Lw,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-jw*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,s=BigInt("0x100000000000000000000000000000000"),a=Zw(o*e,t),c=Zw(-r*e,t);let u=zb(e-a*n-c*i,t),l=zb(-a*r-c*o,t);const d=u>s,f=l>s;if(d&&(u=t-u),f&&(l=t-l),u>s||l>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:f,k2:l}}}},Bv);BigInt(0);Gw.ProjectivePoint;Ev.utils.randomPrivateKey;const Vw=()=>{const e=Ev.utils.randomPrivateKey(),t=Ww(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),{publicKey:t,secretKey:n}},Ww=Ev.getPublicKey;function qw(e){try{return Ev.ExtendedPoint.fromHex(e),!0}catch{return!1}}const $w=(e,t)=>Ev.sign(e,t.slice(0,32)),Kw=Ev.verify,Yw=e=>wy.lW.isBuffer(e)?e:e instanceof Uint8Array?wy.lW.from(e.buffer,e.byteOffset,e.byteLength):wy.lW.from(e);class Xw{constructor(e){Object.assign(this,e)}encode(){return wy.lW.from((0,Mv.serialize)(Jw,this))}static decode(e){return(0,Mv.deserialize)(Jw,this,e)}static decodeUnchecked(e){return(0,Mv.deserializeUnchecked)(Jw,this,e)}}const Jw=new Map;var Qw;const ex=32;let tx=1;class nx extends Xw{constructor(e){if(super({}),this._bn=void 0,function(e){return void 0!==e._bn}(e))this._bn=e._bn;else{if("string"===typeof e){const t=Iv().decode(e);if(t.length!=ex)throw new Error("Invalid public key input");this._bn=new(Sv())(t)}else this._bn=new(Sv())(e);if(this._bn.byteLength()>ex)throw new Error("Invalid public key input")}}static unique(){const e=new nx(tx);return tx+=1,new nx(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return Iv().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(wy.lW);if(e.length===ex)return e;const t=wy.lW.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,n){const r=wy.lW.concat([e.toBuffer(),wy.lW.from(t),n.toBuffer()]),i=Bv(r);return new nx(i)}static createProgramAddressSync(e,t){let n=wy.lW.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");n=wy.lW.concat([n,Yw(e)])})),n=wy.lW.concat([n,t.toBuffer(),wy.lW.from("ProgramDerivedAddress")]);const r=Bv(n);if(qw(r))throw new Error("Invalid seeds, address must fall off the curve");return new nx(r)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let n,r=255;for(;0!=r;){try{const i=e.concat(wy.lW.from([r]));n=this.createProgramAddressSync(i,t)}catch(i){if(i instanceof TypeError)throw i;r--;continue}return[n,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return qw(new nx(e).toBytes())}}Qw=nx,nx.default=new Qw("11111111111111111111111111111111"),Jw.set(nx,{kind:"struct",fields:[["_bn","u256"]]});new nx("BPFLoader1111111111111111111111111111111111");const rx=1232;class ix extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(ix.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class ox extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(ox.prototype,"name",{value:"TransactionExpiredTimeoutError"});class sx extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(sx.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class ax{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e256)throw new Error("Account index overflow encountered during compilation");const t=new Map;this.keySegments().flat().forEach(((e,n)=>{t.set(e.toBase58(),n)}));const n=e=>{const n=t.get(e.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return e.map((e=>({programIdIndex:n(e.programId),accountKeyIndexes:e.keys.map((e=>n(e.pubkey))),data:e.data})))}}const cx=(e="publicKey")=>Nv.Ik(32,e),ux=(e="string")=>{const t=Nv.n_([Nv.Jq("length"),Nv.Jq("lengthPadding"),Nv.Ik(Nv.cv(Nv.Jq(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t),i=t;return i.decode=(e,t)=>n(e,t).chars.toString(),i.encode=(e,t,n)=>{const i={chars:wy.lW.from(e,"utf8")};return r(i,t,n)},i.alloc=e=>Nv.Jq().span+Nv.Jq().span+wy.lW.from(e,"utf8").length,i};function lx(e,t){const n=e=>{if(e.span>=0)return e.span;if("function"===typeof e.alloc)return e.alloc(t[e.property]);if("count"in e&&"elementLayout"in e){const r=t[e.property];if(Array.isArray(r))return r.length*n(e.elementLayout)}else if("fields"in e)return lx({layout:e},t[e.property]);return 0};let r=0;return e.layout.fields.forEach((e=>{r+=n(e)})),r}function dx(e){let t=0,n=0;for(;;){let r=e.shift();if(t|=(127&r)<<7*n,n+=1,0===(128&r))break}return t}function fx(e,t){let n=t;for(;;){let t=127&n;if(n>>=7,0==n){e.push(t);break}t|=128,e.push(t)}}function px(e,t){if(!e)throw new Error(t||"Assertion failed")}class hx{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const n=new Map,r=e=>{const t=e.toBase58();let r=n.get(t);return void 0===r&&(r={isSigner:!1,isWritable:!1,isInvoked:!1},n.set(t,r)),r},i=r(t);i.isSigner=!0,i.isWritable=!0;for(const o of e){r(o.programId).isInvoked=!0;for(const e of o.keys){const t=r(e.pubkey);t.isSigner||=e.isSigner,t.isWritable||=e.isWritable}}return new hx(t,n)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];px(e.length<=256,"Max static account keys length exceeded");const t=e.filter((([,e])=>e.isSigner&&e.isWritable)),n=e.filter((([,e])=>e.isSigner&&!e.isWritable)),r=e.filter((([,e])=>!e.isSigner&&e.isWritable)),i=e.filter((([,e])=>!e.isSigner&&!e.isWritable)),o={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};{px(t.length>0,"Expected at least one writable signer key");const[e]=t[0];px(e===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...t.map((([e])=>new nx(e))),...n.map((([e])=>new nx(e))),...r.map((([e])=>new nx(e))),...i.map((([e])=>new nx(e)))]]}extractTableLookup(e){const[t,n]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&e.isWritable)),[r,i]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&!e.isWritable));if(0!==t.length||0!==r.length)return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:r},{writable:n,readonly:i}]}drainKeysFoundInLookupTable(e,t){const n=new Array,r=new Array;for(const[i,o]of this.keyMetaMap.entries())if(t(o)){const t=new nx(i),o=e.findIndex((e=>e.equals(t)));o>=0&&(px(o<256,"Max lookup table index exceeded"),n.push(o),r.push(t),this.keyMetaMap.delete(i))}return[n,r]}}const mx="Reached end of buffer unexpectedly";function gx(e){if(0===e.length)throw new Error(mx);return e.shift()}function yx(e,...t){const[n]=t;if(2===t.length?n+(t[1]??0)>e.length:n>=e.length)throw new Error(mx);return e.splice(...t)}class bx{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map((e=>new nx(e))),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach((e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex])))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map((e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:Iv().decode(e.data)})))}get addressTableLookups(){return[]}getAccountKeys(){return new ax(this.staticAccountKeys)}static compile(e){const t=hx.compile(e.instructions,e.payerKey),[n,r]=t.getMessageComponents(),i=new ax(r).compileInstructions(e.instructions).map((e=>({programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:Iv().encode(e.data)})));return new bx({header:n,accountKeys:r,recentBlockhash:e.recentBlockhash,instructions:i})}isAccountSigner(e){return e=this.header.numRequiredSignatures){return e-t!this.isProgramId(t)))}serialize(){const e=this.accountKeys.length;let t=[];fx(t,e);const n=this.instructions.map((e=>{const{accounts:t,programIdIndex:n}=e,r=Array.from(Iv().decode(e.data));let i=[];fx(i,t.length);let o=[];return fx(o,r.length),{programIdIndex:n,keyIndicesCount:wy.lW.from(i),keyIndices:t,dataLength:wy.lW.from(o),data:r}}));let r=[];fx(r,n.length);let i=wy.lW.alloc(rx);wy.lW.from(r).copy(i);let o=r.length;n.forEach((e=>{const t=Nv.n_([Nv.u8("programIdIndex"),Nv.Ik(e.keyIndicesCount.length,"keyIndicesCount"),Nv.A9(Nv.u8("keyIndex"),e.keyIndices.length,"keyIndices"),Nv.Ik(e.dataLength.length,"dataLength"),Nv.A9(Nv.u8("userdatum"),e.data.length,"data")]).encode(e,i,o);o+=t})),i=i.slice(0,o);const s=Nv.n_([Nv.Ik(1,"numRequiredSignatures"),Nv.Ik(1,"numReadonlySignedAccounts"),Nv.Ik(1,"numReadonlyUnsignedAccounts"),Nv.Ik(t.length,"keyCount"),Nv.A9(cx("key"),e,"keys"),cx("recentBlockhash")]),a={numRequiredSignatures:wy.lW.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:wy.lW.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:wy.lW.from([this.header.numReadonlyUnsignedAccounts]),keyCount:wy.lW.from(t),keys:this.accountKeys.map((e=>Yw(e.toBytes()))),recentBlockhash:Iv().decode(this.recentBlockhash)};let c=wy.lW.alloc(2048);const u=s.encode(a,c);return i.copy(c,u),c.slice(0,u+i.length)}static from(e){let t=[...e];const n=gx(t);if(n!==(127&n))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const r=gx(t),i=gx(t),o=dx(t);let s=[];for(let d=0;d({pubkey:e.toJSON(),isSigner:t,isWritable:n}))),programId:this.programId.toJSON(),data:[...this.data]}}}class xx{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){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,e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:n}=e;this.minNonceContextSlot=t,this.nonceInfo=n}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:n}=e;this.recentBlockhash=t,this.lastValidBlockHeight=n}else{const{recentBlockhash:t,nonceInfo:n}=e;n&&(this.nonceInfo=n),this.recentBlockhash=t}}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((e=>e.toJSON())),signers:this.signatures.map((({publicKey:e})=>e.toJSON()))}}add(...e){if(0===e.length)throw new Error("No instructions");return e.forEach((e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new wx(e))})),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t,n;if(this.nonceInfo?(e=this.nonceInfo.nonce,t=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");if(t.length<1&&console.warn("No instructions provided"),this.feePayer)n=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(let h=0;h{e.keys.forEach((e=>{i.push({...e})}));const t=e.programId.toString();r.includes(t)||r.push(t)})),r.forEach((e=>{i.push({pubkey:new nx(e),isSigner:!1,isWritable:!1})}));const o=[];i.forEach((e=>{const t=e.pubkey.toString(),n=o.findIndex((e=>e.pubkey.toString()===t));n>-1?(o[n].isWritable=o[n].isWritable||e.isWritable,o[n].isSigner=o[n].isSigner||e.isSigner):o.push(e)})),o.sort((function(e,t){if(e.isSigner!==t.isSigner)return e.isSigner?-1:1;if(e.isWritable!==t.isWritable)return e.isWritable?-1:1;return e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})}));const s=o.findIndex((e=>e.pubkey.equals(n)));if(s>-1){const[e]=o.splice(s,1);e.isSigner=!0,e.isWritable=!0,o.unshift(e)}else o.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(const h of this.signatures){const e=o.findIndex((e=>e.pubkey.equals(h.publicKey)));if(!(e>-1))throw new Error(`unknown signer: ${h.publicKey.toString()}`);o[e].isSigner||(o[e].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."))}let a=0,c=0,u=0;const l=[],d=[];o.forEach((({pubkey:e,isSigner:t,isWritable:n})=>{t?(l.push(e.toString()),a+=1,n||(c+=1)):(d.push(e.toString()),n||(u+=1))}));const f=l.concat(d),p=t.map((e=>{const{data:t,programId:n}=e;return{programIdIndex:f.indexOf(n.toString()),accounts:e.keys.map((e=>f.indexOf(e.pubkey.toString()))),data:Iv().encode(t)}}));return p.forEach((e=>{px(e.programIdIndex>=0),e.accounts.forEach((e=>px(e>=0)))})),new bx({header:{numRequiredSignatures:a,numReadonlySignedAccounts:c,numReadonlyUnsignedAccounts:u},accountKeys:f,recentBlockhash:e,instructions:p})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length){if(this.signatures.every(((e,n)=>t[n].equals(e.publicKey))))return e}return this.signatures=t.map((e=>({signature:null,publicKey:e}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(0===e.length)throw new Error("No signers");const t=new Set;this.signatures=e.filter((e=>{const n=e.toString();return!t.has(n)&&(t.add(n),!0)})).map((e=>({signature:null,publicKey:e})))}sign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,n=[];for(const i of e){const e=i.publicKey.toString();t.has(e)||(t.add(e),n.push(i))}this.signatures=n.map((e=>({signature:null,publicKey:e.publicKey})));const r=this._compile();this._partialSign(r,...n)}partialSign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,n=[];for(const i of e){const e=i.publicKey.toString();t.has(e)||(t.add(e),n.push(i))}const r=this._compile();this._partialSign(r,...n)}_partialSign(e,...t){const n=e.serialize();t.forEach((e=>{const t=$w(n,e.secretKey);this._addSignature(e.publicKey,Yw(t))}))}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){px(64===t.length);const n=this.signatures.findIndex((t=>e.equals(t.publicKey)));if(n<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[n].signature=wy.lW.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const n={};for(const{signature:r,publicKey:i}of this.signatures)null===r?t&&(n.missing||=[]).push(i):Kw(r,e,i.toBytes())||(n.invalid||=[]).push(i);return n.invalid||n.missing?n:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),r=this.serializeMessage();if(n){const e=this._getMessageSignednessErrors(r,t);if(e){let t="Signature verification failed.";throw e.invalid&&(t+=`\nInvalid signature for public key${1===e.invalid.length?"":"(s)"} [\`${e.invalid.map((e=>e.toBase58())).join("`, `")}\`].`),e.missing&&(t+=`\nMissing signature for public key${1===e.missing.length?"":"(s)"} [\`${e.missing.map((e=>e.toBase58())).join("`, `")}\`].`),new Error(t)}}return this._serialize(r)}_serialize(e){const{signatures:t}=this,n=[];fx(n,t.length);const r=n.length+64*t.length+e.length,i=wy.lW.alloc(r);return px(t.length<256),wy.lW.from(n).copy(i,0),t.forEach((({signature:e},t)=>{null!==e&&(px(64===e.length,"signature has invalid length"),wy.lW.from(e).copy(i,n.length+64*t))})),e.copy(i,n.length+64*t.length),px(i.length<=rx,`Transaction too large: ${i.length} > 1232`),i}get keys(){return px(1===this.instructions.length),this.instructions[0].keys.map((e=>e.pubkey))}get programId(){return px(1===this.instructions.length),this.instructions[0].programId}get data(){return px(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e];const n=dx(t);let r=[];for(let i=0;i0&&(n.feePayer=e.accountKeys[0]),t.forEach(((t,r)=>{const i={signature:t==Iv().encode(vx)?null:Iv().decode(t),publicKey:e.accountKeys[r]};n.signatures.push(i)})),e.instructions.forEach((t=>{const r=t.accounts.map((t=>{const r=e.accountKeys[t];return{pubkey:r,isSigner:n.signatures.some((e=>e.publicKey.toString()===r.toString()))||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}}));n.instructions.push(new wx({keys:r,programId:e.accountKeys[t.programIdIndex],data:Iv().decode(t.data)}))})),n._message=e,n._json=n.toJSON(),n}}const Ax=new nx("SysvarC1ock11111111111111111111111111111111"),Ex=(new nx("SysvarEpochSchedu1e111111111111111111111111"),new nx("Sysvar1nstructions1111111111111111111111111"),new nx("SysvarRecentB1ockHashes11111111111111111111")),_x=new nx("SysvarRent111111111111111111111111111111111"),kx=(new nx("SysvarRewards111111111111111111111111111111"),new nx("SysvarS1otHashes111111111111111111111111111"),new nx("SysvarS1otHistory11111111111111111111111111"),new nx("SysvarStakeHistory1111111111111111111111111"));async function Tx(e,t,n,r){const i=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},o=await e.sendTransaction(t,n,i);let s;if(null!=t.recentBlockhash&&null!=t.lastValidBlockHeight)s=(await e.confirmTransaction({abortSignal:r?.abortSignal,signature:o,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},r&&r.commitment)).value;else if(null!=t.minNonceContextSlot&&null!=t.nonceInfo){const{nonceInstruction:n}=t.nonceInfo,i=n.keys[0].pubkey;s=(await e.confirmTransaction({abortSignal:r?.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:i,nonceValue:t.nonceInfo.nonce,signature:o},r&&r.commitment)).value}else null!=r?.abortSignal&&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."),s=(await e.confirmTransaction(o,r&&r.commitment)).value;if(s.err)throw new Error(`Transaction ${o} failed (${JSON.stringify(s)})`);return o}function Sx(e){return new Promise((t=>setTimeout(t,e)))}function Cx(e,t){const n=e.layout.span>=0?e.layout.span:lx(e,t),r=wy.lW.alloc(n),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,r),r}const Ix=Nv._O("lamportsPerSignature"),Ox=Nv.n_([Nv.Jq("version"),Nv.Jq("state"),cx("authorizedPubkey"),cx("nonce"),Nv.n_([Ix],"feeCalculator")]),Rx=Ox.span;const Dx=(Px=8,e=>{const t=(0,Nv.Ik)(Px,e),{encode:n,decode:r}=(e=>({decode:e.decode.bind(e),encode:e.encode.bind(e)}))(t),i=t;return i.decode=(e,t)=>{const n=r(e,t);return(0,Fv.oU)(wy.lW.from(n))},i.encode=(e,t,r)=>{const i=(0,Fv.k$)(e,Px);return n(i,t,r)},i});var Px;const Bx=Object.freeze({Create:{index:0,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("lamports"),Nv.gM("space"),cx("programId")])},Assign:{index:1,layout:Nv.n_([Nv.Jq("instruction"),cx("programId")])},Transfer:{index:2,layout:Nv.n_([Nv.Jq("instruction"),Dx("lamports")])},CreateWithSeed:{index:3,layout:Nv.n_([Nv.Jq("instruction"),cx("base"),ux("seed"),Nv.gM("lamports"),Nv.gM("space"),cx("programId")])},AdvanceNonceAccount:{index:4,layout:Nv.n_([Nv.Jq("instruction")])},WithdrawNonceAccount:{index:5,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("lamports")])},InitializeNonceAccount:{index:6,layout:Nv.n_([Nv.Jq("instruction"),cx("authorized")])},AuthorizeNonceAccount:{index:7,layout:Nv.n_([Nv.Jq("instruction"),cx("authorized")])},Allocate:{index:8,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("space")])},AllocateWithSeed:{index:9,layout:Nv.n_([Nv.Jq("instruction"),cx("base"),ux("seed"),Nv.gM("space"),cx("programId")])},AssignWithSeed:{index:10,layout:Nv.n_([Nv.Jq("instruction"),cx("base"),ux("seed"),cx("programId")])},TransferWithSeed:{index:11,layout:Nv.n_([Nv.Jq("instruction"),Dx("lamports"),ux("seed"),cx("programId")])},UpgradeNonceAccount:{index:12,layout:Nv.n_([Nv.Jq("instruction")])}});class Mx{constructor(){}static createAccount(e){const t=Cx(Bx.Create,{lamports:e.lamports,space:e.space,programId:Yw(e.programId.toBuffer())});return new wx({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}static transfer(e){let t,n;if("basePubkey"in e){t=Cx(Bx.TransferWithSeed,{lamports:BigInt(e.lamports),seed:e.seed,programId:Yw(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{t=Cx(Bx.Transfer,{lamports:BigInt(e.lamports)}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new wx({keys:n,programId:this.programId,data:t})}static assign(e){let t,n;if("basePubkey"in e){t=Cx(Bx.AssignWithSeed,{base:Yw(e.basePubkey.toBuffer()),seed:e.seed,programId:Yw(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{t=Cx(Bx.Assign,{programId:Yw(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new wx({keys:n,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=Cx(Bx.CreateWithSeed,{base:Yw(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:Yw(e.programId.toBuffer())});let n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey!=e.fromPubkey&&n.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new wx({keys:n,programId:this.programId,data:t})}static createNonceAccount(e){const t=new xx;"basePubkey"in e&&"seed"in e?t.add(Mx.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:Rx,programId:this.programId})):t.add(Mx.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:Rx,programId:this.programId}));const n={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(n)),t}static nonceInitialize(e){const t=Cx(Bx.InitializeNonceAccount,{authorized:Yw(e.authorizedPubkey.toBuffer())}),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Ex,isSigner:!1,isWritable:!1},{pubkey:_x,isSigner:!1,isWritable:!1}],programId:this.programId,data:t};return new wx(n)}static nonceAdvance(e){const t=Cx(Bx.AdvanceNonceAccount),n={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Ex,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t};return new wx(n)}static nonceWithdraw(e){const t=Cx(Bx.WithdrawNonceAccount,{lamports:e.lamports});return new wx({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Ex,isSigner:!1,isWritable:!1},{pubkey:_x,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static nonceAuthorize(e){const t=Cx(Bx.AuthorizeNonceAccount,{authorized:Yw(e.newAuthorizedPubkey.toBuffer())});return new wx({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static allocate(e){let t,n;if("basePubkey"in e){t=Cx(Bx.AllocateWithSeed,{base:Yw(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:Yw(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{t=Cx(Bx.Allocate,{space:e.space}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new wx({keys:n,programId:this.programId,data:t})}}Mx.programId=new nx("11111111111111111111111111111111");class Nx{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/Nx.chunkSize)+1+1)}static async load(e,t,n,r,i){{const o=await e.getMinimumBalanceForRentExemption(i.length),s=await e.getAccountInfo(n.publicKey,"confirmed");let a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==i.length&&(a=a||new xx,a.add(Mx.allocate({accountPubkey:n.publicKey,space:i.length}))),s.owner.equals(r)||(a=a||new xx,a.add(Mx.assign({accountPubkey:n.publicKey,programId:r}))),s.lamports0?o:1,space:i.length,programId:r}));null!==a&&await Tx(e,a,[t,n],{commitment:"confirmed"})}const o=Nv.n_([Nv.Jq("instruction"),Nv.Jq("offset"),Nv.Jq("bytesLength"),Nv.Jq("bytesLengthPadding"),Nv.A9(Nv.u8("byte"),Nv.cv(Nv.Jq(),-8),"bytes")]),s=Nx.chunkSize;let a=0,c=i,u=[];for(;c.length>0;){const i=c.slice(0,s),l=wy.lW.alloc(s+16);o.encode({instruction:0,offset:a,bytes:i,bytesLength:0,bytesLengthPadding:0},l);const d=(new xx).add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0}],programId:r,data:l});if(u.push(Tx(e,d,[t,n],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")){const e=4;await Sx(1e3/e)}a+=s,c=c.slice(s)}await Promise.all(u);{const i=Nv.n_([Nv.Jq("instruction")]),o=wy.lW.alloc(i.span);i.encode({instruction:1},o);const s=(new xx).add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0},{pubkey:_x,isSigner:!1,isWritable:!1}],programId:r,data:o}),a="processed",c=await e.sendTransaction(s,[t,n],{preflightCommitment:a}),{context:u,value:l}=await e.confirmTransaction({signature:c,lastValidBlockHeight:s.lastValidBlockHeight,blockhash:s.recentBlockhash},a);if(l.err)throw new Error(`Transaction ${c} failed (${JSON.stringify(l)})`);for(;;){try{if(await e.getSlot({commitment:a})>u.slot)break}catch{}await new Promise((e=>setTimeout(e,Math.round(200))))}}return!0}}Nx.chunkSize=932;new nx("BPFLoader2111111111111111111111111111111111");Object.prototype.toString,Object.keys;Error;Error;globalThis.fetch;Nv.n_([Nv.Jq("typeIndex"),Dx("deactivationSlot"),Nv._O("lastExtendedSlot"),Nv.u8("lastExtendedStartIndex"),Nv.u8(),Nv.A9(cx(),Nv.cv(Nv.u8(),-1),"authority")]);const Fx=uw(Xv(nx),iw(),(e=>new nx(e))),Lx=ow([iw(),Jv("base64")]),jx=uw(Xv(wy.lW),Lx,(e=>wy.lW.from(e[0],"base64")));function Ux(e){return aw([sw({jsonrpc:Jv("2.0"),id:iw(),result:e}),sw({jsonrpc:Jv("2.0"),id:iw(),error:sw({code:cw(),message:iw(),data:nw($v("any",(()=>!0)))})})])}const Zx=Ux(cw());function Hx(e){return uw(Ux(e),Zx,(t=>"error"in t?t:{...t,result:Vv(t.result,e)}))}function zx(e){return Hx(sw({context:sw({slot:tw()}),value:e}))}function Gx(e){return sw({context:sw({slot:tw()}),value:e})}const Vx=sw({foundation:tw(),foundationTerm:tw(),initial:tw(),taper:tw(),terminal:tw()}),Wx=(Hx(Kv(ew(sw({epoch:tw(),effectiveSlot:tw(),amount:tw(),postBalance:tw(),commission:nw(ew(tw()))})))),Kv(sw({slot:tw(),prioritizationFee:tw()}))),qx=sw({total:tw(),validator:tw(),foundation:tw(),epoch:tw()}),$x=sw({epoch:tw(),slotIndex:tw(),slotsInEpoch:tw(),absoluteSlot:tw(),blockHeight:nw(tw()),transactionCount:nw(tw())}),Kx=sw({slotsPerEpoch:tw(),leaderScheduleSlotOffset:tw(),warmup:Yv(),firstNormalEpoch:tw(),firstNormalSlot:tw()}),Yx=rw(iw(),Kv(tw())),Xx=ew(aw([sw({}),iw()])),Jx=sw({err:Xx}),Qx=Jv("receivedSignature");sw({"solana-core":iw(),"feature-set":nw(tw())}),zx(sw({err:ew(aw([sw({}),iw()])),logs:ew(Kv(iw())),accounts:nw(ew(Kv(ew(sw({executable:Yv(),owner:iw(),lamports:tw(),data:Kv(iw()),rentEpoch:nw(tw())}))))),unitsConsumed:nw(tw()),returnData:nw(ew(sw({programId:iw(),data:ow([iw(),Jv("base64")])})))})),zx(sw({byIdentity:rw(iw(),Kv(tw())),range:sw({firstSlot:tw(),lastSlot:tw()})}));Hx(Vx),Hx(qx),Hx(Wx),Hx($x),Hx(Kx),Hx(Yx),Hx(tw()),zx(sw({total:tw(),circulating:tw(),nonCirculating:tw(),nonCirculatingAccounts:Kv(Fx)}));const eA=sw({amount:iw(),uiAmount:ew(tw()),decimals:tw(),uiAmountString:nw(iw())}),tA=(zx(Kv(sw({address:Fx,amount:iw(),uiAmount:ew(tw()),decimals:tw(),uiAmountString:nw(iw())}))),zx(Kv(sw({pubkey:Fx,account:sw({executable:Yv(),owner:Fx,lamports:tw(),data:jx,rentEpoch:tw()})}))),sw({program:iw(),parsed:cw(),space:tw()})),nA=(zx(Kv(sw({pubkey:Fx,account:sw({executable:Yv(),owner:Fx,lamports:tw(),data:tA,rentEpoch:tw()})}))),zx(Kv(sw({lamports:tw(),address:Fx}))),sw({executable:Yv(),owner:Fx,lamports:tw(),data:jx,rentEpoch:tw()})),rA=(sw({pubkey:Fx,account:nA}),uw(aw([Xv(wy.lW),tA]),aw([Lx,tA]),(e=>Array.isArray(e)?Vv(e,jx):e))),iA=sw({executable:Yv(),owner:Fx,lamports:tw(),data:rA,rentEpoch:tw()}),oA=(sw({pubkey:Fx,account:iA}),sw({state:aw([Jv("active"),Jv("inactive"),Jv("activating"),Jv("deactivating")]),active:tw(),inactive:tw()}),Hx(Kv(sw({signature:iw(),slot:tw(),err:Xx,memo:ew(iw()),blockTime:nw(ew(tw()))}))),Hx(Kv(sw({signature:iw(),slot:tw(),err:Xx,memo:ew(iw()),blockTime:nw(ew(tw()))}))),sw({subscription:tw(),result:Gx(nA)}),sw({pubkey:Fx,account:nA})),sA=(sw({subscription:tw(),result:Gx(oA)}),sw({parent:tw(),slot:tw(),root:tw()})),aA=(sw({subscription:tw(),result:sA}),aw([sw({type:aw([Jv("firstShredReceived"),Jv("completed"),Jv("optimisticConfirmation"),Jv("root")]),slot:tw(),timestamp:tw()}),sw({type:Jv("createdBank"),parent:tw(),slot:tw(),timestamp:tw()}),sw({type:Jv("frozen"),slot:tw(),timestamp:tw(),stats:sw({numTransactionEntries:tw(),numSuccessfulTransactions:tw(),numFailedTransactions:tw(),maxTransactionsPerEntry:tw()})}),sw({type:Jv("dead"),slot:tw(),timestamp:tw(),err:iw()})])),cA=(sw({subscription:tw(),result:aA}),sw({subscription:tw(),result:Gx(aw([Jx,Qx]))}),sw({subscription:tw(),result:tw()}),sw({pubkey:iw(),gossip:ew(iw()),tpu:ew(iw()),rpc:ew(iw()),version:ew(iw())}),sw({votePubkey:iw(),nodePubkey:iw(),activatedStake:tw(),epochVoteAccount:Yv(),epochCredits:Kv(ow([tw(),tw(),tw()])),commission:tw(),lastVote:tw(),rootSlot:ew(tw())})),uA=(Hx(sw({current:Kv(cA),delinquent:Kv(cA)})),aw([Jv("processed"),Jv("confirmed"),Jv("finalized")])),lA=sw({slot:tw(),confirmations:ew(tw()),err:Xx,confirmationStatus:nw(uA)}),dA=(zx(Kv(ew(lA))),Hx(tw()),sw({accountKey:Fx,writableIndexes:Kv(tw()),readonlyIndexes:Kv(tw())})),fA=sw({signatures:Kv(iw()),message:sw({accountKeys:Kv(iw()),header:sw({numRequiredSignatures:tw(),numReadonlySignedAccounts:tw(),numReadonlyUnsignedAccounts:tw()}),instructions:Kv(sw({accounts:Kv(tw()),data:iw(),programIdIndex:tw()})),recentBlockhash:iw(),addressTableLookups:nw(Kv(dA))})}),pA=sw({pubkey:Fx,signer:Yv(),writable:Yv(),source:nw(aw([Jv("transaction"),Jv("lookupTable")]))}),hA=sw({accountKeys:Kv(pA),signatures:Kv(iw())}),mA=sw({parsed:cw(),program:iw(),programId:Fx}),gA=sw({accounts:Kv(Fx),data:iw(),programId:Fx}),yA=uw(aw([gA,mA]),aw([sw({parsed:cw(),program:iw(),programId:iw()}),sw({accounts:Kv(iw()),data:iw(),programId:iw()})]),(e=>Vv(e,"accounts"in e?gA:mA))),bA=sw({signatures:Kv(iw()),message:sw({accountKeys:Kv(pA),instructions:Kv(yA),recentBlockhash:iw(),addressTableLookups:nw(ew(Kv(dA)))})}),vA=sw({accountIndex:tw(),mint:iw(),owner:nw(iw()),uiTokenAmount:eA}),wA=sw({writable:Kv(Fx),readonly:Kv(Fx)}),xA=sw({err:Xx,fee:tw(),innerInstructions:nw(ew(Kv(sw({index:tw(),instructions:Kv(sw({accounts:Kv(tw()),data:iw(),programIdIndex:tw()}))})))),preBalances:Kv(tw()),postBalances:Kv(tw()),logMessages:nw(ew(Kv(iw()))),preTokenBalances:nw(ew(Kv(vA))),postTokenBalances:nw(ew(Kv(vA))),loadedAddresses:nw(wA),computeUnitsConsumed:nw(tw())}),AA=sw({err:Xx,fee:tw(),innerInstructions:nw(ew(Kv(sw({index:tw(),instructions:Kv(yA)})))),preBalances:Kv(tw()),postBalances:Kv(tw()),logMessages:nw(ew(Kv(iw()))),preTokenBalances:nw(ew(Kv(vA))),postTokenBalances:nw(ew(Kv(vA))),loadedAddresses:nw(wA),computeUnitsConsumed:nw(tw())}),EA=aw([Jv(0),Jv("legacy")]),_A=sw({pubkey:iw(),lamports:tw(),postBalance:ew(tw()),rewardType:ew(iw()),commission:nw(ew(tw()))}),kA=(Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),transactions:Kv(sw({transaction:fA,meta:ew(xA),version:nw(EA)})),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),transactions:Kv(sw({transaction:hA,meta:ew(xA),version:nw(EA)})),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),transactions:Kv(sw({transaction:bA,meta:ew(AA),version:nw(EA)})),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),transactions:Kv(sw({transaction:hA,meta:ew(AA),version:nw(EA)})),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),rewards:nw(Kv(_A)),blockTime:ew(tw()),blockHeight:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),transactions:Kv(sw({transaction:fA,meta:ew(xA)})),rewards:nw(Kv(_A)),blockTime:ew(tw())}))),Hx(ew(sw({blockhash:iw(),previousBlockhash:iw(),parentSlot:tw(),signatures:Kv(iw()),blockTime:ew(tw())}))),Hx(ew(sw({slot:tw(),meta:ew(xA),blockTime:nw(ew(tw())),transaction:fA,version:nw(EA)}))),Hx(ew(sw({slot:tw(),transaction:bA,meta:ew(AA),blockTime:nw(ew(tw())),version:nw(EA)}))),zx(sw({blockhash:iw(),feeCalculator:sw({lamportsPerSignature:tw()})})),zx(sw({blockhash:iw(),lastValidBlockHeight:tw()})),zx(Yv()),Hx(Kv(sw({slot:tw(),numTransactions:tw(),numSlots:tw(),samplePeriodSecs:tw()}))),zx(ew(sw({feeCalculator:sw({lamportsPerSignature:tw()})}))),Hx(iw()),Hx(iw()),sw({err:Xx,logs:Kv(iw()),signature:iw()}));sw({result:Gx(kA),subscription:tw()});class TA{constructor(e){this._keypair=void 0,this._keypair=e??Vw()}static generate(){return new TA(Vw())}static fromSecretKey(e,t){if(64!==e.byteLength)throw new Error("bad secret key size");const n=e.slice(32,64);if(!t||!t.skipValidation){const t=e.slice(0,32),r=Ww(t);for(let e=0;e<32;e++)if(n[e]!==r[e])throw new Error("provided secretKey is invalid")}return new TA({publicKey:n,secretKey:e})}static fromSeed(e){const t=Ww(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),new TA({publicKey:t,secretKey:n})}get publicKey(){return new nx(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const SA=Object.freeze({CreateLookupTable:{index:0,layout:Nv.n_([Nv.Jq("instruction"),Dx("recentSlot"),Nv.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:Nv.n_([Nv.Jq("instruction")])},ExtendLookupTable:{index:2,layout:Nv.n_([Nv.Jq("instruction"),Dx(),Nv.A9(cx(),Nv.cv(Nv.Jq(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Nv.n_([Nv.Jq("instruction")])},CloseLookupTable:{index:4,layout:Nv.n_([Nv.Jq("instruction")])}});class CA{constructor(){}static createLookupTable(e){const[t,n]=nx.findProgramAddressSync([e.authority.toBuffer(),(0,Fv.k$)(BigInt(e.recentSlot),8)],this.programId),r=Cx(SA.CreateLookupTable,{recentSlot:BigInt(e.recentSlot),bumpSeed:n}),i=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Mx.programId,isSigner:!1,isWritable:!1}];return[new wx({programId:this.programId,keys:i,data:r}),t]}static freezeLookupTable(e){const t=Cx(SA.FreezeLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new wx({programId:this.programId,keys:n,data:t})}static extendLookupTable(e){const t=Cx(SA.ExtendLookupTable,{addresses:e.addresses.map((e=>e.toBytes()))}),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&n.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Mx.programId,isSigner:!1,isWritable:!1}),new wx({programId:this.programId,keys:n,data:t})}static deactivateLookupTable(e){const t=Cx(SA.DeactivateLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new wx({programId:this.programId,keys:n,data:t})}static closeLookupTable(e){const t=Cx(SA.CloseLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new wx({programId:this.programId,keys:n,data:t})}}CA.programId=new nx("AddressLookupTab1e1111111111111111111111111");const IA=Object.freeze({RequestUnits:{index:0,layout:Nv.n_([Nv.u8("instruction"),Nv.Jq("units"),Nv.Jq("additionalFee")])},RequestHeapFrame:{index:1,layout:Nv.n_([Nv.u8("instruction"),Nv.Jq("bytes")])},SetComputeUnitLimit:{index:2,layout:Nv.n_([Nv.u8("instruction"),Nv.Jq("units")])},SetComputeUnitPrice:{index:3,layout:Nv.n_([Nv.u8("instruction"),Dx("microLamports")])}});class OA{constructor(){}static requestUnits(e){const t=Cx(IA.RequestUnits,e);return new wx({keys:[],programId:this.programId,data:t})}static requestHeapFrame(e){const t=Cx(IA.RequestHeapFrame,e);return new wx({keys:[],programId:this.programId,data:t})}static setComputeUnitLimit(e){const t=Cx(IA.SetComputeUnitLimit,e);return new wx({keys:[],programId:this.programId,data:t})}static setComputeUnitPrice(e){const t=Cx(IA.SetComputeUnitPrice,{microLamports:BigInt(e.microLamports)});return new wx({keys:[],programId:this.programId,data:t})}}OA.programId=new nx("ComputeBudget111111111111111111111111111111");const RA=Nv.n_([Nv.u8("numSignatures"),Nv.u8("padding"),Nv.KB("signatureOffset"),Nv.KB("signatureInstructionIndex"),Nv.KB("publicKeyOffset"),Nv.KB("publicKeyInstructionIndex"),Nv.KB("messageDataOffset"),Nv.KB("messageDataSize"),Nv.KB("messageInstructionIndex")]);class DA{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:n,signature:r,instructionIndex:i}=e;px(32===t.length,`Public Key must be 32 bytes but received ${t.length} bytes`),px(64===r.length,`Signature must be 64 bytes but received ${r.length} bytes`);const o=RA.span,s=o+t.length,a=s+r.length,c=wy.lW.alloc(a+n.length),u=null==i?65535:i;return RA.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:u,publicKeyOffset:o,publicKeyInstructionIndex:u,messageDataOffset:a,messageDataSize:n.length,messageInstructionIndex:u},c),c.fill(t,o),c.fill(r,s),c.fill(n,a),new wx({keys:[],programId:DA.programId,data:c})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:n,instructionIndex:r}=e;px(64===t.length,`Private key must be 64 bytes but received ${t.length} bytes`);try{const e=TA.fromSecretKey(t),i=e.publicKey.toBytes(),o=$w(n,e.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:o,instructionIndex:r})}catch(IT){throw new Error(`Error creating instruction; ${IT}`)}}}DA.programId=new nx("Ed25519SigVerify111111111111111111111111111");Gw.utils.isValidPrivateKey;const PA=Gw.getPublicKey,BA=Nv.n_([Nv.u8("numSignatures"),Nv.KB("signatureOffset"),Nv.u8("signatureInstructionIndex"),Nv.KB("ethAddressOffset"),Nv.u8("ethAddressInstructionIndex"),Nv.KB("messageDataOffset"),Nv.KB("messageDataSize"),Nv.u8("messageInstructionIndex"),Nv.Ik(20,"ethAddress"),Nv.Ik(64,"signature"),Nv.u8("recoveryId")]);class MA{constructor(){}static publicKeyToEthAddress(e){px(64===e.length,`Public key must be 64 bytes but received ${e.length} bytes`);try{return wy.lW.from(kw(Yw(e))).slice(-20)}catch(IT){throw new Error(`Error constructing Ethereum address: ${IT}`)}}static createInstructionWithPublicKey(e){const{publicKey:t,message:n,signature:r,recoveryId:i,instructionIndex:o}=e;return MA.createInstructionWithEthAddress({ethAddress:MA.publicKeyToEthAddress(t),message:n,signature:r,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:n,signature:r,recoveryId:i,instructionIndex:o=0}=e;let s;s="string"===typeof t?t.startsWith("0x")?wy.lW.from(t.substr(2),"hex"):wy.lW.from(t,"hex"):t,px(20===s.length,`Address must be 20 bytes but received ${s.length} bytes`);const a=12+s.length,c=a+r.length+1,u=wy.lW.alloc(BA.span+n.length);return BA.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:o,ethAddressOffset:12,ethAddressInstructionIndex:o,messageDataOffset:c,messageDataSize:n.length,messageInstructionIndex:o,signature:Yw(r),ethAddress:Yw(s),recoveryId:i},u),u.fill(Yw(n),BA.span),new wx({keys:[],programId:MA.programId,data:u})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:n,instructionIndex:r}=e;px(32===t.length,`Private key must be 32 bytes but received ${t.length} bytes`);try{const e=Yw(t),i=PA(e,!1).slice(1),o=wy.lW.from(kw(Yw(n))),[s,a]=((e,t)=>{const n=Gw.sign(e,t);return[n.toCompactRawBytes(),n.recovery]})(o,e);return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:s,recoveryId:a,instructionIndex:r})}catch(IT){throw new Error(`Error creating instruction; ${IT}`)}}}var NA;MA.programId=new nx("KeccakSecp256k11111111111111111111111111111");const FA=new nx("StakeConfig11111111111111111111111111111111");class LA{constructor(e,t,n){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=n}}NA=LA,LA.default=new NA(0,0,nx.default);const jA=Object.freeze({Initialize:{index:0,layout:Nv.n_([Nv.Jq("instruction"),((e="authorized")=>Nv.n_([cx("staker"),cx("withdrawer")],e))(),((e="lockup")=>Nv.n_([Nv.gM("unixTimestamp"),Nv.gM("epoch"),cx("custodian")],e))()])},Authorize:{index:1,layout:Nv.n_([Nv.Jq("instruction"),cx("newAuthorized"),Nv.Jq("stakeAuthorizationType")])},Delegate:{index:2,layout:Nv.n_([Nv.Jq("instruction")])},Split:{index:3,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("lamports")])},Withdraw:{index:4,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("lamports")])},Deactivate:{index:5,layout:Nv.n_([Nv.Jq("instruction")])},Merge:{index:7,layout:Nv.n_([Nv.Jq("instruction")])},AuthorizeWithSeed:{index:8,layout:Nv.n_([Nv.Jq("instruction"),cx("newAuthorized"),Nv.Jq("stakeAuthorizationType"),ux("authoritySeed"),cx("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class UA{constructor(){}static initialize(e){const{stakePubkey:t,authorized:n,lockup:r}=e,i=r||LA.default,o=Cx(jA.Initialize,{authorized:{staker:Yw(n.staker.toBuffer()),withdrawer:Yw(n.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:Yw(i.custodian.toBuffer())}}),s={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:_x,isSigner:!1,isWritable:!1}],programId:this.programId,data:o};return new wx(s)}static createAccountWithSeed(e){const t=new xx;t.add(Mx.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:n,authorized:r,lockup:i}=e;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static createAccount(e){const t=new xx;t.add(Mx.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:n,authorized:r,lockup:i}=e;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:n,votePubkey:r}=e,i=Cx(jA.Delegate);return(new xx).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:kx,isSigner:!1,isWritable:!1},{pubkey:FA,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(e){const{stakePubkey:t,authorizedPubkey:n,newAuthorizedPubkey:r,stakeAuthorizationType:i,custodianPubkey:o}=e,s=Cx(jA.Authorize,{newAuthorized:Yw(r.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),(new xx).add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:n,authoritySeed:r,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=e,c=Cx(jA.AuthorizeWithSeed,{newAuthorized:Yw(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:r,authorityOwner:Yw(i.toBuffer())}),u=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:Ax,isSigner:!1,isWritable:!1}];return a&&u.push({pubkey:a,isSigner:!0,isWritable:!1}),(new xx).add({keys:u,programId:this.programId,data:c})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:i}=e,o=Cx(jA.Split,{lamports:i});return new wx({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(e,t){const n=new xx;return n.add(Mx.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space:this.space,programId:this.programId})),n.add(this.splitInstruction(e))}static splitWithSeed(e,t){const{stakePubkey:n,authorizedPubkey:r,splitStakePubkey:i,basePubkey:o,seed:s,lamports:a}=e,c=new xx;return c.add(Mx.allocate({accountPubkey:i,basePubkey:o,seed:s,space:this.space,programId:this.programId})),t&&t>0&&c.add(Mx.transfer({fromPubkey:e.authorizedPubkey,toPubkey:i,lamports:t})),c.add(this.splitInstruction({stakePubkey:n,authorizedPubkey:r,splitStakePubkey:i,lamports:a}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:n,authorizedPubkey:r}=e,i=Cx(jA.Merge);return(new xx).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:kx,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:n,toPubkey:r,lamports:i,custodianPubkey:o}=e,s=Cx(jA.Withdraw,{lamports:i}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:kx,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),(new xx).add({keys:a,programId:this.programId,data:s})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:n}=e,r=Cx(jA.Deactivate);return(new xx).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}UA.programId=new nx("Stake11111111111111111111111111111111111111"),UA.space=200;const ZA=Object.freeze({InitializeAccount:{index:0,layout:Nv.n_([Nv.Jq("instruction"),((e="voteInit")=>Nv.n_([cx("nodePubkey"),cx("authorizedVoter"),cx("authorizedWithdrawer"),Nv.u8("commission")],e))()])},Authorize:{index:1,layout:Nv.n_([Nv.Jq("instruction"),cx("newAuthorized"),Nv.Jq("voteAuthorizationType")])},Withdraw:{index:3,layout:Nv.n_([Nv.Jq("instruction"),Nv.gM("lamports")])},UpdateValidatorIdentity:{index:4,layout:Nv.n_([Nv.Jq("instruction")])},AuthorizeWithSeed:{index:10,layout:Nv.n_([Nv.Jq("instruction"),((e="voteAuthorizeWithSeedArgs")=>Nv.n_([Nv.Jq("voteAuthorizationType"),cx("currentAuthorityDerivedKeyOwnerPubkey"),ux("currentAuthorityDerivedKeySeed"),cx("newAuthorized")],e))()])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class HA{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:n,voteInit:r}=e,i=Cx(ZA.InitializeAccount,{voteInit:{nodePubkey:Yw(r.nodePubkey.toBuffer()),authorizedVoter:Yw(r.authorizedVoter.toBuffer()),authorizedWithdrawer:Yw(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:_x,isSigner:!1,isWritable:!1},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new wx(o)}static createAccount(e){const t=new xx;return t.add(Mx.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:t,authorizedPubkey:n,newAuthorizedPubkey:r,voteAuthorizationType:i}=e,o=Cx(ZA.Authorize,{newAuthorized:Yw(r.toBuffer()),voteAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new xx).add({keys:s,programId:this.programId,data:o})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:s}=e,a=Cx(ZA.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Yw(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:Yw(i.toBuffer()),voteAuthorizationType:o.index}}),c=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:Ax,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new xx).add({keys:c,programId:this.programId,data:a})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:n,lamports:r,toPubkey:i}=e,o=Cx(ZA.Withdraw,{lamports:r}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new xx).add({keys:s,programId:this.programId,data:o})}static safeWithdraw(e,t,n){if(e.lamports>t-n)throw new Error("Withdraw will leave vote account with insufficient funds.");return HA.withdraw(e)}static updateValidatorIdentity(e){const{votePubkey:t,authorizedWithdrawerPubkey:n,nodePubkey:r}=e,i=Cx(ZA.UpdateValidatorIdentity),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new xx).add({keys:o,programId:this.programId,data:i})}}HA.programId=new nx("Vote111111111111111111111111111111111111111"),HA.space=3762;new nx("Va1idator1nfo111111111111111111111111111111"),sw({name:iw(),website:nw(iw()),details:nw(iw()),keybaseUsername:nw(iw())});new nx("Vote111111111111111111111111111111111111111"),Nv.n_([cx("nodePubkey"),cx("authorizedWithdrawer"),Nv.u8("commission"),Nv._O(),Nv.A9(Nv.n_([Nv._O("slot"),Nv.Jq("confirmationCount")]),Nv.cv(Nv.Jq(),-8),"votes"),Nv.u8("rootSlotValid"),Nv._O("rootSlot"),Nv._O(),Nv.A9(Nv.n_([Nv._O("epoch"),cx("authorizedVoter")]),Nv.cv(Nv.Jq(),-8),"authorizedVoters"),Nv.n_([Nv.A9(Nv.n_([cx("authorizedPubkey"),Nv._O("epochOfLastAuthorizedSwitch"),Nv._O("targetEpoch")]),32,"buf"),Nv._O("idx"),Nv.u8("isEmpty")],"priorVoters"),Nv._O(),Nv.A9(Nv.n_([Nv._O("epoch"),Nv._O("credits"),Nv._O("prevCredits")]),Nv.cv(Nv.Jq(),-8),"epochCredits"),Nv.n_([Nv._O("slot"),Nv._O("timestamp")],"lastTimestamp")]);var zA=n(67996),GA=n(48764).Buffer;function VA(e){return e.replace(/^0x/,"")}function WA(e){if(function(e){return qA.test(e)}(e))return new nx(e).toBytes();if(e.startsWith("0x")&&e.length<=66)return(0,Zc.arrayify)((t=e,(0,Zc.hexZeroPad)(t,32)));var t;throw new Error("Invalid address")}var qA=/^([1-9A-HJ-NP-Za-km-z]{32,44})$/;var $A=Cc.O$.from("0xffffffffffffffffffffffffffffffff");var KA=class e{workerOptions=[];constructor(){}static newOptions(){return new e}static fromOptions(t){const n=new e,r=(0,Zc.arrayify)(t),i=Cc.O$.from(r.slice(0,2)).toNumber();if(3===i){let e=2;for(;e{for(const n of t.options)if(1===t.workerId)e+=VA((0,zA.pack)(["uint8","uint16","uint8","bytes"],[t.workerId,VA(n.params).length/2+1,n.type,n.params]));else if(2===t.workerId){const r=n;e+=VA((0,zA.pack)(["uint8","uint16","uint8","uint8","bytes"],[t.workerId,VA(n.params).length/2+2,r.index,r.type,r.params]))}})),e}toBytes(){return(0,Zc.arrayify)(this.toHex())}addOption(e,t){const n=this.workerOptions.find((t=>t.workerId===e));n?n.options.push(t):this.workerOptions.push({workerId:e,options:[t]})}decodeExecutorLzReceiveOption(){let e=this.findOptions(1,1);if(void 0===e||Array.isArray(e)&&0===e.length)return;let t=Cc.O$.from(0).toBigInt(),n=Cc.O$.from(0).toBigInt();e=Array.isArray(e)?e:[e];for(const r of e){const e=GA.from(VA(r.params),"hex");t+=Cc.O$.from(e.subarray(0,16)).toBigInt(),n+=Cc.O$.from(16===e.length?0:e.subarray(16,32)).toBigInt()}return{gas:t,value:n}}decodeExecutorNativeDropOption(){const e=this.findOptions(1,2);if(!e||0===e.length)return[];const t=e.reduce(((e,t)=>{const n=GA.from(VA(t.params),"hex"),r=Cc.O$.from(n.subarray(0,16)).toBigInt(),i=(0,Zc.hexlify)(n.subarray(16,48));return e[i]?e[i].amount=e[i].amount+r:e[i]={amount:r,receiver:i},e}),{});return Object.values(t)}decodeExecutorComposeOption(){const e=this.findOptions(1,3);if(!e||0===e.length)return[];const t=e.reduce(((e,t)=>{const n=GA.from(VA(t.params),"hex"),r=Cc.O$.from(n.subarray(0,2)).toNumber(),i=Cc.O$.from(n.subarray(2,18)).toBigInt(),o=(34===n.length?Cc.O$.from(n.subarray(18,34)):Cc.O$.from(0)).toBigInt();return e[r]?(e[r].gas=e[r].gas+i,e[r].value=e[r].value+o):e[r]={index:r,gas:i,value:o},e}),{});return Object.values(t)}decodeExecutorOrderedExecutionOption(){return void 0!==this.findOptions(1,4)}findOptions(e,t){const n=this.workerOptions.find((t=>t.workerId===e));if(n)return 4===t?n.options.find((e=>e.type===t)):n.options.filter((e=>e.type===t))}findVerifierOption(e,t){const n=this.workerOptions.find((e=>2===e.workerId));if(n){const r=n.options.find((n=>n.type===t&&n.index===e));if(r)return r}}};var YA=n(45703);function XA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function JA(e){for(var t=1;tNumber(c)?r("-1"):r(e.target.value))},inputProps:{"aria-label":"amount input",style:{fontSize:"21px",lineHeight:"28,01px",padding:0,height:"28px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},inputComponent:iE}),""!==t&&!o&&(0,hc.jsx)(Ed.Z,{sx:{minWidth:0,p:0,left:8,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},onClick:function(){r&&r("")},disabled:i,children:(0,hc.jsx)(lp.Z,{height:16})}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center"},"data-cy":"assetsSelectedOption_".concat(w.symbol.toUpperCase()),children:[(0,hc.jsx)(vp.UD,{symbol:w.symbol,logoURI:w.logoURI,sx:{mr:2,ml:4}}),(0,hc.jsx)(dc.Z,{variant:"main16",color:"text.primary",children:n})]})]}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",height:"16px"},children:[(0,hc.jsx)(uc.Z,{sx:{flex:1}}),w.balance&&(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsxs)(dc.Z,{component:"div",variant:"secondary12",color:"text.secondary",children:[d&&""!==d?d:(0,hc.jsx)(sc.cC,{id:"Balance"})," ",(0,hc.jsx)(kd.B,{value:w.balance,compact:!0,variant:"secondary12",color:"text.secondary",symbolsColor:"text.disabled"})]}),!o&&r&&(0,hc.jsx)(fc.Z,{size:"small",sx:{minWidth:0,ml:"7px",p:0},onClick:function(){h&&b(h.eventName,rE({},h.eventParams)),r("-1")},disabled:i||u,children:(0,hc.jsx)(sc.cC,{id:"Max"})})]})]})]})]})):null},sE=function(e){var t=e.balance,n=e.inputAmount;return Number(n)>Number(t)?(0,hc.jsx)(Sd.v,{severity:"error",sx:{mt:4},icon:!1,children:(0,hc.jsx)(dc.Z,{variant:"caption",children:(0,hc.jsx)(sc.cC,{id:"Your balance is lower than the selected amount."})})}):null},aE=function(e){var t=e.txHash,n=e.amount,r=e.symbol,i=e.iconSymbol,o=e.outAmount,s=e.outSymbol,a=e.outIconSymbol,c=e.iconUri,u=e.outIconUri;return(0,hc.jsx)(Hp,{explorer:"https://layerzeroscan.com/tx/",txHash:t,children:(0,hc.jsxs)(uc.Z,{sx:{mt:2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"},children:[(0,hc.jsx)(dc.Z,{children:(0,hc.jsx)(sc.cC,{id:"You've successfully bridged tokens."})}),(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",gap:2,mt:3},children:[(0,hc.jsx)(vp.UD,{sx:{fontSize:"20px"},logoURI:c,symbol:i}),(0,hc.jsx)(kd.B,{value:Number(n),compact:!0,variant:"main14"}),(0,hc.jsx)(dc.Z,{variant:"secondary14",children:r}),(0,hc.jsx)(lc.Z,{sx:{fontSize:"14px"},children:(0,hc.jsx)(Fp,{fontSize:"14px"})}),(0,hc.jsx)(vp.UD,{sx:{fontSize:"20px"},logoURI:u,symbol:a}),(0,hc.jsx)(kd.B,{value:Number(o),variant:"main14"}),(0,hc.jsx)(dc.Z,{variant:"secondary14",children:s})]})]})})},cE=function(e){var t=e.supportedNetworks,n=e.sourceChainId,r=e.setSourceChainId,i=e.destChainId,o=e.setDestChainId,s=e.tokens,a=e.selectedNetworkConfig,c=e.destNetworkConfig,u=(0,ec.useState)(""),l=u[0],d=u[1],f=(0,dd.vR)(),p=f.mainTxState,h=f.txError,m=f.setTxError,g=(0,bc.Yh)((function(e){return e.account})),y=function(){var e=s.find((function(e){return e.chainId===n}));return null!==e&&void 0!==e?e:s[0]},b=(0,ec.useState)((function(){return y()})),v=b[0],w=b[1],x=(0,ec.useState)(0),A=x[0],E=x[1];(0,ec.useEffect)((function(){var e;w(y());var t=s.find((function(e){return e.chainId===i}));E(null!==(e=null===t||void 0===t?void 0:t.eId)&&void 0!==e?e:0)}),[s]),(0,ec.useEffect)((function(){var e,t=s.find((function(e){return e.chainId===i}));E(null!==(e=null===t||void 0===t?void 0:t.eId)&&void 0!==e?e:0)}),[i,n]);var _=(0,ic.Z)().readOnlyModeAddress,k=(0,Cd.Q)(n);if(p.success)return(0,hc.jsx)(aE,{txHash:p.txHash,amount:l,symbol:v.symbol,iconSymbol:v.symbol,iconUri:a.networkLogoPath,outSymbol:v.symbol,outIconSymbol:v.symbol,outIconUri:c.networkLogoPath,outAmount:l});return(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(dc.Z,{variant:"h2",sx:{mb:3},children:"Bridge ZERO"}),(0,hc.jsx)(dc.Z,{variant:"description",sx:{mb:3},children:"Bridge ZERO to other networks using LayerZero."}),k.isWrongNetwork&&!_&&(0,hc.jsx)(Rd.I,{networkName:(0,oc.Mo)(n).name,chainId:n,event:{eventName:wc.vh.SWITCH_NETWORK}}),v?(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"left"},children:(0,hc.jsx)(vy,{networks:t,selectedNetwork:n,setSelectedNetwork:function(e){m(void 0),r(e)},isSource:!0})}),(0,hc.jsx)(uc.Z,{sx:{display:"flex",gap:"15px",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative"},children:(0,hc.jsx)(oE,{assets:s,value:l,onChange:function(e){m(void 0),d("-1"===e?v.balance:e)},usdValue:"0",symbol:v.symbol,inputTitle:" ",sx:{width:"100%"},chainId:n})}),(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"left",mt:4},children:(0,hc.jsx)(vy,{networks:t,selectedNetwork:i,setSelectedNetwork:function(e){m(void 0),o(e)},isSource:!1,sourceChainId:n})}),(0,hc.jsx)(uc.Z,{sx:{display:"flex",gap:"15px",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative"},children:(0,hc.jsx)(oE,{assets:s,value:l,usdValue:"0",symbol:v.symbol,disableInput:!0,inputTitle:" ",sx:{width:"100%"},chainId:i})}),g?(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(sE,{balance:v.balance,inputAmount:l}),h&&(0,hc.jsx)(Dd.Q,{txError:h}),(0,hc.jsx)(QA,{isWrongNetwork:k.isWrongNetwork,inputAmount:l,inputToken:v.address,outputToken:v.address,inputName:v.name,outputName:v.name,blocked:Number(l)>Number(v.balance)||!g,chainId:n,targetEId:A})]}):(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:4,alignItems:"center"},children:[(0,hc.jsx)(dc.Z,{sx:{mb:6,textAlign:"center"},color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Please connect your wallet to be able to bridge ZERO."})}),(0,hc.jsx)(kc.p,{})]})]}):(0,hc.jsx)(_c.Z,{})]})};function uE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lE(e){for(var t=1;t=1?(0,hc.jsx)(cE,{sourceChainId:c,setSourceChainId:u,destChainId:f,setDestChainId:p,supportedNetworks:gy,tokens:x,selectedNetworkConfig:y,destNetworkConfig:b},c):s?(0,hc.jsx)(uc.Z,{sx:{width:"100%",display:"flex",justifyContent:"center",my:"60px"},children:(0,hc.jsx)(_c.Z,{})}):(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:4,alignItems:"center"},children:[(0,hc.jsx)(dc.Z,{sx:{mb:6,mt:4,textAlign:"center"},color:"text.secondary",children:(0,hc.jsx)(sc.cC,{id:"Please connect your wallet to be able to bridge ZERO."})}),(0,hc.jsx)(kc.p,{})]})})},hE=n(90452),mE=n(31041),gE=n(31630),yE=n(97452),bE=n(52864),vE=n(65637),wE=n(5906),xE=["from"],AE=["from"];function EE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _E(e){for(var t=1;t(0,dm.Z)({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},t&&!e.vars&&{colorScheme:e.palette.mode}),OE=e=>(0,dm.Z)({color:(e.vars||e).palette.text.primary},e.typography.body1,{backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}});var RE=function(e){const t=(0,mm.Z)({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=t;return(0,hc.jsxs)(ec.Fragment,{children:[(0,hc.jsx)(CE.Z,{styles:e=>((e,t=!1)=>{var n,r;const i={};t&&e.colorSchemes&&Object.entries(e.colorSchemes).forEach((([t,n])=>{var r;i[e.getColorSchemeSelector(t).replace(/\s*&/,"")]={colorScheme:null==(r=n.palette)?void 0:r.mode}}));let o=(0,dm.Z)({html:IE(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:(0,dm.Z)({margin:0},OE(e),{"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}})},i);const s=null==(n=e.components)||null==(r=n.MuiCssBaseline)?void 0:r.styleOverrides;return s&&(o=[o,s]),o})(e,r)}),n]})},DE=n(19762),PE=n(44819),BE=n(56760);var ME="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";var NE=function(e){const{children:t,theme:n}=e,r=(0,BE.Z)(),i=ec.useMemo((()=>{const e=null===r?n:function(e,t){if("function"===typeof t)return t(e);return(0,dm.Z)({},e,t)}(r,n);return null!=e&&(e[ME]=null!==r),e}),[n,r]);return(0,hc.jsx)(PE.Z.Provider,{value:i,children:t})},FE=n(96682);function LE(e){const t=(0,FE.Z)();return(0,hc.jsx)(y.T.Provider,{value:"object"===typeof t?t:{},children:e.children})}var jE=function(e){const{children:t,theme:n}=e;return(0,hc.jsx)(NE,{theme:n,children:(0,hc.jsx)(LE,{children:t})})},UE=n(59766),ZE=n(38264);var HE=ec.forwardRef((function(e,t){return ec.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),ec.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))}));function zE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function GE(e){for(var t=1;t div:first-of-type":{minHeight:"100vh",display:"flex",flexDirection:"column"}}}},MuiSvgIcon:{styleOverrides:{colorPrimary:{color:e.palette.primary.light}}},MuiSelect:{defaultProps:{IconComponent:function(e){return(0,hc.jsx)(lc.Z,GE(GE({sx:{fontSize:"16px"}},e),{},{children:(0,hc.jsx)(Bd.Z,{})}))}},styleOverrides:{outlined:GE(GE({backgroundColor:e.palette.background.surface},e.typography.buttonM),{},{padding:"6px 12px",color:e.palette.primary.light})}},MuiLinearProgress:{styleOverrides:{bar1Indeterminate:{background:e.palette.gradients.aaveGradient},bar2Indeterminate:{background:e.palette.gradients.aaveGradient}}}}}}(e))}),[r]);return(0,hc.jsx)(qE.Provider,{value:s,children:(0,hc.jsxs)(jE,{theme:a,children:[(0,hc.jsx)(RE,{}),t]})})}var KE,YE=n(35683),XE=n(4298),JE=function(e){var t=e.isApproved,n=e.handleLockAction,r=e.mainTxState,i=e.approvalTxState,o=e.vest,s=(0,ic.Z)().readOnlyModeAddress;var a=null!==r&&void 0!==r&&r.loading?{loading:!0,disabled:!0,content:o.penalty.gt(0)&&o.hasPenalty?"Exit Early":"Claim ZERO"}:null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:"Approving Vest"}:t||null!==i&&void 0!==i&&i.success?t?{loading:!1,disabled:!1,content:o.penalty.gt(0)&&o.hasPenalty?"Exit Early":"Claim ZERO"}:{content:o.penalty.gt(0)&&o.hasPenalty?"Exit Early":"Claim ZERO",handleClick:n}:{disabled:!1,content:"Approve Vest"},c=a.loading,u=a.disabled,l=a.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==s||u||c,onClick:n,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[c&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),l]}),s&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})};function QE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function e_(e){for(var t=1;t1&&(0,hc.jsx)(v_,{vests:f,selectedVest:l,setSelectedVest:function(e){return d(e)}})}),(0,hc.jsxs)(uc.Z,{children:[(0,hc.jsx)(Yh.Z,{sx:{mb:1,color:"text.secondary"},children:(0,hc.jsx)(sc.cC,{id:"Enter Wallet Address"})}),(0,hc.jsx)(mp.ZP,{sx:function(e){return{py:1,px:3,border:"1px solid ".concat(e.palette.divider),borderRadius:"6px",mb:1,overflow:"show",fontSize:y?"16px":"14px"}},placeholder:"Enter ethereum address or username",fullWidth:!0,value:h,onChange:function(e){return m(e.target.value)},inputProps:{"aria-label":"read-only mode address"}}),(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:function(){switch(v){case h_.ALREADY_STAKE:return(0,hc.jsx)(sc.cC,{id:"This vest is already staked"});case h_.NOT_A_VALID_ADDRESS:return(0,hc.jsx)(sc.cC,{id:"Not a valid address"});default:return null}}()})]}),l&&(0,hc.jsxs)(Id.m6,{gasLimit:n,children:[(0,hc.jsx)(Id.aY,{description:"Vest ID",value:"#".concat(l.toString())}),(0,hc.jsx)(Id.aY,{description:"Transfer To",value:(0,hc.jsx)(w_.E,{compact:!0,loading:!1,children:h})})]}),i&&(0,hc.jsx)(Dd.Q,{txError:i}),(0,hc.jsx)(b_,{isWrongNetwork:w,selectedReward:{},blocked:void 0!==v})]})},T_=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.TransferVest,setOpen:n,children:(0,hc.jsx)(k_,{vestId:r.vestId})})},S_=function(e){var t=e.isApproved,n=e.handleLockAction,r=e.mainTxState,i=e.approvalTxState,o=e.vestId,s=e.isClaimable,a=(0,ic.Z)().readOnlyModeAddress;var c=s?null!==r&&void 0!==r&&r.loading?{loading:!0,disabled:!0,content:"Claiming Vest #".concat(o)}:null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:"Approving ZERO"}:t||null!==i&&void 0!==i&&i.success?t?{loading:!1,disabled:!1,content:"Claim Vest #".concat(o)}:{content:"Claim Vest",handleClick:n}:{disabled:!1,content:"Approve ZERO"}:{disabled:!0,content:"Not enough to Claim"},u=c.loading,l=c.disabled,d=c.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==a||l||u,onClick:n,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[u&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),d]}),a&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})},C_=function(e){var t=e.vests,n=e.setSelectedVest,r=e.selectedVest;return(0,hc.jsxs)(Md.Z,{sx:{mb:1,width:"100%"},children:[(0,hc.jsx)(Yh.Z,{sx:{mb:1,color:"text.secondary"},children:(0,hc.jsx)(sc.cC,{id:"All your vests"})}),(0,hc.jsx)(Nd.Z,{value:r,onChange:function(e){return n(Number(e.target.value))},sx:{width:"100%",height:"44px",borderRadius:"6px",borderColor:"divider",outline:"none !important",color:"text.primary",".MuiOutlinedInput-input":{backgroundColor:"transparent"},"&:hover .MuiOutlinedInput-notchedOutline, .MuiOutlinedInput-notchedOutline":{borderColor:"divider",outline:"none !important",borderWidth:"1px"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"},".MuiSelect-icon":{color:"text.primary"}},native:!1,renderValue:function(e){var n=Number(e),r=t.find((function(e){return e.id===n}));return(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:(0,hc.jsx)(dc.Z,{color:"text.primary",children:r.id})})},children:t.map((function(e){return(0,hc.jsx)(Fd.Z,{value:e.id,children:(0,hc.jsx)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:(0,hc.jsxs)(dc.Z,{variant:"subheader1",sx:{mr:1},children:["Vest id: ",e.id]})})},"vest-id-".concat(e.id))}))})]})};function I_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O_(e){for(var t=1;t1&&(0,hc.jsx)(C_,{vests:w,selectedVest:b,setSelectedVest:function(e){return v(e)}}),b&&(0,hc.jsxs)(Id.m6,{gasLimit:n,children:[(0,hc.jsx)(Id.aY,{description:"Vest ID #",value:b}),(0,hc.jsx)(Id.oD,{description:"Claimable Amount",value:e.claimableAmount,symbol:"ZERO"})]}),a&&(0,hc.jsx)(Dd.Q,{txError:a}),(0,hc.jsx)(S_,{mainTxState:r,approvalTxState:u,isApproved:!0,handleLockAction:T,vestId:e.vestId,isClaimable:Number(e.claimableAmount)>0})]})},P_=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.ClaimVestedTokens,setOpen:n,children:(0,hc.jsx)(D_,{vestId:r.vestId,claimableAmount:r.amount})})},B_=function(e){var t=e.isWrongNetwork,n=e.isApproved,r=e.handleVestAction,i=e.mainTxState,o=e.approvalTxState,s=e.isClaimed,a=e.text,c=(0,ic.Z)().readOnlyModeAddress;var u=null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:a}:s?{disabled:!0,content:"Already claimed"}:t?{disabled:!0}:n?{loading:!1,disabled:!1,content:a}:n||null!==o&&void 0!==o&&o.success?{disabled:!1,content:a,handleClick:r}:{disabled:!1,content:"Approve EZERO"},l=u.loading,d=u.disabled,f=u.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==c||d||l,onClick:r,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[l&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),f]}),c&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})},M_=n(18377);function N_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function F_(e){for(var t=1;t0)if(u.chainId===zd.a_.mainnet){var f=s.find((function(e){return"AAVE"===e.symbol}));d=f?Number(f.priceInUSD):0}else s.forEach((function(e){e.isWrappedBaseAsset&&(d=Number(e.priceInUSD))}));else d=Number(c.rewardPriceFeed);var p=Number(l)*d;p>0&&(c.assets.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),e.push({assets:c.assets,incentiveControllerAddress:c.incentiveControllerAddress,symbol:c.rewardTokenSymbol,balance:l,balanceUsd:p.toString(),rewardTokenAddress:r}),t+=Number(p))}})),1===e.length)b(e[0].symbol);else if(e.length>1&&!C){var r={assets:n,incentiveControllerAddress:e[0].incentiveControllerAddress,symbol:"all",balance:"0",balanceUsd:t.toString(),rewardTokenAddress:""};b("all"),_(r)}x(e),m(t.toString())}),[]);var T=void 0;"0"===h&&(T=rk.NOT_ENOUGH_BALANCE);var S=c!==d,C="all"===y?E:w.find((function(e){return e.symbol===y}));return r&&r.blocking?(0,hc.jsx)(jh.D,{txError:r}):n.success?(0,hc.jsx)(lh.R,{action:(0,hc.jsx)(sc.cC,{id:"Claimed"}),amount:null===C||void 0===C?void 0:C.balanceUsd}):(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Od.E,{title:"Claim rewards "}),S&&!f&&(0,hc.jsx)(Rd.I,{networkName:k.name,chainId:c}),void 0!==T&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"error.main",children:T===rk.NOT_ENOUGH_BALANCE?(0,hc.jsx)(sc.cC,{id:"Your reward balance is 0"}):null}),w.length>1&&(0,hc.jsx)(ak,{rewards:w,selectedReward:y,setSelectedReward:b}),C&&(0,hc.jsxs)(Id.m6,{gasLimit:t,children:["all"===y&&(0,hc.jsxs)(hc.Fragment,{children:[(0,hc.jsx)(Td.X,{caption:(0,hc.jsx)(sc.cC,{id:"Balance"}),captionVariant:"description",align:"flex-start",mb:"all"!==C.symbol?0:4,children:(0,hc.jsx)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:w.map((function(e){return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",mb:4},children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,hc.jsx)(vp.T1,{symbol:e.symbol,sx:{mr:1,fontSize:"16px"}}),(0,hc.jsx)(kd.B,{value:Number(e.balance),variant:"secondary14"}),(0,hc.jsx)(dc.Z,{ml:1,variant:"secondary14",children:e.symbol})]}),(0,hc.jsx)(kd.B,{value:Number(e.balanceUsd),variant:"helperText",compact:!0,symbol:"USD",color:"text.secondary"})]},"claim-".concat(e.symbol))}))})}),(0,hc.jsx)(Id.oD,{description:(0,hc.jsx)(sc.cC,{id:"Total worth"}),value:h})]}),"all"!==y&&(0,hc.jsx)(Id.XJ,{symbol:(0,hc.jsx)(vp.T1,{symbol:C.symbol}),futureValue:C.balance,futureValueUSD:C.balanceUsd,description:(0,hc.jsx)(sc.cC,{id:"{0} Balance",values:{0:C.symbol}})})]}),r&&(0,hc.jsx)(Dd.Q,{txError:r}),(0,hc.jsx)(sk,{isWrongNetwork:S,selectedReward:null!==C&&void 0!==C?C:{},blocked:void 0!==T})]})},lk=function(){var e=(0,dd.vR)(),t=e.type,n=e.close;return(0,hc.jsx)(pc.P,{open:t===dd.w8.ClaimZEROLpIncentives,setOpen:n,children:(0,hc.jsx)(uk,{})})},dk=function(e){var t=e.isApproved,n=e.handleLockAction,r=e.mainTxState,i=e.approvalTxState,o=e.isClaimable,s=(0,ic.Z)().readOnlyModeAddress;var a=o?null!==r&&void 0!==r&&r.loading?{loading:!0,disabled:!0,content:"Claiming Incentives"}:null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:"Approving ZERO"}:t||null!==i&&void 0!==i&&i.success?t?{loading:!1,disabled:!1,content:"Claim Staking Rewards"}:{content:"Claim Staking Rewards",handleClick:n}:{disabled:!1,content:"Approve ZERO"}:{disabled:!0,content:"Not enough to Claim"},c=a.loading,u=a.disabled,l=a.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==s||u||c,onClick:n,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[c&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),l]}),s&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})};function fk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pk(e){for(var t=1;t0})]})},gk=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.ClaimZEROLockerIncentives,setOpen:n,children:(0,hc.jsx)(mk,{amount:r.amount||""})})},yk=function(e){var t=e.isApproved,n=e.handleLockAction,r=e.mainTxState,i=e.approvalTxState,o=e.vestId,s=e.isVests,a=e.isClaimableSufficient,c=(0,ic.Z)().readOnlyModeAddress;var u=a?s?null!==r&&void 0!==r&&r.loading?{loading:!0,disabled:!0,content:0===o?"Claiming All Vests":"Claiming Vest #".concat(o)}:null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:"Approving ZERO"}:t||null!==i&&void 0!==i&&i.success?t?{loading:!1,disabled:!1,content:0===o?"Claim All Vests":"Claim Vest #".concat(o)}:{content:"Stake ZERO",handleClick:n}:{disabled:!1,content:"Approve ZERO"}:{disabled:!0,content:"Not Vests Available"}:{disabled:!0,content:"Insufficient Amount"},l=u.loading,d=u.disabled,f=u.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==c||d||l,onClick:n,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[l&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),f]}),c&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})},bk=function(e){var t=e.nfts,n=e.selectedNFT,r=e.setSelectedNFT;return(0,hc.jsxs)(Md.Z,{sx:{mb:1,width:"100%"},children:[(0,hc.jsx)(Yh.Z,{sx:{mb:1,color:"text.secondary"},children:"Unlocked Vest".concat("0"===n?"(s)":""," to claim")}),(0,hc.jsxs)(Nd.Z,{value:n,onChange:function(e){r(e.target.value)},sx:{width:"100%",height:"44px",borderRadius:"6px",borderColor:"divider",outline:"none !important",color:"text.primary",".MuiOutlinedInput-input":{backgroundColor:"transparent"},"&:hover .MuiOutlinedInput-notchedOutline, .MuiOutlinedInput-notchedOutline":{borderColor:"divider",outline:"none !important",borderWidth:"1px"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"},".MuiSelect-icon":{color:"text.primary"}},native:!1,renderValue:function(e){if("0"===e)return(0,hc.jsx)(dc.Z,{color:"text.primary",children:(0,hc.jsx)(sc.cC,{id:"Claim all Vests"})});var n=t.find((function(t){return t.id.toString()===e}));return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,hc.jsx)(vp.T1,{symbol:"ZERO",sx:{mr:2,fontSize:"16px"}}),(0,hc.jsxs)(dc.Z,{color:"text.primary",children:["Vest #",n.id.toString()]})]})},children:[(0,hc.jsx)(Fd.Z,{value:"0",children:(0,hc.jsx)(dc.Z,{variant:"subheader1",children:(0,hc.jsx)(sc.cC,{id:"Claim all Vests"})})}),(0,hc.jsx)(Xh.Z,{}),t.map((function(e,t){return(0,hc.jsx)(Fd.Z,{value:e.id.toString(),children:(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},width:"100%",children:[(0,hc.jsxs)(dc.Z,{variant:"subheader1",sx:{mr:1},flex:1,children:["Vest #",e.id.toString()]}),(0,hc.jsxs)(uc.Z,{children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[(0,hc.jsx)(kd.B,{value:(0,xd.Fv)(e.claimable.toString(),18).toString(),variant:"h4",compact:!0}),(0,hc.jsx)(vp.T1,{symbol:"zero",sx:{ml:1,fontSize:"16px"}})]}),(0,hc.jsxs)(uc.Z,{children:[(0,hc.jsx)(dc.Z,{component:"span",sx:{display:"inline-flex",alignItems:"center"},variant:"caption",color:"text.muted",children:"~"}),(0,hc.jsx)(kd.B,{value:(0,xd.Fv)(e.claimable.toString(),18).toString(),variant:"caption",compact:!0,symbol:"USD",symbolsColor:"text.muted",color:"text.muted"})]})]})]})},t)}))]})]})};function vk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wk(e){for(var t=1;t1&&(0,hc.jsx)(bk,{nfts:t,selectedNFT:0===v?"0":v.toString(),setSelectedNFT:function(e){w(Number(e))}}),(0,hc.jsxs)(Id.m6,{gasLimit:r,children:[0===v&&(0,hc.jsx)(hc.Fragment,{children:t&&t.filter((function(e){return e.claimable.gt(0)})).map((function(e,t){return(0,hc.jsx)(Td.X,{caption:(0,hc.jsx)(sc.cC,{id:"Vest #{0}",values:{0:e.id.toString()}}),captionVariant:"description",align:"flex-start",mb:0!==v?0:4,children:(0,hc.jsx)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",mb:4},children:[(0,hc.jsxs)(uc.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,hc.jsx)(dc.Z,{ml:1,variant:"secondary14"}),(0,hc.jsx)(kd.B,{value:(0,xd.Fv)(e.claimable.toString(),18),variant:"secondary14",symbol:"ZERO"})]}),(0,hc.jsx)(kd.B,{value:(0,xd.Fv)(e.claimable.toString(),18),variant:"helperText",compact:!0,symbol:"USD",color:"text.secondary"})]},"claim-".concat(e.id.toString()))})},t)}))}),0!==v&&O&&(0,hc.jsx)(Id.XJ,{symbol:(0,hc.jsx)(vp.T1,{symbol:"ZERO"}),futureValue:(0,xd.Fv)(O.claimable.toString(),18),futureValueUSD:(0,xd.Fv)(O.claimable.toString(),18),description:(0,hc.jsx)(sc.cC,{id:"Vest #{0} Claimable Amount",values:{0:O.id.toString()}})}),0===v&&(0,hc.jsx)(Id.XJ,{symbol:(0,hc.jsx)(vp.T1,{symbol:"ZERO"}),futureValue:(0,xd.Fv)(T.toString(),18),futureValueUSD:(0,xd.Fv)(T.toString(),18),description:(0,hc.jsx)(sc.cC,{id:"Total Claimable Amount"})})]}),a&&(0,hc.jsx)(Dd.Q,{txError:a}),(0,hc.jsx)(yk,{mainTxState:i,approvalTxState:u,isApproved:!0,handleLockAction:S,vestId:v,isVests:t.length>0,isClaimableSufficient:0===v||(null===O||void 0===O?void 0:O.claimable.gt(0))})]})},Ek=function(){var e,t,n,r=(0,dd.vR)(),i=r.type,o=r.close,s=r.args;return(0,hc.jsx)(pc.P,{open:i===dd.w8.ClaimZEROVestsRewards,setOpen:o,children:(0,hc.jsx)(Ak,{vests:null!==(e=null===(t=s.vests)||void 0===t?void 0:t.filter((function(e){return!e.claimable.eq(0)&&!e.hasPenalty})))&&void 0!==e?e:[],vestLoading:null!==(n=s.vestLoading)&&void 0!==n&&n})})},_k=function(e){var t=e.isWrongNetwork,n=e.isApproved,r=e.handleVestAction,i=e.mainTxState,o=e.approvalTxState,s=e.isClaimed,a=e.text,c=(0,ic.Z)().readOnlyModeAddress;var u=null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:a}:s?{disabled:!0,content:"Already claimed"}:t?{disabled:!0}:n?{loading:!1,disabled:!1,content:a}:n||null!==o&&void 0!==o&&o.success?{disabled:!1,content:a,handleClick:r}:{disabled:!1,content:"Approve EZERO"},l=u.loading,d=u.disabled,f=u.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==c||d||l,onClick:r,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[l&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),f]}),c&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})},kk=function(){var e=(0,TE.z)().airdropDataService,t=(0,ic.Z)().currentAccount;return(0,Sc.a)({queryFn:function(){var n=(0,o.Z)(d().mark((function n(){return d().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.getUserRewardClaimed(t);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),queryKey:["USER_REWARD_CLAIMED"],enabled:!!t,refetchInterval:cd.g_})};function Tk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sk(e){for(var t=1;t0&&(0,hc.jsx)(Sd.v,{severity:"error",sx:{mb:2},children:(0,hc.jsx)(dc.Z,{variant:"caption",children:c})}),"not-successful"===o&&(0,hc.jsx)(Sd.v,{severity:"error",sx:{mb:2},children:(0,hc.jsx)(dc.Z,{variant:"caption",children:"Something Went Wrong"})}),r&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mb:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to link referral code."})}),(0,hc.jsxs)(fc.Z,{variant:"contained",fullWidth:!0,disabled:!!r||0===t.length||"in-progress"===o,onClick:function(){l((function(){return s("in-progress")}),(function(){n(!1),s("successful")}),(function(e){u(e),s("not-successful")}))},children:["in-progress"===o&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),"Verify Wallet"]})]})]})},Fk=n(11163),Lk=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args,i=bc.Yh.getState().setInvite;return(0,hc.jsx)(pc.P,{open:t===dd.w8.LinkReferralCode,setOpen:function(){localStorage.setItem("invite",""),i(""),Fk.default.push({pathname:"/gravity"},void 0,{shallow:!0}),n()},children:(0,hc.jsx)(Nk,{inviteReferrerCode:r.referrerCode||"",setOpen:n})})},jk=n(81374),Uk=function(e){var t=e.amount,n=e.isApproved,r=e.handleLockAction,i=e.mainTxState,o=e.approvalTxState,s=e.text,a=e.loadingText,c=(0,ic.Z)().readOnlyModeAddress;var u=!t||Number(t)<.1?{disabled:!0,content:s}:null!==i&&void 0!==i&&i.loading?{loading:!0,disabled:!0,content:a}:null!==o&&void 0!==o&&o.loading?{loading:!0,disabled:!0,content:"Approving ZERO"}:n||null!==o&&void 0!==o&&o.success?n?{loading:!1,disabled:!1,content:s}:{content:s,handleClick:r}:{disabled:!1,content:"Approve ZERO"},l=u.loading,d=u.disabled,f=u.content;return(0,hc.jsxs)(uc.Z,{sx:{display:"flex",flexDirection:"column",mt:6},children:[(0,hc.jsxs)(fc.Z,{variant:"contained",disabled:void 0!==c||d||l,onClick:r,size:"large",sx:{minHeight:"44px"},"data-cy":"actionButton",children:[l&&(0,hc.jsx)(_c.Z,{color:"inherit",size:"16px",sx:{mr:2}}),f]}),c&&(0,hc.jsx)(dc.Z,{variant:"helperText",color:"warning.main",sx:{textAlign:"center",mt:2},children:(0,hc.jsx)(sc.cC,{id:"Read-only mode. Connect to a wallet to perform transactions."})})]})},Zk=n(82482);function Hk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zk(e){for(var t=1;t0})]})},AT=function(){var e=(0,dd.vR)(),t=e.type,n=e.close,r=e.args;return(0,hc.jsx)(pc.P,{open:t===dd.w8.ClaimLPLockerIncentives,setOpen:n,children:(0,hc.jsx)(xT,{amount:r.amount||""})})};function ET(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _T(e){for(var t=1;t{I.j.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())})),this.unsubscribeOnline=O.N.subscribe((()=>{O.N.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())})))}unmount(){var e,t;this.mountCount--,0===this.mountCount&&(null==(e=this.unsubscribeFocus)||e.call(this),this.unsubscribeFocus=void 0,null==(t=this.unsubscribeOnline)||t.call(this),this.unsubscribeOnline=void 0)}isFetching(e,t){const[n]=(0,b.I6)(e,t);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var n;return null==(n=this.queryCache.find(e,t))?void 0:n.state.data}ensureQueryData(e,t,n){const r=(0,b._v)(e,t,n),i=this.getQueryData(r.queryKey);return i?Promise.resolve(i):this.fetchQuery(r)}getQueriesData(e){return this.getQueryCache().findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,n){const r=this.queryCache.find(e),i=null==r?void 0:r.state.data,o=(0,b.SE)(t,i);if("undefined"===typeof o)return;const s=(0,b._v)(e),a=this.defaultQueryOptions(s);return this.queryCache.build(this,a).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return w.V.batch((()=>this.getQueryCache().findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,n)]))))}getQueryState(e,t){var n;return null==(n=this.queryCache.find(e,t))?void 0:n.state}removeQueries(e,t){const[n]=(0,b.I6)(e,t),r=this.queryCache;w.V.batch((()=>{r.findAll(n).forEach((e=>{r.remove(e)}))}))}resetQueries(e,t,n){const[r,i]=(0,b.I6)(e,t,n),o=this.queryCache,s={type:"active",...r};return w.V.batch((()=>(o.findAll(r).forEach((e=>{e.reset()})),this.refetchQueries(s,i))))}cancelQueries(e,t,n){const[r,i={}]=(0,b.I6)(e,t,n);"undefined"===typeof i.revert&&(i.revert=!0);const o=w.V.batch((()=>this.queryCache.findAll(r).map((e=>e.cancel(i)))));return Promise.all(o).then(b.ZT).catch(b.ZT)}invalidateQueries(e,t,n){const[r,i]=(0,b.I6)(e,t,n);return w.V.batch((()=>{var e,t;if(this.queryCache.findAll(r).forEach((e=>{e.invalidate()})),"none"===r.refetchType)return Promise.resolve();const n={...r,type:null!=(e=null!=(t=r.refetchType)?t:r.type)?e:"active"};return this.refetchQueries(n,i)}))}refetchQueries(e,t,n){const[r,i]=(0,b.I6)(e,t,n),o=w.V.batch((()=>this.queryCache.findAll(r).filter((e=>!e.isDisabled())).map((e=>{var t;return e.fetch(void 0,{...i,cancelRefetch:null==(t=null==i?void 0:i.cancelRefetch)||t,meta:{refetchPage:r.refetchPage}})}))));let s=Promise.all(o).then(b.ZT);return null!=i&&i.throwOnError||(s=s.catch(b.ZT)),s}fetchQuery(e,t,n){const r=(0,b._v)(e,t,n),i=this.defaultQueryOptions(r);"undefined"===typeof i.retry&&(i.retry=!1);const o=this.queryCache.build(this,i);return o.isStaleByTime(i.staleTime)?o.fetch(i):Promise.resolve(o.state.data)}prefetchQuery(e,t,n){return this.fetchQuery(e,t,n).then(b.ZT).catch(b.ZT)}fetchInfiniteQuery(e,t,n){const r=(0,b._v)(e,t,n);return r.behavior=(0,R.Gm)(),this.fetchQuery(r)}prefetchInfiniteQuery(e,t,n){return this.fetchInfiniteQuery(e,t,n).then(b.ZT).catch(b.ZT)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){const n=this.queryDefaults.find((t=>(0,b.yF)(e)===(0,b.yF)(t.queryKey)));n?n.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;const t=this.queryDefaults.find((t=>(0,b.to)(e,t.queryKey)));return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){const n=this.mutationDefaults.find((t=>(0,b.yF)(e)===(0,b.yF)(t.mutationKey)));n?n.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;const t=this.mutationDefaults.find((t=>(0,b.to)(e,t.mutationKey)));return null==t?void 0:t.defaultOptions}defaultQueryOptions(e){if(null!=e&&e._defaulted)return e;const t={...this.defaultOptions.queries,...this.getQueryDefaults(null==e?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=(0,b.Rm)(t.queryKey,t)),"undefined"===typeof t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),"undefined"===typeof t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==e?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}};function CT(e){var t,n=e.Component,r=e.emotionCache,i=void 0===r?kT:r,o=e.pageProps,s=null!==(t=n.getLayout)&&void 0!==t?t:function(e){return e},a=(0,bc.Yh)((function(e){return e.initializeMixpanel})),c="56a73cd233d8c404b823d000f9a807c3";(0,ec.useEffect)((function(){var e;(e={dsn:"https://629466fb3bc0091f0af74dbf30bb0a76@o4505951646121984.ingest.sentry.io/4505963347312640",integrations:[new pi({}),new Ya],tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1})._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:M}],version:M},pr(e)}),[]),(0,ec.useEffect)((function(){a()}),[c,a]);var u=(0,jk.ce)("invite");return(0,ec.useEffect)((function(){u&&localStorage.setItem("invite",u)}),[u]),(0,hc.jsxs)(y.C,{value:i,children:[(0,hc.jsx)(Qa.default,{children:(0,hc.jsx)("meta",{name:"viewport",content:"initial-scale=1, width=device-width"})}),(0,hc.jsx)(yc,{title:"Open Source Liquidity Protocol on Layer 2s",description:"ZeroLend is an Open Source Protocol to create Non-Custodial Liquidity Markets to earn interest on supplying and borrowing assets with a variable or stable interest rate.",imageUrl:"https://i.imgur.com/KaP3sNh.png"}),(0,hc.jsx)(YE.iL,{children:(0,hc.jsxs)(D.aH,{client:ST,children:[(0,hc.jsx)(B.Web3ReactProvider,{getLibrary:TT,children:(0,hc.jsx)(kE,{children:(0,hc.jsx)($E,{children:(0,hc.jsx)(gc,{children:(0,hc.jsx)(hE.W,{children:(0,hc.jsx)(dd.ny,{children:(0,hc.jsx)(dh.R,{children:(0,hc.jsx)(ih.GM,{children:(0,hc.jsx)(rg.Wv,{children:(0,hc.jsxs)(TE._,{children:[(0,hc.jsx)(XE.default,{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=G-4BXYGRCH1M"}),(0,hc.jsx)(XE.default,{src:"https://attribution.metacrm.inc/tracking-1-1-1.js\u201d data-entity-id=\u201c661662c4265d2715bc8a1b19",id:"metacrm-tracking",integrity:"sha384-KVT0cdwbRt/fjdhbbEcHAVvFdtrAkBuvoip0q/+NDjPC73iAPNEkAXLkGOre5AUP",crossOrigin:"anonymous",apiKey:"mjrsl5d8kun"}),(0,hc.jsx)(XE.default,{id:"google-analytics",children:"window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-4BXYGRCH1M');"}),(0,hc.jsx)(XE.default,{id:"heap-analytics",children:'window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o=3?y.success.main:b<1.1?y.error.main:y.warning.main,(0,p.jsxs)(c.Z,{sx:{display:"inline-flex",alignItems:{xs:"flex-start",xsm:"center"},flexDirection:{xs:"column",xsm:"row"}},"data-cy":"HealthFactorTopPannel",children:["-1"===t?(0,p.jsx)(u.Z,{variant:"secondary14",color:y.success.main,children:"\u221e"}):(0,p.jsx)(f.B,g({value:b,sx:g({color:v},m.sx),visibleDecimals:2,compact:!0},m)),n&&(0,p.jsx)(l.Z,{onClick:n,variant:"surface",size:"small",sx:{minWidth:"unset",ml:{xs:0,xsm:2}},children:(0,p.jsx)(o.cC,{id:"Risk details"})}),r&&(0,p.jsx)(c.Z,{ml:{xs:0,xsm:2},mt:{xs:1,xsm:0},children:r})]})}},16693:function(e,t,n){"use strict";n.d(t,{gO:function(){return oe},tF:function(){return se},St:function(){return ie},hu:function(){return re}});var r=n(59499),i=n(49501),o=n(61782),s=n(87462),a=n(63366),c=n(67294),u=n(86010),l=n(94780),d=n(57579),f=n(81719),p=n(78884),h=n(96480),m=n(37630),g=n(84246),y=n(56594),b=n(59711),v=n(47546),w=n(65410),x=n(34867),A=n(1588);function E(e){return(0,x.Z)("MuiInputLabel",e)}(0,A.Z)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);var _=n(85893);const k=["disableAnimation","margin","shrink","variant","className"],T=(0,f.ZP)(v.Z,{shouldForwardProp:e=>(0,f.FO)(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${w.Z.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,"small"===n.size&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,t[n.variant]]}})((({theme:e,ownerState:t})=>(0,s.Z)({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},t.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},"small"===t.size&&{transform:"translate(0, 17px) scale(1)"},t.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!t.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},"filled"===t.variant&&(0,s.Z)({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===t.size&&{transform:"translate(12px, 13px) scale(1)"},t.shrink&&(0,s.Z)({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},"small"===t.size&&{transform:"translate(12px, 4px) scale(0.75)"})),"outlined"===t.variant&&(0,s.Z)({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===t.size&&{transform:"translate(14px, 9px) scale(1)"},t.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 24px)",transform:"translate(14px, -9px) scale(0.75)"}))));var S=c.forwardRef((function(e,t){const n=(0,p.Z)({name:"MuiInputLabel",props:e}),{disableAnimation:r=!1,shrink:i,className:o}=n,c=(0,a.Z)(n,k),d=(0,b.Z)();let f=i;"undefined"===typeof f&&d&&(f=d.filled||d.focused||d.adornedStart);const h=(0,y.Z)({props:n,muiFormControl:d,states:["size","variant","required"]}),m=(0,s.Z)({},n,{disableAnimation:r,formControl:d,shrink:f,size:h.size,variant:h.variant,required:h.required}),g=(e=>{const{classes:t,formControl:n,size:r,shrink:i,disableAnimation:o,variant:a,required:c}=e,u={root:["root",n&&"formControl",!o&&"animated",i&&"shrink","small"===r&&"sizeSmall",a],asterisk:[c&&"asterisk"]},d=(0,l.Z)(u,E,t);return(0,s.Z)({},t,d)})(m);return(0,_.jsx)(T,(0,s.Z)({"data-shrink":f,ownerState:m,ref:t,className:(0,u.default)(g.root,o)},c,{classes:g}))})),C=n(55343),I=n(36622);function O(e){return(0,x.Z)("MuiFormHelperText",e)}var R,D=(0,A.Z)("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);const P=["children","className","component","disabled","error","filled","focused","margin","required","variant"],B=(0,f.ZP)("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${(0,I.Z)(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})((({theme:e,ownerState:t})=>(0,s.Z)({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${D.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${D.error}`]:{color:(e.vars||e).palette.error.main}},"small"===t.size&&{marginTop:4},t.contained&&{marginLeft:14,marginRight:14})));var M=c.forwardRef((function(e,t){const n=(0,p.Z)({props:e,name:"MuiFormHelperText"}),{children:r,className:i,component:o="p"}=n,c=(0,a.Z)(n,P),d=(0,b.Z)(),f=(0,y.Z)({props:n,muiFormControl:d,states:["variant","size","disabled","error","filled","focused","required"]}),h=(0,s.Z)({},n,{component:o,contained:"filled"===f.variant||"outlined"===f.variant,variant:f.variant,size:f.size,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required}),m=(e=>{const{classes:t,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:c}=e,u={root:["root",i&&"disabled",o&&"error",r&&`size${(0,I.Z)(r)}`,n&&"contained",a&&"focused",s&&"filled",c&&"required"]};return(0,l.Z)(u,O,t)})(h);return(0,_.jsx)(B,(0,s.Z)({as:o,ownerState:h,className:(0,u.default)(m.root,i),ref:t},c,{children:" "===r?R||(R=(0,_.jsx)("span",{className:"notranslate",children:"\u200b"})):r}))})),N=n(46541);function F(e){return(0,x.Z)("MuiTextField",e)}(0,A.Z)("MuiTextField",["root"]);const L=["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"],j={standard:h.Z,filled:m.Z,outlined:g.Z},U=(0,f.ZP)(C.Z,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({});var Z=c.forwardRef((function(e,t){const n=(0,p.Z)({props:e,name:"MuiTextField"}),{autoComplete:r,autoFocus:i=!1,children:o,className:c,color:f="primary",defaultValue:h,disabled:m=!1,error:g=!1,FormHelperTextProps:y,fullWidth:b=!1,helperText:v,id:w,InputLabelProps:x,inputProps:A,InputProps:E,inputRef:k,label:T,maxRows:C,minRows:I,multiline:O=!1,name:R,onBlur:D,onChange:P,onFocus:B,placeholder:Z,required:H=!1,rows:z,select:G=!1,SelectProps:V,type:W,value:q,variant:$="outlined"}=n,K=(0,a.Z)(n,L),Y=(0,s.Z)({},n,{autoFocus:i,color:f,disabled:m,error:g,fullWidth:b,multiline:O,required:H,select:G,variant:$}),X=(e=>{const{classes:t}=e;return(0,l.Z)({root:["root"]},F,t)})(Y);const J={};"outlined"===$&&(x&&"undefined"!==typeof x.shrink&&(J.notched=x.shrink),J.label=T),G&&(V&&V.native||(J.id=void 0),J["aria-describedby"]=void 0);const Q=(0,d.Z)(w),ee=v&&Q?`${Q}-helper-text`:void 0,te=T&&Q?`${Q}-label`:void 0,ne=j[$],re=(0,_.jsx)(ne,(0,s.Z)({"aria-describedby":ee,autoComplete:r,autoFocus:i,defaultValue:h,fullWidth:b,multiline:O,name:R,rows:z,maxRows:C,minRows:I,type:W,value:q,id:Q,inputRef:k,onBlur:D,onChange:P,onFocus:B,placeholder:Z,inputProps:A},J,E));return(0,_.jsxs)(U,(0,s.Z)({className:(0,u.default)(X.root,c),disabled:m,error:g,fullWidth:b,ref:t,required:H,color:f,variant:$,ownerState:Y},K,{children:[null!=T&&""!==T&&(0,_.jsx)(S,(0,s.Z)({htmlFor:Q,id:te},x,{children:T})),G?(0,_.jsx)(N.Z,(0,s.Z)({"aria-describedby":ee,id:Q,labelId:te,value:q,input:re},V,{children:o})):re,v&&(0,_.jsx)(M,(0,s.Z)({id:ee},y,{children:v}))]}))})),H=n(30120),z=n(72389),G=n(62097),V=n(61225),W=n(81645),q=n(29630),$=n(31538),K=n(61702),Y=n(69311),X=n(57609),J=n(46930),Q=n(63206);function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function te(e){for(var t=1;t-1}));return{name:n.filter((function(e){return!r.includes(e)})).join(" "),testChainName:r[0]}},oe=function(e){var t=e.size,n=e.logo,r=e.testChainName;return(0,_.jsxs)(H.Z,{sx:{mr:2,width:t,height:t,position:"relative"},children:[(0,_.jsx)("img",{src:n,alt:"",width:"100%",height:"100%"}),r&&(0,_.jsx)(z.Z,{title:r,arrow:!0,children:(0,_.jsx)(H.Z,{sx:{bgcolor:"#29B6F6",width:"16px",height:"16px",borderRadius:"50%",color:"common.white",fontSize:"12px",lineHeight:"16px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",right:"-2px",bottom:"-2px"},children:r.split("")[0]})})]})};!function(e){e[e.V2=0]="V2",e[e.V3=1]="V3"}(ne||(ne={}));var se=function(){var e=(0,J.f)(),t=e.currentMarket,n=e.setCurrentMarket,r=(0,c.useState)(ne.V3)[0],s=(0,G.Z)(),a=(0,V.Z)(s.breakpoints.up("lg")),u=(0,V.Z)(s.breakpoints.down("xsm")),l=(0,Y.Yh)((function(e){return e.trackEvent}));return(0,_.jsxs)(Z,{select:!0,"aria-label":"select market","data-cy":"marketSelector",value:t,onChange:function(e){l(X.h1.CHANGE_MARKET,{market:e.target.value}),n(e.target.value)},sx:{mr:2,"& .MuiOutlinedInput-notchedOutline":{border:"none"}},SelectProps:{native:!1,className:"MarketSwitcher__select",IconComponent:function(e){return(0,_.jsx)(W.Z,te(te({fontSize:"medium"},e),{},{children:(0,_.jsx)(o.Z,{})}))},renderValue:function(e){var t=re(e),n=t.market,r=t.network;return(0,_.jsxs)(H.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,_.jsx)(oe,{size:a?32:28,logo:r.networkLogoPath,testChainName:ie(n.marketTitle).testChainName}),(0,_.jsx)(H.Z,{sx:{mr:1,display:"inline-flex",alignItems:"flex-start"},children:(0,_.jsxs)(q.Z,{variant:a?"display1":"h1",sx:{fontSize:u?"1.55rem":void 0,color:"common.white",mr:1},children:[ie(n.marketTitle).name," ",n.isFork?"Fork":"",a&&" Market"]})})]})},sx:{"&.MarketSwitcher__select .MuiSelect-outlined":{pl:0,py:0,backgroundColor:"transparent !important"},".MuiSelect-icon":{color:"#F1F1F3"}},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},PaperProps:{style:{minWidth:240},variant:"outlined",elevation:0}}},children:[(0,_.jsx)(H.Z,{children:(0,_.jsx)(q.Z,{variant:"subheader2",color:"text.secondary",sx:{px:4,pt:2},children:(0,_.jsx)(i.cC,{id:"{0}",values:{0:Q.p8||Q.aV?"Select ZeroLend Testnet Market":"Select ZeroLend Market"}})})}),Q.z2.map((function(e){var t=re(e),n=t.market,i=t.network,o=ie(n.marketTitle);return null!==n&&void 0!==n&&n.hideInMarketSwitcher?(0,_.jsx)("div",{}):(0,_.jsxs)($.Z,{"data-cy":"marketSelector_".concat(e),value:e,sx:{".MuiListItemIcon-root":{minWidth:"unset"},display:n.v3&&r===ne.V2||!n.v3&&r===ne.V3?"none":"flex"},children:[(0,_.jsx)(oe,{size:32,logo:i.networkLogoPath,testChainName:o.testChainName}),(0,_.jsxs)(K.Z,{sx:{mr:0},children:[o.name," ",n.isFork?"Fork":""]}),(0,_.jsx)(K.Z,{sx:{textAlign:"right"},children:(0,_.jsx)(q.Z,{color:"text.muted",variant:"description",children:o.testChainName})})]},e)}))]})}},8403:function(e,t,n){"use strict";n.d(t,{M:function(){return g}});var r=n(59499),i=n(53737),o=n(33740),s=n(62097),a=n(61225),c=n(30120),u=n(81011),l=n(80562),d=n(23279),f=n.n(d),p=n(67294),h=n(85893);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var g=function(e){var t=e.onSearchTermChange,n=e.wrapperSx,d=e.placeholder,g=e.disableFocus,y=(0,p.useRef)(null),b=(0,p.useState)(""),v=b[0],w=b[1],x=(0,s.Z)().breakpoints,A=(0,a.Z)(x.down("sm")),E=(0,p.useMemo)((function(){return f()((function(e){t(e)}),300)}),[t]);return(0,h.jsxs)(c.Z,{sx:function(e){return function(e){for(var t=1;t18),C=!b||S,I=(0,u.Yh)((function(e){return e.trackEvent}));return(0,p.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,p.jsx)(d.E,g(g({compactMode:b?m:n,compact:C,loading:y},T),{},{children:b||v})),w&&(0,p.jsx)(f.y,{title:k,children:(0,p.jsx)(a.Z,{href:w,target:"_blank",sx:{display:"flex"},onClick:function(){return I(l.vh.EXTERNAL_LINK,{funnel:E,Link:"Etherscan"})},children:(0,p.jsx)(c.Z,{sx:{fontSize:A},children:(0,p.jsx)(o.Z,{})})})})]})}},3765:function(e,t,n){"use strict";n.d(t,{p:function(){return l}});var r=n(49501),i=n(75084),o=n(26074),s=n(69311),a=n(57609),c=n(58294),u=n(85893),l=function(e){var t=e.funnel,n=(0,o.q)().setWalletModalOpen,l=(0,s.Yh)((function(e){return e.trackEvent}));return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i.Z,{variant:"gradient",onClick:function(){l(a.Bp.CONNECT_WALLET,{funnel:t}),n(!0)},children:(0,u.jsx)(r.cC,{id:"Connect wallet"})}),(0,u.jsx)(c.x,{})]})}},58294:function(e,t,n){"use strict";n.d(t,{x:function(){return L}});var r=n(26074),i=n(31959),o=n(50029),s=n(87794),a=n.n(s),c=n(49501),u=n(75084),l=n(62097),d=n(61225),f=n(30120),p=n(29630),h=n(81011),m=n(68346),g=n(81088),y=n(30950),b=n(46126),v=n(67294),w=n(59499),x=n(36864),A=n(58527),E=n(85893);function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;tJoin our Discord",components:{0:(0,E.jsx)(m.Z,{href:"https://discord.gg/zerolend",underline:"always"})}})}),(0,E.jsx)(p.Z,{variant:"helperText",children:(0,E.jsx)(c.cC,{id:"Wallets are provided by External Providers and by selecting you agree to Terms of those Providers. Your access to the wallet might be reliant on the External Provider being operational."})})]})},L=function(){var e=(0,r.q)(),t=e.isWalletModalOpen,n=e.setWalletModalOpen;return(0,E.jsx)(i.P,{open:t,setOpen:n,children:(0,E.jsx)(F,{})})}},84734:function(e,t,n){"use strict";n.d(t,{v:function(){return s}});var r=n(49501),i=n(68861),o=n(85893),s=function(){return(0,o.jsx)(r.cC,{id:"<0>Ampleforth is a rebasing asset. Visit the<1>discordto learn more.",components:{0:(0,o.jsx)("b",{}),1:(0,o.jsx)(i.rU,{href:"https://discord.gg/zerolend",underline:"always"})}})}},1252:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(49501),i=n(85893),o=function(){return(0,i.jsx)(r.cC,{id:"Due to internal stETH mechanics required for rebasing support, it is not possible to perform a collateral switch where stETH is the source token."})}},81902:function(e,t,n){"use strict";var r;n.d(t,{R:function(){return r}}),function(e){e.supplyCap="supplyCap",e.borrowCap="borrowCap"}(r||(r={}))},29002:function(e,t,n){"use strict";n.d(t,{o:function(){return l}});var r=n(59499),i=n(4730),o=n(81645),s=n(85893),a=["sx"];function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t1?2:0},children:[(0,g.jsx)(p.T1,{symbol:e.rewardTokenSymbol,sx:{fontSize:"20px",mr:1}}),(0,g.jsx)(a.Z,{variant:i,children:e.rewardTokenSymbol})]}),width:"100%",children:e.rewardTokenSymbol.includes("BLAST")?(0,g.jsxs)("div",{children:[(0,g.jsx)(f.B,{value:Math.floor(1e8*Number(e.incentiveAPR)),compact:!0,variant:i}),"\xa0Points/$"]}):(0,g.jsx)(o,{incentiveAPR:e.incentiveAPR})},e.rewardTokenAddress)})),t.length>1&&(0,g.jsx)(s.Z,{sx:function(e){return{pt:1,mt:1,border:"1px solid ".concat(e.palette.divider)}},children:(0,g.jsx)(m.X,{caption:(0,g.jsx)(h.cC,{id:"Net APR"}),height:32,children:(0,g.jsx)(o,{incentiveAPR:n})})})]})]})},b=n(46930),v=function(){return(0,g.jsx)(s.Z,{sx:{p:{xs:"0 4px",xsm:"3.625px 4px"},display:"flex",alignItems:"center",justifyContent:"center"},children:(0,g.jsx)(a.Z,{variant:"main12",color:"text.secondary",children:"\xa0"})})},w=function(e){var t=e.incentives,n=e.symbol,h=e.displayBlank,m=(0,i.useState)(!1),w=m[0],x=m[1],A=(0,u.Yh)((function(e){return e.trackEvent})),E=(0,b.f)().currentMarketData,_=(0,i.useMemo)((function(){return(null===t||void 0===t?void 0:t.filter((function(e){return E.whiteListedIncentives.includes(e.rewardTokenSymbol.toLowerCase())})))||t}),[t]);if(!(_&&_.length>0))return h?(0,g.jsx)(v,{}):null;var k=_.some((function(e){return"Infinity"===e.incentiveAPR})),T=k?"Infinity":_.reduce((function(e,t){return e+ +t.incentiveAPR}),0),S=k?"Infinity":"Infinity"!==T?(0,r.hE)(T||0).toNumber():"Infinity";if(0===S)return h?(0,g.jsx)(v,{}):null;return(0,g.jsx)(d.a,{placement:"bottom",tooltipContent:(0,g.jsx)(y,{incentives:_,incentivesNetAPR:S,symbol:n}),withoutHover:!0,setOpen:x,open:w,children:(0,g.jsxs)(s.Z,{sx:function(e){return{p:{xs:"0 4px",xsm:"2px 4px"},border:"1px solid ".concat(w?e.palette.action.disabled:e.palette.divider),borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s ease",bgcolor:w?"action.hover":"transparent","&:hover":{bgcolor:"action.hover",borderColor:"action.disabled"}}},onClick:function(){A(l.h1.VIEW_LM_DETAILS_DASHBOARD,{}),x(!w)},children:[(0,g.jsx)(s.Z,{sx:{mr:2},children:"Infinity"!==S&&S<1e4?(0,g.jsx)(f.B,{value:S,percent:!0,variant:"secondary12",color:"text.secondary"}):"Infinity"!==S&&S>9999?(0,g.jsx)(f.B,{value:S,percent:!0,compact:!0,variant:"secondary12",color:"text.secondary"}):"Infinity"===S?(0,g.jsx)(a.Z,{variant:"main12",color:"text.secondary",children:"\u221e"}):void 0}),(0,g.jsx)(s.Z,{sx:{display:"inline-flex"},children:(0,g.jsx)(g.Fragment,{children:_.length<5?(0,g.jsx)(g.Fragment,{children:_.filter((function(e){return"WETH"!==e.rewardTokenSymbol})).map((function(e){return(0,g.jsx)(p.T1,{symbol:e.rewardTokenSymbol,sx:{fontSize:"".concat(12,"px"),ml:-1}},e.rewardTokenSymbol)}))}):(0,g.jsxs)(g.Fragment,{children:[_.slice(0,3).filter((function(e){return"WETH"!==e.rewardTokenSymbol})).map((function(e){return(0,g.jsx)(p.T1,{symbol:e.rewardTokenSymbol,sx:{fontSize:"".concat(12,"px"),ml:-1}},e.rewardTokenSymbol)})),(0,g.jsx)(c.Z,{sx:{fontSize:"".concat(12,"px"),borderRadius:"50%",bgcolor:"common.white",color:"common.black",ml:-1,zIndex:5},children:(0,g.jsx)(o,{})})]})})})]})})}},14098:function(e,t,n){"use strict";n.d(t,{s:function(){return c}});var r=n(30120),i=n(29630),o=n(67294),s=n(4132),a=n(85893),c=function(e){var t=(0,o.useState)(!1),n=t[0],c=t[1];return(0,a.jsx)(r.Z,{display:"flex",alignItems:"center",position:"relative",children:(0,a.jsx)(s.a,{placement:"bottom",tooltipContent:(0,a.jsx)(i.Z,{children:(null===e||void 0===e?void 0:e.tooltip)||""}),withoutHover:!0,setOpen:c,open:n,children:(0,a.jsx)(r.Z,{children:e.pointsIcon?(0,a.jsx)(r.Z,{borderRadius:"50%",height:"22px",onClick:function(){e.link?window.open(e.link,"_blank"):null!==e&&void 0!==e&&e.tooltip&&c(!n)},children:(0,a.jsx)(r.Z,{border:"1px solid white",borderRadius:"50%",height:"20px",children:(0,a.jsx)("img",{src:e.pointsIcon,alt:".",width:"18px",height:"18px",style:{borderRadius:"50%"}})})}):(0,a.jsx)(r.Z,{sx:function(e){return{p:{xs:"4px",xsm:"2px 4px"},border:"1px solid ".concat(n?e.palette.action.disabled:e.palette.divider),borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s ease"}},onClick:function(){e.link?window.open(e.link,"_blank"):null!==e&&void 0!==e&&e.tooltip&&c(!n)},children:(0,a.jsx)(i.Z,{variant:"main12",color:"text.secondary",sx:{textWrap:"nowrap"},children:e.text})})})})})}},10766:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(59499),i=n(36864),o=n(49501),s=n(58527),a=n(85893);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;tvariable and <1>stable interest rates, where variable rate can increase and decrease depending on the amount of liquidity in the reserve, and stable rate will stay the same for the duration of your loan.",components:{0:(0,a.jsx)("b",{}),1:(0,a.jsx)("b",{})}})}))}},25049:function(e,t,n){"use strict";n.d(t,{Y:function(){return f}});var r=n(59499),i=n(4730),o=n(49501),s=n(81902),a=n(58527),c=n(85893),u=["capType"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;tLearn more",components:{0:(0,c.jsx)(s.rU,{href:"https://docs.gho.xyz/concepts/how-gho-works/interest-rate-discount-model#interest-rate-model",underline:"always"})}}),f=function(e){return(0,c.jsx)(a.G,l(l({event:{eventName:o.vh.TOOL_TIP,eventParams:{tooltip:"ONEZ APY"}}},e),{},{children:d}))}},44749:function(e,t,n){"use strict";n.d(t,{Ch:function(){return g},r$:function(){return y},a9:function(){return b}});var r=n(59499),i=n(49501),o=n(38264),s=n(81645),a=n(30120),c=n(29630),u=n(68346),l=n(4132),d=n(85893);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;tdiscord",components:{0:(0,d.jsx)(u.Z,{href:"https://discord.gg/zerolend",fontWeight:500})}})})]})}},45556:function(e,t,n){"use strict";n.d(t,{l:function(){return m}});var r=n(59499),i=n(49501),o=n(70918),s=n(30120),a=n(29630),c=n(67294),u=n(69311),l=n(57609),d=n(92381),f=n(85893);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t1||u||"USD"===n?2:7);var v=Math.pow(10,-b),w=0!==y&&Math.abs(y)99999);return h&&!A&&(x=Math.trunc(Number(x)*Math.pow(10,b))/Math.pow(10,b)),(0,a.jsxs)(s.Z,l(l({},g),{},{sx:l({display:"inline-flex",flexDirection:"row",alignItems:"center",position:"relative"},g.sx),noWrap:!0,children:[w&&(0,a.jsx)(s.Z,{component:"span",sx:{mr:.5},variant:d||g.variant,color:p||"text.secondary",children:"<"}),"usd"===(null===n||void 0===n?void 0:n.toLowerCase())&&!u&&(0,a.jsx)(s.Z,{component:"span",sx:{mr:.5},variant:d||g.variant,color:p||"text.secondary",children:"$"}),A?(0,a.jsx)(f,{value:x,visibleDecimals:b,roundDown:h,compactThreshold:m}):new Intl.NumberFormat("en-US",{maximumFractionDigits:b,minimumFractionDigits:b}).format(x),u&&(0,a.jsx)(s.Z,{component:"span",sx:{ml:.5},variant:d||g.variant,color:p||"text.secondary",children:"%"}),"usd"!==(null===n||void 0===n?void 0:n.toLowerCase())&&"undefined"!==typeof n&&(0,a.jsx)(s.Z,{component:"span",sx:{ml:.5},variant:d||g.variant,color:p||"text.secondary",children:n})]}))}},68861:function(e,t,n){"use strict";n.d(t,{rU:function(){return b},Z6:function(){return v}});var r=n(59499),i=n(4730),o=n(68346),s=n(81719),a=n(86010),c=n(41664),u=n(11163),l=n(67294),d=n(85893),f=["to","linkAs","href","replace","scroll","shallow","prefetch","locale"],p=["as","className","href","noLinkStyle","role"];function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${(0,g.Z)(n.color)}`],t[`fontSize${(0,g.Z)(n.fontSize)}`]]}})((({theme:e,ownerState:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,fontSize:{inherit:"inherit",small:e.typography.pxToRem(20),medium:e.typography.pxToRem(24),large:e.typography.pxToRem(36)}[t.fontSize],color:{primary:(e.vars||e).palette.primary.main,secondary:(e.vars||e).palette.secondary.main,info:(e.vars||e).palette.info.main,success:(e.vars||e).palette.success.main,warning:(e.vars||e).palette.warning.main,action:(e.vars||e).palette.action.active,error:(e.vars||e).palette.error.main,disabled:(e.vars||e).palette.action.disabled,inherit:void 0}[t.color]}))),A=d.forwardRef((function(e,t){const n=(0,m.Z)({props:e,name:"MuiIcon"}),{baseClassName:r="material-icons",className:i,color:o="inherit",component:s="span",fontSize:a="medium"}=n,c=(0,l.Z)(n,w),d=(0,u.Z)({},n,{baseClassName:r,color:o,component:s,fontSize:a}),h=(e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root","inherit"!==t&&`color${(0,g.Z)(t)}`,`fontSize${(0,g.Z)(n)}`]};return(0,p.Z)(i,b,r)})(d);return(0,v.jsx)(x,(0,u.Z)({as:s,className:(0,f.default)(r,"notranslate",h.root,i),ownerState:d,"aria-hidden":!0,ref:t},c))}));A.muiName="Icon";var E=A,_=n(30120),k=n(60082),T=Object.defineProperty,S=(e,t,n)=>(((e,t,n)=>{t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const C=(e,t)=>typeof getComputedStyle<"u"?getComputedStyle(e,null).getPropertyValue(t):e.style.getPropertyValue(t),I=e=>C(e,"overflow")+C(e,"overflow-y")+C(e,"overflow-x");class O extends d.Component{constructor(e){super(e),S(this,"elementObserver"),S(this,"wrapper"),S(this,"lazyLoadHandler",(e=>{var t,n;const{onContentVisible:r}=this.props,[i]=e,{isIntersecting:o}=i;if(o){this.setState({visible:!0},(()=>{r&&r()}));const e=null==(t=this.wrapper)?void 0:t.current;e&&e instanceof HTMLElement&&(null==(n=this.elementObserver)||n.unobserve(e))}})),this.elementObserver=null,this.wrapper=d.createRef(),this.state={visible:!1}}componentDidMount(){var e;this.getEventNode();const{offset:t,threshold:n}=this.props,r={rootMargin:"number"==typeof t?`${t}px`:t||"0px",threshold:n||0};this.elementObserver=new IntersectionObserver(this.lazyLoadHandler,r);const i=null==(e=this.wrapper)?void 0:e.current;i instanceof HTMLElement&&this.elementObserver.observe(i)}shouldComponentUpdate(e,t){return t.visible}componentWillUnmount(){var e,t;const n=null==(e=this.wrapper)?void 0:e.current;n&&n instanceof HTMLElement&&(null==(t=this.elementObserver)||t.unobserve(n))}getEventNode(){var e;return(e=>{if(!(e instanceof HTMLElement))return window;let t=e;for(;t&&t!==document.body&&t!==document.documentElement&&t.parentNode;){if(/(scroll|auto)/.test(I(t)))return t;t=t.parentNode}return window})(null==(e=this.wrapper)?void 0:e.current)}render(){const{children:e,className:t,height:n,width:r,elementType:i}=this.props,{visible:o}=this.state,s={height:n,width:r},a=`LazyLoad${o?" is-visible":""}${t?` ${t}`:""}`;return(0,d.createElement)(i||"div",{className:a,style:s,ref:this.wrapper},o&&d.Children.only(e))}}S(O,"defaultProps",{elementType:"div",className:"",offset:0,threshold:0,width:null,onContentVisible:null,height:null});var R=["symbol","aToken"],D=["symbol","logoURI"],P=["symbols","badgeSymbol"],B=["symbol"];function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t1){var l=(t=u,(0,r.Z)(t)||(0,i.Z)(t)||(0,o.Z)(t)||(0,s.Z)()),d=l[0],f=l.slice(1);return(0,v.jsx)(Z,N(N({},a),{},{symbols:f,badgeSymbol:"/pools/"+d}))}return(0,v.jsx)(j,N({symbol:n},a))}L.displayName="ATokenIcon"},19952:function(e,t,n){"use strict";n.d(t,{v:function(){return F}});var r=n(59499),i=n(4730),o=n(63366),s=n(87462),a=n(67294),c=n(86010),u=n(94780),l=n(41796),d=n(81719),f=n(78884),p=n(36622),h=n(70918),m=n(34867);function g(e){return(0,m.Z)("MuiAlert",e)}var y,b=(0,n(1588).Z)("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),v=n(80562),w=n(54235),x=n(85893),A=(0,w.Z)((0,x.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),E=(0,w.Z)((0,x.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),_=(0,w.Z)((0,x.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 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),k=(0,w.Z)((0,x.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),T=(0,w.Z)((0,x.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");const S=["action","children","className","closeText","color","icon","iconMapping","onClose","role","severity","variant"],C=(0,d.ZP)(h.Z,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${(0,p.Z)(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?l._j:l.$n,r="light"===e.palette.mode?l.$n:l._j,i=t.color||t.severity;return(0,s.Z)({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},i&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${i}Color`]:n(e.palette[i].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${i}StandardBg`]:r(e.palette[i].light,.9),[`& .${b.icon}`]:e.vars?{color:e.vars.palette.Alert[`${i}IconColor`]}:{color:"dark"===e.palette.mode?e.palette[i].main:e.palette[i].light}},i&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${i}Color`]:n(e.palette[i].light,.6),border:`1px solid ${(e.vars||e).palette[i].light}`,[`& .${b.icon}`]:e.vars?{color:e.vars.palette.Alert[`${i}IconColor`]}:{color:"dark"===e.palette.mode?e.palette[i].main:e.palette[i].light}},i&&"filled"===t.variant&&(0,s.Z)({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${i}FilledColor`],backgroundColor:e.vars.palette.Alert[`${i}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[i].dark:e.palette[i].main,color:e.palette.getContrastText("dark"===e.palette.mode?e.palette[i].dark:e.palette[i].main)}))})),I=(0,d.ZP)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),O=(0,d.ZP)("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),R=(0,d.ZP)("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),D={success:(0,x.jsx)(A,{fontSize:"inherit"}),warning:(0,x.jsx)(E,{fontSize:"inherit"}),error:(0,x.jsx)(_,{fontSize:"inherit"}),info:(0,x.jsx)(k,{fontSize:"inherit"})};var P=a.forwardRef((function(e,t){const n=(0,f.Z)({props:e,name:"MuiAlert"}),{action:r,children:i,className:a,closeText:l="Close",color:d,icon:h,iconMapping:m=D,onClose:b,role:w="alert",severity:A="success",variant:E="standard"}=n,_=(0,o.Z)(n,S),k=(0,s.Z)({},n,{color:d,severity:A,variant:E}),P=(e=>{const{variant:t,color:n,severity:r,classes:i}=e,o={root:["root",`${t}${(0,p.Z)(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return(0,u.Z)(o,g,i)})(k);return(0,x.jsxs)(C,(0,s.Z)({role:w,elevation:0,ownerState:k,className:(0,c.default)(P.root,a),ref:t},_,{children:[!1!==h?(0,x.jsx)(I,{ownerState:k,className:P.icon,children:h||m[A]||D[A]}):null,(0,x.jsx)(O,{ownerState:k,className:P.message,children:i}),null!=r?(0,x.jsx)(R,{ownerState:k,className:P.action,children:r}):null,null==r&&b?(0,x.jsx)(R,{ownerState:k,className:P.action,children:(0,x.jsx)(v.Z,{size:"small","aria-label":l,title:l,color:"inherit",onClick:b,children:y||(y=(0,x.jsx)(T,{fontSize:"small"}))})}):null]}))})),B=["children","sx"];function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;tNumber(R)?i("-1"):i(e.target.value))},inputProps:{"aria-label":"amount input",style:{fontSize:"21px",lineHeight:"28,01px",padding:0,height:"28px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},inputComponent:I}),""!==t&&!v&&(0,k.jsx)(f.Z,{sx:{minWidth:0,p:0,left:8,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},onClick:function(){i&&i("")},disabled:b,children:(0,k.jsx)(s.Z,{height:16})}),T&&1!==S.length?(0,k.jsx)(p.Z,{children:(0,k.jsxs)(h.Z,{disabled:b,value:G.symbol,onChange:function(e){var t=S.find((function(t){return t.symbol===e.target.value}));T&&T(t),i&&i("")},variant:"outlined",className:"AssetInput__select","data-cy":"assetSelect",MenuProps:{sx:{maxHeight:"240px",".MuiPaper-root":{border:"dark"===H.palette.mode?"1px solid #EBEBED1F":"unset",boxShadow:"0px 2px 10px 0px #0000001A"}}},sx:{p:0,"&.AssetInput__select .MuiOutlinedInput-input":{p:0,backgroundColor:"transparent",pr:"24px !important"},"&.AssetInput__select .MuiOutlinedInput-notchedOutline":{display:"none"},"&.AssetInput__select .MuiSelect-icon":{color:"text.primary",right:"0%"}},renderValue:function(e){var t=1===S.length?S[0]:S&&S.find((function(t){return t.symbol===e}));return(0,k.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center"},"data-cy":"assetsSelectedOption_".concat(t.symbol.toUpperCase()),children:[(0,k.jsx)(E.T1,{symbol:t.iconSymbol||t.symbol,aToken:t.aToken,sx:{mr:2,ml:4}}),(0,k.jsx)(u.Z,{variant:"main16",color:"text.primary",children:e})]})},children:[U||void 0,S.map((function(e){return(0,k.jsx)(m.Z,{value:e.symbol,"data-cy":"assetsSelectOption_".concat(e.symbol.toUpperCase()),children:Z?Z(e):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(E.T1,{aToken:e.aToken,symbol:e.iconSymbol||e.symbol,sx:{fontSize:"22px",mr:1}}),(0,k.jsx)(g.Z,{sx:{mr:6},children:e.symbol}),e.balance&&(0,k.jsx)(A.B,{value:e.balance,compact:!0})]})},e.symbol)}))]})}):(0,k.jsxs)(c.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[!(0,_.M)(G.iconSymbol||G.symbol)&&(0,k.jsx)(E.T1,{aToken:G.aToken,symbol:G.iconSymbol||G.symbol,sx:(0,_.M)(G.iconSymbol||G.symbol)?{}:{mr:2,ml:4},fontSize:(0,_.M)(G.iconSymbol||G.symbol)?"large":"inherit"}),(0,k.jsx)(u.Z,{variant:"h3",sx:{lineHeight:"28px"},"data-cy":"inputAsset",children:r})]})]}),(0,k.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",height:"16px"},children:[L?(0,k.jsx)(c.Z,{sx:{flex:1}}):(0,k.jsx)(A.B,{value:isNaN(Number(n))?0:Number(n),compact:!0,symbol:"USD",variant:"secondary12",color:"text.muted",symbolsColor:"text.muted",flexGrow:1}),G.balance&&i&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(u.Z,{component:"div",variant:"secondary12",color:"text.secondary",children:[N&&""!==N?N:(0,k.jsx)(o.cC,{id:"Balance"})," ",(0,k.jsx)(A.B,{value:G.balance,compact:!0,variant:"secondary12",color:"text.secondary",symbolsColor:"text.disabled"})]}),!v&&(0,k.jsx)(y.Z,{size:"small",sx:{minWidth:0,ml:"7px",p:0},onClick:function(){j&&z(j.eventName,C({},j.eventParams)),i("-1")},disabled:b||B,children:(0,k.jsx)(o.cC,{id:"Max"})})]})]})]})]})}},60008:function(e,t,n){"use strict";n.d(t,{Fy:function(){return G},_h:function(){return i}});var r,i,o=n(49501),s=n(48949),a=n(80227),c=n(29630),u=n(81645),l=n(68346),d=n(30120),f=n(67294),p=n(41024),h=n(92391),m=n(19952),g=n(34220),y=n(43478),b=n(8195),v=n(46930),w=n(77537),x=n(63206),A=n(76920),E=n(63491),_=n(67916),k=n(93608),T=n(57824),S=n(78944),C=n(10343),I=n(50029),O=n(87794),R=n.n(O),D=n(75331),P=n(89291),B=n(69311),M=n(67489),N=n(32667),F=n(85893),L=function(e){var t=e.isWrongNetwork,n=e.blocked,r=e.selectedEmode,i=e.activeEmode,s=e.eModes,a=(0,B.Yh)((function(e){return e.setUserEMode})),c=(0,P.Q)({tryPermit:!1,handleGetTxns:function(){var e=(0,I.Z)(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a(r));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),skip:n,deps:[r],protocolAction:D.UQ.setEModeUsage,eventTxInfo:{previousState:(0,N.U)(s[i].label),newState:(0,N.U)(s[r].label)}}),u=c.action,l=c.loadingTxns,d=c.mainTxState,f=c.requiresApproval;return(0,F.jsx)(M.B,{requiresApproval:f,blocked:n,mainTxState:d,preparingTransactions:l,handleAction:u,actionText:0===i?(0,F.jsx)(o.cC,{id:"Enable E-Mode"}):0!==r?(0,F.jsx)(o.cC,{id:"Switch E-Mode"}):(0,F.jsx)(o.cC,{id:"Disable E-Mode"}),actionInProgressText:0===i?(0,F.jsx)(o.cC,{id:"Enabling E-Mode"}):0!==r?(0,F.jsx)(o.cC,{id:"Switching E-Mode"}):(0,F.jsx)(o.cC,{id:"Disabling E-Mode"}),isWrongNetwork:t})},j=n(47546),U=n(55343),Z=n(31538),H=n(46541),z=function(e){var t=e.emodeCategories,n=e.selectedEmode,r=e.setSelectedEmode,i=e.userEmode;return(0,F.jsxs)(U.Z,{sx:{mb:1,width:"100%"},children:[(0,F.jsx)(j.Z,{sx:{mb:1,color:"text.secondary"},children:(0,F.jsx)(o.cC,{id:"Asset category"})}),(0,F.jsx)(H.Z,{defaultValue:0,value:n,onChange:function(e){r(t[Number(e.target.value)])},className:"EmodeSelect","data-cy":"EmodeSelect",sx:{width:"100%",height:"44px",borderRadius:"6px",borderColor:"divider",outline:"none !important",color:"text.primary",".MuiOutlinedInput-input":{backgroundColor:"transparent"},".MuiOutlinedInput-notchedOutline, .MuiOutlinedInput-notchedOutline":{borderColor:"divider",outline:"none !important",borderWidth:"1px"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"},"&.EmodeSelect .MuiSelect-icon":{color:"text.primary"}},native:!1,renderValue:function(e){return 0!==e?(0,F.jsx)(c.Z,{color:"text.primary",children:(0,N.U)(t[e].label)}):(0,F.jsx)(c.Z,{color:"text.muted",children:(0,F.jsx)(o.cC,{id:"Select"})})},children:Object.keys(t).map((function(e){if(i!==Number(e)&&0!==Number(e))return(0,F.jsx)(Z.Z,{value:t[Number(e)].id,children:(0,F.jsx)(c.Z,{color:"text.primary",children:(0,N.U)(t[Number(e)].label)})},"emode-".concat(t[Number(e)].id))}))})]})};!function(e){e[e.EMODE_DISABLED_LIQUIDATION=0]="EMODE_DISABLED_LIQUIDATION",e[e.CLOSE_POSITIONS_BEFORE_SWITCHING=1]="CLOSE_POSITIONS_BEFORE_SWITCHING"}(r||(r={})),function(e){e.ENABLE="Enable",e.DISABLE="Disable",e.SWITCH="Switch"}(i||(i={}));var G=function(e){var t=e.mode,n=(0,g.HT)(),I=n.user,O=n.reserves,R=n.eModes,D=n.marketReferenceCurrencyDecimals,P=n.marketReferencePriceInUsd,B=n.userReserves,M=(0,v.f)().currentChainId,j=(0,w.Z)(),U=j.chainId,Z=j.readOnlyModeAddress,H=(0,y.p)(1),G=(0,b.vR)(),V=G.gasLimit,W=G.mainTxState,q=G.txError,$=(0,f.useState)(function(e,t,n){var r=Object.keys(t).length;if(e===i.ENABLE){if(r>2)return;return t[1]}if(e===i.SWITCH){if(r>3)return;return 1===n?t[2]:t[1]}return t[0]}(t,R,I.userEmodeCategoryId)),K=$[0],Y=$[1],X=(0,x.Mo)(M),J=(0,s.G)({currentTimestamp:H,userReserves:B,formattedReserves:O,userEmodeCategoryId:K?K.id:0,marketReferenceCurrencyDecimals:D,marketReferencePriceInUsd:P}),Q=void 0;if(I.isInEmode&&0===(null===K||void 0===K?void 0:K.id))Number(J.healthFactor)<1.01&&"-1"!==J.healthFactor&&(Q=r.EMODE_DISABLED_LIQUIDATION);else if(K&&I.userEmodeCategoryId!==(null===K||void 0===K?void 0:K.id)){I.userReservesData.some((function(e){return(Number(e.scaledVariableDebt)>0||Number(e.principalStableDebt)>0)&&e.reserve.eModeCategoryId!==(null===K||void 0===K?void 0:K.id)}))&&(Q=r.CLOSE_POSITIONS_BEFORE_SWITCHING)}var ee=function(){switch(Q){case r.CLOSE_POSITIONS_BEFORE_SWITCHING:return(0,F.jsx)(m.v,{severity:"info",sx:{mt:6,alignItems:"center"},children:(0,F.jsx)(c.Z,{variant:"caption",children:(0,F.jsx)(o.cC,{id:"To enable E-mode for the {0} category, all borrow positions outside of this category must be closed.",values:{0:K&&(0,N.U)(K.label)}})})});case r.EMODE_DISABLED_LIQUIDATION:return(0,F.jsxs)(m.v,{severity:"error",sx:{mt:6,alignItems:"center"},children:[(0,F.jsx)(c.Z,{variant:"subheader1",color:"#4F1919",children:(0,F.jsx)(o.cC,{id:"Cannot disable E-Mode"})}),(0,F.jsx)(c.Z,{variant:"caption",children:(0,F.jsx)(o.cC,{id:"You can not disable E-Mode as your current collateralization level is above 80%, disabling E-Mode can cause liquidation. To exit E-Mode supply or repay borrowed positions."})})]});default:return null}},te=Object.keys(R).length>=3&&t===i.ENABLE||Object.keys(R).length>=4&&t===i.SWITCH,ne=M!==U,re=function(){return(0,F.jsx)(u.Z,{color:"primary",sx:{fontSize:"14px",mx:1},children:(0,F.jsx)(a.Z,{})})},ie=!!K&&0===K.id&&void 0===Q&&Number(J.healthFactor).toFixed(3)discord to learn more about how it works and the applied restrictions.",components:{0:(0,F.jsx)(l.Z,{href:"https://discord.gg/zerolend",target:"_blank",rel:"noopener"})}})})}),te&&(0,F.jsx)(z,{emodeCategories:R,selectedEmode:null===K||void 0===K?void 0:K.id,setSelectedEmode:Y,userEmode:I.userEmodeCategoryId}),Q===r.EMODE_DISABLED_LIQUIDATION&&(0,F.jsx)(ee,{}),ie&&(0,F.jsxs)(m.v,{severity:"error",sx:{mt:6,alignItems:"center"},children:[(0,F.jsx)(c.Z,{variant:"subheader1",color:"#4F1919",children:(0,F.jsx)(o.cC,{id:"Liquidation risk"})}),(0,F.jsx)(c.Z,{variant:"caption",children:(0,F.jsx)(o.cC,{id:"This action will reduce your health factor. Please be mindful of the increased risk of collateral liquidation."})})]}),(0,F.jsxs)(T.m6,{gasLimit:V,children:[!te&&(0,F.jsx)(h.X,{caption:(0,F.jsx)(o.cC,{id:"E-Mode category"}),captionVariant:"description",mb:4,children:(0,F.jsxs)(d.Z,{sx:{display:"flex",justifyContent:"right",alignItems:"center"},children:[(0,F.jsx)(d.Z,{sx:{display:"inline-flex",alignItems:"center",mx:1},children:0!==I.userEmodeCategoryId?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(u.Z,{sx:{fontSize:"12px"},children:(0,F.jsx)(A.Z,{})}),(0,F.jsx)(c.Z,{variant:"subheader1",children:(0,N.U)(R[I.userEmodeCategoryId].label)})]}):(0,F.jsx)(c.Z,{variant:"subheader1",children:(0,F.jsx)(o.cC,{id:"None"})})}),K&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(re,{}),(0,F.jsx)(d.Z,{sx:{display:"inline-flex",alignItems:"center"},children:0!==K.id?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(u.Z,{sx:{fontSize:"12px",mr:.5},children:(0,F.jsx)(A.Z,{})}),(0,F.jsx)(c.Z,{variant:"subheader1",children:(0,N.U)(R[K.id].label)})]}):(0,F.jsx)(c.Z,{variant:"subheader1",children:(0,F.jsx)(o.cC,{id:"None"})})})]})]})}),(0,F.jsx)(h.X,{caption:(0,F.jsx)(o.cC,{id:"Available assets"}),captionVariant:"description",mb:4,sx:{alignContent:"flex-end"},children:(0,F.jsxs)(d.Z,{sx:{display:"flex",justifyContent:"right",alignItems:"center"},children:[R[I.userEmodeCategoryId]&&(0,F.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",textAlign:"end"},children:0!==I.userEmodeCategoryId?(0,F.jsx)(c.Z,{sx:{textAlign:"end"},children:R[I.userEmodeCategoryId].assets.join(", ")}):(0,F.jsx)(c.Z,{children:(0,F.jsx)(o.cC,{id:"All Assets"})})}),K&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(re,{}),(0,F.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",textAlign:"end"},children:0!==(null===K||void 0===K?void 0:K.id)?(0,F.jsx)(c.Z,{sx:{textAlign:"end"},children:K.assets.join(", ")}):(0,F.jsx)(c.Z,{children:(0,F.jsx)(o.cC,{id:"All Assets"})})})]})]})}),(0,F.jsx)(T.jz,{visibleHfChange:!!K,healthFactor:I.healthFactor,futureHealthFactor:J.healthFactor}),oe&&(0,F.jsx)(h.X,{caption:(0,F.jsx)(o.cC,{id:"Maximum loan to value"}),captionVariant:"description",mb:4,align:"flex-start",children:(0,F.jsx)(d.Z,{sx:{textAlign:"right"},children:(0,F.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[(0,F.jsx)(p.B,{value:I.currentLoanToValue,sx:{color:"text.primary"},visibleDecimals:2,compact:!0,percent:!0,variant:"secondary14"}),void 0!==K&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(re,{}),(0,F.jsx)(p.B,{value:J.currentLoanToValue,sx:{color:"text.primary"},visibleDecimals:2,compact:!0,percent:!0,variant:"secondary14"})]})]})})})]}),Q===r.CLOSE_POSITIONS_BEFORE_SWITCHING&&(0,F.jsx)(ee,{}),q&&(0,F.jsx)(_.Q,{txError:q}),(0,F.jsx)(L,{isWrongNetwork:ne,blocked:void 0!==Q||!K,selectedEmode:(null===K||void 0===K?void 0:K.id)||0,activeEmode:I.userEmodeCategoryId,eModes:R})]})}},32667:function(e,t,n){"use strict";n.d(t,{U:function(){return r}});var r=function(e){return""===e?"Disabled":e}},3336:function(e,t,n){"use strict";n.d(t,{F:function(){return Z}});var r,i,o=n(59499),s=n(49501),a=n(67294),c=n(8195),u=n(69311),l=n(31959),d=n(94635),f=n(50029),p=n(87794),h=n.n(p),m=n(29630),g=n(30120),y=n(75084),b=n(90149),v=n(77537),w=n(83601),x=n(93608),A=n(57824),E=n(85893),_=null!==globalThis&&void 0!==globalThis?globalThis:window,k="undefined"!==typeof _.turnstile?"ready":"unloaded",T="cf__reactTurnstileOnLoad",S=new Promise((function(e,t){i={resolve:e,reject:t},"ready"===k&&e(void 0)}));function C(e){var t=e.id,n=e.ref,i=e.className,o=e.style,s=e.sitekey,c=e.action,u=e.cData,l=e.theme,d=e.size,p=e.tabIndex,m=e.responseField,g=e.responseFieldName,y=e.retry,b=e.retryInterval,v=e.autoResetOnExpire,w=e.onVerify,x=e.onLoad,A=e.onError,_=e.onExpire,T=e.onTimeout,S=(0,a.useRef)(null),C=(0,a.useState)({onVerify:w})[0],I=null!==n&&void 0!==n?n:S;return(0,a.useEffect)((function(){if(I.current){var e=!1,t="";return(0,f.Z)(h().mark((function n(){var i,o,a;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("ready"===k){n.next=10;break}return n.prev=1,n.next=4,r();case 4:n.next=10;break;case 6:return n.prev=6,n.t0=n.catch(1),null===(o=C.onError)||void 0===o||o.call(C,n.t0),n.abrupt("return");case 10:if(!e&&I.current){n.next=12;break}return n.abrupt("return");case 12:a={sitekey:s,action:c,cData:u,theme:l,size:d,tabindex:p,callback:function(e){return C.onVerify(e)},"error-callback":function(){var e;return null===(e=C.onError)||void 0===e?void 0:e.call(C)},"expired-callback":function(){var e;null===(e=C.onExpire)||void 0===e||e.call(C),v&&window.turnstile.reset(t)},"timeout-callback":function(){var e;return null===(e=C.onTimeout)||void 0===e?void 0:e.call(C)},"response-field":m,"response-field-name":g,retry:y,"retry-interval":b},t=window.turnstile.render(I.current,a),null===(i=C.onLoad)||void 0===i||i.call(C,t);case 15:case"end":return n.stop()}}),n,null,[[1,6]])})))(),function(){e=!0,t&&window.turnstile.remove(t)}}}),[s,c,u,l,d,p,m,g,y,b,v]),(0,a.useEffect)((function(){C.onVerify=w,C.onLoad=x,C.onError=A,C.onExpire=_}),[w,x,A,_,T]),(0,E.jsx)("div",{ref:I,id:t,className:i,style:o})}_.cf__reactTurnstileOnLoad=function(){i.resolve(),k="ready"},r=function(){if("unloaded"===k){k="loading";var e="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(T,"&render=explicit"),t=document.createElement("script");t.src=e,t.async=!0,t.addEventListener("error",(function(){i.reject("Failed to load Turnstile.")})),document.head.appendChild(t)}return S};var I,O=n(80854),R=n(1279),D=function(e,t){var n=(0,O.gU)("1000",18),r=O.Ry[e.toUpperCase()]?O.Ry[e.toUpperCase()]:n;return(0,R.Fv)(r,t)},P=n(83454),B=function(e){var t=e.underlyingAsset,n=(0,v.Z)().readOnlyModeAddress,r=(0,u.Yh)(),i=r.account,o=r.currentMarket,c=r.currentMarketData,l=(0,u.Yh)((function(e){return(0,w.Rp)(e)})),d=(0,a.useState)(""),p=d[0],_=d[1],k=(0,a.useState)(!1),T=k[0],S=k[1],I=(0,a.useState)(!0),O=I[0],R=I[1],B=(0,a.useState)(""),M=B[0],N=B[1],F=(0,a.useState)(""),L=F[0],j=F[1],U="".concat(P.env.NEXT_PUBLIC_API_BASEURL,"/faucet"),Z=P.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY,H=l.find((function(e){return e.underlyingAsset===t})),z=D(H.symbol,H.decimals),G=function(){var e=(0,f.Z)(h().mark((function e(){var t,n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,N(""),S(!0),j(""),e.next=6,fetch(U,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:i,captchaToken:p,market:o,tokenAddress:H.underlyingAsset,tokenSymbol:H.symbol,faucetAddress:c.addresses.FAUCET})});case 6:return t=e.sent,e.next=9,t.json();case 9:if(n=e.sent,t.ok){e.next=12;break}throw new Error(n.msg);case 12:N(n.msg),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),e.t0 instanceof Error&&e.t0.message?j(e.t0.message):j("An error occurred trying to send the transaction");case 18:return e.prev=18,S(!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[0,15,18,21]])})));return function(){return e.apply(this,arguments)}}();return M?(0,E.jsx)(x.R,{txHash:M,action:(0,E.jsx)(s.cC,{id:"will receive"}),symbol:H.symbol,amount:z}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(C,{sitekey:Z,onVerify:function(e){_(e),R(!1)},autoResetOnExpire:!0}),(0,E.jsxs)(m.Z,{variant:"h2",sx:{mb:6},children:[(0,E.jsx)(s.cC,{id:"Faucet"})," ",H.symbol]}),(0,E.jsx)(g.Z,{sx:function(e){return{p:3,border:"1px solid ".concat(e.palette.divider),borderRadius:"4px",".MuiBox-root:last-of-type":{mb:0}}},children:(0,E.jsx)(A.oD,{description:(0,E.jsx)(s.cC,{id:"Amount"}),iconSymbol:H.symbol,symbol:H.symbol,value:z})}),(0,E.jsx)(m.Z,{variant:"helperText",color:"error.main",children:L}),(0,E.jsx)(g.Z,{sx:{display:"flex",flexDirection:"column",mt:12},children:(0,E.jsxs)(y.Z,{variant:"contained",disabled:T||!p||void 0!==n,onClick:G,size:"large",sx:{minHeight:"44px"},children:[(T||O)&&(0,E.jsx)(b.Z,{color:"inherit",size:"16px",sx:{mr:2}}),(0,E.jsx)(s.cC,{id:"Faucet {0}",values:{0:H.symbol}})]})})]})},M=n(67916),N=n(89291),F=n(67489),L=function(e){var t=e.poolReserve,n=e.isWrongNetwork,r=e.blocked,i=(0,u.Yh)((function(e){return e.mint})),o=(0,N.Q)({tryPermit:!1,handleGetTxns:function(){var e=(0,f.Z)(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i({tokenSymbol:t.symbol,reserve:t.underlyingAsset}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),skip:r}),a=o.action,c=o.loadingTxns,l=o.mainTxState,d=o.requiresApproval;return(0,E.jsx)(F.B,{requiresApproval:d,blocked:r,preparingTransactions:c,handleAction:a,actionText:(0,E.jsx)(s.cC,{id:"Faucet {0}",values:{0:t.symbol}}),actionInProgressText:(0,E.jsx)(s.cC,{id:"Pending..."}),mainTxState:l,isWrongNetwork:n})};I||(I={});var j=function(e){var t=e.poolReserve,n=e.isWrongNetwork,r=(0,c.vR)(),i=r.gasLimit,o=r.mainTxState,a=r.txError,u=D(t.symbol,t.decimals);return o.success?(0,E.jsx)(x.R,{action:(0,E.jsx)(s.cC,{id:"Received"}),symbol:t.symbol,amount:u}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(A.m6,{gasLimit:i,children:(0,E.jsx)(A.oD,{description:(0,E.jsx)(s.cC,{id:"Amount"}),iconSymbol:t.symbol,symbol:t.symbol,value:u})}),a&&(0,E.jsx)(M.Q,{txError:a}),(0,E.jsx)(L,{poolReserve:t,isWrongNetwork:n,blocked:!1})]})};function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Z=function(){var e=(0,c.vR)(),t=e.type,n=e.close,r=e.args,i=(0,u.Yh)().isFaucetPermissioned;return(0,E.jsx)(l.P,{open:t===c.w8.Faucet,setOpen:n,children:i?(0,E.jsx)(B,{underlyingAsset:r.underlyingAsset}):(0,E.jsx)(d.A,{title:(0,E.jsx)(s.cC,{id:"Faucet"}),underlyingAsset:r.underlyingAsset,children:function(e){return(0,E.jsx)(j,function(e){for(var t=1;tDiscord .",components:{0:(0,f.jsx)(u.Z,{href:"https://discord.gg/zerolend"})}})}),(0,f.jsxs)(l.Z,{variant:"outlined",onClick:function(){return navigator.clipboard.writeText(t.rawError.message.toString())},size:"small",sx:{mt:6},children:[(0,f.jsx)(r.cC,{id:"Copy error text"}),(0,f.jsx)(a.Z,{sx:{ml:.5,fontSize:"12px"},children:(0,f.jsx)(o.Z,{})})]})]}),(0,f.jsx)(s.Z,{sx:{display:"flex",flexDirection:"column",mt:12},children:(0,f.jsx)(l.Z,{onClick:n,variant:"contained",size:"large",sx:{minHeight:"44px"},children:(0,f.jsx)(r.cC,{id:"Close"})})})]})}},68206:function(e,t,n){"use strict";n.d(t,{Z:function(){return z},_:function(){return H}});var r=n(30120),i=n(67294),o=n(49501),s=n(62753),a=n(16247),c=n(62097),u=n(29630),l=n(80562),d=n(90149),f=n(55343),p=n(46541),h=n(31538),m=n(61702),g=n(41024),y=n(52526),b=n(58527),v=n(65856),w=n(1279),x=n(85893),A=function(e){var t=e.paymasterData,n=e.symbol,i=e.totalGasCostsUsd,A=void 0===i?0:i,E=e.onSelect,_=e.assets,k=e.selectOptionHeader,T=e.selectOption,S=e.amountInUSD,C=(0,c.Z)(),I="ETH"===n?A.toFixed(3):t&&t.estimatedFinalFeeUSD?Number(t.estimatedFinalFeeUSD).toFixed(3):"-",O=1===_.length?_[0]:_&&_.find((function(e){return e.symbol===n}));return(0,x.jsxs)(r.Z,{sx:{background:"#f6f6f6",borderRadius:"6px",border:"1px solid ".concat(C.palette.divider)},children:[(0,x.jsxs)(r.Z,{sx:{display:"flex",flex:1,color:"#999",p:2},children:[(0,x.jsx)(u.Z,{variant:"caption",children:(0,x.jsx)(o.cC,{id:"Transaction Cost"})}),(0,x.jsx)(b.G,{children:(0,x.jsx)(o.cC,{id:"You can choose a different asset other than ETH to pay your transaction fees. This can be any supported ERC20 token."})})]}),(0,x.jsxs)(r.Z,{sx:{p:"0 12px 8px 12px"},children:[t&&(0,x.jsxs)(r.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,x.jsx)(l.Z,{sx:{minWidth:0,p:0,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},children:(0,x.jsx)(a.Z,{color:"primary",sx:{fontSize:"16px",mr:1.5}})}),(0,x.jsx)(u.Z,{sx:{fontSize:"14px",flex:1,lineHeight:"2",padding:0,height:"28px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:null===t||void 0===t?void 0:t.markup})]}),(0,x.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",mb:.5,justifyContent:"space-between"},children:[(0,x.jsxs)(r.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,x.jsx)(l.Z,{sx:{minWidth:0,p:0,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},children:(0,x.jsx)(s.Z,{color:"primary",sx:{fontSize:"16px",mr:1.5}})}),t||"-"!==I?(0,x.jsxs)(r.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,x.jsx)(g.B,{value:I,symbol:"USD",color:"text.secondary"}),(0,x.jsx)(u.Z,{sx:{ml:2},children:"(Approx)"})]}):0===S?(0,x.jsx)(u.Z,{sx:{fontSize:"14px",flex:1,lineHeight:"2",padding:0,height:"28px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:"-"}):(0,x.jsx)(d.Z,{color:"inherit",size:"16px",sx:{mr:2}})]}),E&&1!==_.length?(0,x.jsx)(f.Z,{children:(0,x.jsxs)(p.Z,{value:O.symbol,onChange:function(e){var t=_.find((function(t){return t.symbol===e.target.value}));E&&E(t)},variant:"outlined",className:"AssetInput__select","data-cy":"assetSelect",MenuProps:{sx:{maxHeight:"240px",".MuiPaper-root":{border:"dark"===C.palette.mode?"1px solid #EBEBED1F":"unset",boxShadow:"0px 2px 10px 0px #0000001A"}}},sx:{p:0,"&.AssetInput__select .MuiOutlinedInput-input":{p:0,backgroundColor:"transparent",pr:"24px !important"},"&.AssetInput__select .MuiOutlinedInput-notchedOutline":{display:"none"},"&.AssetInput__select .MuiSelect-icon":{color:"text.primary",right:"0%"}},renderValue:function(e){var t=1===_.length?_[0]:_&&_.find((function(t){return t.symbol===e}));return(0,x.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center"},"data-cy":"assetsSelectedOption_".concat(t.symbol.toUpperCase()),children:[(0,x.jsx)(y.T1,{symbol:t.iconSymbol||t.symbol,aToken:t.aToken,sx:{mr:2,ml:4}}),(0,x.jsx)(u.Z,{variant:"main16",color:"text.primary",children:e})]})},children:[k||void 0,_.map((function(e){return(0,x.jsx)(h.Z,{value:e.symbol,"data-cy":"assetsSelectOption_".concat(e.symbol.toUpperCase()),children:T?T(e):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(y.T1,{aToken:e.aToken,symbol:e.iconSymbol||e.symbol,sx:{fontSize:"22px",mr:1}}),(0,x.jsx)(m.Z,{sx:{mr:6},children:e.symbol}),(0,x.jsx)(g.B,{value:(0,w.pV)((0,v.Z)(e.address).toString(),e.decimals||18).toString(),compact:!0})]})},e.symbol)}))]})}):(0,x.jsxs)(r.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,x.jsx)(y.T1,{aToken:O.aToken,symbol:O.iconSymbol||O.symbol,sx:{mr:2,ml:4},fontSize:"inherit"}),(0,x.jsx)(u.Z,{variant:"h3",sx:{lineHeight:"28px"},"data-cy":"inputAsset",children:n})]})]})]}),(0,x.jsx)(r.Z,{sx:{display:"flex",textAlign:"center",flex:1,background:C.palette.divider,p:2},children:(0,x.jsxs)(u.Z,{variant:"caption",sx:{margin:"auto",color:"#333"},children:["Paymasters are an experimental feature. Use it at you own risk. Paymaster integration is powered by zyfi.org. You are paying transaction fees in ",O.iconSymbol,"."]})})]})},E=n(46930),_=n(80854),k=n(9144),T=n(56371),S=n(59499),C=n(36864),I=n(57609);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t5&&(0,x.jsx)(Z,{})]}):(0,x.jsx)(U,{gasLimit:p,skipLoad:e.skipLoad,disabled:e.disabled})}},67916:function(e,t,n){"use strict";n.d(t,{Q:function(){return c}});var r=n(49501),i=n(29630),o=n(75084),s=n(19952),a=n(85893),c=function(e){var t=e.txError;return(0,a.jsx)(s.v,{severity:"error",sx:{mt:4,mb:0},children:(0,a.jsx)(i.Z,{variant:"description",children:t.error?(0,a.jsxs)(a.Fragment,{children:[t.error," ",(0,a.jsx)(o.Z,{sx:{verticalAlign:"top"},variant:"text",onClick:function(){return navigator.clipboard.writeText(t.rawError.message.toString())},children:(0,a.jsx)(i.Z,{variant:"description",children:(0,a.jsx)(r.cC,{id:"copy the error"})})})]}):(0,a.jsx)(r.cC,{id:"There was some error. Please try changing the parameters or <0><1>copy the error",components:{0:(0,a.jsx)(o.Z,{sx:{verticalAlign:"top"},onClick:function(){return navigator.clipboard.writeText(t.rawError.message.toString())}}),1:(0,a.jsx)(i.Z,{variant:"description"})}})})})}},94635:function(e,t,n){"use strict";n.d(t,{A:function(){return b}});var r=n(80854),i=(n(67294),n(34220)),o=n(82482),s=n(43629),a=n(66209),c=n(8195),u=n(90452),l=n(46930),d=n(77537),f=n(63206),p=n(57609),h=n(78944),m=n(10343),g=n(63491),y=n(85893),b=function(e){var t,n,b=e.hideTitleSymbol,v=e.underlyingAsset,w=e.children,x=e.requiredChainId,A=e.title,E=e.requiredPermission,_=e.keepWrappedSymbol,k=(0,d.Z)().readOnlyModeAddress,T=(0,o.P)().walletBalances,S=(0,l.f)(),C=S.currentNetworkConfig,I=S.currentMarketData,O=(0,i.HT)(),R=O.user,D=O.reserves,P=(0,c.vR)(),B=P.txError,M=P.mainTxState,N=(0,u.T)().permissions,F=(0,a.Q)(x),L=F.isWrongNetwork,j=F.requiredChainId;if(B&&B.blocking)return(0,y.jsx)(g.D,{txError:B});if(E&&f.cr.permissions(I)&&!N.includes(E)&&I.permissionComponent)return(0,y.jsx)(y.Fragment,{children:I.permissionComponent});var U=D.find((function(e){return v.toLowerCase()===r.hP.toLowerCase()?e.isWrappedBaseAsset:v===e.underlyingAsset})),Z=null===R||void 0===R?void 0:R.userReservesData.find((function(e){return v.toLowerCase()===r.hP.toLowerCase()?e.reserve.isWrappedBaseAsset:v===e.underlyingAsset})),H=U.isWrappedBaseAsset&&!_?C.baseAssetSymbol:U.symbol;return(0,y.jsxs)(s.hv,{asset:U,children:[!M.success&&(0,y.jsx)(h.E,{title:A,symbol:b?void 0:H}),L&&!k&&(0,y.jsx)(m.I,{networkName:(0,f.Mo)(j).name,chainId:j,event:{eventName:p.vh.SWITCH_NETWORK,eventParams:{asset:v}}}),w({isWrongNetwork:L,nativeBalance:(null===(t=T[r.hP.toLowerCase()])||void 0===t?void 0:t.amount)||"0",tokenBalance:(null===(n=T[U.underlyingAsset.toLowerCase()])||void 0===n?void 0:n.amount)||"0",poolReserve:U,symbol:H,underlyingAsset:v,userReserve:Z})]})}},93608:function(e,t,n){"use strict";n.d(t,{R:function(){return A}});var r=n(49501),i=n(75331),o=n(56365),s=n(58057),a=n(81645),c=n(62097),u=n(30120),l=n(29630),d=n(75084),f=n(68346),p=n(67294),h=n(29002),m=n(41024),g=n(52526),y=n(8195),b=n(46930),v=n(77537),w=n(85893),x=function(){return(0,w.jsx)(a.Z,{sx:{ml:"2px",fontSize:"11px"},children:(0,w.jsx)(o.Z,{})})},A=function(e){var t=e.txHash,n=e.action,o=e.amount,A=e.symbol,E=e.collateral,_=e.rate,k=e.addToken,T=e.customAction,S=e.customText,C=e.joinDiscord,I=void 0!==C&&C,O=(0,y.vR)(),R=O.close,D=O.mainTxState,P=(0,v.Z)().addERC20Token,B=(0,b.f)().currentNetworkConfig,M=(0,p.useState)(""),N=M[0],F=M[1],L=(0,c.Z)();return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(u.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,w.jsx)(u.Z,{sx:{width:"48px",height:"48px",bgcolor:"success.200",borderRadius:"50%",mt:14,mx:"auto",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,w.jsx)(a.Z,{sx:{color:"success.main",fontSize:"32px"},children:(0,w.jsx)(s.Z,{})})}),(0,w.jsx)(l.Z,{sx:{mt:4},variant:"h2",children:(0,w.jsx)(r.cC,{id:"All done!"})}),(0,w.jsxs)(u.Z,{sx:{mt:2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"},children:[n&&o&&A&&(0,w.jsx)(l.Z,{children:(0,w.jsx)(r.cC,{id:"You {action} <0/> {symbol}",values:{action:n,symbol:A},components:{0:(0,w.jsx)(m.B,{value:Number(o),compact:!0,variant:"secondary14"})}})}),T&&(0,w.jsxs)(l.Z,{children:[S,T]}),!n&&!o&&A&&(0,w.jsxs)(l.Z,{children:["Your ",A," ",E?"now":"is not"," used as collateral"]}),_&&(0,w.jsx)(l.Z,{children:(0,w.jsx)(r.cC,{id:"You switched to {0} rate",values:{0:_===i.tk.Variable?"variable":"stable"}})}),k&&A&&(0,w.jsxs)(u.Z,{sx:function(e){return{border:"dark"===e.palette.mode?"1px solid ".concat(e.palette.divider):"none",background:"dark"===e.palette.mode?"none":"#F7F7F9",borderRadius:"12px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",mt:"24px"}},children:[(0,w.jsx)(g.T1,{symbol:k.symbol,aToken:!(!k||!k.aToken),sx:{fontSize:"32px",mt:"12px",mb:"8px"}}),(0,w.jsx)(l.Z,{variant:"description",color:"text.primary",sx:{mx:"24px"},children:(0,w.jsx)(r.cC,{id:"Add {0} to wallet to track your balance.",values:{0:k&&k.aToken?"z0Token ":"token "}})}),(0,w.jsxs)(d.Z,{onClick:function(){P({address:k.address,decimals:k.decimals,symbol:k.aToken?"z0".concat(k.symbol.slice(0,11)):k.symbol.slice(0,11),image:/_/.test(k.symbol)?void 0:N})},variant:"dark"===L.palette.mode?"outlined":"contained",size:"medium",sx:{mt:"8px",mb:"12px"},children:[k.symbol&&!/_/.test(k.symbol)&&(0,w.jsx)(g.Js,{symbol:k.symbol,onImageGenerated:F,aToken:k.aToken}),(0,w.jsx)(h.o,{sx:{width:"20px",height:"20px"}}),(0,w.jsx)(l.Z,{variant:"buttonM",color:"white",ml:"4px",children:(0,w.jsx)(r.cC,{id:"Add to wallet"})})]})]}),I&&(0,w.jsxs)(u.Z,{sx:function(e){return{border:"dark"===e.palette.mode?"1px solid ".concat(e.palette.divider):"none",background:"dark"===e.palette.mode?"none":"#F7F7F9",borderRadius:"12px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",mt:"24px",pt:"8px"}},children:[(0,w.jsx)(l.Z,{variant:"description",color:"text.primary",sx:{mx:"24px"},children:(0,w.jsx)(r.cC,{id:"Your transaction is through! Join our discord to get special roles."})}),(0,w.jsx)(d.Z,{variant:"outlined",size:"medium",href:"https://discord.gg/zerolend",target:"_blank",sx:{mt:"8px",mb:"12px"},children:(0,w.jsx)(l.Z,{variant:"buttonM",ml:"4px",children:"Join our Discord"})})]})]})]}),(0,w.jsxs)(u.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,w.jsxs)(f.Z,{variant:"helperText",href:B.explorerLinkBuilder({tx:t||D.txHash}),sx:{display:"inline-flex",alignItems:"center",justifyContent:"right",mt:6,mb:3},underline:"hover",target:"_blank",rel:"noreferrer noopener",children:[(0,w.jsx)(r.cC,{id:"Review tx details"}),(0,w.jsx)(x,{})]}),(0,w.jsx)(d.Z,{onClick:R,variant:"contained",size:"large",sx:{minHeight:"44px"},"data-cy":"closeButton",children:(0,w.jsx)(r.cC,{id:"Ok, Close"})})]})]})}},57824:function(e,t,n){"use strict";n.d(t,{m6:function(){return S},oD:function(){return C},aY:function(){return I},XJ:function(){return O},Bx:function(){return R},JV:function(){return D},aE:function(){return P},jz:function(){return B},Pu:function(){return M}});var r=n(59499),i=n(4730),o=n(49501),s=n(80227),a=n(81645),c=n(30120),u=n(29630),l=n(54181),d=n(91655),f=n(22841),p=n(67294),h=n(44749),m=n(92391),g=n(29946),y=n(41024),b=n(96875),v=n(17218),w=n(52526),x=n(68206),A=n(85893),E=["description","value","futureValue","numberPrefix","iconSymbol","usdValue","loading"];function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;tLearn more",components:{0:(0,v.jsx)(y.rU,{href:"https://eips.ethereum.org/EIPS/eip-2612",underline:"always"})}})}))},E=n(56365),_=n(68346),k=n(17674),T=n(64343),S=n(22659),C=n(73812),I=n(31538),O=n(61702),R=n(29894),D=n(32113),P=function(e){var t=e.currentMethod,n=e.setMethod,r=f.useState(null),i=(0,k.Z)(r,2),s=i[0],u=i[1],l=Boolean(s),p=function(){u(null)};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(c.Z,{onClick:function(e){u(e.currentTarget)},sx:{display:"flex",alignItems:"center",cursor:"pointer"},"data-cy":"approveButtonChange",children:[(0,v.jsx)(d.Z,{variant:"subheader2",color:"info.main",children:(0,v.jsx)(o.cC,{id:"{currentMethod}",values:{currentMethod:t}})}),(0,v.jsx)(a.Z,{sx:{fontSize:16,ml:1,color:"info.main"},children:(0,v.jsx)(S.Z,{})})]}),(0,v.jsxs)(C.Z,{anchorEl:s,open:l,onClose:p,MenuListProps:{"aria-labelledby":"basic-button"},keepMounted:!0,"data-cy":"approveMenu_".concat(t),children:[(0,v.jsxs)(I.Z,{"data-cy":"approveOption_".concat(D.n.PERMIT),selected:t===D.n.PERMIT,value:D.n.PERMIT,onClick:function(){t===D.n.APPROVE&&n(D.n.PERMIT),p()},children:[(0,v.jsx)(O.Z,{primaryTypographyProps:{variant:"subheader1"},children:(0,v.jsx)(o.cC,{id:"{0}",values:{0:D.n.PERMIT}})}),(0,v.jsx)(R.Z,{children:(0,v.jsx)(a.Z,{children:t===D.n.PERMIT&&(0,v.jsx)(T.Z,{})})})]}),(0,v.jsxs)(I.Z,{"data-cy":"approveOption_".concat(D.n.APPROVE),selected:t===D.n.APPROVE,value:D.n.APPROVE,onClick:function(){t===D.n.PERMIT&&n(D.n.APPROVE),p()},children:[(0,v.jsx)(O.Z,{primaryTypographyProps:{variant:"subheader1"},children:(0,v.jsx)(o.cC,{id:"{0}",values:{0:D.n.APPROVE}})}),(0,v.jsx)(R.Z,{children:(0,v.jsx)(a.Z,{children:t===D.n.APPROVE&&(0,v.jsx)(T.Z,{})})})]})]})]})},B=n(89291),M=n(46930),N=n(69311),F=function(){return(0,v.jsx)(a.Z,{sx:{ml:"2px",fontSize:"11px"},children:(0,v.jsx)(E.Z,{})})},L=function(e){var t=e.approvalHash,n=e.tryPermit,r=(0,N.Yh)(),i=r.walletApprovalMethodPreference,s=r.setWalletApprovalMethodPreference,a=n&&i,u=(0,M.f)().currentNetworkConfig,l=t===B.Z;return t||l||!n?t&&!a?(0,v.jsx)(c.Z,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",pb:1},children:t&&(0,v.jsxs)(_.Z,{variant:"helperText",href:u.explorerLinkBuilder({tx:t}),sx:{display:"inline-flex",alignItems:"center"},underline:"hover",target:"_blank",rel:"noreferrer noopener",children:[(0,v.jsx)(o.cC,{id:"Review approval tx details"}),(0,v.jsx)(F,{})]})}):(0,v.jsx)(v.Fragment,{}):(0,v.jsxs)(c.Z,{sx:{display:"inline-flex",alignItems:"center",mb:2},children:[(0,v.jsxs)(d.Z,{variant:"subheader2",color:"text.secondary",children:[(0,v.jsx)(o.cC,{id:"Approve with"}),"\xa0"]}),(0,v.jsx)(P,{currentMethod:i,setMethod:function(e){return s(e)}})]})},j=["actionInProgressText","actionText","amount","approvalTxState","handleApproval","handleAction","isWrongNetwork","mainTxState","preparingTransactions","requiresAmount","requiresApproval","sx","symbol","blocked","fetchingData","errorParams","tryPermit","event","isBalance","isPaymaster","paymasterData","feeTokenAddress","isStrategy"];function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;tDiscord",values:{0:t||""},components:{0:(0,a.jsx)(o.rU,{href:"https://discord.gg/zerolend",underline:"always"})}})})]})}},94671:function(e,t,n){"use strict";n.d(t,{NI:function(){return r},gK:function(){return s},pQ:function(){return a},Fi:function(){return c},iv:function(){return u},Vc:function(){return l},yI:function(){return d}});var r,i=n(70794),o=n(29946);!function(e){e[e.SUPPLY_CAP_REACHED=0]="SUPPLY_CAP_REACHED",e[e.HF_BELOW_ONE=1]="HF_BELOW_ONE",e[e.NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH=2]="NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH",e[e.ZERO_LTV_WITHDRAW_BLOCKED=3]="ZERO_LTV_WITHDRAW_BLOCKED"}(r||(r={}));var s=function(e,t){return"-1"!==e&&new i.O(e).minus(new i.O(t)).lt("1.05")},a=65e3,c=55e3,u=function(e){var t=e.approvedAmount,n=e.signedAmount,r=e.amount;return!("-1"===t||"0"!==t&&Number(t)>=Number(r)||Number(n)>=Number(r))},l=function(e){var t=[];return e.userReservesData.forEach((function(e){Number(e.scaledATokenBalance)>0&&"0"===e.reserve.baseLTVasCollateral&&e.usageAsCollateralEnabledOnUser&&"0"!==e.reserve.reserveLiquidationThreshold&&t.push(e.reserve.symbol)})),t},d=function(e,t,n,r){var i=e.reserve;if(!i.usageAsCollateralEnabled)return o.z.UNAVAILABLE;var s=o.z.ENABLED,a=e&&"0"!==e.scaledATokenBalance,c="0"!==t;return i.isIsolated?r?s=o.z.UNAVAILABLE:n?a?s=e.usageAsCollateralEnabledOnUser?o.z.ISOLATED_ENABLED:o.z.DISABLED:c&&(s=o.z.UNAVAILABLE_DUE_TO_ISOLATION):s=c?o.z.ISOLATED_DISABLED:o.z.ISOLATED_ENABLED:s=n?o.z.UNAVAILABLE_DUE_TO_ISOLATION:a?e.usageAsCollateralEnabledOnUser?o.z.ENABLED:o.z.DISABLED:o.z.ENABLED,s}},92381:function(e,t,n){"use strict";n.d(t,{e:function(){return r}});var r=function(e,t,n){e?(localStorage.setItem(n,"false"),t(!1)):(localStorage.setItem(n,"true"),t(!0))}},29946:function(e,t,n){"use strict";var r,i;n.d(t,{z:function(){return i}}),function(e){e.VOTING="0",e.PROPOSITION_POWER="1",e.BOTH="2"}(r||(r={})),function(e){e[e.ENABLED=0]="ENABLED",e[e.ISOLATED_ENABLED=1]="ISOLATED_ENABLED",e[e.DISABLED=2]="DISABLED",e[e.ISOLATED_DISABLED=3]="ISOLATED_DISABLED",e[e.UNAVAILABLE=4]="UNAVAILABLE",e[e.UNAVAILABLE_DUE_TO_ISOLATION=5]="UNAVAILABLE_DUE_TO_ISOLATION"}(i||(i={}))},89291:function(e,t,n){"use strict";n.d(t,{Z:function(){return _},Q:function(){return k}});var r=n(90116),i=n(59499),o=n(50029),s=n(17674),a=n(87794),c=n.n(a),u=n(75331),l=n(80854),d=n(20169),f=n(67294),p=n(19419),h=n(8195),m=n(77537),g=n(69311),y=n(32113),b=n(39771),v=n(31001);function w(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)){e.next=59;break}R(E(E({},O),{},{loading:!0})),e.prev=3,n=Math.floor(Date.now()/1e3+3600).toString(),r=[],i=w(t);try{for(i.s();!(s=i.n()).done;)(a=s.value).permitType&&"POOL"!=a.permitType?"SUPPLY_MIGRATOR_V3"===a.permitType?r.push(re(E(E({},a),{},{deadline:n}))):"BORROW_MIGRATOR_V3"===a.permitType&&r.push(ne(E(E({},a),{},{deadline:n,spender:oe.addresses.V3_MIGRATOR||""}))):r.push(ee({reserve:a.underlyingAsset,amount:a.amount,deadline:n}))}catch(x){i.e(x)}finally{i.f()}return e.prev=8,u=[],e.next=12,Promise.all(r);case 12:l=e.sent,d=w(l),e.prev=14,d.s();case 16:if((f=d.n()).done){e.next=25;break}return p=f.value,e.t0=u,e.next=21,j(p);case 21:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 23:e.next=16;break;case 25:e.next=30;break;case 27:e.prev=27,e.t2=e.catch(14),d.e(e.t2);case 30:return e.prev=30,d.f(),e.finish(30);case 33:if(me.current){e.next=35;break}return e.abrupt("return");case 35:$(u),X(n),R({txHash:_,loading:!1,success:!0}),F(void 0),e.next=48;break;case 41:if(e.prev=41,e.t3=e.catch(8),me.current){e.next=45;break}return e.abrupt("return");case 45:h=(0,b.WG)(e.t3,b.aD.APPROVAL,!1),F(h),R({txHash:void 0,loading:!1});case 48:e.next=57;break;case 50:if(e.prev=50,e.t4=e.catch(3),me.current){e.next=54;break}return e.abrupt("return");case 54:m=(0,b.WG)(e.t4,b.aD.GAS_ESTIMATION,!1),F(m),R({txHash:void 0,loading:!1});case 57:e.next=77;break;case 59:return e.prev=59,R(E(E({},O),{},{loading:!0})),e.next=63,Promise.all(ae.map((function(e){return e.tx()})));case 63:return g=e.sent,e.next=66,Promise.all(g.map((function(e){return new Promise(function(){var t=(0,o.Z)(c().mark((function t(n,r){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:delete e.gasPrice,ge({tx:function(){return U(e)},successCallback:function(e){n(e)},errorCallback:function(e,t){var n=(0,b.WG)(e,b.aD.APPROVAL,!1);F(n),R({txHash:t,loading:!1}),r()},approval:!0});case 2:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())})));case 66:y=e.sent,R({txHash:y[0].hash,loading:!1,success:!0}),e.next=77;break;case 70:if(e.prev=70,e.t5=e.catch(59),me.current){e.next=74;break}return e.abrupt("return");case 74:v=(0,b.WG)(e.t5,b.aD.GAS_ESTIMATION,!1),F(v),R({txHash:void 0,loading:!1});case 77:case"end":return e.stop()}}),e,null,[[3,50],[8,41],[14,27,30,33],[59,70]])})));return function(t){return e.apply(this,arguments)}}(),be=function(){var e=(0,o.Z)(c().mark((function e(){var t,r,i,o,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!pe||!n){e.next=21;break}if(q.length&&Y){e.next=3;break}throw new Error("signature needed");case 3:return e.prev=3,P(E(E({},D),{},{loading:!0})),e.next=7,n(q,Y);case 7:return t=e.sent,e.next=10,t[0].tx();case 10:return delete(r=e.sent).gasPrice,e.abrupt("return",ge({tx:function(){return U(r)},successCallback:function(e){P({txHash:e.hash,loading:!1,success:!0}),F(void 0)},errorCallback:function(e,t){var n=(0,b.WG)(e,b.aD.MAIN_ACTION);F(n),P({txHash:t,loading:!1})}}));case 15:e.prev=15,e.t0=e.catch(3),console.log(e.t0,"error"),i=(0,b.WG)(e.t0,b.aD.GAS_ESTIMATION,!1),F(i),P({txHash:void 0,loading:!1});case 21:if(pe&&ae||!le){e.next=37;break}return e.prev=22,P(E(E({},D),{},{loading:!0})),e.next=26,le.tx();case 26:return delete(o=e.sent).gasPrice,e.abrupt("return",ge({tx:function(){return U(o)},successCallback:function(e){P({txHash:e.hash,loading:!1,success:!0}),F(void 0)},errorCallback:function(e,t){var n=(0,b.WG)(e,b.aD.MAIN_ACTION);F(n),P({txHash:t,loading:!1})}}));case 31:e.prev=31,e.t1=e.catch(22),s=(0,b.WG)(e.t1,b.aD.GAS_ESTIMATION,!1),console.log(e.t1,s),F(s),P({txHash:void 0,loading:!1});case 37:case"end":return e.stop()}}),e,null,[[3,15],[22,31]])})));return function(){return e.apply(this,arguments)}}();return(0,f.useEffect)((function(){if(!A){N(!0);var e=setTimeout((function(){return N(!0),t().then(function(){var e=(0,o.Z)(c().mark((function e(t){var r,i,o,s,u,d,f,p,h;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(me.current){e.next=2;break}return e.abrupt("return");case 2:if(r=t.filter((function(e){return"ERC20_APPROVAL"==e.txType})),r.length>0&&ce(r),i=a&&te===y.n.PERMIT&&n&&x,!(r.length>0&&i)){e.next=14;break}he(!0),o=l.eB[x],B(o.limit||""),P({txHash:void 0}),F(void 0),N(!1),e.next=48;break;case 14:he(!1),r.length>0&&ce(r),de(t.find((function(e){return["DLP_ACTION","REWARD_ACTION","FAUCET_V2_MINT","FAUCET_MINT","STAKE_ACTION","GOV_DELEGATION_ACTION","GOVERNANCE_ACTION","V3_MIGRATION_ACTION"].includes(e.txType)}))),P({txHash:void 0}),F(void 0),s=0,e.prev=20,u=w(t),e.prev=22,u.s();case 24:if((d=u.n()).done){e.next=32;break}return f=d.value,e.next=28,f.gas();case 28:(p=e.sent)&&p.gasLimit&&(s+=Number(p.gasLimit));case 30:e.next=24;break;case 32:e.next=37;break;case 34:e.prev=34,e.t0=e.catch(22),u.e(e.t0);case 37:return e.prev=37,u.f(),e.finish(37);case 40:e.next=46;break;case 42:e.prev=42,e.t1=e.catch(20),h=(0,b.WG)(e.t1,b.aD.GAS_ESTIMATION,!1),F(h);case 46:B(s.toString()||""),N(!1);case 48:case"end":return e.stop()}}),e,null,[[20,42],[22,34,37,40]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){if(me.current){P({txHash:void 0});var t=(0,b.WG)(e,b.aD.GAS_ESTIMATION,!1);F(t),N(!1)}}))}),1e3);return function(){return clearTimeout(e)}}ce(void 0),de(void 0)}),[A].concat((0,r.Z)(S),[a,te])),{approval:ye,action:be,loadingTxns:M,setUsePermit:he,requiresApproval:!!ae||pe,approvalTxState:O,mainTxState:D,usePermit:pe}}},19419:function(e,t,n){"use strict";n.d(t,{R:function(){return a},n:function(){return c}});var r=n(67294),i=n(69311),o=n(85893),s=r.createContext({}),a=function(e){var t=e.children,n=(0,i.p4)(),r=(0,i.Qb)(),a=(0,i.DP)(),c=(0,i.IP)(),u=(0,i.Fp)(),l=(0,i.n7)(),d=(0,i.HL)();return(0,o.jsx)(s.Provider,{value:{refetchIncentiveData:r,refetchPoolData:n,refetchGhoData:a,refetchOracle:c,refetchRewardRates:u,refetchLPRewardRates:l,refetchIsClaimed:d},children:t})},c=function(){return(0,r.useContext)(s)}},34220:function(e,t,n){"use strict";n.d(t,{GM:function(){return _},cp:function(){return A},HT:function(){return k}});var r=n(59499),i=n(17674),o=n(1279),s=n(82403),a=n(20854),c=n(59148),u=n(75148);var l=n(70794),d=n(56371),f=n(67294),p=n(77537),h=n(69311),m=n(69125),g=n(83601),y=n(43478),b=n(46930),v=n(85893);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t0){var L=function({userGhoDiscountedInterest:e,user:t,marketReferenceCurrencyPriceUSD:n}){const r=Number(t.totalBorrowsUSD)-e,i=Number(t.availableBorrowsUSD)+e,o=Number(t.totalBorrowsMarketReferenceCurrency)-e/n,s=0===o?"-1":Number(t.totalCollateralMarketReferenceCurrency)*Number(t.currentLiquidationThreshold)/o;return Object.assign(Object.assign({},t),{totalBorrowsMarketReferenceCurrency:o.toString(),totalBorrowsUSD:r.toString(),netWorthUSD:(Number(t.netWorthUSD)+e).toString(),availableBorrowsUSD:i.toString(),availableBorrowsMarketReferenceCurrency:(i/n).toString(),healthFactor:s.toString()})}({userGhoDiscountedInterest:N.userDiscountedGhoInterest,user:F,marketReferenceCurrencyPriceUSD:Number((0,d.formatUnits)(k.marketReferenceCurrencyPriceInUsd,s.$3))});F=x(x({},F),L)}var j=F.userReservesData.reduce((function(e,t){var n=D.find((function(e){return e.underlyingAsset===t.reserve.underlyingAsset}));if(!n)throw new Error("no possible to calculate net apy");if("0"!==t.underlyingBalanceUSD&&(e.positiveProportion=e.positiveProportion.plus(new l.Z(n.supplyAPY).multipliedBy(t.underlyingBalanceUSD)),n.aIncentivesData&&n.aIncentivesData.forEach((function(n){e.positiveProportion=e.positiveProportion.plus(new l.Z(n.incentiveAPR).multipliedBy(t.underlyingBalanceUSD))}))),"0"!==t.variableBorrowsUSD)if(B({symbol:n.symbol,currentMarket:f})){var r=(0,m.li)(M.ghoVariableBorrowAPY,N.userGhoBorrowBalance,N.userGhoAvailableToBorrowAtDiscount,M.ghoBorrowAPYWithMaxDiscount);e.negativeProportion=e.negativeProportion.plus(new l.Z(r).multipliedBy(N.userGhoBorrowBalance)),n.vIncentivesData&&n.vIncentivesData.forEach((function(t){e.positiveProportion=e.positiveProportion.plus(new l.Z(t.incentiveAPR).multipliedBy(N.userGhoBorrowBalance))}))}else e.negativeProportion=e.negativeProportion.plus(new l.Z(n.variableBorrowAPY).multipliedBy(t.variableBorrowsUSD)),n.vIncentivesData&&n.vIncentivesData.forEach((function(n){e.positiveProportion=e.positiveProportion.plus(new l.Z(n.incentiveAPR).multipliedBy(t.variableBorrowsUSD))}));return"0"!==t.stableBorrowsUSD&&(e.negativeProportion=e.negativeProportion.plus(new l.Z(t.stableBorrowAPY).multipliedBy(t.stableBorrowsUSD)),n.sIncentivesData&&n.sIncentivesData.forEach((function(n){e.positiveProportion=e.positiveProportion.plus(new l.Z(n.incentiveAPR).multipliedBy(t.stableBorrowsUSD))}))),e}),{positiveProportion:new l.Z(0),negativeProportion:new l.Z(0)}),U=F.userReservesData.some((function(e){return"0"!==e.scaledATokenBalance})),Z=j.positiveProportion.dividedBy(F.totalLiquidityUSD).toNumber(),H=j.negativeProportion.dividedBy(F.totalBorrowsUSD).toNumber(),z=(Z||0)*(Number(F.totalLiquidityUSD)/Number("0"!==F.netWorthUSD?F.netWorthUSD:"1"))-(H||0)*(Number(F.totalBorrowsUSD)/Number("0"!==F.netWorthUSD?F.netWorthUSD:"1"));return(0,v.jsx)(E.Provider,{value:{loading:!_.length||!!r&&!T.length,reserves:D,eModes:C,user:x(x({},F),{},{totalBorrowsUSD:F.totalBorrowsUSD,totalBorrowsMarketReferenceCurrency:F.totalBorrowsMarketReferenceCurrency,userEmodeCategoryId:S,isInEmode:0!==S,userReservesData:F.userReservesData.sort((function(e,t){return(0,g.uk)(e.reserve,t.reserve)})),earnedAPY:Z,debtAPY:H,netAPY:z}),userReserves:T,isUserHasDeposits:U,marketReferencePriceInUsd:k.marketReferenceCurrencyPriceInUsd,marketReferenceCurrencyDecimals:k.marketReferenceCurrencyDecimals,ghoReserveData:x(x({},M),{},{aaveFacilitatorRemainingCapacity:Math.max(M.aaveFacilitatorRemainingCapacity-1e-6,0)}),ghoUserData:N,ghoLoadingData:!R},children:t})},k=function(){return(0,f.useContext)(E)}},82482:function(e,t,n){"use strict";n.d(t,{P:function(){return m}});var r=n(17674),i=n(80854),o=n(1279),s=n(81206),a=n(82403),c=n(70794),u=n(69311),l=n(83601),d=n(36492),f=n(31001),p=n(30449),h=n(46930),m=function(){var e=(0,h.f)().currentNetworkConfig,t=function(){var e=(0,p.z)().poolTokensBalanceService,t=(0,u.Yh)((function(e){return e.currentMarketData})),n=(0,u.Yh)((function(e){return e.account})),r=t.addresses.LENDING_POOL_ADDRESS_PROVIDER,i=t.addresses.LENDING_POOL;return(0,d.a)({queryFn:function(){return e.getPoolTokensBalances({user:n,lendingPoolAddressProvider:r})},queryKey:[f.iP.POOL_TOKENS,n,r,i,e.toHash()],enabled:!!n,refetchInterval:f.g_})}(),n=t.data,m=t.isLoading,g=(0,u.Yh)((function(e){return[(0,l.Rp)(e),(0,l.Fb)(e)]})),y=(0,r.Z)(g,2),b=y[0],v=y[1],w=!0;return{walletBalances:(null!==n&&void 0!==n?n:[]).reduce((function(t,n){var r=b.find((function(t){var r;return n.address===i.hP.toLowerCase()?t.symbol.toLowerCase()===(null===(r=e.wrappedBaseAssetSymbol)||void 0===r?void 0:r.toLowerCase()):t.underlyingAsset.toLowerCase()===n.address}));return"0"!==n.amount&&(w=!1),r&&(t[n.address]={amount:(0,o.Fv)(n.amount,r.decimals),amountUSD:(0,s.Z)({amount:new c.O(n.amount),currencyDecimals:r.decimals,priceInMarketReferenceCurrency:r.priceInMarketReferenceCurrency,marketReferenceCurrencyDecimals:v.marketReferenceCurrencyDecimals,normalizedMarketReferencePriceInUsd:(0,o.Fv)(v.marketReferenceCurrencyPriceInUsd,a.$3)})}),t}),{}),hasEmptyWallet:w,loading:m||!b.length}}},61038:function(e,t,n){"use strict";var r=n(50029),i=n(59499),o=n(87794),s=n.n(o),a=n(67294),c=n(77537),u=n(21036),l=n(82828);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;tLearn more",components:{0:(0,d.jsx)(w.rU,{href:"https://discord.gg/zerolend",underline:"always"})}})," "]})}))}):null},k=n(19952),T=["borrowCap","icon"];function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t was not given a valid reserve asset to parse"),null;var r=function(e){var t=W(e),n=t.supplyCapUsage,r=t.supplyCapReached,o=q(e),s=o.borrowCapUsage,a=o.borrowCapReached,c=$(e);return{reserve:e,supplyCap:{percentUsed:n,isMaxed:r,determineWarningDisplay:function(e){var t=e.supplyCap,n=e.icon,r=(0,i.Z)(e,L);return t?(0,d.jsx)(F,H({supplyCap:t,icon:n},r)):null},displayMaxedTooltip:function(e){var t=e.supplyCap;return t?(0,d.jsx)(_,{supplyCap:t}):null}},borrowCap:{percentUsed:s,isMaxed:a,determineWarningDisplay:function(e){var t=e.borrowCap,n=e.icon,r=(0,i.Z)(e,j);return t?(0,d.jsx)(I,H({borrowCap:t,icon:n},r)):null},displayMaxedTooltip:function(e){var t=e.borrowCap;return t?(0,d.jsx)(m,{borrowCap:t}):null}},debtCeiling:{percentUsed:c.debtCeilingUsage,isMaxed:c.debtCeilingReached,determineWarningDisplay:function(e){var t=e.debtCeiling,n=e.icon,r=(0,i.Z)(e,U);return t?(0,d.jsx)(P,H({debtCeiling:t,icon:n},r)):null},displayMaxedTooltip:function(e){var t=e.debtCeiling;return t?(0,d.jsx)(v,{debtCeiling:t}):null}}}}(n);return(0,d.jsx)(z.Provider,{value:r,children:t})},V=function(){var e=(0,s.useContext)(z);if(void 0===e)throw new Error("useAssetCaps() can only be used inside of , please declare it at a higher level.");return e},W=function(e){var t=e?100*(0,o.hE)(e.totalLiquidity).dividedBy(e.supplyCap).toNumber():0;return{supplyCapUsage:t=t===1/0?0:t,supplyCapReached:t>=99.99}},q=function(e){var t=e?100*(0,o.hE)(e.totalDebt).dividedBy(e.borrowCap).toNumber():0;return{borrowCapUsage:t=t===1/0?0:t,borrowCapReached:t>=99.99}},$=function(e){var t=e?100*(0,o.hE)(e.isolationModeTotalDebt).dividedBy(e.debtCeiling).toNumber():0;return{debtCeilingUsage:t=t===1/0?0:t,debtCeilingReached:t>=99.99}}},43478:function(e,t,n){"use strict";n.d(t,{p:function(){return s}});var r=n(27484),i=n.n(r),o=n(67294);function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15,t=(0,o.useState)(0),n=t[0],r=t[1],s=(0,o.useState)(0),a=s[0],c=s[1];return(0,o.useEffect)((function(){var t=setInterval((function(){return c(i()().unix()+n)}),1e3*e);return function(){return clearInterval(t)}}),[e,n]),(0,o.useEffect)((function(){var e=Number(localStorage.getItem("forkTimeAhead")||0);r(e),c(i()().unix()+e)}),[]),a}},48618:function(e,t,n){"use strict";n.d(t,{i:function(){return d}});var r=n(50029),i=n(17674),o=n(87794),s=n.n(o),a=n(80854),c=n(1279),u=n(67294),l=n(69311);function d(e,t){var n=(0,u.useState)(0),o=n[0],d=n[1],f=(0,l.Yh)((function(e){return[e.LPrewardRate,e.LPtotalSupply]})),p=(0,i.Z)(f,2),h=p[0],m=p[1],g=(0,a.gU)("1",18),y=(0,u.useCallback)((0,r.Z)(s().mark((function n(){var r,i,o,u;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("0"!==h.toString()&&"0"!==m.toString()){n.next=2;break}return n.abrupt("return",d(0));case 2:if("0"!==(null===e||void 0===e?void 0:e.toString())&&"0"!==(null===t||void 0===t?void 0:t.toString())){n.next=4;break}return n.abrupt("return",d(0));case 4:if("0"!==(null===e||void 0===e?void 0:e.toString())&&"0"!==(null===t||void 0===t?void 0:t.toString())){n.next=6;break}return n.abrupt("return",d(0));case 6:r=e&&t?(0,c.hE)(e).multipliedBy(g).dividedBy(t):(0,a.gU)("1",18),i=(0,c.hE)(h.toString()).multipliedBy(31536e3).multipliedBy(6753941),o=i.multipliedBy(1e3).div(m.toString()),u=o.multipliedBy(r).div(g).toNumber()/1e3,d(u);case 11:case"end":return n.stop()}}),n)}))),[e,m,h]);return(0,u.useEffect)((function(){y().catch((function(e){console.error("Failed to fetch Apr Values: ".concat(e.stack))}))}),[y]),o}},47850:function(e,t,n){"use strict";n.d(t,{A:function(){return d}});var r=n(50029),i=n(17674),o=n(87794),s=n.n(o),a=n(80854),c=n(91747),u=n(67294),l=n(69311);function d(e,t){var n=(0,u.useState)(0),o=n[0],d=n[1],f=(0,l.Yh)((function(e){return[e.rewardRate,e.totalSupply]})),p=(0,i.Z)(f,2),h=p[0],m=p[1],g=(0,a.gU)("1",18),y=(0,u.useCallback)((0,r.Z)(s().mark((function n(){var r,i,o,u;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("0"!==h.toString()&&"0"!==m.toString()){n.next=2;break}return n.abrupt("return",d(0));case 2:if("0"!==(null===e||void 0===e?void 0:e.toString())&&"0"!==(null===t||void 0===t?void 0:t.toString())){n.next=4;break}return n.abrupt("return",d(0));case 4:if("0"!==(null===e||void 0===e?void 0:e.toString())&&"0"!==(null===t||void 0===t?void 0:t.toString())){n.next=6;break}return n.abrupt("return",d(0));case 6:r=e&&t?c.O$.from(e).mul(g).div(t):(0,a.gU)("1",18),i=h.mul(31536e3),o=i.mul(1e3).div(m),u=o.mul(r).div(g).toNumber()/1e3,d(u);case 11:case"end":return n.stop()}}),n)}))),[e,m,h]);return(0,u.useEffect)((function(){y().catch((function(e){console.error("Failed to fetch Apr Values: ".concat(e.stack))}))}),[y]),o}},66209:function(e,t,n){"use strict";n.d(t,{Q:function(){return o}});var r=n(77537),i=n(46930);function o(e){var t=(0,i.f)().currentChainId,n=e||t;return{isWrongNetwork:(0,r.Z)().chainId!==n,requiredChainId:n}}},8195:function(e,t,n){"use strict";n.d(t,{w8:function(){return r},ny:function(){return l},vR:function(){return d}});var r,i=n(67294),o=n(77537),s=n(69311),a=n(57609),c=n(85893);!function(e){e[e.Supply=0]="Supply",e[e.Withdraw=1]="Withdraw",e[e.Borrow=2]="Borrow",e[e.Repay=3]="Repay",e[e.CollateralChange=4]="CollateralChange",e[e.RateSwitch=5]="RateSwitch",e[e.Stake=6]="Stake",e[e.Unstake=7]="Unstake",e[e.StakeCooldown=8]="StakeCooldown",e[e.StakeRewardClaim=9]="StakeRewardClaim",e[e.ClaimRewards=10]="ClaimRewards",e[e.ClaimZEROLpIncentives=11]="ClaimZEROLpIncentives",e[e.ClaimZEROLockerIncentives=12]="ClaimZEROLockerIncentives",e[e.ClaimZEROLpLockerETHIncentives=13]="ClaimZEROLpLockerETHIncentives",e[e.ClaimLPLockerIncentives=14]="ClaimLPLockerIncentives",e[e.ClaimZEROVestsRewards=15]="ClaimZEROVestsRewards",e[e.Emode=16]="Emode",e[e.Faucet=17]="Faucet",e[e.Swap=18]="Swap",e[e.DebtSwitch=19]="DebtSwitch",e[e.GovDelegation=20]="GovDelegation",e[e.GovVote=21]="GovVote",e[e.V3Migration=22]="V3Migration",e[e.RevokeGovDelegation=23]="RevokeGovDelegation",e[e.StakeRewardsClaimRestake=24]="StakeRewardsClaimRestake",e[e.Switch=25]="Switch",e[e.Bridge=26]="Bridge",e[e.StakeZERO=27]="StakeZERO",e[e.ExitEarly=28]="ExitEarly",e[e.WithdrawVestZERO=29]="WithdrawVestZERO",e[e.StakeVest=30]="StakeVest",e[e.TransferVest=31]="TransferVest",e[e.ClaimVestedTokens=32]="ClaimVestedTokens",e[e.ConvertEZero=33]="ConvertEZero",e[e.ConvertGravity=34]="ConvertGravity",e[e.StakeEZero=35]="StakeEZero",e[e.LockZero=36]="LockZero",e[e.NewLockZero=37]="NewLockZero",e[e.LockLP=38]="LockLP",e[e.WithdrawLockZero=39]="WithdrawLockZero",e[e.UnstakeZero=40]="UnstakeZero",e[e.LinkReferralCode=41]="LinkReferralCode",e[e.LockedDLP=42]="LockedDLP"}(r||(r={}));var u=(0,i.createContext)({}),l=function(e){var t=e.children,n=(0,o.Z)().setSwitchNetworkError,l=(0,i.useState)(),d=l[0],f=l[1],p=(0,i.useState)({}),h=p[0],m=p[1],g=(0,i.useState)({}),y=g[0],b=g[1],v=(0,i.useState)({}),w=v[0],x=v[1],A=(0,i.useState)(""),E=A[0],_=A[1],k=(0,i.useState)(!1),T=k[0],S=k[1],C=(0,i.useState)(),I=C[0],O=C[1],R=(0,s.Yh)((function(e){return e.trackEvent}));return(0,c.jsx)(u.Provider,{value:{openSupply:function(e,t,n,i,o){f(r.Supply),m({underlyingAsset:e}),R(a.vh.OPEN_MODAL,{modal:"Supply",market:t,assetName:n,asset:e,funnel:i})},openWithdraw:function(e,t,n,i){f(r.Withdraw),m({underlyingAsset:e}),R(a.vh.OPEN_MODAL,{modal:"Withdraw",market:t,assetName:n,asset:e,funnel:i})},openBorrow:function(e,t,n,i,o){f(r.Borrow),m({underlyingAsset:e}),R(a.vh.OPEN_MODAL,{modal:"Borrow",market:t,assetName:n,asset:e,funnel:i})},openRepay:function(e,t,n,i,o,s){f(r.Repay),m({underlyingAsset:e,currentRateMode:t,isFrozen:n}),R(a.vh.OPEN_MODAL,{modal:"Repay",asset:e,assetName:o,market:i,funnel:s})},openCollateralChange:function(e,t,n,i,o){f(r.CollateralChange),m({underlyingAsset:e}),R(a.vh.OPEN_MODAL,{modal:"Toggle Collateral",market:t,assetName:n,asset:e,usageAsCollateralEnabledOnUser:o,funnel:i})},openRateSwitch:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Rate Switch"}),f(r.RateSwitch),m({underlyingAsset:e,currentRateMode:t})},openStake:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Stake",assetName:e}),f(r.Stake),m({stakeAssetName:e,icon:t})},openUnstake:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Untake",assetName:e}),f(r.Unstake),m({stakeAssetName:e,icon:t})},openStakeCooldown:function(e){R(a.vh.OPEN_MODAL,{modal:"Cooldown",assetName:e}),f(r.StakeCooldown),m({stakeAssetName:e})},openStakeRewardsClaim:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Stake Rewards",assetName:e}),f(r.StakeRewardClaim),m({stakeAssetName:e,icon:t})},openStakeRewardsRestakeClaim:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Restatke Stake Rewards",assetName:e}),f(r.StakeRewardsClaimRestake),m({stakeAssetName:e,icon:t})},openClaimRewards:function(){R(a.vh.OPEN_MODAL,{modal:"Claim"}),f(r.ClaimRewards)},openZEROLpIncentivesRewards:function(){R(a.vh.OPEN_MODAL,{modal:"ClaimZEROLpIncentives"}),f(r.ClaimZEROLpIncentives)},openZEROLPETHLockerIncentives:function(e){R(a.vh.OPEN_MODAL,{modal:"ClaimZEROLpLockerETHIncentives"}),f(r.ClaimZEROLpLockerETHIncentives),m({amount:e})},openZEROLockerIncentives:function(e){R(a.vh.OPEN_MODAL,{modal:"ClaimZEROLockerIncentives"}),f(r.ClaimZEROLockerIncentives),m({amount:e})},openLPLockerIncentives:function(e){R(a.vh.OPEN_MODAL,{modal:"ClaimLPLockerIncentives"}),f(r.ClaimLPLockerIncentives),m({amount:e})},openZEROVestsRewards:function(e,t){R(a.vh.OPEN_MODAL,{modal:"ClaimZEROVestsRewards"}),f(r.ClaimZEROVestsRewards),m({vests:e,vestLoading:t})},openEmode:function(e){R(a.vh.OPEN_MODAL,{modal:"eMode"}),f(r.Emode),m({emode:e})},openFaucet:function(e){R(a.vh.OPEN_MODAL,{modal:"Faucet"}),f(r.Faucet),m({underlyingAsset:e})},openSwap:function(e){R(a.vh.OPEN_MODAL,{modal:"Swap"}),f(r.Swap),m({underlyingAsset:e})},openDebtSwitch:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Debt Switch"}),f(r.DebtSwitch),m({underlyingAsset:e,currentRateMode:t})},openGovDelegation:function(){R(a.vh.OPEN_MODAL,{modal:"Governance Delegation"}),f(r.GovDelegation)},openRevokeGovDelegation:function(){R(a.vh.OPEN_MODAL,{modal:"Revoke Governance Delegation"}),f(r.RevokeGovDelegation)},openGovVote:function(e,t,n){R(a.vh.OPEN_MODAL,{modal:"Vote",proposalId:e,voteSide:t}),f(r.GovVote),m({proposalId:e,support:t,power:n})},openV3Migration:function(){R(a.vh.OPEN_MODAL,{modal:"V2->V3 Migration"}),f(r.V3Migration)},openSwitch:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Switch"}),f(r.Switch),m({underlyingAsset:e,chainId:t})},openBridge:function(e,t){R(a.vh.OPEN_MODAL,{modal:"Bridge"}),f(r.Bridge),m({underlyingAsset:e,chainId:t})},openExitEarly:function(e){R(a.vh.OPEN_MODAL,{modal:"Exit Early"}),f(r.ExitEarly),m({vest:e})},openWithdrawVestZero:function(e){R(a.vh.OPEN_MODAL,{modal:"Withdraw vest zero"}),f(r.WithdrawVestZERO),m({underlyingAsset:e})},openStakeVestModal:function(e){f(r.StakeVest),m({vest:e})},openTransferVestModal:function(e){f(r.TransferVest),m({vestId:e})},openClaimVestedTokensModal:function(e,t){f(r.ClaimVestedTokens),m({vestId:e,amount:t})},openStakeEZeroModal:function(){f(r.StakeEZero)},openConvertEZeroModal:function(e,t){f(r.ConvertEZero),m({merkleData:e,isClaimed:t})},openConvertGravityModal:function(e){f(r.ConvertGravity),m({gravityMerkleData:e})},openLockZeroModal:function(e,t,n){R(a.vh.OPEN_MODAL,{modal:"Lock Zero"}),f(r.LockZero),m({amount:e,duration:t,stakeNFT:n})},openNewLockZeroModal:function(){R(a.vh.OPEN_MODAL,{modal:"Lock Zero"}),f(r.NewLockZero)},openLockLPModal:function(){R(a.vh.OPEN_MODAL,{modal:"Lock LP"}),f(r.LockLP)},openStakeZero:function(e){R(a.vh.OPEN_MODAL,{modal:"Stake Zero"}),f(r.StakeZERO),m({nftId:e})},openWithdrawLockZeroModal:function(e,t,n){R(a.vh.OPEN_MODAL,{modal:"Withdraw Zero"}),f(r.WithdrawLockZero),m({icon:e,nftId:t,amount:n})},openUnstakeZero:function(e){R(a.vh.OPEN_MODAL,{modal:"Unstake Zero"}),f(r.UnstakeZero),m({nftId:e})},openLinkReferralModal:function(e){f(r.LinkReferralCode),m({referrerCode:e})},openLockedDLP:function(){R(a.vh.OPEN_MODAL,{modal:"Locked DLP"}),f(r.LockedDLP)},close:function(){f(void 0),m({}),x({}),b({}),_(""),O(void 0),n(void 0)},type:d,args:h,approvalTxState:y,mainTxState:w,setApprovalTxState:b,setMainTxState:x,gasLimit:E,setGasLimit:_,loadingTxns:T,setLoadingTxns:S,txError:I,setTxError:O},children:t})},d=function(){var e=(0,i.useContext)(u);if(void 0===e)throw new Error("useModalContext must be used within a ModalProvider");return e}},90452:function(e,t,n){"use strict";n.d(t,{W:function(){return v},T:function(){return w}});var r=n(50029),i=n(87794),o=n.n(i),s=n(56371),a=n(58342);class c extends a.lV{constructor(e){super(u,l,e)}static connect(e,t){return new a.CH(e,u,t)}}const u=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"bool",name:"set",type:"bool"}],name:"PermissionsAdminSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"role",type:"uint256"},{indexed:!0,internalType:"address",name:"whiteLister",type:"address"},{indexed:!1,internalType:"bool",name:"set",type:"bool"}],name:"RoleSet",type:"event"},{inputs:[{internalType:"address[]",name:"admins",type:"address[]"}],name:"addPermissionAdmins",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"roles",type:"uint256[]"},{internalType:"address[]",name:"users",type:"address[]"}],name:"addPermissions",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserPermissionAdmin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserPermissions",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256[]",name:"roles",type:"uint256[]"}],name:"isInAllRoles",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256[]",name:"roles",type:"uint256[]"}],name:"isInAnyRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"role",type:"uint256"}],name:"isInRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"isPermissionsAdmin",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"isUserPermissionAdminValid",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"admins",type:"address[]"}],name:"removePermissionAdmins",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"roles",type:"uint256[]"},{internalType:"address[]",name:"users",type:"address[]"}],name:"removePermissions",outputs:[],stateMutability:"nonpayable",type:"function"}],l="0x608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b6111488061007d6000396000f3fe608060405234801561001057600080fd5b50600436106100d55760003560e01c80638857a624116100875780638857a624146102fd5780638cadc3341461036b5780638da5cb5b14610429578063be5de6af14610431578063c9c8836014610457578063ca553a7a1461047d578063ea6c64fb146104eb578063f2fde38b146105a9576100d5565b80631cea0e8c146100da57806325fde6631461011c5780633e734f551461019d578063643148251461022f5780636d38f7841461025b578063715018a6146102d957806377133d81146102e3575b600080fd5b610100600480360360208110156100f057600080fd5b50356001600160a01b03166105cf565b604080516001600160a01b039092168252519081900360200190f35b6101426004803603602081101561013257600080fd5b50356001600160a01b03166105f1565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b83811015610188578181015183820152602001610170565b50505050905001935050505060405180910390f35b61021b600480360360408110156101b357600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156101dd57600080fd5b8201836020820111156101ef57600080fd5b803590602001918460208302840111600160201b8311171561021057600080fd5b509092509050610680565b604080519115158252519081900360200190f35b61021b6004803603604081101561024557600080fd5b506001600160a01b0381351690602001356106f4565b61021b6004803603604081101561027157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561029b57600080fd5b8201836020820111156102ad57600080fd5b803590602001918460208302840111600160201b831117156102ce57600080fd5b50909250905061071b565b6102e161078d565b005b6102eb61082f565b60408051918252519081900360200190f35b6102e16004803603602081101561031357600080fd5b810190602081018135600160201b81111561032d57600080fd5b82018360208201111561033f57600080fd5b803590602001918460208302840111600160201b8311171561036057600080fd5b509092509050610835565b6102e16004803603604081101561038157600080fd5b810190602081018135600160201b81111561039b57600080fd5b8201836020820111156103ad57600080fd5b803590602001918460208302840111600160201b831117156103ce57600080fd5b919390929091602081019035600160201b8111156103eb57600080fd5b8201836020820111156103fd57600080fd5b803590602001918460208302840111600160201b8311171561041e57600080fd5b50909250905061094a565b610100610be0565b61021b6004803603602081101561044757600080fd5b50356001600160a01b0316610bef565b61021b6004803603602081101561046d57600080fd5b50356001600160a01b0316610c0c565b6102e16004803603602081101561049357600080fd5b810190602081018135600160201b8111156104ad57600080fd5b8201836020820111156104bf57600080fd5b803590602001918460208302840111600160201b831117156104e057600080fd5b509092509050610c3d565b6102e16004803603604081101561050157600080fd5b810190602081018135600160201b81111561051b57600080fd5b82018360208201111561052d57600080fd5b803590602001918460208302840111600160201b8311171561054e57600080fd5b919390929091602081019035600160201b81111561056b57600080fd5b82018360208201111561057d57600080fd5b803590602001918460208302840111600160201b8311171561059e57600080fd5b509092509050610d4d565b6102e1600480360360208110156105bf57600080fd5b50356001600160a01b0316610fd0565b6001600160a01b03908116600090815260016020819052604090912001541690565b604080516101008082526120208201909252606091600091839160208201612000803683375050506001600160a01b03851660009081526001602052604081205491925090815b61010081101561067457600182821c161561066c578084848151811061065a57fe5b60209081029190910101526001909201915b600101610638565b50919350915050915091565b6000805b828110156106e75783838281811061069857fe5b9050602002013560016000876001600160a01b03166001600160a01b0316815260200190815260200160002060000154901c600116600014156106df5760009150506106ed565b600101610684565b50600190505b9392505050565b6001600160a01b038216600090815260016020819052604090912054821c16151592915050565b6000805b8281101561078257600084848381811061073557fe5b9050602002013560016000886001600160a01b03166001600160a01b0316815260200190815260200160002060000154901c600116111561077a5760019150506106ed565b60010161071f565b506000949350505050565b6107956110c8565b6000546001600160a01b039081169116146107e5576040805162461bcd60e51b815260206004820181905260248201526000805160206110f3833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b61010081565b61083d6110c8565b6000546001600160a01b0390811691161461088d576040805162461bcd60e51b815260206004820181905260248201526000805160206110f3833981519152604482015290519081900360640190fd5b60005b81811015610945576001600260008585858181106108aa57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055508282828181106108ea57fe5b905060200201356001600160a01b03166001600160a01b03167fce25e05cb98afcaf8f38f5668e4b0edc9248a8e1993151d180aa2f1823f4c79c600160405180821515815260200191505060405180910390a2600101610890565b505050565b336000818152600260205260409020546109ab576040805162461bcd60e51b815260206004820152601c60248201527f43414c4c45525f4e4f545f5045524d495353494f4e535f41444d494e00000000604482015290519081900360640190fd5b8382146109fc576040805162461bcd60e51b815260206004820152601a6024820152790929c869e9ca692a6a88a9ca8be82a4a482b2a6be988a9c8ea8960331b604482015290519081900360640190fd5b60005b82811015610bd8576000868683818110610a1557fe5b9050602002013590506000858584818110610a2c57fe5b905060200201356001600160a01b031690506101008210610a83576040805162461bcd60e51b815260206004820152600c60248201526b494e56414c49445f524f4c4560a01b604482015290519081900360640190fd5b6001600160a01b03808216600090815260016020819052604090912080549101549091168115801590610abe57506001600160a01b03811633145b80610ae557506001600160a01b038381166000908152600160208190526040909120015416155b610b30576040805162461bcd60e51b815260206004820152601760248201527624a72b20a624a22fa822a926a4a9a9a4a7a720a226a4a760491b604482015290519081900360640190fd5b6001600160a01b038316600090815260016020819052604090912090851b19831690819055610b84576001600160a01b03831660009081526001602081905260409091200180546001600160a01b03191690555b60408051600081529051339186916001600160a01b038716917fcd20d6b081e97182a607d072021b5e830136ec08ba1b05aeb25859a6a6649c94919081900360200190a45050600190920191506109ff9050565b505050505050565b6000546001600160a01b031690565b6001600160a01b0316600090815260026020526040902054151590565b6001600160a01b03908116600090815260016020818152604080842090920154909316825260029092522054151590565b610c456110c8565b6000546001600160a01b03908116911614610c95576040805162461bcd60e51b815260206004820181905260248201526000805160206110f3833981519152604482015290519081900360640190fd5b60005b8181101561094557600060026000858585818110610cb257fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002081905550828282818110610cf257fe5b905060200201356001600160a01b03166001600160a01b03167fce25e05cb98afcaf8f38f5668e4b0edc9248a8e1993151d180aa2f1823f4c79c600060405180821515815260200191505060405180910390a2600101610c98565b33600081815260026020526040902054610dae576040805162461bcd60e51b815260206004820152601c60248201527f43414c4c45525f4e4f545f5045524d495353494f4e535f41444d494e00000000604482015290519081900360640190fd5b838214610dff576040805162461bcd60e51b815260206004820152601a6024820152790929c869e9ca692a6a88a9ca8be82a4a482b2a6be988a9c8ea8960331b604482015290519081900360640190fd5b60005b82811015610bd8576000868683818110610e1857fe5b9050602002013590506000858584818110610e2f57fe5b905060200201356001600160a01b031690506101008210610e86576040805162461bcd60e51b815260206004820152600c60248201526b494e56414c49445f524f4c4560a01b604482015290519081900360640190fd5b6001600160a01b03808216600090815260016020819052604090912080549101549091168115801590610ec157506001600160a01b03811633145b80610ee857506001600160a01b038381166000908152600160208190526040909120015416155b610f33576040805162461bcd60e51b815260206004820152601760248201527624a72b20a624a22fa822a926a4a9a9a4a7a720a226a4a760491b604482015290519081900360640190fd5b81610f65576001600160a01b03831660009081526001602081905260409091200180546001600160a01b031916331790555b6001600160a01b03831660008181526001602081815260409283902082891b87179055825191825291513393889390927fcd20d6b081e97182a607d072021b5e830136ec08ba1b05aeb25859a6a6649c94929081900390910190a4505060019092019150610e029050565b610fd86110c8565b6000546001600160a01b03908116911614611028576040805162461bcd60e51b815260206004820181905260248201526000805160206110f3833981519152604482015290519081900360640190fd5b6001600160a01b03811661106d5760405162461bcd60e51b81526004018080602001828103825260268152602001806110cd6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220aee55fd2ffe4c1ae4ebcf66d0cd51779458160aebfc82117874fa1cd3a9ae4b664736f6c634300060c0033";var d=n(23286);class f{constructor(e){if(!(0,s.isAddress)(e.permissionManagerAddress))throw new Error("contract address is not valid");this._contract=c.connect(e.permissionManagerAddress,e.provider)}async getUserPermissions(e){if(!(0,s.isAddress)(e))throw new Error("User address is not a valid ethereum address");return this._contract.getUserPermissions(e)}async getHumanizedUserPermissions(e){const{0:t,1:n}=await this.getUserPermissions(e),r=[];return t.forEach(((e,t)=>{if(t4)throw new Error("Error parsing permission");r[t]=d.Z[n]}})),r}}var p=n(67294),h=n(77537),m=n(63206),g=n(46930),y=n(85893),b=p.createContext({permissions:[],isPermissionsLoading:!1}),v=function(e){var t=e.children,n=(0,g.f)(),i=n.currentChainId,s=n.currentMarketData,a=(0,h.Z)().currentAccount,c=(0,p.useState)(!0),u=c[0],l=c[1],d=(0,p.useState)([]),v=d[0],w=d[1];function x(){return(x=(0,r.Z)(o().mark((function e(t){var n,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=new f({provider:(0,m.VH)(i),permissionManagerAddress:t}),e.next=4,n.getHumanizedUserPermissions(a);case 4:r=e.sent,l(!0),w(r),e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(0),new Error("there was an error fetching your permissions");case 12:l(!1);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}return(0,p.useEffect)((function(){m.cr.permissions(s)&&a&&s.addresses.PERMISSION_MANAGER?function(e){x.apply(this,arguments)}(s.addresses.PERMISSION_MANAGER):l(!1)}),[a,s.addresses.PERMISSION_MANAGER]),(0,y.jsx)(b.Provider,{value:{permissions:v,isPermissionsLoading:u},children:t})},w=function(){return(0,p.useContext)(b)}},40481:function(e,t,n){"use strict";n.d(t,{W:function(){return o}});var r=n(90116),i=n(67294),o=function(e,t,n,o){var s=(0,i.useState)(0),a=s[0],c=s[1],u=(0,i.useRef)(e);(0,i.useEffect)((function(){u.current=e}),[e]),(0,i.useEffect)((function(){n||e()}),(0,r.Z)(o)),(0,i.useEffect)((function(){var e;return n||(e=window.setTimeout((function(){var e=u.current();e instanceof Promise?e.then((function(){c(a+1)})):(e(),c(a+1))}),t)),function(){return clearTimeout(e)}}),[a].concat((0,r.Z)(o)))}},46930:function(e,t,n){"use strict";n.d(t,{f:function(){return i}});var r=n(69311),i=function(){return(0,r.Yh)((function(e){return{currentChainId:e.currentChainId,currentMarket:e.currentMarket,currentMarketData:e.currentMarketData,currentNetworkConfig:e.currentNetworkConfig,jsonRpcProvider:e.jsonRpcProvider,setCurrentMarket:e.setCurrentMarket}}))}},26074:function(e,t,n){"use strict";n.d(t,{q:function(){return i}});var r=n(69311),i=function(){return(0,r.Yh)((function(e){return{isWalletModalOpen:e.isWalletModalOpen,setWalletModalOpen:e.setWalletModalOpen}}))}},56881:function(e,t,n){"use strict";n.d(t,{Z:function(){return ln}});var r,i=n(30120),o=n(67294),s=n(49501),a=n(54235),c=n(85893),u=(0,a.Z)((0,c.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"}),"Twitter"),l=(0,a.Z)((0,c.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"),d=n(81719),f=n(29630),p=n(81645),h=n(68861);function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;tr}const L="undefined"!==typeof window?window:null;var j=n(8662),U=n(75400),Z=n(84771),H=n(53566),z=n(57577);const G=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function V(e,t,n){var r;const i=function(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=(0,z.Z)(t);let s;if(t.fakeTransform)s=t.fakeTransform;else{const e=o.getComputedStyle(t);s=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let a=0,c=0;if(s&&"none"!==s&&"string"===typeof s){const e=s.split("(")[1].split(")")[0].split(",");a=parseInt(e[4],10),c=parseInt(e[5],10)}return"left"===e?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:"right"===e?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:"up"===e?i?`translateY(${i.bottom+c-r.top}px)`:`translateY(${o.innerHeight+c-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-c}px)`:`translateY(-${r.top+r.height-c}px)`}(e,t,"function"===typeof(r=n)?r():r);i&&(t.style.webkitTransform=i,t.style.transform=i)}var W=o.forwardRef((function(e,t){const n=(0,D.Z)(),r={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:u,container:l,direction:d="down",easing:f=r,in:p,onEnter:h,onEntered:m,onEntering:g,onExit:y,onExited:b,onExiting:v,style:w,timeout:x=i,TransitionComponent:A=j.ZP}=e,E=(0,M.Z)(e,G),_=o.useRef(null),k=(0,Z.Z)(u.ref,_,t),T=e=>t=>{e&&(void 0===t?e(_.current):e(_.current,t))},S=T(((e,t)=>{V(d,e,l),(0,H.n)(e),h&&h(e,t)})),C=T(((e,t)=>{const r=(0,H.C)({timeout:x,style:w,easing:f},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",(0,B.Z)({},r)),e.style.transition=n.transitions.create("transform",(0,B.Z)({},r)),e.style.webkitTransform="none",e.style.transform="none",g&&g(e,t)})),I=T(m),O=T(v),R=T((e=>{const t=(0,H.C)({timeout:x,style:w,easing:f},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),V(d,e,l),y&&y(e)})),P=T((e=>{e.style.webkitTransition="",e.style.transition="",b&&b(e)})),N=o.useCallback((()=>{_.current&&V(d,_.current,l)}),[d,l]);return o.useEffect((()=>{if(p||"down"===d||"right"===d)return;const e=(0,U.Z)((()=>{_.current&&V(d,_.current,l)})),t=(0,z.Z)(_.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[d,p,l]),o.useEffect((()=>{p||N()}),[p,N]),(0,c.jsx)(A,(0,B.Z)({nodeRef:_,onEnter:S,onEntered:I,onEntering:C,onExit:R,onExited:P,onExiting:O,addEndListener:e=>{s&&s(_.current,e)},appear:a,in:p,timeout:x},E,{children:(e,t)=>o.cloneElement(u,(0,B.Z)({ref:k,style:(0,B.Z)({visibility:"exited"!==e||p?void 0:"hidden"},w,u.props.style)},t))}))})),q=n(16600);var $=function(e){const{children:t,defer:n=!1,fallback:r=null}=e,[i,s]=o.useState(!1);return(0,q.Z)((()=>{n||s(!0)}),[n]),o.useEffect((()=>{n&&s(!0)}),[n]),(0,c.jsx)(o.Fragment,{children:i?t:r})},K=n(4132),Y=n(8195),X=n(69311),J=n(63206),Q=n(85214),ee=n(86010),te=n(94780),ne=n(28442),re=n(41796),ie=n(78884),oe=n(83187),se=n(7335),ae=n(63289),ce=n(57742),ue=n(34867),le=n(1588);function de(e){return(0,ue.Z)("MuiListItem",e)}var fe=(0,le.Z)("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]);var pe=(0,le.Z)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function he(e){return(0,ue.Z)("MuiListItemSecondaryAction",e)}(0,le.Z)("MuiListItemSecondaryAction",["root","disableGutters"]);const me=["className"],ge=(0,d.ZP)("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})((({ownerState:e})=>(0,B.Z)({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},e.disableGutters&&{right:0}))),ye=o.forwardRef((function(e,t){const n=(0,ie.Z)({props:e,name:"MuiListItemSecondaryAction"}),{className:r}=n,i=(0,M.Z)(n,me),s=o.useContext(ce.Z),a=(0,B.Z)({},n,{disableGutters:s.disableGutters}),u=(e=>{const{disableGutters:t,classes:n}=e,r={root:["root",t&&"disableGutters"]};return(0,te.Z)(r,he,n)})(a);return(0,c.jsx)(ge,(0,B.Z)({className:(0,ee.default)(u.root,r),ownerState:a,ref:t},i))}));ye.muiName="ListItemSecondaryAction";var be=ye;const ve=["className"],we=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected"],xe=(0,d.ZP)("div",{name:"MuiListItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.button&&t.button,n.hasSecondaryAction&&t.secondaryAction]}})((({theme:e,ownerState:t})=>(0,B.Z)({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!t.disablePadding&&(0,B.Z)({paddingTop:8,paddingBottom:8},t.dense&&{paddingTop:4,paddingBottom:4},!t.disableGutters&&{paddingLeft:16,paddingRight:16},!!t.secondaryAction&&{paddingRight:48}),!!t.secondaryAction&&{[`& > .${pe.root}`]:{paddingRight:48}},{[`&.${fe.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${fe.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,re.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${fe.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,re.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${fe.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},"flex-start"===t.alignItems&&{alignItems:"flex-start"},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},t.button&&{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${fe.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,re.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,re.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity)}}},t.hasSecondaryAction&&{paddingRight:48}))),Ae=(0,d.ZP)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"});var Ee=o.forwardRef((function(e,t){const n=(0,ie.Z)({props:e,name:"MuiListItem"}),{alignItems:r="center",autoFocus:i=!1,button:s=!1,children:a,className:u,component:l,components:d={},componentsProps:f={},ContainerComponent:p="li",ContainerProps:{className:h}={},dense:m=!1,disabled:g=!1,disableGutters:y=!1,disablePadding:b=!1,divider:v=!1,focusVisibleClassName:w,secondaryAction:x,selected:A=!1}=n,E=(0,M.Z)(n.ContainerProps,ve),_=(0,M.Z)(n,we),k=o.useContext(ce.Z),T={dense:m||k.dense||!1,alignItems:r,disableGutters:y},S=o.useRef(null);(0,ae.Z)((()=>{i&&S.current&&S.current.focus()}),[i]);const C=o.Children.toArray(a),I=C.length&&(0,se.Z)(C[C.length-1],["ListItemSecondaryAction"]),O=(0,B.Z)({},n,{alignItems:r,autoFocus:i,button:s,dense:T.dense,disabled:g,disableGutters:y,disablePadding:b,divider:v,hasSecondaryAction:I,selected:A}),R=(e=>{const{alignItems:t,button:n,classes:r,dense:i,disabled:o,disableGutters:s,disablePadding:a,divider:c,hasSecondaryAction:u,selected:l}=e,d={root:["root",i&&"dense",!s&&"gutters",!a&&"padding",c&&"divider",o&&"disabled",n&&"button","flex-start"===t&&"alignItemsFlexStart",u&&"secondaryAction",l&&"selected"],container:["container"]};return(0,te.Z)(d,de,r)})(O),D=(0,Z.Z)(S,t),P=d.Root||xe,N=f.root||{},F=(0,B.Z)({className:(0,ee.default)(R.root,N.className,u),disabled:g},_);let L=l||"li";return s&&(F.component=l||"div",F.focusVisibleClassName=(0,ee.default)(fe.focusVisible,w),L=oe.Z),I?(L=F.component||l?L:"div","li"===p&&("li"===L?L="div":"li"===F.component&&(F.component="div")),(0,c.jsx)(ce.Z.Provider,{value:T,children:(0,c.jsxs)(Ae,(0,B.Z)({as:p,className:(0,ee.default)(R.container,h),ref:D,ownerState:O},E,{children:[(0,c.jsx)(P,(0,B.Z)({},N,!(0,ne.Z)(P)&&{as:L,ownerState:(0,B.Z)({},O,N.ownerState)},F,{children:C})),C.pop()]}))})):(0,c.jsx)(ce.Z.Provider,{value:T,children:(0,c.jsxs)(P,(0,B.Z)({},N,{as:L,ref:D,ownerState:O},!(0,ne.Z)(P)&&{ownerState:(0,B.Z)({},O,N.ownerState)},F,{children:[C,x&&(0,c.jsx)(be,{children:x})]}))})})),_e=n(57609),ke=n(46930),Te=n(6022),Se=n(83454),Ce=(Se.env.NEXT_PUBLIC_FIAT_ON_RAMP,[].concat([])),Ie=function(e){var t,n=e.setOpen,r=(0,s.mV)().i18n,i=(0,ke.f)(),o=i.currentNetworkConfig,a=i.currentMarketData,u=(0,D.Z)().breakpoints,l=(0,P.Z)(u.down("md")),d=(0,X.Yh)((function(e){return e.trackEvent})),p=function(e,t){t&&n?(d(_e.uh.MAIN_MENU,{nav_link:e}),n(!1)):d(_e.uh.MAIN_MENU,{nav_link:e})};return(0,c.jsx)(Q.Z,{sx:{display:"flex",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},disablePadding:!0,children:(null===(t=o.bridge)||void 0===t||t.url,[{link:h.Z6.markets,title:Te.ag._("Home"),dataCy:"menuMarkets"},{link:h.Z6.dashboard,title:Te.ag._("Dashboard"),dataCy:"menuDashboard"},{link:h.Z6.rewards,title:Te.ag._("Rewards"),dataCy:"menuMarkets"},{link:h.Z6.stake,title:Te.ag._("Stake"),dataCy:"menuMarkets"},{link:h.Z6.gravity,title:Te.ag._("Gravity \ud83d\ude80"),dataCy:"menuMarkets"},{link:h.Z6.faucet,title:Te.ag._("Faucet"),isVisible:function(){return"staging"===Se.env.NEXT_PUBLIC_ENV||J.p8}},{link:h.Z6.strategy,title:Te.ag._("Strategy"),dataCy:"menuMarkets",isVisible:function(){return!1}}]).filter((function(e){return!e.isVisible||e.isVisible(a)})).map((function(e,t){return""===e.link?(0,c.jsx)("div",{},t):(0,c.jsx)(Ee,{sx:{width:{xs:"100%",md:"unset"},mr:{xs:0,md:2}},"data-cy":e.dataCy,disablePadding:!0,children:l?(0,c.jsx)(f.Z,{component:h.rU,href:e.link,variant:"h2",color:"#F1F1F3",sx:{width:"100%",p:4},onClick:function(){return p(e.title,!0)},children:r._(e.title)}):(0,c.jsx)(v.Z,{component:h.rU,onClick:function(){return p(e.title,!1)},href:e.link,sx:function(){return{color:"#F1F1F3",p:"6px 8px",position:"relative",".active&:after, &:hover&:after":{transform:"scaleX(1)",transformOrigin:"bottom left"},"&:after":{content:"''",position:"absolute",width:"100%",transform:"scaleX(0)",height:"2px",bottom:"-6px",left:"0",background:"#fff",transformOrigin:"bottom right",transition:"transform 0.25s ease-out"}}},children:r._(e.title)})},t)}))})};var Oe=o.forwardRef((function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"}))})),Re=n(29894),De=n(72553),Pe=n(70918),Be=n(36622);function Me(e){return(0,ue.Z)("MuiDrawer",e)}(0,le.Z)("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const Ne=["BackdropProps"],Fe=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],Le=(e,t)=>{const{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},je=(0,d.ZP)(De.Z,{name:"MuiDrawer",slot:"Root",overridesResolver:Le})((({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),Ue=(0,d.ZP)("div",{shouldForwardProp:d.FO,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:Le})({flex:"0 0 auto"}),Ze=(0,d.ZP)(Pe.Z,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,Be.Z)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,Be.Z)(n.anchor)}`]]}})((({theme:e,ownerState:t})=>(0,B.Z)({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},"left"===t.anchor&&{left:0},"top"===t.anchor&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},"right"===t.anchor&&{right:0},"bottom"===t.anchor&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},"left"===t.anchor&&"temporary"!==t.variant&&{borderRight:`1px solid ${(e.vars||e).palette.divider}`},"top"===t.anchor&&"temporary"!==t.variant&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`},"right"===t.anchor&&"temporary"!==t.variant&&{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},"bottom"===t.anchor&&"temporary"!==t.variant&&{borderTop:`1px solid ${(e.vars||e).palette.divider}`}))),He={left:"right",right:"left",top:"down",bottom:"up"};var ze=o.forwardRef((function(e,t){const n=(0,ie.Z)({props:e,name:"MuiDrawer"}),r=(0,D.Z)(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{anchor:s="left",BackdropProps:a,children:u,className:l,elevation:d=16,hideBackdrop:f=!1,ModalProps:{BackdropProps:p}={},onClose:h,open:m=!1,PaperProps:g={},SlideProps:y,TransitionComponent:b=W,transitionDuration:v=i,variant:w="temporary"}=n,x=(0,M.Z)(n.ModalProps,Ne),A=(0,M.Z)(n,Fe),E=o.useRef(!1);o.useEffect((()=>{E.current=!0}),[]);const _=function(e,t){return"rtl"===e.direction&&function(e){return-1!==["left","right"].indexOf(e)}(t)?He[t]:t}(r,s),k=s,T=(0,B.Z)({},n,{anchor:k,elevation:d,open:m,variant:w},A),S=(e=>{const{classes:t,anchor:n,variant:r}=e,i={root:["root"],docked:[("permanent"===r||"persistent"===r)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,Be.Z)(n)}`,"temporary"!==r&&`paperAnchorDocked${(0,Be.Z)(n)}`]};return(0,te.Z)(i,Me,t)})(T),C=(0,c.jsx)(Ze,(0,B.Z)({elevation:"temporary"===w?d:0,square:!0},g,{className:(0,ee.default)(S.paper,g.className),ownerState:T,children:u}));if("permanent"===w)return(0,c.jsx)(Ue,(0,B.Z)({className:(0,ee.default)(S.root,S.docked,l),ownerState:T,ref:t},A,{children:C}));const I=(0,c.jsx)(b,(0,B.Z)({in:m,direction:He[_],timeout:v,appear:E.current},y,{children:C}));return"persistent"===w?(0,c.jsx)(Ue,(0,B.Z)({className:(0,ee.default)(S.root,S.docked,l),ownerState:T,ref:t},A,{children:I})):(0,c.jsx)(je,(0,B.Z)({BackdropProps:(0,B.Z)({},a,p,{transitionDuration:v}),className:(0,ee.default)(S.root,S.modal,l),open:m,ownerState:T,onClose:h,hideBackdrop:f,ref:t},A,x,{children:I}))})),Ge=function(e){var t=e.open,n=e.setOpen,r=e.children,i=e.headerHeight;return(0,c.jsx)(ze,{"data-cy":"mobile-menu",anchor:"top",open:t,onClose:function(){return n(!1)},hideBackdrop:!0,sx:{top:"".concat(i,"px")},PaperProps:{sx:{background:"rgba(27, 32, 48, 0.98)",backdropFilter:"blur(20px)",boxShadow:"none",borderRadius:"unset",width:"100%",top:"".concat(i+20,"px"),pt:6,pb:15,minHeight:"100vh"}},children:r})};var Ve=o.forwardRef((function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"}))}));var We=o.forwardRef((function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"}))})),qe=n(58057),$e=n(35683),Ke={en:Te.ag._("English"),es:Te.ag._("Spanish"),fr:Te.ag._("French"),el:Te.ag._("Greek"),zh:Te.ag._("Chinese"),jp:Te.ag._("Japanese")},Ye=function(e){var t=e.component,n=void 0===t?Ee:t,r=e.onClick,o=(0,s.mV)().i18n;return(0,c.jsxs)(i.Z,{component:n,onClick:r,sx:{color:{xs:"#F1F1F3",md:"text.primary"}},children:[(0,c.jsx)(A.Z,{children:(0,c.jsx)(s.cC,{id:"Language"})}),(0,c.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center"},children:[o._(Ke[o.locale])," ",(0,c.jsx)(p.Z,{fontSize:"small",sx:{color:{xs:"#F1F1F3",md:"text.primary"},ml:1},children:(0,c.jsx)(Ve,{})})]})]})},Xe=function(e){var t=e.component,n=void 0===t?Ee:t,r=e.onClick,o=(0,s.mV)().i18n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(i.Z,{component:n,sx:{color:{xs:"#F1F1F3",md:"text.primary"},mb:"4px"},onClick:r,children:[(0,c.jsx)(Re.Z,{sx:{minWidth:"unset !important",mr:2,color:{xs:"#F1F1F3",md:"primary.light"}},children:(0,c.jsx)(p.Z,{fontSize:"small",children:(0,c.jsx)(We,{})})}),(0,c.jsx)(A.Z,{disableTypography:!0,children:(0,c.jsx)(f.Z,{variant:"subheader2",children:(0,c.jsx)(s.cC,{id:"Select language"})})})]}),Object.keys(Ke).map((function(e){return(0,c.jsxs)(i.Z,{component:n,onClick:function(){return(0,$e.zl)(e)},sx:{color:{xs:"#F1F1F3",md:"text.primary"},".MuiListItemIcon-root":{minWidth:"unset"},".MuiMenuItemIcon-root":{minWidth:"unset"}},children:[(0,c.jsx)(Re.Z,{sx:{mr:3,borderRadius:"2px",overflow:"hidden",width:20,height:14},children:(0,c.jsx)("img",{src:"/icons/flags/".concat(e,".svg"),width:"100%",height:"100%",alt:"".concat(e," icon")})}),(0,c.jsx)(A.Z,{children:o._(Ke[e])}),e===o.locale&&(0,c.jsx)(Re.Z,{sx:{m:0},children:(0,c.jsx)(p.Z,{fontSize:"small",sx:{color:{xs:"#F1F1F3",md:"text.primary"}},children:(0,c.jsx)(qe.Z,{})})})]},e)}))]})},Je=n(5506),Qe=n(80562),et=function(e){var t=e.setOpen;return(0,c.jsx)(Qe.Z,{onClick:function(){return t(!1)},sx:{p:0,mr:{xs:-2,xsm:1}},children:(0,c.jsx)(p.Z,{sx:{color:"#F1F1F3",fontSize:"32px"},children:(0,c.jsx)(Je.Z,{})})})},tt=n(22841),nt=n(54181),rt=function(e){var t=e.component,n=void 0===t?Ee:t,r="testnetsEnabled",a="true"===localStorage.getItem(r)||!1,u=(0,o.useState)(a),l=u[0],d=u[1],f=(0,X.Yh)((function(e){return e.trackEvent}));return(0,c.jsxs)(i.Z,{component:n,onClick:function(){var e=!l;d(!l),localStorage.setItem(r,e?"true":"false"),window.location.href="/"},sx:{cursor:"pointer",color:{xs:"#F1F1F3",md:"text.primary"},py:{xs:1.5,md:2}},children:[(0,c.jsx)(A.Z,{children:(0,c.jsx)(s.cC,{id:"Testnet mode"})}),(0,c.jsx)(tt.Z,{sx:{mr:0},value:"testnetsMode",control:(0,c.jsx)(nt.Z,{disableRipple:!0,onClick:function(){return f(_e.L6.TESTNET_MODE)},checked:l,sx:{".MuiSwitch-track":{bgcolor:{xs:"#FFFFFF1F",md:"primary.light"}}}}),label:l?"On":"Off",labelPlacement:"start"})]})},it=function(e){var t=e.children,n=e.title;return(0,c.jsxs)(i.Z,{sx:{mb:6,"&:last-of-type":{mb:0,".MuiDivider-root":{display:"none"}}},children:[(0,c.jsxs)(i.Z,{sx:{px:2},children:[(0,c.jsx)(f.Z,{variant:"subheader2",sx:{color:"#A5A8B6",px:4,py:2},children:n}),t]}),(0,c.jsx)(E.Z,{sx:{borderColor:"#F2F3F729",mt:6}})]})},ot=function(e){var t=e.open,n=e.setOpen,r=e.headerHeight,i=(0,s.mV)().i18n,a=(0,o.useState)(!1),u=a[0],l=a[1];return(0,o.useEffect)((function(){return l(!1)}),[t]),(0,c.jsxs)(c.Fragment,{children:[t?(0,c.jsx)(et,{setOpen:n}):(0,c.jsx)(v.Z,{id:"settings-button-mobile",variant:"surface",sx:{p:"7px 8px",minWidth:"unset",ml:2},onClick:function(){return n(!0)},children:(0,c.jsx)(p.Z,{sx:{color:"#F1F1F3"},fontSize:"small",children:(0,c.jsx)(Oe,{})})}),(0,c.jsx)(Ge,{open:t,setOpen:n,headerHeight:r,children:u?(0,c.jsx)(Q.Z,{sx:{px:2},children:(0,c.jsx)(Xe,{onClick:function(){return l(!1)}})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(it,{title:(0,c.jsx)(s.cC,{id:"Menu"}),children:(0,c.jsx)(Ie,{setOpen:n})}),(0,c.jsx)(it,{title:(0,c.jsx)(s.cC,{id:"Global settings"}),children:(0,c.jsxs)(Q.Z,{children:[J.F3&&(0,c.jsx)(rt,{}),(0,c.jsx)(Ye,{onClick:function(){return l(!0)}})]})}),(0,c.jsx)(it,{title:(0,c.jsx)(s.cC,{id:"Links"}),children:(0,c.jsx)(Q.Z,{children:Ce.map((function(e,t){return(0,c.jsxs)(Ee,{component:h.rU,href:e.link,sx:{color:"#F1F1F3"},children:[(0,c.jsx)(Re.Z,{sx:{minWidth:"unset",mr:3},children:(0,c.jsx)(p.Z,{sx:{fontSize:"20px",color:"#F1F1F3"},children:e.icon})}),(0,c.jsx)(A.Z,{children:i._(e.title)})]},t)}))})})]})})]})},st=n(22659),at={en:"English",es:"Spanish",fr:"French",el:"Greek"};function ct(){var e=(0,o.useState)(!1),t=e[0],n=e[1],r=(0,o.useState)(!1),i=r[0],a=r[1],u=(0,o.useState)(null),l=u[0],d=u[1],h=(0,X.Yh)((function(e){return e.trackEvent})),m=function(){d(null),n(!1),a(!1)};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(v.Z,{variant:"surface","aria-label":"settings",id:"settings-button","aria-controls":t?"settings-menu":void 0,"aria-expanded":t?"true":void 0,"aria-haspopup":"true",onClick:function(e){d(e.currentTarget),n(!0),a(!1)},sx:{p:"7px 8px",minWidth:"unset",ml:2},children:(0,c.jsx)(p.Z,{sx:{color:"#F1F1F3"},fontSize:"small",children:(0,c.jsx)(st.Z,{})})}),(0,c.jsxs)(w.Z,{id:"settings-menu",MenuListProps:{"aria-labelledby":"settings-button"},anchorEl:l,open:t,onClose:m,sx:{".MuiMenuItem-root.Mui-disabled":{opacity:1}},keepMounted:!0,children:[(0,c.jsx)(x.Z,{disabled:!0,sx:{mb:"4px"},children:(0,c.jsx)(f.Z,{variant:"subheader2",color:"text.secondary",children:(0,c.jsx)(s.cC,{id:"Global settings"})})}),J.F3&&(0,c.jsx)(rt,{}),(0,c.jsx)(Ye,{onClick:function(){var e=localStorage.getItem("LOCALE")||$e.ZW;n(!1),a(!0),h(_e.L6.LANGUAGE,{language:at[e]})},component:x.Z})]}),(0,c.jsx)(w.Z,{id:"settings-menu",MenuListProps:{"aria-labelledby":"settings-button"},anchorEl:l,open:i,onClose:m,keepMounted:!0,children:(0,c.jsx)(Xe,{onClick:function(){n(!0),a(!1)},component:x.Z})})]})}var ut=n(59499),lt=n(50029),dt=n(87794),ft=n.n(dt),pt=n(64343),ht=n(52758),mt=n(84563);var gt=o.forwardRef((function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"}))})),yt=n(91655),bt=n(852),vt=n(17155),wt=n(4730),xt=(0,a.Z)((0,c.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function At(e){return(0,ue.Z)("MuiAvatar",e)}(0,le.Z)("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const Et=["alt","children","className","component","imgProps","sizes","src","srcSet","variant"],_t=(0,d.ZP)("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})((({theme:e,ownerState:t})=>(0,B.Z)({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},"rounded"===t.variant&&{borderRadius:(e.vars||e).shape.borderRadius},"square"===t.variant&&{borderRadius:0},t.colorDefault&&(0,B.Z)({color:(e.vars||e).palette.background.default},e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:"light"===e.palette.mode?e.palette.grey[400]:e.palette.grey[600]})))),kt=(0,d.ZP)("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Tt=(0,d.ZP)(xt,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});var St,Ct=o.forwardRef((function(e,t){const n=(0,ie.Z)({props:e,name:"MuiAvatar"}),{alt:r,children:i,className:s,component:a="div",imgProps:u,sizes:l,src:d,srcSet:f,variant:p="circular"}=n,h=(0,M.Z)(n,Et);let m=null;const g=function({crossOrigin:e,referrerPolicy:t,src:n,srcSet:r}){const[i,s]=o.useState(!1);return o.useEffect((()=>{if(!n&&!r)return;s(!1);let i=!0;const o=new Image;return o.onload=()=>{i&&s("loaded")},o.onerror=()=>{i&&s("error")},o.crossOrigin=e,o.referrerPolicy=t,o.src=n,r&&(o.srcset=r),()=>{i=!1}}),[e,t,n,r]),i}((0,B.Z)({},u,{src:d,srcSet:f})),y=d||f,b=y&&"error"!==g,v=(0,B.Z)({},n,{colorDefault:!b,component:a,variant:p}),w=(e=>{const{classes:t,variant:n,colorDefault:r}=e,i={root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]};return(0,te.Z)(i,At,t)})(v);return m=b?(0,c.jsx)(kt,(0,B.Z)({alt:r,src:d,srcSet:f,sizes:l,ownerState:v,className:w.img},u)):null!=i?i:y&&r?r[0]:(0,c.jsx)(Tt,{className:w.fallback}),(0,c.jsx)(_t,(0,B.Z)({as:a,ownerState:v,className:(0,ee.default)(w.root,s),ref:t},h,{children:m}))})),It=n(11288),Ot=n.n(It),Rt=["image","fallbackImage","size","sx","loading","invisibleBadge","badge"];function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;tt(i,r)));return o.useEffect((()=>{const e=()=>{a(t(i,(0,B.Z)({target:n},r)))};return e(),n.addEventListener("scroll",e,{passive:!0}),()=>{n.removeEventListener("scroll",e,{passive:!0})}}),[n,t,JSON.stringify(r)]),s}({threshold:(0,P.Z)(n.down("md"))?160:80});return(0,c.jsx)(W,{appear:!1,direction:"down",in:!r,children:t})}var rn="bridgeVisited";function on(){var e=(0,D.Z)().breakpoints,t=(0,P.Z)(e.down("md")),n=(0,P.Z)(e.down("sm")),r=(0,o.useState)((function(){return Boolean(localStorage.getItem(tn))})),a=(r[0],r[1],(0,o.useState)((function(){return Boolean(localStorage.getItem(rn))}))),u=a[0],l=a[1],d=(0,X.Yh)((function(e){return[e.mobileDrawerOpen,e.setMobileDrawerOpen]})),m=(0,C.Z)(d,2),g=m[0],y=m[1],b=(0,Y.vR)().openBridge,w=(0,o.useState)(!1),x=w[0],A=w[1],E=(0,o.useState)(!1),_=E[0],k=E[1];(0,Y.vR)().openSwitch;(0,o.useEffect)((function(){g&&!t&&y(!1),x&&A(!1)}),[t]);var T=(0,c.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"start",gap:1},children:[(0,c.jsx)(f.Z,{variant:"subheader1",children:(0,c.jsx)(s.cC,{id:"Testnet mode is ON"})}),(0,c.jsxs)(f.Z,{variant:"description",children:[(0,c.jsx)(s.cC,{id:"The app is running in testnet mode. Learn how it works in"})," ",(0,c.jsx)(h.rU,{href:"https://discord.gg/zerolend",underline:"always",children:(0,c.jsx)(s.cC,{id:"Discord"})})]}),(0,c.jsx)(v.Z,{variant:"outlined",sx:{mt:"12px"},onClick:function(){localStorage.setItem("testnetsEnabled","false"),window.location.href="/"},children:(0,c.jsx)(s.cC,{id:"Disable testnet"})})]});return(0,c.jsx)(nn,{children:(0,c.jsxs)(i.Z,{component:"header",sx:function(e){return{height:48,position:"sticky",top:0,transition:e.transitions.create("top"),zIndex:e.zIndex.appBar,bgcolor:e.palette.background.header,padding:{xs:_||x?"8px 20px":"8px 8px 8px 20px",xsm:"8px 20px"},display:"flex",alignItems:"center",flexDirection:"space-between",boxShadow:"inset 0px -1px 0px rgba(242, 243, 247, 0.16)"}},children:[(0,c.jsx)(i.Z,{sx:{mr:n?1:3},children:J.p8&&(0,c.jsx)(K.a,{tooltipContent:T,offset:[0,-4],withoutHover:!0,children:(0,c.jsxs)(v.Z,{variant:"surface",size:"small",color:"primary",sx:{backgroundColor:"#12152B","&:hover, &.Mui-focusVisible":{backgroundColor:"rgba(182, 80, 158, 0.7)"}},children:["TESTNET",(0,c.jsx)(p.Z,{sx:{marginLeft:"2px",fontSize:"16px"},children:(0,c.jsx)(I.Z,{})})]})})}),(0,c.jsx)(i.Z,{sx:{display:{xs:"none",md:"block"}},children:(0,c.jsx)(Ie,{})}),(0,c.jsx)(i.Z,{sx:{flexGrow:1}}),(0,c.jsx)($,{children:(0,c.jsx)(en,{invisible:u,variant:"dot",badgeContent:"",color:"secondary",sx:{mr:2},children:(0,c.jsxs)(v.Z,{onClick:function(){localStorage.setItem(rn,"true"),l(!0),b()},variant:"surface",sx:{p:"7px 8px",minWidth:"unset",gap:2,alignItems:"center"},"aria-label":"Switch tool",children:[!t&&(0,c.jsx)(f.Z,{component:"span",typography:"subheader1",children:"Bridge"}),(0,c.jsx)(p.Z,{fontSize:"small",children:(0,c.jsx)(O.Z,{})})]})})}),(0,c.jsx)($,{children:!1}),!_&&(0,c.jsx)(Qt,{open:x,setOpen:function(e){t&&y(e),A(e)},headerHeight:48}),(0,c.jsx)(i.Z,{sx:{display:{xs:"none",md:"block"}},children:(0,c.jsx)(ct,{})}),!x&&(0,c.jsx)(i.Z,{sx:{display:{xs:"flex",md:"none"}},children:(0,c.jsx)(ot,{open:_,setOpen:function(e){t&&y(e),k(e)},headerHeight:48})})]})})}var sn=n(68346),an=n(97005),cn=function(){return(0,c.jsx)(i.Z,{sx:{bgcolor:"#111",color:"#fff",display:"flex",justifyContent:"center",p:"3px"},children:(0,c.jsxs)(an.Z,{pauseOnHover:!0,children:[(0,c.jsxs)(sn.Z,{href:"https://github.com/zerolend/audits",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"VIEW OUR AUDITS"})]}),(0,c.jsxs)(sn.Z,{href:"https://guild.xyz/zerolend",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"JOIN OUR GUILD"})]}),(0,c.jsxs)(sn.Z,{href:"https://app.zerolend.xyz/stake/?marketName=proto_linea_v3",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"STAKING IS LIVE"})]}),(0,c.jsxs)(sn.Z,{href:"https://github.com/zerolend/audits",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"VIEW OUR AUDITS"})]}),(0,c.jsxs)(sn.Z,{href:"https://guild.xyz/zerolend",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"JOIN OUR GUILD"})]}),(0,c.jsxs)(sn.Z,{href:"https://app.zerolend.xyz/stake/?marketName=proto_linea_v3",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"STAKING IS LIVE"})]}),(0,c.jsxs)(sn.Z,{href:"https://github.com/zerolend/audits",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"VIEW OUR AUDITS"})]}),(0,c.jsxs)(sn.Z,{href:"https://guild.xyz/zerolend",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"JOIN OUR GUILD"})]}),(0,c.jsxs)(sn.Z,{href:"https://app.zerolend.xyz/stake/?marketName=proto_linea_v3",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(s.cC,{id:"STAKING IS LIVE"})]})]})})},un=n(61038);function ln(e){var t,n=e.children,r=(0,Y.vR)().openLinkReferralModal,s=(0,un.ZP)(),a=X.Yh.getState().invite,u=(0,Ft.Z)().currentAccount;return(0,o.useEffect)((function(){var e;u&&void 0===(null===(e=s.value)||void 0===e?void 0:e.referrerCode)&&!s.isLoading&&""!==a&&r(a||"")}),[null===(t=s.value)||void 0===t?void 0:t.referrerCode,u,a,s.isLoading]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(cn,{}),(0,c.jsx)(on,{}),(0,c.jsx)(i.Z,{component:"main",sx:{display:"flex",flexDirection:"column",flex:1},children:n}),(0,c.jsx)(S,{})]})}},35683:function(e,t,n){"use strict";n.d(t,{ZW:function(){return g},iL:function(){return v},zl:function(){return y}});var r=n(50029),i=n(87794),o=n.n(i),s=n(6022),a=n(49501);function c(e,t){return t?"other":1==e?"one":"other"}function u(e,t){return"other"}const l=c;const d=c;const f=u;var p=n(67294),h=n(79958),m=n(85893);s.ag.loadLocaleData({en:{plurals:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,o=i&&n[0].slice(-1),s=i&&n[0].slice(-2);return t?1==o&&11!=s?"one":2==o&&12!=s?"two":3==o&&13!=s?"few":"other":1==e&&r?"one":"other"}},es:{plurals:d},fr:{plurals:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"}},el:{plurals:l},zh:{plurals:f}}),s.ag.load("en",h.messages),s.ag.activate("en");var g="en";function y(e){return b.apply(this,arguments)}function b(){return b=(0,r.Z)(o().mark((function e(t){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(50702)("./".concat(t,"/messages.js"));case 2:r=e.sent,i=r.messages,s.ag.load(t,i),s.ag.activate(t),localStorage.setItem("LOCALE",t);case 7:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}var v=function(e){return(0,p.useEffect)((function(){var e=localStorage.getItem("LOCALE")||g;s.ag._locale!==e&&y(e)}),[]),(0,m.jsx)(a.bd,{i18n:s.ag,forceRenderOnLocaleChange:!1,children:e.children})}},77537:function(e,t,n){"use strict";n.d(t,{S:function(){return i},Z:function(){return o}});var r=n(67294),i=r.createContext({}),o=function(){var e=(0,r.useContext)(i).web3ProviderData;if(0===Object.keys(e).length)throw new Error("useWeb3Context() can only be used inside of , please declare it at a higher level.");return e}},65637:function(e,t,n){"use strict";n.d(t,{ab:function(){return b},zw:function(){return v}});var r=n(50029),i=n(82262),o=n(10748),s=n(59499),a=n(92777),c=n(81531),u=n(63553),l=n(37247),d=n(46576),f=n(87794),p=n.n(f),h=n(26939),m=n(63206),g=n(38776);function y(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var b=function(e){(0,c.Z)(n,e);var t=y(n);function n(){var e;return(0,a.Z)(this,n),(e=t.call(this)).name=e.constructor.name,e.message="The user rejected the request.",e}return n}((0,d.Z)(Error)),v=function(e){(0,c.Z)(u,e);var t=y(u);function u(e){var n;(0,a.Z)(this,u),n=t.call(this),(0,s.Z)((0,o.Z)(n),"config",void 0),(0,s.Z)((0,o.Z)(n),"walletConnectProvider",void 0),(0,s.Z)((0,o.Z)(n),"handleDisplayURI",(function(e){n.emit("URI_AVAILABLE",e)}));var r=(0,m.c)(),i=r.reduce((function(e,t){var n=(0,m.Mo)(t);return e[t]=n.privateJsonRPCUrl||n.publicJsonRPCUrl[0],e}),{});return n.config={chains:[e],optionalChains:r,rpcMap:i,projectId:"9f8cf941224ba28f02be7c7dd755c78b",showQrModal:!0},n.handleChainChanged=n.handleChainChanged.bind((0,o.Z)(n)),n.handleAccountsChanged=n.handleAccountsChanged.bind((0,o.Z)(n)),n.handleDisconnect=n.handleDisconnect.bind((0,o.Z)(n)),n}return(0,i.Z)(u,[{key:"handleChainChanged",value:function(e){this.emitUpdate({chainId:e})}},{key:"handleAccountsChanged",value:function(e){this.emitUpdate({account:e[0]})}},{key:"handleDisconnect",value:function(){this.emitDeactivate()}},{key:"activate",value:function(){var e=(0,r.Z)(p().mark((function e(){var t,r,i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.walletConnectProvider){e.next=7;break}return e.next=3,n.e(327).then(n.bind(n,44327)).then((function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.default)&&void 0!==t?t:e}));case 3:return t=e.sent,e.next=6,t.init(this.config);case 6:this.walletConnectProvider=e.sent;case 7:return this.walletConnectProvider.on("chainChanged",this.handleChainChanged),this.walletConnectProvider.on("accountsChanged",this.handleAccountsChanged),this.walletConnectProvider.on("disconnect",this.handleDisconnect),this.walletConnectProvider.on("display_uri",this.handleDisplayURI),e.prev=11,e.next=14,this.walletConnectProvider.enable();case 14:return r=e.sent,i=r[0],e.abrupt("return",{provider:this.walletConnectProvider,account:i});case 19:if(e.prev=19,e.t0=e.catch(11),"Connection request reset. Please try again."!==e.t0.message){e.next=23;break}throw new b;case 23:throw e.t0;case 24:case"end":return e.stop()}}),e,this,[[11,19]])})));return function(){return e.apply(this,arguments)}}()},{key:"getProvider",value:function(){var e=(0,r.Z)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.walletConnectProvider);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getChainId",value:function(){var e=(0,r.Z)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,g.Z)(this.walletConnectProvider,"WalletConnectProvider should exists when calling getChainId"),e.abrupt("return",Promise.resolve(this.walletConnectProvider.chainId));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getAccount",value:function(){var e=(0,r.Z)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,g.Z)(this.walletConnectProvider,"WalletConnectProvider should exists when calling getAccount"),e.abrupt("return",Promise.resolve(this.walletConnectProvider.accounts).then((function(e){return e[0]})));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"deactivate",value:function(){this.walletConnectProvider&&(this.walletConnectProvider.removeListener("disconnect",this.handleDisconnect),this.walletConnectProvider.removeListener("chainChanged",this.handleChainChanged),this.walletConnectProvider.removeListener("accountsChanged",this.handleAccountsChanged),this.walletConnectProvider.removeListener("display_uri",this.handleDisplayURI),this.walletConnectProvider.disconnect(),this.walletConnectProvider=void 0,localStorage.removeItem("walletProvider"))}},{key:"close",value:function(){var e=(0,r.Z)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.emitDeactivate();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),u}(h.AbstractConnector)},5906:function(e,t,n){"use strict";n.d(t,{kn:function(){return ke},Sq:function(){return be},iL:function(){return Se}});var r=n(92777),i=n(82262),o=n(10748),s=n(81531),a=n(63553),c=n(37247),u=n(59499),l=n(75331),d=n(15495),f=n(26939),p=n(81088),h=n(36939),m=n.n(h),g="Invariant failed";function y(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function w(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(V){return!1}}function x(e,t,n){return x=w()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&v(i,n.prototype),i},x.apply(null,arguments)}function A(e){var t="function"===typeof Map?new Map:void 0;return A=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return x(e,arguments,b(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),v(r,e)},A(e)}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var _=function(e){function t(){var t;return(t=e.call(this)||this).name=t.constructor.name,t.message="The user rejected the request.",t}return y(t,e),t}(A(Error)),k=function(e){function t(t){var n;return 1!==t.supportedChainIds.length&&function(e,t){if(!e)throw new Error(g)}(!1),(n=e.call(this,t)||this).handleNetworkChanged=n.handleNetworkChanged.bind(E(n)),n.handleChainChanged=n.handleChainChanged.bind(E(n)),n.handleAccountsChanged=n.handleAccountsChanged.bind(E(n)),n.handleClose=n.handleClose.bind(E(n)),n}y(t,e);var n=t.prototype;return n.handleNetworkChanged=function(e){this.emitUpdate({provider:this.provider,chainId:e})},n.handleChainChanged=function(e){this.emitUpdate({chainId:e})},n.handleAccountsChanged=function(e){this.emitUpdate({account:0===e.length?null:e[0]})},n.handleClose=function(e,t){this.emitDeactivate()},n.activate=function(){try{var e=this;return e.provider||(e.provider=m()("frame")),e.provider.on("networkChanged",e.handleNetworkChanged).on("chainChanged",e.handleChainChanged).on("accountsChanged",e.handleAccountsChanged).on("close",e.handleClose),Promise.resolve(e.provider.enable().then((function(e){return e[0]})).catch((function(e){throw e&&4001===e.code?new _:e}))).then((function(t){return{provider:e.provider,account:t}}))}catch(V){return Promise.reject(V)}},n.getProvider=function(){try{return Promise.resolve(this.provider)}catch(V){return Promise.reject(V)}},n.getChainId=function(){try{return Promise.resolve(this.provider.send("eth_chainId"))}catch(V){return Promise.reject(V)}},n.getAccount=function(){try{return Promise.resolve(this.provider.send("eth_accounts").then((function(e){return e[0]})))}catch(V){return Promise.reject(V)}},n.deactivate=function(){this.provider.removeListener("networkChanged",this.handleNetworkChanged).removeListener("chainChanged",this.handleChainChanged).removeListener("accountsChanged",this.handleAccountsChanged).removeListener("close",this.handleClose)},t}(f.AbstractConnector),T=n(30950),S=n(31630),C=n(97452),I=n(63206),O=n(52864),R=n(65637),D=n(50029),P=n(46576),B=n(87794),M=n.n(B);var N=function(e,t){};function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t0}));case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(){return e.apply(this,arguments)}}()}]),n}(f.AbstractConnector),G=n(14094);function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function q(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){W(o,r,i,s,a,"next",e)}function a(e){W(o,r,i,s,a,"throw",e)}s(void 0)}))}}function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K(e,t,n){return K=se()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&re(i,n.prototype),i},K.apply(null,arguments)}function Y(e,t){for(var n=0;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0}))];case 2:return[2,e.sent()];case 3:return e.sent(),[2,!1];case 4:return[2]}}))}))()}}]),n}(f.AbstractConnector),ge=function(e){ee(n,e);var t=ae(n);function n(){var e;return $(this,n),(e=t.call(this)).name=e.constructor.name,e.message="The user rejected the request.",ne(e)}return n}(oe(Error));function ye(e){var t=e.supportedChainIds,n=e.rpc;return t||(n?Object.keys(n).map((function(e){return Number(e)})):void 0)}var be,ve=function(e){ee(r,e);var t=ae(r);function r(e){var n;return $(this,r),n=t.call(this,{supportedChainIds:ye(e)}),le(V(n),"binanceW3WProvider"),le(V(n),"config"),n.config=e,n.handleChainChanged=n.handleChainChanged.bind(V(n)),n.handleAccountsChanged=n.handleAccountsChanged.bind(V(n)),n.handleDisconnect=n.handleDisconnect.bind(V(n)),n}return X(r,[{key:"handleChainChanged",value:function(e){this.emitUpdate({chainId:e})}},{key:"handleAccountsChanged",value:function(e){this.emitUpdate({account:e[0]})}},{key:"handleDisconnect",value:function(){this.binanceW3WProvider&&(this.binanceW3WProvider.removeListener("chainChanged",this.handleChainChanged),this.binanceW3WProvider.removeListener("accountsChanged",this.handleAccountsChanged),this.binanceW3WProvider=void 0),this.emitDeactivate()}},{key:"activate",value:function(){var e=this;return q((function(){var t,r;return ce(this,(function(i){switch(i.label){case 0:return e.binanceW3WProvider?[3,2]:[4,n.e(728).then(n.bind(n,50888))];case 1:t=i.sent().default,e.binanceW3WProvider=new t(e.config),i.label=2;case 2:return[4,new Promise((function(t,n){var i=function(){e.binanceW3WProvider=void 0,n(new ge)};e.binanceW3WProvider.connector.on("disconnect",(function(){r||i()})),e.config.lng&&e.binanceW3WProvider.setLng(e.config.lng),e.binanceW3WProvider.enable(e.config.chainId).then((function(e){return t(e[0])})).catch((function(e){100001!==e.code?n(e):i()}))})).catch((function(e){throw e}))];case 3:return r=i.sent(),[2,(e.binanceW3WProvider.on("disconnect",e.handleDisconnect),e.binanceW3WProvider.on("chainChanged",e.handleChainChanged),e.binanceW3WProvider.on("accountsChanged",e.handleAccountsChanged),{provider:e.binanceW3WProvider,account:r})]}}))}))()}},{key:"getProvider",value:function(){var e=this;return q((function(){return ce(this,(function(t){return[2,e.binanceW3WProvider]}))}))()}},{key:"getChainId",value:function(){var e=this;return q((function(){return ce(this,(function(t){return[2,Promise.resolve(e.binanceW3WProvider.chainId)]}))}))()}},{key:"getAccount",value:function(){var e=this;return q((function(){return ce(this,(function(t){return[2,Promise.resolve(e.binanceW3WProvider.accounts).then((function(e){return e[0]}))]}))}))()}},{key:"deactivate",value:function(){this.binanceW3WProvider&&(this.binanceW3WProvider.removeListener("disconnect",this.handleDisconnect),this.binanceW3WProvider.removeListener("chainChanged",this.handleChainChanged),this.binanceW3WProvider.removeListener("accountsChanged",this.handleAccountsChanged),this.binanceW3WProvider.disconnect())}},{key:"close",value:function(){this.emitDeactivate()}}]),r}(f.AbstractConnector),we=function(){return(0,G.bD)()?me:ve};function xe(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(V){return!1}}();return function(){var n,r=(0,c.Z)(e);if(t){var i=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}!function(e){e.OKX="okx",e.BITGET="bitget",e.INJECTED="injected",e.WALLET_CONNECT="wallet_connect",e.WALLET_LINK="wallet_link",e.TORUS="torus",e.FRAME="frame",e.GNOSIS="gnosis",e.LEDGER="ledger",e.READ_ONLY_MODE="read_only_mode",e.BINANCE="binance"}(be||(be={}));var Ae="ZeroLend",Ee="https://app.zerolend.xyz/favicon.ico",_e={request:Promise.resolve(null)},ke=function(e){(0,s.Z)(n,e);var t=xe(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,s=new Array(i),a=0;a1&&void 0!==arguments[1]?arguments[1]:l.a_.mainnet,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.a_.mainnet;switch(e){case be.OKX:return new z({});case be.BITGET:return new Te({});case be.READ_ONLY_MODE:return new ke;case be.LEDGER:return new O.us({});case be.INJECTED:return new T._k({});case be.WALLET_LINK:var i=(0,I.Mo)(n);return new C.J({appName:Ae,appLogoUrl:Ee,url:i.privateJsonRPCUrl||i.publicJsonRPCUrl[0]});case be.WALLET_CONNECT:return new R.zw(r);case be.GNOSIS:if(window)return new d.P;throw new Error("Safe app not working");case be.TORUS:return new S.Q({chainId:n,initOptions:{network:{host:n===l.a_.polygon?"matic":n},showTorusButton:!1,enableLogging:!1,enabledVerifiers:!1}});case be.FRAME:if(n!==l.a_.mainnet)throw new p.UnsupportedChainIdError(n,[1]);return new k({supportedChainIds:[1]});case be.BINANCE:var o=we();return new o({rpc:(t={},(0,u.Z)(t,1,"https://cloudflare-eth.com/v1/mainnet"),(0,u.Z)(t,81457,"https://rpc.ankr.com/blast"),(0,u.Z)(t,324,"https://mainnet.era.zksync.io"),(0,u.Z)(t,280,"https://testnet.era.zksync.dev"),(0,u.Z)(t,59144,"https://linea.blockpi.network/v1/rpc/public"),(0,u.Z)(t,169,"https://pacific-rpc.manta.network/http"),(0,u.Z)(t,168587773,"https://sepolia.blast.io"),t),supportedChainIds:[1,81457,324,280,59144,169,168587773]});default:throw new Error("unsupported wallet")}}},79958:function(e){e.exports={messages:{".CSV":".CSV",".JSON":".JSON","<0><1><2/>Add <3/> stkZERO to borrow at <4/> (max discount)":"<0><1><2/>Add <3/> stkZERO to borrow at <4/> (max discount)","<0><1><2/>Add stkZERO to see borrow rate with discount":"<0><1><2/>Add stkZERO to see borrow rate with discount","<0>Ampleforth is a rebasing asset. Visit the <1>documentation to learn more.":"<0>Ampleforth is a rebasing asset. Visit the <1>documentation to learn more.","<0>Attention: Parameter changes via governance can alter your account health factor and risk of liquidation. Follow the <1>ZeroLend governance forum for updates.":"<0>Attention: Parameter changes via governance can alter your account health factor and risk of liquidation. Follow the <1>ZeroLend governance forum for updates.","<0>Slippage tolerance <1>{selectedSlippage}% <2>{0}":["<0>Slippage tolerance <1>",["selectedSlippage"],"% <2>",["0"],""],"ZERO holders (Ethereum network only) can stake their ZERO in the Safety Module to add more security to the protocol and earn Safety Incentives. In the case of a shortfall event, up to 30% of your stake can be slashed to cover the deficit, providing an additional layer of protection for the protocol.":"ZERO holders (Ethereum network only) can stake their ZERO in the Safety Module to add more security to the protocol and earn Safety Incentives. In the case of a shortfall event, up to 30% of your stake can be slashed to cover the deficit, providing an additional layer of protection for the protocol.",APR:"APR",APY:"APY","APY change":"APY change","APY type":"APY type","APY type change":"APY type change","APY with discount applied":"APY with discount applied","APY, fixed rate":"APY, fixed rate","APY, stable":"APY, stable","APY, variable":"APY, variable","AToken supply is not zero":"AToken supply is not zero","ZeroLend Governance":"ZeroLend Governance","ZeroLend aToken":"ZeroLend aToken","ZeroLend debt token":"ZeroLend debt token","ZeroLend is a fully decentralized, community governed protocol by the ZERO token-holders. ZERO token-holders collectively discuss, propose, and vote on upgrades to the protocol. ZERO token-holders (Ethereum network only) can either vote themselves on new proposals or delagate to an address of choice. To learn more check out the Governance":"ZeroLend is a fully decentralized, community governed protocol by the ZERO token-holders. ZERO token-holders collectively discuss, propose, and vote on upgrades to the protocol. ZERO token-holders (Ethereum network only) can either vote themselves on new proposals or delagate to an address of choice. To learn more check out the Governance","ZeroLend per month":"ZeroLend per month","About GHO":"About GHO",Account:"Account","Action cannot be performed because the reserve is frozen":"Action cannot be performed because the reserve is frozen","Action cannot be performed because the reserve is paused":"Action cannot be performed because the reserve is paused","Action requires an active reserve":"Action requires an active reserve","Activate Cooldown":"Activate Cooldown","Add stkZERO to see borrow APY with the discount":"Add stkZERO to see borrow APY with the discount","Add to wallet":"Add to wallet","Add {0} to wallet to track your balance.":["Add ",["0"]," to wallet to track your balance."],"Address is not a contract":"Address is not a contract",Addresses:"Addresses","Addresses ({0})":["Addresses (",["0"],")"],"All Assets":"All Assets","All done!":"All done!","All proposals":"All proposals","All transactions":"All transactions","Allowance required action":"Allowance required action","Allows you to decide whether to use a supplied asset as collateral. An asset used as collateral will affect your borrowing power and health factor.":"Allows you to decide whether to use a supplied asset as collateral. An asset used as collateral will affect your borrowing power and health factor.","Allows you to switch between <0>variable and <1>stable interest rates, where variable rate can increase and decrease depending on the amount of liquidity in the reserve, and stable rate will stay the same for the duration of your loan.":"Allows you to switch between <0>variable and <1>stable interest rates, where variable rate can increase and decrease depending on the amount of liquidity in the reserve, and stable rate will stay the same for the duration of your loan.",Amount:"Amount","Amount claimable":"Amount claimable","Amount in cooldown":"Amount in cooldown","Amount must be greater than 0":"Amount must be greater than 0","Amount to unstake":"Amount to unstake","An error has occurred fetching the proposal metadata from IPFS.":"An error has occurred fetching the proposal metadata from IPFS.","Approve Confirmed":"Approve Confirmed","Approve with":"Approve with","Approve {symbol} to continue":["Approve ",["symbol"]," to continue"],"Approving {symbol}...":["Approving ",["symbol"],"..."],"Array parameters that should be equal length are not":"Array parameters that should be equal length are not",Asset:"Asset","Asset can be only used as collateral in isolation mode with limited borrowing power. To enter isolation mode, disable all other collateral.":"Asset can be only used as collateral in isolation mode with limited borrowing power. To enter isolation mode, disable all other collateral.","Asset can only be used as collateral in isolation mode only.":"Asset can only be used as collateral in isolation mode only.","Asset cannot be migrated because you have isolated collateral in {marketName} v3 Market which limits borrowable assets. You can manage your collateral in <0>{marketName} V3 Dashboard":["Asset cannot be migrated because you have isolated collateral in ",["marketName"]," v3 Market which limits borrowable assets. You can manage your collateral in <0>",["marketName"]," V3 Dashboard"],"Asset cannot be migrated due to insufficient liquidity or borrow cap limitation in {marketName} v3 market.":["Asset cannot be migrated due to insufficient liquidity or borrow cap limitation in ",["marketName"]," v3 market."],"Asset cannot be migrated due to supply cap restriction in {marketName} v3 market.":["Asset cannot be migrated due to supply cap restriction in ",["marketName"]," v3 market."],"Asset cannot be migrated to {marketName} V3 Market due to E-mode restrictions. You can disable or manage E-mode categories in your <0>V3 Dashboard":["Asset cannot be migrated to ",["marketName"]," V3 Market due to E-mode restrictions. You can disable or manage E-mode categories in your <0>V3 Dashboard"],"Asset cannot be migrated to {marketName} v3 Market since collateral asset will enable isolation mode.":["Asset cannot be migrated to ",["marketName"]," v3 Market since collateral asset will enable isolation mode."],"Asset cannot be used as collateral.":"Asset cannot be used as collateral.","Asset category":"Asset category","Asset is frozen in {marketName} v3 market, hence this position cannot be migrated.":["Asset is frozen in ",["marketName"]," v3 market, hence this position cannot be migrated."],"Asset is not borrowable in isolation mode":"Asset is not borrowable in isolation mode","Asset is not listed":"Asset is not listed","Asset supply is limited to a certain amount to reduce protocol exposure to the asset and to help manage risks involved.":"Asset supply is limited to a certain amount to reduce protocol exposure to the asset and to help manage risks involved.",Assets:"Assets","Assets to borrow":"Assets to borrow","Assets to supply":"Assets to supply","Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action":["Assets with zero LTV (",["assetsBlockingWithdraw"],") must be withdrawn or disabled as collateral to perform this action"],"At a discount":"At a discount",Author:"Author",Available:"Available","Available assets":"Available assets","Available liquidity":"Available liquidity","Available on":"Available on","Available rewards":"Available rewards","Available to borrow":"Available to borrow","Available to supply":"Available to supply","Back to Dashboard":"Back to Dashboard",Balance:"Balance","Balance to revoke":"Balance to revoke","Be careful - You are very close to liquidation. Consider depositing more collateral or paying down some of your borrowed positions":"Be careful - You are very close to liquidation. Consider depositing more collateral or paying down some of your borrowed positions","Be mindful of the network congestion and gas prices.":"Be mindful of the network congestion and gas prices.","Because this asset is paused, no actions can be taken until further notice":"Because this asset is paused, no actions can be taken until further notice","Before supplying":"Before supplying","Blocked Address":"Blocked Address",Borrow:"Borrow","Borrow APY rate":"Borrow APY rate","Borrow APY, fixed rate":"Borrow APY, fixed rate","Borrow APY, stable":"Borrow APY, stable","Borrow APY, variable":"Borrow APY, variable","Borrow amount to reach {0}% utilization":["Borrow amount to reach ",["0"],"% utilization"],"Borrow and repay in same block is not allowed":"Borrow and repay in same block is not allowed","Borrow apy":"Borrow apy","Borrow balance":"Borrow balance","Borrow balance after repay":"Borrow balance after repay","Borrow balance after switch":"Borrow balance after switch","Borrow cap":"Borrow cap","Borrow cap is exceeded":"Borrow cap is exceeded","Borrow info":"Borrow info","Borrow power used":"Borrow power used","Borrow rate change":"Borrow rate change","Borrow {symbol}":["Borrow ",["symbol"]],Borrowed:"Borrowed","Borrowed asset amount":"Borrowed asset amount","Borrowing is currently unavailable for {0}.":["Borrowing is currently unavailable for ",["0"],"."],"Borrowing is disabled due to an ZeroLend community decision. <0>More details":"Borrowing is disabled due to an ZeroLend community decision. <0>More details","Borrowing is not enabled":"Borrowing is not enabled","Borrowing is unavailable because you\u2019re using Isolation mode. To manage Isolation mode visit your <0>Dashboard.":"Borrowing is unavailable because you\u2019re using Isolation mode. To manage Isolation mode visit your <0>Dashboard.","Borrowing is unavailable because you\u2019ve enabled Efficiency Mode (E-Mode) and Isolation mode. To manage E-Mode and Isolation mode visit your <0>Dashboard.":"Borrowing is unavailable because you\u2019ve enabled Efficiency Mode (E-Mode) and Isolation mode. To manage E-Mode and Isolation mode visit your <0>Dashboard.","Borrowing is unavailable because you\u2019ve enabled Efficiency Mode (E-Mode) for {0} category. To manage E-Mode categories visit your <0>Dashboard.":["Borrowing is unavailable because you\u2019ve enabled Efficiency Mode (E-Mode) for ",["0"]," category. To manage E-Mode categories visit your <0>Dashboard."],"Borrowing of this asset is limited to a certain amount to minimize liquidity pool insolvency.":"Borrowing of this asset is limited to a certain amount to minimize liquidity pool insolvency.","Borrowing power and assets are limited due to Isolation mode.":"Borrowing power and assets are limited due to Isolation mode.","Borrowing this amount will reduce your health factor and increase risk of liquidation.":"Borrowing this amount will reduce your health factor and increase risk of liquidation.","Borrowing {symbol}":["Borrowing ",["symbol"]],Both:"Both","Buy Crypto With Fiat":"Buy Crypto With Fiat","Buy Crypto with Fiat":"Buy Crypto with Fiat","Buy {cryptoSymbol} with Fiat":["Buy ",["cryptoSymbol"]," with Fiat"],"COPIED!":"COPIED!","COPY IMAGE":"COPY IMAGE","Can be collateral":"Can be collateral","Can be executed":"Can be executed",Cancel:"Cancel","Cannot disable E-Mode":"Cannot disable E-Mode","Choose how much voting/proposition power to give to someone else by delegating some of your ZERO or stkZERO balance. Your tokens will remain in your account, but your delegate will be able to vote or propose on your behalf. If your ZERO or stkZERO balance changes, your delegate's voting/proposition power will be automatically adjusted.":"Choose how much voting/proposition power to give to someone else by delegating some of your ZERO or stkZERO balance. Your tokens will remain in your account, but your delegate will be able to vote or propose on your behalf. If your ZERO or stkZERO balance changes, your delegate's voting/proposition power will be automatically adjusted.","Choose one of the on-ramp services":"Choose one of the on-ramp services",Claim:"Claim","Claim all":"Claim all","Claim all rewards":"Claim all rewards","Claim {0}":["Claim ",["0"]],"Claim {symbol}":["Claim ",["symbol"]],"Claimable ZERO":"Claimable ZERO",Claimed:"Claimed",Claiming:"Claiming","Claiming {symbol}":["Claiming ",["symbol"]],Close:"Close",Collateral:"Collateral","Collateral balance after repay":"Collateral balance after repay","Collateral change":"Collateral change","Collateral is (mostly) the same currency that is being borrowed":"Collateral is (mostly) the same currency that is being borrowed","Collateral to repay with":"Collateral to repay with","Collateral usage":"Collateral usage","Collateral usage is limited because of Isolation mode.":"Collateral usage is limited because of Isolation mode.","Collateral usage is limited because of isolation mode.":"Collateral usage is limited because of isolation mode.","Collateral usage is limited because of isolation mode. <0>Learn More":"Collateral usage is limited because of isolation mode. <0>Learn More",Collateralization:"Collateralization","Collector Contract":"Collector Contract","Collector Info":"Collector Info","Connect wallet":"Connect wallet","Cooldown period":"Cooldown period","Cooldown period warning":"Cooldown period warning","Cooldown time left":"Cooldown time left","Cooldown to unstake":"Cooldown to unstake","Cooling down...":"Cooling down...","Copy address":"Copy address","Copy error message":"Copy error message","Copy error text":"Copy error text","Covered debt":"Covered debt",Created:"Created","Current LTV":"Current LTV","Current differential":"Current differential","Current v2 Balance":"Current v2 Balance","Current v2 balance":"Current v2 balance","Current votes":"Current votes","Dark mode":"Dark mode",Dashboard:"Dashboard","Data couldn't be fetched, please reload graph.":"Data couldn't be fetched, please reload graph.",Debt:"Debt","Debt ceiling is exceeded":"Debt ceiling is exceeded","Debt ceiling is not zero":"Debt ceiling is not zero","Debt ceiling limits the amount possible to borrow against this asset by protocol users. Debt ceiling is specific to assets in isolation mode and is denoted in USD.":"Debt ceiling limits the amount possible to borrow against this asset by protocol users. Debt ceiling is specific to assets in isolation mode and is denoted in USD.","Delegated power":"Delegated power",Details:"Details",Developers:"Developers",Differential:"Differential","Disable E-Mode":"Disable E-Mode","Disable testnet":"Disable testnet","Disable {symbol} as collateral":["Disable ",["symbol"]," as collateral"],Disabled:"Disabled","Disabling E-Mode":"Disabling E-Mode","Disabling this asset as collateral affects your borrowing power and Health Factor.":"Disabling this asset as collateral affects your borrowing power and Health Factor.","Disconnect Wallet":"Disconnect Wallet","Discord channel":"Discord channel",Discount:"Discount","Discount applied for <0/> staking ZERO":"Discount applied for <0/> staking ZERO","Discount model parameters":"Discount model parameters","Discount parameters are decided by the ZeroLend community and may be changed over time. Check Governance for updates and vote to participate. <0>Learn more":"Discount parameters are decided by the ZeroLend community and may be changed over time. Check Governance for updates and vote to participate. <0>Learn more","Discountable amount":"Discountable amount",Docs:"Docs",Download:"Download","Due to internal stETH mechanics required for rebasing support, it is not possible to perform a collateral switch where stETH is the source token.":"Due to internal stETH mechanics required for rebasing support, it is not possible to perform a collateral switch where stETH is the source token.","Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the ZeroLend V3 Harmony market.":"Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity with Ethereum, which affects the ZeroLend V3 Harmony market.","E-Mode":"E-Mode","E-Mode Category":"E-Mode Category","E-Mode category":"E-Mode category","E-Mode increases your LTV for a selected category of assets up to 97%. <0>Learn more":"E-Mode increases your LTV for a selected category of assets up to 97%. <0>Learn more","E-Mode increases your LTV for a selected category of assets up to<0/>. <1>Learn more":"E-Mode increases your LTV for a selected category of assets up to<0/>. <1>Learn more","E-Mode increases your LTV for a selected category of assets, meaning that when E-mode is enabled, you will have higher borrowing power over assets of the same E-mode category which are defined by ZeroLend Governance. You can enter E-Mode from your <0>Dashboard. To learn more about E-Mode and applied restrictions in <1>FAQ or <2>ZeroLend V3 Technical Paper.":"E-Mode increases your LTV for a selected category of assets, meaning that when E-mode is enabled, you will have higher borrowing power over assets of the same E-mode category which are defined by ZeroLend Governance. You can enter E-Mode from your <0>Dashboard. To learn more about E-Mode and applied restrictions in <1>FAQ or <2>ZeroLend V3 Technical Paper.","Effective interest rate":"Effective interest rate","Efficiency mode (E-Mode)":"Efficiency mode (E-Mode)",Emode:"Emode","Enable E-Mode":"Enable E-Mode","Enable {symbol} as collateral":["Enable ",["symbol"]," as collateral"],Enabled:"Enabled","Enabling E-Mode":"Enabling E-Mode","Enabling E-Mode only allows you to borrow assets belonging to the selected category. Please visit our <0>FAQ guide to learn more about how it works and the applied restrictions.":"Enabling E-Mode only allows you to borrow assets belonging to the selected category. Please visit our <0>FAQ guide to learn more about how it works and the applied restrictions.","Enabling this asset as collateral increases your borrowing power and Health Factor. However, it can get liquidated if your health factor drops below 1.":"Enabling this asset as collateral increases your borrowing power and Health Factor. However, it can get liquidated if your health factor drops below 1.",Ended:"Ended",Ends:"Ends",English:"English","Enter ETH address":"Enter ETH address","Enter an amount":"Enter an amount","Error connecting. Try refreshing the page.":"Error connecting. Try refreshing the page.","Estimated compounding interest, including discount for Staking {0}ZERO in Safety Module.":["Estimated compounding interest, including discount for Staking ",["0"],"ZERO in Safety Module."],"Exceeds the discount":"Exceeds the discount",Executed:"Executed","Expected amount to repay":"Expected amount to repay",Expires:"Expires","Export data to":"Export data to",FAQ:"FAQ",FAQS:"FAQS","Failed to load proposal voters. Please refresh the page.":"Failed to load proposal voters. Please refresh the page.",Faucet:"Faucet","Faucet {0}":["Faucet ",["0"]],"Fetching data...":"Fetching data...",Filter:"Filter","Flashloan is disabled for this asset, hence this position cannot be migrated.":"Flashloan is disabled for this asset, hence this position cannot be migrated.","For repayment of a specific type of debt, the user needs to have debt that type":"For repayment of a specific type of debt, the user needs to have debt that type","Forum discussion":"Forum discussion",French:"French","Frozen or paused assets":"Frozen or paused assets","Funds in the Safety Module":"Funds in the Safety Module","GHO is a native decentralized, collateral-backed digital asset pegged to USD. It is created by users via borrowing against multiple collateral. When user repays their GHO borrow position, the protocol burns that user's GHO. All the interest payments accrued by minters of GHO would be directly transferred to the ZeroLend treasury.":"GHO is a native decentralized, collateral-backed digital asset pegged to USD. It is created by users via borrowing against multiple collateral. When user repays their GHO borrow position, the protocol burns that user's GHO. All the interest payments accrued by minters of GHO would be directly transferred to the ZeroLend treasury.","Get ABP Token":"Get ABP Token","Global settings":"Global settings","Go Back":"Go Back","Go to Balancer Pool":"Go to Balancer Pool","Go to V3 Dashboard":"Go to V3 Dashboard",Governance:"Governance",Greek:"Greek","Health Factor ({0} v2)":["Health Factor (",["0"]," v2)"],"Health Factor ({0} v3)":["Health Factor (",["0"]," v3)"],"Health factor":"Health factor","Health factor is lesser than the liquidation threshold":"Health factor is lesser than the liquidation threshold","Health factor is not below the threshold":"Health factor is not below the threshold",Hide:"Hide","Holders of stkZERO receive a discount on the GHO borrowing rate":"Holders of stkZERO receive a discount on the GHO borrowing rate","I acknowledge the risks involved.":"I acknowledge the risks involved.","I fully understand the risks of migrating.":"I fully understand the risks of migrating.","I understand how cooldown ({0}) and unstaking ({1}) work":["I understand how cooldown (",["0"],") and unstaking (",["1"],") work"],"If the error continues to happen,<0/> you may report it to this":"If the error continues to happen,<0/> you may report it to this","If the health factor goes below 1, the liquidation of your collateral might be triggered.":"If the health factor goes below 1, the liquidation of your collateral might be triggered.","If you DO NOT unstake within {0} of unstake window, you will need to activate cooldown process again.":["If you DO NOT unstake within ",["0"]," of unstake window, you will need to activate cooldown process again."],"If your loan to value goes above the liquidation threshold your collateral supplied may be liquidated.":"If your loan to value goes above the liquidation threshold your collateral supplied may be liquidated.","In E-Mode some assets are not borrowable. Exit E-Mode to get access to all assets":"In E-Mode some assets are not borrowable. Exit E-Mode to get access to all assets","In Isolation mode, you cannot supply other assets as collateral. A global debt ceiling limits the borrowing power of the isolated asset. To exit isolation mode disable {0} as collateral before borrowing another asset. Read more in our <0>FAQ":["In Isolation mode, you cannot supply other assets as collateral. A global debt ceiling limits the borrowing power of the isolated asset. To exit isolation mode disable ",["0"]," as collateral before borrowing another asset. Read more in our <0>FAQ"],"Inconsistent flashloan parameters":"Inconsistent flashloan parameters","Insufficient collateral to cover new borrow position. Wallet must have borrowing power remaining to perform debt switch.":"Insufficient collateral to cover new borrow position. Wallet must have borrowing power remaining to perform debt switch.","Interest accrued":"Interest accrued","Interest rate rebalance conditions were not met":"Interest rate rebalance conditions were not met","Interest rate strategy":"Interest rate strategy","Invalid amount to burn":"Invalid amount to burn","Invalid amount to mint":"Invalid amount to mint","Invalid bridge protocol fee":"Invalid bridge protocol fee","Invalid expiration":"Invalid expiration","Invalid flashloan premium":"Invalid flashloan premium","Invalid return value of the flashloan executor function":"Invalid return value of the flashloan executor function","Invalid signature":"Invalid signature",Isolated:"Isolated","Isolated Debt Ceiling":"Isolated Debt Ceiling","Isolated assets have limited borrowing power and other assets cannot be used as collateral.":"Isolated assets have limited borrowing power and other assets cannot be used as collateral.","Join the community discussion":"Join the community discussion","LEARN MORE":"LEARN MORE",Language:"Language","Learn more":"Learn more","Learn more about risks involved":"Learn more about risks involved","Learn more in our <0>FAQ guide":"Learn more in our <0>FAQ guide","Learn more.":"Learn more.",Links:"Links",Liqudation:"Liqudation","Liquidated collateral":"Liquidated collateral",Liquidation:"Liquidation","Liquidation <0/> threshold":"Liquidation <0/> threshold","Liquidation Threshold":"Liquidation Threshold","Liquidation at":"Liquidation at","Liquidation penalty":"Liquidation penalty","Liquidation risk":"Liquidation risk","Liquidation risk parameters":"Liquidation risk parameters","Liquidation threshold":"Liquidation threshold","Liquidation value":"Liquidation value","Loading data...":"Loading data...","Ltv validation failed":"Ltv validation failed","MAI has been paused due to a community decision. Supply, borrows and repays are impacted. <0>More details":"MAI has been paused due to a community decision. Supply, borrows and repays are impacted. <0>More details",MAX:"MAX","Manage analytics":"Manage analytics",Market:"Market",Markets:"Markets",Max:"Max","Max LTV":"Max LTV","Max slashing":"Max slashing","Maximum amount available to borrow against this asset is limited because debt ceiling is at {0}%.":["Maximum amount available to borrow against this asset is limited because debt ceiling is at ",["0"],"%."],"Maximum amount available to borrow is <0/> {0} (<1/>).":["Maximum amount available to borrow is <0/> ",["0"]," (<1/>)."],"Maximum amount available to borrow is limited because protocol borrow cap is nearly reached.":"Maximum amount available to borrow is limited because protocol borrow cap is nearly reached.","Maximum amount available to supply is <0/> {0} (<1/>).":["Maximum amount available to supply is <0/> ",["0"]," (<1/>)."],"Maximum amount available to supply is limited because protocol supply cap is at {0}%.":["Maximum amount available to supply is limited because protocol supply cap is at ",["0"],"%."],"Maximum loan to value":"Maximum loan to value","Meet GHO":"Meet GHO",Menu:"Menu",Migrate:"Migrate","Migrate to V3":"Migrate to V3","Migrate to v3":"Migrate to v3","Migrate to {0} v3 Market":["Migrate to ",["0"]," v3 Market"],Migrated:"Migrated",Migrating:"Migrating","Migrating multiple collaterals and borrowed assets at the same time can be an expensive operation and might fail in certain situations.<0>Therefore it\u2019s not recommended to migrate positions with more than 5 assets (deposited + borrowed) at the same time.":"Migrating multiple collaterals and borrowed assets at the same time can be an expensive operation and might fail in certain situations.<0>Therefore it\u2019s not recommended to migrate positions with more than 5 assets (deposited + borrowed) at the same time.","Migration risks":"Migration risks","Minimum GHO borrow amount":"Minimum GHO borrow amount","Minimum staked ZeroLend amount":"Minimum staked ZeroLend amount",More:"More",NAY:"NAY","Need help connecting a wallet? <0>Read our FAQ":"Need help connecting a wallet? <0>Read our FAQ","Net APR":"Net APR","Net APY":"Net APY","Net APY is the combined effect of all supply and borrow positions on net worth, including incentives. It is possible to have a negative net APY if debt APY is higher than supply APY.":"Net APY is the combined effect of all supply and borrow positions on net worth, including incentives. It is possible to have a negative net APY if debt APY is higher than supply APY.","Net worth":"Net worth",Network:"Network","Network not supported for this wallet":"Network not supported for this wallet","New APY":"New APY","No assets selected to migrate.":"No assets selected to migrate.","No rewards to claim":"No rewards to claim","No search results{0}":["No search results",["0"]],"No transactions yet.":"No transactions yet.","No voting power":"No voting power",None:"None","Not a valid address":"Not a valid address","Not enough balance on your wallet":"Not enough balance on your wallet","Not enough collateral to repay this amount of debt with":"Not enough collateral to repay this amount of debt with","Not enough staked balance":"Not enough staked balance","Not enough voting power to participate in this proposal":"Not enough voting power to participate in this proposal","Not reached":"Not reached","Nothing borrowed yet":"Nothing borrowed yet","Nothing found":"Nothing found","Nothing staked":"Nothing staked","Nothing supplied yet":"Nothing supplied yet",Notify:"Notify","Ok, Close":"Ok, Close","Ok, I got it":"Ok, I got it","Operation not supported":"Operation not supported","Oracle price":"Oracle price",Overview:"Overview","Page not found":"Page not found","Participating in this {symbol} reserve gives annualized rewards.":["Participating in this ",["symbol"]," reserve gives annualized rewards."],"Pending...":"Pending...","Per the community, the Fantom market has been frozen.":"Per the community, the Fantom market has been frozen.","Per the community, the V2 AMM market has been deprecated.":"Per the community, the V2 AMM market has been deprecated.","Please always be aware of your <0>Health Factor (HF) when partially migrating a position and that your rates will be updated to V3 rates.":"Please always be aware of your <0>Health Factor (HF) when partially migrating a position and that your rates will be updated to V3 rates.","Please connect a wallet to view your personal information here.":"Please connect a wallet to view your personal information here.","Please connect your wallet to get free testnet assets.":"Please connect your wallet to get free testnet assets.","Please connect your wallet to see migration tool.":"Please connect your wallet to see migration tool.","Please connect your wallet to see your supplies, borrowings, and open positions.":"Please connect your wallet to see your supplies, borrowings, and open positions.","Please connect your wallet to view transaction history.":"Please connect your wallet to view transaction history.","Please enter a valid wallet address.":"Please enter a valid wallet address.","Please switch to {networkName}.":["Please switch to ",["networkName"],"."],"Please, connect your wallet":"Please, connect your wallet","Pool addresses provider is not registered":"Pool addresses provider is not registered","Powered by":"Powered by","Preview tx and migrate":"Preview tx and migrate",Price:"Price","Price data is not currently available for this reserve on the protocol subgraph":"Price data is not currently available for this reserve on the protocol subgraph","Price impact is the spread between the total value of the entry tokens switched and the destination tokens obtained (in USD), which results from the limited liquidity of the trading pair.":"Price impact is the spread between the total value of the entry tokens switched and the destination tokens obtained (in USD), which results from the limited liquidity of the trading pair.","Price impact {0}%":["Price impact ",["0"],"%"],Privacy:"Privacy","Proposal details":"Proposal details","Proposal overview":"Proposal overview",Proposals:"Proposals",Proposition:"Proposition","Protocol borrow cap at 100% for this asset. Further borrowing unavailable.":"Protocol borrow cap at 100% for this asset. Further borrowing unavailable.","Protocol borrow cap is at 100% for this asset. Further borrowing unavailable.":"Protocol borrow cap is at 100% for this asset. Further borrowing unavailable.","Protocol debt ceiling is at 100% for this asset. Further borrowing against this asset is unavailable.":"Protocol debt ceiling is at 100% for this asset. Further borrowing against this asset is unavailable.","Protocol debt ceiling is at 100% for this asset. Futher borrowing against this asset is unavailable.":"Protocol debt ceiling is at 100% for this asset. Futher borrowing against this asset is unavailable.","Protocol supply cap at 100% for this asset. Further supply unavailable.":"Protocol supply cap at 100% for this asset. Further supply unavailable.","Protocol supply cap is at 100% for this asset. Further supply unavailable.":"Protocol supply cap is at 100% for this asset. Further supply unavailable.",Quorum:"Quorum","Rate change":"Rate change","Raw-Ipfs":"Raw-Ipfs",Reached:"Reached","Reactivate cooldown period to unstake {0} {stakedToken}":["Reactivate cooldown period to unstake ",["0"]," ",["stakedToken"]],"Read more here.":"Read more here.","Read-only mode allows to see address positions in ZeroLend, but you won't be able to perform transactions.":"Read-only mode allows to see address positions in ZeroLend, but you won't be able to perform transactions.","Read-only mode.":"Read-only mode.","Read-only mode. Connect to a wallet to perform transactions.":"Read-only mode. Connect to a wallet to perform transactions.",Received:"Received","Recipient address":"Recipient address","Rejected connection request":"Rejected connection request",Reload:"Reload","Reload the page":"Reload the page","Remaining debt":"Remaining debt","Remaining supply":"Remaining supply",Repaid:"Repaid",Repay:"Repay","Repay with":"Repay with","Repay {symbol}":["Repay ",["symbol"]],"Repaying {symbol}":["Repaying ",["symbol"]],"Repayment amount to reach {0}% utilization":["Repayment amount to reach ",["0"],"% utilization"],"Reserve Size":"Reserve Size","Reserve factor":"Reserve factor","Reserve factor is a percentage of interest which goes to a {0} that is controlled by ZeroLend governance to promote ecosystem growth.":["Reserve factor is a percentage of interest which goes to a ",["0"]," that is controlled by ZeroLend governance to promote ecosystem growth."],"Reserve status & configuration":"Reserve status & configuration",Reset:"Reset",Restake:"Restake","Restake {symbol}":["Restake ",["symbol"]],Restaked:"Restaked","Restaking {symbol}":["Restaking ",["symbol"]],"Review approval tx details":"Review approval tx details","Review changes to continue":"Review changes to continue","Review tx":"Review tx","Review tx details":"Review tx details","Revoke power":"Revoke power","Reward(s) to claim":"Reward(s) to claim","Rewards APR":"Rewards APR","Risk details":"Risk details","SEE CHARTS":"SEE CHARTS","Safety of your deposited collateral against the borrowed assets and its underlying value.":"Safety of your deposited collateral against the borrowed assets and its underlying value.","Save and share":"Save and share","Seatbelt report":"Seatbelt report","Seems like we can't switch the network automatically. Please check if you can change it from the wallet.":"Seems like we can't switch the network automatically. Please check if you can change it from the wallet.",Select:"Select","Select APY type to switch":"Select APY type to switch","Select an asset":"Select an asset","Select language":"Select language","Select slippage tolerance":"Select slippage tolerance","Select v2 borrows to migrate":"Select v2 borrows to migrate","Select v2 supplies to migrate":"Select v2 supplies to migrate","Selected assets have successfully migrated. Visit the Market Dashboard to see them.":"Selected assets have successfully migrated. Visit the Market Dashboard to see them.","Selected borrow assets":"Selected borrow assets","Selected supply assets":"Selected supply assets","Send feedback":"Send feedback","Set up delegation":"Set up delegation","Setup notifications about your Health Factor using the Hal app.":"Setup notifications about your Health Factor using the Hal app.","Share on Lens":"Share on Lens","Share on twitter":"Share on twitter",Show:"Show","Show assets with 0 balance":"Show assets with 0 balance","Sign to continue":"Sign to continue","Signatures ready":"Signatures ready",Signing:"Signing","Since this asset is frozen, the only available actions are withdraw and repay which can be accessed from the <0>Dashboard":"Since this asset is frozen, the only available actions are withdraw and repay which can be accessed from the <0>Dashboard","Since this is a test network, you can get any of the assets if you have ETH on your wallet":"Since this is a test network, you can get any of the assets if you have ETH on your wallet","Slippage is the difference between the quoted and received amounts from changing market conditions between the moment the transaction is submitted and its verification.":"Slippage is the difference between the quoted and received amounts from changing market conditions between the moment the transaction is submitted and its verification.","Some migrated assets will not be used as collateral due to enabled isolation mode in {marketName} V3 Market. Visit <0>{marketName} V3 Dashboard to manage isolation mode.":["Some migrated assets will not be used as collateral due to enabled isolation mode in ",["marketName"]," V3 Market. Visit <0>",["marketName"]," V3 Dashboard to manage isolation mode."],"Something went wrong":"Something went wrong","Sorry, an unexpected error happened. In the meantime you may try reloading the page, or come back later.":"Sorry, an unexpected error happened. In the meantime you may try reloading the page, or come back later.","Sorry, we couldn't find the page you were looking for.":"Sorry, we couldn't find the page you were looking for.",Spanish:"Spanish",Stable:"Stable","Stable Interest Type is disabled for this currency":"Stable Interest Type is disabled for this currency","Stable borrowing is enabled":"Stable borrowing is enabled","Stable borrowing is not enabled":"Stable borrowing is not enabled","Stable debt supply is not zero":"Stable debt supply is not zero","Stable interest rate will <0>stay the same for the duration of your loan. Recommended for long-term loan periods and for users who prefer predictability.":"Stable interest rate will <0>stay the same for the duration of your loan. Recommended for long-term loan periods and for users who prefer predictability.",Stablecoin:"Stablecoin",Stake:"Stake","Stake ZERO":"Stake ZERO","Stake ABPT":"Stake ABPT","Stake cooldown activated":"Stake cooldown activated",Staked:"Staked",Staking:"Staking","Staking APR":"Staking APR","Staking Rewards":"Staking Rewards","Staking balance":"Staking balance","Staking discount":"Staking discount",Started:"Started",State:"State","Static interest rate that is determined by ZeroLend Governance. This rate may be changed over time depending on the need for the GHO supply to contract/expand. <0>Learn more":"Static interest rate that is determined by ZeroLend Governance. This rate may be changed over time depending on the need for the GHO supply to contract/expand. <0>Learn more",Supplied:"Supplied","Supplied asset amount":"Supplied asset amount",Supply:"Supply","Supply APY":"Supply APY","Supply apy":"Supply apy","Supply balance":"Supply balance","Supply balance after switch":"Supply balance after switch","Supply cap is exceeded":"Supply cap is exceeded","Supply cap on target reserve reached. Try lowering the amount.":"Supply cap on target reserve reached. Try lowering the amount.","Supply {symbol}":["Supply ",["symbol"]],"Supplying your":"Supplying your","Supplying {symbol}":["Supplying ",["symbol"]],Switch:"Switch","Switch APY type":"Switch APY type","Switch E-Mode":"Switch E-Mode","Switch E-Mode category":"Switch E-Mode category","Switch Network":"Switch Network","Switch borrow position":"Switch borrow position","Switch rate":"Switch rate","Switch to":"Switch to",Switched:"Switched",Switching:"Switching","Switching E-Mode":"Switching E-Mode","Switching rate":"Switching rate",Techpaper:"Techpaper",Terms:"Terms","Test Assets":"Test Assets","Testnet mode":"Testnet mode","Testnet mode is ON":"Testnet mode is ON","Thank you for voting!!":"Thank you for voting!!","The % of your total borrowing power used. This is based on the amount of your collateral supplied and the total amount that you can borrow.":"The % of your total borrowing power used. This is based on the amount of your collateral supplied and the total amount that you can borrow.","The ZeroLend Balancer Pool Token (ABPT) is a liquidity pool token. You can receive ABPT by depositing a combination of ZERO + ETH in the Balancer liquidity pool. You can then stake your BPT in the Safety Module to secure the protocol and earn Safety Incentives.":"The ZeroLend Balancer Pool Token (ABPT) is a liquidity pool token. You can receive ABPT by depositing a combination of ZERO + ETH in the Balancer liquidity pool. You can then stake your BPT in the Safety Module to secure the protocol and earn Safety Incentives.","The ZeroLend Protocol is programmed to always use the price of 1 GHO = $1. This is different from using market pricing via oracles for other crypto assets. This creates stabilizing arbitrage opportunities when the price of GHO fluctuates.":"The ZeroLend Protocol is programmed to always use the price of 1 GHO = $1. This is different from using market pricing via oracles for other crypto assets. This creates stabilizing arbitrage opportunities when the price of GHO fluctuates.","The Maximum LTV ratio represents the maximum borrowing power of a specific collateral. For example, if a collateral has an LTV of 75%, the user can borrow up to 0.75 worth of ETH in the principal currency for every 1 ETH worth of collateral.":"The Maximum LTV ratio represents the maximum borrowing power of a specific collateral. For example, if a collateral has an LTV of 75%, the user can borrow up to 0.75 worth of ETH in the principal currency for every 1 ETH worth of collateral.","The Stable Rate is not enabled for this currency":"The Stable Rate is not enabled for this currency","The address of the pool addresses provider is invalid":"The address of the pool addresses provider is invalid","The app is running in testnet mode. Learn how it works in":"The app is running in testnet mode. Learn how it works in","The caller of the function is not an AToken":"The caller of the function is not an AToken","The caller of this function must be a pool":"The caller of this function must be a pool","The collateral balance is 0":"The collateral balance is 0","The collateral chosen cannot be liquidated":"The collateral chosen cannot be liquidated","The cooldown period is the time required prior to unstaking your tokens (20 days). You can only withdraw your assets from the Security Module after the cooldown period and within the unstake window.<0>Learn more":"The cooldown period is the time required prior to unstaking your tokens (20 days). You can only withdraw your assets from the Security Module after the cooldown period and within the unstake window.<0>Learn more","The cooldown period is {0}. After {1} of cooldown, you will enter unstake window of {2}. You will continue receiving rewards during cooldown and unstake window.":["The cooldown period is ",["0"],". After ",["1"]," of cooldown, you will enter unstake window of ",["2"],". You will continue receiving rewards during cooldown and unstake window."],"The effects on the health factor would cause liquidation. Try lowering the amount.":"The effects on the health factor would cause liquidation. Try lowering the amount.","The loan to value of the migrated positions would cause liquidation. Increase migrated collateral or reduce migrated borrow to continue.":"The loan to value of the migrated positions would cause liquidation. Increase migrated collateral or reduce migrated borrow to continue.","The requested amount is greater than the max loan size in stable rate mode":"The requested amount is greater than the max loan size in stable rate mode","The total amount of your assets denominated in USD that can be used as collateral for borrowing assets.":"The total amount of your assets denominated in USD that can be used as collateral for borrowing assets.","The underlying asset cannot be rescued":"The underlying asset cannot be rescued","The underlying balance needs to be greater than 0":"The underlying balance needs to be greater than 0","The weighted average of APY for all borrowed assets, including incentives.":"The weighted average of APY for all borrowed assets, including incentives.","The weighted average of APY for all supplied assets, including incentives.":"The weighted average of APY for all supplied assets, including incentives.","There are not enough funds in the{0}reserve to borrow":["There are not enough funds in the",["0"],"reserve to borrow"],"There is not enough collateral to cover a new borrow":"There is not enough collateral to cover a new borrow","There is not enough liquidity for the target asset to perform the switch. Try lowering the amount.":"There is not enough liquidity for the target asset to perform the switch. Try lowering the amount.","There was some error. Please try changing the parameters or <0><1>copy the error":"There was some error. Please try changing the parameters or <0><1>copy the error","These assets are temporarily frozen or paused by ZeroLend community decisions, meaning that further supply / borrow, or rate swap of these assets are unavailable. Withdrawals and debt repayments are allowed. Follow the <0>ZeroLend governance forum for further updates.":"These assets are temporarily frozen or paused by ZeroLend community decisions, meaning that further supply / borrow, or rate swap of these assets are unavailable. Withdrawals and debt repayments are allowed. Follow the <0>ZeroLend governance forum for further updates.","These funds have been borrowed and are not available for withdrawal at this time.":"These funds have been borrowed and are not available for withdrawal at this time.","This action will reduce V2 health factor below liquidation threshold. retain collateral or migrate borrow position to continue.":"This action will reduce V2 health factor below liquidation threshold. retain collateral or migrate borrow position to continue.","This action will reduce health factor of V3 below liquidation threshold. Increase migrated collateral or reduce migrated borrow to continue.":"This action will reduce health factor of V3 below liquidation threshold. Increase migrated collateral or reduce migrated borrow to continue.","This action will reduce your health factor. Please be mindful of the increased risk of collateral liquidation.":"This action will reduce your health factor. Please be mindful of the increased risk of collateral liquidation.","This address is blocked on app.zerolend.xyz because it is associated with one or more":"This address is blocked on app.zerolend.xyz because it is associated with one or more","This asset has almost reached its borrow cap. There is only {messageValue} available to be borrowed from this market.":["This asset has almost reached its borrow cap. There is only ",["messageValue"]," available to be borrowed from this market."],"This asset has almost reached its supply cap. There can only be {messageValue} supplied to this market.":["This asset has almost reached its supply cap. There can only be ",["messageValue"]," supplied to this market."],"This asset has reached its borrow cap. Nothing is available to be borrowed from this market.":"This asset has reached its borrow cap. Nothing is available to be borrowed from this market.","This asset has reached its supply cap. Nothing is available to be supplied from this market.":"This asset has reached its supply cap. Nothing is available to be supplied from this market.","This asset is frozen due to an ZeroLend Protocol Governance decision. <0>More details":"This asset is frozen due to an ZeroLend Protocol Governance decision. <0>More details","This asset is frozen due to an ZeroLend Protocol Governance decision. On the 20th of December 2022, renFIL will no longer be supported and cannot be bridged back to its native network. It is recommended to withdraw supply positions and repay borrow positions so that renFIL can be bridged back to FIL before the deadline. After this date, it will no longer be possible to convert renFIL to FIL. <0>More details":"This asset is frozen due to an ZeroLend Protocol Governance decision. On the 20th of December 2022, renFIL will no longer be supported and cannot be bridged back to its native network. It is recommended to withdraw supply positions and repay borrow positions so that renFIL can be bridged back to FIL before the deadline. After this date, it will no longer be possible to convert renFIL to FIL. <0>More details","This asset is frozen due to an ZeroLend community decision. <0>More details":"This asset is frozen due to an ZeroLend community decision. <0>More details","This asset is planned to be offboarded due to an ZeroLend Protocol Governance decision. <0>More details":"This asset is planned to be offboarded due to an ZeroLend Protocol Governance decision. <0>More details","This gas calculation is only an estimation. Your wallet will set the price of the transaction. You can modify the gas settings directly from your wallet provider.":"This gas calculation is only an estimation. Your wallet will set the price of the transaction. You can modify the gas settings directly from your wallet provider.","This integration was<0>proposed and approvedby the community.":"This integration was<0>proposed and approvedby the community.","This is the total amount available for you to borrow. You can borrow based on your collateral and until the borrow cap is reached.":"This is the total amount available for you to borrow. You can borrow based on your collateral and until the borrow cap is reached.","This is the total amount that you are able to supply to in this reserve. You are able to supply your wallet balance up until the supply cap is reached.":"This is the total amount that you are able to supply to in this reserve. You are able to supply your wallet balance up until the supply cap is reached.","This represents the threshold at which a borrow position will be considered undercollateralized and subject to liquidation for each collateral. For example, if a collateral has a liquidation threshold of 80%, it means that the position will be liquidated when the debt value is worth 80% of the collateral value.":"This represents the threshold at which a borrow position will be considered undercollateralized and subject to liquidation for each collateral. For example, if a collateral has a liquidation threshold of 80%, it means that the position will be liquidated when the debt value is worth 80% of the collateral value.","Time left to be able to withdraw your staked asset.":"Time left to be able to withdraw your staked asset.","Time left to unstake":"Time left to unstake","Time left until the withdrawal window closes.":"Time left until the withdrawal window closes.","Tip: Try increasing slippage or reduce input amount":"Tip: Try increasing slippage or reduce input amount","To borrow you need to supply any asset to be used as collateral.":"To borrow you need to supply any asset to be used as collateral.","To continue, you need to grant ZeroLend smart contracts permission to move your funds from your wallet. Depending on the asset and wallet you use, it is done by signing the permission message (gas free), or by submitting an approval transaction (requires gas). <0>Learn more":"To continue, you need to grant ZeroLend smart contracts permission to move your funds from your wallet. Depending on the asset and wallet you use, it is done by signing the permission message (gas free), or by submitting an approval transaction (requires gas). <0>Learn more","To enable E-mode for the {0} category, all borrow positions outside of this category must be closed.":["To enable E-mode for the ",["0"]," category, all borrow positions outside of this category must be closed."],"To repay on behalf of a user an explicit amount to repay is needed":"To repay on behalf of a user an explicit amount to repay is needed","To request access for this permissioned market, please visit: <0>Acces Provider Name":"To request access for this permissioned market, please visit: <0>Acces Provider Name","To submit a proposal for minor changes to the protocol, you'll need at least 80.00K power. If you want to change the core code base, you'll need 320k power.<0>Learn more.":"To submit a proposal for minor changes to the protocol, you'll need at least 80.00K power. If you want to change the core code base, you'll need 320k power.<0>Learn more.","Top 10 addresses":"Top 10 addresses","Total available":"Total available","Total borrowed":"Total borrowed","Total borrows":"Total borrows","Total emission per day":"Total emission per day","Total interest accrued":"Total interest accrued","Total market size":"Total market size","Total supplied":"Total supplied","Total voting power":"Total voting power","Total worth":"Total worth","Track wallet":"Track wallet","Track wallet balance in read-only mode":"Track wallet balance in read-only mode","Transaction failed":"Transaction failed","Transaction history":"Transaction history","Transaction history is not currently available for this market":"Transaction history is not currently available for this market","Transaction overview":"Transaction overview",Transactions:"Transactions","UNSTAKE {symbol}":["UNSTAKE ",["symbol"]],Unavailable:"Unavailable",Unbacked:"Unbacked","Unbacked mint cap is exceeded":"Unbacked mint cap is exceeded","Underlying asset does not exist in {marketName} v3 Market, hence this position cannot be migrated.":["Underlying asset does not exist in ",["marketName"]," v3 Market, hence this position cannot be migrated."],"Underlying token":"Underlying token","Unstake now":"Unstake now","Unstake window":"Unstake window",Unstaked:"Unstaked","Unstaking {symbol}":["Unstaking ",["symbol"]],"Update: Disruptions reported for WETH, WBTC, WMATIC, and USDT. AIP 230 will resolve the disruptions and the market will be operating as normal on ~26th May 13h00 UTC.":"Update: Disruptions reported for WETH, WBTC, WMATIC, and USDT. AIP 230 will resolve the disruptions and the market will be operating as normal on ~26th May 13h00 UTC.","Use it to vote for or against active proposals.":"Use it to vote for or against active proposals.","Use your ZERO and stkZERO balance to delegate your voting and proposition powers. You will not be sending any tokens, only the rights to vote and propose changes to the protocol. You can re-delegate or revoke power to self at any time.":"Use your ZERO and stkZERO balance to delegate your voting and proposition powers. You will not be sending any tokens, only the rights to vote and propose changes to the protocol. You can re-delegate or revoke power to self at any time.","Used as collateral":"Used as collateral","User cannot withdraw more than the available balance":"User cannot withdraw more than the available balance","User did not borrow the specified currency":"User did not borrow the specified currency","User does not have outstanding stable rate debt on this reserve":"User does not have outstanding stable rate debt on this reserve","User does not have outstanding variable rate debt on this reserve":"User does not have outstanding variable rate debt on this reserve","User is in isolation mode":"User is in isolation mode","User is trying to borrow multiple assets including a siloed one":"User is trying to borrow multiple assets including a siloed one","Users who stake ZERO in Safety Module (i.e. stkZERO holders) receive a discount on GHO borrow interest rate. The discount applies to 100 GHO for every 1 stkZERO held. Use the calculator below to see GHO borrow rate with the discount applied.":"Users who stake ZERO in Safety Module (i.e. stkZERO holders) receive a discount on GHO borrow interest rate. The discount applies to 100 GHO for every 1 stkZERO held. Use the calculator below to see GHO borrow rate with the discount applied.","Utilization Rate":"Utilization Rate","VIEW TX":"VIEW TX","VOTE NAY":"VOTE NAY","VOTE YAE":"VOTE YAE",Variable:"Variable","Variable debt supply is not zero":"Variable debt supply is not zero","Variable interest rate will <0>fluctuate based on the market conditions. Recommended for short-term positions.":"Variable interest rate will <0>fluctuate based on the market conditions. Recommended for short-term positions.","Version 2":"Version 2","Version 3":"Version 3",View:"View","View all votes":"View all votes","View contract":"View contract","View details":"View details","View on Explorer":"View on Explorer","Vote NAY":"Vote NAY","Vote YAE":"Vote YAE","Voted NAY":"Voted NAY","Voted YAE":"Voted YAE",Votes:"Votes",Voting:"Voting","Voting power":"Voting power","Voting results":"Voting results","Wallet Balance":"Wallet Balance","Wallet balance":"Wallet balance","Wallet not detected. Connect or install wallet and retry":"Wallet not detected. Connect or install wallet and retry","Wallets are provided by External Providers and by selecting you agree to Terms of those Providers. Your access to the wallet might be reliant on the External Provider being operational.":"Wallets are provided by External Providers and by selecting you agree to Terms of those Providers. Your access to the wallet might be reliant on the External Provider being operational.","We couldn't find any assets related to your search. Try again with a different asset name, symbol, or address.":"We couldn't find any assets related to your search. Try again with a different asset name, symbol, or address.","We couldn't find any transactions related to your search. Try again with a different asset name, or reset filters.":"We couldn't find any transactions related to your search. Try again with a different asset name, or reset filters.","We couldn\u2019t detect a wallet. Connect a wallet to stake and view your balance.":"We couldn\u2019t detect a wallet. Connect a wallet to stake and view your balance.","We suggest you go back to the Dashboard.":"We suggest you go back to the Dashboard.",Website:"Website","When a liquidation occurs, liquidators repay up to 50% of the outstanding borrowed amount on behalf of the borrower. In return, they can buy the collateral at a discount and keep the difference (liquidation penalty) as a bonus.":"When a liquidation occurs, liquidators repay up to 50% of the outstanding borrowed amount on behalf of the borrower. In return, they can buy the collateral at a discount and keep the difference (liquidation penalty) as a bonus.","With a voting power of <0/>":"With a voting power of <0/>","With testnet Faucet you can get free assets to test the ZeroLend Protocol. Make sure to switch your wallet provider to the appropriate testnet network, select desired asset, and click \u2018Faucet\u2019 to get tokens transferred to your wallet. The assets on a testnet are not \u201creal,\u201d meaning they have no monetary value. <0>Learn more":"With testnet Faucet you can get free assets to test the ZeroLend Protocol. Make sure to switch your wallet provider to the appropriate testnet network, select desired asset, and click \u2018Faucet\u2019 to get tokens transferred to your wallet. The assets on a testnet are not \u201creal,\u201d meaning they have no monetary value. <0>Learn more",Withdraw:"Withdraw","Withdraw {symbol}":["Withdraw ",["symbol"]],"Withdrawing this amount will reduce your health factor and increase risk of liquidation.":"Withdrawing this amount will reduce your health factor and increase risk of liquidation.","Withdrawing {symbol}":["Withdrawing ",["symbol"]],"Wrong Network":"Wrong Network",YAE:"YAE","You are entering Isolation mode":"You are entering Isolation mode","You can borrow this asset with a stable rate only if you borrow more than the amount you are supplying as collateral.":"You can borrow this asset with a stable rate only if you borrow more than the amount you are supplying as collateral.","You can not change Interest Type to stable as your borrowings are higher than your collateral":"You can not change Interest Type to stable as your borrowings are higher than your collateral","You can not disable E-Mode as your current collateralization level is above 80%, disabling E-Mode can cause liquidation. To exit E-Mode supply or repay borrowed positions.":"You can not disable E-Mode as your current collateralization level is above 80%, disabling E-Mode can cause liquidation. To exit E-Mode supply or repay borrowed positions.","You can not switch usage as collateral mode for this currency, because it will cause collateral call":"You can not switch usage as collateral mode for this currency, because it will cause collateral call","You can not use this currency as collateral":"You can not use this currency as collateral","You can not withdraw this amount because it will cause collateral call":"You can not withdraw this amount because it will cause collateral call","You can only switch to tokens with variable APY types. After this transaction, you may change the variable rate to a stable one if available.":"You can only switch to tokens with variable APY types. After this transaction, you may change the variable rate to a stable one if available.","You can only withdraw your assets from the Security Module after the cooldown period ends and the unstake window is active.":"You can only withdraw your assets from the Security Module after the cooldown period ends and the unstake window is active.","You can report incident to our <0>Discord or <1>Github.":"You can report incident to our <0>Discord or <1>Github.","You cancelled the transaction.":"You cancelled the transaction.","You did not participate in this proposal":"You did not participate in this proposal","You do not have supplies in this currency":"You do not have supplies in this currency","You don\u2019t have enough funds in your wallet to repay the full amount. If you proceed to repay with your current amount of funds, you will still have a small borrowing position in your dashboard.":"You don\u2019t have enough funds in your wallet to repay the full amount. If you proceed to repay with your current amount of funds, you will still have a small borrowing position in your dashboard.","You have no ZERO/stkZERO balance to delegate.":"You have no ZERO/stkZERO balance to delegate.","You have not borrow yet using this currency":"You have not borrow yet using this currency","You may borrow up to <0/> GHO at <1/> (max discount)":"You may borrow up to <0/> GHO at <1/> (max discount)","You may enter a custom amount in the field.":"You may enter a custom amount in the field.","You switched to {0} rate":["You switched to ",["0"]," rate"],"You unstake here":"You unstake here","You voted {0}":["You voted ",["0"]],"You will exit isolation mode and other tokens can now be used as collateral":"You will exit isolation mode and other tokens can now be used as collateral","You {action} <0/> {symbol}":["You ",["action"]," <0/> ",["symbol"]],"You've successfully switched borrow position.":"You've successfully switched borrow position.","Your borrows":"Your borrows","Your current loan to value based on your collateral supplied.":"Your current loan to value based on your collateral supplied.","Your health factor and loan to value determine the assurance of your collateral. To avoid liquidations you can supply more collateral or repay borrow positions.":"Your health factor and loan to value determine the assurance of your collateral. To avoid liquidations you can supply more collateral or repay borrow positions.","Your info":"Your info","Your proposition power is based on your ZERO/stkZERO balance and received delegations.":"Your proposition power is based on your ZERO/stkZERO balance and received delegations.","Your reward balance is 0":"Your reward balance is 0","Your supplies":"Your supplies","Your voting info":"Your voting info","Your voting power is based on your ZERO/stkZERO balance and received delegations.":"Your voting power is based on your ZERO/stkZERO balance and received delegations.","Your {name} wallet is empty. Purchase or transfer assets or use <0>{0} to transfer your {network} assets.":["Your ",["name"]," wallet is empty. Purchase or transfer assets or use <0>",["0"]," to transfer your ",["network"]," assets."],"Your {name} wallet is empty. Purchase or transfer assets.":["Your ",["name"]," wallet is empty. Purchase or transfer assets."],"Your {networkName} wallet is empty. Get free test assets at":["Your ",["networkName"]," wallet is empty. Get free test assets at"],"Your {networkName} wallet is empty. Get free test {0} at":["Your ",["networkName"]," wallet is empty. Get free test ",["0"]," at"],"Zero address not valid":"Zero address not valid",assets:"assets","blocked activities":"blocked activities","copy the error":"copy the error",disabled:"disabled",documentation:"documentation",enabled:"enabled",ends:"ends",for:"for",of:"of",on:"on","please check that the amount you want to supply is not currently being used for staking. If it is being used for staking, your transaction might fail.":"please check that the amount you want to supply is not currently being used for staking. If it is being used for staking, your transaction might fail.",repaid:"repaid","stETH supplied as collateral will continue to accrue staking rewards provided by daily rebases.":"stETH supplied as collateral will continue to accrue staking rewards provided by daily rebases.","stETH tokens will be migrated to Wrapped stETH using Lido Protocol wrapper which leads to supply balance change after migration: {0}":["stETH tokens will be migrated to Wrapped stETH using Lido Protocol wrapper which leads to supply balance change after migration: ",["0"]],"staking view":"staking view",starts:"starts","stkZERO holders get a discount on GHO borrow rate":"stkZERO holders get a discount on GHO borrow rate",to:"to","tokens is not the same as staking them. If you wish to stake your":"tokens is not the same as staking them. If you wish to stake your","tokens, please go to the":"tokens, please go to the","will receive":"will receive",withdrew:"withdrew","{0}":[["0"]],"{0} Balance":[["0"]," Balance"],"{0} Faucet":[["0"]," Faucet"],"{0} on-ramp service is provided by External Provider and by selecting you agree to Terms of the Provider. Your access to the service might be reliant on the External Provider being operational.":[["0"]," on-ramp service is provided by External Provider and by selecting you agree to Terms of the Provider. Your access to the service might be reliant on the External Provider being operational."],"{0}{name}":[["0"],["name"]],"{currentMethod}":[["currentMethod"]],"{d}d":[["d"],"d"],"{h}h":[["h"],"h"],"{m}m":[["m"],"m"],"{networkName} Faucet":[["networkName"]," Faucet"],"{notifyText}":[["notifyText"]],"{numSelected}/{numAvailable} assets selected":[["numSelected"],"/",["numAvailable"]," assets selected"],"{s}s":[["s"],"s"],"{title}":[["title"]],"{tooltipText}":[["tooltipText"]]}}},87940:function(e,t,n){"use strict";n.d(t,{K:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[{internalType:"address",name:"target",type:"address"}],name:"AddressEmptyCode",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"AddressInsufficientBalance",type:"error"},{inputs:[],name:"FailedInnerCall",type:"error"},{inputs:[],name:"InvalidAddress",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"InvalidLockDuration",type:"error"},{inputs:[{internalType:"bytes32[]",name:"",type:"bytes32[]"}],name:"InvalidMerkleProof",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"RewardsAlreadyClaimed",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"SafeERC20FailedOperation",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldLocker",type:"address"},{indexed:!1,internalType:"address",name:"newLocker",type:"address"}],name:"LockerSet",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"oldMerkleRoot",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"newMerkleRoot",type:"bytes32"}],name:"MerkleRootSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[],name:"RewardTerminated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRewardToken",type:"address"},{indexed:!1,internalType:"address",name:"newRewardToken",type:"address"}],name:"RewardTokenSet",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"_user",type:"address"},{indexed:!1,internalType:"uint256",name:"_rewardsAmount",type:"uint256"}],name:"RewardsClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"_user",type:"address"},{indexed:!1,internalType:"uint256",name:"_lockAmount",type:"uint256"}],name:"RewardsLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"_user",type:"address"},{indexed:!1,internalType:"uint256",name:"_transferAmount",type:"uint256"}],name:"RewardsTransferred",type:"event"},{inputs:[],name:"adminWithdrawal",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_user",type:"address"},{internalType:"uint256",name:"_claimAmount",type:"uint256"},{internalType:"bytes32[]",name:"_merkleProofs",type:"bytes32[]"},{internalType:"bool",name:"_lockAndStake",type:"bool"},{internalType:"uint256",name:"lockUntil",type:"uint256"}],name:"claim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_rewardToken",type:"address"},{internalType:"address",name:"_locker",type:"address"},{internalType:"address",name:"_vestedZeroNFT",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"locker",outputs:[{internalType:"contract IZeroLocker",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rewardToken",outputs:[{internalType:"contract ERC20Upgradeable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"rewardsClaimed",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_locker",type:"address"}],name:"setLocker",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"_merkleRoot",type:"bytes32"}],name:"setMerkleRoot",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_rewardToken",type:"address"}],name:"setRewardToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_locker",type:"address"}],name:"setVestedZeroNFT",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"vestedZeroNFT",outputs:[{internalType:"contract IVestedZeroNFT",name:"",type:"address"}],stateMutability:"view",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"getUserClaimed",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.rewardsClaimed(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setClaimReward",value:function(){var e=(0,r.Z)(c().mark((function e(t,n,r,i,o){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.claim(t,n,r,i,o);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,o){return e.apply(this,arguments)}}()}]),e}(),b=function(){function e(t,n,r){(0,i.Z)(this,e),this.chainId=r,(0,s.Z)(this,"airdropDataService",void 0),this.airdropDataService=new y({uiStakeDataProvider:n,provider:t})}return(0,o.Z)(e,[{key:"getUserRewardClaimed",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.airdropDataService.getUserClaimed(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setClaimRewards",value:function(){var e=(0,r.Z)(c().mark((function e(t){var n,r,i,o,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.user,r=t.claimAmount,i=t.merkleProofs,o=t.stakeNFT,s=t.lockUntil,e.next=3,this.airdropDataService.setClaimReward(n,r,i,o,s);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}()},21380:function(e,t,n){"use strict";n.d(t,{s:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[],name:"ERC721EnumerableForbiddenBatchMint",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"owner",type:"address"}],name:"ERC721IncorrectOwner",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC721InsufficientApproval",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC721InvalidApprover",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC721InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"ERC721InvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC721InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC721InvalidSender",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC721NonexistentToken",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"ERC721OutOfBoundsIndex",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"provider",type:"address"},{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!0,internalType:"uint256",name:"locktime",type:"uint256"},{indexed:!1,internalType:"enum IZeroLocker.DepositType",name:"deposit_type",type:"uint8"},{indexed:!1,internalType:"uint256",name:"ts",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"prevSupply",type:"uint256"},{indexed:!1,internalType:"uint256",name:"supply",type:"uint256"}],name:"Supply",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"provider",type:"address"},{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!1,internalType:"uint256",name:"ts",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"balanceOfNFT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_value",type:"uint256"},{internalType:"uint256",name:"_lockDuration",type:"uint256"},{internalType:"bool",name:"_stakeNFT",type:"bool"}],name:"createLock",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_value",type:"uint256"},{internalType:"uint256",name:"_lockDuration",type:"uint256"},{internalType:"address",name:"_to",type:"address"},{internalType:"bool",name:"_stakeNFT",type:"bool"}],name:"createLockFor",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"},{internalType:"uint256",name:"_value",type:"uint256"}],name:"depositFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"},{internalType:"uint256",name:"_value",type:"uint256"}],name:"increaseAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"},{internalType:"uint256",name:"_lockDuration",type:"uint256"}],name:"increaseUnlockTime",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"address",name:"_staking",type:"address"},{internalType:"address",name:"_stakingBonus",type:"address"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"locked",outputs:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"power",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"lockedEnd",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_from",type:"uint256"},{internalType:"uint256",name:"_to",type:"uint256"}],name:"merge",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"staking",outputs:[{internalType:"contract IOmnichainStaking",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"supply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"_interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"underlying",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_owner",type:"address"}],name:"votingPowerOf",outputs:[{internalType:"uint256",name:"_power",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"getUserLockBalance",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.balanceOf(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"generateNFTAllowance",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getApproved(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setCreateLock",value:function(){var e=(0,r.Z)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.createLock(t,n,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"setWithdrawLock",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.withdraw(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setApproveNFT",value:function(){var e=(0,r.Z)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.approve(t,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setStakeNFT",value:function(){var e=(0,r.Z)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction["safeTransferFrom(address,address,uint256)"](t,n,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()}]),e}(),b=function(){function e(t,n,r){(0,i.Z)(this,e),this.chainId=r,(0,s.Z)(this,"lockDataService",void 0),this.lockDataService=new y({uiStakeDataProvider:n,provider:t})}return(0,o.Z)(e,[{key:"setGeneralCreateLock",value:function(){var e=(0,r.Z)(c().mark((function e(t){var n,r,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.amount,r=t.duration,i=t.stakeNFT,e.abrupt("return",this.lockDataService.setCreateLock(n,r,i));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setGeneralWithdrawLock",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.lockDataService.setWithdrawLock(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getNFTAllowance",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.lockDataService.generateNFTAllowance(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setNFTApproval",value:function(){var e=(0,r.Z)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.lockDataService.setApproveNFT(t,n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setStakeNFT",value:function(){var e=(0,r.Z)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.lockDataService.setStakeNFT(t,n,r));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}()},59027:function(e,t,n){"use strict";n.d(t,{T:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[],name:"CheckpointUnorderedInsertion",type:"error"},{inputs:[],name:"ECDSAInvalidSignature",type:"error"},{inputs:[{internalType:"uint256",name:"length",type:"uint256"}],name:"ECDSAInvalidSignatureLength",type:"error"},{inputs:[{internalType:"bytes32",name:"s",type:"bytes32"}],name:"ECDSAInvalidSignatureS",type:"error"},{inputs:[{internalType:"uint256",name:"increasedSupply",type:"uint256"},{internalType:"uint256",name:"cap",type:"uint256"}],name:"ERC20ExceededSafeSupply",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"allowance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientAllowance",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC20InvalidApprover",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC20InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC20InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"}],name:"ERC20InvalidSpender",type:"error"},{inputs:[{internalType:"uint256",name:"timepoint",type:"uint256"},{internalType:"uint48",name:"clock",type:"uint48"}],name:"ERC5805FutureLookup",type:"error"},{inputs:[],name:"ERC6372InconsistentClock",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"currentNonce",type:"uint256"}],name:"InvalidAccountNonce",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"InvalidUnstaker",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{internalType:"uint8",name:"bits",type:"uint8"},{internalType:"uint256",name:"value",type:"uint256"}],name:"SafeCastOverflowedUintDowncast",type:"error"},{inputs:[{internalType:"uint256",name:"expiry",type:"uint256"}],name:"VotesExpiredSignature",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegator",type:"address"},{indexed:!0,internalType:"address",name:"fromDelegate",type:"address"},{indexed:!0,internalType:"address",name:"toDelegate",type:"address"}],name:"DelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!1,internalType:"uint256",name:"previousVotes",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newVotes",type:"uint256"}],name:"DelegateVotesChanged",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldLpOracle",type:"address"},{indexed:!0,internalType:"address",name:"newLpOracle",type:"address"}],name:"LpOracleSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"token",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Recovered",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardPaid",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newDuration",type:"uint256"}],name:"RewardsDurationUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousToken",type:"address"},{indexed:!1,internalType:"address",name:"_zeroToken",type:"address"}],name:"RewardsTokenUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousLocker",type:"address"},{indexed:!1,internalType:"address",name:"_tokenLocker",type:"address"}],name:"TokenLockerUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousVotingPowerCombined",type:"address"},{indexed:!1,internalType:"address",name:"_votingPowerCombined",type:"address"}],name:"VotingPowerCombinedUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldZeroAggregator",type:"address"},{indexed:!0,internalType:"address",name:"newZeroAggregator",type:"address"}],name:"ZeroAggregatorSet",type:"event"},{inputs:[],name:"CLOCK_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"__",outputs:[{internalType:"contract ILocker",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint32",name:"pos",type:"uint32"}],name:"checkpoints",outputs:[{components:[{internalType:"uint48",name:"_key",type:"uint48"},{internalType:"uint208",name:"_value",type:"uint208"}],internalType:"struct Checkpoints.Checkpoint208",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"clock",outputs:[{internalType:"uint48",name:"",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"}],name:"delegate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"delegates",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"distributor",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"earned",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_user",type:"address"}],name:"getLockedNftDetails",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"power",type:"uint256"}],internalType:"struct ILocker.LockedBalance[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"timepoint",type:"uint256"}],name:"getPastTotalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"timepoint",type:"uint256"}],name:"getPastVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getReward",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getRewardETH",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"getTokenPower",outputs:[{internalType:"uint256",name:"power",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"newLockAmount",type:"uint256"}],name:"increaseLockAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"newLockDuration",type:"uint256"}],name:"increaseLockDuration",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_locker",type:"address"},{internalType:"address",name:"_zeroToken",type:"address"},{internalType:"address",name:"_poolVoter",type:"address"},{internalType:"uint256",name:"_rewardsDuration",type:"uint256"},{internalType:"address",name:"_owner",type:"address"},{internalType:"address",name:"_distributor",type:"address"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"who",type:"address[]"}],name:"initDelegates",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"lastTimeRewardApplicable",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"lastUpdateTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"lockedByToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"lockedTokenIdNfts",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"locker",outputs:[{internalType:"contract ILocker",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"lpPower",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"reward",type:"uint256"}],name:"notifyRewardAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"numCheckpoints",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"periodFinish",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"uint256",name:"tokenAmount",type:"uint256"}],name:"recoverERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rewardPerToken",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardPerTokenStored",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardRate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"rewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardsDuration",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardsToken",outputs:[{internalType:"contract IZeroLend",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"what",type:"address"}],name:"setRewardDistributor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"what",type:"address"}],name:"setVotingPowerCombined",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokenPower",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"who",type:"address"}],name:"totalNFTStaked",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeAndWithdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"updateRewardFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"userRewardPerTokenPaid",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPowerCombined",outputs:[{internalType:"contract IVotingPowerCombined",name:"",type:"address"}],stateMutability:"view",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"unStakeandWithdraw",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.unstakeAndWithdraw(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRewardRate",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.rewardRate();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getBalanceOf",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.balanceOf(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getTotalSupply",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.totalSupply();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getEarnedValue",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.earned(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRewardETH",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.getRewardETH();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getStakedSupply",value:function(){var e=(0,r.Z)(c().mark((function e(t){var n,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getBalanceOf(t);case 2:return n=e.sent,e.next=5,this.getTotalSupply();case 5:return r=e.sent,e.abrupt("return",n.mul(1e8).div(r));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),b=function(){function e(t,n,r){(0,i.Z)(this,e),this.chainId=r,(0,s.Z)(this,"omniLPStakingDataService",void 0),this.omniLPStakingDataService=new y({uiStakeDataProvider:n,provider:t})}return(0,o.Z)(e,[{key:"setUnstakeandWithdraw",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.unStakeandWithdraw(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRewardRate",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getRewardRate();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTotalSupply",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getTotalSupply();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getEarnedValue",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getEarnedValue(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"claimReward",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getRewardETH();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}},{key:"claimRewardETH",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getRewardETH();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getVotingPower",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getBalanceOf(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getStakedSupply",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniLPStakingDataService.getStakedSupply(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}()},67724:function(e,t,n){"use strict";n.d(t,{y:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[],name:"CheckpointUnorderedInsertion",type:"error"},{inputs:[],name:"ECDSAInvalidSignature",type:"error"},{inputs:[{internalType:"uint256",name:"length",type:"uint256"}],name:"ECDSAInvalidSignatureLength",type:"error"},{inputs:[{internalType:"bytes32",name:"s",type:"bytes32"}],name:"ECDSAInvalidSignatureS",type:"error"},{inputs:[{internalType:"uint256",name:"increasedSupply",type:"uint256"},{internalType:"uint256",name:"cap",type:"uint256"}],name:"ERC20ExceededSafeSupply",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"allowance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientAllowance",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC20InvalidApprover",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC20InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC20InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"}],name:"ERC20InvalidSpender",type:"error"},{inputs:[{internalType:"uint256",name:"timepoint",type:"uint256"},{internalType:"uint48",name:"clock",type:"uint48"}],name:"ERC5805FutureLookup",type:"error"},{inputs:[],name:"ERC6372InconsistentClock",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"currentNonce",type:"uint256"}],name:"InvalidAccountNonce",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"InvalidUnstaker",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{internalType:"uint8",name:"bits",type:"uint8"},{internalType:"uint256",name:"value",type:"uint256"}],name:"SafeCastOverflowedUintDowncast",type:"error"},{inputs:[{internalType:"uint256",name:"expiry",type:"uint256"}],name:"VotesExpiredSignature",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegator",type:"address"},{indexed:!0,internalType:"address",name:"fromDelegate",type:"address"},{indexed:!0,internalType:"address",name:"toDelegate",type:"address"}],name:"DelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!1,internalType:"uint256",name:"previousVotes",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newVotes",type:"uint256"}],name:"DelegateVotesChanged",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldLpOracle",type:"address"},{indexed:!0,internalType:"address",name:"newLpOracle",type:"address"}],name:"LpOracleSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"token",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Recovered",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardPaid",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newDuration",type:"uint256"}],name:"RewardsDurationUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousToken",type:"address"},{indexed:!1,internalType:"address",name:"_zeroToken",type:"address"}],name:"RewardsTokenUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousLocker",type:"address"},{indexed:!1,internalType:"address",name:"_tokenLocker",type:"address"}],name:"TokenLockerUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousVotingPowerCombined",type:"address"},{indexed:!1,internalType:"address",name:"_votingPowerCombined",type:"address"}],name:"VotingPowerCombinedUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldZeroAggregator",type:"address"},{indexed:!0,internalType:"address",name:"newZeroAggregator",type:"address"}],name:"ZeroAggregatorSet",type:"event"},{inputs:[],name:"CLOCK_MODE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"__",outputs:[{internalType:"contract ILocker",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint32",name:"pos",type:"uint32"}],name:"checkpoints",outputs:[{components:[{internalType:"uint48",name:"_key",type:"uint48"},{internalType:"uint208",name:"_value",type:"uint208"}],internalType:"struct Checkpoints.Checkpoint208",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"clock",outputs:[{internalType:"uint48",name:"",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"}],name:"delegate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"delegates",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"distributor",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"earned",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_user",type:"address"}],name:"getLockedNftDetails",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"power",type:"uint256"}],internalType:"struct ILocker.LockedBalance[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"timepoint",type:"uint256"}],name:"getPastTotalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"timepoint",type:"uint256"}],name:"getPastVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getReward",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getRewardETH",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"getTokenPower",outputs:[{internalType:"uint256",name:"power",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getVotes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"newLockAmount",type:"uint256"}],name:"increaseLockAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"newLockDuration",type:"uint256"}],name:"increaseLockDuration",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_locker",type:"address"},{internalType:"address",name:"_zeroToken",type:"address"},{internalType:"address",name:"_poolVoter",type:"address"},{internalType:"uint256",name:"_rewardsDuration",type:"uint256"},{internalType:"address",name:"_owner",type:"address"},{internalType:"address",name:"_distributor",type:"address"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"who",type:"address[]"}],name:"initDelegates",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"lastTimeRewardApplicable",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"lastUpdateTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"lockedByToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"lockedTokenIdNfts",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"locker",outputs:[{internalType:"contract ILocker",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"lpPower",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"reward",type:"uint256"}],name:"notifyRewardAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"numCheckpoints",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"periodFinish",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"uint256",name:"tokenAmount",type:"uint256"}],name:"recoverERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rewardPerToken",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardPerTokenStored",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardRate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"rewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardsDuration",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardsToken",outputs:[{internalType:"contract IZeroLend",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"what",type:"address"}],name:"setRewardDistributor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"what",type:"address"}],name:"setVotingPowerCombined",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokenPower",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"who",type:"address"}],name:"totalNFTStaked",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeAndWithdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"updateRewardFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"userRewardPerTokenPaid",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"votingPowerCombined",outputs:[{internalType:"contract IVotingPowerCombined",name:"",type:"address"}],stateMutability:"view",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"getRewardRate",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.rewardRate();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTotalSupply",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.totalSupply();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getBalanceOf",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.balanceOf(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unStake",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.unstakeToken(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unStakeandWithdraw",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.unstakeAndWithdraw(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getEarnedValue",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.earned(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getReward",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.getReward();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRewardETH",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.populateTransaction.getRewardETH();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getStakedSupply",value:function(){var e=(0,r.Z)(c().mark((function e(t){var n,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getBalanceOf(t);case 2:return n=e.sent,e.next=5,this.getTotalSupply();case 5:return r=e.sent,e.abrupt("return",n.mul(1e8).div(r));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),b=function(){function e(t,n,r){(0,i.Z)(this,e),this.chainId=r,(0,s.Z)(this,"omniStakingDataService",void 0),this.omniStakingDataService=new y({uiStakeDataProvider:n,provider:t})}return(0,o.Z)(e,[{key:"getRewardRate",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getRewardRate();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTotalSupply",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getTotalSupply();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setUnstakeNFT",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.unStake(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setUnstakeandWithdraw",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.unStakeandWithdraw(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getEarnedValue",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getEarnedValue(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"claimReward",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getReward();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getVotingPower",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getBalanceOf(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getStakedSupply",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.omniStakingDataService.getStakedSupply(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}()},16649:function(e,t,n){"use strict";n.d(t,{w:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[{internalType:"int256",name:"_answer",type:"int256"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"pure",type:"function"},{inputs:[],name:"latestAnswer",outputs:[{internalType:"int256",name:"",type:"int256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int256",name:"_answer",type:"int256"}],name:"setAnswer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"getLatestAnswer",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.latestAnswer();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),b=function(){function e(t,n,r){(0,i.Z)(this,e),this.chainId=r,(0,s.Z)(this,"oracleDataService",void 0),this.oracleDataService=new y({uiStakeDataProvider:n,provider:t})}return(0,o.Z)(e,[{key:"getLatestAnswer",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.oracleDataService.getLatestAnswer();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}()},3408:function(e,t,n){"use strict";n.d(t,{n:function(){return b}});var r=n(50029),i=n(92777),o=n(82262),s=n(59499),a=n(87794),c=n.n(a),u=n(74450),l=n(81531),d=n(63553),f=n(37247),p=n(11466);function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var m=function(e){(0,l.Z)(n,e);var t=h(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"connect",value:function(e){return(0,u.Z)((0,f.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new p.CH(e,g,t)}}]),n}(p.CH),g=[{inputs:[{internalType:"address",name:"target",type:"address"}],name:"AddressEmptyCode",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"AddressInsufficientBalance",type:"error"},{inputs:[],name:"FailedInnerCall",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"SafeERC20FailedOperation",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"bribes",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"claimable",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"_gauges",type:"address[]"}],name:"distribute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_gauge",type:"address"}],name:"distribute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"finish",type:"uint256"}],name:"distribute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"distribute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"gauges",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getPoolWeights",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserVotes",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"index",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_staking",type:"address"},{internalType:"address",name:"_reward",type:"address"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isPool",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"length",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"lzEndpoint",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"mainnetEmissions",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"notifyRewardAmount",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"who",type:"address"}],name:"poke",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"poolForGauge",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"poolVote",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pools",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_asset",type:"address"},{internalType:"address",name:"_gauge",type:"address"}],name:"registerGauge",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"reset",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"reward",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"gauge",type:"address"},{internalType:"address",name:"bribe",type:"address"}],name:"setBribe",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"weight",type:"uint256"}],name:"setTotalWeight",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"usedWeight",type:"uint256"}],name:"setUsedWeight",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"address[]",name:"_pool",type:"address[]"},{internalType:"uint256[]",name:"_weights",type:"uint256[]"}],name:"setVotes",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"pool",type:"address"},{internalType:"uint256",name:"weight",type:"uint256"}],name:"setWeight",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"staking",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"supplyIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalWeight",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_gauge",type:"address"}],name:"updateFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"usedWeights",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"_poolVote",type:"address[]"},{internalType:"uint256[]",name:"_weights",type:"uint256[]"}],name:"vote",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"votes",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"weights",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}],y=function(){function e(t){(0,i.Z)(this,e),(0,s.Z)(this,"_contract",void 0),this._contract=m.connect(t.uiStakeDataProvider,t.provider)}return(0,o.Z)(e,[{key:"getPoolWeights",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getPoolWeights();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getUserVotes",value:function(){var e=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getUserVotes(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPools",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.pools();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTotalWeight",value:function(){var e=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.totalWeight();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getAllPools",value:function(){var e=(0,r.Z)(c().mark((function e(t){var n,r,i,o,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],e.next=3,this.getPoolWeights();case 3:return r=e.sent,e.next=6,this.getUserVotes(t);case 6:return i=e.sent,e.next=9,this.getPools();case 9:for(o=e.sent,s=0;st.iconSymbol.toUpperCase()?1:-1},x=function(e,t){var n=y(e),r=v(e),o=e.currentNetworkConfig;return(0,i.vl)({reserves:n,currentTimestamp:t,marketReferenceCurrencyDecimals:r.marketReferenceCurrencyDecimals,marketReferencePriceInUsd:r.marketReferenceCurrencyPriceInUsd,reserveIncentives:e.reserveIncentiveData||[]}).map((function(e){var t;return u(u(u({},e),(0,s.QD)(e)),{},{isEmodeEnabled:0!==e.eModeCategoryId,isWrappedBaseAsset:e.symbol.toLowerCase()===(null===(t=o.wrappedBaseAssetSymbol)||void 0===t?void 0:t.toLowerCase()),borrowAPY1D:(Number(e.variableBorrowAPY)/365).toString(),supplyMaxAPY:Number(e.supplyAPY).toString()})})).sort(w)},A=function(e,t){var n=v(e),r=m(e),i=x(e,t),s=h(e),a=e.reserveIncentiveData,c=e.userIncentiveData;return(0,o.n)({currentTimestamp:t,marketReferencePriceInUsd:n.marketReferenceCurrencyPriceInUsd,marketReferenceCurrencyDecimals:n.marketReferenceCurrencyDecimals,userReserves:r,formattedReserves:i,userEmodeCategoryId:s,reserveIncentives:a||[],userIncentives:c||[]})},E=function(e){return null===e||void 0===e?void 0:e.reduce((function(e,t){return e[t.eModeCategoryId]?e[t.eModeCategoryId].assets.push(t.symbol):e[t.eModeCategoryId]={liquidationBonus:t.eModeLiquidationBonus,id:t.eModeCategoryId,label:t.eModeLabel,liquidationThreshold:t.eModeLiquidationThreshold,ltv:t.eModeLtv,priceSource:t.eModePriceSource,assets:[t.symbol]},e}),{})},_=function(e){var t=y(e);return E(t)}},69311:function(e,t,n){"use strict";n.d(t,{DP:function(){return ei},Qb:function(){return Qr},HL:function(){return ii},n7:function(){return ri},IP:function(){return ti},p4:function(){return Xr},Xh:function(){return Jr},Fp:function(){return ni},Yh:function(){return Kr}});var r=n(50029),i=n(59499),o=n(87794),s=n.n(o),a=n(70655),c=n(27627),u=n(75331),l=n(80854),d=n(29897),f=n(55206),p=n(11466);const h=[{inputs:[],name:"isPermissioned",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bool",name:"value",type:"bool"}],name:"setPermissioned",outputs:[],stateMutability:"nonpayable",type:"function"}];class m{static connect(e,t){return new p.CH(e,h,t)}}m.abi=h;class g extends c.Z{constructor(e,t){super(e,m),this.faucetAddress=null!==t&&void 0!==t?t:""}mint({userAddress:e,reserve:t,tokenSymbol:n,owner:r}){const i=(0,l.gU)("1000",18),o=l.Ry[n]?l.Ry[n]:i,s=this.getContractInstance(this.faucetAddress),a=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.mint(t,e,o),from:null!==r&&void 0!==r?r:e,value:l.k8});return[{tx:a,txType:u.ns.FAUCET_V2_MINT,gas:this.generateTxPriceEstimation([],a)}]}async isPermissioned(){return this.getContractInstance(this.faucetAddress).isPermissioned()}}function y(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:T(e)?2:S(e)?3:0}function A(e,t){return 2===x(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function E(e,t){return 2===x(e)?e.get(t):e[t]}function _(e,t,n){var r=x(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function k(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function T(e){return ne&&e instanceof Map}function S(e){return re&&e instanceof Set}function C(e){return e.o||e.t}function I(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=de(e);delete t[ae];for(var n=le(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=R),Object.freeze(e),t&&w(e,(function(e,t){return O(t,!0)}),!0)),e}function R(){y(2)}function D(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function P(e){var t=fe[e];return t||y(18,e),t}function B(e,t){fe[e]||(fe[e]=t)}function M(){return ee}function N(e,t){t&&(P("Patches"),e.u=[],e.s=[],e.v=t)}function F(e){L(e),e.p.forEach(U),e.p=null}function L(e){e===ee&&(ee=e.l)}function j(e){return ee={p:[],l:ee,h:e,m:!0,_:0}}function U(e){var t=e[ae];0===t.i||1===t.i?t.j():t.O=!0}function Z(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||P("ES5").S(t,e,r),r?(n[ae].P&&(F(t),y(4)),v(e)&&(e=H(t,e),t.l||G(t,e)),t.u&&P("Patches").M(n[ae].t,e,t.u,t.s)):e=H(t,n,[]),F(t),t.u&&t.v(t.u,t.s),e!==oe?e:void 0}function H(e,t,n){if(D(t))return t;var r=t[ae];if(!r)return w(t,(function(i,o){return z(e,r,t,i,o,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return G(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=I(r.k):r.o;w(3===r.i?new Set(i):i,(function(t,o){return z(e,r,i,t,o,n)})),G(e,i,!1),n&&e.u&&P("Patches").R(r,n,e.u,e.s)}return r.o}function z(e,t,n,r,i,o){if(b(i)){var s=H(e,i,o&&t&&3!==t.i&&!A(t.D,r)?o.concat(r):void 0);if(_(n,r,s),!b(s))return;e.m=!1}if(v(i)&&!D(i)){if(!e.h.F&&e._<1)return;H(e,i),t&&t.A.l||G(e,i)}}function G(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&O(t,n)}function V(e,t){var n=e[ae];return(n?C(n):e)[t]}function W(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function q(e){e.P||(e.P=!0,e.l&&q(e.l))}function $(e){e.o||(e.o=I(e.t))}function K(e,t,n){var r=T(t)?P("MapSet").N(t,n):S(t)?P("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:M(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,o=pe;n&&(i=[r],o=he);var s=Proxy.revocable(i,o),a=s.revoke,c=s.proxy;return r.k=c,r.j=a,c}(t,n):P("ES5").J(t,n);return(n?n.A:M()).p.push(r),r}function Y(e){return b(e)||y(22,e),function e(t){if(!v(t))return t;var n,r=t[ae],i=x(t);if(r){if(!r.P&&(r.i<4||!P("ES5").K(r)))return r.t;r.I=!0,n=X(t,i),r.I=!1}else n=X(t,i);return w(n,(function(t,i){r&&E(r.t,t)===i||_(n,t,e(i))})),3===i?new Set(n):n}(e)}function X(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return I(e)}function J(){function e(e,t){function n(){this.constructor=e}i(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function n(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(v(t)){var n=K(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)})))}function r(e){e.O&&y(3,JSON.stringify(C(e)))}var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},o=function(){function n(e,t){return this[ae]={i:2,l:t,A:t?t.A:M(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(n,Map);var i=n.prototype;return Object.defineProperty(i,"size",{get:function(){return C(this[ae]).size}}),i.has=function(e){return C(this[ae]).has(e)},i.set=function(e,n){var i=this[ae];return r(i),C(i).has(e)&&C(i).get(e)===n||(t(i),q(i),i.D.set(e,!0),i.o.set(e,n),i.D.set(e,!0)),this},i.delete=function(e){if(!this.has(e))return!1;var n=this[ae];return r(n),t(n),q(n),n.t.has(e)?n.D.set(e,!1):n.D.delete(e),n.o.delete(e),!0},i.clear=function(){var e=this[ae];r(e),C(e).size&&(t(e),q(e),e.D=new Map,w(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},i.forEach=function(e,t){var n=this;C(this[ae]).forEach((function(r,i){e.call(t,n.get(i),i,n)}))},i.get=function(e){var n=this[ae];r(n);var i=C(n).get(e);if(n.I||!v(i))return i;if(i!==n.t.get(e))return i;var o=K(n.A.h,i,n);return t(n),n.o.set(e,o),o},i.keys=function(){return C(this[ae]).keys()},i.values=function(){var e,t=this,n=this.keys();return(e={})[ce]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},i.entries=function(){var e,t=this,n=this.keys();return(e={})[ce]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},i[ce]=function(){return this.entries()},n}(),s=function(){function t(e,t){return this[ae]={i:3,l:t,A:t?t.A:M(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,O:!1,C:!1},this}e(t,Set);var i=t.prototype;return Object.defineProperty(i,"size",{get:function(){return C(this[ae]).size}}),i.has=function(e){var t=this[ae];return r(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},i.add=function(e){var t=this[ae];return r(t),this.has(e)||(n(t),q(t),t.o.add(e)),this},i.delete=function(e){if(!this.has(e))return!1;var t=this[ae];return r(t),n(t),q(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},i.clear=function(){var e=this[ae];r(e),C(e).size&&(n(e),q(e),e.o.clear())},i.values=function(){var e=this[ae];return r(e),n(e),e.o.values()},i.entries=function(){var e=this[ae];return r(e),n(e),e.o.entries()},i.keys=function(){return this.values()},i[ce]=function(){return this.values()},i.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();B("MapSet",{N:function(e,t){return new o(e,t)},T:function(e,t){return new s(e,t)}})}(0,a.__decorate)([d.QL,(0,a.__param)(0,(0,f.Oh)("userAddress")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],g.prototype,"mint",null);var Q,ee,te="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),ne="undefined"!=typeof Map,re="undefined"!=typeof Set,ie="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,oe=te?Symbol.for("immer-nothing"):((Q={})["immer-nothing"]=!0,Q),se=te?Symbol.for("immer-draftable"):"__$immer_draftable",ae=te?Symbol.for("immer-state"):"__$immer_state",ce="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",ue=""+Object.prototype.constructor,le="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,de=Object.getOwnPropertyDescriptors||function(e){var t={};return le(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},fe={},pe={get:function(e,t){if(t===ae)return e;var n=C(e);if(!A(n,t))return function(e,t,n){var r,i=W(t,n);return i?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!v(r)?r:r===V(e.t,t)?($(e),e.o[t]=K(e.A.h,r,e)):r},has:function(e,t){return t in C(e)},ownKeys:function(e){return Reflect.ownKeys(C(e))},set:function(e,t,n){var r=W(C(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=V(C(e),t),o=null==i?void 0:i[ae];if(o&&o.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(k(n,i)&&(void 0!==n||A(e.t,t)))return!0;$(e),q(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==V(e.t,t)||t in e.t?(e.D[t]=!1,$(e),q(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=C(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){y(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){y(12)}},he={};w(pe,(function(e,t){he[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),he.deleteProperty=function(e,t){return he.set.call(this,e,t,void 0)},he.set=function(e,t,n){return pe.set.call(this,e[0],t,n,e[0])};var me=function(){function e(e){var t=this;this.g=ie,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var i=n;n=e;var o=t;return function(e){var t=this;void 0===e&&(e=i);for(var r=arguments.length,s=Array(r>1?r-1:0),a=1;a1?r-1:0),o=1;o=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var i=P("Patches").$;return b(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}(),ge=new me,ye=ge.produce,be=(ge.produceWithPatches.bind(ge),ge.setAutoFreeze.bind(ge),ge.setUseProxies.bind(ge),ge.applyPatches.bind(ge),ge.createDraft.bind(ge),ge.finishDraft.bind(ge),ye),ve=n(63206);const we=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"===typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!==typeof i)?i:Object.assign({},t,i),n.forEach((n=>n(t,e)))}},i=()=>t,o={setState:r,getState:i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,i,o),o};var xe=n(67294),Ae=n(52798);const{useSyncExternalStoreWithSelector:Ee}=Ae;const _e=e=>{const t="function"===typeof e?(e=>e?we(e):we)(e):e,n=(e,n)=>function(e,t=e.getState,n){const r=Ee(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return(0,xe.useDebugValue)(r),r}(t,e,n);return Object.assign(n,t),n},ke=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,...a}=t;let c;try{c=(null==o||o)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const u=c.connect(a);let l=!0;i.setState=(e,t,i)=>{const o=n(e,t);return l?(u.send(void 0===i?{type:s||"anonymous"}:"string"===typeof i?{type:i}:i,r()),o):o};const d=(...e)=>{const t=l;l=!1,n(...e),l=t},f=e(i.setState,r,i);if(u.init(f),i.dispatchFromDevtools&&"function"===typeof i.dispatch){let e=!1;const t=i.dispatch;i.dispatch=(...n)=>{"__setState"!==n[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...n)}}return u.subscribe((e=>{var t;switch(e.type){case"ACTION":return"string"!==typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):Te(e.payload,(e=>{"__setState"!==e.type?i.dispatchFromDevtools&&"function"===typeof i.dispatch&&i.dispatch(e):d(e.state)}));case"DISPATCH":switch(e.payload.type){case"RESET":return d(f),u.init(i.getState());case"COMMIT":return u.init(i.getState());case"ROLLBACK":return Te(e.state,(e=>{d(e),u.init(i.getState())}));case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Te(e.state,(e=>{d(e)}));case"IMPORT_STATE":{const{nextLiftedState:n}=e.payload,r=null==(t=n.computedStates.slice(-1)[0])?void 0:t.state;if(!r)return;return d(r),void u.send(null,n)}case"PAUSE_RECORDING":return l=!l}return}})),f},Te=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}void 0!==n&&t(n)},Se=e=>(t,n,r)=>{const i=r.subscribe;r.subscribe=(e,t,n)=>{let o=e;if(t){const i=(null==n?void 0:n.equalityFn)||Object.is;let s=e(r.getState());o=n=>{const r=e(n);if(!i(s,r)){const e=s;t(s=r,e)}},(null==n?void 0:n.fireImmediately)&&t(s,s)}return i(o)};return e(t,n,r)};var Ce=n(8891),Ie=n.n(Ce);function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Re(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"0",n=t().ghoReserveDataFetched,r=t().ghoUserDataFetched;if(!n||!r)return!1;var i=t().ghoReserveData,o=t().ghoUserData,s=Number((0,Ue.Fv)(o.userGhoScaledBorrowBalance,18)),a=Number((0,Ue.Fv)(i.ghoMinDebtTokenBalanceForDiscount,18)),c=Number((0,Ue.Fv)(o.userDiscountTokenBalance,18)),u=Number((0,Ue.Fv)(i.ghoMinDiscountTokenBalanceForDiscount,18));return s+Number(e)>=a&&c>=u},ghoMarketConfig:function(){var e=t().currentMarket;if(Ze.uF.includes(e)){var n=t().currentMarketData.addresses,r=n.GHO_TOKEN_ADDRESS,i=n.GHO_UI_DATA_PROVIDER;if(r&&i)return{ghoTokenAddress:r,uiGhoDataProviderAddress:i}}},refreshGhoData:function(){var n=(0,r.Z)(s().mark((function n(){var r,i,o,a,c,u,l,d;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t().ghoMarketConfig()){n.next=3;break}return n.abrupt("return");case 3:if(i=t().account,o=new je({provider:(0,ve.VH)(t().currentMarketData.chainId),uiGhoDataProviderAddress:r.uiGhoDataProviderAddress}),!i){n.next=21;break}return n.prev=6,n.next=9,Promise.all([o.getGhoReserveData(),o.getGhoUserData(i)]);case 9:a=n.sent,c=(0,Be.Z)(a,2),u=c[0],l=c[1],e({ghoReserveData:u,ghoUserData:l,ghoReserveDataFetched:!0,ghoUserDataFetched:!0}),n.next=19;break;case 16:n.prev=16,n.t0=n.catch(6),console.log("error",n.t0);case 19:n.next=31;break;case 21:return n.prev=21,n.next=24,o.getGhoReserveData();case 24:d=n.sent,e({ghoReserveData:d,ghoReserveDataFetched:!0,ghoUserDataFetched:!1}),n.next=31;break;case 28:n.prev=28,n.t1=n.catch(21),console.log("error",n.t1);case 31:case"end":return n.stop()}}),n,null,[[6,16],[21,28]])})));return function(){return n.apply(this,arguments)}}()}},ze=n(93667);class Ge{static connect(e,t){return new p.CH(e,Ve,t)}}const Ve=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"delegator",type:"address"},{indexed:!0,internalType:"address",name:"delegatee",type:"address"},{indexed:!1,internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"DelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"DelegatedPowerChanged",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"_nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"}],name:"delegate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"delegateByType",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"delegateByTypeBySig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"delegator",type:"address"},{internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"getDelegateeByType",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"getPowerAtBlock",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"enum IGovernancePowerDelegationToken.DelegationType",name:"delegationType",type:"uint8"}],name:"getPowerCurrent",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"totalSupplyAt",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}];class We extends c.Z{constructor(e){super(e,Ge)}async delegate({user:e,delegatee:t,governanceToken:n}){const r=[],i=this.getContractInstance(n),o=await this.getDelegateeAddress(t),s=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.delegate(o),from:e});return r.push({tx:s,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(r,s)}),r}async delegateByType({user:e,delegatee:t,delegationType:n,governanceToken:r}){const i=[],o=this.getContractInstance(r),s=await this.getDelegateeAddress(t),a=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.delegateByType(s,n),from:e});return i.push({tx:a,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(i,a)}),i}async delegateBySig({user:e,delegatee:t,expiry:n,signature:r,governanceToken:i}){const o=[],s=this.getContractInstance(i),a=await this.getNonce({user:e,governanceToken:i}),{v:c,r:l,s:d}=(0,ze.splitSignature)(r),f=await this.getDelegateeAddress(t),p=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.delegateBySig(f,a,n,c,l,d),from:e});return o.push({tx:p,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(o,p)}),o}async delegateByTypeBySig({user:e,delegatee:t,delegationType:n,expiry:r,signature:i,governanceToken:o}){const s=[],a=this.getContractInstance(o),c=await this.getNonce({user:e,governanceToken:o}),{v:l,r:d,s:f}=(0,ze.splitSignature)(i),p=await this.getDelegateeAddress(t),h=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.delegateByTypeBySig(p,n,c,r,l,d,f),from:e});return s.push({tx:h,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(s,h)}),s}async prepareDelegateSignature({delegatee:e,nonce:t,expiry:n,governanceTokenName:r,governanceToken:i}){const o=await this.getDelegateeAddress(e),{chainId:s}=await this.provider.getNetwork(),a={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Delegate:[{name:"delegatee",type:"address"},{name:"nonce",type:"uint256"},{name:"expiry",type:"uint256"}]},primaryType:"Delegate",domain:{name:r,version:"1",chainId:s,verifyingContract:i},message:{delegatee:o,nonce:t,expiry:n}};return JSON.stringify(a)}async prepareDelegateByTypeSignature({delegatee:e,type:t,nonce:n,expiry:r,governanceTokenName:i,governanceToken:o}){const s=await this.getDelegateeAddress(e),{chainId:a}=await this.provider.getNetwork(),c={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],DelegateByType:[{name:"delegatee",type:"address"},{name:"type",type:"uint256"},{name:"nonce",type:"uint256"},{name:"expiry",type:"uint256"}]},primaryType:"DelegateByType",domain:{name:i,version:"1",chainId:a,verifyingContract:o},message:{delegatee:s,type:t,nonce:n,expiry:r}};return JSON.stringify(c)}async getDelegateeByType({delegator:e,delegationType:t,governanceToken:n}){return this.getContractInstance(n).getDelegateeByType(e,t)}async getPowerCurrent({user:e,delegationType:t,governanceToken:n}){const r=this.getContractInstance(n);return(await r.getPowerCurrent(e,t)).toString()}async getPowerAtBlock({user:e,blockNumber:t,delegationType:n,governanceToken:r}){const i=this.getContractInstance(r);return(await i.getPowerAtBlock(e,t,n)).toString()}async getNonce({user:e,governanceToken:t}){const n=this.getContractInstance(t);return(await n._nonces(e)).toString()}async getDelegateeAddress(e){if((0,l.Nv)(e)){const t=await this.provider.resolveName(e);if(!t)throw new Error(`Address: ${e} is not a valid ENS address`);return t}return e}}(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"delegate",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"delegateByType",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"delegateBySig",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"delegateByTypeBySig",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__param)(0,(0,f.rX)("nonce")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"prepareDelegateSignature",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Il)("delegatee")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__param)(0,(0,f.rX)("nonce")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"prepareDelegateByTypeSignature",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("delegator")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"getDelegateeByType",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"getPowerCurrent",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__param)(0,(0,f.K5)("blockNumber")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"getPowerAtBlock",null),(0,a.__decorate)([d.Sm,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("governanceToken")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],We.prototype,"getNonce",null);var qe=n(24387);const $e=[{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"_nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}];class Ke{static createInterface(){return new Ne.vU($e)}static connect(e,t){return new p.CH(e,$e,t)}}Ke.abi=$e;class Ye extends c.Z{constructor(e){super(e,Ke),this.getNonce=this.getNonce.bind(this)}async getNonce({token:e,owner:t}){const n=this.getContractInstance(e);let r;try{return r=await n.nonces(t),r.toNumber()}catch(M){}try{return r=await n._nonces(t),r.toNumber()}catch(M){console.log(`Token ${e} does not implement nonces or _nonces method`)}return null}}(0,a.__decorate)([d.JZ,(0,a.__param)(0,(0,f.Oh)("token")),(0,a.__param)(0,(0,f.Oh)("owner")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ye.prototype,"getNonce",null);var Xe=n(45626);function Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qe(e){for(var t=1;t{if(!(0,Me.isAddress)(e))throw new Error("tokenAddress is not valid");return this._registryContract.latestRoundData(e,rt[t])},this.decimals=async(e,t)=>{if(!(0,Me.isAddress)(e))throw new Error("tokenAddress is not valid");return this._registryContract.decimals(e,rt[t])},this.getPriceFeed=async(e,t)=>{const n=await this.latestRoundData(e,t),r=await this.decimals(e,t);return{answer:n[1].toString(),updatedAt:n[3].toNumber(),decimals:r}},!(0,Me.isAddress)(t))throw new Error("contract address is not valid");this._registryContract=class{static connect(e,t){return new p.CH(e,tt,t)}}.connect(t,e)}}const ot=[{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"getFullReservesIncentiveData",outputs:[{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"aIncentiveData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"vIncentiveData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"sIncentiveData",type:"tuple"}],internalType:"struct IUiIncentiveDataProviderV3.AggregatedReserveIncentiveData[]",name:"",type:"tuple[]"},{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"aTokenIncentivesUserData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"vTokenIncentivesUserData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"sTokenIncentivesUserData",type:"tuple"}],internalType:"struct IUiIncentiveDataProviderV3.UserReserveIncentiveData[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"}],name:"getReservesIncentivesData",outputs:[{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"aIncentiveData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"vIncentiveData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"uint256",name:"emissionPerSecond",type:"uint256"},{internalType:"uint256",name:"incentivesLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesIndex",type:"uint256"},{internalType:"uint256",name:"emissionEndTimestamp",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"},{internalType:"uint8",name:"precision",type:"uint8"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.RewardInfo[]",name:"rewardsTokenInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.IncentiveData",name:"sIncentiveData",type:"tuple"}],internalType:"struct IUiIncentiveDataProviderV3.AggregatedReserveIncentiveData[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"getUserReservesIncentivesData",outputs:[{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"aTokenIncentivesUserData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"vTokenIncentivesUserData",type:"tuple"},{components:[{internalType:"address",name:"tokenAddress",type:"address"},{internalType:"address",name:"incentiveControllerAddress",type:"address"},{components:[{internalType:"string",name:"rewardTokenSymbol",type:"string"},{internalType:"address",name:"rewardOracleAddress",type:"address"},{internalType:"address",name:"rewardTokenAddress",type:"address"},{internalType:"uint256",name:"userUnclaimedRewards",type:"uint256"},{internalType:"uint256",name:"tokenIncentivesUserIndex",type:"uint256"},{internalType:"int256",name:"rewardPriceFeed",type:"int256"},{internalType:"uint8",name:"priceFeedDecimals",type:"uint8"},{internalType:"uint8",name:"rewardTokenDecimals",type:"uint8"}],internalType:"struct IUiIncentiveDataProviderV3.UserRewardInfo[]",name:"userRewardsInformation",type:"tuple[]"}],internalType:"struct IUiIncentiveDataProviderV3.UserIncentiveData",name:"sTokenIncentivesUserData",type:"tuple"}],internalType:"struct IUiIncentiveDataProviderV3.UserReserveIncentiveData[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"}];class st{static createInterface(){return new Ne.vU(ot)}static connect(e,t){return new p.CH(e,ot,t)}}st.abi=ot;class at extends c.Z{constructor({provider:e,uiIncentiveDataProviderAddress:t,chainId:n}){super(e,st),this._getFeed=async(e,t,n)=>{const r=await this._chainlinkFeedsRegistries[t].getPriceFeed(e,n);return Object.assign(Object.assign({},r),{rewardTokenAddress:e})},this.uiIncentiveDataProviderAddress=t,this._chainlinkFeedsRegistries={},this.chainId=n}async getFullReservesIncentiveData({user:e,lendingPoolAddressProvider:t}){return this.getContractInstance(this.uiIncentiveDataProviderAddress).getFullReservesIncentiveData(t,e)}async getReservesIncentivesData({lendingPoolAddressProvider:e}){return this.getContractInstance(this.uiIncentiveDataProviderAddress).getReservesIncentivesData(e)}async getUserReservesIncentivesData({user:e,lendingPoolAddressProvider:t}){return this.getContractInstance(this.uiIncentiveDataProviderAddress).getUserReservesIncentivesData(t,e)}async getReservesIncentivesDataHumanized({lendingPoolAddressProvider:e}){return(await this.getReservesIncentivesData({lendingPoolAddressProvider:e})).map((t=>({id:`${this.chainId}-${t.underlyingAsset}-${e}`.toLowerCase(),underlyingAsset:t.underlyingAsset.toLowerCase(),aIncentiveData:this._formatIncentiveData(t.aIncentiveData),vIncentiveData:this._formatIncentiveData(t.vIncentiveData),sIncentiveData:this._formatIncentiveData(t.sIncentiveData)})))}async getUserReservesIncentivesDataHumanized({user:e,lendingPoolAddressProvider:t}){return(await this.getUserReservesIncentivesData({user:e,lendingPoolAddressProvider:t})).map((n=>({id:`${this.chainId}-${e}-${n.underlyingAsset}-${t}`.toLowerCase(),underlyingAsset:n.underlyingAsset.toLowerCase(),aTokenIncentivesUserData:this._formatUserIncentiveData(n.aTokenIncentivesUserData),vTokenIncentivesUserData:this._formatUserIncentiveData(n.vTokenIncentivesUserData),sTokenIncentivesUserData:this._formatUserIncentiveData(n.sTokenIncentivesUserData)})))}async getIncentivesDataWithPriceLegacy({lendingPoolAddressProvider:e,chainlinkFeedsRegistry:t,quote:n=nt.eth}){const r=await this.getReservesIncentivesDataHumanized({lendingPoolAddressProvider:e}),i=[];if(t&&(0,Me.isAddress)(t)){this._chainlinkFeedsRegistries[t]||(this._chainlinkFeedsRegistries[t]=new it({provider:this.provider,chainlinkFeedsRegistry:t}));const e=new Set;r.forEach((t=>{t.aIncentiveData.rewardsTokenInformation.map((t=>e.add(t.rewardTokenAddress))),t.vIncentiveData.rewardsTokenInformation.map((t=>e.add(t.rewardTokenAddress))),t.sIncentiveData.rewardsTokenInformation.map((t=>e.add(t.rewardTokenAddress)))}));const o=Array.from(e).map((e=>this._getFeed(e,t,n)));(await Promise.allSettled(o)).forEach((e=>{"fulfilled"===e.status&&i.push(e.value)}))}return r.map((t=>({id:`${this.chainId}-${t.underlyingAsset}-${e}`.toLowerCase(),underlyingAsset:t.underlyingAsset,aIncentiveData:Object.assign(Object.assign({},t.aIncentiveData),{rewardsTokenInformation:t.aIncentiveData.rewardsTokenInformation.map((e=>{const t=i.find((t=>t.rewardTokenAddress===e.rewardTokenAddress));return Object.assign(Object.assign({},e),{rewardPriceFeed:(null===t||void 0===t?void 0:t.answer)?t.answer:e.rewardPriceFeed,priceFeedDecimals:(null===t||void 0===t?void 0:t.decimals)?t.decimals:e.priceFeedDecimals})}))}),vIncentiveData:Object.assign(Object.assign({},t.vIncentiveData),{rewardsTokenInformation:t.vIncentiveData.rewardsTokenInformation.map((e=>{const t=i.find((t=>t.rewardTokenAddress===e.rewardTokenAddress));return Object.assign(Object.assign({},e),{rewardPriceFeed:(null===t||void 0===t?void 0:t.answer)?t.answer:e.rewardPriceFeed,priceFeedDecimals:(null===t||void 0===t?void 0:t.decimals)?t.decimals:e.priceFeedDecimals})}))}),sIncentiveData:Object.assign(Object.assign({},t.sIncentiveData),{rewardsTokenInformation:t.sIncentiveData.rewardsTokenInformation.map((e=>{const t=i.find((t=>t.rewardTokenAddress===e.rewardTokenAddress));return Object.assign(Object.assign({},e),{rewardPriceFeed:(null===t||void 0===t?void 0:t.answer)?t.answer:e.rewardPriceFeed,priceFeedDecimals:(null===t||void 0===t?void 0:t.decimals)?t.decimals:e.priceFeedDecimals})}))})})))}_formatIncentiveData(e){return{tokenAddress:e.tokenAddress,incentiveControllerAddress:e.incentiveControllerAddress,rewardsTokenInformation:e.rewardsTokenInformation.map((e=>({precision:e.precision,rewardTokenAddress:e.rewardTokenAddress,rewardTokenDecimals:e.rewardTokenDecimals,emissionPerSecond:e.emissionPerSecond.toString(),incentivesLastUpdateTimestamp:e.incentivesLastUpdateTimestamp.toNumber(),tokenIncentivesIndex:e.tokenIncentivesIndex.toString(),emissionEndTimestamp:e.emissionEndTimestamp.toNumber(),rewardTokenSymbol:e.rewardTokenSymbol,rewardOracleAddress:e.rewardOracleAddress,rewardPriceFeed:e.rewardPriceFeed.toString(),priceFeedDecimals:e.priceFeedDecimals})))}}_formatUserIncentiveData(e){return{tokenAddress:e.tokenAddress,incentiveControllerAddress:e.incentiveControllerAddress,userRewardsInformation:e.userRewardsInformation.map((e=>({rewardTokenAddress:e.rewardTokenAddress,rewardTokenDecimals:e.rewardTokenDecimals,tokenIncentivesUserIndex:e.tokenIncentivesUserIndex.toString(),userUnclaimedRewards:e.userUnclaimedRewards.toString(),rewardTokenSymbol:e.rewardTokenSymbol,rewardOracleAddress:e.rewardOracleAddress,rewardPriceFeed:e.rewardPriceFeed.toString(),priceFeedDecimals:e.priceFeedDecimals})))}}}function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ut(e){for(var t=1;t0})).map((function(e){return"GOLD"===e.rewardTokenSymbol&&(e.rewardTokenSymbol="zBLAST-GOLD"),"BLAST"===e.rewardTokenSymbol&&(e.rewardTokenSymbol="zBLAST"),e}))};return e.map((function(e){return ut(ut({},e),{},{aIncentiveData:ut(ut({},e.aIncentiveData),{},{rewardsTokenInformation:t(e.aIncentiveData.rewardsTokenInformation)}),vIncentiveData:ut(ut({},e.vIncentiveData),{},{rewardsTokenInformation:t(e.vIncentiveData.rewardsTokenInformation)})})}))})).then((function(t){return e({reserveIncentiveData:t})}))),r&&c.push(a.getUserReservesIncentivesDataHumanized({lendingPoolAddressProvider:i.addresses.LENDING_POOL_ADDRESS_PROVIDER,user:r}).then((function(t){return e({userIncentiveData:t})}))),n.next=12,Promise.all(c);case 12:n.next=17;break;case 14:n.prev=14,n.t0=n.catch(7),console.log("error fetching incentives");case 17:case"end":return n.stop()}}),n,null,[[7,14]])})));return function(){return n.apply(this,arguments)}}()}},dt=function(e){return{mobileDrawerOpen:!1,setMobileDrawerOpen:function(t){e({mobileDrawerOpen:t})},gaslessEnabled:!0,setGaslessEnabled:function(t){e({gaslessEnabled:t})}}},ft=n(69820),pt=n(21921),ht=n(24243);class mt{static connect(e,t){return new p.CH(e,gt,t)}}const gt=[{inputs:[{internalType:"address",name:"assetToSwapFrom",type:"address"},{internalType:"address",name:"assetToSwapTo",type:"address"},{internalType:"uint256",name:"amountToSwap",type:"uint256"},{internalType:"uint256",name:"minAmountToReceive",type:"uint256"},{internalType:"uint256",name:"swapAllBalanceOffset",type:"uint256"},{internalType:"bytes",name:"swapCalldata",type:"bytes"},{internalType:"address",name:"augustus",type:"address"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct IParaSwapLiquiditySwapAdapter.PermitSignature",name:"permitParams",type:"tuple"}],name:"swapAndDeposit",outputs:[],stateMutability:"nonpayable",type:"function"}];function yt(e){switch(e.slice(0,10)){case"0xda8567c8":return 100;case"0x58b9d179":case"0x54840d1a":return 4;case"0x0863b7ac":case"0x8f00eccb":case"0xec1d21dd":case"0xf5661034":case"0x64466805":case"0xa94e78ef":case"0x46c67b6d":case"0xb22f4db8":case"0x19fc5be0":case"0x3865bde6":case"0x58f15100":case"0xa6866da9":return 68;case"0x0b86a4c1":return 36;default:throw new Error("Unrecognized function selector for Augustus")}}class bt extends c.Z{constructor(e,t){super(e,mt),this.liquiditySwapAdapterAddress=null!==t&&void 0!==t?t:"",this.swapAndDeposit=this.swapAndDeposit.bind(this)}swapAndDeposit({user:e,assetToSwapFrom:t,assetToSwapTo:n,amountToSwap:r,minAmountToReceive:i,permitParams:o,augustus:s,swapCallData:a,swapAll:c},l){const d=this.getContractInstance(this.liquiditySwapAdapterAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.swapAndDeposit(t,n,r,i,c?yt(a):0,a,s,o),from:e});return{tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(null!==l&&void 0!==l?l:[],f,u.UQ.swapCollateral)}}}(0,a.__decorate)([d.cJ,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("assetToSwapFrom")),(0,a.__param)(0,(0,f.Oh)("assetToSwapTo")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__param)(0,(0,f.K5)("amountToSwap")),(0,a.__param)(0,(0,f.K5)("minAmountToReceive")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Object)],bt.prototype,"swapAndDeposit",null);const vt=[{inputs:[{internalType:"contract IPoolAddressesProvider",name:"addressesProvider",type:"address"},{internalType:"contract IParaSwapAugustusRegistry",name:"augustusRegistry",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"fromAsset",type:"address"},{indexed:!0,internalType:"address",name:"toAsset",type:"address"},{indexed:!1,internalType:"uint256",name:"amountSold",type:"uint256"},{indexed:!1,internalType:"uint256",name:"receivedAmount",type:"uint256"}],name:"Bought",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"fromAsset",type:"address"},{indexed:!0,internalType:"address",name:"toAsset",type:"address"},{indexed:!1,internalType:"uint256",name:"fromAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"receivedAmount",type:"uint256"}],name:"Swapped",type:"event"},{inputs:[],name:"ADDRESSES_PROVIDER",outputs:[{internalType:"contract IPoolAddressesProvider",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"AUGUSTUS_REGISTRY",outputs:[{internalType:"contract IParaSwapAugustusRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_SLIPPAGE_PERCENT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ORACLE",outputs:[{internalType:"contract IPriceOracleGetter",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"POOL",outputs:[{internalType:"contract IPool",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"uint256[]",name:"premiums",type:"uint256[]"},{internalType:"address",name:"initiator",type:"address"},{internalType:"bytes",name:"params",type:"bytes"}],name:"executeOperation",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20",name:"token",type:"address"}],name:"rescueTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20Detailed",name:"collateralAsset",type:"address"},{internalType:"contract IERC20Detailed",name:"debtAsset",type:"address"},{internalType:"uint256",name:"collateralAmount",type:"uint256"},{internalType:"uint256",name:"debtRepayAmount",type:"uint256"},{internalType:"uint256",name:"debtRateMode",type:"uint256"},{internalType:"uint256",name:"buyAllBalanceOffset",type:"uint256"},{internalType:"bytes",name:"paraswapData",type:"bytes"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct BaseParaSwapAdapter.PermitSignature",name:"permitSignature",type:"tuple"}],name:"swapAndRepay",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],wt="0x6101006040523480156200001257600080fd5b506040516200333638038062003336833981016040819052620000359162000263565b81818180806001600160a01b03166080816001600160a01b031681525050806001600160a01b031663026b1d5f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000092573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b89190620002a2565b6001600160a01b031660a05250600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350806001600160a01b031663fca513a86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000145573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016b9190620002a2565b6001600160a01b0390811660c05260405163fb04e17b60e01b815260006004820152908316915063fb04e17b90602401602060405180830381865afa158015620001b9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001df9190620002c9565b15620002315760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420612076616c6964204175677573747573206164647265737300000000604482015260640160405180910390fd5b6001600160a01b031660e05250506001805550620002ed565b6001600160a01b03811681146200026057600080fd5b50565b600080604083850312156200027757600080fd5b825162000284816200024a565b602084015190925062000297816200024a565b809150509250929050565b600060208284031215620002b557600080fd5b8151620002c2816200024a565b9392505050565b600060208284031215620002dc57600080fd5b81518015158114620002c257600080fd5b60805160a05160c05160e051612fa06200039660003960008181610176015261111801526000818161014f015261237b0152600081816101b8015281816104bb015281816105750152818161064b015281816106e50152818161079f0152818161087501528181610a7001528181611a6801528181611b2601528181611bfe01528181611cc301528181611d5e01528181611fc6015261217b0152600060e70152612fa06000f3fe608060405234801561001057600080fd5b50600436106100c85760003560e01c80634db9dc97116100815780638da5cb5b1161005b5780638da5cb5b146101da578063920f5c84146101f8578063f2fde38b1461021b57600080fd5b80634db9dc9714610198578063715018a6146101ab5780637535d246146101b357600080fd5b806332e4b286116100b257806332e4b2861461013357806338013f021461014a5780633a8298671461017157600080fd5b8062ae3bf8146100cd5780630542975c146100e2575b600080fd5b6100e06100db366004612585565b61022e565b005b6101097f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61013c610bb881565b60405190815260200161012a565b6101097f000000000000000000000000000000000000000000000000000000000000000081565b6101097f000000000000000000000000000000000000000000000000000000000000000081565b6100e06101a63660046125eb565b610385565b6100e06108f4565b6101097f000000000000000000000000000000000000000000000000000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff16610109565b61020b6102063660046126f9565b6109e4565b604051901515815260200161012a565b6100e0610229366004612585565b610c31565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103826102d660005473ffffffffffffffffffffffffffffffffffffffff1690565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610340573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036491906127d4565b73ffffffffffffffffffffffffffffffffffffffff84169190610de2565b50565b600260015414156103f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ab565b60026001556104048886868933610ebb565b955061042089338961041b3686900386018661291f565b61108e565b60006104688585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e91508d90508c6110b4565b90506000610476828a61296a565b905080156106a8576040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301528c169063095ea7b3906044016020604051808303816000875af1158015610513573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105379190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390528c169063095ea7b3906044016020604051808303816000875af11580156105cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f19190612981565b506040517fe8eda9df00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8c8116600483015260248201839052336044830152600060648301527f0000000000000000000000000000000000000000000000000000000000000000169063e8eda9df90608401600060405180830381600087803b15801561068f57600080fd5b505af11580156106a3573d6000803e3d6000fd5b505050505b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301528b169063095ea7b3906044016020604051808303816000875af115801561073d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107619190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018a90528b169063095ea7b3906044016020604051808303816000875af11580156107f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081b9190612981565b506040517f573ade8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152602482018a9052604482018990523360648301527f0000000000000000000000000000000000000000000000000000000000000000169063573ade81906084016020604051808303816000875af11580156108be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e291906127d4565b50506001805550505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102ab565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600060026001541415610a53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ab565b60026001553373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610af7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f43414c4c45525f4d5553545f42455f504f4f4c0000000000000000000000000060448201526064016102ab565b600189148015610b075750600187145b8015610b135750600185145b610b9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f464c4153484c4f414e5f4d554c5449504c455f4153534554535f4e4f545f535560448201527f50504f525445440000000000000000000000000000000000000000000000000060648201526084016102ab565b600088886000818110610bb457610bb46129a3565b905060200201359050600087876000818110610bd257610bd26129a3565b905060200201359050600086905060008d8d6000818110610bf557610bf56129a3565b9050602002016020810190610c0a9190612585565b9050610c1a8787858585896119ed565b505060018080559c9b505050505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610cb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102ab565b73ffffffffffffffffffffffffffffffffffffffff8116610d55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102ab565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff84166004830152602482018390529060008060448382895af1610e45573d6000803e3d6000fd5b50610e4f84611e35565b610eb5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f475076323a206661696c6564207472616e73666572000000000000000000000060448201526064016102ab565b50505050565b600080610ec787611f01565b905060006001876002811115610edf57610edf6129d2565b6002811115610ef057610ef06129d2565b14610f0057816101400151610f07565b8161012001515b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301529192506000918316906370a0823190602401602060405180830381865afa158015610f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9d91906127d4565b90508615611017578581111561100f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f494e53554646494349454e545f414d4f554e545f544f5f52455041590000000060448201526064016102ab565b809550611081565b80861115611081576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f494e56414c49445f444542545f52455041595f414d4f554e540000000000000060448201526064016102ab565b5093979650505050505050565b600061109985611f01565b610100015190506110ad8582868686612038565b5050505050565b6000806000878060200190518101906110cd9190612a73565b6040517ffb04e17b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301529294509092507f00000000000000000000000000000000000000000000000000000000000000009091169063fb04e17b90602401602060405180830381865afa158015611161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111859190612981565b6111eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f494e56414c49445f41554755535455530000000000000000000000000000000060448201526064016102ab565b60006111f688612251565b60ff169050600061120688612251565b60ff16905060006112168a612333565b905060006112238a612333565b9050600061127b611238612710610bb86123e8565b61127561125061124988600a612c26565b87906123f8565b61126f6112686112618b600a612c26565b88906123f8565b8e906123f8565b90612422565b90612435565b9050808a111561130d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f6d6178416d6f756e74546f5377617020657863656564206d617820736c69707060448201527f616765000000000000000000000000000000000000000000000000000000000060648201526084016102ab565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000935073ffffffffffffffffffffffffffffffffffffffff8b1692506370a082319150602401602060405180830381865afa15801561137f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a391906127d4565b90508581101561140f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f494e53554646494349454e545f42414c414e43455f4245464f52455f5357415060448201526064016102ab565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8916906370a0823190602401602060405180830381865afa15801561147c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a091906127d4565b905060008373ffffffffffffffffffffffffffffffffffffffff1663d2c4b5986040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115139190612c42565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808316600483015260006024830152919250908b169063095ea7b3906044016020604051808303816000875af115801561158c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b09190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152602482018a90528b169063095ea7b3906044016020604051808303816000875af1158015611626573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164a9190612981565b508b156116dd5760048c1015801561166e5750845161166a906020612478565b8c11155b6116d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f544f5f414d4f554e545f4f46465345545f4f55545f4f465f52414e474500000060448201526064016102ab565b8660208d018601525b60008473ffffffffffffffffffffffffffffffffffffffff16866040516117049190612c5f565b6000604051808303816000865af19150503d8060008114611741576040519150601f19603f3d011682016040523d82523d6000602084013e611746565b606091505b5050905080611759573d6000803e3d6000fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8d16906370a0823190602401602060405180830381865afa1580156117c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ea91906127d4565b90506117f6818661296a565b975089881115611862576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f57524f4e475f42414c414e43455f41465445525f53574150000000000000000060448201526064016102ab565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906118ff90869073ffffffffffffffffffffffffffffffffffffffff8f16906370a0823190602401602060405180830381865afa1580156118d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f991906127d4565b90612478565b90508981101561196b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f494e53554646494349454e545f414d4f554e545f52454345495645440000000060448201526064016102ab565b8b73ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff167fbf77fd13a39d14dc0da779342c14105c38d9a5d0c60f2caa22f5fd1d5525416d8b846040516119d3929190918252602082015260400190565b60405180910390a350505050505050509695505050505050565b60008080808080611a008b8d018d612c7b565b955095509550955095509550611a19868486888d610ebb565b94506000611a2b85848b8a8c8b6110b4565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301529192509088169063095ea7b3906044016020604051808303816000875af1158015611ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae89190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660048301526024820188905288169063095ea7b3906044016020604051808303816000875af1158015611b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba29190612981565b506040517f573ade8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015260248201889052604482018690528b811660648301527f0000000000000000000000000000000000000000000000000000000000000000169063573ade81906084016020604051808303816000875af1158015611c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6b91906127d4565b506000611c78828d6123e8565b9050611c868a8c838661108e565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301528b169063095ea7b3906044016020604051808303816000875af1158015611d1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d3f9190612981565b508973ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f0000000000000000000000000000000000000000000000000000000000000000611d908f8d6123e890919063ffffffff16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044016020604051808303816000875af1158015611e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e249190612981565b505050505050505050505050505050565b6000611e75565b7f08c379a00000000000000000000000000000000000000000000000000000000060005260206004528060245250806044525060646000fd5b3d8015611eb45760208114611eee57611eaf7f475076323a206d616c666f726d6564207472616e7366657220726573756c7400601f611e3c565b611efb565b823b611ee557611ee57f475076323a206e6f74206120636f6e74726163740000000000000000000000006014611e3c565b60019150611efb565b3d6000803e600051151591505b50919050565b604080516102008101825260006101e08201818152825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c08101919091526040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa15801561200e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120329190612dc0565b92915050565b60208101511561210557805160208201516040808401516060850151608086015192517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301523060248301526044820196909652606481019490945260ff909116608484015260a483015260c48201529085169063d505accf9060e401600060405180830381600087803b1580156120ec57600080fd5b505af1158015612100573d6000803e3d6000fd5b505050505b61212773ffffffffffffffffffffffffffffffffffffffff8516843085612488565b6040517f69328dec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301526024820184905230604483015283917f0000000000000000000000000000000000000000000000000000000000000000909116906369328dec906064016020604051808303816000875af11580156121c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121ea91906127d4565b146110ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f554e45585045435445445f414d4f554e545f57495448445241574e000000000060448201526064016102ab565b6000808273ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561229f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c39190612ee3565b9050604d8160ff161115612032576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f544f4f5f4d414e595f444543494d414c535f4f4e5f544f4b454e00000000000060448201526064016102ab565b6040517fb3596f0700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063b3596f0790602401602060405180830381865afa1580156123c4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203291906127d4565b8082018281101561203257600080fd5b60008215806124195750508181028183828161241657612416612f00565b04145b61203257600080fd5b600061242e8284612f2f565b9392505050565b600081157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec778390048411151761246a57600080fd5b506127109102611388010490565b8082038281111561203257600080fd5b6040517f23b872dd0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8581166004840152841660248301526044820183905290600080606483828a5af16124f3573d6000803e3d6000fd5b506124fd85611e35565b6110ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a206661696c6564207472616e7366657246726f6d0000000000000060448201526064016102ab565b73ffffffffffffffffffffffffffffffffffffffff8116811461038257600080fd5b60006020828403121561259757600080fd5b813561242e81612563565b60008083601f8401126125b457600080fd5b50813567ffffffffffffffff8111156125cc57600080fd5b6020830191508360208285010111156125e457600080fd5b9250929050565b6000806000806000806000806000898b0361018081121561260b57600080fd5b8a3561261681612563565b995060208b013561262681612563565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b013567ffffffffffffffff81111561265e57600080fd5b61266a8d828e016125a2565b90955093505060a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20820112156126a057600080fd5b5060e08a0190509295985092959850929598565b60008083601f8401126126c657600080fd5b50813567ffffffffffffffff8111156126de57600080fd5b6020830191508360208260051b85010111156125e457600080fd5b600080600080600080600080600060a08a8c03121561271757600080fd5b893567ffffffffffffffff8082111561272f57600080fd5b61273b8d838e016126b4565b909b50995060208c013591508082111561275457600080fd5b6127608d838e016126b4565b909950975060408c013591508082111561277957600080fd5b6127858d838e016126b4565b909750955060608c0135915061279a82612563565b90935060808b013590808211156127b057600080fd5b506127bd8c828d016125a2565b915080935050809150509295985092959850929598565b6000602082840312156127e657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516101e0810167ffffffffffffffff81118282101715612840576128406127ed565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561288d5761288d6127ed565b604052919050565b60ff8116811461038257600080fd5b600060a082840312156128b657600080fd5b60405160a0810181811067ffffffffffffffff821117156128d9576128d96127ed565b8060405250809150823581526020830135602082015260408301356128fd81612895565b8060408301525060608301356060820152608083013560808201525092915050565b600060a0828403121561293157600080fd5b61242e83836128a4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561297c5761297c61293b565b500390565b60006020828403121561299357600080fd5b8151801515811461242e57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600067ffffffffffffffff821115612a1b57612a1b6127ed565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60005b83811015612a62578181015183820152602001612a4a565b83811115610eb55750506000910152565b60008060408385031215612a8657600080fd5b825167ffffffffffffffff811115612a9d57600080fd5b8301601f81018513612aae57600080fd5b8051612ac1612abc82612a01565b612846565b818152866020838501011115612ad657600080fd5b612ae7826020830160208601612a47565b8094505050506020830151612afb81612563565b809150509250929050565b600181815b80851115612b5f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612b4557612b4561293b565b80851615612b5257918102915b93841c9390800290612b0b565b509250929050565b600082612b7657506001612032565b81612b8357506000612032565b8160018114612b995760028114612ba357612bbf565b6001915050612032565b60ff841115612bb457612bb461293b565b50506001821b612032565b5060208310610133831016604e8410600b8410161715612be2575081810a612032565b612bec8383612b06565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612c1e57612c1e61293b565b029392505050565b600061242e8383612b67565b8051612c3d81612563565b919050565b600060208284031215612c5457600080fd5b815161242e81612563565b60008251612c71818460208701612a47565b9190910192915050565b6000806000806000806101408789031215612c9557600080fd5b8635612ca081612563565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff811115612cd157600080fd5b8701601f81018913612ce257600080fd5b8035612cf0612abc82612a01565b8181528a6020838501011115612d0557600080fd5b81602084016020830137600060208383010152809450505050612d2b8860a089016128a4565b90509295509295509295565b600060208284031215612d4957600080fd5b6040516020810181811067ffffffffffffffff82111715612d6c57612d6c6127ed565b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114612c3d57600080fd5b805164ffffffffff81168114612c3d57600080fd5b805161ffff81168114612c3d57600080fd5b60006101e08284031215612dd357600080fd5b612ddb61281c565b612de58484612d37565b8152612df360208401612d79565b6020820152612e0460408401612d79565b6040820152612e1560608401612d79565b6060820152612e2660808401612d79565b6080820152612e3760a08401612d79565b60a0820152612e4860c08401612d99565b60c0820152612e5960e08401612dae565b60e0820152610100612e6c818501612c32565b90820152610120612e7e848201612c32565b90820152610140612e90848201612c32565b90820152610160612ea2848201612c32565b90820152610180612eb4848201612d79565b908201526101a0612ec6848201612d79565b908201526101c0612ed8848201612d79565b908201529392505050565b600060208284031215612ef557600080fd5b815161242e81612895565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612f65577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea26469706673582212201ae79dd35f34ecf1387bee8e87022a83fa61b3a7ba8b1ecade15267edadaceb264736f6c634300080a0033";class xt extends p.lV{constructor(e){super(vt,wt,e)}deploy(e,t,n){return super.deploy(e,t,n||{})}getDeployTransaction(e,t,n){return super.getDeployTransaction(e,t,n||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static createInterface(){return new Ne.vU(vt)}static connect(e,t){return new p.CH(e,vt,t)}}xt.bytecode=wt,xt.abi=vt;class At extends c.Z{constructor(e,t){super(e,xt),this.repayWithCollateralAddress=null!==t&&void 0!==t?t:"",this.swapAndRepay=this.swapAndRepay.bind(this)}swapAndRepay({collateralAsset:e,debtAsset:t,collateralAmount:n,debtRepayAmount:r,debtRateMode:i,repayAll:o,permitParams:s,swapAndRepayCallData:a,user:c,augustus:d},f){const p=i===u.tk.Stable?1:2,h=this.getContractInstance(this.repayWithCollateralAddress),m=ft.$.encode(["bytes","address"],[a,d]),g=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.swapAndRepay(e,t,n,r,p,o?(0,l.mz)(a):0,m,s),from:c});return{tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(null!==f&&void 0!==f?f:[],g,u.UQ.repayCollateral)}}}(0,a.__decorate)([d.mB,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("collateralAsset")),(0,a.__param)(0,(0,f.Oh)("debtAsset")),(0,a.__param)(0,(0,f.K5)("collateralAmount")),(0,a.__param)(0,(0,f.K5)("debtRepayAmount")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Object)],At.prototype,"swapAndRepay",null);var Et=n(84707),_t=n(91747);const kt=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"backer",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"fee",type:"uint256"}],name:"BackUnbacked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!1,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"onBehalfOf",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"enum DataTypes.InterestRateMode",name:"interestRateMode",type:"uint8"},{indexed:!1,internalType:"uint256",name:"borrowRate",type:"uint256"},{indexed:!0,internalType:"uint16",name:"referral",type:"uint16"}],name:"Borrow",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"target",type:"address"},{indexed:!0,internalType:"address",name:"initiator",type:"address"},{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"enum DataTypes.InterestRateMode",name:"interestRateMode",type:"uint8"},{indexed:!1,internalType:"uint256",name:"premium",type:"uint256"},{indexed:!1,internalType:"uint16",name:"referralCode",type:"uint16"}],name:"FlashLoan",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"totalDebt",type:"uint256"}],name:"IsolationModeTotalDebtUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"collateralAsset",type:"address"},{indexed:!0,internalType:"address",name:"debtAsset",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint256",name:"debtToCover",type:"uint256"},{indexed:!1,internalType:"uint256",name:"liquidatedCollateralAmount",type:"uint256"},{indexed:!1,internalType:"address",name:"liquidator",type:"address"},{indexed:!1,internalType:"bool",name:"receiveAToken",type:"bool"}],name:"LiquidationCall",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!1,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"onBehalfOf",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!0,internalType:"uint16",name:"referral",type:"uint16"}],name:"MintUnbacked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!1,internalType:"uint256",name:"amountMinted",type:"uint256"}],name:"MintedToTreasury",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"}],name:"RebalanceStableBorrowRate",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"repayer",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bool",name:"useATokens",type:"bool"}],name:"Repay",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!1,internalType:"uint256",name:"liquidityRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"stableBorrowRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"variableBorrowRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"liquidityIndex",type:"uint256"},{indexed:!1,internalType:"uint256",name:"variableBorrowIndex",type:"uint256"}],name:"ReserveDataUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"}],name:"ReserveUsedAsCollateralDisabled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"}],name:"ReserveUsedAsCollateralEnabled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!1,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"onBehalfOf",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!0,internalType:"uint16",name:"referralCode",type:"uint16"}],name:"Supply",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"enum DataTypes.InterestRateMode",name:"interestRateMode",type:"uint8"}],name:"SwapBorrowRateMode",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint8",name:"categoryId",type:"uint8"}],name:"UserEModeSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reserve",type:"address"},{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[],name:"ADDRESSES_PROVIDER",outputs:[{internalType:"contract IPoolAddressesProvider",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"BRIDGE_PROTOCOL_FEE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"FLASHLOAN_PREMIUM_TOTAL",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"FLASHLOAN_PREMIUM_TO_PROTOCOL",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_NUMBER_RESERVES",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_STABLE_RATE_BORROW_SIZE_PERCENT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"fee",type:"uint256"}],name:"backUnbacked",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"borrow",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint8",name:"id",type:"uint8"},{components:[{internalType:"uint16",name:"ltv",type:"uint16"},{internalType:"uint16",name:"liquidationThreshold",type:"uint16"},{internalType:"uint16",name:"liquidationBonus",type:"uint16"},{internalType:"address",name:"priceSource",type:"address"},{internalType:"string",name:"label",type:"string"}],internalType:"struct DataTypes.EModeCategory",name:"config",type:"tuple"}],name:"configureEModeCategory",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"deposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"dropReserve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"balanceFromBefore",type:"uint256"},{internalType:"uint256",name:"balanceToBefore",type:"uint256"}],name:"finalizeTransfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiverAddress",type:"address"},{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"uint256[]",name:"interestRateModes",type:"uint256[]"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"bytes",name:"params",type:"bytes"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"flashLoan",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiverAddress",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"params",type:"bytes"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"flashLoanSimple",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"getConfiguration",outputs:[{components:[{internalType:"uint256",name:"data",type:"uint256"}],internalType:"struct DataTypes.ReserveConfigurationMap",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint8",name:"id",type:"uint8"}],name:"getEModeCategoryData",outputs:[{components:[{internalType:"uint16",name:"ltv",type:"uint16"},{internalType:"uint16",name:"liquidationThreshold",type:"uint16"},{internalType:"uint16",name:"liquidationBonus",type:"uint16"},{internalType:"address",name:"priceSource",type:"address"},{internalType:"string",name:"label",type:"string"}],internalType:"struct DataTypes.EModeCategory",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"getReserveData",outputs:[{components:[{components:[{internalType:"uint256",name:"data",type:"uint256"}],internalType:"struct DataTypes.ReserveConfigurationMap",name:"configuration",type:"tuple"},{internalType:"uint128",name:"liquidityIndex",type:"uint128"},{internalType:"uint128",name:"currentLiquidityRate",type:"uint128"},{internalType:"uint128",name:"variableBorrowIndex",type:"uint128"},{internalType:"uint128",name:"currentVariableBorrowRate",type:"uint128"},{internalType:"uint128",name:"currentStableBorrowRate",type:"uint128"},{internalType:"uint40",name:"lastUpdateTimestamp",type:"uint40"},{internalType:"uint16",name:"id",type:"uint16"},{internalType:"address",name:"aTokenAddress",type:"address"},{internalType:"address",name:"stableDebtTokenAddress",type:"address"},{internalType:"address",name:"variableDebtTokenAddress",type:"address"},{internalType:"address",name:"interestRateStrategyAddress",type:"address"},{internalType:"uint128",name:"accruedToTreasury",type:"uint128"},{internalType:"uint128",name:"unbacked",type:"uint128"},{internalType:"uint128",name:"isolationModeTotalDebt",type:"uint128"}],internalType:"struct DataTypes.ReserveData",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"getReserveNormalizedIncome",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"getReserveNormalizedVariableDebt",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getReservesList",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserAccountData",outputs:[{internalType:"uint256",name:"totalCollateralBase",type:"uint256"},{internalType:"uint256",name:"totalDebtBase",type:"uint256"},{internalType:"uint256",name:"availableBorrowsBase",type:"uint256"},{internalType:"uint256",name:"currentLiquidationThreshold",type:"uint256"},{internalType:"uint256",name:"ltv",type:"uint256"},{internalType:"uint256",name:"healthFactor",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserConfiguration",outputs:[{components:[{internalType:"uint256",name:"data",type:"uint256"}],internalType:"struct DataTypes.UserConfigurationMap",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getUserEMode",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"aTokenAddress",type:"address"},{internalType:"address",name:"stableDebtAddress",type:"address"},{internalType:"address",name:"variableDebtAddress",type:"address"},{internalType:"address",name:"interestRateStrategyAddress",type:"address"}],name:"initReserve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"collateralAsset",type:"address"},{internalType:"address",name:"debtAsset",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"debtToCover",type:"uint256"},{internalType:"bool",name:"receiveAToken",type:"bool"}],name:"liquidationCall",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"}],name:"mintToTreasury",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"mintUnbacked",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"rebalanceStableBorrowRate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"repay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"}],name:"repayWithATokens",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"permitV",type:"uint8"},{internalType:"bytes32",name:"permitR",type:"bytes32"},{internalType:"bytes32",name:"permitS",type:"bytes32"}],name:"repayWithPermit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"configuration",type:"uint256"}],name:"setConfiguration",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"rateStrategyAddress",type:"address"}],name:"setReserveInterestRateStrategyAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint8",name:"categoryId",type:"uint8"}],name:"setUserEMode",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"bool",name:"useAsCollateral",type:"bool"}],name:"setUserUseReserveAsCollateral",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"supply",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"permitV",type:"uint8"},{internalType:"bytes32",name:"permitR",type:"bytes32"},{internalType:"bytes32",name:"permitS",type:"bytes32"}],name:"supplyWithPermit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"interestRateMode",type:"uint256"}],name:"swapBorrowRateMode",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"bridgeProtocolFee",type:"uint256"}],name:"updateBridgeProtocolFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"flashLoanPremiumTotal",type:"uint256"},{internalType:"uint256",name:"flashLoanPremiumToProtocol",type:"uint256"}],name:"updateFlashloanPremiums",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"to",type:"address"}],name:"withdraw",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"}];class Tt{static createInterface(){return new Ne.vU(kt)}static connect(e,t){return new p.CH(e,kt,t)}}Tt.abi=kt;const St=[{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"borrow",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args1",type:"bytes32"},{internalType:"bytes32",name:"args2",type:"bytes32"}],name:"liquidationCall",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"rebalanceStableBorrowRate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"repay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"repayWithATokens",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"repayWithPermit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"setUserUseReserveAsCollateral",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"supply",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"supplyWithPermit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"swapBorrowRateMode",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"args",type:"bytes32"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}];class Ct{static createInterface(){return new Ne.vU(St)}static connect(e,t){return new p.CH(e,St,t)}}Ct.abi=St;const It=[{inputs:[{internalType:"contract IPool",name:"pool",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"POOL",outputs:[{internalType:"contract IPool",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"encodeBorrowParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"collateralAsset",type:"address"},{internalType:"address",name:"debtAsset",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"debtToCover",type:"uint256"},{internalType:"bool",name:"receiveAToken",type:"bool"}],name:"encodeLiquidationCall",outputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"encodeRebalanceStableBorrowRate",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"}],name:"encodeRepayParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"}],name:"encodeRepayWithATokensParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"permitV",type:"uint8"},{internalType:"bytes32",name:"permitR",type:"bytes32"},{internalType:"bytes32",name:"permitS",type:"bytes32"}],name:"encodeRepayWithPermitParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"bool",name:"useAsCollateral",type:"bool"}],name:"encodeSetUserUseReserveAsCollateral",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"encodeSupplyParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"permitV",type:"uint8"},{internalType:"bytes32",name:"permitR",type:"bytes32"},{internalType:"bytes32",name:"permitS",type:"bytes32"}],name:"encodeSupplyWithPermitParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"interestRateMode",type:"uint256"}],name:"encodeSwapBorrowRateMode",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"encodeWithdrawParams",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"}],Ot="0x60a060405234801561001057600080fd5b5060405161143138038061143183398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516113606100d16000396000818161016b0152818161027e015281816103760152818161043f015281816105180152818161062e0152818161073c015281816107fc0152818161094101528181610a700152610b5501526113606000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806388d5185211610081578063b76398e41161005b578063b76398e414610200578063fc0eed8514610213578063fed63a931461022157600080fd5b806388d51852146101b25780638da7fb18146101da5780639d2ffc1b146101ed57600080fd5b80635cc7bc10116100b25780635cc7bc1014610125578063671a7fae146101385780637535d2461461016657600080fd5b80631a64acf2146100d95780631a8f6dee146100ff5780631fd3479714610112575b600080fd5b6100ec6100e7366004610e66565b610234565b6040519081526020015b60405180910390f35b6100ec61010d366004610eb0565b61032c565b6100ec610120366004610ee9565b6103f5565b6100ec610133366004610ee9565b6104ce565b61014b610146366004610f2b565b6105e0565b604080519384526020840192909252908201526060016100f6565b61018d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f6565b6101c56101c0366004610fa9565b6106f0565b604080519283526020830191909152016100f6565b6100ec6101e836600461100d565b6108e2565b6100ec6101fb36600461100d565b6108f7565b6100ec61020e366004611042565b610a26565b6100ec61010d366004611084565b61014b61022f3660046110b9565b610b07565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff858116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ea9190611207565b60e081015190915060006102fd87610c5d565b9050600061030a87610d08565b60109290921b60909290921b60989690961b9590950101019695505050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa1580156103be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e29190611207565b60e00151601084901b0191505092915050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610487573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ab9190611207565b60e081015190915060006104be85610d08565b60101b9190910195945050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105849190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85146105c3576105be85610c5d565b6104be565b5071ffffffffffffffffffffffffffffffff000001949350505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301526000918291829182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069a9190611207565b60e081015190915060006106ad8c610c5d565b905060006106ba8b610d9b565b905060008a60c01b8260a01b018d60901b018360101b0184019050808a8a97509750975050505050509750975097945050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152600091829182917f0000000000000000000000000000000000000000000000000000000000000000909116906335ea6a75906024016101e060405180830381865afa158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa9190611207565b60e08101516040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015292935090916000917f0000000000000000000000000000000000000000000000000000000000000000909116906335ea6a75906024016101e060405180830381865afa158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a9190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff89146108a9576108a489610c5d565b6108bb565b6fffffffffffffffffffffffffffffffff5b60109290921b9390930160208a901b019550608087901b0193505050509550959350505050565b60006108ef8484846108f7565b949350505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ad9190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86146109ec576109e786610c5d565b6109fe565b6fffffffffffffffffffffffffffffffff5b90506000610a0b86610d08565b60901b60109290921b91909101919091019695505050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610ab8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610adc9190611207565b60e08101519091506000610aef86610c5d565b60101b609086901b0191909101925050509392505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301526000918291829182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610b9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc19190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8c14610c0057610bfb8c610c5d565b610c12565b6fffffffffffffffffffffffffffffffff5b90506000610c1f8c610d08565b90506000610c2c8c610d9b565b60b89b909b1b60989b909b1b9a909a0160909190911b0160109190911b01019b959a50939850939650505050505050565b60006fffffffffffffffffffffffffffffffff821115610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f323820626974730000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5090565b600060ff821115610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203860448201527f20626974730000000000000000000000000000000000000000000000000000006064820152608401610cfb565b600063ffffffff821115610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610cfb565b73ffffffffffffffffffffffffffffffffffffffff81168114610e5357600080fd5b50565b61ffff81168114610e5357600080fd5b60008060008060808587031215610e7c57600080fd5b8435610e8781610e31565b935060208501359250604085013591506060850135610ea581610e56565b939692955090935050565b60008060408385031215610ec357600080fd5b8235610ece81610e31565b91506020830135610ede81610e31565b809150509250929050565b60008060408385031215610efc57600080fd5b8235610f0781610e31565b946020939093013593505050565b803560ff81168114610f2657600080fd5b919050565b600080600080600080600060e0888a031215610f4657600080fd5b8735610f5181610e31565b9650602088013595506040880135610f6881610e56565b945060608801359350610f7d60808901610f15565b925060a0880135915060c0880135905092959891949750929550565b80358015158114610f2657600080fd5b600080600080600060a08688031215610fc157600080fd5b8535610fcc81610e31565b94506020860135610fdc81610e31565b93506040860135610fec81610e31565b92506060860135915061100160808701610f99565b90509295509295909350565b60008060006060848603121561102257600080fd5b833561102d81610e31565b95602085013595506040909401359392505050565b60008060006060848603121561105757600080fd5b833561106281610e31565b925060208401359150604084013561107981610e56565b809150509250925092565b6000806040838503121561109757600080fd5b82356110a281610e31565b91506110b060208401610f99565b90509250929050565b600080600080600080600060e0888a0312156110d457600080fd5b87356110df81610e31565b9650602088013595506040880135945060608801359350610f7d60808901610f15565b6040516101e0810167ffffffffffffffff8111828210171561114d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b60006020828403121561116557600080fd5b6040516020810181811067ffffffffffffffff821117156111af577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114610f2657600080fd5b805164ffffffffff81168114610f2657600080fd5b8051610f2681610e56565b8051610f2681610e31565b60006101e0828403121561121a57600080fd5b611222611102565b61122c8484611153565b815261123a602084016111bc565b602082015261124b604084016111bc565b604082015261125c606084016111bc565b606082015261126d608084016111bc565b608082015261127e60a084016111bc565b60a082015261128f60c084016111dc565b60c08201526112a060e084016111f1565b60e08201526101006112b38185016111fc565b908201526101206112c58482016111fc565b908201526101406112d78482016111fc565b908201526101606112e98482016111fc565b908201526101806112fb8482016111bc565b908201526101a061130d8482016111bc565b908201526101c061131f8482016111bc565b90820152939250505056fea2646970667358221220550a5d1ca13779d56fd6a3f9cf5cee982d93d61310d74a95690bcec9ee75ab4a64736f6c634300080a0033";class Rt extends p.lV{constructor(...e){1===e.length?super(It,Ot,e[0]):super(...e)}deploy(e,t){return super.deploy(e,t||{})}getDeployTransaction(e,t){return super.getDeployTransaction(e,t||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static createInterface(){return new Ne.vU(It)}static connect(e,t){return new p.CH(e,It,t)}}Rt.bytecode=Ot,Rt.abi=It;class Dt extends c.Z{constructor(e,t){super(e,Ct);const{l2PoolAddress:n,encoderAddress:r}=null!==t&&void 0!==t?t:{};this.l2PoolAddress=null!==n&&void 0!==n?n:"",this.encoderAddress=null!==r&&void 0!==r?r:"",this.encoderInterface=Rt.createInterface(),this.l2PoolContractInstance=Ct.createInterface(),this.poolContractInstance=Tt.createInterface(),this.generateSupplyTxData=({user:e,reserve:t,onBehalfOf:n,amount:r,referralCode:i})=>{const o={},s=this.poolContractInstance.encodeFunctionData("supply",[t,r,null!==n&&void 0!==n?n:e,null!==i&&void 0!==i?i:"0"]);return o.to=this.l2PoolAddress,o.from=e,o.data=s,o},this.generateBorrowTxData=({user:e,reserve:t,amount:n,numericRateMode:r,referralCode:i,onBehalfOf:o})=>{const s={},a=this.poolContractInstance.encodeFunctionData("borrow",[t,n,r,null!==i&&void 0!==i?i:"0",null!==o&&void 0!==o?o:e]);return s.to=this.l2PoolAddress,s.from=e,s.data=a,s.gasLimit=_t.O$.from(l.eB[u.UQ.borrow].limit),s},this.generateSupplyWithPermitTxData=({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i,deadline:o,permitR:s,permitS:a,permitV:c})=>{const u={},l=this.poolContractInstance.encodeFunctionData("supplyWithPermit",[t,n,null!==r&&void 0!==r?r:e,null!==i&&void 0!==i?i:"0",o,c,s,a]);return u.to=this.l2PoolAddress,u.from=e,u.data=l,u},this.generateEncodedSupplyTxData=({encodedTxData:e,user:t})=>{const n={},r=this.l2PoolContractInstance.encodeFunctionData("supply",[e]);return n.to=this.l2PoolAddress,n.data=r,n.from=t,n.gasLimit=_t.O$.from(l.eB[u.UQ.supply].limit),n},this.generateEncodedBorrowTxData=({encodedTxData:e,user:t})=>{const n={},r=this.l2PoolContractInstance.encodeFunctionData("borrow",[e]);return n.to=this.l2PoolAddress,n.data=r,n.from=t,n.gasLimit=_t.O$.from(l.eB[u.UQ.borrow].limit),n},this.generateEncodedSupplyWithPermitTxData=({encodedTxData:e,signature:t,user:n})=>{const r={},i=(0,Me.splitSignature)(t),o=this.l2PoolContractInstance.encodeFunctionData("supplyWithPermit",[e,i.r,i.s]);return r.to=this.l2PoolAddress,r.data=o,r.from=n,r.gasLimit=_t.O$.from(l.eB[u.UQ.supplyWithPermit].limit),r}}async supply({user:e,reserve:t,amount:n,referralCode:r},i){const o=this.getEncoder(),s=await o.encodeSupplyParams(t,n,null!==r&&void 0!==r?r:0),a=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.supply(s),from:e,value:(0,l.oC)(t,n)});return i.push({tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(i,c,u.UQ.supply)}),i}async supplyWithPermit({user:e,reserve:t,amount:n,deadline:r,referralCode:i,permitR:o,permitS:s,permitV:a},c){const l=this.getEncoder(),d=await l.encodeSupplyWithPermitParams(t,n,null!==i&&void 0!==i?i:0,r,a,o,s),f=this.getContractInstance(this.l2PoolAddress),p=this.generateTxCallback({rawTxMethod:async()=>f.populateTransaction.supplyWithPermit(d[0],o,s),from:e});return c.push({tx:p,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,p)}),c}async withdraw({user:e,reserve:t,amount:n}){const r=this.getEncoder(),i=await r.encodeWithdrawParams(t,n),o=this.getContractInstance(this.l2PoolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.withdraw(i),from:e,action:u.UQ.withdraw});return[{tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],s,u.UQ.supply)}]}async borrow({user:e,reserve:t,amount:n,numericRateMode:r,referralCode:i}){const o=this.getEncoder(),s=await o.encodeBorrowParams(t,n,r,null!==i&&void 0!==i?i:0),a=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.borrow(s),from:e});return[{tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],c)}]}async repay({reserve:e,user:t,amount:n,numericRateMode:r},i){const o=this.getEncoder(),s=await o.encodeRepayParams(e,n,r),a=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.repay(s),from:t,value:(0,l.oC)(e,n)});return i.push({tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(i,c,u.UQ.repay)}),i}async repayWithPermit({user:e,reserve:t,amount:n,numericRateMode:r,permitR:i,permitS:o,permitV:s,deadline:a},c){const d=this.getEncoder(),f=await d.encodeRepayWithPermitParams(t,n,r,a,s,i,o),p=this.getContractInstance(this.l2PoolAddress),h=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.repayWithPermit(f[0],i,o),from:e,value:(0,l.oC)(t,n)});return c.push({tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,h,u.UQ.repay)}),c}async repayWithATokens({reserve:e,user:t,amount:n,numericRateMode:r},i){const o=this.getEncoder(),s=await o.encodeRepayWithATokensParams(e,n,r),a=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.repayWithATokens(s),from:t,value:(0,l.oC)(e,n)});return i.push({tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(i,c,u.UQ.repay)}),i}async swapBorrowRateMode({reserve:e,numericRateMode:t,user:n}){const r=this.getEncoder(),i=await r.encodeSwapBorrowRateMode(e,t),o=this.getContractInstance(this.l2PoolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.swapBorrowRateMode(i),from:n});return[{tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],s)}]}async setUserUseReserveAsCollateral({reserve:e,usageAsCollateral:t,user:n}){const r=this.getEncoder(),i=await r.encodeSetUserUseReserveAsCollateral(e,t),o=this.getContractInstance(this.l2PoolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.setUserUseReserveAsCollateral(i),from:n});return[{tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],s)}]}async liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,debtToCover:i,getAToken:o},s){const a=this.getEncoder(),c=await a.encodeLiquidationCall(r,n,t,i,null!==o&&void 0!==o&&o),d=this.getContractInstance(this.l2PoolAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.liquidationCall(c[0],c[1]),from:e,value:(0,l.oC)(n,i)});return s.push({tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],f,u.UQ.liquidationCall)}),s}getEncoder(){return this.encoderContract||""===this.encoderAddress||(this.encoderContract=Rt.connect(this.encoderAddress,this.provider)),this.encoderContract}}(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"supply",null),(0,a.__decorate)([d.pv,(0,a.__param)(0,(0,f.f1)("deadline")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"supplyWithPermit",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"withdraw",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"borrow",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"repay",null),(0,a.__decorate)([d.pv,(0,a.__param)(0,(0,f.f1)("deadline")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"repayWithPermit",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"repayWithATokens",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"swapBorrowRateMode",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"setUserUseReserveAsCollateral",null),(0,a.__decorate)([d.pv,(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Promise)],Dt.prototype,"liquidationCall",null);var Pt=n(59386);class Bt{static connect(e,t){return new p.CH(e,Mt,t)}static createInterface(){return new Ne.vU(Mt)}}const Mt=[{inputs:[{internalType:"address",name:"delegatee",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approveDelegation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"fromUser",type:"address"},{internalType:"address",name:"toUser",type:"address"}],name:"borrowAllowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}];class Nt extends c.Z{constructor(e,t){super(e,Bt),this.erc20Service=t,this.debtTokenInterface=Bt.createInterface()}approveDelegation({user:e,delegatee:t,debtTokenAddress:n,amount:r}){const i=this.getContractInstance(n),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.approveDelegation(t,r),from:e});return{tx:o,txType:u.ns.ERC20_APPROVAL,gas:this.generateTxPriceEstimation([],o)}}async approvedDelegationAmount({user:e,delegatee:t,debtTokenAddress:n}){const r=this.getContractInstance(n),i=await r.borrowAllowance(e,t),o=await this.erc20Service.decimalsOf(n);return Number(Pt.formatUnits(i,o))}generateApproveDelegationTxData({user:e,delegatee:t,debtTokenAddress:n,amount:r}){return{data:this.debtTokenInterface.encodeFunctionData("approveDelegation",[t,r]),to:n,from:e,gasLimit:_t.O$.from(l.eB[u.UQ.creditDelegationApproval].recommended)}}async isDelegationApproved({debtTokenAddress:e,allowanceGiver:t,allowanceReceiver:n,amount:r,nativeDecimals:i}){const o=await this.erc20Service.decimalsOf(e),s=this.getContractInstance(e),a=await s.borrowAllowance(t,n),c=i?_t.O$.from(r):_t.O$.from((0,l.gU)(r,o));return a.gte(c)}}(0,a.__decorate)([d.EB,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("delegatee")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Object)],Nt.prototype,"approveDelegation",null),(0,a.__decorate)([d.EB,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("delegatee")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Nt.prototype,"approvedDelegationAmount",null),(0,a.__decorate)([d.EB,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("delegatee")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Object)],Nt.prototype,"generateApproveDelegationTxData",null),(0,a.__decorate)([d.EB,(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.Oh)("allowanceGiver")),(0,a.__param)(0,(0,f.Oh)("allowanceReceiver")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Nt.prototype,"isDelegationApproved",null);class Ft{static connect(e,t){return new p.CH(e,Lt,t)}static createInterface(){return new Ne.vU(Lt)}}const Lt=[{inputs:[{internalType:"address",name:"lendingPool",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interesRateMode",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"borrowETH",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"lendingPool",type:"address"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"depositETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"lendingPool",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"rateMode",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"repayETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"lendingPool",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"withdrawETH",outputs:[],stateMutability:"nonpayable",type:"function"}];class jt extends c.Z{constructor(e,t,n){super(e,Ft),this.erc20Service=t,this.baseDebtTokenService=new Nt(this.provider,this.erc20Service),this.wethGatewayAddress=null!==n&&void 0!==n?n:"",this.depositETH=this.depositETH.bind(this),this.withdrawETH=this.withdrawETH.bind(this),this.repayETH=this.repayETH.bind(this),this.borrowETH=this.borrowETH.bind(this),this.wethGatewayInstance=Ft.createInterface(),this.generateDepositEthTxData=e=>{var t,n;return{data:this.wethGatewayInstance.encodeFunctionData("depositETH",[e.lendingPool,null!==(t=e.onBehalfOf)&&void 0!==t?t:e.user,null!==(n=e.referralCode)&&void 0!==n?n:"0"]),to:this.wethGatewayAddress,from:e.user,value:_t.O$.from(e.amount),gasLimit:_t.O$.from(l.eB[u.UQ.deposit].limit)}},this.generateBorrowEthTxData=e=>{var t;const n=e.interestRateMode===u.tk.Variable?2:1;return{data:this.wethGatewayInstance.encodeFunctionData("borrowETH",[e.lendingPool,e.amount,n,null!==(t=e.referralCode)&&void 0!==t?t:"0"]),to:this.wethGatewayAddress,from:e.user,gasLimit:_t.O$.from(l.eB[u.UQ.borrowETH].limit)}}}depositETH({lendingPool:e,user:t,amount:n,onBehalfOf:r,referralCode:i}){const o=(0,l.gU)(n,18),s=this.getContractInstance(this.wethGatewayAddress),a=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.depositETH(e,null!==r&&void 0!==r?r:t,null!==i&&void 0!==i?i:"0"),from:t,value:o});return[{tx:a,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],a)}]}async borrowETH({lendingPool:e,user:t,amount:n,debtTokenAddress:r,interestRateMode:i,referralCode:o}){const s=[],a=(0,l.gU)(n,18),c=i===u.tk.Variable?2:1;if(!r)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");if(!(await this.baseDebtTokenService.isDelegationApproved({debtTokenAddress:r,allowanceGiver:t,allowanceReceiver:this.wethGatewayAddress,amount:n}))){const e=this.baseDebtTokenService.approveDelegation({user:t,delegatee:this.wethGatewayAddress,debtTokenAddress:r,amount:pt.Bz.toString()});s.push(e)}const d=this.getContractInstance(this.wethGatewayAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.borrowETH(e,a,c,null!==o&&void 0!==o?o:"0"),from:t});return s.push({tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(s,f,u.UQ.borrowETH)}),s}async withdrawETH({lendingPool:e,user:t,amount:n,onBehalfOf:r,aTokenAddress:i}){const o=[],{isApproved:s,approve:a}=this.erc20Service,c="-1"===n?pt.Bz.toString():(0,l.gU)(n,18);if(!(await s({token:i,user:t,spender:this.wethGatewayAddress,amount:n}))){const e=a({user:t,token:i,spender:this.wethGatewayAddress,amount:pt.Bz.toString()});o.push(e)}const d=this.getContractInstance(this.wethGatewayAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.withdrawETH(e,c,null!==r&&void 0!==r?r:t),from:t});return o.push({tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(o,f,u.UQ.withdrawETH)}),o}repayETH({lendingPool:e,user:t,amount:n,interestRateMode:r,onBehalfOf:i}){const o=(0,l.gU)(n,18),s=r===u.tk.Variable?2:1,a=this.getContractInstance(this.wethGatewayAddress),c=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.repayETH(e,o,s,null!==i&&void 0!==i?i:t),gasSurplus:30,from:t,value:o});return[{tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],c)}]}}(0,a.__decorate)([d.N,(0,a.__param)(0,(0,f.Oh)("lendingPool")),(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.rX)("referralCode")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],jt.prototype,"depositETH",null),(0,a.__decorate)([d.N,(0,a.__param)(0,(0,f.Oh)("lendingPool")),(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.rX)("referralCode")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],jt.prototype,"borrowETH",null),(0,a.__decorate)([d.N,(0,a.__param)(0,(0,f.Oh)("lendingPool")),(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("aTokenAddress")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],jt.prototype,"withdrawETH",null),(0,a.__decorate)([d.N,(0,a.__param)(0,(0,f.Oh)("lendingPool")),(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],jt.prototype,"repayETH",null);class Ut extends c.Z{constructor(e,t){super(e,Tt);const{POOL:n,FLASH_LIQUIDATION_ADAPTER:r,REPAY_WITH_COLLATERAL_ADAPTER:i,SWAP_COLLATERAL_ADAPTER:o,WETH_GATEWAY:s,L2_ENCODER:a}=null!==t&&void 0!==t?t:{};this.poolAddress=null!==n&&void 0!==n?n:"",this.flashLiquidationAddress=null!==r&&void 0!==r?r:"",this.swapCollateralAddress=null!==o&&void 0!==o?o:"",this.repayWithCollateralAddress=null!==i&&void 0!==i?i:"",this.l2EncoderAddress=null!==a&&void 0!==a?a:"",this.erc20_2612Service=new Ye(e),this.erc20Service=new ht.A(e),this.synthetixService=new Et.K(e),this.wethGatewayService=new jt(e,this.erc20Service,s),this.liquiditySwapAdapterService=new bt(e,o),this.paraswapRepayWithCollateralAdapterService=new At(e,i),this.l2PoolService=new Dt(e,{l2PoolAddress:this.poolAddress,encoderAddress:this.l2EncoderAddress})}async getReserveData(e){return this.getContractInstance(this.poolAddress).getReserveData(e)}async deposit({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.depositETH({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:r,referralCode:i});const{isApproved:o,approve:s,decimalsOf:a}=this.erc20Service,c=[],d=await a(t),f=(0,l.gU)(n,d);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:f})))throw new Error("Not enough funds to execute operation");if(!(await o({token:t,user:e,spender:this.poolAddress,amount:n}))){const n=s({user:e,token:t,spender:this.poolAddress,amount:l.zn});c.push(n)}const p=this.getContractInstance(this.poolAddress),h=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.deposit(t,f,null!==r&&void 0!==r?r:e,null!==i&&void 0!==i?i:"0"),from:e,value:(0,l.oC)(t,f),action:u.UQ.supply});return c.push({tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,h,u.UQ.supply)}),c}async supply({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i,useOptimizedPath:o}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.depositETH({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:r,referralCode:i});const{isApproved:s,approve:a,decimalsOf:c}=this.erc20Service,d=[],f=await c(t),p=(0,l.gU)(n,f);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:p})))throw new Error("Not enough funds to execute operation");if(!(await s({token:t,user:e,spender:this.poolAddress,amount:n}))){const n=a({user:e,token:t,spender:this.poolAddress,amount:l.zn});d.push(n)}const h=this.getContractInstance(this.poolAddress);if(o)return this.l2PoolService.supply({user:e,reserve:t,amount:p,referralCode:i},d);const m=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.supply(t,p,null!==r&&void 0!==r?r:e,null!==i&&void 0!==i?i:"0"),from:e,value:(0,l.oC)(t,p),action:u.UQ.supply});return d.push({tx:m,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(d,m,u.UQ.supply)}),d}async signERC20Approval({user:e,reserve:t,amount:n,deadline:r}){const{getTokenData:i,isApproved:o}=this.erc20Service,{name:s,decimals:a}=await i(t),c="-1"===n?pt.Bz.toString():(0,l.gU)(n,a);if(await o({token:t,user:e,spender:this.poolAddress,amount:n}))return"";const{chainId:u}=await this.provider.getNetwork(),d=await this.erc20_2612Service.getNonce({token:t,owner:e});if(null===d)return"";const f={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},primaryType:"Permit",domain:{name:s,version:"1",chainId:u,verifyingContract:t},message:{owner:e,spender:this.poolAddress,value:c,nonce:d,deadline:r}};return JSON.stringify(f)}async supplyWithPermit({user:e,reserve:t,onBehalfOf:n,amount:r,referralCode:i,signature:o,useOptimizedPath:s,deadline:a}){const c=[],{decimalsOf:d}=this.erc20Service,f=this.getContractInstance(this.poolAddress),p=await d(t),h=(0,l.gU)(r,p),m=(0,ze.splitSignature)(o);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:h})))throw new Error("Not enough funds to execute operation");if(s)return this.l2PoolService.supplyWithPermit({user:e,reserve:t,amount:h,referralCode:i,deadline:a,permitV:m.v,permitR:m.r,permitS:m.s},c);const g=this.generateTxCallback({rawTxMethod:async()=>f.populateTransaction.supplyWithPermit(t,h,null!==n&&void 0!==n?n:e,null!==i&&void 0!==i?i:0,a,m.v,m.r,m.s),from:e,action:u.UQ.supplyWithPermit});return c.push({tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,g,u.UQ.supplyWithPermit)}),c}async withdraw({user:e,reserve:t,amount:n,onBehalfOf:r,aTokenAddress:i,useOptimizedPath:o}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To withdraw ETH you need to pass the aWETH token address");return this.wethGatewayService.withdrawETH({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:r,aTokenAddress:i})}const{decimalsOf:s}=this.erc20Service,a=await s(t),c="-1"===n?pt.Bz.toString():(0,l.gU)(n,a);if(o)return this.l2PoolService.withdraw({user:e,reserve:t,amount:c});const d=this.getContractInstance(this.poolAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.withdraw(t,c,null!==r&&void 0!==r?r:e),from:e,action:u.UQ.withdraw});return[{tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],f,u.UQ.withdraw)}]}async borrow({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:i,onBehalfOf:o,referralCode:s,useOptimizedPath:a}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");return this.wethGatewayService.borrowETH({lendingPool:this.poolAddress,user:e,amount:n,debtTokenAddress:i,interestRateMode:r,referralCode:s})}const{decimalsOf:c}=this.erc20Service,d=await c(t),f=(0,l.gU)(n,d),p=r===u.tk.Variable?2:1;if(a)return this.l2PoolService.borrow({user:e,reserve:t,amount:f,numericRateMode:p,referralCode:s});const h=this.getContractInstance(this.poolAddress),m=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.borrow(t,f,p,null!==s&&void 0!==s?s:0,null!==o&&void 0!==o?o:e),from:e,action:u.UQ.borrow});return[{tx:m,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],m,u.UQ.borrow)}]}async repay({user:e,reserve:t,amount:n,interestRateMode:r,onBehalfOf:i,useOptimizedPath:o}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.repayETH({lendingPool:this.poolAddress,user:e,amount:n,interestRateMode:r,onBehalfOf:i});const s=[],{isApproved:a,approve:c,decimalsOf:d}=this.erc20Service,f=this.getContractInstance(this.poolAddress),{populateTransaction:p}=f,h=r===u.tk.Variable?2:1,m=await d(t),g="-1"===n?pt.Bz.toString():(0,l.gU)(n,m);if("-1"!==n){if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:g})))throw new Error("Not enough funds to execute operation")}if(!(await a({token:t,user:e,spender:this.poolAddress,amount:n}))){const n=c({user:e,token:t,spender:this.poolAddress,amount:l.zn});s.push(n)}if(o)return this.l2PoolService.repay({user:e,reserve:t,amount:g,numericRateMode:h},s);const y=this.generateTxCallback({rawTxMethod:async()=>p.repay(t,g,h,null!==i&&void 0!==i?i:e),from:e,value:(0,l.oC)(t,g),action:u.UQ.repay});return s.push({tx:y,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(s,y,u.UQ.repay)}),s}async repayWithPermit({user:e,reserve:t,amount:n,interestRateMode:r,onBehalfOf:i,signature:o,useOptimizedPath:s,deadline:a}){const c=[],{decimalsOf:d}=this.erc20Service,f=this.getContractInstance(this.poolAddress),{populateTransaction:p}=f,h=r===u.tk.Variable?2:1,m=await d(t),g=(0,ze.splitSignature)(o),y="-1"===n?pt.Bz.toString():(0,l.gU)(n,m);if("-1"!==n){if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:y})))throw new Error("Not enough funds to execute operation")}if(s)return this.l2PoolService.repayWithPermit({user:e,reserve:t,amount:y,numericRateMode:h,deadline:a,permitR:g.r,permitS:g.s,permitV:g.v},c);const b=this.generateTxCallback({rawTxMethod:async()=>p.repayWithPermit(t,y,h,null!==i&&void 0!==i?i:e,a,g.v,g.r,g.s),from:e,value:(0,l.oC)(t,y),action:u.UQ.repayWithPermit});return c.push({tx:b,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,b,u.UQ.repayWithPermit)}),c}async swapBorrowRateMode({user:e,reserve:t,interestRateMode:n,useOptimizedPath:r}){const i=n===u.tk.Variable?2:1;if(r)return this.l2PoolService.swapBorrowRateMode({user:e,reserve:t,numericRateMode:i});const o=this.getContractInstance(this.poolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.swapBorrowRateMode(t,i),from:e});return[{txType:u.ns.DLP_ACTION,tx:s,gas:this.generateTxPriceEstimation([],s)}]}async setUsageAsCollateral({user:e,reserve:t,usageAsCollateral:n,useOptimizedPath:r}){const i=this.getContractInstance(this.poolAddress);if(r)return this.l2PoolService.setUserUseReserveAsCollateral({user:e,reserve:t,usageAsCollateral:n});const o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.setUserUseReserveAsCollateral(t,n),from:e});return[{tx:o,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],o)}]}async liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,purchaseAmount:i,getAToken:o,liquidateAll:s,useOptimizedPath:a}){const c=[],{isApproved:d,approve:f,decimalsOf:p}=this.erc20Service;if(!(await d({token:n,user:e,spender:this.poolAddress,amount:i}))){const t=f({user:e,token:n,spender:this.poolAddress,amount:l.zn});c.push(t)}let h=pt.Bz.toString();if(!s){const e=await p(n);h=(0,l.gU)(i,e)}if(a)return this.l2PoolService.liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,debtToCover:h,getAToken:o},c);const m=this.getContractInstance(this.poolAddress),g=this.generateTxCallback({rawTxMethod:async()=>m.populateTransaction.liquidationCall(r,n,t,h,null!==o&&void 0!==o&&o),from:e,value:(0,l.oC)(n,h)});return c.push({tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,g,u.UQ.liquidationCall)}),c}async swapCollateral({user:e,flash:t,fromAsset:n,fromAToken:r,toAsset:i,fromAmount:o,minToAmount:s,permitSignature:a,swapAll:c,referralCode:d,augustus:f,swapCallData:p}){const h=[],m=null!==a&&void 0!==a?a:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:r,user:e,spender:this.swapCollateralAddress,amount:o}))){const t=this.erc20Service.approve({user:e,token:r,spender:this.swapCollateralAddress,amount:pt.Bz.toString()});h.push(t)}const g=await this.erc20Service.decimalsOf(n),y=(0,l.gU)(o,g),b=await this.erc20Service.decimalsOf(i),v=(0,l.gU)(s,b),w=this.getContractInstance(this.poolAddress);if(t){const t=((e,t,n,r,i,o,s,a,c,u)=>ft.$.encode(["address","uint256","uint256","bytes","address","tuple(uint256,uint256,uint8,bytes32,bytes32)"],[e,t,n,r,i,[o,s,a,c,u]]))(i,v,c?yt(p):0,p,f,m.amount,m.deadline,m.v,m.r,m.s),r=(Number(o)+Number(o)*Number(l.zp)/100).toString(),s=(0,l.gU)(r,g),a=this.generateTxCallback({rawTxMethod:async()=>w.populateTransaction.flashLoanSimple(this.swapCollateralAddress,n,c?s:y,t,null!==d&&void 0!==d?d:"0"),from:e,action:u.UQ.swapCollateral});return h.push({tx:a,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(h,a,u.UQ.swapCollateral)}),h}const x=this.liquiditySwapAdapterService.swapAndDeposit({user:e,assetToSwapFrom:n,assetToSwapTo:i,amountToSwap:y,minAmountToReceive:v,swapAll:c,swapCallData:p,augustus:f,permitParams:m},h);return h.push(x),h}async paraswapRepayWithCollateral({user:e,fromAsset:t,fromAToken:n,assetToRepay:r,repayWithAmount:i,repayAmount:o,permitSignature:s,repayAllDebt:a,rateMode:c,referralCode:d,flash:f,swapAndRepayCallData:p,augustus:h}){const m=[],g=null!==s&&void 0!==s?s:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:n,user:e,spender:this.repayWithCollateralAddress,amount:i}))){const t=this.erc20Service.approve({user:e,token:n,spender:this.repayWithCollateralAddress,amount:pt.Bz.toString()});m.push(t)}const y=await this.erc20Service.decimalsOf(t),b=(0,l.gU)(i,y),v=(Number(i)+Number(i)*Number(l.zp)/100).toString(),w=(0,l.gU)(v,y),x=await this.erc20Service.decimalsOf(r),A=(0,l.gU)(o,x),E=c===u.tk.Stable?1:2;if(f){const n=ft.$.encode(["bytes","address"],[p,h]),i=ft.$.encode(["address","uint256","uint256","uint256","bytes","uint256","uint256","uint8","bytes32","bytes32"],[r,A,a?(0,l.mz)(p):0,E,n,g.amount,g.deadline,g.v,g.r,g.s]),o=this.getContractInstance(this.poolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.flashLoanSimple(this.repayWithCollateralAddress,t,a?w:b,i,null!==d&&void 0!==d?d:"0"),from:e,action:u.UQ.repayCollateral});return m.push({tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(m,s,u.UQ.repayCollateral)}),m}const _=this.paraswapRepayWithCollateralAdapterService.swapAndRepay({user:e,collateralAsset:t,debtAsset:r,collateralAmount:b,debtRepayAmount:A,debtRateMode:c,permitParams:g,repayAll:null!==a&&void 0!==a&&a,swapAndRepayCallData:p,augustus:h},m);return m.push(_),m}async flashLiquidation({user:e,collateralAsset:t,borrowedAsset:n,debtTokenCover:r,liquidateAll:i,initiator:o,useEthPath:s}){const a=[],c=this.getContractInstance(this.poolAddress),d=await this.erc20Service.decimalsOf(n),f=(0,l.gU)(r,d),p=i?pt.Bz.toString():f,h=i?(0,l.gU)((m=r,(Number(m)+Number(m)*Number(m)/100).toString()),d):f;var m;const g=ft.$.encode(["address","address","address","uint256","bool"],[t,n,e,p,null!==s&&void 0!==s&&s]),y=this.generateTxCallback({rawTxMethod:async()=>c.populateTransaction.flashLoanSimple(this.flashLiquidationAddress,n,h,g,"0"),from:o});return a.push({tx:y,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(a,y,u.UQ.liquidationFlash)}),a}async repayWithATokens({user:e,amount:t,reserve:n,rateMode:r,useOptimizedPath:i}){if(n.toLowerCase()===l.hP.toLowerCase())throw new Error("Can not repay with aTokens with eth. Should be WETH instead");const o=[],{decimalsOf:s}=this.erc20Service,a=this.getContractInstance(this.poolAddress),{populateTransaction:c}=a,d=r===u.tk.Variable?2:1,f=await s(n),p="-1"===t?pt.Bz.toString():(0,l.gU)(t,f);if(i)return this.l2PoolService.repayWithATokens({user:e,reserve:n,amount:p,numericRateMode:d},o);const h=this.generateTxCallback({rawTxMethod:async()=>c.repayWithATokens(n,p,d),from:e,value:(0,l.oC)(n,p)});return o.push({tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(o,h,u.UQ.repay)}),o}setUserEMode({user:e,categoryId:t}){const n=this.getContractInstance(this.poolAddress),r=this.generateTxCallback({rawTxMethod:async()=>n.populateTransaction.setUserEMode(t),from:e});return[{tx:r,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],r,u.UQ.repay)}]}async migrateV3({migrator:e,borrowedAssets:t,borrowedAmounts:n,interestRatesModes:r,user:i,suppliedPositions:o,borrowedPositions:s,permits:a}){const c=this.getContractInstance(this.poolAddress),u=s.map((e=>[e.address,e.amount,e.rateMode.toString()])),l=a.map((e=>[e.aToken,e.value,e.deadline,e.v,e.r,e.s])),d=ft.$.encode(["address[]","(address, uint256, uint256)[]","(address, uint256, uint256, uint8, bytes32, bytes32)[]"],[o,u,l]);return c.populateTransaction.flashLoan(e,t,n,r,i,d,"0")}}(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[String]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"getReserveData",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"deposit",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"supply",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"signERC20Approval",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.K5)("referralCode")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"supplyWithPermit",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.Oh)("aTokenAddress")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"withdraw",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"borrow",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"repay",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"repayWithPermit",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"swapBorrowRateMode",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"setUsageAsCollateral",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("liquidator")),(0,a.__param)(0,(0,f.Oh)("liquidatedUser")),(0,a.__param)(0,(0,f.Oh)("debtReserve")),(0,a.__param)(0,(0,f.Oh)("collateralReserve")),(0,a.__param)(0,(0,f.K5)("purchaseAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"liquidationCall",null),(0,a.__decorate)([d.Gv,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("fromAsset")),(0,a.__param)(0,(0,f.Oh)("fromAToken")),(0,a.__param)(0,(0,f.Oh)("toAsset")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__param)(0,(0,f.K5)("fromAmount")),(0,a.__param)(0,(0,f.K5)("minToAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"swapCollateral",null),(0,a.__decorate)([d.M9,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("fromAsset")),(0,a.__param)(0,(0,f.Oh)("fromAToken")),(0,a.__param)(0,(0,f.Oh)("assetToRepay")),(0,a.__param)(0,(0,f.K5)("repayWithAmount")),(0,a.__param)(0,(0,f.K5)("repayAmount")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"paraswapRepayWithCollateral",null),(0,a.__decorate)([d.yZ,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("collateralAsset")),(0,a.__param)(0,(0,f.Oh)("borrowedAsset")),(0,a.__param)(0,(0,f.K5)("debtTokenCover")),(0,a.__param)(0,(0,f.Oh)("initiator")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"flashLiquidation",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"repayWithATokens",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.rX)("categoryId")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],Ut.prototype,"setUserEMode",null),(0,a.__decorate)([d.mM,(0,a.__param)(0,(0,f.Oh)("migrator")),(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Gq)("borrowedAssets")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Ut.prototype,"migrateV3",null);class Zt{static connect(e,t){return new p.CH(e,Ht,t)}}const Ht=[{inputs:[{internalType:"address",name:"collateralAsset",type:"address"},{internalType:"address",name:"debtAsset",type:"address"},{internalType:"uint256",name:"collateralAmount",type:"uint256"},{internalType:"uint256",name:"debtRepayAmount",type:"uint256"},{internalType:"uint256",name:"debtRateMode",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct IRepayWithCollateral.PermitSignature",name:"permitSignature",type:"tuple"},{internalType:"bool",name:"useEthPath",type:"bool"}],name:"swapAndRepay",outputs:[],stateMutability:"nonpayable",type:"function"}];class zt extends c.Z{constructor(e,t){super(e,Zt),this.repayWithCollateralAddress=null!==t&&void 0!==t?t:"",this.swapAndRepay=this.swapAndRepay.bind(this)}swapAndRepay({user:e,collateralAsset:t,debtAsset:n,collateralAmount:r,debtRepayAmount:i,debtRateMode:o,permit:s,useEthPath:a},c){const l=o===u.tk.Stable?1:2,d=this.getContractInstance(this.repayWithCollateralAddress),f=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.swapAndRepay(t,n,r,i,l,s,null!==a&&void 0!==a&&a),from:e});return{tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(null!==c&&void 0!==c?c:[],f,u.UQ.repayCollateral)}}}(0,a.__decorate)([d.mB,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("collateralAsset")),(0,a.__param)(0,(0,f.Oh)("debtAsset")),(0,a.__param)(0,(0,f.K5)("collateralAmount")),(0,a.__param)(0,(0,f.K5)("debtRepayAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object,Array]),(0,a.__metadata)("design:returntype",Object)],zt.prototype,"swapAndRepay",null);class Gt{static connect(e,t){return new p.CH(e,Vt,t)}static createInterface(){return new Ne.vU(Vt)}}const Vt=[{inputs:[],name:"FLASHLOAN_PREMIUM_TOTAL",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"interestRateMode",type:"uint256"},{internalType:"uint16",name:"referralCode",type:"uint16"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"borrow",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"deposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"uint256[]",name:"modes",type:"uint256[]"},{internalType:"address",name:"onBehalfOf",type:"address"},{internalType:"bytes",name:"params",type:"bytes"},{internalType:"uint16",name:"referralCode",type:"uint16"}],name:"flashLoan",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"collateral",type:"address"},{internalType:"address",name:"reserve",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"purchaseAmount",type:"uint256"},{internalType:"bool",name:"receiveAToken",type:"bool"}],name:"liquidationCall",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"rateMode",type:"uint256"},{internalType:"address",name:"onBehalfOf",type:"address"}],name:"repay",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"bool",name:"useAsCollateral",type:"bool"}],name:"setUserUseReserveAsCollateral",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"uint256",name:"rateMode",type:"uint256"}],name:"swapBorrowRateMode",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"to",type:"address"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}];class Wt extends c.Z{constructor(e,t){super(e,Gt);const{LENDING_POOL:n,FLASH_LIQUIDATION_ADAPTER:r,REPAY_WITH_COLLATERAL_ADAPTER:i,SWAP_COLLATERAL_ADAPTER:o,WETH_GATEWAY:s}=null!==t&&void 0!==t?t:{};this.lendingPoolAddress=null!==n&&void 0!==n?n:"",this.flashLiquidationAddress=null!==r&&void 0!==r?r:"",this.swapCollateralAddress=null!==o&&void 0!==o?o:"",this.repayWithCollateralAddress=null!==i&&void 0!==i?i:"",this.erc20Service=new ht.A(e),this.synthetixService=new Et.K(e),this.wethGatewayService=new jt(e,this.erc20Service,s),this.liquiditySwapAdapterService=new bt(e,o),this.repayWithCollateralAdapterService=new zt(e,i),this.paraswapRepayWithCollateralAdapterService=new At(e,i)}async deposit({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.depositETH({lendingPool:this.lendingPoolAddress,user:e,amount:n,onBehalfOf:r,referralCode:i});const{isApproved:o,approve:s,decimalsOf:a}=this.erc20Service,c=[],d=await a(t),f=(0,l.gU)(n,d);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:f})))throw new Error("Not enough funds to execute operation");if(!(await o({token:t,user:e,spender:this.lendingPoolAddress,amount:n}))){const n=s({user:e,token:t,spender:this.lendingPoolAddress,amount:l.zn});c.push(n)}const p=this.getContractInstance(this.lendingPoolAddress),h=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.deposit(t,f,null!==r&&void 0!==r?r:e,null!==i&&void 0!==i?i:"0"),from:e,value:(0,l.oC)(t,f),action:u.UQ.deposit});return c.push({tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,h,u.UQ.deposit)}),c}async withdraw({user:e,reserve:t,amount:n,onBehalfOf:r,aTokenAddress:i}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To withdraw ETH you need to pass the aWETH token address");return this.wethGatewayService.withdrawETH({lendingPool:this.lendingPoolAddress,user:e,amount:n,onBehalfOf:r,aTokenAddress:i})}const{decimalsOf:o}=this.erc20Service,s=await o(t),a="-1"===n?pt.Bz.toString():(0,l.gU)(n,s),c=this.getContractInstance(this.lendingPoolAddress),d=this.generateTxCallback({rawTxMethod:async()=>c.populateTransaction.withdraw(t,a,null!==r&&void 0!==r?r:e),from:e,action:u.UQ.withdraw});return[{tx:d,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],d,u.UQ.withdraw)}]}async borrow({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:i,onBehalfOf:o,referralCode:s}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");return this.wethGatewayService.borrowETH({lendingPool:this.lendingPoolAddress,user:e,amount:n,debtTokenAddress:i,interestRateMode:r,referralCode:s})}const{decimalsOf:a}=this.erc20Service,c=await a(t),d=(0,l.gU)(n,c),f=r===u.tk.Variable?2:1,p=this.getContractInstance(this.lendingPoolAddress),h=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.borrow(t,d,f,null!==s&&void 0!==s?s:0,null!==o&&void 0!==o?o:e),from:e,action:u.UQ.borrow});return[{tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],h,u.UQ.borrow)}]}async repay({user:e,reserve:t,amount:n,interestRateMode:r,onBehalfOf:i}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.repayETH({lendingPool:this.lendingPoolAddress,user:e,amount:n,interestRateMode:r,onBehalfOf:i});const o=[],{isApproved:s,approve:a,decimalsOf:c}=this.erc20Service,d=this.getContractInstance(this.lendingPoolAddress),{populateTransaction:f}=d,p=r===u.tk.Variable?2:1,h=await c(t),m="-1"===n?pt.Bz.toString():(0,l.gU)(n,h);if("-1"!==n){if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:m})))throw new Error("Not enough funds to execute operation")}if(!(await s({token:t,user:e,spender:this.lendingPoolAddress,amount:n}))){const n=a({user:e,token:t,spender:this.lendingPoolAddress,amount:l.zn});o.push(n)}const g=this.generateTxCallback({rawTxMethod:async()=>f.repay(t,m,p,null!==i&&void 0!==i?i:e),from:e,value:(0,l.oC)(t,m),action:u.UQ.repay});return o.push({tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(o,g,u.UQ.repay)}),o}swapBorrowRateMode({user:e,reserve:t,interestRateMode:n}){const r=n===u.tk.Variable?2:1,i=this.getContractInstance(this.lendingPoolAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.swapBorrowRateMode(t,r),from:e});return[{txType:u.ns.DLP_ACTION,tx:o,gas:this.generateTxPriceEstimation([],o)}]}setUsageAsCollateral({user:e,reserve:t,usageAsCollateral:n}){const r=this.getContractInstance(this.lendingPoolAddress),i=this.generateTxCallback({rawTxMethod:async()=>r.populateTransaction.setUserUseReserveAsCollateral(t,n),from:e,action:u.UQ.setUsageAsCollateral});return[{tx:i,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],i,u.UQ.setUsageAsCollateral)}]}async liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,purchaseAmount:i,getAToken:o,liquidateAll:s}){const a=[],{isApproved:c,approve:d,decimalsOf:f}=this.erc20Service;if(!(await c({token:n,user:e,spender:this.lendingPoolAddress,amount:i}))){const t=d({user:e,token:n,spender:this.lendingPoolAddress,amount:l.zn});a.push(t)}let p=pt.Bz.toString();if(!s){const e=await f(n);p=(0,l.gU)(i,e)}const h=this.getContractInstance(this.lendingPoolAddress),m=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.liquidationCall(r,n,t,p,null!==o&&void 0!==o&&o),from:e,value:(0,l.oC)(n,p)});return a.push({tx:m,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(a,m,u.UQ.liquidationCall)}),a}async swapCollateral({user:e,flash:t,fromAsset:n,fromAToken:r,toAsset:i,fromAmount:o,minToAmount:s,permitSignature:a,swapAll:c,onBehalfOf:d,referralCode:f,augustus:p,swapCallData:h}){const m=[],g=null!==a&&void 0!==a?a:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:r,user:e,spender:this.swapCollateralAddress,amount:o}))){const t=this.erc20Service.approve({user:e,token:r,spender:this.swapCollateralAddress,amount:pt.Bz.toString()});m.push(t)}const y=await this.erc20Service.decimalsOf(n),b=(0,l.gU)(o,y),v=await this.erc20Service.decimalsOf(i),w=(0,l.gU)(s,v),x=this.getContractInstance(this.lendingPoolAddress);if(t){const t=((e,t,n,r,i,o,s,a,c,u)=>ft.$.encode(["address","uint256","uint256","bytes","address","tuple(uint256,uint256,uint8,bytes32,bytes32)"],[e,t,n,r,i,[o,s,a,c,u]]))(i,w,c?yt(h):0,h,p,g.amount,g.deadline,g.v,g.r,g.s),r=(Number(o)+Number(o)*Number(l.zp)/100).toString(),s=(0,l.gU)(r,y),a=this.generateTxCallback({rawTxMethod:async()=>x.populateTransaction.flashLoan(this.swapCollateralAddress,[n],c?[s]:[b],[0],null!==d&&void 0!==d?d:e,t,null!==f&&void 0!==f?f:"0"),from:e,action:u.UQ.swapCollateral});return m.push({tx:a,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(m,a,u.UQ.swapCollateral)}),m}const A=this.liquiditySwapAdapterService.swapAndDeposit({user:e,assetToSwapFrom:n,assetToSwapTo:i,amountToSwap:b,minAmountToReceive:w,swapAll:c,swapCallData:h,augustus:p,permitParams:g},m);return m.push(A),m}async repayWithCollateral({user:e,fromAsset:t,fromAToken:n,assetToRepay:r,repayWithAmount:i,repayAmount:o,permitSignature:s,repayAllDebt:a,rateMode:c,onBehalfOf:d,referralCode:f,flash:p,useEthPath:h}){const m=[],g=null!==s&&void 0!==s?s:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:n,user:e,spender:this.repayWithCollateralAddress,amount:i}))){const t=this.erc20Service.approve({user:e,token:n,spender:this.repayWithCollateralAddress,amount:pt.Bz.toString()});m.push(t)}const y=await this.erc20Service.decimalsOf(t),b=(0,l.gU)(i,y),v=(Number(o)+Number(o)*Number(l.zp)/100).toString(),w=await this.erc20Service.decimalsOf(r),x=a?(0,l.gU)(v,w):(0,l.gU)(o,w),A=c===u.tk.Stable?1:2;if(p){const n=ft.$.encode(["address","uint256","uint256","uint256","uint256","uint8","bytes32","bytes32","bool"],[t,b,A,g.amount,g.deadline,g.v,g.r,g.s,null!==h&&void 0!==h&&h]),i=this.getContractInstance(this.lendingPoolAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.flashLoan(this.repayWithCollateralAddress,[r],[x],[0],null!==d&&void 0!==d?d:e,n,null!==f&&void 0!==f?f:"0"),from:e,action:u.UQ.repayCollateral});return m.push({tx:o,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(m,o,u.UQ.repayCollateral)}),m}const E=this.repayWithCollateralAdapterService.swapAndRepay({user:e,collateralAsset:t,debtAsset:r,collateralAmount:b,debtRepayAmount:x,debtRateMode:c,permit:g,useEthPath:h},m);return m.push(E),m}async paraswapRepayWithCollateral({user:e,fromAsset:t,fromAToken:n,assetToRepay:r,repayWithAmount:i,repayAmount:o,permitSignature:s,repayAllDebt:a,rateMode:c,onBehalfOf:d,referralCode:f,flash:p,swapAndRepayCallData:h,augustus:m}){const g=[],y=null!==s&&void 0!==s?s:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:n,user:e,spender:this.repayWithCollateralAddress,amount:i}))){const t=this.erc20Service.approve({user:e,token:n,spender:this.repayWithCollateralAddress,amount:pt.Bz.toString()});g.push(t)}const b=await this.erc20Service.decimalsOf(t),v=(0,l.gU)(i,b),w=(Number(i)+Number(i)*Number(l.zp)/100).toString(),x=(0,l.gU)(w,b),A=await this.erc20Service.decimalsOf(r),E=(0,l.gU)(o,A),_=c===u.tk.Stable?1:2;if(p){const n=ft.$.encode(["bytes","address"],[h,m]),i=ft.$.encode(["address","uint256","uint256","uint256","bytes","uint256","uint256","uint8","bytes32","bytes32"],[r,E,a?(0,l.mz)(h):0,_,n,y.amount,y.deadline,y.v,y.r,y.s]),o=this.getContractInstance(this.lendingPoolAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.flashLoan(this.repayWithCollateralAddress,[t],a?[x]:[v],[0],null!==d&&void 0!==d?d:e,i,null!==f&&void 0!==f?f:"0"),from:e,action:u.UQ.repayCollateral});return g.push({tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(g,s,u.UQ.repayCollateral)}),g}const k=this.paraswapRepayWithCollateralAdapterService.swapAndRepay({user:e,collateralAsset:t,debtAsset:r,collateralAmount:v,debtRepayAmount:E,debtRateMode:c,permitParams:y,repayAll:null!==a&&void 0!==a&&a,swapAndRepayCallData:h,augustus:m},g);return g.push(k),g}async flashLiquidation({user:e,collateralAsset:t,borrowedAsset:n,debtTokenCover:r,liquidateAll:i,initiator:o,useEthPath:s}){const a=[],c=this.getContractInstance(this.lendingPoolAddress),d=await this.erc20Service.decimalsOf(n),f=(0,l.gU)(r,d),p=i?pt.Bz.toString():f,h=i?(0,l.gU)((m=r,(Number(m)+Number(m)*Number(m)/100).toString()),d):f;var m;const g=ft.$.encode(["address","address","address","uint256","bool"],[t,n,e,p,null!==s&&void 0!==s&&s]),y=this.generateTxCallback({rawTxMethod:async()=>c.populateTransaction.flashLoan(this.flashLiquidationAddress,[n],[h],[0],o,g,"0"),from:o});return a.push({tx:y,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(a,y,u.UQ.liquidationFlash)}),a}}(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"deposit",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.Oh)("aTokenAddress")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"withdraw",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.K5)("amount")),(0,a.__param)(0,(0,f.Oh)("debtTokenAddress")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"borrow",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__param)(0,(0,f.lw)("amount")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"repay",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],Wt.prototype,"swapBorrowRateMode",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],Wt.prototype,"setUsageAsCollateral",null),(0,a.__decorate)([d.en,(0,a.__param)(0,(0,f.Oh)("liquidator")),(0,a.__param)(0,(0,f.Oh)("liquidatedUser")),(0,a.__param)(0,(0,f.Oh)("debtReserve")),(0,a.__param)(0,(0,f.Oh)("collateralReserve")),(0,a.__param)(0,(0,f.K5)("purchaseAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"liquidationCall",null),(0,a.__decorate)([d.Yr,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("fromAsset")),(0,a.__param)(0,(0,f.Oh)("fromAToken")),(0,a.__param)(0,(0,f.Oh)("toAsset")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__param)(0,(0,f.K5)("fromAmount")),(0,a.__param)(0,(0,f.K5)("minToAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"swapCollateral",null),(0,a.__decorate)([d.j7,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("fromAsset")),(0,a.__param)(0,(0,f.Oh)("fromAToken")),(0,a.__param)(0,(0,f.Oh)("assetToRepay")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.K5)("repayWithAmount")),(0,a.__param)(0,(0,f.K5)("repayAmount")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"repayWithCollateral",null),(0,a.__decorate)([d.j7,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("fromAsset")),(0,a.__param)(0,(0,f.Oh)("fromAToken")),(0,a.__param)(0,(0,f.Oh)("assetToRepay")),(0,a.__param)(0,(0,f.Oh)("onBehalfOf")),(0,a.__param)(0,(0,f.K5)("repayWithAmount")),(0,a.__param)(0,(0,f.K5)("repayAmount")),(0,a.__param)(0,(0,f.Oh)("augustus")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"paraswapRepayWithCollateral",null),(0,a.__decorate)([d.bt,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("collateralAsset")),(0,a.__param)(0,(0,f.Oh)("borrowedAsset")),(0,a.__param)(0,(0,f.K5)("debtTokenCover")),(0,a.__param)(0,(0,f.Oh)("initiator")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Wt.prototype,"flashLiquidation",null);class qt extends c.Z{constructor(e,t){super(e,Tt);const{POOL:n,WETH_GATEWAY:r,L2_ENCODER:i}=null!==t&&void 0!==t?t:{};this.poolAddress=null!==n&&void 0!==n?n:"",this.l2EncoderAddress=null!==i&&void 0!==i?i:"",this.wethGatewayAddress=null!==r&&void 0!==r?r:"",this.v3PoolService=new Ut(e,t),this.erc20_2612Service=new Ye(e),this.erc20Service=new ht.A(e),this.synthetixService=new Et.K(e),this.wethGatewayService=new jt(e,this.erc20Service,r),this.l2PoolService=new Dt(e,{l2PoolAddress:this.poolAddress,encoderAddress:this.l2EncoderAddress}),this.contractInterface=Tt.createInterface(),this.supplyTxBuilder={getApprovedAmount:async e=>{const t=e.token.toLowerCase()===l.hP.toLowerCase()?this.wethGatewayAddress:this.poolAddress,n=await this.erc20Service.approvedAmount(Object.assign(Object.assign({},e),{spender:t}));return Object.assign(Object.assign({},e),{spender:t,amount:n.toString()})},generateTxData:({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i,useOptimizedPath:o,encodedTxData:s})=>{let a={};const c=null!==r&&void 0!==r?r:e,d=null!==i&&void 0!==i?i:"0";if(t.toLowerCase()===l.hP.toLowerCase())a=this.wethGatewayService.generateDepositEthTxData({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:c,referralCode:d});else if(o)if(s)a=this.l2PoolService.generateEncodedSupplyTxData({encodedTxData:s,user:e});else{const r={user:e,reserve:t,amount:n,onBehalfOf:c,referralCode:d};a=this.l2PoolService.generateSupplyTxData(r)}else{const r=this.contractInterface.encodeFunctionData("supply",[t,n,c,d]);a.to=this.poolAddress,a.from=e,a.data=r,a.gasLimit=_t.O$.from(l.eB[u.UQ.supply].recommended)}return a},generateSignedTxData:({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i,useOptimizedPath:o,signature:s,deadline:a,encodedTxData:c})=>{const d=(0,ze.splitSignature)(s);let f={};const p=null!==r&&void 0!==r?r:e,h=null!==i&&void 0!==i?i:"0";if(o)if(c)f=this.l2PoolService.generateEncodedSupplyWithPermitTxData({encodedTxData:c,user:e,signature:s});else{const r={user:e,reserve:t,amount:n,referralCode:h,onBehalfOf:p,permitR:d.r,permitS:d.s,permitV:d.v,deadline:Number(a)};f=this.l2PoolService.generateSupplyWithPermitTxData(r)}else{const r=this.contractInterface.encodeFunctionData("supplyWithPermit",[t,n,p,h,a,d.v,d.r,d.s]);f.to=this.poolAddress,f.from=e,f.data=r,f.gasLimit=_t.O$.from(l.eB[u.UQ.supplyWithPermit].recommended)}return f}},this.borrowTxBuilder={generateTxData:({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:i,onBehalfOf:o,referralCode:s,useOptimizedPath:a,encodedTxData:c})=>{let d={};const f=null!==s&&void 0!==s?s:"0",p=null!==o&&void 0!==o?o:e,h=r===u.tk.Variable?2:1;if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");d=this.wethGatewayService.generateBorrowEthTxData({lendingPool:this.poolAddress,user:e,amount:n,debtTokenAddress:i,interestRateMode:r,referralCode:f})}else if(a)if(c)d=this.l2PoolService.generateEncodedBorrowTxData({encodedTxData:c,user:e});else{const r={user:e,reserve:t,amount:n,onBehalfOf:p,referralCode:f,numericRateMode:h};d=this.l2PoolService.generateBorrowTxData(r)}else{const r=this.contractInterface.encodeFunctionData("borrow",[t,n,h,f,p]);d.to=this.poolAddress,d.from=e,d.data=r,d.gasLimit=_t.O$.from(l.eB[u.UQ.borrow].recommended)}return d}}}}class $t extends c.Z{constructor(e,t){super(e,Gt);const{LENDING_POOL:n,WETH_GATEWAY:r}=null!==t&&void 0!==t?t:{};this.lendingPoolAddress=null!==n&&void 0!==n?n:"",this.wethGatewayAddress=null!==r&&void 0!==r?r:"",this.erc20Service=new ht.A(e),this.synthetixService=new Et.K(e),this.wethGatewayService=new jt(e,this.erc20Service,r),this.contractInterface=Gt.createInterface(),this.depositTxBuilder={getApprovedAmount:async e=>{const t=e.token.toLowerCase()===l.hP.toLowerCase()?this.wethGatewayAddress:this.lendingPoolAddress,n=await this.erc20Service.approvedAmount(Object.assign(Object.assign({},e),{spender:t}));return Object.assign(Object.assign({},e),{spender:t,amount:n.toString()})},generateTxData:({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:i})=>{let o={};if(t.toLowerCase()===l.hP.toLowerCase())o=this.wethGatewayService.generateDepositEthTxData({lendingPool:this.lendingPoolAddress,user:e,amount:n,onBehalfOf:r,referralCode:i});else{const s=this.contractInterface.encodeFunctionData("deposit",[t,n,null!==r&&void 0!==r?r:e,null!==i&&void 0!==i?i:"0"]);o.to=this.lendingPoolAddress,o.from=e,o.data=s,o.gasLimit=_t.O$.from(l.eB[u.UQ.deposit].recommended)}return o}},this.borrowTxBuilder={generateTxData:({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:i,onBehalfOf:o,referralCode:s})=>{let a={};const c=null!==s&&void 0!==s?s:"0",d=null!==o&&void 0!==o?o:e,f=r===u.tk.Variable?2:1;if(t.toLowerCase()===l.hP.toLowerCase()){if(!i)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");a=this.wethGatewayService.generateBorrowEthTxData({lendingPool:this.lendingPoolAddress,user:e,amount:n,debtTokenAddress:i,interestRateMode:r,referralCode:c})}else{const r=this.contractInterface.encodeFunctionData("borrow",[t,n,f,c,d]);a.to=this.lendingPoolAddress,a.from=e,a.data=r,a.gasLimit=_t.O$.from(l.eB[u.UQ.borrow].recommended)}return a}}}}const Kt=[{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"}],name:"getReservesData",outputs:[{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"baseLTVasCollateral",type:"uint256"},{internalType:"uint256",name:"reserveLiquidationThreshold",type:"uint256"},{internalType:"uint256",name:"reserveLiquidationBonus",type:"uint256"},{internalType:"uint256",name:"reserveFactor",type:"uint256"},{internalType:"bool",name:"usageAsCollateralEnabled",type:"bool"},{internalType:"bool",name:"borrowingEnabled",type:"bool"},{internalType:"bool",name:"stableBorrowRateEnabled",type:"bool"},{internalType:"bool",name:"isActive",type:"bool"},{internalType:"bool",name:"isFrozen",type:"bool"},{internalType:"uint128",name:"liquidityIndex",type:"uint128"},{internalType:"uint128",name:"variableBorrowIndex",type:"uint128"},{internalType:"uint128",name:"liquidityRate",type:"uint128"},{internalType:"uint128",name:"variableBorrowRate",type:"uint128"},{internalType:"uint128",name:"stableBorrowRate",type:"uint128"},{internalType:"uint40",name:"lastUpdateTimestamp",type:"uint40"},{internalType:"address",name:"aTokenAddress",type:"address"},{internalType:"address",name:"stableDebtTokenAddress",type:"address"},{internalType:"address",name:"variableDebtTokenAddress",type:"address"},{internalType:"address",name:"interestRateStrategyAddress",type:"address"},{internalType:"uint256",name:"availableLiquidity",type:"uint256"},{internalType:"uint256",name:"totalPrincipalStableDebt",type:"uint256"},{internalType:"uint256",name:"averageStableRate",type:"uint256"},{internalType:"uint256",name:"stableDebtLastUpdateTimestamp",type:"uint256"},{internalType:"uint256",name:"totalScaledVariableDebt",type:"uint256"},{internalType:"uint256",name:"priceInMarketReferenceCurrency",type:"uint256"},{internalType:"address",name:"priceOracle",type:"address"},{internalType:"uint256",name:"variableRateSlope1",type:"uint256"},{internalType:"uint256",name:"variableRateSlope2",type:"uint256"},{internalType:"uint256",name:"stableRateSlope1",type:"uint256"},{internalType:"uint256",name:"stableRateSlope2",type:"uint256"},{internalType:"uint256",name:"baseStableBorrowRate",type:"uint256"},{internalType:"uint256",name:"baseVariableBorrowRate",type:"uint256"},{internalType:"uint256",name:"optimalUsageRatio",type:"uint256"},{internalType:"bool",name:"isPaused",type:"bool"},{internalType:"bool",name:"isSiloedBorrowing",type:"bool"},{internalType:"uint128",name:"accruedToTreasury",type:"uint128"},{internalType:"uint128",name:"unbacked",type:"uint128"},{internalType:"uint128",name:"isolationModeTotalDebt",type:"uint128"},{internalType:"bool",name:"flashLoanEnabled",type:"bool"},{internalType:"uint256",name:"debtCeiling",type:"uint256"},{internalType:"uint256",name:"debtCeilingDecimals",type:"uint256"},{internalType:"uint8",name:"eModeCategoryId",type:"uint8"},{internalType:"uint256",name:"borrowCap",type:"uint256"},{internalType:"uint256",name:"supplyCap",type:"uint256"},{internalType:"uint16",name:"eModeLtv",type:"uint16"},{internalType:"uint16",name:"eModeLiquidationThreshold",type:"uint16"},{internalType:"uint16",name:"eModeLiquidationBonus",type:"uint16"},{internalType:"address",name:"eModePriceSource",type:"address"},{internalType:"string",name:"eModeLabel",type:"string"},{internalType:"bool",name:"borrowableInIsolation",type:"bool"}],internalType:"struct IUiPoolDataProviderV3.AggregatedReserveData[]",name:"",type:"tuple[]"},{components:[{internalType:"uint256",name:"marketReferenceCurrencyUnit",type:"uint256"},{internalType:"int256",name:"marketReferenceCurrencyPriceInUsd",type:"int256"},{internalType:"int256",name:"networkBaseTokenPriceInUsd",type:"int256"},{internalType:"uint8",name:"networkBaseTokenPriceDecimals",type:"uint8"}],internalType:"struct IUiPoolDataProviderV3.BaseCurrencyInfo",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"}],name:"getReservesList",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IPoolAddressesProvider",name:"provider",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"getUserReservesData",outputs:[{components:[{internalType:"address",name:"underlyingAsset",type:"address"},{internalType:"uint256",name:"scaledATokenBalance",type:"uint256"},{internalType:"bool",name:"usageAsCollateralEnabledOnUser",type:"bool"},{internalType:"uint256",name:"stableBorrowRate",type:"uint256"},{internalType:"uint256",name:"scaledVariableDebt",type:"uint256"},{internalType:"uint256",name:"principalStableDebt",type:"uint256"},{internalType:"uint256",name:"stableBorrowLastUpdateTimestamp",type:"uint256"}],internalType:"struct IUiPoolDataProviderV3.UserReserveData[]",name:"",type:"tuple[]"},{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"}];class Yt{static createInterface(){return new Ne.vU(Kt)}static connect(e,t){return new p.CH(e,Kt,t)}}Yt.abi=Kt;const Xt={"0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5":"UNIDAIUSDC","0x004375dff511095cc5a197a54140a24efef3a416":"UNIWBTCUSDC","0xa478c2975ab1ea89e8196811f51a7b7ade33eb11":"UNIDAIWETH","0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc":"UNIUSDCWETH","0xdfc14d2af169b0d36c4eff567ada9b2e0cae044f":"UNIAAVEWETH","0xb6909b960dbbe7392d405429eb2b3649752b4838":"UNIBATWETH","0x3da1313ae46132a397d90d95b1424a9a7e3e0fce":"UNICRVWETH","0xa2107fa5b38d9bbd2c461d6edf11b11a50f6b974":"UNILINKWETH","0xc2adda861f89bbb333c90c492cb837741916a225":"UNIMKRWETH","0x8bd1661da98ebdd3bd080f0be4e6d9be8ce9858c":"UNIRENWETH","0x43ae24960e5534731fc831386c07755a2dc33d47":"UNISNXWETH","0xd3d2e2692501a5c9ca623199d38826e513033a17":"UNIUNIWETH","0xbb2b8038a1640196fbe3e38816f3e67cba72d940":"UNIWBTCWETH","0x2fdbadf3c4d5a8666bc06645b8358ab803996e28":"UNIYFIWETH","0x1eff8af5d577060ba4ac8a29a13525bb0ee2a3d5":"BPTWBTCWETH","0x59a19d8c652fa0284f44113d0ff9aba70bd46fb4":"BPTBALWETH"};class Jt{constructor(e){if(!(0,Me.isAddress)(e.uiPoolDataProviderAddress))throw new Error("contract address is not valid");this._contract=Yt.connect(e.uiPoolDataProviderAddress,e.provider),this.chainId=e.chainId}async getReservesList({lendingPoolAddressProvider:e}){if(!(0,Me.isAddress)(e))throw new Error("Lending pool address is not valid");return this._contract.getReservesList(e)}async getReservesData({lendingPoolAddressProvider:e}){if(!(0,Me.isAddress)(e))throw new Error("Lending pool address is not valid");return this._contract.getReservesData(e)}async getUserReservesData({lendingPoolAddressProvider:e,user:t}){if(!(0,Me.isAddress)(e))throw new Error("Lending pool address is not valid");if(!(0,Me.isAddress)(t))throw new Error("User address is not a valid ethereum address");return this._contract.getUserReservesData(e,t)}async getReservesHumanized({lendingPoolAddressProvider:e}){const{0:t,1:n}=await this.getReservesData({lendingPoolAddressProvider:e});return{reservesData:t.map((t=>({id:`${this.chainId}-${t.underlyingAsset}-${e}`.toLowerCase(),underlyingAsset:t.underlyingAsset.toLowerCase(),name:t.name,symbol:Xt[t.underlyingAsset.toLowerCase()]?Xt[t.underlyingAsset.toLowerCase()]:t.symbol,decimals:t.decimals.toNumber(),baseLTVasCollateral:t.baseLTVasCollateral.toString(),reserveLiquidationThreshold:t.reserveLiquidationThreshold.toString(),reserveLiquidationBonus:t.reserveLiquidationBonus.toString(),reserveFactor:t.reserveFactor.toString(),usageAsCollateralEnabled:t.usageAsCollateralEnabled,borrowingEnabled:t.borrowingEnabled,stableBorrowRateEnabled:t.stableBorrowRateEnabled,isActive:t.isActive,isFrozen:t.isFrozen,liquidityIndex:t.liquidityIndex.toString(),variableBorrowIndex:t.variableBorrowIndex.toString(),liquidityRate:t.liquidityRate.toString(),variableBorrowRate:t.variableBorrowRate.toString(),stableBorrowRate:t.stableBorrowRate.toString(),lastUpdateTimestamp:t.lastUpdateTimestamp,aTokenAddress:t.aTokenAddress.toString(),stableDebtTokenAddress:t.stableDebtTokenAddress.toString(),variableDebtTokenAddress:t.variableDebtTokenAddress.toString(),interestRateStrategyAddress:t.interestRateStrategyAddress.toString(),availableLiquidity:t.availableLiquidity.toString(),totalPrincipalStableDebt:t.totalPrincipalStableDebt.toString(),averageStableRate:t.averageStableRate.toString(),stableDebtLastUpdateTimestamp:t.stableDebtLastUpdateTimestamp.toNumber(),totalScaledVariableDebt:t.totalScaledVariableDebt.toString(),priceInMarketReferenceCurrency:t.priceInMarketReferenceCurrency.toString(),priceOracle:t.priceOracle,variableRateSlope1:t.variableRateSlope1.toString(),variableRateSlope2:t.variableRateSlope2.toString(),stableRateSlope1:t.stableRateSlope1.toString(),stableRateSlope2:t.stableRateSlope2.toString(),baseStableBorrowRate:t.baseStableBorrowRate.toString(),baseVariableBorrowRate:t.baseVariableBorrowRate.toString(),optimalUsageRatio:t.optimalUsageRatio.toString(),isPaused:t.isPaused,debtCeiling:t.debtCeiling.toString(),eModeCategoryId:t.eModeCategoryId,borrowCap:t.borrowCap.toString(),supplyCap:t.supplyCap.toString(),eModeLtv:t.eModeLtv,eModeLiquidationThreshold:t.eModeLiquidationThreshold,eModeLiquidationBonus:t.eModeLiquidationBonus,eModePriceSource:t.eModePriceSource.toString(),eModeLabel:t.eModeLabel.toString(),borrowableInIsolation:t.borrowableInIsolation,accruedToTreasury:t.accruedToTreasury.toString(),unbacked:t.unbacked.toString(),isolationModeTotalDebt:t.isolationModeTotalDebt.toString(),debtCeilingDecimals:t.debtCeilingDecimals.toNumber(),isSiloedBorrowing:t.isSiloedBorrowing,flashLoanEnabled:t.flashLoanEnabled}))),baseCurrencyData:{marketReferenceCurrencyDecimals:n.marketReferenceCurrencyUnit.toString().length-1,marketReferenceCurrencyPriceInUsd:n.marketReferenceCurrencyPriceInUsd.toString(),networkBaseTokenPriceInUsd:n.networkBaseTokenPriceInUsd.toString(),networkBaseTokenPriceDecimals:n.networkBaseTokenPriceDecimals}}}async getUserReservesHumanized({lendingPoolAddressProvider:e,user:t}){const{0:n,1:r}=await this.getUserReservesData({lendingPoolAddressProvider:e,user:t});return{userReserves:n.map((n=>({id:`${this.chainId}-${t}-${n.underlyingAsset}-${e}`.toLowerCase(),underlyingAsset:n.underlyingAsset.toLowerCase(),scaledATokenBalance:n.scaledATokenBalance.toString(),usageAsCollateralEnabledOnUser:n.usageAsCollateralEnabledOnUser,stableBorrowRate:n.stableBorrowRate.toString(),scaledVariableDebt:n.scaledVariableDebt.toString(),principalStableDebt:n.principalStableDebt.toString(),stableBorrowLastUpdateTimestamp:n.stableBorrowLastUpdateTimestamp.toNumber()}))),userEmodeCategoryId:r}}}class Qt{static connect(e,t){return new p.CH(e,en,t)}}const en=[{inputs:[{internalType:"address",name:"_token",type:"address"}],name:"getMinter",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"}],name:"mint",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"payable",type:"function"}];class tn extends c.Z{constructor(e,t){super(e,Qt),this.faucetAddress=null!==t&&void 0!==t?t:""}mint({userAddress:e,reserve:t,tokenSymbol:n}){const r=(0,l.gU)("1000",18),i=l.Ry[n]?l.Ry[n]:r,o=this.getContractInstance(this.faucetAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.mint(t,i),from:e,value:l.k8});return[{tx:s,txType:u.ns.FAUCET_MINT,gas:this.generateTxPriceEstimation([],s)}]}}(0,a.__decorate)([d.QL,(0,a.__param)(0,(0,f.Oh)("userAddress")),(0,a.__param)(0,(0,f.Oh)("reserve")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],tn.prototype,"mint",null);const nn=[{inputs:[{internalType:"contract IPoolAddressesProvider",name:"addressesProvider",type:"address"},{internalType:"address",name:"pool",type:"address"},{internalType:"contract IParaSwapAugustusRegistry",name:"augustusRegistry",type:"address"},{internalType:"address",name:"owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"fromAsset",type:"address"},{indexed:!0,internalType:"address",name:"toAsset",type:"address"},{indexed:!1,internalType:"uint256",name:"amountSold",type:"uint256"},{indexed:!1,internalType:"uint256",name:"receivedAmount",type:"uint256"}],name:"Bought",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"fromAsset",type:"address"},{indexed:!0,internalType:"address",name:"toAsset",type:"address"},{indexed:!1,internalType:"uint256",name:"fromAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"receivedAmount",type:"uint256"}],name:"Swapped",type:"event"},{inputs:[],name:"ADDRESSES_PROVIDER",outputs:[{internalType:"contract IPoolAddressesProvider",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"AUGUSTUS_REGISTRY",outputs:[{internalType:"contract IParaSwapAugustusRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_SLIPPAGE_PERCENT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ORACLE",outputs:[{internalType:"contract IPriceOracleGetter",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"POOL",outputs:[{internalType:"contract IPool",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"REFERRER",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"cacheReserves",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"address",name:"initiator",type:"address"},{internalType:"bytes",name:"params",type:"bytes"}],name:"executeOperation",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"reserve",type:"address"}],name:"renewAllowance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20",name:"token",type:"address"}],name:"rescueTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"debtAsset",type:"address"},{internalType:"uint256",name:"debtRepayAmount",type:"uint256"},{internalType:"uint256",name:"debtRateMode",type:"uint256"},{internalType:"address",name:"newDebtAsset",type:"address"},{internalType:"uint256",name:"maxNewDebtAmount",type:"uint256"},{internalType:"uint256",name:"offset",type:"uint256"},{internalType:"bytes",name:"paraswapData",type:"bytes"}],internalType:"struct ParaSwapDebtSwapAdapter.DebtSwapParams",name:"debtSwapParams",type:"tuple"},{components:[{internalType:"contract ICreditDelegationToken",name:"debtToken",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct ParaSwapDebtSwapAdapter.CreditDelegationInput",name:"creditDelegationPermit",type:"tuple"}],name:"swapDebt",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],rn="0x6101006040523480156200001257600080fd5b5060405162003410380380620034108339810160408190526200003591620007c5565b838383838383838282600033600080546001600160a01b0319166001600160a01b038316908117825560405192935091600080516020620033f0833981519152908290a350816001600160a01b031663fca513a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000b9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000df91906200082d565b6001600160a01b0390811660805291821660a052811660c05260405163fb04e17b60e01b8152600060048201529082169063fb04e17b90602401602060405180830381865afa15801562000137573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015d919062000854565b15620001b05760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420612076616c696420417567757374757320616464726573730000000060448201526064015b60405180910390fd5b6001600160a01b031660e052505060018055620001cd81620001e5565b620001d7620002f2565b505050505050505062000a40565b6000546001600160a01b03163314620002415760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620001a7565b6001600160a01b038116620002a85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620001a7565b600080546040516001600160a01b0380851693921691600080516020620033f083398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600060c0516001600160a01b031663d1946dbc6040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000335573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200035f91908101906200088e565b905060005b8151811015620003c857620003b360c0516000198484815181106200038d576200038d62000960565b60200260200101516001600160a01b0316620003cc60201b62000cf6179092919060201c565b80620003bf8162000976565b91505062000364565b5050565b8015806200044a5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801562000422573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004489190620009a0565b155b620004be5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401620001a7565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b17909152620005169185916200051b16565b505050565b600062000577826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620005f960201b62000e32179092919060201c565b80519091501562000516578080602001905181019062000598919062000854565b620005165760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401620001a7565b60606200060a848460008562000612565b949350505050565b606082471015620006755760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620001a7565b600080866001600160a01b03168587604051620006939190620009ed565b60006040518083038185875af1925050503d8060008114620006d2576040519150601f19603f3d011682016040523d82523d6000602084013e620006d7565b606091505b509092509050620006eb87838387620006f6565b979650505050505050565b60608315620007675782516200075f576001600160a01b0385163b6200075f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620001a7565b50816200060a565b6200060a83838151156200077e5781518083602001fd5b8060405162461bcd60e51b8152600401620001a7919062000a0b565b6001600160a01b0381168114620007b057600080fd5b50565b8051620007c0816200079a565b919050565b60008060008060808587031215620007dc57600080fd5b8451620007e9816200079a565b6020860151909450620007fc816200079a565b60408601519093506200080f816200079a565b606086015190925062000822816200079a565b939692955090935050565b6000602082840312156200084057600080fd5b81516200084d816200079a565b9392505050565b6000602082840312156200086757600080fd5b815180151581146200084d57600080fd5b634e487b7160e01b600052604160045260246000fd5b60006020808385031215620008a257600080fd5b82516001600160401b0380821115620008ba57600080fd5b818501915085601f830112620008cf57600080fd5b815181811115620008e457620008e462000878565b8060051b604051601f19603f830116810181811085821117156200090c576200090c62000878565b6040529182528482019250838101850191888311156200092b57600080fd5b938501935b8285101562000954576200094485620007b3565b8452938501939285019262000930565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b60006000198214156200099957634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208284031215620009b357600080fd5b5051919050565b60005b83811015620009d7578181015183820152602001620009bd565b83811115620009e7576000848401525b50505050565b6000825162000a01818460208701620009ba565b9190910192915050565b602081526000825180602084015262000a2c816040850160208701620009ba565b601f01601f19169190910160400192915050565b60805160a05160c05160e05161291b62000ad56000396000818161019d01526113b20152600081816101e70152818161033f015281816103740152818161071801528181610834015281816108f8015281816109ee01528181610a8501528181610afc01528181610f0001528181610fd401526110a6015260006101080152600081816101760152611c05015261291b6000f3fe608060405234801561001057600080fd5b50600436106100e95760003560e01c8063715018a61161008c5780638da5cb5b116100665780638da5cb5b14610209578063920f5c841461021a578063c05603741461023d578063f2fde38b1461025957600080fd5b8063715018a6146101d257806371f893ea146101da5780637535d246146101e257600080fd5b806332e4b286116100c857806332e4b2861461015a57806338013f02146101715780633a82986714610198578063636aa619146101bf57600080fd5b8062ae3bf8146100ee5780630542975c146101035780630a03635114610147575b600080fd5b6101016100fc366004611d34565b61026c565b005b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b610101610155366004611d34565b610330565b610163610bb881565b60405190815260200161013e565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b6101016101cd366004611f13565b61039b565b610101610976565b6101016109ea565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031661012a565b61022d61022836600461202a565b610aef565b604051901515815260200161013e565b61024661173081565b60405161ffff909116815260200161013e565b610101610267366004611d34565b610c0c565b6000546001600160a01b0316331461029f5760405162461bcd60e51b81526004016102969061212f565b60405180910390fd5b61032d6102b46000546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156102f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031c9190612164565b6001600160a01b0384169190610e49565b50565b6103656001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000006000610cf6565b61032d6001600160a01b0382167f0000000000000000000000000000000000000000000000000000000000000000600019610cf6565b60608201516040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156103e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040a9190612164565b905081604001516000146104b657815160208301516040808501516060860151608087015160a0880151935163016a5aab60e31b81523360048201523060248201526044810195909552606485019290925260ff16608484015260a483015260c48201526001600160a01b0390911690630b52d5589060e401600060405180830381600087803b15801561049d57600080fd5b505af11580156104b1573d6000803e3d6000fd5b505050505b600019836020015114156105c1576000806104d48560000151610eda565b915091508460400151600214610551576040516370a0823160e01b81523360048201526001600160a01b038216906370a0823190602401602060405180830381865afa158015610528573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054c9190612164565b6105b9565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610595573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b99190612164565b602086015250505b6040805160c0808201835285516001600160a01b0316825260208087015181840152868401518385015290860151606083015260a0808701516080840152339083015291519091600091610617918491016121d5565b60408051601f1981840301815260018084528383019092529250600091906020808301908036833701905050905085606001518160008151811061065d5761065d61223b565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090508660800151816000815181106106b2576106b261223b565b60209081029190910101526040805160018082528183019092526000918160200160208202803683370190505090506002816000815181106106f6576106f661223b565b602090810291909101015260405163ab9c4b5d60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ab9c4b5d9061075b90309087908790879033908c906117309060040161228c565b600060405180830381600087803b15801561077557600080fd5b505af1158015610789573d6000803e3d6000fd5b5050505060608801516040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156107d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fc9190612164565b9050600061080a888361235e565b9050801561096a5760608a0151604051636eb1769f60e11b81523060048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152600092169063dd62ed3e90604401602060405180830381865afa158015610885573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a99190612164565b9050818110156108c0576108c08b60600151610330565b60608b015160405163573ade8160e01b81526001600160a01b03918216600482015260248101849052600260448201523360648201527f00000000000000000000000000000000000000000000000000000000000000009091169063573ade81906084016020604051808303816000875af1158015610943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109679190612164565b50505b50505050505050505050565b6000546001600160a01b031633146109a05760405162461bcd60e51b81526004016102969061212f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d1946dbc6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610a4a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a729190810190612380565b905060005b8151811015610aeb57610ad97f0000000000000000000000000000000000000000000000000000000000000000600019848481518110610ab957610ab961223b565b60200260200101516001600160a01b0316610cf69092919063ffffffff16565b80610ae381612426565b915050610a77565b5050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b5f5760405162461bcd60e51b815260206004820152601360248201527210d05313115497d35554d517d09157d413d3d3606a1b6044820152606401610296565b6001600160a01b0384163014610bb05760405162461bcd60e51b8152602060048201526016602482015275494e49544941544f525f4d5553545f42455f5448495360501b6044820152606401610296565b610bfc83838c8c6000818110610bc857610bc861223b565b9050602002016020810190610bdd9190611d34565b8b8b6000818110610bf057610bf061223b565b90506020020135610f86565b5060019998505050505050505050565b6000546001600160a01b03163314610c365760405162461bcd60e51b81526004016102969061212f565b6001600160a01b038116610c9b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610296565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b801580610d705750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e9190612164565b155b610ddb5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610296565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052610e2d90849061111e565b505050565b6060610e4184846000856111f0565b949350505050565b60405163a9059cbb60e01b8082526001600160a01b0384166004830152602482018390529060008060448382895af1610e86573d6000803e3d6000fd5b50610e90846112cb565b610ed45760405162461bcd60e51b815260206004820152601560248201527423a83b191d103330b4b632b2103a3930b739b332b960591b6044820152606401610296565b50505050565b6040516335ea6a7560e01b81526001600160a01b038281166004830152600091829182917f0000000000000000000000000000000000000000000000000000000000000000909116906335ea6a75906024016101e060405180830381865afa158015610f4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6e91906124ca565b90508061014001518161012001519250925050915091565b6000610f94848601866125ed565b9050610fb481608001518260600151858460000151868660200151611374565b508051604051636eb1769f60e11b81523060048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152600092169063dd62ed3e90604401602060405180830381865afa158015611025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110499190612164565b9050816020015181101561106257815161106290610330565b8151602083015160408085015160a0860151915163573ade8160e01b81526001600160a01b03948516600482015260248101939093526044830152821660648201527f00000000000000000000000000000000000000000000000000000000000000009091169063573ade81906084016020604051808303816000875af11580156110f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111159190612164565b50505050505050565b6000611173826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e329092919063ffffffff16565b805190915015610e2d578080602001905181019061119191906126a4565b610e2d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610296565b6060824710156112515760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610296565b600080866001600160a01b0316858760405161126d91906126c6565b60006040518083038185875af1925050503d80600081146112aa576040519150601f19603f3d011682016040523d82523d6000602084013e6112af565b606091505b50915091506112c087838387611aac565b979650505050505050565b60006112f1565b62461bcd60e51b60005260206004528060245250806044525060646000fd5b3d801561133057602081146113615761132b7f475076323a206d616c666f726d6564207472616e7366657220726573756c7400601f6112d2565b61136e565b823b611358576113587311d41d8c8e881b9bdd08184818dbdb9d1c9858dd60621b60146112d2565b6001915061136e565b3d6000803e600051151591505b50919050565b60008060008780602001905181019061138d91906126e2565b60405163fb04e17b60e01b81526001600160a01b0380831660048301529294509092507f00000000000000000000000000000000000000000000000000000000000000009091169063fb04e17b90602401602060405180830381865afa1580156113fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141f91906126a4565b61145e5760405162461bcd60e51b815260206004820152601060248201526f494e56414c49445f415547555354555360801b6044820152606401610296565b600061146988611b22565b60ff169050600061147988611b22565b60ff16905060006114898a611be3565b905060006114968a611be3565b905060006114ee6114ab612710610bb8611c72565b6114e86114c36114bc88600a612854565b8790611c82565b6114e26114db6114d48b600a612854565b8890611c82565b8e90611c82565b90611cac565b90611cbf565b9050808a111561154c5760405162461bcd60e51b815260206004820152602360248201527f6d6178416d6f756e74546f5377617020657863656564206d617820736c69707060448201526261676560e81b6064820152608401610296565b50506040516370a0823160e01b8152306004820152600093506001600160a01b038b1692506370a082319150602401602060405180830381865afa158015611598573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bc9190612164565b90508581101561160e5760405162461bcd60e51b815260206004820181905260248201527f494e53554646494349454e545f42414c414e43455f4245464f52455f535741506044820152606401610296565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa158015611655573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116799190612164565b90506000836001600160a01b031663d2c4b5986040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df9190612860565b60405163095ea7b360e01b81526001600160a01b03808316600483015260006024830152919250908b169063095ea7b3906044016020604051808303816000875af1158015611732573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175691906126a4565b5060405163095ea7b360e01b81526001600160a01b038281166004830152602482018a90528b169063095ea7b3906044016020604051808303816000875af11580156117a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ca91906126a4565b508b156118435760048c101580156117ee575084516117ea906020611ce5565b8c11155b61183a5760405162461bcd60e51b815260206004820152601d60248201527f544f5f414d4f554e545f4f46465345545f4f55545f4f465f52414e47450000006044820152606401610296565b8660208d018601525b6000846001600160a01b03168660405161185d91906126c6565b6000604051808303816000865af19150503d806000811461189a576040519150601f19603f3d011682016040523d82523d6000602084013e61189f565b606091505b50509050806118b2573d6000803e3d6000fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038d16906370a0823190602401602060405180830381865afa1580156118f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191d9190612164565b9050611929818661235e565b97508988111561197b5760405162461bcd60e51b815260206004820152601860248201527f57524f4e475f42414c414e43455f41465445525f5357415000000000000000006044820152606401610296565b6040516370a0823160e01b81523060048201526000906119f29086906001600160a01b038f16906370a0823190602401602060405180830381865afa1580156119c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ec9190612164565b90611ce5565b905089811015611a445760405162461bcd60e51b815260206004820152601c60248201527f494e53554646494349454e545f414d4f554e545f5245434549564544000000006044820152606401610296565b8b6001600160a01b03168d6001600160a01b03167fbf77fd13a39d14dc0da779342c14105c38d9a5d0c60f2caa22f5fd1d5525416d8b84604051611a92929190918252602082015260400190565b60405180910390a350505050505050509695505050505050565b60608315611b18578251611b11576001600160a01b0385163b611b115760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610296565b5081610e41565b610e418383611cf5565b600080826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b87919061287d565b9050604d8160ff161115611bdd5760405162461bcd60e51b815260206004820152601a60248201527f544f4f5f4d414e595f444543494d414c535f4f4e5f544f4b454e0000000000006044820152606401610296565b92915050565b60405163b3596f0760e01b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063b3596f0790602401602060405180830381865afa158015611c4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bdd9190612164565b80820182811015611bdd57600080fd5b6000821580611ca357505081810281838281611ca057611ca061289a565b04145b611bdd57600080fd5b6000611cb882846128b0565b9392505050565b600081156113881983900484111517611cd757600080fd5b506127109102611388010490565b80820382811115611bdd57600080fd5b815115611d055781518083602001fd5b8060405162461bcd60e51b815260040161029691906128d2565b6001600160a01b038116811461032d57600080fd5b600060208284031215611d4657600080fd5b8135611cb881611d1f565b8035611d5c81611d1f565b919050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715611d9a57611d9a611d61565b60405290565b60405160e0810167ffffffffffffffff81118282101715611d9a57611d9a611d61565b6040516101e0810167ffffffffffffffff81118282101715611d9a57611d9a611d61565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e1057611e10611d61565b604052919050565b600067ffffffffffffffff821115611e3257611e32611d61565b50601f01601f191660200190565b600082601f830112611e5157600080fd5b8135611e64611e5f82611e18565b611de7565b818152846020838601011115611e7957600080fd5b816020850160208301376000918101602001919091529392505050565b60ff8116811461032d57600080fd5b600060c08284031215611eb757600080fd5b611ebf611d77565b90508135611ecc81611d1f565b8082525060208201356020820152604082013560408201526060820135611ef281611e96565b806060830152506080820135608082015260a082013560a082015292915050565b60008060e08385031215611f2657600080fd5b823567ffffffffffffffff80821115611f3e57600080fd5b9084019060e08287031215611f5257600080fd5b611f5a611da0565b611f6383611d51565b81526020830135602082015260408301356040820152611f8560608401611d51565b60608201526080830135608082015260a083013560a082015260c083013582811115611fb057600080fd5b611fbc88828601611e40565b60c083015250809450505050611fd58460208501611ea5565b90509250929050565b60008083601f840112611ff057600080fd5b50813567ffffffffffffffff81111561200857600080fd5b6020830191508360208260051b850101111561202357600080fd5b9250929050565b600080600080600080600080600060a08a8c03121561204857600080fd5b893567ffffffffffffffff8082111561206057600080fd5b61206c8d838e01611fde565b909b50995060208c013591508082111561208557600080fd5b6120918d838e01611fde565b909950975060408c01359150808211156120aa57600080fd5b6120b68d838e01611fde565b909750955060608c013591506120cb82611d1f565b90935060808b013590808211156120e157600080fd5b818c0191508c601f8301126120f557600080fd5b81358181111561210457600080fd5b8d602082850101111561211657600080fd5b6020830194508093505050509295985092959850929598565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561217657600080fd5b5051919050565b60005b83811015612198578181015183820152602001612180565b83811115610ed45750506000910152565b600081518084526121c181602086016020860161217d565b601f01601f19169290920160200192915050565b60208152600060018060a01b038084511660208401526020840151604084015260408401516060840152606084015160c0608085015261221860e08501826121a9565b9050608085015160a08501528160a08601511660c0850152809250505092915050565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b8381101561228157815187529582019590820190600101612265565b509495945050505050565b6001600160a01b03888116825260e0602080840182905289519184018290526000928a820192909190610100860190855b818110156122db5785518516835294830194918301916001016122bd565b505085810360408701526122ef818c612251565b935050505082810360608401526123068188612251565b6001600160a01b0387166080850152905082810360a084015261232981866121a9565b91505061233c60c083018461ffff169052565b98975050505050505050565b634e487b7160e01b600052601160045260246000fd5b60008282101561237057612370612348565b500390565b8051611d5c81611d1f565b6000602080838503121561239357600080fd5b825167ffffffffffffffff808211156123ab57600080fd5b818501915085601f8301126123bf57600080fd5b8151818111156123d1576123d1611d61565b8060051b91506123e2848301611de7565b81815291830184019184810190888411156123fc57600080fd5b938501935b8385101561233c578451925061241683611d1f565b8282529385019390850190612401565b600060001982141561243a5761243a612348565b5060010190565b60006020828403121561245357600080fd5b6040516020810181811067ffffffffffffffff8211171561247657612476611d61565b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114611d5c57600080fd5b805164ffffffffff81168114611d5c57600080fd5b805161ffff81168114611d5c57600080fd5b60006101e082840312156124dd57600080fd5b6124e5611dc3565b6124ef8484612441565b81526124fd60208401612483565b602082015261250e60408401612483565b604082015261251f60608401612483565b606082015261253060808401612483565b608082015261254160a08401612483565b60a082015261255260c084016124a3565b60c082015261256360e084016124b8565b60e0820152610100612576818501612375565b90820152610120612588848201612375565b9082015261014061259a848201612375565b908201526101606125ac848201612375565b908201526101806125be848201612483565b908201526101a06125d0848201612483565b908201526101c06125e2848201612483565b908201529392505050565b6000602082840312156125ff57600080fd5b813567ffffffffffffffff8082111561261757600080fd5b9083019060c0828603121561262b57600080fd5b612633611d77565b823561263e81611d1f565b80825250602083013560208201526040830135604082015260608301358281111561266857600080fd5b61267487828601611e40565b6060830152506080830135608082015260a0830135925061269483611d1f565b60a0810192909252509392505050565b6000602082840312156126b657600080fd5b81518015158114611cb857600080fd5b600082516126d881846020870161217d565b9190910192915050565b600080604083850312156126f557600080fd5b825167ffffffffffffffff81111561270c57600080fd5b8301601f8101851361271d57600080fd5b805161272b611e5f82611e18565b81815286602083850101111561274057600080fd5b61275182602083016020860161217d565b809450505050602083015161276581611d1f565b809150509250929050565b600181815b808511156127ab57816000190482111561279157612791612348565b8085161561279e57918102915b93841c9390800290612775565b509250929050565b6000826127c257506001611bdd565b816127cf57506000611bdd565b81600181146127e557600281146127ef5761280b565b6001915050611bdd565b60ff84111561280057612800612348565b50506001821b611bdd565b5060208310610133831016604e8410600b841016171561282e575081810a611bdd565b6128388383612770565b806000190482111561284c5761284c612348565b029392505050565b6000611cb883836127b3565b60006020828403121561287257600080fd5b8151611cb881611d1f565b60006020828403121561288f57600080fd5b8151611cb881611e96565b634e487b7160e01b600052601260045260246000fd5b6000826128cd57634e487b7160e01b600052601260045260246000fd5b500490565b602081526000611cb860208301846121a956fea264697066735822122083916c2e867ffe5cc5586626cf69491670775747aa658d7b03240abbbe94052f64736f6c634300080a00338be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0";class on extends p.lV{constructor(...e){e.length>1?super(...e):super(nn,rn,e[0])}deploy(e,t,n,r,i){return super.deploy(e,t,n,r,i||{})}getDeployTransaction(e,t,n,r,i){return super.getDeployTransaction(e,t,n,r,i||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static createInterface(){return new Ne.vU(nn)}static connect(e,t){return new p.CH(e,nn,t)}}on.bytecode=rn,on.abi=nn;class sn extends c.Z{constructor(e,t){super(e,on),this.debtSwitchAddress=null!==t&&void 0!==t?t:"",this.contractInterface=on.createInterface(),this.debtSwitch=this.debtSwitch.bind(this)}debtSwitch({user:e,debtAssetUnderlying:t,debtRepayAmount:n,debtRateMode:r,newAssetDebtToken:i,newAssetUnderlying:o,maxNewDebtAmount:s,repayAll:a,txCalldata:c,augustus:u,deadline:d,sigV:f,sigR:p,sigS:h,signedAmount:m}){const g=ft.$.encode(["bytes","address"],[c,u]),y={debtAsset:t,debtRepayAmount:n,debtRateMode:r,newDebtAsset:o,maxNewDebtAmount:s,offset:a?(0,l.mz)(c):0,paraswapData:g},b={debtToken:i,value:m,deadline:d,v:f,r:p,s:h},v={},w=this.contractInterface.encodeFunctionData("swapDebt",[y,b]);return v.to=this.debtSwitchAddress,v.data=w,v.from=e,v}}class an{static connect(e,t){return new p.CH(e,cn,t)}}const cn=[{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"to",type:"address"}],name:"claimRewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"}];class un extends c.Z{constructor(e){super(e,an)}claimRewards({user:e,assets:t,to:n,incentivesControllerAddress:r}){const i=this.getContractInstance(r),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.claimRewards(t,pt.Bz.toString(),null!==n&&void 0!==n?n:e),from:e});return[{tx:o,txType:u.ns.REWARD_ACTION,gas:this.generateTxPriceEstimation([],o)}]}}(0,a.__decorate)([d.nX,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("incentivesControllerAddress")),(0,a.__param)(0,(0,f.Oh)("to")),(0,a.__param)(0,(0,f.Gq)("assets")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],un.prototype,"claimRewards",null);const ln=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!1,internalType:"uint256",name:"emission",type:"uint256"},{indexed:!1,internalType:"uint256",name:"distributionEnd",type:"uint256"}],name:"AssetConfigUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"AssetIndexUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"claimer",type:"address"}],name:"ClaimerSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!0,internalType:"address",name:"rewardOracle",type:"address"}],name:"RewardOracleUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"RewardsAccrued",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"address",name:"claimer",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"RewardsClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!0,internalType:"address",name:"transferStrategy",type:"address"}],name:"TransferStrategyInstalled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!0,internalType:"address",name:"reward",type:"address"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"UserIndexUpdated",type:"event"},{inputs:[],name:"PRECISION",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"address",name:"to",type:"address"}],name:"claimAllRewards",outputs:[{internalType:"address[]",name:"rewardsList",type:"address[]"},{internalType:"uint256[]",name:"claimedAmounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"to",type:"address"}],name:"claimAllRewardsOnBehalf",outputs:[{internalType:"address[]",name:"rewardsList",type:"address[]"},{internalType:"uint256[]",name:"claimedAmounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"}],name:"claimAllRewardsToSelf",outputs:[{internalType:"address[]",name:"rewardsList",type:"address[]"},{internalType:"uint256[]",name:"claimedAmounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"claimRewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"claimRewardsOnBehalf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"reward",type:"address"}],name:"claimRewardsToSelf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint104",name:"emissionPerSecond",type:"uint104"},{internalType:"uint256",name:"totalSupply",type:"uint256"},{internalType:"uint40",name:"distributionEnd",type:"uint40"},{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"reward",type:"address"},{internalType:"contract ITransferStrategy",name:"transferStrategy",type:"address"},{internalType:"bytes",name:"transferStrategyParams",type:"bytes"},{internalType:"contract IEACAggregatorProxy",name:"rewardOracle",type:"address"}],internalType:"struct DistributionTypesV2.RewardsConfigInput[]",name:"config",type:"tuple[]"}],name:"configureAssets",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"address",name:"user",type:"address"}],name:"getAllUserRewardsBalance",outputs:[{internalType:"address[]",name:"",type:"address[]"},{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getClaimer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"getDistributionEnd",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"reward",type:"address"}],name:"getRewardOracle",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"}],name:"getRewardsByAsset",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"getRewardsData",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getRewardsList",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"reward",type:"address"}],name:"getTransferStrategy",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"getUserAssetData",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"assets",type:"address[]"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"getUserRewardsBalance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"reward",type:"address"}],name:"getUserUnclaimedRewardsFromStorage",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"userBalance",type:"uint256"},{internalType:"uint256",name:"totalSupply",type:"uint256"}],name:"handleAction",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"claimer",type:"address"}],name:"setClaimer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"address",name:"reward",type:"address"},{internalType:"uint40",name:"distributionEnd",type:"uint40"}],name:"setDistributionEnd",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reward",type:"address"},{internalType:"contract IEACAggregatorProxy",name:"rewardOracle",type:"address"}],name:"setRewardOracle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reward",type:"address"},{internalType:"contract ITransferStrategy",name:"transferStrategy",type:"address"},{internalType:"bytes",name:"params",type:"bytes"}],name:"setTransferStrategy",outputs:[],stateMutability:"nonpayable",type:"function"}];class dn{static createInterface(){return new Ne.vU(ln)}static connect(e,t){return new p.CH(e,ln,t)}}dn.abi=ln;class fn extends c.Z{constructor(e){super(e,dn)}claimRewards({user:e,assets:t,to:n,incentivesControllerAddress:r,reward:i}){const o=this.getContractInstance(r),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.claimRewards(t,pt.Bz.toString(),null!==n&&void 0!==n?n:e,i),from:e});return[{tx:s,txType:u.ns.REWARD_ACTION,gas:this.generateTxPriceEstimation([],s)}]}claimAllRewards({user:e,assets:t,to:n,incentivesControllerAddress:r}){const i=this.getContractInstance(r),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.claimAllRewards(t,null!==n&&void 0!==n?n:e),from:e});return[{tx:o,txType:u.ns.REWARD_ACTION,gas:this.generateTxPriceEstimation([],o)}]}}(0,a.__decorate)([d.nX,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("incentivesControllerAddress")),(0,a.__param)(0,(0,f.Oh)("to")),(0,a.__param)(0,(0,f.Oh)("reward")),(0,a.__param)(0,(0,f.Gq)("assets")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],fn.prototype,"claimRewards",null),(0,a.__decorate)([d.nX,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__param)(0,(0,f.Oh)("incentivesControllerAddress")),(0,a.__param)(0,(0,f.Oh)("to")),(0,a.__param)(0,(0,f.Gq)("assets")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Array)],fn.prototype,"claimAllRewards",null);var pn=n(27484),hn=n.n(pn),mn=n(45703),gn=n(87385),yn=n(83601),bn=JSON.parse('{"Mt":[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"AddressZero","type":"error"},{"inputs":[],"name":"ETHTransferFailed","type":"error"},{"inputs":[],"name":"EthTransferFailed","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"FallbackNotAllowed","type":"error"},{"inputs":[],"name":"InsufficientPermission","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidLoopCount","type":"error"},{"inputs":[],"name":"InvalidRatio","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReceiveNotAllowed","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_feePercent","type":"uint256"}],"name":"FeePercentUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_treasury","type":"address"}],"name":"TreasuryUpdated","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"MAX_REASONABLE_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RATIO_DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TWO_POW_16","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getConfiguration","outputs":[{"components":[{"internalType":"uint256","name":"data","type":"uint256"}],"internalType":"struct DataTypes.ReserveConfigurationMap","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"borrowRatio","type":"uint256"},{"internalType":"uint256","name":"loopCount","type":"uint256"},{"internalType":"bool","name":"isBorrow","type":"bool"}],"name":"getSupplyBorrowAmount","outputs":[{"internalType":"uint256","name":"aTokenAmount","type":"uint256"},{"internalType":"uint256","name":"debtTokenAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getVDebtToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IPool","name":"_pool","type":"address"},{"internalType":"contract IWETH","name":"_weth","type":"address"},{"internalType":"uint256","name":"_feePercent","type":"uint256"},{"internalType":"address","name":"_treasury","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"interestRateMode","type":"uint256"},{"internalType":"uint256","name":"borrowRatio","type":"uint256"},{"internalType":"uint256","name":"loopCount","type":"uint256"},{"internalType":"bool","name":"isBorrow","type":"bool"}],"name":"loop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"interestRateMode","type":"uint256"},{"internalType":"uint256","name":"borrowRatio","type":"uint256"},{"internalType":"uint256","name":"loopCount","type":"uint256"}],"name":"loopETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"interestRateMode","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"borrowRatio","type":"uint256"},{"internalType":"uint256","name":"loopCount","type":"uint256"}],"name":"loopETHFromBorrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"ltv","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"contract IPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feePercent","type":"uint256"}],"name":"setFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]}');function vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t0&&c.push(e.aTokenAddress),e.vIncentivesData&&e.vIncentivesData.length>0&&c.push(e.variableDebtTokenAddress),e.sIncentivesData&&e.sIncentivesData.length>0&&c.push(e.stableDebtTokenAddress)})),u=new un(t().jsonRpcProvider()),l=new fn(t().jsonRpcProvider()),!t().currentMarketData.v3){e.next=16;break}if("all"!==r.symbol){e.next=13;break}return e.abrupt("return",l.claimAllRewards({user:a,assets:c,to:a,incentivesControllerAddress:r.incentiveControllerAddress}));case 13:return e.abrupt("return",l.claimRewards({user:a,assets:c,to:a,incentivesControllerAddress:r.incentiveControllerAddress,reward:r.rewardTokenAddress}));case 14:e.next=17;break;case 16:return e.abrupt("return",u.claimRewards({user:a,assets:r.assets,to:a,incentivesControllerAddress:r.incentiveControllerAddress}));case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),useOptimizedPath:function(){return t().currentMarketData.v3&&(0,gn.eH)(t().currentChainId)},poolComputed:{get minRemainingBaseTokenBalance(){if(!t())return"0.001";var e=wn({},t()),n=e.currentNetworkConfig,r=e.currentChainId,i=n.underlyingChainId||r;return gn.AU[i]||"0.001"}},generateSignatureRequest:function(){var e=(0,r.Z)(s().mark((function e(n){var r,i,o,a,c,u,l,d,f,p,h,m,g;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.token,i=n.amount,o=n.deadline,a=n.spender,c=t().jsonRpcProvider(),u=new ht.A(c),l=new Ye(c),e.next=6,u.getTokenData(r);case 6:return d=e.sent,f=d.name,e.next=10,c.getNetwork();case 10:return p=e.sent,h=p.chainId,e.next=14,l.getNonce({token:r,owner:t().account});case 14:return m=e.sent,g={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},primaryType:"Permit",domain:{name:f,version:"1",chainId:h,verifyingContract:r},message:{owner:t().account,spender:a,value:i,nonce:m,deadline:o}},e.abrupt("return",JSON.stringify(g));case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),estimateGasLimit:function(){var e=(0,r.Z)(s().mark((function e(n){var r,i,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t().jsonRpcProvider(),i=n.gasLimit?n.gasLimit:_t.O$.from("0"),delete n.gasLimit,e.next=5,r.estimateGas(n);case 5:return o=(o=e.sent).mul(115).div(100),n.gasLimit=o.gt(i)?o:i,e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getLoopApprovedAmount:function(){var e=(0,r.Z)(s().mark((function e(n){var r,i,o,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t().jsonRpcProvider(),i=new ht.A(r),o=t().account,e.next=5,i.approvedAmount({user:o,token:n.token,spender:n.spender});case 5:return a=e.sent,e.abrupt("return",wn({user:o,amount:a.toString()},n));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),loop:function(e){var n=t().account,r={},i=new Ne.vU(bn.Mt).encodeFunctionData("loop",[e.asset,e.amount,e.interestRateMode,e.borrowRatio,e.loopCount,e.isBorrow]);return r.to=e.contract,r.from=n,r.data=i,r.gasLimit=_t.O$.from(l.eB[u.UQ.default].recommended),r},loopETH:function(e){var n=t().account,r={},i=new Ne.vU(bn.Mt),o=e.isSupply?i.encodeFunctionData("loopETH",[e.interestRateMode,e.borrowRatio,e.loopCount]):i.encodeFunctionData("loopETHFromBorrow",[e.interestRateMode,e.amount,e.borrowRatio,e.loopCount]);return r.to=e.contract,r.from=n,r.data=o,e.isSupply&&(r.value=_t.O$.from(e.amount)),r.gasLimit=_t.O$.from(l.eB[u.UQ.supply].recommended),r}}},An=n(81374),En=function(e,t){var n=ve.z2[0],r=ve.ei[n];return{currentMarket:n,currentMarketData:ve.ei[n],currentChainId:r.chainId,currentNetworkConfig:(0,ve.Mo)(r.chainId),jsonRpcProvider:function(){return(0,ve.VH)(t().currentChainId)},setCurrentMarket:function(t,n){if(ve.z2.includes(t)){var r=ve.ei[t];localStorage.setItem("selectedMarket",t),n||(0,An.Qw)("marketName",t),e({currentMarket:t,currentMarketData:r,currentChainId:r.chainId,currentNetworkConfig:(0,ve.Mo)(r.chainId)})}},tryPermit:function(){return!1},invite:"",setInvite:function(t){e({invite:t})}}};function _n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kn(e){for(var t=1;t0?a=this.splitSignedPermits(r):s=await this.approveSupplyAssets(t,e);let c=[];if(i&&i.length>0)c=this.splitSignedCreditDelegationPermits(i);else{const e=await this.approveDelegationTokens(t,o);s.push(...e)}const l=e.map((e=>e.underlyingAsset)),d=n.map((e=>({asset:e.underlyingAsset,rateMode:e.rateMode===u.tk.Stable?1:2}))),f=this.getContractInstance(this.MIGRATOR_ADDRESS),p=this.generateTxCallback({rawTxMethod:async()=>f.populateTransaction.migrate(l,d,a,c),from:t});return s.push({tx:p,txType:u.ns.V3_MIGRATION_ACTION,gas:this.generateTxPriceEstimation(a.length>0?[]:s,p,u.UQ.migrateV3)}),s}async approveDelegationTokens(e,t){return(await Promise.all(t.map((async({amount:t,debtTokenAddress:n})=>this.baseDebtTokenService.isDelegationApproved({debtTokenAddress:n,allowanceGiver:e,allowanceReceiver:this.MIGRATOR_ADDRESS,amount:t,nativeDecimals:!0}))))).map(((n,r)=>{if(n)return;const i=t[r],o=new In.Z(i.amount),s=o.dividedBy(10),a=o.plus(s).toFixed(0);return this.baseDebtTokenService.approveDelegation({user:e,delegatee:this.MIGRATOR_ADDRESS,debtTokenAddress:i.debtTokenAddress,amount:a})})).filter((e=>Boolean(e)))}async approveSupplyAssets(e,t){return(await Promise.all(t.map((async({amount:t,aToken:n})=>this.erc20Service.isApproved({amount:t,spender:this.MIGRATOR_ADDRESS,token:n,user:e,nativeDecimals:!0}))))).map(((n,r)=>{if(n)return;const i=t[r];return this.erc20Service.approve({user:e,token:i.aToken,spender:this.MIGRATOR_ADDRESS,amount:pt.Bz.toString()})})).filter((e=>Boolean(e)))}splitSignedPermits(e){return e.map((e=>{const{aToken:t,deadline:n,value:r,signedPermit:i}=e,o=mn.splitSignature(i);return{aToken:t,deadline:n,value:r,v:o.v,r:o.r,s:o.s}}))}splitSignedCreditDelegationPermits(e){return e.map((e=>{const{debtToken:t,deadline:n,value:r,signedPermit:i}=e,o=mn.splitSignature(i);return{debtToken:t,deadline:n,value:r,v:o.v,r:o.r,s:o.s}}))}}(0,a.__decorate)([d.Wt,(0,a.__param)(0,(0,f.Oh)("asset")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dn.prototype,"getMigrationSupply",null),(0,a.__decorate)([d.Wt,(0,a.__param)(0,(0,f.Oh)("user")),(0,a.__metadata)("design:type",Function),(0,a.__metadata)("design:paramtypes",[Object]),(0,a.__metadata)("design:returntype",Promise)],Dn.prototype,"migrate",null);var Pn=n(67728);function Bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mn(e){for(var t=1;t=0?e.selectedMigrationSupplyAssets.splice(n,1):e.selectedMigrationSupplyAssets.push({underlyingAsset:t,enforced:!1})}))}))},toggleMigrationSelectedBorrowAsset:function(t){e((function(e){return ye(e,(function(e){var n=e.selectedMigrationBorrowAssets.findIndex((function(e){return t.debtKey==e.debtKey}));n>=0?e.selectedMigrationBorrowAssets.splice(n,1):e.selectedMigrationBorrowAssets.push(t)}))}))},enforceAsCollateral:function(n){e((function(e){return ye(e,(function(e){var r,i=(0,Pn.Wx)(t(),n),o=null===(r=e.selectedMigrationSupplyAssets[i])||void 0===r?void 0:r.enforced;i>=0&&(e.selectedMigrationSupplyAssets.forEach((function(e){e.enforced=!1})),e.selectedMigrationSupplyAssets[i].enforced=!o)}))}))},resetMigrationSelectedAssets:function(){e({selectedMigrationBorrowAssets:[],selectedMigrationSupplyAssets:[]})},selectAllSupply:function(n){var r=(0,Pn.xk)(t(),n).supplyReserves;if(t().selectedMigrationSupplyAssets.length==r.length||0!=t().selectedMigrationSupplyAssets.length)e({selectedMigrationSupplyAssets:[]});else{var i=r.filter((function(e){return void 0===e.migrationDisabled})).filter((function(e){var n=e.underlyingAsset;return(0,Pn.Wx)(t(),n)<0})).map((function(e){return{underlyingAsset:e.underlyingAsset,enforced:!1}}));e({selectedMigrationSupplyAssets:[].concat((0,Cn.Z)(t().selectedMigrationSupplyAssets),(0,Cn.Z)(i))})}},selectAllBorrow:function(n){var r=(0,Pn.xk)(t(),n).borrowReserves;if(t().selectedMigrationBorrowAssets.length==r.length||0!=t().selectedMigrationBorrowAssets.length)e({selectedMigrationBorrowAssets:[]});else{var i=r.filter((function(e){return void 0===e.migrationDisabled})).filter((function(e){return(0,Pn.Z4)(t().selectedMigrationBorrowAssets,e)<0}));e({selectedMigrationBorrowAssets:[].concat((0,Cn.Z)(t().selectedMigrationBorrowAssets),(0,Cn.Z)(i))})}},getApprovePermitsForSelectedAssets:function(){var n=hn()().unix(),r=(0,Pn.Bx)(t(),n,!0),i=(0,Pn.OH)(t(),n).map((function(e){var t=e.reserve;return{amount:e.increasedAmount,underlyingAsset:t.aTokenAddress,permitType:"SUPPLY_MIGRATOR_V3"}})),o=[].concat((0,Cn.Z)(i),(0,Cn.Z)(r));return e({approvalPermitsForMigrationAssets:o}),o},migrateWithoutPermits:function(){var n=hn()().unix();e({timestamp:n});var r=(0,Pn.rB)(t(),n),i=(0,Pn.k6)(t(),n),o=t().account,s=(0,Pn.Bx)(t(),n).map((function(e){return{debtTokenAddress:e.underlyingAsset,amount:e.amount}}));return t().getMigrationServiceInstance().migrate({repayAssets:i,supplyAssets:r,user:o,creditDelegationApprovals:s,signedCreditDelegationPermits:[],signedSupplyPermits:[]})},migrateWithPermits:function(){var n=(0,r.Z)(s().mark((function n(r,i){var o,a,c,u,l,d,f,p,h;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=hn()().unix(),e({timestamp:o}),a=(0,Pn.Gc)(t(),r,i),c=a.creditDelegationPermits,u=a.supplyPermits,l=(0,Pn.rB)(t(),o),d=(0,Pn.k6)(t(),o),f=t().account,p=(0,Pn.Bx)(t(),o,!0),h=p.map((function(e){return{debtTokenAddress:e.underlyingAsset,amount:e.amount}})),n.abrupt("return",t().getMigrationServiceInstance().migrate({repayAssets:d,supplyAssets:l,user:f,creditDelegationApprovals:h,signedCreditDelegationPermits:c,signedSupplyPermits:u}));case 9:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),getMigratorAddress:function(){return t().currentMarketData.addresses.V3_MIGRATOR||""},getMigrationServiceInstance:function(){var n=t().getMigratorAddress(),r=t().migrationServiceInstances[n];if(r)return r;var o=t().jsonRpcProvider(),s=t().getMigratorAddress(),a=(0,yn.xI)(t()),c=new Ut(o,{POOL:a.addresses.LENDING_POOL,REPAY_WITH_COLLATERAL_ADAPTER:a.addresses.REPAY_WITH_COLLATERAL_ADAPTER,SWAP_COLLATERAL_ADAPTER:a.addresses.SWAP_COLLATERAL_ADAPTER,WETH_GATEWAY:a.addresses.WETH_GATEWAY,L2_ENCODER:a.addresses.L2_ENCODER}),u=t().migrationServiceInstances,l=new Dn(o,s,c);return e({migrationServiceInstances:Mn(Mn({},u),{},(0,i.Z)({},n,l))}),l},getMigrationExceptionSupplyBalances:function(){var n=(0,r.Z)(s().mark((function n(r){var i,o,a,c,u;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=t().currentNetworkConfig.underlyingChainId||t().currentChainId,!((o=Fn[i])&&o.length>0)||t().exceptionsBalancesLoading||0!=Object.keys(t().migrationExceptions).length){n.next=12;break}if(e({exceptionsBalancesLoading:!0}),!((a=r.filter((function(e){return o.indexOf(e.underlyingAsset)>=0&&"0"!==e.scaledATokenBalance}))).length>0)){n.next=12;break}return e({exceptionsBalancesLoading:!0}),c=a.map((function(e){var n=e.scaledATokenBalance,r=e.underlyingAsset;return t().getMigrationServiceInstance().getMigrationSupply({amount:n,asset:r})})),n.next=10,Promise.all(c);case 10:u=n.sent,e((function(e){return ye(e,(function(e){u.forEach((function(t,n){var r=(0,Be.Z)(t,2),i=r[0],o=r[1],s=a[n].underlyingAsset;e.migrationExceptions[s]={v2UnderlyingAsset:s,v3UnderlyingAsset:i.toLowerCase(),amount:o.toString()}})),e.exceptionsBalancesLoading=!1}))}));case 12:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}},jn=function(e,t){return fetch(e,t).then((function(e){if(!e.ok)throw new Error(e.statusText);return"HEAD"===(null===t||void 0===t?void 0:t.method)?Promise.resolve():e.json()}))},Un=(0,ve.Zs)(),Zn=[{inputs:[{internalType:"address",name:"_address",type:"address"}],name:"getL2ReverseRecord",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],Hn=function(){var e=(0,r.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new p.CH("0x135a32c16765cef67dec3ae53b03f8c21feec0d8",Zn,Un),e.prev=1,e.next=4,n.getL2ReverseRecord(t);case 4:return e.abrupt("return",e.sent);case 7:if(e.prev=7,e.t0=e.catch(1),"CALL_EXCEPTION"!==e.t0.code){e.next=11;break}return e.abrupt("return",null);case 11:throw e.t0;case 12:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}(),zn=function(){var e=(0,r.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Hn(t);case 3:return n=e.sent,e.abrupt("return",n);case 7:e.prev=7,e.t0=e.catch(0),console.error("ENS name lookup error",e.t0);case 10:return e.abrupt("return",null);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),Gn=function(){var e=(0,r.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n="https://metadata.ens.domains/mainnet/avatar/".concat(t,"/"),e.next=4,jn(n,{method:"HEAD"});case 4:return e.abrupt("return",n);case 7:e.prev=7,e.t0=e.catch(0),console.error("ENS avatar lookup error",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),Vn=function(){var e=(0,r.Z)(s().mark((function e(t){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zn(t);case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.next=7,Gn(n);case 7:return r=e.sent,e.abrupt("return",{name:n,avatar:r,type:Nn.ENS});case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Wn=(0,ve.Zs)(),qn=[{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"name",outputs:[{name:"ret",type:"string"}],payable:!1,type:"function"}],$n=function(){var e=(0,r.Z)(s().mark((function e(t){var n,r,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new p.CH("0xCE70B7f5BB44BE2f8A7f37f8c162240440Fc6218",qn,Wn),r=(0,Me.namehash)(t.substring(2)+".addr.reverse"),e.prev=2,e.next=5,n.name(r);case 5:return i=e.sent,e.abrupt("return",i);case 9:if(e.prev=9,e.t0=e.catch(2),"CALL_EXCEPTION"!==e.t0.code){e.next=13;break}return e.abrupt("return",null);case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),Kn=function(){var e=(0,r.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,$n(t);case 3:return n=e.sent,e.abrupt("return",n);case 7:e.prev=7,e.t0=e.catch(0),console.error("ENS name lookup error",e.t0);case 10:return e.abrupt("return",null);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),Yn=function(){var e=(0,r.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n="https://metadata.ens.domains/mainnet/avatar/".concat(t,"/"),e.next=4,jn(n,{method:"HEAD"});case 4:return e.abrupt("return",n);case 7:e.prev=7,e.t0=e.catch(0),console.error("ENS avatar lookup error",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),Xn=function(){var e=(0,r.Z)(s().mark((function e(t){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kn(t);case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.next=7,Yn(n);case 7:return r=e.sent,e.abrupt("return",{name:n,avatar:r,type:Nn.ENS});case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Jn=[Xn,Vn];!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ENS=1]="ENS"}(Nn||(Nn={}));var Qn=function(e,t){return{defaultDomain:null,domainsLoading:!1,userDomains:[],fetchConnectedWalletDomains:function(){var n=(0,r.Z)(s().mark((function n(){var r,i,o,a;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e({domainsLoading:!0}),i=t().account,n.next=4,Promise.all(Jn.map((function(e){return e(i)})));case 4:o=n.sent,a=o.filter((function(e){return null!==e})),e({userDomains:a,defaultDomain:null!==(r=a[0])&&void 0!==r?r:null,domainsLoading:!1});case 7:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),clearWalletDomains:function(){e({userDomains:[],defaultDomain:null})}}},er=n(32113),tr=n(9669),nr=n.n(tr);function rr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ir(e){for(var t=1;t0)return n;var r=e.selectedMigrationSupplyAssets.filter((function(n){var r=w(e,n),i=t[r],o=x(e,i);return!!i&&"0"==o&&!i.reserve.isIsolated}));return r.length>0?r:e.selectedMigrationSupplyAssets.filter((function(n){var r=w(e,n),i=t[r];return"0"==x(e,i)&&i.reserve.isIsolated}))}(e,A);if(E.length>0){var _=w(e,E[0]),k=A[_];"0"!==k.reserve.reserveLiquidationThreshold&&k.reserve.isIsolated&&(v=g(g({},k.reserve),{},{enteringIsolationMode:!0}))}}var T=l.filter((function(e){return"0"!==e.underlyingBalance})),S=function(e){var t=[];return e.forEach((function(e){"0"!==e.stableBorrows&&t.push(g(g({},e),{},{interestRate:o.tk.Stable,increasedStableBorrows:e.stableBorrows,increasedVariableBorrows:"0",debtKey:e.reserve.stableDebtTokenAddress})),"0"!==e.variableBorrows&&t.push(g(g({},e),{},{interestRate:o.tk.Variable,increasedStableBorrows:"0",increasedVariableBorrows:e.variableBorrows,debtKey:e.reserve.variableDebtTokenAddress}))})),t}(l),C=T.map((function(t){var n,r,i,o,s=!0,c=w(e,t),u=null===(n=A[c])||void 0===n?void 0:n.reserve.isIsolated,l="0"==(null===(r=A[c])||void 0===r?void 0:r.underlyingBalance),d=A[c];if(d){var f=(0,a.hE)(d.reserve.supplyCap).minus(d.reserve.totalLiquidity),p=d.reserve.formattedBaseLTVasCollateral;0!==b&&d.reserve.eModeCategoryId!==b&&(p=d.reserve.formattedEModeLtv),o={stableBorrowAPY:d.stableBorrowAPY,variableBorrowAPY:d.reserve.variableBorrowAPY,supplyAPY:d.reserve.supplyAPY,aIncentivesData:d.reserve.aIncentivesData,vIncentivesData:d.reserve.vIncentivesData,sIncentivesData:d.reserve.sIncentivesData,priceInUSD:d.reserve.priceInUSD,ltv:p},d.reserve.isFrozen?i=y.ReserveFrozen:f.isGreaterThan(t.underlyingBalance)||(i=y.NotEnoughtSupplies)}else i=y.V3AssetMissing;return s=v?t.underlyingAsset==v.underlyingAsset:"0"!==(null===d||void 0===d?void 0:d.underlyingBalance)?null===d||void 0===d?void 0:d.usageAsCollateralEnabledOnUser:!u,g(g({},t),{},{usageAsCollateralEnabledOnUserV3:s,isolatedOnV3:u,canBeEnforced:l,migrationDisabled:i,v3Rates:o})})),I=S.map((function(e){var t,n,r,i=null===(t=A[e.underlyingAsset])||void 0===t?void 0:t.reserve;v&&!i.borrowableInIsolation&&(n=y.IsolationModeBorrowDisabled);var o=A[e.underlyingAsset];if(o){var c=o.reserve.formattedReserveLiquidationThreshold;0!==b&&(null===i||void 0===i?void 0:i.eModeCategoryId)!==b&&(n=y.EModeBorrowDisabled,c=o.reserve.formattedEModeLiquidationThreshold),r={stableBorrowAPY:o.stableBorrowAPY,variableBorrowAPY:o.reserve.variableBorrowAPY,supplyAPY:o.reserve.stableBorrowAPY,aIncentivesData:o.reserve.aIncentivesData,vIncentivesData:o.reserve.vIncentivesData,sIncentivesData:o.reserve.sIncentivesData,priceInUSD:o.reserve.priceInUSD,liquidationThreshold:c},(0,a.hE)((0,s.gU)(e.increasedStableBorrows,e.reserve.decimals)).plus((0,s.gU)(e.increasedVariableBorrows,e.reserve.decimals)).isGreaterThan(o.reserve.availableLiquidity)?n=y.InsufficientLiquidity:o.reserve.flashLoanEnabled?o.reserve.isFrozen&&(n=y.ReserveFrozen):n=y.AssetNotFlashloanable}else n=y.V3AssetMissing;return g(g({},e),{},{v3Rates:r,migrationDisabled:n})}));return{totalCollateralUSD:d.totalCollateralUSD,totalBorrowsUSD:d.totalBorrowsUSD,healthFactor:d.healthFactor,borrowReserves:I,supplyReserves:C,isolatedReserveV3:v}},E=function(e,t){var n=A(e,t),r=n.supplyReserves,i=n.isolatedReserveV3,o=r.filter((function(t){return b(e,t.underlyingAsset)>=0}));return o.sort((function(e){return i?i.underlyingAsset==e.underlyingAsset?-1:1:e.isolatedOnV3?1:-1})),o},_=function(e,t){return E(e,t).map((function(e){var t=C(e.underlyingBalance),n=(0,s.gU)(t,e.reserve.decimals);return g(g({},e),{},{increasedAmount:n})}))},k=function(e,t){return _(e,t).map((function(e){var t=e.underlyingAsset,n=e.reserve,r=e.increasedAmount,i=Math.floor(Date.now()/1e3+3600);return{amount:r,aToken:n.aTokenAddress,underlyingAsset:t,deadline:i}}))},T=function(e,t){var n=Math.floor(Date.now()/1e3+3600);return I(e,t).map((function(e){return{underlyingAsset:e.underlyingAsset,amount:e.interestRate==o.tk.Stable?e.increasedStableBorrows:e.increasedVariableBorrows,deadline:n,debtToken:e.debtKey,rateMode:e.interestRate}}))},S=function(e,t,n){var r=e.approvalPermitsForMigrationAssets.map((function(e,n){return g(g({},e),{},{signedPermit:t[n]})}));return{supplyPermits:r.filter((function(e){return"SUPPLY_MIGRATOR_V3"===e.permitType})).map((function(e){var t=e.signedPermit,r=e.underlyingAsset,i=e.amount;return{deadline:n,aToken:r,value:i,signedPermit:t}})),creditDelegationPermits:r.filter((function(e){return"BORROW_MIGRATOR_V3"===e.permitType})).map((function(e){var t=e.amount,r=e.signedPermit,i=e.underlyingAsset;return{deadline:n,debtToken:i,signedPermit:r,value:t}}))}},C=function(e){var t=(0,a.hE)(e);return t.plus(t.div(1e3)).toString()},I=function(e,t){return A(e,t).borrowReserves.filter((function(t){return v(e.selectedMigrationBorrowAssets,t)>=0}))},O=function(e,t){var n=M(e,t).userReservesData;return I(e,t).filter((function(e){return void 0===e.migrationDisabled})).map((function(e){var t=e.debtKey,r=n.find((function(t){return t.underlyingAsset==e.underlyingAsset}));return r&&(t=e.interestRate==o.tk.Variable?r.reserve.variableDebtTokenAddress:r.reserve.stableDebtTokenAddress),g(g({},e),{},{debtKey:t})}))},R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=r.marketReferenceCurrencyDecimals,a=r.marketReferenceCurrencyPriceInUsd,l=(0,c.vl)({reserves:e,reserveIncentives:t,currentTimestamp:i,marketReferenceCurrencyDecimals:s,marketReferencePriceInUsd:a}),d=(0,u.G)({currentTimestamp:i,formattedReserves:l,marketReferenceCurrencyDecimals:s,marketReferencePriceInUsd:a,userReserves:n,userEmodeCategoryId:o});return d},D=function(e,t){var n,r=(0,f.qY)(e),i=A(e,t).borrowReserves,s=(null===r||void 0===r||null===(n=r.userReserves)||void 0===n?void 0:n.map((function(t){var n=t.scaledATokenBalance,r=t.principalStableDebt,s=t.scaledVariableDebt;return b(e,t.underlyingAsset)>=0&&(n="0"),e.selectedMigrationBorrowAssets.filter((function(e){return e.underlyingAsset==t.underlyingAsset})).filter((function(e){var t=i.find((function(t){return t.underlyingAsset==e.underlyingAsset}));return!!t&&void 0===t.migrationDisabled})).forEach((function(e){e.interestRate==o.tk.Stable?r="0":s="0"})),g(g({},t),{},{principalStableDebt:r,scaledATokenBalance:n,scaledVariableDebt:s})})))||[],a=(0,f.To)(r);return R(null===r||void 0===r?void 0:r.reserves,null===r||void 0===r?void 0:r.reserveIncentives,s,a,t,null===r||void 0===r?void 0:r.userEmodeCategoryId)},P=function(e,t,n){var r=M(e,t).userReservesData,i=I(e,t),c={};return i.filter((function(e){return void 0===e.migrationDisabled})).forEach((function(e){var t=r.find((function(t){return t.underlyingAsset===e.underlyingAsset}));if(t){c[e.underlyingAsset]||(c[e.underlyingAsset]={variableDebtTokenAddress:t.reserve.variableDebtTokenAddress,decimals:t.reserve.decimals,stableDebtAmount:"0",variableDebtAmount:"0"});var n=c[e.underlyingAsset];e.interestRate===o.tk.Stable?n.stableDebtAmount=(0,a.hE)(n.stableDebtAmount).plus((0,a.hE)(e.increasedStableBorrows)).toString():e.interestRate===o.tk.Variable&&(n.variableDebtAmount=(0,a.hE)(n.variableDebtAmount).plus((0,a.hE)(e.increasedVariableBorrows)).toString())}})),Object.keys(c).map((function(e){var t=c[e],r=(0,a.hE)(t.stableDebtAmount).plus(t.variableDebtAmount),i=(0,s.gU)(r.toString(),t.decimals);if(n){var o=new d.Z(i),u=o.dividedBy(10);i=o.plus(u).toFixed(0)}return{amount:i,underlyingAsset:t.variableDebtTokenAddress,permitType:"BORROW_MIGRATOR_V3"}}))},B=function(e,t){var n=M(e,t),r=(0,f.$)(e),i=E(e,t),o=O(e,t),c=i.reduce((function(e,t){return e[t.underlyingAsset]=t,e}),{}),u=o.reduce((function(e,t){return e[t.debtKey]=t,e}),{}),d=n.userReservesData.map((function(t){var n=u[t.reserve.stableDebtTokenAddress],r=u[t.reserve.variableDebtTokenAddress],i=function(e,t){var n=Object.values(e.migrationExceptions).find((function(e){return e.v3UnderlyingAsset==t.underlyingAsset}));return(null===n||void 0===n?void 0:n.v2UnderlyingAsset)||t.underlyingAsset}(e,t),o=c[i],d=t.scaledVariableDebt,f=t.scaledATokenBalance,p=t.usageAsCollateralEnabledOnUser,h=(0,a.hE)(t.reserve.variableBorrowIndex);if(r&&void 0===r.migrationDisabled){var m=(0,l.e9)((0,s.gU)(r.increasedVariableBorrows,t.reserve.decimals),h);d=(0,a.hE)(d).plus(m).toString()}if(n&&void 0===n.migrationDisabled){var y=(0,l.e9)((0,s.gU)(n.increasedStableBorrows,t.reserve.decimals),h);d=(0,a.hE)(d).plus(y).toString()}if(o){var b;p=o.usageAsCollateralEnabledOnUserV3;var v=(0,a.hE)(t.scaledATokenBalance),w=(0,a.hE)(t.reserve.liquidityIndex),x=(null===(b=e.migrationExceptions[i])||void 0===b?void 0:b.amount)||(0,s.gU)(o.underlyingBalance,t.reserve.decimals),A=(0,l.e9)(x,w);f=v.plus(A).toString()}return g(g({},t),{},{id:t.reserve.id,scaledVariableDebt:d,scaledATokenBalance:f,usageAsCollateralEnabledOnUser:p})})),p=(0,f.To)(r),h=R(null===r||void 0===r?void 0:r.reserves,null===r||void 0===r?void 0:r.reserveIncentives,d,p,t,null===r||void 0===r?void 0:r.userEmodeCategoryId);return{healthFactor:h.healthFactor,currentLoanToValue:h.currentLoanToValue,totalCollateralMarketReferenceCurrency:h.totalCollateralMarketReferenceCurrency,totalBorrowsMarketReferenceCurrency:h.totalBorrowsMarketReferenceCurrency}},M=function(e,t){var n=(0,f.$)(e),r=(0,f.To)(n);return R(null===n||void 0===n?void 0:n.reserves,null===n||void 0===n?void 0:n.reserveIncentives,null===n||void 0===n?void 0:n.userReserves,r,t,null===n||void 0===n?void 0:n.userEmodeCategoryId)},N=function(e){return Boolean(e.currentMarketData.addresses.V3_MIGRATOR)},F=function(e,t){return void 0!==t.find((function(t){return t.underlyingAsset===e.underlyingAsset}))},L=function(e,t){var n=e.filter((function(e){return void 0===e.migrationDisabled}));return{activeSelections:n.filter((function(e){return F(e,t)})),activeUnselected:n.filter((function(e){return!F(e,t)}))}}},32113:function(e,t,n){"use strict";var r;n.d(t,{n:function(){return r},h:function(){return o}}),function(e){e.APPROVE="Transaction",e.PERMIT="Signed message"}(r||(r={}));var i=function(){var e=localStorage.getItem("walletApprovalPreferences");return e?JSON.parse(e):{}},o=function(e,t){return{account:"",accountLoading:!1,walletType:void 0,setWalletType:function(t){e({walletType:t})},setAccount:function(n){e({account:n||"",isWalletModalOpen:!1}),(0,t().refreshWalletApprovalMethod)()},setAccountLoading:function(t){e({accountLoading:t})},isWalletModalOpen:!1,setWalletModalOpen:function(t){e({isWalletModalOpen:t})},walletApprovalMethodPreference:r.PERMIT,setWalletApprovalMethodPreference:function(n){var r=t().account;if(""!==r){var o=i();o[r.toLowerCase()]=n,localStorage.setItem("walletApprovalPreferences",JSON.stringify(o)),e((function(){return{walletApprovalMethodPreference:n}}))}},refreshWalletApprovalMethod:function(){var n=t().account;if(""!==n){var o=i()[n.toLowerCase()];e((function(){return{walletApprovalMethodPreference:o||r.PERMIT}}))}}}}},30449:function(e,t,n){"use strict";n.d(t,{_:function(){return q},z:function(){return $}});var r=n(67294),i=n(17674),o=n(50029),s=n(92777),a=n(82262),c=n(59499),u=n(87794),l=n.n(u),d=n(24387),f=n(1279),p=n(45626),h=function(e,t){return e.toLocaleLowerCase()===t.toLocaleLowerCase()?"":e},m=function(){function e(t,n){(0,s.Z)(this,e),this.chainId=n,(0,c.Z)(this,"governanceService",void 0),this.governanceService=new d.d(t,{GOVERNANCE_ADDRESS:p.d.addresses.AAVE_GOVERNANCE_V2,GOVERNANCE_HELPER_ADDRESS:p.d.addresses.AAVE_GOVERNANCE_V2_HELPER,ipfsGateway:p.d.ipfsGateway})}return(0,a.Z)(e,[{key:"getVotingPowerAt",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.governanceService.getVotingPowerAt(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getVoteOnProposal",value:function(){var e=(0,o.Z)(l().mark((function e(t){var n,r,i;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.governanceService.getVoteOnProposal(t);case 2:return n=e.sent,r=n.votingPower,i=n.support,e.abrupt("return",{votingPower:(0,f.Fv)(r.toString(),18),support:i});case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPowers",value:function(){var e=(0,o.Z)(l().mark((function e(t){var n,r,o,s,a,c,u,d;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.user,r=p.d.aaveTokenAddress,o=p.d.stkAaveTokenAddress,e.next=4,this.governanceService.getTokensPower({user:n,tokens:[r,o]});case 4:return s=e.sent,a=(0,i.Z)(s,2),c=a[0],u=a[1],d={votingPower:(0,f.Fv)((0,f.hE)(c.votingPower.toString()).plus(u.votingPower.toString()).toString(),18),aaveTokenPower:c,stkAaveTokenPower:u,propositionPower:(0,f.Fv)((0,f.hE)(c.propositionPower.toString()).plus(u.propositionPower.toString()).toString(),18),aaveVotingDelegatee:h(c.delegatedAddressVotingPower,n),aavePropositionDelegatee:h(c.delegatedAddressPropositionPower,n),stkAaveVotingDelegatee:h(u.delegatedAddressVotingPower,n),stkAavePropositionDelegatee:h(u.delegatedAddressPropositionPower,n)},e.abrupt("return",d);case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}(),g=n(56371),y=n(58342);class b extends y.lV{constructor(e){super(v,w,e)}static connect(e,t){return new y.CH(e,v,t)}}const v=[{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"token",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"users",type:"address[]"},{internalType:"address[]",name:"tokens",type:"address[]"}],name:"batchBalanceOf",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"provider",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"getUserWalletBalances",outputs:[{internalType:"address[]",name:"",type:"address[]"},{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}],w="0x608060405234801561001057600080fd5b50610a63806100206000396000f3fe6080604052600436106100385760003560e01c80630240534314610072578063b59b28ef146100a9578063f7888aec146100d65761006d565b3661006d5761004633610103565b61006b5760405162461bcd60e51b8152600401610062906109c9565b60405180910390fd5b005b600080fd5b34801561007e57600080fd5b5061009261008d366004610758565b61013f565b6040516100a092919061092f565b60405180910390f35b3480156100b557600080fd5b506100c96100c4366004610790565b6104b1565b6040516100a0919061098f565b3480156100e257600080fd5b506100f66100f1366004610758565b61058d565b6040516100a091906109e5565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061013757508115155b949350505050565b6060806000846001600160a01b0316630261bf8b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561017d57600080fd5b505afa158015610191573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b5919061073c565b90506060816001600160a01b031663d1946dbc6040518163ffffffff1660e01b815260040160006040518083038186803b1580156101f257600080fd5b505afa158015610206573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261022e91908101906107f9565b90506060815160010167ffffffffffffffff8111801561024d57600080fd5b50604051908082528060200260200182016040528015610277578160200160208202803683370190505b50905060005b82518110156102c65782818151811061029257fe5b60200260200101518282815181106102a657fe5b6001600160a01b039092166020928302919091019091015260010161027d565b5073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee818351815181106102e957fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506060815167ffffffffffffffff8111801561032357600080fd5b5060405190808252806020026020018201604052801561034d578160200160208202803683370190505b50905060005b835181101561046b576103646106b9565b856001600160a01b031663c44b11f785848151811061037f57fe5b60200260200101516040518263ffffffff1660e01b81526004016103a3919061091b565b60206040518083038186803b1580156103bb57600080fd5b505afa1580156103cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f391906108a4565b905060006104008261067d565b50505090508061042b57600084848151811061041857fe5b6020026020010181815250505050610463565b6104488a86858151811061043b57fe5b602002602001015161058d565b84848151811061045457fe5b60200260200101818152505050505b600101610353565b5061048a8773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61058d565b8184518151811061049757fe5b6020908102919091010152909450925050505b9250929050565b60608084830267ffffffffffffffff811180156104cd57600080fd5b506040519080825280602002602001820160405280156104f7578160200160208202803683370190505b50905060005b858110156105835760005b8481101561057a5761055588888481811061051f57fe5b90506020020160208101906105349190610719565b87878481811061054057fe5b90506020020160208101906100f19190610719565b83518490848802840190811061056757fe5b6020908102919091010152600101610508565b506001016104fd565b5095945050505050565b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156105c557506001600160a01b03821631610677565b6105d7826001600160a01b0316610103565b1561065f576040516370a0823160e01b81526001600160a01b038316906370a082319061060890869060040161091b565b60206040518083038186803b15801561062057600080fd5b505afa158015610634573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065891906108c9565b9050610677565b60405162461bcd60e51b8152600401610062906109a2565b92915050565b51670100000000000000811615159167020000000000000082161515916704000000000000008116151591670800000000000000909116151590565b6040518060200160405280600081525090565b805161067781610a15565b60008083601f8401126106e8578182fd5b50813567ffffffffffffffff8111156106ff578182fd5b60208301915083602080830285010111156104aa57600080fd5b60006020828403121561072a578081fd5b813561073581610a15565b9392505050565b60006020828403121561074d578081fd5b815161073581610a15565b6000806040838503121561076a578081fd5b823561077581610a15565b9150602083013561078581610a15565b809150509250929050565b600080600080604085870312156107a5578182fd5b843567ffffffffffffffff808211156107bc578384fd5b6107c8888389016106d7565b909650945060208701359150808211156107e0578384fd5b506107ed878288016106d7565b95989497509550505050565b6000602080838503121561080b578182fd5b825167ffffffffffffffff80821115610822578384fd5b818501915085601f830112610835578384fd5b815181811115610843578485fd5b83810291506108538483016109ee565b8181528481019084860184860187018a101561086d578788fd5b8795505b83861015610897576108838a826106cc565b835260019590950194918601918601610871565b5098975050505050505050565b6000602082840312156108b5578081fd5b6108bf60206109ee565b9151825250919050565b6000602082840312156108da578081fd5b5051919050565b6000815180845260208085019450808401835b83811015610910578151875295820195908201906001016108f4565b509495945050505050565b6001600160a01b0391909116815260200190565b604080825283519082018190526000906020906060840190828701845b828110156109715781516001600160a01b03168452928401929084019060010161094c565b5050508381038285015261098581866108e1565b9695505050505050565b60006020825261073560208301846108e1565b6020808252600d908201526c24a72b20a624a22faa27a5a2a760991b604082015260600190565b602080825260029082015261191960f11b604082015260600190565b90815260200190565b60405181810167ffffffffffffffff81118282101715610a0d57600080fd5b604052919050565b6001600160a01b0381168114610a2a57600080fd5b5056fea26469706673582212207ae67703d49267c117fb5657d5acf71315b42fa382a2989a68cd98ccc5351bc964736f6c634300060c0033";class x{constructor(e){this._contract=b.connect(e.walletBalanceProviderAddress,e.provider)}async balanceOf(e,t){if(!(0,g.isAddress)(e))throw new Error("User address is not a valid ethereum address");if(!(0,g.isAddress)(t))throw new Error("Token address is not a valid ethereum address");return this._contract.balanceOf(e,t)}async batchBalanceOf(e,t){if(!e.every((e=>(0,g.isAddress)(e))))throw new Error("One of the user address is not a valid ethereum address");if(!t.every((e=>(0,g.isAddress)(e))))throw new Error("One of the token address is not a valid ethereum address");return this._contract.batchBalanceOf(e,t)}async getUserWalletBalancesForLendingPoolProvider(e,t){if(!(0,g.isAddress)(e))throw new Error("User address is not a valid ethereum address");if(!(0,g.isAddress)(t))throw new Error("Lending pool address provider is not a valid ethereum address");return this._contract.getUserWalletBalances(t,e)}}var A=function(){function e(t,n,r){var i=this;(0,s.Z)(this,e),this.chainId=r,(0,c.Z)(this,"walletBalanceService",void 0),(0,c.Z)(this,"getTokenBalanceOf",function(){var e=(0,o.Z)(l().mark((function e(t){var n,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.tokenAddress,r=t.user,e.next=3,i.walletBalanceService.balanceOf(r,n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.walletBalanceService=new x({walletBalanceProviderAddress:n,provider:t})}return(0,a.Z)(e,[{key:"getGovernanceTokensBalance",value:function(){var e=(0,o.Z)(l().mark((function e(t){var n,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.user,e.next=3,this.walletBalanceService.batchBalanceOf([n],[p.d.aaveTokenAddress,p.d.aAaveTokenAddress,p.d.stkAaveTokenAddress]);case 3:return r=e.sent,e.abrupt("return",{aave:(0,f.Fv)(r[0].toString(),18),aAave:(0,f.Fv)(r[1].toString(),18),stkAave:(0,f.Fv)(r[2].toString(),18)});case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPoolTokensBalances",value:function(){var e=(0,o.Z)(l().mark((function e(t){var n,r,i,o,s,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.user,r=t.lendingPoolAddressProvider,e.next=3,this.walletBalanceService.getUserWalletBalancesForLendingPoolProvider(n,r);case 3:return i=e.sent,o=i[0],s=i[1],a=o.map((function(e,t){return{address:e.toLowerCase(),amount:s[t].toString()}})),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}(),E=n(69311),_=n(63206),k=n(38776),T=n(59370),S=n(9704),C=n(21380),I=n(3408),O=n(67724),R=n(87940),D=n(16649),P=n(74450),B=n(81531),M=n(63553),N=n(37247),F=n(11466);function L(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,N.Z)(e);if(t){var i=(0,N.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,M.Z)(this,n)}}var j=function(e){(0,B.Z)(n,e);var t=L(n);function n(){return(0,s.Z)(this,n),t.apply(this,arguments)}return(0,a.Z)(n,[{key:"connect",value:function(e){return(0,P.Z)((0,N.Z)(n.prototype),"connect",this).call(this,e)}}],[{key:"connect",value:function(e,t){return new F.CH(e,U,t)}}]),n}(F.CH),U=[{inputs:[{internalType:"address",name:"_userAddress",type:"address"}],name:"getLPLockDetails",outputs:[{components:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"power",type:"uint256"},{internalType:"uint256",name:"apr",type:"uint256"}],internalType:"struct VestedZeroUiHelper.LockedBalanceWithApr[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_userAddress",type:"address"}],name:"getLockDetails",outputs:[{components:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"power",type:"uint256"},{internalType:"uint256",name:"apr",type:"uint256"}],internalType:"struct VestedZeroUiHelper.LockedBalanceWithApr[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_userAddress",type:"address"}],name:"getVestedNFTData",outputs:[{components:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"cliffDuration",type:"uint256"},{internalType:"uint256",name:"unlockDate",type:"uint256"},{internalType:"uint256",name:"pendingClaimed",type:"uint256"},{internalType:"uint256",name:"pending",type:"uint256"},{internalType:"uint256",name:"upfrontClaimed",type:"uint256"},{internalType:"uint256",name:"upfront",type:"uint256"},{internalType:"uint256",name:"linearDuration",type:"uint256"},{internalType:"uint256",name:"createdAt",type:"uint256"},{internalType:"bool",name:"hasPenalty",type:"bool"},{internalType:"enum IVestedZeroNFT.VestCategory",name:"category",type:"uint8"},{internalType:"uint256",name:"claimable",type:"uint256"},{internalType:"uint256",name:"unClaimed",type:"uint256"},{internalType:"uint256",name:"penalty",type:"uint256"},{internalType:"bool",name:"isFrozen",type:"bool"}],internalType:"struct VestedZeroUiHelper.VestDetails[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_vestedZeroNFT",type:"address"},{internalType:"address",name:"_omnichainStakingToken",type:"address"},{internalType:"address",name:"_omnichainStakingLP",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"}],Z=function(){function e(t){(0,s.Z)(this,e),(0,c.Z)(this,"_contract",void 0),this._contract=j.connect(t.uiStakeDataProvider,t.provider)}return(0,a.Z)(e,[{key:"getUserVestingData",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getVestedNFTData(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getUserLockData",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getLockDetails(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getUserLPLockData",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._contract.getLPLockDetails(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),H=function(){function e(t,n,r){(0,s.Z)(this,e),this.chainId=r,(0,c.Z)(this,"vestUIDataService",void 0),this.vestUIDataService=new Z({uiStakeDataProvider:n,provider:t})}return(0,a.Z)(e,[{key:"getGeneralVestUIDataHumanized",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.vestUIDataService.getUserVestingData(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getGenralStakeUIDataHumanized",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.vestUIDataService.getUserLockData(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getGenralLPLockUIDataHumanized",value:function(){var e=(0,o.Z)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.vestUIDataService.getUserLPLockData(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}(),z=n(59027),G=n(24243),V=n(85893),W=(0,r.createContext)(null),q=function(e){var t=e.children,n=(0,E.Yh)((function(e){return e.currentNetworkConfig})),r=(0,E.Yh)((function(e){return e.currentMarketData})),i=n.isFork&&n.underlyingChainId===p.d.chainId?r.chainId:p.d.chainId,o=(0,_.VH)(r.chainId),s=o,a=(0,_.VH)(T.H.chainId),c=(0,_.VH)(T.H.chainId),u=(0,_.VH)(T.H.chainId),l=(0,_.VH)(T.H.chainId),d=(0,_.VH)(T.H.chainId),f=(0,_.VH)(T.H.chainId),h=(0,_.VH)(T.H.chainId),g=(0,_.VH)(T.H.chainId),y=new m(s,i),b=new A(s,p.d.walletBalanceProvider,i),v=new G.A(o),w=new A(o,r.addresses.WALLET_BALANCE_PROVIDER,r.chainId),x=new A(o,r.addresses.WALLET_BALANCE_PROVIDER,r.chainId),k=new S.N(a,T.H.crossChainAddresses[T.H.chainId].VESTING_ADDRESS,T.H.chainId),P=new C.s(c,T.H.crossChainAddresses[T.H.chainId].LOCKER_TOKEN,T.H.chainId),B=new I.n(u,T.H.governance.POOL_VOTER,T.H.chainId),M=new O.y(l,T.H.crossChainAddresses[T.H.chainId].OMNI_STAKING,T.H.chainId),N=new R.K(d,T.H.governance.ZERO_AIRDROP,T.H.chainId),F=new D.w(f,T.H.crossChainAddresses[T.H.chainId].ORACLE_ADDRESS,T.H.chainId),L=new H(h,T.H.crossChainAddresses[T.H.chainId].VESTING_UI_PROVIDER,r.chainId),j=new z.T(g,T.H.crossChainAddresses[T.H.chainId].OMNI_STAKING_LP,T.H.chainId);return(0,V.jsx)(W.Provider,{value:{governanceService:y,governanceWalletBalanceService:b,poolTokensBalanceService:w,tokenBalanceService:x,vestingDataService:k,lockDataService:P,poolVotingDataService:B,omniStakingDataService:M,airdropDataService:N,oracleDataService:F,erc20Service:v,vestUIDataService:L,omniLPStakingDataService:j},children:t})},$=function(){var e=(0,r.useContext)(W);return(0,k.Z)(e,"Component should be wrapper inside a "),e}},39771:function(e,t,n){"use strict";n.d(t,{aD:function(){return r},WG:function(){return s}});var r,i=n(49501),o=n(85893);!function(e){e[e.APPROVAL=0]="APPROVAL",e[e.MAIN_ACTION=1]="MAIN_ACTION",e[e.GAS_ESTIMATION=2]="GAS_ESTIMATION"}(r||(r={}));var s=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=1;if("MetaMask Tx Signature: User denied transaction signature."===e.message||"MetaMask Message Signature: User denied message signature."===e.message)return{error:a[4001],blocking:!1,actionBlocked:!1,rawError:e,txAction:t};if(e.message.includes("insufficient funds for intrinsic transaction cost"))return{error:a[4002],blocking:!1,actionBlocked:!1,rawError:e,txAction:t};try{var i,o=JSON.parse(null===e||void 0===e||null===(i=e.error)||void 0===i?void 0:i.body),s=Number(o.error.message.split(": ")[1]);isNaN(s)||(r=s)}catch(u){}var c=a[r];return c?{error:c,blocking:n,actionBlocked:!0,rawError:e,txAction:t}:{error:void 0,blocking:n,actionBlocked:!0,rawError:e,txAction:t}},a={7:(0,o.jsx)(i.cC,{id:"Pool addresses provider is not registered"}),9:(0,o.jsx)(i.cC,{id:"Address is not a contract"}),11:(0,o.jsx)(i.cC,{id:"The caller of the function is not an AToken"}),12:(0,o.jsx)(i.cC,{id:"The address of the pool addresses provider is invalid"}),13:(0,o.jsx)(i.cC,{id:"Invalid return value of the flashloan executor function"}),19:(0,o.jsx)(i.cC,{id:"Invalid flashloan premium"}),22:(0,o.jsx)(i.cC,{id:"Invalid bridge protocol fee"}),23:(0,o.jsx)(i.cC,{id:"The caller of this function must be a pool"}),24:(0,o.jsx)(i.cC,{id:"Invalid amount to mint"}),25:(0,o.jsx)(i.cC,{id:"Invalid amount to burn"}),26:(0,o.jsx)(i.cC,{id:"Amount must be greater than 0"}),27:(0,o.jsx)(i.cC,{id:"Action requires an active reserve"}),28:(0,o.jsx)(i.cC,{id:"Action cannot be performed because the reserve is frozen"}),29:(0,o.jsx)(i.cC,{id:"Action cannot be performed because the reserve is paused"}),30:(0,o.jsx)(i.cC,{id:"Borrowing is not enabled"}),31:(0,o.jsx)(i.cC,{id:"Stable borrowing is not enabled"}),32:(0,o.jsx)(i.cC,{id:"User cannot withdraw more than the available balance"}),34:(0,o.jsx)(i.cC,{id:"The collateral balance is 0"}),35:(0,o.jsx)(i.cC,{id:"Health factor is lesser than the liquidation threshold"}),36:(0,o.jsx)(i.cC,{id:"There is not enough collateral to cover a new borrow"}),37:(0,o.jsx)(i.cC,{id:"Collateral is (mostly) the same currency that is being borrowed"}),38:(0,o.jsx)(i.cC,{id:"The requested amount is greater than the max loan size in stable rate mode"}),39:(0,o.jsx)(i.cC,{id:"For repayment of a specific type of debt, the user needs to have debt that type"}),40:(0,o.jsx)(i.cC,{id:"To repay on behalf of a user an explicit amount to repay is needed"}),41:(0,o.jsx)(i.cC,{id:"User does not have outstanding stable rate debt on this reserve"}),42:(0,o.jsx)(i.cC,{id:"User does not have outstanding variable rate debt on this reserve"}),43:(0,o.jsx)(i.cC,{id:"The underlying balance needs to be greater than 0"}),44:(0,o.jsx)(i.cC,{id:"Interest rate rebalance conditions were not met"}),45:(0,o.jsx)(i.cC,{id:"Health factor is not below the threshold"}),46:(0,o.jsx)(i.cC,{id:"The collateral chosen cannot be liquidated"}),47:(0,o.jsx)(i.cC,{id:"User did not borrow the specified currency"}),48:(0,o.jsx)(i.cC,{id:"Borrow and repay in same block is not allowed"}),49:(0,o.jsx)(i.cC,{id:"Inconsistent flashloan parameters"}),50:(0,o.jsx)(i.cC,{id:"Borrow cap is exceeded"}),51:(0,o.jsx)(i.cC,{id:"Supply cap is exceeded"}),52:(0,o.jsx)(i.cC,{id:"Unbacked mint cap is exceeded"}),53:(0,o.jsx)(i.cC,{id:"Debt ceiling is exceeded"}),54:(0,o.jsx)(i.cC,{id:"AToken supply is not zero"}),55:(0,o.jsx)(i.cC,{id:"Stable debt supply is not zero"}),56:(0,o.jsx)(i.cC,{id:"Variable debt supply is not zero"}),57:(0,o.jsx)(i.cC,{id:"Ltv validation failed"}),60:(0,o.jsx)(i.cC,{id:"Asset is not borrowable in isolation mode"}),62:(0,o.jsx)(i.cC,{id:"User is in isolation mode"}),76:(0,o.jsx)(i.cC,{id:"Array parameters that should be equal length are not"}),77:(0,o.jsx)(i.cC,{id:"Zero address not valid"}),78:(0,o.jsx)(i.cC,{id:"Invalid expiration"}),79:(0,o.jsx)(i.cC,{id:"Invalid signature"}),80:(0,o.jsx)(i.cC,{id:"Operation not supported"}),81:(0,o.jsx)(i.cC,{id:"Debt ceiling is not zero"}),82:(0,o.jsx)(i.cC,{id:"Asset is not listed"}),85:(0,o.jsx)(i.cC,{id:"The underlying asset cannot be rescued"}),88:(0,o.jsx)(i.cC,{id:"Stable borrowing is enabled"}),89:(0,o.jsx)(i.cC,{id:"User is trying to borrow multiple assets including a siloed one"}),4001:(0,o.jsx)(i.cC,{id:"You cancelled the transaction."}),4002:(0,o.jsx)(i.cC,{id:"Insufficient funds for intrinsic transaction cost"})}},45626:function(e,t,n){"use strict";n.d(t,{d:function(){return r}});var r={chainId:n(75331).a_.mainnet,votingAssetName:"AAVE + stkAAVE",averageNetworkBlockTime:13.5,queryGovernanceDataUrl:"https://api.thegraph.com/subgraphs/name/aave/governance-v2",wsGovernanceDataUrl:"wss://api.thegraph.com/subgraphs/name/aave/governance-v2",aaveTokenAddress:"0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",aAaveTokenAddress:"0xDa5E8e1C3596D3Cc11a4dd5aD66b8f03B5410F8C",stkAaveTokenAddress:"0x4da27a545c0c5b758a6ba100e3a049001de870f5",governanceForumLink:"https://governance.aave.com",governanceFAQLink:"https://docs.aave.com/faq/governance",walletBalanceProvider:"0x8E8dAd5409E0263a51C0aB5055dA66Be28cFF922",governanceSnapshotLink:"https://snapshot.org/#/aave.eth",addresses:{AAVE_GOVERNANCE_V2:"0xEC568fffba86c094cf06b22134B23074DFE2252c",AAVE_GOVERNANCE_V2_EXECUTOR_SHORT:"0x61910EcD7e8e942136CE7Fe7943f956cea1CC2f7",AAVE_GOVERNANCE_V2_EXECUTOR_LONG:"0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",AAVE_GOVERNANCE_V2_HELPER:"0xBb7baf0534423e3108E1D03c259104cDba2C1cB7"},ipfsGateway:"https://cloudflare-ipfs.com/ipfs",fallbackIpfsGateway:"https://ipfs.io/ipfs"}},34314:function(e,t,n){"use strict";n.d(t,{z:function(){return r},M:function(){return i}});var r={KNC_USDC_USDT:{liquidityPoolLink:"https://kyberswap.com/zksync/add/0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4/0x493257fD37EDB34451f62EDf8D2a0C418852bA4C/0x4d321cd88c5680ce4f85bb58c578dfe9c2cc1ef6"},VAMM_AERO_USDC:{liquidityPoolLink:"https://aerodrome.finance/deposit?token0=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&token1=0x940181a94A35A4569E4529A3CDfB74e38FD98631&type=-1"},VAMM_USDZ_USDC:{liquidityPoolLink:"https://app.maha.xyz/earn/pool/8453/0x1097dFe9539350cb466dF9CA89A5e61195A520B0/"},NYLE_ETH_ZERO:{liquidityPoolLink:"https://www.nile.build/manage/v1/0x0040f36784dda0821e74ba67f86e084d70d67a3a"}};function i(e){return!!r[e]}},57014:function(e,t,n){"use strict";n.d(t,{el:function(){return i},ei:function(){return a}});var r,i,o=n(59499),s=n(75331);new Date("May 6, 2024 8:00:00 UTC").getTime(),new Date("May 6, 2024 7:30:00 UTC").getTime();!function(e){e.proto_zksync_era_v3="proto_zksync_era_v3",e.proto_linea_v3="proto_linea_v3",e.proto_base_v3="proto_base_v3",e.proto_linea_croak_v3="proto_linea_croak_v3",e.proto_linea_foxy_v3="proto_linea_foxy_v3",e.proto_manta_v3="proto_manta_v3",e.proto_linea_sepolia_v3="proto_linea_sepolia_v3",e.proto_blast_v3="proto_blast_v3",e.proto_zircuit_v3="proto_zircuit_v3",e.proto_mainnet_lrt_v3="proto_mainnet_lrt_v3",e.proto_mainnet_btc_v3="proto_mainnet_btc_v3",e.proto_mainnet_rwa_v3="proto_mainnet_rwa_v3",e.proto_layerx_v3="proto_layerx_v3"}(i||(i={}));var a=(r={},(0,o.Z)(r,i.proto_linea_v3,{marketTitle:"Linea",marketAltName:"Linea Main Market",grpKey:"linea",chainId:59144,v3:!0,enabledFeatures:{governance:!0,staking:!0,collateralRepay:!1,incentives:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xC44827C51d00381ed4C52646aeAB45b455d200eB",LENDING_POOL:"0x2f9bB73a8e98793e26Cb2F6C4ad037BDf1C6B269",WETH_GATEWAY:"0x5d50bE703836C330Fc2d147a631CDd7bb8D7171c",WALLET_BALANCE_PROVIDER:"0xE05361EA51E20118072aec0fB0FD178e8b09D69e",UI_POOL_DATA_PROVIDER:"0x81b3184A3B5d4612F2c26A53Da8D99474B91B2D2",UI_INCENTIVE_DATA_PROVIDER:"0xCbDc0aeD7CDf2472784068abEf23a902CafABb98",OFT_ADAPTER:"0x671FbC39D7C99735E99Ce6918ff0666E88971D45",STAKING_BONUS:"0xD676c56A93Fe2a05233Ce6EAFEfDe2bd4017B3eA",OMNI_STAKING:"0xf374229a18ff691406f99CCBD93e8a3f16B68888",LOCKER_TOKEN:"0x08D5FEA625B1dBf9Bae0b97437303a0374ee02F8",ZERO_ADDRESS:"0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7",VESTING_ADDRESS:"0x9FA72ea96591e486FF065E7C8A89282dEDfA6C12",POOL_VOTER:"0x5346e9ab27D7874Db95993667D1Cb8338913f0aF",ORACLE_ADDRESS:"0x1C2B983E1FE9830B80c315b7dd2A331960C842DC",ZERO_AIRDROP:"0x569982A604cA61fa425fD924ADF08BE9e4f3035f"}}),(0,o.Z)(r,i.proto_base_v3,{marketTitle:"Base",chainId:8453,v3:!0,disableCharts:!0,enabledFeatures:{incentives:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0x5213ab3997a596c75Ac6ebF81f8aEb9cf9A31007",LENDING_POOL:"0x766f21277087E18967c1b10bF602d8Fe56d0c671",WETH_GATEWAY:"0x11CCDcFb19151FEb086ee6F1f62bfA0940C85612",WALLET_BALANCE_PROVIDER:"0x6eA9d99c6653DF987bDEa11ffcd56DFB4B5d38b4",COLLECTOR:"0x6F5Ae60d89dbbc4EeD4B08d08A68dD5679Ac61B4",UI_POOL_DATA_PROVIDER:"0x0A1198DDb5247a283F76077Bb1E45e5858ee100b",UI_INCENTIVE_DATA_PROVIDER:"0xa1e6BcDab01B9d7De83647d1Bbd4113c6c2B4e0d",OFT:"0x458AD5B487F4442245E4C5eA7249009E607A5583",VESTING_ADDRESS:"",ZERO_ADDRESS:"0x458AD5B487F4442245E4C5eA7249009E607A5583"}}),(0,o.Z)(r,i.proto_mainnet_lrt_v3,{marketTitle:"Ethereum LRTs",chainId:s.a_.mainnet,v3:!0,disableCharts:!0,description:"The Ethereum LRT Market is a ETH-focused market that allows users to lend/borrow ETH-corelated assets at high LTVs. This market also supports Pendle PT tokens as collateral.",marketAltName:"Ethereum LRTs",grpKey:"ethereum",enabledFeatures:{staking:!1,liquiditySwap:!0,debtSwitch:!0,withdrawAndSwitch:!0,incentives:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xFD856E1a33225B86f70D686f9280435E3fF75FCF",LENDING_POOL:"0x3BC3D34C32cc98bf098D832364Df8A222bBaB4c0",WETH_GATEWAY:"0x6eA9d99c6653DF987bDEa11ffcd56DFB4B5d38b4",WALLET_BALANCE_PROVIDER:"0xa1e6BcDab01B9d7De83647d1Bbd4113c6c2B4e0d",SWAP_COLLATERAL_ADAPTER:"0x189cfdb4d7a08D926CA209D84a713c4c629645aF",DEBT_SWITCH_ADAPTER:"0x80Ce5A187E477663fcFE99A108eefd9FBf0acC18",UI_POOL_DATA_PROVIDER:"0xa6EA08D16d47feE408505fda73520EbefC68Ef01",UI_INCENTIVE_DATA_PROVIDER:"0x0A1198DDb5247a283F76077Bb1E45e5858ee100b",OFT:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22",VESTING_ADDRESS:"",ZERO_ADDRESS:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22"}}),(0,o.Z)(r,i.proto_mainnet_btc_v3,{marketTitle:"Bitcoin LRTs",chainId:s.a_.mainnet,description:"The Bitcoin LRT Market is a BTC-focused market that allows users to lend/borrow BTC-corelated assets at high LTVs. This market also supports Pendle PT tokens as collateral.",v3:!0,disableCharts:!0,marketAltName:"Bitcoin LRTs",grpKey:"ethereum",enabledFeatures:{staking:!1,liquiditySwap:!0,debtSwitch:!1,incentives:!0,withdrawAndSwitch:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0x17878AFdD5772F4Ec93c265Ac7Ad8E2b29abB857",LENDING_POOL:"0xCD2b31071119D7eA449a9D211AC8eBF7Ee97F987",WETH_GATEWAY:"0x2787c0cb2F20010Ae2814Da9Ef20E04bb64B2466",WALLET_BALANCE_PROVIDER:"0xa1e6BcDab01B9d7De83647d1Bbd4113c6c2B4e0d",COLLECTOR:"0x4e88e72bd81c7ea394cb410296d99987c3a242fe",SWAP_COLLATERAL_ADAPTER:"0x189cfdb4d7a08D926CA209D84a713c4c629645aF",DEBT_SWITCH_ADAPTER:"0x80Ce5A187E477663fcFE99A108eefd9FBf0acC18",UI_POOL_DATA_PROVIDER:"0xa6EA08D16d47feE408505fda73520EbefC68Ef01",UI_INCENTIVE_DATA_PROVIDER:"0x0A1198DDb5247a283F76077Bb1E45e5858ee100b",OFT:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22",VESTING_ADDRESS:"",ZERO_ADDRESS:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22"}}),(0,o.Z)(r,i.proto_zircuit_v3,{marketTitle:"Zircuit",chainId:48900,isAlpha:!0,v3:!0,disableCharts:!0,enabledFeatures:{staking:!1,incentives:!0,bridge:!0},whiteListedIncentives:[],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xFF679e5B4178A2f74A56f0e2c0e1FA1C80579385",LENDING_POOL:"0x2774C8B95CaB474D0d21943d83b9322Fb1cE9cF5",WETH_GATEWAY:"0x6eA9d99c6653DF987bDEa11ffcd56DFB4B5d38b4",WALLET_BALANCE_PROVIDER:"0xa1e6BcDab01B9d7De83647d1Bbd4113c6c2B4e0d",UI_POOL_DATA_PROVIDER:"0x189cfdb4d7a08D926CA209D84a713c4c629645aF",UI_INCENTIVE_DATA_PROVIDER:"0xa6EA08D16d47feE408505fda73520EbefC68Ef01",OFT:"0x458AD5B487F4442245E4C5eA7249009E607A5583",ZERO_ADDRESS:"0x458AD5B487F4442245E4C5eA7249009E607A5583"}}),(0,o.Z)(r,i.proto_layerx_v3,{marketTitle:"X Layer",chainId:196,v3:!0,enabledFeatures:{staking:!1,incentives:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0x2f7e54ff5d45f77bFfa11f2aee67bD7621Eb8a93",LENDING_POOL:"0xfFd79D05D5dc37E221ed7d3971E75ed5930c6580",WETH_GATEWAY:"0x0f9bfa294bE6e3CA8c39221Bb5DFB88032C8936E",WALLET_BALANCE_PROVIDER:"0xaa999eA356F925BF1e856038c5D182Ae5E8A4973",UI_POOL_DATA_PROVIDER:"0xFaDFb0BC400427663020887e7c8073D03A35dc3c",UI_INCENTIVE_DATA_PROVIDER:"0x33B13F46a25D836CC0ce91B370305902aB6CF1Be",OFT:"0x98D56d03be3C0B9C58C67b209cA557d7DA9eb611",ZERO_ADDRESS:"0x98D56d03be3C0B9C58C67b209cA557d7DA9eb611"}}),(0,o.Z)(r,i.proto_linea_croak_v3,{marketTitle:"Croak",marketAltName:"Croak Market",grpKey:"linea",description:"The CROAK Market is an experimental isolated market designed to support the CROAK community. It allows users to lend/borrow CROAK with stablecoins and other assets.",hideInMarketSwitcher:!0,chainId:59144,v3:!0,show1DBorrowAPR:!0,enabledFeatures:{staking:!1,incentives:!0},whiteListedIncentives:["croak"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xf38B16FA3FC809d40F568BFe5B092AD9Ef4E15ed",LENDING_POOL:"0xc6ff96AefD1cC757d56e1E8Dcc4633dD7AA5222D",WETH_GATEWAY:"0x60F97315200815DbdD003fAC19E94E68CaCB6230",WALLET_BALANCE_PROVIDER:"0xE1a4e28fF7515E8eC7CaDa5fCf583cd47698e826",UI_POOL_DATA_PROVIDER:"0x19dD9E60198D1a1b2f531005592222ed8DfdD826",UI_INCENTIVE_DATA_PROVIDER:"0xBbb913D8adaE54E34dA336EA5218432001292df2",ZERO_ADDRESS:"0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7"}}),(0,o.Z)(r,i.proto_linea_foxy_v3,{marketTitle:"Foxy",marketAltName:"Foxy Market",grpKey:"linea",description:"The FOXY Market is an experimental isolated market designed to support the FOXY community. It allows users to lend/borrow FOXY with stablecoins and other assets.",hideInMarketSwitcher:!0,chainId:59144,v3:!0,enabledFeatures:{staking:!1,incentives:!0},show1DBorrowAPR:!0,whiteListedIncentives:[],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xaF9aB0C286a36A430C9bB7C58Ebf0BF075DDE595",LENDING_POOL:"0xbDAa004A456E7f2dAff00FfcDCbEaD5da27B7966",WETH_GATEWAY:"0x405BDA48cAB999865688eB1F5129C29a9cB0cDe1",WALLET_BALANCE_PROVIDER:"0xA770AF819A74BDB8a00e6C2aE19c4e434D276752",UI_POOL_DATA_PROVIDER:"0xa160571E7074EaC9652c0289C2969942Fc5CcA45",UI_INCENTIVE_DATA_PROVIDER:"0xbbe9548C50Db58cBEd8EbC2343fba02d3F8A5Af8",ZERO_ADDRESS:"0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7"}}),(0,o.Z)(r,i.proto_blast_v3,{marketTitle:"Blast",chainId:81457,v3:!0,enabledFeatures:{staking:!1,incentives:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xb0811a1FC9Fb9972ee683Ba04c32Cb828Bcf587B",LENDING_POOL:"0xa70B0F3C2470AbBE104BdB3F3aaa9C7C54BEA7A8",WETH_GATEWAY:"0xFaDFb0BC400427663020887e7c8073D03A35dc3c",WALLET_BALANCE_PROVIDER:"0x4Fcb7F18FA9255B52793dfd865d245bcec871468",UI_POOL_DATA_PROVIDER:"0xE230cF9Cee7b299F69778EF950A61de0dE520ba7",UI_INCENTIVE_DATA_PROVIDER:"0x66f3015534fae808773422e32b74f5732668dD5b",EARLYZERO_ADDRESS:"0x81b3184A3B5d4612F2c26A53Da8D99474B91B2D2",VESTING_ADDRESS:"",OFT:"0x6195FDA19376d2A3B3F7ED552247272308c644Dd",ZERO_ADDRESS:"0x6195FDA19376d2A3B3F7ED552247272308c644Dd"}}),(0,o.Z)(r,i.proto_mainnet_rwa_v3,{marketTitle:"RWA Stablecoins",chainId:s.a_.mainnet,v3:!0,disableCharts:!0,description:"The RWA Stablecoin is a stablecoin-focused market that allows users to lend/borrow stablecoins backed by real-world assets at high LTVs.",marketAltName:"RWA Stablecoins",grpKey:"ethereum",isAlpha:!0,enabledFeatures:{staking:!1,liquiditySwap:!0,debtSwitch:!1,incentives:!0,withdrawAndSwitch:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xe3c3c5ead58fc2bed4e577e38985b8f7f1ddff00",LENDING_POOL:"0xD3a4DA66EC15a001466F324FA08037f3272BDbE8",WETH_GATEWAY:"0x2787c0cb2F20010Ae2814Da9Ef20E04bb64B2466",WALLET_BALANCE_PROVIDER:"0xa1e6BcDab01B9d7De83647d1Bbd4113c6c2B4e0d",COLLECTOR:"0x4e88e72bd81c7ea394cb410296d99987c3a242fe",SWAP_COLLATERAL_ADAPTER:"0x189cfdb4d7a08D926CA209D84a713c4c629645aF",DEBT_SWITCH_ADAPTER:"0x80Ce5A187E477663fcFE99A108eefd9FBf0acC18",UI_POOL_DATA_PROVIDER:"0xa6EA08D16d47feE408505fda73520EbefC68Ef01",UI_INCENTIVE_DATA_PROVIDER:"0x0A1198DDb5247a283F76077Bb1E45e5858ee100b",OFT:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22",VESTING_ADDRESS:"",ZERO_ADDRESS:"0x2Da17fAf782ae884faf7dB2208BBC66b6E085C22"}}),(0,o.Z)(r,i.proto_zksync_era_v3,{marketTitle:"zkSync",chainId:324,v3:!0,disableCharts:!0,enabledFeatures:{paymasters:!0,staking:!1,incentives:!0,isGasless:!0,debtSwitch:!0,switch:!0,bridge:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0x4f285Ea117eF0067B59853D6d16a5dE8088bA259",LENDING_POOL:"0x4d9429246EA989C9CeE203B43F6d1C7D83e3B8F8",WETH_GATEWAY:"0x767b4A087c11d7581Ac95eaFfc1FeBFA26bad3d2",PAYMASTER:"0x03173eFe71e4201FDb439e716C801E41A239d58c",WALLET_BALANCE_PROVIDER:"0xdeEa10da04D867e3303AB6E50FA26C2d8a5e9f70",UI_POOL_DATA_PROVIDER:"0x8FE0ac76b634B7D343Bd32282B98E9f271B43367",UI_INCENTIVE_DATA_PROVIDER:"0x91ccF57c1E9A7F5A9537eE59306faF8dA3b7e960",GHO_TOKEN_ADDRESS:"0x90059C32Eeeb1A2aa1351a58860d98855f3655aD",GHO_UI_DATA_PROVIDER:"0x3d65cEDCb8Bbf19b477e5FF09057567F3B052b1f",VESTING_ADDRESS:"",ZERO_ADDRESS:"0x27d0A2b5316b98088294378692F4EAbfB3222e36"}}),(0,o.Z)(r,i.proto_manta_v3,{marketTitle:"Manta",chainId:169,v3:!0,disableCharts:!0,enabledFeatures:{governance:!0,staking:!0,liquiditySwap:!0,collateralRepay:!0,incentives:!0,withdrawAndSwitch:!0,debtSwitch:!0,switch:!0,bridge:!0},whiteListedIncentives:["zero"],subgraphUrl:"https://api.thegraph.com/subgraphs/name/aave/protocol-v3",addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xC44827C51d00381ed4C52646aeAB45b455d200eB",LENDING_POOL:"0x2f9bB73a8e98793e26Cb2F6C4ad037BDf1C6B269",WETH_GATEWAY:"0xE05361EA51E20118072aec0fB0FD178e8b09D69e",WALLET_BALANCE_PROVIDER:"0xCbDc0aeD7CDf2472784068abEf23a902CafABb98",UI_POOL_DATA_PROVIDER:"0xa32Eb787F2A3DC1F2c2da0E5d8caE7Ff74E6fD32",UI_INCENTIVE_DATA_PROVIDER:"0x81b3184A3B5d4612F2c26A53Da8D99474B91B2D2",EARLYZERO_ADDRESS:"0x642ce49f36f74fcc430ff79a76eb984737a7672d",VESTING_ADDRESS:"",OFT:"0xFCCa0098e740CE6D87e372717B210f5e2c27159D",ZERO_ADDRESS:"0xFCCa0098e740CE6D87e372717B210f5e2c27159D"}}),(0,o.Z)(r,i.proto_linea_sepolia_v3,{marketTitle:"Linea Sepolia",chainId:168587773,v3:!0,disableCharts:!0,enabledFeatures:{staking:!1,incentives:!0},whiteListedIncentives:["zero"],addresses:{LENDING_POOL_ADDRESS_PROVIDER:"0xa9eE3E04F102c6ba1A6468d641094A0BB83d6D2c",LENDING_POOL:"0x2B6106B5e7b01042f9039f75CEeEAEca69Fc0ab7",WETH_GATEWAY:"0xe165750b9882E9AF6A76082996392d0592A5CF16",WALLET_BALANCE_PROVIDER:"0xA79641b126194929C9c959794A24A77913D3502C",UI_POOL_DATA_PROVIDER:"0x7cf23595BA89D309983B9dDbe617B3892DF24a9A",UI_INCENTIVE_DATA_PROVIDER:"0x8a209c303FebE28569404C1435f282543fE65c0D",STAKING_BONUS:"0xe5ccA68b9E1D5575B7e3062fA34B0C725B003a69",OMNI_STAKING:"0xC35022eCbb36D81b9c92AD13f8e2D417e7F7a1C3",LOCKER_TOKEN:"0x1Fe7E6Cc96f9DA66b803E9573c083427b13C4370",LOCKER_LP:"0x6850E5D5396e4ce3CB6919E790b8Fce2Ebdf49eC",EARLYZERO_ADDRESS:"0x0082f3184a0b36c957F38f19fBdD3570ad9F095f",EARLY_ZERO_VESTING:"0xaBeD86D5eEe2Bf39A7d389B95bd4b92aAE24D04D",ZERO_ADDRESS:"0xA386758Dfb9B695c8C21245f61Fb71c38d045169",VESTING_ADDRESS:"0x1Ac68a3141745AA3c835fA518d2bAf70fDCE9F4B",POOL_VOTER:"0x8bf50096aA1ddBc7930d726F9d3a67EA138F010A",ZERO_AIRDROP:"0x56b83bc8886274DC0bE2273FbBc985710099D5C4"}}),r)},91555:function(e,t,n){"use strict";n.d(t,{m:function(){return s},R:function(){return a}});var r,i,o=n(59499),s=(r={},(0,o.Z)(r,1,{name:"Ethereum",publicJsonRPCUrl:["https://rpc.ankr.com/eth","https://rpc.flashbots.net","https://eth-mainnet.public.blastapi.io","https://cloudflare-eth.com/v1/mainnet"],baseUniswapAdapter:"0xc3efa200a60883a96ffe3d5b492b121d6e9a1f3f",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://etherscan.io",networkLogoPath:"/icons/networks/ethereum.svg"}),(0,o.Z)(r,196,{name:"X Layer",publicJsonRPCUrl:["https://xlayerrpc.okx.com"],baseAssetSymbol:"OKB",wrappedBaseAssetSymbol:"WOKB",explorerLink:"https://www.okx.com/explorer/xlayer",baseAssetDecimals:18,networkLogoPath:"/icons/networks/okb.svg",bridge:{icon:"/icons/networks/okb.svg",name:"OKX Bridge",url:"https://www.okx.com/xlayer/bridge"}}),(0,o.Z)(r,48900,{name:"Zircuit",publicJsonRPCUrl:["https://zircuit1-mainnet.p2pify.com/","https://zircuit-mainnet.drpc.org","https://zircuit1-mainnet.liquify.com"],baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",explorerLink:"https://explorer.zircuit.com/",baseAssetDecimals:18,networkLogoPath:"/icons/networks/zircuit.svg",bridge:{icon:"/icons/networks/zircuit.svg",name:"Zircuit Bridge",url:"https://bridge.zircuit.com/"}}),(0,o.Z)(r,81457,{name:"Blast",publicJsonRPCUrl:["https://rpc.blast.io"],baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://blastscan.io",networkLogoPath:"/icons/networks/blast.svg",bridge:{icon:"/icons/networks/blast.svg",name:"Blast Bridge",url:"https://docs.blast.io/building/bridges/mainnet"}}),(0,o.Z)(r,324,{name:"zkSync Era",publicJsonRPCUrl:["https://mainnet.era.zksync.io"],baseUniswapAdapter:"0x0",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://era.zksync.network/",isTestnet:!1,bridge:{icon:"/icons/networks/zksync.svg",name:"zkSync Bridge",url:"https://portal.zksync.io/bridge/"},networkLogoPath:"/icons/networks/zksync.svg"}),(0,o.Z)(r,59144,{name:"Linea",publicJsonRPCUrl:["https://rpc.linea.build"],baseUniswapAdapter:"0x0",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://lineascan.build",networkLogoPath:"/icons/networks/linea.svg",bridge:{icon:"/icons/networks/linea.svg",name:"Linea Bridge",url:"https://linea.build/apps?types=bridge",oftAdapter:!0}}),(0,o.Z)(r,8453,{name:"Base",publicJsonRPCUrl:["https://mainnet.base.org"],baseUniswapAdapter:"0x0",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://basescan.org",networkLogoPath:"/icons/networks/base.svg",bridge:{icon:"/icons/networks/base.svg",name:"Base Bridge",url:"https://bridge.base.org/deposit",oftAdapter:!0}}),(0,o.Z)(r,169,{name:"Manta",publicJsonRPCUrl:["https://pacific-rpc.manta.network/http","https://1rpc.io/manta"],baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://pacific-explorer.manta.network",networkLogoPath:"/icons/networks/manta.svg",bridge:{icon:"/icons/networks/manta.svg",name:"Manta Bridge",url:"https://pacific-bridge.manta.network/"}}),(0,o.Z)(r,11155111,{name:"Ethereum Sepolia",privateJsonRPCUrl:"https://eth-sepolia.g.alchemy.com/v2/VAfNJrTN-TopQjFDwcdLeeDOLDiFQcBP",publicJsonRPCUrl:["https://eth-sepolia.public.blastapi.io","https://rpc.sepolia.org","https://rpc2.sepolia.org","https://rpc.sepolia.online","https://www.sepoliarpc.space"],baseUniswapAdapter:"0x0",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://sepolia.etherscan.io",isTestnet:!0,networkLogoPath:"/icons/networks/ethereum.svg"}),(0,o.Z)(r,168587773,{name:"Blast Sepolia",publicJsonRPCUrl:["https://sepolia.blast.io"],baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,isTestnet:!0,explorerLink:"https://testnet.blastscan.io",networkLogoPath:"/icons/networks/blast.svg",bridge:{icon:"/icons/networks/blast.svg",name:"Blast Bridge",url:"https://docs.blast.io/building/bridges/mainnet"}}),(0,o.Z)(r,280,{name:"zkSync Goerli",publicJsonRPCUrl:["https://testnet.era.zksync.dev"],baseUniswapAdapter:"0x0",baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,explorerLink:"https://goerli.explorer.zksync.io/",isTestnet:!0,networkLogoPath:"/icons/networks/zksync.svg"}),(0,o.Z)(r,11155420,{name:"Optimism Sepolia",publicJsonRPCUrl:["https://sepolia.optimism.io/"],baseAssetSymbol:"ETH",wrappedBaseAssetSymbol:"WETH",baseAssetDecimals:18,isTestnet:!0,explorerLink:"https://optimism-sepolia.blockscout.com/",networkLogoPath:"/icons/networks/optimism.svg"}),r),a=(i={},(0,o.Z)(i,1,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,11155111,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,59144,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,42,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,169,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,168587773,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,81457,"0xcA11bde05977b3631167028862bE2a173976CA11"),(0,o.Z)(i,324,"0xF9cda624FBC7e059355ce98a31693d299FACd963"),(0,o.Z)(i,280,"0xF9cda624FBC7e059355ce98a31693d299FACd963"),i)},90187:function(e,t,n){"use strict";n.d(t,{fc:function(){return E},aj:function(){return _},Op:function(){return k}});var r,i,o,s=n(59499),a=n(68346),c=n(85893),u=function(e,t){return{text:"".concat(e,"x-").concat(t,"x Gravity Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x-",t,"x points/USD/day. Visit"," ",(0,c.jsx)(a.Z,{href:"/gravity",target:"_blank",children:"Gravity Page"})," ","for more info"]}),pointsIcon:"/icons/tokens/zero.svg"}},l={text:"4x-20x Gravity Points ",tooltip:(0,c.jsxs)("span",{children:["Borrowing this collateral will give you 4x-20x points/USD/day. Visit"," ",(0,c.jsx)(a.Z,{href:"/gravity",target:"_blank",children:"Gravity Page"})," ","for more info"]}),pointsIcon:"/icons/tokens/zero.svg"},d=function(){return{color:"#c2eeff",text:"LXP-L Points",tooltip:(0,c.jsxs)("span",{children:["Supplying this asset will give you will get you LXP-L points from linea. Visit the"," ",(0,c.jsx)(a.Z,{href:"https://referrals.linea.build/?refCode=vhN04mGePq",target:"_blank",children:"LXP-L Campaign page"})," ","for more info"]}),pointsIcon:"/icons/tokens/lxp-l.svg"}},f={text:"ZL LXP-L Referral Points",tooltip:"Referral points earned by ZeroLend, distributed back to borrowers",link:"/rewards",pointsIcon:"/icons/tokens/lxp-l.svg"},p={text:"Turtle Points",tooltip:(0,c.jsxs)("span",{children:["Users get boosted points if they are part of"," ",(0,c.jsx)(a.Z,{href:"https://turtle.club/dashboard/?ref=ZEROLEND",target:"_blank",children:"turtle.club"})," "]}),pointsIcon:"/icons/tokens/turtle.svg"},h={text:"1x Blast Points",pointsIcon:"/icons/tokens/blast.svg"},m=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Loyalty Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Loyalty points from ether.fi. You can get more points (upto ",t,"x) by leveraging on your deposit. ",(0,c.jsx)("br",{}),(0,c.jsx)("br",{}),"(Points are added retroactively by the points issuer)."]}),pointsIcon:"/icons/tokens/weeth.svg"}},g=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Veda Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Veda points from Veda. You can get more points (upto ",t,"x) by leveraging on your deposit. ",(0,c.jsx)("br",{}),(0,c.jsx)("br",{}),"(Points are added retroactively by the points issuer)."]}),pointsIcon:"/icons/tokens/veda.svg"}},y=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Babylon Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Babylon points from Babylon. You can get more points (upto ",t,"x) by leveraging on your deposit. ",(0,c.jsx)("br",{}),(0,c.jsx)("br",{}),"(Points are added retroactively by the points issuer)."]}),pointsIcon:"/icons/tokens/babylon.svg"}},b=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x ezPoints"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x ezPoints on Renzo. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/ezeth.svg"}},v=function(e,t,n){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Lombard Points"),tooltip:(0,c.jsx)("span",{children:n||(0,c.jsxs)(c.Fragment,{children:["Supplying this collateral will give you ",e,"x Lombard Points on Lombard. You can get more points (upto ",t,"x) by leveraging on your deposit."]})}),pointsIcon:"/icons/tokens/lombard.svg"}},w=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Symbiotic Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Symbiotic Points on Symbiotic. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/symbiotic.svg"}},x=function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x EIGEN Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x EIGEN Points on EignerLayer. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/eigenlayer.svg"}},A=function(e,t){return{color:"#D8F0F0",text:"".concat(e,"-").concat(t,"x Kelp Miles"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Kelp Miles on KelpDao. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/rseth.svg"}},E=[{text:"LXP-L Points",tooltip:"",link:"https://referrals.linea.build/?refCode=vhN04mGePq"},{text:"Gravity Points"}],_={proto_mainnet_lrt_v3:{eth:[u(2,10),p],weth:[u(2,10),p],ezeth:[u(2,10),p,b(2,6),x(1,3)],pzeth:[u(2,10),p,(i=2,o=6,{color:"#fa849c",text:"".concat(i,"-").concat(o,"x Mellow Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",i,"x Mellow Points on Mellow Protocol. You can get more points (upto ",o,"x) by leveraging on your deposit. ",(0,c.jsx)("br",{}),(0,c.jsx)("br",{}),"(Points are added retroactively by the points issuer)."]}),pointsIcon:"/icons/tokens/pzeth.svg"}),b(2,6),w(1,3)],"pt-rseth-26sep2024":[u(1,5),p],pufeth:[u(2,10),p,function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Puffer Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Puffer Points on Puffer. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/pufeth.svg"}}(2,6)],rseth:[u(2,10),p,A(3,9),x(1,3)],weeth:[u(1,5),p,m(2,6),x(1,3)]},proto_linea_v3:(r={eth:[u(2,10),d(),p],weth:[u(2,10),d(),p],usdc:[u(1,5),d(),p],dai:[u(1,5),d(),p]},(0,s.Z)(r,"m-btc",[u(1,5),d(),p]),(0,s.Z)(r,"solvbtc.m",[u(1,5),d(),p]),(0,s.Z)(r,"usdt",[u(1,5),d(),p]),(0,s.Z)(r,"ezeth",[b(2,6),u(2,10),d(),p,x(1,3)]),(0,s.Z)(r,"grai",[u(1,5),d(),p]),(0,s.Z)(r,"wbtc",[u(1,5),d(),p]),(0,s.Z)(r,"weeth",[u(1,5),d(),p,m(2,6),x(1,3)]),(0,s.Z)(r,"wrseth",[u(3,15),d(),p,A(3,9),x(1,3)]),(0,s.Z)(r,"unieth",[u(1,5),d(),p,function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Bedrock Diamonds"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Bedrock Daimonds from Bedrock. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/unieth.svg"}}(3,6)]),(0,s.Z)(r,"stone",[u(1,5),d(),function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x ezPoints"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x StakeStone Points on StakeStone. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/stone-points.svg"}}(2,6),p]),(0,s.Z)(r,"wsteth",[u(1,5),d(),p]),(0,s.Z)(r,"frxeth",[u(1,5),d(),p]),(0,s.Z)(r,"ineth",[u(1,5),d(),p,function(e,t){return{text:"".concat(e,"-").concat(t,"x Inception Totem"),color:"#ACE731",tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x InceptionLRT Totems from InceptionLRT. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/unieth.svg"}}(15,30)]),(0,s.Z)(r,"susde",[u(1,5),d(),p]),(0,s.Z)(r,"usde",[u(1,5),d(),p]),r),proto_linea_foxy_v3:{eth:[u(1,5),d()],usdc:[u(1,5),d()],foxy:[u(1,5),d()]},proto_blast_v3:{eth:[u(2,10),h,p],weth:[u(2,10),h,p],ezeth:[u(1,5),p,b(2,6),x(1,3)],usdb:[u(1,5),h,p],weeth:[u(1,5),p,m(2,6),x(1,3)]},proto_zksync_era_v3:{eth:[u(2,10)],weth:[u(2,10)],dai:[u(1,5)],lusd:[u(1,5)],usdt:[u(1,5)],"usdc.e":[u(1,5)],wbtc:[u(1,5)]},proto_mainnet_btc_v3:{ebtc:[y(1,10),v(2,20),w(1,10),m(3,30),g(3,30),p,u(3,30),x("TBD","?"),function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Karak Points"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Karak Points on Karak. You can get more points (upto ",t,"x) by leveraging on your deposit."]}),pointsIcon:"/icons/tokens/karak.svg"}}("TBD","?")],lbtc:[y(1,10),v(2,20),p,u(2,30)],wbtc:[u(2,10),p],"pt-ebtc-26dec2024":[u(1,5),p],"pt-cornlbtc-26dec2024":[u(1,5),p]},proto_layerx_v3:{eth:[u(2,10)],weth:[u(2,10)],usdc:[u(1,5)],usdz:[u(1,5)],usdt:[u(1,5)],wbtc:[u(1,5)],dai:[u(1,5)],okb:[u(1,5)]},proto_mainnet_rwa_v3:{usdc:[u(1,5),p],usdz:[u(1,5),p],usds:[u(1,5),p],eusd:[m(3,30),function(e,t){return{color:"#ACE731",text:"".concat(e,"-").concat(t,"x Ethena Sats"),tooltip:(0,c.jsxs)("span",{children:["Supplying this collateral will give you ",e,"x Sats from Ethena. You can get more points (upto"," ",t,"x) by leveraging on your deposit. ",(0,c.jsx)("br",{}),(0,c.jsx)("br",{}),"(Points are added retroactively by the points issuer)."]}),pointsIcon:"/icons/tokens/usde.svg"}}(20,200),g(3,30),u(1,5),p],usdt:[u(1,5),p]},proto_base_v3:{usdc:[u(1,5),p],xusdz:[u(1,5),p],aero:[u(1,5),p],cbbtc:[u(1,5),p],cbeth:[u(1,5),p],"vamm-usdc/aero":[u(1,5),p],susdzusdc:[u(1,5),p],eth:[u(1,5),p],weth:[u(1,5),p]}},k={proto_mainnet_lrt_v3:{eth:[l],weth:[l],pzeth:[l],ezeth:[l],rseth:[l],weeth:[l]},proto_linea_v3:{eth:[l,f],usdc:[l,f],dai:[l,f],usdt:[l,f],wbtc:[l,f],wrseth:[l,f],ezeth:[l,f],usde:[l,f],weeth:[l,f],wsteth:[l,f]},proto_blast_v3:{eth:[l],usdb:[l]},proto_zksync_era_v3:{eth:[l],dai:[l],lusd:[l],usdt:[l],"usdc.e":[l],wbtc:[l]},proto_mainnet_btc_v3:{ebtc:[l],wbtc:[l],lbtc:[l,v(0,0,"Borrowing this collateral will give you 3x Lombard Lux Points if you borrow LBTC against the PT-cornLBTC-26DEC2024 token as collateral")]},proto_mainnet_rwa_v3:{usdc:[l],usdt:[l],eusd:[l],usds:[l],usdz:[l]},proto_layerx_v3:{eth:[l],weth:[l],usdc:[l],usdt:[l],wbtc:[l],dai:[l],okb:[l],usdz:[l]},proto_base_v3:{usdc:[l],xusdz:[l],aero:[l],cbbtc:[l],cbeth:[l],eth:[l],weth:[l]}}},31001:function(e,t,n){"use strict";n.d(t,{iP:function(){return r},Bd:function(){return o},g_:function(){return s}});var r,i=n(90116);!function(e){e.USE_POWERS="USE_POWERS",e.TOKEN_BALANCE="TOKEN_BALANCE",e.POWERS="POWERS",e.VOTE_ON_PROPOSAL="VOTE_ON_PROPOSAL",e.VOTING_POWER_AT="VOTING_POWER_AT",e.GOVERNANCE_TOKENS="GOVERNANCE_TOKENS",e.TRANSACTION_HISTORY="TRANSACTION_HISTORY",e.POOL_TOKENS="POOL_TOKENS",e.GENERAL_STAKE_UI_DATA="GENERAL_STAKE_UI_DATA",e.USER_STAKE_UI_DATA="USER_STAKE_UI_DATA",e.USER_VEST_UI_DATA="USER_VEST_UI_DATA",e.USER_LOCK_UI_DATA="USER_LOCK_UI_DATA",e.USER_POOL_VOTE="USER_POOL_VOTE",e.GENERAL_NFT_UI_DATA="GENERAL_NFT_UI_DATA",e.USER_REWARD_CLAIMED="USER_REWARD_CLAIMED"}(r||(r={}));var o={governance:["governance"],staking:["staking"],pool:["pool"],incentives:["incentives"],gho:["gho"],market:function(e){return[e.chainId,!!e.isFork,e.market]},user:function(e){return[e]},powers:function(e,t){return[].concat((0,i.Z)(o.governance),(0,i.Z)(o.user(e)),[t,"powers"])},voteOnProposal:function(e,t,n){return[].concat((0,i.Z)(o.governance),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(n)),[t,"voteOnProposal"])},votingPowerAt:function(e,t,n){return[].concat((0,i.Z)(o.governance),(0,i.Z)(o.user(e)),(0,i.Z)(n),[t,"votingPowerAt"])},governanceRepresentatives:function(e){return[].concat((0,i.Z)(o.governance),(0,i.Z)(o.user(e)),["representatives"])},governanceTokens:function(e,t){return[].concat((0,i.Z)(o.governance),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),["governanceTokens"])},transactionHistory:function(e,t){return[].concat((0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),["transactionHistory"])},poolTokens:function(e,t){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),["poolTokens"])},poolReservesDataHumanized:function(e){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.market(e)),["poolReservesDataHumanized"])},userPoolReservesDataHumanized:function(e,t){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),["userPoolReservesDataHumanized"])},generalStakeUiData:function(e,t,n){return[].concat((0,i.Z)(o.staking),(0,i.Z)(o.market(e)),[t,n,"generalStakeUiData"])},userStakeUiData:function(e,t,n,r){return[].concat((0,i.Z)(o.staking),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),[n,r,"userStakeUiData"])},paraswapRates:function(e,t,n,r,s){return[].concat((0,i.Z)(o.user(s)),[e,t,n,r,"paraswapRates"])},odosswapQuote:function(e){var t=e.chainId,n=e.inputTokens,r=e.outputTokens,s=e.userAddr,a=e.slippageLimitPercent,c=e.referralCode,u=e.disableRFQs,l=e.compact;return[].concat((0,i.Z)(o.user(s)),[t,n,r,s,a,c,u,l,"odosswapQuote"])},odosswapAssemble:function(e){var t=e.pathId,n=e.simulate,r=e.userAddr;return[].concat((0,i.Z)(o.user(r)),[t,n,r,"odosswapAssemble"])},gasPrices:function(e){return[e,"gasPrices"]},poolReservesIncentiveDataHumanized:function(e){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.incentives),(0,i.Z)(o.market(e)),["poolReservesIncentiveDataHumanized"])},userPoolReservesIncentiveDataHumanized:function(e,t){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.incentives),(0,i.Z)(o.market(t)),(0,i.Z)(o.user(e)),["userPoolReservesIncentiveDataHumanized"])},ghoReserveData:function(e){return[].concat((0,i.Z)(o.gho),(0,i.Z)(o.market(e)),["ghoReserveData"])},ghoUserReserveData:function(e,t){return[].concat((0,i.Z)(o.gho),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(t)),["ghoUserReserveData"])},poolApprovedAmount:function(e,t,n){return[].concat((0,i.Z)(o.pool),(0,i.Z)(o.user(e)),(0,i.Z)(o.market(n)),[t,"poolApprovedAmount"])},approvedAmount:function(e,t,n,r){return[].concat((0,i.Z)(o.user(e)),(0,i.Z)(o.market(r)),[t,n,"approvedAmount"])},tokenPowers:function(e,t,n){return[].concat((0,i.Z)(o.user(e)),[t,n,"tokenPowers"])},tokenDelegatees:function(e,t,n){return[].concat((0,i.Z)(o.user(e)),[t,n,"tokenDelegatees"])},migrationExceptions:function(e,t,n){return[].concat((0,i.Z)(e.map((function(e){return e.underlyingAsset}))),(0,i.Z)(o.market(t)),(0,i.Z)(o.market(n)))},tokensBalance:function(e,t,n){return[].concat((0,i.Z)(o.user(n)),[e.map((function(e){return e.address})),t,"tokensBalance"])}},s=1e4},41551:function(e,t,n){"use strict";n.d(t,{QD:function(){return c},S0:function(){return u}});var r=n(59499),i=n(34220);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var s={BPTBALWETH:"BPT_BAL_WETH",BPTWBTCWETH:"BPT_WBTC_WETH",UNIAAVEWETH:"UNI_AAVE_WETH",UNIBATWETH:"UNI_BAT_WETH",UNICRVWETH:"UNI_CRV_WETH",UNIDAIUSDC:"UNI_DAI_USDC",UNIDAIWETH:"UNI_DAI_WETH",UNILINKWETH:"UNI_LINK_WETH",UNIMKRWETH:"UNI_MKR_WETH",UNIRENWETH:"UNI_REN_WETH",UNISNXWETH:"UNI_SNX_WETH",UNIUNIWETH:"UNI_UNI_WETH",UNIUSDCWETH:"UNI_USDC_WETH",UNIWBTCUSDC:"UNI_WBTC_USDC",UNIWBTCWETH:"UNI_WBTC_WETH",UNIYFIWETH:"UNI_YFI_WETH","vAMM-USDC/AERO":"VAMM_AERO_USDC",sUSDZUSDC:"VAMM_USDZ_USDC","KS-LP USDC-USDT":"KNC_USDC_USDT",fUSDT:"USDT","1DAI":"DAI","1USDC":"USDC","1USDT":"USDT","1AAVE":"AAVE","1ETH":"ETH","1WBTC":"WBTC","DAI.e":"DAI","LINK.e":"LINK","WBTC.e":"WBTC","WETH.e":"WETH","AAVE.e":"AAVE","USDT.e":"USDT","USDC.e":"USDC","BTC.b":"BTC",miMATIC:"MAI","m.USDC":"USDC","m.USDT":"USDT","m.DAI":"DAI",NYLEETHZERO:"NYLE_ETH_ZERO"},a={"1INCH":"1inch Network","PT-CORNLBTC-26DEC2024":"LBTC PT 26DEC24","PT-EBTC-26DEC2024":"eBTC PT 26DEC24",AVAX:"Avalanche",CBBTC:"Coinbase BTC",CBETH:"Coinbase ETH",ETH:"Ethereum",EUROS:"STASIS EURO",EZETH:"Renzo ezETH",FAI:"Fei USD",GHST:"Aavegotchi GHST",GRAI:"Gravita",GUSD:"Gemini Dollar",KNC_USDC_USDT:"Kyberswap USDT/USDT",KNC:"Kyber Legacy",LBTC:"Lombard LBTC",LINK:"ChainLink",LUSD:"LUSD Stablecoin",MAI:"MAI",MANA:"Decentraland",MKR:"Maker",PAX:"Paxos Standard",PUFETH:"Puffer.fi ETH",PZETH:"Renzo pzETH",RAI:"Rai Reflex Index",REP:"Augur",RSETH:"Kelp rsETH",SAVAX:"Benqi Staked Avalanche",STETH:"Lido Staked Ether",STKAAVE:"Stake ZeroLend",TUSD:"TrueUSD",UNI:"Uniswap",UNIDAIWETH:"UNI DAI/WETH",UNIWBTCUSDC:"UNI WBTC/USDC",USDT:"Tether",USDZ:"ZAI Stablecoin",WAVAX:"Wrapped Avalanche",WBTC:"Wrapped BTC",WEETH:"Etherfi weETH",WETH:"Wrapped ETH",WFTM:"Wrapped FTM",WMATIC:"Wrapped Matic",WONE:"Wrapped ONE",WRSETH:"Kelp wrsETH",YFI:"yearn.finance",ZRX:"0x Coin"};function c(e){var t=e.underlyingAsset,n=e.symbol,c=e.name,u={"0xff970a61a04b1ca14834a43f5de4533ebddb5cc8":{name:"Bridged USDC",symbol:"USDC.e",iconSymbol:"USDC"},"0x5d83c0850570de35eaf5c9d6215bf2e8020f656b":{iconSymbol:"KNC_USDC_USDT",name:"Kyberswap USDC/USDT"},"0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d":{iconSymbol:"VAMM_AERO_USDC",name:"USDC/AERO LP (Aerodrome)"},"0x1097dfe9539350cb466df9ca89a5e61195a520b0":{iconSymbol:"VAMM_USDZ_USDC",name:"USDz/USDC Staked LP (MAHA.xyz)"},"0xa693B19d2931d498c5B318dF961919BB4aee87a5":{iconSymbol:"UST",name:"UST (Wormhole)"},"0x59a19d8c652fa0284f44113d0ff9aba70bd46fb4":{iconSymbol:"BPT_BAL_WETH"},"0x1eff8af5d577060ba4ac8a29a13525bb0ee2a3d5":{iconSymbol:"BPT_WBTC_WETH"},"0xdfc14d2af169b0d36c4eff567ada9b2e0cae044f":{iconSymbol:"UNI_AAVE_WETH"},"0xb6909b960dbbe7392d405429eb2b3649752b4838":{iconSymbol:"UNI_BAT_WETH"},"0x3da1313ae46132a397d90d95b1424a9a7e3e0fce":{iconSymbol:"UNI_CRV_WETH"},"0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5":{iconSymbol:"UNI_DAI_USDC"},"0xa478c2975ab1ea89e8196811f51a7b7ade33eb11":{iconSymbol:"UNI_DAI_WETH"},"0xa2107fa5b38d9bbd2c461d6edf11b11a50f6b974":{iconSymbol:"UNI_LINK_WETH"},"0xc2adda861f89bbb333c90c492cb837741916a225":{iconSymbol:"UNI_MKR_WETH"},"0x8bd1661da98ebdd3bd080f0be4e6d9be8ce9858c":{iconSymbol:"UNI_REN_WETH"},"0x43ae24960e5534731fc831386c07755a2dc33d47":{iconSymbol:"UNI_SNX_WETH"},"0xd3d2e2692501a5c9ca623199d38826e513033a17":{iconSymbol:"UNI_UNI_WETH"},"0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc":{iconSymbol:"UNI_USDC_WETH"},"0x004375dff511095cc5a197a54140a24efef3a416":{iconSymbol:"UNI_BTC_USDC"},"0xbb2b8038a1640196fbe3e38816f3e67cba72d940":{iconSymbol:"UNI_WBTC_WETH"},"0x2fdbadf3c4d5a8666bc06645b8358ab803996e28":{iconSymbol:"UNI_YFI_WETH"},"0x0040F36784dDA0821E74BA67f86E084D70d67a3A":{iconSymbol:"ETH_ZERO"}},l=t.toLowerCase();if(u.hasOwnProperty(l))return function(e){for(var t=1;t1&&void 0!==v[1]?v[1]:"get",r=v.length>2?v[2]:void 0,i=v.length>3?v[3]:void 0,s=v.length>4?v[4]:void 0,a=v.length>5?v[5]:void 0,c="".concat(a||g,"/").concat(t),"get"===n&&i&&(c="".concat(c,"?").concat(i)),u={"content-type":"application/json","Access-Control-Allow-Origin":"*"},s&&(u["x-jwt"]=s),e.prev=9,e.next=12,h()({url:c,headers:u,method:n,data:r});case 12:if(l=e.sent,d=l.data,200===l.status){e.next=16;break}throw new y(d.error,l.status);case 16:return e.abrupt("return",l.data);case 19:return e.prev=19,e.t0=e.catch(9),b=e.t0,console.log("error",(null===(f=b.response)||void 0===f?void 0:f.data.message)||b.message,(null===(p=b.response)||void 0===p?void 0:p.status)||500),e.abrupt("return",null===(m=b.response)||void 0===m?void 0:m.data);case 24:case"end":return e.stop()}}),e,null,[[9,19]])}))),b.apply(this,arguments)}var v=function(e){return b.apply(this,arguments)},w=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("","get");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("","get",null,void 0,void 0,"https://api.zerolend.xyz/pendle/impliedApy");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),A=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("leaderBoardwithSortKeys","get",null);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("user/userInfo","get",null,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_=function(){var e=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("user/userCurrentPoints","get",null,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),k=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("globalData","get",null);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("referral/openBlock","get",null);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),S=function(){var e=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v("linkReferral","patch",t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},82828:function(e,t,n){"use strict";n.d(t,{A:function(){return r},h:function(){return i}});var r={success:!1,error:void 0,isLoading:!1},i={success:!1,error:void 0,isLoading:!0}},59286:function(e,t,n){"use strict";n.d(t,{nG:function(){return c},BC:function(){return u},hF:function(){return l}});var r=n(75331),i=n(1279),o=n(70794),s=n(21921),a=n(87385);function c(e,t,n){var c,u,l,d,f=e.availableLiquidityUSD,p=o.Z.min(t.availableBorrowsUSD,f),h="0"===e.borrowCap?(0,i.hE)(s.Bz.toString()):(0,i.hE)(Number(e.borrowCap)).minus((0,i.hE)(e.totalDebt)),m=o.Z.max(o.Z.min(e.formattedAvailableLiquidity,h),0),g=(0,i.hE)((null===t||void 0===t?void 0:t.availableBorrowsMarketReferenceCurrency)||0).div(e.formattedPriceInMarketReferenceCurrency),y=o.Z.min(g,m);n===r.tk.Stable&&(y=o.Z.min(y,(0,i.hE)(e.formattedAvailableLiquidity).multipliedBy(.25)));var b=y.gte(g)||"0"!==t.totalBorrowsMarketReferenceCurrency&&p.lt(f)||p.eq(f)&&"0"!==e.totalDebt||e.borrowCapUSD&&"0"!==e.totalDebt&&p.gte(f)||t.isInIsolationMode&&"0"!==(null===(c=t.isolatedReserve)||void 0===c?void 0:c.isolationModeTotalDebt)&&(0,i.hE)((null===(u=t.isolatedReserve)||void 0===u?void 0:u.debtCeiling)||"0").minus((null===(l=t.isolatedReserve)||void 0===l?void 0:l.isolationModeTotalDebt)||"0").shiftedBy(-((null===(d=t.isolatedReserve)||void 0===d?void 0:d.debtCeilingDecimals)||0)).multipliedBy("0.99").lt(t.availableBorrowsUSD)?y.multipliedBy("0.99"):y;return(0,a.$w)(b.toString(10),e.decimals)}function u(e){var t,n,r,o,s=(0,i.hE)((null===e||void 0===e?void 0:e.availableBorrowsMarketReferenceCurrency)||0),c="0"!==e.totalBorrowsMarketReferenceCurrency||e.isInIsolationMode&&"0"!==(null===(t=e.isolatedReserve)||void 0===t?void 0:t.isolationModeTotalDebt)&&(0,i.hE)((null===(n=e.isolatedReserve)||void 0===n?void 0:n.debtCeiling)||"0").minus((null===(r=e.isolatedReserve)||void 0===r?void 0:r.isolationModeTotalDebt)||"0").shiftedBy(-((null===(o=e.isolatedReserve)||void 0===o?void 0:o.debtCeilingDecimals)||0)).multipliedBy("0.99").lt(e.availableBorrowsUSD)?s.multipliedBy("0.99"):s;return(0,a.$w)(c.toString(10),18)}function l(e,t){var n=e.borrowingEnabled,r=e.isActive,i=e.borrowableInIsolation,o=e.eModeCategoryId,s=e.isFrozen,a=e.isPaused;return!(!n||!r||s||a)&&((null===t||void 0===t||!t.isInEmode||o===t.userEmodeCategoryId)&&!(null!==t&&void 0!==t&&t.isInIsolationMode&&!i))}},94847:function(e,t,n){"use strict";n.d(t,{x:function(){return a},I:function(){return c}});var r=n(80854),i=n(1279),o=n(70794),s=n(87385);function a(e,t){return"0"===e?new o.Z(-1):new o.Z(e).minus(t)}function c(e,t,n,c){if(t.isFrozen)return"0";var u=(0,i.hE)(e);return u.gt(0)&&n.toLowerCase()===r.hP.toLowerCase()&&(u=u.minus(c)),"0"!==t.supplyCap&&(u=o.Z.min(u,a(t.supplyCap,t.totalLiquidity))),u.lte(0)?"0":(0,s.$w)(u.toString(10),t.decimals)}},69125:function(e,t,n){"use strict";n.d(t,{JP:function(){return s},uF:function(){return a},hN:function(){return c},li:function(){return u},aU:function(){return l}});var r=n(59499);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;tthis.maxRetries)){e.next=13;break}throw this.retries=0,new Error("RotationProvider exceeded max number of retries. Last error: ".concat(this.lastError));case 13:this.currentProviderIndex=0,e.next=17;break;case 16:this.currentProviderIndex+=1;case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"detectNetwork",value:function(){var e=(0,u.Z)(y().mark((function e(){var t;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providers.map((function(e){return e.getNetwork()})));case 2:return t=e.sent,e.abrupt("return",A(t));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"perform",value:function(){var e=(0,u.Z)(y().mark((function e(t,n){var r;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.currentProviderIndex,e.prev=1,e.next=4,this.providers[r].perform(t,n);case 4:case 16:return e.abrupt("return",e.sent);case 7:return e.prev=7,e.t0=e.catch(1),console.error(e.t0.message),this.lastError=e.t0.message,this.emit("debug",{action:"perform",provider:this.providers[r]}),e.next=14,this.rotateUrl(r);case 14:return e.next=16,this.perform(t,n);case 17:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(b.Zk),D=n(83454);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t1)for(var n=1;n