diff --git a/index.bc9456bc.js.download b/index.bc9456bc.js.download new file mode 100644 index 0000000..9886392 --- /dev/null +++ b/index.bc9456bc.js.download @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkdefi_mode=self.webpackChunkdefi_mode||[]).push([[3514],{58463:(e,t,n)=>{n.d(t,{q9:()=>s.Z});var s=n(52528);n(70269)},3447:(e,t,n)=>{n.d(t,{Z:()=>k});var s=n(1413),r=n(87363),o=n(86451),c=n(70991),a=n(14300),i=n(74165),u=n(15861),f=n(29439),d=n(93380),p=n(39858),l=n(40910),_=n(10680),x=n(22333),I=n(21401),h=n(77902),m={getAcceptOfferConfig:function(){var e=(0,u.Z)((0,i.Z)().mark((function e(t){var n,s,r,o,c,a,u,f,p,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.nftInfo,s=t.orderInfo,r=t.stepActionInfo,o=s.price,c=s.count,e.next=4,(0,h.X5)({nftInfo:n,orderInfo:s});case 4:return a=e.sent,u=d.yx.mul(d.yx.mul(o,c),d.yx.div(a.taxFeeRate,1e4)),f=d.yx.mul(a.serviceFee||0,1e-4),p=d.yx.mul(d.yx.mul(o,c),f),l=d.yx.sub(d.yx.mul(o,c),d.yx.add(u,p)),e.abrupt("return",{taxFee:d.yx.floorTruncate(u,4,!1),serviceFee:d.yx.floorTruncate(p,4,!1),profit:d.yx.floorTruncate(l,4,!1),taxFeeRate:d.yx.div(a.taxFeeRate,100),serviceFeeRate:f,nftInfo:n,orderInfo:s,stepActionInfo:r});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getAcceptOfferConfigList:function(){var e=(0,u.Z)((0,i.Z)().mark((function e(t){var n,s,r,o,c,a,u,f;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.orderInfoList,s=t.nftInfoList,r=t.tradeInfo,o=t.stepActionInfoList,c=s[0].chain,a=I.tradeUtil.getStepActionInfoListByActionType({steps:o,actionType:l.tl.TAKE_ORDERS}),u=[],n.forEach(((e,t)=>{var n=s[t];n&&u.push(m.getAcceptOfferConfig({orderInfo:e,nftInfo:n,stepActionInfo:a[t]}))})),e.next=7,Promise.all(u);case 7:return f=e.sent,e.abrupt("return",[{offerList:f,chain:c,tradeInfo:r}]);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),acceptOffer:function(){var e=(0,u.Z)((0,i.Z)().mark((function e(t){var n,r,o,c,a,u,f,d,p;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.offerList,r=t.tradeInfo,a=n[0]||{},u=a.nftInfo,f=a.orderInfo,d=a.stepActionInfo,e.prev=2,e.next=5,I.default[I.TRADE_TYPE.ACCEPT_OFFER]({orderInfo:f,nftInfo:u,stepActionInfo:d,tradeData:(0,s.Z)({},r)});case 5:p=e.sent,c=null===p||void 0===p?void 0:p.txHash,o=(null===p||void 0===p?void 0:p.status)===l.jG.SUCCESS?l.Ez.SUCCESS:l.Ez.WARNING,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),o=l.Ez.WARNING;case 13:return e.abrupt("return",{processedResultStatus:o,processedResultPayload:{txHash:c}});case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),acceptOfferExecutor:function(){var e=(0,u.Z)((0,i.Z)().mark((function e(t){var n,r,o,c,a,u,f,d,p,_;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.processInfo,r=t.processedCallback,o=n.status,c=n.processConfig,a=c.offerList,u=c.chain,f=c.tradeInfo,o==l.Ez.SUCCESS){e.next=12;break}return r((0,s.Z)((0,s.Z)({},n),{},{status:l.Ez.EXECUTING})),e.next=6,m.acceptOffer({offerList:a,chain:u,tradeInfo:f});case 6:d=e.sent,p=d.processedResultStatus,_=d.processedResultPayload,r((0,s.Z)((0,s.Z)({},n),{},{processedResultPayload:_,status:p})),e.next=13;break;case 12:r(n);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};const Z=m;var v=n(14792),E=n(82148),g=n(45271);const y=class extends v.Z{constructor(e){var t=e.nftInfoList,n=e.orderInfoList,s=e.tradeInfo,r=e.stepActionInfoList,o=e.onProcessChange;super(),this.setProcessChangeHandler((function(){o&&o(...arguments)})),this.setProcessExecutor(Z.acceptOfferExecutor),Z.getAcceptOfferConfigList({nftInfoList:t,orderInfoList:n,tradeInfo:s,stepActionInfoList:r}).then((e=>{this.init({processConfigList:e})})).catch((e=>{(0,g.H)(E.I.tradeError,e)}))}};var S=e=>{var t=e.nftInfoList,n=e.orderInfoList,o=e.tradeInfo,c=e.stepActionInfoList,a=(0,r.useState)([]),I=(0,f.Z)(a,2),h=I[0],m=I[1],v=(0,x.jD)("AcceptOffer",h),E=v.processStatus,g=v.setStatusToFinished,S=v.setStatusToSuccess,C=v.setStatusToFailed,L=v.setStatusToRetry,A=(0,r.useState)(!1),R=(0,f.Z)(A,2),k=R[0],T=R[1],b=(0,r.useMemo)((()=>[l.DZ.EXECUTING,l.DZ.RETRYING].includes(E)),[E]),N=(0,r.useState)([]),j=(0,f.Z)(N,2),w=j[0],F=j[1],P=(0,r.useState)(),G=(0,f.Z)(P,2),O=G[0],U=G[1],z=(0,r.useRef)(),H=(0,r.useMemo)((()=>{var e=w.reduce(((e,t)=>{var n=t.profit,s=t.taxFee,r=t.serviceFee;return{profit:d.yx.add(e.profit,n),taxFee:d.yx.add(e.taxFee,s),serviceFee:d.yx.add(e.serviceFee,r)}}),{profit:0,taxFee:0,serviceFee:0});return(0,s.Z)((0,s.Z)({},e),{},{currencyLabel:p.Cq.weth.label})}),[w]),D=e=>{var t=e.processInfo,n=e.processInfoList,s=t.processedResultPayload.txHash;U(s),(e=>{e.some((e=>e.status!=l.Ez.SUCCESS))?e.some((e=>e.status===l.Ez.FAILED||e.status===l.Ez.WARNING))&&(C(),T(!0)):(S(),g(),T(!1))})(n),m([...n])},X=function(){var e=(0,u.Z)((0,i.Z)().mark((function e(){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t[0].chain,(0,_.hl)({chain:n,txHash:O});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=(0,u.Z)((0,i.Z)().mark((function e(){var s,r,a,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z.getAcceptOfferConfigList({nftInfoList:t,orderInfoList:n,tradeInfo:o,stepActionInfoList:c});case 2:s=e.sent,r=(0,f.Z)(s,1),a=r[0],u=a.offerList,F(u);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,r.useEffect)((()=>{z.current=new y({nftInfoList:t,orderInfoList:n,tradeInfo:o,stepActionInfoList:c,onProcessChange:D}),B()}),[]),(0,r.useEffect)((()=>{[l.DZ.EXECUTING,l.DZ.RETRYING].includes(E)&&z.current.run(E)}),[E]),{retry:()=>{L()},showRetry:k,isLoading:b,processInfoList:h,offerList:w,processStatus:E,txHash:O,totalProfitMemo:H,handleClickHash:X}},C=n(36272),L=n(97230);const A={hash:"index_hash__t6v0q","jump-icon":"index_jump-icon__pnRGu",jumpIcon:"index_jump-icon__pnRGu",currency:"index_currency__tg+ZQ","currency-icon":"index_currency-icon__S3pVz",currencyIcon:"index_currency-icon__S3pVz",icon:"index_icon__p2UCB","loading-icon":"index_loading-icon__5GHnM",loadingIcon:"index_loading-icon__5GHnM",loader:"index_loader__HFJpQ","success-icon":"index_success-icon__cDi46",successIcon:"index_success-icon__cDi46","icon-check":"index_icon-check__89G8c",iconCheck:"index_icon-check__89G8c","failed-icon":"index_failed-icon__4Mjs+",failedIcon:"index_failed-icon__4Mjs+","icon-close":"index_icon-close__TStFI",iconClose:"index_icon-close__TStFI","nft-img":"index_nft-img__Hut-x",nftImg:"index_nft-img__Hut-x","platform-img":"index_platform-img__iMwtu",platformImg:"index_platform-img__iMwtu","nft-name":"index_nft-name__qLyX2",nftName:"index_nft-name__qLyX2","nft-price":"index_nft-price__BqvGn",nftPrice:"index_nft-price__BqvGn","sub-title":"index_sub-title__PvwG2",subTitle:"index_sub-title__PvwG2","pay-label":"index_pay-label__kX8-t",payLabel:"index_pay-label__kX8-t","dash-line":"index_dash-line__O+VkH",dashLine:"index_dash-line__O+VkH",title:"index_title__9SIQz","tips-icon":"index_tips-icon__LZX5V",tipsIcon:"index_tips-icon__LZX5V"};var R=n(45263);const k=e=>{var t=e.nftInfoList,n=e.orderInfoList,r=e.tradeInfo,i=e.title,u=e.subTitle,f=e.collapseProps,d=e.stepActionInfoList,p=S({orderInfoList:n,nftInfoList:t,tradeInfo:r,stepActionInfoList:d}),l=p.offerList,_=p.processInfoList,x=p.processStatus,I=p.txHash,h=p.showRetry,m=p.isLoading,Z=p.retry;return(0,R.jsx)(o.Z,(0,s.Z)({title:i,className:A.container,notShowLine:!0,processInfos:l.map((e=>{var t,n=e.orderInfo,r=e.nftInfo,o=e.profit,a=n.currency,i=n.sourceIcon,u=r.name,f=r.resourceUrl,d=r.coverUrl,p=r.project,l=r.tokenId,x=r.projectUrl,h=r.chain,m={name:u,imageUrl:d||f,price:o,currency:a,collectionImage:x,sourceIcon:i,project:p,tokenId:l,txHash:I,chain:h};return{content:(0,R.jsx)(c.Z,(0,s.Z)({},m)),status:null===(t=_[0])||void 0===t?void 0:t.status}})),processStatus:x,addAfterContent:h?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(L.Z,{subTitle:u}),(0,R.jsx)(C.Z,{isLoading:m,retry:Z,errorTip:(0,a.O4)("nftmarket_general_errmsg_accept_offer_error")})]}):(0,R.jsx)(L.Z,{subTitle:u})},f))}},61605:(e,t,n)=>{n.d(t,{Z:()=>T});var s=n(1413),r=n(87363),o=n(14300),c=n(23364),a=n(7562),i=(n(23502),n(95640)),u=n.n(i),f=n(10680),d=n(86451),p=n(36272),l=n(97230),_=n(29439),x=n(40910),I=n(22333),h=n(14792),m=n(82148),Z=n(45271),v=n(74165),E=n(15861),g=n(64397),y=n(48903),S={getApproveNFTConfigForMarkets:function(){var e=(0,E.Z)((0,v.Z)().mark((function e(t){var n,s,r,o,c,a,i,u,f,d;return(0,v.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.stepActionInfoList,s=t.marketInfo,r=t.collectionInfoList,o=[],c=r[0].chain,a=s.source,i=y.Z.getStepActionInfoListByActionType({steps:n,actionType:x.tl.APPROVE_NFT}),e.next=7,y.Z.getTradeStepActionInfo({stepActionInfo:i[0]});case 7:return u=e.sent,f=u.collectionAddress,d=u.approvalAddress,o.push({marketInfo:s,collectionInfo:r[0],approveConfig:{contractAddress:f,operatorAddress:d,chain:c,source:a}}),e.abrupt("return",o);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),approve:function(){var e=(0,E.Z)((0,v.Z)().mark((function e(t){var n,s,r,o,c,a,i;return(0,v.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.contractAddress,s=t.operatorAddress,r=t.chain,o=t.source,e.prev=1,e.next=4,(0,g.Pd)({contractAddress:n,operatorAddress:s,chain:r});case 4:if(e.sent){e.next=12;break}return e.next=8,(0,g.A9)({contractAddress:n,operatorAddress:s,chain:r,callback:e=>{c=e},source:o});case 8:i=e.sent,a=i?x.Ez.SUCCESS:x.Ez.WARNING,e.next=13;break;case 12:a=x.Ez.SUCCESS;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(1),a=x.Ez.WARNING;case 18:return e.abrupt("return",{processedResultStatus:a,processedResultPayload:{txHash:c}});case 19:case"end":return e.stop()}}),e,null,[[1,15]])})));return function(t){return e.apply(this,arguments)}}(),approveNFTExecutor:function(){var e=(0,E.Z)((0,v.Z)().mark((function e(t){var n,r,o,c,a,i,u;return(0,v.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.processInfo,r=t.processedCallback,o=n.status,c=n.processConfig.approveConfig,o==x.Ez.SUCCESS){e.next=10;break}return r((0,s.Z)((0,s.Z)({},n),{},{status:x.Ez.EXECUTING})),e.next=6,S.approve(c);case 6:a=e.sent,i=a.processedResultStatus,u=a.processedResultPayload,r((0,s.Z)((0,s.Z)({},n),{},{processedResultPayload:u,status:i}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};const C=S,L=class extends h.Z{constructor(e){var t=e.collectionInfoList,n=e.marketInfo,s=e.stepActionInfoList,r=e.onProcessChange;super(),C.getApproveNFTConfigForMarkets({collectionInfoList:t,marketInfo:n,stepActionInfoList:s}).then((e=>{this.init({processConfigList:e})})).catch((e=>{(0,Z.H)(m.I.tradeError,e)})),this.setProcessChangeHandler((function(){r&&r(...arguments)})),this.setProcessExecutor(C.approveNFTExecutor)}};var A=e=>{var t=e.collectionInfoList,n=e.marketInfo,s=e.stepActionInfoList,o=(0,r.useState)([]),c=(0,_.Z)(o,2),a=c[0],i=c[1],u=(0,r.useState)(!1),f=(0,_.Z)(u,2),d=f[0],p=f[1],l=(0,I.jD)("ApproveNFT",a),h=l.processStatus,m=l.setStatusToFinished,Z=l.setStatusToSuccess,v=l.setStatusToFailed,E=l.setStatusToRetry,g=(0,r.useRef)(),y=(0,r.useMemo)((()=>[x.DZ.EXECUTING,x.DZ.RETRYING].includes(h)),[h]),S=e=>{var t=e.processInfoList;i([...t]),(e=>{e.some((e=>e.status===x.Ez.EXECUTING))||(e.some((e=>e.status!=x.Ez.SUCCESS))?e.some((e=>e.status===x.Ez.FAILED||e.status===x.Ez.WARNING))&&(v(),p(!0)):(Z(),m(),p(!1)))})(t)};return(0,r.useEffect)((()=>{var e=new L({collectionInfoList:t,marketInfo:n,stepActionInfoList:s,onProcessChange:S});g.current=e}),[t,n,s]),(0,r.useEffect)((()=>{[x.DZ.EXECUTING,x.DZ.RETRYING].includes(h)&&g.current.run(h)}),[h]),{approveInfoList:a,processStatus:h,retry:()=>{E()},showRetry:d,isLoading:y}};const R={hash:"index_hash__Cvoad","jump-icon":"index_jump-icon__qEPt3",jumpIcon:"index_jump-icon__qEPt3",market:"index_market__-d5Y4","market-icon":"index_market-icon__uQVBF",marketIcon:"index_market-icon__uQVBF","collection-name":"index_collection-name__AeSGz",collectionName:"index_collection-name__AeSGz"};var k=n(45263);const T=e=>{var t=e.collectionInfoList,n=e.marketInfo,r=e.title,i=void 0===r?(0,o.O4)("nftmarket_orderbook_modal_approve_collection"):r,_=e.subTitle,x=e.collapseProps,I=e.stepActionInfoList,h=A({collectionInfoList:t,marketInfo:n,stepActionInfoList:I}),m=h.approveInfoList,Z=h.processStatus,v=h.isLoading,E=h.retry,g=h.showRetry,y=e=>()=>{var n=t[0].chain;(0,f.hl)({chain:n,txHash:e})},S=e=>{var t=e.processConfig,n=e.processedResultPayload,s=t.collectionInfo,r=n.txHash,i=s||{},f=i.projectUrl,d=i.projectName,p=i.resourceUrl;return(0,k.jsxs)("div",{className:u()("flex flex-row justify-between items-center"),children:[(0,k.jsxs)("div",{className:u()("flex flex-row justify-between items-center",R.market),children:[(0,k.jsx)(c.Z,{className:R.marketIcon,src:f||p,useWebp:!1,width:1,height:1,alt:"projectUrl"}),(0,k.jsxs)("div",{className:R.collectionName,children:[d," "]})]}),r&&(0,k.jsxs)("div",{className:u()("shrink-0 flex items-center",R.hash),children:[(0,o.O4)("nftmarket_orderbook_confirm_middle_label_hash"),(0,k.jsx)(a.Z,{className:u()("icon-a-openlink20",R.jumpIcon),onClick:y(r)})]})]},d)};return(0,k.jsx)(d.Z,(0,s.Z)({title:i,className:R.container,processInfos:m.map((e=>({status:e.status,content:S(e)}))),processStatus:Z,addAfterContent:g?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(l.Z,{subTitle:_}),(0,k.jsx)(p.Z,{isLoading:v,retry:E,errorTip:(0,o.O4)("nftmarket_general_errmsg_approve_collection_error")})]}):(0,k.jsx)(l.Z,{subTitle:_})},x))}},37350:(e,t,n)=>{n.d(t,{Z:()=>y});var s=n(1413),r=n(87363),o=n(86451),c=n(70991),a=n(14300),i=n(29439),u=n(40910),f=n(22333),d=n(14792),p=n(74165),l=n(15861),_=n(21401),x={getPurchaseConfig:e=>{var t=e.stepActionInfoList,n=e.nftInfo,s=e.orderInfo;return _.tradeUtil.getStepActionInfoListByActionType({steps:t,actionType:u.tl.CANCEL_ORDERS}).map((e=>({stepActionInfo:e,nftInfo:n,orderInfo:s})))},purchase:function(){var e=(0,l.Z)((0,p.Z)().mark((function e(t){var n,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,_.default[_.TRADE_TYPE.CANCEL_OFFER](t);case 3:s=e.sent,n=u.Ez.SUCCESS,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),n=u.Ez.WARNING;case 10:return e.abrupt("return",{processedResultStatus:n,processedResultPayload:{txResult:s}});case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),purchaseExecutor:function(){var e=(0,l.Z)((0,p.Z)().mark((function e(t){var n,r,o,c,a,i,f,d,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.processInfo,r=t.processedCallback,o=n.processConfig,c=o.stepActionInfo,a=o.nftInfo,i=o.orderInfo,n.status==u.Ez.SUCCESS){e.next=14;break}return r((0,s.Z)((0,s.Z)({},n),{},{status:u.Ez.EXECUTING})),e.next=8,x.purchase({stepActionInfo:c,nftInfo:a,orderInfo:i});case 8:f=e.sent,d=f.processedResultStatus,l=f.processedResultPayload,r((0,s.Z)((0,s.Z)({},n),{},{processedResultPayload:l,status:d})),e.next=15;break;case 14:r(n);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};const I=x,h=class extends d.Z{constructor(e){var t=e.onProcessChange,n=e.stepActionInfoList,s=e.nftInfo,r=e.orderInfo;super();var o=I.getPurchaseConfig({stepActionInfoList:n,nftInfo:s,orderInfo:r});this.init({processConfigList:o}),this.setProcessChangeHandler((function(){t&&t(...arguments)})),this.setProcessExecutor(I.purchaseExecutor)}};var m=e=>{var t=e.stepActionInfoList,n=e.nftInfo,s=e.orderInfo,o=(0,r.useState)([]),c=(0,i.Z)(o,2),a=c[0],d=c[1],p=(0,f.jD)("useSign",a),l=p.processStatus,_=p.setStatusToFinished,x=p.setStatusToSuccess,I=p.setStatusToFailed,m=p.setStatusToRetry,Z=(0,r.useRef)(),v=(0,r.useState)(!1),E=(0,i.Z)(v,2),g=E[0],y=E[1],S=(0,r.useMemo)((()=>[u.DZ.EXECUTING,u.DZ.RETRYING].includes(l)),[l]),C=e=>{var t=e.processInfoList;(e=>{e.some((e=>e.status===u.Ez.EXECUTING))||(e.some((e=>e.status!=u.Ez.SUCCESS))?e.some((e=>e.status===u.Ez.FAILED||e.status===u.Ez.WARNING))&&(I(),y(!0)):(x(),_(),y(!1)))})(t),d([...t])};return(0,r.useEffect)((()=>{var e=new h({stepActionInfoList:t,onProcessChange:C,nftInfo:n,orderInfo:s});Z.current=e}),[t]),(0,r.useEffect)((()=>{[u.DZ.EXECUTING,u.DZ.RETRYING].includes(l)&&Z.current.run(l)}),[l]),{retry:()=>{m()},showRetry:g,isLoading:S,processStatus:l,processInfoList:a}},Z=n(36272),v=n(97230);const E={hash:"index_hash__RPHJB","jump-icon":"index_jump-icon__ZKgcT",jumpIcon:"index_jump-icon__ZKgcT",currency:"index_currency__GwGKX","currency-icon":"index_currency-icon__wb15e",currencyIcon:"index_currency-icon__wb15e",icon:"index_icon__WjjgW","loading-icon":"index_loading-icon__xakx1",loadingIcon:"index_loading-icon__xakx1",loader:"index_loader__UvNSH","success-icon":"index_success-icon__a+LaI",successIcon:"index_success-icon__a+LaI","icon-check":"index_icon-check__aZN0h",iconCheck:"index_icon-check__aZN0h","failed-icon":"index_failed-icon__3Kmw2",failedIcon:"index_failed-icon__3Kmw2","icon-close":"index_icon-close__dRkg0",iconClose:"index_icon-close__dRkg0","nft-img":"index_nft-img__z-kR4",nftImg:"index_nft-img__z-kR4","platform-img":"index_platform-img__soOtN",platformImg:"index_platform-img__soOtN","nft-name":"index_nft-name__XBSf4",nftName:"index_nft-name__XBSf4","nft-price":"index_nft-price__pLwC6",nftPrice:"index_nft-price__pLwC6","sub-title":"index_sub-title__1Mx0n",subTitle:"index_sub-title__1Mx0n","pay-label":"index_pay-label__qkWB6",payLabel:"index_pay-label__qkWB6","dash-line":"index_dash-line__RTrx+",dashLine:"index_dash-line__RTrx+",title:"index_title__cquTO"};var g=n(45263);const y=e=>{var t=e.title,n=e.subTitle,r=e.collapseProps,i=e.nftInfo,u=e.orderInfo,f=e.stepActionInfoList,d=m({stepActionInfoList:f,nftInfo:i,orderInfo:u}),p=d.showRetry,l=d.isLoading,_=d.retry,x=d.processStatus,I=d.processInfoList;return(0,g.jsx)(o.Z,(0,s.Z)({title:t,className:E.container,notShowLine:!0,processInfos:I.map((e=>{var t={name:i.name||i.projectName,imageUrl:i.image||i.projectUrl,collectionImage:i.projectUrl,sourceIcon:u.sourceIcon};return{content:(0,g.jsx)(c.Z,(0,s.Z)({},t)),status:null===e||void 0===e?void 0:e.status}})),processStatus:x,addAfterContent:p?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(v.Z,{subTitle:n}),(0,g.jsx)(Z.Z,{isLoading:l,retry:_,errorTip:(0,a.O4)("nftmarket_offer_modal_reminder_err_cancel_offer")})]}):(0,g.jsx)(v.Z,{subTitle:n})},r))}},34439:(e,t,n)=>{n.d(t,{Z:()=>L});var s=n(1413),r=n(74165),o=n(15861),c=n(87363),a=n(14300),i=n(7562),u=n(95640),f=n.n(u),d=n(10680),p=n(86451),l=n(36272),_=n(97230);const x={hash:"index_hash__rI4pm","jump-icon":"index_jump-icon__a9goh",jumpIcon:"index_jump-icon__a9goh",currency:"index_currency__9-bAL","currency-icon":"index_currency-icon__BaG7V",currencyIcon:"index_currency-icon__BaG7V",desc:"index_desc__vgy4L"};var I=n(29439),h=n(40910),m=n(22333),Z=n(14792),v=n(21401),E={getInitAccountConfig:e=>[{stepActionInfo:e.stepActionInfo}],initAccount:function(){var e=(0,o.Z)((0,r.Z)().mark((function e(t){var n,s,o,c;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.stepActionInfo,e.prev=1,"complete"!==n.status){e.next=5;break}return s=h.Ez.SUCCESS,e.abrupt("return",{processedResultStatus:s,processedResultPayload:{txHash:o}});case 5:return e.next=7,v.default[v.TRADE_TYPE.INIT_ACCOUNT]({stepActionInfo:n,chain:null===n||void 0===n?void 0:n.chain});case 7:c=e.sent,o=null===c||void 0===c?void 0:c.txHash,s=(null===c||void 0===c?void 0:c.status)===h.jG.SUCCESS?h.Ez.SUCCESS:h.Ez.WARNING,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),s=h.Ez.WARNING;case 15:return e.abrupt("return",{processedResultStatus:s,processedResultPayload:{txHash:o}});case 16:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t){return e.apply(this,arguments)}}(),initAccountExecutor:function(){var e=(0,o.Z)((0,r.Z)().mark((function e(t){var n,o,c,a,i,u,f;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.processInfo,o=t.processedCallback,c=n.status,a=n.processConfig,c==h.Ez.SUCCESS){e.next=12;break}return o((0,s.Z)((0,s.Z)({},n),{},{status:h.Ez.EXECUTING})),e.next=6,E.initAccount(a);case 6:i=e.sent,u=i.processedResultStatus,f=i.processedResultPayload,o((0,s.Z)((0,s.Z)({},n),{},{processedResultPayload:f,status:u})),e.next=13;break;case 12:o(n);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};const g=E,y=class extends Z.Z{constructor(e){var t=e.onProcessChange,n=e.stepActionInfo;super();var s=g.getInitAccountConfig({stepActionInfo:n});this.init({processConfigList:s}),this.setProcessChangeHandler((function(){t&&t(...arguments)})),this.setProcessExecutor(g.initAccountExecutor)}};var S=e=>{var t=e.stepActionInfoList,n=(0,m.jD)("InitAccount"),s=n.processStatus,r=n.setStatusToFinished,o=n.setStatusToSuccess,a=n.setStatusToFailed,i=n.setStatusToRetry,u=n.setRuntimeProcessCtx,f=(0,c.useState)([]),d=(0,I.Z)(f,2),p=d[0],l=d[1],_=(0,c.useState)(!1),x=(0,I.Z)(_,2),Z=x[0],v=x[1],E=(0,c.useMemo)((()=>[h.DZ.EXECUTING,h.DZ.RETRYING].includes(s)),[s]),g=(0,c.useRef)(),S=e=>{var t,n=e.processInfoList;l([...n]),(e=>{e.some((e=>e.status!=h.Ez.SUCCESS))?e.some((e=>e.status===h.Ez.FAILED||e.status===h.Ez.WARNING))&&(a(),v(!0)):(o(),r(),v(!1))})(n);var s=(null===(t=n[0])||void 0===t?void 0:t.processedResultPayload).utxosData;u(s)};return(0,c.useEffect)((()=>{var e=new y({stepActionInfo:t[0],onProcessChange:S});g.current=e}),[t]),(0,c.useEffect)((()=>{[h.DZ.EXECUTING,h.DZ.RETRYING].includes(s)&&g.current.run(s)}),[s]),{initInfoList:p,processStatus:s,isLoading:E,retry:()=>{i()},showRetry:Z}},C=n(45263);const L=e=>{var t=e.stepActionInfoList,n=e.subTitle,c=e.isHideRetry,u=e.collapseProps,I=S({stepActionInfoList:t}),h=I.initInfoList,m=I.processStatus,Z=I.isLoading,v=I.retry,E=I.showRetry,g=e=>(0,o.Z)((0,r.Z)().mark((function n(){var s;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:(0,d.hl)({chain:null===(s=t[0])||void 0===s?void 0:s.chain,txHash:e});case 1:case"end":return n.stop()}}),n)}))),y=e=>{var t=e.processedResultPayload.txHash;return(0,C.jsxs)("div",{className:f()("flex flex-row justify-between items-center"),children:[(0,C.jsx)("div",{className:x.desc,children:(0,a.O4)("nft_looksrare_account_set_up_subtilte")}),t&&(0,C.jsxs)("div",{className:f()("shrink-0 flex items-center",x.hash),onClick:g(t),children:[(0,a.O4)("nftmarket_orderbook_confirm_middle_label_hash"),(0,C.jsx)(i.Z,{className:f()("icon-a-openlink20",x.jumpIcon)})]})]})};return(0,C.jsx)(p.Z,(0,s.Z)({title:(0,a.O4)("nft_looksrare_account_set_up_tilte"),className:x.container,processInfos:h.map((e=>({status:e.status,content:y(e)}))),processStatus:m,addAfterContent:c?null:E?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(_.Z,{subTitle:n}),(0,C.jsx)(l.Z,{isLoading:Z,retry:v,errorTip:(0,a.O4)("nft_looksrare_account_set_up_refused")})]}):(0,C.jsx)(_.Z,{subTitle:n})},u))}},13282:(e,t,n)=>{n.d(t,{Z:()=>k});var s=n(1413),r=n(87363),o=n(86451),c=n(95640),a=n.n(c),i=n(23364);n(23502);const u="index_platform-img__V+puw",f="index_nft-name__PH8u5";var d=n(45263);const p=e=>{var t=e.name,n=e.imageUrl;return(0,d.jsx)("div",{className:a()("flex flex-row justify-between items-center"),children:(0,d.jsxs)("div",{className:a()("flex flex-row items-center"),children:[(0,d.jsx)("div",{className:a()("relative"),children:(0,d.jsx)(i.Z,{useWebp:!1,className:u,src:n,alt:t,width:24,height:24})}),(0,d.jsx)("div",{className:f,children:t})]})})};var l=n(14300),_=n(29439),x=n(40910),I=n(22333),h=n(14792),m=n(74165),Z=n(15861),v=n(1708),E=n(48903),g={getPurchaseConfig:e=>{var t=e.stepActionInfoList;return E.Z.getStepActionInfoListByActionType({steps:t,actionType:x.tl.VERIFY_WALLET_ADDRESS})},purchase:function(){var e=(0,Z.Z)((0,m.Z)().mark((function e(t){var n,s,r,o;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.processConfig,e.prev=1,n.status!=x.wr.IN_COMPLETE){e.next=9;break}return e.next=5,v.Z.getWalletAccount();case 5:return o=e.sent,e.next=8,E.Z.verifyWallet({stepActionInfo:n,wallet:o});case 8:r=e.sent;case 9:s=x.Ez.SUCCESS,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),s=x.Ez.WARNING;case 15:return e.abrupt("return",{processedResultStatus:s,processedResultPayload:{txResult:r}});case 16:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t){return e.apply(this,arguments)}}(),purchaseExecutor:function(){var e=(0,Z.Z)((0,m.Z)().mark((function e(t){var n,r,o,c,a,i;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.processInfo,r=t.processedCallback,o=n.processConfig,n.status==x.Ez.SUCCESS){e.next=13;break}return r((0,s.Z)((0,s.Z)({},n),{},{status:x.Ez.EXECUTING})),e.next=7,g.purchase({processConfig:o});case 7:c=e.sent,a=c.processedResultStatus,i=c.processedResultPayload,r((0,s.Z)((0,s.Z)({},n),{},{processedResultPayload:i,status:a})),e.next=14;break;case 13:r(n);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};const y=g,S=class extends h.Z{constructor(e){var t=e.onProcessChange,n=e.stepActionInfoList;super();var s=y.getPurchaseConfig({stepActionInfoList:n});this.init({processConfigList:s}),this.setProcessChangeHandler((function(){t&&t(...arguments)})),this.setProcessExecutor(y.purchaseExecutor)}};var C=e=>{var t=e.stepActionInfoList,n=(0,r.useState)([]),s=(0,_.Z)(n,2),o=s[0],c=s[1],a=(0,I.jD)("useSign",o),i=a.processStatus,u=a.setStatusToFinished,f=a.setStatusToSuccess,d=a.setStatusToFailed,p=a.setStatusToRetry,l=(0,r.useRef)(),h=(0,r.useState)(!1),m=(0,_.Z)(h,2),Z=m[0],v=m[1],E=(0,r.useMemo)((()=>[x.DZ.EXECUTING,x.DZ.RETRYING].includes(i)),[i]),g=e=>{var t=e.processInfoList;(e=>{e.some((e=>e.status===x.Ez.EXECUTING))||(e.some((e=>e.status!=x.Ez.SUCCESS))?e.some((e=>e.status===x.Ez.WARNING))&&(d(),v(!0)):(f(),u(),v(!1)))})(t),c([...t])};return(0,r.useEffect)((()=>{var e=new S({stepActionInfoList:t,onProcessChange:g});l.current=e}),[t]),(0,r.useEffect)((()=>{[x.DZ.EXECUTING,x.DZ.RETRYING].includes(i)&&l.current.run(i)}),[i]),{retry:()=>{p()},showRetry:Z,isLoading:E,processStatus:i,processInfoList:o}},L=n(36272),A=n(97230);const R={hash:"index_hash__2pe4b","jump-icon":"index_jump-icon__wj3Oc",jumpIcon:"index_jump-icon__wj3Oc",currency:"index_currency__0mG1y","currency-icon":"index_currency-icon__aGwzp",currencyIcon:"index_currency-icon__aGwzp",icon:"index_icon__WOz70","loading-icon":"index_loading-icon__OZjfL",loadingIcon:"index_loading-icon__OZjfL",loader:"index_loader__L3KBq","success-icon":"index_success-icon__uIfWC",successIcon:"index_success-icon__uIfWC","icon-check":"index_icon-check__mt6xH",iconCheck:"index_icon-check__mt6xH","failed-icon":"index_failed-icon__r0HBi",failedIcon:"index_failed-icon__r0HBi","icon-close":"index_icon-close__GtSAu",iconClose:"index_icon-close__GtSAu","nft-img":"index_nft-img__+m-u5",nftImg:"index_nft-img__+m-u5","platform-img":"index_platform-img__zo8cY",platformImg:"index_platform-img__zo8cY","nft-name":"index_nft-name__caF1G",nftName:"index_nft-name__caF1G","nft-price":"index_nft-price__eptjm",nftPrice:"index_nft-price__eptjm","sub-title":"index_sub-title__1fiW5",subTitle:"index_sub-title__1fiW5","pay-label":"index_pay-label__RsUkb",payLabel:"index_pay-label__RsUkb","dash-line":"index_dash-line__6tYy1",dashLine:"index_dash-line__6tYy1",title:"index_title__yFtCT"};const k=e=>{var t=e.title,n=e.subTitle,r=e.isHideRetry,c=e.collapseProps,a=e.stepActionInfoList,i=C({stepActionInfoList:a}),u=i.showRetry,f=i.isLoading,_=i.retry,x=i.processStatus,I=i.processInfoList;return(0,d.jsx)(o.Z,(0,s.Z)({title:t,className:R.container,processInfos:I.map((e=>{var t=e.processConfig.platform,n=t.icon,r={name:t.name,imageUrl:n};return{content:(0,d.jsx)(p,(0,s.Z)({},r)),status:null===e||void 0===e?void 0:e.status}})),processStatus:x,addAfterContent:r?null:u?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.Z,{subTitle:n}),(0,d.jsx)(L.Z,{isLoading:f,retry:_,errorTip:(0,l.O4)("nftmarket_offer_modal_reminder_err_sign_message")})]}):(0,d.jsx)(A.Z,{subTitle:n})},c))}},15305:(e,t,n)=>{n.d(t,{Bw:()=>r.Z,JY:()=>f.Z,Ky:()=>i.Z,My:()=>u.Z,VT:()=>d.Z,bF:()=>a.Z,g1:()=>o.Z,lr:()=>s.Z,zE:()=>c.Z,zf:()=>p.Z});var s=n(99544),r=(n(8099),n(61605)),o=n(3447),c=n(83189),a=n(69987),i=(n(18793),n(13282)),u=n(32044),f=n(37350),d=n(3275),p=n(34439);n(51602)},13350:(e,t,n)=>{n.d(t,{Z:()=>r});var s=n(87363);const r=(0,s.createContext)({})},9947:(e,t,n)=>{n.d(t,{Z:()=>x});var s=n(1413),r=n(29439),o=n(74165),c=n(15861),a=n(93380),i=n(14300),u=n(40910),f=n(97505),d=n(85658),p=n(75219),l=n(11229),_={mockPush:e=>d.Z.get(f.Z.MOCK_PUSH,e),postCheckCollect:e=>d.Z.post(f.Z.COLLECTION_CHECK_COLLECT,e),postCollect:e=>d.Z.post(f.Z.COLLECTION_COLLECT,e),getCollectionInfo:e=>d.Z.getXss(f.Z.COLLECTION_INFO,e),getCollectionProjectStats:e=>d.Z.get(f.Z.COLLECTION_INFO_OTHER,e),getCollectionFaqs:e=>d.Z.get(f.Z.COLLECTION_QUESTIONS,e),getMockPendingSubscribe:e=>d.Z.get(f.Z.MOCK_PENDING_PUSH,e),getCollectionNfts:e=>d.Z.postXss(f.Z.MARKET,e),getRoyaltySignFormServer:(e,t)=>(0,c.Z)((0,o.Z)().mark((function n(){return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l.Z.checkLogin({chainList:[t]});case 2:return n.abrupt("return",d.Z.post(f.Z.COLLECTION_ROYALTY_SIGN,e));case 3:case"end":return n.stop()}}),n)})))(),updateRoyalty:e=>(0,c.Z)((0,o.Z)().mark((function t(){return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",d.Z.post(f.Z.UPDATE_ROYALTY,e));case 1:case"end":return t.stop()}}),t)})))(),getRoyaltySignature:e=>(0,c.Z)((0,o.Z)().mark((function t(){return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",d.Z.post(f.Z.GET_ROYALTY_SIGNATURE,e));case 1:case"end":return t.stop()}}),t)})))(),setRoyalty:e=>(0,c.Z)((0,o.Z)().mark((function t(){var n,c,f,d,x,I,h,m,Z,v,E,g,y,S,C,L,A,R;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.taxFeeRate,c=void 0===n?0:n,f=e.taxReceiveAddress,d=e.contractAddress,x=e.chainId,I=e.project,h=e.timestamp,!f){t.next=32;break}return t.prev=2,t.next=5,l.Z.checkLink({chain:x});case 5:return m=t.sent,Z={project:I,timestamp:h,contractAddress:d,signAddress:m,receiverAddress:f,chain:x,feeBps:String(a.yx.mul(c,100))},t.next=9,(0,p.Z)(_.getRoyaltySignature(Z));case 9:return v=t.sent,E=(0,r.Z)(v,2),g=E[1],t.next=14,l.Z.signWallet({account:m,signData:g});case 14:return y=t.sent,S=y.signature,C=(0,s.Z)((0,s.Z)({},Z),{},{signature:S}),t.next=19,(0,p.Z)(_.updateRoyalty(C));case 19:if(L=t.sent,A=(0,r.Z)(L,1),R=A[0]){t.next=24;break}return t.abrupt("return",{isSuccess:!0});case 24:return t.abrupt("return",{isSuccess:!1,message:(null===R||void 0===R?void 0:R.msg)||(0,i.O4)("defi_nftcoll_notif_requestfailed")});case 27:return t.prev=27,t.t0=t.catch(2),t.abrupt("return",{isSuccess:!1,message:t.t0===u.Bs.WALLET_SIGN?"":(0,i.O4)("defi_nftcoll_notif_requestfailed")});case 30:t.next=33;break;case 32:return t.abrupt("return",{isSuccess:!1});case 33:case"end":return t.stop()}}),t,null,[[2,27]])})))()};const x=_},77902:(e,t,n)=>{n.d(t,{WB:()=>l,X5:()=>_});var s=n(74165),r=n(29439),o=n(15861),c=n(23781),a=n(72208),i=n(75219),u=n(9947),f=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(t){var n,o,u,f,d,p,l,_,x,I,h,m,Z,v,E,g;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.orderInfo,o=n.id,u=n.source,f=[o],e.next=5,(0,i.Z)(c.Z.getOrderFees({orderIds:f}));case 5:if(d=e.sent,p=(0,r.Z)(d,2),l=p[0],_=p[1],!l){e.next=11;break}return e.abrupt("return",{taxFeeRate:0});case 11:return x=_[o]||{},I=x.devFeeBasisPoints,h=x.devFees,m=x.sourceFeeBasisPoints,Z=x.takerSourceFeeBasisPoints,v=x.protocolFeeBasisPoints,E=Object.keys(h||{}),g=[a.Qz.MAGICEDEN,a.Qz.TENSOR].includes(u)?Z:m,e.abrupt("return",{taxFeeRate:I||0,taxReceiveAddress:E&&E.length>0&&E[0],serviceFee:g||0,protocolFee:v||0});case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(t){var n,o,a,u,f,d,p,l,_,x,I,h,m,Z,v,E,g,y,S,C,L;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.nftInfo,o=t.source,a=n.id,u=n.chain,f=[a],e.next=5,(0,i.Z)(c.Z.getNftFees({chain:u,nftIds:f,sourceList:[o]}));case 5:if(d=e.sent,p=(0,r.Z)(d,2),l=p[0],_=p[1],!l){e.next=11;break}return e.abrupt("return",{taxFeeRate:0});case 11:if(x=_[a]||{},!((I=x.sourceFees)&&I.length>0)){e.next=18;break}return h=I[0].fee||{},m=h.devFeeBasisPoints,Z=h.devFees,v=h.invalid,E=h.sourceFeeBasisPoints,g=h.protocolFeeBasisPoints,y=h.sourceFees,S=Object.keys(Z||{}),C=Object.keys(y||{}),L=S&&S.length>0&&S[0],e.abrupt("return",{taxFeeRate:m||0,taxReceiveAddress:L,assetHide:v,fees:{sellerFees:Z},payoutAddress:L,serviceFee:E||0,protocolFee:g||0,serviceFeeReceiveAddress:C[0]});case 18:return e.abrupt("return",{taxFeeRate:0,taxReceiveAddress:"",assetHide:!1,serviceFee:0,protocolFee:0});case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),p=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(t){var n,o,c,a,f,d,p,l,_,x;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.collectionInfo,o=n.collectionName,c=n.chain,e.next=4,(0,i.Z)(u.Z.getCollectionInfo({collectionName:o,chain:c}));case 4:return a=e.sent,f=(0,r.Z)(a,2),d=f[1],l=(p=d||{}).taxFeeRate,_=void 0===l?0:l,x=p.taxReceiveAddress,e.abrupt("return",{taxFeeRate:_,taxReceiveAddress:x});case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),l=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(t){var n,r,o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.collectionInfo,r=t.nftInfo,o=t.source,!!!n){e.next=4;break}return e.abrupt("return",p({collectionInfo:n,source:o}));case 4:return e.abrupt("return",d({nftInfo:r,source:o}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(t){var n,r,o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.nftInfo,r=t.orderInfo,o=r.source,e.abrupt("return",f({nftInfo:n,orderInfo:r,source:o}));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}]); +//# sourceMappingURL=https://static-daily.okg.com/crash/okfe/defi-mode/3514/index.bc9456bc.js.map \ No newline at end of file