!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5f821c8d-4a77-4fd2-ad4e-0572aad421eb",e._sentryDebugIdIdentifier="sentry-dbid-5f821c8d-4a77-4fd2-ad4e-0572aad421eb")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7258],{79757:function(e,t,r){r.d(t,{G:function(){return n}});function n(e){return BigInt(e.toString())}},82875:function(e,t,r){r.d(t,{ZP:function(){return C},__:function(){return N},pC:function(){return a}});var n,a,s=r(57437),o=r(30015),i=r(60682),d=r(50707),c=r(27770),l=r(52143),u=r(5842),p=r(24125),f=r(46674),x=r(39785),R=r(38e3),m=r.n(R),E=r(2265);(n=a||(a={})).Info="INFO",n.Error="ERROR",n.Warn="WARN",n.Success="SUCCESS",n.Loading="LOADING";let g=E.createContext({}),N=()=>(0,E.useContext)(g),I=e=>{switch(e){case"INFO":default:return"gray.600";case"ERROR":return"red.400";case"SUCCESS":return"green.400";case"WARN":return"orange.200"}},O=e=>{switch(e){case"INFO":case"LOADING":return"white";case"ERROR":case"SUCCESS":default:return"gray.900";case"WARN":return"orange.900"}},y=e=>{switch(e){case"INFO":case"LOADING":default:return["gray.600","gray.200"];case"ERROR":return["red.700","red.50"];case"SUCCESS":return["green.800","green.200"];case"WARN":return["orange.900","orange.50"]}};function h(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Box,{as:f.E.div,animate:{transform:"scale(1)"},initial:{transform:"scale(0)"},exit:{transform:"scale(0)"},top:"-10",right:"2",position:"absolute","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx",children:(0,s.jsx)(o.Box,{as:f.E.div,animate:{transform:"rotate(360deg)  translateY(-3px)",transition:{default:{ease:"easeOut",duration:10,repeat:1/0,repeatType:"mirror"}}},rounded:"1px",height:"12px",width:"12px",bg:"green.400","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx"})}),(0,s.jsx)(o.Box,{as:f.E.div,animate:{transform:"scale(1)"},initial:{transform:"scale(0)"},exit:{transform:"scale(0)"},top:"-10",left:"2",position:"absolute","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx",children:(0,s.jsx)(o.Box,{as:f.E.div,rounded:"1px",animate:{transform:"rotate(360deg)  translateY(-3px)",transition:{default:{ease:"easeOut",duration:10,repeat:1/0,repeatType:"mirror"}}},height:"6px",width:"6px",bg:"green.400","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx"})}),(0,s.jsx)(o.Box,{as:f.E.div,animate:{transform:"scale(1)"},initial:{transform:"scale(0)"},exit:{transform:"scale(0)"},top:"-5",left:"8",position:"absolute","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx",children:(0,s.jsx)(o.Box,{as:f.E.div,rounded:"1px",animate:{transform:"rotate(360deg)  translateY(-3px)",transition:{default:{ease:"easeOut",duration:10,repeat:1/0,repeatType:"mirror"}}},height:"5px",width:"5px",bg:"green.400","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx"})}),(0,s.jsx)(o.Box,{as:f.E.div,animate:{transform:"scale(1)"},initial:{transform:"scale(0)"},exit:{transform:"scale(0)"},top:"-10",right:"10",position:"absolute","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx",children:(0,s.jsx)(o.Box,{as:f.E.div,rounded:"1px",animate:{transform:"rotate(360deg)  translateY(-3px)",transition:{default:{ease:"easeOut",duration:10,repeat:1/0,repeatType:"mirror"}}},height:"5px",width:"5px",bg:"green.400","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx"})}),(0,s.jsx)(o.Box,{as:f.E.div,animate:{transform:"scale(1)"},initial:{transform:"scale(0)"},exit:{transform:"scale(0)"},top:"-5",right:"-7",position:"absolute","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx",children:(0,s.jsx)(o.Box,{as:f.E.div,rounded:"1px",animate:{transform:"rotate(360deg)  translateY(-3px)",transition:{default:{ease:"easeOut",duration:10,repeat:1/0,repeatType:"mirror"}}},height:"10px",width:"10px",bg:"green.400","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx"})}),(0,s.jsx)(o.Box,{as:f.E.div,animate:{transform:"scale(1)"},initial:{transform:"scale(0)"},exit:{transform:"scale(0)"},top:"-5",left:"-8",position:"absolute","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx",children:(0,s.jsx)(o.Box,{as:f.E.div,rounded:"1px",animate:{transform:"rotate(360deg)  translateY(-3px)",transition:{default:{ease:"easeOut",duration:10,repeat:1/0,repeatType:"mirror"}}},height:"10px",width:"10px",bg:"green.400","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx"})}),(0,s.jsx)(o.Box,{as:f.E.div,animate:{transform:"scale(1)"},initial:{transform:"scale(0)"},exit:{transform:"scale(0)"},top:"5",left:"-6",position:"absolute","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx",children:(0,s.jsx)(o.Box,{as:f.E.div,rounded:"1px",animate:{transform:"rotate(360deg)  translateY(-3px)",transition:{default:{ease:"easeOut",duration:10,repeat:1/0,repeatType:"mirror"}}},height:"3px",width:"3px",bg:"green.400","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx"})}),(0,s.jsx)(o.Box,{as:f.E.div,animate:{transform:"scale(1)"},initial:{transform:"scale(0)"},exit:{transform:"scale(0)"},top:"5",right:"-4",position:"absolute","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx",children:(0,s.jsx)(o.Box,{as:f.E.div,rounded:"1px",animate:{transform:"rotate(360deg)  translateY(-3px)",transition:{default:{ease:"easeOut",duration:10,repeat:1/0,repeatType:"mirror"}}},height:"3px",width:"3px",bg:"green.400","data-sentry-element":"Box","data-sentry-source-file":"AppToast.tsx"})})]})}function C(e){let{children:t}=e,[r,n]=(0,E.useState)([]),a=(0,E.useRef)([]),R=(0,E.useRef)(0),N=(0,E.useRef)([]),[C,D]=(0,E.useState)(0),[v,T]=(0,E.useState)([]),A=(0,i.useBreakpointValue)({base:!0,lg:!1});a.current=r,R.current=C;let P=(e,t)=>{N.current[e]=t,v[e]=C+(e+1)*16,D(C+((null==t?void 0:t.offsetHeight)||0)+16),T(v)};function S(e){var t;if(!a.current.length)return;let s=r.findIndex(t=>t.id===e),o=(null===(t=N.current[s])||void 0===t?void 0:t.offsetHeight)||0;n(a.current.filter(t=>t.id!==e)),D(R.current-o)}return(0,s.jsxs)(g.Provider,{value:{showToast:e=>{!a.current.find(t=>e.id===t.id)&&(N.current=N.current.filter(e=>null!==e),D(m()(N.current.map(e=>(null==e?void 0:e.offsetHeight)||0))),setTimeout(()=>{n([...a.current,{...e,type:e.type||"INFO"}]),v[r.length]=16,T(v)},0),e.auto&&setTimeout(()=>{S(e.id)},8e3))},removeToast:S,updateToast:(e,t)=>{if(!a.current.length)return;let r=a.current.findIndex(t=>t.id===e),s=a.current[r],o=[...a.current];o[r]={...s,...t},n(o),t.auto&&setTimeout(()=>{S(e)},8e3)},toastList:r},"data-sentry-element":"unknown","data-sentry-component":"AppToast","data-sentry-source-file":"AppToast.tsx",children:[(0,s.jsx)(d.Portal,{"data-sentry-element":"Portal","data-sentry-source-file":"AppToast.tsx",children:(0,s.jsx)(x.M,{"data-sentry-element":"AnimatePresence","data-sentry-source-file":"AppToast.tsx",children:r.map((e,t)=>(0,s.jsx)(o.Box,{zIndex:"toast",ref:e=>P(t,e),backgroundColor:I(e.type||"INFO"),color:O(e.type||"INFO"),px:"3",py:"3",fontWeight:"semibold",marginX:"auto",width:"fit-content",maxW:"80%",rounded:"lg",shadow:"dark-lg",as:f.E.div,position:"fixed",bottom:"0",left:"0",right:"0",initial:{transform:"translateY(96px)"},animate:{transform:"translateY(-".concat(v[t],"px)"),transition:{damping:20,mass:.8,stiffness:200,type:"spring"}},exit:{transform:A?"translateY(196px)":"translateY(96px)",transition:{damping:20,mass:.8,stiffness:200,type:"spring"}},children:(0,s.jsxs)(o.Box,{position:"relative",children:["SUCCESS"===e.type&&(0,s.jsx)(h,{}),(0,s.jsxs)(c.HStack,{children:[(0,s.jsx)(o.Box,{children:(0,s.jsx)(l.CloseButton,{_hover:{background:"green.500"},onClick:()=>S(e.id)})}),e.badge&&(0,s.jsx)(u.Badge,{py:"1",px:"2",bg:y(e.type||"INFO")[0],color:y(e.type||"INFO")[1],children:e.badge}),(0,s.jsxs)(c.HStack,{spacing:"2",children:[(0,s.jsx)(o.Box,{children:e.content}),"LOADING"===e.type&&(0,s.jsx)(p.Spinner,{size:"sm"})]})]})]})},"toast-".concat(e.id)))})}),t]})}},67258:function(e,t,r){r.d(t,{L:function(){return g},l:function(){return N}});var n=r(57437),a=r(41758),s=r(83640),o=r(28522),i=r(45334),d=r(21604),c=r(74319);let l={SWAP:{PENDING:"Swap pending",CONFIRMED:"Swap confirmed",ERROR:"Swap error"},ADD_LIQUIDITY_V2:{PENDING:"Add V2 pending",CONFIRMED:"Add V2 confirmed",ERROR:"Add V2 error"},ZAP_LIQUIDITY_V2:{PENDING:"Zap Liquidity Pending",CONFIRMED:"Zap Liquidity Confirmed",ERROR:"Zap Error"},ADD_LIQUIDITY_V3:{PENDING:"Add V3 pending",CONFIRMED:"Add V3 confirmed",ERROR:"Add V3 error"},REMOVE_LIQUIDITY_V2:{PENDING:"Remove V2 Liquidity - Pending",CONFIRMED:"Remove V2 Liquidity - Confirmed",ERROR:"Remove V2 error"},REMOVE_LIQUIDITY_V3:{PENDING:"Remove V3 pending",CONFIRMED:"Remove V3 confirmed",ERROR:"Remove V3 error"},HARVEST:{PENDING:"Harvest pending",CONFIRMED:"Harvest confirmed",ERROR:"Harvest error"},STAKE:{PENDING:"Stake pending",CONFIRMED:"Stake confirmed",ERROR:"Stake error"},CLAIM:{PENDING:"Claim pending",CONFIRMED:"Claim confirmed",ERROR:"Claim error"},LOCK:{PENDING:"Lock pending",CONFIRMED:"Lock confirmed",ERROR:"Lock error"},UNSTAKE:{PENDING:"Unstake pending",CONFIRMED:"Unstake confirmed",ERROR:"Unstake error"},APPROVE:{PENDING:"Approve pending",CONFIRMED:"Approve confirmed",ERROR:"Approve error"},WRAP:{PENDING:"Wrap pending",CONFIRMED:"Wrap confirmed",ERROR:"Wrap error"},UNWRAP:{PENDING:"Unwrap pending",CONFIRMED:"Unwrap confirmed",ERROR:"Unwrap error"},CREATE_POSITION:{PENDING:"Create position pending",CONFIRMED:"Create position confirmed",ERROR:"Unwrap error"},INCREASE_POSITION:{PENDING:"Increase Position pending",CONFIRMED:"Increase Position confirmed",ERROR:"Increase Position error"},DECREASE_POSITION:{PENDING:"Decrease Position pending",CONFIRMED:"Decrease Position confirmed",ERROR:"Decrease Position error"},BOOST_POSITION:{PENDING:"Boost Position pending",CONFIRMED:"Boost Position confirmed",ERROR:"Boost Position error"},UNBOOST_POSITION:{PENDING:"Unboost Position pending",CONFIRMED:"Unboost Position confirmed",ERROR:"Unboost Position error"},CONVERT:{PENDING:"Convert pending",CONFIRMED:"Convert confirmed",ERROR:"Convert error"},REDEEM:{PENDING:"Redeem pending",CONFIRMED:"Redeem confirmed",ERROR:"Redeem error"},CLAIM_VESTING:{PENDING:"Claim vesting pending",CONFIRMED:"Claim vesting confirmed",ERROR:"Claim vesting error"},CANCEL_VESTING:{PENDING:"Cancel vesting pending",CONFIRMED:"Cancel vesting confirmed",ERROR:"Cancel vesting error"},COLLECT_FEES:{PENDING:"Collect fees pending",CONFIRMED:"Collect fees confirmed",ERROR:"Collect fees error"},APPROVE_USAGE:{PENDING:"Approve usage pending",CONFIRMED:"Approve usage confirmed",ERROR:"Approve usage error"}};function u(e,t){return l[e][t]||"Missing headline"}var p=r(2265),f=r(73501),x=r(72266),R=r(79757),m=r(82875),E=r(46161);let g=(0,x.QS)(!1);function N(e){var t,r;let{config:l,transactionType:x}=e,N=(0,E.Z)();N.etherscanUrl;let{showToast:I,updateToast:O,removeToast:y}=(0,m.__)();(0,p.useRef)();let h=(0,p.useRef)(""),C=(0,p.useRef)(""),D=(0,f.uX)(),v={mutation:{onMutate(){g(!0)},onSuccess(e,t,r){I({id:e,badge:u(x,"PENDING"),content:(0,n.jsx)(d.Text,{children:h.current}),type:m.pC.Loading,auto:!0});try{D({hash:e,description:C.current})}catch(e){console.error("addRecentTransaction failed")}if(null==l?void 0:l.onSuccess)return l.onSuccess(e,t,r)},onError(e){console.log(e),g(!1)},onSettled(e,t,r,a){if(t?setTimeout(function(){O(e||"",{type:m.pC.Error,badge:u(x,"ERROR"),content:(0,n.jsx)(d.Text,{children:h.current}),auto:!0})},2e3):setTimeout(function(){O(e||"",{type:m.pC.Success,badge:u(x,"CONFIRMED"),content:(0,n.jsxs)(d.Text,{color:"text.900",fontSize:"14px",children:[h.current,(0,n.jsx)(c.Link,{color:"inherit",href:function(e){let t=N.etherscanUrl;return"".concat(t,"/tx/").concat(e)}(e),isExternal:!0,children:"View Transaction Receipt"})]}),auto:!0})},2e3),g(!1),null==l?void 0:l.onSettled)return l.onSettled()}}},{sendTransaction:T,data:A,isError:P,isPending:S,error:b,reset:B}=(0,s.p)(v),{writeContract:F,writeContractAsync:G,data:w,error:j,isError:M,isPending:_,reset:L}=(0,o.S)(v),V=(0,i.A)({hash:w||A});return{submit:function(e){h.current=e.toastText,C.current=e.walletText||l.toastText,F({...l,args:e.args,gas:e.gas,value:e.value})},submitAsync:async function(e){return h.current=e.toastText,C.current=e.walletText||l.toastText,G({...l,args:e.args,gas:e.gas,value:e.value})},submitRawTransaction:function(e){h.current=e.toastText,C.current=e.walletText||e.toastText,T({to:e.to,data:e.data,value:(0,a.y_)(e.value),gas:e.gas?(0,R.G)(e.gas):void 0,gasLimit:e.gasLimit?(0,R.G)(e.gasLimit):void 0,nonce:e.nonce})},isSubmitting:_||S,submitError:j||b,isSubmitError:M||P,isPending:V.isLoading,isConfirmed:V.isSuccess&&(null===(t=V.data)||void 0===t?void 0:t.status)!==0&&null===V.error,isFailed:V.isError||null!==V.error||(null===(r=V.data)||void 0===r?void 0:r.status)===0,error:V.error,reset:()=>{if(A)return B();L()},txReceipt:V.data?V.data[w]:void 0}}}}]);
//# sourceMappingURL=7258-c71ca7c5d7bf5cde.js.map