1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6619,2874],{15666:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/add/[[...currency]]",function(){return t(98452)}])},12874:function(e,r,t){"use strict";t.r(r),t.d(r,{LotterySubgraphHealthIndicator:function(){return w},PredictionSubgraphHealthIndicator:function(){return O},V3SubgraphHealthIndicator:function(){return P},default:function(){return _},subgraphHealthIndicatorFactory:function(){return subgraphHealthIndicatorFactory}});var a,n,l=t(97458),i=t(79960),o=t(82577),s=t(62656),u=t(36614),c=t(16169),d=t(47287),h=t(51036),p=t(23690),g=t(87529),b=t(8047),f=t(52983),m=t(13138),x=t(82880),y=t(30012),N=t(11189),v=t(60011),j=t(14319),k=t(5573);let I=[];(a=n||(n={}))[a.OK=0]="OK",a[a.WARNING=1]="WARNING",a[a.NOT_OK=2]="NOT_OK",a[a.UNKNOWN=3]="UNKNOWN",a[a.DOWN=4]="DOWN";var hooks_useSubgraphHealth=e=>{let[r,t]=(0,f.useState)({status:3,currentBlock:0,chainHeadBlock:0,latestBlock:0,blockDifference:0});return!function(e,r){let{chainId:t}=(0,k.g)(),{data:a=0}=(0,j.a)([v.KI,"blockNumber",t],{enabled:!1});(0,f.useEffect)(e.bind(null,a),[a,...r||I])}(r=>{let getSubgraphHealth=async()=>{try{var a,n;let[{indexingStatusForCurrentVersion:l},i]=await Promise.all([(0,m.request)(x.AM,m.gql` 2 query getNftMarketSubgraphHealth { 3 indexingStatusForCurrentVersion(subgraphName: "${e}") { 4 health 5 chains { 6 chainHeadBlock { 7 number 8 } 9 latestBlock { 10 number 11 } 12 } 13 } 14 } 15 `),r?Promise.resolve(r):Number((0,y.z2)({chainId:N.a_.MODE_MAINNET}).getBlockNumber())]),o=(null==l?void 0:l.health)==="healthy",s=parseInt(null==l?void 0:null===(a=l.chains[0])||void 0===a?void 0:a.chainHeadBlock.number),u=parseInt(null==l?void 0:null===(n=l.chains[0])||void 0===n?void 0:n.latestBlock.number),c=i-u,d=i-s;!o||c>200||d>200?t({status:2,currentBlock:i,chainHeadBlock:s,latestBlock:u,blockDifference:c}):c>50||d>50?t({status:1,currentBlock:i,chainHeadBlock:s,latestBlock:u,blockDifference:c}):t({status:0,currentBlock:i,chainHeadBlock:s,latestBlock:u,blockDifference:c})}catch(r){console.error(`Failed to perform health check for ${e} subgraph`,r),t({status:4,currentBlock:-1,chainHeadBlock:0,latestBlock:-1,blockDifference:0})}};e&&getSubgraphHealth()},[e]),r};let H=(0,s.zo)(u.Z)` 16 border-radius: 8px; 17 > div { 18 border-radius: 8px; 19 } 20 user-select: none; 21`,S=(0,s.zo)(c.Z)` 22 gap: 7px; 23`,Z=(0,s.zo)(d.ZP)` 24 width: 12px; 25 height: 12px; 26 border-radius: 50%; 27 background: ${e=>{let{$color:r,theme:t}=e;return t.colors[r]}}; 28`,indicator=(e,r)=>{var t,a,n,l;return{delayed:{label:e("Delayed"),color:"failure",description:null!==(t=null==r?void 0:r.delayed)&&void 0!==t?t:e("Subgraph is currently experiencing delays due to BSC issues. Performance may suffer until subgraph is restored.")},slow:{label:e("Slight delay"),color:"warning",description:null!==(a=null==r?void 0:r.slow)&&void 0!==a?a:e("Subgraph is currently experiencing delays due to BSC issues. Performance may suffer until subgraph is restored.")},healthy:{label:e("Fast"),color:"success",description:null!==(n=null==r?void 0:r.healthy)&&void 0!==n?n:e("No issues with the subgraph.")},down:{label:e("Down"),color:"failure",description:null!==(l=null==r?void 0:r.down)&&void 0!==l?l:e("Subgraph is currently experiencing issues. Performance may suffer until subgraph is restored.")}}},getIndicator=e=>e===n.NOT_OK?"delayed":e===n.WARNING?"slow":e===n.DOWN?"down":"healthy",SubgraphHealthIndicator=e=>{let{subgraphName:r,inline:t,customDescriptions:a,obeyGlobalSetting:s=!0}=e,{t:u}=(0,o.Z)(),{status:f,currentBlock:m,blockDifference:x,latestBlock:y}=hooks_useSubgraphHealth(r),[N]=(0,b.YF)(),v=f===n.WARNING||f===n.NOT_OK||f===n.DOWN,j=indicator(u,a),k=x*i.hJ,I=getIndicator(f),B=j[I],{targetRef:P,tooltipVisible:w,tooltip:O}=(0,h.Z)((0,l.jsx)(TooltipContent,{currentBlock:m,secondRemainingBlockSync:k,blockNumberFromSubgraph:y,showBlockInfo:f!==n.DOWN,...B}),{placement:"top"});return y&&m&&(s&&N||v)?t?(0,l.jsx)(c.Z,{justifyContent:"flex-end",children:(0,l.jsxs)(S,{alignItems:"center",ref:P,children:[(0,l.jsx)(Z,{$color:B.color}),(0,l.jsx)(p.Z,{children:B.label}),(0,l.jsx)(g.Z,{}),w&&O]})}):(0,l.jsxs)(d.ZP,{position:"fixed",bottom:"calc(55px + env(safe-area-inset-bottom))",right:"18px",ref:P,"data-test":"subgraph-health-indicator",children:[w&&O,(0,l.jsx)(H,{children:(0,l.jsxs)(S,{alignItems:"center",p:"10px",children:[(0,l.jsx)(Z,{$color:B.color}),(0,l.jsx)(p.Z,{children:B.label}),(0,l.jsx)(g.Z,{})]})})]}):null},TooltipContent=e=>{let{color:r,label:t,description:a,showBlockInfo:n=!0,currentBlock:i,secondRemainingBlockSync:s,blockNumberFromSubgraph:u}=e,{t:c}=(0,o.Z)();return(0,l.jsxs)(d.ZP,{children:[(0,l.jsxs)(S,{alignItems:"center",pb:"10px",children:[(0,l.jsx)(Z,{$color:r}),(0,l.jsx)(p.Z,{children:t})]}),(0,l.jsx)(p.Z,{children:a}),n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(p.Z,{mt:"24px",children:[(0,l.jsxs)("strong",{children:[c("Chain Head Block"),":"]})," ",i]}),(0,l.jsxs)(p.Z,{children:[(0,l.jsxs)("strong",{children:[c("Latest Subgraph Block"),":"]})," ",u]}),(0,l.jsxs)(p.Z,{children:[(0,l.jsxs)("strong",{children:[c("Delay"),":"]})," ",i-u," (",s,"s)"]})]}):null]})};var B=t(63730);function subgraphHealthIndicatorFactory(e){let{getSubgraphName:r}=e;return function(e){let{chainId:t}=(0,k.g)(),a=(0,f.useMemo)(()=>r(t),[t]);return(0,B.createPortal)((0,l.jsx)(SubgraphHealthIndicator,{subgraphName:a,...e}),document.body)}}let P=subgraphHealthIndicatorFactory({getSubgraphName:e=>{var r;return(null===(r=x.H$[e])||void 0===r?void 0:r.startsWith("https://api.thegraph.com/subgraphs/name/"))&&x.H$[e].replace("https://api.thegraph.com/subgraphs/name/","")||""}}),w=subgraphHealthIndicatorFactory({getSubgraphName:()=>x.Xr.replace("https://api.thegraph.com/subgraphs/name/","")}),O=subgraphHealthIndicatorFactory({getSubgraphName:()=>x.GZ.replace("https://api.thegraph.com/subgraphs/name/","")});var _=SubgraphHealthIndicator},98452:function(e,r,t){"use strict";t.r(r);var a=t(97458),n=t(43709),l=t(97656),i=t(52983),o=t(30012),s=t(45192),u=t
28(13518),c=t(97700),d=t(12874),h=t(43850);let AddLiquidityPage=()=>{let e=(0,l.useRouter)(),{currencyIdA:r,currencyIdB:t,feeAmount:o}=(0,c.z)();(0,n.U8)(r),(0,n.U8)(t);let p=(0,i.useCallback)(()=>{e.replace({pathname:e.pathname,query:{currency:[r,t]}},void 0,{shallow:!0})},[e,r,t]);return(0,a.jsx)(h.Z,{children:(0,a.jsx)(u.Z,{children:(0,a.jsxs)(s.UE,{handleRefresh:p,showRefreshButton:!1,children:[(0,a.jsx)(s.Bm,{currencyIdA:r,currencyIdB:t}),(0,a.jsx)(d.V3SubgraphHealthIndicator,{})]})})})};AddLiquidityPage.chains=o.vo,r.default=AddLiquidityPage},43850:function(e,r,t){"use strict";t.d(r,{Z:function(){return AddLiquidityV2FormProvider}});var a=t(97458),n=t(52983),l=t(8834);function AddLiquidityV2FormProvider(e){let{children:r}=e,t=(0,n.useMemo)(()=>(0,l.lP)(),[]);return(0,a.jsx)(l.UX,{value:{formAtom:t},children:r})}},13518:function(e,r,t){"use strict";t.d(r,{Z:function(){return LiquidityFormProvider}});var a=t(97458),n=t(52983),l=t(83800);function LiquidityFormProvider(e){let{children:r,onAddLiquidityCallback:t}=e,i=(0,n.useMemo)(()=>(0,l.lP)(),[]);return(0,a.jsx)(l.kH,{value:{formAtom:i,onAddLiquidityCallback:(0,n.useCallback)(e=>{null==t||t(e)},[t])},children:r})}}},function(e){e.O(0,[6723,1857,2971,3294,873,5880,5868,2133,3865,6344,1368,4350,9446,3070,231,648,9774,2888,179],function(){return e(e.s=15666)}),_N_E=e.O()}]); 29//# sourceMappingURL=[[...currency]]-ed011222385f8a49.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.