From c4c2a25f4d444a5e64c367e0420190707b31f7f7 Mon Sep 17 00:00:00 2001 From: deadshotryker <151393124+deadshotryker@users.noreply.github.com> Date: Thu, 28 Dec 2023 10:53:53 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20zerolend?= =?UTF-8?q?/frontend-lending@660299176fd2d66e0863de97caddfd2a95f20890=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404/index.html | 2 +- 500/index.html | 2 +- .../_buildManifest.js | 2 +- .../_middlewareManifest.js | 0 .../_ssgManifest.js | 0 _next/static/chunks/pages/500-7fe6956576c3598b.js | 1 - _next/static/chunks/pages/500-a98da1986ae3c175.js | 1 + .../{_app-a58f433104c91ed4.js => _app-5b59be114bd2e17b.js} | 2 +- dashboard/index.html | 2 +- faucet/index.html | 2 +- history/index.html | 2 +- index.html | 2 +- markets/index.html | 2 +- reserve-overview/index.html | 2 +- rewards/index.html | 2 +- v3-migration/index.html | 2 +- 16 files changed, 13 insertions(+), 13 deletions(-) rename _next/static/{rloKX-ua6P5cU8R9HWq26 => 2hP8hux3fVt0zHjjlKxH6}/_buildManifest.js (88%) rename _next/static/{rloKX-ua6P5cU8R9HWq26 => 2hP8hux3fVt0zHjjlKxH6}/_middlewareManifest.js (100%) rename _next/static/{rloKX-ua6P5cU8R9HWq26 => 2hP8hux3fVt0zHjjlKxH6}/_ssgManifest.js (100%) delete mode 100644 _next/static/chunks/pages/500-7fe6956576c3598b.js create mode 100644 _next/static/chunks/pages/500-a98da1986ae3c175.js rename _next/static/chunks/pages/{_app-a58f433104c91ed4.js => _app-5b59be114bd2e17b.js} (67%) diff --git a/404/index.html b/404/index.html index 2ee61524..14eb2dd8 100644 --- a/404/index.html +++ b/404/index.html @@ -1 +1 @@ -ZeroLend - Open Source Liquidity Protocol

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

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 2f6ea09a..b220e9ff 100644 --- a/500/index.html +++ b/500/index.html @@ -1 +1 @@ -ZeroLend - Open Source Liquidity Protocol

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

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/rloKX-ua6P5cU8R9HWq26/_buildManifest.js b/_next/static/2hP8hux3fVt0zHjjlKxH6/_buildManifest.js similarity index 88% rename from _next/static/rloKX-ua6P5cU8R9HWq26/_buildManifest.js rename to _next/static/2hP8hux3fVt0zHjjlKxH6/_buildManifest.js index 1a6571b9..f257265f 100644 --- a/_next/static/rloKX-ua6P5cU8R9HWq26/_buildManifest.js +++ b/_next/static/2hP8hux3fVt0zHjjlKxH6/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(s,e,a){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,e,a,"static/chunks/pages/index-7b1802a18df3ab4d.js"],"/404":[s,"static/chunks/pages/404-8244524c9f550033.js"],"/500":[s,"static/chunks/pages/500-7fe6956576c3598b.js"],"/_error":["static/chunks/pages/_error-deefae67ca062615.js"],"/dashboard":[s,e,a,"static/chunks/pages/dashboard-93407cc48972c8a1.js"],"/faucet":[s,e,"static/chunks/pages/faucet-06056462e9a0df25.js"],"/history":[s,e,"static/chunks/pages/history-92912731f09015e7.js"],"/markets":["static/chunks/pages/markets-76ea9f21a00f7f0a.js"],"/reserve-overview":[s,"static/chunks/pages/reserve-overview-38de093ae433e0da.js"],"/rewards":[s,e,"static/chunks/pages/rewards-f358cc7abe186580.js"],"/v3-migration":[s,e,"static/chunks/pages/v3-migration-48198034a76eb83b.js"],sortedPages:["/","/404","/500","/_app","/_error","/dashboard","/faucet","/history","/markets","/reserve-overview","/rewards","/v3-migration"]}}("static/chunks/249-28a8ffbdea6aec40.js","static/chunks/980-50d467cfe581562b.js","static/chunks/869-43880293811e129f.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(s,e,a){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,e,a,"static/chunks/pages/index-7b1802a18df3ab4d.js"],"/404":[s,"static/chunks/pages/404-8244524c9f550033.js"],"/500":[s,"static/chunks/pages/500-a98da1986ae3c175.js"],"/_error":["static/chunks/pages/_error-deefae67ca062615.js"],"/dashboard":[s,e,a,"static/chunks/pages/dashboard-93407cc48972c8a1.js"],"/faucet":[s,e,"static/chunks/pages/faucet-06056462e9a0df25.js"],"/history":[s,e,"static/chunks/pages/history-92912731f09015e7.js"],"/markets":["static/chunks/pages/markets-76ea9f21a00f7f0a.js"],"/reserve-overview":[s,"static/chunks/pages/reserve-overview-38de093ae433e0da.js"],"/rewards":[s,e,"static/chunks/pages/rewards-f358cc7abe186580.js"],"/v3-migration":[s,e,"static/chunks/pages/v3-migration-48198034a76eb83b.js"],sortedPages:["/","/404","/500","/_app","/_error","/dashboard","/faucet","/history","/markets","/reserve-overview","/rewards","/v3-migration"]}}("static/chunks/249-28a8ffbdea6aec40.js","static/chunks/980-50d467cfe581562b.js","static/chunks/869-43880293811e129f.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/_next/static/rloKX-ua6P5cU8R9HWq26/_middlewareManifest.js b/_next/static/2hP8hux3fVt0zHjjlKxH6/_middlewareManifest.js similarity index 100% rename from _next/static/rloKX-ua6P5cU8R9HWq26/_middlewareManifest.js rename to _next/static/2hP8hux3fVt0zHjjlKxH6/_middlewareManifest.js diff --git a/_next/static/rloKX-ua6P5cU8R9HWq26/_ssgManifest.js b/_next/static/2hP8hux3fVt0zHjjlKxH6/_ssgManifest.js similarity index 100% rename from _next/static/rloKX-ua6P5cU8R9HWq26/_ssgManifest.js rename to _next/static/2hP8hux3fVt0zHjjlKxH6/_ssgManifest.js diff --git a/_next/static/chunks/pages/500-7fe6956576c3598b.js b/_next/static/chunks/pages/500-7fe6956576c3598b.js deleted file mode 100644 index d4a88076..00000000 --- a/_next/static/chunks/pages/500-7fe6956576c3598b.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[573],{27163:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return b}});var n=r(49501),i=r(67294);var o=i.forwardRef((function(e,t){return i.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),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))})),s=r(52758),a=r(62097),c=r(70918),l=r(29630),x=r(75084),d=r(81645),u=r(61953),h=r(68346),p=r(15446),m=r(74815),f=r(78544),j=r(24834),g=r(85893);function b(){var e=(0,a.Z)(),t=(0,j.Yh)((function(e){return e.trackEvent}));return(0,i.useEffect)((function(){t("Page Viewed",{"Page Name":"500 Error"})}),[t]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(m.f,{}),(0,g.jsx)(p.O,{children:(0,g.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",p:4,flex:1,backgroundColor:"dark"===e.palette.mode?"transparent":""},children:[(0,g.jsx)(l.Z,{variant:"display1",sx:{mt:8,mb:3},children:(0,g.jsx)(n.cC,{id:"Something went wrong"})}),(0,g.jsx)(l.Z,{sx:{mt:2,mb:5,maxWidth:480},children:(0,g.jsx)(n.cC,{id:"Sorry, an unexpected error happened. In the meantime you may try reloading the page, or come back later."})}),(0,g.jsx)(x.Z,{variant:"outlined",color:"primary",startIcon:(0,g.jsx)(d.Z,{children:(0,g.jsx)(o,{})}),onClick:function(){return window.location.reload()},sx:{mb:10},children:(0,g.jsx)(n.cC,{id:"Reload the page"})}),(0,g.jsxs)(u.Z,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",mt:10,children:[(0,g.jsxs)(l.Z,{sx:{mb:4},children:[(0,g.jsx)(n.cC,{id:"If the error continues to happen,<0/> you may report it to this",components:{0:(0,g.jsx)("br",{})}})," ",(0,g.jsx)(h.Z,{href:"https://discord.com/invite/7kHKnkDEUf",color:"inherit",target:"_blank",children:(0,g.jsx)(n.cC,{id:"Discord channel"})}),"."]}),(0,g.jsx)(x.Z,{color:"primary",startIcon:(0,g.jsx)(d.Z,{children:(0,g.jsx)(s.Z,{})}),onClick:function(){console.log("copying error to clipboard")},children:(0,g.jsx)(n.cC,{id:"Copy error message"})})]})]})})]})}b.getLayout=function(e){return(0,g.jsx)(f.Z,{children:e})}},15446:function(e,t,r){"use strict";r.d(t,{O:function(){return s}});var n=r(61953),i=r(36336),o=r(85893),s=function(e){var t=e.children;return(0,o.jsx)(n.Z,{sx:{display:"flex",flexDirection:"column",flex:1,mt:{xs:"-32px",lg:"-46px",xl:"-44px",xxl:"-48px"}},children:(0,o.jsx)(i.Z,{children:t})})}},25563:function(e,t,r){"use strict";r.d(t,{hu:function(){return k},St:function(){return O},gO:function(){return C},tF:function(){return P}});var n=r(59499),i=r(49501),o=r(61782),s=r(61953),a=r(72389),c=r(62097),l=r(61225),x=r(82334),d=r(81645),u=r(29630),h=r(31538),p=r(61702),m=r(67294),f=r(24834),j=r(57609),g=r(46930),b=r(25298),v=r(85893);function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t-1}));return{name:r.filter((function(e){return!n.includes(e)})).join(" "),testChainName:n[0]}},C=function(e){var t=e.size,r=e.logo,n=e.testChainName;return(0,v.jsxs)(s.Z,{sx:{mr:2,width:t,height:t,position:"relative"},children:[(0,v.jsx)("img",{src:r,alt:"",width:"100%",height:"100%"}),n&&(0,v.jsx)(a.Z,{title:n,arrow:!0,children:(0,v.jsx)(s.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:n.split("")[0]})})]})};!function(e){e[e.V2=0]="V2",e[e.V3=1]="V3"}(y||(y={}));var P=function(){var e=(0,g.f)(),t=e.currentMarket,r=e.setCurrentMarket,n=(0,m.useState)(y.V3)[0],a=(0,c.Z)(),w=(0,l.Z)(a.breakpoints.up("lg")),P=(0,l.Z)(a.breakpoints.down("xsm")),S=(0,f.Yh)((function(e){return e.trackEvent}));return(0,v.jsxs)(x.Z,{select:!0,"aria-label":"select market","data-cy":"marketSelector",value:t,onChange:function(e){S(j.h1.CHANGE_MARKET,{market:e.target.value}),r(e.target.value)},sx:{mr:2,"& .MuiOutlinedInput-notchedOutline":{border:"none"}},SelectProps:{native:!1,className:"MarketSwitcher__select",IconComponent:function(e){return(0,v.jsx)(d.Z,Z(Z({fontSize:"medium"},e),{},{children:(0,v.jsx)(o.Z,{})}))},renderValue:function(e){var t=k(e),r=t.market,n=t.network;return(0,v.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,v.jsx)(C,{size:w?32:28,logo:n.networkLogoPath,testChainName:O(r.marketTitle).testChainName}),(0,v.jsxs)(s.Z,{sx:{mr:1,display:"inline-flex",alignItems:"flex-start"},children:[(0,v.jsxs)(u.Z,{variant:w?"display1":"h1",sx:{fontSize:P?"1.55rem":void 0,color:"common.white",mr:1},children:[O(r.marketTitle).name," ",r.isFork?"Fork":"",w&&" Market"]}),r.v3?(0,v.jsx)(s.Z,{sx:{color:"#fff",px:2,borderRadius:"12px",background:function(e){return e.palette.gradients.aaveGradient}},children:(0,v.jsx)(u.Z,{variant:"subheader2",children:"V3"})}):(0,v.jsx)(s.Z,{sx:{color:"#A5A8B6",px:2,borderRadius:"12px",backgroundColor:"#27264C"},children:(0,v.jsx)(u.Z,{variant:"subheader2",children:"V2"})})]})]})},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,v.jsx)(s.Z,{children:(0,v.jsx)(u.Z,{variant:"subheader2",color:"text.secondary",sx:{px:4,pt:2},children:(0,v.jsx)(i.cC,{id:"{0}",values:{0:b.p8||b.aV?"Select ZeroLend Testnet Market":"Select ZeroLend Market"}})})}),b.z2.map((function(e){var t=k(e),r=t.market,i=t.network,o=O(r.marketTitle);return(0,v.jsxs)(h.Z,{"data-cy":"marketSelector_".concat(e),value:e,sx:{".MuiListItemIcon-root":{minWidth:"unset"},display:r.v3&&n===y.V2||!r.v3&&n===y.V3?"none":"flex"},children:[(0,v.jsx)(C,{size:32,logo:i.networkLogoPath,testChainName:o.testChainName}),(0,v.jsxs)(p.Z,{sx:{mr:0},children:[o.name," ",r.isFork?"Fork":""]}),(0,v.jsx)(p.Z,{sx:{textAlign:"right"},children:(0,v.jsx)(u.Z,{color:"text.muted",variant:"description",children:o.testChainName})})]},e)}))]})}},40535:function(e,t,r){"use strict";r.d(t,{V:function(){return p}});var n=r(49501),i=r(62097),o=r(61225),s=r(61953),a=r(29630),c=r(75084),l=r(24834),x=r(67728),d=r(25563),u=r(68861),h=r(85893),p=function(e){var t=e.pageTitle,r=e.withMarketSwitcher,p=e.withMigrateButton,m=(0,l.Yh)((function(e){return(0,x.lY)(e)})),f=(0,i.Z)(),j=(0,o.Z)(f.breakpoints.up("lg")),g=(0,o.Z)(f.breakpoints.down("xsm"));return(0,h.jsxs)(s.Z,{sx:{display:"flex",alignItems:{xs:"flex-start",xsm:"center"},mb:t?4:0,flexDirection:{xs:"column",xsm:"row"}},children:[t&&(g||!r)&&(0,h.jsx)(s.Z,{sx:{display:"flex",alignItems:"flex-start"},children:(0,h.jsx)(a.Z,{variant:g?"h2":j?"display1":"h1",sx:{color:r?"text.muted":"text.white",mr:{xs:5,xsm:3},mb:{xs:1,xsm:0}},children:t})}),(0,h.jsxs)(s.Z,{sx:{display:"flex",alignItems:"flex-start",flexWrap:"wrap",mb:t?0:4},children:[(0,h.jsx)("br",{}),r&&(0,h.jsx)(d.tF,{}),m&&p&&(0,h.jsx)(u.rU,{href:u.Z6.migrationTool,sx:{mt:{xs:2,xsm:0}},children:(0,h.jsx)(c.Z,{variant:"gradient",size:"small",children:(0,h.jsx)(n.cC,{id:"Migrate to V3"})})})]})]})}},74815:function(e,t,r){"use strict";r.d(t,{f:function(){return f}});var n=r(59499),i=r(49501),o=r(62097),s=r(61225),a=r(61953),c=r(29630),l=r(36336),x=r(67294),d=r(19952),u=r(40535),h=r(85893);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;tPhase 1 Launch to learn more.",components:{0:(0,h.jsx)("a",{href:"https://docs.zerolend.xyz/roadmap/phase-1-launch",target:"_blank",rel:"noreferrer",style:{color:"#fff"}})}})]}),(0,h.jsx)(a.Z,{sx:{pt:{xs:6,md:8},pb:{xs:18,md:20,lg:"94px",xl:"92px",xxl:"96px"},color:"#F1F1F3"},children:(0,h.jsx)(l.Z,m(m({},v),{},{sx:m(m({},v.sx),{},{pb:0}),children:(0,h.jsxs)(a.Z,{sx:{px:{xs:4,xsm:6}},children:[!n&&(0,h.jsx)(u.V,{pageTitle:t,withMarketSwitcher:p,withMigrateButton:f,bridge:j}),n&&n,r&&(0,h.jsx)(c.Z,{variant:"main14",sx:{color:"text.muted",mt:2,mr:{xs:5,xsm:3},maxWidth:750,mb:r?4:0},style:Z?{marginTop:"-36px"}:{marginTop:"-12px"},children:r}),(0,h.jsx)(a.Z,{sx:{display:"flex",alignItems:"flex-start",gap:{xs:3,xsm:8},flexWrap:"wrap",width:"100%"},children:g})]})}))})]})}},52298:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/500",function(){return r(27163)}])}},function(e){e.O(0,[249,774,888,179],(function(){return t=52298,e(e.s=t);var t}));var t=e.O();_N_E=t}]); \ No newline at end of file diff --git a/_next/static/chunks/pages/500-a98da1986ae3c175.js b/_next/static/chunks/pages/500-a98da1986ae3c175.js new file mode 100644 index 00000000..813d021d --- /dev/null +++ b/_next/static/chunks/pages/500-a98da1986ae3c175.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[573],{27163:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return b}});var n=r(49501),i=r(67294);var o=i.forwardRef((function(e,t){return i.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),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))})),s=r(52758),a=r(62097),c=r(70918),l=r(29630),x=r(75084),d=r(81645),u=r(61953),h=r(68346),p=r(15446),m=r(74815),f=r(78544),j=r(24834),g=r(85893);function b(){var e=(0,a.Z)(),t=(0,j.Yh)((function(e){return e.trackEvent}));return(0,i.useEffect)((function(){t("Page Viewed",{"Page Name":"500 Error"})}),[t]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(m.f,{}),(0,g.jsx)(p.O,{children:(0,g.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",p:4,flex:1,backgroundColor:"dark"===e.palette.mode?"transparent":""},children:[(0,g.jsx)(l.Z,{variant:"display1",sx:{mt:8,mb:3},children:(0,g.jsx)(n.cC,{id:"Something went wrong"})}),(0,g.jsx)(l.Z,{sx:{mt:2,mb:5,maxWidth:480},children:(0,g.jsx)(n.cC,{id:"Sorry, an unexpected error happened. In the meantime you may try reloading the page, or come back later."})}),(0,g.jsx)(x.Z,{variant:"outlined",color:"primary",startIcon:(0,g.jsx)(d.Z,{children:(0,g.jsx)(o,{})}),onClick:function(){return window.location.reload()},sx:{mb:10},children:(0,g.jsx)(n.cC,{id:"Reload the page"})}),(0,g.jsxs)(u.Z,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",mt:10,children:[(0,g.jsxs)(l.Z,{sx:{mb:4},children:[(0,g.jsx)(n.cC,{id:"If the error continues to happen,<0/> you may report it to this",components:{0:(0,g.jsx)("br",{})}})," ",(0,g.jsx)(h.Z,{href:"https://discord.gg/zerolend",color:"inherit",target:"_blank",children:(0,g.jsx)(n.cC,{id:"Discord channel"})}),"."]}),(0,g.jsx)(x.Z,{color:"primary",startIcon:(0,g.jsx)(d.Z,{children:(0,g.jsx)(s.Z,{})}),onClick:function(){console.log("copying error to clipboard")},children:(0,g.jsx)(n.cC,{id:"Copy error message"})})]})]})})]})}b.getLayout=function(e){return(0,g.jsx)(f.Z,{children:e})}},15446:function(e,t,r){"use strict";r.d(t,{O:function(){return s}});var n=r(61953),i=r(36336),o=r(85893),s=function(e){var t=e.children;return(0,o.jsx)(n.Z,{sx:{display:"flex",flexDirection:"column",flex:1,mt:{xs:"-32px",lg:"-46px",xl:"-44px",xxl:"-48px"}},children:(0,o.jsx)(i.Z,{children:t})})}},25563:function(e,t,r){"use strict";r.d(t,{hu:function(){return k},St:function(){return O},gO:function(){return C},tF:function(){return P}});var n=r(59499),i=r(49501),o=r(61782),s=r(61953),a=r(72389),c=r(62097),l=r(61225),x=r(82334),d=r(81645),u=r(29630),h=r(31538),p=r(61702),m=r(67294),f=r(24834),j=r(57609),g=r(46930),b=r(25298),v=r(85893);function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t-1}));return{name:r.filter((function(e){return!n.includes(e)})).join(" "),testChainName:n[0]}},C=function(e){var t=e.size,r=e.logo,n=e.testChainName;return(0,v.jsxs)(s.Z,{sx:{mr:2,width:t,height:t,position:"relative"},children:[(0,v.jsx)("img",{src:r,alt:"",width:"100%",height:"100%"}),n&&(0,v.jsx)(a.Z,{title:n,arrow:!0,children:(0,v.jsx)(s.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:n.split("")[0]})})]})};!function(e){e[e.V2=0]="V2",e[e.V3=1]="V3"}(y||(y={}));var P=function(){var e=(0,g.f)(),t=e.currentMarket,r=e.setCurrentMarket,n=(0,m.useState)(y.V3)[0],a=(0,c.Z)(),w=(0,l.Z)(a.breakpoints.up("lg")),P=(0,l.Z)(a.breakpoints.down("xsm")),S=(0,f.Yh)((function(e){return e.trackEvent}));return(0,v.jsxs)(x.Z,{select:!0,"aria-label":"select market","data-cy":"marketSelector",value:t,onChange:function(e){S(j.h1.CHANGE_MARKET,{market:e.target.value}),r(e.target.value)},sx:{mr:2,"& .MuiOutlinedInput-notchedOutline":{border:"none"}},SelectProps:{native:!1,className:"MarketSwitcher__select",IconComponent:function(e){return(0,v.jsx)(d.Z,Z(Z({fontSize:"medium"},e),{},{children:(0,v.jsx)(o.Z,{})}))},renderValue:function(e){var t=k(e),r=t.market,n=t.network;return(0,v.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,v.jsx)(C,{size:w?32:28,logo:n.networkLogoPath,testChainName:O(r.marketTitle).testChainName}),(0,v.jsxs)(s.Z,{sx:{mr:1,display:"inline-flex",alignItems:"flex-start"},children:[(0,v.jsxs)(u.Z,{variant:w?"display1":"h1",sx:{fontSize:P?"1.55rem":void 0,color:"common.white",mr:1},children:[O(r.marketTitle).name," ",r.isFork?"Fork":"",w&&" Market"]}),r.v3?(0,v.jsx)(s.Z,{sx:{color:"#fff",px:2,borderRadius:"12px",background:function(e){return e.palette.gradients.aaveGradient}},children:(0,v.jsx)(u.Z,{variant:"subheader2",children:"V3"})}):(0,v.jsx)(s.Z,{sx:{color:"#A5A8B6",px:2,borderRadius:"12px",backgroundColor:"#27264C"},children:(0,v.jsx)(u.Z,{variant:"subheader2",children:"V2"})})]})]})},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,v.jsx)(s.Z,{children:(0,v.jsx)(u.Z,{variant:"subheader2",color:"text.secondary",sx:{px:4,pt:2},children:(0,v.jsx)(i.cC,{id:"{0}",values:{0:b.p8||b.aV?"Select ZeroLend Testnet Market":"Select ZeroLend Market"}})})}),b.z2.map((function(e){var t=k(e),r=t.market,i=t.network,o=O(r.marketTitle);return(0,v.jsxs)(h.Z,{"data-cy":"marketSelector_".concat(e),value:e,sx:{".MuiListItemIcon-root":{minWidth:"unset"},display:r.v3&&n===y.V2||!r.v3&&n===y.V3?"none":"flex"},children:[(0,v.jsx)(C,{size:32,logo:i.networkLogoPath,testChainName:o.testChainName}),(0,v.jsxs)(p.Z,{sx:{mr:0},children:[o.name," ",r.isFork?"Fork":""]}),(0,v.jsx)(p.Z,{sx:{textAlign:"right"},children:(0,v.jsx)(u.Z,{color:"text.muted",variant:"description",children:o.testChainName})})]},e)}))]})}},40535:function(e,t,r){"use strict";r.d(t,{V:function(){return p}});var n=r(49501),i=r(62097),o=r(61225),s=r(61953),a=r(29630),c=r(75084),l=r(24834),x=r(67728),d=r(25563),u=r(68861),h=r(85893),p=function(e){var t=e.pageTitle,r=e.withMarketSwitcher,p=e.withMigrateButton,m=(0,l.Yh)((function(e){return(0,x.lY)(e)})),f=(0,i.Z)(),j=(0,o.Z)(f.breakpoints.up("lg")),g=(0,o.Z)(f.breakpoints.down("xsm"));return(0,h.jsxs)(s.Z,{sx:{display:"flex",alignItems:{xs:"flex-start",xsm:"center"},mb:t?4:0,flexDirection:{xs:"column",xsm:"row"}},children:[t&&(g||!r)&&(0,h.jsx)(s.Z,{sx:{display:"flex",alignItems:"flex-start"},children:(0,h.jsx)(a.Z,{variant:g?"h2":j?"display1":"h1",sx:{color:r?"text.muted":"text.white",mr:{xs:5,xsm:3},mb:{xs:1,xsm:0}},children:t})}),(0,h.jsxs)(s.Z,{sx:{display:"flex",alignItems:"flex-start",flexWrap:"wrap",mb:t?0:4},children:[(0,h.jsx)("br",{}),r&&(0,h.jsx)(d.tF,{}),m&&p&&(0,h.jsx)(u.rU,{href:u.Z6.migrationTool,sx:{mt:{xs:2,xsm:0}},children:(0,h.jsx)(c.Z,{variant:"gradient",size:"small",children:(0,h.jsx)(n.cC,{id:"Migrate to V3"})})})]})]})}},74815:function(e,t,r){"use strict";r.d(t,{f:function(){return f}});var n=r(59499),i=r(49501),o=r(62097),s=r(61225),a=r(61953),c=r(29630),l=r(36336),x=r(67294),d=r(19952),u=r(40535),h=r(85893);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;tPhase 1 Launch to learn more.",components:{0:(0,h.jsx)("a",{href:"https://docs.zerolend.xyz/roadmap/phase-1-launch",target:"_blank",rel:"noreferrer",style:{color:"#fff"}})}})]}),(0,h.jsx)(a.Z,{sx:{pt:{xs:6,md:8},pb:{xs:18,md:20,lg:"94px",xl:"92px",xxl:"96px"},color:"#F1F1F3"},children:(0,h.jsx)(l.Z,m(m({},v),{},{sx:m(m({},v.sx),{},{pb:0}),children:(0,h.jsxs)(a.Z,{sx:{px:{xs:4,xsm:6}},children:[!n&&(0,h.jsx)(u.V,{pageTitle:t,withMarketSwitcher:p,withMigrateButton:f,bridge:j}),n&&n,r&&(0,h.jsx)(c.Z,{variant:"main14",sx:{color:"text.muted",mt:2,mr:{xs:5,xsm:3},maxWidth:750,mb:r?4:0},style:Z?{marginTop:"-36px"}:{marginTop:"-12px"},children:r}),(0,h.jsx)(a.Z,{sx:{display:"flex",alignItems:"flex-start",gap:{xs:3,xsm:8},flexWrap:"wrap",width:"100%"},children:g})]})}))})]})}},52298:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/500",function(){return r(27163)}])}},function(e){e.O(0,[249,774,888,179],(function(){return t=52298,e(e.s=t);var t}));var t=e.O();_N_E=t}]); \ No newline at end of file diff --git a/_next/static/chunks/pages/_app-a58f433104c91ed4.js b/_next/static/chunks/pages/_app-5b59be114bd2e17b.js similarity index 67% rename from _next/static/chunks/pages/_app-a58f433104c91ed4.js rename to _next/static/chunks/pages/_app-5b59be114bd2e17b.js index ff15f6ec..cb2ba996 100644 --- a/_next/static/chunks/pages/_app-a58f433104c91ed4.js +++ b/_next/static/chunks/pages/_app-5b59be114bd2e17b.js @@ -148,4 +148,4 @@ right: 0; top: 0; } - `),S,(t.vars||t).palette.action.hover)));var E=i.forwardRef((function(e,t){const n=(0,f.Z)({props:e,name:"MuiSkeleton"}),{animation:i="pulse",className:s,component:u="span",height:l,style:d,variant:p="text",width:h}=n,b=(0,r.Z)(n,g),v=(0,a.Z)({},n,{animation:i,component:u,variant:p,hasChildren:Boolean(b.children)}),w=(e=>{const{classes:t,variant:n,animation:r,hasChildren:a,width:i,height:o}=e,s={root:["root",n,r,a&&"withChildren",a&&!i&&"fitContent",a&&!o&&"heightAuto"]};return(0,c.Z)(s,m,t)})(v);return(0,y.jsx)(k,(0,a.Z)({as:u,ref:t,className:(0,o.default)(w.root,s),ownerState:v},b,{style:(0,a.Z)({width:h,height:l},d)}))}))},9144:function(e,t,n){"use strict";var r=n(63366),a=n(87462),i=n(67294),o=n(95408),s=n(98700),c=n(39707),u=n(59766),l=n(81719),d=n(78884),p=n(85893);const f=["component","direction","spacing","divider","children"];function h(e,t){const n=i.Children.toArray(e).filter(Boolean);return n.reduce(((e,r,a)=>(e.push(r),a[t.root]})((({ownerState:e,theme:t})=>{let n=(0,a.Z)({display:"flex",flexDirection:"column"},(0,o.k9)({theme:t},(0,o.P$)({values:e.direction,breakpoints:t.breakpoints.values}),(e=>({flexDirection:e}))));if(e.spacing){const r=(0,s.hB)(t),a=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)),{}),i=(0,o.P$)({values:e.direction,base:a}),c=(0,o.P$)({values:e.spacing,base:a});"object"===typeof i&&Object.keys(i).forEach(((e,t,n)=>{if(!i[e]){const r=t>0?i[n[t-1]]:"column";i[e]=r}}));const l=(t,n)=>{return{"& > :not(style) + :not(style)":{margin:0,[`margin${a=n?i[n]:e.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[a]}`]:(0,s.NA)(r,t)}};var a};n=(0,u.Z)(n,(0,o.k9)({theme:t},c,l))}return n=(0,o.dt)(t.breakpoints,n),n})),y=i.forwardRef((function(e,t){const n=(0,d.Z)({props:e,name:"MuiStack"}),i=(0,c.Z)(n),{component:o="div",direction:s="column",spacing:u=0,divider:l,children:y}=i,g=(0,r.Z)(i,f),b={direction:s,spacing:u};return(0,p.jsx)(m,(0,a.Z)({as:o,ownerState:b,ref:t},g,{children:l?h(y,l):y}))}));t.Z=y},81645:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var r=n(87462),a=n(63366),i=n(67294),o=n(86010),s=n(94780),c=n(36622),u=n(78884),l=n(81719),d=n(34867);function p(e){return(0,d.Z)("MuiSvgIcon",e)}(0,n(1588).Z)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var f=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,a,i,o,s,c,u,l,d,p,f,h,m,y,g,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==(a=e.transitions)||null==(i=a.duration)?void 0:i.shorter}),fontSize:{inherit:"inherit",small:(null==(o=e.typography)||null==(s=o.pxToRem)?void 0:s.call(o,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!=(p=null==(f=(e.vars||e).palette)||null==(h=f[t.color])?void 0:h.main)?p:{action:null==(m=(e.vars||e).palette)||null==(y=m.action)?void 0:y.active,disabled:null==(g=(e.vars||e).palette)||null==(b=g.action)?void 0:b.disabled,inherit:void 0}[t.color]}})),y=i.forwardRef((function(e,t){const n=(0,u.Z)({props:e,name:"MuiSvgIcon"}),{children:i,className:l,color:d="inherit",component:y="svg",fontSize:g="medium",htmlColor:b,inheritViewBox:v=!1,titleAccess:w,viewBox:_="0 0 24 24"}=n,x=(0,a.Z)(n,h),T=(0,r.Z)({},n,{color:d,component:y,fontSize:g,instanceFontSize:e.fontSize,inheritViewBox:v,viewBox:_}),S={};v||(S.viewBox=_);const k=(e=>{const{color:t,fontSize:n,classes:r}=e,a={root:["root","inherit"!==t&&`color${(0,c.Z)(t)}`,`fontSize${(0,c.Z)(n)}`]};return(0,s.Z)(a,p,r)})(T);return(0,f.jsxs)(m,(0,r.Z)({as:y,className:(0,o.default)(k.root,l),focusable:"false",color:b,"aria-hidden":!w||void 0,role:w?"img":void 0,ref:t},S,x,{ownerState:T,children:[i,w?(0,f.jsx)("title",{children:w}):null]}))}));y.muiName="SvgIcon";var g=y},54181:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(63366),a=n(87462),i=n(67294),o=n(86010),s=n(94780),c=n(41796),u=n(36622),l=n(37743),d=n(78884),p=n(81719),f=n(34867);function h(e){return(0,f.Z)("MuiSwitch",e)}var m=(0,n(1588).Z)("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),y=n(85893);const g=["className","color","edge","size","sx"],b=(0,p.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,a.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,p.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,a.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,p.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)}))),_=(0,p.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 x=i.forwardRef((function(e,t){const n=(0,d.Z)({props:e,name:"MuiSwitch"}),{className:i,color:c="primary",edge:l=!1,size:p="medium",sx:f}=n,m=(0,r.Z)(n,g),x=(0,a.Z)({},n,{color:c,edge:l,size:p}),T=(e=>{const{classes:t,edge:n,size:r,color:i,checked:o,disabled:c}=e,l={root:["root",n&&`edge${(0,u.Z)(n)}`,`size${(0,u.Z)(r)}`],switchBase:["switchBase",`color${(0,u.Z)(i)}`,o&&"checked",c&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},d=(0,s.Z)(l,h,t);return(0,a.Z)({},t,d)})(x),S=(0,y.jsx)(_,{className:T.thumb,ownerState:x});return(0,y.jsxs)(b,{className:(0,o.default)(T.root,i),sx:f,ownerState:x,children:[(0,y.jsx)(v,(0,a.Z)({type:"checkbox",icon:S,checkedIcon:S,ref:t,ownerState:x},m,{classes:(0,a.Z)({},T,{root:T.switchBase})})),(0,y.jsx)(w,{className:T.track,ownerState:x})]})}))},87054:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(63366),a=n(87462),i=n(67294),o=n(86010),s=n(94780),c=n(41796),u=n(83187),l=n(36622),d=n(78884),p=n(81719),f=n(34867);function h(e){return(0,f.Z)("MuiToggleButton",e)}var m=(0,n(1588).Z)("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),y=n(85893);const g=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],b=(0,p.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,a.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=i.forwardRef((function(e,t){const n=(0,d.Z)({props:e,name:"MuiToggleButton"}),{children:i,className:c,color:u="standard",disabled:p=!1,disableFocusRipple:f=!1,fullWidth:m=!1,onChange:v,onClick:w,selected:_,size:x="medium",value:T}=n,S=(0,r.Z)(n,g),k=(0,a.Z)({},n,{color:u,disabled:p,disableFocusRipple:f,fullWidth:m,size:x}),E=(e=>{const{classes:t,fullWidth:n,selected:r,disabled:a,size:i,color:o}=e,c={root:["root",r&&"selected",a&&"disabled",n&&"fullWidth",`size${(0,l.Z)(i)}`,o]};return(0,s.Z)(c,h,t)})(k);return(0,y.jsx)(b,(0,a.Z)({className:(0,o.default)(E.root,c),disabled:p,focusRipple:!f,ref:t,onClick:e=>{w&&(w(e,T),e.defaultPrevented)||v&&v(e,T)},onChange:v,value:T,ownerState:k,"aria-pressed":_},S,{children:i}))}))},85390:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(63366),a=n(87462),i=n(67294),o=(n(59864),n(86010)),s=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 p=n(34867);function f(e){return(0,p.Z)("MuiToggleButtonGroup",e)}var h=(0,n(1588).Z)("MuiToggleButtonGroup",["root","selected","vertical","disabled","grouped","groupedHorizontal","groupedVertical"]),m=n(85893);const y=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],g=(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,a.Z)({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius},"vertical"===e.orientation&&{flexDirection:"column"},e.fullWidth&&{width:"100%"},{[`& .${h.grouped}`]:(0,a.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=i.forwardRef((function(e,t){const n=(0,u.Z)({props:e,name:"MuiToggleButtonGroup"}),{children:c,className:p,color:h="standard",disabled:b=!1,exclusive:v=!1,fullWidth:w=!1,onChange:_,orientation:x="horizontal",size:T="medium",value:S}=n,k=(0,r.Z)(n,y),E=(0,a.Z)({},n,{disabled:b,fullWidth:w,orientation:x,size:T}),A=(e=>{const{classes:t,orientation:n,fullWidth:r,disabled:a}=e,i={root:["root","vertical"===n&&"vertical",r&&"fullWidth"],grouped:["grouped",`grouped${(0,l.Z)(n)}`,a&&"disabled"]};return(0,s.Z)(i,f,t)})(E),O=(e,t)=>{if(!_)return;const n=S&&S.indexOf(t);let r;S&&n>=0?(r=S.slice(),r.splice(n,1)):r=S?S.concat(t):[t],_(e,r)},C=(e,t)=>{_&&_(e,S===t?null:t)};return(0,m.jsx)(g,(0,a.Z)({role:"group",className:(0,o.default)(A.root,p),ref:t,ownerState:E},k,{children:i.Children.map(c,(e=>i.isValidElement(e)?i.cloneElement(e,{className:(0,o.default)(A.grouped,e.props.className),onChange:v?C:O,selected:void 0===e.props.selected?d(e.props.value,S):e.props.selected,size:e.props.size||T,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 I}});var r=n(63366),a=n(87462),i=n(67294),o=n(86010),s=n(94780),c=n(10238),u=n(41796),l=n(81719),d=n(62097),p=n(78884),f=n(36622),h=n(61760),m=n(58402),y=n(26432),g=n(84771),b=n(49669),v=n(51625),w=n(44591),_=n(34867);function x(e){return(0,_.Z)("MuiTooltip",e)}var T=(0,n(1588).Z)("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),S=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 E=(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,a.Z)({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${T.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${T.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${T.arrow}`]:(0,a.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"] .${T.arrow}`]:(0,a.Z)({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})}))),A=(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,f.Z)(n.placement.split("-")[0])}`]]}})((({theme:e,ownerState:t})=>{return(0,a.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},{[`.${T.popper}[data-popper-placement*="left"] &`]:(0,a.Z)({transformOrigin:"right center"},t.isRtl?(0,a.Z)({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):(0,a.Z)({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${T.popper}[data-popper-placement*="right"] &`]:(0,a.Z)({transformOrigin:"left center"},t.isRtl?(0,a.Z)({marginRight:"14px"},t.touch&&{marginRight:"24px"}):(0,a.Z)({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${T.popper}[data-popper-placement*="top"] &`]:(0,a.Z)({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${T.popper}[data-popper-placement*="bottom"] &`]:(0,a.Z)({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})});var n})),O=(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 C=!1,P=null;function R(e,t){return n=>{t&&t(n),e(n)}}var I=i.forwardRef((function(e,t){var n,u,l,_,T,I;const D=(0,p.Z)({props:e,name:"MuiTooltip"}),{arrow:j=!1,children:M,components:N={},componentsProps:L={},describeChild:B=!1,disableFocusListener:Z=!1,disableHoverListener:U=!1,disableInteractive:F=!1,disableTouchListener:z=!1,enterDelay:G=100,enterNextDelay:H=0,enterTouchDelay:W=700,followCursor:V=!1,id:q,leaveDelay:$=0,leaveTouchDelay:Y=1500,onClose:K,onOpen:Q,open:X,placement:J="bottom",PopperComponent:ee,PopperProps:te={},title:ne,TransitionComponent:re=h.Z,TransitionProps:ae}=D,ie=(0,r.Z)(D,k),oe=(0,d.Z)(),se="rtl"===oe.direction,[ce,ue]=i.useState(),[le,de]=i.useState(null),pe=i.useRef(!1),fe=F||V,he=i.useRef(),me=i.useRef(),ye=i.useRef(),ge=i.useRef(),[be,ve]=(0,w.Z)({controlled:X,default:!1,name:"Tooltip",state:"open"});let we=be;const _e=(0,b.Z)(q),xe=i.useRef(),Te=i.useCallback((()=>{void 0!==xe.current&&(document.body.style.WebkitUserSelect=xe.current,xe.current=void 0),clearTimeout(ge.current)}),[]);i.useEffect((()=>()=>{clearTimeout(he.current),clearTimeout(me.current),clearTimeout(ye.current),Te()}),[Te]);const Se=e=>{clearTimeout(P),C=!0,ve(!0),Q&&!we&&Q(e)},ke=(0,y.Z)((e=>{clearTimeout(P),P=setTimeout((()=>{C=!1}),800+$),ve(!1),K&&we&&K(e),clearTimeout(he.current),he.current=setTimeout((()=>{pe.current=!1}),oe.transitions.duration.shortest)})),Ee=e=>{pe.current&&"touchstart"!==e.type||(ce&&ce.removeAttribute("title"),clearTimeout(me.current),clearTimeout(ye.current),G||C&&H?me.current=setTimeout((()=>{Se(e)}),C?H:G):Se(e))},Ae=e=>{clearTimeout(me.current),clearTimeout(ye.current),ye.current=setTimeout((()=>{ke(e)}),$)},{isFocusVisibleRef:Oe,onBlur:Ce,onFocus:Pe,ref:Re}=(0,v.Z)(),[,Ie]=i.useState(!1),De=e=>{Ce(e),!1===Oe.current&&(Ie(!1),Ae(e))},je=e=>{ce||ue(e.currentTarget),Pe(e),!0===Oe.current&&(Ie(!0),Ee(e))},Me=e=>{pe.current=!0;const t=M.props;t.onTouchStart&&t.onTouchStart(e)},Ne=Ee,Le=Ae,Be=e=>{Me(e),clearTimeout(ye.current),clearTimeout(he.current),Te(),xe.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ge.current=setTimeout((()=>{document.body.style.WebkitUserSelect=xe.current,Ee(e)}),W)},Ze=e=>{M.props.onTouchEnd&&M.props.onTouchEnd(e),Te(),clearTimeout(ye.current),ye.current=setTimeout((()=>{ke(e)}),Y)};i.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,g.Z)(M.ref,Re,ue,t);"number"===typeof ne||ne||(we=!1);const Fe=i.useRef({x:0,y:0}),ze=i.useRef(),Ge={},He="string"===typeof ne;B?(Ge.title=we||!He||U?null:ne,Ge["aria-describedby"]=we?_e:null):(Ge["aria-label"]=He?ne:null,Ge["aria-labelledby"]=we&&!He?_e:null);const We=(0,a.Z)({},Ge,ie,M.props,{className:(0,o.default)(ie.className,M.props.className),onTouchStart:Me,ref:Ue},V?{onMouseMove:e=>{const t=M.props;t.onMouseMove&&t.onMouseMove(e),Fe.current={x:e.clientX,y:e.clientY},ze.current&&ze.current.update()}}:{});const Ve={};z||(We.onTouchStart=Be,We.onTouchEnd=Ze),U||(We.onMouseOver=R(Ne,We.onMouseOver),We.onMouseLeave=R(Le,We.onMouseLeave),fe||(Ve.onMouseOver=Ne,Ve.onMouseLeave=Le)),Z||(We.onFocus=R(je,We.onFocus),We.onBlur=R(De,We.onBlur),fe||(Ve.onFocus=je,Ve.onBlur=De));const qe=i.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,a.Z)({},te.popperOptions,{modifiers:t})}),[le,te]),$e=(0,a.Z)({},D,{isRtl:se,arrow:j,disableInteractive:fe,placement:J,PopperComponentProp:ee,touch:pe.current}),Ye=(e=>{const{classes:t,disableInteractive:n,arrow:r,touch:a,placement:i}=e,o={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",a&&"touch",`tooltipPlacement${(0,f.Z)(i.split("-")[0])}`],arrow:["arrow"]};return(0,s.Z)(o,x,t)})($e),Ke=null!=(n=N.Popper)?n:E,Qe=null!=(u=null!=(l=N.Transition)?l:re)?u:h.Z,Xe=null!=(_=N.Tooltip)?_:A,Je=null!=(T=N.Arrow)?T:O,et=(0,c.Z)(Ke,(0,a.Z)({},te,L.popper),$e),tt=(0,c.Z)(Qe,(0,a.Z)({},ae,L.transition),$e),nt=(0,c.Z)(Xe,(0,a.Z)({},L.tooltip),$e),rt=(0,c.Z)(Je,(0,a.Z)({},L.arrow),$e);return(0,S.jsxs)(i.Fragment,{children:[i.cloneElement(M,We),(0,S.jsx)(Ke,(0,a.Z)({as:null!=ee?ee:m.Z,placement:J,anchorEl:V?{getBoundingClientRect:()=>({top:Fe.current.y,left:Fe.current.x,right:Fe.current.x,bottom:Fe.current.y,width:0,height:0})}:ce,popperRef:ze,open:!!ce&&we,id:_e,transition:!0},Ve,et,{className:(0,o.default)(Ye.popper,null==te?void 0:te.className,null==(I=L.popper)?void 0:I.className),popperOptions:qe,children:({TransitionProps:e})=>{var t,n;return(0,S.jsx)(Qe,(0,a.Z)({timeout:oe.transitions.duration.shorter},e,tt,{children:(0,S.jsxs)(Xe,(0,a.Z)({},nt,{className:(0,o.default)(Ye.tooltip,null==(t=L.tooltip)?void 0:t.className),children:[ne,j?(0,S.jsx)(Je,(0,a.Z)({},rt,{className:(0,o.default)(Ye.arrow,null==(n=L.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),a=n(87462),i=n(67294),o=n(86010),s=n(39707),c=n(94780),u=n(81719),l=n(78884),d=n(36622),p=n(34867);function f(e){return(0,p.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"],y=(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,a.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}))),g={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=i.forwardRef((function(e,t){const n=(0,l.Z)({props:e,name:"MuiTypography"}),i=(e=>b[e]||e)(n.color),u=(0,s.Z)((0,a.Z)({},n,{color:i})),{align:p="inherit",className:v,component:w,gutterBottom:_=!1,noWrap:x=!1,paragraph:T=!1,variant:S="body1",variantMapping:k=g}=u,E=(0,r.Z)(u,m),A=(0,a.Z)({},u,{align:p,color:i,className:v,component:w,gutterBottom:_,noWrap:x,paragraph:T,variant:S,variantMapping:k}),O=w||(T?"p":k[S]||g[S])||"span",C=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:a,variant:i,classes:o}=e,s={root:["root",i,"inherit"!==e.align&&`align${(0,d.Z)(t)}`,n&&"gutterBottom",r&&"noWrap",a&&"paragraph"]};return(0,c.Z)(s,f,o)})(A);return(0,h.jsx)(y,(0,a.Z)({as:O,ref:t,ownerState:A,className:(0,o.default)(C.root,v)},E))}))},37743:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(63366),a=n(87462),i=n(67294),o=n(86010),s=n(94780),c=n(36622),u=n(81719),l=n(44591),d=n(59711),p=n(83187),f=n(34867);function h(e){return(0,f.Z)("PrivateSwitchBase",e)}(0,n(1588).Z)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);var m=n(85893);const y=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],g=(0,u.ZP)(p.Z)((({ownerState:e})=>(0,a.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=i.forwardRef((function(e,t){const{autoFocus:n,checked:i,checkedIcon:u,className:p,defaultChecked:f,disabled:v,disableFocusRipple:w=!1,edge:_=!1,icon:x,id:T,inputProps:S,inputRef:k,name:E,onBlur:A,onChange:O,onFocus:C,readOnly:P,required:R,tabIndex:I,type:D,value:j}=e,M=(0,r.Z)(e,y),[N,L]=(0,l.Z)({controlled:i,default:Boolean(f),name:"SwitchBase",state:"checked"}),B=(0,d.Z)();let Z=v;B&&"undefined"===typeof Z&&(Z=B.disabled);const U="checkbox"===D||"radio"===D,F=(0,a.Z)({},e,{checked:N,disabled:Z,disableFocusRipple:w,edge:_}),z=(e=>{const{classes:t,checked:n,disabled:r,edge:a}=e,i={root:["root",n&&"checked",r&&"disabled",a&&`edge${(0,c.Z)(a)}`],input:["input"]};return(0,s.Z)(i,h,t)})(F);return(0,m.jsxs)(g,(0,a.Z)({component:"span",className:(0,o.default)(z.root,p),centerRipple:!0,focusRipple:!w,disabled:Z,tabIndex:null,role:void 0,onFocus:e=>{C&&C(e),B&&B.onFocus&&B.onFocus(e)},onBlur:e=>{A&&A(e),B&&B.onBlur&&B.onBlur(e)},ownerState:F,ref:t},M,{children:[(0,m.jsx)(b,(0,a.Z)({autoFocus:n,checked:i,defaultChecked:f,className:z.input,disabled:Z,id:U&&T,name:E,onChange:e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;L(t),O&&O(e,t)},readOnly:P,ref:k,required:R,ownerState:F,tabIndex:I,type:D},"checkbox"===D&&void 0===j?{}:{value:j},S)),N?u:x]}))}))},19762:function(e,t,n){"use strict";n.d(t,{Z:function(){return L}});var r=n(87462),a=n(63366),i=n(71387),o=n(59766),s=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 p={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 f={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 y={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 g=["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 a=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,c.$n)(e.main,a):"dark"===t&&(e.dark=(0,c._j)(e.main,i)))}function _(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:s=.2}=e,_=(0,a.Z)(e,g),x=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),T=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),S=e.error||function(e="light"){return"dark"===e?{main:p[500],light:p[300],dark:p[700]}:{main:p[700],light:p[400],dark:p[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),E=e.success||function(e="light"){return"dark"===e?{main:y[400],light:y[300],dark:y[700]}:{main:y[800],light:y[500],dark:y[900]}}(t),A=e.warning||function(e="light"){return"dark"===e?{main:f[400],light:f[300],dark:f[700]}:{main:"#ed6c02",light:f[500],dark:f[900]}}(t);function O(e){return(0,c.mi)(e,v.text.primary)>=n?v.text.primary:b.text.primary}const C=({color:e,name:t,mainShade:n=500,lightShade:a=300,darkShade:o=700})=>{if(!(e=(0,r.Z)({},e)).main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty("main"))throw new Error((0,i.Z)(11,t?` (${t})`:"",n));if("string"!==typeof e.main)throw new Error((0,i.Z)(12,t?` (${t})`:"",JSON.stringify(e.main)));return w(e,"light",a,s),w(e,"dark",o,s),e.contrastText||(e.contrastText=O(e.main)),e},P={dark:v,light:b};return(0,o.Z)((0,r.Z)({common:(0,r.Z)({},u),mode:t,primary:C({color:x,name:"primary"}),secondary:C({color:T,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:C({color:S,name:"error"}),warning:C({color:A,name:"warning"}),info:C({color:k,name:"info"}),success:C({color:E,name:"success"}),grey:l,contrastThreshold:n,getContrastText:O,augmentColor:C,tonalOffset:s},P[t]),_)}const x=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];const T={textTransform:"uppercase"},S='"Roboto", "Helvetica", "Arial", sans-serif';function k(e,t){const n="function"===typeof t?t(e):t,{fontFamily:i=S,fontSize:s=14,fontWeightLight:c=300,fontWeightRegular:u=400,fontWeightMedium:l=500,fontWeightBold:d=700,htmlFontSize:p=16,allVariants:f,pxToRem:h}=n,m=(0,a.Z)(n,x);const y=s/14,g=h||(e=>e/p*y+"rem"),b=(e,t,n,a,o)=>{return(0,r.Z)({fontFamily:i,fontWeight:e,fontSize:g(t),lineHeight:n},i===S?{letterSpacing:(s=a/t,Math.round(1e5*s)/1e5)+"em"}:{},o,f);var s},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,T),caption:b(u,12,1.66,.4),overline:b(u,12,2.66,1,T)};return(0,o.Z)((0,r.Z)({htmlFontSize:p,pxToRem:g,fontFamily:i,fontSize:s,fontWeightLight:c,fontWeightRegular:u,fontWeightMedium:l,fontWeightBold:d},v),m,{clone:!1})}function E(...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 A=["none",E(0,2,1,-1,0,1,1,0,0,1,3,0),E(0,3,1,-2,0,2,2,0,0,1,5,0),E(0,3,3,-2,0,3,4,0,0,1,8,0),E(0,2,4,-1,0,4,5,0,0,1,10,0),E(0,3,5,-1,0,5,8,0,0,1,14,0),E(0,3,5,-1,0,6,10,0,0,1,18,0),E(0,4,5,-2,0,7,10,1,0,2,16,1),E(0,5,5,-3,0,8,10,1,0,3,14,2),E(0,5,6,-3,0,9,12,1,0,3,16,2),E(0,6,6,-3,0,10,14,1,0,4,18,3),E(0,6,7,-4,0,11,15,1,0,4,20,3),E(0,7,8,-4,0,12,17,2,0,5,22,4),E(0,7,8,-4,0,13,19,2,0,5,24,4),E(0,7,9,-4,0,14,21,2,0,5,26,4),E(0,8,9,-5,0,15,22,2,0,6,28,5),E(0,8,10,-5,0,16,24,2,0,6,30,5),E(0,8,11,-5,0,17,26,2,0,6,32,5),E(0,9,11,-5,0,18,28,2,0,7,34,6),E(0,9,12,-6,0,19,29,2,0,7,36,6),E(0,10,13,-6,0,20,31,3,0,8,38,7),E(0,10,13,-6,0,21,33,3,0,8,40,7),E(0,10,14,-6,0,22,35,3,0,8,42,7),E(0,11,14,-7,0,23,36,3,0,9,44,8),E(0,11,15,-7,0,24,38,3,0,9,46,8)];const O=["duration","easing","delay"],C={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)"},P={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function R(e){return`${Math.round(e)}ms`}function I(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function D(e){const t=(0,r.Z)({},C,e.easing),n=(0,r.Z)({},P,e.duration);return(0,r.Z)({getAutoHeightDuration:I,create:(e=["all"],r={})=>{const{duration:i=n.standard,easing:o=t.easeInOut,delay:s=0}=r;(0,a.Z)(r,O);return(Array.isArray(e)?e:[e]).map((e=>`${e} ${"string"===typeof i?i:R(i)} ${o} ${"string"===typeof s?s:R(s)}`)).join(",")}},e,{easing:t,duration:n})}var j={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,a.Z)(e,M);if(e.vars)throw new Error((0,i.Z)(18));const p=_(c),f=(0,s.Z)(e);let h=(0,o.Z)(f,{mixins:(m=f.breakpoints,y=n,(0,r.Z)({toolbar:{minHeight:56,[m.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[m.up("sm")]:{minHeight:64}}},y)),palette:p,shadows:A.slice(),typography:k(p,l),transitions:D(u),zIndex:(0,r.Z)({},j)});var m,y;return h=(0,o.Z)(h,d),h=t.reduce(((e,t)=>(0,o.Z)(e,t)),h),h}var L=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 i},Dz:function(){return o}});var r=n(70182),a=n(25165);const i=e=>(0,r.x9)(e)&&"classes"!==e,o=r.x9,s=(0,r.ZP)({defaultTheme:a.Z,rootShouldForwardProp:i});t.ZP=s},62097:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});n(67294);var r=n(96682),a=n(25165);function i(){return(0,r.Z)(a.Z)}},78884:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(29628),a=n(25165);function i({props:e,name:t}){return(0,r.Z)({props:e,name:t,defaultTheme:a.Z})}},53566:function(e,t,n){"use strict";n.d(t,{n:function(){return r},C:function(){return a}});const r=e=>e.scrollTop;function a(e,t){var n,r;const{timeout:a,easing:i,style:o={}}=e;return{duration:null!=(n=o.transitionDuration)?n:"number"===typeof a?a:a[t.mode]||0,easing:null!=(r=o.transitionTimingFunction)?r:"object"===typeof i?i[t.mode]:i,delay:o.transitionDelay}}},61225:function(e,t,n){"use strict";var r;n.d(t,{Z:function(){return d}});var a=n(67294),i=n(34168),o=n(20539),s=n(63289);function c(e,t,n,r,i){const o="undefined"!==typeof window&&"undefined"!==typeof window.matchMedia,[c,u]=a.useState((()=>i&&o?n(e).matches:r?r(e).matches:t));return(0,s.Z)((()=>{let t=!0;if(!o)return;const r=n(e),a=()=>{t&&u(r.matches)};return a(),r.addListener(a),()=>{t=!1,r.removeListener(a)}}),[e,n,o]),c}const u=(r||(r=n.t(a,2))).useSyncExternalStore;function l(e,t,n,r){const i=a.useCallback((()=>t),[t]),o=a.useMemo((()=>{if(null!==r){const{matches:t}=r(e);return()=>t}return i}),[i,e,r]),[s,c]=a.useMemo((()=>{if(null===n)return[i,()=>()=>{}];const t=n(e);return[()=>t.matches,e=>(t.addListener(e),()=>{t.removeListener(e)})]}),[i,n,e]);return u(c,s,o)}function d(e,t={}){const n=(0,i.Z)(),r="undefined"!==typeof window&&"undefined"!==typeof window.matchMedia,{defaultMatches:a=!1,matchMedia:s=(r?window.matchMedia:null),ssrMatchMedia:d=null,noSsr:p}=(0,o.Z)({name:"MuiUseMediaQuery",props:t,theme:n});let f="function"===typeof e?e(n):e;f=f.replace(/^@media( ?)/m,"");return(void 0!==u?l:c)(f,a,s,d,p)}},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 s}});var r=n(87462),a=n(67294),i=n(81645),o=n(85893);function s(e,t){const n=(n,a)=>(0,o.jsx)(i.Z,(0,r.Z)({"data-testid":`${t}Icon`,ref:a},n,{children:e}));return n.muiName=i.Z.muiName,a.memo(a.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 a.Z},createChainedFunction:function(){return i},createSvgIcon:function(){return o.Z},debounce:function(){return s.Z},deprecatedPropType:function(){return c},isMuiElement:function(){return u.Z},ownerDocument:function(){return l.Z},ownerWindow:function(){return d.Z},requirePropFactory:function(){return p},setRef:function(){return f},unstable_ClassNameGenerator:function(){return _},unstable_useEnhancedEffect:function(){return h.Z},unstable_useId:function(){return m.Z},unsupportedProp:function(){return y},useControlled:function(){return g.Z},useEventCallback:function(){return b.Z},useForkRef:function(){return v.Z},useIsFocusVisible:function(){return w.Z}});var r=n(37078),a=n(36622),i=n(49064).Z,o=n(54235),s=n(75400);var c=function(e,t){return()=>null},u=n(7335),l=n(47505),d=n(57577);n(87462);var p=function(e,t){return()=>null},f=n(7960).Z,h=n(63289),m=n(49669);var y=function(e,t,n,r,a){return null},g=n(44591),b=n(26432),v=n(84771),w=n(51625);const _={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 a}});var r=n(67294);var a=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},44591:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(67294);var a=function({controlled:e,default:t,name:n,state:a="value"}){const{current:i}=r.useRef(void 0!==e),[o,s]=r.useState(t);return[i?e:o,r.useCallback((e=>{i||s(e)}),[])]}},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},51625:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(67294);let a,i=!0,o=!1;const s={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||(i=!0)}function u(){i=!1}function l(){"hidden"===this.visibilityState&&o&&(i=!0)}function d(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(n){}return i||function(e){const{type:t,tagName:n}=e;return!("INPUT"!==n||!s[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}var p=function(){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&&(o=!0,window.clearTimeout(a),a=window.setTimeout((()=>{o=!1}),100),t.current=!1,!0)},ref:e}}},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 i}});var r=n(67294),a=n(44819);function i(){return r.useContext(a.Z)}},49731:function(e,t,n){"use strict";n.d(t,{ZP:function(){return w},Co:function(){return _}});var r=n(67294),a=n(87462),i=n(45042),o=/^((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)-.*))$/,s=(0,i.Z)((function(e){return o.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),p=s,f=function(e){return"theme"!==e},h=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?p:f},m=function(e,t,n){var r;if(t){var a=t.shouldForwardProp;r=e.__emotion_forwardProp&&a?function(t){return e.__emotion_forwardProp(t)&&a(t)}:a}return"function"!==typeof r&&n&&(r=e.__emotion_forwardProp),r},y=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},g=function e(t,n){var i,o,s=t.__emotion_real===t,d=s&&t.__emotion_base||t;void 0!==n&&(i=n.label,o=n.target);var p=m(t,n,s),f=p||h(d),g=!f("as");return function(){var b=arguments,v=s&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&v.push("label:"+i+";"),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,_=1;_{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}},95408:function(e,t,n){"use strict";n.d(t,{VO:function(){return a},k9:function(){return o},W8:function(){return s},L7:function(){return c},dt:function(){return u},P$:function(){return l}});var r=n(59766);const a={xs:0,sm:600,md:900,lg:1200,xl:1536},i={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${a[e]}px)`};function o(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||i;return t.reduce(((r,a,i)=>(r[e.up(e.keys[i])]=n(t[i]),r)),{})}if("object"===typeof t){const e=r.breakpoints||i;return Object.keys(t).reduce(((r,i)=>{if(-1!==Object.keys(e.values||a).indexOf(i)){r[e.up(i)]=n(t[i],i)}else{const e=i;r[e]=t[e]}return r}),{})}return n(t)}function s(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=s(e),a=[n,...t].reduce(((e,t)=>(0,r.Z)(e,t)),{});return c(Object.keys(n),a)}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),a=Object.keys(r);if(0===a.length)return e;let i;return a.reduce(((t,n,r)=>(Array.isArray(e)?(t[n]=null!=e[r]?e[r]:e[i],i=r):"object"===typeof e?(t[n]=null!=e[n]?e[n]:e[i],i=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}});var r=n(71387);function a(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function i(e){if(e.type)return e;if("#"===e.charAt(0))return i(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 a,o=e.substring(t+1,e.length-1);if("color"===n){if(o=o.split(" "),a=o.shift(),4===o.length&&"/"===o[3].charAt(0)&&(o[3]=o[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(a))throw new Error((0,r.Z)(10,a))}else o=o.split(",");return o=o.map((e=>parseFloat(e))),{type:n,values:o,colorSpace:a}}function o(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 s(e){let t="hsl"===(e=i(e)).type||"hsla"===e.type?i(function(e){e=i(e);const{values:t}=e,n=t[0],r=t[1]/100,a=t[2]/100,s=r*Math.min(a,1-a),c=(e,t=(e+n/30)%12)=>a-s*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])),o({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=s(e),r=s(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function u(e,t){return e=i(e),t=a(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,o(e)}function l(e,t){if(e=i(e),t=a(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 o(e)}function d(e,t){if(e=i(e),t=a(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 o(e)}},70182:function(e,t,n){"use strict";n.d(t,{ZP:function(){return b},x9:function(){return y}});var r=n(63366),a=n(87462),i=n(49731),o=n(66500),s=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 a=t||"";return Object.keys(n).sort().forEach((t=>{a+="color"===t?u(a)?e[t]:(0,s.Z)(e[t]):`${u(a)?t:(0,s.Z)(t)}${(0,s.Z)(e[t].toString())}`})),a}var d=n(86523);const p=["name","slot","skipVariantsResolver","skipSx","overridesResolver"],f=["theme"],h=["theme"];function m(e){return 0===Object.keys(e).length}function y(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const g=(0,o.Z)();function b(e={}){const{defaultTheme:t=g,rootShouldForwardProp:n=y,slotShouldForwardProp:o=y,styleFunctionSx:s=d.Z}=e,c=e=>{const n=m(e.theme)?t:e.theme;return s((0,a.Z)({},e,{theme:n}))};return c.__mui_systemSx=!0,(e,s={})=>{(0,i.Co)(e,(e=>e.filter((e=>!(null!=e&&e.__mui_systemSx)))));const{name:u,slot:d,skipVariantsResolver:g,skipSx:b,overridesResolver:v}=s,w=(0,r.Z)(s,p),_=void 0!==g?g:d&&"Root"!==d||!1,x=b||!1;let T=y;"Root"===d?T=n:d?T=o:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(T=void 0);const S=(0,i.ZP)(e,(0,a.Z)({shouldForwardProp:T,label:undefined},w)),k=(e,...n)=>{const i=n?n.map((e=>"function"===typeof e&&e.__emotion_real!==e?n=>{let{theme:i}=n,o=(0,r.Z)(n,f);return e((0,a.Z)({theme:m(i)?t:i},o))}:e)):[];let o=e;u&&v&&i.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,i])=>{t[r]="function"===typeof i?i((0,a.Z)({},e,{theme:n})):i})),v(e,t)}return null})),u&&!_&&i.push((e=>{const n=m(e.theme)?t:e.theme;return((e,t,n,r)=>{var a,i;const{ownerState:o={}}=e,s=[],c=null==n||null==(a=n.components)||null==(i=a[r])?void 0:i.variants;return c&&c.forEach((n=>{let r=!0;Object.keys(n.props).forEach((t=>{o[t]!==n.props[t]&&e[t]!==n.props[t]&&(r=!1)})),r&&s.push(t[l(n.props)])})),s})(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)})),x||i.push(c);const s=i.length-n.length;if(Array.isArray(e)&&s>0){const t=new Array(s).fill("");o=[...e,...t],o.raw=[...e.raw,...t]}else"function"===typeof e&&e.__emotion_real!==e&&(o=n=>{let{theme:i}=n,o=(0,r.Z)(n,h);return e((0,a.Z)({theme:m(i)?t:i},o))});return S(o,...i)};return S.withConfig&&(k.withConfig=S.withConfig),k}}},66500:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(87462),a=n(63366),i=n(59766);const o=["values","unit","step"];function s(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:i=5}=e,s=(0,a.Z)(e,o),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)-i/100}${n})`}function p(e,r){const a=u.indexOf(r);return`@media (min-width:${"number"===typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==a&&"number"===typeof t[u[a]]?t[u[a]]:r)-i/100}${n})`}return(0,r.Z)({keys:u,values:c,up:l,down:d,between:p,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 y=(0,i.Z)({breakpoints:h,direction:"ltr",components:{},palette:(0,r.Z)({mode:"light"},o),spacing:m,shape:(0,r.Z)({},c,p)},f);return y=t.reduce(((e,t)=>(0,i.Z)(e,t)),y),y}},85578:function(e,t,n){"use strict";n.d(t,{Gc:function(){return Y},G$:function(){return $}});var r=n(54844),a=n(47730);var i=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,a.Z)(n,t[r](e)):n),{});return n.propTypes={},n.filterProps=e.reduce(((e,t)=>e.concat(t.filterProps)),[]),n},o=n(98700),s=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}),p=(0,r.Z)({prop:"borderBottom",themeKey:"borders",transform:c}),f=(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"}),y=(0,r.Z)({prop:"borderRightColor",themeKey:"palette"}),g=(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,o.eI)(e.theme,"shape.borderRadius",4,"borderRadius"),n=e=>({borderRadius:(0,o.NA)(t,e)});return(0,s.k9)(e,e.borderRadius,n)}return null};v.propTypes={},v.filterProps=["borderRadius"];var w=i(u,l,d,p,f,h,m,y,g,b,v);var _=i((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 x=i((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 T=e=>{if(void 0!==e.gap&&null!==e.gap){const t=(0,o.eI)(e.theme,"spacing",8,"gap"),n=e=>({gap:(0,o.NA)(t,e)});return(0,s.k9)(e,e.gap,n)}return null};T.propTypes={},T.filterProps=["gap"];const S=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=(0,o.eI)(e.theme,"spacing",8,"columnGap"),n=e=>({columnGap:(0,o.NA)(t,e)});return(0,s.k9)(e,e.columnGap,n)}return null};S.propTypes={},S.filterProps=["columnGap"];const k=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=(0,o.eI)(e.theme,"spacing",8,"rowGap"),n=e=>({rowGap:(0,o.NA)(t,e)});return(0,s.k9)(e,e.rowGap,n)}return null};k.propTypes={},k.filterProps=["rowGap"];var E=i(T,S,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 A=i((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 O=i((0,r.Z)({prop:"color",themeKey:"palette"}),(0,r.Z)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette"}),(0,r.Z)({prop:"backgroundColor",themeKey:"palette"}));var C=(0,r.Z)({prop:"boxShadow",themeKey:"shadows"});function P(e){return e<=1&&0!==e?100*e+"%":e}const R=(0,r.Z)({prop:"width",transform:P}),I=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var n,r,a;return{maxWidth:(null==(n=e.theme)||null==(r=n.breakpoints)||null==(a=r.values)?void 0:a[t])||s.VO[t]||P(t)}};return(0,s.k9)(e,e.maxWidth,t)}return null};I.filterProps=["maxWidth"];const D=(0,r.Z)({prop:"minWidth",transform:P}),j=(0,r.Z)({prop:"height",transform:P}),M=(0,r.Z)({prop:"maxHeight",transform:P}),N=(0,r.Z)({prop:"minHeight",transform:P});(0,r.Z)({prop:"size",cssProperty:"width",transform:P}),(0,r.Z)({prop:"size",cssProperty:"height",transform:P});var L=i(R,I,D,j,M,N,(0,r.Z)({prop:"boxSizing"}));const B=(0,r.Z)({prop:"fontFamily",themeKey:"typography"}),Z=(0,r.Z)({prop:"fontSize",themeKey:"typography"}),U=(0,r.Z)({prop:"fontStyle",themeKey:"typography"}),F=(0,r.Z)({prop:"fontWeight",themeKey:"typography"}),z=(0,r.Z)({prop:"letterSpacing"}),G=(0,r.Z)({prop:"textTransform"}),H=(0,r.Z)({prop:"lineHeight"}),W=(0,r.Z)({prop:"textAlign"});var V=i((0,r.Z)({prop:"typography",cssProperty:!1,themeKey:"typography"}),B,Z,U,F,z,H,W,G);const q={borders:w.filterProps,display:_.filterProps,flexbox:x.filterProps,grid:E.filterProps,positions:A.filterProps,palette:O.filterProps,shadows:C.filterProps,sizing:L.filterProps,spacing:o.ZP.filterProps,typography:V.filterProps},$={borders:w,display:_,flexbox:x,grid:E,positions:A,palette:O,shadows:C,sizing:L,spacing:o.ZP,typography:V},Y=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 f},ZP:function(){return _},NA:function(){return m}});var r=n(95408),a=n(54844),i=n(47730);const o={m:"margin",p:"padding"},s={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=o[t],a=s[n]||"";return Array.isArray(a)?a.map((e=>r+e)):[r+a]})),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"],p=[...l,...d];function f(e,t,n,r){var i;const o=null!=(i=(0,a.D)(e,t,!1))?i:n;return"number"===typeof o?e=>"string"===typeof e?e:o*e:Array.isArray(o)?e=>"string"===typeof e?e:o[e]:"function"===typeof o?o:()=>{}}function h(e){return f(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 y(e,t,n,a){if(-1===t.indexOf(n))return null;const i=function(e,t){return n=>e.reduce(((e,r)=>(e[r]=m(t,n),e)),{})}(u(n),a),o=e[n];return(0,r.k9)(e,o,i)}function g(e,t){const n=h(e.theme);return Object.keys(e).map((r=>y(e,t,r,n))).reduce(i.Z,{})}function b(e){return g(e,l)}function v(e){return g(e,d)}function w(e){return g(e,p)}b.propTypes={},b.filterProps=l,v.propTypes={},v.filterProps=d,w.propTypes={},w.filterProps=p;var _=w},54844:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(28320),a=n(95408);function i(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 o(e,t,n,r=n){let a;return a="function"===typeof e?e(n):Array.isArray(e)?e[n]||r:i(e,n)||r,t&&(a=t(a)),a}t.Z=function(e){const{prop:t,cssProperty:n=e.prop,themeKey:s,transform:c}=e,u=e=>{if(null==e[t])return null;const u=e[t],l=i(e.theme,s)||{};return(0,a.k9)(e,u,(e=>{let a=o(l,c,e);return e===a&&"string"===typeof e&&(a=o(l,c,`${t}${"default"===e?"":(0,r.Z)(e)}`,e)),!1===n?a:{[n]:a}}))};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),a=n(63366),i=n(59766),o=n(85578);const s=["sx"];function c(e){const{sx:t}=e,n=(0,a.Z)(e,s),{systemProps:c,otherProps:u}=(e=>{const t={systemProps:{},otherProps:{}};return Object.keys(e).forEach((n=>{o.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,i.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),a=n(85578),i=n(95408);const o=function(e=a.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 a={[e]:n,theme:r},i=t[e];return i?i(a):{[e]:n}}return function e(a){const{sx:o,theme:s={}}=a||{};if(!o)return null;function c(a){let o=a;if("function"===typeof a)o=a(s);else if("object"!==typeof a)return a;if(!o)return null;const c=(0,i.W8)(s.breakpoints),u=Object.keys(c);let l=c;return Object.keys(o).forEach((a=>{const c=(u=o[a],d=s,"function"===typeof u?u(d):u);var u,d;if(null!==c&&void 0!==c)if("object"===typeof c)if(t[a])l=(0,r.Z)(l,n(a,c,s));else{const t=(0,i.k9)({theme:s},c,(e=>({[a]: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[a]=e({sx:c,theme:s})}else l=(0,r.Z)(l,n(a,c,s))})),(0,i.L7)(u,l)}return Array.isArray(o)?o.map(c):c(o)}}();o.filterProps=["sx"],t.Z=o},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),a=n(34168);const i=(0,r.Z)();t.Z=function(e=i){return(0,a.Z)(e)}},20539:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(47925);function a(e){const{theme:t,name:n,props:a}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,r.Z)(t.components[n].defaultProps,a):a}},29628:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(20539),a=n(96682);function i({props:e,name:t,defaultTheme:n}){const i=(0,a.Z)(n);return(0,r.Z)({theme:i,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 a}});var r=n(71387);function a(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((a=>{r[a]=e[a].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 a},Z:function(){return i}});var r=n(87462);function a(e){return null!==e&&"object"===typeof e&&e.constructor===Object}function i(e,t,n={clone:!0}){const o=n.clone?(0,r.Z)({},e):e;return a(e)&&a(t)&&Object.keys(t).forEach((r=>{"__proto__"!==r&&(a(t[r])&&r in e&&a(e[r])?o[r]=i(e[r],t[r],n):o[r]=t[r])})),o}},71387:function(e,t,n){"use strict";function r(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n{a[t]=(0,r.Z)(e,t,n)})),a}},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 a}});var r=n(57094);function a(e){return(0,r.Z)(e).defaultView||window}},47925:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(87462);function a(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}})},16600:function(e,t,n){"use strict";var r=n(67294);const a="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;t.Z=a},73633:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(67294),a=n(16600);function i(e){const t=r.useRef(e);return(0,a.Z)((()=>{t.current=e})),r.useCallback(((...e)=>(0,t.current)(...e)),[])}},30067:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(67294),a=n(7960);function i(...e){return r.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{(0,a.Z)(e,t)}))}),e)}},57579:function(e,t,n){"use strict";var r;n.d(t,{Z:function(){return s}});var a=n(67294);let i=0;const o=(r||(r=n.t(a,2))).useId;function s(e){if(void 0!==o){const t=o();return null!=e?e:t}return function(e){const[t,n]=a.useState(e),r=e||t;return a.useEffect((()=>{null==t&&(i+=1,n(`mui-${i}`))}),[t]),r}(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 a(){return"npm"}n.d(t,{S:function(){return a},n:function(){return r}})},61422:function(e,t,n){"use strict";n.d(t,{l$:function(){return o},KV:function(){return i}});var r=n(68518);e=n.hmd(e);var a=n(83454);function i(){return!(0,r.n)()&&"[object process]"===Object.prototype.toString.call("undefined"!==typeof a?a:0)}function o(e,t){return e.require(t)}},21170:function(e,t,n){"use strict";n.d(t,{Z1:function(){return p},yW:function(){return u},ph:function(){return l}});var r=n(61422),a=n(71235);e=n.hmd(e);const i=(0,a.Rf)(),o={nowSeconds:()=>Date.now()/1e3};const s=(0,r.KV)()?function(){try{return(0,r.l$)(e,"perf_hooks").performance}catch(t){return}}():function(){const{performance:e}=i;if(!e||!e.now)return;return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),c=void 0===s?o:{nowSeconds:()=>(s.timeOrigin+s.now())/1e3},u=o.nowSeconds.bind(o),l=c.nowSeconds.bind(c);let d;const p=(()=>{const{performance:e}=i;if(!e||!e.now)return void(d="none");const t=36e5,n=e.now(),r=Date.now(),a=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=a>1]>>4>=8&&(n[u]=n[u].toUpperCase()),(15&o[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&&i(!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],a=t[1],i=g(r);if(e.supportedChainIds&&!e.supportedChainIds.includes(i))throw new x(i,e.supportedChainIds);var o=null===a?a:b(a);return{provider:n,chainId:i,account:o}}))},r=void 0===t.provider;return Promise.resolve(r?Promise.resolve(e.getProvider()).then(n):n(t.provider))}catch(a){return Promise.reject(a)}},_=function(e){function t(){var t;return(t=e.call(this)||this).name=t.constructor.name,t}return l(t,e),t}(m(Error)),x=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 T(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 a=r.provider,i=r.chainId,o=r.account;return u({},e,void 0===a?{}:{provider:a},void 0===i?{}:{chainId:i},void 0===o?{}:{account:o});case v.UPDATE_FROM_ERROR:var s=r.provider,c=r.chainId,l=r.account;return u({},e,void 0===s?{}:{provider:s},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 S="primary",k={};function E(e){k[e]&&i(!1),k[e]=(0,r.createContext)({activate:function(){try{return i(!1),Promise.resolve()}catch(e){return Promise.reject(e)}},setError:function(){i(!1)},deactivate:function(){i(!1)},active:!1}),k[e].displayName="Web3ReactContext - "+e;var t=k[e].Provider;return function(e){var n=e.getLibrary,a=e.children,i=function(){var e=(0,r.useReducer)(T,{}),t=e[0],n=e[1],a=t.connector,i=t.provider,s=t.chainId,c=t.account,l=t.onError,d=t.error,p=(0,r.useRef)(-1);p.current+=1;var f=(0,r.useCallback)((function(e,t,r){void 0===r&&(r=!1);try{var a=p.current,i=!1;return Promise.resolve(y((function(){return Promise.resolve(e.activate().then((function(e){return i=!0,e}))).then((function(r){return Promise.resolve(w(e,r)).then((function(r){if(p.current>a)throw new _;n({type:v.ACTIVATE_CONNECTOR,payload:u({connector:e},r,{onError:t})})}))}))}),(function(a){if(a instanceof _)i&&e.deactivate();else{if(r)throw i&&e.deactivate(),a;t?(i&&e.deactivate(),t(a)):n({type:v.ERROR_FROM_ACTIVATION,payload:{connector:e,error:a}})}})))}catch(o){return Promise.reject(o)}}),[]),h=(0,r.useCallback)((function(e){n({type:v.ERROR,payload:{error:e}})}),[]),m=(0,r.useCallback)((function(){n({type:v.DEACTIVATE_CONNECTOR})}),[]),S=(0,r.useCallback)((function(e){try{if(!a)throw Error("This should never happen, it's just so Typescript stops complaining");var t=p.current;return Promise.resolve(function(){if(d)return y((function(){return Promise.resolve(w(a,e)).then((function(e){if(p.current>t)throw new _;n({type:v.UPDATE_FROM_ERROR,payload:e})}))}),(function(e){e instanceof _||(l?l(e):n({type:v.ERROR,payload:{error:e}}))}));var r=void 0===e.chainId?void 0:g(e.chainId);if(void 0!==r&&a.supportedChainIds&&!a.supportedChainIds.includes(r)){var i=new x(r,a.supportedChainIds);l?l(i):n({type:v.ERROR,payload:{error:i}})}else{var o="string"===typeof e.account?b(e.account):e.account;n({type:v.UPDATE,payload:{provider:e.provider,chainId:r,account:o}})}}())}catch(r){return Promise.reject(r)}}),[a,d,l]),k=(0,r.useCallback)((function(e){l?l(e):n({type:v.ERROR,payload:{error:e}})}),[l]),E=(0,r.useCallback)((function(){n({type:v.DEACTIVATE_CONNECTOR})}),[]);return(0,r.useEffect)((function(){return function(){a&&a.deactivate()}}),[a]),(0,r.useEffect)((function(){return a&&a.on(o._.Update,S).on(o._.Error,k).on(o._.Deactivate,E),function(){a&&a.off(o._.Update,S).off(o._.Error,k).off(o._.Deactivate,E)}}),[a,S,k,E]),{connector:a,provider:i,chainId:s,account:c,activate:f,setError:h,deactivate:m,error:d}}(),s=i.connector,c=i.provider,l=i.chainId,d=i.account,p=i.activate,f=i.setError,h=i.deactivate,m=i.error,S=void 0!==s&&void 0!==l&&void 0!==d&&!m,k=(0,r.useMemo)((function(){return S&&void 0!==l&&Number.isInteger(l)&&s?n(c,s):void 0}),[S,n,c,s,l]),E={connector:s,library:k,chainId:l,account:d,activate:p,setError:f,deactivate:h,active:S,error:m};return r.createElement(t,{value:E},a)}}var A=E(S);function O(e){return void 0===e&&(e=S),Object.keys(k).includes(e)||i(!1),k[e]}function C(e){return(0,r.useContext)(O(e))}},32120:function(e,t,n){const r=n(17187),a=!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)a;else if(0===this.targets.length)a;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),a=n(9207),i=n(35479),o={ethereum:"undefined"!==typeof window&&"undefined"!==typeof window.ethereum?window.ethereum:null,web3:"undefined"!==typeof window&&"undefined"!==typeof window.web3?window.web3.currentProvider:null},s="undefined"!==typeof window&&"undefined"!==typeof window.WebSocket?window.WebSocket:null,c="undefined"!==typeof window&&"undefined"!==typeof window.XMLHttpRequest?window.XMLHttpRequest:null;o.ethereum&&(o.ethereum.__isProvider=!0);const u={injected:o.ethereum||n(54806)(o.web3),ipc:n(16886)("IPC connections are unavliable in the browser"),ws:n(3809)(s),http:n(11252)(c)};e.exports=(e=["injected","frame"],t={})=>a(u,r(e,i),t)},11252:function(e,t,n){const r=n(17187),a=n(95394);let i;class o extends r{constructor(e,t,n){super(),i=e,this.connected=!1,this.subscriptions=!1,this.status="loading",this.url=t,this.pollId=a(),setTimeout((()=>this.create()),0)}create(){if(!i)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 i;let r=!1;const a=(a,i)=>{if(!r)if(n.abort(),r=!0,t)t(a,i);else{const{id:t,jsonrpc:n}=e,r=a?{id:t,jsonrpc:n,error:{message:a.message,code:a.code}}:{id:t,jsonrpc:n,result:i};this.emit("payload",r)}};n.open("POST",this.url,!0),n.setRequestHeader("Content-Type","application/json"),n.timeout=6e4,n.onerror=a,n.ontimeout=a,n.onreadystatechange=()=>{if(4===n.readyState)try{const e=JSON.parse(n.responseText);a(e.error,e.result)}catch(e){a(e)}},n.send(JSON.stringify(e))}}e.exports=e=>(t,n)=>new o(e,t,n)},54806:function(e,t,n){const r=n(17187);class a 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 a(e,t)},16886:function(e,t,n){const r=n(17187);class a extends r{constructor(e){super(),setTimeout((()=>this.emit("error",new Error(e))),0)}}e.exports=e=>()=>new a(e)},3809:function(e,t,n){const r=n(17187),a=n(19851);let i;class o extends r{constructor(e,t,n){super(),i=e,setTimeout((()=>this.create(t,n)),0)}create(e,t){i||this.emit("error",new Error("No WebSocket transport available"));try{this.socket=new i(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:"";a(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 o(e,t,n)},19851:function(e){let t,n;e.exports=(e,r)=>{const a=[];e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach((e=>{let i;t&&(e=t+e);try{i=JSON.parse(e)}catch(o){return t=e,clearTimeout(n),void(n=setTimeout((()=>r(new Error("Parse response timeout"))),15e3))}clearTimeout(n),t=null,i&&a.push(i)})),r(null,a)}},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),a=n(12990),i=n(32120),o=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,o(e.injected);const r=new a(new i(e,t,n));return r.setMaxListeners(128),o(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:a}=e;"undefined"!==typeof t?this.promises[t]&&(e.error?this.promises[t].reject(r):this.promises[t].resolve(a),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,a=t;return[a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[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),a=n(49977);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||r)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[i+s]=o[s];return t||a(o)}},30950:function(e,t,n){"use strict";n.d(t,{_k:function(){return y},A5:function(){return h}});var r=n(26939);function a(){return a=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 a}});var a=function(e){var t,a;function i(t){var n,r=t.chainId,a=t.initOptions,i=void 0===a?{}:a,o=t.constructorOptions,s=void 0===o?{}:o,c=t.loginOptions,u=void 0===c?{}:c;return(n=e.call(this,{supportedChainIds:[r]})||this).chainId=r,n.initOptions=i,n.constructorOptions=s,n.loginOptions=u,n}a=e,(t=i).prototype=Object.create(a.prototype),t.prototype.constructor=t,r(t,a);var o=i.prototype;return o.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(a){return Promise.reject(a)}},o.getProvider=function(){try{return Promise.resolve(this.torus.provider)}catch(e){return Promise.reject(e)}},o.getChainId=function(){try{return Promise.resolve(this.chainId)}catch(e){return Promise.reject(e)}},o.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)}},o.deactivate=function(){return Promise.resolve()},o.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)}},i}(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 s}});var r=n(26939);function a(){return a=Object.assign||function(e){for(var t=1;t255)return!1;return!0}function a(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 i(e){return new Uint8Array(e)}function o(e,t,n,r,a){null==r&&null==a||(e=e.slice?e.slice(r,a):Array.prototype.slice.call(e,r,a)),t.set(e,n)}var s={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&a])}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],p=[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],f=[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],y=[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],g=[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],_=[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],x=[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],T=[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],S=[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]=i[t],this._Kd[e-n][t%4]=i[t];for(var o,s=0,c=a;c>16&255]<<24^d[o>>8&255]<<16^d[255&o]<<8^d[o>>24&255]^l[s]<<24,s+=1,8!=a)for(t=1;t>8&255]<<8^d[o>>16&255]<<16^d[o>>24&255]<<24;for(t=a/2+1;t>2,f=c%4,this._Ke[p][f]=i[t],this._Kd[e-p][f]=i[t++],c++}for(var p=1;p>24&255]^x[o>>16&255]^T[o>>8&255]^S[255&o]},E.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),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var o=1;o>24&255]^h[r[(a+1)%4]>>16&255]^m[r[(a+2)%4]>>8&255]^y[255&r[(a+3)%4]]^this._Ke[o][a];r=n.slice()}var s,c=i(16);for(a=0;a<4;a++)s=this._Ke[t][a],c[4*a]=255&(d[r[a]>>24&255]^s>>24),c[4*a+1]=255&(d[r[(a+1)%4]>>16&255]^s>>16),c[4*a+2]=255&(d[r[(a+2)%4]>>8&255]^s>>8),c[4*a+3]=255&(d[255&r[(a+3)%4]]^s);return c},E.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),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var o=1;o>24&255]^b[r[(a+3)%4]>>16&255]^v[r[(a+2)%4]>>8&255]^w[255&r[(a+1)%4]]^this._Kd[o][a];r=n.slice()}var s,c=i(16);for(a=0;a<4;a++)s=this._Kd[t][a],c[4*a]=255&(p[r[a]>>24&255]^s>>24),c[4*a+1]=255&(p[r[(a+3)%4]>>16&255]^s>>16),c[4*a+2]=255&(p[r[(a+2)%4]>>8&255]^s>>8),c[4*a+3]=255&(p[255&r[(a+1)%4]]^s);return c};var A=function(e){if(!(this instanceof A))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new E(e)};A.prototype.encrypt=function(e){if((e=a(e)).length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),n=i(16),r=0;r=0;--t)this._counter[t]=e%256,e>>=8},R.prototype.setBytes=function(e){if(16!=(e=a(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 I=function(e,t){if(!(this instanceof I))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 E(e)};I.prototype.encrypt=function(e){for(var t=a(e,!0),n=0;n16)throw new Error("PKCS#7 padding byte out of range");for(var n=e.length-t,r=0;r0?o-4:o;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(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,a=r%3,i=[],o=16383,s=0,c=r-a;sc?c:s+o));1===a?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],a="undefined"!==typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=i.length;o0)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 a,i,o=[],s=t;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.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 o(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=i(t)^r>>5}for(t=i(t),n=0;nt)return"Exceeds length limit";var r=e.toLowerCase(),a=e.toUpperCase();if(e!==r&&e!==a)return"Mixed-case string "+e;var s=(e=r).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var c=e.slice(0,s),u=e.slice(s+1);if(u.length<6)return"Data too short";var l=o(c);if("string"===typeof l)return l;for(var d=[],p=0;p=u.length||d.push(h)}return 1!==l?"Invalid checksum for "+e:{prefix:c,words:d}}function c(e,t,n,r){for(var a=0,i=0,o=(1<=n;)i-=n,s.push(a>>i&o);if(r)i>0&&s.push(a<=t)return"Excess padding";if(a<r)throw new TypeError("Exceeds length limit");var a=o(e=e.toLowerCase());if("string"===typeof a)throw new Error(a);for(var s=e+"1",c=0;c>5!==0)throw new Error("Non 5-bit word");a=i(a)^u,s+=t.charAt(u)}for(c=0;c<6;++c)a=i(a);for(a^=1,c=0;c<6;++c){s+=t.charAt(a>>5*(5-c)&31)}return s},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)}}},13550:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.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 o;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(46601).Buffer}catch(k){}function s(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=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,r){for(var a=0,i=Math.min(e.length,n),o=t;o=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(a=0,i=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.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)a=c(e,t,r)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=t)r++;r--,a=a/t|0;for(var i=e.length-n,o=i%r,s=Math.min(i,i-o)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};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],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,s=67108863&o,c=o/67108864|0;n.words[0]=s;for(var u=1;u>>26,d=67108863&c,p=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=p;f++){var h=u-f|0;l+=(o=(a=0|e.words[h])*(i=0|t.words[f])+d)/67108864|0,d=67108863&o}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var a=0,i=0,o=0;o>>24-a&16777215)||o!==this.length-1?l[6-c.length]+c+n:c+n,(a+=2)>=26&&(a-=26,o--)}for(0!==i&&(n=i.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],f=p[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modn(f).toString(e);n=(h=h.idivn(f)).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")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var a=this.byteLength(),i=n||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var o,s,c="le"===t,u=new e(i),l=this.clone();if(c){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),u[s]=o;for(;s=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},i.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},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,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)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,a=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 a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=n.length,0!==a)this.words[this.length]=a,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,f=0|o[1],h=8191&f,m=f>>>13,y=0|o[2],g=8191&y,b=y>>>13,v=0|o[3],w=8191&v,_=v>>>13,x=0|o[4],T=8191&x,S=x>>>13,k=0|o[5],E=8191&k,A=k>>>13,O=0|o[6],C=8191&O,P=O>>>13,R=0|o[7],I=8191&R,D=R>>>13,j=0|o[8],M=8191&j,N=j>>>13,L=0|o[9],B=8191&L,Z=L>>>13,U=0|s[0],F=8191&U,z=U>>>13,G=0|s[1],H=8191&G,W=G>>>13,V=0|s[2],q=8191&V,$=V>>>13,Y=0|s[3],K=8191&Y,Q=Y>>>13,X=0|s[4],J=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ae=0|s[6],ie=8191&ae,oe=ae>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],de=8191&le,pe=le>>>13,fe=0|s[9],he=8191&fe,me=fe>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(u+(r=Math.imul(d,F))|0)+((8191&(a=(a=Math.imul(d,z))+Math.imul(p,F)|0))<<13)|0;u=((i=Math.imul(p,z))+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(h,F),a=(a=Math.imul(h,z))+Math.imul(m,F)|0,i=Math.imul(m,z);var ge=(u+(r=r+Math.imul(d,H)|0)|0)+((8191&(a=(a=a+Math.imul(d,W)|0)+Math.imul(p,H)|0))<<13)|0;u=((i=i+Math.imul(p,W)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,F),a=(a=Math.imul(g,z))+Math.imul(b,F)|0,i=Math.imul(b,z),r=r+Math.imul(h,H)|0,a=(a=a+Math.imul(h,W)|0)+Math.imul(m,H)|0,i=i+Math.imul(m,W)|0;var be=(u+(r=r+Math.imul(d,q)|0)|0)+((8191&(a=(a=a+Math.imul(d,$)|0)+Math.imul(p,q)|0))<<13)|0;u=((i=i+Math.imul(p,$)|0)+(a>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,F),a=(a=Math.imul(w,z))+Math.imul(_,F)|0,i=Math.imul(_,z),r=r+Math.imul(g,H)|0,a=(a=a+Math.imul(g,W)|0)+Math.imul(b,H)|0,i=i+Math.imul(b,W)|0,r=r+Math.imul(h,q)|0,a=(a=a+Math.imul(h,$)|0)+Math.imul(m,q)|0,i=i+Math.imul(m,$)|0;var ve=(u+(r=r+Math.imul(d,K)|0)|0)+((8191&(a=(a=a+Math.imul(d,Q)|0)+Math.imul(p,K)|0))<<13)|0;u=((i=i+Math.imul(p,Q)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(T,F),a=(a=Math.imul(T,z))+Math.imul(S,F)|0,i=Math.imul(S,z),r=r+Math.imul(w,H)|0,a=(a=a+Math.imul(w,W)|0)+Math.imul(_,H)|0,i=i+Math.imul(_,W)|0,r=r+Math.imul(g,q)|0,a=(a=a+Math.imul(g,$)|0)+Math.imul(b,q)|0,i=i+Math.imul(b,$)|0,r=r+Math.imul(h,K)|0,a=(a=a+Math.imul(h,Q)|0)+Math.imul(m,K)|0,i=i+Math.imul(m,Q)|0;var we=(u+(r=r+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(p,J)|0))<<13)|0;u=((i=i+Math.imul(p,ee)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,F),a=(a=Math.imul(E,z))+Math.imul(A,F)|0,i=Math.imul(A,z),r=r+Math.imul(T,H)|0,a=(a=a+Math.imul(T,W)|0)+Math.imul(S,H)|0,i=i+Math.imul(S,W)|0,r=r+Math.imul(w,q)|0,a=(a=a+Math.imul(w,$)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,$)|0,r=r+Math.imul(g,K)|0,a=(a=a+Math.imul(g,Q)|0)+Math.imul(b,K)|0,i=i+Math.imul(b,Q)|0,r=r+Math.imul(h,J)|0,a=(a=a+Math.imul(h,ee)|0)+Math.imul(m,J)|0,i=i+Math.imul(m,ee)|0;var _e=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(a=(a=a+Math.imul(d,re)|0)+Math.imul(p,ne)|0))<<13)|0;u=((i=i+Math.imul(p,re)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(C,F),a=(a=Math.imul(C,z))+Math.imul(P,F)|0,i=Math.imul(P,z),r=r+Math.imul(E,H)|0,a=(a=a+Math.imul(E,W)|0)+Math.imul(A,H)|0,i=i+Math.imul(A,W)|0,r=r+Math.imul(T,q)|0,a=(a=a+Math.imul(T,$)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,$)|0,r=r+Math.imul(w,K)|0,a=(a=a+Math.imul(w,Q)|0)+Math.imul(_,K)|0,i=i+Math.imul(_,Q)|0,r=r+Math.imul(g,J)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(b,J)|0,i=i+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,a=(a=a+Math.imul(h,re)|0)+Math.imul(m,ne)|0,i=i+Math.imul(m,re)|0;var xe=(u+(r=r+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,oe)|0)+Math.imul(p,ie)|0))<<13)|0;u=((i=i+Math.imul(p,oe)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(I,F),a=(a=Math.imul(I,z))+Math.imul(D,F)|0,i=Math.imul(D,z),r=r+Math.imul(C,H)|0,a=(a=a+Math.imul(C,W)|0)+Math.imul(P,H)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(E,q)|0,a=(a=a+Math.imul(E,$)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,$)|0,r=r+Math.imul(T,K)|0,a=(a=a+Math.imul(T,Q)|0)+Math.imul(S,K)|0,i=i+Math.imul(S,Q)|0,r=r+Math.imul(w,J)|0,a=(a=a+Math.imul(w,ee)|0)+Math.imul(_,J)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(g,ne)|0,a=(a=a+Math.imul(g,re)|0)+Math.imul(b,ne)|0,i=i+Math.imul(b,re)|0,r=r+Math.imul(h,ie)|0,a=(a=a+Math.imul(h,oe)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,oe)|0;var Te=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(a=(a=a+Math.imul(d,ue)|0)+Math.imul(p,ce)|0))<<13)|0;u=((i=i+Math.imul(p,ue)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(M,F),a=(a=Math.imul(M,z))+Math.imul(N,F)|0,i=Math.imul(N,z),r=r+Math.imul(I,H)|0,a=(a=a+Math.imul(I,W)|0)+Math.imul(D,H)|0,i=i+Math.imul(D,W)|0,r=r+Math.imul(C,q)|0,a=(a=a+Math.imul(C,$)|0)+Math.imul(P,q)|0,i=i+Math.imul(P,$)|0,r=r+Math.imul(E,K)|0,a=(a=a+Math.imul(E,Q)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,Q)|0,r=r+Math.imul(T,J)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,ee)|0,r=r+Math.imul(w,ne)|0,a=(a=a+Math.imul(w,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,oe)|0,r=r+Math.imul(h,ce)|0,a=(a=a+Math.imul(h,ue)|0)+Math.imul(m,ce)|0,i=i+Math.imul(m,ue)|0;var Se=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,pe)|0)+Math.imul(p,de)|0))<<13)|0;u=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(B,F),a=(a=Math.imul(B,z))+Math.imul(Z,F)|0,i=Math.imul(Z,z),r=r+Math.imul(M,H)|0,a=(a=a+Math.imul(M,W)|0)+Math.imul(N,H)|0,i=i+Math.imul(N,W)|0,r=r+Math.imul(I,q)|0,a=(a=a+Math.imul(I,$)|0)+Math.imul(D,q)|0,i=i+Math.imul(D,$)|0,r=r+Math.imul(C,K)|0,a=(a=a+Math.imul(C,Q)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,Q)|0,r=r+Math.imul(E,J)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(T,ne)|0,a=(a=a+Math.imul(T,re)|0)+Math.imul(S,ne)|0,i=i+Math.imul(S,re)|0,r=r+Math.imul(w,ie)|0,a=(a=a+Math.imul(w,oe)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,oe)|0,r=r+Math.imul(g,ce)|0,a=(a=a+Math.imul(g,ue)|0)+Math.imul(b,ce)|0,i=i+Math.imul(b,ue)|0,r=r+Math.imul(h,de)|0,a=(a=a+Math.imul(h,pe)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,pe)|0;var ke=(u+(r=r+Math.imul(d,he)|0)|0)+((8191&(a=(a=a+Math.imul(d,me)|0)+Math.imul(p,he)|0))<<13)|0;u=((i=i+Math.imul(p,me)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(B,H),a=(a=Math.imul(B,W))+Math.imul(Z,H)|0,i=Math.imul(Z,W),r=r+Math.imul(M,q)|0,a=(a=a+Math.imul(M,$)|0)+Math.imul(N,q)|0,i=i+Math.imul(N,$)|0,r=r+Math.imul(I,K)|0,a=(a=a+Math.imul(I,Q)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,Q)|0,r=r+Math.imul(C,J)|0,a=(a=a+Math.imul(C,ee)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(E,ne)|0,a=(a=a+Math.imul(E,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,oe)|0,r=r+Math.imul(w,ce)|0,a=(a=a+Math.imul(w,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,r=r+Math.imul(g,de)|0,a=(a=a+Math.imul(g,pe)|0)+Math.imul(b,de)|0,i=i+Math.imul(b,pe)|0;var Ee=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(a=(a=a+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;u=((i=i+Math.imul(m,me)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(B,q),a=(a=Math.imul(B,$))+Math.imul(Z,q)|0,i=Math.imul(Z,$),r=r+Math.imul(M,K)|0,a=(a=a+Math.imul(M,Q)|0)+Math.imul(N,K)|0,i=i+Math.imul(N,Q)|0,r=r+Math.imul(I,J)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(D,J)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(C,ne)|0,a=(a=a+Math.imul(C,re)|0)+Math.imul(P,ne)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,oe)|0,r=r+Math.imul(T,ce)|0,a=(a=a+Math.imul(T,ue)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,r=r+Math.imul(w,de)|0,a=(a=a+Math.imul(w,pe)|0)+Math.imul(_,de)|0,i=i+Math.imul(_,pe)|0;var Ae=(u+(r=r+Math.imul(g,he)|0)|0)+((8191&(a=(a=a+Math.imul(g,me)|0)+Math.imul(b,he)|0))<<13)|0;u=((i=i+Math.imul(b,me)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(B,K),a=(a=Math.imul(B,Q))+Math.imul(Z,K)|0,i=Math.imul(Z,Q),r=r+Math.imul(M,J)|0,a=(a=a+Math.imul(M,ee)|0)+Math.imul(N,J)|0,i=i+Math.imul(N,ee)|0,r=r+Math.imul(I,ne)|0,a=(a=a+Math.imul(I,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(C,ie)|0,a=(a=a+Math.imul(C,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(E,ce)|0,a=(a=a+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,i=i+Math.imul(A,ue)|0,r=r+Math.imul(T,de)|0,a=(a=a+Math.imul(T,pe)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,pe)|0;var Oe=(u+(r=r+Math.imul(w,he)|0)|0)+((8191&(a=(a=a+Math.imul(w,me)|0)+Math.imul(_,he)|0))<<13)|0;u=((i=i+Math.imul(_,me)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(B,J),a=(a=Math.imul(B,ee))+Math.imul(Z,J)|0,i=Math.imul(Z,ee),r=r+Math.imul(M,ne)|0,a=(a=a+Math.imul(M,re)|0)+Math.imul(N,ne)|0,i=i+Math.imul(N,re)|0,r=r+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,oe)|0,r=r+Math.imul(C,ce)|0,a=(a=a+Math.imul(C,ue)|0)+Math.imul(P,ce)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(E,de)|0,a=(a=a+Math.imul(E,pe)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,pe)|0;var Ce=(u+(r=r+Math.imul(T,he)|0)|0)+((8191&(a=(a=a+Math.imul(T,me)|0)+Math.imul(S,he)|0))<<13)|0;u=((i=i+Math.imul(S,me)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,ne),a=(a=Math.imul(B,re))+Math.imul(Z,ne)|0,i=Math.imul(Z,re),r=r+Math.imul(M,ie)|0,a=(a=a+Math.imul(M,oe)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,oe)|0,r=r+Math.imul(I,ce)|0,a=(a=a+Math.imul(I,ue)|0)+Math.imul(D,ce)|0,i=i+Math.imul(D,ue)|0,r=r+Math.imul(C,de)|0,a=(a=a+Math.imul(C,pe)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,pe)|0;var Pe=(u+(r=r+Math.imul(E,he)|0)|0)+((8191&(a=(a=a+Math.imul(E,me)|0)+Math.imul(A,he)|0))<<13)|0;u=((i=i+Math.imul(A,me)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(B,ie),a=(a=Math.imul(B,oe))+Math.imul(Z,ie)|0,i=Math.imul(Z,oe),r=r+Math.imul(M,ce)|0,a=(a=a+Math.imul(M,ue)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,ue)|0,r=r+Math.imul(I,de)|0,a=(a=a+Math.imul(I,pe)|0)+Math.imul(D,de)|0,i=i+Math.imul(D,pe)|0;var Re=(u+(r=r+Math.imul(C,he)|0)|0)+((8191&(a=(a=a+Math.imul(C,me)|0)+Math.imul(P,he)|0))<<13)|0;u=((i=i+Math.imul(P,me)|0)+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(B,ce),a=(a=Math.imul(B,ue))+Math.imul(Z,ce)|0,i=Math.imul(Z,ue),r=r+Math.imul(M,de)|0,a=(a=a+Math.imul(M,pe)|0)+Math.imul(N,de)|0,i=i+Math.imul(N,pe)|0;var Ie=(u+(r=r+Math.imul(I,he)|0)|0)+((8191&(a=(a=a+Math.imul(I,me)|0)+Math.imul(D,he)|0))<<13)|0;u=((i=i+Math.imul(D,me)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,de),a=(a=Math.imul(B,pe))+Math.imul(Z,de)|0,i=Math.imul(Z,pe);var De=(u+(r=r+Math.imul(M,he)|0)|0)+((8191&(a=(a=a+Math.imul(M,me)|0)+Math.imul(N,he)|0))<<13)|0;u=((i=i+Math.imul(N,me)|0)+(a>>>13)|0)+(De>>>26)|0,De&=67108863;var je=(u+(r=Math.imul(B,he))|0)+((8191&(a=(a=Math.imul(B,me))+Math.imul(Z,he)|0))<<13)|0;return u=((i=Math.imul(Z,me))+(a>>>13)|0)+(je>>>26)|0,je&=67108863,c[0]=ye,c[1]=ge,c[2]=be,c[3]=ve,c[4]=we,c[5]=_e,c[6]=xe,c[7]=Te,c[8]=Se,c[9]=ke,c[10]=Ee,c[11]=Ae,c[12]=Oe,c[13]=Ce,c[14]=Pe,c[15]=Re,c[16]=Ie,c[17]=De,c[18]=je,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){return(new y).mulp(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(h=f),i.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?f(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,a=0,i=0;i>>26)|0)>>>26,o&=67108863}n.words[i]=s,r=o,o=a}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):m(this,e,t),n},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,n[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,t+=a/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>a}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,a=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<o)for(this.length-=o,u=0;u=0&&(0!==l||u>=a);u--){var d=0|this.words[u];this.words[u]=l<<26-i|d>>>i,l=d&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,a=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 a=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},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[a+n]=67108863&i}for(;a>26,this.words[a+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!==(n=26-this._countBits(o))&&(a=a.ushln(n),r.iushln(n),o=0|a.words[a.length-1]);var s,c=r.length-a.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var p=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(p=Math.min(p/o|0,67108863),r._ishlnsubmul(a,p,d);0!==r.negative;)p--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=p)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),a=e.andln(1),i=n.cmp(r);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,a=this.length-1;a>=0;a--)n=(t*n+(0|this.words[a]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var a=(0|this.words[n])+67108864*t;this.words[n]=a/e|0,t=a%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),c=new i(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 p=0,f=1;0===(t.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(l),o.isub(d)),a.iushrn(1),o.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;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s),o.isub(c)):(n.isub(t),s.isub(a),c.isub(o))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(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;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var d=0,p=1;0===(n.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.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 a=t.cmp(n);if(a<0){var i=t;t=n,n=i}else if(0===a||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:ae.length)return 1;if(this.length=0;n--){var r=0|this.words[n],a=0|e.words[n];if(r!==a){ra&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new T(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function 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 _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new i(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)},a(v,b),v.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),a=0;a>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&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]=a,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return g[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):e.umod(this.m)._forceRed(this)},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 i(1)).iushrn(2);return this.pow(e,n)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);r(!a.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,a),p=this.pow(e,a.addn(1).iushrn(1)),f=this.pow(e,a),h=o;0!==f.cmp(s);){for(var m=f,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===l)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}c=26}return a},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},i.mont=function(e){return new S(e)},a(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),a=n.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},48764:function(e,t,n){"use strict";var r=n(79742),a=n(80645),i="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 o=2147483647;function s(e){if(e>o)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=s(n),a=r.write(e,t);a!==n&&(r=r.slice(0,a));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(F(e,Uint8Array)){var t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return p(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(F(e,ArrayBuffer)||e&&F(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(F(e,SharedArrayBuffer)||e&&F(e.buffer,SharedArrayBuffer)))return f(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 a=function(e){if(c.isBuffer(e)){var t=0|h(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||z(e.length)?s(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(a)return a;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),s(e<0?0:0|h(e))}function p(e){for(var t=e.length<0?0:0|h(e.length),n=s(t),r=0;r=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||F(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 a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(e).length;default:if(a)return r?-1:B(e).length;t=(""+t).toLowerCase(),a=!0}}function y(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 P(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return C(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 g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,a){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)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,a);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,a){var i,o=1,s=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;o=2,s/=2,c/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var l=-1;for(i=n;is&&(n=s-c),i=n;i>=0;i--){for(var d=!0,p=0;pa&&(r=a):r=a;var i=t.length;r>i/2&&(r=i/2);for(var o=0;o>8,a=n%256,i.push(a),i.push(r);return i}(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 E(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a239?4:u>223?3:u>191?2:1;if(a+d<=n)switch(d){case 1:u<128&&(l=u);break;case 2:128===(192&(i=e[a+1]))&&(c=(31&u)<<6|63&i)>127&&(l=c);break;case 3:i=e[a+1],o=e[a+2],128===(192&i)&&128===(192&o)&&(c=(15&u)<<12|(63&i)<<6|63&o)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=e[a+1],o=e[a+2],s=e[a+3],128===(192&i)&&128===(192&o)&&128===(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>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),a+=d}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?c.from(i).copy(r,a):Uint8Array.prototype.set.call(r,i,a);else{if(!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,a)}a+=i.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+=" ... "),""},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,a){if(F(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===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(a>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(i,o),u=this.slice(r,a),l=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":case"latin1":case"binary":return x(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function O(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;ar)&&(n=r);for(var a="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,a,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function j(e,t,n,r,a,i){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,i){return t=+t,n>>>=0,i||j(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,8),a.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||I(e,t,this.length);for(var r=this[e],a=1,i=0;++i>>=0,t>>>=0,n||I(e,t,this.length);for(var r=this[e+--t],a=1;t>0&&(a*=256);)r+=this[e+--t]*a;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(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||I(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||I(e,t,this.length);for(var r=this[e],a=1,i=0;++i=(a*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);for(var r=t,a=1,i=this[e+--r];r>0&&(a*=256);)i+=this[e+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||I(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||I(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||I(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||I(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||I(e,4,this.length),a.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),a.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),a.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),a.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var a=n-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(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||D(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||D(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||D(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||D(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 a=Math.pow(2,8*n-1);D(this,e,t,n,a-1,-a)}var 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){var a=Math.pow(2,8*n-1);D(this,e,t,n,a-1,-a)}var 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||D(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||D(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||D(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||D(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||D(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(i=t;i55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.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;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function Z(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function U(e,t,n,r){for(var a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function F(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!==e}var G=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,a=0;a<16;++a)t[r+a]=e[n]+e[a];return t}()},86010:function(e,t,n){"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=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:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),a=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(a,2,"0")},m:function e(t,n){if(t.date()1)return e(o[0])}else{var s=t.name;w[s]=t,a=s}return!r&&a&&(v=a),a||!r&&v},T=function(e,t){if(_(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new k(n)},S=b;S.l=x,S.i=_,S.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function y(e){this.$L=x(e.locale,null,!0),this.parse(e)}var g=y.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(S.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 a=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},g.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()},g.$utils=function(){return S},g.isValid=function(){return!(this.$d.toString()===f)},g.isSame=function(e,t){var n=T(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return T(e)>19^e^e>>8,(i[3]>>>0)/(1<<31>>>0)}function s(){return[Math.floor(360*o())/360,(60*o()+40)/100,25*(o()+o()+o()+o())/100]}function c(e,t,n,r,a,i){for(let o=0;o>24&255,e>>16&255,e>>8&255,255&e)}function i(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 o=new Array,s=0;s>8&255,255&c))),s=0;(s<<16)-1>1&2147483647:p>>1&2147483647;o[s]=p}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 a=(((r=r>=0?r:255)<<8|e)<<8|t)<<8|n;if("undefined"==typeof this.palette[a]){if(this.pindex==this.depth)return"\0";var i=this.plte_offs+8+3*this.pindex;this.buffer[i+0]=String.fromCharCode(e),this.buffer[i+1]=String.fromCharCode(t),this.buffer[i+2]=String.fromCharCode(n),this.buffer[this.trns_offs+8+this.pindex]=String.fromCharCode(r),this.palette[a]=String.fromCharCode(this.pindex++)}return this.palette[a]},this.getBase64=function(){var e,t,n,r,a,i,o,s=this.getDump(),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=s.length,l=0,d="";do{r=(e=s.charCodeAt(l))>>2,a=(3&e)<<4|(t=s.charCodeAt(l+1))>>4,n=s.charCodeAt(l+2),i=u>6,o=u>8&16777215;r(e,t+n-4,a(-1^i))}return t%=e,n%=e,r(this.buffer,this.idat_offs+this.idat_size-8,a(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 a,i,o;if(0==t)a=i=o=r;else{const s=r<.5?r*(1+t):r+t-r*t,c=2*r-s;a=n(c,s,e+1/3),i=n(c,s,e),o=n(c,s,e-1/3)}return[Math.round(255*a),Math.round(255*i),Math.round(255*o),255]}}])},e.exports=t()},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 o.E},Wallet:function(){return s.Wallet},VoidSigner:function(){return o.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 a.O$},FixedNumber:function(){return i.xs},constants:function(){return c},errors:function(){return f.ErrorCode},logger:function(){return m},utils:function(){return p},wordlists:function(){return l.E},version:function(){return h.i},Wordlist:function(){return d.D}});var r=n(64146),a=n(2593),i=n(20335),o=n(48088),s=n(79911),c=n(21815),u=n(24946),l=n(10234),d=n(48812),p=n(86494),f=n(1581),h=n(62863);const m=new f.Logger(h.i)},86623:function(e,t,n){"use strict";n.r(t),n.d(t,{ethers:function(){return r},Signer:function(){return a.E},Wallet:function(){return i.Wallet},VoidSigner:function(){return a.b},getDefaultProvider:function(){return o.getDefaultProvider},providers:function(){return o},BaseContract:function(){return s.VZ},Contract:function(){return s.CH},ContractFactory:function(){return s.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 p},wordlists:function(){return f.E},version:function(){return h.i},Wordlist:function(){return m.D}});var r=n(91023),a=n(48088),i=n(79911),o=n(24946),s=n(64146),c=n(2593),u=n(20335),l=n(21815),d=n(1581),p=n(86494),f=n(10234),h=n(62863),m=n(48812);try{const e=window;null==e._ethers&&(e._ethers=r)}catch(y){}},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 a.HY},ConstructorFragment:function(){return a.Xg},ErrorFragment:function(){return a.IC},EventFragment:function(){return a.QV},FunctionFragment:function(){return a.YW},ParamType:function(){return a._R},FormatTypes:function(){return a.pc},checkResultErrors:function(){return i.BR},Logger:function(){return b.Logger},RLP:function(){return S},_fetchData:function(){return I._fetchData},fetchJson:function(){return I.fetchJson},poll:function(){return I.poll},checkProperties:function(){return T.checkProperties},deepCopy:function(){return T.deepCopy},defineReadOnly:function(){return T.defineReadOnly},getStatic:function(){return T.getStatic},resolveProperties:function(){return T.resolveProperties},shallowCopy:function(){return T.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 o.vU},LogDescription:function(){return o.CC},TransactionDescription:function(){return o.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 E.Ll},_toEscapedUtf8String:function(){return A.U$},toUtf8Bytes:function(){return A.Y0},toUtf8CodePoints:function(){return A.XL},toUtf8String:function(){return A.ZN},Utf8ErrorFuncs:function(){return A.te},formatBytes32String:function(){return O.s},parseBytes32String:function(){return O.F},hashMessage:function(){return d.r},namehash:function(){return p.V},isValidName:function(){return p.r},id:function(){return f.id},_TypedDataEncoder:function(){return h.E},getAddress:function(){return s.getAddress},getIcapAddress:function(){return s.getIcapAddress},getContractAddress:function(){return s.getContractAddress},getCreate2Address:function(){return s.getCreate2Address},isAddress:function(){return s.isAddress},formatEther:function(){return P.formatEther},parseEther:function(){return P.parseEther},formatUnits:function(){return P.formatUnits},parseUnits:function(){return P.parseUnits},commify:function(){return P.commify},computeHmac:function(){return v.Gy},keccak256:function(){return g.keccak256},ripemd160:function(){return v.bP},sha256:function(){return v.JQ},sha512:function(){return v.o},randomBytes:function(){return _.O},shuffled:function(){return x.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 C.accessListify},parseTransaction:function(){return C.parse},serializeTransaction:function(){return C.serialize},TransactionTypes:function(){return C.TransactionTypes},getJsonWalletAddress:function(){return y.Rb},computeAddress:function(){return C.computeAddress},recoverAddress:function(){return C.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 D.p},UnicodeNormalizationForm:function(){return A.Uj},Utf8ErrorReason:function(){return A.Uw},Indexed:function(){return o.Hk}});var r=n(84243),a=n(11388),i=n(61184),o=n(8198),s=n(19485),c=n(4089),u=n(57727),l=n(16441),d=n(93684),p=n(84706),f=n(32046),h=n(67827),m=n(84178),y=n(67949),g=n(38197),b=n(1581),v=n(2006),w=n(31886),_=n(5634),x=n(52472),T=n(6881),S=n(59052),k=n(67669),E=n(35637),A=n(29251),O=n(86237),C=n(83875),P=n(61744),R=n(79911),I=n(37707),D=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]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=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 a(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 o=n(83893);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return o.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return o.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return o.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return o.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return o.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return o.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return o.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return o.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return o.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return o.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return o.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return o.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return o.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return o.TransactionDescription}});var s=n(19485);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return s.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return s.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return s.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return s.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}});var c=i(n(4089));t.base64=c;var u=n(57727);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return u.Base58}});var l=n(16441);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 p=n(84178);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return p.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return p.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return p.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return p.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return p.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return p.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return p.mnemonicToSeed}});var f=n(64341);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return f.getJsonWalletAddress}});var h=n(38197);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 y=n(91278);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return y.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return y.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return y.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return y.sha512}});var g=n(31886);Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return g.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return g.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return g.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=i(n(59052));t.RLP=w;var _=n(67669);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return _.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return _.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return _.SigningKey}});var x=n(62741);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return x.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return x.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return x.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return x._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return x.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return x.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return x.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return x.Utf8ErrorFuncs}});var T=n(83875);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return T.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return T.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return T.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return T.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return T.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return T.TransactionTypes}});var S=n(61744);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return S.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return S.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return S.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return S.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return S.parseUnits}});var k=n(79911);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return k.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return k.verifyTypedData}});var E=n(37707);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return E._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return E.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return E.poll}});var A=n(91278);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return A.SupportedAlgorithm}});var O=n(62741);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return O.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return O.Utf8ErrorReason}})},17187:function(e){"use strict";var t,n="object"===typeof Reflect?Reflect:null,r=n&&"function"===typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"===typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!==e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function a(n){e.removeListener(t,i),r(n)}function i(){"function"===typeof e.removeListener&&e.removeListener("error",a),n([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"===typeof e.on&&m(e,"error",t,n)}(e,a,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function u(e,t,n,r){var a,i,o,u;if(s(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),o=i[t]),void 0===o)o=i[t]=n,++e._eventsCount;else if("function"===typeof o?o=i[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(a=c(e))>0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.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},a=l.bind(r);return a.listener=n,r.wrapFn=a,a}function p(e,t,n){var r=e._events;if(void 0===r)return[];var a=r[t];return void 0===a?[]:"function"===typeof a?n?[a.listener||a]:[a]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=i[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;i--)if(n[i]===t||n[i].listener===t){o=n[i].listener,a=i;break}if(a<0)return this;0===a?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.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),a=n(79746);function i(){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=i,i.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 a=0;a>>24&255,r[a++]=e>>>16&255,r[a++]=e>>>8&255,r[a++]=255&e}else for(r[a++]=255&e,r[a++]=e>>>8&255,r[a++]=e>>>16&255,r[a++]=e>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;ithis.blockSize&&(e=(new this.Hash).update(e).digest()),a(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),a=n(35717);function i(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(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=a,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),a=0;a>6|192,n[r++]=63&o|128):i(e,a)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++a)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(a=0;a>>0}return o},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,a=0;r>>24,n[a+1]=i>>>16&255,n[a+2]=i>>>8&255,n[a+3]=255&i):(n[a+3]=i>>>24,n[a+2]=i>>>16&255,n[a+1]=i>>>8&255,n[a]=255&i)}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,a){return e+t+n+r+a>>>0},t.sum64=function(e,t,n,r){var a=e[t],i=r+e[t+1]>>>0,o=(i>>0,e[t+1]=i},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,a,i,o,s){var c=0,u=t;return c+=(u=u+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,a,i,o,s){return t+r+i+s>>>0},t.sum64_5_hi=function(e,t,n,r,a,i,o,s,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,a,i,o,s,c,u){return t+r+i+s+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),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?o:s[e.$$typeof]||a}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=o;var u=Object.defineProperty,l=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var a=f(n);a&&a!==h&&e(t,a,r)}var o=l(n);d&&(o=o.concat(d(n)));for(var s=c(t),m=c(n),y=0;y>1,l=-7,d=n?a-1:0,p=n?-1:1,f=e[t+d];for(d+=p,i=f&(1<<-l)-1,f>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=p,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=r;l>0;o=256*o+e[t+d],d+=p,l-=8);if(0===i)i=1-u;else{if(i===c)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),i-=u}return(f?-1:1)*o*Math.pow(2,i-r)},t.write=function(e,t,n,r,a,i){var o,s,c,u=8*i-a-1,l=(1<>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:i-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?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?p/c:p*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=l?(s=0,o=l):o+d>=1?(s=(t*c-1)*Math.pow(2,a),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,a),o=0));a>=8;e[n+f]=255&s,f+=h,s/=256,a-=8);for(o=o<0;e[n+f]=255&o,f+=h,o/=256,u-=8);e[n+f-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}}},91094:function(e,t,n){var r,a=n(83454);!function(){"use strict";var i="input is invalid type",o="object"===typeof window,s=o?window:{};s.JS_SHA3_NO_WINDOW&&(o=!1);var c=!o&&"object"===typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"===typeof a&&a.versions&&a.versions.node?s=n.g:c&&(s=self);var u=!s.JS_SHA3_NO_COMMON_JS&&e.exports,l=n.amdO,d=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,p="0123456789abcdef".split(""),f=[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],y=[224,256,384,512],g=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!d||!s.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]()}},_=function(e,t,n){return function(r,a){return new M(e,t,a).update(r)[n]()}},x=function(e,t,n){return function(t,r,a,i){return A["cshake"+e].update(t,r,a,i)[n]()}},T=function(e,t,n){return function(t,r,a,i){return A["kmac"+e].update(t,r,a,i)[n]()}},S=function(e,t,n,r){for(var a=0;a>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(i);if(null===e)throw new Error(i);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!d||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var r,a,o=this.blocks,s=this.byteCount,c=e.length,u=this.blockCount,l=0,p=this.s;l>2]|=e[l]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(o[r>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=s){for(this.start=r-s,this.block=o[u],r=0;r>=8);n>0;)a.unshift(n),n=255&(e>>=8),++r;return t?a.push(r):a.unshift(r),this.update(a),a.length},M.prototype.encodeString=function(e){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(i);if(null===e)throw new Error(i);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!d||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}var r=0,a=e.length;if(t)r=a;else for(var o=0;o=57344?r+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),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]+p[15&e]+p[e>>12&15]+p[e>>8&15]+p[e>>20&15]+p[e>>16&15]+p[e>>28&15]+p[e>>24&15];o%t===0&&(L(n),i=0)}return a&&(e=n[i],s+=p[e>>4&15]+p[15&e],a>1&&(s+=p[e>>12&15]+p[e>>8&15]),a>2&&(s+=p[e>>20&15]+p[e>>16&15])),s},M.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,a=this.extraBytes,i=0,o=0,s=this.outputBits>>3;e=a?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);o>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%n===0&&L(r)}return i&&(e=s<<2,t=r[o],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>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 L=function(e){var t,n,r,a,i,o,s,c,u,l,d,p,f,h,y,g,b,v,w,_,x,T,S,k,E,A,O,C,P,R,I,D,j,M,N,L,B,Z,U,F,z,G,H,W,V,q,$,Y,K,Q,X,J,ee,te,ne,re,ae,ie,oe,se,ce,ue,le;for(r=0;r<48;r+=2)a=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],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=(p=e[8]^e[18]^e[28]^e[38]^e[48])^(o<<1|s>>>31),n=(f=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>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=a^(c<<1|u>>>31),n=i^(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=o^(l<<1|d>>>31),n=s^(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^(p<<1|f>>>31),n=u^(f<<1|p>>>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^(a<<1|i>>>31),n=d^(i<<1|a>>>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],y=e[1],q=e[11]<<4|e[10]>>>28,$=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,M=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,K=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,I=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,L=e[14]<<6|e[15]>>>26,B=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Q=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,D=e[45]<<29|e[44]>>>3,j=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,E=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ae=e[16]<<23|e[17]>>>9,Z=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,J=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,A=e[18]<<20|e[19]>>>12,O=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,F=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,T=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=h^~g&v,e[1]=y^~b&w,e[10]=k^~A&C,e[11]=E^~O&P,e[20]=M^~L&Z,e[21]=N^~B&U,e[30]=W^~q&Y,e[31]=V^~$&K,e[40]=te^~re&ie,e[41]=ne^~ae&oe,e[2]=g^~v&_,e[3]=b^~w&x,e[12]=A^~C&R,e[13]=O^~P&I,e[22]=L^~Z&F,e[23]=B^~U&z,e[32]=q^~Y&Q,e[33]=$^~K&X,e[42]=re^~ie&se,e[43]=ae^~oe&ce,e[4]=v^~_&T,e[5]=w^~x&S,e[14]=C^~R&D,e[15]=P^~I&j,e[24]=Z^~F&G,e[25]=U^~z&H,e[34]=Y^~Q&J,e[35]=K^~X&ee,e[44]=ie^~se&ue,e[45]=oe^~ce&le,e[6]=_^~T&h,e[7]=x^~S&y,e[16]=R^~D&k,e[17]=I^~j&E,e[26]=F^~G&M,e[27]=z^~H&N,e[36]=Q^~J&W,e[37]=X^~ee&V,e[46]=se^~ue&te,e[47]=ce^~le&ne,e[8]=T^~h&g,e[9]=S^~y&b,e[18]=D^~k&A,e[19]=j^~E&O,e[28]=G^~M&L,e[29]=H^~N&B,e[38]=J^~W&q,e[39]=ee^~V&$,e[48]=ue^~te&re,e[49]=le^~ne&ae,e[0]^=m[r],e[1]^=m[r+1]};if(u)e.exports=A;else{for(C=0;C0){for(t=1,r=1;tfe&&(fe=de,he=[]),he.push(e))}function xe(e,n,r){return new t(t.buildMessage(e,n),e,n,r)}function Te(){var e,t;for(e=[],t=Se();t!==a;)e.push(t),t=Se();return e}function Se(){var t,r,i;if(t=function(){var t,n,r,i;t=de,123===e.charCodeAt(de)?(n=l,de++):(n=a,0===me&&_e(d));n!==a&&Me()!==a&&(r=ke())!==a&&Me()!==a?(125===e.charCodeAt(de)?(i=p,de++):(i=a,0===me&&_e(f)),i!==a?(t,t=n={type:"argument",arg:r}):(de=t,t=a)):(de=t,t=a);return t}(),t===a&&(t=function(){var t,r,i,o,s,c,u,b,v,w;t=de,123===e.charCodeAt(de)?(r=l,de++):(r=a,0===me&&_e(d));if(r!==a)if(Me()!==a)if((i=ke())!==a)if(Me()!==a)if(44===e.charCodeAt(de)?(o=h,de++):(o=a,0===me&&_e(m)),o!==a)if(Me()!==a)if(s=de,e.substr(de,6)===y?(c=y,de+=6):(c=a,0===me&&_e(g)),c!==a&&(s,T=c,n.strict&&Ne.unshift(!1),c=T),(s=c)!==a)if((c=Me())!==a)if(44===e.charCodeAt(de)?(u=h,de++):(u=a,0===me&&_e(m)),u!==a)if(Me()!==a){if(b=[],(v=Ee())!==a)for(;v!==a;)b.push(v),v=Ee();else b=a;b!==a&&(v=Me())!==a?(125===e.charCodeAt(de)?(w=p,de++):(w=a,0===me&&_e(f)),w!==a?(t,_=i,x=b,n.strict&&Ne.shift(),t=r={type:"select",arg:_,cases:x}):(de=t,t=a)):(de=t,t=a)}else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;var _,x;var T;return t}(),t===a&&(t=function(){var t,r,i,o,s,c,u,y,g,x,T;t=de,123===e.charCodeAt(de)?(r=l,de++):(r=a,0===me&&_e(d));if(r!==a)if(Me()!==a)if((i=ke())!==a)if(Me()!==a)if(44===e.charCodeAt(de)?(o=h,de++):(o=a,0===me&&_e(m)),o!==a)if(Me()!==a)if(s=de,e.substr(de,6)===b?(c=b,de+=6):(c=a,0===me&&_e(v)),c===a&&(e.substr(de,13)===w?(c=w,de+=13):(c=a,0===me&&_e(_))),c!==a&&(s,S=c,Ne.unshift(!0),c=S),(s=c)!==a)if((c=Me())!==a)if(44===e.charCodeAt(de)?(u=h,de++):(u=a,0===me&&_e(m)),u!==a)if(Me()!==a)if(y=function(){var t,n,r,i;me++,t=de,Me()!==a?(e.substr(de,6)===A?(n=A,de+=6):(n=a,0===me&&_e(O)),n!==a&&Me()!==a?(58===e.charCodeAt(de)?(r=":",de++):(r=a,0===me&&_e(C)),r!==a&&Me()!==a&&(i=je())!==a&&Me()!==a?(t,t=i):(de=t,t=a)):(de=t,t=a)):(de=t,t=a);me--,t===a&&(a,0===me&&_e(E));return t}(),y===a&&(y=null),y!==a){if(g=[],(x=Ae())!==a)for(;x!==a;)g.push(x),x=Ae();else g=a;g!==a&&(x=Me())!==a?(125===e.charCodeAt(de)?(T=p,de++):(T=a,0===me&&_e(f)),T!==a?(t,t=r=function(e,t,r,a){var i=("selectordinal"===t?n.ordinal:n.cardinal)||["zero","one","two","few","many","other"];return i&&i.length&&a.forEach((function(n){if(isNaN(n.key)&&i.indexOf(n.key)<0)throw new Error("Invalid key `"+n.key+"` for argument `"+e+"`. Valid "+t+" keys for this locale are `"+i.join("`, `")+"`, and explicit keys like `=0`.")})),Ne.shift(),{type:t,arg:e,offset:r||0,cases:a}}(i,s,y,g)):(de=t,t=a)):(de=t,t=a)}else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;else de=t,t=a;var S;return t}(),t===a&&(t=function(){var t,r,i,o,s,c,u;t=de,123===e.charCodeAt(de)?(r=l,de++):(r=a,0===me&&_e(d));r!==a&&Me()!==a&&(i=ke())!==a&&Me()!==a?(44===e.charCodeAt(de)?(o=h,de++):(o=a,0===me&&_e(m)),o!==a&&Me()!==a?(s=function(){var t,r,i,o,s;e.substr(de,6)===R?(t=R,de+=6):(t=a,0===me&&_e(I));t===a&&(e.substr(de,4)===D?(t=D,de+=4):(t=a,0===me&&_e(j)),t===a&&(e.substr(de,4)===M?(t=M,de+=4):(t=a,0===me&&_e(N)),t===a&&(e.substr(de,8)===L?(t=L,de+=8):(t=a,0===me&&_e(B)),t===a&&(e.substr(de,7)===Z?(t=Z,de+=7):(t=a,0===me&&_e(U)),t===a&&(e.substr(de,8)===F?(t=F,de+=8):(t=a,0===me&&_e(z)),t===a&&(t=de,r=de,me++,e.substr(de,6)===y?(i=y,de+=6):(i=a,0===me&&_e(g)),me--,i===a?r=void 0:(de=r,r=a),r!==a?(i=de,me++,e.substr(de,6)===b?(o=b,de+=6):(o=a,0===me&&_e(v)),me--,o===a?i=void 0:(de=i,i=a),i!==a?(o=de,me++,e.substr(de,13)===w?(s=w,de+=13):(s=a,0===me&&_e(_)),me--,s===a?o=void 0:(de=o,o=a),o!==a&&(s=ke())!==a?(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}}(s)?void 0:a)!==a?(t,t=r=s):(de=t,t=a)):(de=t,t=a)):(de=t,t=a)):(de=t,t=a)))))));return t}(),s!==a&&Me()!==a?(c=function(){var t,r,i,o;if(t=de,Me()!==a)if(44===e.charCodeAt(de)?(r=h,de++):(r=a,0===me&&_e(m)),r!==a){for(i=[],o=Se();o!==a;)i.push(o),o=Se();i!==a?(de,(o=(o=!n.strict)?void 0:a)!==a?(t,t={tokens:i}):(de=t,t=a)):(de=t,t=a)}else de=t,t=a;else de=t,t=a;if(t===a)if(t=de,Me()!==a)if(44===e.charCodeAt(de)?(r=h,de++):(r=a,0===me&&_e(m)),r!==a){for(i=[],o=Ce();o!==a;)i.push(o),o=Ce();i!==a?(t,t={tokens:[i.join("")]}):(de=t,t=a)}else de=t,t=a;else de=t,t=a;return t}(),c===a&&(c=null),c!==a?(125===e.charCodeAt(de)?(u=p,de++):(u=a,0===me&&_e(f)),u!==a?(t,t=r={type:"function",arg:i,key:s,param:c}):(de=t,t=a)):(de=t,t=a)):(de=t,t=a)):(de=t,t=a)):(de=t,t=a);return t}(),t===a&&(t=de,35===e.charCodeAt(de)?(r="#",de++):(r=a,0===me&&_e(s)),r!==a?(de,(i=(i=c())?void 0:a)!==a?(t,t=r={type:"octothorpe"}):(de=t,t=a)):(de=t,t=a),t===a))))){if(t=de,r=[],(i=De())!==a)for(;i!==a;)r.push(i),i=De();else r=a;r!==a&&(t,r=u(r)),t=r}return t}function ke(){var t,n,r;if(me++,t=de,n=[],T.test(e.charAt(de))?(r=e.charAt(de),de++):(r=a,0===me&&_e(S)),r!==a)for(;r!==a;)n.push(r),T.test(e.charAt(de))?(r=e.charAt(de),de++):(r=a,0===me&&_e(S));else n=a;return t=n!==a?e.substring(t,de):n,me--,t===a&&(n=a,0===me&&_e(x)),t}function Ee(){var e,t,n;return e=de,Me()!==a&&(t=ke())!==a&&Me()!==a&&(n=Oe())!==a?(e,e=k(t,n)):(de=e,e=a),e}function Ae(){var t,n,r;return t=de,Me()!==a?(n=function(){var t,n,r;(t=ke())===a&&(t=de,61===e.charCodeAt(de)?(n="=",de++):(n=a,0===me&&_e(P)),n!==a&&(r=je())!==a?(t,t=n=r):(de=t,t=a));return t}(),n!==a&&Me()!==a&&(r=Oe())!==a?(t,t=k(n,r)):(de=t,t=a)):(de=t,t=a),t}function Oe(){var t,n,r,i,o,s;if(t=de,123===e.charCodeAt(de)?(n=l,de++):(n=a,0===me&&_e(d)),n!==a)if(r=de,(i=Me())!==a?(o=de,me++,123===e.charCodeAt(de)?(s=l,de++):(s=a,0===me&&_e(d)),me--,s!==a?(de=o,o=void 0):o=a,o!==a?r=i=[i,o]:(de=r,r=a)):(de=r,r=a),r===a&&(r=null),r!==a){for(i=[],o=Se();o!==a;)i.push(o),o=Se();i!==a&&(o=Me())!==a?(125===e.charCodeAt(de)?(s=p,de++):(s=a,0===me&&_e(f)),s!==a?(t,t=n=i):(de=t,t=a)):(de=t,t=a)}else de=t,t=a;else de=t,t=a;return t}function Ce(){var t,n,r,i;if(me++,t=de,n=[],H.test(e.charAt(de))?(r=e.charAt(de),de++):(r=a,0===me&&_e(W)),r!==a)for(;r!==a;)n.push(r),H.test(e.charAt(de))?(r=e.charAt(de),de++):(r=a,0===me&&_e(W));else n=a;if(n!==a&&(t,n=n.join("")),(t=n)===a&&(t=Pe())===a&&(t=de,39===e.charCodeAt(de)?(n=V,de++):(n=a,0===me&&_e(q)),n!==a&&(r=Re())!==a?(39===e.charCodeAt(de)?(i=V,de++):(i=a,0===me&&_e(q)),i!==a?(t,t=n=r):(de=t,t=a)):(de=t,t=a),t===a))if(t=de,123===e.charCodeAt(de)?(n=l,de++):(n=a,0===me&&_e(d)),n!==a){for(r=[],i=Ce();i!==a;)r.push(i),i=Ce();r!==a?(125===e.charCodeAt(de)?(i=p,de++):(i=a,0===me&&_e(f)),i!==a?(t,n=function(e){return"{"+e.join("")+"}"}(r),t=n):(de=t,t=a)):(de=t,t=a)}else de=t,t=a;return me--,t===a&&(n=a,0===me&&_e(G)),t}function Pe(){var t,n;return me++,t=de,"''"===e.substr(de,2)?(n="''",de+=2):(n=a,0===me&&_e(Y)),n!==a&&(t,n="'"),me--,(t=n)===a&&(n=a,0===me&&_e($)),t}function Re(){var t,n,r;if((t=Pe())===a){if(t=de,n=[],K.test(e.charAt(de))?(r=e.charAt(de),de++):(r=a,0===me&&_e(Q)),r!==a)for(;r!==a;)n.push(r),K.test(e.charAt(de))?(r=e.charAt(de),de++):(r=a,0===me&&_e(Q));else n=a;n!==a&&(t,n=u(n)),t=n}return t}function Ie(){var t,n,r,i,o,s;if(me++,t=function(){var t,n,r,i;if(t=de,"'{"===e.substr(de,2)?(n="'{",de+=2):(n=a,0===me&&_e(X)),n!==a){for(r=[],i=Re();i!==a;)r.push(i),i=Re();r!==a?(39===e.charCodeAt(de)?(i=V,de++):(i=a,0===me&&_e(q)),i!==a?(t,t=n="{"+r.join("")):(de=t,t=a)):(de=t,t=a)}else de=t,t=a;if(t===a)if(t=de,"'}"===e.substr(de,2)?(n="'}",de+=2):(n=a,0===me&&_e(J)),n!==a){for(r=[],i=Re();i!==a;)r.push(i),i=Re();r!==a?(39===e.charCodeAt(de)?(i=V,de++):(i=a,0===me&&_e(q)),i!==a?(t,t=n="}"+r.join("")):(de=t,t=a)):(de=t,t=a)}else de=t,t=a;return t}(),t===a){if(t=de,n=de,r=de,"'#"===e.substr(de,2)?(i="'#",de+=2):(i=a,0===me&&_e(te)),i!==a){for(o=[],s=Re();s!==a;)o.push(s),s=Re();o!==a?(39===e.charCodeAt(de)?(s=V,de++):(s=a,0===me&&_e(q)),s!==a?(r,r=i="#"+o.join("")):(de=r,r=a)):(de=r,r=a)}else de=r,r=a;r!==a?(de,(i=(i=c())?void 0:a)!==a?n=r=[r,i]:(de=n,n=a)):(de=n,n=a),n!==a&&(t,n=n[0]),(t=n)===a&&(39===e.charCodeAt(de)?(t=V,de++):(t=a,0===me&&_e(q)))}return me--,t===a&&(n=a,0===me&&_e(ee)),t}function De(){var t,n;return(t=Pe())===a&&(t=Ie())===a&&(t=de,35===e.charCodeAt(de)?(n="#",de++):(n=a,0===me&&_e(s)),n!==a?(de,(!Ne[0]?void 0:a)!==a?(t,t=n=n):(de=t,t=a)):(de=t,t=a),t===a&&(t=function(){var t;return me++,re.test(e.charAt(de))?(t=e.charAt(de),de++):(t=a,0===me&&_e(ae)),me--,t===a&&0===me&&_e(ne),t}())),t}function je(){var t,n,r;if(me++,t=de,n=[],oe.test(e.charAt(de))?(r=e.charAt(de),de++):(r=a,0===me&&_e(se)),r!==a)for(;r!==a;)n.push(r),oe.test(e.charAt(de))?(r=e.charAt(de),de++):(r=a,0===me&&_e(se));else n=a;return t=n!==a?e.substring(t,de):n,me--,t===a&&(n=a,0===me&&_e(ie)),t}function Me(){var t,n,r;for(me++,t=de,n=[],ue.test(e.charAt(de))?(r=e.charAt(de),de++):(r=a,0===me&&_e(le));r!==a;)n.push(r),ue.test(e.charAt(de))?(r=e.charAt(de),de++):(r=a,0===me&&_e(le));return t=n!==a?e.substring(t,de):n,me--,t===a&&(n=a,0===me&&_e(ce)),t}var Ne=[!1];if((r=o())!==a&&de===e.length)return r;throw r!==a&&de0&&(t[n]=e)})),t},x.truncate=function(e,t){var n;return"string"===typeof e?n=e.slice(0,t):x.isArray(e)?(n=[],x.each(e,(function(e){n.push(x.truncate(e,t))}))):x.isObject(e)?(n={},x.each(e,(function(e,r){n[r]=x.truncate(e,t)}))):n=e,n},x.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 a="",i=0,o="",s="",l=0,d=a,p=[],f=r[e];switch(f&&"object"===typeof f&&"function"===typeof f.toJSON&&(f=f.toJSON(e)),typeof f){case"string":return t(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":return String(f);case"object":if(!f)return"null";if(a+=" ",p=[],"[object Array]"===c.apply(f)){for(l=f.length,i=0;i="0"&&t<="9";)n+=t,o();if("."===t)for(n+=".";o()&&t>="0"&&t<="9";)n+=t;if("e"===t||"E"===t)for(n+=t,o(),"-"!==t&&"+"!==t||(n+=t,o());t>="0"&&t<="9";)n+=t,o();if(e=+n,isFinite(e))return e;i("Bad number")},c=function(){var e,n,r,s="";if('"'===t)for(;o();){if('"'===t)return o(),s;if("\\"===t)if(o(),"u"===t){for(r=0,n=0;n<4&&(e=parseInt(o(),16),isFinite(e));n+=1)r=16*r+e;s+=String.fromCharCode(r)}else{if("string"!==typeof a[t])break;s+=a[t]}else s+=t}i("Bad string")},u=function(){for(;t&&t<=" ";)o()};return r=function(){switch(u(),t){case"{":return function(){var e,n={};if("{"===t){if(o("{"),u(),"}"===t)return o("}"),n;for(;t;){if(e=c(),u(),o(":"),Object.hasOwnProperty.call(n,e)&&i('Duplicate key "'+e+'"'),n[e]=r(),u(),"}"===t)return o("}"),n;o(","),u()}}i("Bad object")}();case"[":return function(){var e=[];if("["===t){if(o("["),u(),"]"===t)return o("]"),e;for(;t;){if(e.push(r()),u(),"]"===t)return o("]"),e;o(","),u()}}i("Bad array")}();case'"':return c();case"-":return s();default:return t>="0"&&t<="9"?s():function(){switch(t){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}i('Unexpected "'+t+'"')}()}},function(a){var o;return n=a,e=0,t=" ",o=r(),u(),t&&i("Syntax error"),o}}(),x.base64Encode=function(e){var t,n,r,a,i,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,c=0,u="",l=[];if(!e)return e;e=x.utf8Encode(e);do{t=(i=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=i>>12&63,r=i>>6&63,a=63&i,l[c++]=o.charAt(t)+o.charAt(n)+o.charAt(r)+o.charAt(a)}while(s127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),null!==s&&(n>t&&(i+=e.substring(t,n)),i+=s,t=n=a+1)}return n>t&&(i+=e.substring(t,e.length)),i},x.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=[],a=0;function i(e,t){var n,a=0;for(n=0;n=4&&(a=i(a,r),r=[]);return r.length>0&&(a=i(a,r)),a.toString(16)}()+"-"+t+"-"+e()}}();var E=["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"];x.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t=0}function r(t){if(!p.getElementsByTagName)return[];var r,a,i,o,s,c,u,l,d,f,h=t.split(" "),m=[p];for(c=0;c-1){i=(a=r.split("#"))[0];var y=a[1],g=p.getElementById(y);if(!g||i&&g.nodeName.toLowerCase()!=i)return[];m=[g]}else if(r.indexOf(".")>-1){i=(a=r.split("."))[0];var b=a[1];for(i||(i="*"),o=[],s=0,u=0;u-1};break;default:w=function(e){return e.getAttribute(_)}}for(m=[],f=0,u=0;u=3?t[2]:""},properties:function(){return x.extend(x.strip_empty_properties({$os:x.info.os(),$browser:x.info.browser(m,d.vendor,f),$referrer:p.referrer,$referring_domain:x.info.referringDomain(p.referrer),$device:x.info.device(m)}),{$current_url:t.location.href,$browser_version:x.info.browserVersion(m,d.vendor,f),$screen_height:h.height,$screen_width:h.width,mp_lib:"web",$lib_version:n.LIB_VERSION,$insert_id:P(),time:x.timestamp()/1e3})},people_properties:function(){return x.extend(x.strip_empty_properties({$os:x.info.os(),$browser:x.info.browser(m,d.vendor,f)}),{$browser_version:x.info.browserVersion(m,d.vendor,f)})},pageviewInfo:function(e){return x.strip_empty_properties({mp_page:e,mp_referrer:p.referrer,mp_browser:x.info.browser(m,d.vendor,f),mp_platform:x.info.os()})}};var P=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,I=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,D=function(e){var t=I,n=e.split("."),r=n[n.length-1];(r.length>4||"com"===r||"org"===r)&&(t=R);var a=e.match(t);return a?a[0]:""},j=null,M=null;"undefined"!==typeof JSON&&(j=JSON.stringify,M=JSON.parse),j=j||x.JSONEncode,M=M||x.JSONDecode,x.toArray=x.toArray,x.isObject=x.isObject,x.JSONEncode=x.JSONEncode,x.JSONDecode=x.JSONDecode,x.isBlockedUA=x.isBlockedUA,x.isEmptyObject=x.isEmptyObject,x.info=x.info,x.info.device=x.info.device,x.info.browser=x.info.browser,x.info.browserVersion=x.info.browserVersion,x.info.properties=x.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 a=this,i=x.dom_query(e);if(0!==i.length)return x.each(i,(function(e){x.register_event(e,this.override_event,(function(e){var i={},o=a.create_properties(n,this),s=a.mp.get_config("track_links_timeout");a.event_handler(e,this,i),window.setTimeout(a.track_callback(r,o,i,!0),s),a.mp.track(t,o,a.track_callback(r,o,i))}))}),this),!0;T.error("The DOM query ("+e+") returned 0 elements")},N.prototype.track_callback=function(e,t,n,r){r=r||!1;var a=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(r,t)||a.after_track_handler(t,n,r))}},N.prototype.create_properties=function(e,t){return"function"===typeof e?e(t):x.extend({},e)};var L=function(){this.override_event="click"};x.inherit(L,N),L.prototype.create_properties=function(e,t){var n=L.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},L.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()},L.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var B=function(){this.override_event="submit"};x.inherit(B,N),B.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},B.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var Z=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(),a=(new Date).getTime(),i=this.storageKey,o=this.pollIntervalMS,s=this.timeoutMS,c=this.storage,u=i+":X",l=i+":Y",d=i+":Z",p=function(e){t&&t(e)},f=function(e){if((new Date).getTime()-a>s)return Z.error("Timeout waiting for mutex on "+i+"; clearing lock. ["+r+"]"),c.removeItem(d),c.removeItem(l),void y();setTimeout((function(){try{e()}catch(t){p(t)}}),o*(Math.random()+.1))},h=function(e,t){e()?t():f((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(!O(c,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},y=function(){c.setItem(u,r),h(m,(function(){c.getItem(u)!==r?f((function(){c.getItem(l)===r?h((function(){return!c.getItem(d)}),g):y()})):g()}))},g=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(!O(c,!0))throw new Error("localStorage support check failed");y()}catch(b){p(b)}};var F=k("batch"),z=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||x.bind(F.error,F),this.lock=new U(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};z.prototype.enqueue=function(e,t,n){var r={id:P(),flushAfter:(new Date).getTime()+2*t,payload:e};this.lock.withLock(x.bind((function(){var t;try{var a=this.readFromStorage();a.push(r),(t=this.saveToStorage(a))&&this.memQueue.push(r)}catch(i){this.reportError("Error enqueueing item",e),t=!1}n&&n(t)}),this),x.bind((function(e){this.reportError("Error acquiring storage lock",e),n&&n(!1)}),this),this.pid)},z.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.lengthi.flushAfter&&!r[i.id]&&(i.orphaned=!0,t.push(i),t.length>=e))break}}}return t};var G=function(e,t){var n=[];return x.each(e,(function(e){e.id&&!t[e.id]&&n.push(e)})),n};z.prototype.removeItemsByID=function(e,t){var n={};x.each(e,(function(e){n[e]=!0})),this.memQueue=G(this.memQueue,n);var r=x.bind((function(){var t;try{var r=this.readFromStorage();if(r=G(r,n),t=this.saveToStorage(r)){r=this.readFromStorage();for(var a=0;a=t)this.reportError("Network timeout; retrying"),this.flush();else if(x.isObject(i)&&i.xhr_req&&(i.xhr_req.status>=500||429===i.xhr_req.status||"timeout"===i.error)){var c=2*this.flushInterval,u=i.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(x.isObject(i)&&i.xhr_req&&413===i.xhr_req.status)if(a.length>1){var d=Math.max(1,Math.floor(r/2));this.batchSize=Math.min(this.batchSize,d,a.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",a),this.resetBatchSize(),s=!0;else s=!0;s&&this.queue.removeItemsByID(x.map(a,(function(e){return e.id})),x.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(p){this.reportError("Error handling API response",p),this.resetFlush()}}),this),c={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(c.transport="sendBeacon"),W.log("MIXPANEL REQUEST:",i),this.sendRequest(i,c,s)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}},V.prototype.reportError=function(e,t){if(W.error.apply(W.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(t){W.error(t)}};function q(e,t){ae(!0,e,t)}function $(e,t){ae(!1,e,t)}function Y(e,t){return"1"===re(e,t)}function K(e,n){if(function(e){if(e&&e.ignoreDnt)return!1;var n=e&&e.window||t,r=n.navigator||{},a=!1;return x.each([r.doNotTrack,r.msDoNotTrack,n.doNotTrack],(function(e){x.includes([!0,1,"1","yes"],e)&&(a=!0)})),a}(n))return T.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&&T.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function Q(e){return ie(e,(function(e){return this.get_config(e)}))}function X(e){return ie(e,(function(e){return this._get_config(e)}))}function J(e){return ie(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?x.localStorage:x.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 ae(e,t,n){x.isString(t)&&t.length?(te(n=n||{}).set(ne(t,n),e?1:0,x.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})):T.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function ie(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),a=t.call(this,"ignore_dnt"),i=t.call(this,"opt_out_tracking_persistence_type"),o=t.call(this,"opt_out_tracking_cookie_prefix"),s=t.call(this,"window");r&&(n=K(r,{ignoreDnt:a,persistenceType:i,persistencePrefix:o,window:s}))}catch(u){T.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 oe="$set",se="$set_once",ce="$unset",ue="$add",le="$append",de="$union",pe="$remove",fe={set_action:function(e,t){var n={},r={};return x.isObject(e)?x.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 x.isArray(e)||(e=[e]),x.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 x.isObject(e)?x.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 x.isObject(e)?x.each(e,(function(e,t){this._is_reserved_property(t)||(r[t]=x.isArray(e)?e:[e])}),this):r[e]=x.isArray(t)?t:[t],n.$union=r,n},append_action:function(e,t){var n={},r={};return x.isObject(e)?x.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 x.isObject(e)?x.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(){};x.extend(he.prototype,fe),he.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},he.prototype.set=J((function(e,t,n){var r=this.set_action(e,t);return x.isObject(e)&&(n=t),this._send_request(r,n)})),he.prototype.set_once=J((function(e,t,n){var r=this.set_once_action(e,t);return x.isObject(e)&&(n=t),this._send_request(r,n)})),he.prototype.unset=J((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),he.prototype.union=J((function(e,t,n){x.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)})),he.prototype.delete=J((function(e){var t=this.delete_action();return this._send_request(t,e)})),he.prototype.remove=J((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=x.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(){};x.extend(me.prototype,fe),me.prototype._init=function(e){this._mixpanel=e},me.prototype.set=X((function(e,t,n){var r=this.set_action(e,t);return x.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r.$set=x.extend({},x.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),r.$set),this._send_request(r,n)})),me.prototype.set_once=X((function(e,t,n){var r=this.set_once_action(e,t);return x.isObject(e)&&(n=t),this._send_request(r,n)})),me.prototype.unset=X((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),me.prototype.increment=X((function(e,t,n){var r={},a={};return x.isObject(e)?(x.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void T.error("Invalid increment value passed to mixpanel.people.increment - must be a number");a[t]=e}}),this),n=t):(x.isUndefined(t)&&(t=1),a[e]=t),r.$add=a,this._send_request(r,n)})),me.prototype.append=X((function(e,t,n){x.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)})),me.prototype.remove=X((function(e,t,n){x.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)})),me.prototype.union=X((function(e,t,n){x.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)})),me.prototype.track_charge=X((function(e,t,n){if(x.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",x.extend({$amount:e},t),n);T.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)}T.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"),a=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),a&&(e.$had_persisted_distinct_id=a);var i=x.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:i,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),x.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),x.truncate(i,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){oe in e?this._mixpanel.persistence._add_to_people_queue(oe,e):se in e?this._mixpanel.persistence._add_to_people_queue(se,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):pe in e?this._mixpanel.persistence._add_to_people_queue(pe,e):de in e?this._mixpanel.persistence._add_to_people_queue(de,e):T.error("Invalid call to _enqueue():",e)},me.prototype._flush_one_queue=function(e,t,n,r){var a=this,i=x.extend({},this._mixpanel.persistence._get_queue(e)),o=i;x.isUndefined(i)||!x.isObject(i)||x.isEmptyObject(i)||(a._mixpanel.persistence._pop_from_people_queue(e,i),r&&(o=r(i)),t.call(a,o,(function(t,r){0===t&&a._mixpanel.persistence._add_to_people_queue(e,i),x.isUndefined(n)||n(t,r)})))},me.prototype._flush=function(e,t,n,r,a,i,o){var s=this,c=this._mixpanel.persistence._get_queue(le),u=this._mixpanel.persistence._get_queue(pe);if(this._flush_one_queue(oe,this.set,e),this._flush_one_queue(se,this.set_once,r),this._flush_one_queue(ce,this.unset,i,(function(e){return x.keys(e)})),this._flush_one_queue(ue,this.increment,t),this._flush_one_queue(de,this.union,a),!x.isUndefined(c)&&x.isArray(c)&&c.length){for(var l,d=function(e,t){0===e&&s._mixpanel.persistence._add_to_people_queue(le,l),x.isUndefined(n)||n(e,t)},p=c.length-1;p>=0;p--)l=c.pop(),x.isEmptyObject(l)||s.append(l,d);s._mixpanel.persistence.save()}if(!x.isUndefined(u)&&x.isArray(u)&&u.length){for(var f,h=function(e,t){0===e&&s._mixpanel.persistence._add_to_people_queue(pe,f),x.isUndefined(o)||o(e,t)},m=u.length-1;m>=0;m--)f=u.pop(),x.isEmptyObject(f)||s.remove(f,h);s._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 ye,ge,be="__mps",ve="__mpso",we="__mpus",_e="__mpa",xe="__mpap",Te="__mpr",Se="__mpu",ke="$people_distinct_id",Ee="__alias",Ae="__timers",Oe=[be,ve,we,_e,xe,Te,Se,ke,Ee,Ae],Ce=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&&(T.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&x.localStorage.is_supported()?this.storage=x.localStorage:this.storage=x.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};Ce.prototype.properties=function(){var e={};return x.each(this.props,(function(t,n){x.include(Oe,n)||(e[n]=t)})),e},Ce.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=x.extend({},e))}},Ce.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=x.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===x.localStorage&&(n=x.cookie.parse(this.name),x.cookie.remove(this.name),x.cookie.remove(this.name,!0),n&&this.register_once(n))},Ce.prototype.save=function(){this.disabled||this.storage.set(this.name,x.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Ce.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Ce.prototype.clear=function(){this.remove(),this.props={}},Ce.prototype.register_once=function(e,t,n){return!!x.isObject(e)&&("undefined"===typeof t&&(t="None"),this.expire_days="undefined"===typeof n?this.default_expiry:n,x.each(e,(function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)}),this),this.save(),!0)},Ce.prototype.register=function(e,t){return!!x.isObject(e)&&(this.expire_days="undefined"===typeof t?this.default_expiry:t,x.extend(this.props,e),this.save(),!0)},Ce.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())},Ce.prototype.update_campaign_params=function(){this.campaign_params_saved||(this.register_once(x.info.campaignParams()),this.campaign_params_saved=!0)},Ce.prototype.update_search_keyword=function(e){this.register(x.info.searchInfo(e))},Ce.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:x.info.referringDomain(e)||"$direct"},"")},Ce.prototype.get_referrer_info=function(){return x.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Ce.prototype.safe_merge=function(e){return x.each(this.props,(function(t,n){n in e||(e[n]=t)})),e},Ce.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)},Ce.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Ce.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Ce.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Ce.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Ce.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Ce.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Ce.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],a=this._get_or_create_queue(oe),i=this._get_or_create_queue(se),o=this._get_or_create_queue(ce),s=this._get_or_create_queue(ue),c=this._get_or_create_queue(de),u=this._get_or_create_queue(pe,[]),l=this._get_or_create_queue(le,[]);n===be?(x.extend(a,r),this._pop_from_people_queue(ue,r),this._pop_from_people_queue(de,r),this._pop_from_people_queue(ce,r)):n===ve?(x.each(r,(function(e,t){t in i||(i[t]=e)})),this._pop_from_people_queue(ce,r)):n===we?x.each(r,(function(e){x.each([a,i,s,c],(function(t){e in t&&delete t[e]})),x.each(l,(function(t){e in t&&delete t[e]})),o[e]=!0})):n===_e?(x.each(r,(function(e,t){t in a?a[t]+=e:(t in s||(s[t]=0),s[t]+=e)}),this),this._pop_from_people_queue(ce,r)):n===Se?(x.each(r,(function(e,t){x.isArray(e)&&(t in c||(c[t]=[]),c[t]=c[t].concat(e))})),this._pop_from_people_queue(ce,r)):n===Te?(u.push(r),this._pop_from_people_queue(le,r)):n===xe&&(l.push(r),this._pop_from_people_queue(ce,r)),T.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),T.log(t),this.save()},Ce.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);x.isUndefined(n)||(x.each(t,(function(t,r){e===le||e===pe?x.each(n,(function(e){e[r]===t&&delete e[r]})):delete n[r]}),this),this.save())},Ce.prototype._get_queue_key=function(e){return e===oe?be:e===se?ve:e===ce?we:e===ue?_e:e===le?xe:e===pe?Te:e===de?Se:void T.error("Invalid queue:",e)},Ce.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]},Ce.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=x.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},Ce.prototype.set_event_timer=function(e,t){var n=this.props.__timers||{};n[e]=t,this.props.__timers=n,this.save()},Ce.prototype.remove_event_timer=function(e){var t=(this.props.__timers||{})[e];return x.isUndefined(t)||(delete this.props.__timers[e],this.save()),t};var Pe=function(e){return e},Re=function(){},Ie="mixpanel",De="base64",je=t.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Me=!je&&-1===m.indexOf("MSIE")&&-1===m.indexOf("Mozilla"),Ne=null;d.sendBeacon&&(Ne=function(){return d.sendBeacon.apply(d,arguments)});var Le={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:De,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:{}},Be=!1,Ze=function(){},Ue=function(e,t,r){var a,i=r===Ie?ge:ge[r];if(i&&0===ye)a=i;else{if(i&&!x.isArray(i))return void T.error("You have already initialized "+r);a=new Ze}return a._cached_groups={},a._init(e,t,r),a.people=new me,a.people._init(a),n.DEBUG=n.DEBUG||a.get_config("debug"),!x.isUndefined(i)&&x.isArray(i)&&(a._execute_array.call(a.people,i.people),a._execute_array(i)),a};Ze.prototype.init=function(e,t,n){if(x.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==Ie){var r=Ue(e,t,n);return ge[n]=r,r._loaded(),r}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},Ze.prototype._init=function(e,n,r){n=n||{},this.__loaded=!0,this.config={};var a={};"api_payload_format"in n||(n.api_host||Le.api_host).match(/\.mixpanel\.com$/)&&(a.api_payload_format="json");if(this.set_config(x.extend({},Le,a,n,{name:r,token:e,callback_fn:(r===Ie?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(x.localStorage.is_supported(!0)&&je){if(this.init_batchers(),Ne&&t.addEventListener){var i=x.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);t.addEventListener("pagehide",(function(e){e.persisted&&i()})),t.addEventListener("visibilitychange",(function(){"hidden"===p.visibilityState&&i()}))}}else this._batch_requests=!1,T.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");this.persistence=this.cookie=new Ce(this.config),this.unpersisted_superprops={},this._gdpr_init();var o=x.UUID();this.get_distinct_id()||this.register_once({distinct_id:o,$device_id:o},"")},Ze.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()},Ze.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(p.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(p.referrer)},Ze.prototype._dom_loaded=function(){x.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||x.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},Ze.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(!Be)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},Ze.prototype._prepare_callback=function(e,t){if(x.isUndefined(e))return null;if(je){return function(n){e(n,t)}}var n=this._jsc,r=""+Math.floor(1e8*Math.random()),a=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(a){delete n[r],e(a,t)},a},Ze.prototype._send_request=function(e,t,n,r){var a=!0;if(Me)return this.__request_queue.push(arguments),a;var i={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},o=null;r||!x.isFunction(n)&&"string"!==typeof n||(r=n,n=null),n=x.extend(i,n||{}),je||(n.method="GET");var s="POST"===n.method,c=Ne&&s&&"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),je||(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(),s&&(o="data="+encodeURIComponent(t.data),delete t.data),e+="?"+x.HTTPBuildQuery(t);var l=this;if("img"in t){var d=p.createElement("img");d.src=e,p.body.appendChild(d)}else if(c){try{a=Ne(e,o)}catch(b){l.report_error(b),a=!1}try{r&&r(a?1:0)}catch(b){l.report_error(b)}}else if(je)try{var f=new XMLHttpRequest;f.open(n.method,e,!0);var h=this.get_config("xhr_headers");if(s&&(h["Content-Type"]="application/x-www-form-urlencoded"),x.each(h,(function(e,t){f.setRequestHeader(t,e)})),n.timeout_ms&&"undefined"!==typeof f.timeout){f.timeout=n.timeout_ms;var m=(new Date).getTime()}f.withCredentials=!0,f.onreadystatechange=function(){var e;if(4===f.readyState)if(200===f.status){if(r)if(u){var t;try{t=x.JSONDecode(f.responseText)}catch(b){if(l.report_error(b),!n.ignore_json_errors)return;t=f.responseText}r(t)}else r(Number(f.responseText))}else e=f.timeout&&!f.status&&(new Date).getTime()-m>=f.timeout?"timeout":"Bad HTTP status: "+f.status+" "+f.statusText,l.report_error(e),r&&r(u?{status:0,error:e,xhr_req:f}:0)},f.send(o)}catch(b){l.report_error(b),a=!1}else{var y=p.createElement("script");y.type="text/javascript",y.async=!0,y.defer=!0,y.src=e;var g=p.getElementsByTagName("script")[0];g.parentNode.insertBefore(y,g)}return a},Ze.prototype._execute_array=function(e){var t,n=[],r=[],a=[];x.each(e,(function(e){e&&(t=e[0],x.isArray(t)?a.push(e):"function"===typeof e?e.call(this):x.isArray(e)&&"alias"===t?n.push(e):x.isArray(e)&&-1!==t.indexOf("track")&&"function"===typeof this[t]?a.push(e):r.push(e))}),this);var i=function(e,t){x.each(e,(function(e){if(x.isArray(e[0])){var n=t;x.each(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};i(n,this),i(r,this),i(a,this)},Ze.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},Ze.prototype.init_batchers=function(){var e=this.get_config("token");if(!this.are_batchers_initialized()){var t=x.bind((function(t){return new V("__mpq_"+e+t.queue_suffix,{libConfig:this.config,sendRequestFunc:x.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:x.bind((function(e){return this._run_hook("before_send_"+t.type,e)}),this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:x.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()},Ze.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,x.each(this.request_batchers,(function(e){e.start()})))},Ze.prototype.stop_batch_senders=function(){this._batch_requests=!1,x.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},Ze.prototype.push=function(e){this._execute_array([e])},Ze.prototype.disable=function(e){"undefined"===typeof e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},Ze.prototype._encode_data_for_request=function(e){var t=x.JSONEncode(e);return this.get_config("api_payload_format")===De&&(t=x.base64Encode(t)),{data:t}},Ze.prototype._track_or_batch=function(e,t){var n=x.truncate(e.data,255),r=e.endpoint,a=e.batcher,i=e.should_send_immediately,o=e.send_request_options||{};t=t||Re;var s=!0,c=x.bind((function(){return o.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(T.log("MIXPANEL REQUEST:"),T.log(n),this._send_request(r,this._encode_data_for_request(n),o,this._prepare_callback(t,n))):null}),this);return this._batch_requests&&!i?a.enqueue(n,(function(e){e?t(1,n):c()})):s=c(),s&&n},Ze.prototype.track=Q((function(e,t,n,r){r||"function"!==typeof n||(r=n,n=null);var a=(n=n||{}).transport;a&&(n.transport=a);var i=n.send_immediately;if("function"!==typeof r&&(r=Re),x.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 o=this.persistence.remove_event_timer(e);if(!x.isUndefined(o)){var s=(new Date).getTime()-o;t.$duration=parseFloat((s/1e3).toFixed(3))}this._set_default_superprops(),t=x.extend({},x.info.properties(),this.persistence.properties(),this.unpersisted_superprops,t);var c=this.get_config("property_blacklist");x.isArray(c)?x.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:i,send_request_options:n},r)}r(0)}})),Ze.prototype.set_group=Q((function(e,t,n){x.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)})),Ze.prototype.add_group=Q((function(e,t,n){var r=this.get_property(e);if(void 0===r){var a={};a[e]=[t],this.register(a)}else-1===r.indexOf(t)&&(r.push(t),this.register(a));return this.people.union(e,t,n)})),Ze.prototype.remove_group=Q((function(e,t,n){var r=this.get_property(e);if(void 0!==r){var a=r.indexOf(t);a>-1&&(r.splice(a,1),this.register({group_key:r})),0===r.length&&this.unregister(e)}return this.people.remove(e,t,n)})),Ze.prototype.track_with_groups=Q((function(e,t,n,r){var a=x.extend({},t||{});return x.each(n,(function(e,t){null!==e&&void 0!==e&&(a[t]=e)})),this.track(e,a,r)})),Ze.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},Ze.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},Ze.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},Ze.prototype.track_pageview=function(e){x.isUndefined(e)&&(e=p.location.href),this.track("mp_page_view",x.info.pageviewInfo(e))},Ze.prototype.track_links=function(){return this._track_dom.call(this,L,arguments)},Ze.prototype.track_forms=function(){return this._track_dom.call(this,B,arguments)},Ze.prototype.time_event=function(e){x.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 Fe={persistent:!0},ze=function(e){var t;return t=x.isObject(e)?e:x.isUndefined(e)?{}:{days:e},x.extend({},Fe,t)};Ze.prototype.register=function(e,t){var n=ze(t);n.persistent?this.persistence.register(e,n.days):x.extend(this.unpersisted_superprops,e)},Ze.prototype.register_once=function(e,t,n){var r=ze(n);r.persistent?this.persistence.register_once(e,t,r.days):("undefined"===typeof t&&(t="None"),x.each(e,(function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)}),this))},Ze.prototype.unregister=function(e,t){(t=ze(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},Ze.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},Ze.prototype.identify=function(e,t,n,r,a,i,o,s){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(Ee)&&(this.unregister(Ee),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,a,i,o,s),e!==c&&this.track("$identify",{distinct_id:e,$anon_distinct_id:c},{skip_hooks:!0})},Ze.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=x.UUID();this.register_once({distinct_id:e,$device_id:e},"")},Ze.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},Ze.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 x.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Ee,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)},Ze.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},Ze.prototype.set_config=function(e){x.isObject(e)&&(x.extend(this.config,e),e.batch_size&&x.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"))},Ze.prototype.get_config=function(e){return this.config[e]},Ze.prototype._run_hook=function(e){var t=(this.config.hooks[e]||Pe).apply(this,s.call(arguments,1));return"undefined"===typeof t&&(this.report_error(e+" hook did not return a value"),t=null),t},Ze.prototype.get_property=function(e){return this.persistence.props[e]},Ze.prototype.toString=function(){var e=this.get_config("name");return e!==Ie&&(e="mixpanel."+e),e},Ze.prototype._event_is_disabled=function(e){return x.isBlockedUA(m)||this._flags.disable_all_events||x.include(this.__disabled_events,e)},Ze.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&x.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")&&!x.cookie.get("mp_optout")||(x.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},Ze.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&&x.each(this.request_batchers,(function(e){e.clear()}))},Ze.prototype._gdpr_call_func=function(e,t){return t=x.extend({track:x.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),x.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})},Ze.prototype.opt_in_tracking=function(e){e=x.extend({enable_persistence:!0},e),this._gdpr_call_func(q,e),this._gdpr_update_persistence(e)},Ze.prototype.opt_out_tracking=function(e){(e=x.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)},Ze.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(Y,e)},Ze.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(K,e)},Ze.prototype.clear_opt_in_out_tracking=function(e){e=x.extend({enable_persistence:!0},e),this._gdpr_call_func(ee,e),this._gdpr_update_persistence(e)},Ze.prototype.report_error=function(e,t){T.error.apply(T.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(t){T.error(t)}},Ze.prototype.init=Ze.prototype.init,Ze.prototype.reset=Ze.prototype.reset,Ze.prototype.disable=Ze.prototype.disable,Ze.prototype.time_event=Ze.prototype.time_event,Ze.prototype.track=Ze.prototype.track,Ze.prototype.track_links=Ze.prototype.track_links,Ze.prototype.track_forms=Ze.prototype.track_forms,Ze.prototype.track_pageview=Ze.prototype.track_pageview,Ze.prototype.register=Ze.prototype.register,Ze.prototype.register_once=Ze.prototype.register_once,Ze.prototype.unregister=Ze.prototype.unregister,Ze.prototype.identify=Ze.prototype.identify,Ze.prototype.alias=Ze.prototype.alias,Ze.prototype.name_tag=Ze.prototype.name_tag,Ze.prototype.set_config=Ze.prototype.set_config,Ze.prototype.get_config=Ze.prototype.get_config,Ze.prototype.get_property=Ze.prototype.get_property,Ze.prototype.get_distinct_id=Ze.prototype.get_distinct_id,Ze.prototype.toString=Ze.prototype.toString,Ze.prototype.opt_out_tracking=Ze.prototype.opt_out_tracking,Ze.prototype.opt_in_tracking=Ze.prototype.opt_in_tracking,Ze.prototype.has_opted_out_tracking=Ze.prototype.has_opted_out_tracking,Ze.prototype.has_opted_in_tracking=Ze.prototype.has_opted_in_tracking,Ze.prototype.clear_opt_in_out_tracking=Ze.prototype.clear_opt_in_out_tracking,Ze.prototype.get_group=Ze.prototype.get_group,Ze.prototype.set_group=Ze.prototype.set_group,Ze.prototype.add_group=Ze.prototype.add_group,Ze.prototype.remove_group=Ze.prototype.remove_group,Ze.prototype.track_with_groups=Ze.prototype.track_with_groups,Ze.prototype.start_batch_senders=Ze.prototype.start_batch_senders,Ze.prototype.stop_batch_senders=Ze.prototype.stop_batch_senders,Ce.prototype.properties=Ce.prototype.properties,Ce.prototype.update_search_keyword=Ce.prototype.update_search_keyword,Ce.prototype.update_referrer_info=Ce.prototype.update_referrer_info,Ce.prototype.get_cross_subdomain=Ce.prototype.get_cross_subdomain,Ce.prototype.clear=Ce.prototype.clear;var Ge={},He=function(){ge.init=function(e,n,r){if(r)return ge[r]||(ge[r]=Ge[r]=Ue(e,n,r),ge[r]._loaded()),ge[r];var a=ge;Ge.mixpanel?a=Ge.mixpanel:e&&((a=Ue(e,n,Ie))._loaded(),Ge.mixpanel=a),ge=a,1===ye&&(t.mixpanel=ge),x.each(Ge,(function(e,t){t!==Ie&&(ge[t]=e)})),ge._=x}};var We=(ye=0,ge=new Ze,He(),ge.init(),function(){function e(){e.done||(e.done=!0,Be=!0,Me=!1,x.each(Ge,(function(e){e._dom_loaded()})))}if(p.addEventListener)"complete"===p.readyState?e():p.addEventListener("DOMContentLoaded",e,!1);else if(p.attachEvent){p.attachEvent("onreadystatechange",e);var n=!1;try{n=null===t.frameElement}catch(r){}p.documentElement.doScroll&&n&&function t(){try{p.documentElement.doScroll("left")}catch(r){return void setTimeout(t,1)}e()}()}x.register_event(t,"load",e,!0)}(),ge);e.exports=We},77913:function(e,t,n){"use strict";var r=n(85696);t.default=void 0;var a,i=(a=n(67294))&&a.__esModule?a:{default:a},o=n(12199),s=n(61587),c=n(27215);var u={};function l(e,t,n,r){if(e&&o.isLocalURL(t)){e.prefetch(t,n,r).catch((function(e){0}));var a=r&&"undefined"!==typeof r.locale?r.locale:e&&e.locale;u[t+"%"+n+(a?"%"+a:"")]=!0}}var d=function(e){var t,n=!1!==e.prefetch,a=s.useRouter(),d=i.default.useMemo((function(){var t=o.resolveHref(a,e.href,!0),n=r(t,2),i=n[0],s=n[1];return{href:i,as:e.as?o.resolveHref(a,e.as):s||i}}),[a,e.href,e.as]),p=d.href,f=d.as,h=e.children,m=e.replace,y=e.shallow,g=e.scroll,b=e.locale;"string"===typeof h&&(h=i.default.createElement("a",null,h));var v=(t=i.default.Children.only(h))&&"object"===typeof t&&t.ref,w=c.useIntersection({rootMargin:"200px"}),_=r(w,2),x=_[0],T=_[1],S=i.default.useCallback((function(e){x(e),v&&("function"===typeof v?v(e):"object"===typeof v&&(v.current=e))}),[v,x]);i.default.useEffect((function(){var e=T&&n&&o.isLocalURL(p),t="undefined"!==typeof b?b:a&&a.locale,r=u[p+"%"+f+(t?"%"+t:"")];e&&!r&&l(a,p,f,{locale:t})}),[f,p,T,b,n,a]);var k={ref:S,onClick:function(e){t.props&&"function"===typeof t.props.onClick&&t.props.onClick(e),e.defaultPrevented||function(e,t,n,r,a,i,s,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)&&o.isLocalURL(n))&&(e.preventDefault(),t[a?"replace":"push"](n,r,{shallow:i,locale:c,scroll:s}))}(e,a,p,f,m,y,g,b)},onMouseEnter:function(e){t.props&&"function"===typeof t.props.onMouseEnter&&t.props.onMouseEnter(e),o.isLocalURL(p)&&l(a,p,f,{priority:!0})}};if(e.passHref||"a"===t.type&&!("href"in t.props)){var E="undefined"!==typeof b?b:a&&a.locale,A=a&&a.isLocaleDomain&&o.getDomainLocale(f,E,a&&a.locales,a&&a.domainLocales);k.href=A||o.addBasePath(o.addLocale(f,E,a&&a.defaultLocale))}return i.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||!o,l=a.useRef(),d=a.useState(!1),p=r(d,2),f=p[0],h=p[1],m=a.useState(t?t.current:null),y=r(m,2),g=y[0],b=y[1],v=a.useCallback((function(e){l.current&&(l.current(),l.current=void 0),u||f||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=s.get(r):(t=s.get(n),c.push(n));if(t)return t;var a=new Map,i=new IntersectionObserver((function(e){e.forEach((function(e){var t=a.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)}))}),e);return s.set(n,t={id:n,observer:i,elements:a}),t}(n),a=r.id,i=r.observer,o=r.elements;return o.set(e,t),i.observe(e),function(){if(o.delete(e),i.unobserve(e),0===o.size){i.disconnect(),s.delete(a);var t=c.findIndex((function(e){return e.root===a.root&&e.margin===a.margin}));t>-1&&c.splice(t,1)}}}(e,(function(e){return e&&h(e)}),{root:g,rootMargin:n}))}),[u,g,n,f]);return a.useEffect((function(){if(!o&&!f){var e=i.requestIdleCallback((function(){return h(!0)}));return function(){return i.cancelIdleCallback(e)}}}),[f]),a.useEffect((function(){t&&b(t.current)}),[t]),[v,f]};var a=n(67294),i=n(98065),o="undefined"!==typeof IntersectionObserver;var s=new Map,c=[]},17285:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AmpStateContext=void 0;var a=((r=n(67294))&&r.__esModule?r:{default:r}).default.createContext({});t.AmpStateContext=a},49546:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInAmpMode=o,t.useAmp=function(){return o(a.default.useContext(i.AmpStateContext))};var r,a=(r=n(67294))&&r.__esModule?r:{default:r},i=n(17285);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ampFirst,n=void 0!==t&&t,r=e.hybrid,a=void 0!==r&&r,i=e.hasQuery,o=void 0!==i&&i;return n||a&&o}},16505:function(e,t,n){"use strict";var r=n(930);function a(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 i,o=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)),s=(i=n(70148))&&i.__esModule?i:{default:i},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=[o.default.createElement("meta",{charSet:"utf-8"})];return e||t.push(o.default.createElement("meta",{name:"viewport",content:"width=device-width"})),t}function p(e,t){return"string"===typeof t||"number"===typeof t?e:t.type===o.default.Fragment?e.concat(o.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 f=["name","httpEquiv","charSet","itemProp"];function h(e,t){return e.reduce((function(e,t){var n=o.default.Children.toArray(t.props.children);return e.concat(n)}),[]).reduce(p,[]).reverse().concat(d(t.inAmpMode)).filter(function(){var e=new Set,t=new Set,n=new Set,r={};return function(a){var i=!0,o=!1;if(a.key&&"number"!==typeof a.key&&a.key.indexOf("$")>0){o=!0;var s=a.key.slice(a.key.indexOf("$")+1);e.has(s)?i=!1:e.add(s)}switch(a.type){case"title":case"base":t.has(a.type)?i=!1:t.add(a.type);break;case"meta":for(var c=0,u=f.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,r.Z)({},t,n))}),{});var p=function(){function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,s.Z)(this,e);var u=this,l=-1!==document.location.search.toLowerCase().indexOf("debug=webgl");u.canvas=t,u.gl=u.canvas.getContext("webgl",{antialias:!0}),u.meshes=[];var d=u.gl;n&&r&&this.setSize(n,r),u.lastDebugMsg,u.debug=a&&l?function(e){var t,n=new Date;n-u.lastDebugMsg>1e3&&console.log("---"),(t=console).log.apply(t,[n.toLocaleTimeString()+Array(Math.max(0,32-e.length)).join(" ")+e+": "].concat((0,o.Z)(Array.from(arguments).slice(1)))),u.lastDebugMsg=n}:function(){},Object.defineProperties(u,{Material:{enumerable:!1,value:function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,s.Z)(this,e);var a=this;function o(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)),u.debug("Material.compileShaderSource",{source:t}),n}function c(e,t){return Object.entries(e).map((function(e){var n=(0,i.Z)(e,2),r=n[0];return n[1].getDeclaration(r,t)})).join("\n")}a.uniforms=r,a.uniformInstances=[];var l="\n precision highp float;\n ";a.vertexSource="\n ".concat(l,"\n attribute vec4 position;\n attribute vec2 uv;\n attribute vec2 uvNorm;\n ").concat(c(u.commonUniforms,"vertex"),"\n ").concat(c(r,"vertex"),"\n ").concat(t,"\n "),a.Source="\n ".concat(l,"\n ").concat(c(u.commonUniforms,"fragment"),"\n ").concat(c(r,"fragment"),"\n ").concat(n,"\n "),a.vertexShader=o(d.VERTEX_SHADER,a.vertexSource),a.fragmentShader=o(d.FRAGMENT_SHADER,a.Source),a.program=d.createProgram(),d.attachShader(a.program,a.vertexShader),d.attachShader(a.program,a.fragmentShader),d.linkProgram(a.program),d.getProgramParameter(a.program,d.LINK_STATUS)||console.error(d.getProgramInfoLog(a.program)),d.useProgram(a.program),a.attachUniforms(void 0,u.commonUniforms),a.attachUniforms(void 0,a.uniforms)}return(0,c.Z)(e,[{key:"attachUniforms",value:function(e,t){var n=this;void 0===e?Object.entries(t).forEach((function(e){var t=(0,i.Z)(e,2),r=t[0],a=t[1];n.attachUniforms(r,a)})):"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,i.Z)(t,2),a=r[0],o=r[1];return n.attachUniforms("".concat(e,".").concat(a),o)})):(u.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,s.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,c.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 a=e.replace("u_","");return a=a.charAt(0).toUpperCase()+a.slice(1),"uniform struct ".concat(a,"\n {\n")+Object.entries(r.value).map((function(e){var n=(0,i.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,a,i){(0,s.Z)(this,e),d.createBuffer(),this.attributes={position:new u.Attribute({target:d.ARRAY_BUFFER,size:3}),uv:new u.Attribute({target:d.ARRAY_BUFFER,size:2}),uvNorm:new u.Attribute({target:d.ARRAY_BUFFER,size:2}),index:new u.Attribute({target:d.ELEMENT_ARRAY_BUFFER,size:3,type:d.UNSIGNED_SHORT})},this.setTopology(r,a),this.setSize(t,n,i)}return(0,c.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 a=0;a<=n.xSegCount;a++){var i=r*(n.xSegCount+1)+a;if(n.attributes.uv.values[2*i]=a/n.xSegCount,n.attributes.uv.values[2*i+1]=1-r/n.ySegCount,n.attributes.uvNorm.values[2*i]=a/n.xSegCount*2-1,n.attributes.uvNorm.values[2*i+1]=1-r/n.ySegCount*2,a0&&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 a=e/-2,i=t/-2,o=e/r.xSegCount,s=t/r.ySegCount,c=0;c<=r.ySegCount;c++)for(var l=i+c*s,d=0;d<=r.xSegCount;d++){var p=a+d*o,f=c*(r.xSegCount+1)+d;r.attributes.position.values[3*f+"xyz".indexOf(n[0])]=p,r.attributes.position.values[3*f+"xyz".indexOf(n[1])]=-l}r.attributes.position.update(),u.debug("Geometry.setSize",{position:r.attributes.position})}}]),e}()},Mesh:{enumerable:!1,value:function(){function e(t,n){(0,s.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,i.Z)(e,2),n=t[0],a=t[1];r.attributeInstances.push({attribute:a,location:a.attach(n,r.material.program)})})),u.meshes.push(r),u.debug("Mesh.constructor",{mesh:r})}return(0,c.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;u.meshes=u.meshes.filter((function(t){return t!=e}))}}]),e}()},Attribute:{enumerable:!1,value:function(){function e(t){(0,s.Z)(this,e),this.type=d.FLOAT,this.normalized=!1,this.buffer=d.createBuffer(),Object.assign(this,t),this.update()}return(0,c.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 p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];u.commonUniforms={projectionMatrix:new u.Uniform({type:"mat4",value:p}),modelViewMatrix:new u.Uniform({type:"mat4",value:p}),resolution:new u.Uniform({type:"vec2",value:[1,1]}),aspectRatio:new u.Uniform({type:"float",value:1})}}return(0,c.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,a=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-a),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 f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function(){function e(){var t=this;(0,s.Z)(this,e),f(this,"el",void 0),f(this,"cssVarRetries",0),f(this,"maxCssVarRetries",200),f(this,"angle",0),f(this,"isLoadedClass",!1),f(this,"isScrolling",!1),f(this,"scrollingTimeout",void 0),f(this,"scrollingRefreshDelay",200),f(this,"isIntersecting",!1),f(this,"shaderFiles",void 0),f(this,"vertexShader",void 0),f(this,"sectionColors",void 0),f(this,"computedCanvasStyle",void 0),f(this,"conf",void 0),f(this,"uniforms",void 0),f(this,"t",1253106),f(this,"last",0),f(this,"width",void 0),f(this,"minWidth",1111),f(this,"height",600),f(this,"xSegCount",void 0),f(this,"ySegCount",void 0),f(this,"mesh",void 0),f(this,"material",void 0),f(this,"geometry",void 0),f(this,"minigl",void 0),f(this,"scrollObserver",void 0),f(this,"amp",320),f(this,"seed",5),f(this,"freqX",14e-5),f(this,"freqY",29e-5),f(this,"freqDelta",1e-5),f(this,"activeColors",[1,1,1,1]),f(this,"isMetaKey",!1),f(this,"isGradientLegendVisible",!1),f(this,"isMouseDown",!1),f(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())})),f(this,"handleScrollEnd",(function(){t.isScrolling=!1,t.isIntersecting&&t.play()})),f(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})),f(this,"handleMouseDown",(function(e){t.isGradientLegendVisible&&(t.isMetaKey=e.metaKey,t.isMouseDown=!0,!1===t.conf.playing&&requestAnimationFrame(t.animate))})),f(this,"handleMouseUp",(function(){t.isMouseDown=!1})),f(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)})),f(this,"addIsLoadedClass",(function(){!t.isLoadedClass&&(t.isLoadedClass=!0,t.el.classList.add("isLoaded"),setTimeout((function(){t.el.parentElement.classList.add("isLoaded")}),3e3))})),f(this,"pause",(function(){t.conf.playing=!1})),f(this,"play",(function(){requestAnimationFrame(t.animate),t.conf.playing=!0})),f(this,"initGradient",(function(e){return t.el=document.querySelector(e),t.connect(),t}))}return(0,c.Z)(e,[{key:"connect",value:function(){var e=(0,a.Z)(l().mark((function e(){var t=this;return l().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(d)}}]),e}();console.log("here");var m=new h;window.Gradient=h,m.initGradient("#gradient-canvas");var y=n(52443),g=n(32161);const b=console;var v=n(30081),w=n(72379);class _{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,g.PN)(this.cacheTime)&&(this.gcTimeout=setTimeout((()=>{this.optionalRemove()}),this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:g.sk?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class x extends _{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||b,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,g.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(g.ZT).catch(g.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,g.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 a;return null==(a=this.retryer)||a.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 i=(0,g.G9)(),o={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>{if(i)return this.abortSignalConsumed=!0,i.signal}})};s(o);const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(o)):Promise.reject("Missing queryFn")};var u;(s(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,a;((0,w.DV)(e)&&e.silent||this.dispatch({type:"error",error:e}),(0,w.DV)(e))||(null==(t=(n=this.cache.config).onError)||t.call(n,e,this),null==(r=(a=this.cache.config).onSettled)||r.call(a,this.state.data,e,this));this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=(0,w.Mz)({fn:c.fetchFn,abort:null==i?void 0:i.abort.bind(i),onSuccess:e=>{var t,n,r,a;"undefined"!==typeof e?(this.setData(e),null==(t=(n=this.cache.config).onSuccess)||t.call(n,e,this),null==(r=(a=this.cache.config).onSettled)||r.call(a,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,w.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 a=e.error;return(0,w.DV)(a)&&a.revert&&this.revertState?{...this.revertState}:{...t,error:a,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),v.V.batch((()=>{this.observers.forEach((t=>{t.onQueryUpdate(e)})),this.cache.notify({query:this,type:"updated",action:e})}))}}var T=n(33989);class S extends T.l{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,n){var r;const a=t.queryKey,i=null!=(r=t.queryHash)?r:(0,g.Rm)(a,t);let o=this.get(i);return o||(o=new x({cache:this,logger:e.getLogger(),queryKey:a,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(o)),o}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(){v.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,g.I6)(e,t);return"undefined"===typeof n.exact&&(n.exact=!0),this.queries.find((e=>(0,g._x)(n,e)))}findAll(e,t){const[n]=(0,g.I6)(e,t);return Object.keys(n).length>0?this.queries.filter((e=>(0,g._x)(n,e))):this.queries}notify(e){v.V.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){v.V.batch((()=>{this.queries.forEach((e=>{e.onFocus()}))}))}onOnline(){v.V.batch((()=>{this.queries.forEach((e=>{e.onOnline()}))}))}}class k extends _{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||b,this.observers=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0},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,w.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,a,i,o,s,c,u;if(!t){var l,d,p,f;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==(p=(f=this.options).onMutate)?void 0:p.call(f,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==(a=(i=this.options).onSuccess)?void 0:a.call(i,h,this.state.variables,this.state.context)),await(null==(o=(s=this.mutationCache.config).onSettled)?void 0:o.call(s,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(T){try{var h,m,y,g,b,v,_,x;throw await(null==(h=(m=this.mutationCache.config).onError)?void 0:h.call(m,T,this.state.variables,this.state.context,this)),await(null==(y=(g=this.options).onError)?void 0:y.call(g,T,this.state.variables,this.state.context)),await(null==(b=(v=this.mutationCache.config).onSettled)?void 0:b.call(v,void 0,T,this.state.variables,this.state.context,this)),await(null==(_=(x=this.options).onSettled)?void 0:_.call(x,void 0,T,this.state.variables,this.state.context)),T}finally{this.dispatch({type:"error",error:T})}}}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,w.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),v.V.batch((()=>{this.observers.forEach((t=>{t.onMutationUpdate(e)})),this.mutationCache.notify({mutation:this,type:"updated",action:e})}))}}class E extends T.l{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,n){const r=new k({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(){v.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,g.X7)(e,t)))}findAll(e){return this.mutations.filter((t=>(0,g.X7)(e,t)))}notify(e){v.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 v.V.batch((()=>e.reduce(((e,t)=>e.then((()=>t.continue().catch(g.ZT)))),Promise.resolve())))})).then((()=>{this.resuming=void 0})),this.resuming}}var A=n(15761),O=n(96474),C=n(9499);var P=n(85945);const R=function(){return null};var I=n(81088);const D="7.72.0",j=Object.prototype.toString;function M(e){switch(j.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return W(e,Error)}}function N(e,t){return j.call(e)===`[object ${t}]`}function L(e){return N(e,"ErrorEvent")}function B(e){return N(e,"DOMError")}function Z(e){return N(e,"String")}function U(e){return null===e||"object"!==typeof e&&"function"!==typeof e}function F(e){return N(e,"Object")}function z(e){return"undefined"!==typeof Event&&W(e,Event)}function G(e){return Boolean(e&&e.then&&"function"===typeof e.then)}function H(e){return"number"===typeof e&&e!==e}function W(e,t){try{return e instanceof t}catch(n){return!1}}function V(e){return!("object"!==typeof e||null===e||!e.__isVue&&!e._isVue)}var q=n(71235);const $=(0,q.Rf)();function Y(e,t={}){try{let n=e;const r=5,a=[];let i=0,o=0;const s=" > ",c=s.length;let u;const l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&i++1&&o+a.length*c+u.length>=d));)a.push(u),o+=u.length,n=n.parentNode;return a.reverse().join(s)}catch(n){return""}}function K(e,t){const n=e,r=[];let a,i,o,s,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}`),a=n.className,a&&Z(a))for(i=a.split(/\s+/),c=0;c{const r=X[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}const ee=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&&J((()=>{q.n2.console[n](`Sentry Logger [${n}]:`,...t)}))}})):Q.forEach((e=>{t[e]=()=>{}})),t}();function te(e,t=0){return"string"!==typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function ne(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;rre(e,t,n)))}function ie(e,t,n){if(!(t in e))return;const r=e[t],a=n(r);"function"===typeof a&&se(a,r),e[t]=a}function oe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function se(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,oe(e,"__sentry_original__",t)}catch(n){}}function ce(e){return e.__sentry_original__}function ue(e){if(M(e))return{message:e.message,name:e.name,stack:e.stack,...de(e)};if(z(e)){const t={type:e.type,target:le(e.target),currentTarget:le(e.currentTarget),...de(e)};return"undefined"!==typeof CustomEvent&&W(e,CustomEvent)&&(t.detail=e.detail),t}return e}function le(e){try{return t=e,"undefined"!==typeof Element&&W(t,Element)?Y(e):Object.prototype.toString.call(e)}catch(n){return""}var t}function de(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 pe(e){return fe(e,new Map)}function fe(e,t){if(F(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const a of Object.keys(e))"undefined"!==typeof e[a]&&(r[a]=fe(e[a],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(fe(e,t))})),r}return e}function he(){const e=q.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 me(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function ye(e){const{message:t,event_id:n}=e;if(t)return t;const r=me(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function ge(e,t,n){const r=e.exception=e.exception||{},a=r.values=r.values||[],i=a[0]=a[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function be(e,t){const n=me(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 ve(e){if(e&&e.__sentry_captured__)return!0;try{oe(e,"__sentry_captured__",!0)}catch(t){}return!1}function we(e){return Array.isArray(e)?e:[e]}var _e;function xe(e){return new Se((t=>{t(e)}))}function Te(e){return new Se(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(_e||(_e={}));class Se{constructor(e){Se.prototype.__init.call(this),Se.prototype.__init2.call(this),Se.prototype.__init3.call(this),Se.prototype.__init4.call(this),this._state=_e.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(f){this._reject(f)}}then(e,t){return new Se(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(f){r(f)}else n(t)},e=>{if(t)try{n(t(e))}catch(f){r(f)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new Se(((t,n)=>{let r,a;return this.then((t=>{a=!1,r=t,e&&e()}),(t=>{a=!0,r=t,e&&e()})).then((()=>{a?n(r):t(r)}))}))}__init(){this._resolve=e=>{this._setResult(_e.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(_e.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===_e.PENDING&&(G(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===_e.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===_e.RESOLVED&&e[1](this._value),this._state===_e.REJECTED&&e[2](this._value),e[0]=!0)}))}}}function ke(){return(0,q.YO)("globalEventProcessors",(()=>[]))}function Ee(e){ke().push(e)}function Ae(e,t,n,r=0){return new Se(((a,i)=>{const o=e[r];if(null===t||"function"!==typeof o)a(t);else{const s=o({...t},n);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.id&&null===s&&ee.log(`Event processor "${o.id}" dropped event`),G(s)?s.then((t=>Ae(e,t,n,r+1).then(a))).then(null,i):Ae(e,s,n,r+1).then(a).then(null,i)}}))}var Oe=n(21170);const Ce="production";function Pe(e){const t=(0,Oe.ph)(),n={sid:he(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return pe({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&&Re(n,e),n}function Re(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:he()),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 Ie{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=De()}static clone(e){const t=new Ie;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&&Re(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 Ie?t:this}return e instanceof Ie?(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)):F(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=De(),this}addBreadcrumb(e,t){const n="number"===typeof t?t:100;if(n<=0)return this;const r={timestamp:(0,Oe.yW)(),...e},a=this._breadcrumbs;return a.push(r),this._breadcrumbs=a.length>n?a.slice(-n):a,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(),a=[...e.breadcrumbs||[],...r];return e.breadcrumbs=a.length>0?a:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},Ae([...n||[],...ke(),...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?we(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function De(){return{traceId:he(),spanId:he().substring(16)}}const je=100;class Me{constructor(e,t=new Ie,n=4){this._version=n,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version{a.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},i)})),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:he(),a=new Error(e);return this._withClient(((i,o)=>{i.captureMessage(e,t,{originalException:e,syntheticException:a,...n,event_id:r},o)})),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:he();return e.type||(this._lastEventId=n),this._withClient(((r,a)=>{r.captureEvent(e,{...t,event_id:n},a)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:a=null,maxBreadcrumbs:i=je}=r.getOptions&&r.getOptions()||{};if(i<=0)return;const o={timestamp:(0,Oe.yW)(),...e},s=a?J((()=>a(o,t))):o;null!==s&&(r.emit&&r.emit("beforeAddBreadcrumb",s,t),n.addBreadcrumb(s,i))}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=Le(this);try{e(this)}finally{Le(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__)&&ee.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"}),Re(e,n)}(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:a=Ce}=n&&n.getOptions()||{},{userAgent:i}=q.n2.navigator||{},o=Pe({release:r,environment:a,user:t.getUser(),...i&&{userAgent:i},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&Re(s,{status:"exited"}),this.endSession(),t.setSession(o),o}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=Ne().__SENTRY__;if(n&&n.extensions&&"function"===typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Ne(){return q.n2.__SENTRY__=q.n2.__SENTRY__||{extensions:{},hub:void 0},q.n2}function Le(e){const t=Ne(),n=Fe(t);return ze(t,e),n}function Be(){const e=Ne();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return Ze(e)}function Ze(e=Ne()){return Ue(e)&&!Fe(e).isOlderThan(4)||ze(e,new Me),Fe(e)}function Ue(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Fe(e){return(0,q.YO)("hub",(()=>new Me),e)}function ze(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}const Ge=[];function He(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?we(n(t)):t;const a=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),i=function(e,t){for(let n=0;n"Debug"===e.name));if(-1!==i){const[e]=a.splice(i,1);a.push(e)}return a}function We(e,t,n){if(n[t.name]=t,-1===Ge.indexOf(t.name)&&(t.setupOnce(Ee,Be),Ge.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__)&&ee.log(`Integration installed: ${t.name}`)}const Ve=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],qe=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class $e{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=$e.id,this._options=e}setupOnce(e,t){const n=e=>{const n=t();if(n){const t=n.getIntegration($e);if(t){const r=n.getClient(),a=r?r.getOptions():{},i=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Ve],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:qe],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(t._options,a);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(f){}return!1}(e))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${ye(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(f){}n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`));"undefined"!==typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__||0!==t.length||ee.error(`Could not extract message for event ${ye(e)}`);return t}(e).some((e=>ae(e,t)))}(e,t.ignoreErrors))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${ye(e)}`),!0;if(function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&ae(n,t)}(e,t.ignoreTransactions))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${ye(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;const n=Ye(e);return!!n&&ae(n,t)}(e,t.denyUrls))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${ye(e)}.\nUrl: ${Ye(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=Ye(e);return!n||ae(n,t)}(e,t.allowUrls))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${ye(e)}.\nUrl: ${Ye(e)}`),!0;return!1}(e,i)?null:e}}return e};n.id=this.name,e(n)}}function Ye(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(f){}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__)&&ee.error(`Cannot extract url for event ${ye(e)}`),null}}let Ke;$e.__initStatic();class Qe{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=Qe.id}setupOnce(){Ke=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=ce(this)||this;return Ke.apply(t,e)}}catch(f){}}}Qe.__initStatic();const Xe=/\(error: (.*)\)/,Je=/captureMessage|captureException/;function et(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,n=0)=>{const r=[],a=e.split("\n");for(let i=n;i1024)continue;const n=Xe.test(e)?e.replace(Xe,"$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(),Je.test(t[t.length-1].function||"")&&(t.pop(),Je.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 tt="";function nt(e){try{return e&&"function"===typeof e&&e.name||tt}catch(f){return tt}}const rt=(0,q.Rf)();function at(){if(!("fetch"in rt))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(f){return!1}}function it(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}const ot=(0,q.Rf)();const st=(0,q.Rf)(),ct={},ut={};function lt(e){if(!ut[e])switch(ut[e]=!0,e){case"console":!function(){if(!("console"in q.n2))return;Q.forEach((function(e){e in q.n2.console&&ie(q.n2.console,e,(function(t){return X[e]=t,function(...t){pt("console",{args:t,level:e});const n=X[e];n&&n.apply(q.n2.console,t)}}))}))}();break;case"dom":!function(){if(!st.document)return;const e=pt.bind(null,"dom"),t=bt(e,!0);st.document.addEventListener("click",t,!1),st.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=st[t]&&st[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(ie(n,"addEventListener",(function(t){return function(n,r,a){if("click"===n||"keypress"==n)try{const r=this,i=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},o=i[n]=i[n]||{refCount:0};if(!o.handler){const r=bt(e);o.handler=r,t.call(this,n,r,a)}o.refCount++}catch(f){}return t.call(this,n,r,a)}})),ie(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,a=n.__sentry_instrumentation_handlers__||{},i=a[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete a[t]),0===Object.keys(a).length&&delete n.__sentry_instrumentation_handlers__)}catch(f){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!st.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;ie(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 a=()=>{const e=this.__sentry_xhr_v2__;if(e&&4===this.readyState){try{e.status_code=this.status}catch(f){}pt("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&"function"===typeof this.onreadystatechange?ie(this,"onreadystatechange",(function(e){return function(...t){return a(),e.apply(this,t)}})):this.addEventListener("readystatechange",a),ie(this,"setRequestHeader",(function(e){return function(...t){const[n,r]=t,a=this.__sentry_xhr_v2__;return a&&(a.request_headers[n.toLowerCase()]=r),e.apply(this,t)}})),e.apply(this,t)}})),ie(e,"send",(function(e){return function(...t){const n=this.__sentry_xhr_v2__;return n&&void 0!==t[0]&&(n.body=t[0]),pt("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!function(){if(!at())return!1;if(it(rt.fetch))return!0;let e=!1;const t=rt.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=it(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}())return;ie(q.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:ht(t),method:ft(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:ht(t),method:ft(t,"method")?String(t.method).toUpperCase():"GET"}}(t),a={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return pt("fetch",{...a}),e.apply(q.n2,t).then((e=>(pt("fetch",{...a,endTimestamp:Date.now(),response:e}),e)),(e=>{throw pt("fetch",{...a,endTimestamp:Date.now(),error:e}),e}))}}))}();break;case"history":!function(){if(!function(){const e=ot.chrome,t=e&&e.app&&e.app.runtime,n="history"in ot&&!!ot.history.pushState&&!!ot.history.replaceState;return!t&&n}())return;const e=st.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=mt,t=String(n);mt=t,pt("history",{from:e,to:t})}return e.apply(this,t)}}st.onpopstate=function(...t){const n=st.location.href,r=mt;if(mt=n,pt("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(a){}},ie(st.history,"pushState",t),ie(st.history,"replaceState",t)}();break;case"error":vt=st.onerror,st.onerror=function(e,t,n,r,a){return pt("error",{column:r,error:a,line:n,msg:e,url:t}),!(!vt||vt.__SENTRY_LOADER__)&&vt.apply(this,arguments)},st.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":wt=st.onunhandledrejection,st.onunhandledrejection=function(e){return pt("unhandledrejection",e),!(wt&&!wt.__SENTRY_LOADER__)||wt.apply(this,arguments)},st.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("unknown instrumentation type:",e))}}function dt(e,t){ct[e]=ct[e]||[],ct[e].push(t),lt(e)}function pt(e,t){if(e&&ct[e])for(const n of ct[e]||[])try{n(t)}catch(f){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${nt(n)}\nError:`,f)}}function ft(e,t){return!!e&&"object"===typeof e&&!!e[t]}function ht(e){return"string"===typeof e?e:e?ft(e,"url")?e.url:e.toString?e.toString():"":""}let mt;let yt,gt;function bt(e,t=!1){return n=>{if(!n||gt===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(f){}return!0}(n))return;const r="keypress"===n.type?"input":n.type;(void 0===yt||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(f){}return!1}(gt,n))&&(e({event:n,name:r,global:t}),gt=n),clearTimeout(yt),yt=st.setTimeout((()=>{yt=void 0}),1e3)}}let vt=null;let wt=null;const _t=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function xt(e,t=!1){const{host:n,path:r,pass:a,port:i,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&a?`:${a}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${o}`}function Tt(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function St(e){const t="string"===typeof e?function(e){const t=_t.exec(e);if(!t)return void console.error(`Invalid Sentry Dsn: ${e}`);const[n,r,a="",i,o="",s]=t.slice(1);let c="",u=s;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 Tt({host:i,pass:a,path:c,projectId:u,port:o,protocol:n,publicKey:r})}(e):Tt(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]&&(ee.error(`Invalid Sentry Dsn: ${t} missing`),!0)))&&(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?!t||!isNaN(parseInt(t,10))||(ee.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):(ee.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(ee.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1))}(t))return t}function kt(e,t=100,n=1/0){try{return At("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Et(e,t=3,n=102400){const r=kt(e,t);return a=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(a))>n?Et(e,t-1,n):r;var a}function At(e,t,r=1/0,a=1/0,i=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=a){d[n]="[MaxProperties ~]";break}const e=f[n];d[n]=At(n,e,u-1,a,i),p++}return s(t),d}function Ot(e,t=[]){return[e,t]}function Ct(e,t){const[n,r]=e;return[n,[...r,t]]}function Pt(e,t){const n=e[1];for(const r of n){if(t(r,r[0].type))return!0}return!1}function Rt(e,t){return(t||new TextEncoder).encode(e)}function It(e,t){const[n,r]=e;let a=JSON.stringify(n);function i(e){"string"===typeof a?a="string"===typeof e?a+e:[Rt(a,t),e]:a.push("string"===typeof e?Rt(e,t):e)}for(const o of r){const[e,t]=o;if(i(`\n${JSON.stringify(e)}\n`),"string"===typeof t||t instanceof Uint8Array)i(t);else{let e;try{e=JSON.stringify(t)}catch(f){e=JSON.stringify(kt(t))}i(e)}}return"string"===typeof a?a:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const a of e)n.set(a,r),r+=a.length;return n}(a)}function Dt(e,t){const n="string"===typeof e.data?Rt(e.data,t):e.data;return[pe({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const jt={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 Mt(e){return jt[e]}function Nt(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Lt(e,t,n,r){const a=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:xt(r)},...a&&{trace:pe({...a})}}}class Bt 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 Ut(e,t){return n={sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}},Object.keys(n).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`)).join("&");var n}function Ft(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)}?${Ut(e,r)}`}function zt(e,t,n){const r=t.getOptions(),{publicKey:a}=t.getDsn()||{},{segment:i}=n&&n.getUser()||{},o=pe({environment:r.environment||Ce,release:r.release,user_segment:i,public_key:a,trace_id:e});return t.emit&&t.emit("createDsc",o),o}function Gt(e,t,n,r,a){const{normalizeDepth:i=3,normalizeMaxBreadth:o=1e3}=e,s={...t,event_id:t.event_id||n.event_id||he(),timestamp:t.timestamp||(0,Oe.yW)()},c=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:r,dist:a,maxValueLength:i=250}=t;"environment"in e||(e.environment="environment"in t?n:Ce);void 0===e.release&&void 0!==r&&(e.release=r);void 0===e.dist&&void 0!==a&&(e.dist=a);e.message&&(e.message=te(e.message,i));const o=e.exception&&e.exception.values&&e.exception.values[0];o&&o.value&&(o.value=te(o.value,i));const s=e.request;s&&s.url&&(s.url=te(s.url,i))}(s,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(s,c),void 0===t.type&&function(e,t){const n=q.n2._sentryDebugIds;if(!n)return;let r;const a=Ht.get(t);a?r=a:(r=new Map,Ht.set(t,r));const i=Object.keys(n).reduce(((e,a)=>{let i;const o=r.get(a);o?i=o:(i=t(a),r.set(a,i));for(let t=i.length-1;t>=0;t--){const r=i[t];if(r.filename){e[r.filename]=n[a];break}}return e}),{});try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.filename&&(e.debug_id=i[e.filename])}))}))}catch(f){}}(s,e.stackParser);let u=r;n.captureContext&&(u=Ie.clone(u).update(n.captureContext));let l=xe(s);const d=a&&a.getEventProcessors?a.getEventProcessors():[];if(u){if(u.getAttachments){const e=[...n.attachments||[],...u.getAttachments()];e.length&&(n.attachments=e)}l=u.applyToEvent(s,n,d)}else l=Ae([...d,...ke()],s,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(f){}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 i&&i>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:kt(e.data,t,n)}})))},...e.user&&{user:kt(e.user,t,n)},...e.contexts&&{contexts:kt(e.contexts,t,n)},...e.extra&&{extra:kt(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=kt(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=kt(e.data,t,n)),e))));return r}(e,i,o):e)))}const Ht=new WeakMap;const Wt="Not capturing exception because it's already been captured.";function Vt(e){return void 0===e.type}function qt(e){return"transaction"===e.type}var $t=n(68518);function Yt(e,t){const n=Qt(e,t),r={type:t&&t.name,value:Jt(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Kt(e,t){return{exception:{values:[Yt(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(Xt.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(f){}return[]}const Xt=/Minified React error #\d+;/i;function Jt(e){const t=e&&e.message;return t?t.error&&"string"===typeof t.error.message?t.error.message:t:"No error message"}function en(e,t,n,r,a){let i;if(L(t)&&t.error){return Kt(e,t.error)}if(B(t)||N(t,"DOMException")){const a=t;if("stack"in t)i=Kt(e,t);else{const t=a.name||(B(a)?"DOMError":"DOMException"),o=a.message?`${t}: ${a.message}`:t;i=tn(e,o,n,r),ge(i,o)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}if(M(t))return Kt(e,t);if(F(t)||z(t)){return i=function(e,t,n,r){const a=Be().getClient(),i=a&&a.getOptions().normalizeDepth,o={exception:{values:[{type:z(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:nn(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Et(t,i)}};if(n){const t=Qt(e,n);t.length&&(o.exception.values[0].stacktrace={frames:t})}return o}(e,t,n,a),be(i,{synthetic:!0}),i}return i=tn(e,t,n,r),ge(i,`${t}`,void 0),be(i,{synthetic:!0}),i}function tn(e,t,n,r){const a={message:t};if(r&&n){const r=Qt(e,n);r.length&&(a.exception={values:[{value:t,stacktrace:{frames:r}}]})}return a}function nn(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(ue(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return te(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:te(e,t)}return""}(e),r=t?"promise rejection":"exception";if(L(e))return`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``;if(z(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(f){}}(e)}\` (type=${e.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}function rn(e,t){return Be().captureException(e,{captureContext:t})}function an(e){Be().withScope(e)}const on=q.n2;let sn=0;function cn(){return sn>0}function un(){sn++,setTimeout((()=>{sn--}))}function ln(e,t={},n){if("function"!==typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(ce(e))return e}catch(f){return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"===typeof n&&n.apply(this,arguments);const a=r.map((e=>ln(e,t)));return e.apply(this,a)}catch(a){throw un(),an((e=>{e.addEventProcessor((e=>(t.mechanism&&(ge(e,void 0,void 0),be(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),rn(a)})),a}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(a){}se(r,e),oe(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(a){}return r}class dn 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=St(e.dsn):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("No DSN provided, client will not do anything."),this._dsn){const t=Ft(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(ve(e))return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(Wt));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 a=n&&n.event_id;const i=U(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(i.then((e=>this._captureEvent(e,n,r))).then((e=>{a=e}))),a}captureEvent(e,t,n){if(t&&t.originalException&&ve(t.originalException))return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(Wt));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__)&&ee.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Re(e,{init:!1})):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.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)))):xe(!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&&We(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__)&&ee.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){We(this,e,this._integrations)}sendEvent(e,t={}){if(this.emit("beforeSendEvent",e,t),this._dsn){let n=function(e,t,n,r){const a=Nt(n),i=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 o=Lt(e,a,r,t);return delete e.sdkProcessingMetadata,Ot(o,[[{type:i},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Ct(n,Dt(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 a=Nt(n);return Ot({sent_at:(new Date).toISOString(),...a&&{sdk:a},...!!r&&{dsn:xt(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__)&&ee.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 a=t.exception&&t.exception.values;if(a){r=!0;for(const e of a){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(Re(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Se((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(),a=Object.keys(this._integrations);return!t.integrations&&a.length>0&&(t.integrations=a),this.emit("preprocessEvent",e,t),Gt(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:a,parentSpanId:i,dsc:o}=t;e.contexts={trace:{trace_id:r,span_id:a,parent_span_id:i},...e.contexts};const s=o||zt(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:s,...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?ee.log(t.message):ee.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:a}=r;if(!this._isEnabled())return Te(new Bt("SDK not enabled, will not capture event.","log"));const i=qt(e),o=Vt(e),s=e.type||"error",c=`before send for type \`${s}\``;if(o&&"number"===typeof a&&Math.random()>a)return this.recordDroppedEvent("sample_rate","error",e),Te(new Bt(`Discarding event because it's not included in the random sample (sampling rate = ${a})`,"log"));const u="replay_event"===s?"replay":s;return this._prepareEvent(e,t,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",u,e),new Bt("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const a=function(e,t,n){const{beforeSend:r,beforeSendTransaction:a}=e;if(Vt(t)&&r)return r(t,n);if(qt(t)&&a)return a(t,n);return t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(G(e))return e.then((e=>{if(!F(e)&&null!==e)throw new Bt(n);return e}),(e=>{throw new Bt(`${t} rejected with ${e}`)}));if(!F(e)&&null!==e)throw new Bt(n);return e}(a,c)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",u,e),new Bt(`${c} returned \`null\`, will not send event.`,"log");const a=n&&n.getSession();!i&&a&&this._updateSessionFromEvent(a,r);const o=r.transaction_info;if(i&&o&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...o,source:e}}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof Bt)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Bt(`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__)&&ee.error("Error while sending event:",e)}));("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.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=on.SENTRY_SDK_SOURCE||(0,$t.S)();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:D}],version:D},super(e),e.sendClientReports&&on.document&&on.document.addEventListener("visibilitychange",(()=>{"hidden"===on.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){const a=en(e,t,n&&n.syntheticException||void 0,r);return be(a),a.level="error",n&&n.event_id&&(a.event_id=n.event_id),xe(a)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,a){const i=tn(e,t,r&&r.syntheticException||void 0,a);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),xe(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){const a={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:xt(r)}},i=function(e){return[{type:"user_report"},e]}(e);return Ot(a,[i])}(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__)&&ee.log("No outcomes to send"));if(!this._dsn)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log("No dsn provided, will not send outcomes"));("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log("Sending outcomes:",e);const t=(n=e,Ot((r=this._options.tunnel&&xt(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:a||(0,Oe.yW)(),discarded_events:n}]]));var n,r,a;this._sendEnvelope(t)}}class pn{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=pn.id,this._options={onerror:!0,onunhandledrejection:!0,...e},this._installFunc={onerror:fn,onunhandledrejection:hn}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const n in e){const r=this._installFunc[n];r&&e[n]&&(t=n,("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(`Global Handler attached: ${t}`),r(),this._installFunc[n]=void 0)}var t}}function fn(){dt("error",(e=>{const[t,n,r]=gn();if(!t.getIntegration(pn))return;const{msg:a,url:i,line:o,column:s,error:c}=e;if(cn()||c&&c.__sentry_own_request__)return;const u=void 0===c&&Z(a)?function(e,t,n,r){const a=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let i=L(e)?e.message:e,o="Error";const s=i.match(a);s&&(o=s[1],i=s[2]);return mn({exception:{values:[{type:o,value:i}]}},t,n,r)}(a,i,o,s):mn(en(n,c||a,void 0,r,!1),i,o,s);u.level="error",yn(t,c,u,"onerror")}))}function hn(){dt("unhandledrejection",(e=>{const[t,n,r]=gn();if(!t.getIntegration(pn))return;let a=e;try{"reason"in e?a=e.reason:"detail"in e&&"reason"in e.detail&&(a=e.detail.reason)}catch(o){}if(cn()||a&&a.__sentry_own_request__)return!0;const i=U(a)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(a)}`}]}}:en(n,a,void 0,r,!0);i.level="error",yn(t,a,i,"onunhandledrejection")}))}function mn(e,t,n,r){const a=e.exception=e.exception||{},i=a.values=a.values||[],o=i[0]=i[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.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 $.document.location.href}catch(e){return""}}();return 0===c.length&&c.push({colno:u,filename:d,function:"?",in_app:!0,lineno:l}),e}function yn(e,t,n,r){be(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function gn(){const e=Be(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}pn.__initStatic();const bn=["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 vn{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=vn.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&ie(on,"setTimeout",wn),this._options.setInterval&&ie(on,"setInterval",wn),this._options.requestAnimationFrame&&ie(on,"requestAnimationFrame",_n),this._options.XMLHttpRequest&&"XMLHttpRequest"in on&&ie(XMLHttpRequest.prototype,"send",xn);const e=this._options.eventTarget;if(e){(Array.isArray(e)?e:bn).forEach(Tn)}}}function wn(e){return function(...t){const n=t[0];return t[0]=ln(n,{mechanism:{data:{function:nt(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function _n(e){return function(t){return e.apply(this,[ln(t,{mechanism:{data:{function:"requestAnimationFrame",handler:nt(e)},handled:!1,type:"instrument"}})])}}function xn(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"===typeof n[e]&&ie(n,e,(function(t){const n={mechanism:{data:{function:e,handler:nt(t)},handled:!1,type:"instrument"}},r=ce(t);return r&&(n.mechanism.data.handler=nt(r)),ln(t,n)}))})),e.apply(this,t)}}function Tn(e){const t=on,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(ie(n,"addEventListener",(function(t){return function(n,r,a){try{"function"===typeof r.handleEvent&&(r.handleEvent=ln(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:nt(r),target:e},handled:!1,type:"instrument"}}))}catch(i){}return t.apply(this,[n,ln(r,{mechanism:{data:{function:"addEventListener",handler:nt(r),target:e},handled:!1,type:"instrument"}}),a])}})),ie(n,"removeEventListener",(function(e){return function(t,n,r){const a=n;try{const n=a&&a.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch(f){}return e.call(this,t,a,r)}})))}vn.__initStatic();const Sn=["fatal","error","warning","log","info","debug"];function kn(e){return"warn"===e?"warning":Sn.includes(e)?e:"log"}function En(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 An=1024;class On{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=On.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){if(this.options.console&&dt("console",Pn),this.options.dom&&dt("dom",function(e){function t(t){let n,r="object"===typeof e?e.serializeAttribute:void 0,a="object"===typeof e&&"number"===typeof e.maxStringLength?e.maxStringLength:void 0;a&&a>An&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=An),"string"===typeof r&&(r=[r]);try{const e=t.event;n=function(e){return!!e&&!!e.target}(e)?Y(e.target,{keyAttrs:r,maxStringLength:a}):Y(e,{keyAttrs:r,maxStringLength:a})}catch(f){n=""}0!==n.length&&Be().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&dt("xhr",Rn),this.options.fetch&&dt("fetch",In),this.options.history&&dt("history",Dn),this.options.sentry){const e=Be().getClient();e&&e.on&&e.on("beforeSendEvent",Cn)}}}function Cn(e){Be().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:ye(e)},{event:e})}function Pn(e){const t={category:"console",data:{arguments:e.args,logger:"console"},level:kn(e.level),message:ne(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message=`Assertion failed: ${ne(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1)}Be().addBreadcrumb(t,{input:e.args,level:e.level})}function Rn(e){const{startTimestamp:t,endTimestamp:n}=e,r=e.xhr.__sentry_xhr_v2__;if(!t||!n||!r)return;const{method:a,url:i,status_code:o,body:s}=r,c={method:a,url:i,status_code:o},u={xhr:e.xhr,input:s,startTimestamp:t,endTimestamp:n};Be().addBreadcrumb({category:"xhr",data:c,type:"http"},u)}function In(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,a={data:e.error,input:e.args,startTimestamp:t,endTimestamp:n};Be().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},a)}else{const r={...e.fetchData,status_code:e.response&&e.response.status},a={input:e.args,response:e.response,startTimestamp:t,endTimestamp:n};Be().addBreadcrumb({category:"fetch",data:r,type:"http"},a)}}function Dn(e){let t=e.from,n=e.to;const r=En(on.location.href);let a=En(t);const i=En(n);a.path||(a=r),r.protocol===i.protocol&&r.host===i.host&&(n=i.relative),r.protocol===a.protocol&&r.host===a.host&&(t=a.relative),Be().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}function jn(e,t,n=250,r,a,i,o){if(!i.exception||!i.exception.values||!o||!W(o.originalException,Error))return;const s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;var c,u;s&&(i.exception.values=(c=Mn(e,t,a,o.originalException,r,i.exception.values,s,0),u=n,c.map((e=>(e.value&&(e.value=te(e.value,u)),e)))))}function Mn(e,t,n,r,a,i,o,s){if(i.length>=n+1)return i;let c=[...i];if(W(r[a],Error)){Nn(o,s);const i=e(t,r[a]),u=c.length;Ln(i,a,u,s),c=Mn(e,t,n,r[a],a,[i,...c],i,u)}return Array.isArray(r.errors)&&r.errors.forEach(((r,i)=>{if(W(r,Error)){Nn(o,s);const u=e(t,r),l=c.length;Ln(u,`errors[${i}]`,l,s),c=Mn(e,t,n,r,a,[u,...c],u,l)}})),c}function Nn(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function Ln(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}}On.__initStatic();class Bn{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=Bn.id,this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){}preprocessEvent(e,t,n){const r=n.getOptions();jn(Yt,r.stackParser,r.maxValueLength,this._key,this._limit,e,t)}}Bn.__initStatic();class Zn{static __initStatic(){this.id="HttpContext"}constructor(){this.name=Zn.id}setupOnce(){}preprocessEvent(e){if(!on.navigator&&!on.location&&!on.document)return;const t=e.request&&e.request.url||on.location&&on.location.href,{referrer:n}=on.document||{},{userAgent:r}=on.navigator||{},a={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...e.request,...t&&{url:t},headers:a};e.request=i}}Zn.__initStatic();class Un{static __initStatic(){this.id="Dedupe"}constructor(){this.name=Un.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(!zn(e,t))return!1;if(!Fn(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=Gn(t),r=Gn(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!zn(e,t))return!1;if(!Fn(e,t))return!1;return!0}(e,t))return!0;return!1}(e,this._previousEvent))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){}return this._previousEvent=e}}function Fn(e,t){let n=Hn(e),r=Hn(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 a=0;a|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,$n=/\((\S*)(?::(\d+))(?::(\d+))\)/,Yn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Kn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Qn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Xn=et(...[[30,e=>{const t=qn.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=$n.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=Jn(t[1]||Wn,t[2]);return Vn(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,e=>{const t=Yn.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Kn.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]||Wn;return[n,e]=Jn(n,e),Vn(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,e=>{const t=Qn.exec(e);return t?Vn(t[2],t[1]||Wn,+t[3],t[4]?+t[4]:void 0):void 0}]]),Jn=(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]:Wn,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function er(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(a))).then(null,(()=>n(a).then(null,(()=>{})))),a},drain:function(e){return new Se(((n,r)=>{let a=t.length;if(!a)return n(!0);const i=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{xe(e).then((()=>{--a||(clearTimeout(i),n(!0))}),r)}))}))}}}function tr(e,{statusCode:t,headers:n},r=Date.now()){const a={...e},i=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(i)for(const s of i.trim().split(",")){const[e,t]=s.split(":",2),n=parseInt(e,10),i=1e3*(isNaN(n)?60:n);if(t)for(const o of t.split(";"))a[o]=r+i;else a.all=r+i}else o?a.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}(o,r):429===t&&(a.all=r+6e4);return a}function nr(e,t,n=er(e.bufferSize||30)){let r={};function a(a){const i=[];if(Pt(a,((t,n)=>{const a=Mt(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,a)){const r=rr(t,n);e.recordDroppedEvent("ratelimit_backoff",a,r)}else i.push(t)})),0===i.length)return xe();const o=Ot(a[0],i),s=t=>{Pt(o,((n,r)=>{const a=rr(n,r);e.recordDroppedEvent(t,Mt(r),a)}))};return n.add((()=>t({body:It(o,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=tr(r,e),e)),(e=>{throw s("network_error"),e})))).then((e=>e),(e=>{if(e instanceof Bt)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.error("Skipped sending event because buffer is full."),s("queue_overflow"),xe();throw e}))}return a.__sentry__baseTransport__=!0,{send:a,flush:e=>n.drain(e)}}function rr(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}let ar;function ir(e,t=function(){if(ar)return ar;if(it(on.fetch))return ar=on.fetch.bind(on);const e=on.document;let t=on.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(f){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",f)}return ar=t.bind(on)}()){let n=0,r=0;return nr(e,(function(a){const i=a.body.length;n+=i,r++;const o={body:a.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,o).then((e=>(n-=i,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(f){return ar=void 0,n-=i,r--,Te(f)}}))}function or(e){return nr(e,(function(t){return new Se(((n,r)=>{const a=new XMLHttpRequest;a.onerror=r,a.onreadystatechange=()=>{4===a.readyState&&n({statusCode:a.status,headers:{"x-sentry-rate-limits":a.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":a.getResponseHeader("Retry-After")}})},a.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&a.setRequestHeader(t,e.headers[t]);a.send(t.body)}))}))}const sr=[new $e,new Qe,new vn,new On,new pn,new Bn,new Un,new Zn];function cr(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=sr),void 0===e.release&&("string"===typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),on.SENTRY_RELEASE&&on.SENTRY_RELEASE.id&&(e.release=on.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:(n=e.stackParser||Xn,Array.isArray(n)?et(...n):n),integrations:He(e),transport:e.transport||(at()?ir:or)};var n;!function(e,t){!0===t.debug&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?ee.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const n=Be();n.getScope().update(t.initialScope);const r=new e(t);n.bindClient(r)}(dn,t),e.autoSessionTracking&&function(){if("undefined"===typeof on.document)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));const e=Be();if(!e.captureSession)return;ur(e),dt("history",(({from:e,to:t})=>{void 0!==e&&e!==t&&ur(Be())}))}()}function ur(e){e.startSession({ignoreDuration:!0}),e.captureSession()}const lr="baggage",dr="sentry-",pr=/^sentry-/;function fr(e){if(!e)return;return function(e){if(0===Object.keys(e).length)return;return Object.entries(e).reduce(((e,[t,n],r)=>{const a=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,i=0===r?a:`${e},${a}`;return i.length>8192?(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):i}),"")}(Object.entries(e).reduce(((e,[t,n])=>(n&&(e[`sentry-${t}`]=n),e)),{}))}function hr(e){return e.split(",").map((e=>e.split("=").map((e=>decodeURIComponent(e.trim()))))).reduce(((e,[t,n])=>(e[t]=n,e)),{})}const mr=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function yr(e,t){const n=function(e){if(!e)return;const t=e.match(mr);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,...hr(t)})),{});else{if(!e)return;t=hr(e)}const n=Object.entries(t).reduce(((e,[t,n])=>(t.match(pr)&&(e[t.slice(dr.length)]=n),e)),{});return Object.keys(n).length>0?n:void 0}(t),{traceId:a,parentSpanId:i,parentSampled:o}=n||{},s={traceId:a||he(),spanId:he().substring(16),sampled:o};return i&&(s.parentSpanId=i),r&&(s.dsc=r),{traceparentData:n,dynamicSamplingContext:r,propagationContext:s}}function gr(e=he(),t=he().substring(16),n){let r="";return void 0!==n&&(r=n?"-1":"-0"),`${e}-${t}${r}`}class br{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class vr{constructor(e={}){this.traceId=e.traceId||he(),this.spanId=e.spanId||he().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 vr({...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},ee.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&&ee.log(e.replace("Starting","Finishing"))}this.endTimestamp="number"===typeof e?e:(0,Oe.ph)()}toTraceparent(){return gr(this.traceId,this.spanId,this.sampled)}toContext(){return pe({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 pe({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 pe({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 wr extends vr{constructor(e,t){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=t||Be(),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 br(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__)&&ee.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__)&&ee.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,a={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__)&&ee.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),a.measurements=this._measurements),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(a)}toContext(){return pe({...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||Be(),t=e.getClient();if(!t)return{};const n=e.getScope(),r=zt(this.traceId,t,n),a=this.metadata.sampleRate;void 0!==a&&(r.sample_rate=`${a}`);const i=this.metadata.source;return i&&"url"!==i&&(r.transaction=this.name),void 0!==this.sampled&&(r.sampled=String(this.sampled)),r}setHub(e){this._hub=e}}const _r={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},xr=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class Tr extends br{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 Sr extends wr{constructor(e,t,n=_r.idleTimeout,r=_r.finalTimeout,a=_r.heartbeatInterval,i=!1){super(e,t),this._idleHub=t,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=a,this._onScope=i,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=xr[4],i&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.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=xr[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__)&&ee.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__)&&ee.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 Tr(t,n,this.spanId,e),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.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=xr[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=xr[1],this.finish(e))}),this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(`[Tracing] popActivity ${e}`),delete this.activities[e],("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.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=xr[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__)&&ee.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=xr[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout((()=>{this._beat()}),this._heartbeatInterval)}}function kr(e){if("boolean"===typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=Be().getClient(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function Er(e){return(e||Be()).getScope().getTransaction()}let Ar=!1;function Or(){const e=Er();if(e){const t="internal_error";("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}function Cr(){const e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function Pr(e,t,n){if(!kr(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(H(e)||"number"!==typeof e&&"boolean"!==typeof e)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.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__)&&ee.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,a;return i=>{t.value>=0&&(i||n)&&(a=t.value-(r||0),(a||void 0===r)&&(r=t.value,t.delta=a,e(t)))}},Nr=()=>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],Lr=()=>{const e=Nr();return e&&e.activationStart||0},Br=(e,t)=>{const n=Nr();let r="navigate";return n&&(r=jr.document.prerendering||Lr()>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}},Zr=(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(f){}},Ur=(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 Fr=-1;const zr=()=>(Fr<0&&(Fr="hidden"!==jr.document.visibilityState||jr.document.prerendering?1/0:0,Ur((({timeStamp:e})=>{Fr=e}),!0)),{get firstHiddenTime(){return Fr}}),Gr={};function Hr(e){return"number"===typeof e&&isFinite(e)}function Wr(e,{startTimestamp:t,...n}){return t&&e.startTimestamp>t&&(e.startTimestamp=t),e.startChild({startTimestamp:t,...n})}function Vr(e){return e/1e3}function qr(){return jr&&jr.addEventListener&&jr.performance}let $r,Yr,Kr=0,Qr={};function Xr(){const e=qr();if(e&&Oe.Z1){e.mark&&jr.performance.mark("sentry-tracing-init"),(e=>{const t=zr(),n=Br("FID");let r;const a=e=>{e.startTime{e.forEach(a)},o=Zr("first-input",i);r=Mr(e,n),o&&Ur((()=>{i(o.takeRecords()),o.disconnect()}),!0)})((e=>{const t=e.entries.pop();if(!t)return;const n=Vr(Oe.Z1),r=Vr(t.startTime);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log("[Measurements] Adding FID"),Qr.fid={value:e.value,unit:"millisecond"},Qr["mark.fid"]={value:n+r,unit:"second"}}));const t=(e=>{const t=Br("CLS",0);let n,r=0,a=[];const i=e=>{e.forEach((e=>{if(!e.hadRecentInput){const i=a[0],o=a[a.length-1];r&&0!==a.length&&e.startTime-o.startTime<1e3&&e.startTime-i.startTime<5e3?(r+=e.value,a.push(e)):(r=e.value,a=[e]),r>t.value&&(t.value=r,t.entries=a,n&&n())}}))},o=Zr("layout-shift",i);if(o){n=Mr(e,t);const r=()=>{i(o.takeRecords()),n(!0)};return Ur(r),r}})((e=>{const t=e.entries.pop();t&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log("[Measurements] Adding CLS"),Qr.cls={value:e.value,unit:""},Yr=t)})),n=(e=>{const t=zr(),n=Br("LCP");let r;const a=e=>{const a=e[e.length-1];if(a){const e=Math.max(a.startTime-Lr(),0);e{Gr[n.id]||(a(i.takeRecords()),i.disconnect(),Gr[n.id]=!0,r(!0))};return["keydown","click"].forEach((e=>{addEventListener(e,t,{once:!0,capture:!0})})),Ur(t,!0),t}})((e=>{const t=e.entries.pop();t&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log("[Measurements] Adding LCP"),Qr.lcp={value:e.value,unit:"millisecond"},$r=t)}));return()=>{t&&t(),n&&n()}}return()=>{}}function Jr(e){const t=qr();if(!t||!jr.performance.getEntries||!Oe.Z1)return;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log("[Tracing] Adding & adjusting spans using Performance API");const n=Vr(Oe.Z1),r=t.getEntries();let a,i;if(r.slice(Kr).forEach((t=>{const r=Vr(t.startTime),o=Vr(t.duration);if(!("navigation"===e.op&&n+r{ea(e,t,r,n)})),ea(e,t,"secureConnection",n,"TLS/SSL","connectEnd"),ea(e,t,"fetch",n,"cache","domainLookupStart"),ea(e,t,"domainLookup",n,"DNS"),function(e,t,n){Wr(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+Vr(t.requestStart),endTimestamp:n+Vr(t.responseEnd)}),Wr(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+Vr(t.responseStart),endTimestamp:n+Vr(t.responseEnd)})}(e,t,n)}(e,t,n),a=n+Vr(t.responseStart),i=n+Vr(t.requestStart);break;case"mark":case"paint":case"measure":{!function(e,t,n,r,a){const i=a+n,o=i+r;Wr(e,{description:t.name,endTimestamp:o,op:t.entryType,origin:"auto.resource.browser.metrics",startTimestamp:i})}(e,t,r,o,n);const a=zr(),i=t.startTime{if(!Qr[t]||n>=e.startTimestamp)return;const r=Qr[t].value,a=n+Vr(r),i=Math.abs(1e3*(a-e.startTimestamp)),o=i-r;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(`[Measurements] Normalized ${t} from ${r} to ${i} (${o})`),Qr[t].value=i}));const t=Qr["mark.fid"];t&&Qr.fid&&(Wr(e,{description:"first input delay",endTimestamp:t.value+Vr(Qr.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:t.value}),delete Qr["mark.fid"]),"fcp"in Qr||delete Qr.cls,Object.keys(Qr).forEach((t=>{e.setMeasurement(t,Qr[t].value,Qr[t].unit)})),function(e){$r&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log("[Measurements] Adding LCP Data"),$r.element&&e.setTag("lcp.element",Y($r.element)),$r.id&&e.setTag("lcp.id",$r.id),$r.url&&e.setTag("lcp.url",$r.url.trim().slice(0,200)),e.setTag("lcp.size",$r.size));Yr&&Yr.sources&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log("[Measurements] Adding CLS Data"),Yr.sources.forEach(((t,n)=>e.setTag(`cls.source.${n+1}`,Y(t.node)))))}(e)}$r=void 0,Yr=void 0,Qr={}}function ea(e,t,n,r,a,i){const o=i?t[i]:t[`${n}End`],s=t[`${n}Start`];s&&o&&Wr(e,{op:"browser",origin:"auto.browser.browser.metrics",description:a||n,startTimestamp:r+Vr(s),endTimestamp:r+Vr(o)})}const ta=["localhost",/^\/(?!\/)/],na={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:ta,tracePropagationTargets:ta};function ra(e){const{traceFetch:t,traceXHR:n,tracePropagationTargets:r,tracingOrigins:a,shouldCreateSpanForRequest:i,enableHTTPTimings:o}={traceFetch:na.traceFetch,traceXHR:na.traceXHR,...e},s="function"===typeof i?i:e=>!0,c=e=>function(e,t){return ae(e,t||ta)}(e,r||a),u={};t&&dt("fetch",(e=>{const t=function(e,t,n,r){if(!kr()||!e.fetchData)return;const a=t(e.fetchData.url);if(e.endTimestamp&&a){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 i=Be(),o=i.getScope(),s=i.getClient(),c=o.getSpan(),{method:u,url:l}=e.fetchData,d=a&&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)&&s){const t=e.args[0];e.args[1]=e.args[1]||{};const n=e.args[1];n.headers=function(e,t,n,r,a){const i=a||n.getSpan(),o=i&&i.transaction,{traceId:s,sampled:c,dsc:u}=n.getPropagationContext(),l=i?i.toTraceparent():gr(s,void 0,c),d=fr(o?o.getDynamicSamplingContext():u||zt(s,t,n)),p="undefined"!==typeof Request&&W(e,Request)?e.headers:r.headers;if(p){if("undefined"!==typeof Headers&&W(p,Headers)){const e=new Headers(p);return e.append("sentry-trace",l),d&&e.append(lr,d),e}if(Array.isArray(p)){const e=[...p,["sentry-trace",l]];return d&&e.push([lr,d]),e}{const e="baggage"in p?p.baggage:void 0,t=[];return Array.isArray(e)?t.push(...e):e&&t.push(e),d&&t.push(d),{...p,"sentry-trace":l,baggage:t.length>0?t.join(","):void 0}}}return{"sentry-trace":l,baggage:d}}(t,s,o,n,d)}return d}(e,s,c,u);o&&t&&aa(t)})),n&&dt("xhr",(e=>{const t=function(e,t,n,r){const a=e.xhr,i=a&&a.__sentry_xhr_v2__;if(!kr()||a&&a.__sentry_own_request__||!a||!i)return;const o=t(i.url);if(e.endTimestamp&&o){const e=a.__sentry_xhr_span_id__;if(!e)return;const t=r[e];return void(t&&(t.setHttpStatus(i.status_code),t.finish(),delete r[e]))}const s=Be(),c=s.getScope(),u=c.getSpan(),l=o&&u?u.startChild({data:{...i.data,type:"xhr","http.method":i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;l&&(a.__sentry_xhr_span_id__=l.spanId,r[a.__sentry_xhr_span_id__]=l);if(a.setRequestHeader&&n(i.url))if(l){const e=l&&l.transaction,t=fr(e&&e.getDynamicSamplingContext());oa(a,l.toTraceparent(),t)}else{const e=s.getClient(),{traceId:t,sampled:n,dsc:r}=c.getPropagationContext();oa(a,gr(t,void 0,n),fr(r||(e?zt(t,e,c):void 0)))}return l}(e,s,c,u);o&&t&&aa(t)}))}function aa(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 a of e){if("/"===a){[t,n]=e.split("/");break}if(!isNaN(Number(a))){t="h"===r?"http":r,n=e.split(r)[1];break}r+=a}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",ia(e.redirectStart)],["http.request.fetch_start",ia(e.fetchStart)],["http.request.domain_lookup_start",ia(e.domainLookupStart)],["http.request.domain_lookup_end",ia(e.domainLookupEnd)],["http.request.connect_start",ia(e.connectStart)],["http.request.secure_connection_start",ia(e.secureConnectionStart)],["http.request.connection_end",ia(e.connectEnd)],["http.request.request_start",ia(e.requestStart)],["http.request.response_start",ia(e.responseStart)],["http.request.response_end",ia(e.responseEnd)]]}(r);t.forEach((t=>e.setData(...t))),n.disconnect()}}))}));n.observe({entryTypes:["resource"]})}function ia(e=0){return((Oe.Z1||performance.timeOrigin)+e)/1e3}function oa(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader(lr,n)}catch(r){}}const sa={..._r,markBackgroundTransactions:!0,routingInstrumentation:function(e,t=!0,n=!0){if(!jr||!jr.location)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("Could not initialize routing instrumentation due to invalid location"));let r,a=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&&dt("history",(({to:t,from:n})=>{void 0===n&&a&&-1!==a.indexOf(t)?a=void 0:n!==t&&(a=void 0,r&&(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.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:{},...na};class ca{constructor(e){this.name="BrowserTracing",this._hasSetTracePropagationTargets=!1,Dr(),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!(!e||!e.tracePropagationTargets&&!e.tracingOrigins)),this.options={...sa,...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=Xr(),this.options.enableLongTask&&Zr("longtask",(e=>{for(const t of e){const e=Er();if(!e)return;const n=Vr(Oe.Z1+t.startTime),r=Vr(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&&Zr("event",(e=>{for(const t of e){const e=Er();if(!e)return;if("click"===t.name){const n=Vr(Oe.Z1+t.startTime),r=Vr(t.duration);e.startChild({description:Y(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:a,startTransactionOnLocationChange:i,startTransactionOnPageLoad:o,markBackgroundTransactions:s,traceFetch:c,traceXHR:u,shouldCreateSpanForRequest:l,enableHTTPTimings:d,_experiments:p}=this.options,f=r&&r.tracePropagationTargets,h=f||this.options.tracePropagationTargets;("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&f&&ee.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."),a((e=>{const n=this._createRouteTransaction(e);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,e,t),n}),o,i),s&&(jr&&jr.document?jr.document.addEventListener("visibilitychange",(()=>{const e=Er();if(jr.document.hidden&&e){const t="cancelled";("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.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__)&&ee.warn("[Tracing] Could not set up background tab detection due to lack of global document")),p.enableInteractions&&this._registerInteractionListener(),ra({traceFetch:c,traceXHR:u,tracePropagationTargets:h,shouldCreateSpanForRequest:l,enableHTTPTimings:d})}_createRouteTransaction(e){if(!this._getCurrentHub)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`));const t=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:r,finalTimeout:a,heartbeatInterval:i}=this.options,o="pageload"===e.op,s=o?ua("sentry-trace"):"",c=o?ua("baggage"):"",{traceparentData:u,dynamicSamplingContext:l,propagationContext:d}=yr(s,c),p={...e,...u,metadata:{...e.metadata,dynamicSamplingContext:u&&!l?{}:l},trimEnd:!0},f="function"===typeof n?n(p):p,h=void 0===f?{...p,sampled:!1}:f;h.metadata=h.name!==p.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__)&&ee.log(`[Tracing] Will not send ${h.op} transaction because of beforeNavigate.`),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.log(`[Tracing] Starting ${h.op} transaction on scope`);const{location:m}=jr,y=Ir(t,h,r,a,!0,{location:m},i),g=t.getScope();return o&&u?g.setPropagationContext(d):g.setPropagationContext({traceId:y.traceId,spanId:y.spanId,parentSpanId:y.parentSpanId,sampled:y.sampled}),y.registerBeforeFinishCallback((e=>{this._collectWebVitals(),Jr(e)})),y}_registerInteractionListener(){let e;const t=()=>{const{idleTimeout:t,finalTimeout:n,heartbeatInterval:r}=this.options,a="ui.action.click",i=Er();if(i&&i.op&&["navigation","pageload"].includes(i.op))return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`[Tracing] Did not create ${a} 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__)&&ee.warn(`[Tracing] Did not create ${a} transaction because _getCurrentHub is invalid.`));if(!this._latestRouteName)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`));const o=this._getCurrentHub(),{location:s}=jr,c={name:this._latestRouteName,op:a,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=Ir(o,c,t,n,!0,{location:s},r)};["click"].forEach((e=>{addEventListener(e,t,{once:!1,capture:!0})}))}}function ua(e){const t=(n=`meta[name=${e}]`,$.document&&$.document.querySelector?$.document.querySelector(n):null);var n;return t?t.getAttribute("content"):void 0}var la=n(61422),da=n(83454);const pa=q.n2,fa="sentryReplaySession",ha="Unable to send Replay",ma=15e4,ya=5e3,ga=2e7,ba=36e5;var va;function wa(e){const t=null===e||void 0===e?void 0:e.host;return Boolean(t&&t.shadowRoot&&t.shadowRoot===e)}function _a({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 xa({input:e,maskInputSelector:t,unmaskInputSelector:n,maskInputOptions:r,tagName:a,type:i,value:o,maskInputFn:s}){let c=o||"";return n&&e.matches(n)||(e.hasAttribute("data-rr-is-password")&&(i="password"),(_a({maskInputOptions:r,tagName:a,type:i})||t&&e.matches(t))&&(c=s?s(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"}(va||(va={}));const Ta="__rrweb_original__";function Sa(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}function ka(e,t,n){return"string"===typeof n&&n.toLowerCase(),"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}let Ea=1;const Aa=new RegExp("[^a-z0-9-_:]");function Oa(e){return e?e.replace(/[\S]/g,"*"):""}function Ca(e){try{const t=e.rules||e.cssRules;return t?Array.from(t).map(Pa).join(""):null}catch(t){return null}}function Pa(e){let t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=Ca(e.styleSheet)||t}catch(n){}return Ra(t)}function Ra(e){if(e.indexOf(":")>-1){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}return e}let Ia,Da;const ja=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ma=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Na=/^(data:)([^,]*),(.*)/i;function La(e,t){return(e||"").replace(ja,((e,n,r,a,i,o)=>{const s=r||i||o,c=n||a||"";if(!s)return e;if(!Ma.test(s))return`url(${c}${s}${c})`;if(Na.test(s))return`url(${c}${s}${c})`;if("/"===s[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)+s}${c})`;const u=t.split("/"),l=s.split("/");u.pop();for(const t of l)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${c}${u.join("/")}${c})`}))}const Ba=/^[^ \t\n\r\u000c]+/,Za=/^[, \t\n\r\u000c]+/;function Ua(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function Fa(){const e=document.createElement("a");return e.href="",e.href}function za(e,t,n,r,a,i,o,s){if(!a)return a;const c=r.toLowerCase(),u=n.toLowerCase();return"src"===c||"href"===c||"xlink:href"===c&&"#"!==a[0]?Ua(e,a):"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,a=e.exec(t.substring(n));return a?(r=a[0],n+=r.length,r):""}let a=[];for(;r(Za),!(n>=t.length);){let i=r(Ba);if(","===i.slice(-1))i=Ua(e,i.substring(0,i.length-1)),a.push(i);else{let r="";i=Ua(e,i);let o=!1;for(;;){let e=t.charAt(n);if(""===e){a.push((i+r).trim());break}if(o)")"===e&&(o=!1);else{if(","===e){n+=1,a.push((i+r).trim());break}"("===e&&(o=!0)}r+=e,n+=1}}}return a.join(", ")}(e,a):"style"===c?La(a,Fa()):"object"===u&&"data"===c?Ua(e,a):i&&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,o)?s?s(a):Oa(a):a:Ua(e,a)}function Ga(e,t,n,r,a){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return Ga(e.parentNode,t,n,r,a);if(r&&(e.matches(r)||e.closest(r)))return!1;if(a)return!0;if("string"===typeof t){if(e.classList.contains(t))return!0}else for(let i=0;it.href===e.href));let n=null;t&&(n=Ca(t)),n&&(delete E.rel,delete E.href,E._cssText=La(n,t.href))}if("style"===k&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=Ca(e.sheet);t&&(E._cssText=La(t,Fa()))}if("input"===k||"textarea"===k||"select"===k||"option"===k){const t=e,n=Sa(t),r=ka(t,k.toUpperCase(),n),a=e.checked;"submit"!==n&&"button"!==n&&r&&(E.value=xa({input:t,type:n,tagName:k,value:r,maskInputSelector:d,unmaskInputSelector:p,maskInputOptions:h,maskInputFn:y})),a&&(E.checked=a)}if("option"===k&&(e.selected&&!h.select?E.selected=!0:delete E.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)||(E.rr_dataURL=e.toDataURL(g.type,g.quality));else if(!("__context"in e)){const t=e.toDataURL(g.type,g.quality),n=document.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(g.type,g.quality)&&(E.rr_dataURL=t)}if("img"===k&&b){Ia||(Ia=r.createElement("canvas"),Da=Ia.getContext("2d"));const t=e,n=t.crossOrigin;t.crossOrigin="anonymous";const a=()=>{try{Ia.width=t.naturalWidth,Ia.height=t.naturalHeight,Da.drawImage(t,0,0),E.rr_dataURL=Ia.toDataURL(g.type,g.quality)}catch(e){console.warn(`Cannot inline img src=${t.currentSrc}! Error: ${e}`)}n?E.crossOrigin=n:delete E.crossOrigin};t.complete&&0!==t.naturalWidth?a():t.onload=a}if("audio"!==k&&"video"!==k||(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop),t){const{width:t,height:n}=e.getBoundingClientRect();E={class:E.class,rr_width:`${t}px`,rr_height:`${n}px`}}return"iframe"!==k||w(E.src)||(e.contentDocument||(E.rr_src=E.src),delete E.src),{type:va.Element,tagName:k,attributes:E,childNodes:[],isSVG:(T=e,Boolean("svg"===T.tagName||T.ownerSVGElement)||void 0),needBlock:t,rootId:_};case e.TEXT_NODE:const A=e.parentNode&&e.parentNode.tagName;let O=e.textContent;const C="STYLE"===A||void 0,P="SCRIPT"===A||void 0;if(C&&O){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(O=(x=e.parentNode.sheet).cssRules?Array.from(x.cssRules).map((e=>e.cssText?Ra(e.cssText):"")).join(""):"")}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,e)}O=La(O,Fa())}if(P&&(O="SCRIPT_PLACEHOLDER"),"TEXTAREA"===A&&O)O="";else if("OPTION"===A&&O){O=xa({input:e.parentNode,type:null,tagName:A,value:O,maskInputSelector:d,unmaskInputSelector:p,maskInputOptions:h,maskInputFn:y})}else!C&&!P&&Ga(e,s,c,u,f)&&O&&(O=m?m(O):Oa(O));return{type:va.Text,textContent:O||"",isStyle:C,rootId:_};case e.CDATA_SECTION_NODE:return{type:va.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:va.Comment,textContent:e.textContent||"",rootId:_};default:return!1}var x,T}function Wa(e){return void 0===e||null===e?"":e.toLowerCase()}function Va(e,t){const{doc:n,map:r,blockClass:a,blockSelector:i,unblockSelector:o,maskTextClass:s,maskTextSelector:c,unmaskTextSelector:u,skipChild:l=!1,inlineStylesheet:d=!0,maskInputSelector:p,unmaskInputSelector:f,maskAllText:h,maskInputOptions:m={},maskTextFn:y,maskInputFn:g,slimDOMOptions:b,dataURLOptions:v={},inlineImages:w=!1,recordCanvas:_=!1,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:S=5e3,keepIframeSrcFn:k=(()=>!1)}=t;let{preserveWhiteSpace:E=!0}=t;const A=Ha(e,{doc:n,blockClass:a,blockSelector:i,unblockSelector:o,maskTextClass:s,maskTextSelector:c,unmaskTextSelector:u,inlineStylesheet:d,maskInputSelector:p,unmaskInputSelector:f,maskAllText:h,maskInputOptions:m,maskTextFn:y,maskInputFn:g,dataURLOptions:v,inlineImages:w,recordCanvas:_,keepIframeSrcFn:k});if(!A)return console.warn(e,"not serialized"),null;let O;O="__sn"in e?e.__sn.id:!function(e,t){if(t.comment&&e.type===va.Comment)return!0;if(e.type===va.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&&(Wa(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Wa(e.attributes.name)||"icon"===Wa(e.attributes.rel)||"apple-touch-icon"===Wa(e.attributes.rel)||"shortcut icon"===Wa(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Wa(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Wa(e.attributes.property).match(/^(og|twitter|fb):/)||Wa(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Wa(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Wa(e.attributes.name)||"googlebot"===Wa(e.attributes.name)||"bingbot"===Wa(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Wa(e.attributes.name)||"generator"===Wa(e.attributes.name)||"framework"===Wa(e.attributes.name)||"publisher"===Wa(e.attributes.name)||"progid"===Wa(e.attributes.name)||Wa(e.attributes.property).match(/^article:/)||Wa(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Wa(e.attributes.name)||"yandex-verification"===Wa(e.attributes.name)||"csrf-token"===Wa(e.attributes.name)||"p:domain_verify"===Wa(e.attributes.name)||"verify-v1"===Wa(e.attributes.name)||"verification"===Wa(e.attributes.name)||"shopify-checkout-api-token"===Wa(e.attributes.name)))return!0}}return!1}(A,b)&&(E||A.type!==va.Text||A.isStyle||A.textContent.replace(/^\s+|\s+$/gm,"").length)?Ea++:-2;const C=Object.assign(A,{id:O});if(e.__sn=C,-2===O)return null;r[O]=e,x&&x(e);let P=!l;if(C.type===va.Element&&(P=P&&!C.needBlock,delete C.needBlock,e.shadowRoot&&(C.isShadowHost=!0)),(C.type===va.Document||C.type===va.Element)&&P){b.headWhitespace&&A.type===va.Element&&"head"===A.tagName&&(E=!1);const t={doc:n,map:r,blockClass:a,blockSelector:i,unblockSelector:o,maskTextClass:s,maskTextSelector:c,unmaskTextSelector:u,skipChild:l,inlineStylesheet:d,maskInputSelector:p,unmaskInputSelector:f,maskAllText:h,maskInputOptions:m,maskTextFn:y,maskInputFn:g,slimDOMOptions:b,dataURLOptions:v,inlineImages:w,recordCanvas:_,preserveWhiteSpace:E,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:S,keepIframeSrcFn:k};for(const n of Array.from(e.childNodes)){const e=Va(n,t);e&&C.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=Va(n,t);e&&(e.isShadow=!0,C.childNodes.push(e))}}return e.parentNode&&wa(e.parentNode)&&(C.isShadow=!0),C.type===va.Element&&"iframe"===C.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let a,i=!1;try{a=r.document.readyState}catch(s){return}if("complete"!==a){const r=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),i=!0,t()}))}const o="about:blank";r.location.href===o&&e.src!==o&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}(e,(()=>{const t=e.contentDocument;if(t&&T){const n=Va(t,{doc:t,map:r,blockClass:a,blockSelector:i,unblockSelector:o,maskTextClass:s,maskTextSelector:c,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputSelector:p,unmaskInputSelector:f,maskAllText:h,maskInputOptions:m,maskTextFn:y,maskInputFn:g,slimDOMOptions:b,dataURLOptions:v,inlineImages:w,recordCanvas:_,preserveWhiteSpace:E,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:S,keepIframeSrcFn:k});n&&T(e,n)}}),S),C}function qa(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}var $a,Ya,Ka,Qa,Xa,Ja;function ei(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"}($a||($a={})),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"}(Ya||(Ya={})),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"}(Ka||(Ka={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(Qa||(Qa={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(Xa||(Xa={})),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"}(Ja||(Ja={}));const ti="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 ni={map:{},getId:()=>(console.error(ti),-1),getNode:()=>(console.error(ti),null),removeNodeFromMap(){console.error(ti)},has:()=>(console.error(ti),!1),reset(){console.error(ti)}};function ri(e,t,n={}){let r=null,a=0;return function(i){let o=Date.now();a||!1!==n.leading||(a=o);let s=t-(o-a),c=this,u=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),a=o,e.apply(c,u)):r||!1===n.trailing||(r=setTimeout((()=>{a=!1===n.leading?0:Date.now(),r=null,e.apply(c,u)}),s))}}function ai(e,t,n,r,a=window){const i=a.Object.getOwnPropertyDescriptor(e,t);return a.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>ai(e,t,i||{},!0)}function ii(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],a=n(r);return"function"===typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=a,()=>{e[t]=r}}catch(r){return()=>{}}}function oi(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function si(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ci(e,t,n,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){let a=!1;const i=r&&e.matches(r);return"string"===typeof t?a=void 0!==e.closest?!i&&null!==e.closest("."+t):!i&&e.classList.contains(t):!i&&e.classList.forEach((e=>{t.test(e)&&(a=!0)})),!a&&n&&(a=e.matches(n)),!i&&a||ci(e.parentNode,t,n,r)}return e.nodeType,e.TEXT_NODE,ci(e.parentNode,t,n,r)}function ui(e){return"__sn"in e&&-2===e.__sn.id}function li(e,t){if(wa(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||li(e.parentNode,t))}function di(e){return Boolean(e.changedTouches)}function pi(e){return"__sn"in e&&(e.__sn.type===va.Element&&"iframe"===e.__sn.tagName)}function fi(e){return Boolean(null===e||void 0===e?void 0:e.shadowRoot)}function hi(e){return"__ln"in e}"undefined"!==typeof window&&window.Proxy&&window.Reflect&&(ni=new Proxy(ni,{get:(e,t,n)=>("map"===t&&console.error(ti),Reflect.get(e,t,n))}));class mi{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 gi(e){return"__sn"in e}class bi{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 mi,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 a,i,o,s,c;const u=r.getRootNode?null===(a=r.getRootNode())||void 0===a?void 0:a.host:null;let l=u;for(;null===(o=null===(i=null===l||void 0===l?void 0:l.getRootNode)||void 0===i?void 0:i.call(l))||void 0===o?void 0:o.host;)l=(null===(c=null===(s=null===l||void 0===l?void 0:l.getRootNode)||void 0===s?void 0:s.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 p=wa(r.parentNode)?this.mirror.getId(u):this.mirror.getId(r.parentNode),f=n(r);if(-1===p||-1===f)return t.addNode(r);let h=Va(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=>{pi(e)&&this.iframeManager.addIframe(e),fi(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,document)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)}});h&&e.push({parentId:p,nextId:f,node:h})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const o of this.movedSet)wi(this.removes,o,this.mirror)&&!this.movedSet.has(o.parentNode)||r(o);for(const o of this.addedSet)_i(this.droppedSet,o)||wi(this.removes,o,this.mirror)?_i(this.movedSet,o)?r(o):this.droppedSet.add(o):r(o);let a=null;for(;t.length;){let e=null;if(a){const t=this.mirror.getId(a.value.parentNode),r=n(a.value);-1!==t&&-1!==r&&(e=a)}if(!e)for(let r=t.length-1;r>=0;r--){const a=t.get(r);if(a){const t=this.mirror.getId(a.value.parentNode),r=n(a.value);if(-1!==t&&-1!==r){e=a;break}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}a=e.previous,t.removeNode(e.value),r(e.value)}const i={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};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))},this.processMutation=e=>{if(!ui(e.target))switch(e.type){case"characterData":{const t=e.target.textContent;ci(e.target,this.blockClass,this.blockSelector,this.unblockSelector)||t===e.oldValue||this.texts.push({value:Ga(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=xa({input:n,maskInputSelector:this.maskInputSelector,unmaskInputSelector:this.unmaskInputSelector,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:n.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ci(e.target,this.blockClass,this.blockSelector,this.unblockSelector)||r===e.oldValue)return;let a=this.attributes.find((t=>t.node===e.target));if(a||(a={node:e.target,attributes:{}},this.attributes.push(a)),"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!==a.attributes.style&&null!==a.attributes.style||(a.attributes.style={});try{const e=a.attributes.style;for(const t of Array.from(n.style)){const a=n.style.getPropertyValue(t),i=n.style.getPropertyPriority(t);a===r.style.getPropertyValue(t)&&i===r.style.getPropertyPriority(t)||(e[t]=""===i?a:[a,i])}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;a.attributes[e.attributeName]=za(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=wa(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);ci(e.target,this.blockClass,this.blockSelector,this.unblockSelector)||ui(t)||(this.addedSet.has(t)?(vi(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||li(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[yi(n,r)]?vi(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!!wa(e.target)||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!t||!ci(t,this.blockClass,this.blockSelector,this.unblockSelector)){if(gi(e)){if(ui(e))return;this.movedSet.add(e);let n=null;t&&gi(t)&&(n=t.__sn.id),n&&(this.movedMap[yi(e.__sn.id,n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ci(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 vi(e,t){e.delete(t),t.childNodes.forEach((t=>vi(e,t)))}function wi(e,t,n){const{parentNode:r}=t;if(!r)return!1;const a=n.getId(r);return!!e.some((e=>e.id===a))||wi(e,r,n)}function _i(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||_i(e,n))}const xi=e=>(...t)=>{try{return e(...t)}catch(n){try{n.__rrweb__=!0}catch(r){}throw n}},Ti=[];function Si(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 ki(e,t){var n,r;const a=new bi;Ti.push(a),a.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const o=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");o&&window[o]&&(i=window[o]);const s=new i(xi((t=>{e.onMutation&&!1===e.onMutation(t)||a.processMutations(t)})));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ei({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:a,unblockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,c=[];return Object.keys(Ka).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((o=>{const s=o.toLowerCase(),u=xi((t=>o=>{const s=Si(o);if(ci(s,r,a,i))return;const c=di(o)?o.changedTouches[0]:o;if(!c)return;const u=n.getId(s),{clientX:l,clientY:d}=c;xi(e)({type:Ka[t],id:u,x:l,y:d})})(o));c.push(ei(s,u,t))})),xi((()=>{c.forEach((e=>e()))}))}function Ai({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:a,unblockSelector:i,sampling:o}){const s=ri((o=>{const s=Si(o);if(!s||ci(s,r,a,i))return;const c=n.getId(s);if(s===t){const n=t.scrollingElement||t.documentElement;xi(e)({id:c,x:n.scrollLeft,y:n.scrollTop})}else xi(e)({id:c,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100);return ei("scroll",xi(s),t)}function Oi(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Ci=["INPUT","TEXTAREA","SELECT"],Pi=new WeakMap;function Ri({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:a,unblockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputSelector:c,unmaskInputSelector:u,maskInputOptions:l,maskInputFn:d,sampling:p,userTriggeredOnInput:f}){function h(e){let n=Si(e);const p=n&&n.tagName,h=e.isTrusted;if("OPTION"===p&&(n=n.parentElement),!n||!p||Ci.indexOf(p)<0||ci(n,r,a,i))return;const y=n,g=Sa(y);if(y.classList.contains(o)||s&&y.matches(s))return;let b=ka(y,p,g),v=!1;"radio"!==g&&"checkbox"!==g||(v=n.checked),function({tagName:e,type:t,maskInputOptions:n,maskInputSelector:r}){return r||_a({maskInputOptions:n,tagName:e,type:t})}({maskInputOptions:l,maskInputSelector:c,tagName:p,type:g})&&(b=xa({input:y,maskInputOptions:l,maskInputSelector:c,unmaskInputSelector:u,tagName:p,type:g,value:b,maskInputFn:d})),m(n,xi(Oi)({text:b,isChecked:v,userTriggered:h},f));const w=n.name;"radio"===g&&w&&v&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach((e=>{if(e!==n){const t=xa({input:e,maskInputOptions:l,maskInputSelector:c,unmaskInputSelector:u,tagName:p,type:g,value:ka(e,p,g),maskInputFn:d});m(e,xi(Oi)({text:t,isChecked:!v,userTriggered:!1},f))}}))}function m(t,r){const a=Pi.get(t);if(!a||a.text!==r.text||a.isChecked!==r.isChecked){Pi.set(t,r);const a=n.getId(t);e(Object.assign(Object.assign({},r),{id:a}))}}const y=("last"===p.input?["change"]:["input","change"]).map((e=>ei(e,xi(h),t))),g=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 g&&g.set&&y.push(...b.map((e=>ai(e[0],e[1],{set(){xi(h)({target:this})}})))),xi((()=>{y.forEach((e=>e()))}))}function Ii(e){return function(e,t){if(ji("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ji("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ji("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ji("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 Di(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:a,scrollCb:i,viewportResizeCb:o,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:l,canvasMutationCb:d,fontCb:p}=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),a(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...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),p(...e)}}(e,t);const r=ki(e,e.doc),a=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const a="number"===typeof t.mousemove?t.mousemove:50,i="number"===typeof t.mousemoveCallback?t.mousemoveCallback:500;let o,s=[];const c=ri((t=>{const n=Date.now()-o;xi(e)(s.map((e=>(e.timeOffset-=n,e))),t),s=[],o=null}),i),u=ri((e=>{const t=Si(e),{clientX:n,clientY:a}=di(e)?e.changedTouches[0]:e;o||(o=Date.now()),s.push({x:n,y:a,id:r.getId(t),timeOffset:Date.now()-o}),c("undefined"!==typeof DragEvent&&e instanceof DragEvent?Ya.Drag:e instanceof MouseEvent?Ya.MouseMove:Ya.TouchMove)}),a,{trailing:!1}),l=[ei("mousemove",xi(u),n),ei("touchmove",xi(u),n),ei("drag",xi(u),n)];return xi((()=>{l.forEach((e=>e()))}))}(e),i=Ei(e),o=Ai(e),s=function({viewportResizeCb:e}){let t=-1,n=-1;const r=ri((()=>{const r=oi(),a=si();t===r&&n===a||(xi(e)({width:Number(a),height:Number(r)}),t=r,n=a)}),200);return ei("resize",xi(r),window)}(e),c=Ri(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:a,sampling:i}){const o=o=>ri(xi((i=>{const s=Si(i);if(!s||ci(s,t,n,r))return;const{currentTime:c,volume:u,muted:l}=s;e({type:o,id:a.getId(s),currentTime:c,volume:u,muted:l})})),i.media||500),s=[ei("play",o(0)),ei("pause",o(1)),ei("seeked",o(2)),ei("volumechange",o(3))];return xi((()=>{s.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:xi(((n,r,a)=>{const[i,o]=a,s=t.getId(r.ownerNode);return-1!==s&&e({id:s,adds:[{rule:i,index:o}]}),n.apply(r,a)}))});const a=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:xi(((n,r,a)=>{const[i]=a,o=t.getId(r.ownerNode);return-1!==o&&e({id:o,removes:[{index:i}]}),n.apply(r,a)}))});const i={};Mi("CSSGroupingRule")?i.CSSGroupingRule=n.CSSGroupingRule:(Mi("CSSMediaRule")&&(i.CSSMediaRule=n.CSSMediaRule),Mi("CSSConditionRule")&&(i.CSSConditionRule=n.CSSConditionRule),Mi("CSSSupportsRule")&&(i.CSSSupportsRule=n.CSSSupportsRule));const o={};return Object.entries(i).forEach((([n,r])=>{o[n]={insertRule:r.prototype.insertRule,deleteRule:r.prototype.deleteRule},r.prototype.insertRule=new Proxy(o[n].insertRule,{apply:xi(((n,r,a)=>{const[i,o]=a,s=t.getId(r.parentStyleSheet.ownerNode);return-1!==s&&e({id:s,adds:[{rule:i,index:[...Ii(r),o||0]}]}),n.apply(r,a)}))}),r.prototype.deleteRule=new Proxy(o[n].deleteRule,{apply:xi(((n,r,a)=>{const[i]=a,o=t.getId(r.parentStyleSheet.ownerNode);return-1!==o&&e({id:o,removes:[{index:[...Ii(r),i]}]}),n.apply(r,a)}))})})),xi((()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=a,Object.entries(i).forEach((([e,t])=>{t.prototype.insertRule=o[e].insertRule,t.prototype.deleteRule=o[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:xi(((n,r,a)=>{var i,o;const[s,c,u]=a,l=t.getId(null===(o=null===(i=r.parentRule)||void 0===i?void 0:i.parentStyleSheet)||void 0===o?void 0:o.ownerNode);return-1!==l&&e({id:l,set:{property:s,value:c,priority:u},index:Ii(r.parentRule)}),n.apply(r,a)}))});const a=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:xi(((n,r,a)=>{var i,o;const[s]=a,c=t.getId(null===(o=null===(i=r.parentRule)||void 0===i?void 0:i.parentStyleSheet)||void 0===o?void 0:o.ownerNode);return-1!==c&&e({id:c,remove:{property:s},index:Ii(r.parentRule)}),n.apply(r,a)}))}),xi((()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),p=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],a=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return a.set(r,{family:e,buffer:"string"!==typeof t,descriptors:n,fontSource:"string"===typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const o=ii(t.fonts,"add",(function(t){return function(n){return setTimeout((()=>{const t=a.get(n);t&&(e(t),a.delete(n))}),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=i})),r.push(o),xi((()=>{r.forEach((e=>e()))}))}(e):()=>{},h=[];for(const f of e.plugins)h.push(f.observer(f.callback,n,f.options));return xi((()=>{Ti.forEach((e=>e.reset())),r.disconnect(),a(),i(),o(),s(),c(),u();try{l(),d()}catch(f){}p(),h.forEach((e=>e()))}))}function ji(e){return"undefined"!==typeof window[e]}function Mi(e){return Boolean("undefined"!==typeof window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ni{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 Li{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(ii(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){ki(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Ai(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(ii(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 Bi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zi="undefined"===typeof Uint8Array?[]:new Uint8Array(256),Ui=0;Ui{if(!e||!Wi(e,t)&&"object"!==typeof e)return;const r=function(e,t){let n=Fi.get(e);return n||(n=new Map,Fi.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let a=r.indexOf(e);return-1===a&&(a=r.length,r.push(e)),a};function Gi(e,t,n){if(e instanceof Array)return e.map((e=>Gi(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,a="";for(t=0;t>2],a+=Bi[(3&n[t])<<4|n[t+1]>>4],a+=Bi[(15&n[t+1])<<2|n[t+2]>>6],a+=Bi[63&n[t+2]];return r%3===2?a=a.substring(0,a.length-1)+"=":r%3===1&&(a=a.substring(0,a.length-2)+"=="),a}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Gi(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:[Gi(e.data,t,n),e.width,e.height]}}if(Wi(e,t)||"object"===typeof e){return{rr_type:e.constructor.name,index:zi(e,t,n)}}return e}const Hi=(e,t,n)=>[...e].map((e=>Gi(e,t,n))),Wi=(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 Vi(e,t,n,r,a,i,o,s){const c=[],u=Object.getOwnPropertyNames(e);for(const d of u)try{if("function"!==typeof e[d])continue;const u=ii(e,d,(function(c){return function(...u){const l=c.apply(this,u);if(zi(l,s,e),!ci(this.canvas,r,i,a)){o.getId(this.canvas);const r=Hi([...u],s,e),a={type:t,property:d,args:r};n(this.canvas,a)}return l}}));c.push(u)}catch(l){const r=ai(e,d,{set(e){n(this.canvas,{type:t,property:d,args:[e],setter:!0})}});c.push(r)}return c}class qi{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 a=function(e,t,n,r){const a=[];try{const i=ii(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(a,...i){return ci(this,t,n,r)||"__context"in this||(this.__context=a),e.apply(this,[a,...i])}}));a.push(i)}catch(i){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach((e=>e()))}}(e,t,r,n),i=function(e,t,n,r,a,i){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const u of s)try{if("function"!==typeof t.CanvasRenderingContext2D.prototype[u])continue;const i=ii(t.CanvasRenderingContext2D.prototype,u,(function(t){return function(...i){return ci(this.canvas,n,a,r)||setTimeout((()=>{const t=[...i];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),a=null===r||void 0===r?void 0:r.data;t[0]=JSON.stringify(a)}e(this.canvas,{type:Qa["2D"],property:u,args:t})}),0),t.apply(this,i)}}));o.push(i)}catch(c){const n=ai(t.CanvasRenderingContext2D.prototype,u,{set(t){e(this.canvas,{type:Qa["2D"],property:u,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n,this.mirror),o=function(e,t,n,r,a,i){const o=[];return o.push(...Vi(t.WebGLRenderingContext.prototype,Qa.WebGL,e,n,r,a,i,t)),"undefined"!==typeof t.WebGL2RenderingContext&&o.push(...Vi(t.WebGL2RenderingContext.prototype,Qa.WebGL2,e,n,r,a,i,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n,this.mirror);this.resetObservers=()=>{a(),i(),o()}}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 a=0;for(r=Object.getOwnPropertySymbols(e);ae&&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 Xi(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:a="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:c=null,maskTextClass:u="rr-mask",maskTextSelector:l=null,maskInputSelector:d=null,unmaskTextSelector:p=null,unmaskInputSelector:f=null,inlineStylesheet:h=!0,maskAllText:m=!1,maskAllInputs:y,maskInputOptions:g,slimDOMOptions:b,maskInputFn:v,maskTextFn:w,hooks:_,packFn:x,sampling:T={},mousemoveWait:S,recordCanvas:k=!1,userTriggeredOnInput:E=!1,collectFonts:A=!1,inlineImages:O=!1,plugins:C,keepIframeSrcFn:P=(()=>!1),onMutation:R}=e;if(!t)throw new Error("emit function is required");void 0!==S&&void 0===T.mousemove&&(T.mousemove=S);const I=!0===y?{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!==g?g:{},D=!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 j;!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;Yi=(e,a)=>{var i;if(!(null===(i=Ti[0])||void 0===i?void 0:i.isFrozen())||e.type===$a.FullSnapshot||e.type===$a.IncrementalSnapshot&&e.data.source===Ya.Mutation||Ti.forEach((e=>e.unfreeze())),t((e=>{for(const t of C||[])t.eventProcessor&&(e=t.eventProcessor(e));return x&&(e=x(e)),e})(e),a),e.type===$a.FullSnapshot)j=e,M=0;else if(e.type===$a.IncrementalSnapshot){if(e.data.source===Ya.Mutation&&e.data.isAttachIframe)return;M++;const t=r&&M>=r,a=n&&e.timestamp-j.timestamp>n;(t||a)&&Ki(!0)}};const N=e=>{Yi($i({type:$a.IncrementalSnapshot,data:Object.assign({source:Ya.Mutation},e)}))},L=e=>Yi($i({type:$a.IncrementalSnapshot,data:Object.assign({source:Ya.Scroll},e)})),B=e=>Yi($i({type:$a.IncrementalSnapshot,data:Object.assign({source:Ya.CanvasMutation},e)})),Z=new Ni({mutationCb:N}),U=new qi({recordCanvas:k,mutationCb:B,win:window,blockClass:a,blockSelector:i,unblockSelector:o,mirror:Qi}),F=new Li({mutationCb:N,scrollCb:L,bypassOptions:{onMutation:R,blockClass:a,blockSelector:i,unblockSelector:o,maskTextClass:u,maskTextSelector:l,unmaskTextSelector:p,maskInputSelector:d,unmaskInputSelector:f,inlineStylesheet:h,maskAllText:m,maskInputOptions:I,maskTextFn:w,maskInputFn:v,recordCanvas:k,inlineImages:O,sampling:T,slimDOMOptions:D,iframeManager:Z,canvasManager:U},mirror:Qi});Ki=(e=!1)=>{var t,n,r,s;Yi($i({type:$a.Meta,data:{href:window.location.href,width:si(),height:oi()}}),e),Ti.forEach((e=>e.lock()));const[c,y]=function(e,t){const{blockClass:n="rr-block",blockSelector:r=null,unblockSelector:a=null,maskTextClass:i="rr-mask",maskTextSelector:o=null,unmaskTextSelector:s=null,inlineStylesheet:c=!0,inlineImages:u=!1,recordCanvas:l=!1,maskInputSelector:d=null,unmaskInputSelector:p=null,maskAllText:f=!1,maskAllInputs:h=!1,maskTextFn:m,maskInputFn:y,slimDOM:g=!1,dataURLOptions:b,preserveWhiteSpace:v,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:x,keepIframeSrcFn:T=(()=>!1)}=t||{},S={};return[Va(e,{doc:e,map:S,blockClass:n,blockSelector:r,unblockSelector:a,maskTextClass:i,maskTextSelector:o,unmaskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputSelector:d,unmaskInputSelector:p,maskAllText:f,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:y,slimDOMOptions:!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===g,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===g?{}:g,dataURLOptions:b,inlineImages:u,recordCanvas:l,preserveWhiteSpace:v,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:x,keepIframeSrcFn:T}),S]}(document,{blockClass:a,blockSelector:i,unblockSelector:o,maskTextClass:u,maskTextSelector:l,unmaskTextSelector:p,maskInputSelector:d,unmaskInputSelector:f,inlineStylesheet:h,maskAllText:m,maskAllInputs:I,maskTextFn:w,slimDOM:D,recordCanvas:k,inlineImages:O,onSerialize:e=>{pi(e)&&Z.addIframe(e),fi(e)&&F.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{Z.attachIframe(e,t),F.observeAttachShadow(e)},keepIframeSrcFn:P});if(!c)return console.warn("Failed to snapshot the document");Qi.map=y,Yi($i({type:$a.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===(s=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===s?void 0:s.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),Ti.forEach((e=>e.unlock()))};try{const e=[];e.push(ei("DOMContentLoaded",(()=>{Yi($i({type:$a.DomContentLoaded,data:{}}))})));const t=e=>{var t;return xi(Di)({onMutation:R,mutationCb:N,mousemoveCb:(e,t)=>Yi($i({type:$a.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Yi($i({type:$a.IncrementalSnapshot,data:Object.assign({source:Ya.MouseInteraction},e)})),scrollCb:L,viewportResizeCb:e=>Yi($i({type:$a.IncrementalSnapshot,data:Object.assign({source:Ya.ViewportResize},e)})),inputCb:e=>Yi($i({type:$a.IncrementalSnapshot,data:Object.assign({source:Ya.Input},e)})),mediaInteractionCb:e=>Yi($i({type:$a.IncrementalSnapshot,data:Object.assign({source:Ya.MediaInteraction},e)})),styleSheetRuleCb:e=>Yi($i({type:$a.IncrementalSnapshot,data:Object.assign({source:Ya.StyleSheetRule},e)})),styleDeclarationCb:e=>Yi($i({type:$a.IncrementalSnapshot,data:Object.assign({source:Ya.StyleDeclaration},e)})),canvasMutationCb:B,fontCb:e=>Yi($i({type:$a.IncrementalSnapshot,data:Object.assign({source:Ya.Font},e)})),blockClass:a,ignoreClass:s,ignoreSelector:c,maskTextClass:u,maskTextSelector:l,unmaskTextSelector:p,maskInputSelector:d,unmaskInputSelector:f,maskInputOptions:I,inlineStylesheet:h,sampling:T,recordCanvas:k,inlineImages:O,userTriggeredOnInput:E,collectFonts:A,doc:e,maskAllText:m,maskInputFn:v,maskTextFn:w,blockSelector:i,unblockSelector:o,slimDOMOptions:D,mirror:Qi,iframeManager:Z,shadowDomManager:F,canvasManager:U,plugins:(null===(t=null===C||void 0===C?void 0:C.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Yi($i({type:$a.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},_)};Z.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{Ki(),e.push(t(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(ei("load",(()=>{Yi($i({type:$a.Load,data:{}})),n()}),window)),()=>{e.forEach((e=>e()))}}catch(z){console.warn(z)}}function Ji(e){return e>9999999999?e:1e3*e}function eo(e,t){"sentry.transaction"!==t.category&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate((()=>(e.throttledAddEvent({type:$a.Custom,timestamp:1e3*(t.timestamp||0),data:{tag:"breadcrumb",payload:kt(t,10,1e3)}}),"console"===t.category))))}Xi.addCustomEvent=(e,t)=>{if(!Yi)throw new Error("please add custom event after start recording");Yi($i({type:$a.Custom,data:{tag:e,payload:t}}))},Xi.freezePage=()=>{Ti.forEach((e=>e.freeze()))},Xi.takeFullSnapshot=e=>{if(!Ki)throw new Error("please take full snapshot after start recording");Ki(e)},Xi.mirror=Qi;function to(e){const t=no(e);if(!t||!(t instanceof Element))return t;return t.closest("button,a")||t}function no(e){return function(e){return"object"===typeof e&&!!e&&"target"in e}(e)?e.target:e}let ro;function ao(e){return ro||(ro=[],ie(pa,"open",(function(e){return function(...t){if(ro)try{ro.forEach((e=>e()))}catch(f){}return e.apply(pa,t)}}))),ro.push(e),()=>{const t=ro?ro.indexOf(e):-1;t>-1&&ro.splice(t,1)}}class io{constructor(e,t,n=eo){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=so()},t=ao((()=>{this._lastMutation=so()})),n=e=>{if(!e.target)return;const t=to(e);t&&this._handleMultiClick(t)},r=new MutationObserver((()=>{this._lastMutation=so()}));r.observe(pa.document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),pa.addEventListener("scroll",e,{passive:!0}),pa.addEventListener("click",n,{passive:!0}),this._teardown=()=>{pa.removeEventListener("scroll",e),pa.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(!oo.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=so();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,a=!n&&!r,{clickCount:i,clickBreadcrumb:o}=e;if(a){const n=1e3*Math.min(e.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",a={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.slowClickDetected",data:{...o.data,url:pa.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:i||1}};this._addBreadcrumbEvent(t,a)}else if(i>1){const e={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.multiClick",data:{...o.data,url:pa.location.href,route:t.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout((()=>this._checkClicks()),1e3)}}const oo=["A","BUTTON","INPUT"];function so(){return Date.now()/1e3}function co(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var uo;!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"}(uo||(uo={}));const lo=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled"]);function po(e){const t={};for(const n in e)if(lo.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),t[r]=e[n]}return t}const fo=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?to(e.event):no(e.event),n=Y(r,{maxStringLength:200})||""}catch(f){n=""}return{target:r,message:n}}(e);return co({category:`ui.${e.name}`,...ho(t,n)})}(t);if(!n)return;const r="click"===t.name,a=r&&t.event;!(r&&e.clickDetector&&a)||a.altKey||a.metaKey||a.ctrlKey||a.shiftKey||function(e,t,n){e.handleClick(t,n)}(e.clickDetector,n,to(t.event)),eo(e,n)};function ho(e,t){const n=e&&function(e){return"__sn"in e}(e)&&e.__sn.type===uo.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===uo.Text&&e.__sn.textContent)).filter(Boolean).map((e=>e.trim())).join(""):"",attributes:po(n.attributes)}}:{}}}function mo(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=function(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:a,key:i,target:o}=e;if(!o||function(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable}(o)||!i)return null;const s=t||r||a,c=1===i.length;if(!s&&c)return null;const u=Y(o,{maxStringLength:200})||"",l=ho(o,u);return co({category:"ui.keyDown",message:u,data:{...l.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:a,key:i}})}(t);n&&eo(e,n)}const yo=["name","type","startTime","transferSize","duration"];function go(e){return function(t){return yo.every((n=>e[n]===t[n]))}}function bo(e){const t=new PerformanceObserver((t=>{const n=function(e,t){const[n,r,a]=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)),[[],[],[]]),i=[],o=[];let s=r.length?r[r.length-1]:void 0;return t.forEach((e=>{if("largest-contentful-paint"!==e.entryType)if("navigation"!==e.entryType)i.push(e);else{const t=e;e.duration>0&&!n.find(go(t))&&!o.find(go(t))&&o.push(t)}else(!s||s.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(f){}})),t}function vo(e,t){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(ee.info(e),t&&_o(e))}function wo(e,t){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(ee.info(e),t&&setTimeout((()=>{_o(e)}),0))}function _o(e){Be().addBreadcrumb({category:"console",data:{logger:"replay"},level:"info",message:e},{level:"info"})}class xo extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class To{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>ga)throw new xo;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?Ji(e):null}}class So{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(){vo("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(e,t){const n=this._getAndIncrementId();return new Promise(((r,a)=>{const i=({data:t})=>{const o=t;if(o.method===e&&o.id===n){if(this._worker.removeEventListener("message",i),!o.success)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.error("[Replay]",o.response),void a(new Error("Error in compression worker"));r(o.response)}};this._worker.addEventListener("message",i),this._worker.postMessage({id:n,method:e,arg:t})}))}_getAndIncrementId(){return this._id++}}class ko{constructor(e){this._worker=new So(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=Ji(e.timestamp);(!this._earliestTimestamp||tga?Promise.reject(new xo):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 Eo{constructor(e){this._fallback=new To,this._compression=new ko(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 vo("[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 a of e)n.push(this._compression.addEvent(a));this._compression.hasCheckout=t,this._used=this._compression;try{await Promise.all(n)}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("[Replay] Failed to add events when switching buffers.",r)}}}function Ao({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)}();vo("[Replay] Using compression worker");const t=new Worker(e);return new Eo(t)}catch(t){vo("[Replay] Failed to create compression worker")}return vo("[Replay] Using simple buffer"),new To}function Oo(){try{return"sessionStorage"in pa&&!!pa.sessionStorage}catch(f){return!1}}function Co(e){!function(){if(!Oo())return;try{pa.sessionStorage.removeItem(fa)}catch(f){}}(),e.session=void 0}function Po(e){return void 0!==e&&Math.random()e.getContext().initialTimestamp+e.getOptions().maxReplayDuration)||(vo(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,e.getOptions()._experiments.traceInternals),!1))}function Fo(e){return!e.type}function zo(e){return"transaction"===e.type}function Go(e){const t=function(){const e=Be().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()||!Fo(n)&&!zo(n))return;const a=r&&r.statusCode;t&&(!a||a<200||a>=300)||(zo(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 Ho(e,t=!1){const n=t?Go(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(!Fo(t)&&!zo(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__)&&ee.log("[Replay] Ignoring error from rrweb internals",t),null;const a=function(e,t){return"buffer"===e.recordingMode&&t.message!==ha&&!(!t.exception||t.type)&&Po(e.getOptions().errorSampleRate)}(e,t);return(a||"session"===e.recordingMode)&&(t.tags={...t.tags,replayId:e.getSessionId()}),n&&n(t,{statusCode:200}),t}),{id:"Replay"})}function Wo(e,t){return t.map((({type:t,start:n,end:r,name:a,data:i})=>{const o=e.throttledAddEvent({type:$a.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:t,description:a,startTimestamp:n,endTimestamp:r,data:i}}});return"string"===typeof o?Promise.resolve(null):o}))}function Vo(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((()=>(Wo(e,[n]),!1))))}}function qo(e,t){return("undefined"!==typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__||!e.getOptions()._experiments.traceInternals)&&function(e){const t=Be().getClient(),n=t&&t.getDsn();return!!n&&e.includes(n.host)}(t)}function $o(e,t){e.isEnabled()&&null!==t&&(qo(e,t.name)||e.addUpdate((()=>(Wo(e,[t]),!0))))}const Yo=10,Ko=11,Qo=12,Xo=13,Jo=14,es=15,ts=20,ns=21,rs=22,as=23,is=["true","false","null"];function os(e,t){if(!t.length)return e;let n=e;const r=t.length-1;n=function(e,t){switch(t){case Yo:return`${e}"~~":"~~"`;case 11:return`${e}:"~~"`;case 12:return`${e}~~":"~~"`;case Xo:return function(e){const t=e.lastIndexOf(":"),n=e.slice(t+1);if(is.includes(n.trim()))return`${e},"~~":"~~"`;return`${e.slice(0,t+1)}"~~"`}(e);case 14:return`${e}~~"`;case es:return`${e},"~~":"~~"`;case ts:return`${e}"~~"`;case ns: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 is.includes(n.trim())?`${e},"~~"`:`${e.slice(0,t+1)}"~~"`}return e}(e);case 22:return`${e}~~"`;case as:return`${e},"~~"`}return e}(n,t[r]);for(let a=r;a>=0;a--){switch(t[a]){case Yo:n=`${n}}`;break;case ts:n=`${n}]`}}return n}function ss(e,t,n){const r=e[e.length-1],a=t[n];if(!/\s/.test(a))if('"'!==a||cs(t,n))switch(a){case"{":!function(e,t){if(!t)return void e.push(Yo);if(t===Xo)return void e.push(Yo);t===ns&&e.push(Yo);if(t===ts)e.push(Yo)}(e,r);break;case"[":!function(e,t){if(!t)return e.push(ts),void e.push(ns);if(t===Xo)return e.push(ts),void e.push(ns);t===ns&&(e.push(ts),e.push(ns));if(t===ts)e.push(ts),e.push(ns)}(e,r);break;case":":!function(e,t){t===Ko&&(e.pop(),e.push(Xo))}(e,r);break;case",":!function(e,t){if(t===Xo)return void e.pop();if(t===es)return e.pop(),void e.pop();if(t===ns)return;if(t===as)e.pop()}(e,r);break;case"}":!function(e,t){t===Yo&&e.pop();t===Xo&&(e.pop(),e.pop());t===es&&(e.pop(),e.pop(),e.pop());e[e.length-1]===Xo&&e.push(es);e[e.length-1]===ns&&e.push(as)}(e,r);break;case"]":!function(e,t){t===ts&&e.pop();t===ns&&(e.pop(),e.pop());t===as&&(e.pop(),e.pop(),e.pop());e[e.length-1]===Xo&&e.push(es);e[e.length-1]===ns&&e.push(as)}(e,r)}else!function(e,t){if(t===Jo)return e.pop(),void e.push(es);if(t===rs)return e.pop(),void e.push(as);if(t===Xo)return void e.push(Jo);if(t===ns)return void e.push(rs);if(t===Yo)return void e.push(Qo);if(t===Qo)e.pop(),e.push(11)}(e,r)}function cs(e,t){return"\\"===e[t-1]&&!cs(e,t-1)}function us(e){return os(e,function(e){const t=[];for(let n=0;nma;if(function(e){const t=e[0],n=e[e.length-1];return"["===t&&"]"===n||"{"===t&&"}"===n}(e))try{const n=t?us(e.slice(0,ma)):e;return{body:JSON.parse(n),warnings:t?["JSON_TRUNCATED"]:[]}}catch(n){return{body:t?`${e.slice(0,ma)}\u2026`:e,warnings:t?["INVALID_JSON","TEXT_TRUNCATED"]:["INVALID_JSON"]}}return{body:t?`${e.slice(0,ma)}\u2026`:e,warnings:t?["TEXT_TRUNCATED"]:[]}}(n);return r.body=a,i.length>0&&(r._meta={warnings:i}),r}function ys(e,t){return Object.keys(e).reduce(((n,r)=>{const a=r.toLowerCase();return t.includes(a)&&e[r]&&(n[a]=e[r]),n}),{})}function gs(e){return new URLSearchParams(e).toString()}function bs(e,t){const n=function(e,t=pa.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(pa.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 ae(n,t)}async function vs(e,t,n){try{const r=await async function(e,t,n){const{startTimestamp:r,endTimestamp:a}=t,{url:i,method:o,status_code:s=0,request_body_size:c,response_body_size:u}=e.data,l=bs(i,n.networkDetailAllowUrls)&&!bs(i,n.networkDetailDenyUrls),d=l?function({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const a=function(e,t){if(1===e.length&&"string"!==typeof e[0])return xs(e[0],t);if(2===e.length)return xs(e[1],t);return{}}(n,t);if(!e)return ms(a,r,void 0);const i=ps(ws(n));return ms(a,r,i)}(n,t.input,c):hs(c),p=await async function(e,{networkCaptureBodies:t,textEncoder:n,networkResponseHeaders:r},a,i){if(!e&&void 0!==i)return hs(i);const o=_s(a.headers,r);if(!t&&void 0!==i)return ms(o,i,void 0);try{const r=a.clone(),s=await async function(e){try{return await e.text()}catch(t){return}}(r),c=s&&s.length&&void 0===i?ls(s,n):i;return e?ms(o,c,t?s:void 0):hs(c)}catch(f){return ms(o,i,void 0)}}(l,n,t.response,u);return{startTimestamp:r,endTimestamp:a,url:i,method:o,statusCode:s,request:d,response:p}}(e,t,n),a=fs("resource.fetch",r);$o(n.replay,a)}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.error("[Replay] Failed to capture fetch breadcrumb",r)}}function ws(e=[]){if(2===e.length&&"object"===typeof e[1])return e[1].body}function _s(e,t){const n={};return t.forEach((t=>{e.get(t)&&(n[t]=e.get(t))})),n}function xs(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?_s(n,t):Array.isArray(n)?{}:ys(n,t):{}}async function Ts(e,t,n){try{const r=function(e,t,n){const{startTimestamp:r,endTimestamp:a,input:i,xhr:o}=t,{url:s,method:c,status_code:u=0,request_body_size:l,response_body_size:d}=e.data;if(!s)return null;if(!bs(s,n.networkDetailAllowUrls)||bs(s,n.networkDetailDenyUrls)){return{startTimestamp:r,endTimestamp:a,url:s,method:c,statusCode:u,request:hs(l),response:hs(d)}}const p=o.__sentry_xhr_v2__,f=p?ys(p.request_headers,n.networkRequestHeaders):{},h=ys(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}),{})}(o),n.networkResponseHeaders),m=ms(f,l,n.networkCaptureBodies?ps(i):void 0),y=ms(h,d,n.networkCaptureBodies?t.xhr.responseText:void 0);return{startTimestamp:r,endTimestamp:a,url:s,method:c,statusCode:u,request:m,response:y}}(e,t,n),a=fs("resource.xhr",r);$o(n.replay,a)}catch(r){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.error("[Replay] Failed to capture fetch breadcrumb",r)}}function Ss(e){const t=Be().getClient();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:a,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:s}=e.getOptions(),c={replay:e,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:a,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:s};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:a}=t,i=ls(a,n.textEncoder),o=r.getResponseHeader("content-length")?ds(r.getResponseHeader("content-length")):ls(r.response,n.textEncoder);void 0!==i&&(e.data.request_body_size=i),void 0!==o&&(e.data.response_body_size=o)}(t,n,e),Ts(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:a}=t,i=ls(ws(r),n.textEncoder),o=a?ds(a.headers.get("content-length")):void 0;void 0!==i&&(e.data.request_body_size=i),void 0!==o&&(e.data.response_body_size=o)}(t,n,e),vs(t,n,e))}catch(f){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("Error when enriching network breadcrumb")}}(c,e,t))):(dt("fetch",function(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{startTimestamp:t,endTimestamp:n,fetchData:r,response:a}=e;if(!n)return null;const{method:i,url:o}=r;return{type:"resource.fetch",start:t/1e3,end:n/1e3,name:o,data:{method:i,statusCode:a?a.status:void 0}}}(t);$o(e,n)}}(e)),dt("xhr",function(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{startTimestamp:t,endTimestamp:n,xhr:r}=e,a=r.__sentry_xhr_v2__;if(!t||!n||!a)return null;const{method:i,url:o,status_code:s}=a;return void 0===o?null:{type:"resource.xhr",name:o,start:t/1e3,end:n/1e3,data:{method:i,statusCode:s}}}(t);$o(e,n)}}(e)))}catch(n){}}let ks=null;const Es=e=>t=>{if(!e.isEnabled())return;const n=function(e){const t=e.getLastBreadcrumb&&e.getLastBreadcrumb();if(ks===t||!t)return null;if(ks=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 co(e);let n=!1;const r=t.map((e=>{if(!e)return e;if("string"===typeof e)return e.length>ya?(n=!0,`${e.slice(0,ya)}\u2026`):e;if("object"===typeof e)try{const t=kt(e,7),r=JSON.stringify(t);if(r.length>ya){const e=us(r.slice(0,ya)),t=JSON.parse(e);return n=!0,t}return t}catch(f){}return e}));return co({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(t);return co(t)}(t);n&&eo(e,n)};function As(e){return!(!e||!e.on)}function Os(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,a=Date.now()/1e3;return{type:"memory",name:"memory",start:a,end:a,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}const Cs={resource:function(e){const{entryType:t,initiatorType:n,name:r,responseEnd:a,startTime:i,decodedBodySize:o,encodedBodySize:s,responseStatus:c,transferSize:u}=e;if(["fetch","xmlhttprequest"].includes(n))return null;return{type:`${t}.${n}`,start:Rs(i),end:Rs(a),name:r,data:{size:u,statusCode:c,decodedBodySize:o,encodedBodySize:s}}},paint:function(e){const{duration:t,entryType:n,name:r,startTime:a}=e,i=Rs(a);return{type:n,name:r,start:i,end:i+t,data:void 0}},navigation:function(e){const{entryType:t,name:n,decodedBodySize:r,duration:a,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:l,loadEventEnd:d,redirectCount:p,startTime:f,transferSize:h,type:m}=e;if(0===a)return null;return{type:`${t}.${m}`,start:Rs(f),end:Rs(i),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:o,duration:a,domInteractive:u,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,loadEventStart:l,loadEventEnd:d,domComplete:i,redirectCount:p}}},"largest-contentful-paint":function(e){const{entryType:t,startTime:n,size:r}=e;let a=0;if(pa.performance){const e=pa.performance.getEntriesByType("navigation")[0];a=e&&e.activationStart||0}const i=Math.max(n-a,0),o=Rs(a)+i/1e3;return{type:t,name:t,start:o,end:o,data:{value:i,size:r,nodeId:Xi.mirror.getId(e.element)}}}};function Ps(e){return void 0===Cs[e.entryType]?null:Cs[e.entryType](e)}function Rs(e){return((Oe.Z1||pa.performance.timeOrigin)+e)/1e3}function Is(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession())return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.warn("[Replay] Received replay event after session expired."));const a=r||!t;t=!0,e.addUpdate((()=>{if("buffer"===e.recordingMode&&a&&e.setInitialState(),!Bo(e,n,a))return!0;if(!a)return!1;if(function(e,t){if(!t||!e.session||0!==e.session.segmentId)return;Bo(e,function(e){const t=e.getOptions();return{type:$a.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,a),e.session&&e.session.previousSessionId)return!0;if("buffer"===e.recordingMode&&e.session&&e.eventBuffer){const t=e.eventBuffer.getEarliestTimestamp();t&&(vo(`[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&&Ro(e.session))}return"session"===e.recordingMode&&e.flush(),!0}))}}async function Ds({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:a,session:i}){const o=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:s,errorIds:c,traceIds:u,initialTimestamp:l}=r,d=Be(),p=d.getClient(),h=d.getScope(),m=p&&p.getTransport(),y=p&&p.getDsn();if(!p||!m||!y||!i.sampled)return;const g={type:"replay_event",replay_start_timestamp:l/1e3,timestamp:a/1e3,error_ids:c,trace_ids:u,urls:s,replay_id:t,segment_id:n,replay_type:i.sampled},b=await async function({client:e,scope:t,replayId:n,event:r}){const a={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,a);const i=await Gt(e.getOptions(),r,a,t,e);if(!i)return null;i.platform=i.platform||"javascript";const o=e.getSdkMetadata&&e.getSdkMetadata(),{name:s,version:c}=o&&o.sdk||{};return i.sdk={...i.sdk,name:s||"sentry.javascript.unknown",version:c||"0.0.0"},i}({scope:h,client:p,replayId:t,event:g});if(!b)return p.recordDroppedEvent("event_processor","replay",g),void vo("An event processor returned `null`, will not send event.");delete b.sdkProcessingMetadata;const v=function(e,t,n,r){return Ot(Lt(e,Nt(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:"string"===typeof t?(new TextEncoder).encode(t).length:t.length},t]])}(b,o,y,p.getOptions().tunnel);let w;try{w=await m.send(v)}catch(_){const e=new Error(ha);try{e.cause=_}catch(f){}throw e}if(!w)return w;if("number"===typeof w.statusCode&&(w.statusCode<200||w.statusCode>=300))throw new js(w.statusCode);return w}class js extends Error{constructor(e){super(`Transport returned status code ${e}`)}}async function Ms(e,t={count:0,interval:5e3}){const{recordingData:n,options:r}=e;if(n.length)try{return await Ds(e),!0}catch(a){if(a instanceof js)throw a;if(function(e,t){Be().setContext(e,t)}("Replays",{_retryCount:t.count}),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r._experiments&&r._experiments.captureExceptions&&rn(a),t.count>=3){const e=new Error("Unable to send Replay - max retries exceeded");try{e.cause=a}catch(f){}throw e}return t.interval*=++t.count,new Promise(((n,r)=>{setTimeout((async()=>{try{await Ms(e,t),n(!0)}catch(a){r(a)}}),t.interval)}))}}const Ns="__THROTTLED";function Ls(e,t,n){const r=new Map;let a=!1;return(...i)=>{const o=Math.floor(Date.now()/1e3);if((e=>{const t=e-n;r.forEach(((e,n)=>{ne+t),0)>=t){const e=a;return a=!0,e?"__SKIPPED":Ns}a=!1;const s=r.get(o)||0;return r.set(o,s+1),e(...i)}}class Bs{constructor({options:e,recordingOptions:t}){Bs.prototype.__init.call(this),Bs.prototype.__init2.call(this),Bs.prototype.__init3.call(this),Bs.prototype.__init4.call(this),Bs.prototype.__init5.call(this),Bs.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,a,i;const o=n&&n.maxWait?Math.max(n.maxWait,t):0;function s(){return c(),r=e(),r}function c(){void 0!==a&&clearTimeout(a),void 0!==i&&clearTimeout(i),a=i=void 0}function u(){return a&&clearTimeout(a),a=setTimeout(s,t),o&&void 0===i&&(i=setTimeout(s,o)),r}return u.cancel=c,u.flush=function(){return void 0!==a||void 0!==i?s():r},u}((()=>this._flush()),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Ls(((e,t)=>function(e,t,n){return Uo(e,t)?Zo(e,t,n):Promise.resolve(null)}(this,e,t)),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),a=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;a&&(this.clickDetector=new io(this,a))}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",wo(`[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");wo("[Replay] Starting replay in session mode",this._options._experiments.traceInternals);const e=Lo({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");wo("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const e=Lo({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=Xi({...this._recordingOptions,..."buffer"===this.recordingMode&&{checkoutEveryNms:6e4},emit:Is(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{vo("[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,Co(this)}catch(n){this._handleException(n)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),vo("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),vo("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();const t=Date.now();vo("[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&&jo(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled))return!!this._checkSession();this.pause()}setInitialState(){const e=`${pa.location.pathname}${pa.location.hash}${pa.location.search}`,t=`${pa.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===Ns){const e=co({category:"replay.throttled"});this.addUpdate((()=>!Bo(this,{type:5,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e,metric:!0}})))}return n}getCurrentRoute(){const e=this.lastTransaction||Be().getScope().getTransaction();if(e&&["route","custom"].includes(e.metadata.source))return e.name}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Ao({useCompression:this._options.useCompression}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(e){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.error("[Replay]",e),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this._options._experiments&&this._options._experiments.captureExceptions&&rn(e)}_initializeSessionForSampling(e){const t=this._options.errorSampleRate>0,n=Lo({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!No(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{pa.document.addEventListener("visibilitychange",this._handleVisibilityChange),pa.addEventListener("blur",this._handleWindowBlur),pa.addEventListener("focus",this._handleWindowFocus),pa.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(!function(e){const t=Be().getScope(),n=Be().getClient();t.addScopeListener(Es(e)),dt("dom",fo(e)),dt("history",Vo(e)),Ss(e);const r=Ho(e,!As(n));n&&n.addEventProcessor?n.addEventProcessor(r):Ee(r),As(n)&&(n.on("afterSendEvent",Go(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 pa&&(this._performanceObserver=bo(this))}_removeListeners(){try{pa.document.removeEventListener("visibilitychange",this._handleVisibilityChange),pa.removeEventListener("blur",this._handleWindowBlur),pa.removeEventListener("focus",this._handleWindowFocus),pa.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"===pa.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=co({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=co({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{mo(this,e)}}_doChangeToBackgroundTasks(e){if(!this.session)return;Mo(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):vo("[Replay] Document has become active, but session has expired")}_triggerFullSnapshot(e=!0){try{vo("[Replay] Taking full rrweb snapshot"),Xi.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:$a.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})}))}_addPerformanceEntries(){const e=[...this.performanceEvents];return this.performanceEvents=[],Promise.all(Wo(this,function(e){return e.map(Ps).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 a=await this.eventBuffer.finish();await Ms({replayId:e,recordingData:a,segmentId:r,eventContext:n,session:this.session,options:this.getOptions(),timestamp:t})}catch(t){this._handleException(t),this.stop({reason:"sendReplay"});const e=Be().getClient();e&&e.recordDroppedEvent("send_error","replay")}}else("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.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__)&&ee.error("[Replay] Attempting to finish replay event after session expired."));if(!this.session)return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.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||a)return vo(`[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 i=this.eventBuffer;if(i&&0===this.session.segmentId&&!i.hasCheckout&&vo("[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(o){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&ee.error(o)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&Ro(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=co({category:"replay.mutations",data:{count:t,limit:r}});this._createCustomBreadcrumb(e)}return!r||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}}function Zs(e,t,n,r){const a=[...e,..."string"===typeof r?r.split(","):[],...t];return"undefined"!==typeof n&&("string"===typeof n&&a.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.")),a.join(",")}function Us({mask:e,unmask:t,block:n,unblock:r,ignore:a,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,ignoreClass:u}){const l=Zs(e,[".sentry-mask","[data-sentry-mask]"],s,c),d=Zs(t,[".sentry-unmask","[data-sentry-unmask]"]),p={maskTextSelector:l,unmaskTextSelector:d,maskInputSelector:l,unmaskInputSelector:d,blockSelector:Zs(n,[".sentry-block","[data-sentry-block]",'base[href="/"]'],i,o),unblockSelector:Zs(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:Zs(a,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],u)};return i instanceof RegExp&&(p.blockClass=i),s instanceof RegExp&&(p.maskTextClass=s),p}function Fs(){return"undefined"!==typeof window&&(!(0,la.KV)()||"undefined"!==typeof da&&"renderer"===da.type)}const zs='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Gs=["content-length","content-type","accept"];let Hs=!1;class Ws{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=5e3,flushMaxDelay:t=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:a=!0,useCompression:i=!0,_experiments:o={},sessionSampleRate:s,errorSampleRate:c,maskAllText:u=!0,maskAllInputs:l=!0,blockAllMedia:d=!0,mutationBreadcrumbLimit:p=750,mutationLimit:f=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:y=[],networkDetailDenyUrls:g=[],networkCaptureBodies:b=!0,networkRequestHeaders:v=[],networkResponseHeaders:w=[],mask:_=[],unmask:x=[],block:T=[],unblock:S=[],ignore:k=[],maskFn:E,beforeAddRecordingEvent:A,blockClass:O,blockSelector:C,maskInputOptions:P,maskTextClass:R,maskTextSelector:I,ignoreClass:D}={}){if(this.name=Ws.id,this._recordingOptions={maskAllInputs:l,maskAllText:u,maskInputOptions:{...P||{},password:!0},maskTextFn:E,maskInputFn:E,...Us({mask:_,unmask:x,block:T,unblock:S,ignore:k,blockClass:O,blockSelector:C,maskTextClass:R,maskTextSelector:I,ignoreClass:D}),slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,15e3),maxReplayDuration:Math.min(r,ba),stickySession:a,sessionSampleRate:s,errorSampleRate:c,useCompression:i,blockAllMedia:d,maskAllInputs:l,maskAllText:u,mutationBreadcrumbLimit:p,mutationLimit:f,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:y,networkDetailDenyUrls:g,networkCaptureBodies:b,networkRequestHeaders:Vs(v),networkResponseHeaders:Vs(w),beforeAddRecordingEvent:A,_experiments:o},"number"===typeof s&&(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: ${s} })`),this._initialOptions.sessionSampleRate=s),"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},${zs}`:zs),this._isInitialized&&Fs())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Hs}set _isInitialized(e){Hs=e}setupOnce(){Fs()&&(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=Be().getClient(),n=t&&t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...pe(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 Bs({options:e,recordingOptions:this._recordingOptions})}}function Vs(e){return[...Gs,...e.map((e=>e.toLowerCase()))]}Ws.__initStatic();var qs=n(241),$s=n(9008),Ys=n(67294),Ks=n(40481),Qs=n(83454),Xs=n(78544),Js=n(77537),ec=n(25298),tc=n(49501),nc=n(13902);var rc=Ys.forwardRef((function(e,t){return Ys.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),Ys.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"}))})),ac=n(61953),ic=n(81645),oc=n(29630),sc=n(75084),cc=n(31959),uc=n(68861),lc=n(85893),dc=function(e){var t=e.address,n=e.onDisconnectWallet;return(0,lc.jsx)(cc.P,{open:!0,withCloseButton:!1,setOpen:function(e){},children:(0,lc.jsxs)(ac.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,lc.jsx)(ic.Z,{sx:{fontSize:"24px",color:"warning.main",mb:2},children:(0,lc.jsx)(nc.Z,{})}),(0,lc.jsx)(oc.Z,{variant:"h2",children:(0,lc.jsx)(tc.cC,{id:"Blocked Address"})}),(0,lc.jsx)(oc.Z,{variant:"helperText",sx:{my:4},children:t}),(0,lc.jsxs)(oc.Z,{variant:"description",sx:{textAlign:"center",mb:4},children:[(0,lc.jsx)(tc.cC,{id:"This address is blocked on app.aave.com because it is associated with one or more"})," ",(0,lc.jsx)(uc.rU,{href:"https://docs.aave.com/faq/#address-screening",underline:"always",children:(0,lc.jsx)(tc.cC,{id:"blocked activities"})}),"."]}),(0,lc.jsxs)(sc.Z,{variant:"contained",onClick:n,children:[(0,lc.jsx)(ic.Z,{fontSize:"small",sx:{mx:1},children:(0,lc.jsx)(rc,{})}),(0,lc.jsx)(tc.cC,{id:"Disconnect Wallet"})]})]})})},pc=function(e){var t=e.children,n=(0,Js.Z)(),r=n.currentAccount,i=n.disconnectWallet,o=n.readOnlyMode,s=n.loading,c=function(e){var t=(0,Ys.useState)(!0),n=t[0],r=t[1],i="".concat(Qs.env.NEXT_PUBLIC_API_BASEURL,"/addresses/status"),o="?address=".concat(e),s=function(){var t=(0,a.Z)(l().mark((function t(){var n,a;return l().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+o);case 4:if(!(n=t.sent).ok){t.next=10;break}return t.next=8,n.json();case 8:a=t.sent,r(a.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,Ks.W)(s,12e4,!1,[e]),{isAllowed:n}}(o||s||ec.p8?"":r);return c.isAllowed?(0,lc.jsx)(lc.Fragment,{children:t}):(0,lc.jsxs)(Xs.Z,{children:[(0,lc.jsx)(dc,{address:r,onDisconnectWallet:i}),";"]})};function fc(e){var t=e.title,n=e.description,r=e.imageUrl,a=e.timestamp;return(0,lc.jsxs)($s.default,{children:[(0,lc.jsxs)("title",{children:["ZeroLend - ",t]}),(0,lc.jsx)("meta",{name:"description",content:n},"description"),(0,lc.jsx)("meta",{property:"og:title",content:"ZeroLend - ".concat(t)},"title"),(0,lc.jsx)("meta",{property:"og:description",content:n},"ogdescription"),r&&(0,lc.jsx)("meta",{property:"og:image",content:r},"ogimage"),r&&(0,lc.jsx)("meta",{name:"twitter:image",content:r},"twitterimage"),(0,lc.jsx)("meta",{name:"twitter:site",content:"@zerolendxyz"},"twittersite"),(0,lc.jsx)("meta",{property:"twitter:card",content:r?"summary_large_image":"summary"},"twittercard"),(0,lc.jsx)("meta",{name:"twitter:title",content:t},"twittertitle"),(0,lc.jsx)("meta",{name:"twitter:description",content:n},"twitterdescription"),a&&(0,lc.jsx)("meta",{name:"revised",content:a},"timestamp"),(0,lc.jsx)("meta",{name:"keywords",content:"Decentralized Finance, DeFi, lending, borrowing, stablecoins, Ethereum, assets, erc-20, smart contracts, open finance, trustless"},"keywords"),(0,lc.jsx)("meta",{name:"apple-mobile-web-app-title",content:"ZeroLend"}),(0,lc.jsx)("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),(0,lc.jsx)("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black"})]})}var hc=n(24834),mc=function(e){var t={};return Object.keys(e.transactions).forEach((function(n){var r=+n,a=Object.keys(e.transactions[r]).filter((function(t){return"success"===e.transactions[r][t].txState}));t[r]=a.reduce((function(t,n){return t[n]=e.transactions[r][n],t}),{})})),t},yc=n(57609);function gc(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 bc(e){for(var t=1;tc&&("#"!==o[l]||!Kc(e[l]));)l-=1;return!Kc(e[d])||"left"===n&&t!==c||t-l=o?r+=tu("0",i-o):r=(r.substring(0,i)||"0")+"."+r.substring(i),t+r}(s),c=!0),"Infinity"===s&&c&&(s=""),c&&!n&&"number"===typeof r&&(s=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,a=Jc(e),i=a.beforeDecimal,o=a.afterDecimal,s=a.hasNagation,c=parseFloat("0."+(o||"0")),u=(o.length<=t?"0."+o:c.toFixed(t)).split(".");return(s?"-":"")+i.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),u[0])+(r?".":"")+eu(u[1]||"",Math.min(t,o.length),n)}(s,r,a)),c?this.formatNumString(s):this.formatInput(s))},t.prototype.formatNegation=function(e){void 0===e&&(e="");var t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),a=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),a&&!i&&t&&(e="-"+e),e},t.prototype.formatInput=function(e){return void 0===e&&(e=""),this.props.format||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)},t.prototype.isCharacterAFormat=function(e,t){var n=this.props,r=n.format,a=n.prefix,i=n.suffix,o=n.decimalScale,s=n.fixedDecimalScale,c=this.getSeparators().decimalSeparator;return"string"===typeof r&&"#"!==r[e]||!(r||!(e=t.length-i.length||o&&s&&t[e]===c))},t.prototype.correctInputValue=function(e,t,n){var r=this,a=this.props,i=a.format,o=a.allowNegative,s=a.prefix,c=a.suffix,u=a.decimalScale,l=this.getSeparators(),d=l.allowedDecimalSeparators,p=l.decimalSeparator,f=this.state.numAsString||"",h=this.selectionBeforeInput,m=h.selectionStart,y=h.selectionEnd,g=function(e,t){for(var n=0,r=0,a=e.length,i=t.length;e[n]===t[n]&&nn&&a-r>n;)r++;return{start:n,end:a-r}}(t,n),b=g.start,v=g.end;if(!i&&b===v&&-1!==d.indexOf(n[m])){var w=0===u?"":p;return n.substr(0,m)+w+n.substr(m+1,n.length)}var _=i?0:s.length,x=t.length-(i?0:c.length);if(n.length>t.length||!n.length||b===v||0===m&&y===t.length||0===b&&v===t.length||m===_&&y===x)return n;var T=t.substr(b,v-b);if(!![].concat(T).find((function(e,n){return r.isCharacterAFormat(n+b,t)}))){var S=t.substr(b),k={},E=[];[].concat(S).forEach((function(e,n){r.isCharacterAFormat(n+b,t)?k[n]=e:n>T.length-1&&E.push(e)})),Object.keys(k).forEach((function(e){E.length>e?E.splice(e,0,k[e]):E.push(k[e])})),n=t.substr(0,b)+E.join("")}if(!i){var A=this.removeFormatting(n),O=Jc(A,o),C=O.beforeDecimal,P=O.afterDecimal,R=O.addNegation,I=ev;)b--;b=this.correctCaretPosition(o,b,"left")}}else for(;!m.test(o[b])&&bw)&&(e.preventDefault(),this.setPatchedCaretPosition(n,b,o)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,b,o),f(e)}else f(e)},t.prototype.onMouseUp=function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,a=t.value;if(void 0===a&&(a=""),n===r){var i=this.correctCaretPosition(a,n);i!==n&&this.setPatchedCaretPosition(t,i,a)}this.props.onMouseUp(e)},t.prototype.onFocus=function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,a=n.selectionEnd,i=n.value;void 0===i&&(i="");var o=t.correctCaretPosition(i,r);o===r||0===r&&a===i.length||t.setPatchedCaretPosition(n,o,i),t.props.onFocus(e)}),0)},t.prototype.render=function(){var e=this.props,t=e.type,n=e.displayType,r=e.customInput,a=e.renderText,i=e.getInputRef,o=e.format,s=(e.thousandSeparator,e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle,e.decimalScale,e.fixedDecimalScale,e.prefix,e.suffix,e.removeFormatting,e.mask,e.defaultValue,e.isNumericString,e.allowNegative,e.allowEmptyFormatting,e.allowLeadingZeros,e.onValueChange,e.isAllowed,e.customNumerals,e.onChange,e.onKeyDown,e.onMouseUp,e.onFocus,e.onBlur,e.value,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}(e,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"])),c=this.state,u=c.value,l=c.mounted&&function(e){return e||"undefined"!==typeof navigator&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(o)?"numeric":void 0,d=Object.assign({inputMode:l},s,{type:t,value:u,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===n)return a?a(u,s)||null:Ys.createElement("span",Object.assign({},s,{ref:i}),u);if(r){var p=r;return Ys.createElement(p,Object.assign({},d,{ref:i}))}return Ys.createElement("input",Object.assign({},d,{ref:i}))},t}(Ys.Component);ou.defaultProps=iu;var su=ou,cu=n(25049),uu=n(2180),lu=n(34314),du=["onChange"];function pu(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 fu(e){for(var t=1;tNumber(l)?a("-1"):a(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:mu}),""!==t&&!o&&(0,lc.jsx)(Hc.Z,{sx:{minWidth:0,p:0,left:8,zIndex:1,color:"text.muted","&:hover":{color:"text.secondary"}},onClick:function(){a&&a("")},disabled:i,children:(0,lc.jsx)(Uc.Z,{height:16})}),s&&1!==c.length?(0,lc.jsx)(Wc.Z,{children:(0,lc.jsxs)(Vc.Z,{disabled:i,value:_.symbol,onChange:function(e){var t=c.find((function(t){return t.symbol===e.target.value}));s&&s(t),a&&a("")},variant:"outlined",className:"AssetInput__select","data-cy":"assetSelect",MenuProps:{sx:{maxHeight:"240px",".MuiPaper-root":{border:"dark"===v.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===c.length?c[0]:c&&c.find((function(t){return t.symbol===e}));return(0,lc.jsxs)(ac.Z,{sx:{display:"flex",alignItems:"center"},"data-cy":"assetsSelectedOption_".concat(t.symbol.toUpperCase()),children:[(0,lc.jsx)(uu.T1,{symbol:t.iconSymbol||t.symbol,aToken:t.aToken,sx:{mr:2,ml:4}}),(0,lc.jsx)(oc.Z,{variant:"main16",color:"text.primary",children:e})]})},children:[g||void 0,c.map((function(e){return(0,lc.jsx)(qc.Z,{value:e.symbol,"data-cy":"assetsSelectOption_".concat(e.symbol.toUpperCase()),children:b?b(e):(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(uu.T1,{aToken:e.aToken,symbol:e.iconSymbol||e.symbol,sx:{fontSize:"22px",mr:1}}),(0,lc.jsx)($c.Z,{sx:{mr:6},children:e.symbol}),e.balance&&(0,lc.jsx)(Pc.B,{value:e.balance,compact:!0})]})},e.symbol)}))]})}):(0,lc.jsxs)(ac.Z,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,lc.jsx)(uu.T1,{aToken:_.aToken,symbol:_.iconSymbol||_.symbol,sx:(0,lu.M)(_.iconSymbol||_.symbol)?{}:{mr:2,ml:4},fontSize:(0,lu.M)(_.iconSymbol||_.symbol)?"large":"inherit"}),(0,lc.jsx)(oc.Z,{variant:"h3",sx:{lineHeight:"28px"},"data-cy":"inputAsset",children:r})]})]}),(0,lc.jsxs)(ac.Z,{sx:{display:"flex",alignItems:"center",height:"16px"},children:[m?(0,lc.jsx)(ac.Z,{sx:{flex:1}}):(0,lc.jsx)(Pc.B,{value:isNaN(Number(n))?0:Number(n),compact:!0,symbol:"USD",variant:"secondary12",color:"text.muted",symbolsColor:"text.muted",flexGrow:1}),_.balance&&a&&(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsxs)(oc.Z,{component:"div",variant:"secondary12",color:"text.secondary",children:[f&&""!==f?f:(0,lc.jsx)(tc.cC,{id:"Balance"})," ",(0,lc.jsx)(Pc.B,{value:_.balance,compact:!0,variant:"secondary12",color:"text.secondary",symbolsColor:"text.disabled"})]}),!o&&(0,lc.jsx)(sc.Z,{size:"small",sx:{minWidth:0,ml:"7px",p:0},onClick:function(){y&&w(y.eventName,fu({},y.eventParams)),a("-1")},disabled:i||d,children:(0,lc.jsx)(tc.cC,{id:"Max"})})]})]})]})]})},gu=n(67916),bu=n(93608),vu=n(97461),wu=n(56371),_u=n(19419),xu=n(39771),Tu=n(74180),Su=n(67489),ku=n(70794),Eu=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"}(hu||(hu={}));var Au=function(e,t){return"-1"!==e&&new ku.O(e).minus(new ku.O(t)).lt("1.05")},Ou=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))},Cu=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},Pu=function(e,t,n,r){var a=e.reserve;if(!a.usageAsCollateralEnabled)return Eu.z.UNAVAILABLE;var i=Eu.z.ENABLED,o=e&&"0"!==e.scaledATokenBalance,s="0"!==t;return a.isIsolated?r?i=Eu.z.UNAVAILABLE:n?o?i=e.usageAsCollateralEnabledOnUser?Eu.z.ISOLATED_ENABLED:Eu.z.DISABLED:s&&(i=Eu.z.UNAVAILABLE_DUE_TO_ISOLATION):i=s?Eu.z.ISOLATED_DISABLED:Eu.z.ISOLATED_ENABLED:i=n?Eu.z.UNAVAILABLE_DUE_TO_ISOLATION:o?e.usageAsCollateralEnabledOnUser?Eu.z.ENABLED:Eu.z.DISABLED:Eu.z.ENABLED,i};function Ru(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 Iu(e){for(var t=1;t {symbol}",values:{action:n,symbol:a},components:{0:(0,lc.jsx)(Pc.B,{value:Number(r),compact:!0,variant:"secondary14"})}})})}),(0,lc.jsx)(sc.Z,{sx:{mt:4},variant:"outlined",size:"small",endIcon:(0,lc.jsx)(Ku,{style:{fontSize:12}}),onClick:function(){return s(yc.Sd.GHO_BORROW_VIEW_TX_DETAILS)},href:o.explorerLinkBuilder({tx:t||i.txHash}),target:"_blank",children:(0,lc.jsx)(oc.Z,{variant:"buttonS",children:(0,lc.jsx)(tc.cC,{id:"Review tx details"})})})]})})};function Xu(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 Ju(e){for(var t=1;t0,P=g(S),R=(0,Nc.BC)(p),I=S===(R=Math.min(Number(R),h.aaveFacilitatorRemainingCapacity).toFixed(10)),D=(0,Ec.hE)(S).multipliedBy(r.formattedPriceInMarketReferenceCurrency).multipliedBy(f).shiftedBy(-Ac.$3),j=(0,Oc.L1)({collateralBalanceMarketReferenceCurrency:p.totalCollateralUSD,borrowBalanceMarketReferenceCurrency:(0,Ec.hE)(p.totalBorrowsUSD).plus(D),currentLiquidationThreshold:p.currentLiquidationThreshold}),M=j.toNumber()<1.5&&"-1"!==j.toString(),N=(0,Ec.hE)(S).multipliedBy(r.priceInUSD),L=m.userGhoBorrowBalance>=h.ghoMinDebtTokenBalanceForDiscount?m.userGhoAvailableToBorrowAtDiscount:0,B=(0,Hu.li)(h.ghoVariableBorrowAPY,m.userGhoBorrowBalance,L,h.ghoBorrowAPYWithMaxDiscount),Z=m.userGhoBorrowBalance+Number(S)>=h.ghoMinDebtTokenBalanceForDiscount?m.userGhoAvailableToBorrowAtDiscount:0,U=(0,Hu.li)(h.ghoVariableBorrowAPY,m.userGhoBorrowBalance+Number(S),Z,h.ghoBorrowAPYWithMaxDiscount),F=void 0;_!==Sc.tk.Stable||r.stableBorrowRateEnabled?_===Sc.tk.Stable&&null!==a&&void 0!==a&&a.usageAsCollateralEnabledOnUser&&(0,Ec.hE)(S).lt((null===a||void 0===a?void 0:a.underlyingBalance)||0)?F=Yu.NOT_ENOUGH_BORROWED:r.borrowingEnabled||(F=Yu.BORROWING_NOT_AVAILABLE):F=Yu.STABLE_RATE_NOT_ENABLED;var z=function(){switch(F){case Yu.BORROWING_NOT_AVAILABLE:return(0,lc.jsx)(tc.cC,{id:"Borrowing is currently unavailable for {0}.",values:{0:r.symbol}});case Yu.NOT_ENOUGH_BORROWED:return(0,lc.jsx)(tc.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 Yu.STABLE_RATE_NOT_ENABLED:return(0,lc.jsx)(tc.cC,{id:"The Stable Rate is not enabled for this currency"});default:return(0,lc.jsx)(lc.Fragment,{})}},G=r.iconSymbol;return s.success?(0,lc.jsx)(Qu,{action:(0,lc.jsx)(tc.cC,{id:"Minted"}),amount:S,symbol:G}):(0,lc.jsxs)(lc.Fragment,{children:[b.determineWarningDisplay({borrowCap:b}),r.stableBorrowRateEnabled&&(0,lc.jsx)(el,{interestRateMode:_,setInterestRateMode:x,variableRate:r.variableBorrowAPY,stableRate:r.stableBorrowAPY}),(0,lc.jsxs)(oc.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,lc.jsx)("a",{href:"https://docs.zerolend.xyz/onez",target:"_blank",rel:"noreferrer",children:"documentation"}),"."]}),(0,lc.jsx)(yu,{value:S,onChange:function(e){if("-1"===e)k(R);else{var t=(0,Lc.$w)(e,r.decimals);k(t)}},usdValue:N.toString(10),assets:[{balance:R,symbol:i,iconSymbol:G}],symbol:i,capType:Bc.R.borrowCap,isMaxSelected:I,maxValue:R,balanceText:(0,lc.jsx)(tc.cC,{id:"Available"})}),void 0!==F&&(0,lc.jsx)(oc.Z,{variant:"helperText",color:"error.main",children:(0,lc.jsx)(z,{})}),(0,lc.jsxs)(vu.m6,{gasLimit:c,children:[(0,lc.jsx)(vu.jz,{visibleHfChange:!!S,healthFactor:p.healthFactor,futureHealthFactor:j.toString(10)}),(0,lc.jsx)(Rc.X,{caption:(0,lc.jsx)(ac.Z,{children:(0,lc.jsx)(zu.n,{text:(0,lc.jsx)(tc.cC,{id:"APY, fixed rate"}),variant:"subheader2",color:"text.secondary"})}),captionVariant:"description",mb:4,align:"flex-start",children:(0,lc.jsx)(ac.Z,{sx:{textAlign:"right"},children:(0,lc.jsx)(ac.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:(0,lc.jsx)(nl,{ghoLoadingData:y,hasGhoBorrowPositions:C,borrowAmount:S,discountAvailable:P,userDiscountTokenBalance:m.userDiscountTokenBalance,underlyingAsset:t,customMarket:v,currentBorrowAPY:B,futureBorrowAPY:U,onDetailsClick:function(){return l()}})})})})]}),u&&(0,lc.jsx)(gu.Q,{txError:u}),M&&(0,lc.jsx)(Lu,{riskCheckboxAccepted:A,onRiskCheckboxChange:function(){O(!A)}}),(0,lc.jsx)(ju,{poolReserve:r,amountToBorrow:S,poolAddress:r.underlyingAsset,interestRateMode:_,isWrongNetwork:n,symbol:i,blocked:void 0!==F||M&&!A,sx:M?{mt:0}:{}})]})},nl=function(e){var t=e.ghoLoadingData,n=e.hasGhoBorrowPositions,r=e.borrowAmount,a=e.discountAvailable,i=e.userDiscountTokenBalance,o=e.underlyingAsset,s=e.customMarket,c=e.currentBorrowAPY,u=e.futureBorrowAPY,l=e.onDetailsClick;if(t||!n&&""===r&&a)return(0,lc.jsx)(Gu.J,{variant:"secondary14",color:"text.secondary"});var d={stkAaveBalance:i||0,ghoRoute:uc.Z6.reserveOverview(o,s)+"/#discount",userQualifiesForDiscount:a,"data-cy":"apyType"};return n||""===r?n&&""===r?(0,lc.jsx)(Fu.B,Ju({withTokenIcon:a,value:c,onMoreDetailsClick:l},d)):a?a?(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(Fu.B,Ju({withTokenIcon:!0,value:c,onMoreDetailsClick:l},d)),!!r&&(0,lc.jsxs)(lc.Fragment,{children:[n&&(0,lc.jsx)(ic.Z,{color:"primary",sx:{fontSize:"14px",mx:1},children:(0,lc.jsx)(Uu.Z,{})}),(0,lc.jsx)(Fu.B,Ju({value:t?-1:u},d))]})]}):(0,lc.jsx)(Gu.J,{variant:"secondary14",color:"text.secondary"}):(0,lc.jsx)(Fu.B,Ju({value:c,onMoreDetailsClick:l},d)):(0,lc.jsx)(Fu.B,Ju({withTokenIcon:a,value:u},d))};function rl(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 al(e){for(var t=1;t0)if(u.chainId===Sc.a_.mainnet){var l=o.find((function(e){return"AAVE"===e.symbol}));c=l?Number(l.priceInUSD):0}else o.forEach((function(e){e.isWrappedBaseAsset&&(c=Number(e.priceInUSD))}));else c=Number(a.rewardPriceFeed);var d=Number(s)*c;d>0&&(a.assets.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),e.push({assets:a.assets,incentiveControllerAddress:a.incentiveControllerAddress,symbol:a.rewardTokenSymbol,balance:s,balanceUsd:d.toString(),rewardTokenAddress:r}),t+=Number(d))})),1===e.length)b(e[0].symbol);else if(e.length>1&&!O){var r={assets:n,incentiveControllerAddress:e[0].incentiveControllerAddress,symbol:"all",balance:"0",balanceUsd:t.toString(),rewardTokenAddress:""};b("all"),S(r)}_(e),m(t.toString())}),[]);var E=void 0;"0"===h&&(E=il.NOT_ENOUGH_BALANCE);var A=c!==d,O="all"===g?T:w.find((function(e){return e.symbol===g}));return r&&r.blocking?(0,lc.jsx)(sl.D,{txError:r}):n.success?(0,lc.jsx)(bu.R,{action:(0,lc.jsx)(tc.cC,{id:"Claimed"}),amount:null===O||void 0===O?void 0:O.balanceUsd}):(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(cl.E,{title:"Claim rewards"}),A&&!p&&(0,lc.jsx)(ul.I,{networkName:k.name,chainId:c}),void 0!==E&&(0,lc.jsx)(oc.Z,{variant:"helperText",color:"error.main",children:E===il.NOT_ENOUGH_BALANCE?(0,lc.jsx)(tc.cC,{id:"Your reward balance is 0"}):null}),w.length>1&&(0,lc.jsx)(hl,{rewards:w,selectedReward:g,setSelectedReward:b}),O&&(0,lc.jsxs)(vu.m6,{gasLimit:t,children:["all"===g&&(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(Rc.X,{caption:(0,lc.jsx)(tc.cC,{id:"Balance"}),captionVariant:"description",align:"flex-start",mb:"all"!==O.symbol?0:4,children:(0,lc.jsx)(ac.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:w.map((function(e){return(0,lc.jsxs)(ac.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",mb:4},children:[(0,lc.jsxs)(ac.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,lc.jsx)(uu.T1,{symbol:e.symbol,sx:{mr:1,fontSize:"16px"}}),(0,lc.jsx)(Pc.B,{value:Number(e.balance),variant:"secondary14"}),(0,lc.jsx)(oc.Z,{ml:1,variant:"secondary14",children:e.symbol})]}),(0,lc.jsx)(Pc.B,{value:Number(e.balanceUsd),variant:"helperText",compact:!0,symbol:"USD",color:"text.secondary"})]},"claim-".concat(e.symbol))}))})}),(0,lc.jsx)(vu.oD,{description:(0,lc.jsx)(tc.cC,{id:"Total worth"}),value:h})]}),"all"!==g&&(0,lc.jsx)(vu.XJ,{symbol:(0,lc.jsx)(uu.T1,{symbol:O.symbol}),futureValue:O.balance,futureValueUSD:O.balanceUsd,description:(0,lc.jsx)(tc.cC,{id:"{0} Balance",values:{0:O.symbol}})})]}),r&&(0,lc.jsx)(gu.Q,{txError:r}),(0,lc.jsx)(dl,{isWrongNetwork:A,selectedReward:null!==O&&void 0!==O?O:{},blocked:void 0!==E})]})},gl=function(){var e=(0,_c.vR)(),t=e.type,n=e.close;return(0,lc.jsx)(cc.P,{open:t===_c.w8.ClaimRewards,setOpen:n,children:(0,lc.jsx)(yl,{})})},bl=n(18384),vl=function(e){var t=e.poolReserve,n=e.isWrongNetwork,r=e.usageAsCollateral,i=e.blocked,o=e.symbol,s=(0,hc.Yh)((function(e){return e.setUsageAsCollateral})),c=(0,ll.Q)({tryPermit:!1,protocolAction:Sc.UQ.setUsageAsCollateral,eventTxInfo:{assetName:t.name,asset:t.underlyingAsset,previousState:(!r).toString(),newState:r.toString()},handleGetTxns:function(){var e=(0,a.Z)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({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,d=c.loadingTxns,p=c.mainTxState,f=c.requiresApproval;return(0,lc.jsx)(Su.B,{requiresApproval:f,blocked:i,preparingTransactions:d,mainTxState:p,isWrongNetwork:n,actionText:r?(0,lc.jsx)(tc.cC,{id:"Enable {symbol} as collateral",values:{symbol:o}}):(0,lc.jsx)(tc.cC,{id:"Disable {symbol} as collateral",values:{symbol:o}}),actionInProgressText:(0,lc.jsx)(tc.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"}(ml||(ml={}));var wl=function(e){var t=e.poolReserve,n=e.userReserve,r=e.isWrongNetwork,a=e.symbol,i=(0,_c.vR)(),o=i.gasLimit,s=i.mainTxState,c=i.txError,u=(0,jc.HT)().user,l=(0,Mc.ov)().debtCeiling,d=!n.usageAsCollateralEnabledOnUser,p=(0,Ec.hE)(u.totalCollateralMarketReferenceCurrency),f=!t.isIsolated&&d,h=!t.isIsolated&&!d,m=t.isIsolated&&d,y=t.isIsolated&&!d,g=p[d?"plus":"minus"](n.underlyingBalanceMarketReferenceCurrency),b=(0,Oc.L1)({collateralBalanceMarketReferenceCurrency:g,borrowBalanceMarketReferenceCurrency:u.totalBorrowsMarketReferenceCurrency,currentLiquidationThreshold:u.currentLiquidationThreshold}),v=Cu(u),w=void 0;v.length>0&&!v.includes(t.symbol)?w=ml.ZERO_LTV_WITHDRAW_BLOCKED:(0,Ec.hE)(n.underlyingBalance).eq(0)?w=ml.DO_NOT_HAVE_SUPPLIES_IN_THIS_CURRENCY:!n.usageAsCollateralEnabledOnUser&&"0"===t.reserveLiquidationThreshold||"0"===t.reserveLiquidationThreshold?w=ml.CAN_NOT_USE_THIS_CURRENCY_AS_COLLATERAL:n.usageAsCollateralEnabledOnUser&&"0"!==u.totalBorrowsMarketReferenceCurrency&&b.lte("1")&&(w=ml.CAN_NOT_SWITCH_USAGE_AS_COLLATERAL_MODE);var _=function(){switch(w){case ml.DO_NOT_HAVE_SUPPLIES_IN_THIS_CURRENCY:return(0,lc.jsx)(tc.cC,{id:"You do not have supplies in this currency"});case ml.CAN_NOT_USE_THIS_CURRENCY_AS_COLLATERAL:return(0,lc.jsx)(tc.cC,{id:"You can not use this currency as collateral"});case ml.CAN_NOT_SWITCH_USAGE_AS_COLLATERAL_MODE:return(0,lc.jsx)(tc.cC,{id:"You can not switch usage as collateral mode for this currency, because it will cause collateral call"});case ml.ZERO_LTV_WITHDRAW_BLOCKED:return(0,lc.jsx)(tc.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 s.success?(0,lc.jsx)(bu.R,{collateral:d,symbol:t.symbol}):(0,lc.jsxs)(lc.Fragment,{children:[f&&(0,lc.jsx)(Nu.v,{severity:"warning",icon:!1,sx:{mb:3},children:(0,lc.jsx)(tc.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,lc.jsx)(Nu.v,{severity:"warning",icon:!1,sx:{mb:3},children:(0,lc.jsx)(tc.cC,{id:"Disabling this asset as collateral affects your borrowing power and Health Factor."})}),m&&(0,lc.jsx)(bl.i,{asset:t.symbol}),y&&(0,lc.jsx)(Nu.v,{severity:"info",icon:!1,sx:{mb:3},children:(0,lc.jsx)(tc.cC,{id:"You will exit isolation mode and other tokens can now be used as collateral"})}),t.isIsolated&&l.determineWarningDisplay({debtCeiling:l}),(0,lc.jsxs)(vu.m6,{gasLimit:o,children:[(0,lc.jsx)(vu.oD,{symbol:t.symbol,iconSymbol:t.iconSymbol,description:(0,lc.jsx)(tc.cC,{id:"Supply balance"}),value:n.underlyingBalance}),(0,lc.jsx)(vu.jz,{visibleHfChange:!0,healthFactor:u.healthFactor,futureHealthFactor:b.toString(10)})]}),void 0!==w&&(0,lc.jsx)(oc.Z,{variant:"helperText",color:"error.main",children:(0,lc.jsx)(_,{})}),c&&(0,lc.jsx)(gu.Q,{txError:c}),(0,lc.jsx)(vl,{symbol:a,poolReserve:t,usageAsCollateral:d,isWrongNetwork:r,blocked:void 0!==w})]})};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}var xl=function(){var e=(0,_c.vR)(),t=e.type,n=e.close,a=e.args;return(0,lc.jsx)(cc.P,{open:t===_c.w8.CollateralChange,setOpen:n,children:(0,lc.jsx)(Tc.A,{title:(0,lc.jsx)(tc.cC,{id:"Review tx"}),underlyingAsset:a.underlyingAsset,children:function(e){return(0,lc.jsx)(wl,function(e){for(var t=1;t{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${(0,Il.Z)(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})((({theme:e,ownerState:t})=>(0,Al.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 Ll=Ys.forwardRef((function(e,t){const n=(0,Rl.Z)({props:e,name:"MuiListSubheader"}),{className:r,color:a="default",component:i="li",disableGutters:o=!1,disableSticky:s=!1,inset:c=!1}=n,u=(0,El.Z)(n,Ml),l=(0,Al.Z)({},n,{color:a,component:i,disableGutters:o,disableSticky:s,inset:c}),d=(e=>{const{classes:t,color:n,disableGutters:r,inset:a,disableSticky:i}=e,o={root:["root","default"!==n&&`color${(0,Il.Z)(n)}`,!r&&"gutters",a&&"inset",!i&&"sticky"]};return(0,Cl.Z)(o,jl,t)})(l);return(0,lc.jsx)(Nl,(0,Al.Z)({as:i,className:(0,Ol.default)(d.root,r),ref:t,ownerState:l},u))})),Bl=n(91655),Zl=n(58527),Ul=["loading","outputAmountUSD","inputAmountUSD"];function Fl(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 zl(e){for(var t=1;t=0||(a[n]=e[n]);return a}function td(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var nd={exports:{}};!function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,a="function"===typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",s=a.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 a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),o=new O(r||[]);return i._invoke=function(e,t,n){var r=d;return function(a,i){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===a)throw i;return P()}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===m)continue;return s}}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=f;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?h:p,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,o),i}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",p="suspendedYield",f="executing",h="completed",m={};function y(){}function g(){}function b(){}var v={};c(v,i,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(C([])));_&&_!==n&&r.call(_,i)&&(v=_);var x=b.prototype=y.prototype=Object.create(v);function T(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(a,i,o,s){var c=l(e[a],e,i);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,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,s)}))}s(c.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,a){n(e,r,t,a)}))}return a=a?a.then(i,i):i()}}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 a=l(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,m;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function E(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 A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var n=e[i];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(c&&u){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(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 a=r.arg;A(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(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)}}(nd);var rd=nd.exports,ad="https://api.paraswap.io";var id=function(e){var t,n=(t=e,Object.entries(t).filter((function(e){return void 0!==e[1]})).map((function(e){var t=e[0],n=e[1];return[t,String(n)]}))),r=new URLSearchParams(n).toString();return r&&"?"+r},od=function(e){var t,n;function r(t){var n,a=t.code,i=t.request,o=t.response,s=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(td(n),r),n.name=n.constructor.name,n.code=a,n.request=i,n.isAxiosError=s,!o)return n.message=c,td(n);n.response=o;var u=o.data,l=o.status;return n.status=l,n.message=sd(u)?u.error:c,n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Kl(t,n),r}(Jl(Error));function sd(e){return!!(t=e)&&"object"===typeof t&&"string"===typeof e.error;var t}var cd,ud=["srcToken","destToken"],ld=["route"],dd=["options"],pd=["excludePricingMethods","excludeContractMethods","includeContractMethods","adapterVersion","partner","includeDEXS","excludeDEXS","excludePools"];!function(e){e.megapath="megapath",e.multipath="multipath",e.simplepath="simplepath"}(cd||(cd={}));var fd=function(e){var t=e.apiURL,n=void 0===t?ad:t,r=e.chainId,a=e.fetcher,i=n+"/prices",o=function(){var e=ql(rd.mark((function e(t,n){var o,s,c,u,l,d,p;return rd.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.srcToken,s=t.destToken,c=ed(t,ud),u=hd(c),l=id($l({srcToken:o,destToken:s,network:r},u)),d=i+"/"+l,e.next=6,a({url:d,method:"GET",signal:n});case 6:return p=e.sent,e.abrupt("return",p.priceRoute);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s=function(){var e=ql(rd.mark((function e(t,n){var o,s,c,u,l,d,p;return rd.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.route,s=ed(t,ld),!(o.length<2)){e.next=3;break}throw new Error("Invalid Route");case 3:return c=hd(s),u=o.join("-"),l=id($l({route:u,network:r},c)),d=i+"/"+l,e.next=9,a({url:d,method:"GET",signal:n});case 9:return p=e.sent,e.abrupt("return",p.priceRoute);case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return{getRate:o,getRateByRoute:s}};function hd(e){var t=e.options,n=void 0===t?{}:t,r=ed(e,dd),a=n.excludePricingMethods,i=n.excludeContractMethods,o=n.includeContractMethods,s=n.adapterVersion,c=n.partner,u=void 0===c?"paraswap.io":c,l=n.includeDEXS,d=n.excludeDEXS,p=n.excludePools,f=ed(n,pd),h=[l,d,p,a,i,o].map((function(e){return(null==e?void 0:e.join(","))||void 0})),m=h[0],y=h[1],g=h[2];return $l({version:s,excludePricingMethods:h[3],excludeContractMethods:h[4],includeContractMethods:h[5],partner:u,includeDEXS:m,excludeDEXS:y,excludePools:g},r,f)}function md(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 yd(e,t){return(BigInt(e)+(BigInt(t)<0?$l({},t,{orders:t.orders.map((function(e){var t=$l({},"makerAssetId"in e?gd(e):md(e),{signature:e.signature});return e.permitMakerAsset&&(t.permitMakerAsset=e.permitMakerAsset),t}))}):t,p={url:l,method:"POST",data:d,signal:r},e.next=8,a(p);case 8:return f=e.sent,e.abrupt("return",f);case 10:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();return{buildTx:o}};function vd(e){var t=e.queryParams,n=e.side,r=e.priceRoute;if(t.slippage)return n===Hl.PC.BUY&&t.destAmount===r.destAmount||n===Hl.PC.SELL&&t.srcAmount===r.srcAmount;var a=n===Hl.PC.SELL?[t.srcAmount,r.srcAmount]:[t.destAmount,r.destAmount];return a[0]===a[1]}var wd=function(e){return function(){var t=ql(rd.mark((function t(n){var r,a,i,o,s,c,u;return rd.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r=n.url,a=n.method,i=n.signal,o="POST"===a?JSON.stringify(n.data):null,s="POST"===a&&o?{"Content-Type":"application/json"}:void 0,t.next=6,e(r,{method:a,body:o,signal:i,headers:s});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 od({code:String(c.status),response:{data:u,status:c.status,statusText:c.statusText,headers:Object.fromEntries(c.headers.entries()),config:{url:r,method:a}},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 od)){t.next=19;break}throw t.t0;case 19:throw new od(t.t0);case 20:case"end":return t.stop()}}),t,null,[[0,15]])})));return function(e){return t.apply(this,arguments)}}()};var _d=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rSlippage tolerance <1>{selectedSlippage}% <2>{0}",values:{0:c?(0,lc.jsx)(Gd.Z,{}):(0,lc.jsx)(Hd.Z,{}),selectedSlippage:n},components:{0:(0,lc.jsx)(oc.Z,{color:"text.secondary",variant:"description"}),1:(0,lc.jsx)(oc.Z,{color:"text.main",variant:"secondary14",sx:{px:"4px"}}),2:(0,lc.jsx)(ic.Z,{sx:{fontSize:"14px !important",mr:"4px"}})}})}),variant:"secondary14"}),disabled:!1,"data-cy":"slippageButton_".concat(n),sx:{mt:6}}),(0,lc.jsxs)(Vd.Z,{anchorEl:o,open:c,onClose:l,MenuListProps:{"aria-labelledby":"basic-button"},keepMounted:!0,"data-cy":"slippageMenu_".concat(n),children:[(0,lc.jsx)(ac.Z,{sx:{px:"16px",py:"12px"},children:(0,lc.jsx)(oc.Z,{variant:"secondary12",color:"text.secondary",children:(0,lc.jsx)(tc.cC,{id:"Select slippage tolerance"})})}),["0.1","0.5","1"].map((function(e){var r=e===n;return(0,lc.jsxs)(qc.Z,{selected:r,value:e,onClick:function(){t(e),u(yc.vh.SET_SLIPPAGE,{amount:e}),l()},children:[(0,lc.jsxs)($c.Z,{primaryTypographyProps:{variant:"subheader1"},children:[e,"%"]}),(0,lc.jsx)(qd.Z,{children:(0,lc.jsx)(ic.Z,{children:r&&(0,lc.jsx)(Wd.Z,{})})})]},e)})),(0,lc.jsx)(fl.Z,{}),(0,lc.jsxs)(ac.Z,{sx:{px:"16px",py:"12px",display:"inline-flex",alignItems:"center"},children:[(0,lc.jsxs)(oc.Z,{variant:"secondary12",color:"text.secondary",sx:{display:"flex",alignItems:"center"},children:[(0,lc.jsx)(tc.cC,{id:"Powered by"}),(0,lc.jsx)(ic.Z,{sx:{fontSize:"20px",width:"20px",color:"#2669F5",position:"relative",top:"5px",left:"5px"},children:(0,lc.jsx)(ep,{})})]}),(0,lc.jsx)(oc.Z,{variant:"main12",color:"text.secondary",children:"Paraswap"})]})]})]})},np=function(e){var t=e.txError;return(0,lc.jsxs)(ac.Z,{children:[(0,lc.jsx)(gu.Q,{txError:t}),"MetaMask Message Signature: User denied message signature."!==t.rawError.message&&"MetaMask Message Signature: User denied message signature."!==t.rawError.message&&(0,lc.jsx)(ac.Z,{sx:{pt:4},children:(0,lc.jsx)(Nu.v,{severity:"info",children:(0,lc.jsxs)(oc.Z,{variant:"description",children:[" ",(0,lc.jsx)(tc.cC,{id:"Tip: Try increasing slippage or reduce input amount"})]})})})]})},rp=n(32113);function ap(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 ip(e){for(var t=1;tNumber(c.availableBorrowsUSD),$=void 0;(0,ku.Z)(N).gt(G)&&($=op.INSUFFICIENT_LIQUIDITY);var Y=function(){return $===op.INSUFFICIENT_LIQUIDITY?(0,lc.jsx)(tc.cC,{id:"There is not enough liquidity for the target asset to perform the switch. Try lowering the amount."}):null};return y.success?(0,lc.jsx)(bu.R,{customAction:(0,lc.jsxs)(kl.Z,{gap:3,children:[(0,lc.jsx)(oc.Z,{variant:"description",color:"text.primary",children:(0,lc.jsx)(tc.cC,{id:"You've successfully switched borrow position."})}),(0,lc.jsxs)(kl.Z,{direction:"row",alignItems:"center",justifyContent:"center",gap:1,children:[(0,lc.jsx)(uu.T1,{symbol:t.iconSymbol,sx:{mx:1}}),(0,lc.jsx)(Pc.B,{value:T.current,compact:!0,variant:"subheader1"}),t.symbol,(0,lc.jsx)(ic.Z,{color:"primary",sx:{fontSize:"14px",mx:1},children:(0,lc.jsx)(Uu.Z,{})}),(0,lc.jsx)(uu.T1,{symbol:P.reserve.symbol,sx:{mx:1}}),(0,lc.jsx)(Pc.B,{value:M,compact:!0,variant:"subheader1"}),P.reserve.symbol]})]})}):(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(yu,{value:D,onChange:function(e){var t="-1"===e;T.current=t?R:e,x(e),b(void 0)},usdValue:H.toString(),symbol:t.symbol,assets:[{balance:R,address:t.underlyingAsset,symbol:t.symbol,iconSymbol:t.iconSymbol}],maxValue:R,inputTitle:(0,lc.jsx)(tc.cC,{id:"Borrowed asset amount"}),balanceText:(0,lc.jsx)(Ys.Fragment,{children:(0,lc.jsx)(tc.cC,{id:"Borrow balance"})}),isMaxSelected:I}),(0,lc.jsxs)(ac.Z,{sx:{padding:"18px",pt:"14px",display:"flex",justifyContent:"space-between"},children:[(0,lc.jsx)(ic.Z,{sx:{fontSize:"18px !important"},children:(0,lc.jsx)(Sl,{})}),(0,lc.jsx)(Gl,{loading:F,outputAmountUSD:W.toString(),inputAmountUSD:H.toString()})]}),(0,lc.jsx)(yu,{value:M,onSelect:E,usdValue:W.toString(),symbol:k.symbol,assets:v,inputTitle:(0,lc.jsx)(tc.cC,{id:"Switch to"}),balanceText:(0,lc.jsx)(tc.cC,{id:"Supply balance"}),disableInput:!0,loading:F,selectOptionHeader:(0,lc.jsx)(pp,{}),selectOption:function(e){return(0,lc.jsx)(fp,{asset:e})}}),B&&!F&&(0,lc.jsx)(oc.Z,{variant:"helperText",color:"error.main",children:B}),!B&&void 0!==$&&(0,lc.jsx)(oc.Z,{variant:"helperText",color:"error.main",children:(0,lc.jsx)(Y,{})}),(0,lc.jsx)(vu.m6,{gasLimit:m,slippageSelector:(0,lc.jsx)(tp,{selectedSlippage:O,setSlippage:function(e){b(void 0),C(e)}}),children:(0,lc.jsx)(cp,{switchSource:n,switchTarget:P,toAmount:M,fromAmount:""===D?"0":D,loading:F,sourceBalance:R,sourceBorrowAPY:i===Sc.tk.Variable?t.variableBorrowAPY:t.stableBorrowAPY,targetBorrowAPY:P.reserve.variableBorrowAPY,showAPYTypeChange:i===Sc.tk.Stable})}),g&&(0,lc.jsx)(np,{txError:g}),q&&(0,lc.jsx)(Nu.v,{severity:"error",sx:{mt:4},children:(0,lc.jsx)(oc.Z,{variant:"caption",children:(0,lc.jsx)(tc.cC,{id:"Insufficient collateral to cover new borrow position. Wallet must have borrowing power remaining to perform debt switch."})})}),(0,lc.jsx)(sp,{isMaxSelected:I,poolReserve:t,amountToSwap:N,amountToReceive:M,isWrongNetwork:r,targetReserve:P.reserve,symbol:t.symbol,blocked:void 0!==$||""!==B||q,loading:Z,buildTxFn:U,currentRateMode:i===Sc.tk.Variable?2:1})]})},pp=function(){return(0,lc.jsx)(Ll,{sx:function(e){return{borderBottom:"1px solid ".concat(e.palette.divider),mt:-1}},children:(0,lc.jsxs)(kl.Z,{direction:"row",sx:{py:4},gap:14,children:[(0,lc.jsx)(oc.Z,{variant:"subheader2",children:(0,lc.jsx)(tc.cC,{id:"Select an asset"})}),(0,lc.jsx)(oc.Z,{variant:"subheader2",children:(0,lc.jsx)(tc.cC,{id:"Borrow APY, variable"})})]})})},fp=function(e){var t=e.asset;return(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(uu.T1,{aToken:t.aToken,symbol:t.iconSymbol||t.symbol,sx:{fontSize:"22px",mr:1}}),(0,lc.jsx)($c.Z,{sx:{mr:6},children:t.symbol}),(0,lc.jsx)(Pc.B,{value:t.variableApy,percent:!0,variant:"secondary14",color:"text.secondary"})]})};function hp(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 mp(e){for(var t=1;tNumber(W.amount)+.05*Number(W.amount))&&(h({success:!1}),w(void 0)),Number(d[1])0&&!pe.includes(x.symbol)?fe=hu.ZERO_LTV_WITHDRAW_BLOCKED:(0,Ec.hE)(S).lt(q)&&(fe=hu.NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH);var he=function(){switch(fe){case hu.NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH:return(0,lc.jsx)(tc.cC,{id:"Not enough collateral to repay this amount of debt with"});case hu.ZERO_LTV_WITHDRAW_BLOCKED:return(0,lc.jsx)(tc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:pe}});default:return null}};return m.success?(0,lc.jsx)(bu.R,{action:(0,lc.jsx)(tc.cC,{id:"Repaid"}),amount:$,symbol:t.symbol}):(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(yu,{value:le,onChange:ee,usdValue:de,symbol:t.symbol,assets:[{address:t.underlyingAsset,symbol:t.symbol,iconSymbol:t.iconSymbol,balance:N}],isMaxSelected:B,maxValue:N,inputTitle:(0,lc.jsx)(tc.cC,{id:"Expected amount to repay"}),balanceText:(0,lc.jsx)(tc.cC,{id:"Borrow balance"})}),(0,lc.jsxs)(ac.Z,{sx:{padding:"18px",pt:"14px",display:"flex",justifyContent:"space-between"},children:[(0,lc.jsx)(ic.Z,{sx:{fontSize:"18px !important"},children:(0,lc.jsx)(Sl,{})}),(0,lc.jsx)(Gl,{loading:J,outputAmountUSD:Y,inputAmountUSD:V})]}),(0,lc.jsx)(yu,{value:"exactOut"===E?q:S,usdValue:V,symbol:x.symbol,assets:w,onSelect:T,onChange:ee,inputTitle:(0,lc.jsx)(tc.cC,{id:"Collateral to repay with"}),balanceText:(0,lc.jsx)(tc.cC,{id:"Borrow balance"}),maxValue:S,loading:J,disableInput:!0}),Q&&!J&&(0,lc.jsx)(oc.Z,{variant:"helperText",color:"error.main",children:Q}),void 0!==fe&&(0,lc.jsx)(oc.Z,{variant:"helperText",color:"error.main",children:(0,lc.jsx)(he,{})}),(0,lc.jsxs)(vu.m6,{gasLimit:f,slippageSelector:(0,lc.jsx)(tp,{selectedSlippage:I,setSlippage:D}),children:[(0,lc.jsx)(vu.jz,{visibleHfChange:"exactOut"===E?!!C:!!q,healthFactor:null===c||void 0===c?void 0:c.healthFactor,futureHealthFactor:re.toString(10),loading:J}),(0,lc.jsx)(vu.XJ,{description:(0,lc.jsx)(tc.cC,{id:"Borrow balance after repay"}),futureValue:oe.toString(),futureValueUSD:se.toString(),symbol:n,tokenIcon:t.iconSymbol,loading:J,hideSymbolSuffix:!0}),(0,lc.jsx)(vu.XJ,{description:(0,lc.jsx)(tc.cC,{id:"Collateral balance after repay"}),futureValue:ce.toString(),futureValueUSD:ue.toString(),symbol:x.symbol,tokenIcon:x.iconSymbol,loading:J,hideSymbolSuffix:!0})]}),h&&(0,lc.jsx)(np,{txError:h}),(0,lc.jsx)(jp,{poolReserve:t,fromAssetData:M,repayAmount:$,repayWithAmount:q,repayAllDebt:H,useFlashLoan:ie,isWrongNetwork:o,symbol:n,rateMode:r,blocked:void 0!==fe||""!==Q,loading:K,buildTxFn:X})]})}var Bp=n(84707),Zp=["amountToRepay","poolReserve","poolAddress","isWrongNetwork","sx","symbol","debtType","repayWithATokens","blocked"];function Up(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 Fp(e){for(var t=1;t0,ee=null===b||void 0===b?void 0:b.healthFactor;if(K){var te=(null===b||void 0===b?void 0:b.totalCollateralUSD)||"0";H&&z&&(te=(0,Ec.hE)((null===b||void 0===b?void 0:b.totalCollateralUSD)||"0").minus((0,Ec.hE)(G.priceInUSD).multipliedBy(K)));var ne=(0,Ec.hE)((null===b||void 0===b?void 0:b.totalBorrowsUSD)||"0").minus((0,Ec.hE)(G.priceInUSD).multipliedBy(K)),re=ku.Z.max(ne,0),ae=(0,Oc.L1)({collateralBalanceMarketReferenceCurrency:te,borrowBalanceMarketReferenceCurrency:re,currentLiquidationThreshold:(null===b||void 0===b?void 0:b.currentLiquidationThreshold)||"0"});ee=ae.isLessThan(0)&&!ae.eq(-1)?"0":ae.toString(10)}var ie=(0,Ec.hE)(K).multipliedBy(G.priceInUSD);return h.success?(0,lc.jsx)(bu.R,{action:(0,lc.jsx)(tc.cC,{id:"repaid"}),amount:Z.current,symbol:O.symbol}):(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(yu,{value:K,onChange:function(e){var t="-1"===e;Z.current=t?n.toString(10):e,B(e),t&&(H||n.eq(W))?O.address===kc.hP.toLowerCase()||Bp.U[w]&&Bp.U[w].toLowerCase()===G.underlyingAsset.toLowerCase()?M(q.toString(10)):M("-1"):M(q.lt(r)?q.toString(10):n.toString(10))},usdValue:ie.toString(10),symbol:O.symbol,assets:R,onSelect:C,isMaxSelected:Y,maxValue:n.toString(10),balanceText:(0,lc.jsx)(tc.cC,{id:"Wallet balance"})}),J&&(0,lc.jsx)(oc.Z,{color:"warning.main",variant:"helperText",children:(0,lc.jsx)(tc.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,lc.jsxs)(vu.m6,{gasLimit:f,children:[(0,lc.jsx)(vu.XJ,{description:(0,lc.jsx)(tc.cC,{id:"Remaining debt"}),futureValue:Q,futureValueUSD:X.toString(10),value:W,valueUSD:V.toString(),symbol:a.iconSymbol===U.wrappedBaseAssetSymbol?U.baseAssetSymbol:a.iconSymbol}),(0,lc.jsx)(vu.jz,{visibleHfChange:!!L,healthFactor:null===b||void 0===b?void 0:b.healthFactor,futureHealthFactor:ee})]}),m&&(0,lc.jsx)(gu.Q,{txError:m}),(0,lc.jsx)(Gp,{poolReserve:a,amountToRepay:Y?j:K,poolAddress:H?a.underlyingAsset:null!==(t=O.address)&&void 0!==t?t:"",isWrongNetwork:l,symbol:s,debtType:d,repayWithATokens:H})]})};function Wp(e){var t,n=e.repayType,r=e.setRepayType,a=(0,xc.f)().currentMarketData,i=(0,hc.Yh)((function(e){return e.trackEvent}));return null!==(t=a.enabledFeatures)&&void 0!==t&&t.collateralRepay?(0,lc.jsxs)(ac.Z,{sx:{mb:6},children:[(0,lc.jsx)(oc.Z,{mb:1,color:"text.secondary",children:(0,lc.jsx)(tc.cC,{id:"Repay with"})}),(0,lc.jsxs)(Dc.f,{color:"primary",value:n,exclusive:!0,onChange:function(e,t){return r(t)},children:[(0,lc.jsx)(Ic.Y,{value:zp.BALANCE,disabled:n===zp.BALANCE,onClick:function(){return i(yc.rQ.SWITCH_REPAY_TYPE,{repayType:"Wallet Balance"})},children:(0,lc.jsx)(oc.Z,{variant:"buttonM",children:(0,lc.jsx)(tc.cC,{id:"Wallet balance"})})}),(0,lc.jsx)(Ic.Y,{value:zp.COLLATERAL,disabled:n===zp.COLLATERAL,onClick:function(){return i(yc.rQ.SWITCH_REPAY_TYPE,{repayType:"Collateral"})},children:(0,lc.jsx)(oc.Z,{variant:"buttonM",children:(0,lc.jsx)(tc.cC,{id:"Collateral"})})})]})]}):null}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 qp(e){for(var t=1;tof.Sw}),[B,of.Sw]),Q=(0,Ys.useMemo)((function(){return T&&Y&&K}),[T,Y,K]),X={amountToSupply:k,isWrongNetwork:o,poolAddress:A?kc.hP:r.underlyingAsset,symbol:A?h.baseAssetSymbol:r.symbol,blocked:!1,decimals:r.decimals,gaslessPossible:Q};return y.success?(0,lc.jsx)(bu.R,{action:(0,lc.jsx)(tc.cC,{id:"Supplied"}),amount:k,symbol:A?h.baseAssetSymbol:r.symbol,addToken:V}):(0,lc.jsxs)(lc.Fragment,{children:[W&&(0,lc.jsx)(bl.i,{asset:r.symbol}),w.determineWarningDisplay({supplyCap:w}),_.determineWarningDisplay({debtCeiling:_}),"AMPL"===r.symbol&&(0,lc.jsx)(Nu.v,{sx:{mt:"16px",mb:"40px"},severity:"warning",children:(0,lc.jsx)(Yp.v,{})}),"true"===sf.env.NEXT_PUBLIC_ENABLE_STAKING&&"AAVE"===r.symbol&&ec.cr.staking(f)&&(0,lc.jsx)(Xp,{}),"SNX"===r.symbol&&"0"!==N&&(0,lc.jsx)(Jp,{}),(0,lc.jsx)(yu,{value:k,onChange:function(e){if("-1"===e)E(N);else{var t=(0,Lc.$w)(e,r.decimals);E(t)}},usdValue:B.toString(10),symbol:A?h.baseAssetSymbol:r.symbol,assets:[{balance:N,symbol:A?h.baseAssetSymbol:r.symbol,iconSymbol:A?h.baseAssetSymbol:r.iconSymbol}],capType:Bc.R.supplyCap,isMaxSelected:z,disabled:y.loading,maxValue:N,balanceText:(0,lc.jsx)(tc.cC,{id:"Wallet balance"}),event:{eventName:yc.vh.MAX_INPUT_SELECTION,eventParams:{asset:r.underlyingAsset,assetName:r.name}}}),(0,lc.jsxs)(vu.m6,{gasLimit:g,skipLoad:!0,disabled:0===Number(k),gaslessPossible:T.isGaslessPossible,amountInUsd:Z,children:[(0,lc.jsx)(vu.oD,{description:(0,lc.jsx)(tc.cC,{id:"Supply APY"}),value:C,percent:!0}),(0,lc.jsx)(vu.aE,{incentives:r.aIncentivesData,symbol:r.symbol}),(0,lc.jsx)(vu.Bx,{collateralType:q}),(0,lc.jsx)(vu.jz,{visibleHfChange:!!k,healthFactor:d?d.healthFactor:"-1",futureHealthFactor:G.toString(10)})]}),b&&(0,lc.jsx)(gu.Q,{txError:b}),(0,lc.jsx)(af,uf({},X))]})}));function df(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 pf=function(){var e=(0,_c.vR)(),t=e.type,n=e.close,a=e.args;return(0,lc.jsx)(cc.P,{open:t===_c.w8.Supply,setOpen:n,children:(0,lc.jsx)(Tc.A,{action:"supply",title:(0,lc.jsx)(tc.cC,{id:"Supply"}),underlyingAsset:a.underlyingAsset,requiredPermission:wc.g.DEPOSITOR,children:function(e){return(0,lc.jsx)(lf,function(e){for(var t=1;t0&&!$.includes(t.symbol)?Y=hu.ZERO_LTV_WITHDRAW_BLOCKED:!V.eq("-1")&&q.lt(L)?Y=hu.SUPPLY_CAP_REACHED:!G.eq("-1")&&G.lt("1.01")&&(Y=hu.HF_BELOW_ONE);var K=function(){switch(Y){case hu.SUPPLY_CAP_REACHED:return(0,lc.jsx)(tc.cC,{id:"Supply cap on target reserve reached. Try lowering the amount."});case hu.HF_BELOW_ONE:return(0,lc.jsx)(tc.cC,{id:"The effects on the health factor would cause liquidation. Try lowering the amount."});case hu.ZERO_LTV_WITHDRAW_BLOCKED:return(0,lc.jsx)(tc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:$}});default:return null}};if(y.success)return(0,lc.jsx)(bu.R,{action:(0,lc.jsx)(tc.cC,{id:"Switched"}),amount:x.current,symbol:t.symbol});var Q=s&&"0"!==s.totalBorrowsMarketReferenceCurrency&&"0"!==t.reserveLiquidationThreshold,X=(0,Mc.wD)(C.reserve).debtCeilingReached,J=Pu(n,s.totalCollateralUSD,s.isInIsolationMode,X),ee=(0,Mc.wD)(C.reserve).debtCeilingReached,te=Pu(C,s.totalCollateralUSD,s.isInIsolationMode,ee);if(R&&J===Eu.z.ISOLATED_ENABLED&&"0"===C.underlyingBalance&&(te=C.reserve.isIsolated?Eu.z.ISOLATED_ENABLED:Eu.z.ENABLED),R&&J===Eu.z.ENABLED&&"0"===C.underlyingBalance&&C.reserve.isIsolated){var ne=s.userReservesData.filter((function(e){return e.usageAsCollateralEnabledOnUser}));1===ne.length&&ne[0].underlyingAsset===n.underlyingAsset&&(te=Eu.z.ISOLATED_ENABLED)}return(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(yu,{value:I,onChange:function(e){var t="-1"===e;x.current=t?P:e,_(e)},usdValue:j,symbol:t.iconSymbol,assets:[{balance:P,address:t.underlyingAsset,symbol:t.symbol,iconSymbol:t.iconSymbol}],maxValue:P,inputTitle:(0,lc.jsx)(tc.cC,{id:"Supplied asset amount"}),balanceText:(0,lc.jsx)(tc.cC,{id:"Supply balance"}),isMaxSelected:R}),(0,lc.jsxs)(ac.Z,{sx:{padding:"18px",pt:"14px",display:"flex",justifyContent:"space-between"},children:[(0,lc.jsx)(ic.Z,{sx:{fontSize:"18px !important"},children:(0,lc.jsx)(ff,{})}),(0,lc.jsx)(Gl,{loading:F,outputAmountUSD:L,inputAmountUSD:j})]}),(0,lc.jsx)(yu,{value:N,onSelect:k,usdValue:L,symbol:S.symbol,assets:b,inputTitle:(0,lc.jsx)(tc.cC,{id:"Switch to"}),balanceText:(0,lc.jsx)(tc.cC,{id:"Supply balance"}),disableInput:!0,loading:F}),B&&!F&&(0,lc.jsx)(oc.Z,{variant:"helperText",color:"error.main",children:B}),!B&&void 0!==Y&&(0,lc.jsx)(oc.Z,{variant:"helperText",color:"error.main",children:(0,lc.jsx)(K,{})}),"stETH"===C.reserve.symbol&&(0,lc.jsx)(Nu.v,{severity:"warning",sx:{mt:2,mb:0},children:(0,lc.jsx)(hf.O,{})}),(0,lc.jsx)(vu.m6,{gasLimit:m,slippageSelector:(0,lc.jsx)(tp,{selectedSlippage:A,setSlippage:O}),children:(0,lc.jsx)(vf,{showHealthFactor:Q,healthFactor:null===s||void 0===s?void 0:s.healthFactor,healthFactorAfterSwap:G.toString(10),swapSource:_f(_f({},n),{},{collateralType:J}),swapTarget:_f(_f({},C),{},{collateralType:te}),toAmount:N,fromAmount:""===I?"0":I,loading:F})}),g&&(0,lc.jsx)(np,{txError:g}),(0,lc.jsx)(gf,{isMaxSelected:R,poolReserve:t,amountToSwap:M,amountToReceive:N,isWrongNetwork:r,targetReserve:C.reserve,symbol:t.symbol,blocked:void 0!==Y||""!==B||"stETH"===C.reserve.symbol,useFlashLoan:W,loading:Z,buildTxFn:U})]})};function Tf(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 Sf,kf=function(){var e=(0,_c.vR)(),t=e.type,n=e.close,a=e.args;return(0,lc.jsx)(cc.P,{open:t===_c.w8.Swap,setOpen:n,children:(0,lc.jsx)(Tc.A,{title:(0,lc.jsx)(tc.cC,{id:"Switch"}),underlyingAsset:a.underlyingAsset,children:function(e){return(0,lc.jsx)(xf,function(e){for(var t=1;t=1&&j.toNumber()<1.5&&n.usageAsCollateralEnabledOnUser,B=void 0;u.success||u.txHash||(M.length>0&&!M.includes(t.symbol)?B=Sf.ZERO_LTV_WITHDRAW_BLOCKED:j.lt("1")&&"0"!==d.totalBorrowsMarketReferenceCurrency?B=Sf.CAN_NOT_WITHDRAW_THIS_AMOUNT:B||!k.eq("0")&&!(0,Ec.hE)(R).gt(t.unborrowedLiquidity)||(B=Sf.POOL_DOES_NOT_HAVE_ENOUGH_LIQUIDITY));var Z=function(){switch(B){case Sf.CAN_NOT_WITHDRAW_THIS_AMOUNT:return(0,lc.jsx)(tc.cC,{id:"You can not withdraw this amount because it will cause collateral call"});case Sf.POOL_DOES_NOT_HAVE_ENOUGH_LIQUIDITY:return(0,lc.jsx)(tc.cC,{id:"These funds have been borrowed and are not available for withdrawal at this time."});case Sf.ZERO_LTV_WITHDRAW_BLOCKED:return(0,lc.jsx)(tc.cC,{id:"Assets with zero LTV ({assetsBlockingWithdraw}) must be withdrawn or disabled as collateral to perform this action",values:{assetsBlockingWithdraw:M}});default:return null}},U=(0,Ec.hE)(R).multipliedBy((null===n||void 0===n?void 0:n.reserve.priceInUSD)||0);return u.success?(0,lc.jsx)(bu.R,{action:(0,lc.jsx)(tc.cC,{id:"withdrew"}),amount:x.current,symbol:r&&t.isWrappedBaseAsset?p.baseAssetSymbol:t.symbol}):(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(yu,{value:R,onChange:function(e){var t="-1"===e;x.current=t?E.toString(10):e,m(e),t&&E.eq(S)?(T(yc.vh.MAX_INPUT_SELECTION,{type:"withdraw"}),b("-1")):b(E.toString(10))},symbol:i,assets:[{balance:E.toString(10),symbol:i,iconSymbol:r&&t.isWrappedBaseAsset?p.baseAssetSymbol:t.iconSymbol}],usdValue:U.toString(10),isMaxSelected:P,disabled:u.loading,maxValue:E.toString(10),balanceText:k.lt(S)?(0,lc.jsx)(tc.cC,{id:"Available"}):(0,lc.jsx)(tc.cC,{id:"Supply balance"})}),void 0!==B&&(0,lc.jsx)(oc.Z,{variant:"helperText",color:"error.main",children:(0,lc.jsx)(Z,{})}),t.isWrappedBaseAsset&&(0,lc.jsx)(vu.Pu,{unwrapped:r,setUnWrapped:a,label:(0,lc.jsx)(oc.Z,{children:"Unwrap ".concat(t.symbol," (to withdraw ").concat(p.baseAssetSymbol,")")})}),(0,lc.jsxs)(vu.m6,{gasLimit:c,children:[(0,lc.jsx)(vu.oD,{description:(0,lc.jsx)(tc.cC,{id:"Remaining supply"}),value:S.minus(R||"0").toString(10),symbol:t.isWrappedBaseAsset?p.baseAssetSymbol:t.symbol}),(0,lc.jsx)(vu.jz,{visibleHfChange:!!h,healthFactor:d?d.healthFactor:"-1",futureHealthFactor:j.toString(10)})]}),l&&(0,lc.jsx)(gu.Q,{txError:l}),L&&(0,lc.jsxs)(lc.Fragment,{children:[(0,lc.jsx)(Nu.v,{severity:"error",sx:{my:6},children:(0,lc.jsx)(tc.cC,{id:"Withdrawing this amount will reduce your health factor and increase risk of liquidation."})}),(0,lc.jsxs)(ac.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",mx:"24px",mb:"12px"},children:[(0,lc.jsx)(Mu.Z,{checked:w,onChange:function(){_(!w),T(yc.vh.ACCEPT_RISK,{modal:"Withdraw",riskCheckboxAccepted:w})},size:"small","data-cy":"risk-checkbox"}),(0,lc.jsx)(oc.Z,{variant:"description",children:(0,lc.jsx)(tc.cC,{id:"I acknowledge the risks involved."})})]})]}),(0,lc.jsx)(Ef,{poolReserve:t,amountToWithdraw:P?g:R,poolAddress:r&&t.isWrappedBaseAsset?kc.hP:t.underlyingAsset,isWrongNetwork:o,symbol:i,blocked:void 0!==B||L&&!w,sx:L?{mt:0}:{}})]})};function Of(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 Cf(e){for(var t=1;t{A.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,g.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,g._v)(e,t,n),a=this.getQueryData(r.queryKey);return a?Promise.resolve(a):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),a=null==r?void 0:r.state.data,i=(0,g.SE)(t,a);if("undefined"===typeof i)return;const o=(0,g._v)(e),s=this.defaultQueryOptions(o);return this.queryCache.build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return v.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,g.I6)(e,t),r=this.queryCache;v.V.batch((()=>{r.findAll(n).forEach((e=>{r.remove(e)}))}))}resetQueries(e,t,n){const[r,a]=(0,g.I6)(e,t,n),i=this.queryCache,o={type:"active",...r};return v.V.batch((()=>(i.findAll(r).forEach((e=>{e.reset()})),this.refetchQueries(o,a))))}cancelQueries(e,t,n){const[r,a={}]=(0,g.I6)(e,t,n);"undefined"===typeof a.revert&&(a.revert=!0);const i=v.V.batch((()=>this.queryCache.findAll(r).map((e=>e.cancel(a)))));return Promise.all(i).then(g.ZT).catch(g.ZT)}invalidateQueries(e,t,n){const[r,a]=(0,g.I6)(e,t,n);return v.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,a)}))}refetchQueries(e,t,n){const[r,a]=(0,g.I6)(e,t,n),i=v.V.batch((()=>this.queryCache.findAll(r).filter((e=>!e.isDisabled())).map((e=>{var t;return e.fetch(void 0,{...a,cancelRefetch:null==(t=null==a?void 0:a.cancelRefetch)||t,meta:{refetchPage:r.refetchPage}})}))));let o=Promise.all(i).then(g.ZT);return null!=a&&a.throwOnError||(o=o.catch(g.ZT)),o}fetchQuery(e,t,n){const r=(0,g._v)(e,t,n),a=this.defaultQueryOptions(r);"undefined"===typeof a.retry&&(a.retry=!1);const i=this.queryCache.build(this,a);return i.isStaleByTime(a.staleTime)?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e,t,n){return this.fetchQuery(e,t,n).then(g.ZT).catch(g.ZT)}fetchInfiniteQuery(e,t,n){const r=(0,g._v)(e,t,n);return r.behavior=(0,C.Gm)(),this.fetchQuery(r)}prefetchInfiniteQuery(e,t,n){return this.fetchInfiniteQuery(e,t,n).then(g.ZT).catch(g.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,g.yF)(e)===(0,g.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,g.to)(e,t.queryKey)));return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){const n=this.mutationDefaults.find((t=>(0,g.yF)(e)===(0,g.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,g.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,g.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 eh(e){var t,n=e.Component,r=e.emotionCache,a=void 0===r?Qf:r,i=e.pageProps,o=null!==(t=n.getLayout)&&void 0!==t?t:function(e){return e},s=(0,hc.Yh)((function(e){return e.initializeMixpanel})),c="56a73cd233d8c404b823d000f9a807c3";return(0,Ys.useEffect)((function(){var e;(e={dsn:"https://629466fb3bc0091f0af74dbf30bb0a76@o4505951646121984.ingest.sentry.io/4505963347312640",integrations:[new ca({}),new Ws],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:D}],version:D},cr(e)}),[]),(0,Ys.useEffect)((function(){s()}),[c,s]),(0,lc.jsxs)(y.C,{value:a,children:[(0,lc.jsx)($s.default,{children:(0,lc.jsx)("meta",{name:"viewport",content:"initial-scale=1, width=device-width"})}),(0,lc.jsx)(fc,{title:"Open Source Liquidity Protocol",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. The protocol is designed for easy integration into your products and services.",imageUrl:"https://i.imgur.com/Ee63x7K.png"}),(0,lc.jsx)(qf.iL,{children:(0,lc.jsxs)(P.aH,{client:Jf,children:[(0,lc.jsx)(I.Web3ReactProvider,{getLibrary:Xf,children:(0,lc.jsx)(Gf,{children:(0,lc.jsx)(Vf.v,{children:(0,lc.jsx)(pc,{children:(0,lc.jsx)(Rf.W,{children:(0,lc.jsx)(_c.ny,{children:(0,lc.jsx)(_u.R,{children:(0,lc.jsx)(jc.GM,{children:(0,lc.jsx)(_p.Wv,{children:(0,lc.jsxs)(Hf._,{children:[(0,lc.jsx)($f.default,{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=G-4BXYGRCH1M"}),(0,lc.jsx)($f.default,{id:"google-analytics",children:"window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-4BXYGRCH1M');"}),o((0,lc.jsx)(n,Kf({},i))),(0,lc.jsx)(pf,{}),(0,lc.jsx)(Pf,{}),(0,lc.jsx)(ol,{}),(0,lc.jsx)($p,{}),(0,lc.jsx)(xl,{}),(0,lc.jsx)(Ap,{}),(0,lc.jsx)(gp,{}),(0,lc.jsx)(gl,{}),(0,lc.jsx)(vp,{}),(0,lc.jsx)(kf,{}),(0,lc.jsx)(wp.F,{}),(0,lc.jsx)(xp.P,{}),(0,lc.jsx)(vc,{})]})})})})})})})})})}),(0,lc.jsx)(R,{initialIsOpen:!1})]})})]})}},97563:function(e,t,n){"use strict";n.d(t,{a:function(){return y},E:function(){return m}});var r=n(67294),a=n(30067),i=n(73633),o=n(57094),s=n(85893);function c(e){return e.substring(2).toLowerCase()}var u=function(e){const{children:t,disableReactTree:n=!1,mouseEvent:u="onClick",onClickAway:l,touchEvent:d="onTouchEnd"}=e,p=r.useRef(!1),f=r.useRef(null),h=r.useRef(!1),m=r.useRef(!1);r.useEffect((()=>(setTimeout((()=>{h.current=!0}),0),()=>{h.current=!1})),[]);const y=(0,a.Z)(t.ref,f),g=(0,i.Z)((e=>{const t=m.current;m.current=!1;const r=(0,o.Z)(f.current);if(!h.current||!f.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth-1:!r.documentElement.contains(e.target)||f.current.contains(e.target),a||!n&&t||l(e)})),b=e=>n=>{m.current=!0;const r=t.props[e];r&&r(n)},v={ref:y};return!1!==d&&(v[d]=b(d)),r.useEffect((()=>{if(!1!==d){const e=c(d),t=(0,o.Z)(f.current),n=()=>{p.current=!0};return t.addEventListener(e,g),t.addEventListener("touchmove",n),()=>{t.removeEventListener(e,g),t.removeEventListener("touchmove",n)}}}),[g,d]),!1!==u&&(v[u]=b(u)),r.useEffect((()=>{if(!1!==u){const e=c(u),t=(0,o.Z)(f.current);return t.addEventListener(e,g),()=>{t.removeEventListener(e,g)}}}),[g,u]),(0,s.jsx)(r.Fragment,{children:r.cloneElement(t,v)})},l=n(81719),d=n(58402),p=n(20525),f=n(72389),h=n(61953),m=(0,l.ZP)(d.Z)((0,p.Z)({".MuiTooltip-tooltip":{color:"text.primary",backgroundColor:"background.paper",p:0,borderRadius:"6px",boxShadow:"0px 0px 2px rgba(0, 0, 0, 0.2), 0px 2px 10px rgba(0, 0, 0, 0.1)",maxWidth:"280px"},".MuiTooltip-arrow":{color:"background.paper","&:before":{boxShadow:"0px 0px 2px rgba(0, 0, 0, 0.2), 0px 2px 10px rgba(0, 0, 0, 0.1)"}}})),y=function(e){var t=e.children,n=e.tooltipContent,a=e.placement,i=void 0===a?"top":a,o=e.withoutHover,c=e.open,l=e.setOpen,d=e.offset,p=(0,r.useState)(!1),y=p[0],g=p[1],b="undefined"!==typeof c?c:y,v=function(){return"undefined"!==typeof l?l(!1):g(!1)};return(0,s.jsx)(f.Z,{open:b,onClose:v,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,placement:i,PopperComponent:m,componentsProps:{popper:{modifiers:[{name:"offset",options:{offset:null!==d&&void 0!==d?d:[]}}],onClick:function(e){e.stopPropagation()}}},title:(0,s.jsx)(u,{mouseEvent:"onMouseDown",touchEvent:"onTouchStart",onClickAway:v,children:(0,s.jsx)(h.Z,{sx:{py:4,px:6,fontSize:"12px",lineHeight:"16px",a:{fontSize:"12px",lineHeight:"16px",fontWeight:500,"&:hover":{textDecoration:"underline"}}},children:n})}),arrow:!0,children:(0,s.jsx)(h.Z,{sx:{display:"inline-flex",cursor:"pointer",transition:"all 0.2s ease","&:hover":{opacity:o||b?1:.5}},onClick:function(e){e.preventDefault(),e.stopPropagation(),"undefined"!==typeof l?l(!b):g(!b)},children:t})})}},50020:function(e,t,n){"use strict";var r=n(59499),a=n(4730),i=n(91655),o=n(61953),s=n(29630),c=(n(67294),n(34220)),u=n(41024),l=n(85893),d=["minVal","maxVal","percentVariant","hyphenVariant"];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 f(e){for(var t=1;t=3?g.success.main:b<1.1?g.error.main:g.warning.main,(0,f.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,f.jsx)(u.Z,{variant:"secondary14",color:g.success.main,children:"\u221e"}):(0,f.jsx)(p.B,y({value:b,sx:y({color:v},m.sx),visibleDecimals:2,compact:!0},m)),n&&(0,f.jsx)(l.Z,{onClick:n,variant:"surface",size:"small",sx:{minWidth:"unset",ml:{xs:0,xsm:2}},children:(0,f.jsx)(i.cC,{id:"Risk details"})}),r&&(0,f.jsx)(c.Z,{ml:{xs:0,xsm:2},mt:{xs:1,xsm:0},children:r})]})}},34637:function(e,t,n){"use strict";n.d(t,{Y:function(){return d},Z:function(){return p}});var r=n(59499),a=n(81719),i=n(87054),o=(n(67294),n(85893));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;tRead our FAQ",components:{0:(0,T.jsx)(m.Z,{href:"https://docs.aave.com/faq/troubleshooting",target:"_blank",rel:"noopener"})}})}),(0,T.jsx)(l.Z,{variant:"helperText",children:(0,T.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."})})]})},B=function(){var e=(0,r.q)(),t=e.isWalletModalOpen,n=e.setWalletModalOpen;return(0,T.jsx)(a.P,{open:t,setOpen:n,children:(0,T.jsx)(L,{})})}},84734:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(49501),a=n(68861),i=n(85893),o=function(){return(0,i.jsx)(r.cC,{id:"<0>Ampleforth is a rebasing asset. Visit the <1>documentation to learn more.",components:{0:(0,i.jsx)("b",{}),1:(0,i.jsx)(a.rU,{href:"https://docs.aave.com/developers/v/2.0/guides/ampl-asset-listing",underline:"always"})}})}},1252:function(e,t,n){"use strict";n.d(t,{O:function(){return i}});var r=n(49501),a=n(85893),i=function(){return(0,a.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),a=n(4730),i=n(81645),o=n(85893),s=["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,y.jsx)(f.T1,{symbol:e.rewardTokenSymbol,sx:{fontSize:"20px",mr:1}}),(0,y.jsx)(s.Z,{variant:a,children:e.rewardTokenSymbol})]}),width:"100%",children:(0,y.jsx)(i,{incentiveAPR:e.incentiveAPR})},e.rewardTokenAddress)})),t.length>1&&(0,y.jsx)(o.Z,{sx:function(e){return{pt:1,mt:1,border:"1px solid ".concat(e.palette.divider)}},children:(0,y.jsx)(m.X,{caption:(0,y.jsx)(h.cC,{id:"Net APR"}),height:32,children:(0,y.jsx)(i,{incentiveAPR:n})})})]})]})},b=function(){return(0,y.jsx)(o.Z,{sx:{p:{xs:"0 4px",xsm:"3.625px 4px"},display:"flex",alignItems:"center",justifyContent:"center"},children:(0,y.jsx)(s.Z,{variant:"main12",color:"text.secondary",children:"\xa0"})})},v=function(e){var t=e.incentives,n=e.symbol,h=e.displayBlank,m=(0,a.useState)(!1),v=m[0],w=m[1],_=(0,u.Yh)((function(e){return e.trackEvent}));if(!(t&&t.length>0))return h?(0,y.jsx)(b,{}):null;var x=t.some((function(e){return"Infinity"===e.incentiveAPR})),T=x?"Infinity":t.reduce((function(e,t){return e+ +t.incentiveAPR}),0),S=x?"Infinity":"Infinity"!==T?(0,r.hE)(T||0).toNumber():"Infinity";if(0===S)return h?(0,y.jsx)(b,{}):null;return(0,y.jsx)(d.a,{tooltipContent:(0,y.jsx)(g,{incentives:t,incentivesNetAPR:S,symbol:n}),withoutHover:!0,setOpen:w,open:v,children:(0,y.jsxs)(o.Z,{sx:function(e){return{p:{xs:"0 4px",xsm:"2px 4px"},border:"1px solid ".concat(v?e.palette.action.disabled:e.palette.divider),borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s ease",bgcolor:v?"action.hover":"transparent","&:hover":{bgcolor:"action.hover",borderColor:"action.disabled"}}},onClick:function(){_(l.h1.VIEW_LM_DETAILS_DASHBOARD,{}),w(!v)},children:[(0,y.jsx)(o.Z,{sx:{mr:2},children:"Infinity"!==S&&S<1e4?(0,y.jsx)(p.B,{value:S,percent:!0,variant:"secondary12",color:"text.secondary"}):"Infinity"!==S&&S>9999?(0,y.jsx)(p.B,{value:S,percent:!0,compact:!0,variant:"secondary12",color:"text.secondary"}):"Infinity"===S?(0,y.jsx)(s.Z,{variant:"main12",color:"text.secondary",children:"\u221e"}):void 0}),(0,y.jsx)(o.Z,{sx:{display:"inline-flex"},children:(0,y.jsx)(y.Fragment,{children:t.length<5?(0,y.jsx)(y.Fragment,{children:t.map((function(e){return(0,y.jsx)(f.T1,{symbol:e.rewardTokenSymbol,sx:{fontSize:"".concat(12,"px"),ml:-1}},e.rewardTokenSymbol)}))}):(0,y.jsxs)(y.Fragment,{children:[t.slice(0,3).map((function(e){return(0,y.jsx)(f.T1,{symbol:e.rewardTokenSymbol,sx:{fontSize:"".concat(12,"px"),ml:-1}},e.rewardTokenSymbol)})),(0,y.jsx)(c.Z,{sx:{fontSize:"".concat(12,"px"),borderRadius:"50%",bgcolor:"common.white",color:"common.black",ml:-1,zIndex:5},children:(0,y.jsx)(i,{})})]})})})]})})}},10766:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(59499),a=n(36864),i=n(49501),o=n(58527),s=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,s.jsx)("b",{}),1:(0,s.jsx)("b",{})}})}))}},25049:function(e,t,n){"use strict";n.d(t,{Y:function(){return p}});var r=n(59499),a=n(4730),i=n(49501),o=n(81902),s=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)(o.rU,{href:"https://docs.gho.xyz/concepts/how-gho-works/interest-rate-discount-model#interest-rate-model",underline:"always"})}}),p=function(e){return(0,c.jsx)(s.G,l(l({event:{eventName:i.vh.TOOL_TIP,eventParams:{tooltip:"ONEZ APY"}}},e),{},{children:d}))}},44749:function(e,t,n){"use strict";n.d(t,{Ch:function(){return y},r$:function(){return g},a9:function(){return b}});var r=n(59499),a=n(49501),i=n(38264),o=n(81645),s=n(61953),c=n(29630),u=n(68346),l=n(97563),d=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 f(e){for(var t=1;tFAQ guide",components:{0:(0,d.jsx)(u.Z,{href:"https://docs.aave.com/faq/aave-v3-features#isolation-mode",fontWeight:500})}})})]})}},31959:function(e,t,n){"use strict";n.d(t,{P:function(){return m}});var r=n(59499),a=n(4730),i=n(5506),o=n(72553),s=n(70918),c=n(61953),u=n(80562),l=n(81645),d=(n(67294),n(85893)),p=["open","setOpen","withCloseButton","contentMaxWidth","children"];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 h(e){for(var t=1;t1||u||"USD"===n?2:7);var v=Math.pow(10,-b),w=0!==g&&Math.abs(g)99999);return h&&!x&&(_=Math.trunc(Number(_)*Math.pow(10,b))/Math.pow(10,b)),(0,s.jsxs)(o.Z,l(l({},y),{},{sx:l({display:"inline-flex",flexDirection:"row",alignItems:"center",position:"relative"},y.sx),noWrap:!0,children:[w&&(0,s.jsx)(o.Z,{component:"span",sx:{mr:.5},variant:d||y.variant,color:f||"text.secondary",children:"<"}),"usd"===(null===n||void 0===n?void 0:n.toLowerCase())&&!u&&(0,s.jsx)(o.Z,{component:"span",sx:{mr:.5},variant:d||y.variant,color:f||"text.secondary",children:"$"}),x?(0,s.jsx)(p,{value:_,visibleDecimals:b,roundDown:h,compactThreshold:m}):new Intl.NumberFormat("en-US",{maximumFractionDigits:b,minimumFractionDigits:b}).format(_),u&&(0,s.jsx)(o.Z,{component:"span",sx:{ml:.5},variant:d||y.variant,color:f||"text.secondary",children:"%"}),"usd"!==(null===n||void 0===n?void 0:n.toLowerCase())&&"undefined"!==typeof n&&(0,s.jsx)(o.Z,{component:"span",sx:{ml:.5},variant:d||y.variant,color:f||"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),a=n(4730),i=n(68346),o=n(81719),s=n(86010),c=n(41664),u=n(11163),l=n(67294),d=n(85893),p=["to","linkAs","href","replace","scroll","shallow","prefetch","locale"],f=["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,y.Z)(n.color)}`],t[`fontSize${(0,y.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]}))),x=d.forwardRef((function(e,t){const n=(0,m.Z)({props:e,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:i="inherit",component:o="span",fontSize:s="medium"}=n,c=(0,l.Z)(n,w),d=(0,u.Z)({},n,{baseClassName:r,color:i,component:o,fontSize:s}),h=(e=>{const{color:t,fontSize:n,classes:r}=e,a={root:["root","inherit"!==t&&`color${(0,y.Z)(t)}`,`fontSize${(0,y.Z)(n)}`]};return(0,f.Z)(a,b,r)})(d);return(0,v.jsx)(_,(0,u.Z)({as:o,className:(0,p.default)(r,"notranslate",h.root,a),ownerState:d,"aria-hidden":!0,ref:t},c))}));x.muiName="Icon";var T=x,S=n(61953),k=n(33821),E=["symbol","aToken"],A=["symbols","badgeSymbol"],O=["symbol"];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 P(e){for(var t=1;t1){var l=(t=u,(0,r.Z)(t)||(0,a.Z)(t)||(0,i.Z)(t)||(0,o.Z)()),d=l[0],p=l.slice(1);return(0,v.jsx)(j,P(P({},s),{},{symbols:p,badgeSymbol:"/pools/"+d}))}return(0,v.jsx)(D,P({symbol:n},s))}I.displayName="ATokenIcon"},19952:function(e,t,n){"use strict";n.d(t,{v:function(){return L}});var r=n(59499),a=n(4730),i=n(63366),o=n(87462),s=n(67294),c=n(86010),u=n(94780),l=n(41796),d=n(81719),p=n(78884),f=n(36622),h=n(70918),m=n(34867);function y(e){return(0,m.Z)("MuiAlert",e)}var g,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),_=n(85893),x=(0,w.Z)((0,_.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"),T=(0,w.Z)((0,_.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),S=(0,w.Z)((0,_.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,_.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"),E=(0,w.Z)((0,_.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 A=["action","children","className","closeText","color","icon","iconMapping","onClose","role","severity","variant"],O=(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,f.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,a=t.color||t.severity;return(0,o.Z)({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},a&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${a}Color`]:n(e.palette[a].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${a}StandardBg`]:r(e.palette[a].light,.9),[`& .${b.icon}`]:e.vars?{color:e.vars.palette.Alert[`${a}IconColor`]}:{color:"dark"===e.palette.mode?e.palette[a].main:e.palette[a].light}},a&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${a}Color`]:n(e.palette[a].light,.6),border:`1px solid ${(e.vars||e).palette[a].light}`,[`& .${b.icon}`]:e.vars?{color:e.vars.palette.Alert[`${a}IconColor`]}:{color:"dark"===e.palette.mode?e.palette[a].main:e.palette[a].light}},a&&"filled"===t.variant&&(0,o.Z)({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${a}FilledColor`],backgroundColor:e.vars.palette.Alert[`${a}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[a].dark:e.palette[a].main,color:e.palette.getContrastText("dark"===e.palette.mode?e.palette[a].dark:e.palette[a].main)}))})),C=(0,d.ZP)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),P=(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}),I={success:(0,_.jsx)(x,{fontSize:"inherit"}),warning:(0,_.jsx)(T,{fontSize:"inherit"}),error:(0,_.jsx)(S,{fontSize:"inherit"}),info:(0,_.jsx)(k,{fontSize:"inherit"})};var D=s.forwardRef((function(e,t){const n=(0,p.Z)({props:e,name:"MuiAlert"}),{action:r,children:a,className:s,closeText:l="Close",color:d,icon:h,iconMapping:m=I,onClose:b,role:w="alert",severity:x="success",variant:T="standard"}=n,S=(0,i.Z)(n,A),k=(0,o.Z)({},n,{color:d,severity:x,variant:T}),D=(e=>{const{variant:t,color:n,severity:r,classes:a}=e,i={root:["root",`${t}${(0,f.Z)(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return(0,u.Z)(i,y,a)})(k);return(0,_.jsxs)(O,(0,o.Z)({role:w,elevation:0,ownerState:k,className:(0,c.default)(D.root,s),ref:t},S,{children:[!1!==h?(0,_.jsx)(C,{ownerState:k,className:D.icon,children:h||m[x]||I[x]}):null,(0,_.jsx)(P,{ownerState:k,className:D.message,children:a}),null!=r?(0,_.jsx)(R,{ownerState:k,className:D.action,children:r}):null,null==r&&b?(0,_.jsx)(R,{ownerState:k,className:D.action,children:(0,_.jsx)(v.Z,{size:"small","aria-label":l,title:l,color:"inherit",onClick:b,children:g||(g=(0,_.jsx)(E,{fontSize:"small"}))})}):null]}))})),j=["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;t2)return;return t[1]}if(e===a.SWITCH){if(r>3)return;return 1===n?t[2]:t[1]}return t[0]}(t,R,C.userEmodeCategoryId)),Y=$[0],K=$[1],Q=(0,_.Mo)(M),X=(0,o.G)({currentTimestamp:z,userReserves:j,formattedReserves:P,userEmodeCategoryId:Y?Y.id:0,marketReferenceCurrencyDecimals:I,marketReferencePriceInUsd:D}),J=void 0;if(C.isInEmode&&0===(null===Y||void 0===Y?void 0:Y.id))Number(X.healthFactor)<1.01&&"-1"!==X.healthFactor&&(J=r.EMODE_DISABLED_LIQUIDATION);else if(Y&&C.userEmodeCategoryId!==(null===Y||void 0===Y?void 0:Y.id)){C.userReservesData.some((function(e){return(Number(e.scaledVariableDebt)>0||Number(e.principalStableDebt)>0)&&e.reserve.eModeCategoryId!==(null===Y||void 0===Y?void 0:Y.id)}))&&(J=r.CLOSE_POSITIONS_BEFORE_SWITCHING)}var ee=function(){switch(J){case r.CLOSE_POSITIONS_BEFORE_SWITCHING:return(0,L.jsx)(m.v,{severity:"info",sx:{mt:6,alignItems:"center"},children:(0,L.jsx)(c.Z,{variant:"caption",children:(0,L.jsx)(i.cC,{id:"To enable E-mode for the {0} category, all borrow positions outside of this category must be closed.",values:{0:Y&&(0,N.U)(Y.label)}})})});case r.EMODE_DISABLED_LIQUIDATION:return(0,L.jsxs)(m.v,{severity:"error",sx:{mt:6,alignItems:"center"},children:[(0,L.jsx)(c.Z,{variant:"subheader1",color:"#4F1919",children:(0,L.jsx)(i.cC,{id:"Cannot disable E-Mode"})}),(0,L.jsx)(c.Z,{variant:"caption",children:(0,L.jsx)(i.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===a.ENABLE||Object.keys(R).length>=4&&t===a.SWITCH,ne=M!==U,re=function(){return(0,L.jsx)(u.Z,{color:"primary",sx:{fontSize:"14px",mx:1},children:(0,L.jsx)(s.Z,{})})},ae=!!Y&&0===Y.id&&void 0===J&&Number(X.healthFactor).toFixed(3)FAQ guide to learn more about how it works and the applied restrictions.",components:{0:(0,L.jsx)(l.Z,{href:"https://docs.aave.com/faq/aave-v3-features#high-efficiency-mode-e-mode",target:"_blank",rel:"noopener"})}})})}),te&&(0,L.jsx)(G,{emodeCategories:R,selectedEmode:null===Y||void 0===Y?void 0:Y.id,setSelectedEmode:K,userEmode:C.userEmodeCategoryId}),J===r.EMODE_DISABLED_LIQUIDATION&&(0,L.jsx)(ee,{}),ae&&(0,L.jsxs)(m.v,{severity:"error",sx:{mt:6,alignItems:"center"},children:[(0,L.jsx)(c.Z,{variant:"subheader1",color:"#4F1919",children:(0,L.jsx)(i.cC,{id:"Liquidation risk"})}),(0,L.jsx)(c.Z,{variant:"caption",children:(0,L.jsx)(i.cC,{id:"This action will reduce your health factor. Please be mindful of the increased risk of collateral liquidation."})})]}),(0,L.jsxs)(E.m6,{gasLimit:W,children:[!te&&(0,L.jsx)(h.X,{caption:(0,L.jsx)(i.cC,{id:"E-Mode category"}),captionVariant:"description",mb:4,children:(0,L.jsxs)(d.Z,{sx:{display:"flex",justifyContent:"right",alignItems:"center"},children:[(0,L.jsx)(d.Z,{sx:{display:"inline-flex",alignItems:"center",mx:1},children:0!==C.userEmodeCategoryId?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(u.Z,{sx:{fontSize:"12px"},children:(0,L.jsx)(x.Z,{})}),(0,L.jsx)(c.Z,{variant:"subheader1",children:(0,N.U)(R[C.userEmodeCategoryId].label)})]}):(0,L.jsx)(c.Z,{variant:"subheader1",children:(0,L.jsx)(i.cC,{id:"None"})})}),Y&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(re,{}),(0,L.jsx)(d.Z,{sx:{display:"inline-flex",alignItems:"center"},children:0!==Y.id?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(u.Z,{sx:{fontSize:"12px",mr:.5},children:(0,L.jsx)(x.Z,{})}),(0,L.jsx)(c.Z,{variant:"subheader1",children:(0,N.U)(R[Y.id].label)})]}):(0,L.jsx)(c.Z,{variant:"subheader1",children:(0,L.jsx)(i.cC,{id:"None"})})})]})]})}),(0,L.jsx)(h.X,{caption:(0,L.jsx)(i.cC,{id:"Available assets"}),captionVariant:"description",mb:4,sx:{alignContent:"flex-end"},children:(0,L.jsxs)(d.Z,{sx:{display:"flex",justifyContent:"right",alignItems:"center"},children:[R[C.userEmodeCategoryId]&&(0,L.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",textAlign:"end"},children:0!==C.userEmodeCategoryId?(0,L.jsx)(c.Z,{sx:{textAlign:"end"},children:R[C.userEmodeCategoryId].assets.join(", ")}):(0,L.jsx)(c.Z,{children:(0,L.jsx)(i.cC,{id:"All Assets"})})}),Y&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(re,{}),(0,L.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",textAlign:"end"},children:0!==(null===Y||void 0===Y?void 0:Y.id)?(0,L.jsx)(c.Z,{sx:{textAlign:"end"},children:Y.assets.join(", ")}):(0,L.jsx)(c.Z,{children:(0,L.jsx)(i.cC,{id:"All Assets"})})})]})]})}),(0,L.jsx)(E.jz,{visibleHfChange:!!Y,healthFactor:C.healthFactor,futureHealthFactor:X.healthFactor}),ie&&(0,L.jsx)(h.X,{caption:(0,L.jsx)(i.cC,{id:"Maximum loan to value"}),captionVariant:"description",mb:4,align:"flex-start",children:(0,L.jsx)(d.Z,{sx:{textAlign:"right"},children:(0,L.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[(0,L.jsx)(f.B,{value:C.currentLoanToValue,sx:{color:"text.primary"},visibleDecimals:2,compact:!0,percent:!0,variant:"secondary14"}),void 0!==Y&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(re,{}),(0,L.jsx)(f.B,{value:X.currentLoanToValue,sx:{color:"text.primary"},visibleDecimals:2,compact:!0,percent:!0,variant:"secondary14"})]})]})})})]}),J===r.CLOSE_POSITIONS_BEFORE_SWITCHING&&(0,L.jsx)(ee,{}),q&&(0,L.jsx)(S.Q,{txError:q}),(0,L.jsx)(B,{isWrongNetwork:ne,blocked:void 0!==J||!Y,selectedEmode:(null===Y||void 0===Y?void 0:Y.id)||0,activeEmode:C.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 F}});var r,a,i=n(59499),o=n(49501),s=n(67294),c=n(8195),u=n(24834),l=n(31959),d=n(32993),p=n(50029),f=n(87794),h=n.n(f),m=n(29630),y=n(61953),g=n(75084),b=n(90149),v=n(77537),w=n(83601),_=n(93608),x=n(97461),T=n(85893),S=null!==globalThis&&void 0!==globalThis?globalThis:window,k="undefined"!==typeof S.turnstile?"ready":"unloaded",E="cf__reactTurnstileOnLoad",A=new Promise((function(e,t){a={resolve:e,reject:t},"ready"===k&&e(void 0)}));function O(e){var t=e.id,n=e.ref,a=e.className,i=e.style,o=e.sitekey,c=e.action,u=e.cData,l=e.theme,d=e.size,f=e.tabIndex,m=e.responseField,y=e.responseFieldName,g=e.retry,b=e.retryInterval,v=e.autoResetOnExpire,w=e.onVerify,_=e.onLoad,x=e.onError,S=e.onExpire,E=e.onTimeout,A=(0,s.useRef)(null),O=(0,s.useState)({onVerify:w})[0],C=null!==n&&void 0!==n?n:A;return(0,s.useEffect)((function(){if(C.current){var e=!1,t="";return(0,p.Z)(h().mark((function n(){var a,i,s;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===(i=O.onError)||void 0===i||i.call(O,n.t0),n.abrupt("return");case 10:if(!e&&C.current){n.next=12;break}return n.abrupt("return");case 12:s={sitekey:o,action:c,cData:u,theme:l,size:d,tabindex:f,callback:function(e){return O.onVerify(e)},"error-callback":function(){var e;return null===(e=O.onError)||void 0===e?void 0:e.call(O)},"expired-callback":function(){var e;null===(e=O.onExpire)||void 0===e||e.call(O),v&&window.turnstile.reset(t)},"timeout-callback":function(){var e;return null===(e=O.onTimeout)||void 0===e?void 0:e.call(O)},"response-field":m,"response-field-name":y,retry:g,"retry-interval":b},t=window.turnstile.render(C.current,s),null===(a=O.onLoad)||void 0===a||a.call(O,t);case 15:case"end":return n.stop()}}),n,null,[[1,6]])})))(),function(){e=!0,t&&window.turnstile.remove(t)}}}),[o,c,u,l,d,f,m,y,g,b,v]),(0,s.useEffect)((function(){O.onVerify=w,O.onLoad=_,O.onError=x,O.onExpire=S}),[w,_,x,S,E]),(0,T.jsx)("div",{ref:C,id:t,className:a,style:i})}S.cf__reactTurnstileOnLoad=function(){a.resolve(),k="ready"},r=function(){if("unloaded"===k){k="loading";var e="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(E,"&render=explicit"),t=document.createElement("script");t.src=e,t.async=!0,t.addEventListener("error",(function(){a.reject("Failed to load Turnstile.")})),document.head.appendChild(t)}return A};var C,P=n(80854),R=n(1279),I=function(e,t){var n=(0,P.gU)("1000",18),r=P.Ry[e.toUpperCase()]?P.Ry[e.toUpperCase()]:n;return(0,R.Fv)(r,t)},D=n(83454),j=function(e){var t=e.underlyingAsset,n=(0,v.Z)().readOnlyModeAddress,r=(0,u.Yh)(),a=r.account,i=r.currentMarket,c=r.currentMarketData,l=(0,u.Yh)((function(e){return(0,w.Rp)(e)})),d=(0,s.useState)(""),f=d[0],S=d[1],k=(0,s.useState)(!1),E=k[0],A=k[1],C=(0,s.useState)(!0),P=C[0],R=C[1],j=(0,s.useState)(""),M=j[0],N=j[1],L=(0,s.useState)(""),B=L[0],Z=L[1],U="".concat(D.env.NEXT_PUBLIC_API_BASEURL,"/faucet"),F=D.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY,z=l.find((function(e){return e.underlyingAsset===t})),G=I(z.symbol,z.decimals),H=function(){var e=(0,p.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(""),A(!0),Z(""),e.next=6,fetch(U,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a,captchaToken:f,market:i,tokenAddress:z.underlyingAsset,tokenSymbol:z.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?Z(e.t0.message):Z("An error occurred trying to send the transaction");case 18:return e.prev=18,A(!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,T.jsx)(_.R,{txHash:M,action:(0,T.jsx)(o.cC,{id:"will receive"}),symbol:z.symbol,amount:G}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(O,{sitekey:F,onVerify:function(e){S(e),R(!1)},autoResetOnExpire:!0}),(0,T.jsxs)(m.Z,{variant:"h2",sx:{mb:6},children:[(0,T.jsx)(o.cC,{id:"Faucet"})," ",z.symbol]}),(0,T.jsx)(y.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,T.jsx)(x.oD,{description:(0,T.jsx)(o.cC,{id:"Amount"}),iconSymbol:z.symbol,symbol:z.symbol,value:G})}),(0,T.jsx)(m.Z,{variant:"helperText",color:"error.main",children:B}),(0,T.jsx)(y.Z,{sx:{display:"flex",flexDirection:"column",mt:12},children:(0,T.jsxs)(g.Z,{variant:"contained",disabled:E||!f||void 0!==n,onClick:H,size:"large",sx:{minHeight:"44px"},children:[(E||P)&&(0,T.jsx)(b.Z,{color:"inherit",size:"16px",sx:{mr:2}}),(0,T.jsx)(o.cC,{id:"Faucet {0}",values:{0:z.symbol}})]})})]})},M=n(67916),N=n(89291),L=n(67489),B=function(e){var t=e.poolReserve,n=e.isWrongNetwork,r=e.blocked,a=(0,u.Yh)((function(e){return e.mint})),i=(0,N.Q)({tryPermit:!1,handleGetTxns:function(){var e=(0,p.Z)(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a({tokenSymbol:t.symbol,reserve:t.underlyingAsset}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),skip:r}),s=i.action,c=i.loadingTxns,l=i.mainTxState,d=i.requiresApproval;return(0,T.jsx)(L.B,{requiresApproval:d,blocked:r,preparingTransactions:c,handleAction:s,actionText:(0,T.jsx)(o.cC,{id:"Faucet {0}",values:{0:t.symbol}}),actionInProgressText:(0,T.jsx)(o.cC,{id:"Pending..."}),mainTxState:l,isWrongNetwork:n})};C||(C={});var Z=function(e){var t=e.poolReserve,n=e.isWrongNetwork,r=(0,c.vR)(),a=r.gasLimit,i=r.mainTxState,s=r.txError,u=I(t.symbol,t.decimals);return i.success?(0,T.jsx)(_.R,{action:(0,T.jsx)(o.cC,{id:"Received"}),symbol:t.symbol,amount:u}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(x.m6,{gasLimit:a,children:(0,T.jsx)(x.oD,{description:(0,T.jsx)(o.cC,{id:"Amount"}),iconSymbol:t.symbol,symbol:t.symbol,value:u})}),s&&(0,T.jsx)(M.Q,{txError:s}),(0,T.jsx)(B,{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 F=function(){var e=(0,c.vR)(),t=e.type,n=e.close,r=e.args,a=(0,u.Yh)().isFaucetPermissioned;return(0,T.jsx)(l.P,{open:t===c.w8.Faucet,setOpen:n,children:a?(0,T.jsx)(j,{underlyingAsset:r.underlyingAsset}):(0,T.jsx)(d.A,{title:(0,T.jsx)(o.cC,{id:"Faucet"}),underlyingAsset:r.underlyingAsset,children:function(e){return(0,T.jsx)(Z,function(e){for(var t=1;tDiscord or <1>Github.",components:{0:(0,p.jsx)(u.Z,{href:"https://discord.gg/7kHKnkDEUf"}),1:(0,p.jsx)(u.Z,{href:"https://github.com/aave/interface"})}})}),(0,p.jsxs)(l.Z,{variant:"outlined",onClick:function(){return navigator.clipboard.writeText(t.rawError.message.toString())},size:"small",sx:{mt:6},children:[(0,p.jsx)(r.cC,{id:"Copy error text"}),(0,p.jsx)(s.Z,{sx:{ml:.5,fontSize:"12px"},children:(0,p.jsx)(i.Z,{})})]})]}),(0,p.jsx)(o.Z,{sx:{display:"flex",flexDirection:"column",mt:12},children:(0,p.jsx)(l.Z,{onClick:n,variant:"contained",size:"large",sx:{minHeight:"44px"},children:(0,p.jsx)(r.cC,{id:"Close"})})})]})}},67916:function(e,t,n){"use strict";n.d(t,{Q:function(){return c}});var r=n(49501),a=n(29630),i=n(75084),o=n(19952),s=n(85893),c=function(e){var t=e.txError;return(0,s.jsx)(o.v,{severity:"error",sx:{mt:4,mb:0},children:(0,s.jsx)(a.Z,{variant:"description",children:t.error?(0,s.jsxs)(s.Fragment,{children:[t.error," ",(0,s.jsx)(i.Z,{sx:{verticalAlign:"top"},variant:"text",onClick:function(){return navigator.clipboard.writeText(t.rawError.message.toString())},children:(0,s.jsx)(a.Z,{variant:"description",children:(0,s.jsx)(r.cC,{id:"copy the error"})})})]}):(0,s.jsx)(r.cC,{id:"There was some error. Please try changing the parameters or <0><1>copy the error",components:{0:(0,s.jsx)(i.Z,{sx:{verticalAlign:"top"},onClick:function(){return navigator.clipboard.writeText(t.rawError.message.toString())}}),1:(0,s.jsx)(a.Z,{variant:"description"})}})})})}},32993:function(e,t,n){"use strict";n.d(t,{A:function(){return g}});var r=n(80854),a=(n(67294),n(34220)),i=n(98833),o=n(43629),s=n(77537),c=n(46930);var u=n(8195),l=n(90452),d=n(25298),p=n(57609),f=n(78944),h=n(10343),m=n(63491),y=n(85893),g=function(e){var t,n,g=e.hideTitleSymbol,b=e.underlyingAsset,v=e.children,w=e.requiredChainId,_=e.title,x=e.requiredPermission,T=e.keepWrappedSymbol,S=(0,s.Z)().readOnlyModeAddress,k=(0,i.P)().walletBalances,E=(0,c.f)(),A=E.currentNetworkConfig,O=E.currentMarketData,C=(0,a.HT)(),P=C.user,R=C.reserves,I=(0,u.vR)(),D=I.txError,j=I.mainTxState,M=(0,l.T)().permissions,N=function(e){var t=(0,c.f)().currentChainId,n=e||t;return{isWrongNetwork:(0,s.Z)().chainId!==n,requiredChainId:n}}(w),L=N.isWrongNetwork,B=N.requiredChainId;if(D&&D.blocking)return(0,y.jsx)(m.D,{txError:D});if(x&&d.cr.permissions(O)&&!M.includes(x)&&O.permissionComponent)return(0,y.jsx)(y.Fragment,{children:O.permissionComponent});var Z=R.find((function(e){return b.toLowerCase()===r.hP.toLowerCase()?e.isWrappedBaseAsset:b===e.underlyingAsset})),U=null===P||void 0===P?void 0:P.userReservesData.find((function(e){return b.toLowerCase()===r.hP.toLowerCase()?e.reserve.isWrappedBaseAsset:b===e.underlyingAsset})),F=Z.isWrappedBaseAsset&&!T?A.baseAssetSymbol:Z.symbol;return(0,y.jsxs)(o.hv,{asset:Z,children:[!j.success&&(0,y.jsx)(f.E,{title:_,symbol:g?void 0:F}),L&&!S&&(0,y.jsx)(h.I,{networkName:(0,d.Mo)(B).name,chainId:B,event:{eventName:p.vh.SWITCH_NETWORK,eventParams:{asset:b}}}),v({isWrongNetwork:L,nativeBalance:(null===(t=k[r.hP.toLowerCase()])||void 0===t?void 0:t.amount)||"0",tokenBalance:(null===(n=k[Z.underlyingAsset.toLowerCase()])||void 0===n?void 0:n.amount)||"0",poolReserve:Z,symbol:F,underlyingAsset:b,userReserve:U})]})}},93608:function(e,t,n){"use strict";n.d(t,{R:function(){return x}});var r=n(49501),a=n(75331),i=n(56365),o=n(58057),s=n(81645),c=n(62097),u=n(61953),l=n(29630),d=n(75084),p=n(68346),f=n(67294),h=n(29002),m=n(41024),y=n(2180),g=n(8195),b=n(46930),v=n(77537),w=n(85893),_=function(){return(0,w.jsx)(s.Z,{sx:{ml:"2px",fontSize:"11px"},children:(0,w.jsx)(i.Z,{})})},x=function(e){var t=e.txHash,n=e.action,i=e.amount,x=e.symbol,T=e.collateral,S=e.rate,k=e.addToken,E=e.customAction,A=e.customText,O=(0,g.vR)(),C=O.close,P=O.mainTxState,R=(0,v.Z)().addERC20Token,I=(0,b.f)().currentNetworkConfig,D=(0,f.useState)(""),j=D[0],M=D[1],N=(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)(s.Z,{sx:{color:"success.main",fontSize:"32px"},children:(0,w.jsx)(o.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&&i&&x&&(0,w.jsx)(l.Z,{children:(0,w.jsx)(r.cC,{id:"You {action} <0/> {symbol}",values:{action:n,symbol:x},components:{0:(0,w.jsx)(m.B,{value:Number(i),compact:!0,variant:"secondary14"})}})}),E&&(0,w.jsxs)(l.Z,{children:[A,E]}),!n&&!i&&x&&(0,w.jsxs)(l.Z,{children:["Your ",x," ",T?"now":"is not"," used as collateral"]}),S&&(0,w.jsx)(l.Z,{children:(0,w.jsx)(r.cC,{id:"You switched to {0} rate",values:{0:S===a.tk.Variable?"variable":"stable"}})}),k&&x&&(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)(y.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(){R({address:k.address,decimals:k.decimals,symbol:k.aToken?"a".concat(k.symbol.slice(0,11)):k.symbol.slice(0,11),image:/_/.test(k.symbol)?void 0:j})},variant:"dark"===N.palette.mode?"outlined":"contained",size:"medium",sx:{mt:"8px",mb:"12px"},children:[k.symbol&&!/_/.test(k.symbol)&&(0,w.jsx)(y.Js,{symbol:k.symbol,onImageGenerated:M,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"})})]})]}),(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:"You now have special access to our Discord for providing liquidity! Join our guild page to get these special roles."})}),(0,w.jsx)(d.Z,{variant:"outlined",size:"medium",href:"https://guild.xyz/zerolend",target:"_blank",sx:{mt:"8px",mb:"12px"},children:(0,w.jsx)(l.Z,{variant:"buttonM",ml:"4px",children:"Join our Guild"})})]})]})]}),(0,w.jsxs)(u.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,w.jsxs)(p.Z,{variant:"helperText",href:I.explorerLinkBuilder({tx:t||P.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)(_,{})]}),(0,w.jsx)(d.Z,{onClick:C,variant:"contained",size:"large",sx:{minHeight:"44px"},"data-cy":"closeButton",children:(0,w.jsx)(r.cC,{id:"Ok, Close"})})]})]})}},97461:function(e,t,n){"use strict";n.d(t,{JV:function(){return re},Bx:function(){return ne},jz:function(){return ie},aE:function(){return ae},oD:function(){return ee},XJ:function(){return te},Pu:function(){return oe},m6:function(){return J}});var r=n(59499),a=n(4730),i=n(17674),o=n(49501),s=n(80227),c=n(81645),u=n(61953),l=n(29630),d=n(91655),p=n(22841),f=n(54181),h=n(56371),m=n(67294),y=n(44749),g=n(92391),b=n(29946),v=n(96875),w=n(17218),_=n(41024),x=n(2180),T=n(80854),S=n(62753),k=n(9144),E=n(90149),A=n(36864),O=n(57609),C=n(58527),P=n(85893);function R(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 I(e){for(var t=1;t$.Sw}),[d,$.Sw]),g=(0,m.useMemo)((function(){return c&&f&&y}),[c,f,y]),b=(0,m.useMemo)((function(){return c&&y}),[c,y]);return(0,P.jsxs)(u.Z,{sx:{pt:5},children:[(0,P.jsx)(l.Z,{sx:{mb:1},color:"text.secondary",children:(0,P.jsx)(o.cC,{id:"Transaction overview"})}),(0,P.jsx)(u.Z,{sx:function(e){return{p:3,border:"1px solid ".concat(e.palette.divider),borderRadius:"4px",".MuiBox-root:last-of-type":{mb:0}}},children:s}),c&&!y&&(0,P.jsx)(j.v,{severity:"warning",icon:!1,sx:{mt:4},children:(0,P.jsxs)(l.Z,{children:["If you supply more than ",$.Sw.toString(),"$ your transaction will be free. \ud83c\udf89"]})}),b&&(0,P.jsx)(q,{}),(0,P.jsxs)(u.Z,{sx:{display:"flex",justifyContent:"space-between"},children:[(0,P.jsx)(H,{gasLimit:(0,h.parseUnits)(t||"0","wei"),skipLoad:r,disabled:a,gaslessPossible:g}),n]}),g&&(0,P.jsx)(j.v,{severity:"success",icon:!1,sx:{mt:4},children:(0,P.jsx)(l.Z,{children:"This is a free transaction. You won't have to pay any transaction fees. \ud83d\ude80"})})]})},ee=function(e){var t=e.description,n=e.value,r=e.futureValue,i=e.numberPrefix,o=e.iconSymbol,s=e.loading,c=void 0!==s&&s,p=(0,a.Z)(e,Y);return(0,P.jsx)(g.X,{caption:t,captionVariant:"description",mb:4,children:(0,P.jsx)(u.Z,{sx:{display:"flex",alignItems:"center"},children:c?(0,P.jsx)(d.Z,{variant:"rectangular",height:20,width:100,sx:{borderRadius:"4px"}}):(0,P.jsxs)(P.Fragment,{children:[o&&(0,P.jsx)(x.T1,{symbol:o,sx:{mr:1,fontSize:"16px"}}),i&&(0,P.jsx)(l.Z,{sx:{mr:1},children:i}),(0,P.jsx)(_.B,Q({value:n,variant:"secondary14"},p)),r&&(0,P.jsxs)(P.Fragment,{children:[X,(0,P.jsx)(_.B,Q({value:r,variant:"secondary14"},p))]})]})})})},te=function(e){var t=e.description,n=e.symbol,r=e.value,a=e.valueUSD,i=e.futureValue,o=e.futureValueUSD,s=e.hideSymbolSuffix,c=e.color,p=e.tokenIcon,f=e.loading,h=void 0!==f&&f;return(0,P.jsx)(g.X,{caption:t,captionVariant:"description",mb:4,align:"flex-start",children:(0,P.jsx)(u.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:h?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(d.Z,{variant:"rectangular",height:20,width:100,sx:{borderRadius:"4px"}}),(0,P.jsx)(d.Z,{variant:"rectangular",height:15,width:80,sx:{borderRadius:"4px",marginTop:"4px"}})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(u.Z,{sx:{display:"flex",alignItems:"center"},children:[r&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(_.B,{value:r,variant:"secondary14",color:c}),!s&&(0,P.jsx)(l.Z,{ml:1,variant:"secondary14",children:n}),X]}),p&&(0,P.jsx)(x.T1,{symbol:p,sx:{mr:1,fontSize:"14px"}}),(0,P.jsx)(_.B,{value:i,variant:"secondary14",color:c}),!s&&(0,P.jsx)(l.Z,{ml:1,variant:"secondary14",children:n})]}),(0,P.jsxs)(u.Z,{sx:{display:"flex",alignItems:"center"},children:[a&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(_.B,{value:a,variant:"helperText",compact:!0,symbol:"USD"}),X]}),(0,P.jsx)(_.B,{value:o,variant:"helperText",compact:!0,symbol:"USD"})]})]})})})},ne=function(e){var t=e.collateralType;return(0,P.jsx)(g.X,{caption:(0,P.jsx)(o.cC,{id:"Collateralization"}),captionVariant:"description",mb:4,children:(0,P.jsx)(re,{collateralType:t})})},re=function(e){var t,n=e.collateralType;return(0,P.jsx)(u.Z,{sx:{display:"inline-flex",alignItems:"center"},children:(t={},(0,r.Z)(t,b.z.ENABLED,(0,P.jsx)(l.Z,{variant:"description",color:"success.main",children:(0,P.jsx)(o.cC,{id:"Enabled"})})),(0,r.Z)(t,b.z.ISOLATED_ENABLED,(0,P.jsx)(y.Ch,{typographyProps:{variant:"description",color:"warning.main"}})),(0,r.Z)(t,b.z.DISABLED,(0,P.jsx)(l.Z,{variant:"description",color:"error.main",children:(0,P.jsx)(o.cC,{id:"Disabled"})})),(0,r.Z)(t,b.z.UNAVAILABLE,(0,P.jsx)(l.Z,{variant:"description",color:"error.main",children:(0,P.jsx)(o.cC,{id:"Unavailable"})})),(0,r.Z)(t,b.z.ISOLATED_DISABLED,(0,P.jsx)(y.r$,{})),(0,r.Z)(t,b.z.UNAVAILABLE_DUE_TO_ISOLATION,(0,P.jsx)(y.a9,{})),t)[n]})},ae=function(e){var t=e.incentives,n=e.symbol,r=e.futureIncentives,a=e.futureSymbol,i=e.loading,s=void 0!==i&&i;return t&&0!==t.filter((function(e){return"0"!==e.incentiveAPR})).length?(0,P.jsx)(g.X,{caption:(0,P.jsx)(o.cC,{id:"Rewards APR"}),captionVariant:"description",mb:4,minHeight:24,children:(0,P.jsx)(u.Z,{sx:{display:"flex",alignItems:"center"},children:s?(0,P.jsx)(d.Z,{variant:"rectangular",height:20,width:100,sx:{borderRadius:"4px"}}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w.M,{incentives:t,symbol:n}),a&&(0,P.jsxs)(P.Fragment,{children:[X,(0,P.jsx)(w.M,{incentives:r,symbol:a}),r&&0===r.length&&(0,P.jsx)(l.Z,{variant:"secondary14",children:(0,P.jsx)(o.cC,{id:"None"})})]})]})})}):null},ie=function(e){var t=e.healthFactor,n=e.futureHealthFactor,r=e.visibleHfChange,a=e.loading,i=void 0!==a&&a;return"-1"===t&&"-1"===n?null:(0,P.jsx)(g.X,{caption:(0,P.jsx)(o.cC,{id:"Health factor"}),captionVariant:"description",mb:4,align:"flex-start",children:(0,P.jsxs)(u.Z,{sx:{textAlign:"right"},children:[(0,P.jsx)(u.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:i?(0,P.jsx)(d.Z,{variant:"rectangular",height:20,width:80,sx:{borderRadius:"4px"}}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(v.o,{value:t,variant:"secondary14"}),r&&(0,P.jsxs)(P.Fragment,{children:[X,(0,P.jsx)(v.o,{value:isNaN(Number(n))?t:n,variant:"secondary14"})]})]})}),(0,P.jsxs)(l.Z,{variant:"helperText",color:"text.secondary",children:[(0,P.jsx)(o.cC,{id:"Liquidation at"})," <1.0"]})]})})},oe=function(e){var t=e.unwrapped,n=e.setUnWrapped,r=e.label;return(0,P.jsx)(g.X,{captionVariant:"description",sx:{mt:5},children:(0,P.jsx)(p.Z,{sx:{mx:0},control:(0,P.jsx)(f.Z,{disableRipple:!0,checked:t,onClick:function(){return n(!t)},"data-cy":"wrappedSwitcher"}),labelPlacement:"end",label:r})})}},78944:function(e,t,n){"use strict";n.d(t,{E:function(){return i}});var r=n(29630),a=n(85893),i=function(e){var t=e.title,n=e.symbol;return(0,a.jsxs)(r.Z,{variant:"h2",sx:{mb:6},children:[t," ",null!==n&&void 0!==n?n:""]})}},30345:function(e,t,n){"use strict";n.d(t,{TP:function(){return r},N4:function(){return g},Wv:function(){return v}});var r,a=n(17674),i=n(67294),o=n(50029),s=n(59499),c=n(87794),u=n.n(c),l=n(77537),d=n(8195),p=n(40481),f=n(46930),h=function(e){var t,n,a,i,o={legacyGasPrice:(null===(t=e.gasPrice)||void 0===t?void 0:t.toString())||"0",maxFeePerGas:(null===(n=e.maxFeePerGas)||void 0===n?void 0:n.toString())||"0",maxPriorityFeePerGas:(null===(a=e.maxPriorityFeePerGas)||void 0===a?void 0:a.toString())||"0"};return i={},(0,s.Z)(i,r.Slow,o),(0,s.Z)(i,r.Normal,o),(0,s.Z)(i,r.Fast,o),i},m=function(){var e=(0,i.useState)(!1),t=e[0],n=e[1],r=(0,i.useState)(!1),a=r[0],s=r[1],c=(0,i.useState)(),m=c[0],y=c[1],g=(0,d.vR)().type,b=(0,f.f)(),v=b.currentChainId,w=b.jsonRpcProvider,_=(0,l.Z)().connected,x=function(){var e=(0,o.Z)(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w().getFeeData();case 2:t=e.sent,y(h(t)),s(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=(0,o.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,x();case 3:e.next=10;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Gas price retrieval from API failed",undefined),console.error("Gas price retrieval from Web3 provider failed.",e.t0),s(!0);case 10:n(!1);case 11:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}();return(0,p.W)(T,3e4,void 0===g,[_,v,g]),{loading:t,data:m,error:a}},y=n(85893);!function(e){e.Slow="slow",e.Normal="normal",e.Fast="fast",e.Custom="custom"}(r||(r={}));var g=i.createContext(void 0);function b(e,t){switch(t.type){case"setGasOption":return{gasOption:t.value,customGas:e.customGas};case"setCustomGasOption":return{gasOption:r.Custom,customGas:t.value}}}var v=function(e){var t=e.children,n=i.useReducer(b,{gasOption:r.Normal,customGas:"100"}),o=(0,a.Z)(n,2),s={state:o[0],dispatch:o[1],gasPriceData:m()};return(0,y.jsx)(g.Provider,{value:s,children:t})}},99528:function(e,t,n){"use strict";n.d(t,{P:function(){return M}});var r=n(67294),a=n(31959),i=n(8195),o=n(49501),s=n(75331),c=n(61953),u=n(75084),l=n(43478),d=n(46930),p=n(77537),f=n(24834),h=n(67728),m=n(25298),y=n(63491),g=n(67916),b=n(93608),v=n(97461),w=n(78944),_=n(10343),x=n(50029),T=n(87794),S=n.n(T),k=n(89291),E=n(67489),A=n(85893),O=function(e){var t=e.isWrongNetwork,n=e.blocked,r=(0,f.Yh)((function(e){return e.migrateWithPermits})),a=(0,f.Yh)((function(e){return e.migrateWithoutPermits})),i=(0,f.Yh)((function(e){return e.getApprovePermitsForSelectedAssets})),c=(0,k.Q)({handleGetTxns:function(){var e=(0,x.Z)(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),handleGetPermitTxns:function(){var e=(0,x.Z)(S().mark((function e(t,n){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r(t,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),tryPermit:!0,permitAction:s.UQ.migrateV3}),u=c.approval,l=c.action,d=c.loadingTxns,p=c.requiresApproval,h=c.mainTxState,m=c.approvalTxState,y=function(){var e=(0,x.Z)(S().mark((function e(){var t;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i();case 2:t=e.sent,u(t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,A.jsx)(E.B,{requiresApproval:p,preparingTransactions:d,mainTxState:h,approvalTxState:m,isWrongNetwork:t,handleAction:l,handleApproval:y,blocked:n,actionText:(0,A.jsx)(o.cC,{id:"Migrate"}),actionInProgressText:(0,A.jsx)(o.cC,{id:"Migrating"}),tryPermit:!0})},C=n(29630),P=n(41024),R=n(92391),I=n(2180),D=function(e){var t=e.caption,n=e.assets;return(0,A.jsx)(R.X,{caption:t,captionVariant:"description",align:"flex-start",sx:{mb:6,"&:last-of-type":{mb:0}},children:n.length?(0,A.jsx)(c.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:n.map((function(e){return e?(0,A.jsxs)(c.Z,{sx:{mb:2,display:"flex",alignItems:"flex-end",flexDirection:"column"},children:[(0,A.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,A.jsx)(I.T1,{symbol:e.iconSymbol,sx:{mr:1,fontSize:"16px"}}),(0,A.jsx)(P.B,{value:e.amount,variant:"secondary14",compact:!0}),(0,A.jsx)(C.Z,{ml:1,variant:"secondary14",children:e.symbol})]}),(0,A.jsx)(P.B,{value:e.amountInUSD,variant:"helperText",compact:!0,symbol:"USD",color:"text.secondary"})]},e.underlyingAsset):(0,A.jsx)(A.Fragment,{})}))}):(0,A.jsx)(C.Z,{children:"\u2014"})})},j=function(){var e=(0,l.p)(10),t=(0,f.Yh)((0,r.useCallback)((function(t){return{supplyPositions:(0,h.B9)(t,e),borrowPositions:(0,h.hA)(t,e)}}),[e])),n=t.supplyPositions,a=t.borrowPositions,x=(0,i.vR)(),T=x.gasLimit,S=x.mainTxState,k=x.txError,E=(0,d.f)().currentChainId,C=(0,p.Z)(),P=C.chainId,R=C.readOnlyModeAddress,I=(0,m.Mo)(E),j=n.map((function(e){return{underlyingAsset:e.underlyingAsset,iconSymbol:e.reserve.iconSymbol,symbol:e.reserve.symbol,amount:e.underlyingBalance,amountInUSD:e.underlyingBalanceUSD}})),M=a.map((function(e){return{underlyingAsset:e.debtKey,iconSymbol:e.reserve.iconSymbol,symbol:e.reserve.symbol,amount:e.interestRate==s.tk.Stable?e.stableBorrows:e.variableBorrows,amountInUSD:e.interestRate==s.tk.Stable?e.stableBorrowsUSD:e.variableBorrowsUSD}})),N=E!==P;if(k&&k.blocking)return(0,A.jsx)(y.D,{txError:k});return S.success?(0,A.jsx)(b.R,{customAction:(0,A.jsx)(c.Z,{mt:5,children:(0,A.jsx)(u.Z,{variant:"gradient",size:"medium",onClick:function(){},children:(0,A.jsx)(o.cC,{id:"Go to V3 Dashboard"})})}),customText:(0,A.jsx)(o.cC,{id:"Selected assets have successfully migrated. Visit the Market Dashboard to see them."}),action:(0,A.jsx)(o.cC,{id:"Migrated"})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(w.E,{title:"Migrate to V3"}),N&&!R&&(0,A.jsx)(_.I,{networkName:I.name,chainId:E}),(0,A.jsxs)(v.m6,{gasLimit:T,children:[(0,A.jsx)(D,{caption:(0,A.jsx)(o.cC,{id:"Selected supply assets"}),assets:j}),(0,A.jsx)(D,{caption:(0,A.jsx)(o.cC,{id:"Selected borrow assets"}),assets:M})]}),k&&(0,A.jsx)(g.Q,{txError:k}),(0,A.jsx)(O,{isWrongNetwork:N,blocked:!1})]})},M=function(){var e=(0,i.vR)(),t=e.type,n=e.close;return(0,A.jsx)(a.P,{open:t===i.w8.V3Migration,setOpen:n,children:(0,A.jsx)(j,{})})}},67489:function(e,t,n){"use strict";n.d(t,{B:function(){return z}});var r=n(59499),a=n(4730),i=n(49501),o=n(58057),s=n(81645),c=n(61953),u=n(75084),l=n(90149),d=n(29630),p=n(8195),f=n(77537),h=n(39771),m=n(36864),y=n(68861),g=n(58527),b=n(85893);function v(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 w(e){for(var t=1;tLearn more",components:{0:(0,b.jsx)(y.rU,{href:"https://eips.ethereum.org/EIPS/eip-2612",underline:"always"})}})}))},x=n(56365),T=n(68346),S=n(17674),k=n(64343),E=n(22659),A=n(73812),O=n(31538),C=n(61702),P=n(29894),R=n(67294),I=n(32113),D=function(e){var t=e.currentMethod,n=e.setMethod,r=R.useState(null),a=(0,S.Z)(r,2),o=a[0],u=a[1],l=Boolean(o),p=function(){u(null)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(c.Z,{onClick:function(e){u(e.currentTarget)},sx:{display:"flex",alignItems:"center",cursor:"pointer"},"data-cy":"approveButtonChange",children:[(0,b.jsx)(d.Z,{variant:"subheader2",color:"info.main",children:(0,b.jsx)(i.cC,{id:"{currentMethod}",values:{currentMethod:t}})}),(0,b.jsx)(s.Z,{sx:{fontSize:16,ml:1,color:"info.main"},children:(0,b.jsx)(E.Z,{})})]}),(0,b.jsxs)(A.Z,{anchorEl:o,open:l,onClose:p,MenuListProps:{"aria-labelledby":"basic-button"},keepMounted:!0,"data-cy":"approveMenu_".concat(t),children:[(0,b.jsxs)(O.Z,{"data-cy":"approveOption_".concat(I.n.PERMIT),selected:t===I.n.PERMIT,value:I.n.PERMIT,onClick:function(){t===I.n.APPROVE&&n(I.n.PERMIT),p()},children:[(0,b.jsx)(C.Z,{primaryTypographyProps:{variant:"subheader1"},children:(0,b.jsx)(i.cC,{id:"{0}",values:{0:I.n.PERMIT}})}),(0,b.jsx)(P.Z,{children:(0,b.jsx)(s.Z,{children:t===I.n.PERMIT&&(0,b.jsx)(k.Z,{})})})]}),(0,b.jsxs)(O.Z,{"data-cy":"approveOption_".concat(I.n.APPROVE),selected:t===I.n.APPROVE,value:I.n.APPROVE,onClick:function(){t===I.n.PERMIT&&n(I.n.APPROVE),p()},children:[(0,b.jsx)(C.Z,{primaryTypographyProps:{variant:"subheader1"},children:(0,b.jsx)(i.cC,{id:"{0}",values:{0:I.n.APPROVE}})}),(0,b.jsx)(P.Z,{children:(0,b.jsx)(s.Z,{children:t===I.n.APPROVE&&(0,b.jsx)(k.Z,{})})})]})]})]})},j=n(89291),M=n(46930),N=n(24834),L=function(){return(0,b.jsx)(s.Z,{sx:{ml:"2px",fontSize:"11px"},children:(0,b.jsx)(x.Z,{})})},B=function(e){var t=e.approvalHash,n=e.tryPermit,r=(0,N.Yh)(),a=r.walletApprovalMethodPreference,o=r.setWalletApprovalMethodPreference,s=n&&a,u=(0,M.f)().currentNetworkConfig,l=t===j.Z;return t||l||!n?t&&!s?(0,b.jsx)(c.Z,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",pb:1},children:t&&(0,b.jsxs)(T.Z,{variant:"helperText",href:u.explorerLinkBuilder({tx:t}),sx:{display:"inline-flex",alignItems:"center"},underline:"hover",target:"_blank",rel:"noreferrer noopener",children:[(0,b.jsx)(i.cC,{id:"Review approval tx details"}),(0,b.jsx)(L,{})]})}):(0,b.jsx)(b.Fragment,{}):(0,b.jsxs)(c.Z,{sx:{display:"inline-flex",alignItems:"center",mb:2},children:[(0,b.jsxs)(d.Z,{variant:"subheader2",color:"text.secondary",children:[(0,b.jsx)(i.cC,{id:"Approve with"}),"\xa0"]}),(0,b.jsx)(D,{currentMethod:a,setMethod:function(e){return o(e)}})]})},Z=["actionInProgressText","actionText","amount","approvalTxState","handleApproval","handleAction","isWrongNetwork","mainTxState","preparingTransactions","requiresAmount","requiresApproval","sx","symbol","blocked","fetchingData","errorParams","tryPermit","event"];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 F(e){for(var t=1;tFAQ",values:{0:t||""},components:{0:(0,s.jsx)(i.rU,{href:"https://docs.aave.com/faq/aave-v3-features#isolation-mode"})}})})]})}},29946:function(e,t,n){"use strict";var r,a;n.d(t,{z:function(){return a}}),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"}(a||(a={}))},89291:function(e,t,n){"use strict";n.d(t,{Z:function(){return S},Q:function(){return k}});var r=n(90116),a=n(59499),i=n(50029),o=n(17674),s=n(87794),c=n.n(s),u=n(75331),l=n(80854),d=n(6236),p=n(67294),f=n(19419),h=n(8195),m=n(77537),y=n(24834),g=n(32113),b=n(39771),v=n(74180);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 _(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 _(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)){e.next=59;break}R(T(T({},P),{},{loading:!0})),e.prev=3,n=Math.floor(Date.now()/1e3+3600).toString(),r=[],a=w(t);try{for(a.s();!(o=a.n()).done;)(s=o.value).permitType&&"POOL"!=s.permitType?"SUPPLY_MIGRATOR_V3"===s.permitType?r.push(re(T(T({},s),{},{deadline:n}))):"BORROW_MIGRATOR_V3"===s.permitType?r.push(ne(T(T({},s),{},{deadline:n,spender:oe.addresses.V3_MIGRATOR||""}))):"STAKE"===s.permitType&&r.push(ie({token:s.underlyingAsset,amount:s.amount,deadline:n})):r.push(ee({reserve:s.underlyingAsset,amount:s.amount,deadline:n}))}catch(_){a.e(_)}finally{a.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((p=d.n()).done){e.next=25;break}return f=p.value,e.t0=u,e.next=21,Z(f);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(ye.current){e.next=35;break}return e.abrupt("return");case 35:$(u),Q(n),R({txHash:S,loading:!1,success:!0}),L(void 0),e.next=48;break;case 41:if(e.prev=41,e.t3=e.catch(8),ye.current){e.next=45;break}return e.abrupt("return");case 45:h=(0,b.WG)(e.t3,b.aD.APPROVAL,!1),L(h),R({txHash:void 0,loading:!1});case 48:e.next=57;break;case 50:if(e.prev=50,e.t4=e.catch(3),ye.current){e.next=54;break}return e.abrupt("return");case 54:m=(0,b.WG)(e.t4,b.aD.GAS_ESTIMATION,!1),L(m),R({txHash:void 0,loading:!1});case 57:e.next=77;break;case 59:return e.prev=59,R(T(T({},P),{},{loading:!0})),e.next=63,Promise.all(ce.map((function(e){return e.tx()})));case 63:return y=e.sent,e.next=66,Promise.all(y.map((function(e){return new Promise(function(){var t=(0,i.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);L(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:g=e.sent,R({txHash:g[0].hash,loading:!1,success:!0}),e.next=77;break;case 70:if(e.prev=70,e.t5=e.catch(59),ye.current){e.next=74;break}return e.abrupt("return");case 74:v=(0,b.WG)(e.t5,b.aD.GAS_ESTIMATION,!1),L(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)}}(),ve=function(){var e=(0,i.Z)(c().mark((function e(){var t,r,a,i,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!he||!n){e.next=21;break}if(q.length&&K){e.next=3;break}throw new Error("signature needed");case 3:return e.prev=3,D(T(T({},I),{},{loading:!0})),e.next=7,n(q,K);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){D({txHash:e.hash,loading:!1,success:!0}),L(void 0)},errorCallback:function(e,t){var n=(0,b.WG)(e,b.aD.MAIN_ACTION);L(n),D({txHash:t,loading:!1})}}));case 15:e.prev=15,e.t0=e.catch(3),console.log(e.t0,"error"),a=(0,b.WG)(e.t0,b.aD.GAS_ESTIMATION,!1),L(a),D({txHash:void 0,loading:!1});case 21:if(he&&ce||!de){e.next=37;break}return e.prev=22,D(T(T({},I),{},{loading:!0})),e.next=26,de.tx();case 26:return delete(i=e.sent).gasPrice,e.abrupt("return",ge({tx:function(){return U(i)},successCallback:function(e){D({txHash:e.hash,loading:!1,success:!0}),L(void 0)},errorCallback:function(e,t){var n=(0,b.WG)(e,b.aD.MAIN_ACTION);L(n),D({txHash:t,loading:!1})}}));case 31:e.prev=31,e.t1=e.catch(22),o=(0,b.WG)(e.t1,b.aD.GAS_ESTIMATION,!1),console.log(e.t1,o),L(o),D({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,p.useEffect)((function(){if(!x){N(!0);var e=setTimeout((function(){return N(!0),t().then(function(){var e=(0,i.Z)(c().mark((function e(t){var r,a,i,o,u,d,p,f,h;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ye.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&&ue(r),a=s&&te===g.n.PERMIT&&n&&_,!(r.length>0&&a)){e.next=14;break}me(!0),i=l.eB[_],j(i.limit||""),D({txHash:void 0}),L(void 0),N(!1),e.next=48;break;case 14:me(!1),r.length>0&&ue(r),pe(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)}))),D({txHash:void 0}),L(void 0),o=0,e.prev=20,u=w(t),e.prev=22,u.s();case 24:if((d=u.n()).done){e.next=32;break}return p=d.value,e.next=28,p.gas();case 28:(f=e.sent)&&f.gasLimit&&(o+=Number(f.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),L(h);case 46:j(o.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(ye.current){D({txHash:void 0});var t=(0,b.WG)(e,b.aD.GAS_ESTIMATION,!1);L(t),N(!1)}}))}),1e3);return function(){return clearTimeout(e)}}ue(void 0),pe(void 0)}),[x].concat((0,r.Z)(A),[s,te])),{approval:be,action:ve,loadingTxns:M,setUsePermit:me,requiresApproval:!!ce||he,approvalTxState:P,mainTxState:I,usePermit:he}}},19419:function(e,t,n){"use strict";n.d(t,{R:function(){return s},n:function(){return c}});var r=n(67294),a=n(24834),i=n(85893),o=r.createContext({}),s=function(e){var t=e.children,n=(0,a.p4)(),r=(0,a.Qb)(),s=(0,a.DP)();return(0,i.jsx)(o.Provider,{value:{refetchIncentiveData:r,refetchPoolData:n,refetchGhoData:s},children:t})},c=function(){return(0,r.useContext)(o)}},34220:function(e,t,n){"use strict";n.d(t,{GM:function(){return S},cp:function(){return x},HT:function(){return k}});var r=n(59499),a=n(17674),i=n(1279),o=n(82403),s=n(20854),c=n(59148),u=n(75148);var l=n(70794),d=n(56371),p=n(67294),f=n(77537),h=n(24834),m=n(69125),y=n(83601),g=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 _(e){for(var t=1;t0){var B=function({userGhoDiscountedInterest:e,user:t,marketReferenceCurrencyPriceUSD:n}){const r=Number(t.totalBorrowsUSD)-e,a=Number(t.availableBorrowsUSD)+e,i=Number(t.totalBorrowsMarketReferenceCurrency)-e/n,o=0===i?"-1":Number(t.totalCollateralMarketReferenceCurrency)*Number(t.currentLiquidationThreshold)/i;return Object.assign(Object.assign({},t),{totalBorrowsMarketReferenceCurrency:i.toString(),totalBorrowsUSD:r.toString(),netWorthUSD:(Number(t.netWorthUSD)+e).toString(),availableBorrowsUSD:a.toString(),availableBorrowsMarketReferenceCurrency:(a/n).toString(),healthFactor:o.toString()})}({userGhoDiscountedInterest:N.userDiscountedGhoInterest,user:L,marketReferenceCurrencyPriceUSD:Number((0,d.formatUnits)(k.marketReferenceCurrencyPriceInUsd,o.$3))});L=_(_({},L),B)}var Z=L.userReservesData.reduce((function(e,t){var n=I.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(j({symbol:n.symbol,currentMarket:p})){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=L.userReservesData.some((function(e){return"0"!==e.scaledATokenBalance})),F=Z.positiveProportion.dividedBy(L.totalLiquidityUSD).toNumber(),z=Z.negativeProportion.dividedBy(L.totalBorrowsUSD).toNumber(),G=(F||0)*(Number(L.totalLiquidityUSD)/Number("0"!==L.netWorthUSD?L.netWorthUSD:"1"))-(z||0)*(Number(L.totalBorrowsUSD)/Number("0"!==L.netWorthUSD?L.netWorthUSD:"1"));return(0,v.jsx)(T.Provider,{value:{loading:!S.length||!!r&&!E.length,reserves:I,eModes:O,user:_(_({},L),{},{totalBorrowsUSD:L.totalBorrowsUSD,totalBorrowsMarketReferenceCurrency:L.totalBorrowsMarketReferenceCurrency,userEmodeCategoryId:A,isInEmode:0!==A,userReservesData:L.userReservesData.sort((function(e,t){return(0,y.uk)(e.reserve,t.reserve)})),earnedAPY:F,debtAPY:z,netAPY:G}),userReserves:E,isUserHasDeposits:U,marketReferencePriceInUsd:k.marketReferenceCurrencyPriceInUsd,marketReferenceCurrencyDecimals:k.marketReferenceCurrencyDecimals,ghoReserveData:_(_({},M),{},{aaveFacilitatorRemainingCapacity:Math.max(M.aaveFacilitatorRemainingCapacity-1e-6,0)}),ghoUserData:N,ghoLoadingData:!R},children:t})},k=function(){return(0,p.useContext)(T)}},98833:function(e,t,n){"use strict";n.d(t,{P:function(){return b}});var r=n(17674),a=n(80854),i=n(1279),o=n(81206),s=n(82403),c=n(70794),u=n(24834),l=n(83601),d=n(32161),p=n(52924),f=n(1476);var h=n(74180),m=n(79070),y=function(){var e=(0,m.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,a=t.addresses.LENDING_POOL;return function(e,t,n){const r=(0,d._v)(e,t,n);return(0,f.r)(r,p.z)}({queryFn:function(){return e.getPoolTokensBalances({user:n,lendingPoolAddressProvider:r})},queryKey:[h.i.POOL_TOKENS,n,r,a,e.toHash()],enabled:!!n,refetchInterval:h.POLLING_INTERVAL})},g=n(46930),b=function(){var e=(0,g.f)().currentNetworkConfig,t=y(),n=t.data,d=t.isLoading,p=(0,u.Yh)((function(e){return[(0,l.Rp)(e),(0,l.Fb)(e)]})),f=(0,r.Z)(p,2),h=f[0],m=f[1],b=!0;return{walletBalances:(null!==n&&void 0!==n?n:[]).reduce((function(t,n){var r=h.find((function(t){var r;return n.address===a.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&&(b=!1),r&&(t[n.address]={amount:(0,i.Fv)(n.amount,r.decimals),amountUSD:(0,o.Z)({amount:new c.O(n.amount),currencyDecimals:r.decimals,priceInMarketReferenceCurrency:r.priceInMarketReferenceCurrency,marketReferenceCurrencyDecimals:m.marketReferenceCurrencyDecimals,normalizedMarketReferencePriceInUsd:(0,i.Fv)(m.marketReferenceCurrencyPriceInUsd,s.$3)})}),t}),{}),hasEmptyWallet:b,loading:d||!h.length}}},40109:function(e,t,n){"use strict";n.d(t,{Sw:function(){return d}});var r=n(50029),a=n(17674),i=n(87794),o=n.n(i),s=n(67294),c=n(25298),u=n(24834),l=(0,c.Zs)(),d=5e3;t.ZP=function(){var e=(0,s.useState)({isLoading:!0,isGaslessPossible:!1}),t=e[0],n=e[1],i=(0,u.Yh)((function(e){return[e.currentMarketData]})),c=(0,a.Z)(i,1)[0],d=(0,s.useCallback)((0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c.addresses.PAYMASTER){e.next=6;break}return e.next=3,l.getBalance(c.addresses.PAYMASTER);case 3:if(!e.sent.gt("2600000000000000")){e.next=6;break}return e.abrupt("return",n({isLoading:!1,isGaslessPossible:!0}));case 6:n({isLoading:!1,isGaslessPossible:!1});case 7:case"end":return e.stop()}}),e)}))),[]);return(0,s.useEffect)((function(){n({isLoading:!0,isGaslessPossible:!1}),d().catch((function(e){n({isLoading:!1,isGaslessPossible:!1}),console.error("Failed to fetch gasless: ".concat(e.stack))}));var e=setInterval(d,5e3);return function(){clearInterval(e)}}),[d,c.addresses.PAYMASTER]),t}},43629:function(e,t,n){"use strict";n.d(t,{hv:function(){return H},wD:function(){return $},ov:function(){return W}});var r=n(59499),a=n(4730),i=n(1279),o=n(67294),s=n(49501),c=n(58771),u=n(61953),l=n(58527),d=n(85893),p=["borrowCap"];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 h(e){for(var t=1;t was not given a valid reserve asset to parse"),null;var r=function(e){var t=V(e),n=t.supplyCapUsage,r=t.supplyCapReached,i=q(e),o=i.borrowCapUsage,s=i.borrowCapReached,c=$(e);return{reserve:e,supplyCap:{percentUsed:n,isMaxed:r,determineWarningDisplay:function(e){var t=e.supplyCap,n=e.icon,r=(0,a.Z)(e,B);return t?(0,d.jsx)(L,z({supplyCap:t,icon:n},r)):null},displayMaxedTooltip:function(e){var t=e.supplyCap;return t?(0,d.jsx)(S,{supplyCap:t}):null}},borrowCap:{percentUsed:o,isMaxed:s,determineWarningDisplay:function(e){var t=e.borrowCap,n=e.icon,r=(0,a.Z)(e,Z);return t?(0,d.jsx)(C,z({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,a.Z)(e,U);return t?(0,d.jsx)(D,z({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)(G.Provider,{value:r,children:t})},W=function(){var e=(0,o.useContext)(G);if(void 0===e)throw new Error("useAssetCaps() can only be used inside of , please declare it at a higher level.");return e},V=function(e){var t=e?100*(0,i.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,i.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,i.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 o}});var r=n(27484),a=n.n(r),i=n(67294);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15,t=(0,i.useState)(0),n=t[0],r=t[1],o=(0,i.useState)(0),s=o[0],c=o[1];return(0,i.useEffect)((function(){var t=setInterval((function(){return c(a()().unix()+n)}),1e3*e);return function(){return clearInterval(t)}}),[e,n]),(0,i.useEffect)((function(){var e=Number(localStorage.getItem("forkTimeAhead")||0);r(e),c(a()().unix()+e)}),[]),s}},8195:function(e,t,n){"use strict";n.d(t,{w8:function(){return r},ny:function(){return l},vR:function(){return d}});var r,a=n(67294),i=n(77537),o=n(24834),s=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.Emode=11]="Emode",e[e.Faucet=12]="Faucet",e[e.Swap=13]="Swap",e[e.DebtSwitch=14]="DebtSwitch",e[e.GovDelegation=15]="GovDelegation",e[e.GovVote=16]="GovVote",e[e.V3Migration=17]="V3Migration",e[e.RevokeGovDelegation=18]="RevokeGovDelegation",e[e.StakeRewardsClaimRestake=19]="StakeRewardsClaimRestake"}(r||(r={}));var u=(0,a.createContext)({}),l=function(e){var t=e.children,n=(0,i.Z)().setSwitchNetworkError,l=(0,a.useState)(),d=l[0],p=l[1],f=(0,a.useState)({}),h=f[0],m=f[1],y=(0,a.useState)({}),g=y[0],b=y[1],v=(0,a.useState)({}),w=v[0],_=v[1],x=(0,a.useState)(""),T=x[0],S=x[1],k=(0,a.useState)(!1),E=k[0],A=k[1],O=(0,a.useState)(),C=O[0],P=O[1],R=(0,o.Yh)((function(e){return e.trackEvent}));return(0,c.jsx)(u.Provider,{value:{openSupply:function(e,t,n,a,i){p(r.Supply),m({underlyingAsset:e}),R(s.vh.OPEN_MODAL,{modal:"Supply",market:t,assetName:n,asset:e,funnel:a})},openWithdraw:function(e,t,n,a){p(r.Withdraw),m({underlyingAsset:e}),R(s.vh.OPEN_MODAL,{modal:"Withdraw",market:t,assetName:n,asset:e,funnel:a})},openBorrow:function(e,t,n,a,i){p(r.Borrow),m({underlyingAsset:e}),R(s.vh.OPEN_MODAL,{modal:"Borrow",market:t,assetName:n,asset:e,funnel:a})},openRepay:function(e,t,n,a,i,o){p(r.Repay),m({underlyingAsset:e,currentRateMode:t,isFrozen:n}),R(s.vh.OPEN_MODAL,{modal:"Repay",asset:e,assetName:i,market:a,funnel:o})},openCollateralChange:function(e,t,n,a,i){p(r.CollateralChange),m({underlyingAsset:e}),R(s.vh.OPEN_MODAL,{modal:"Toggle Collateral",market:t,assetName:n,asset:e,usageAsCollateralEnabledOnUser:i,funnel:a})},openRateSwitch:function(e,t){R(s.vh.OPEN_MODAL,{modal:"Rate Switch"}),p(r.RateSwitch),m({underlyingAsset:e,currentRateMode:t})},openStake:function(e,t){R(s.vh.OPEN_MODAL,{modal:"Stake",assetName:e}),p(r.Stake),m({stakeAssetName:e,icon:t})},openUnstake:function(e,t){R(s.vh.OPEN_MODAL,{modal:"Untake",assetName:e}),p(r.Unstake),m({stakeAssetName:e,icon:t})},openStakeCooldown:function(e){R(s.vh.OPEN_MODAL,{modal:"Cooldown",assetName:e}),p(r.StakeCooldown),m({stakeAssetName:e})},openStakeRewardsClaim:function(e,t){R(s.vh.OPEN_MODAL,{modal:"Stake Rewards",assetName:e}),p(r.StakeRewardClaim),m({stakeAssetName:e,icon:t})},openStakeRewardsRestakeClaim:function(e,t){R(s.vh.OPEN_MODAL,{modal:"Restatke Stake Rewards",assetName:e}),p(r.StakeRewardsClaimRestake),m({stakeAssetName:e,icon:t})},openClaimRewards:function(){R(s.vh.OPEN_MODAL,{modal:"Claim"}),p(r.ClaimRewards)},openEmode:function(e){R(s.vh.OPEN_MODAL,{modal:"eMode"}),p(r.Emode),m({emode:e})},openFaucet:function(e){R(s.vh.OPEN_MODAL,{modal:"Faucet"}),p(r.Faucet),m({underlyingAsset:e})},openSwap:function(e){R(s.vh.OPEN_MODAL,{modal:"Swap"}),p(r.Swap),m({underlyingAsset:e})},openDebtSwitch:function(e,t){R(s.vh.OPEN_MODAL,{modal:"Debt Switch"}),p(r.DebtSwitch),m({underlyingAsset:e,currentRateMode:t})},openGovDelegation:function(){R(s.vh.OPEN_MODAL,{modal:"Governance Delegation"}),p(r.GovDelegation)},openRevokeGovDelegation:function(){R(s.vh.OPEN_MODAL,{modal:"Revoke Governance Delegation"}),p(r.RevokeGovDelegation)},openGovVote:function(e,t,n){R(s.vh.OPEN_MODAL,{modal:"Vote",proposalId:e,voteSide:t}),p(r.GovVote),m({proposalId:e,support:t,power:n})},openV3Migration:function(){R(s.vh.OPEN_MODAL,{modal:"V2->V3 Migration"}),p(r.V3Migration)},close:function(){p(void 0),m({}),_({}),b({}),S(""),P(void 0),n(void 0)},type:d,args:h,approvalTxState:g,mainTxState:w,setApprovalTxState:b,setMainTxState:_,gasLimit:T,setGasLimit:S,loadingTxns:E,setLoadingTxns:A,txError:C,setTxError:P},children:t})},d=function(){var e=(0,a.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),a=n(87794),i=n.n(a),o=n(56371),s=n(64146);class c extends s.lV{constructor(e){super(u,l,e)}static connect(e,t){return new s.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 p{constructor(e){if(!(0,o.isAddress)(e.permissionManagerAddress))throw new Error("contract address is not valid");this._contract=c.connect(e.permissionManagerAddress,e.provider)}async getUserPermissions(e){if(!(0,o.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 f=n(67294),h=n(77537),m=n(25298),y=n(46930),g=n(85893),b=f.createContext({permissions:[],isPermissionsLoading:!1}),v=function(e){var t=e.children,n=(0,y.f)(),a=n.currentChainId,o=n.currentMarketData,s=(0,h.Z)().currentAccount,c=(0,f.useState)(!0),u=c[0],l=c[1],d=(0,f.useState)([]),v=d[0],w=d[1];function _(){return(_=(0,r.Z)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=new p({provider:(0,m.VH)(a),permissionManagerAddress:t}),e.next=4,n.getHumanizedUserPermissions(s);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,f.useEffect)((function(){m.cr.permissions(o)&&s&&o.addresses.PERMISSION_MANAGER?function(e){_.apply(this,arguments)}(o.addresses.PERMISSION_MANAGER):l(!1)}),[s,o.addresses.PERMISSION_MANAGER]),(0,g.jsx)(b.Provider,{value:{permissions:v,isPermissionsLoading:u},children:t})},w=function(){return(0,f.useContext)(b)}},40481:function(e,t,n){"use strict";n.d(t,{W:function(){return i}});var r=n(90116),a=n(67294),i=function(e,t,n,i){var o=(0,a.useState)(0),s=o[0],c=o[1],u=(0,a.useRef)(e);(0,a.useEffect)((function(){u.current=e}),[e]),(0,a.useEffect)((function(){n||e()}),(0,r.Z)(i)),(0,a.useEffect)((function(){var e;return n||(e=window.setTimeout((function(){var e=u.current();e instanceof Promise?e.then((function(){c(s+1)})):(e(),c(s+1))}),t)),function(){return clearTimeout(e)}}),[s].concat((0,r.Z)(i)))}},46930:function(e,t,n){"use strict";n.d(t,{f:function(){return a}});var r=n(24834),a=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 a}});var r=n(24834),a=function(){return(0,r.Yh)((function(e){return{isWalletModalOpen:e.isWalletModalOpen,setWalletModalOpen:e.setWalletModalOpen}}))}},82483:function(e,t,n){"use strict";n.d(t,{v:function(){return j},k:function(){return D}});var r=n(61225),a=n(87462),i=n(67294),o=n(78884),s=n(43918),c=n(85893);const u=(e,t)=>(0,a.Z)({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},t&&!e.vars&&{colorScheme:e.palette.mode}),l=e=>(0,a.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 d=function(e){const t=(0,o.Z)({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=t;return(0,c.jsxs)(i.Fragment,{children:[(0,c.jsx)(s.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,a.Z)({html:u(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:(0,a.Z)({margin:0},l(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]})},p=n(44819),f=n(56760);var h="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";var m=function(e){const{children:t,theme:n}=e,r=(0,f.Z)(),o=i.useMemo((()=>{const e=null===r?n:function(e,t){if("function"===typeof t)return t(e);return(0,a.Z)({},e,t)}(r,n);return null!=e&&(e[h]=null!==r),e}),[n,r]);return(0,c.jsx)(p.Z.Provider,{value:o,children:t})},y=n(52443),g=n(96682);function b(e){const t=(0,g.Z)();return(0,c.jsx)(y.T.Provider,{value:"object"===typeof t?t:{},children:e.children})}var v=function(e){const{children:t,theme:n}=e;return(0,c.jsx)(m,{theme:n,children:(0,c.jsx)(b,{children:t})})},w=n(19762),_=n(59766),x=n(59499),T=n(58771),S=n(38264);var k=i.forwardRef((function(e,t){return i.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),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))})),E=n(13902),A=n(61782),O=n(81645);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 P(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,c.jsx)(O.Z,P(P({sx:{fontSize:"16px"}},e),{},{children:(0,c.jsx)(A.Z,{})}))}},styleOverrides:{outlined:P(P({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))}),[o]);return(0,c.jsx)(D.Provider,{value:u,children:(0,c.jsxs)(v,{theme:l,children:[(0,c.jsx)(d,{}),t]})})}},78544:function(e,t,n){"use strict";n.d(t,{Z:function(){return en}});var r,a=n(61953),i=n(67294),o=n(49501),s=n(54235),c=n(85893),u=(0,s.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,s.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),p=n(29630),f=n(81645),h=n(68861);function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;tr}const N="undefined"!==typeof window?window:null;var L=n(8662),B=n(75400),Z=n(84771),U=n(53566),F=n(57577);const z=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function G(e,t,n){var r;const a=function(e,t,n){const r=t.getBoundingClientRect(),a=n&&n.getBoundingClientRect(),i=(0,F.Z)(t);let o;if(t.fakeTransform)o=t.fakeTransform;else{const e=i.getComputedStyle(t);o=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let s=0,c=0;if(o&&"none"!==o&&"string"===typeof o){const e=o.split("(")[1].split(")")[0].split(",");s=parseInt(e[4],10),c=parseInt(e[5],10)}return"left"===e?a?`translateX(${a.right+s-r.left}px)`:`translateX(${i.innerWidth+s-r.left}px)`:"right"===e?a?`translateX(-${r.right-a.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:"up"===e?a?`translateY(${a.bottom+c-r.top}px)`:`translateY(${i.innerHeight+c-r.top}px)`:a?`translateY(-${r.top-a.top+r.height-c}px)`:`translateY(-${r.top+r.height-c}px)`}(e,t,"function"===typeof(r=n)?r():r);a&&(t.style.webkitTransform=a,t.style.transform=a)}var H=i.forwardRef((function(e,t){const n=(0,P.Z)(),r={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:u,container:l,direction:d="down",easing:p=r,in:f,onEnter:h,onEntered:m,onEntering:y,onExit:g,onExited:b,onExiting:v,style:w,timeout:_=a,TransitionComponent:x=L.ZP}=e,T=(0,D.Z)(e,z),S=i.useRef(null),k=(0,Z.Z)(u.ref,S,t),E=e=>t=>{e&&(void 0===t?e(S.current):e(S.current,t))},A=E(((e,t)=>{G(d,e,l),(0,U.n)(e),h&&h(e,t)})),O=E(((e,t)=>{const r=(0,U.C)({timeout:_,style:w,easing:p},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",(0,I.Z)({},r)),e.style.transition=n.transitions.create("transform",(0,I.Z)({},r)),e.style.webkitTransform="none",e.style.transform="none",y&&y(e,t)})),C=E(m),R=E(v),j=E((e=>{const t=(0,U.C)({timeout:_,style:w,easing:p},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),G(d,e,l),g&&g(e)})),M=E((e=>{e.style.webkitTransition="",e.style.transition="",b&&b(e)})),N=i.useCallback((()=>{S.current&&G(d,S.current,l)}),[d,l]);return i.useEffect((()=>{if(f||"down"===d||"right"===d)return;const e=(0,B.Z)((()=>{S.current&&G(d,S.current,l)})),t=(0,F.Z)(S.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[d,f,l]),i.useEffect((()=>{f||N()}),[f,N]),(0,c.jsx)(x,(0,I.Z)({nodeRef:S,onEnter:A,onEntered:C,onEntering:O,onExit:j,onExited:M,onExiting:R,addEndListener:e=>{o&&o(S.current,e)},appear:s,in:f,timeout:_},T,{children:(e,t)=>i.cloneElement(u,(0,I.Z)({ref:k,style:(0,I.Z)({visibility:"exited"!==e||f?void 0:"hidden"},w,u.props.style)},t))}))})),W=n(97563),V=n(24834),q=n(25298),$=n(85214),Y=n(43265),K=n(57609),Q=n(46930),X=n(6022);var J=i.forwardRef((function(e,t){return i.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),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}));var ee=i.forwardRef((function(e,t){return i.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),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"}))})),te=n(83454),ne=[{link:h.Z6.markets,title:X.ag._("Home"),dataCy:"menuMarkets"},{link:h.Z6.dashboard,title:X.ag._("Dashboard"),dataCy:"menuDashboard"},{link:h.Z6.rewards,title:X.ag._("Rewards"),dataCy:"menuMarkets"},{link:"https://docs.google.com/forms/d/e/1FAIpQLSf2RmxTce7xDZueULr2vjmSntSm0lmesiFi1sqxpnkPblN0vA/viewform",title:X.ag._("NFTs"),dataCy:"menuNFT"},{link:"https://docs.zerolend.xyz",title:X.ag._("Docs"),dataCy:"menuDocs"},{link:"https://portal.zksync.io/bridge/",title:X.ag._("Bridge"),dataCy:"menuBridge"},{link:h.Z6.faucet,title:X.ag._("Faucet"),isVisible:function(){return"staging"===te.env.NEXT_PUBLIC_ENV||q.p8}}],re=[{link:"https://docs.aave.com/faq/",title:X.ag._("FAQ"),icon:(0,c.jsx)(J,{})},{link:"https://docs.aave.com/portal/",title:X.ag._("Developers"),icon:(0,c.jsx)(ee,{})}],ae=(te.env.NEXT_PUBLIC_FIAT_ON_RAMP,[].concat(re)),ie=function(e){var t=e.setOpen,n=(0,o.mV)().i18n,r=(0,Q.f)().currentMarketData,a=(0,P.Z)().breakpoints,i=(0,R.Z)(a.down("md")),s=(0,V.Yh)((function(e){return e.trackEvent})),u=function(e,n){n&&t?(s(K.uh.MAIN_MENU,{nav_link:e}),t(!1)):s(K.uh.MAIN_MENU,{nav_link:e})};return(0,c.jsx)($.Z,{sx:{display:"flex",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},disablePadding:!0,children:ne.filter((function(e){return!e.isVisible||e.isVisible(r)})).map((function(e,t){return(0,c.jsx)(Y.ZP,{sx:{width:{xs:"100%",md:"unset"},mr:{xs:0,md:2}},"data-cy":e.dataCy,disablePadding:!0,children:i?(0,c.jsx)(p.Z,{component:h.rU,href:e.link,variant:"h2",color:"#F1F1F3",sx:{width:"100%",p:4},onClick:function(){return u(e.title,!0)},children:n._(e.title)}):(0,c.jsx)(v.Z,{component:h.rU,onClick:function(){return u(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:n._(e.title)})},t)}))})};var oe=i.forwardRef((function(e,t){return i.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),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"}))})),se=n(29894),ce=n(22841),ue=n(54181),le=n(82483),de=function(e){var t=e.component,n=void 0===t?Y.ZP:t,r=(0,P.Z)(),s=i.useContext(le.k),u=(0,V.Yh)((function(e){return e.trackEvent}));return(0,c.jsxs)(a.Z,{component:n,onClick:s.toggleColorMode,sx:{color:{xs:"#F1F1F3",md:"text.primary"},py:{xs:1.5,md:2}},children:[(0,c.jsx)(x.Z,{children:(0,c.jsx)(o.cC,{id:"Dark mode"})}),(0,c.jsx)(ce.Z,{sx:{mr:0},value:"darkmode",control:(0,c.jsx)(ue.Z,{onClick:function(){return u(K.L6.DARK_MODE,{mode:r.palette.mode})},disableRipple:!0,checked:"dark"===r.palette.mode,sx:{".MuiSwitch-track":{bgcolor:{xs:"#FFFFFF1F",md:"primary.light"}}}}),label:"dark"===r.palette.mode?"On":"Off",labelPlacement:"start"})]})},pe=n(86010),fe=n(94780),he=n(72553),me=n(70918),ye=n(36622),ge=n(78884),be=n(34867),ve=n(1588);function we(e){return(0,be.Z)("MuiDrawer",e)}(0,ve.Z)("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const _e=["BackdropProps"],xe=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],Te=(e,t)=>{const{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},Se=(0,d.ZP)(he.Z,{name:"MuiDrawer",slot:"Root",overridesResolver:Te})((({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ke=(0,d.ZP)("div",{shouldForwardProp:d.FO,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:Te})({flex:"0 0 auto"}),Ee=(0,d.ZP)(me.Z,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,ye.Z)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,ye.Z)(n.anchor)}`]]}})((({theme:e,ownerState:t})=>(0,I.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}`}))),Ae={left:"right",right:"left",top:"down",bottom:"up"};var Oe=i.forwardRef((function(e,t){const n=(0,ge.Z)({props:e,name:"MuiDrawer"}),r=(0,P.Z)(),a={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{anchor:o="left",BackdropProps:s,children:u,className:l,elevation:d=16,hideBackdrop:p=!1,ModalProps:{BackdropProps:f}={},onClose:h,open:m=!1,PaperProps:y={},SlideProps:g,TransitionComponent:b=H,transitionDuration:v=a,variant:w="temporary"}=n,_=(0,D.Z)(n.ModalProps,_e),x=(0,D.Z)(n,xe),T=i.useRef(!1);i.useEffect((()=>{T.current=!0}),[]);const S=function(e,t){return"rtl"===e.direction&&function(e){return-1!==["left","right"].indexOf(e)}(t)?Ae[t]:t}(r,o),k=o,E=(0,I.Z)({},n,{anchor:k,elevation:d,open:m,variant:w},x),A=(e=>{const{classes:t,anchor:n,variant:r}=e,a={root:["root"],docked:[("permanent"===r||"persistent"===r)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,ye.Z)(n)}`,"temporary"!==r&&`paperAnchorDocked${(0,ye.Z)(n)}`]};return(0,fe.Z)(a,we,t)})(E),O=(0,c.jsx)(Ee,(0,I.Z)({elevation:"temporary"===w?d:0,square:!0},y,{className:(0,pe.default)(A.paper,y.className),ownerState:E,children:u}));if("permanent"===w)return(0,c.jsx)(ke,(0,I.Z)({className:(0,pe.default)(A.root,A.docked,l),ownerState:E,ref:t},x,{children:O}));const C=(0,c.jsx)(b,(0,I.Z)({in:m,direction:Ae[S],timeout:v,appear:T.current},g,{children:O}));return"persistent"===w?(0,c.jsx)(ke,(0,I.Z)({className:(0,pe.default)(A.root,A.docked,l),ownerState:E,ref:t},x,{children:C})):(0,c.jsx)(Se,(0,I.Z)({BackdropProps:(0,I.Z)({},s,f,{transitionDuration:v}),className:(0,pe.default)(A.root,A.modal,l),open:m,ownerState:E,onClose:h,hideBackdrop:p,ref:t},x,_,{children:C}))})),Ce=function(e){var t=e.open,n=e.setOpen,r=e.children,a=e.headerHeight;return(0,c.jsx)(Oe,{"data-cy":"mobile-menu",anchor:"top",open:t,onClose:function(){return n(!1)},hideBackdrop:!0,sx:{top:"".concat(a,"px")},PaperProps:{sx:{background:"rgba(27, 32, 48, 0.98)",backdropFilter:"blur(20px)",boxShadow:"none",borderRadius:"unset",width:"100%",top:"".concat(a+20,"px"),pt:6,pb:15,minHeight:"100vh"}},children:r})};var Pe=i.forwardRef((function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),i.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 Re=i.forwardRef((function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),i.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"}))})),Ie=n(58057),De=n(35683),je={en:X.ag._("English"),es:X.ag._("Spanish"),fr:X.ag._("French"),el:X.ag._("Greek"),zh:X.ag._("Chinese"),jp:X.ag._("Japanese")},Me=function(e){var t=e.component,n=void 0===t?Y.ZP:t,r=e.onClick,i=(0,o.mV)().i18n;return(0,c.jsxs)(a.Z,{component:n,onClick:r,sx:{color:{xs:"#F1F1F3",md:"text.primary"}},children:[(0,c.jsx)(x.Z,{children:(0,c.jsx)(o.cC,{id:"Language"})}),(0,c.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[i._(je[i.locale])," ",(0,c.jsx)(f.Z,{fontSize:"small",sx:{color:{xs:"#F1F1F3",md:"text.primary"},ml:1},children:(0,c.jsx)(Pe,{})})]})]})},Ne=function(e){var t=e.component,n=void 0===t?Y.ZP:t,r=e.onClick,i=(0,o.mV)().i18n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(a.Z,{component:n,sx:{color:{xs:"#F1F1F3",md:"text.primary"},mb:"4px"},onClick:r,children:[(0,c.jsx)(se.Z,{sx:{minWidth:"unset !important",mr:2,color:{xs:"#F1F1F3",md:"primary.light"}},children:(0,c.jsx)(f.Z,{fontSize:"small",children:(0,c.jsx)(Re,{})})}),(0,c.jsx)(x.Z,{disableTypography:!0,children:(0,c.jsx)(p.Z,{variant:"subheader2",children:(0,c.jsx)(o.cC,{id:"Select language"})})})]}),Object.keys(je).map((function(e){return(0,c.jsxs)(a.Z,{component:n,onClick:function(){return(0,De.zl)(e)},sx:{color:{xs:"#F1F1F3",md:"text.primary"},".MuiListItemIcon-root":{minWidth:"unset"},".MuiMenuItemIcon-root":{minWidth:"unset"}},children:[(0,c.jsx)(se.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)(x.Z,{children:i._(je[e])}),e===i.locale&&(0,c.jsx)(se.Z,{sx:{m:0},children:(0,c.jsx)(f.Z,{fontSize:"small",sx:{color:{xs:"#F1F1F3",md:"text.primary"}},children:(0,c.jsx)(Ie.Z,{})})})]},e)}))]})},Le=n(5506),Be=n(80562),Ze=function(e){var t=e.setOpen;return(0,c.jsx)(Be.Z,{onClick:function(){return t(!1)},sx:{p:0,mr:{xs:-2,xsm:1}},children:(0,c.jsx)(f.Z,{sx:{color:"#F1F1F3",fontSize:"32px"},children:(0,c.jsx)(Le.Z,{})})})},Ue=function(e){var t=e.component,n=void 0===t?Y.ZP:t,r="testnetsEnabled",s="true"===localStorage.getItem(r)||!1,u=(0,i.useState)(s),l=u[0],d=u[1],p=(0,V.Yh)((function(e){return e.trackEvent}));return(0,c.jsxs)(a.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)(x.Z,{children:(0,c.jsx)(o.cC,{id:"Testnet mode"})}),(0,c.jsx)(ce.Z,{sx:{mr:0},value:"testnetsMode",control:(0,c.jsx)(ue.Z,{disableRipple:!0,onClick:function(){return p(K.L6.TESTNET_MODE)},checked:l,sx:{".MuiSwitch-track":{bgcolor:{xs:"#FFFFFF1F",md:"primary.light"}}}}),label:l?"On":"Off",labelPlacement:"start"})]})},Fe=function(e){var t=e.children,n=e.title;return(0,c.jsxs)(a.Z,{sx:{mb:6,"&:last-of-type":{mb:0,".MuiDivider-root":{display:"none"}}},children:[(0,c.jsxs)(a.Z,{sx:{px:2},children:[(0,c.jsx)(p.Z,{variant:"subheader2",sx:{color:"#A5A8B6",px:4,py:2},children:n}),t]}),(0,c.jsx)(T.Z,{sx:{borderColor:"#F2F3F729",mt:6}})]})},ze=function(e){var t=e.open,n=e.setOpen,r=e.headerHeight,a=(0,o.mV)().i18n,s=(0,i.useState)(!1),u=s[0],l=s[1];return(0,i.useEffect)((function(){return l(!1)}),[t]),(0,c.jsxs)(c.Fragment,{children:[t?(0,c.jsx)(Ze,{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)(f.Z,{sx:{color:"#F1F1F3"},fontSize:"small",children:(0,c.jsx)(oe,{})})}),(0,c.jsx)(Ce,{open:t,setOpen:n,headerHeight:r,children:u?(0,c.jsx)($.Z,{sx:{px:2},children:(0,c.jsx)(Ne,{onClick:function(){return l(!1)}})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fe,{title:(0,c.jsx)(o.cC,{id:"Menu"}),children:(0,c.jsx)(ie,{setOpen:n})}),(0,c.jsx)(Fe,{title:(0,c.jsx)(o.cC,{id:"Global settings"}),children:(0,c.jsxs)($.Z,{children:[(0,c.jsx)(de,{}),q.F3&&(0,c.jsx)(Ue,{}),(0,c.jsx)(Me,{onClick:function(){return l(!0)}})]})}),(0,c.jsx)(Fe,{title:(0,c.jsx)(o.cC,{id:"Links"}),children:(0,c.jsx)($.Z,{children:ae.map((function(e,t){return(0,c.jsxs)(Y.ZP,{component:h.rU,href:e.link,sx:{color:"#F1F1F3"},children:[(0,c.jsx)(se.Z,{sx:{minWidth:"unset",mr:3},children:(0,c.jsx)(f.Z,{sx:{fontSize:"20px",color:"#F1F1F3"},children:e.icon})}),(0,c.jsx)(x.Z,{children:a._(e.title)})]},t)}))})})]})})]})},Ge=n(22659),He={en:"English",es:"Spanish",fr:"French",el:"Greek"};function We(){var e=(0,i.useState)(!1),t=e[0],n=e[1],r=(0,i.useState)(!1),a=r[0],s=r[1],u=(0,i.useState)(null),l=u[0],d=u[1],h=(0,V.Yh)((function(e){return e.trackEvent})),m=function(){d(null),n(!1),s(!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),s(!1)},sx:{p:"7px 8px",minWidth:"unset",ml:2},children:(0,c.jsx)(f.Z,{sx:{color:"#F1F1F3"},fontSize:"small",children:(0,c.jsx)(Ge.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)(_.Z,{disabled:!0,sx:{mb:"4px"},children:(0,c.jsx)(p.Z,{variant:"subheader2",color:"text.secondary",children:(0,c.jsx)(o.cC,{id:"Global settings"})})}),(0,c.jsx)(de,{component:_.Z}),q.F3&&(0,c.jsx)(Ue,{}),(0,c.jsx)(Me,{onClick:function(){var e=localStorage.getItem("LOCALE")||De.ZW;n(!1),s(!0),h(K.L6.LANGUAGE,{language:He[e]})},component:_.Z})]}),(0,c.jsx)(w.Z,{id:"settings-menu",MenuListProps:{"aria-labelledby":"settings-button"},anchorEl:l,open:a,onClose:m,keepMounted:!0,children:(0,c.jsx)(Ne,{onClick:function(){n(!0),s(!1)},component:_.Z})})]})}var Ve=n(59499),qe=n(50029),$e=n(87794),Ye=n.n($e);var Ke=i.forwardRef((function(e,t){return i.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),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))})),Qe=n(52758),Xe=n(84563);var Je=i.forwardRef((function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),i.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"}))})),et=n(91655),tt=n(852),nt=n(11163),rt=n(4730),at=n(33821),it=(0,s.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 ot(e){return(0,be.Z)("MuiAvatar",e)}(0,ve.Z)("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const st=["alt","children","className","component","imgProps","sizes","src","srcSet","variant"],ct=(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,I.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,I.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]})))),ut=(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}),lt=(0,d.ZP)(it,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});var dt,pt=i.forwardRef((function(e,t){const n=(0,ge.Z)({props:e,name:"MuiAvatar"}),{alt:r,children:a,className:o,component:s="div",imgProps:u,sizes:l,src:d,srcSet:p,variant:f="circular"}=n,h=(0,D.Z)(n,st);let m=null;const y=function({crossOrigin:e,referrerPolicy:t,src:n,srcSet:r}){const[a,o]=i.useState(!1);return i.useEffect((()=>{if(!n&&!r)return;o(!1);let a=!0;const i=new Image;return i.onload=()=>{a&&o("loaded")},i.onerror=()=>{a&&o("error")},i.crossOrigin=e,i.referrerPolicy=t,i.src=n,r&&(i.srcset=r),()=>{a=!1}}),[e,t,n,r]),a}((0,I.Z)({},u,{src:d,srcSet:p})),g=d||p,b=g&&"error"!==y,v=(0,I.Z)({},n,{colorDefault:!b,component:s,variant:f}),w=(e=>{const{classes:t,variant:n,colorDefault:r}=e,a={root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]};return(0,fe.Z)(a,ot,t)})(v);return m=b?(0,c.jsx)(ut,(0,I.Z)({alt:r,src:d,srcSet:p,sizes:l,ownerState:v,className:w.img},u)):null!=a?a:g&&r?r[0]:(0,c.jsx)(lt,{className:w.fallback}),(0,c.jsx)(ct,(0,I.Z)({as:s,ownerState:v,className:(0,pe.default)(w.root,o),ref:t},h,{children:m}))})),ft=n(11288),ht=n.n(ft),mt=["image","fallbackImage","size","sx","loading","invisibleBadge","badge"];function yt(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 gt(e){for(var t=1;t18),g=!s||y,b=(0,V.Yh)((function(e){return e.trackEvent}));return(0,c.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,c.jsx)(Et,Ut(Ut({compactMode:s?i:n,compact:g,loading:o},m),{},{children:s||u})),l&&(0,c.jsx)(Lt.y,{title:"View on Etherscan",children:(0,c.jsx)(Nt.Z,{href:l,target:"_blank",sx:{display:"flex"},onClick:function(){return b(K.vh.EXTERNAL_LINK,{funnel:h,Link:"Etherscan"})},children:(0,c.jsx)(f.Z,{sx:{fontSize:p},children:(0,c.jsx)(Xe.Z,{})})})})]})};function zt(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 Gt(e){for(var t=1;tt(a,r)));return i.useEffect((()=>{const e=()=>{s(t(a,(0,I.Z)({target:n},r)))};return e(),n.addEventListener("scroll",e,{passive:!0}),()=>{n.removeEventListener("scroll",e,{passive:!0})}}),[n,t,JSON.stringify(r)]),o}({threshold:(0,R.Z)(n.down("md"))?160:80});return(0,c.jsx)(H,{appear:!1,direction:"down",in:!r,children:t})}function Qt(){var e=(0,P.Z)().breakpoints,t=(0,R.Z)(e.down("md")),n=(0,R.Z)(e.down("sm")),r=(0,V.Yh)((function(e){return[e.mobileDrawerOpen,e.setMobileDrawerOpen]})),s=(0,O.Z)(r,2),u=s[0],l=s[1],d=(0,i.useState)(!1),m=d[0],y=d[1],g=(0,i.useState)(!1),b=g[0],w=g[1];(0,i.useEffect)((function(){u&&!t&&l(!1),m&&y(!1)}),[t]);var _=(0,c.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"start",gap:1},children:[(0,c.jsx)(p.Z,{variant:"subheader1",children:(0,c.jsx)(o.cC,{id:"Testnet mode is ON"})}),(0,c.jsxs)(p.Z,{variant:"description",children:[(0,c.jsx)(o.cC,{id:"The app is running in testnet mode. Learn how it works in"})," ",(0,c.jsx)(h.rU,{href:"https://docs.aave.com/faq/testing-aave",style:{fontSize:"14px",fontWeight:400,textDecoration:"underline"},children:"FAQ."})]}),(0,c.jsx)(v.Z,{variant:"outlined",sx:{mt:"12px"},onClick:function(){localStorage.setItem("testnetsEnabled","false"),window.location.href="/"},children:(0,c.jsx)(o.cC,{id:"Disable testnet"})})]});return(0,c.jsx)(Kt,{children:(0,c.jsxs)(a.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:b||m?"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)(a.Z,{sx:{mr:n?1:3},children:q.p8&&(0,c.jsx)(W.a,{tooltipContent:_,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)(f.Z,{sx:{marginLeft:"2px",fontSize:"16px"},children:(0,c.jsx)(C.Z,{})})]})})}),(0,c.jsx)(a.Z,{sx:{display:{xs:"none",md:"block"}},children:(0,c.jsx)(ie,{})}),(0,c.jsx)(a.Z,{sx:{flexGrow:1}}),!b&&(0,c.jsx)(Yt,{open:m,setOpen:function(e){t&&l(e),y(e)},headerHeight:48}),(0,c.jsx)(a.Z,{sx:{display:{xs:"none",md:"block"}},children:(0,c.jsx)(We,{})}),!m&&(0,c.jsx)(a.Z,{sx:{display:{xs:"flex",md:"none"}},children:(0,c.jsx)(ze,{open:b,setOpen:function(e){t&&l(e),w(e)},headerHeight:48})})]})})}var Xt=n(97005),Jt=function(){return(0,c.jsx)(a.Z,{sx:{bgcolor:"#111",color:"#fff",display:"flex",justifyContent:"center",p:"3px"},children:(0,c.jsxs)(Xt.Z,{pauseOnHover:!0,children:[(0,c.jsxs)(Nt.Z,{href:"https://docs.zerolend.xyz/roadmap/phase-1-launch",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(o.cC,{id:"$ZERO PRE-MINE IS LIVE"})," /"]}),(0,c.jsxs)(Nt.Z,{href:"https://docs.zerolend.xyz/audits",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(o.cC,{id:"ZEROLEND IS AUDITED BY MUNDUS SECURITY"})," /"]}),(0,c.jsxs)(Nt.Z,{href:"https://guild.xyz/zerolend",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(o.cC,{id:"JOIN OUR GUILD"})," /"]}),(0,c.jsxs)(Nt.Z,{href:"https://docs.zerolend.xyz/roadmap/phase-1-launch",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(o.cC,{id:"$ZERO PRE-MINE IS LIVE"})," /"]}),(0,c.jsxs)(Nt.Z,{href:"https://docs.zerolend.xyz/audits",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(o.cC,{id:"ZEROLEND IS AUDITED BY MUNDUS SECURITY"})," /"]}),(0,c.jsxs)(Nt.Z,{href:"https://guild.xyz/zerolend",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(o.cC,{id:"JOIN OUR GUILD"})," /"]}),(0,c.jsxs)(Nt.Z,{href:"https://docs.zerolend.xyz/roadmap/phase-1-launch",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(o.cC,{id:"$ZERO PRE-MINE IS LIVE"})," /"]}),(0,c.jsxs)(Nt.Z,{href:"https://docs.zerolend.xyz/audits",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(o.cC,{id:"ZEROLEND IS AUDITED BY MUNDUS SECURITY"})," /"]}),(0,c.jsxs)(Nt.Z,{href:"https://guild.xyz/zerolend",color:"inherit",target:"_blank",mr:6,fontSize:12,sx:{textDecoration:"none"},children:["/ ",(0,c.jsx)(o.cC,{id:"JOIN OUR GUILD"})," /"]})]})})};function en(e){var t=e.children;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Jt,{}),(0,c.jsx)(Qt,{}),(0,c.jsx)(a.Z,{component:"main",sx:{display:"flex",flexDirection:"column",flex:1},children:t}),(0,c.jsx)(A,{})]})}},35683:function(e,t,n){"use strict";n.d(t,{ZW:function(){return y},iL:function(){return v},zl:function(){return g}});var r=n(50029),a=n(87794),i=n.n(a),o=n(6022),s=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 p=u;var f=n(67294),h=n(79958),m=n(85893);o.ag.loadLocaleData({en:{plurals:function(e,t){var n=String(e).split("."),r=!n[1],a=Number(n[0])==e,i=a&&n[0].slice(-1),o=a&&n[0].slice(-2);return t?1==i&&11!=o?"one":2==i&&12!=o?"two":3==i&&13!=o?"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:p}}),o.ag.load("en",h.messages),o.ag.activate("en");var y="en";function g(e){return b.apply(this,arguments)}function b(){return b=(0,r.Z)(i().mark((function e(t){var r,a;return i().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,a=r.messages,o.ag.load(t,a),o.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,f.useEffect)((function(){var e=localStorage.getItem("LOCALE")||y;o.ag._locale!==e&&g(e)}),[]),(0,m.jsx)(s.bd,{i18n:o.ag,forceRenderOnLocaleChange:!1,children:e.children})}},77537:function(e,t,n){"use strict";n.d(t,{S:function(){return a},Z:function(){return i}});var r=n(67294),a=r.createContext({}),i=function(){var e=(0,r.useContext)(a).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),a=n(82262),i=n(10748),o=n(59499),s=n(92777),c=n(81531),u=n(63553),l=n(37247),d=n(46576),p=n(87794),f=n.n(p),h=n(26939),m=n(25298),y=n(38776);function g(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 a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var b=function(e){(0,c.Z)(n,e);var t=g(n);function n(){var e;return(0,s.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=g(u);function u(e){var n;(0,s.Z)(this,u),n=t.call(this),(0,o.Z)((0,i.Z)(n),"config",void 0),(0,o.Z)((0,i.Z)(n),"walletConnectProvider",void 0),(0,o.Z)((0,i.Z)(n),"handleDisplayURI",(function(e){n.emit("URI_AVAILABLE",e)}));var r=(0,m.c)(),a=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:a,projectId:"9f8cf941224ba28f02be7c7dd755c78b",showQrModal:!0},n.handleChainChanged=n.handleChainChanged.bind((0,i.Z)(n)),n.handleAccountsChanged=n.handleAccountsChanged.bind((0,i.Z)(n)),n.handleDisconnect=n.handleDisconnect.bind((0,i.Z)(n)),n}return(0,a.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)(f().mark((function e(){var t,r,a;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.walletConnectProvider){e.next=7;break}return e.next=3,Promise.all([n.e(327),n.e(883)]).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,a=r[0],e.abrupt("return",{provider:this.walletConnectProvider,account:a});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)(f().mark((function e(){return f().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)(f().mark((function e(){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,y.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)(f().mark((function e(){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,y.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)(f().mark((function e(){return f().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)},33623:function(e,t,n){"use strict";n.d(t,{kn:function(){return Y},Sq:function(){return F},iL:function(){return Q}});var r=n(92777),a=n(82262),i=n(10748),o=n(81531),s=n(63553),c=n(37247),u=n(59499),l=n(75331),d=n(15495),p=n(26939),f=n(81088),h=n(36939),m=n.n(h),y="Invariant failed";function g(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(e){return!1}}function _(e,t,n){return _=w()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&v(a,n.prototype),a},_.apply(null,arguments)}function x(e){var t="function"===typeof Map?new Map:void 0;return x=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 _(e,arguments,b(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),v(r,e)},x(e)}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var S=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 g(t,e),t}(x(Error)),k=function(e){function t(t){var n;return 1!==t.supportedChainIds.length&&function(e,t){if(!e)throw new Error(y)}(!1),(n=e.call(this,t)||this).handleNetworkChanged=n.handleNetworkChanged.bind(T(n)),n.handleChainChanged=n.handleChainChanged.bind(T(n)),n.handleAccountsChanged=n.handleAccountsChanged.bind(T(n)),n.handleClose=n.handleClose.bind(T(n)),n}g(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 S:e}))).then((function(t){return{provider:e.provider,account:t}}))}catch(t){return Promise.reject(t)}},n.getProvider=function(){try{return Promise.resolve(this.provider)}catch(e){return Promise.reject(e)}},n.getChainId=function(){try{return Promise.resolve(this.provider.send("eth_chainId"))}catch(e){return Promise.reject(e)}},n.getAccount=function(){try{return Promise.resolve(this.provider.send("eth_accounts").then((function(e){return e[0]})))}catch(e){return Promise.reject(e)}},n.deactivate=function(){this.provider.removeListener("networkChanged",this.handleNetworkChanged).removeListener("chainChanged",this.handleChainChanged).removeListener("accountsChanged",this.handleAccountsChanged).removeListener("close",this.handleClose)},t}(p.AbstractConnector),E=n(30950),A=n(31630),O=n(97452),C=n(25298),P=n(52864),R=n(65637),I=n(50029),D=n(46576),j=n(87794),M=n.n(j);var N=function(e,t){};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 B(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}(p.AbstractConnector);function W(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,c.Z)(e);if(t){var a=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,s.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"}(F||(F={}));var V="ZeroLend",q="https://aave.com/favicon.ico",$={request:Promise.resolve(null)},Y=function(e){(0,o.Z)(n,e);var t=W(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,o=new Array(a),s=0;s1&&void 0!==arguments[1]?arguments[1]:l.a_.mainnet,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.a_.mainnet;switch(e){case F.OKX:return new H({});case F.BITGET:return new K({});case F.READ_ONLY_MODE:return new Y;case F.LEDGER:return new P.us({});case F.INJECTED:return new E._k({});case F.WALLET_LINK:var r=(0,C.Mo)(t);return new O.J({appName:V,appLogoUrl:q,url:r.privateJsonRPCUrl||r.publicJsonRPCUrl[0]});case F.WALLET_CONNECT:return new R.zw(n);case F.GNOSIS:if(window)return new d.P;throw new Error("Safe app not working");case F.TORUS:return new A.Q({chainId:t,initOptions:{network:{host:t===l.a_.polygon?"matic":t},showTorusButton:!1,enableLogging:!1,enabledVerifiers:!1}});case F.FRAME:if(t!==l.a_.mainnet)throw new f.UnsupportedChainIdError(t,[1]);return new k({supportedChainIds:[1]});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.aave.com because it is associated with one or more":"This address is blocked on app.aave.com 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"]]}}},83601:function(e,t,n){"use strict";n.d(t,{xI:function(){return l},qY:function(){return d},$:function(){return p},NJ:function(){return h},mg:function(){return m},Rp:function(){return g},To:function(){return b},Fb:function(){return v},uk:function(){return w},pF:function(){return _},em:function(){return x},ML:function(){return S}});var r=n(59499),a=n(22433),i=n(48949),o=n(41551),s=n(25298);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;tt.iconSymbol.toUpperCase()?1:-1},_=function(e,t){var n=g(e),r=v(e),i=e.currentNetworkConfig;return(0,a.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,o.QD)(e)),{},{isEmodeEnabled:0!==e.eModeCategoryId,isWrappedBaseAsset:e.symbol.toLowerCase()===(null===(t=i.wrappedBaseAssetSymbol)||void 0===t?void 0:t.toLowerCase())})})).sort(w)},x=function(e,t){var n=v(e),r=m(e),a=_(e,t),o=h(e),s=e.reserveIncentiveData,c=e.userIncentiveData;return(0,i.n)({currentTimestamp:t,marketReferencePriceInUsd:n.marketReferenceCurrencyPriceInUsd,marketReferenceCurrencyDecimals:n.marketReferenceCurrencyDecimals,userReserves:r,formattedReserves:a,userEmodeCategoryId:o,reserveIncentives:s||[],userIncentives:c||[]})},T=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}),{})},S=function(e){var t=g(e);return T(t)}},24834:function(e,t,n){"use strict";n.d(t,{DP:function(){return gr},Qb:function(){return yr},p4:function(){return hr},Xh:function(){return mr},Yh:function(){return pr}});var r=n(50029),a=n(59499),i=n(87794),o=n.n(i),s=n(70655),c=n(27627),u=n(75331),l=n(80854),d=n(29897),p=n(55206),f=n(64146);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 f.CH(e,h,t)}}m.abi=h;class y 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 a=(0,l.gU)("1000",18),i=l.Ry[n]?l.Ry[n]:a,o=this.getContractInstance(this.faucetAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.mint(t,e,i),from:null!==r&&void 0!==r?r:e,value:l.k8});return[{tx:s,txType:u.ns.FAUCET_V2_MINT,gas:this.generateTxPriceEstimation([],s)}]}async isPermissioned(){return this.getContractInstance(this.faucetAddress).isPermissioned()}}function g(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:E(e)?2:A(e)?3:0}function x(e,t){return 2===_(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function T(e,t){return 2===_(e)?e.get(t):e[t]}function S(e,t,n){var r=_(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 E(e){return ne&&e instanceof Map}function A(e){return re&&e instanceof Set}function O(e){return e.o||e.t}function C(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=de(e);delete t[se];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 P(t,!0)}),!0)),e}function R(){g(2)}function I(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function D(e){var t=pe[e];return t||g(18,e),t}function j(e,t){pe[e]||(pe[e]=t)}function M(){return ee}function N(e,t){t&&(D("Patches"),e.u=[],e.s=[],e.v=t)}function L(e){B(e),e.p.forEach(U),e.p=null}function B(e){e===ee&&(ee=e.l)}function Z(e){return ee={p:[],l:ee,h:e,m:!0,_:0}}function U(e){var t=e[se];0===t.i||1===t.i?t.j():t.O=!0}function F(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||D("ES5").S(t,e,r),r?(n[se].P&&(L(t),g(4)),v(e)&&(e=z(t,e),t.l||H(t,e)),t.u&&D("Patches").M(n[se].t,e,t.u,t.s)):e=z(t,n,[]),L(t),t.u&&t.v(t.u,t.s),e!==ie?e:void 0}function z(e,t,n){if(I(t))return t;var r=t[se];if(!r)return w(t,(function(a,i){return G(e,r,t,a,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return H(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var a=4===r.i||5===r.i?r.o=C(r.k):r.o;w(3===r.i?new Set(a):a,(function(t,i){return G(e,r,a,t,i,n)})),H(e,a,!1),n&&e.u&&D("Patches").R(r,n,e.u,e.s)}return r.o}function G(e,t,n,r,a,i){if(b(a)){var o=z(e,a,i&&t&&3!==t.i&&!x(t.D,r)?i.concat(r):void 0);if(S(n,r,o),!b(o))return;e.m=!1}if(v(a)&&!I(a)){if(!e.h.F&&e._<1)return;z(e,a),t&&t.A.l||H(e,a)}}function H(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&P(t,n)}function W(e,t){var n=e[se];return(n?O(n):e)[t]}function V(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=C(e.t))}function Y(e,t,n){var r=E(t)?D("MapSet").N(t,n):A(t)?D("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},a=r,i=fe;n&&(a=[r],i=he);var o=Proxy.revocable(a,i),s=o.revoke,c=o.proxy;return r.k=c,r.j=s,c}(t,n):D("ES5").J(t,n);return(n?n.A:M()).p.push(r),r}function K(e){return b(e)||g(22,e),function e(t){if(!v(t))return t;var n,r=t[se],a=_(t);if(r){if(!r.P&&(r.i<4||!D("ES5").K(r)))return r.t;r.I=!0,n=Q(t,a),r.I=!1}else n=Q(t,a);return w(n,(function(t,a){r&&T(r.t,t)===a||S(n,t,e(a))})),3===a?new Set(n):n}(e)}function Q(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return C(e)}function X(){function e(e,t){function n(){this.constructor=e}a(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=Y(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)})))}function r(e){e.O&&g(3,JSON.stringify(O(e)))}var a=function(e,t){return(a=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)},i=function(){function n(e,t){return this[se]={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 a=n.prototype;return Object.defineProperty(a,"size",{get:function(){return O(this[se]).size}}),a.has=function(e){return O(this[se]).has(e)},a.set=function(e,n){var a=this[se];return r(a),O(a).has(e)&&O(a).get(e)===n||(t(a),q(a),a.D.set(e,!0),a.o.set(e,n),a.D.set(e,!0)),this},a.delete=function(e){if(!this.has(e))return!1;var n=this[se];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},a.clear=function(){var e=this[se];r(e),O(e).size&&(t(e),q(e),e.D=new Map,w(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},a.forEach=function(e,t){var n=this;O(this[se]).forEach((function(r,a){e.call(t,n.get(a),a,n)}))},a.get=function(e){var n=this[se];r(n);var a=O(n).get(e);if(n.I||!v(a))return a;if(a!==n.t.get(e))return a;var i=Y(n.A.h,a,n);return t(n),n.o.set(e,i),i},a.keys=function(){return O(this[se]).keys()},a.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},a.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},a[ce]=function(){return this.entries()},n}(),o=function(){function t(e,t){return this[se]={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 a=t.prototype;return Object.defineProperty(a,"size",{get:function(){return O(this[se]).size}}),a.has=function(e){var t=this[se];return r(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},a.add=function(e){var t=this[se];return r(t),this.has(e)||(n(t),q(t),t.o.add(e)),this},a.delete=function(e){if(!this.has(e))return!1;var t=this[se];return r(t),n(t),q(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},a.clear=function(){var e=this[se];r(e),O(e).size&&(n(e),q(e),e.o.clear())},a.values=function(){var e=this[se];return r(e),n(e),e.o.values()},a.entries=function(){var e=this[se];return r(e),n(e),e.o.entries()},a.keys=function(){return this.values()},a[ce]=function(){return this.values()},a.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}();j("MapSet",{N:function(e,t){return new i(e,t)},T:function(e,t){return new o(e,t)}})}(0,s.__decorate)([d.QL,(0,s.__param)(0,(0,p.Oh)("userAddress")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Array)],y.prototype,"mint",null);var J,ee,te="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),ne="undefined"!=typeof Map,re="undefined"!=typeof Set,ae="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,ie=te?Symbol.for("immer-nothing"):((J={})["immer-nothing"]=!0,J),oe=te?Symbol.for("immer-draftable"):"__$immer_draftable",se=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},pe={},fe={get:function(e,t){if(t===se)return e;var n=O(e);if(!x(n,t))return function(e,t,n){var r,a=V(t,n);return a?"value"in a?a.value:null===(r=a.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===W(e.t,t)?($(e),e.o[t]=Y(e.A.h,r,e)):r},has:function(e,t){return t in O(e)},ownKeys:function(e){return Reflect.ownKeys(O(e))},set:function(e,t,n){var r=V(O(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var a=W(O(e),t),i=null==a?void 0:a[se];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(k(n,a)&&(void 0!==n||x(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!==W(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=O(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(){g(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){g(12)}},he={};w(fe,(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 fe.set.call(this,e[0],t,n,e[0])};var me=function(){function e(e){var t=this;this.g=ae,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var a=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=a);for(var r=arguments.length,o=Array(r>1?r-1:0),s=1;s1?r-1:0),i=1;i=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 a=D("Patches").$;return b(e)?a(e,t):this.produce(e,(function(e){return a(e,t)}))},e}(),ye=new me,ge=ye.produce,be=(ye.produceWithPatches.bind(ye),ye.setAutoFreeze.bind(ye),ye.setUseProxies.bind(ye),ye.applyPatches.bind(ye),ye.createDraft.bind(ye),ye.finishDraft.bind(ye),n(25298));const ve=e=>{let t;const n=new Set,r=(e,r)=>{const a="function"===typeof e?e(t):e;if(!Object.is(a,t)){const e=t;t=(null!=r?r:"object"!==typeof a)?a:Object.assign({},t,a),n.forEach((n=>n(t,e)))}},a=()=>t,i={setState:r,getState:a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,a,i),i};var we=n(67294),_e=n(52798);const{useSyncExternalStoreWithSelector:xe}=_e;const Te=e=>{const t="function"===typeof e?(e=>e?ve(e):ve)(e):e,n=(e,n)=>function(e,t=e.getState,n){const r=xe(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return(0,we.useDebugValue)(r),r}(t,e,n);return Object.assign(n,t),n},Se=(e,t={})=>(n,r,a)=>{const{enabled:i,anonymousActionType:o,...s}=t;let c;try{c=(null==i||i)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return i&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,a);const u=c.connect(s);let l=!0;a.setState=(e,t,a)=>{const i=n(e,t);return l?(u.send(void 0===a?{type:o||"anonymous"}:"string"===typeof a?{type:a}:a,r()),i):i};const d=(...e)=>{const t=l;l=!1,n(...e),l=t},p=e(a.setState,r,a);if(u.init(p),a.dispatchFromDevtools&&"function"===typeof a.dispatch){let e=!1;const t=a.dispatch;a.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"):ke(e.payload,(e=>{"__setState"!==e.type?a.dispatchFromDevtools&&"function"===typeof a.dispatch&&a.dispatch(e):d(e.state)}));case"DISPATCH":switch(e.payload.type){case"RESET":return d(p),u.init(a.getState());case"COMMIT":return u.init(a.getState());case"ROLLBACK":return ke(e.state,(e=>{d(e),u.init(a.getState())}));case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return ke(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}})),p},ke=(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)},Ee=e=>(t,n,r)=>{const a=r.subscribe;r.subscribe=(e,t,n)=>{let i=e;if(t){const a=(null==n?void 0:n.equalityFn)||Object.is;let o=e(r.getState());i=n=>{const r=e(n);if(!a(o,r)){const e=o;t(o=r,e)}},(null==n?void 0:n.fireImmediately)&&t(o,o)}return a(i)};return e(t,n,r)};var Ae=n(8891),Oe=n.n(Ae);function Ce(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 Pe(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 a=t().ghoReserveData,i=t().ghoUserData,o=Number((0,Ze.Fv)(i.userGhoScaledBorrowBalance,18)),s=Number((0,Ze.Fv)(a.ghoMinDebtTokenBalanceForDiscount,18)),c=Number((0,Ze.Fv)(i.userDiscountTokenBalance,18)),u=Number((0,Ze.Fv)(a.ghoMinDiscountTokenBalanceForDiscount,18));return o+Number(e)>=s&&c>=u},ghoMarketConfig:function(){var e=t().currentMarket;if(Ue.uF.includes(e)){var n=t().currentMarketData.addresses,r=n.GHO_TOKEN_ADDRESS,a=n.GHO_UI_DATA_PROVIDER;if(r&&a)return{ghoTokenAddress:r,uiGhoDataProviderAddress:a}}},refreshGhoData:function(){var n=(0,r.Z)(o().mark((function n(){var r,a,i,s,c,u,l,d;return o().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(a=t().account,i=new Be({provider:(0,be.VH)(t().currentMarketData.chainId),uiGhoDataProviderAddress:r.uiGhoDataProviderAddress}),!a){n.next=21;break}return n.prev=6,n.next=9,Promise.all([i.getGhoReserveData(),i.getGhoUserData(a)]);case 9:s=n.sent,c=(0,De.Z)(s,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,i.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(16441);class Ge{static connect(e,t){return new f.CH(e,He,t)}}const He=[{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=[],a=this.getContractInstance(n),i=await this.getDelegateeAddress(t),o=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.delegate(i),from:e});return r.push({tx:o,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(r,o)}),r}async delegateByType({user:e,delegatee:t,delegationType:n,governanceToken:r}){const a=[],i=this.getContractInstance(r),o=await this.getDelegateeAddress(t),s=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.delegateByType(o,n),from:e});return a.push({tx:s,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(a,s)}),a}async delegateBySig({user:e,delegatee:t,expiry:n,signature:r,governanceToken:a}){const i=[],o=this.getContractInstance(a),s=await this.getNonce({user:e,governanceToken:a}),{v:c,r:l,s:d}=(0,ze.splitSignature)(r),p=await this.getDelegateeAddress(t),f=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.delegateBySig(p,s,n,c,l,d),from:e});return i.push({tx:f,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(i,f)}),i}async delegateByTypeBySig({user:e,delegatee:t,delegationType:n,expiry:r,signature:a,governanceToken:i}){const o=[],s=this.getContractInstance(i),c=await this.getNonce({user:e,governanceToken:i}),{v:l,r:d,s:p}=(0,ze.splitSignature)(a),f=await this.getDelegateeAddress(t),h=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.delegateByTypeBySig(f,n,c,r,l,d,p),from:e});return o.push({tx:h,txType:u.ns.GOV_DELEGATION_ACTION,gas:this.generateTxPriceEstimation(o,h)}),o}async prepareDelegateSignature({delegatee:e,nonce:t,expiry:n,governanceTokenName:r,governanceToken:a}){const i=await this.getDelegateeAddress(e),{chainId:o}=await this.provider.getNetwork(),s={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:o,verifyingContract:a},message:{delegatee:i,nonce:t,expiry:n}};return JSON.stringify(s)}async prepareDelegateByTypeSignature({delegatee:e,type:t,nonce:n,expiry:r,governanceTokenName:a,governanceToken:i}){const o=await this.getDelegateeAddress(e),{chainId:s}=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:a,version:"1",chainId:s,verifyingContract:i},message:{delegatee:o,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 a=this.getContractInstance(r);return(await a.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,s.__decorate)([d.Sm,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Il)("delegatee")),(0,s.__param)(0,(0,p.Oh)("governanceToken")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],We.prototype,"delegate",null),(0,s.__decorate)([d.Sm,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Il)("delegatee")),(0,s.__param)(0,(0,p.Oh)("governanceToken")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],We.prototype,"delegateByType",null),(0,s.__decorate)([d.Sm,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Il)("delegatee")),(0,s.__param)(0,(0,p.Oh)("governanceToken")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],We.prototype,"delegateBySig",null),(0,s.__decorate)([d.Sm,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Il)("delegatee")),(0,s.__param)(0,(0,p.Oh)("governanceToken")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],We.prototype,"delegateByTypeBySig",null),(0,s.__decorate)([d.Sm,(0,s.__param)(0,(0,p.Il)("delegatee")),(0,s.__param)(0,(0,p.Oh)("governanceToken")),(0,s.__param)(0,(0,p.rX)("nonce")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],We.prototype,"prepareDelegateSignature",null),(0,s.__decorate)([d.Sm,(0,s.__param)(0,(0,p.Il)("delegatee")),(0,s.__param)(0,(0,p.Oh)("governanceToken")),(0,s.__param)(0,(0,p.rX)("nonce")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],We.prototype,"prepareDelegateByTypeSignature",null),(0,s.__decorate)([d.Sm,(0,s.__param)(0,(0,p.Oh)("delegator")),(0,s.__param)(0,(0,p.Oh)("governanceToken")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],We.prototype,"getDelegateeByType",null),(0,s.__decorate)([d.Sm,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("governanceToken")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],We.prototype,"getPowerCurrent",null),(0,s.__decorate)([d.Sm,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("governanceToken")),(0,s.__param)(0,(0,p.K5)("blockNumber")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],We.prototype,"getPowerAtBlock",null),(0,s.__decorate)([d.Sm,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("governanceToken")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],We.prototype,"getNonce",null);var Ve=n(24387);const qe=[{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 $e{static createInterface(){return new Me.vU(qe)}static connect(e,t){return new f.CH(e,qe,t)}}$e.abi=qe;class Ye extends c.Z{constructor(e){super(e,$e),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,s.__decorate)([d.JZ,(0,s.__param)(0,(0,p.Oh)("token")),(0,s.__param)(0,(0,p.Oh)("owner")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Ye.prototype,"getNonce",null);var Ke=n(45626);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 Xe(e){for(var t=1;t{if(!(0,je.isAddress)(e))throw new Error("tokenAddress is not valid");return this._registryContract.latestRoundData(e,nt[t])},this.decimals=async(e,t)=>{if(!(0,je.isAddress)(e))throw new Error("tokenAddress is not valid");return this._registryContract.decimals(e,nt[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,je.isAddress)(t))throw new Error("contract address is not valid");this._registryContract=class{static connect(e,t){return new f.CH(e,et,t)}}.connect(t,e)}}const at=[{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 it{static createInterface(){return new Me.vU(at)}static connect(e,t){return new f.CH(e,at,t)}}it.abi=at;class ot extends c.Z{constructor({provider:e,uiIncentiveDataProviderAddress:t,chainId:n}){super(e,it),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=tt.eth}){const r=await this.getReservesIncentivesDataHumanized({lendingPoolAddressProvider:e}),a=[];if(t&&(0,je.isAddress)(t)){this._chainlinkFeedsRegistries[t]||(this._chainlinkFeedsRegistries[t]=new rt({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 i=Array.from(e).map((e=>this._getFeed(e,t,n)));(await Promise.allSettled(i)).forEach((e=>{"fulfilled"===e.status&&a.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=a.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=a.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=a.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})))}}}(0,s.__decorate)([d.Z,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("lendingPoolAddressProvider")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],ot.prototype,"getFullReservesIncentiveData",null),(0,s.__decorate)([d.Z,(0,s.__param)(0,(0,p.Oh)("lendingPoolAddressProvider")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],ot.prototype,"getReservesIncentivesData",null),(0,s.__decorate)([d.Z,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("lendingPoolAddressProvider")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],ot.prototype,"getUserReservesIncentivesData",null),(0,s.__decorate)([d.Z,(0,s.__param)(0,(0,p.Oh)("lendingPoolAddressProvider")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],ot.prototype,"getReservesIncentivesDataHumanized",null),(0,s.__decorate)([d.Z,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("lendingPoolAddressProvider")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],ot.prototype,"getUserReservesIncentivesDataHumanized",null),(0,s.__decorate)([d.Z,(0,s.__param)(0,(0,p.Oh)("lendingPoolAddressProvider")),(0,s.__param)(0,(0,p.Oh)("chainlinkFeedsRegistry")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],ot.prototype,"getIncentivesDataWithPriceLegacy",null);var st=function(e,t){return{refreshIncentiveData:function(){var n=(0,r.Z)(o().mark((function n(){var r,a,i,s,c;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t().account,a=t().currentMarketData,i=t().currentChainId,a.addresses.UI_INCENTIVE_DATA_PROVIDER){n.next=5;break}return n.abrupt("return");case 5:return s=new ot({uiIncentiveDataProviderAddress:a.addresses.UI_INCENTIVE_DATA_PROVIDER,provider:t().jsonRpcProvider(),chainId:i}),c=[],n.prev=7,c.push(s.getReservesIncentivesDataHumanized({lendingPoolAddressProvider:a.addresses.LENDING_POOL_ADDRESS_PROVIDER}).then((function(t){return e({reserveIncentiveData:t})}))),r&&c.push(s.getUserReservesIncentivesDataHumanized({lendingPoolAddressProvider:a.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)}}()}},ct=function(e){return{mobileDrawerOpen:!1,setMobileDrawerOpen:function(t){e({mobileDrawerOpen:t})},gaslessEnabled:!0,setGaslessEnabled:function(t){e({gaslessEnabled:t})}}},ut=n(84243),lt=n(21046),dt=n(2593),pt=n(61744);class ft{static connect(e,t){return new f.CH(e,ht,t)}static createInterface(){return new Me.vU(ht)}}const ht=[{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:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];class mt extends c.Z{constructor(e){super(e,ft),this.tokenDecimals={},this.tokenMetadata={},this.approve=this.approve.bind(this),this.approveTxData=this.approveTxData.bind(this),this.isApproved=this.isApproved.bind(this),this.getTokenData=this.getTokenData.bind(this),this.decimalsOf=this.decimalsOf.bind(this),this.contractInterface=ft.createInterface()}approve({user:e,token:t,spender:n,amount:r}){const a=this.getContractInstance(t),i=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.approve(n,r),from:e});return{tx:i,txType:u.ns.ERC20_APPROVAL,gas:this.generateTxPriceEstimation([],i)}}approveTxData({user:e,token:t,spender:n,amount:r}){const a={},i=this.contractInterface.encodeFunctionData("approve",[n,r]);return a.data=i,a.to=t,a.from=e,a.gasLimit=dt.O$.from(l.eB[u.UQ.approval].recommended),a}async isApproved({user:e,token:t,spender:n,amount:r,nativeDecimals:a}){if(t.toLowerCase()===l.hP.toLowerCase())return!0;const i=await this.decimalsOf(t),o=this.getContractInstance(t),s=await o.allowance(e,n),c="-1"===r?dt.O$.from(l.Od):dt.O$.from((0,l.gU)(a?(0,je.formatUnits)(r,i):r,i));return s.gte(c)}async approvedAmount({user:e,token:t,spender:n}){if(t.toLowerCase()===l.hP.toLowerCase())return-1;const r=this.getContractInstance(t),a=await r.allowance(e,n);if(a.toString()===l.ke)return-1;const i=await this.decimalsOf(t);return Number(pt.formatUnits(a,i))}async decimalsOf(e){if(e.toLowerCase()===l.hP.toLowerCase())return 18;if(!this.tokenDecimals[e]){const t=this.getContractInstance(e);this.tokenDecimals[e]=await t.decimals()}return this.tokenDecimals[e]}async getTokenData(e){if(e.toLowerCase()===l.hP.toLowerCase())return{name:"Ethereum",symbol:"ETH",decimals:18,address:e};if(e.toLowerCase()==="0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2".toLowerCase())return{name:"Maker",symbol:"MKR",decimals:18,address:e};if(!this.tokenMetadata[e]){const{name:t,symbol:n}=this.getContractInstance(e),[r,a,i]=await Promise.all([t(),n(),this.decimalsOf(e)]);this.tokenMetadata[e]={name:r,symbol:a,decimals:i,address:e}}return this.tokenMetadata[e]}}(0,s.__decorate)([d.JZ,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("token")),(0,s.__param)(0,(0,p.Oh)("spender")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Object)],mt.prototype,"approve",null),(0,s.__decorate)([d.JZ,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("token")),(0,s.__param)(0,(0,p.Oh)("spender")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Object)],mt.prototype,"approveTxData",null),(0,s.__decorate)([d.JZ,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("token")),(0,s.__param)(0,(0,p.Oh)("spender")),(0,s.__param)(0,(0,p.lw)("amount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],mt.prototype,"isApproved",null),(0,s.__decorate)([d.JZ,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("token")),(0,s.__param)(0,(0,p.Oh)("spender")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],mt.prototype,"approvedAmount",null),(0,s.__decorate)([d.JZ,(0,s.__param)(0,(0,p.Oh)()),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[String]),(0,s.__metadata)("design:returntype",Promise)],mt.prototype,"decimalsOf",null),(0,s.__decorate)([d.JZ,(0,s.__param)(0,(0,p.Oh)()),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[String]),(0,s.__metadata)("design:returntype",Promise)],mt.prototype,"getTokenData",null);class yt{static connect(e,t){return new f.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 bt(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 vt extends c.Z{constructor(e,t){super(e,yt),this.liquiditySwapAdapterAddress=null!==t&&void 0!==t?t:"",this.swapAndDeposit=this.swapAndDeposit.bind(this)}swapAndDeposit({user:e,assetToSwapFrom:t,assetToSwapTo:n,amountToSwap:r,minAmountToReceive:a,permitParams:i,augustus:o,swapCallData:s,swapAll:c},l){const d=this.getContractInstance(this.liquiditySwapAdapterAddress),p=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.swapAndDeposit(t,n,r,a,c?bt(s):0,s,o,i),from:e});return{tx:p,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(null!==l&&void 0!==l?l:[],p,u.UQ.swapCollateral)}}}(0,s.__decorate)([d.cJ,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("assetToSwapFrom")),(0,s.__param)(0,(0,p.Oh)("assetToSwapTo")),(0,s.__param)(0,(0,p.Oh)("augustus")),(0,s.__param)(0,(0,p.K5)("amountToSwap")),(0,s.__param)(0,(0,p.K5)("minAmountToReceive")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object,Array]),(0,s.__metadata)("design:returntype",Object)],vt.prototype,"swapAndDeposit",null);const wt=[{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"}],_t="0x6101006040523480156200001257600080fd5b506040516200333638038062003336833981016040819052620000359162000263565b81818180806001600160a01b03166080816001600160a01b031681525050806001600160a01b031663026b1d5f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000092573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b89190620002a2565b6001600160a01b031660a05250600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350806001600160a01b031663fca513a86040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000145573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016b9190620002a2565b6001600160a01b0390811660c05260405163fb04e17b60e01b815260006004820152908316915063fb04e17b90602401602060405180830381865afa158015620001b9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001df9190620002c9565b15620002315760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420612076616c6964204175677573747573206164647265737300000000604482015260640160405180910390fd5b6001600160a01b031660e05250506001805550620002ed565b6001600160a01b03811681146200026057600080fd5b50565b600080604083850312156200027757600080fd5b825162000284816200024a565b602084015190925062000297816200024a565b809150509250929050565b600060208284031215620002b557600080fd5b8151620002c2816200024a565b9392505050565b600060208284031215620002dc57600080fd5b81518015158114620002c257600080fd5b60805160a05160c05160e051612fa06200039660003960008181610176015261111801526000818161014f015261237b0152600081816101b8015281816104bb015281816105750152818161064b015281816106e50152818161079f0152818161087501528181610a7001528181611a6801528181611b2601528181611bfe01528181611cc301528181611d5e01528181611fc6015261217b0152600060e70152612fa06000f3fe608060405234801561001057600080fd5b50600436106100c85760003560e01c80634db9dc97116100815780638da5cb5b1161005b5780638da5cb5b146101da578063920f5c84146101f8578063f2fde38b1461021b57600080fd5b80634db9dc9714610198578063715018a6146101ab5780637535d246146101b357600080fd5b806332e4b286116100b257806332e4b2861461013357806338013f021461014a5780633a8298671461017157600080fd5b8062ae3bf8146100cd5780630542975c146100e2575b600080fd5b6100e06100db366004612585565b61022e565b005b6101097f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61013c610bb881565b60405190815260200161012a565b6101097f000000000000000000000000000000000000000000000000000000000000000081565b6101097f000000000000000000000000000000000000000000000000000000000000000081565b6100e06101a63660046125eb565b610385565b6100e06108f4565b6101097f000000000000000000000000000000000000000000000000000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff16610109565b61020b6102063660046126f9565b6109e4565b604051901515815260200161012a565b6100e0610229366004612585565b610c31565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103826102d660005473ffffffffffffffffffffffffffffffffffffffff1690565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610340573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036491906127d4565b73ffffffffffffffffffffffffffffffffffffffff84169190610de2565b50565b600260015414156103f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ab565b60026001556104048886868933610ebb565b955061042089338961041b3686900386018661291f565b61108e565b60006104688585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e91508d90508c6110b4565b90506000610476828a61296a565b905080156106a8576040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301528c169063095ea7b3906044016020604051808303816000875af1158015610513573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105379190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390528c169063095ea7b3906044016020604051808303816000875af11580156105cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f19190612981565b506040517fe8eda9df00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8c8116600483015260248201839052336044830152600060648301527f0000000000000000000000000000000000000000000000000000000000000000169063e8eda9df90608401600060405180830381600087803b15801561068f57600080fd5b505af11580156106a3573d6000803e3d6000fd5b505050505b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301528b169063095ea7b3906044016020604051808303816000875af115801561073d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107619190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018a90528b169063095ea7b3906044016020604051808303816000875af11580156107f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081b9190612981565b506040517f573ade8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152602482018a9052604482018990523360648301527f0000000000000000000000000000000000000000000000000000000000000000169063573ade81906084016020604051808303816000875af11580156108be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e291906127d4565b50506001805550505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102ab565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600060026001541415610a53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ab565b60026001553373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610af7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f43414c4c45525f4d5553545f42455f504f4f4c0000000000000000000000000060448201526064016102ab565b600189148015610b075750600187145b8015610b135750600185145b610b9f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f464c4153484c4f414e5f4d554c5449504c455f4153534554535f4e4f545f535560448201527f50504f525445440000000000000000000000000000000000000000000000000060648201526084016102ab565b600088886000818110610bb457610bb46129a3565b905060200201359050600087876000818110610bd257610bd26129a3565b905060200201359050600086905060008d8d6000818110610bf557610bf56129a3565b9050602002016020810190610c0a9190612585565b9050610c1a8787858585896119ed565b505060018080559c9b505050505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610cb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102ab565b73ffffffffffffffffffffffffffffffffffffffff8116610d55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102ab565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff84166004830152602482018390529060008060448382895af1610e45573d6000803e3d6000fd5b50610e4f84611e35565b610eb5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f475076323a206661696c6564207472616e73666572000000000000000000000060448201526064016102ab565b50505050565b600080610ec787611f01565b905060006001876002811115610edf57610edf6129d2565b6002811115610ef057610ef06129d2565b14610f0057816101400151610f07565b8161012001515b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301529192506000918316906370a0823190602401602060405180830381865afa158015610f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9d91906127d4565b90508615611017578581111561100f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f494e53554646494349454e545f414d4f554e545f544f5f52455041590000000060448201526064016102ab565b809550611081565b80861115611081576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f494e56414c49445f444542545f52455041595f414d4f554e540000000000000060448201526064016102ab565b5093979650505050505050565b600061109985611f01565b610100015190506110ad8582868686612038565b5050505050565b6000806000878060200190518101906110cd9190612a73565b6040517ffb04e17b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301529294509092507f00000000000000000000000000000000000000000000000000000000000000009091169063fb04e17b90602401602060405180830381865afa158015611161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111859190612981565b6111eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f494e56414c49445f41554755535455530000000000000000000000000000000060448201526064016102ab565b60006111f688612251565b60ff169050600061120688612251565b60ff16905060006112168a612333565b905060006112238a612333565b9050600061127b611238612710610bb86123e8565b61127561125061124988600a612c26565b87906123f8565b61126f6112686112618b600a612c26565b88906123f8565b8e906123f8565b90612422565b90612435565b9050808a111561130d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f6d6178416d6f756e74546f5377617020657863656564206d617820736c69707060448201527f616765000000000000000000000000000000000000000000000000000000000060648201526084016102ab565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000935073ffffffffffffffffffffffffffffffffffffffff8b1692506370a082319150602401602060405180830381865afa15801561137f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a391906127d4565b90508581101561140f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f494e53554646494349454e545f42414c414e43455f4245464f52455f5357415060448201526064016102ab565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8916906370a0823190602401602060405180830381865afa15801561147c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a091906127d4565b905060008373ffffffffffffffffffffffffffffffffffffffff1663d2c4b5986040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115139190612c42565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808316600483015260006024830152919250908b169063095ea7b3906044016020604051808303816000875af115801561158c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b09190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152602482018a90528b169063095ea7b3906044016020604051808303816000875af1158015611626573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164a9190612981565b508b156116dd5760048c1015801561166e5750845161166a906020612478565b8c11155b6116d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f544f5f414d4f554e545f4f46465345545f4f55545f4f465f52414e474500000060448201526064016102ab565b8660208d018601525b60008473ffffffffffffffffffffffffffffffffffffffff16866040516117049190612c5f565b6000604051808303816000865af19150503d8060008114611741576040519150601f19603f3d011682016040523d82523d6000602084013e611746565b606091505b5050905080611759573d6000803e3d6000fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8d16906370a0823190602401602060405180830381865afa1580156117c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ea91906127d4565b90506117f6818661296a565b975089881115611862576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f57524f4e475f42414c414e43455f41465445525f53574150000000000000000060448201526064016102ab565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906118ff90869073ffffffffffffffffffffffffffffffffffffffff8f16906370a0823190602401602060405180830381865afa1580156118d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f991906127d4565b90612478565b90508981101561196b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f494e53554646494349454e545f414d4f554e545f52454345495645440000000060448201526064016102ab565b8b73ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff167fbf77fd13a39d14dc0da779342c14105c38d9a5d0c60f2caa22f5fd1d5525416d8b846040516119d3929190918252602082015260400190565b60405180910390a350505050505050509695505050505050565b60008080808080611a008b8d018d612c7b565b955095509550955095509550611a19868486888d610ebb565b94506000611a2b85848b8a8c8b6110b4565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301529192509088169063095ea7b3906044016020604051808303816000875af1158015611ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae89190612981565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660048301526024820188905288169063095ea7b3906044016020604051808303816000875af1158015611b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba29190612981565b506040517f573ade8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015260248201889052604482018690528b811660648301527f0000000000000000000000000000000000000000000000000000000000000000169063573ade81906084016020604051808303816000875af1158015611c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6b91906127d4565b506000611c78828d6123e8565b9050611c868a8c838661108e565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152600060248301528b169063095ea7b3906044016020604051808303816000875af1158015611d1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d3f9190612981565b508973ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f0000000000000000000000000000000000000000000000000000000000000000611d908f8d6123e890919063ffffffff16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044016020604051808303816000875af1158015611e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e249190612981565b505050505050505050505050505050565b6000611e75565b7f08c379a00000000000000000000000000000000000000000000000000000000060005260206004528060245250806044525060646000fd5b3d8015611eb45760208114611eee57611eaf7f475076323a206d616c666f726d6564207472616e7366657220726573756c7400601f611e3c565b611efb565b823b611ee557611ee57f475076323a206e6f74206120636f6e74726163740000000000000000000000006014611e3c565b60019150611efb565b3d6000803e600051151591505b50919050565b604080516102008101825260006101e08201818152825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c08101919091526040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa15801561200e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120329190612dc0565b92915050565b60208101511561210557805160208201516040808401516060850151608086015192517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301523060248301526044820196909652606481019490945260ff909116608484015260a483015260c48201529085169063d505accf9060e401600060405180830381600087803b1580156120ec57600080fd5b505af1158015612100573d6000803e3d6000fd5b505050505b61212773ffffffffffffffffffffffffffffffffffffffff8516843085612488565b6040517f69328dec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301526024820184905230604483015283917f0000000000000000000000000000000000000000000000000000000000000000909116906369328dec906064016020604051808303816000875af11580156121c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121ea91906127d4565b146110ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f554e45585045435445445f414d4f554e545f57495448445241574e000000000060448201526064016102ab565b6000808273ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561229f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c39190612ee3565b9050604d8160ff161115612032576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f544f4f5f4d414e595f444543494d414c535f4f4e5f544f4b454e00000000000060448201526064016102ab565b6040517fb3596f0700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063b3596f0790602401602060405180830381865afa1580156123c4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203291906127d4565b8082018281101561203257600080fd5b60008215806124195750508181028183828161241657612416612f00565b04145b61203257600080fd5b600061242e8284612f2f565b9392505050565b600081157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec778390048411151761246a57600080fd5b506127109102611388010490565b8082038281111561203257600080fd5b6040517f23b872dd0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8581166004840152841660248301526044820183905290600080606483828a5af16124f3573d6000803e3d6000fd5b506124fd85611e35565b6110ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a206661696c6564207472616e7366657246726f6d0000000000000060448201526064016102ab565b73ffffffffffffffffffffffffffffffffffffffff8116811461038257600080fd5b60006020828403121561259757600080fd5b813561242e81612563565b60008083601f8401126125b457600080fd5b50813567ffffffffffffffff8111156125cc57600080fd5b6020830191508360208285010111156125e457600080fd5b9250929050565b6000806000806000806000806000898b0361018081121561260b57600080fd5b8a3561261681612563565b995060208b013561262681612563565b985060408b0135975060608b0135965060808b0135955060a08b0135945060c08b013567ffffffffffffffff81111561265e57600080fd5b61266a8d828e016125a2565b90955093505060a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20820112156126a057600080fd5b5060e08a0190509295985092959850929598565b60008083601f8401126126c657600080fd5b50813567ffffffffffffffff8111156126de57600080fd5b6020830191508360208260051b85010111156125e457600080fd5b600080600080600080600080600060a08a8c03121561271757600080fd5b893567ffffffffffffffff8082111561272f57600080fd5b61273b8d838e016126b4565b909b50995060208c013591508082111561275457600080fd5b6127608d838e016126b4565b909950975060408c013591508082111561277957600080fd5b6127858d838e016126b4565b909750955060608c0135915061279a82612563565b90935060808b013590808211156127b057600080fd5b506127bd8c828d016125a2565b915080935050809150509295985092959850929598565b6000602082840312156127e657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516101e0810167ffffffffffffffff81118282101715612840576128406127ed565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561288d5761288d6127ed565b604052919050565b60ff8116811461038257600080fd5b600060a082840312156128b657600080fd5b60405160a0810181811067ffffffffffffffff821117156128d9576128d96127ed565b8060405250809150823581526020830135602082015260408301356128fd81612895565b8060408301525060608301356060820152608083013560808201525092915050565b600060a0828403121561293157600080fd5b61242e83836128a4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561297c5761297c61293b565b500390565b60006020828403121561299357600080fd5b8151801515811461242e57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600067ffffffffffffffff821115612a1b57612a1b6127ed565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60005b83811015612a62578181015183820152602001612a4a565b83811115610eb55750506000910152565b60008060408385031215612a8657600080fd5b825167ffffffffffffffff811115612a9d57600080fd5b8301601f81018513612aae57600080fd5b8051612ac1612abc82612a01565b612846565b818152866020838501011115612ad657600080fd5b612ae7826020830160208601612a47565b8094505050506020830151612afb81612563565b809150509250929050565b600181815b80851115612b5f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612b4557612b4561293b565b80851615612b5257918102915b93841c9390800290612b0b565b509250929050565b600082612b7657506001612032565b81612b8357506000612032565b8160018114612b995760028114612ba357612bbf565b6001915050612032565b60ff841115612bb457612bb461293b565b50506001821b612032565b5060208310610133831016604e8410600b8410161715612be2575081810a612032565b612bec8383612b06565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612c1e57612c1e61293b565b029392505050565b600061242e8383612b67565b8051612c3d81612563565b919050565b600060208284031215612c5457600080fd5b815161242e81612563565b60008251612c71818460208701612a47565b9190910192915050565b6000806000806000806101408789031215612c9557600080fd5b8635612ca081612563565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff811115612cd157600080fd5b8701601f81018913612ce257600080fd5b8035612cf0612abc82612a01565b8181528a6020838501011115612d0557600080fd5b81602084016020830137600060208383010152809450505050612d2b8860a089016128a4565b90509295509295509295565b600060208284031215612d4957600080fd5b6040516020810181811067ffffffffffffffff82111715612d6c57612d6c6127ed565b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114612c3d57600080fd5b805164ffffffffff81168114612c3d57600080fd5b805161ffff81168114612c3d57600080fd5b60006101e08284031215612dd357600080fd5b612ddb61281c565b612de58484612d37565b8152612df360208401612d79565b6020820152612e0460408401612d79565b6040820152612e1560608401612d79565b6060820152612e2660808401612d79565b6080820152612e3760a08401612d79565b60a0820152612e4860c08401612d99565b60c0820152612e5960e08401612dae565b60e0820152610100612e6c818501612c32565b90820152610120612e7e848201612c32565b90820152610140612e90848201612c32565b90820152610160612ea2848201612c32565b90820152610180612eb4848201612d79565b908201526101a0612ec6848201612d79565b908201526101c0612ed8848201612d79565b908201529392505050565b600060208284031215612ef557600080fd5b815161242e81612895565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612f65577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea26469706673582212201ae79dd35f34ecf1387bee8e87022a83fa61b3a7ba8b1ecade15267edadaceb264736f6c634300080a0033";class xt extends f.lV{constructor(e){super(wt,_t,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 Me.vU(wt)}static connect(e,t){return new f.CH(e,wt,t)}}xt.bytecode=_t,xt.abi=wt;class Tt 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:a,repayAll:i,permitParams:o,swapAndRepayCallData:s,user:c,augustus:d},p){const f=a===u.tk.Stable?1:2,h=this.getContractInstance(this.repayWithCollateralAddress),m=ut.$.encode(["bytes","address"],[s,d]),y=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.swapAndRepay(e,t,n,r,f,i?(0,l.mz)(s):0,m,o),from:c});return{tx:y,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(null!==p&&void 0!==p?p:[],y,u.UQ.repayCollateral)}}}(0,s.__decorate)([d.mB,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("collateralAsset")),(0,s.__param)(0,(0,p.Oh)("debtAsset")),(0,s.__param)(0,(0,p.K5)("collateralAmount")),(0,s.__param)(0,(0,p.K5)("debtRepayAmount")),(0,s.__param)(0,(0,p.Oh)("augustus")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object,Array]),(0,s.__metadata)("design:returntype",Object)],Tt.prototype,"swapAndRepay",null);var St=n(84707);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 Et{static createInterface(){return new Me.vU(kt)}static connect(e,t){return new f.CH(e,kt,t)}}Et.abi=kt;const At=[{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 Ot{static createInterface(){return new Me.vU(At)}static connect(e,t){return new f.CH(e,At,t)}}Ot.abi=At;const Ct=[{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"}],Pt="0x60a060405234801561001057600080fd5b5060405161143138038061143183398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516113606100d16000396000818161016b0152818161027e015281816103760152818161043f015281816105180152818161062e0152818161073c015281816107fc0152818161094101528181610a700152610b5501526113606000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806388d5185211610081578063b76398e41161005b578063b76398e414610200578063fc0eed8514610213578063fed63a931461022157600080fd5b806388d51852146101b25780638da7fb18146101da5780639d2ffc1b146101ed57600080fd5b80635cc7bc10116100b25780635cc7bc1014610125578063671a7fae146101385780637535d2461461016657600080fd5b80631a64acf2146100d95780631a8f6dee146100ff5780631fd3479714610112575b600080fd5b6100ec6100e7366004610e66565b610234565b6040519081526020015b60405180910390f35b6100ec61010d366004610eb0565b61032c565b6100ec610120366004610ee9565b6103f5565b6100ec610133366004610ee9565b6104ce565b61014b610146366004610f2b565b6105e0565b604080519384526020840192909252908201526060016100f6565b61018d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f6565b6101c56101c0366004610fa9565b6106f0565b604080519283526020830191909152016100f6565b6100ec6101e836600461100d565b6108e2565b6100ec6101fb36600461100d565b6108f7565b6100ec61020e366004611042565b610a26565b6100ec61010d366004611084565b61014b61022f3660046110b9565b610b07565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff858116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ea9190611207565b60e081015190915060006102fd87610c5d565b9050600061030a87610d08565b60109290921b60909290921b60989690961b9590950101019695505050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa1580156103be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e29190611207565b60e00151601084901b0191505092915050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610487573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ab9190611207565b60e081015190915060006104be85610d08565b60101b9190910195945050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105849190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85146105c3576105be85610c5d565b6104be565b5071ffffffffffffffffffffffffffffffff000001949350505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301526000918291829182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069a9190611207565b60e081015190915060006106ad8c610c5d565b905060006106ba8b610d9b565b905060008a60c01b8260a01b018d60901b018360101b0184019050808a8a97509750975050505050509750975097945050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152600091829182917f0000000000000000000000000000000000000000000000000000000000000000909116906335ea6a75906024016101e060405180830381865afa158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa9190611207565b60e08101516040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015292935090916000917f0000000000000000000000000000000000000000000000000000000000000000909116906335ea6a75906024016101e060405180830381865afa158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a9190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff89146108a9576108a489610c5d565b6108bb565b6fffffffffffffffffffffffffffffffff5b60109290921b9390930160208a901b019550608087901b0193505050509550959350505050565b60006108ef8484846108f7565b949350505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ad9190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86146109ec576109e786610c5d565b6109fe565b6fffffffffffffffffffffffffffffffff5b90506000610a0b86610d08565b60901b60109290921b91909101919091019695505050505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610ab8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610adc9190611207565b60e08101519091506000610aef86610c5d565b60101b609086901b0191909101925050509392505050565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301526000918291829182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610b9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc19190611207565b60e081015190915060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8c14610c0057610bfb8c610c5d565b610c12565b6fffffffffffffffffffffffffffffffff5b90506000610c1f8c610d08565b90506000610c2c8c610d9b565b60b89b909b1b60989b909b1b9a909a0160909190911b0160109190911b01019b959a50939850939650505050505050565b60006fffffffffffffffffffffffffffffffff821115610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f323820626974730000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5090565b600060ff821115610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203860448201527f20626974730000000000000000000000000000000000000000000000000000006064820152608401610cfb565b600063ffffffff821115610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610cfb565b73ffffffffffffffffffffffffffffffffffffffff81168114610e5357600080fd5b50565b61ffff81168114610e5357600080fd5b60008060008060808587031215610e7c57600080fd5b8435610e8781610e31565b935060208501359250604085013591506060850135610ea581610e56565b939692955090935050565b60008060408385031215610ec357600080fd5b8235610ece81610e31565b91506020830135610ede81610e31565b809150509250929050565b60008060408385031215610efc57600080fd5b8235610f0781610e31565b946020939093013593505050565b803560ff81168114610f2657600080fd5b919050565b600080600080600080600060e0888a031215610f4657600080fd5b8735610f5181610e31565b9650602088013595506040880135610f6881610e56565b945060608801359350610f7d60808901610f15565b925060a0880135915060c0880135905092959891949750929550565b80358015158114610f2657600080fd5b600080600080600060a08688031215610fc157600080fd5b8535610fcc81610e31565b94506020860135610fdc81610e31565b93506040860135610fec81610e31565b92506060860135915061100160808701610f99565b90509295509295909350565b60008060006060848603121561102257600080fd5b833561102d81610e31565b95602085013595506040909401359392505050565b60008060006060848603121561105757600080fd5b833561106281610e31565b925060208401359150604084013561107981610e56565b809150509250925092565b6000806040838503121561109757600080fd5b82356110a281610e31565b91506110b060208401610f99565b90509250929050565b600080600080600080600060e0888a0312156110d457600080fd5b87356110df81610e31565b9650602088013595506040880135945060608801359350610f7d60808901610f15565b6040516101e0810167ffffffffffffffff8111828210171561114d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b60006020828403121561116557600080fd5b6040516020810181811067ffffffffffffffff821117156111af577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114610f2657600080fd5b805164ffffffffff81168114610f2657600080fd5b8051610f2681610e56565b8051610f2681610e31565b60006101e0828403121561121a57600080fd5b611222611102565b61122c8484611153565b815261123a602084016111bc565b602082015261124b604084016111bc565b604082015261125c606084016111bc565b606082015261126d608084016111bc565b608082015261127e60a084016111bc565b60a082015261128f60c084016111dc565b60c08201526112a060e084016111f1565b60e08201526101006112b38185016111fc565b908201526101206112c58482016111fc565b908201526101406112d78482016111fc565b908201526101606112e98482016111fc565b908201526101806112fb8482016111bc565b908201526101a061130d8482016111bc565b908201526101c061131f8482016111bc565b90820152939250505056fea2646970667358221220550a5d1ca13779d56fd6a3f9cf5cee982d93d61310d74a95690bcec9ee75ab4a64736f6c634300080a0033";class Rt extends f.lV{constructor(...e){1===e.length?super(Ct,Pt,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 Me.vU(Ct)}static connect(e,t){return new f.CH(e,Ct,t)}}Rt.bytecode=Pt,Rt.abi=Ct;class It extends c.Z{constructor(e,t){super(e,Ot);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=Ot.createInterface(),this.poolContractInstance=Et.createInterface(),this.generateSupplyTxData=({user:e,reserve:t,onBehalfOf:n,amount:r,referralCode:a})=>{const i={},o=this.poolContractInstance.encodeFunctionData("supply",[t,r,null!==n&&void 0!==n?n:e,null!==a&&void 0!==a?a:"0"]);return i.to=this.l2PoolAddress,i.from=e,i.data=o,i},this.generateBorrowTxData=({user:e,reserve:t,amount:n,numericRateMode:r,referralCode:a,onBehalfOf:i})=>{const o={},s=this.poolContractInstance.encodeFunctionData("borrow",[t,n,r,null!==a&&void 0!==a?a:"0",null!==i&&void 0!==i?i:e]);return o.to=this.l2PoolAddress,o.from=e,o.data=s,o.gasLimit=dt.O$.from(l.eB[u.UQ.borrow].limit),o},this.generateSupplyWithPermitTxData=({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:a,deadline:i,permitR:o,permitS:s,permitV:c})=>{const u={},l=this.poolContractInstance.encodeFunctionData("supplyWithPermit",[t,n,null!==r&&void 0!==r?r:e,null!==a&&void 0!==a?a:"0",i,c,o,s]);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=dt.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=dt.O$.from(l.eB[u.UQ.borrow].limit),n},this.generateEncodedSupplyWithPermitTxData=({encodedTxData:e,signature:t,user:n})=>{const r={},a=(0,je.splitSignature)(t),i=this.l2PoolContractInstance.encodeFunctionData("supplyWithPermit",[e,a.r,a.s]);return r.to=this.l2PoolAddress,r.data=i,r.from=n,r.gasLimit=dt.O$.from(l.eB[u.UQ.supplyWithPermit].limit),r}}async supply({user:e,reserve:t,amount:n,referralCode:r},a){const i=this.getEncoder(),o=await i.encodeSupplyParams(t,n,null!==r&&void 0!==r?r:0),s=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.supply(o),from:e,value:(0,l.oC)(t,n)});return a.push({tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(a,c,u.UQ.supply)}),a}async supplyWithPermit({user:e,reserve:t,amount:n,deadline:r,referralCode:a,permitR:i,permitS:o,permitV:s},c){const l=this.getEncoder(),d=await l.encodeSupplyWithPermitParams(t,n,null!==a&&void 0!==a?a:0,r,s,i,o),p=this.getContractInstance(this.l2PoolAddress),f=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.supplyWithPermit(d[0],i,o),from:e});return c.push({tx:f,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,f)}),c}async withdraw({user:e,reserve:t,amount:n}){const r=this.getEncoder(),a=await r.encodeWithdrawParams(t,n),i=this.getContractInstance(this.l2PoolAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.withdraw(a),from:e,action:u.UQ.withdraw});return[{tx:o,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],o,u.UQ.supply)}]}async borrow({user:e,reserve:t,amount:n,numericRateMode:r,referralCode:a}){const i=this.getEncoder(),o=await i.encodeBorrowParams(t,n,r,null!==a&&void 0!==a?a:0),s=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.borrow(o),from:e});return[{tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],c)}]}async repay({reserve:e,user:t,amount:n,numericRateMode:r},a){const i=this.getEncoder(),o=await i.encodeRepayParams(e,n,r),s=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.repay(o),from:t,value:(0,l.oC)(e,n)});return a.push({tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(a,c,u.UQ.repay)}),a}async repayWithPermit({user:e,reserve:t,amount:n,numericRateMode:r,permitR:a,permitS:i,permitV:o,deadline:s},c){const d=this.getEncoder(),p=await d.encodeRepayWithPermitParams(t,n,r,s,o,a,i),f=this.getContractInstance(this.l2PoolAddress),h=this.generateTxCallback({rawTxMethod:async()=>f.populateTransaction.repayWithPermit(p[0],a,i),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},a){const i=this.getEncoder(),o=await i.encodeRepayWithATokensParams(e,n,r),s=this.getContractInstance(this.l2PoolAddress),c=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.repayWithATokens(o),from:t,value:(0,l.oC)(e,n)});return a.push({tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(a,c,u.UQ.repay)}),a}async swapBorrowRateMode({reserve:e,numericRateMode:t,user:n}){const r=this.getEncoder(),a=await r.encodeSwapBorrowRateMode(e,t),i=this.getContractInstance(this.l2PoolAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.swapBorrowRateMode(a),from:n});return[{tx:o,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],o)}]}async setUserUseReserveAsCollateral({reserve:e,usageAsCollateral:t,user:n}){const r=this.getEncoder(),a=await r.encodeSetUserUseReserveAsCollateral(e,t),i=this.getContractInstance(this.l2PoolAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.setUserUseReserveAsCollateral(a),from:n});return[{tx:o,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],o)}]}async liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,debtToCover:a,getAToken:i},o){const s=this.getEncoder(),c=await s.encodeLiquidationCall(r,n,t,a,null!==i&&void 0!==i&&i),d=this.getContractInstance(this.l2PoolAddress),p=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.liquidationCall(c[0],c[1]),from:e,value:(0,l.oC)(n,a)});return o.push({tx:p,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],p,u.UQ.liquidationCall)}),o}getEncoder(){return this.encoderContract||""===this.encoderAddress||(this.encoderContract=Rt.connect(this.encoderAddress,this.provider)),this.encoderContract}}(0,s.__decorate)([d.pv,(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object,Array]),(0,s.__metadata)("design:returntype",Promise)],It.prototype,"supply",null),(0,s.__decorate)([d.pv,(0,s.__param)(0,(0,p.f1)("deadline")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object,Array]),(0,s.__metadata)("design:returntype",Promise)],It.prototype,"supplyWithPermit",null),(0,s.__decorate)([d.pv,(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],It.prototype,"withdraw",null),(0,s.__decorate)([d.pv,(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],It.prototype,"borrow",null),(0,s.__decorate)([d.pv,(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object,Array]),(0,s.__metadata)("design:returntype",Promise)],It.prototype,"repay",null),(0,s.__decorate)([d.pv,(0,s.__param)(0,(0,p.f1)("deadline")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object,Array]),(0,s.__metadata)("design:returntype",Promise)],It.prototype,"repayWithPermit",null),(0,s.__decorate)([d.pv,(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object,Array]),(0,s.__metadata)("design:returntype",Promise)],It.prototype,"repayWithATokens",null),(0,s.__decorate)([d.pv,(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],It.prototype,"swapBorrowRateMode",null),(0,s.__decorate)([d.pv,(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],It.prototype,"setUserUseReserveAsCollateral",null),(0,s.__decorate)([d.pv,(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object,Array]),(0,s.__metadata)("design:returntype",Promise)],It.prototype,"liquidationCall",null);class Dt{static connect(e,t){return new f.CH(e,jt,t)}static createInterface(){return new Me.vU(jt)}}const jt=[{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 Mt extends c.Z{constructor(e,t){super(e,Dt),this.erc20Service=t,this.debtTokenInterface=Dt.createInterface()}approveDelegation({user:e,delegatee:t,debtTokenAddress:n,amount:r}){const a=this.getContractInstance(n),i=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.approveDelegation(t,r),from:e});return{tx:i,txType:u.ns.ERC20_APPROVAL,gas:this.generateTxPriceEstimation([],i)}}async approvedDelegationAmount({user:e,delegatee:t,debtTokenAddress:n}){const r=this.getContractInstance(n),a=await r.borrowAllowance(e,t),i=await this.erc20Service.decimalsOf(n);return Number(pt.formatUnits(a,i))}generateApproveDelegationTxData({user:e,delegatee:t,debtTokenAddress:n,amount:r}){return{data:this.debtTokenInterface.encodeFunctionData("approveDelegation",[t,r]),to:n,from:e,gasLimit:dt.O$.from(l.eB[u.UQ.creditDelegationApproval].recommended)}}async isDelegationApproved({debtTokenAddress:e,allowanceGiver:t,allowanceReceiver:n,amount:r,nativeDecimals:a}){const i=await this.erc20Service.decimalsOf(e),o=this.getContractInstance(e),s=await o.borrowAllowance(t,n),c=a?dt.O$.from(r):dt.O$.from((0,l.gU)(r,i));return s.gte(c)}}(0,s.__decorate)([d.EB,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("delegatee")),(0,s.__param)(0,(0,p.Oh)("debtTokenAddress")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Object)],Mt.prototype,"approveDelegation",null),(0,s.__decorate)([d.EB,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("delegatee")),(0,s.__param)(0,(0,p.Oh)("debtTokenAddress")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Mt.prototype,"approvedDelegationAmount",null),(0,s.__decorate)([d.EB,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("delegatee")),(0,s.__param)(0,(0,p.Oh)("debtTokenAddress")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Object)],Mt.prototype,"generateApproveDelegationTxData",null),(0,s.__decorate)([d.EB,(0,s.__param)(0,(0,p.Oh)("debtTokenAddress")),(0,s.__param)(0,(0,p.Oh)("allowanceGiver")),(0,s.__param)(0,(0,p.Oh)("allowanceReceiver")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Mt.prototype,"isDelegationApproved",null);class Nt{static connect(e,t){return new f.CH(e,Lt,t)}static createInterface(){return new Me.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 Bt extends c.Z{constructor(e,t,n){super(e,Nt),this.erc20Service=t,this.baseDebtTokenService=new Mt(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=Nt.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:dt.O$.from(e.amount),gasLimit:dt.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:dt.O$.from(l.eB[u.UQ.borrowETH].limit)}}}depositETH({lendingPool:e,user:t,amount:n,onBehalfOf:r,referralCode:a}){const i=(0,l.gU)(n,18),o=this.getContractInstance(this.wethGatewayAddress),s=this.generateTxCallback({rawTxMethod:async()=>o.populateTransaction.depositETH(e,null!==r&&void 0!==r?r:t,null!==a&&void 0!==a?a:"0"),from:t,value:i});return[{tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],s)}]}async borrowETH({lendingPool:e,user:t,amount:n,debtTokenAddress:r,interestRateMode:a,referralCode:i}){const o=[],s=(0,l.gU)(n,18),c=a===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:lt.Bz.toString()});o.push(e)}const d=this.getContractInstance(this.wethGatewayAddress),p=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.borrowETH(e,s,c,null!==i&&void 0!==i?i:"0"),from:t});return o.push({tx:p,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(o,p,u.UQ.borrowETH)}),o}async withdrawETH({lendingPool:e,user:t,amount:n,onBehalfOf:r,aTokenAddress:a}){const i=[],{isApproved:o,approve:s}=this.erc20Service,c="-1"===n?lt.Bz.toString():(0,l.gU)(n,18);if(!(await o({token:a,user:t,spender:this.wethGatewayAddress,amount:n}))){const e=s({user:t,token:a,spender:this.wethGatewayAddress,amount:lt.Bz.toString()});i.push(e)}const d=this.getContractInstance(this.wethGatewayAddress),p=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.withdrawETH(e,c,null!==r&&void 0!==r?r:t),from:t});return i.push({tx:p,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(i,p,u.UQ.withdrawETH)}),i}repayETH({lendingPool:e,user:t,amount:n,interestRateMode:r,onBehalfOf:a}){const i=(0,l.gU)(n,18),o=r===u.tk.Variable?2:1,s=this.getContractInstance(this.wethGatewayAddress),c=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.repayETH(e,i,o,null!==a&&void 0!==a?a:t),gasSurplus:30,from:t,value:i});return[{tx:c,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],c)}]}}(0,s.__decorate)([d.N,(0,s.__param)(0,(0,p.Oh)("lendingPool")),(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__param)(0,(0,p.rX)("referralCode")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Array)],Bt.prototype,"depositETH",null),(0,s.__decorate)([d.N,(0,s.__param)(0,(0,p.Oh)("lendingPool")),(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__param)(0,(0,p.Oh)("debtTokenAddress")),(0,s.__param)(0,(0,p.rX)("referralCode")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Bt.prototype,"borrowETH",null),(0,s.__decorate)([d.N,(0,s.__param)(0,(0,p.Oh)("lendingPool")),(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__param)(0,(0,p.lw)("amount")),(0,s.__param)(0,(0,p.Oh)("aTokenAddress")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Bt.prototype,"withdrawETH",null),(0,s.__decorate)([d.N,(0,s.__param)(0,(0,p.Oh)("lendingPool")),(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Array)],Bt.prototype,"repayETH",null);class Zt extends c.Z{constructor(e,t){super(e,Et);const{POOL:n,FLASH_LIQUIDATION_ADAPTER:r,REPAY_WITH_COLLATERAL_ADAPTER:a,SWAP_COLLATERAL_ADAPTER:i,WETH_GATEWAY:o,L2_ENCODER:s}=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!==i&&void 0!==i?i:"",this.repayWithCollateralAddress=null!==a&&void 0!==a?a:"",this.l2EncoderAddress=null!==s&&void 0!==s?s:"",this.erc20_2612Service=new Ye(e),this.erc20Service=new mt(e),this.synthetixService=new St.K(e),this.wethGatewayService=new Bt(e,this.erc20Service,o),this.liquiditySwapAdapterService=new vt(e,i),this.paraswapRepayWithCollateralAdapterService=new Tt(e,a),this.l2PoolService=new It(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:a}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.depositETH({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:r,referralCode:a});const{isApproved:i,approve:o,decimalsOf:s}=this.erc20Service,c=[],d=await s(t),p=(0,l.gU)(n,d);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:p})))throw new Error("Not enough funds to execute operation");if(!(await i({token:t,user:e,spender:this.poolAddress,amount:n}))){const n=o({user:e,token:t,spender:this.poolAddress,amount:l.zn});c.push(n)}const f=this.getContractInstance(this.poolAddress),h=this.generateTxCallback({rawTxMethod:async()=>f.populateTransaction.deposit(t,p,null!==r&&void 0!==r?r:e,null!==a&&void 0!==a?a:"0"),from:e,value:(0,l.oC)(t,p),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:a,useOptimizedPath:i}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.depositETH({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:r,referralCode:a});const{isApproved:o,approve:s,decimalsOf:c}=this.erc20Service,d=[],p=await c(t),f=(0,l.gU)(n,p);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});d.push(n)}const h=this.getContractInstance(this.poolAddress);if(i)return this.l2PoolService.supply({user:e,reserve:t,amount:f,referralCode:a},d);const m=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.supply(t,f,null!==r&&void 0!==r?r:e,null!==a&&void 0!==a?a:"0"),from:e,value:(0,l.oC)(t,f),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:a,isApproved:i}=this.erc20Service,{name:o,decimals:s}=await a(t),c="-1"===n?lt.Bz.toString():(0,l.gU)(n,s);if(await i({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 p={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:o,version:"1",chainId:u,verifyingContract:t},message:{owner:e,spender:this.poolAddress,value:c,nonce:d,deadline:r}};return JSON.stringify(p)}async supplyWithPermit({user:e,reserve:t,onBehalfOf:n,amount:r,referralCode:a,signature:i,useOptimizedPath:o,deadline:s}){const c=[],{decimalsOf:d}=this.erc20Service,p=this.getContractInstance(this.poolAddress),f=await d(t),h=(0,l.gU)(r,f),m=(0,ze.splitSignature)(i);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:h})))throw new Error("Not enough funds to execute operation");if(o)return this.l2PoolService.supplyWithPermit({user:e,reserve:t,amount:h,referralCode:a,deadline:s,permitV:m.v,permitR:m.r,permitS:m.s},c);const y=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.supplyWithPermit(t,h,null!==n&&void 0!==n?n:e,null!==a&&void 0!==a?a:0,s,m.v,m.r,m.s),from:e,action:u.UQ.supplyWithPermit});return c.push({tx:y,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,y,u.UQ.supplyWithPermit)}),c}async withdraw({user:e,reserve:t,amount:n,onBehalfOf:r,aTokenAddress:a,useOptimizedPath:i}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!a)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:a})}const{decimalsOf:o}=this.erc20Service,s=await o(t),c="-1"===n?lt.Bz.toString():(0,l.gU)(n,s);if(i)return this.l2PoolService.withdraw({user:e,reserve:t,amount:c});const d=this.getContractInstance(this.poolAddress),p=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.withdraw(t,c,null!==r&&void 0!==r?r:e),from:e,action:u.UQ.withdraw});return[{tx:p,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],p,u.UQ.withdraw)}]}async borrow({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:a,onBehalfOf:i,referralCode:o,useOptimizedPath:s}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!a)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:a,interestRateMode:r,referralCode:o})}const{decimalsOf:c}=this.erc20Service,d=await c(t),p=(0,l.gU)(n,d),f=r===u.tk.Variable?2:1;if(s)return this.l2PoolService.borrow({user:e,reserve:t,amount:p,numericRateMode:f,referralCode:o});const h=this.getContractInstance(this.poolAddress),m=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.borrow(t,p,f,null!==o&&void 0!==o?o:0,null!==i&&void 0!==i?i: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:a,useOptimizedPath:i}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.repayETH({lendingPool:this.poolAddress,user:e,amount:n,interestRateMode:r,onBehalfOf:a});const o=[],{isApproved:s,approve:c,decimalsOf:d}=this.erc20Service,p=this.getContractInstance(this.poolAddress),{populateTransaction:f}=p,h=r===u.tk.Variable?2:1,m=await d(t),y="-1"===n?lt.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(!(await s({token:t,user:e,spender:this.poolAddress,amount:n}))){const n=c({user:e,token:t,spender:this.poolAddress,amount:l.zn});o.push(n)}if(i)return this.l2PoolService.repay({user:e,reserve:t,amount:y,numericRateMode:h},o);const g=this.generateTxCallback({rawTxMethod:async()=>f.repay(t,y,h,null!==a&&void 0!==a?a:e),from:e,value:(0,l.oC)(t,y),action:u.UQ.repay});return o.push({tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(o,g,u.UQ.repay)}),o}async repayWithPermit({user:e,reserve:t,amount:n,interestRateMode:r,onBehalfOf:a,signature:i,useOptimizedPath:o,deadline:s}){const c=[],{decimalsOf:d}=this.erc20Service,p=this.getContractInstance(this.poolAddress),{populateTransaction:f}=p,h=r===u.tk.Variable?2:1,m=await d(t),y=(0,ze.splitSignature)(i),g="-1"===n?lt.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(o)return this.l2PoolService.repayWithPermit({user:e,reserve:t,amount:g,numericRateMode:h,deadline:s,permitR:y.r,permitS:y.s,permitV:y.v},c);const b=this.generateTxCallback({rawTxMethod:async()=>f.repayWithPermit(t,g,h,null!==a&&void 0!==a?a:e,s,y.v,y.r,y.s),from:e,value:(0,l.oC)(t,g),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 a=n===u.tk.Variable?2:1;if(r)return this.l2PoolService.swapBorrowRateMode({user:e,reserve:t,numericRateMode:a});const i=this.getContractInstance(this.poolAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.swapBorrowRateMode(t,a),from:e});return[{txType:u.ns.DLP_ACTION,tx:o,gas:this.generateTxPriceEstimation([],o)}]}async setUsageAsCollateral({user:e,reserve:t,usageAsCollateral:n,useOptimizedPath:r}){const a=this.getContractInstance(this.poolAddress);if(r)return this.l2PoolService.setUserUseReserveAsCollateral({user:e,reserve:t,usageAsCollateral:n});const i=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.setUserUseReserveAsCollateral(t,n),from:e});return[{tx:i,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],i)}]}async liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,purchaseAmount:a,getAToken:i,liquidateAll:o,useOptimizedPath:s}){const c=[],{isApproved:d,approve:p,decimalsOf:f}=this.erc20Service;if(!(await d({token:n,user:e,spender:this.poolAddress,amount:a}))){const t=p({user:e,token:n,spender:this.poolAddress,amount:l.zn});c.push(t)}let h=lt.Bz.toString();if(!o){const e=await f(n);h=(0,l.gU)(a,e)}if(s)return this.l2PoolService.liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,debtToCover:h,getAToken:i},c);const m=this.getContractInstance(this.poolAddress),y=this.generateTxCallback({rawTxMethod:async()=>m.populateTransaction.liquidationCall(r,n,t,h,null!==i&&void 0!==i&&i),from:e,value:(0,l.oC)(n,h)});return c.push({tx:y,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(c,y,u.UQ.liquidationCall)}),c}async swapCollateral({user:e,flash:t,fromAsset:n,fromAToken:r,toAsset:a,fromAmount:i,minToAmount:o,permitSignature:s,swapAll:c,referralCode:d,augustus:p,swapCallData:f}){const h=[],m=null!==s&&void 0!==s?s:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:r,user:e,spender:this.swapCollateralAddress,amount:i}))){const t=this.erc20Service.approve({user:e,token:r,spender:this.swapCollateralAddress,amount:lt.Bz.toString()});h.push(t)}const y=await this.erc20Service.decimalsOf(n),g=(0,l.gU)(i,y),b=await this.erc20Service.decimalsOf(a),v=(0,l.gU)(o,b),w=this.getContractInstance(this.poolAddress);if(t){const t=((e,t,n,r,a,i,o,s,c,u)=>ut.$.encode(["address","uint256","uint256","bytes","address","tuple(uint256,uint256,uint8,bytes32,bytes32)"],[e,t,n,r,a,[i,o,s,c,u]]))(a,v,c?bt(f):0,f,p,m.amount,m.deadline,m.v,m.r,m.s),r=(Number(i)+Number(i)*Number(l.zp)/100).toString(),o=(0,l.gU)(r,y),s=this.generateTxCallback({rawTxMethod:async()=>w.populateTransaction.flashLoanSimple(this.swapCollateralAddress,n,c?o:g,t,null!==d&&void 0!==d?d:"0"),from:e,action:u.UQ.swapCollateral});return h.push({tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(h,s,u.UQ.swapCollateral)}),h}const _=this.liquiditySwapAdapterService.swapAndDeposit({user:e,assetToSwapFrom:n,assetToSwapTo:a,amountToSwap:g,minAmountToReceive:v,swapAll:c,swapCallData:f,augustus:p,permitParams:m},h);return h.push(_),h}async paraswapRepayWithCollateral({user:e,fromAsset:t,fromAToken:n,assetToRepay:r,repayWithAmount:a,repayAmount:i,permitSignature:o,repayAllDebt:s,rateMode:c,referralCode:d,flash:p,swapAndRepayCallData:f,augustus:h}){const m=[],y=null!==o&&void 0!==o?o:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:n,user:e,spender:this.repayWithCollateralAddress,amount:a}))){const t=this.erc20Service.approve({user:e,token:n,spender:this.repayWithCollateralAddress,amount:lt.Bz.toString()});m.push(t)}const g=await this.erc20Service.decimalsOf(t),b=(0,l.gU)(a,g),v=(Number(a)+Number(a)*Number(l.zp)/100).toString(),w=(0,l.gU)(v,g),_=await this.erc20Service.decimalsOf(r),x=(0,l.gU)(i,_),T=c===u.tk.Stable?1:2;if(p){const n=ut.$.encode(["bytes","address"],[f,h]),a=ut.$.encode(["address","uint256","uint256","uint256","bytes","uint256","uint256","uint8","bytes32","bytes32"],[r,x,s?(0,l.mz)(f):0,T,n,y.amount,y.deadline,y.v,y.r,y.s]),i=this.getContractInstance(this.poolAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.flashLoanSimple(this.repayWithCollateralAddress,t,s?w:b,a,null!==d&&void 0!==d?d:"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 S=this.paraswapRepayWithCollateralAdapterService.swapAndRepay({user:e,collateralAsset:t,debtAsset:r,collateralAmount:b,debtRepayAmount:x,debtRateMode:c,permitParams:y,repayAll:null!==s&&void 0!==s&&s,swapAndRepayCallData:f,augustus:h},m);return m.push(S),m}async flashLiquidation({user:e,collateralAsset:t,borrowedAsset:n,debtTokenCover:r,liquidateAll:a,initiator:i,useEthPath:o}){const s=[],c=this.getContractInstance(this.poolAddress),d=await this.erc20Service.decimalsOf(n),p=(0,l.gU)(r,d),f=a?lt.Bz.toString():p,h=a?(0,l.gU)((m=r,(Number(m)+Number(m)*Number(m)/100).toString()),d):p;var m;const y=ut.$.encode(["address","address","address","uint256","bool"],[t,n,e,f,null!==o&&void 0!==o&&o]),g=this.generateTxCallback({rawTxMethod:async()=>c.populateTransaction.flashLoanSimple(this.flashLiquidationAddress,n,h,y,"0"),from:i});return s.push({tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(s,g,u.UQ.liquidationFlash)}),s}async repayWithATokens({user:e,amount:t,reserve:n,rateMode:r,useOptimizedPath:a}){if(n.toLowerCase()===l.hP.toLowerCase())throw new Error("Can not repay with aTokens with eth. Should be WETH instead");const i=[],{decimalsOf:o}=this.erc20Service,s=this.getContractInstance(this.poolAddress),{populateTransaction:c}=s,d=r===u.tk.Variable?2:1,p=await o(n),f="-1"===t?lt.Bz.toString():(0,l.gU)(t,p);if(a)return this.l2PoolService.repayWithATokens({user:e,reserve:n,amount:f,numericRateMode:d},i);const h=this.generateTxCallback({rawTxMethod:async()=>c.repayWithATokens(n,f,d),from:e,value:(0,l.oC)(n,f)});return i.push({tx:h,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(i,h,u.UQ.repay)}),i}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:a,suppliedPositions:i,borrowedPositions:o,permits:s}){const c=this.getContractInstance(this.poolAddress),u=o.map((e=>[e.address,e.amount,e.rateMode.toString()])),l=s.map((e=>[e.aToken,e.value,e.deadline,e.v,e.r,e.s])),d=ut.$.encode(["address[]","(address, uint256, uint256)[]","(address, uint256, uint256, uint8, bytes32, bytes32)[]"],[i,u,l]);return c.populateTransaction.flashLoan(e,t,n,r,a,d,"0")}}(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[String]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"getReserveData",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"deposit",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"supply",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.lw)("amount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"signERC20Approval",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__param)(0,(0,p.K5)("referralCode")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"supplyWithPermit",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.lw)("amount")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__param)(0,(0,p.Oh)("aTokenAddress")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"withdraw",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__param)(0,(0,p.Oh)("debtTokenAddress")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"borrow",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.lw)("amount")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"repay",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.lw)("amount")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"repayWithPermit",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"swapBorrowRateMode",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"setUsageAsCollateral",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("liquidator")),(0,s.__param)(0,(0,p.Oh)("liquidatedUser")),(0,s.__param)(0,(0,p.Oh)("debtReserve")),(0,s.__param)(0,(0,p.Oh)("collateralReserve")),(0,s.__param)(0,(0,p.K5)("purchaseAmount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"liquidationCall",null),(0,s.__decorate)([d.Gv,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("fromAsset")),(0,s.__param)(0,(0,p.Oh)("fromAToken")),(0,s.__param)(0,(0,p.Oh)("toAsset")),(0,s.__param)(0,(0,p.Oh)("augustus")),(0,s.__param)(0,(0,p.K5)("fromAmount")),(0,s.__param)(0,(0,p.K5)("minToAmount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"swapCollateral",null),(0,s.__decorate)([d.M9,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("fromAsset")),(0,s.__param)(0,(0,p.Oh)("fromAToken")),(0,s.__param)(0,(0,p.Oh)("assetToRepay")),(0,s.__param)(0,(0,p.K5)("repayWithAmount")),(0,s.__param)(0,(0,p.K5)("repayAmount")),(0,s.__param)(0,(0,p.Oh)("augustus")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"paraswapRepayWithCollateral",null),(0,s.__decorate)([d.yZ,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("collateralAsset")),(0,s.__param)(0,(0,p.Oh)("borrowedAsset")),(0,s.__param)(0,(0,p.K5)("debtTokenCover")),(0,s.__param)(0,(0,p.Oh)("initiator")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"flashLiquidation",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.lw)("amount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"repayWithATokens",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.rX)("categoryId")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Array)],Zt.prototype,"setUserEMode",null),(0,s.__decorate)([d.mM,(0,s.__param)(0,(0,p.Oh)("migrator")),(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Gq)("borrowedAssets")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Zt.prototype,"migrateV3",null);class Ut{static connect(e,t){return new f.CH(e,Ft,t)}}const Ft=[{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,Ut),this.repayWithCollateralAddress=null!==t&&void 0!==t?t:"",this.swapAndRepay=this.swapAndRepay.bind(this)}swapAndRepay({user:e,collateralAsset:t,debtAsset:n,collateralAmount:r,debtRepayAmount:a,debtRateMode:i,permit:o,useEthPath:s},c){const l=i===u.tk.Stable?1:2,d=this.getContractInstance(this.repayWithCollateralAddress),p=this.generateTxCallback({rawTxMethod:async()=>d.populateTransaction.swapAndRepay(t,n,r,a,l,o,null!==s&&void 0!==s&&s),from:e});return{tx:p,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(null!==c&&void 0!==c?c:[],p,u.UQ.repayCollateral)}}}(0,s.__decorate)([d.mB,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("collateralAsset")),(0,s.__param)(0,(0,p.Oh)("debtAsset")),(0,s.__param)(0,(0,p.K5)("collateralAmount")),(0,s.__param)(0,(0,p.K5)("debtRepayAmount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object,Array]),(0,s.__metadata)("design:returntype",Object)],zt.prototype,"swapAndRepay",null);class Gt{static connect(e,t){return new f.CH(e,Ht,t)}static createInterface(){return new Me.vU(Ht)}}const Ht=[{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:a,SWAP_COLLATERAL_ADAPTER:i,WETH_GATEWAY:o}=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!==i&&void 0!==i?i:"",this.repayWithCollateralAddress=null!==a&&void 0!==a?a:"",this.erc20Service=new mt(e),this.synthetixService=new St.K(e),this.wethGatewayService=new Bt(e,this.erc20Service,o),this.liquiditySwapAdapterService=new vt(e,i),this.repayWithCollateralAdapterService=new zt(e,a),this.paraswapRepayWithCollateralAdapterService=new Tt(e,a)}async deposit({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:a}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.depositETH({lendingPool:this.lendingPoolAddress,user:e,amount:n,onBehalfOf:r,referralCode:a});const{isApproved:i,approve:o,decimalsOf:s}=this.erc20Service,c=[],d=await s(t),p=(0,l.gU)(n,d);if(!(await this.synthetixService.synthetixValidation({user:e,reserve:t,amount:p})))throw new Error("Not enough funds to execute operation");if(!(await i({token:t,user:e,spender:this.lendingPoolAddress,amount:n}))){const n=o({user:e,token:t,spender:this.lendingPoolAddress,amount:l.zn});c.push(n)}const f=this.getContractInstance(this.lendingPoolAddress),h=this.generateTxCallback({rawTxMethod:async()=>f.populateTransaction.deposit(t,p,null!==r&&void 0!==r?r:e,null!==a&&void 0!==a?a:"0"),from:e,value:(0,l.oC)(t,p),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:a}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!a)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:a})}const{decimalsOf:i}=this.erc20Service,o=await i(t),s="-1"===n?lt.Bz.toString():(0,l.gU)(n,o),c=this.getContractInstance(this.lendingPoolAddress),d=this.generateTxCallback({rawTxMethod:async()=>c.populateTransaction.withdraw(t,s,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:a,onBehalfOf:i,referralCode:o}){if(t.toLowerCase()===l.hP.toLowerCase()){if(!a)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:a,interestRateMode:r,referralCode:o})}const{decimalsOf:s}=this.erc20Service,c=await s(t),d=(0,l.gU)(n,c),p=r===u.tk.Variable?2:1,f=this.getContractInstance(this.lendingPoolAddress),h=this.generateTxCallback({rawTxMethod:async()=>f.populateTransaction.borrow(t,d,p,null!==o&&void 0!==o?o:0,null!==i&&void 0!==i?i: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:a}){if(t.toLowerCase()===l.hP.toLowerCase())return this.wethGatewayService.repayETH({lendingPool:this.lendingPoolAddress,user:e,amount:n,interestRateMode:r,onBehalfOf:a});const i=[],{isApproved:o,approve:s,decimalsOf:c}=this.erc20Service,d=this.getContractInstance(this.lendingPoolAddress),{populateTransaction:p}=d,f=r===u.tk.Variable?2:1,h=await c(t),m="-1"===n?lt.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 o({token:t,user:e,spender:this.lendingPoolAddress,amount:n}))){const n=s({user:e,token:t,spender:this.lendingPoolAddress,amount:l.zn});i.push(n)}const y=this.generateTxCallback({rawTxMethod:async()=>p.repay(t,m,f,null!==a&&void 0!==a?a:e),from:e,value:(0,l.oC)(t,m),action:u.UQ.repay});return i.push({tx:y,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(i,y,u.UQ.repay)}),i}swapBorrowRateMode({user:e,reserve:t,interestRateMode:n}){const r=n===u.tk.Variable?2:1,a=this.getContractInstance(this.lendingPoolAddress),i=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.swapBorrowRateMode(t,r),from:e});return[{txType:u.ns.DLP_ACTION,tx:i,gas:this.generateTxPriceEstimation([],i)}]}setUsageAsCollateral({user:e,reserve:t,usageAsCollateral:n}){const r=this.getContractInstance(this.lendingPoolAddress),a=this.generateTxCallback({rawTxMethod:async()=>r.populateTransaction.setUserUseReserveAsCollateral(t,n),from:e,action:u.UQ.setUsageAsCollateral});return[{tx:a,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation([],a,u.UQ.setUsageAsCollateral)}]}async liquidationCall({liquidator:e,liquidatedUser:t,debtReserve:n,collateralReserve:r,purchaseAmount:a,getAToken:i,liquidateAll:o}){const s=[],{isApproved:c,approve:d,decimalsOf:p}=this.erc20Service;if(!(await c({token:n,user:e,spender:this.lendingPoolAddress,amount:a}))){const t=d({user:e,token:n,spender:this.lendingPoolAddress,amount:l.zn});s.push(t)}let f=lt.Bz.toString();if(!o){const e=await p(n);f=(0,l.gU)(a,e)}const h=this.getContractInstance(this.lendingPoolAddress),m=this.generateTxCallback({rawTxMethod:async()=>h.populateTransaction.liquidationCall(r,n,t,f,null!==i&&void 0!==i&&i),from:e,value:(0,l.oC)(n,f)});return s.push({tx:m,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(s,m,u.UQ.liquidationCall)}),s}async swapCollateral({user:e,flash:t,fromAsset:n,fromAToken:r,toAsset:a,fromAmount:i,minToAmount:o,permitSignature:s,swapAll:c,onBehalfOf:d,referralCode:p,augustus:f,swapCallData:h}){const m=[],y=null!==s&&void 0!==s?s:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:r,user:e,spender:this.swapCollateralAddress,amount:i}))){const t=this.erc20Service.approve({user:e,token:r,spender:this.swapCollateralAddress,amount:lt.Bz.toString()});m.push(t)}const g=await this.erc20Service.decimalsOf(n),b=(0,l.gU)(i,g),v=await this.erc20Service.decimalsOf(a),w=(0,l.gU)(o,v),_=this.getContractInstance(this.lendingPoolAddress);if(t){const t=((e,t,n,r,a,i,o,s,c,u)=>ut.$.encode(["address","uint256","uint256","bytes","address","tuple(uint256,uint256,uint8,bytes32,bytes32)"],[e,t,n,r,a,[i,o,s,c,u]]))(a,w,c?bt(h):0,h,f,y.amount,y.deadline,y.v,y.r,y.s),r=(Number(i)+Number(i)*Number(l.zp)/100).toString(),o=(0,l.gU)(r,g),s=this.generateTxCallback({rawTxMethod:async()=>_.populateTransaction.flashLoan(this.swapCollateralAddress,[n],c?[o]:[b],[0],null!==d&&void 0!==d?d:e,t,null!==p&&void 0!==p?p:"0"),from:e,action:u.UQ.swapCollateral});return m.push({tx:s,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(m,s,u.UQ.swapCollateral)}),m}const x=this.liquiditySwapAdapterService.swapAndDeposit({user:e,assetToSwapFrom:n,assetToSwapTo:a,amountToSwap:b,minAmountToReceive:w,swapAll:c,swapCallData:h,augustus:f,permitParams:y},m);return m.push(x),m}async repayWithCollateral({user:e,fromAsset:t,fromAToken:n,assetToRepay:r,repayWithAmount:a,repayAmount:i,permitSignature:o,repayAllDebt:s,rateMode:c,onBehalfOf:d,referralCode:p,flash:f,useEthPath:h}){const m=[],y=null!==o&&void 0!==o?o:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:n,user:e,spender:this.repayWithCollateralAddress,amount:a}))){const t=this.erc20Service.approve({user:e,token:n,spender:this.repayWithCollateralAddress,amount:lt.Bz.toString()});m.push(t)}const g=await this.erc20Service.decimalsOf(t),b=(0,l.gU)(a,g),v=(Number(i)+Number(i)*Number(l.zp)/100).toString(),w=await this.erc20Service.decimalsOf(r),_=s?(0,l.gU)(v,w):(0,l.gU)(i,w),x=c===u.tk.Stable?1:2;if(f){const n=ut.$.encode(["address","uint256","uint256","uint256","uint256","uint8","bytes32","bytes32","bool"],[t,b,x,y.amount,y.deadline,y.v,y.r,y.s,null!==h&&void 0!==h&&h]),a=this.getContractInstance(this.lendingPoolAddress),i=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.flashLoan(this.repayWithCollateralAddress,[r],[_],[0],null!==d&&void 0!==d?d:e,n,null!==p&&void 0!==p?p:"0"),from:e,action:u.UQ.repayCollateral});return m.push({tx:i,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(m,i,u.UQ.repayCollateral)}),m}const T=this.repayWithCollateralAdapterService.swapAndRepay({user:e,collateralAsset:t,debtAsset:r,collateralAmount:b,debtRepayAmount:_,debtRateMode:c,permit:y,useEthPath:h},m);return m.push(T),m}async paraswapRepayWithCollateral({user:e,fromAsset:t,fromAToken:n,assetToRepay:r,repayWithAmount:a,repayAmount:i,permitSignature:o,repayAllDebt:s,rateMode:c,onBehalfOf:d,referralCode:p,flash:f,swapAndRepayCallData:h,augustus:m}){const y=[],g=null!==o&&void 0!==o?o:{amount:"0",deadline:"0",v:0,r:"0x0000000000000000000000000000000000000000000000000000000000000000",s:"0x0000000000000000000000000000000000000000000000000000000000000000"};if(!(await this.erc20Service.isApproved({token:n,user:e,spender:this.repayWithCollateralAddress,amount:a}))){const t=this.erc20Service.approve({user:e,token:n,spender:this.repayWithCollateralAddress,amount:lt.Bz.toString()});y.push(t)}const b=await this.erc20Service.decimalsOf(t),v=(0,l.gU)(a,b),w=(Number(a)+Number(a)*Number(l.zp)/100).toString(),_=(0,l.gU)(w,b),x=await this.erc20Service.decimalsOf(r),T=(0,l.gU)(i,x),S=c===u.tk.Stable?1:2;if(f){const n=ut.$.encode(["bytes","address"],[h,m]),a=ut.$.encode(["address","uint256","uint256","uint256","bytes","uint256","uint256","uint8","bytes32","bytes32"],[r,T,s?(0,l.mz)(h):0,S,n,g.amount,g.deadline,g.v,g.r,g.s]),i=this.getContractInstance(this.lendingPoolAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.flashLoan(this.repayWithCollateralAddress,[t],s?[_]:[v],[0],null!==d&&void 0!==d?d:e,a,null!==p&&void 0!==p?p:"0"),from:e,action:u.UQ.repayCollateral});return y.push({tx:o,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(y,o,u.UQ.repayCollateral)}),y}const k=this.paraswapRepayWithCollateralAdapterService.swapAndRepay({user:e,collateralAsset:t,debtAsset:r,collateralAmount:v,debtRepayAmount:T,debtRateMode:c,permitParams:g,repayAll:null!==s&&void 0!==s&&s,swapAndRepayCallData:h,augustus:m},y);return y.push(k),y}async flashLiquidation({user:e,collateralAsset:t,borrowedAsset:n,debtTokenCover:r,liquidateAll:a,initiator:i,useEthPath:o}){const s=[],c=this.getContractInstance(this.lendingPoolAddress),d=await this.erc20Service.decimalsOf(n),p=(0,l.gU)(r,d),f=a?lt.Bz.toString():p,h=a?(0,l.gU)((m=r,(Number(m)+Number(m)*Number(m)/100).toString()),d):p;var m;const y=ut.$.encode(["address","address","address","uint256","bool"],[t,n,e,f,null!==o&&void 0!==o&&o]),g=this.generateTxCallback({rawTxMethod:async()=>c.populateTransaction.flashLoan(this.flashLiquidationAddress,[n],[h],[0],i,y,"0"),from:i});return s.push({tx:g,txType:u.ns.DLP_ACTION,gas:this.generateTxPriceEstimation(s,g,u.UQ.liquidationFlash)}),s}}(0,s.__decorate)([d.en,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Wt.prototype,"deposit",null),(0,s.__decorate)([d.en,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.lw)("amount")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__param)(0,(0,p.Oh)("aTokenAddress")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Wt.prototype,"withdraw",null),(0,s.__decorate)([d.en,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.K5)("amount")),(0,s.__param)(0,(0,p.Oh)("debtTokenAddress")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Wt.prototype,"borrow",null),(0,s.__decorate)([d.en,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__param)(0,(0,p.lw)("amount")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Wt.prototype,"repay",null),(0,s.__decorate)([d.en,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Array)],Wt.prototype,"swapBorrowRateMode",null),(0,s.__decorate)([d.en,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Array)],Wt.prototype,"setUsageAsCollateral",null),(0,s.__decorate)([d.en,(0,s.__param)(0,(0,p.Oh)("liquidator")),(0,s.__param)(0,(0,p.Oh)("liquidatedUser")),(0,s.__param)(0,(0,p.Oh)("debtReserve")),(0,s.__param)(0,(0,p.Oh)("collateralReserve")),(0,s.__param)(0,(0,p.K5)("purchaseAmount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Wt.prototype,"liquidationCall",null),(0,s.__decorate)([d.Yr,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("fromAsset")),(0,s.__param)(0,(0,p.Oh)("fromAToken")),(0,s.__param)(0,(0,p.Oh)("toAsset")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__param)(0,(0,p.Oh)("augustus")),(0,s.__param)(0,(0,p.K5)("fromAmount")),(0,s.__param)(0,(0,p.K5)("minToAmount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Wt.prototype,"swapCollateral",null),(0,s.__decorate)([d.j7,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("fromAsset")),(0,s.__param)(0,(0,p.Oh)("fromAToken")),(0,s.__param)(0,(0,p.Oh)("assetToRepay")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__param)(0,(0,p.K5)("repayWithAmount")),(0,s.__param)(0,(0,p.K5)("repayAmount")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Wt.prototype,"repayWithCollateral",null),(0,s.__decorate)([d.j7,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("fromAsset")),(0,s.__param)(0,(0,p.Oh)("fromAToken")),(0,s.__param)(0,(0,p.Oh)("assetToRepay")),(0,s.__param)(0,(0,p.Oh)("onBehalfOf")),(0,s.__param)(0,(0,p.K5)("repayWithAmount")),(0,s.__param)(0,(0,p.K5)("repayAmount")),(0,s.__param)(0,(0,p.Oh)("augustus")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Wt.prototype,"paraswapRepayWithCollateral",null),(0,s.__decorate)([d.bt,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("collateralAsset")),(0,s.__param)(0,(0,p.Oh)("borrowedAsset")),(0,s.__param)(0,(0,p.K5)("debtTokenCover")),(0,s.__param)(0,(0,p.Oh)("initiator")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Wt.prototype,"flashLiquidation",null);class Vt extends c.Z{constructor(e,t){super(e,Et);const{POOL:n,WETH_GATEWAY:r,L2_ENCODER:a}=null!==t&&void 0!==t?t:{};this.poolAddress=null!==n&&void 0!==n?n:"",this.l2EncoderAddress=null!==a&&void 0!==a?a:"",this.wethGatewayAddress=null!==r&&void 0!==r?r:"",this.v3PoolService=new Zt(e,t),this.erc20_2612Service=new Ye(e),this.erc20Service=new mt(e),this.synthetixService=new St.K(e),this.wethGatewayService=new Bt(e,this.erc20Service,r),this.l2PoolService=new It(e,{l2PoolAddress:this.poolAddress,encoderAddress:this.l2EncoderAddress}),this.contractInterface=Et.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:a,useOptimizedPath:i,encodedTxData:o})=>{let s={};const c=null!==r&&void 0!==r?r:e,d=null!==a&&void 0!==a?a:"0";if(t.toLowerCase()===l.hP.toLowerCase())s=this.wethGatewayService.generateDepositEthTxData({lendingPool:this.poolAddress,user:e,amount:n,onBehalfOf:c,referralCode:d});else if(i)if(o)s=this.l2PoolService.generateEncodedSupplyTxData({encodedTxData:o,user:e});else{const r={user:e,reserve:t,amount:n,onBehalfOf:c,referralCode:d};s=this.l2PoolService.generateSupplyTxData(r)}else{const r=this.contractInterface.encodeFunctionData("supply",[t,n,c,d]);s.to=this.poolAddress,s.from=e,s.data=r,s.gasLimit=dt.O$.from(l.eB[u.UQ.supply].recommended)}return s},generateSignedTxData:({user:e,reserve:t,amount:n,onBehalfOf:r,referralCode:a,useOptimizedPath:i,signature:o,deadline:s,encodedTxData:c})=>{const d=(0,ze.splitSignature)(o);let p={};const f=null!==r&&void 0!==r?r:e,h=null!==a&&void 0!==a?a:"0";if(i)if(c)p=this.l2PoolService.generateEncodedSupplyWithPermitTxData({encodedTxData:c,user:e,signature:o});else{const r={user:e,reserve:t,amount:n,referralCode:h,onBehalfOf:f,permitR:d.r,permitS:d.s,permitV:d.v,deadline:Number(s)};p=this.l2PoolService.generateSupplyWithPermitTxData(r)}else{const r=this.contractInterface.encodeFunctionData("supplyWithPermit",[t,n,f,h,s,d.v,d.r,d.s]);p.to=this.poolAddress,p.from=e,p.data=r,p.gasLimit=dt.O$.from(l.eB[u.UQ.supplyWithPermit].recommended)}return p}},this.borrowTxBuilder={generateTxData:({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:a,onBehalfOf:i,referralCode:o,useOptimizedPath:s,encodedTxData:c})=>{let d={};const p=null!==o&&void 0!==o?o:"0",f=null!==i&&void 0!==i?i:e,h=r===u.tk.Variable?2:1;if(t.toLowerCase()===l.hP.toLowerCase()){if(!a)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:a,interestRateMode:r,referralCode:p})}else if(s)if(c)d=this.l2PoolService.generateEncodedBorrowTxData({encodedTxData:c,user:e});else{const r={user:e,reserve:t,amount:n,onBehalfOf:f,referralCode:p,numericRateMode:h};d=this.l2PoolService.generateBorrowTxData(r)}else{const r=this.contractInterface.encodeFunctionData("borrow",[t,n,h,p,f]);d.to=this.poolAddress,d.from=e,d.data=r,d.gasLimit=dt.O$.from(l.eB[u.UQ.borrow].recommended)}return d}}}}class qt 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 mt(e),this.synthetixService=new St.K(e),this.wethGatewayService=new Bt(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:a})=>{let i={};if(t.toLowerCase()===l.hP.toLowerCase())i=this.wethGatewayService.generateDepositEthTxData({lendingPool:this.lendingPoolAddress,user:e,amount:n,onBehalfOf:r,referralCode:a});else{const o=this.contractInterface.encodeFunctionData("deposit",[t,n,null!==r&&void 0!==r?r:e,null!==a&&void 0!==a?a:"0"]);i.to=this.lendingPoolAddress,i.from=e,i.data=o,i.gasLimit=dt.O$.from(l.eB[u.UQ.deposit].recommended)}return i}},this.borrowTxBuilder={generateTxData:({user:e,reserve:t,amount:n,interestRateMode:r,debtTokenAddress:a,onBehalfOf:i,referralCode:o})=>{let s={};const c=null!==o&&void 0!==o?o:"0",d=null!==i&&void 0!==i?i:e,p=r===u.tk.Variable?2:1;if(t.toLowerCase()===l.hP.toLowerCase()){if(!a)throw new Error("To borrow ETH you need to pass the stable or variable WETH debt Token Address corresponding the interestRateMode");s=this.wethGatewayService.generateBorrowEthTxData({lendingPool:this.lendingPoolAddress,user:e,amount:n,debtTokenAddress:a,interestRateMode:r,referralCode:c})}else{const r=this.contractInterface.encodeFunctionData("borrow",[t,n,p,c,d]);s.to=this.lendingPoolAddress,s.from=e,s.data=r,s.gasLimit=dt.O$.from(l.eB[u.UQ.borrow].recommended)}return s}}}}const $t=[{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 Me.vU($t)}static connect(e,t){return new f.CH(e,$t,t)}}Yt.abi=$t;const Kt={"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 Qt{constructor(e){if(!(0,je.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,je.isAddress)(e))throw new Error("Lending pool address is not valid");return this._contract.getReservesList(e)}async getReservesData({lendingPoolAddressProvider:e}){if(!(0,je.isAddress)(e))throw new Error("Lending pool address is not valid");return this._contract.getReservesData(e)}async getUserReservesData({lendingPoolAddressProvider:e,user:t}){if(!(0,je.isAddress)(e))throw new Error("Lending pool address is not valid");if(!(0,je.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:Kt[t.underlyingAsset.toLowerCase()]?Kt[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 Xt{static connect(e,t){return new f.CH(e,Jt,t)}}const Jt=[{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 en extends c.Z{constructor(e,t){super(e,Xt),this.faucetAddress=null!==t&&void 0!==t?t:""}mint({userAddress:e,reserve:t,tokenSymbol:n}){const r=(0,l.gU)("1000",18),a=l.Ry[n]?l.Ry[n]:r,i=this.getContractInstance(this.faucetAddress),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.mint(t,a),from:e,value:l.k8});return[{tx:o,txType:u.ns.FAUCET_MINT,gas:this.generateTxPriceEstimation([],o)}]}}(0,s.__decorate)([d.QL,(0,s.__param)(0,(0,p.Oh)("userAddress")),(0,s.__param)(0,(0,p.Oh)("reserve")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Array)],en.prototype,"mint",null);const tn=[{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"}],nn="0x6101006040523480156200001257600080fd5b5060405162003410380380620034108339810160408190526200003591620007c5565b838383838383838282600033600080546001600160a01b0319166001600160a01b038316908117825560405192935091600080516020620033f0833981519152908290a350816001600160a01b031663fca513a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000b9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000df91906200082d565b6001600160a01b0390811660805291821660a052811660c05260405163fb04e17b60e01b8152600060048201529082169063fb04e17b90602401602060405180830381865afa15801562000137573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015d919062000854565b15620001b05760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420612076616c696420417567757374757320616464726573730000000060448201526064015b60405180910390fd5b6001600160a01b031660e052505060018055620001cd81620001e5565b620001d7620002f2565b505050505050505062000a40565b6000546001600160a01b03163314620002415760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620001a7565b6001600160a01b038116620002a85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620001a7565b600080546040516001600160a01b0380851693921691600080516020620033f083398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600060c0516001600160a01b031663d1946dbc6040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000335573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200035f91908101906200088e565b905060005b8151811015620003c857620003b360c0516000198484815181106200038d576200038d62000960565b60200260200101516001600160a01b0316620003cc60201b62000cf6179092919060201c565b80620003bf8162000976565b91505062000364565b5050565b8015806200044a5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801562000422573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004489190620009a0565b155b620004be5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401620001a7565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b17909152620005169185916200051b16565b505050565b600062000577826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620005f960201b62000e32179092919060201c565b80519091501562000516578080602001905181019062000598919062000854565b620005165760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401620001a7565b60606200060a848460008562000612565b949350505050565b606082471015620006755760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620001a7565b600080866001600160a01b03168587604051620006939190620009ed565b60006040518083038185875af1925050503d8060008114620006d2576040519150601f19603f3d011682016040523d82523d6000602084013e620006d7565b606091505b509092509050620006eb87838387620006f6565b979650505050505050565b60608315620007675782516200075f576001600160a01b0385163b6200075f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620001a7565b50816200060a565b6200060a83838151156200077e5781518083602001fd5b8060405162461bcd60e51b8152600401620001a7919062000a0b565b6001600160a01b0381168114620007b057600080fd5b50565b8051620007c0816200079a565b919050565b60008060008060808587031215620007dc57600080fd5b8451620007e9816200079a565b6020860151909450620007fc816200079a565b60408601519093506200080f816200079a565b606086015190925062000822816200079a565b939692955090935050565b6000602082840312156200084057600080fd5b81516200084d816200079a565b9392505050565b6000602082840312156200086757600080fd5b815180151581146200084d57600080fd5b634e487b7160e01b600052604160045260246000fd5b60006020808385031215620008a257600080fd5b82516001600160401b0380821115620008ba57600080fd5b818501915085601f830112620008cf57600080fd5b815181811115620008e457620008e462000878565b8060051b604051601f19603f830116810181811085821117156200090c576200090c62000878565b6040529182528482019250838101850191888311156200092b57600080fd5b938501935b8285101562000954576200094485620007b3565b8452938501939285019262000930565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b60006000198214156200099957634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208284031215620009b357600080fd5b5051919050565b60005b83811015620009d7578181015183820152602001620009bd565b83811115620009e7576000848401525b50505050565b6000825162000a01818460208701620009ba565b9190910192915050565b602081526000825180602084015262000a2c816040850160208701620009ba565b601f01601f19169190910160400192915050565b60805160a05160c05160e05161291b62000ad56000396000818161019d01526113b20152600081816101e70152818161033f015281816103740152818161071801528181610834015281816108f8015281816109ee01528181610a8501528181610afc01528181610f0001528181610fd401526110a6015260006101080152600081816101760152611c05015261291b6000f3fe608060405234801561001057600080fd5b50600436106100e95760003560e01c8063715018a61161008c5780638da5cb5b116100665780638da5cb5b14610209578063920f5c841461021a578063c05603741461023d578063f2fde38b1461025957600080fd5b8063715018a6146101d257806371f893ea146101da5780637535d246146101e257600080fd5b806332e4b286116100c857806332e4b2861461015a57806338013f02146101715780633a82986714610198578063636aa619146101bf57600080fd5b8062ae3bf8146100ee5780630542975c146101035780630a03635114610147575b600080fd5b6101016100fc366004611d34565b61026c565b005b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b610101610155366004611d34565b610330565b610163610bb881565b60405190815260200161013e565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b6101016101cd366004611f13565b61039b565b610101610976565b6101016109ea565b61012a7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031661012a565b61022d61022836600461202a565b610aef565b604051901515815260200161013e565b61024661173081565b60405161ffff909116815260200161013e565b610101610267366004611d34565b610c0c565b6000546001600160a01b0316331461029f5760405162461bcd60e51b81526004016102969061212f565b60405180910390fd5b61032d6102b46000546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156102f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031c9190612164565b6001600160a01b0384169190610e49565b50565b6103656001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000006000610cf6565b61032d6001600160a01b0382167f0000000000000000000000000000000000000000000000000000000000000000600019610cf6565b60608201516040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156103e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040a9190612164565b905081604001516000146104b657815160208301516040808501516060860151608087015160a0880151935163016a5aab60e31b81523360048201523060248201526044810195909552606485019290925260ff16608484015260a483015260c48201526001600160a01b0390911690630b52d5589060e401600060405180830381600087803b15801561049d57600080fd5b505af11580156104b1573d6000803e3d6000fd5b505050505b600019836020015114156105c1576000806104d48560000151610eda565b915091508460400151600214610551576040516370a0823160e01b81523360048201526001600160a01b038216906370a0823190602401602060405180830381865afa158015610528573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054c9190612164565b6105b9565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610595573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b99190612164565b602086015250505b6040805160c0808201835285516001600160a01b0316825260208087015181840152868401518385015290860151606083015260a0808701516080840152339083015291519091600091610617918491016121d5565b60408051601f1981840301815260018084528383019092529250600091906020808301908036833701905050905085606001518160008151811061065d5761065d61223b565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090508660800151816000815181106106b2576106b261223b565b60209081029190910101526040805160018082528183019092526000918160200160208202803683370190505090506002816000815181106106f6576106f661223b565b602090810291909101015260405163ab9c4b5d60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ab9c4b5d9061075b90309087908790879033908c906117309060040161228c565b600060405180830381600087803b15801561077557600080fd5b505af1158015610789573d6000803e3d6000fd5b5050505060608801516040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156107d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fc9190612164565b9050600061080a888361235e565b9050801561096a5760608a0151604051636eb1769f60e11b81523060048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152600092169063dd62ed3e90604401602060405180830381865afa158015610885573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a99190612164565b9050818110156108c0576108c08b60600151610330565b60608b015160405163573ade8160e01b81526001600160a01b03918216600482015260248101849052600260448201523360648201527f00000000000000000000000000000000000000000000000000000000000000009091169063573ade81906084016020604051808303816000875af1158015610943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109679190612164565b50505b50505050505050505050565b6000546001600160a01b031633146109a05760405162461bcd60e51b81526004016102969061212f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d1946dbc6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610a4a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a729190810190612380565b905060005b8151811015610aeb57610ad97f0000000000000000000000000000000000000000000000000000000000000000600019848481518110610ab957610ab961223b565b60200260200101516001600160a01b0316610cf69092919063ffffffff16565b80610ae381612426565b915050610a77565b5050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b5f5760405162461bcd60e51b815260206004820152601360248201527210d05313115497d35554d517d09157d413d3d3606a1b6044820152606401610296565b6001600160a01b0384163014610bb05760405162461bcd60e51b8152602060048201526016602482015275494e49544941544f525f4d5553545f42455f5448495360501b6044820152606401610296565b610bfc83838c8c6000818110610bc857610bc861223b565b9050602002016020810190610bdd9190611d34565b8b8b6000818110610bf057610bf061223b565b90506020020135610f86565b5060019998505050505050505050565b6000546001600160a01b03163314610c365760405162461bcd60e51b81526004016102969061212f565b6001600160a01b038116610c9b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610296565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b801580610d705750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e9190612164565b155b610ddb5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610296565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052610e2d90849061111e565b505050565b6060610e4184846000856111f0565b949350505050565b60405163a9059cbb60e01b8082526001600160a01b0384166004830152602482018390529060008060448382895af1610e86573d6000803e3d6000fd5b50610e90846112cb565b610ed45760405162461bcd60e51b815260206004820152601560248201527423a83b191d103330b4b632b2103a3930b739b332b960591b6044820152606401610296565b50505050565b6040516335ea6a7560e01b81526001600160a01b038281166004830152600091829182917f0000000000000000000000000000000000000000000000000000000000000000909116906335ea6a75906024016101e060405180830381865afa158015610f4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6e91906124ca565b90508061014001518161012001519250925050915091565b6000610f94848601866125ed565b9050610fb481608001518260600151858460000151868660200151611374565b508051604051636eb1769f60e11b81523060048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152600092169063dd62ed3e90604401602060405180830381865afa158015611025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110499190612164565b9050816020015181101561106257815161106290610330565b8151602083015160408085015160a0860151915163573ade8160e01b81526001600160a01b03948516600482015260248101939093526044830152821660648201527f00000000000000000000000000000000000000000000000000000000000000009091169063573ade81906084016020604051808303816000875af11580156110f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111159190612164565b50505050505050565b6000611173826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e329092919063ffffffff16565b805190915015610e2d578080602001905181019061119191906126a4565b610e2d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610296565b6060824710156112515760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610296565b600080866001600160a01b0316858760405161126d91906126c6565b60006040518083038185875af1925050503d80600081146112aa576040519150601f19603f3d011682016040523d82523d6000602084013e6112af565b606091505b50915091506112c087838387611aac565b979650505050505050565b60006112f1565b62461bcd60e51b60005260206004528060245250806044525060646000fd5b3d801561133057602081146113615761132b7f475076323a206d616c666f726d6564207472616e7366657220726573756c7400601f6112d2565b61136e565b823b611358576113587311d41d8c8e881b9bdd08184818dbdb9d1c9858dd60621b60146112d2565b6001915061136e565b3d6000803e600051151591505b50919050565b60008060008780602001905181019061138d91906126e2565b60405163fb04e17b60e01b81526001600160a01b0380831660048301529294509092507f00000000000000000000000000000000000000000000000000000000000000009091169063fb04e17b90602401602060405180830381865afa1580156113fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141f91906126a4565b61145e5760405162461bcd60e51b815260206004820152601060248201526f494e56414c49445f415547555354555360801b6044820152606401610296565b600061146988611b22565b60ff169050600061147988611b22565b60ff16905060006114898a611be3565b905060006114968a611be3565b905060006114ee6114ab612710610bb8611c72565b6114e86114c36114bc88600a612854565b8790611c82565b6114e26114db6114d48b600a612854565b8890611c82565b8e90611c82565b90611cac565b90611cbf565b9050808a111561154c5760405162461bcd60e51b815260206004820152602360248201527f6d6178416d6f756e74546f5377617020657863656564206d617820736c69707060448201526261676560e81b6064820152608401610296565b50506040516370a0823160e01b8152306004820152600093506001600160a01b038b1692506370a082319150602401602060405180830381865afa158015611598573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bc9190612164565b90508581101561160e5760405162461bcd60e51b815260206004820181905260248201527f494e53554646494349454e545f42414c414e43455f4245464f52455f535741506044820152606401610296565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa158015611655573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116799190612164565b90506000836001600160a01b031663d2c4b5986040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df9190612860565b60405163095ea7b360e01b81526001600160a01b03808316600483015260006024830152919250908b169063095ea7b3906044016020604051808303816000875af1158015611732573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175691906126a4565b5060405163095ea7b360e01b81526001600160a01b038281166004830152602482018a90528b169063095ea7b3906044016020604051808303816000875af11580156117a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ca91906126a4565b508b156118435760048c101580156117ee575084516117ea906020611ce5565b8c11155b61183a5760405162461bcd60e51b815260206004820152601d60248201527f544f5f414d4f554e545f4f46465345545f4f55545f4f465f52414e47450000006044820152606401610296565b8660208d018601525b6000846001600160a01b03168660405161185d91906126c6565b6000604051808303816000865af19150503d806000811461189a576040519150601f19603f3d011682016040523d82523d6000602084013e61189f565b606091505b50509050806118b2573d6000803e3d6000fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038d16906370a0823190602401602060405180830381865afa1580156118f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191d9190612164565b9050611929818661235e565b97508988111561197b5760405162461bcd60e51b815260206004820152601860248201527f57524f4e475f42414c414e43455f41465445525f5357415000000000000000006044820152606401610296565b6040516370a0823160e01b81523060048201526000906119f29086906001600160a01b038f16906370a0823190602401602060405180830381865afa1580156119c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ec9190612164565b90611ce5565b905089811015611a445760405162461bcd60e51b815260206004820152601c60248201527f494e53554646494349454e545f414d4f554e545f5245434549564544000000006044820152606401610296565b8b6001600160a01b03168d6001600160a01b03167fbf77fd13a39d14dc0da779342c14105c38d9a5d0c60f2caa22f5fd1d5525416d8b84604051611a92929190918252602082015260400190565b60405180910390a350505050505050509695505050505050565b60608315611b18578251611b11576001600160a01b0385163b611b115760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610296565b5081610e41565b610e418383611cf5565b600080826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b87919061287d565b9050604d8160ff161115611bdd5760405162461bcd60e51b815260206004820152601a60248201527f544f4f5f4d414e595f444543494d414c535f4f4e5f544f4b454e0000000000006044820152606401610296565b92915050565b60405163b3596f0760e01b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063b3596f0790602401602060405180830381865afa158015611c4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bdd9190612164565b80820182811015611bdd57600080fd5b6000821580611ca357505081810281838281611ca057611ca061289a565b04145b611bdd57600080fd5b6000611cb882846128b0565b9392505050565b600081156113881983900484111517611cd757600080fd5b506127109102611388010490565b80820382811115611bdd57600080fd5b815115611d055781518083602001fd5b8060405162461bcd60e51b815260040161029691906128d2565b6001600160a01b038116811461032d57600080fd5b600060208284031215611d4657600080fd5b8135611cb881611d1f565b8035611d5c81611d1f565b919050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715611d9a57611d9a611d61565b60405290565b60405160e0810167ffffffffffffffff81118282101715611d9a57611d9a611d61565b6040516101e0810167ffffffffffffffff81118282101715611d9a57611d9a611d61565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e1057611e10611d61565b604052919050565b600067ffffffffffffffff821115611e3257611e32611d61565b50601f01601f191660200190565b600082601f830112611e5157600080fd5b8135611e64611e5f82611e18565b611de7565b818152846020838601011115611e7957600080fd5b816020850160208301376000918101602001919091529392505050565b60ff8116811461032d57600080fd5b600060c08284031215611eb757600080fd5b611ebf611d77565b90508135611ecc81611d1f565b8082525060208201356020820152604082013560408201526060820135611ef281611e96565b806060830152506080820135608082015260a082013560a082015292915050565b60008060e08385031215611f2657600080fd5b823567ffffffffffffffff80821115611f3e57600080fd5b9084019060e08287031215611f5257600080fd5b611f5a611da0565b611f6383611d51565b81526020830135602082015260408301356040820152611f8560608401611d51565b60608201526080830135608082015260a083013560a082015260c083013582811115611fb057600080fd5b611fbc88828601611e40565b60c083015250809450505050611fd58460208501611ea5565b90509250929050565b60008083601f840112611ff057600080fd5b50813567ffffffffffffffff81111561200857600080fd5b6020830191508360208260051b850101111561202357600080fd5b9250929050565b600080600080600080600080600060a08a8c03121561204857600080fd5b893567ffffffffffffffff8082111561206057600080fd5b61206c8d838e01611fde565b909b50995060208c013591508082111561208557600080fd5b6120918d838e01611fde565b909950975060408c01359150808211156120aa57600080fd5b6120b68d838e01611fde565b909750955060608c013591506120cb82611d1f565b90935060808b013590808211156120e157600080fd5b818c0191508c601f8301126120f557600080fd5b81358181111561210457600080fd5b8d602082850101111561211657600080fd5b6020830194508093505050509295985092959850929598565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561217657600080fd5b5051919050565b60005b83811015612198578181015183820152602001612180565b83811115610ed45750506000910152565b600081518084526121c181602086016020860161217d565b601f01601f19169290920160200192915050565b60208152600060018060a01b038084511660208401526020840151604084015260408401516060840152606084015160c0608085015261221860e08501826121a9565b9050608085015160a08501528160a08601511660c0850152809250505092915050565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b8381101561228157815187529582019590820190600101612265565b509495945050505050565b6001600160a01b03888116825260e0602080840182905289519184018290526000928a820192909190610100860190855b818110156122db5785518516835294830194918301916001016122bd565b505085810360408701526122ef818c612251565b935050505082810360608401526123068188612251565b6001600160a01b0387166080850152905082810360a084015261232981866121a9565b91505061233c60c083018461ffff169052565b98975050505050505050565b634e487b7160e01b600052601160045260246000fd5b60008282101561237057612370612348565b500390565b8051611d5c81611d1f565b6000602080838503121561239357600080fd5b825167ffffffffffffffff808211156123ab57600080fd5b818501915085601f8301126123bf57600080fd5b8151818111156123d1576123d1611d61565b8060051b91506123e2848301611de7565b81815291830184019184810190888411156123fc57600080fd5b938501935b8385101561233c578451925061241683611d1f565b8282529385019390850190612401565b600060001982141561243a5761243a612348565b5060010190565b60006020828403121561245357600080fd5b6040516020810181811067ffffffffffffffff8211171561247657612476611d61565b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114611d5c57600080fd5b805164ffffffffff81168114611d5c57600080fd5b805161ffff81168114611d5c57600080fd5b60006101e082840312156124dd57600080fd5b6124e5611dc3565b6124ef8484612441565b81526124fd60208401612483565b602082015261250e60408401612483565b604082015261251f60608401612483565b606082015261253060808401612483565b608082015261254160a08401612483565b60a082015261255260c084016124a3565b60c082015261256360e084016124b8565b60e0820152610100612576818501612375565b90820152610120612588848201612375565b9082015261014061259a848201612375565b908201526101606125ac848201612375565b908201526101806125be848201612483565b908201526101a06125d0848201612483565b908201526101c06125e2848201612483565b908201529392505050565b6000602082840312156125ff57600080fd5b813567ffffffffffffffff8082111561261757600080fd5b9083019060c0828603121561262b57600080fd5b612633611d77565b823561263e81611d1f565b80825250602083013560208201526040830135604082015260608301358281111561266857600080fd5b61267487828601611e40565b6060830152506080830135608082015260a0830135925061269483611d1f565b60a0810192909252509392505050565b6000602082840312156126b657600080fd5b81518015158114611cb857600080fd5b600082516126d881846020870161217d565b9190910192915050565b600080604083850312156126f557600080fd5b825167ffffffffffffffff81111561270c57600080fd5b8301601f8101851361271d57600080fd5b805161272b611e5f82611e18565b81815286602083850101111561274057600080fd5b61275182602083016020860161217d565b809450505050602083015161276581611d1f565b809150509250929050565b600181815b808511156127ab57816000190482111561279157612791612348565b8085161561279e57918102915b93841c9390800290612775565b509250929050565b6000826127c257506001611bdd565b816127cf57506000611bdd565b81600181146127e557600281146127ef5761280b565b6001915050611bdd565b60ff84111561280057612800612348565b50506001821b611bdd565b5060208310610133831016604e8410600b841016171561282e575081810a611bdd565b6128388383612770565b806000190482111561284c5761284c612348565b029392505050565b6000611cb883836127b3565b60006020828403121561287257600080fd5b8151611cb881611d1f565b60006020828403121561288f57600080fd5b8151611cb881611e96565b634e487b7160e01b600052601260045260246000fd5b6000826128cd57634e487b7160e01b600052601260045260246000fd5b500490565b602081526000611cb860208301846121a956fea264697066735822122083916c2e867ffe5cc5586626cf69491670775747aa658d7b03240abbbe94052f64736f6c634300080a00338be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0";class rn extends f.lV{constructor(...e){e.length>1?super(...e):super(tn,nn,e[0])}deploy(e,t,n,r,a){return super.deploy(e,t,n,r,a||{})}getDeployTransaction(e,t,n,r,a){return super.getDeployTransaction(e,t,n,r,a||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static createInterface(){return new Me.vU(tn)}static connect(e,t){return new f.CH(e,tn,t)}}rn.bytecode=nn,rn.abi=tn;class an extends c.Z{constructor(e,t){super(e,rn),this.debtSwitchAddress=null!==t&&void 0!==t?t:"",this.contractInterface=rn.createInterface(),this.debtSwitch=this.debtSwitch.bind(this)}debtSwitch({user:e,debtAssetUnderlying:t,debtRepayAmount:n,debtRateMode:r,newAssetDebtToken:a,newAssetUnderlying:i,maxNewDebtAmount:o,repayAll:s,txCalldata:c,augustus:u,deadline:d,sigV:p,sigR:f,sigS:h,signedAmount:m}){const y=ut.$.encode(["bytes","address"],[c,u]),g={debtAsset:t,debtRepayAmount:n,debtRateMode:r,newDebtAsset:i,maxNewDebtAmount:o,offset:s?(0,l.mz)(c):0,paraswapData:y},b={debtToken:a,value:m,deadline:d,v:p,r:f,s:h},v={},w=this.contractInterface.encodeFunctionData("swapDebt",[g,b]);return v.to=this.debtSwitchAddress,v.data=w,v.from=e,v}}class on{static connect(e,t){return new f.CH(e,sn,t)}}const sn=[{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 cn extends c.Z{constructor(e){super(e,on)}claimRewards({user:e,assets:t,to:n,incentivesControllerAddress:r}){const a=this.getContractInstance(r),i=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.claimRewards(t,lt.Bz.toString(),null!==n&&void 0!==n?n:e),from:e});return[{tx:i,txType:u.ns.REWARD_ACTION,gas:this.generateTxPriceEstimation([],i)}]}}(0,s.__decorate)([d.nX,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("incentivesControllerAddress")),(0,s.__param)(0,(0,p.Oh)("to")),(0,s.__param)(0,(0,p.Gq)("assets")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Array)],cn.prototype,"claimRewards",null);const un=[{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 ln{static createInterface(){return new Me.vU(un)}static connect(e,t){return new f.CH(e,un,t)}}ln.abi=un;class dn extends c.Z{constructor(e){super(e,ln)}claimRewards({user:e,assets:t,to:n,incentivesControllerAddress:r,reward:a}){const i=this.getContractInstance(r),o=this.generateTxCallback({rawTxMethod:async()=>i.populateTransaction.claimRewards(t,lt.Bz.toString(),null!==n&&void 0!==n?n:e,a),from:e});return[{tx:o,txType:u.ns.REWARD_ACTION,gas:this.generateTxPriceEstimation([],o)}]}claimAllRewards({user:e,assets:t,to:n,incentivesControllerAddress:r}){const a=this.getContractInstance(r),i=this.generateTxCallback({rawTxMethod:async()=>a.populateTransaction.claimAllRewards(t,null!==n&&void 0!==n?n:e),from:e});return[{tx:i,txType:u.ns.REWARD_ACTION,gas:this.generateTxPriceEstimation([],i)}]}}(0,s.__decorate)([d.nX,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("incentivesControllerAddress")),(0,s.__param)(0,(0,p.Oh)("to")),(0,s.__param)(0,(0,p.Oh)("reward")),(0,s.__param)(0,(0,p.Gq)("assets")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Array)],dn.prototype,"claimRewards",null),(0,s.__decorate)([d.nX,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__param)(0,(0,p.Oh)("incentivesControllerAddress")),(0,s.__param)(0,(0,p.Oh)("to")),(0,s.__param)(0,(0,p.Gq)("assets")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Array)],dn.prototype,"claimAllRewards",null);var pn=n(27484),fn=n.n(pn),hn=n(87385),mn=n(83601);function yn(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 gn(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 cn(t().jsonRpcProvider()),l=new dn(t().jsonRpcProvider()),!t().currentMarketData.v3){e.next=16;break}if("all"!==r.symbol){e.next=13;break}return e.abrupt("return",l.claimAllRewards({user:s,assets:c,to:s,incentivesControllerAddress:r.incentiveControllerAddress}));case 13:return e.abrupt("return",l.claimRewards({user:s,assets:c,to:s,incentivesControllerAddress:r.incentiveControllerAddress,reward:r.rewardTokenAddress}));case 14:e.next=17;break;case 16:return e.abrupt("return",u.claimRewards({user:s,assets:r.assets,to:s,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,hn.eH)(t().currentChainId)},poolComputed:{get minRemainingBaseTokenBalance(){if(!t())return"0.001";var e=gn({},t()),n=e.currentNetworkConfig,r=e.currentChainId,a=n.underlyingChainId||r;return hn.AU[a]||"0.001"}},generateSignatureRequest:function(){var e=(0,r.Z)(o().mark((function e(n){var r,a,i,s,c,u,l,d,p,f,h,m,y;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.token,a=n.amount,i=n.deadline,s=n.spender,c=t().jsonRpcProvider(),u=new mt(c),l=new Ye(c),e.next=6,u.getTokenData(r);case 6:return d=e.sent,p=d.name,e.next=10,c.getNetwork();case 10:return f=e.sent,h=f.chainId,e.next=14,l.getNonce({token:r,owner:t().account});case 14:return m=e.sent,y={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:p,version:"1",chainId:h,verifyingContract:r},message:{owner:t().account,spender:s,value:a,nonce:m,deadline:i}},e.abrupt("return",JSON.stringify(y));case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),estimateGasLimit:function(){var e=(0,r.Z)(o().mark((function e(n){var r,a,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t().jsonRpcProvider(),a=n.gasLimit?n.gasLimit:dt.O$.from("0"),delete n.gasLimit,e.next=5,r.estimateGas(n);case 5:return i=(i=e.sent).mul(115).div(100),n.gasLimit=i.gt(a)?i:a,e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}},wn=n(19485),_n=(bn={},(0,a.Z)(bn,u.a_.mainnet,{"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48":!1,"0x6b175474e89094c44da98b954eedeac495271d0f":!1,"0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9":!0,"0x514910771af9ca656af840dff83e8264ecf986ca":!1,"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599":!1,"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2":!1,"0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0":!0,"0x40d16fc0246ad3160ccc09b8d0d3a2cd28ae6c2f":!0,"0x5f98805a4e8be255a32880fdec7f6728c6568ba0":!0}),(0,a.Z)(bn,u.a_.arbitrum_one,{"0xf97f4df75117a78c1a5a0dbb814af92458539fb4":!0,"0xff970a61a04b1ca14834a43f5de4533ebddb5cc8":!0,"0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f":!0,"0x82af49447d8a07e3bd95bd0d56f35241523fbab1":!0,"0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9":!0,"0xba5ddd1f9d7f570dc94a51479a000e3bce967196":!0,"0xd22a58f79e9481d1a88e00c343885a588b34b68b":!1}),(0,a.Z)(bn,u.a_.fantom,{"0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e":!0,"0xb3654dc3d10ea7645f8319668e8f54d2574fbdc8":!0,"0x04068da6c83afcfa0e13ba15a6696662335d5b75":!0,"0x321162cd933e2be498cd2267a90534a804051b11":!0,"0x74b23882a30290451a17c44f4f05243b6b58c76d":!0,"0x049d68029688eabf473097a2fc38ef61633a3c7a":!0,"0x6a07a792ab2965c72a5b8088d3a069a7ac3a993b":!0,"0xae75a438b2e0cb8bb01ec1e1e376de11d44477cc":!1,"0x1e4f97b9f9f913c46f1632781732927b9019c68b":!0}),(0,a.Z)(bn,u.a_.polygon,{"0x4e3decbb3645551b8a19f0ea1678079fcb33fb4c":!0}),(0,a.Z)(bn,u.a_.harmony,{}),(0,a.Z)(bn,u.a_.avalanche,{"0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7":!0}),(0,a.Z)(bn,u.a_.optimism,{"0x76fb31fb4af56892a25e32cfc43de717950c9278":!1}),bn),xn=n(11163);function Tn(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 Sn(e){for(var t=1;to.populateTransaction.stakeWithPermit(e,d,r,p.v,p.r,p.s),from:e});return a.push({tx:f,txType:u.ns.STAKE_ACTION,gas:this.generateTxPriceEstimation(a,f,u.UQ.stakeWithPermit)}),a}async stake(e,t,n){const r=[],{decimalsOf:a,isApproved:i,approve:o}=this.erc20Service,s=this.getContractInstance(this.stakingContractAddress),c=await s.STAKED_TOKEN(),d=await a(c),p=(0,l.gU)(t,d);if(!(await i({token:c,user:e,spender:this.stakingContractAddress,amount:t}))){const t=o({user:e,token:c,spender:this.stakingContractAddress,amount:l.zn});r.push(t)}const f=this.generateTxCallback({rawTxMethod:async()=>s.populateTransaction.stake(null!==n&&void 0!==n?n:e,p),from:e,action:u.UQ.stake});return r.push({tx:f,txType:u.ns.STAKE_ACTION,gas:this.generateTxPriceEstimation(r,f,u.UQ.stake)}),r}async redeem(e,t){let n;const r=this.getContractInstance(this.stakingContractAddress);if("-1"===t)n=lt.Bz.toString();else{const{decimalsOf:e}=this.erc20Service,a=await r.STAKED_TOKEN(),i=await e(a);n=(0,l.gU)(t,i)}const a=this.generateTxCallback({rawTxMethod:async()=>r.populateTransaction.redeem(e,n),from:e,gasSurplus:20});return[{tx:a,txType:u.ns.STAKE_ACTION,gas:this.generateTxPriceEstimation([],a)}]}cooldown(e){const t=this.getContractInstance(this.stakingContractAddress),n=this.generateTxCallback({rawTxMethod:async()=>t.populateTransaction.cooldown(),from:e});return[{tx:n,txType:u.ns.STAKE_ACTION,gas:this.generateTxPriceEstimation([],n)}]}async claimRewards(e,t){let n;const r=this.getContractInstance(this.stakingContractAddress);if("-1"===t)n=lt.Bz.toString();else{const{decimalsOf:e}=this.erc20Service,a=await r.REWARD_TOKEN(),i=await e(a);n=(0,l.gU)(t,i)}const a=this.generateTxCallback({rawTxMethod:async()=>r.populateTransaction.claimRewards(e,n),from:e,gasSurplus:20,action:u.UQ.claimRewards});return[{tx:a,txType:u.ns.STAKE_ACTION,gas:this.generateTxPriceEstimation([],a,u.UQ.claimRewards)}]}async claimRewardsAndStake(e,t){let n;const r=this.getContractInstance(this.stakingContractAddress);if("-1"===t)n=lt.Bz.toString();else{const{decimalsOf:e}=this.erc20Service,a=await r.STAKED_TOKEN(),i=await e(a);n=(0,l.gU)(t,i)}const a=this.generateTxCallback({rawTxMethod:async()=>r.populateTransaction.claimRewardsAndStake(e,n),from:e,gasSurplus:20,action:u.UQ.claimRewardsAndStake});return[{tx:a,txType:u.ns.STAKE_ACTION,gas:this.generateTxPriceEstimation([],a,u.UQ.claimRewardsAndStake)}]}}(0,s.__decorate)([d.Tc,(0,s.__param)(0,(0,p.Oh)()),(0,s.__param)(1,(0,p.K5)()),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[String,String,String]),(0,s.__metadata)("design:returntype",Promise)],Cn.prototype,"signStaking",null),(0,s.__decorate)([d.Tc,(0,s.__param)(0,(0,p.Oh)()),(0,s.__param)(1,(0,p.K5)()),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[String,String,Object,String]),(0,s.__metadata)("design:returntype",Promise)],Cn.prototype,"stakeWithPermit",null),(0,s.__decorate)([d.GW,(0,s.__param)(0,(0,p.Oh)()),(0,s.__param)(1,(0,p.K5)()),(0,s.__param)(2,(0,p.Oh)()),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[String,String,String]),(0,s.__metadata)("design:returntype",Promise)],Cn.prototype,"stake",null),(0,s.__decorate)([d.GW,(0,s.__param)(0,(0,p.Oh)()),(0,s.__param)(1,(0,p.lw)()),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[String,String]),(0,s.__metadata)("design:returntype",Promise)],Cn.prototype,"redeem",null),(0,s.__decorate)([d.GW,(0,s.__param)(0,(0,p.Oh)()),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[String]),(0,s.__metadata)("design:returntype",Array)],Cn.prototype,"cooldown",null),(0,s.__decorate)([d.GW,(0,s.__param)(0,(0,p.Oh)()),(0,s.__param)(1,(0,p.lw)()),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[String,String]),(0,s.__metadata)("design:returntype",Promise)],Cn.prototype,"claimRewards",null),(0,s.__decorate)([d.GW,(0,s.__param)(0,(0,p.Oh)()),(0,s.__param)(1,(0,p.lw)()),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[String,String]),(0,s.__metadata)("design:returntype",Promise)],Cn.prototype,"claimRewardsAndStake",null);var Pn=n(84568),Rn=function(e,t){function n(){var e=t().currentNetworkConfig;return e.isFork&&e.underlyingChainId===Pn.X.chainId?t().jsonRpcProvider():(0,be.VH)(Pn.X.chainId)}return{signStakingApproval:function(e){var r=e.token,a=e.amount,i=e.deadline,o=n(),s=new Cn(o,{TOKEN_STAKING_ADDRESS:Pn.X.tokens[r].TOKEN_STAKING}),c=t().account;return s.signStaking(c,a,i)},stakeWithPermit:function(e){var r=e.token,a=e.amount,i=e.signature,o=e.deadline,s=n(),c=new Cn(s,{TOKEN_STAKING_ADDRESS:Pn.X.tokens[r].TOKEN_STAKING}),u=t().account;return c.stakeWithPermit(u,a,i,o)},stake:function(e){var r=e.token,a=e.amount,i=e.onBehalfOf,o=n(),s=new Cn(o,{TOKEN_STAKING_ADDRESS:Pn.X.tokens[r].TOKEN_STAKING}),c=t().account;return s.stake(c,a,i)},cooldown:function(e){return(0,r.Z)(o().mark((function r(){var a,i,s;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=n(),i=t().account,s=new Cn(a,{TOKEN_STAKING_ADDRESS:Pn.X.tokens[e].TOKEN_STAKING}),r.abrupt("return",s.cooldown(i));case 4:case"end":return r.stop()}}),r)})))()},claimStakeRewards:function(e){var r=e.token,a=e.amount,i=t().account,o=n();return new Cn(o,{TOKEN_STAKING_ADDRESS:Pn.X.tokens[r].TOKEN_STAKING}).claimRewards(i,a)},claimRewardsAndStake:function(e){var r=e.token,a=e.amount,i=t().account,o=n();return new Cn(o,{TOKEN_STAKING_ADDRESS:Pn.X.tokens[r].TOKEN_STAKING}).claimRewardsAndStake(i,a)},redeem:function(e){var r=n(),a=t().account,i=new Cn(r,{TOKEN_STAKING_ADDRESS:Pn.X.tokens[e].TOKEN_STAKING});return function(e){return i.redeem(a,e)}}}};function In(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 Dn(e){for(var t=1;t0?s=this.splitSignedPermits(r):o=await this.approveSupplyAssets(t,e);let c=[];if(a&&a.length>0)c=this.splitSignedCreditDelegationPermits(a);else{const e=await this.approveDelegationTokens(t,i);o.push(...e)}const l=e.map((e=>e.underlyingAsset)),d=n.map((e=>({asset:e.underlyingAsset,rateMode:e.rateMode===u.tk.Stable?1:2}))),p=this.getContractInstance(this.MIGRATOR_ADDRESS),f=this.generateTxCallback({rawTxMethod:async()=>p.populateTransaction.migrate(l,d,s,c),from:t});return o.push({tx:f,txType:u.ns.V3_MIGRATION_ACTION,gas:this.generateTxPriceEstimation(s.length>0?[]:o,f,u.UQ.migrateV3)}),o}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 a=t[r],i=new Ln.Z(a.amount),o=i.dividedBy(10),s=i.plus(o).toFixed(0);return this.baseDebtTokenService.approveDelegation({user:e,delegatee:this.MIGRATOR_ADDRESS,debtTokenAddress:a.debtTokenAddress,amount:s})})).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 a=t[r];return this.erc20Service.approve({user:e,token:a.aToken,spender:this.MIGRATOR_ADDRESS,amount:lt.Bz.toString()})})).filter((e=>Boolean(e)))}splitSignedPermits(e){return e.map((e=>{const{aToken:t,deadline:n,value:r,signedPermit:a}=e,i=ze.splitSignature(a);return{aToken:t,deadline:n,value:r,v:i.v,r:i.r,s:i.s}}))}splitSignedCreditDelegationPermits(e){return e.map((e=>{const{debtToken:t,deadline:n,value:r,signedPermit:a}=e,i=ze.splitSignature(a);return{debtToken:t,deadline:n,value:r,v:i.v,r:i.r,s:i.s}}))}}(0,s.__decorate)([d.Wt,(0,s.__param)(0,(0,p.Oh)("asset")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Un.prototype,"getMigrationSupply",null),(0,s.__decorate)([d.Wt,(0,s.__param)(0,(0,p.Oh)("user")),(0,s.__metadata)("design:type",Function),(0,s.__metadata)("design:paramtypes",[Object]),(0,s.__metadata)("design:returntype",Promise)],Un.prototype,"migrate",null);var Fn=n(67728);function zn(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 Gn(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 ge(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 ge(e,(function(e){var r,a=(0,Fn.Wx)(t(),n),i=null===(r=e.selectedMigrationSupplyAssets[a])||void 0===r?void 0:r.enforced;a>=0&&(e.selectedMigrationSupplyAssets.forEach((function(e){e.enforced=!1})),e.selectedMigrationSupplyAssets[a].enforced=!i)}))}))},resetMigrationSelectedAssets:function(){e({selectedMigrationBorrowAssets:[],selectedMigrationSupplyAssets:[]})},selectAllSupply:function(n){var r=(0,Fn.xk)(t(),n).supplyReserves;if(t().selectedMigrationSupplyAssets.length==r.length||0!=t().selectedMigrationSupplyAssets.length)e({selectedMigrationSupplyAssets:[]});else{var a=r.filter((function(e){return void 0===e.migrationDisabled})).filter((function(e){var n=e.underlyingAsset;return(0,Fn.Wx)(t(),n)<0})).map((function(e){return{underlyingAsset:e.underlyingAsset,enforced:!1}}));e({selectedMigrationSupplyAssets:[].concat((0,Nn.Z)(t().selectedMigrationSupplyAssets),(0,Nn.Z)(a))})}},selectAllBorrow:function(n){var r=(0,Fn.xk)(t(),n).borrowReserves;if(t().selectedMigrationBorrowAssets.length==r.length||0!=t().selectedMigrationBorrowAssets.length)e({selectedMigrationBorrowAssets:[]});else{var a=r.filter((function(e){return void 0===e.migrationDisabled})).filter((function(e){return(0,Fn.Z4)(t().selectedMigrationBorrowAssets,e)<0}));e({selectedMigrationBorrowAssets:[].concat((0,Nn.Z)(t().selectedMigrationBorrowAssets),(0,Nn.Z)(a))})}},getApprovePermitsForSelectedAssets:function(){var n=fn()().unix(),r=(0,Fn.Bx)(t(),n,!0),a=(0,Fn.OH)(t(),n).map((function(e){var t=e.reserve;return{amount:e.increasedAmount,underlyingAsset:t.aTokenAddress,permitType:"SUPPLY_MIGRATOR_V3"}})),i=[].concat((0,Nn.Z)(a),(0,Nn.Z)(r));return e({approvalPermitsForMigrationAssets:i}),i},migrateWithoutPermits:function(){var n=fn()().unix();e({timestamp:n});var r=(0,Fn.rB)(t(),n),a=(0,Fn.k6)(t(),n),i=t().account,o=(0,Fn.Bx)(t(),n).map((function(e){return{debtTokenAddress:e.underlyingAsset,amount:e.amount}}));return t().getMigrationServiceInstance().migrate({repayAssets:a,supplyAssets:r,user:i,creditDelegationApprovals:o,signedCreditDelegationPermits:[],signedSupplyPermits:[]})},migrateWithPermits:function(){var n=(0,r.Z)(o().mark((function n(r,a){var i,s,c,u,l,d,p,f,h;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=fn()().unix(),e({timestamp:i}),s=(0,Fn.Gc)(t(),r,a),c=s.creditDelegationPermits,u=s.supplyPermits,l=(0,Fn.rB)(t(),i),d=(0,Fn.k6)(t(),i),p=t().account,f=(0,Fn.Bx)(t(),i,!0),h=f.map((function(e){return{debtTokenAddress:e.underlyingAsset,amount:e.amount}})),n.abrupt("return",t().getMigrationServiceInstance().migrate({repayAssets:d,supplyAssets:l,user:p,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 i=t().jsonRpcProvider(),o=t().getMigratorAddress(),s=(0,mn.xI)(t()),c=new Zt(i,{POOL:s.addresses.LENDING_POOL,REPAY_WITH_COLLATERAL_ADAPTER:s.addresses.REPAY_WITH_COLLATERAL_ADAPTER,SWAP_COLLATERAL_ADAPTER:s.addresses.SWAP_COLLATERAL_ADAPTER,WETH_GATEWAY:s.addresses.WETH_GATEWAY,L2_ENCODER:s.addresses.L2_ENCODER}),u=t().migrationServiceInstances,l=new Un(i,o,c);return e({migrationServiceInstances:Gn(Gn({},u),{},(0,a.Z)({},n,l))}),l},getMigrationExceptionSupplyBalances:function(){var n=(0,r.Z)(o().mark((function n(r){var a,i,s,c,u;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=t().currentNetworkConfig.underlyingChainId||t().currentChainId,!((i=Wn[a])&&i.length>0)||t().exceptionsBalancesLoading||0!=Object.keys(t().migrationExceptions).length){n.next=12;break}if(e({exceptionsBalancesLoading:!0}),!((s=r.filter((function(e){return i.indexOf(e.underlyingAsset)>=0&&"0"!==e.scaledATokenBalance}))).length>0)){n.next=12;break}return e({exceptionsBalancesLoading:!0}),c=s.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 ge(e,(function(e){u.forEach((function(t,n){var r=(0,De.Z)(t,2),a=r[0],i=r[1],o=s[n].underlyingAsset;e.migrationExceptions[o]={v2UnderlyingAsset:o,v3UnderlyingAsset:a.toLowerCase(),amount:i.toString()}})),e.exceptionsBalancesLoading=!1}))}));case 12:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}},qn=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()}))},$n=(0,be.Zs)(),Yn=[{inputs:[{internalType:"address",name:"_address",type:"address"}],name:"getL2ReverseRecord",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],Kn=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new f.CH("0x135a32c16765cef67dec3ae53b03f8c21feec0d8",Yn,$n),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)}}(),Qn=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Kn(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)}}(),Xn=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().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,qn(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)}}(),Jn=function(){var e=(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.next=2,Qn(t);case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.next=7,Xn(n);case 7:return r=e.sent,e.abrupt("return",{name:n,avatar:r,type:Hn.ENS});case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),er=(0,be.Zs)(),tr=[{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"name",outputs:[{name:"ret",type:"string"}],payable:!1,type:"function"}],nr=function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new f.CH("0xCE70B7f5BB44BE2f8A7f37f8c162240440Fc6218",tr,er),r=(0,je.namehash)(t.substring(2)+".addr.reverse"),e.prev=2,e.next=5,n.name(r);case 5:return a=e.sent,e.abrupt("return",a);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)}}(),rr=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,nr(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)}}(),ar=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().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,qn(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)}}(),ir=function(){var e=(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.next=2,rr(t);case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.next=7,ar(n);case 7:return r=e.sent,e.abrupt("return",{name:n,avatar:r,type:Hn.ENS});case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),or=[ir,Jn];!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ENS=1]="ENS"}(Hn||(Hn={}));var sr=function(e,t){return{defaultDomain:null,domainsLoading:!1,userDomains:[],fetchConnectedWalletDomains:function(){var n=(0,r.Z)(o().mark((function n(){var r,a,i,s;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e({domainsLoading:!0}),a=t().account,n.next=4,Promise.all(or.map((function(e){return e(a)})));case 4:i=n.sent,s=i.filter((function(e){return null!==e})),e({userDomains:s,defaultDomain:null!==(r=s[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})}}},cr=n(32113);function ur(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 lr(e){for(var t=1;t0)return n;var r=e.selectedMigrationSupplyAssets.filter((function(n){var r=w(e,n),a=t[r],i=_(e,a);return!!a&&"0"==i&&!a.reserve.isIsolated}));return r.length>0?r:e.selectedMigrationSupplyAssets.filter((function(n){var r=w(e,n),a=t[r];return"0"==_(e,a)&&a.reserve.isIsolated}))}(e,x);if(T.length>0){var S=w(e,T[0]),k=x[S];"0"!==k.reserve.reserveLiquidationThreshold&&k.reserve.isIsolated&&(v=y(y({},k.reserve),{},{enteringIsolationMode:!0}))}}var E=l.filter((function(e){return"0"!==e.underlyingBalance})),A=function(e){var t=[];return e.forEach((function(e){"0"!==e.stableBorrows&&t.push(y(y({},e),{},{interestRate:i.tk.Stable,increasedStableBorrows:e.stableBorrows,increasedVariableBorrows:"0",debtKey:e.reserve.stableDebtTokenAddress})),"0"!==e.variableBorrows&&t.push(y(y({},e),{},{interestRate:i.tk.Variable,increasedStableBorrows:"0",increasedVariableBorrows:e.variableBorrows,debtKey:e.reserve.variableDebtTokenAddress}))})),t}(l),O=E.map((function(t){var n,r,a,i,o=!0,c=w(e,t),u=null===(n=x[c])||void 0===n?void 0:n.reserve.isIsolated,l="0"==(null===(r=x[c])||void 0===r?void 0:r.underlyingBalance),d=x[c];if(d){var p=(0,s.hE)(d.reserve.supplyCap).minus(d.reserve.totalLiquidity),f=d.reserve.formattedBaseLTVasCollateral;0!==b&&d.reserve.eModeCategoryId!==b&&(f=d.reserve.formattedEModeLtv),i={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:f},d.reserve.isFrozen?a=g.ReserveFrozen:p.isGreaterThan(t.underlyingBalance)||(a=g.NotEnoughtSupplies)}else a=g.V3AssetMissing;return o=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,y(y({},t),{},{usageAsCollateralEnabledOnUserV3:o,isolatedOnV3:u,canBeEnforced:l,migrationDisabled:a,v3Rates:i})})),C=A.map((function(e){var t,n,r,a=null===(t=x[e.underlyingAsset])||void 0===t?void 0:t.reserve;v&&!a.borrowableInIsolation&&(n=g.IsolationModeBorrowDisabled);var i=x[e.underlyingAsset];if(i){var c=i.reserve.formattedReserveLiquidationThreshold;0!==b&&(null===a||void 0===a?void 0:a.eModeCategoryId)!==b&&(n=g.EModeBorrowDisabled,c=i.reserve.formattedEModeLiquidationThreshold),r={stableBorrowAPY:i.stableBorrowAPY,variableBorrowAPY:i.reserve.variableBorrowAPY,supplyAPY:i.reserve.stableBorrowAPY,aIncentivesData:i.reserve.aIncentivesData,vIncentivesData:i.reserve.vIncentivesData,sIncentivesData:i.reserve.sIncentivesData,priceInUSD:i.reserve.priceInUSD,liquidationThreshold:c},(0,s.hE)((0,o.gU)(e.increasedStableBorrows,e.reserve.decimals)).plus((0,o.gU)(e.increasedVariableBorrows,e.reserve.decimals)).isGreaterThan(i.reserve.availableLiquidity)?n=g.InsufficientLiquidity:i.reserve.flashLoanEnabled?i.reserve.isFrozen&&(n=g.ReserveFrozen):n=g.AssetNotFlashloanable}else n=g.V3AssetMissing;return y(y({},e),{},{v3Rates:r,migrationDisabled:n})}));return{totalCollateralUSD:d.totalCollateralUSD,totalBorrowsUSD:d.totalBorrowsUSD,healthFactor:d.healthFactor,borrowReserves:C,supplyReserves:O,isolatedReserveV3:v}},T=function(e,t){var n=x(e,t),r=n.supplyReserves,a=n.isolatedReserveV3,i=r.filter((function(t){return b(e,t.underlyingAsset)>=0}));return i.sort((function(e){return a?a.underlyingAsset==e.underlyingAsset?-1:1:e.isolatedOnV3?1:-1})),i},S=function(e,t){return T(e,t).map((function(e){var t=O(e.underlyingBalance),n=(0,o.gU)(t,e.reserve.decimals);return y(y({},e),{},{increasedAmount:n})}))},k=function(e,t){return S(e,t).map((function(e){var t=e.underlyingAsset,n=e.reserve,r=e.increasedAmount,a=Math.floor(Date.now()/1e3+3600);return{amount:r,aToken:n.aTokenAddress,underlyingAsset:t,deadline:a}}))},E=function(e,t){var n=Math.floor(Date.now()/1e3+3600);return C(e,t).map((function(e){return{underlyingAsset:e.underlyingAsset,amount:e.interestRate==i.tk.Stable?e.increasedStableBorrows:e.increasedVariableBorrows,deadline:n,debtToken:e.debtKey,rateMode:e.interestRate}}))},A=function(e,t,n){var r=e.approvalPermitsForMigrationAssets.map((function(e,n){return y(y({},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,a=e.amount;return{deadline:n,aToken:r,value:a,signedPermit:t}})),creditDelegationPermits:r.filter((function(e){return"BORROW_MIGRATOR_V3"===e.permitType})).map((function(e){var t=e.amount,r=e.signedPermit,a=e.underlyingAsset;return{deadline:n,debtToken:a,signedPermit:r,value:t}}))}},O=function(e){var t=(0,s.hE)(e);return t.plus(t.div(1e3)).toString()},C=function(e,t){return x(e,t).borrowReserves.filter((function(t){return v(e.selectedMigrationBorrowAssets,t)>=0}))},P=function(e,t){var n=M(e,t).userReservesData;return C(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==i.tk.Variable?r.reserve.variableDebtTokenAddress:r.reserve.stableDebtTokenAddress),y(y({},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,a=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=r.marketReferenceCurrencyDecimals,s=r.marketReferenceCurrencyPriceInUsd,l=(0,c.vl)({reserves:e,reserveIncentives:t,currentTimestamp:a,marketReferenceCurrencyDecimals:o,marketReferencePriceInUsd:s}),d=(0,u.G)({currentTimestamp:a,formattedReserves:l,marketReferenceCurrencyDecimals:o,marketReferencePriceInUsd:s,userReserves:n,userEmodeCategoryId:i});return d},I=function(e,t){var n,r=(0,p.qY)(e),a=x(e,t).borrowReserves,o=(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,o=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=a.find((function(t){return t.underlyingAsset==e.underlyingAsset}));return!!t&&void 0===t.migrationDisabled})).forEach((function(e){e.interestRate==i.tk.Stable?r="0":o="0"})),y(y({},t),{},{principalStableDebt:r,scaledATokenBalance:n,scaledVariableDebt:o})})))||[],s=(0,p.To)(r);return R(null===r||void 0===r?void 0:r.reserves,null===r||void 0===r?void 0:r.reserveIncentives,o,s,t,null===r||void 0===r?void 0:r.userEmodeCategoryId)},D=function(e,t,n){var r=M(e,t).userReservesData,a=C(e,t),c={};return a.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===i.tk.Stable?n.stableDebtAmount=(0,s.hE)(n.stableDebtAmount).plus((0,s.hE)(e.increasedStableBorrows)).toString():e.interestRate===i.tk.Variable&&(n.variableDebtAmount=(0,s.hE)(n.variableDebtAmount).plus((0,s.hE)(e.increasedVariableBorrows)).toString())}})),Object.keys(c).map((function(e){var t=c[e],r=(0,s.hE)(t.stableDebtAmount).plus(t.variableDebtAmount),a=(0,o.gU)(r.toString(),t.decimals);if(n){var i=new d.Z(a),u=i.dividedBy(10);a=i.plus(u).toFixed(0)}return{amount:a,underlyingAsset:t.variableDebtTokenAddress,permitType:"BORROW_MIGRATOR_V3"}}))},j=function(e,t){var n=M(e,t),r=(0,p.$)(e),a=T(e,t),i=P(e,t),c=a.reduce((function(e,t){return e[t.underlyingAsset]=t,e}),{}),u=i.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],a=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),i=c[a],d=t.scaledVariableDebt,p=t.scaledATokenBalance,f=t.usageAsCollateralEnabledOnUser,h=(0,s.hE)(t.reserve.variableBorrowIndex);if(r&&void 0===r.migrationDisabled){var m=(0,l.e9)((0,o.gU)(r.increasedVariableBorrows,t.reserve.decimals),h);d=(0,s.hE)(d).plus(m).toString()}if(n&&void 0===n.migrationDisabled){var g=(0,l.e9)((0,o.gU)(n.increasedStableBorrows,t.reserve.decimals),h);d=(0,s.hE)(d).plus(g).toString()}if(i){var b;f=i.usageAsCollateralEnabledOnUserV3;var v=(0,s.hE)(t.scaledATokenBalance),w=(0,s.hE)(t.reserve.liquidityIndex),_=(null===(b=e.migrationExceptions[a])||void 0===b?void 0:b.amount)||(0,o.gU)(i.underlyingBalance,t.reserve.decimals),x=(0,l.e9)(_,w);p=v.plus(x).toString()}return y(y({},t),{},{id:t.reserve.id,scaledVariableDebt:d,scaledATokenBalance:p,usageAsCollateralEnabledOnUser:f})})),f=(0,p.To)(r),h=R(null===r||void 0===r?void 0:r.reserves,null===r||void 0===r?void 0:r.reserveIncentives,d,f,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,p.$)(e),r=(0,p.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)},L=function(e,t){return void 0!==t.find((function(t){return t.underlyingAsset===e.underlyingAsset}))},B=function(e,t){var n=e.filter((function(e){return void 0===e.migrationDisabled}));return{activeSelections:n.filter((function(e){return L(e,t)})),activeUnselected:n.filter((function(e){return!L(e,t)}))}}},32113:function(e,t,n){"use strict";var r;n.d(t,{n:function(){return r},h:function(){return i}}),function(e){e.APPROVE="Transaction",e.PERMIT="Signed message"}(r||(r={}));var a=function(){var e=localStorage.getItem("walletApprovalPreferences");return e?JSON.parse(e):{}},i=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 i=a();i[r.toLowerCase()]=n,localStorage.setItem("walletApprovalPreferences",JSON.stringify(i)),e((function(){return{walletApprovalMethodPreference:n}}))}},refreshWalletApprovalMethod:function(){var n=t().account;if(""!==n){var i=a()[n.toLowerCase()];e((function(){return{walletApprovalMethodPreference:i||r.PERMIT}}))}}}}},79070:function(e,t,n){"use strict";n.d(t,{_:function(){return L},z:function(){return B}});var r=n(67294),a=n(17674),i=n(50029),o=n(92777),s=n(82262),c=n(59499),u=n(87794),l=n.n(u),d=n(24387),p=n(1279),f=n(45626),h=function(e,t){return e.toLocaleLowerCase()===t.toLocaleLowerCase()?"":e},m=function(){function e(t,n){(0,o.Z)(this,e),this.chainId=n,(0,c.Z)(this,"governanceService",void 0),this.governanceService=new d.d(t,{GOVERNANCE_ADDRESS:f.d.addresses.AAVE_GOVERNANCE_V2,GOVERNANCE_HELPER_ADDRESS:f.d.addresses.AAVE_GOVERNANCE_V2_HELPER,ipfsGateway:f.d.ipfsGateway})}return(0,s.Z)(e,[{key:"getVotingPowerAt",value:function(){var e=(0,i.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,i.Z)(l().mark((function e(t){var n,r,a;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,a=n.support,e.abrupt("return",{votingPower:(0,p.Fv)(r.toString(),18),support:a});case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPowers",value:function(){var e=(0,i.Z)(l().mark((function e(t){var n,r,i,o,s,c,u,d;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.user,r=f.d.aaveTokenAddress,i=f.d.stkAaveTokenAddress,e.next=4,this.governanceService.getTokensPower({user:n,tokens:[r,i]});case 4:return o=e.sent,s=(0,a.Z)(o,2),c=s[0],u=s[1],d={votingPower:(0,p.Fv)((0,p.hE)(c.votingPower.toString()).plus(u.votingPower.toString()).toString(),18),aaveTokenPower:c,stkAaveTokenPower:u,propositionPower:(0,p.Fv)((0,p.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}(),y=n(70655),g=n(29897),b=n(55206),v=n(64146);class w extends v.lV{constructor(e){super(_,x,e)}deploy(e,t,n,r,a,i,o,s){return super.deploy(e,t,n,r,a,i,o,s||{})}getDeployTransaction(e,t,n,r,a,i,o,s){return super.getDeployTransaction(e,t,n,r,a,i,o,s||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static connect(e,t){return new v.CH(e,_,t)}}const _=[{inputs:[{internalType:"address",name:"aave",type:"address"},{internalType:"address",name:"stkAave",type:"address"},{internalType:"address",name:"bpt",type:"address"},{internalType:"address",name:"stkBpt",type:"address"},{internalType:"address",name:"ethUsdPriceFeed",type:"address"},{internalType:"address",name:"aavePriceFeed",type:"address"},{internalType:"address",name:"bptPriceFeed",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AAVE",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"AAVE_PRICE_FEED",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"BPT",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"BPT_PRICE_FEED",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"ETH_USD_PRICE_FEED",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"STAKED_AAVE",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"STAKED_BPT",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAllStakedTokenData",outputs:[{components:[{internalType:"uint256",name:"stakedTokenTotalSupply",type:"uint256"},{internalType:"uint256",name:"stakedTokenTotalRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"stakeCooldownSeconds",type:"uint256"},{internalType:"uint256",name:"stakeUnstakeWindow",type:"uint256"},{internalType:"uint256",name:"stakedTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"rewardTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"stakeApy",type:"uint256"},{internalType:"uint128",name:"distributionPerSecond",type:"uint128"},{internalType:"uint256",name:"distributionEnd",type:"uint256"}],internalType:"struct IStakedTokenDataProvider.StakedTokenData",name:"stkAaveData",type:"tuple"},{components:[{internalType:"uint256",name:"stakedTokenTotalSupply",type:"uint256"},{internalType:"uint256",name:"stakedTokenTotalRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"stakeCooldownSeconds",type:"uint256"},{internalType:"uint256",name:"stakeUnstakeWindow",type:"uint256"},{internalType:"uint256",name:"stakedTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"rewardTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"stakeApy",type:"uint256"},{internalType:"uint128",name:"distributionPerSecond",type:"uint128"},{internalType:"uint256",name:"distributionEnd",type:"uint256"}],internalType:"struct IStakedTokenDataProvider.StakedTokenData",name:"stkBptData",type:"tuple"},{internalType:"uint256",name:"ethPrice",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getAllStakedTokenUserData",outputs:[{components:[{internalType:"uint256",name:"stakedTokenTotalSupply",type:"uint256"},{internalType:"uint256",name:"stakedTokenTotalRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"stakeCooldownSeconds",type:"uint256"},{internalType:"uint256",name:"stakeUnstakeWindow",type:"uint256"},{internalType:"uint256",name:"stakedTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"rewardTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"stakeApy",type:"uint256"},{internalType:"uint128",name:"distributionPerSecond",type:"uint128"},{internalType:"uint256",name:"distributionEnd",type:"uint256"}],internalType:"struct IStakedTokenDataProvider.StakedTokenData",name:"stkAaveData",type:"tuple"},{components:[{internalType:"uint256",name:"stakedTokenUserBalance",type:"uint256"},{internalType:"uint256",name:"stakedTokenRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"underlyingTokenUserBalance",type:"uint256"},{internalType:"uint256",name:"rewardsToClaim",type:"uint256"},{internalType:"uint40",name:"userCooldownTimestamp",type:"uint40"},{internalType:"uint216",name:"userCooldownAmount",type:"uint216"}],internalType:"struct IStakedTokenDataProvider.StakedTokenUserData",name:"stkAaveUserData",type:"tuple"},{components:[{internalType:"uint256",name:"stakedTokenTotalSupply",type:"uint256"},{internalType:"uint256",name:"stakedTokenTotalRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"stakeCooldownSeconds",type:"uint256"},{internalType:"uint256",name:"stakeUnstakeWindow",type:"uint256"},{internalType:"uint256",name:"stakedTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"rewardTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"stakeApy",type:"uint256"},{internalType:"uint128",name:"distributionPerSecond",type:"uint128"},{internalType:"uint256",name:"distributionEnd",type:"uint256"}],internalType:"struct IStakedTokenDataProvider.StakedTokenData",name:"stkBptData",type:"tuple"},{components:[{internalType:"uint256",name:"stakedTokenUserBalance",type:"uint256"},{internalType:"uint256",name:"stakedTokenRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"underlyingTokenUserBalance",type:"uint256"},{internalType:"uint256",name:"rewardsToClaim",type:"uint256"},{internalType:"uint40",name:"userCooldownTimestamp",type:"uint40"},{internalType:"uint216",name:"userCooldownAmount",type:"uint216"}],internalType:"struct IStakedTokenDataProvider.StakedTokenUserData",name:"stkBptUserData",type:"tuple"},{internalType:"uint256",name:"ethPrice",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getStkAaveData",outputs:[{components:[{internalType:"uint256",name:"stakedTokenTotalSupply",type:"uint256"},{internalType:"uint256",name:"stakedTokenTotalRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"stakeCooldownSeconds",type:"uint256"},{internalType:"uint256",name:"stakeUnstakeWindow",type:"uint256"},{internalType:"uint256",name:"stakedTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"rewardTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"stakeApy",type:"uint256"},{internalType:"uint128",name:"distributionPerSecond",type:"uint128"},{internalType:"uint256",name:"distributionEnd",type:"uint256"}],internalType:"struct IStakedTokenDataProvider.StakedTokenData",name:"stkAaveData",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getStkAaveUserData",outputs:[{components:[{internalType:"uint256",name:"stakedTokenTotalSupply",type:"uint256"},{internalType:"uint256",name:"stakedTokenTotalRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"stakeCooldownSeconds",type:"uint256"},{internalType:"uint256",name:"stakeUnstakeWindow",type:"uint256"},{internalType:"uint256",name:"stakedTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"rewardTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"stakeApy",type:"uint256"},{internalType:"uint128",name:"distributionPerSecond",type:"uint128"},{internalType:"uint256",name:"distributionEnd",type:"uint256"}],internalType:"struct IStakedTokenDataProvider.StakedTokenData",name:"stkAaveData",type:"tuple"},{components:[{internalType:"uint256",name:"stakedTokenUserBalance",type:"uint256"},{internalType:"uint256",name:"stakedTokenRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"underlyingTokenUserBalance",type:"uint256"},{internalType:"uint256",name:"rewardsToClaim",type:"uint256"},{internalType:"uint40",name:"userCooldownTimestamp",type:"uint40"},{internalType:"uint216",name:"userCooldownAmount",type:"uint216"}],internalType:"struct IStakedTokenDataProvider.StakedTokenUserData",name:"stkAaveUserData",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getStkBptAaveUserData",outputs:[{components:[{internalType:"uint256",name:"stakedTokenTotalSupply",type:"uint256"},{internalType:"uint256",name:"stakedTokenTotalRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"stakeCooldownSeconds",type:"uint256"},{internalType:"uint256",name:"stakeUnstakeWindow",type:"uint256"},{internalType:"uint256",name:"stakedTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"rewardTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"stakeApy",type:"uint256"},{internalType:"uint128",name:"distributionPerSecond",type:"uint128"},{internalType:"uint256",name:"distributionEnd",type:"uint256"}],internalType:"struct IStakedTokenDataProvider.StakedTokenData",name:"stkBptData",type:"tuple"},{components:[{internalType:"uint256",name:"stakedTokenUserBalance",type:"uint256"},{internalType:"uint256",name:"stakedTokenRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"underlyingTokenUserBalance",type:"uint256"},{internalType:"uint256",name:"rewardsToClaim",type:"uint256"},{internalType:"uint40",name:"userCooldownTimestamp",type:"uint40"},{internalType:"uint216",name:"userCooldownAmount",type:"uint216"}],internalType:"struct IStakedTokenDataProvider.StakedTokenUserData",name:"stkBptUserData",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getStkBptData",outputs:[{components:[{internalType:"uint256",name:"stakedTokenTotalSupply",type:"uint256"},{internalType:"uint256",name:"stakedTokenTotalRedeemableAmount",type:"uint256"},{internalType:"uint256",name:"stakeCooldownSeconds",type:"uint256"},{internalType:"uint256",name:"stakeUnstakeWindow",type:"uint256"},{internalType:"uint256",name:"stakedTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"rewardTokenPriceEth",type:"uint256"},{internalType:"uint256",name:"stakeApy",type:"uint256"},{internalType:"uint128",name:"distributionPerSecond",type:"uint128"},{internalType:"uint256",name:"distributionEnd",type:"uint256"}],internalType:"struct IStakedTokenDataProvider.StakedTokenData",name:"stkBptData",type:"tuple"}],stateMutability:"view",type:"function"}],x="0x6101606040523480156200001257600080fd5b50604051620013f4380380620013f483398101604081905262000035916200009b565b6001600160601b0319606097881b811660e05295871b86166101005293861b85166101205291851b841661014052841b8316608052831b821660a05290911b1660c0526200012f565b80516001600160a01b03811681146200009657600080fd5b919050565b600080600080600080600060e0888a031215620000b6578283fd5b620000c1886200007e565b9650620000d1602089016200007e565b9550620000e1604089016200007e565b9450620000f1606089016200007e565b935062000101608089016200007e565b92506200011160a089016200007e565b91506200012160c089016200007e565b905092959891949750929550565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c6101205160601c6101405160601c611202620001f2600039806101bb528061028952806102b452806102e2528061036a52806104a652806104d15280610a4f52508061022e525080610252528061033f528061044f528061047a52806105cd52806105f8528061062a52806109ec52508061020a5250806105965280610a895250806101e65280610840525080610306528061039252806104fa52506112026000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063ad809caa1161008c578063cca44f0a11610066578063cca44f0a14610167578063cfe7b3121461018b578063eaf5b48f14610193578063f9f2634f146101a6576100cf565b8063ad809caa14610140578063b0f0abe914610148578063b7d1a98d14610150576100cf565b80632c1aa8d2146100d457806345afe360146100f257806348ccda3c146101075780634f0640861461010f5780638e6a6941146101175780639f8bf4da1461011f575b600080fd5b6100dc6101ae565b6040516100e99190611109565b60405180910390f35b6100fa6101e4565b6040516100e991906110f5565b6100fa610208565b6100fa61022c565b6100fa610250565b61013261012d366004610f46565b610274565b6040516100e9929190611144565b6100fa6102e0565b6100fa610304565b610158610328565b6040516100e993929190611118565b61017a610175366004610f46565b610428565b6040516100e9959493929190611161565b6100fa610594565b6101326101a1366004610f46565b6105b8565b6100dc61061d565b6101b6610e94565b6101df7f000000000000000000000000000000000000000000000000000000000000000061064a565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b61027c610e94565b610284610ee9565b6102ad7f000000000000000000000000000000000000000000000000000000000000000061064a565b91506102d97f000000000000000000000000000000000000000000000000000000000000000084610b4f565b9050915091565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b610330610e94565b610338610e94565b60006103637f000000000000000000000000000000000000000000000000000000000000000061064a565b925061038e7f000000000000000000000000000000000000000000000000000000000000000061064a565b91507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103e957600080fd5b505afa1580156103fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104219190610f85565b9050909192565b610430610e94565b610438610ee9565b610440610e94565b610448610ee9565b60006104737f000000000000000000000000000000000000000000000000000000000000000061064a565b945061049f7f000000000000000000000000000000000000000000000000000000000000000087610b4f565b93506104ca7f000000000000000000000000000000000000000000000000000000000000000061064a565b92506104f67f000000000000000000000000000000000000000000000000000000000000000087610b4f565b91507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561055157600080fd5b505afa158015610565573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105899190610f85565b905091939590929450565b7f000000000000000000000000000000000000000000000000000000000000000081565b6105c0610e94565b6105c8610ee9565b6105f17f000000000000000000000000000000000000000000000000000000000000000061064a565b91506102d97f000000000000000000000000000000000000000000000000000000000000000084610b4f565b610625610e94565b6101df7f00000000000000000000000000000000000000000000000000000000000000005b610652610e94565b816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561068b57600080fd5b505afa15801561069f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c39190610f85565b80825260405163266d6a8360e11b81526001600160a01b03841691634cdad506916106f191906004016111ab565b60206040518083038186803b15801561070957600080fd5b505afa15801561071d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107419190610f85565b816020018181525050816001600160a01b03166372b49d636040518163ffffffff1660e01b815260040160206040518083038186803b15801561078357600080fd5b505afa158015610797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bb9190610f85565b816040018181525050816001600160a01b031663359c4a966040518163ffffffff1660e01b815260040160206040518083038186803b1580156107fd57600080fd5b505afa158015610811573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108359190610f85565b8160600181815250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561089757600080fd5b505afa1580156108ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cf9190610f85565b8160a0018181525050816001600160a01b031663919cd40f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561091157600080fd5b505afa158015610925573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109499190610f85565b6101008201819052421061095e5760006109dc565b604051631e23703160e31b81526001600160a01b0383169063f11b81889061098a9085906004016110f5565b60606040518083038186803b1580156109a257600080fd5b505afa1580156109b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109da9190610f9d565b515b6001600160801b031660e08201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169083161415610a4d5760a0810151608082015260e08101518151610a43916001600160801b031690610e6b565b60c0820152610b4a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415610b4a577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ae057600080fd5b505afa158015610af4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b189190610f85565b6080820181905260a082015160e08301518351610b44936001600160801b039092169092029102610e6b565b60c08201525b919050565b610b57610ee9565b6040516370a0823160e01b81526001600160a01b038416906370a0823190610b839085906004016110f5565b60206040518083038186803b158015610b9b57600080fd5b505afa158015610baf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd39190610f85565b81526040516346df7f7160e11b81526001600160a01b03841690638dbefee290610c019085906004016110f5565b60206040518083038186803b158015610c1957600080fd5b505afa158015610c2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c519190610f85565b816060018181525050826001600160a01b031663312f6b836040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9357600080fd5b505afa158015610ca7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccb9190610f69565b6001600160a01b03166370a08231836040518263ffffffff1660e01b8152600401610cf691906110f5565b60206040518083038186803b158015610d0e57600080fd5b505afa158015610d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d469190610f85565b6040808301919091528151905163266d6a8360e11b81526001600160a01b03851691634cdad50691610d7b91906004016111ab565b60206040518083038186803b158015610d9357600080fd5b505afa158015610da7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcb9190610f85565b602082015260405163091030c360e01b81526001600160a01b0384169063091030c390610dfc9085906004016110f5565b604080518083038186803b158015610e1357600080fd5b505afa158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190610ffe565b6001600160d81b031660a083015264ffffffffff16608082015292915050565b600081610e7a57506000610e8e565b8164496cebb800840281610e8a57fe5b0490505b92915050565b6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160801b03168152602001600081525090565b6040518060c0016040528060008152602001600081526020016000815260200160008152602001600064ffffffffff16815260200160006001600160d81b031681525090565b80516001600160801b0381168114610b4a57600080fd5b600060208284031215610f57578081fd5b8135610f62816111b4565b9392505050565b600060208284031215610f7a578081fd5b8151610f62816111b4565b600060208284031215610f96578081fd5b5051919050565b600060608284031215610fae578081fd5b6040516060810181811067ffffffffffffffff82111715610fcb57fe5b604052610fd783610f2f565b8152610fe560208401610f2f565b6020820152604083015160408201528091505092915050565b60008060408385031215611010578081fd5b825164ffffffffff81168114611024578182fd5b60208401519092506001600160d81b0381168114611040578182fd5b809150509250929050565b805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c08301526001600160801b0360e08201511660e08301526101008082015181840152505050565b8051825260208082015190830152604080820151908301526060808201519083015260808082015164ffffffffff169083015260a0908101516001600160d81b0316910152565b6001600160a01b0391909116815260200190565b6101208101610e8e828461104b565b6102608101611127828661104b565b61113561012083018561104b565b82610240830152949350505050565b6101e08101611153828561104b565b610f626101208301846110ae565b6103e08101611170828861104b565b61117e6101208301876110ae565b61118c6101e083018661104b565b61119a6103008301856110ae565b826103c08301529695505050505050565b90815260200190565b6001600160a01b03811681146111c957600080fd5b5056fea2646970667358221220273c9b55009ee92e111a4be9075dfee70ec45d01bd9b462c1168dd428da4e0cc64736f6c63430007050033";class T{constructor(e){this._contract=w.connect(e.uiStakeDataProvider,e.provider)}async getUserStakeUIData({user:e}){const{stkAaveData:t,stkAaveUserData:n,stkBptData:r,stkBptUserData:a,ethPrice:i}=await this._contract.getAllStakedTokenUserData(e);return{stkAaveData:Object.assign(Object.assign({},t),{stakedTokenUserBalance:n.stakedTokenUserBalance,underlyingTokenUserBalance:n.underlyingTokenUserBalance,stakedTokenRedeemableAmount:n.stakedTokenRedeemableAmount,userCooldownAmount:n.userCooldownAmount,userCooldownTimestamp:n.userCooldownTimestamp,rewardsToClaim:n.rewardsToClaim}),stkBptData:Object.assign(Object.assign({},r),{stakedTokenUserBalance:a.stakedTokenUserBalance,underlyingTokenUserBalance:a.underlyingTokenUserBalance,stakedTokenRedeemableAmount:a.stakedTokenRedeemableAmount,userCooldownAmount:a.userCooldownAmount,userCooldownTimestamp:a.userCooldownTimestamp,rewardsToClaim:a.rewardsToClaim}),ethPrice:i}}async getUserStakeUIDataHumanized({user:e}){const t=await this.getUserStakeUIData({user:e});return{aave:{stakeTokenUserBalance:t.stkAaveData.stakedTokenUserBalance.toString(),underlyingTokenUserBalance:t.stkAaveData.underlyingTokenUserBalance.toString(),stakeTokenRedeemableAmount:t.stkAaveData.stakedTokenRedeemableAmount.toString(),userCooldownAmount:t.stkAaveData.userCooldownAmount.toString(),userCooldownTimestamp:t.stkAaveData.userCooldownTimestamp,userIncentivesToClaim:t.stkAaveData.rewardsToClaim.toString()},bpt:{stakeTokenUserBalance:t.stkBptData.stakedTokenUserBalance.toString(),underlyingTokenUserBalance:t.stkBptData.underlyingTokenUserBalance.toString(),stakeTokenRedeemableAmount:t.stkBptData.stakedTokenRedeemableAmount.toString(),userCooldownAmount:t.stkBptData.userCooldownAmount.toString(),userCooldownTimestamp:t.stkBptData.userCooldownTimestamp,userIncentivesToClaim:t.stkBptData.rewardsToClaim.toString()},ethPriceUsd:t.ethPrice.toString()}}async getGeneralStakeUIData(){const{stkAaveData:e,stkBptData:t,ethPrice:n}=await this._contract.getAllStakedTokenData();return{stkAaveData:e,stkBptData:t,ethPrice:n}}async getGeneralStakeUIDataHumanized(){const e=await this.getGeneralStakeUIData();return{aave:{stakeTokenTotalSupply:e.stkAaveData.stakedTokenTotalSupply.toString(),stakeTokenTotalRedeemableAmount:e.stkAaveData.stakedTokenTotalRedeemableAmount.toString(),stakeCooldownSeconds:e.stkAaveData.stakeCooldownSeconds.toNumber(),stakeUnstakeWindow:e.stkAaveData.stakeUnstakeWindow.toNumber(),stakeTokenPriceEth:e.stkAaveData.stakedTokenPriceEth.toString(),rewardTokenPriceEth:e.stkAaveData.rewardTokenPriceEth.toString(),stakeApy:e.stkAaveData.stakeApy.toString(),distributionPerSecond:e.stkAaveData.distributionPerSecond.toString(),distributionEnd:e.stkAaveData.distributionEnd.toString()},bpt:{stakeTokenTotalSupply:e.stkBptData.stakedTokenTotalSupply.toString(),stakeTokenTotalRedeemableAmount:e.stkAaveData.stakedTokenTotalRedeemableAmount.toString(),stakeCooldownSeconds:e.stkBptData.stakeCooldownSeconds.toNumber(),stakeUnstakeWindow:e.stkBptData.stakeUnstakeWindow.toNumber(),stakeTokenPriceEth:e.stkBptData.stakedTokenPriceEth.toString(),rewardTokenPriceEth:e.stkBptData.rewardTokenPriceEth.toString(),stakeApy:e.stkBptData.stakeApy.toString(),distributionPerSecond:e.stkBptData.distributionPerSecond.toString(),distributionEnd:e.stkBptData.distributionEnd.toString()},ethPriceUsd:e.ethPrice.toString()}}}(0,y.__decorate)([g.u$,(0,y.__param)(0,(0,b.Oh)("user")),(0,y.__metadata)("design:type",Function),(0,y.__metadata)("design:paramtypes",[Object]),(0,y.__metadata)("design:returntype",Promise)],T.prototype,"getUserStakeUIData",null),(0,y.__decorate)([g.u$,(0,y.__param)(0,(0,b.Oh)("user")),(0,y.__metadata)("design:type",Function),(0,y.__metadata)("design:paramtypes",[Object]),(0,y.__metadata)("design:returntype",Promise)],T.prototype,"getUserStakeUIDataHumanized",null);var S=function(){function e(t,n,r){(0,o.Z)(this,e),this.chainId=r,(0,c.Z)(this,"stakeDataService",void 0),this.stakeDataService=new T({uiStakeDataProvider:n,provider:t})}return(0,s.Z)(e,[{key:"getGeneralStakeUIDataHumanized",value:function(){var e=(0,i.Z)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stakeDataService.getGeneralStakeUIDataHumanized());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getUserStakeUIDataHumanized",value:function(){var e=(0,i.Z)(l().mark((function e(t){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.user,e.abrupt("return",this.stakeDataService.getUserStakeUIDataHumanized({user:n}));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toHash",value:function(){return this.chainId.toString()}}]),e}(),k=n(56371);class E extends v.lV{constructor(e){super(A,O,e)}static connect(e,t){return new v.CH(e,A,t)}}const A=[{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"}],O="0x608060405234801561001057600080fd5b50610a63806100206000396000f3fe6080604052600436106100385760003560e01c80630240534314610072578063b59b28ef146100a9578063f7888aec146100d65761006d565b3661006d5761004633610103565b61006b5760405162461bcd60e51b8152600401610062906109c9565b60405180910390fd5b005b600080fd5b34801561007e57600080fd5b5061009261008d366004610758565b61013f565b6040516100a092919061092f565b60405180910390f35b3480156100b557600080fd5b506100c96100c4366004610790565b6104b1565b6040516100a0919061098f565b3480156100e257600080fd5b506100f66100f1366004610758565b61058d565b6040516100a091906109e5565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061013757508115155b949350505050565b6060806000846001600160a01b0316630261bf8b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561017d57600080fd5b505afa158015610191573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b5919061073c565b90506060816001600160a01b031663d1946dbc6040518163ffffffff1660e01b815260040160006040518083038186803b1580156101f257600080fd5b505afa158015610206573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261022e91908101906107f9565b90506060815160010167ffffffffffffffff8111801561024d57600080fd5b50604051908082528060200260200182016040528015610277578160200160208202803683370190505b50905060005b82518110156102c65782818151811061029257fe5b60200260200101518282815181106102a657fe5b6001600160a01b039092166020928302919091019091015260010161027d565b5073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee818351815181106102e957fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506060815167ffffffffffffffff8111801561032357600080fd5b5060405190808252806020026020018201604052801561034d578160200160208202803683370190505b50905060005b835181101561046b576103646106b9565b856001600160a01b031663c44b11f785848151811061037f57fe5b60200260200101516040518263ffffffff1660e01b81526004016103a3919061091b565b60206040518083038186803b1580156103bb57600080fd5b505afa1580156103cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f391906108a4565b905060006104008261067d565b50505090508061042b57600084848151811061041857fe5b6020026020010181815250505050610463565b6104488a86858151811061043b57fe5b602002602001015161058d565b84848151811061045457fe5b60200260200101818152505050505b600101610353565b5061048a8773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61058d565b8184518151811061049757fe5b6020908102919091010152909450925050505b9250929050565b60608084830267ffffffffffffffff811180156104cd57600080fd5b506040519080825280602002602001820160405280156104f7578160200160208202803683370190505b50905060005b858110156105835760005b8481101561057a5761055588888481811061051f57fe5b90506020020160208101906105349190610719565b87878481811061054057fe5b90506020020160208101906100f19190610719565b83518490848802840190811061056757fe5b6020908102919091010152600101610508565b506001016104fd565b5095945050505050565b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156105c557506001600160a01b03821631610677565b6105d7826001600160a01b0316610103565b1561065f576040516370a0823160e01b81526001600160a01b038316906370a082319061060890869060040161091b565b60206040518083038186803b15801561062057600080fd5b505afa158015610634573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065891906108c9565b9050610677565b60405162461bcd60e51b8152600401610062906109a2565b92915050565b51670100000000000000811615159167020000000000000082161515916704000000000000008116151591670800000000000000909116151590565b6040518060200160405280600081525090565b805161067781610a15565b60008083601f8401126106e8578182fd5b50813567ffffffffffffffff8111156106ff578182fd5b60208301915083602080830285010111156104aa57600080fd5b60006020828403121561072a578081fd5b813561073581610a15565b9392505050565b60006020828403121561074d578081fd5b815161073581610a15565b6000806040838503121561076a578081fd5b823561077581610a15565b9150602083013561078581610a15565b809150509250929050565b600080600080604085870312156107a5578182fd5b843567ffffffffffffffff808211156107bc578384fd5b6107c8888389016106d7565b909650945060208701359150808211156107e0578384fd5b506107ed878288016106d7565b95989497509550505050565b6000602080838503121561080b578182fd5b825167ffffffffffffffff80821115610822578384fd5b818501915085601f830112610835578384fd5b815181811115610843578485fd5b83810291506108538483016109ee565b8181528481019084860184860187018a101561086d578788fd5b8795505b83861015610897576108838a826106cc565b835260019590950194918601918601610871565b5098975050505050505050565b6000602082840312156108b5578081fd5b6108bf60206109ee565b9151825250919050565b6000602082840312156108da578081fd5b5051919050565b6000815180845260208085019450808401835b83811015610910578151875295820195908201906001016108f4565b509495945050505050565b6001600160a01b0391909116815260200190565b604080825283519082018190526000906020906060840190828701845b828110156109715781516001600160a01b03168452928401929084019060010161094c565b5050508381038285015261098581866108e1565b9695505050505050565b60006020825261073560208301846108e1565b6020808252600d908201526c24a72b20a624a22faa27a5a2a760991b604082015260600190565b602080825260029082015261191960f11b604082015260600190565b90815260200190565b60405181810167ffffffffffffffff81118282101715610a0d57600080fd5b604052919050565b6001600160a01b0381168114610a2a57600080fd5b5056fea26469706673582212207ae67703d49267c117fb5657d5acf71315b42fa382a2989a68cd98ccc5351bc964736f6c634300060c0033";class C{constructor(e){this._contract=E.connect(e.walletBalanceProviderAddress,e.provider)}async balanceOf(e,t){if(!(0,k.isAddress)(e))throw new Error("User address is not a valid ethereum address");if(!(0,k.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,k.isAddress)(e))))throw new Error("One of the user address is not a valid ethereum address");if(!t.every((e=>(0,k.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,k.isAddress)(e))throw new Error("User address is not a valid ethereum address");if(!(0,k.isAddress)(t))throw new Error("Lending pool address provider is not a valid ethereum address");return this._contract.getUserWalletBalances(t,e)}}var P=function(){function e(t,n,r){var a=this;(0,o.Z)(this,e),this.chainId=r,(0,c.Z)(this,"walletBalanceService",void 0),(0,c.Z)(this,"getTokenBalanceOf",function(){var e=(0,i.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,a.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 C({walletBalanceProviderAddress:n,provider:t})}return(0,s.Z)(e,[{key:"getGovernanceTokensBalance",value:function(){var e=(0,i.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],[f.d.aaveTokenAddress,f.d.aAaveTokenAddress,f.d.stkAaveTokenAddress]);case 3:return r=e.sent,e.abrupt("return",{aave:(0,p.Fv)(r[0].toString(),18),aAave:(0,p.Fv)(r[1].toString(),18),stkAave:(0,p.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,i.Z)(l().mark((function e(t){var n,r,a,i,o,s;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 a=e.sent,i=a[0],o=a[1],s=i.map((function(e,t){return{address:e.toLowerCase(),amount:o[t].toString()}})),e.abrupt("return",s);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}(),R=n(24834),I=n(25298),D=n(38776),j=n(84568),M=n(85893),N=(0,r.createContext)(null),L=function(e){var t=e.children,n=(0,R.Yh)((function(e){return e.currentNetworkConfig})),r=(0,R.Yh)((function(e){return e.currentMarketData})),a=n.isFork&&n.underlyingChainId===f.d.chainId,i=n.isFork&&n.underlyingChainId===j.X.chainId,o=a?r.chainId:f.d.chainId,s=i?r.chainId:j.X.chainId,c=(0,I.VH)(r.chainId),u=c,l=c,d=new m(u,o),p=new P(u,f.d.walletBalanceProvider,o),h=new P(c,r.addresses.WALLET_BALANCE_PROVIDER,r.chainId),y=new P(c,r.addresses.WALLET_BALANCE_PROVIDER,r.chainId),g=new S(l,j.X.stakeDataProvider,s);return(0,M.jsx)(N.Provider,{value:{governanceService:d,governanceWalletBalanceService:p,poolTokensBalanceService:h,uiStakeDataService:g,tokenBalanceService:y},children:t})},B=function(){var e=(0,r.useContext)(N);return(0,D.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 o}});var r,a=n(49501),i=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 o=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:s[4001],blocking:!1,actionBlocked:!1,rawError:e,txAction:t};try{var a,i=JSON.parse(null===e||void 0===e||null===(a=e.error)||void 0===a?void 0:a.body),o=Number(i.error.message.split(": ")[1]);isNaN(o)||(r=o)}catch(u){}var c=s[r];return c?{error:c,blocking:n,actionBlocked:!0,rawError:e,txAction:t}:{error:void 0,blocking:n,actionBlocked:!0,rawError:e,txAction:t}},s={7:(0,i.jsx)(a.cC,{id:"Pool addresses provider is not registered"}),9:(0,i.jsx)(a.cC,{id:"Address is not a contract"}),11:(0,i.jsx)(a.cC,{id:"The caller of the function is not an AToken"}),12:(0,i.jsx)(a.cC,{id:"The address of the pool addresses provider is invalid"}),13:(0,i.jsx)(a.cC,{id:"Invalid return value of the flashloan executor function"}),19:(0,i.jsx)(a.cC,{id:"Invalid flashloan premium"}),22:(0,i.jsx)(a.cC,{id:"Invalid bridge protocol fee"}),23:(0,i.jsx)(a.cC,{id:"The caller of this function must be a pool"}),24:(0,i.jsx)(a.cC,{id:"Invalid amount to mint"}),25:(0,i.jsx)(a.cC,{id:"Invalid amount to burn"}),26:(0,i.jsx)(a.cC,{id:"Amount must be greater than 0"}),27:(0,i.jsx)(a.cC,{id:"Action requires an active reserve"}),28:(0,i.jsx)(a.cC,{id:"Action cannot be performed because the reserve is frozen"}),29:(0,i.jsx)(a.cC,{id:"Action cannot be performed because the reserve is paused"}),30:(0,i.jsx)(a.cC,{id:"Borrowing is not enabled"}),31:(0,i.jsx)(a.cC,{id:"Stable borrowing is not enabled"}),32:(0,i.jsx)(a.cC,{id:"User cannot withdraw more than the available balance"}),34:(0,i.jsx)(a.cC,{id:"The collateral balance is 0"}),35:(0,i.jsx)(a.cC,{id:"Health factor is lesser than the liquidation threshold"}),36:(0,i.jsx)(a.cC,{id:"There is not enough collateral to cover a new borrow"}),37:(0,i.jsx)(a.cC,{id:"Collateral is (mostly) the same currency that is being borrowed"}),38:(0,i.jsx)(a.cC,{id:"The requested amount is greater than the max loan size in stable rate mode"}),39:(0,i.jsx)(a.cC,{id:"For repayment of a specific type of debt, the user needs to have debt that type"}),40:(0,i.jsx)(a.cC,{id:"To repay on behalf of a user an explicit amount to repay is needed"}),41:(0,i.jsx)(a.cC,{id:"User does not have outstanding stable rate debt on this reserve"}),42:(0,i.jsx)(a.cC,{id:"User does not have outstanding variable rate debt on this reserve"}),43:(0,i.jsx)(a.cC,{id:"The underlying balance needs to be greater than 0"}),44:(0,i.jsx)(a.cC,{id:"Interest rate rebalance conditions were not met"}),45:(0,i.jsx)(a.cC,{id:"Health factor is not below the threshold"}),46:(0,i.jsx)(a.cC,{id:"The collateral chosen cannot be liquidated"}),47:(0,i.jsx)(a.cC,{id:"User did not borrow the specified currency"}),48:(0,i.jsx)(a.cC,{id:"Borrow and repay in same block is not allowed"}),49:(0,i.jsx)(a.cC,{id:"Inconsistent flashloan parameters"}),50:(0,i.jsx)(a.cC,{id:"Borrow cap is exceeded"}),51:(0,i.jsx)(a.cC,{id:"Supply cap is exceeded"}),52:(0,i.jsx)(a.cC,{id:"Unbacked mint cap is exceeded"}),53:(0,i.jsx)(a.cC,{id:"Debt ceiling is exceeded"}),54:(0,i.jsx)(a.cC,{id:"AToken supply is not zero"}),55:(0,i.jsx)(a.cC,{id:"Stable debt supply is not zero"}),56:(0,i.jsx)(a.cC,{id:"Variable debt supply is not zero"}),57:(0,i.jsx)(a.cC,{id:"Ltv validation failed"}),60:(0,i.jsx)(a.cC,{id:"Asset is not borrowable in isolation mode"}),62:(0,i.jsx)(a.cC,{id:"User is in isolation mode"}),76:(0,i.jsx)(a.cC,{id:"Array parameters that should be equal length are not"}),77:(0,i.jsx)(a.cC,{id:"Zero address not valid"}),78:(0,i.jsx)(a.cC,{id:"Invalid expiration"}),79:(0,i.jsx)(a.cC,{id:"Invalid signature"}),80:(0,i.jsx)(a.cC,{id:"Operation not supported"}),81:(0,i.jsx)(a.cC,{id:"Debt ceiling is not zero"}),82:(0,i.jsx)(a.cC,{id:"Asset is not listed"}),85:(0,i.jsx)(a.cC,{id:"The underlying asset cannot be rescued"}),88:(0,i.jsx)(a.cC,{id:"Stable borrowing is enabled"}),89:(0,i.jsx)(a.cC,{id:"User is trying to borrow multiple assets including a siloed one"}),4001:(0,i.jsx)(a.cC,{id:"You cancelled the transaction."})}},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 a}});var r={KNC_USDC_USDT:{liquidityPoolLink:"https://kyberswap.com/zksync/add/0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4/0x493257fD37EDB34451f62EDf8D2a0C418852bA4C/0x4d321cd88c5680ce4f85bb58c578dfe9c2cc1ef6"}};function a(e){return!!r[e]}},74180:function(e,t,n){"use strict";var r;n.d(t,{i:function(){return r}}),function(e){e.USE_POWERS="USE_POWERS",e.VOTE_ON_PROPOSAL="VOTE_ON_PROPOSAL",e.VOTING_POWER_AT="VOTING_POWER_AT",e.GOVERNANCE_TOKENS="GOVERNANCE_TOKENS",e.POOL_TOKENS="POOL_TOKENS",e.GENERAL_STAKE_UI_DATA="GENERAL_STAKE_UI_DATA",e.USER_STAKE_UI_DATA="USER_STAKE_UI_DATA",e.TRANSACTION_HISTORY="TRANSACTION_HISTORY"}(r||(r={}))},41551:function(e,t,n){"use strict";n.d(t,{QD:function(){return c},S0:function(){return u}});var r=n(59499),a=n(34220);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}var o={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","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"},s={AVAX:"Avalanche",ETH:"Ethereum",EUROS:"STASIS EURO",FAI:"Fei USD",GHST:"Aavegotchi GHST",GUSD:"Gemini Dollar",KNC:"Kyber Legacy",LINK:"ChainLink",MAI:"MAI (mimatic)",MANA:"Decentraland",MKR:"Maker",PAX:"Paxos Standard",RAI:"Rai Reflex Index",REP:"Augur",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",WAVAX:"Wrapped Avalanche",WBTC:"Wrapped BTC",WETH:"Wrapped ETH",WFTM:"Wrapped FTM",WMATIC:"Wrapped Matic",WONE:"Wrapped ONE",YFI:"yearn.finance",ZRX:"0x Coin","1INCH":"1inch Network",LUSD:"LUSD Stablecoin",KNC_USDC_USDT:"Kyberswap USDT/USDT"};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"},"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"}},l=t.toLowerCase();if(u.hasOwnProperty(l))return function(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,p.Z)(w().mark((function e(){var t;return w().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",k(t));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"perform",value:function(){var e=(0,p.Z)(w().mark((function e(t,n){var r;return w().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}(_.Zk),M=n(83454);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 L(e){for(var t=1;t1)for(var n=1;n