1"use strict";(self.webpackChunkreact_frontend=self.webpackChunkreact_frontend||[]).push([[9353],{2253:(e,n,i)=>{i.d(n,{A:()=>N});var l=i(89379),t=i(25045),s=i.n(t),o=i(9950),a=i(82569),d=i(84081),r=i(92310),c=i(96820),u=i(14765),v=i(31789),m=i(13590),h=i(8748),g=i(45612),x=i(56801),p=i(58697),_=i(79178),j=i(44414);const y=function(e,n,i,l){let t=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7?arguments[7]:void 0,d=arguments.length>9?arguments[9]:void 0,r=arguments.length>10?arguments[10]:void 0,c=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0,v=arguments.length>13?arguments[13]:void 0;const h=Array.isArray(p.U$[e])?p.U$[e]:[],g=new _.A(h,{keys:[],threshold:.4,includeScore:!0}).search(u),x=u?g.map(e=>null===e||void 0===e?void 0:e.item):h,y=async e=>{let o=n;o.length=0;const a=e.currentTarget.getAttribute("data-key");o.push(a),i(o),l(!1),t&&await t(),s&&(i([]),s()),i([])},C=x.sort((e,n)=>e.localeCompare(n)).filter(e=>(!r||"Deposit"!==e&&"Withdrawal"!==e)&&("Uncategorised"!==c||"Deposit"!==e&&"Withdrawal"!==e));let T=C.length>0?C.map(e=>{var n;return(0,j.jsxs)("li",{onClick:y,"data-key":e,className:o.listItem,children:[(0,j.jsxs)("h4",{children:[e," ",(null===d||void 0===d||null===(n=d.label)||void 0===n?void 0:n.toLowerCase())===(null===e||void 0===e?void 0:e.toLowerCase())&&(0,j.jsx)("img",{src:m.T.GreenCheckOutlineCircle,alt:"check"})]}),(0,j.jsx)("p",{children:p.fm[e]||""})]},e)}):(0,j.jsx)("li",{style:{pointerEvents:"none",fontSize:14,opacity:.4,fontWeight:400},children:"Search not found"});return(0,j.jsxs)("ul",{style:(f=a,f?{top:"105%"}:{bottom:"105%"}),"data-testid":"handle-tag",children:[(0,j.jsx)("input",{type:"text",value:u,onChange:e=>v(e.target.value),className:o.searchInput,placeholder:"Search label",autoFocus:!0}),T]});var f},C={uncategorizedIconContainer:"warning_uncategorizedIconContainer__fV1bM",toolTipContainer:"warning_toolTipContainer__SVL4l",warningPopupMainContainer:"warning_warningPopupMainContainer__cxk9K",addPriceBtn:"warning_addPriceBtn__7TmjZ",warningPopupMain:"warning_warningPopupMain__I20aD",fade:"warning_fade__b6U-7",content:"warning_content__T7GjR",line:"warning_line__Xb8UI",lines:"warning_lines__QC6Ue",button:"warning_button__vTlMa","content-row":"warning_content-row__ii0Jk"},T=e=>{let{text:n,content:i,buttonText:l,buttonHandler:t,customStyle:s}=e;return(0,j.jsx)("div",{className:C.warningPopupMainContainer,children:(0,j.jsxs)("div",{className:C.warningPopupMain,style:s,children:[(0,j.jsxs)("div",{className:C.firstRow,style:{display:"flex",alignItems:"center"},children:[(0,j.jsx)("img",{src:m.T.WarningRed,alt:"warning",className:C.warningIcon}),n]}),(0,j.jsx)("div",{className:"content-row",children:(0,j.jsxs)("div",{className:C.content,children:[i,(0,j.jsx)("button",{className:C.button,onClick:t,children:l})]})}),(0,j.jsx)("hr",{className:C.lines,style:{marginTop:"20px"}})]})})},f=e=>{var n,i,l;let{postDetail:t,showWarning:s,handleMissingPriceModal:a,handleMissingPurchaseModal:d,index:r}=e;const[c,u]=(0,o.useState)(!1);return(0,j.jsx)("div",{className:C.uncategorizedIconContainer,children:null!==t&&void 0!==t&&t.label||!s?null!==(null===t||void 0===t||null===(n=t.netValue)||void 0===n?void 0:n.fiatValue)||null!==t&&void 0!==t&&null!==(i=t.gainsDetails)&&void 0!==i&&i.isMissingPurchaseHistory?(null===t||void 0===t||null===(l=t.gainsDetails)||void 0===l?void 0:l.isMissingPurchaseHistory)&&(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:C.toolTipContainer,children:[(0,j.jsx)("img",{src:c?m.T.WarningRed:m.T.Warnings,alt:"warning",className:C.warningIcon,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1)}),(0,j.jsx)("div",{className:C.tooltipHover,children:(0,j.jsx)(T,{text:"Missing purchase history",content:"Purchase history is missing for this transaction. Please review the ledger of the transactions, and add the missing transaction to resolve this issue.",buttonText:"View Ledger",buttonHandler:d})})]})}):(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:C.toolTipContainer,children:[(0,j.jsx)("img",{src:c?m.T.WarningRed:m.T.Warnings,alt:"warning",className:C.warningIcon,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1)}),(0,j.jsx)("div",{className:C.tooltipHover,children:(0,j.jsx)(T,{text:"Missing price",content:"The price is missing at the time of this transaction. Please add the price to resolve this issue.",buttonText:"Add now",buttonHandler:a,index:r})})]})}):(0,j.jsx)(j.Fragment,{children:(0,j.jsx)("img",{src:c?m.T.WarningRed:m.T.WarningsBlue,alt:"warning",onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1)})})})},b={FirstTransactionColumn:"type-tags-section_FirstTransactionColumn__6+CAL",tagModalSelectTagContainer:"type-tags-section_tagModalSelectTagContainer__575Q5",tabDropContainer:"type-tags-section_tabDropContainer__UXsTF",selectTag:"type-tags-section_selectTag__LyYvR",clickHereTags:"type-tags-section_clickHereTags__cPQL1",showTagsTypeArrow:"type-tags-section_showTagsTypeArrow__CDMXo",showTagsTypeArrows:"type-tags-section_showTagsTypeArrows__K7m0h",timeStap:"type-tags-section_timeStap__VyuFo",tooltip:"type-tags-section_tooltip__OGAnU",checkBoxMain:"type-tags-section_checkBoxMain__Kq-+n",labelSearchFilter:"type-tags-section_labelSearchFilter__y-01p",fade:"type-tags-section_fade__+HM9S",searchInput:"type-tags-section_searchInput__5vqDh",tagDropContainer:"type-tags-section_tagDropContainer__-x7-H"},N=e=>{var n,i,t;let{currentUser:p,userSettings:_,typeIcon:C,tagsList:T,setTagsList:N,setTagIgnore:w,setShowLoader:k,postDetail:A,openDown:S,updateTransactions:I,selectedTrxsType:D,showDate:M,handleHooksAfterRes:L,showWarning:F,displayData:P,handleShowModal:B,handleMissingPriceModal:R,handleMissingPurchaseModal:E,name:H,onChange:U,allCheckBox:W,setTrxInfo:Y,index:V,updateEditedTrx:O,from:G,setEditedTrxList:z,fromSelectionBox:Z,isReviewPage:J,setSelectionBox:Q,editedBgColor:q,isEditedModeOn:X,fetchTransactionsNew:K,setFilterTypesChecked:$,isRowHover:ee}=e;const ne=(0,a.wA)(),ie=new c.Gf,le=new c.d3,te=(0,o.useRef)(),{idToken:se}=(0,o.useContext)(d.c),[oe,ae]=(0,o.useState)(!1),[de,re]=(0,o.useState)(null),[ce,ue]=(0,o.useState)("");(0,o.useEffect)(()=>(document.addEventListener("mousedown",ve),()=>{document.removeEventListener("mousedown",ve)}),[]);const ve=e=>{te.current&&!te.current.contains(e.target)&&(ae(!1),ue(""))},me=async()=>{const e="Bearer "+se;p.uid;if(re(null===A||void 0===A?void 0:A.id),w&&"Ignore"===T[0]&&(w({status:!0,id:null===A||void 0===A?void 0:A.id}
1),Y({status:!1,id:null})),k(!0),Array.isArray(A)){A.forEach(e=>he(e,"Selected Footer"));let i={recalculate:!0,isEditMode:X,list:A.map(e=>(0,l.A)((0,l.A)({},e),{},{label:T[0]}))};ne(X?(0,r.uU)(!1):(0,r.uU)(!0));try{await ie.editTransaction(e,i),K&&await K()}catch(n){console.error("Error updating transactions:",n)}}else{he(A,"Transactions Tab");let n={recalculate:!0,isEditMode:X,list:[(0,l.A)((0,l.A)({},A),{},{label:T[0]})]};ne(X?(0,r.uU)(!1):(0,r.uU)(!0)),await ie.editTransaction(e,n),K&&await K(),(0,g.y)("Success!","You have successfully updated the label. You can continue editing other labels, and click on Recalculate to sync the cost basis if needed.","info")}L(),re(null),"review"!==G&&"Review"!==G||Q(!1)},he=async(e,n)=>{var i,t,o,a;let d={existing_transaction_label:null===e||void 0===e?void 0:e.label,updated_transaction_label:T[0],transaction_type:null===e||void 0===e?void 0:e.transactionType,date_of_transaction:s()(+(null===e||void 0===e?void 0:e.timestamp)).format("YYYY/MM/DD HH:mm:ss"),net_worth:(null===e||void 0===e||null===(i=e.netValue)||void 0===i?void 0:i.fiatValue)||0,fee_coin:null===e||void 0===e||null===(t=e.fee)||void 0===t?void 0:t.currency,fee:(null===e||void 0===e||null===(o=e.fee)||void 0===o?void 0:o.amount)||0,transaction_id:null===e||void 0===e?void 0:e.transactionId,"profit/loss":(null===e||void 0===e||null===(a=e.gainsDetails)||void 0===a?void 0:a.capitalGain)>=0?"Profit":"Loss",asset_type:null!==e&&void 0!==e&&e.isNFT?"NFT":"Transaction",from_where:n,source:u.s.source};var r,c,v,m,h,g,x,p,_,j;null!==e&&void 0!==e&&e.receiver&&(d=(0,l.A)((0,l.A)({},d),{},{to:{wallet:"".concat(null===e||void 0===e||null===(r=e.receiver)||void 0===r?void 0:r.public_name," (").concat((null===e||void 0===e||null===(c=e.receiver)||void 0===c?void 0:c.alias)||(null===e||void 0===e||null===(v=e.receiver)||void 0===v?void 0:v.address),")"),coin:(null===e||void 0===e||null===(m=e.receivedCurrency)||void 0===m?void 0:m.currency)||(null===e||void 0===e||null===(h=e.sentCurrency)||void 0===h?void 0:h.currency)}}));null!==e&&void 0!==e&&e.sender&&(d=(0,l.A)((0,l.A)({},d),{},{from:{wallet:"".concat(null===e||void 0===e||null===(g=e.sender)||void 0===g?void 0:g.public_name," (").concat((null===e||void 0===e||null===(x=e.sender)||void 0===x?void 0:x.alias)||(null===e||void 0===e||null===(p=e.sender)||void 0===p?void 0:p.address),")"),coin:(null===e||void 0===e||null===(_=e.sentCurrency)||void 0===_?void 0:_.currency)||(null===e||void 0===e||null===(j=e.receivedCurrency)||void 0===j?void 0:j.currency)}}));u.A.trackEvent(u.s.transaction_label_update,d)};return(0,j.jsx)("div",{className:[b.FirstTransactionColumn,"fourthTourStep"].join(" "),id:"main-trx-box",onClick:e=>{e.stopPropagation()},children:(0,j.jsxs)("div",{className:b.transactionTypeImgAndTitleContainer,children:[(0,j.jsxs)("div",{className:b.timeStap,id:"main-trx-box",children:[(xe=null===A||void 0===A?void 0:A.functionName,xe&&xe.length>20?"".concat(xe.slice(0,20),"..."):xe),(0,j.jsx)(x.A,{className:b.tooltip,text:null===A||void 0===A?void 0:A.functionName,theme:"dark",bubbleStyle:"left-center"})]}),(0,j.jsxs)("div",{className:b.tagDropContainer,style:{position:"relative"},ref:te,children:[(0,j.jsx)("div",{className:b.tagModalSelectTagContainer,onClick:()=>{ae(!oe),ue("")},"data-testid":"tags-list",style:{background:q},children:(0,j.jsxs)("div",{className:b.selectTag,children:[(0,j.jsx)("div",{className:b.clickHereTags,"data-testid":"tag-title",children:Z?T.length>0?T[0]:"Select Label":"transactions"===G?"Select Label":(null===A||void 0===A?void 0:A.label)||"Select Label"}),de===(null===A||void 0===A?void 0:A.id)?(0,j.jsx)("img",{src:m.T.Loader,alt:"edit"}):(0,j.jsx)("img",{src:m.T.Edit,alt:"edit"})]})}),(0,j.jsx)("div",{className:b.tabDropContainer,children:oe&&null===de&&(ge=(null===A||void 0===A?void 0:A.transactionType)||D,y(ge,T,N,ae,me,I,b,S,v.gL,A,J,G,ce,ue))}),(0,j.jsx)("div",{children:(!(null!==A&&void 0!==A&&A.label)||null===(null===A||void 0===A||null===(n=A.netValue)||void 0===n?void 0:n.fiatValue)&&!(null!==A&&void 0!==A&&null!==(i=A.gainsDetails)&&void 0!==i&&i.isMissingPurchaseHistory)||(null===A||void 0===A||null===(t=A.gainsDetails)||void 0===t?void 0:t.isMissingPurchaseHistory))&&(0,j.jsx)(f,{postDetail:A,showWarning:F,handleMissingPriceModal:e=>{e.stopPropagation(),R(null===A||void 0===A?void 0:A.id)},handleMissingPurchaseModal:e=>{e.stopPropagation(),E(null===A||void 0===A?void 0:A.id)},index:V,isRowHover:ee})}),$&&(0,j.jsxs)("div",{className:b.labelSearchFilter,onClick:()=>{return e="Label",n=null===A||void 0===A?void 0:A.label,void $(i=>{var t;const s=null!==(t=i[e])&&void 0!==t&&t.includes(n)?i[e].filter(e=>e!==n):[...i[e]||[],n],o=null===n||void 0===n?void 0:n.replace(/\s/g,"-"),a="".concat(e,"_").concat(o);s.includes(n)?le.updateUrlWithQueryParm(a,!0):le.removeQueryParam(a);
1const d=new URL(window.location.origin+h.e6),r=new URLSearchParams(window.location.search);r.set(a,s.includes(n));const c="".concat(d.toString(),"?").concat(r.toString()),u=window.open(c,"_blank","noopener,noreferrer");return u&&(u.opener=null),(0,l.A)((0,l.A)({},i),{},{[e]:s})});var e,n},children:[(0,j.jsx)("img",{src:m.T.SearchIcon,alt:"search"}),(0,j.jsxs)("div",{className:b.tooltip,children:["Filter all ",null===A||void 0===A?void 0:A.label]})]})]}),M&&(0,j.jsx)("div",{className:b.timeStap,"data-testid":"timestamp",id:"main-trx-box",children:s()(+(null===A||void 0===A?void 0:A.timestamp)).tz(_.timezone).format("YYYY/MM/DD HH:mm:ss")})]})});var ge,xe}},11451:(e,n,i)=>{i.d(n,{A:()=>T});i(9950);const l="warning-modal_Overlay__lf4j8",t="warning-modal_Modal__9ouKw",s="warning-modal_ModalHeaderContainer__JTxlV",o="warning-modal_arrowImg__Is8nS",a="warning-modal_closeImg__-0DFT",d="warning-modal_contentContainer__aqfAi",r="warning-modal_inputContainer__Azzpk",c="warning-modal_title__8mRn3",u="warning-modal_desc__1ML0n",v="warning-modal_selectWalletCount__Vts7x",m="warning-modal_scrollableContainer__hXQjX",h="warning-modal_nameCell__THNIq",g="warning-modal_avatar__EimRq",x="warning-modal_noteContainer__kkbrs",p="warning-modal_closeBtnContainer__R14+2",_="warning-modal_cancelBtn__9kj2I";var j=i(13590),y=i(63031),C=i(44414);const T=e=>{let{data:n,closeHandler:i,handleDeleteBtn:T,updateTransactionSettings:f,isMultiple:b,multipleContacts:N,handleDeleteAllBtn:w}=e;return(0,C.jsx)("div",{className:l,children:(0,C.jsxs)("div",{className:t,children:[(0,C.jsxs)("div",{className:s,children:[(0,C.jsxs)("h1",{children:[(0,C.jsx)("img",{src:j.T.LeftArrow,alt:"back",className:o,onClick:i}),null===n||void 0===n?void 0:n.modalTitle]}),(0,C.jsx)("img",{src:j.T.CrossBlack,alt:"close",onClick:i,className:a})]}),(0,C.jsxs)("div",{className:d,children:[!b&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:r,children:null!==n&&void 0!==n&&n.isContact?(0,C.jsxs)("div",{className:h,children:[(0,C.jsx)("div",{className:g,style:{backgroundColor:(0,y.Xf)((0,y.rU)(null===n||void 0===n?void 0:n.title))},children:(0,y.rU)(null===n||void 0===n?void 0:n.title)}),(0,C.jsx)("span",{children:null===n||void 0===n?void 0:n.title})]}):(0,C.jsxs)("div",{children:[(0,C.jsx)("img",{src:null===n||void 0===n?void 0:n.logo,alt:null===n||void 0===n?void 0:n.modalTitle}),(0,C.jsx)("div",{className:c,children:null===n||void 0===n?void 0:n.title}),(0,C.jsx)("div",{className:u,children:null===n||void 0===n?void 0:n.desc})]})}),(0,C.jsxs)("div",{className:x,style:"Update Transaction settings"===(null===n||void 0===n?void 0:n.modalTitle)?{background:"#F4F6FF"}:void 0,children:[(0,C.jsx)("img",{src:j.T.InfoLightBlack,alt:"info"}),null===n||void 0===n?void 0:n.infoNote]})]}),b&&(0,C.jsxs)("div",{style:{marginTop:-50},children:[(0,C.jsxs)("div",{className:x,style:"Update Transaction settings"===(null===n||void 0===n?void 0:n.modalTitle)?{background:"#F4F6FF"}:void 0,children:[(0,C.jsx)("img",{src:j.T.InfoLightBlack,alt:"info"}),null===n||void 0===n?void 0:n.infoNote]}),(0,C.jsxs)("div",{className:v,children:["Selected Contacts (",null===N||void 0===N?void 0:N.length,")"]}),(0,C.jsx)("div",{className:m,children:N.map(e=>(0,C.jsxs)("div",{className:h,children:[(0,C.jsx)("div",{className:g,style:{backgroundColor:(0,y.Xf)((0,y.rU)(e.name))},children:(0,y.rU)(e.name)}),(0,C.jsx)("span",{children:e.name})]}))})]})]}),(0,C.jsxs)("div",{className:p,children:[(0,C.jsx)("button",{onClick:i,"data-testid":"close-btn",className:_,children:"Cancel"}),(0,C.jsx)("button",{onClick:b?w:T||f,style:{background:T?"#FF3D00B2":"#00C693"},"data-testid":"delete-btn",children:T?null===n||void 0===n?void 0:n.modalTitle:"Update Settings"})]})]})})}},28153:(e,n,i)=>{i.d(n,{A:()=>g});var l=i(89379),t=i(9950),s=i(19567),o=i(79178),a=i(9210),d=i.n(a),r=i(96820),c=i(23849),u=i(66648),v=i(84081),m=i(92539),h=i(44414);const g=function(e){var n,i;let{title:a,setFunction:g,enableSearch:x=!1,borderColor:p,isUp:_,isReachedTop:j,filterTypesChecked:y,setFilterTypesChecked:C,isCheckedTrue:T,handleChange:f=()=>{},listOfCurrency:b,setListOfCurrency:N,setCurrentPage:w,setSelectedTrx:k,setAllCheckBox:A,editedBgColor:S}=e;const{currentUser:I}=(0,t.useContext)(v.c),D=new r.d3,[M,L]=(0,t.useState)(!1),[F,P]=(0,t.useState)(""),[B,R]=(0,t.useState)(!1),[E,H]=(0,t.useState)(null),[U,W]=(0,t.useState)(!1),Y=(0,t.useRef)(),V=new o.A(b,{keys:["name","currency","contractAddress"]}),O=(0,t.useRef)(),G=V.search(F),z=F?G.map(e=>e.item):b,Z=()=>{L(e=>(e||0===b.length&&X(),!e)),P("")};let J=0;(0,t.useEffect)(()=>(document.addEventListener("mousedown",Q),()=>{document.removeEventListener("mousedown",Q)}),[]);const Q=e=>{O.current&&!O.current.contains(e.target)&&(L(!1),P(""))};(0,t.useEffect)(()=>{j&&L(!1)},[j]);const q=(e,n)=>{if(!e||!n)return;null===w||void 0===w||w(1),null===k||void 0===k||k([]),null===A||void 0===A||A(!1);const{name:i,id:t}=n;t&&(f(e,i),C&&C(n=>{const i=n[e]||[],s=i.includes(t),o=s?i.filter(e=>e!==t):[...i,t],a="".concat(e,"_").concat(String(t).replace(/\s+/g,"-"));return D?(s?D.removeQueryParam(a):D.updateUrlWithQueryParm(a,!0),(0,l.A)((0,l.A)({},n),{},{[e]:o})):n}))},X=async()=>{R(!0);const e=(0,c.rJ)(u.db,"users",I.uid,"TrxMetadata","tokenCount","assets"),n=(0,c.P)(e,(0,c.My)("count","desc"),(0,c.AB)(200)),i=await(0,c.GG)(n),l=i.docs.map(e=>e.data());N(l),i.docs.length>0?(H(i.docs[i.docs.length-1]),W(!1),R(!1)):(W(!0),R(!1))};return(0,t.useEffect)(()=>{const e=new IntersectionObserver(e=>{!e[0].isIntersecting||B||U||(async()=>
1{if(!E||B)return;R(!0);const e=(0,c.rJ)(u.db,"users",I.uid,"TrxMetadata","tokenCount","assets"),n=(0,c.P)(e,(0,c.My)("count","desc"),(0,c.HM)(E),(0,c.AB)(200)),i=await(0,c.GG)(n),l=i.docs.map(e=>e.data());N(e=>[...e,...l]),i.docs.length>0?(H(i.docs[i.docs.length-1]),R(!1)):(W(!0),R(!1))})()},{root:document.querySelector("#scrollList"),threshold:.1});return Y.current&&e.observe(Y.current),()=>{Y.current&&e.unobserve(Y.current)}},[E,B,U,M]),(0,t.useEffect)(()=>{0===b.length&&X()},[M]),(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)("div",{className:s.A.Dropdown,ref:O,"data-test-id":a,style:{borderColor:p,background:S},children:[(0,h.jsxs)("div",{className:s.A.Header,role:"button",onKeyPress:()=>Z(),onClick:()=>Z(),children:[(0,h.jsx)("div",{className:s.A.titleText,"data-testid":"drop-title-".concat(null===(n=String(a))||void 0===n||null===(i=n.toLowerCase())||void 0===i?void 0:i.replace(/\s/g,"-")),children:a}),(0,h.jsx)("div",{className:s.A.Action,children:M?(0,h.jsx)("i",{className:"fas fa-minus"}):_?(0,h.jsx)("i",{className:"fas fa-chevron-up"}):(0,h.jsx)("i",{className:"fas fa-chevron-down"})})]}),M?(0,h.jsxs)("div",{className:s.A.dropDownContentBox,testId:a,children:[x&&(0,h.jsx)("div",{className:s.A.searchInput,children:(0,h.jsx)("input",{type:"text",placeholder:"Search...",value:F,onChange:e=>P((0,m.o)(e.target.value)),autoFocus:!0,style:{background:S}})}),(0,h.jsxs)("div",{className:s.A.List,"data-testid":"drop-items-".concat(null===z||void 0===z?void 0:z.length),id:"scrollList",children:[z.map((e,n)=>{var i,l,t,o,r,c,u,v,m,x,p;return(0,h.jsxs)("div",{onClick:()=>function(e){T?T&&q(a,e):(g(e),L(!1),P(""))}(e),"data-testid":"button-".concat("object"===typeof e?null===e||void 0===e||null===(i=e.name)||void 0===i||null===(l=i.toLowerCase())||void 0===l?void 0:l.replace(/\s/g,"-"):null===(t=String(e))||void 0===t||null===(o=t.toLowerCase())||void 0===o?void 0:o.replace(/\s/g,"-")),className:s.A.listItem,style:{background:S},children:[T?(0,h.jsxs)("div",{className:s.A.checkBoxContainer,children:[(0,h.jsx)("input",{type:"checkbox",name:"checkbox",checked:(null===y||void 0===y||null===(r=y[a])||void 0===r?void 0:r.includes(null===e||void 0===e?void 0:e.id))||(null===y||void 0===y||null===(c=y[a])||void 0===c?void 0:c.includes(null===e||void 0===e?void 0:e.currency))}),(0,h.jsx)("span",{className:s.A.checkSign})]}):null,(0,h.jsx)("img",{src:e.logo_url||"http://www.gravatar.com/avatar/".concat(d().enc.Hex.stringify(d().SHA1(e.currency)),"?d=retro&s=10"),alt:e.id,className:s.A.iconImage}),(0,h.jsx)("div",{className:s.A.TextWrapper,"data-testid":"item-details-".concat("object"===typeof e?null===e||void 0===e||null===(u=e.name)||void 0===u||null===(v=u.toLowerCase())||void 0===v?void 0:v.replace(/\s/g,"-"):null===(m=String(e))||void 0===m||null===(x=m.toLowerCase())||void 0===x?void 0:x.replace(/\s/g,"-")),children:(0,h.jsx)("div",{className:s.A.ItemName,children:(0,h.jsx)("span",{children:null===(p=z[J++])||void 0===p?void 0:p.name})})})]},n)}),null!==z&&void 0!==z&&z.length||B?null:(0,h.jsx)("h5",{className:s.A.notFoundText,children:"Search not found!"}),B&&(0,h.jsx)("div",{children:[...Array(1)].map((e,n)=>(0,h.jsxs)("div",{className:"".concat(s.A.listItem," ").concat(s.A.loadingSkelton),children:[(0,h.jsx)("div",{className:s.A.skeltonText,style:{width:"24px",marginRight:8}}),(0,h.jsx)("div",{className:s.A.skeltonText})]},n))}),U?null:(0,h.jsx)("div",{ref:Y,style:{height:"50px",marginTop:"0px",backgroundColor:"transparent"}}),z.length&&U?(0,h.jsx)("h5",{className:s.A.notFoundText,children:"No more data to load."}):null]})]}):null]})})}},57446:(e,n,i)=>{i.d(n,{A:()=>L});var l=i(89379),t=i(9210),s=i.n(t),o=i(9950),a=i(82569),d=i(29684),r=i(60981),c=i(82676),u=i(24273),v=i(84081),m=i(96820),h=(i(14765),i(84355)),g=i(78480),x=(i(63031),i(13590)),p=i(11451),_=i(56801),j=i(2253);const y="selection-box_selectionBoxMainContainer__0+kXr",C="selection-box_selectionBoxContent__t6bKj",T="selection-box_selectedText__F23JK",f="selection-box_selectBtn__tzEFJ",b="selection-box_selectBtns__cOCmc",N="selection-box_actionsMainContainer__H6Mrz",w="selection-box_tooltip__lPVSX",k="selection-box_Loading__5oj8R",A="selection-box_mergeStatusBar__ynyzD",S="selection-box_deSelectBtnContainer__JREo-",I="selection-box_tagsContainer__dfyRq",D="selection-box_editBtn__1pxIM";var M=i(44414);const L=e=>{var n,i;let{selectionBox:t,selectedTrx:L,deleteSelectedTransactionsHandler:F,currentUser:P,setSelectionBox:B,clicked:R,setClicked:E,setAllCheckBox:H,allCheckBox:U,updateTransactions:W,handleAllCheckbox:Y,handleShowModal:V,isMergedClicked:O,setMergedClicked:G,handleSplit:z,from:Z,setEditedTrxList:J,isEditedModeOn:Q,fetchTransactionsNew:q,onTransactionUpdate:X}=e;const K=(0,o.useRef)(),{isTriggered:$}=(0,a.d4)(e=>e.session),{idToken:ee}=(0,o.useContext)(v.c),{userSettings:ne}=(0,o.useContext)(g.N),ie=(new h.A,new m.Gf),[le,te]=(0,o.useState)(!0),[se,oe]=(0,o.useState)(!1),[ae,de]=(0,o.useState)(!1),[re,ce]=(0,o.useState)([]),[ue,ve]=(0,o.useState)(!1),[me,he]=(0,o.useState)({status:"",msg:""}),[ge,xe]=(L.map(e=>e.id),(0,o.useState)(!1)),pe=()=>{de(!1),ve(!1),B(!1),H(!1),localStorage.setItem("isCostbasisUpated","true")};(0,o.useEffect)(()=>(document.addEventListener("mousedown",_e),()=>{document.removeEventListener("mousedown",_e)}),[]),(0,o.useEffect)(()=>{var e;let n=!0;(null===(e=L)||void 0===e?void 0:e.length)>1&&(n=L.every(e=>{var n;return(null===e||void 0===e?void 0:e.transactionType)===(null===(n=L[0])||void 0===n?void 0:n.transactionType)})),te(n)},[L]);const _e=e=>{K.current&&!K.current.contains(e.target)&&de(!1)},je=e=>{let n;return n=null!==e&&void 0!==e&&e.logo_url?null===e||void 0===e?void 0:e.logo_url:"http://www.gravatar.com/avatar/".concat(s().enc.Hex.stringify(s().SHA1(e.id)),"?d=retro"),n},ye=(e=>{var n,i,t,s,o,a,v;const m=(null===(n=L)||void 0===n?void 0:n.sentCurrency)&&je(null===(i=L)||void 0===i?void 0:i.sentCurrency),h=(null===(t=L)||void 0===t?void 0:t.receivedCurrency)&&je(null===(s=L)||void 0===s?void 0:s.receivedCurrency),g=(null===(o=L)||void 0===o?void 0:o.fee)&&je(null===(a=L)||void 0===a?void 0:a.fee),x=null===(v=L)||void 0===v?void 0:v.transactionId;let p={};switch(e){case"deposit":p={transactionType:d.A,buttonText:"Deposit"};break;case"withdrawal":p={transactionType:r.A,buttonText:"Withdrawal"};break;case"trade":p={transactionType:c.A,buttonText:"Trade"};break;case"transfer":p={transactionType:u.A,buttonText:"Transfer"}}return p=(0,l.A)((0,l.A)({},p),{}
1,{sentImg:m,receivedImg:h,feeImg:g,transactionId:x}),p})(null===(n=L)||void 0===n?void 0:n.transactionType);return(0,o.useEffect)(()=>{let e;return me.status&&(e=setTimeout(()=>{he({status:"",msg:""}),"success"===(null===me||void 0===me?void 0:me.status)&&(E(!R),B(!1))},5e3)),()=>clearTimeout(e)},[me.status]),t&&(null===(i=L)||void 0===i?void 0:i.map((e,n)=>{var i,t,s,o,a;return n<1?(0,M.jsxs)("div",{className:y,children:["success"===me.status&&(0,M.jsxs)("div",{className:A,children:[(0,M.jsx)("i",{className:"fas fa-check"}),(0,M.jsx)("p",{children:me.msg})]}),"failed"===me.status&&(0,M.jsxs)("div",{className:A,style:{background:"#EC5252"},children:[(0,M.jsx)("i",{className:"fas fa-times"}),(0,M.jsx)("p",{children:me.msg})]}),(0,M.jsxs)("div",{className:C,children:[se?(0,M.jsx)(p.A,{data:{modalTitle:"Delete ".concat(L.length>1?"Transactions":"Transaction"),logo:x.T.Trash,desc:"Once you delete ".concat(L.length>1?"these":"this"," ").concat(L.length," ").concat(L.length>1?"transactions":"transaction",", ").concat(L.length>1?"they":"it"," will be permanently removed from your records. This action is irreversible."),infoNote:"Are you sure you want to delete ".concat(L.length>1?"these":"this"," ").concat(L.length," ").concat(L.length>1?"transactions":"transaction","?")},closeHandler:()=>oe(!1),handleDeleteBtn:()=>{F(),oe(!1),H(!1)},isTriggered:$}):null,(0,M.jsxs)("div",{className:N,children:[(0,M.jsxs)("div",{className:T,"data-testid":"selected-trx-numbers",children:[(0,M.jsx)("img",{src:x.T.CheckMark,alt:"checkmark",style:{marginRight:"5px"}}),(0,M.jsx)("span",{children:L.length}),"Selected"]}),(0,M.jsx)("hr",{}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("button",{className:f,onClick:()=>{!U&&Y(!0)},children:"Select All"}),(0,M.jsx)("hr",{}),1===L.length&&(0,M.jsxs)("button",{className:"".concat(b," ").concat(D),onClick:()=>V(e,ye),style:{marginRight:"10px"},children:[(0,M.jsx)("img",{src:x.T.Edit,alt:"edit",style:{marginRight:"5px"}}),"Edit"]}),L.length>1&&(0,M.jsxs)("button",{className:"".concat(b," ").concat(D),style:{marginRight:"10px"},onClick:()=>{(async e=>{const n="Bearer "+ee;if("idle"===$){G(!0);const a=e.map(e=>null===e||void 0===e?void 0:e.id),d={uid:null===P||void 0===P?void 0:P.uid,trxsIDs:a,isEditMode:Q};try{const e=await ie.mergeTransactionsData(n,d);var i,l;200===(null===e||void 0===e?void 0:e.status)||null!==e&&void 0!==e&&e.success?(he({status:"success",msg:(null===e||void 0===e||null===(i=e.data)||void 0===i?void 0:i.message)||"Transactions have been merged."}),q&&await q()):he({status:"failed",msg:(null===e||void 0===e||null===(l=e.data)||void 0===l?void 0:l.message)||"Transactions can\u2019t be merged."})}catch(o){var t,s;const e=(null===(t=o.response)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.message)||o.message||"Merge API failed";he({status:"failed",msg:e})}G(!1)}})(L)},children:[O?(0,M.jsx)("img",{src:x.T.Loader,alt:"loading"}):(0,M.jsx)("img",{src:x.T.MergeWhite,alt:"merge",style:"start"===$?{opacity:.5,cursor:"not-allowed"}:null}),(0,M.jsx)("span",{style:"start"===$?{opacity:.5,cursor:"not-allowed"}:null,children:"Merge"}),"start"===$&&(0,M.jsx)(_.A,{className:w,text:"This Action is disabled while syncing.",theme:"light",bubbleStyle:"bottom-left"})]}),(null===(i=L)||void 0===i?void 0:i.length)<=1&&((null===(t=L[0])||void 0===t?void 0:t.isMergedTrx)||"trade"===(null===(s=L[0])||void 0===s?void 0:s.transactionType)||"transfer"===(null===(o=L[0])||void 0===o?void 0:o.transactionType))&&(0,M.jsxs)("button",{className:"".concat(b," ").concat(D),style:{marginRight:"10px"},onClick:()=>{z(L[0])},children:[O?(0,M.jsx)("img",{src:x.T.Loader,alt:"loading"}):(0,M.jsx)("img",{src:x.T.SplitWhite,alt:"split",style:"start"===$?{opacity:.5,cursor:"not-allowed"}:null}),(0,M.jsx)("span",{style:"start"===$?{opacity:.5,cursor:"not-allowed"}:null,children:"Split"}),"start"===$&&(0,M.jsx)(_.A,{className:w,text:"This Action is disabled while syncing.",theme:"light",bubbleStyle:"bottom-left"})]})]}),(0,M.jsx)("div",{className:I,children:le&&(0,M.jsx)(j.A,{currentUser:P,userSettings:ne,tagsList:re,setTagsList:ce,setShowLoader:ve,showTagType:ae,setShowTagType:de,postDetail:L,openDown:!1,showDate:!1,updateTransactions:W,selectedTrxsType:null===(a=L[0])||void 0===a?void 0:a.transactionType,handleHooksAfterRes:pe,from:Z,setEditedTrxList:J,fromSelectionBox:!0,setSelectionBox:B,isEditedModeOn:Q,fetchTransactionsNew:q})}),ue&&(0,M.jsx)("img",{className:k,src:x.T.Loader,alt:"loading"}),(0,M.jsxs)("div",{className:S,children:[("highPnl"===Z||"Uncategorised"===Z)&&(0,M.jsxs)("button",{className:b,onClick:()=>{const e="highPnl"===Z?"Mark as Resolved":"Uncategorised"===Z?"Ignore":"";e&&(async(e,n)=>{if(xe(!0),"idle"===$){const t="Bearer "+ee;let s=e.map(e=>(0,l.A)((0,l.A)({},e),{},{isHighPnLReviewed:e.isHighPnLReviewed||"Mark as Resolved"===n,isUncategorisedIgnored:e.isUncategorisedIgnored||"Ignore"===n,isMissingPriceIgnored:e.isMissingPriceIgnored||"Ignore Trx"===n})),o={recalculate:!0,isEditMode:Q,list:s};try{const n=await ie.editTransaction(t,o);q();const i=n.data.updatedTransactions.map(e=>e.id),l=e.map(e=>e.id).filter(e=>!i.includes(e));return X&&X(),{success:i,failed:l}}catch(i){return{success:[],failed:e.map(e=>e.id)}}finally{xe(!1),B(!1),H(!1)}}})(L,e)},children:[ge?(0,M.jsx)("img",{src:x.T.Loader,alt:"loading"}):(0,M.jsx)("img",{src:"highPnl"===Z?x.T.MarkAsResolved:x.T.Ignore,alt:"highPnl"===Z?"MarkAsResolved":"Ignore",style:{marginRight:"5px"}}),"highPnl"===Z?"Mark as Resolved":"Uncategorised"===Z?"Ignore from Uncategorised":""]}),(0,M.jsxs)("button",{className:b,onClick:()=>{oe(!0)},children:[(0,M.jsx)("img",{src:x.T.Delete,alt:"delete",style:{marginRight:"5px"}}),"Delete"]}),(0,M.jsx)("hr",{}),(0,M.jsxs)("button",{className:b,onClick:()=>{Y(!1),L=[]},children:[(0,M.jsx)("img",{src:x.T.Close,alt:"close"}),"Close"]})]})]})]})]},n):null}))}},72299:(e,n,i)=>{i.d(n,{A:()=>g});i(9950);var l=i(56801),t=i(13590);const s="edit-mode_toggleContainer__q6adE",o="edit-mode_toggleSwitch__jVTmi",a="edit-mode_slider__LknIO",d="edit-mode_infoContainer__53ENd",r="edit-mode_outlineImg__Y7kFN",c="edit-mode_filledImg__ncD+O",u="edit-mode_tooltip__lupA5";var v=i(82569),m=i(84753),h=i(44414);const g=e=>{let{isEditedModeOn:n,handleEditModeToggle:i,page:g}=e;const x=(0,v.d4)(m.si),{isTriggered:p}=(0,v.d4)(e=>e.session),_=(0,v.wA)(),j=void 0!==n?n:x;return(0,h.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,h.jsxs)("div",{className:s,style:{background:j?"#FFF98E":""},children:[(0,h.jsxs)("label",{className:o,children:[(0,h.jsx)("input",{type:"checkbox",checked:j,onChange:()=>{i?i():_((0,m.op)(!j))}}),(0,h.jsx)("span",{className:a,style:"review"===g?{left:"-8px",right:"-7px"}:{}})]}),(0,h.jsx)("span",{children:"Edit Mode"})]}),(0,h.jsxs)("div",{className:d,children:[(0,h.jsx)("img",{src:t.T.InfoOutlineBlack,className:r,alt:"info"}),(0,h.jsx)("img",{src:t.T.InfoFilledBlack,className:c,alt:"info"}),(0,h.jsx)(l.A,{className:u,text:"Enabling Edit Mode pauses tax calculations and P&L updates. Disable Edit Mode to resume calculations.",theme:"light",bubbleStyle:"left-center",isNotShowCopyButton:!0})]})]})}},87703:(e,n,i)=>{i.d(n,{A:()=>m});i(9950);const l="loader_NoDataFound__le+1S",t="loader_NoData__pbFpC",s="loader_desc__5kRah",o="loader_DollarBill__Evoqx",a="loader_addInteg__qz3q7",d="loader_loader__uYGDD";i(58661);var r=i(42074),c=i(13590),u=i(44414);const v=e=>{let{title:n,desc:i,restFilterHandler:d,isLink:v,links:m}=e;return(0,u.jsxs)("div",{className:l,children:[(0,u.jsx)("img",{className:o,src:c.T.DollarBill,alt:"add"}),(0,u.jsx)("div",{className:t,children:n}),(0,u.jsx)("p",{className:s,children:i}),v?(0,u.jsxs)(r.N_,{to:"".concat(null===m||void 0===m?void 0:m.wallet,"?viewMore=true&filter=all"),className:a,"data-testid":"reports-tax-loss-see-how-button",children:[(0,u.jsx)("img",{src:c.T.EmptyWallet,alt:"add"}),"Add Integration"]}):(0,u.jsx)("button",{onClick:d,children:"Reset Filter"})]})};i(82569);const m=e=>{let{links:n,fetched:i,transactions:l,isFilterLimitExceed:t,restFilterHandler:s,progress:o}=e;return(0,u.jsx)(u.Fragment,{children:i&&0===(null===l||void 0===l?void 0:l.length)?(0,u.jsx)(v,{title:"No Transactions Found!",desc:"We will need your full transaction history in order to generate accurate gains and tax reports",isLink:!0,links:n}
1):i&&0===(null===l||void 0===l?void 0:l.length)&&!t?(0,u.jsx)(v,{title:"No Transactions Found!",desc:"Please consider adjusting your filters or resetting the search",restFilterHandler:s}):i&&t?(0,u.jsx)(v,{title:"Applied Filter Limit Exceeded!",desc:"Please remove some filters to proceed or reset your filters.",restFilterHandler:s}):i?null:(0,u.jsx)("div",{className:d,style:{width:"".concat(o,"%")}})})}},89272:(e,n,i)=>{i.d(n,{A:()=>j});i(9950);const l="pagination_paginationContainer__hknaC",t="pagination_paginationControls__4Wdfw",s="pagination_pageInfo__jeqWp",o="pagination_currentPage__sSTnc",a="pagination_inactive__aNyyw",d="pagination_icon__IjS8l",r="pagination_arrowBtn__vcZTW",c="pagination_arrowButtons__JR3QN",u="pagination_rowPerPageDrop__wHwfv",v="pagination_rowPerPageDropContainer__cZJNX",m="pagination_gotoFirstPage__SaGQb";var h=i(13590),g=i(47748),x=i(31789),p=i(96820),_=i(44414);const j=e=>{let{setPageRowFilter:n,pageRowFilter:i,currentPage:j,setCurrentPage:y,updatePage:C,setSelectedTrx:T,setAllCheckBox:f,trxLength:b,totalTrx:N,fetched:w,fetchTransactions:k,clicked:A,setClicked:S,isLastPage:I,handleNextPage:D,handlePreviousPage:M,totalFilteredResult:L,isTrxPage:F,resetPageQuery:P}=e;const B=new p.d3,R=Math.ceil((L||N)/i);const E=()=>{y(1),B.updateUrlWithQueryParm("page",1),P&&P()};return b>0?(0,_.jsxs)("div",{className:l,children:[F?null:(0,_.jsx)("div",{className:m,children:j>2&&(void 0===w||!0===w)&&(0,_.jsx)("button",{className:c,onClick:E,children:"Go to First Page"})}),(0,_.jsxs)("div",{className:t,children:[F?(0,_.jsx)("div",{className:"".concat(r," ").concat(j<=1?a:""),onClick:E,children:(0,_.jsx)("img",{src:h.T.DoubleForward,alt:"back",className:d,style:{transform:"rotate(180deg)"}})}):null,(0,_.jsxs)("div",{className:"".concat(r," ").concat(j<=1?a:""),onClick:()=>{F&&j>1?M():C(+j-1!==0?+j-1:+j,"prev"),T&&T([]),f&&f(!1)},children:[(0,_.jsx)("img",{src:h.T.Forward,alt:"Previous",className:d,style:{transform:"rotate(180deg)"}}),(0,_.jsx)("span",{children:"Previous"})]}),(0,_.jsxs)("div",{className:s,children:[(0,_.jsx)("span",{className:o,children:Math.ceil(j)}),"of ",R]}),(0,_.jsxs)("div",{className:"".concat(r," ").concat((I||j)>=R?a:""),onClick:()=>{F&&j<R?D():!I&&j<R&&C(+j+1,"next"),T&&T([]),f&&f(!1)},children:[(0,_.jsx)("span",{children:"Next"}),(0,_.jsx)("img",{src:h.T.Forward,alt:"Next",className:d})]}),F?(0,_.jsx)("div",{className:"".concat(r," ").concat(j>=R?a:""),onClick:()=>{y(R),B.updateUrlWithQueryParm("page",R),P&&P()},children:(0,_.jsx)("img",{src:h.T.DoubleForward,alt:"Next",className:d})}):null]}),(0,_.jsxs)("div",{className:u,children:[(0,_.jsx)("h4",{children:"Items per page"}),(0,_.jsx)("div",{className:v,children:(0,_.jsx)(g.A,{title:i,items:x.F8,setFunction:e=>{n(e),B.updateUrlWithQueryParm("pageRowFilter",e)},totalTrx:b,listWidth:"100%",borderColor:"#1E1F4B",isUp:!0})})]})]}):null}},94142:(e,n,i)=>{i.d(n,{A:()=>Ge});var l=i(89379),t=i(9950);const s={marketTablesMainContainer:"transactions-table_marketTablesMainContainer__auO5d",trThInnerContainer:"transactions-table_trThInnerContainer__HtYgd",trInnerContainer:"transactions-table_trInnerContainer__AkEqe",groupedDateTxt:"transactions-table_groupedDateTxt__4zLa3",trInnerHovered:"transactions-table_trInnerHovered__uUnS2",tableHeading:"transactions-table_tableHeading__mSWIP",scrollContainer:"transactions-table_scrollContainer__Nekgo",pricesTableContainer:"transactions-table_pricesTableContainer__ubOpr",checkBoxContainer:"transactions-table_checkBoxContainer__uMo8n",checkSign:"transactions-table_checkSign__MFVzl",trxTypeAndCheckboxContainer:"transactions-table_trxTypeAndCheckboxContainer__DT0yZ",checkBoxMain:"transactions-table_checkBoxMain__KkppW",trxTypeMainContainer:"transactions-table_trxTypeMainContainer__am9hx",editedText:"transactions-table_editedText__Z321w",actionButtonsContainer:"transactions-table_actionButtonsContainer__Yl3ab",commentsContainer:"transactions-table_commentsContainer__wNVck",tooltipHover:"transactions-table_tooltipHover__FzC9b",tagsContainer:"transactions-table_tagsContainer__29LgV",manualTrxSymbol:"transactions-table_manualTrxSymbol__EnEQq",mergedIcon:"transactions-table_mergedIcon__60G+Z",divider:"transactions-table_divider__zt+cZ"};var o=i(13590),a=i(9210),d=i.n(a),r=i(2253),c=i(84081),u=i(78480);const v={SecondColumn:"sender-receiver-section_SecondColumn__ckOx9",icon:"sender-receiver-section_icon__jON-M",container:"sender-receiver-section_container__BkcvJ",globeContainer:"sender-receiver-section_globeContainer__Dzbnc",section_det:"sender-receiver-section_section_det__-06fu",hover:"sender-receiver-section_hover__1LkLi",currencySearchFilter:"sender-receiver-section_currencySearchFilter__UTDjG",fade:"sender-receiver-section_fade__AIgV0",tooltip:"sender-receiver-section_tooltip__ufqg4",hintFee:"sender-receiver-section_hintFee__P0iks",amountSentReceived:"sender-receiver-section_amountSentReceived__zDo-Y",sentCurrencyContainer:"sender-receiver-section_sentCurrencyContainer__jn3r9",leftColumn:"sender-receiver-section_leftColumn__KF4Jf",rightColumn:"sender-receiver-section_rightColumn__SiTpZ",walletImgContainer:"sender-receiver-section_walletImgContainer__dS0HE",aliasNameContainer:"sender-receiver-section_aliasNameContainer__iSA-y",fullAddressContainer:"sender-receiver-section_fullAddressContainer__G64un",aliasName:"sender-receiver-section_aliasName__r-2wh",copyImg:"sender-receiver-section_copyImg__8r4PB",currencyContainer:"sender-receiver-section_currencyContainer__c3RT3",sourceIcon:"sender-receiver-section_sourceIcon__d0Dfl",currencyIcon:"sender-receiver-section_currencyIcon__q0C6-"};var m=i(63031),h=i(82569),g=i(23849),x=i(66648),p=i(96820),_=i(49731),j=i(92539),y=i(45612);const C="contact-name_modalOverlay__0NACP",T="contact-name_modal__lZLLj",f="contact-name_modalHeader__gGwKw",b="contact-name_closeButton__tg5Qh",N="contact-name_modalContent__0H3+d",w="contact-name_modalFooter__tE6Pf",k="contact-name_cancelButton__WULeS",A="contact-name_createButton__PI3zz",S="contact-name_dropdown__2EMwD",I="contact-name_section__8Ju+c",D="contact-name_label__qaJdX",M="contact-name_from__S-IpL",L="contact-name_to__QZpei",F="contact-name_walletLogo__Yln96",P="contact-name_walletDetails__0Gc3h",B="contact-name_walletName__mmBat",R="contact-name_walletAddress__2lD3O",E="contact-name_inputDiv__+zUWR",H="contact-name_input__bmv47",U="contact-name_dropdownItem__dTGZp",W="contact-name_createNewItem__YvyYV",Y="contact-name_errorMsg__S+ZoS",V="contact-name_nameCell__1iiz9",O="contact-name_avatar__J5LWt";var G=i(90149),z=i(44414);const Z=e=>{var n,i,s,a,d,r,u,v,h,Z,J,Q;let{handleClose:q,postDetail:X,displayData:K,from:$,fetchTransactionsNew:ee}=e;const ne=new p.Gf,ie=new _.A,[le,te]=(0,t.useState)(""),[se,oe]=(0,t.useState)(""),{idToken:ae,currentUser:de}=(0,t.useContext)(c.c),[re,ce]=(0,t.useState)(!1),[ue,ve]=(0,t.useState)([]),[me,he]=(0,t.useState)(!1),[ge,xe]=(0,t.useState)(!1),[pe,_e]=(0,t.useState)(""),{isChecking:je,isDupl
1icate:ye,errorMsg:Ce,checkAlias:Te}=(0,G._)(de,null===de||void 0===de?void 0:de.uid,500),fe=(0,t.useRef)();(0,t.useEffect)(()=>(document.addEventListener("mousedown",be),()=>{document.removeEventListener("mousedown",be)}),[]);const be=e=>{fe.current&&!fe.current.contains(e.target)&&he(!1)};(0,t.useEffect)(()=>{Ce?_e(null===Ce||void 0===Ce?void 0:Ce.msg):(null===le||void 0===le?void 0:le.length)>40?_e("Contact name cannot be more than 40 characters"):_e("")},[Ce,le]);const Ne=e=>{_e("");let n=(0,j.o)(e.target.value);""===n.trim()&&n.includes(" ")?_e("Please add the contact name "):(n=n.replace(/\s{2,}/g," "),""===n?(ce(!0),te(""),_e("Please add the contact name ")):(ce(!1),te(n),Re()&&n.trim()&&Te(n)),he(!0))},we=e=>ue.some(n=>n.name===e),ke=e=>{_e(""),te(e),ce(!1),he(!1)},Ae=()=>{te(le),oe(le),ce(!1),he(!1)},Se=async()=>{if(xe(!0),le)if((null===le||void 0===le?void 0:le.length)>40)_e("Contact name cannot be more than 40 characters"),xe(!1);else if(ye)_e("Wallet name is already exist!"),xe(!1);else{var e;await ie.updateWalletAliasName(de.uid,null===X||void 0===X||null===(e=X.source)||void 0===e?void 0:e.walletId,le),(0,y.y)("Success","Contact name updated successfully","info"),ee&&setTimeout(async()=>{await ee()},5e3),q()}else _e("Please add the contact name"),xe(!1)};(0,t.useEffect)(()=>{(async()=>{const e=(0,g.rJ)(x.db,"users",null===de||void 0===de?void 0:de.uid,"contacts"),n=(await(0,g.GG)(e)).docs.map(e=>(0,l.A)({id:e.id},e.data()));ve(n.sort((e,n)=>e.name.localeCompare(n.name)))})()},[]);const Ie=e=>e||null,De=()=>{const{transactionType:e,source:n,sender:i,label:l}=X;return"trade"===e&&"Cross Chain Swaps"===l||"transfer"===e||"deposit"===e?(null===i||void 0===i?void 0:i.alias)||(null===i||void 0===i?void 0:i.address):(null===n||void 0===n?void 0:n.alias)||(null===n||void 0===n?void 0:n.address)},Me=()=>{const{transactionType:e,source:n,sender:i,label:l}=X;return"trade"===e&&"Cross Chain Swaps"===l||"transfer"===e||"deposit"===e?(null===i||void 0===i?void 0:i.address)||(null===i||void 0===i?void 0:i.alias):(null===n||void 0===n?void 0:n.address)||(null===n||void 0===n?void 0:n.alias)},Le=()=>{const{transactionType:e,receiver:n,label:i,source:l}=X;return"trade"===e&&"Cross Chain Swaps"===i||"transfer"===e&&"Bridge Transfer"===i||"transfer"===e||"withdrawal"===e||"payment"===e?(null===n||void 0===n?void 0:n.alias)||(null===n||void 0===n?void 0:n.address):(null===l||void 0===l?void 0:l.alias)||(null===l||void 0===l?void 0:l.address)},Fe=()=>{const{transactionType:e,receiver:n,label:i,source:l}=X;return"trade"===e&&"Cross Chain Swaps"===i||"transfer"===e&&"Bridge Transfer"===i||"transfer"===e||"withdrawal"===e||"payment"===e?(null===n||void 0===n?void 0:n.address)||(null===n||void 0===n?void 0:n.alias):(null===l||void 0===l?void 0:l.address)||(null===l||void 0===l?void 0:l.alias)},Pe=()=>{var e;const n="sender"===$?De():Le(),i=(null===X||void 0===X||null===(e=X.source)||void 0===e?void 0:e.alias)===n,l=(()=>{var e;return!(null===X||void 0===X||null===(e=X.source)||void 0===e||!e.walletId)})();return{isSourceAddress:i,hasWalletId:l,canUpdate:i&&l,addressType:i?"source":"other"}},Be=()=>{var e;const n=Pe(),i="sender"===$?De():Le();return(0,l.A)((0,l.A)({},n),{},{currentInputAddress:i,inputType:"sender"===$?"sender":"receiver",sourceWalletId:(null===X||void 0===X||null===(e=X.source)||void 0===e?void 0:e.walletId)||null})},Re=()=>!0===Be().isSourceAddress&&!0===Be().hasWalletId;return(0,z.jsx)("div",{className:C,onClick:e=>e.stopPropagation(),children:(0,z.jsxs)("div",{className:T,ref:fe,children:[(0,z.jsxs)("div",{className:f,children:[(0,z.jsx)("h2",{children:"Contact Name"}),(0,z.jsx)("img",{className:b,onClick:q,src:o.T.CrossBlack,alt:"Close Icon"})]}),(0,z.jsxs)("div",{className:N,children:["sender"===$&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("div",{className:I,children:[(0,z.jsx)("label",{className:D,children:"From"}),(0,z.jsxs)("div",{className:L,children:[null!==K&&void 0!==K&&K.sentImg?(0,z.jsx)("img",{src:(null===X||void 0===X||null===(n=X.sender)||void 0===n?void 0:n.logo_url)||(null===X||void 0===X||null===(i=X.source)||void 0===i?void 0:i.logo_url),className:F,alt:"sent","data-testid":"sent-img"}):(null===X||void 0===X||null===(s=X.sender)||void 0===s?void 0:s.address)&&(0,z.jsx)("img",{className:F,src:o.T.
1Empty,alt:"empty wallet"}),(0,z.jsxs)("div",{className:E,children:[(0,z.jsx)("input",{className:H,type:"text",placeholder:"Type to Add",onClick:()=>{Re()||he(!0)},value:re?"":le||De()||"",onChange:Ne,style:pe?{border:"1px solid #ec6745"}:void 0}),me&&!Re()&&(0,z.jsxs)("ul",{className:S,children:[le&&le!==se&&!we(le)&&(0,z.jsxs)("li",{onClick:Ae,className:W,children:["Create new:"," ",(null===le||void 0===le?void 0:le.length)>35?"".concat(le.slice(0,30),"..."):le]}),ue.map((e,n)=>(0,z.jsx)("li",{onClick:()=>ke(null===e||void 0===e?void 0:e.name),className:U,children:(0,z.jsxs)("div",{className:V,children:[(0,z.jsx)("div",{className:O,style:{backgroundColor:(0,m.Xf)((0,m.rU)(null===e||void 0===e?void 0:e.name))},children:(0,m.rU)(null===e||void 0===e?void 0:e.name)}),(0,z.jsx)("span",{children:null===e||void 0===e?void 0:e.name})]})},n))]}),(0,z.jsx)("span",{className:Y,children:pe})]})]}),(0,z.jsx)("p",{className:R,style:{marginLeft:"50px",marginTop:"4px"},children:Ie(Me())})]}),(0,z.jsxs)("div",{className:I,children:[(0,z.jsx)("label",{className:D,children:"To"}),(0,z.jsxs)("div",{className:M,children:[null!==K&&void 0!==K&&K.receivedImg?(0,z.jsx)("img",{src:(null===X||void 0===X||null===(a=X.receiver)||void 0===a?void 0:a.logo_url)||(null===X||void 0===X||null===(d=X.source)||void 0===d?void 0:d.logo_url),className:F,alt:"received","data-testid":"received-img"}):(null===X||void 0===X||null===(r=X.receiver)||void 0===r?void 0:r.address)&&(0,z.jsx)("img",{className:F,src:o.T.Empty,alt:"empty wallet"}),(0,z.jsxs)("div",{className:P,children:[(0,z.jsx)("p",{className:B,children:Ie(Le())}),(0,z.jsx)("p",{className:R,children:Ie(Fe())})]})]})]})]}),"receiver"===$&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("div",{className:I,children:[(0,z.jsx)("label",{className:D,children:"From"}),(0,z.jsxs)("div",{className:M,children:[null!==K&&void 0!==K&&K.sentImg?(0,z.jsx)("img",{src:(null===X||void 0===X||null===(u=X.sender)||void 0===u?void 0:u.logo_url)||(null===X||void 0===X||null===(v=X.source)||void 0===v?void 0:v.logo_url),className:F,alt:"sent","data-testid":"sent-img"}):(null===X||void 0===X||null===(h=X.sender)||void 0===h?void 0:h.address)&&(0,z.jsx)("img",{className:F,src:o.T.Empty,alt:"empty wallet"}),(0,z.jsxs)("div",{className:P,children:[(0,z.jsx)("p",{className:B,children:Ie(De())}),(0,z.jsx)("p",{className:R,children:Ie(Me())})]})]})]}),(0,z.jsxs)("div",{className:I,children:[(0,z.jsx)("label",{className:D,children:"To"}),(0,z.jsxs)("div",{className:L,children:[null!==K&&void 0!==K&&K.receivedImg?(0,z.jsx)("img",{src:(null===X||void 0===X||null===(Z=X.receiver)||void 0===Z?void 0:Z.logo_url)||(null===X||void 0===X||null===(J=X.source)||void 0===J?void 0:J.logo_url),className:F,alt:"received","data-testid":"received-img"}):(null===X||void 0===X||null===(Q=X.receiver)||void 0===Q?void 0:Q.address)&&(0,z.jsx)("img",{className:F,src:o.T.Empty,alt:"empty wallet"}),(0,z.jsxs)("div",{className:E,ref:fe,children:[(0,z.jsx)("input",{className:H,type:"text",placeholder:"Type to Add",onClick:()=>{Re()||he(!0)},value:re?"":le||Le()||"",onChange:Ne,style:pe?{border:"1px solid #ec6745"}:void 0}),me&&!Re()&&(0,z.jsxs)("ul",{className:S,children:[le&&le!==se&&!we(le)&&(0,z.jsxs)("li",{onClick:Ae,className:W,children:["Create new:"," ",(null===le||void 0===le?void 0:le.length)>35?"".concat(le.slice(0,30),"..."):le]}),ue.map((e,n)=>(0,z.jsx)("li",{onClick:()=>ke(null===e||void 0===e?void 0:e.name),className:U,children:(0,z.jsxs)("div",{className:V,children:[(0,z.jsx)("div",{className:O,style:{backgroundColor:(0,m.Xf)((0,m.rU)(null===e||void 0===e?void 0:e.name))},children:(0,m.rU)(null===e||void 0===e?void 0:e.name)}),(0,z.jsx)("span",{children:null===e||void 0===e?void 0:e.name})]})},n))]}),(0,z.jsx)("span",{className:Y,children:pe})]})]}),(0,z.jsx)("p",{className:R,style:{marginLeft:"50px",marginTop:"4px"},children:Ie(Fe())})]})]})]}),(0,z.jsxs)("div",{className:w,children:[(0,z.jsx)("button",{className:k,onClick:q,children:"Cancel"}),(0,z.jsx)("button",{className:A,onClick:()=>(async()=>{if(le)if(Re())await Se();else{xe(!0);const c="Bearer ".concat(await(null===de||void 0===de?void 0:de.getIdToken())),u=we(le);let v;try{var e;if(u){var n,i,l,t,s;const e={contactId:null===(n=ue.find(e=>e.name===le))||void 0===n?void 0:n.id,chainAddress:{address:"sender"===$?Me():Fe(),chainName:null===X||void 0===X||null===(i=X.source)||void 0===i||null===(l=i.name)||void 0===l?void 0:l.toUpperCase(),chainPublicName:null===X||void 0===X||null===(t=X.source)||void 0===t?void 0:t.public_name,chainLogo:null===X||void 0===X||null===(s=X.source)||void 0===s?void 0:s.logo_url}};v=await ne.assignAddressToContact(c,null===de||void 0===de?void 0:de.uid,e)}else{var o,a,d,r;const e={contact:{name:le},chainAddresses:[{address:"sender"===$?Me():Fe(),chainName:null===X||void 0===X||null===(o=X.source)||void 0===o||null===(a=o.name)||void 0===a?void 0:a.toUpperCase(),chainPublicName:null===X||void 0===X||null===(d=X.source)||void 0===d?void 0:d.public_name,chainLogo:null===X||void 0===X||null===(r=X.source)||void 0===r?void 0:r.logo_url}]};v=await ne.createNewContact(c,null===de||void 0===de?void 0:de.uid,e)}v&&200===(null===(e=v)||void 0===e?void 0:e.status)&&((0,y.y)("Success","Contact ".concat(u?"updated":"created"," successfully"),"info"),ee&&setTimeout(async()=>{await ee()},5e3),q())}catch(pe){console.log("error",pe)}finally{xe(!1)}}else _e("Please add the contact name")}
1)(),disabled:ge||pe||!le,children:ge?(0,z.jsx)("img",{src:o.T.Loader,alt:"loading"}):we(le)||Re()?"Update":"Create"})]})]})})};var J=i(8748),Q=i(56801);const q=e=>{var n,i,l,s,a,d,r,c,u,h,g,x,p,_,j;let{displayData:y,postDetail:C,fetchTransactionsNew:T}=e;const[f,b]=(0,t.useState)(!1),[N,w]=(0,t.useState)(!1),k=e=>{if(e){const n=e.slice(0,8),i=e.slice(-5);return"0"===(null===e||void 0===e?void 0:e.charAt(0))?"".concat(n,"...").concat(i):e.length>20?"".concat(n,"..."):e}return null},A=()=>{const{transactionType:e,source:n,sender:i,label:l}=C;return"trade"===e&&"Cross Chain Swaps"===l||"transfer"===e&&"Bridge Transfer"===l||"transfer"===e||"deposit"===e?(null===i||void 0===i?void 0:i.alias)||(null===i||void 0===i?void 0:i.address):(null===n||void 0===n?void 0:n.alias)||(null===n||void 0===n?void 0:n.address)},S=()=>{const{transactionType:e,source:n,sender:i,label:l}=C;return"trade"===e&&"Cross Chain Swaps"===l||"transfer"===e&&"Bridge Transfer"===l||"transfer"===e||"deposit"===e?(null===i||void 0===i?void 0:i.address)||(null===i||void 0===i?void 0:i.alias):(null===n||void 0===n?void 0:n.address)||(null===n||void 0===n?void 0:n.alias)},I=(e,n,i)=>{var l;const t=new URL(window.location.origin+J.e6),s=new URLSearchParams(window.location.search);if([...s.keys()].forEach(e=>{(e.startsWith("Wallet_")||e.startsWith("Currency_"))&&s.delete(e)}),e)s.set("Wallet_".concat(e),"true");else if(n===(null===C||void 0===C||null===(l=C.source)||void 0===l?void 0:l.address)){var o;s.set("Wallet_".concat(null===C||void 0===C||null===(o=C.source)||void 0===o?void 0:o.walletId),"true")}i&&s.set("Currency_".concat(i),"true");const a="".concat(t.toString(),"?").concat(s.toString()),d=window.open(a,"_blank","noopener,noreferrer");d&&(d.opener=null)};return(0,z.jsxs)("div",{className:v.leftColumn,id:"main-trx-box",children:[(0,z.jsx)("div",{children:null!==y&&void 0!==y&&y.sentImg?(0,z.jsx)("img",{src:(null===C||void 0===C||null===(n=C.sender)||void 0===n?void 0:n.logo_url)||(null===C||void 0===C||null===(i=C.source)||void 0===i?void 0:i.logo_url)||o.T.WalletFilledBlack,className:v.sourceIcon,alt:"sent","data-testid":"sent-img"}):(null===C||void 0===C||null===(l=C.sender)||void 0===l?void 0:l.address)&&(0,z.jsx)("img",{className:v.sourceIcon,src:o.T.Empty,alt:"empty wallet"})}),(0,z.jsxs)("div",{className:v.walletImgContainer,children:[(0,z.jsxs)("div",{className:v.aliasNameContainer,onClick:e=>e.stopPropagation(),style:null===k(A())?{pointerEvents:"none"}:void 0,children:[(0,z.jsxs)("div",{className:v.fullAddressContainer,children:[(0,z.jsx)("span",{className:v.fulladdress,children:k(S())}
1),(0,z.jsx)("img",{src:o.T.EditPen,alt:"edit",className:v.copyImg,onClick:()=>w(!0)}),k(S())?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("img",{src:f?o.T.CheckGreen:o.T.CopyClipBoard,alt:"copy",onClick:()=>{return e=S(),navigator.clipboard.writeText(e),b(!0),void setTimeout(()=>{b(!1)},500);var e},className:v.copyImg}),(0,z.jsx)("img",{src:o.T.Export,alt:"copy",onClick:()=>{var e;return I(null===C||void 0===C||null===(e=C.sender)||void 0===e?void 0:e.walletId,S())},className:v.copyImg})]}):null]}),(0,z.jsx)("div",{className:v.aliasName,children:null!==(s=k(A()))&&void 0!==s?s:"---"})]}),(0,z.jsxs)("div",{className:v.currencyContainer,children:[null!==y&&void 0!==y&&y.sentImg?(0,z.jsx)("img",{src:null===y||void 0===y?void 0:y.sentImg,className:v.currencyIcon,alt:"sent","data-testid":"sent-img"}):null,(null===C||void 0===C||null===(a=C.sentCurrency)||void 0===a?void 0:a.amount)>0?(0,z.jsxs)("div",{className:v.hover,"data-testid":"received-currency-with-amount",children:[(0,z.jsxs)("span",{children:["-",(0,m.B_)(null===C||void 0===C||null===(d=C.sentCurrency)||void 0===d?void 0:d.amount,(null===C||void 0===C||null===(r=C.sentCurrency)||void 0===r?void 0:r.amount)>=1e3?3:10)," ",(null===C||void 0===C||null===(c=C.sentCurrency)||void 0===c||null===(u=c.currency)||void 0===u?void 0:u.length)>12?(null===C||void 0===C||null===(h=C.sentCurrency)||void 0===h||null===(g=h.currency)||void 0===g?void 0:g.substring(0,8))+"...":null===C||void 0===C||null===(x=C.sentCurrency)||void 0===x?void 0:x.currency]}),(0,z.jsx)("div",{children:(0,z.jsx)(Q.A,{className:v.hintFee,text:(0,m.TZ)((null===C||void 0===C||null===(p=C.sentCurrency)||void 0===p?void 0:p.amount)||0)+" "+(null===C||void 0===C||null===(_=C.sentCurrency)||void 0===_?void 0:_.currency),theme:"dark",customBubbleStyle:{left:"20%",top:"0%"}})}),(0,z.jsxs)("div",{className:v.currencySearchFilter,onClick:()=>{var e,n;return I(null===C||void 0===C||null===(e=C.sender)||void 0===e?void 0:e.walletId,S(),null===C||void 0===C||null===(n=C.sentCurrency)||void 0===n?void 0:n.id)},children:[(0,z.jsx)("img",{src:o.T.SearchIcon,alt:"search"}),(0,z.jsxs)("div",{className:v.tooltip,children:["Filter all ",null===C||void 0===C||null===(j=C.sentCurrency)||void 0===j?void 0:j.currency]})]})]}):null]})]}),N&&(0,z.jsx)(Z,{handleClose:()=>w(!1),postDetail:C,displayData:y,from:"sender",fetchTransactionsNew:T})]})},X=e=>{var n,i,l,s,a,d,r,c,u,h,g,x,p,_,j;let{displayData:y,postDetail:C,fetchTransactionsNew:T}=e;const[f,b]=(0,t.useState)(!1),[N,w]=(0,t.useState)(!1),k=e=>{if(e){const n=e.slice(0,8),i=e.slice(-5);return"0"===(null===e||void 0===e?void 0:e.charAt(0))?"".concat(n,"...").concat(i):e.length>20?"".concat(n,"..."):e}return null},A=()=>{const{transactionType:e,receiver:n,label:i,source:l}=C;return"trade"===e&&"Cross Chain Swaps"===i||"transfer"===e&&"Bridge Transfer"===i||"transfer"===e||"withdrawal"===e||"payment"===e?(null===n||void 0===n?void 0:n.alias)||(null===n||void 0===n?void 0:n.address):(null===l||void 0===l?void 0:l.alias)||(null===l||void 0===l?void 0:l.address)},S=()=>{const{transactionType:e,source:n,receiver:i,label:l}=C;return"trade"===e&&"Cross Chain Swaps"===l||"transfer"===e&&"Bridge Transfer"===l||"transfer"===e||"withdrawal"===e||"payment"===e?(null===i||void 0===i?void 0:i.address)||(null===i||void 0===i?void 0:i.alias):(null===n||void 0===n?void 0:n.address)||(null===n||void 0===n?void 0:n.alias)},I=(e,n,i)=>{var l;const t=new URL(window.location.origin+J.e6),s=new URLSearchParams(window.location.search);if([...s.keys()].forEach(e=>{(e.startsWith("Wallet_")||e.startsWith("Currency_"))&&s.delete(e)}),e)s.set("Wallet_".concat(e),"true");else if(n===(null===C||void 0===C||null===(l=C.source)||void 0===l?void 0:l.address)){var o;s.set("Wallet_".concat(null===C||void 0===C||null===(o=C.source)||void 0===o?void 0:o.walletId),"true")}i&&s.set("Currency_".concat(i),"true");const a="".concat(t.toString(),"?").concat(s.toString()),d=window.open(a,"_blank","noopener,noreferrer");d&&(d.opener=null)};return(0,z.jsxs)("div",{className:v.rightColumn,id:"main-trx-box",children:[(0,z.jsx)("div",{children:null!==y&&void 0!==y&&y.receivedImg?(0,z.jsx)("img",{src:(null===C||void 0===C||null===(n=C.receiver)||void 0===n?void 0:n.logo_url)||(null===C||void 0===C||null===(i=C.source)||void 0===i?void 0:i.logo_url)||o.T.WalletFilledBlack,className:v.sourceIcon,alt:"received","data-testid":"received-img"}):(null===C||void 0===C||null===(l=C.receiver)||void 0===l?void 0:l.address)&&(0,z.jsx)("img",{className:v.sourceIcon,src:o.T.
1Empty,alt:"empty wallet"})}),(0,z.jsxs)("div",{className:v.walletImgContainer,children:[(0,z.jsxs)("div",{className:v.aliasNameContainer,onClick:e=>e.stopPropagation(),style:null===k(A())?{pointerEvents:"none"}:void 0,children:[(0,z.jsxs)("div",{className:v.fullAddressContainer,children:[(0,z.jsx)("span",{className:v.fulladdress,children:k(S())}),(0,z.jsx)("img",{src:o.T.EditPen,alt:"edit",className:v.copyImg,onClick:e=>{e.stopPropagation(),w(!0)}}),k(S())?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("img",{src:f?o.T.CheckGreen:o.T.CopyClipBoard,alt:"copy",onClick:()=>{return e=S(),navigator.clipboard.writeText(e),b(!0),void setTimeout(()=>{b(!1)},500);var e},className:v.copyImg}),(0,z.jsx)("img",{src:o.T.Export,alt:"copy",onClick:()=>{var e;return I(null===C||void 0===C||null===(e=C.receiver)||void 0===e?void 0:e.walletId,S())},className:v.copyImg})]}):null]}),(0,z.jsx)("div",{className:v.aliasName,children:null!==(s=k(A()))&&void 0!==s?s:"---"})]}),(0,z.jsxs)("div",{className:v.currencyContainer,children:[null!==y&&void 0!==y&&y.receivedImg?(0,z.jsx)("img",{src:null===y||void 0===y?void 0:y.receivedImg,className:v.currencyIcon,alt:"received","data-testid":"received-img"}):null,(null===C||void 0===C||null===(a=C.receivedCurrency)||void 0===a?void 0:a.amount)>0?(0,z.jsxs)("div",{className:v.hover,"data-testid":"received-currency-with-amount",children:[(0,z.jsxs)("span",{children:["+",(0,m.B_)(null===C||void 0===C||null===(d=C.receivedCurrency)||void 0===d?void 0:d.amount,(null===C||void 0===C||null===(r=C.receivedCurrency)||void 0===r?void 0:r.amount)>=1e3?3:10)," ",(null===C||void 0===C||null===(c=C.receivedCurrency)||void 0===c||null===(u=c.currency)||void 0===u?void 0:u.length)>12?(null===C||void 0===C||null===(h=C.receivedCurrency)||void 0===h||null===(g=h.currency)||void 0===g?void 0:g.substring(0,8))+"...":null===C||void 0===C||null===(x=C.receivedCurrency)||void 0===x?void 0:x.currency]}),(0,z.jsx)("div",{children:(0,z.jsx)(Q.A,{className:v.hintFee,text:(0,m.TZ)((null===C||void 0===C||null===(p=C.receivedCurrency)||void 0===p?void 0:p.amount)||0)+" "+(null===C||void 0===C||null===(_=C.receivedCurrency)||void 0===_?void 0:_.currency),theme:"dark",customBubbleStyle:{left:"20%",top:"0%"}})}),(0,z.jsxs)("div",{className:v.currencySearchFilter,onClick:()=>{var e,n;return I(null===C||void 0===C||null===(e=C.receiver)||void 0===e?void 0:e.walletId,S(),null===C||void 0===C||null===(n=C.receivedCurrency)||void 0===n?void 0:n.id)},children:[(0,z.jsx)("img",{src:o.T.SearchIcon,alt:"search"}),(0,z.jsxs)("div",{className:v.tooltip,children:["Filter all ",null===C||void 0===C||null===(j=C.receivedCurrency)||void 0===j?void 0:j.currency]})]})]}):null]})]}),N&&(0,z.jsx)(Z,{handleClose:()=>w(!1),postDetail:C,displayData:y,from:"receiver",fetchTransactionsNew:T})]})},K="fee-section_feeContainer__PQhrX",$="fee-section_hover__6a7L8",ee="fee-section_gainEmpty__zKxsT",ne="fee-section_hintFee__L61tp",ie=e=>{var n,i,l,t,s,o,a;let{postDetail:d,userSettings:r}=e;const c=null!==(n=null===d||void 0===d||null===(i=d.fee)||void 0===i?void 0:i.amount)&&void 0!==n?n:0,u=null!==(l=null===d||void 0===d||null===(t=d.fee)||void 0===t?void 0:t.currency)&&void 0!==l?l:"",v=null!==(s=null===d||void 0===d||null===(o=d.feeValue)||void 0===o?void 0:o.fiatValue)&&void 0!==s?s:0;return(0,z.jsxs)("div",{className:"".concat(K),"data-testid":"fee-section",children:[c?(0,z.jsx)("span",{children:"".concat((0,m.B_)(c||0,5)," ").concat(null===d||void 0===d||null===(a=d.fee)||void 0===a?void 0:a.currency)}):(0,z.jsx)("span",{className:ee,children:"---"}),(0,z.jsxs)("div",{className:$,children:[null!==v&&c?(0,z.jsx)("span",{style:{color:"#626281"},children:"(".concat(m.zA[null===r||void 0===r?void 0:r.baseCurrency]).concat((0,m.B_)(v,2),")")}):null,c&&v?(0,z.jsx)("div",{children:(0,z.jsx)(Q.A,{className:ne,text:"".concat((0,m.TZ)(c||0)," ").concat(u," = ").concat(m.zA[null===r||void 0===r?void 0:r.baseCurrency]).concat((0,m.TZ)(v||0)),theme:"dark",customBubbleStyle:{left:"30%",top:"0%"}})}):null]})]})},le="value_gainContainer__fwdQY",te="value_GainLossText__-nHKQ",se="value_gainEmpty__cRLqw",oe="value_hover__8HPs7",ae
1="value_hintFee__bvZPK",de="value_gainLoseContainer__C5O5O",re=e=>{var n,i,l;let{postDetail:t,showLoader:s,userSettings:a}=e;const{isTriggered:d}=(0,h.d4)(e=>e.session);return(0,z.jsx)("div",{className:le,children:null!==t&&void 0!==t&&null!==(n=t.netValue)&&void 0!==n&&n.fiatValue?(0,z.jsxs)("div",{className:de,"data-testid":"gain-section",children:["start"===d?(0,z.jsx)("img",{src:o.T.Loader,alt:"loading..."}):null,(0,z.jsxs)("p",{className:"".concat(te," ").concat(oe),children:[(0,m.B_)(+(null===t||void 0===t||null===(i=t.netValue)||void 0===i?void 0:i.fiatValue)||0,2,null===a||void 0===a?void 0:a.baseCurrency)," ",(0,z.jsx)("div",{children:(0,z.jsx)(Q.A,{className:ae,text:m.zA[null===a||void 0===a?void 0:a.baseCurrency]+(0,m.TZ)(+(null===t||void 0===t||null===(l=t.netValue)||void 0===l?void 0:l.fiatValue)||0),theme:"dark",customBubbleStyle:{left:"30%",top:"0%"}})})]})]}):(0,z.jsx)("div",{className:se,"data-testid":"empty-gain",children:"---"})})},ce={gainContainer:"gain_gainContainer__91UWf",GainLossText:"gain_GainLossText__vyc4o",gainEmpty:"gain_gainEmpty__3c2Dv",Loading:"gain_Loa
1ding__a1EuD",skltonContainer:"gain_skltonContainer__rVW8K",tooltip:"gain_tooltip__0R9Pj",hover:"gain_hover__xF4wr",gainLoseContainer:"gain_gainLoseContainer__3skke",gainsInfoContainer:"gain_gainsInfoContainer__o12I1",listItem:"gain_listItem__Jx7+G",hoverNote:"gain_hoverNote__puiFO",imgOutline:"gain_imgOutline__Qiid9",imgFilled:"gain_imgFilled__6gAOq",hintFee:"gain_hintFee__qsyX1"},ue=e=>{var n,i,l,t,s,a,d,r,c,u,v;let{postDetail:g,showLoader:x,userSettings:p}=e;const{isTriggered:_}=(0,h.d4)(e=>e.session);return(0,z.jsxs)("div",{className:ce.gainContainer,children:[null!==g&&void 0!==g&&null!==(n=g.gainsDetails)&&void 0!==n&&n.isTaxable&&null!==g&&void 0!==g&&null!==(i=g.gainsDetails)&&void 0!==i&&i.capitalGain?(0,z.jsxs)("div",{className:ce.gainLoseContainer,style:{color:(null===g||void 0===g||null===(l=g.gainsDetails)||void 0===l?void 0:l.capitalGain)>=0?"#00c693":"#EC6745"},"data-testid":"gain-section",children:["start"===_?(0,z.jsx)("img",{src:o.T.Loader,alt:"loading..."}):null,(0,z.jsxs)("p",{className:"".concat(ce.GainLossText," ").concat(ce.hover),children:[(0,m.B_)(+(null===g||void 0===g||null===(t=g.gainsDetails)||void 0===t?void 0:t.capitalGain)||0,2,null===p||void 0===p?void 0:p.baseCurrency)," ",(0,z.jsxs)("div",{className:[ce.hintFee,ce.gainsInfoContainer].join(" "),children:[(0,z.jsxs)("div",{className:ce.listItem,children:[(0,z.jsx)("span",{children:"Net Value:"}),(0,z.jsx)("span",{children:m.zA[null===p||void 0===p?void 0:p.baseCurrency]+(0,m.TZ)((null===g||void 0===g||null===(s=g.netValue)||void 0===s?void 0:s.fiatValue)||0)})]}),(0,z.jsxs)("div",{className:ce.listItem,children:[(0,z.jsx)("span",{children:"Cost Basis:"}),(0,z.jsx)("span",{children:m.zA[null===p||void 0===p?void 0:p.baseCurrency]+(0,m.TZ)(+(null===g||void 0===g||null===(a=g.gainsDetails)||void 0===a?void 0:a.costBasis)||0)})]}),(0,z.jsxs)("div",{className:ce.listItem,style:{color:(null===g||void 0===g||null===(d=g.gainsDetails)||void 0===d?void 0:d.capitalGain)>=0?"#00c693":"#EC6745"},children:[(0,z.jsxs)("span",{children:[+(null===g||void 0===g||null===(r=g.gainsDetails)||void 0===r?void 0:r.capitalGain)>0?"Gains":"Loss",":"]}),(0,z.jsx)("span",{children:m.zA[null===p||void 0===p?void 0:p.baseCurrency]+(0,m.TZ)((null===g||void 0===g||null===(c=g.gainsDetails)||void 0===c?void 0:c.capitalGain)||0)})]})]})]})]}):(0,z.jsx)("div",{className:ce.gainEmpty,"data-testid":"empty-gain",children:"---"}),null!==g&&void 0!==g&&null!==(u=g.gainsDetails)&&void 0!==u&&u.note?(0,z.jsxs)("div",{className:[ce.hover,ce.hoverNote].join(" "),children:[(0,z.jsx)("img",{src:o.T.InfoOutlineBlack,alt:"info",className:ce.imgOutline}),(0,z.jsx)("img",{src:o.T.InfoFilledBlack,alt:"info",className:ce.imgFilled}),(0,z.jsx)("div",{className:ce.hintFee,children:null===g||void 0===g||null===(v=g.gainsDetails)||void 0===v?void 0:v.note})]}):null]})},ve="explorer-link-section_trxLink__aFOuW";var me=i(59051),he=i.n(me),ge=i(14765);const xe=e=>{let{explorerLink:n,postDetail:i}=e;const{userSettings:s}=(0,t.useContext)(u.N),{idToken:a,currentUser:d}=(0,t.useContext)(c.c),r=new p.Gf,v=async e=>{var n,i,t,o;const c="Bearer "+a,u=await(async(e,n,i,l)=>{const t=l-6e5;if(e&&l&&n)return(await r.fiatPrice(e,n,i,null===d||void 0===d?void 0:d.uid,+t))[n].price})(c,s.baseCurrency,"USD",he()(null===e||void 0===e?void 0:e.timestamp));let v={transaction_label:null===e||void 0===e?void 0:e.label,transaction_type:null===e||void 0===e?void 0:e.transactionType,date_of_transaction:he()(+(null===e||void 0===e?void 0:e.timestamp)).format("YYYY/MM/DD HH:mm:ss"),net_worth:((null===e||void 0===e||null===(n=e.netValue)||void 0===n?void 0:n.fiatValue)||0)*u,fee_coin:null===e||void 0===e||null===(i=e.fee)||void 0===i?void 0:i.currency,fee:(null===e||void 0===e||null===(t=e.fee)||void 0===t?void 0:t.amount)||0,transaction_id:null===e||void 0===e?void 0:e.transactionId,"profit/loss":(null===e||void 0===e||null===(o=e.gainsDetails)||void 0===o?void 0:o.capitalGain)>=0?"Profit":"Loss",asset_type:null!==e&&void 0!==e&&e.isNFT?"NFT":"Transaction",source:ge.s.source};var m,h,g,x,p,_,j,y,C,T;null!==e&&void 0!==e&&e.receiver&&(v=(0,l.A)((0,l.A)({},v),{},{to:{wallet:"".concat(null===e||void 0===e||null===(m=e.receiver)||void 0===m?void 0:m.public_name," (").concat((null===e||void 0===e||null===(h=e.receiver)||void 0===h?void 0:h.alias)||(null===e||void 0===e||null===(g=e.receiver)||void 0===g?void 0:g.address),")"),coin:(null===e||void 0===e||null===(x=e.receivedCurrency)||void 0===x?void 0:x.currency)||(null===e||void 0===e||null===(p=e.sentCurrency)||void 0===p?void 0:p.currency)}}));null!==e&&void 0!==e&&e.sender&&(v=(0,l.A)((0,l.A)({},v),{},{from:{wallet:"".concat(null===e||void 0===e||null===(_=e.sender)||void 0===_?void 0:_.public_name," (").concat((null===e||void 0===e||null===(j=e.sender)||void 0===j?void 0:j.alias)||(null===e||void 0===e||null===(y=e.sender)||void 0===y?void 0:y.address),")"),coin:(null===e||void 0===e||null===(C=e.sentCurrency)||void 0===C?void 0:C.currency)||(null===e||void 0===e||null===(T=e.receivedCurrency)||void 0===T?void 0:T.currency)}}));ge.A.trackEvent(ge.s.transaction_snowtrace_history_visit,v)};return n&&(0,z.jsx)("a",{href:n,target:"_blank",className:ve,rel:"noreferrer",onClick:e=>{v(i),e.stopPropagation()}
1,children:(0,z.jsx)("img",{src:o.T.Export,alt:"explorer",className:ve})})},pe={menuMainContainer:"menu-section_menuMainContainer__9RbZi",menu:"menu-section_menu__y4ZA1",dropDownMainContainer:"menu-section_dropDownMainContainer__ypB36",tooltip:"menu-section_tooltip__ignW5"},_e=e=>{let{listItemHandler:n,itemName:i,style:l}=e;return(0,z.jsx)("li",{style:l,onClick:n,children:(0,z.jsx)("span",{children:i})})},je=e=>{let{displayData:n,postDetail:i,handleShowModal:s,setShowDeleteModal:a,isReviewTagHandler:d,handleSplit:r,handleCloneTransaction:v,handleMoreDetailsClick:m,handleIgnoreClick:h,from:g,handleShowDb:x,isProd:_}=e;const j=(0,t.useRef)(),y=new p.Gf,{idToken:C,currentUser:T}=(0,t.useContext)(c.c),{userSettings:f}=(0,t.useContext)(u.N),[b,N]=(0,t.useState)(!1);(0,t.useEffect)(()=>(document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}),[]);const w=e=>{j.current&&!j.current.contains(e.target)&&N(!1)},k=async(e,n)=>{var t,s,o,a;const d="Bearer "+C,r=await(async(e,n,i,l)=>{const t=l-6e5;if(e&&l&&n)return(await y.fiatPrice(e,n,i,null===T||void 0===T?void 0:T.uid,+t))[n].price})(d,null===f||void 0===f?void 0:f.baseCurrency,"USD",he()(null===e||void 0===e?void 0:e.timestamp));let c={transaction_label:null===i||void 0===i?void 0:i.label,asset_type:null!==i&&void 0!==i&&i.isNFT?"NFT":"Transaction",transaction_type:null===i||void 0===i?void 0:i.transactionType,date_of_transaction:he()(+(null===i||void 0===i?void 0:i.timestamp)).format("YYYY/MM/DD HH:mm:ss"),net_worth:((null===e||void 0===e||null===(t=e.netValue)||void 0===t?void 0:t.fiatValue)||0)*r,fee_coin:null===i||void 0===i||null===(s=i.fee)||void 0===s?void 0:s.currency,fee:null===i||void 0===i||null===(o=i.fee)||void 0===o?void 0:o.amount,transaction_id:null===i||void 0===i?void 0:i.transactionId,"profit/loss":(null===i||void 0===i||null===(a=i.gainsDetails)||void 0===a?void 0:a.capitalGain)>=0?"Profit":"Loss",updated_from_page:"/transactions"===window.location.pathname?"Transactions Page":"Review Needed Page",source:ge.s.source};var u,v,m,h,g,x,p,_,j,b;null!==i&&void 0!==i&&i.receiver&&(c=(0,l.A)((0,l.A)({},c),{},{to:{wallet:"".concat(null===i||void 0===i||null===(u=i.receiver)||void 0===u?void 0:u.public_name," (").concat((null===i||void 0===i||null===(v=i.receiver)||void 0===v?void 0:v.alias)||(null===i||void 0===i||null===(m=i.receiver)||void 0===m?void 0:m.address),")"),coin:(null===i||void 0===i||null===(h=i.receivedCurrency)||void 0===h?void 0:h.currency)||(null===i||void 0===i||null===(g=i.sentCurrency)||void 0===g?void 0:g.currency)}}));null!==i&&void 0!==i&&i.sender&&(c=(0,l.A)((0,l.A)({},c),{},{from:{wallet:"".concat(null===i||void 0===i||null===(x=i.sender)||void 0===x?void 0:x.public_name," (").concat((null===i||void 0===i||null===(p=i.sender)||void 0===p?void 0:p.alias)||(null===i||void 0===i||null===(_=i.sender)||void 0===_?void 0:_.address),")"),coin:(null===i||void 0===i||null===(j=i.sentCurrency)||void 0===j?void 0:j.currency)||(null===i||void 0===i||null===(b=i.receivedCurrency)||void 0===b?void 0:b.currency)}}));ge.A.trackEvent("add"===n?ge.s.further_review_tag_transaction:"remove"===n&&ge.s.remove_tag_transaction,c)};return(0,z.jsx)("div",{className:[pe.menuMainContainer,"sixthTourStep"].join(" "),children:(0,z.jsxs)("div",{className:pe.menu,onClick:e=>{e.stopPropagation(),N(!b)},"data-testid":"menu-icon",ref:j,children:[(0,z.jsx)("img",{src:o.T.ThreeDot,alt:"threedot"}),b&&(0,z.jsx)("div",{className:pe.dropDownMainContainer,children:(0,z.jsxs)("ul",{children:[(0,z.jsx)(_e,{listItemHandler:()=>{null!==i&&void 0!==i&&i.isReviewTag?(d(i,"remove"),k(i,"remove")):(d(i,"add"),k(i,"add"))},itemName:null!==i&&void 0!==i&&i.isReviewTag?"Remove tag":"Tag as further review"}),("Review"===g||"review"===g)&&(0,z.jsx)(_e,{listItemHandler:()=>h(i,"Review"===g?"Ignore":"Mark as Resolved"),itemName:"Review"===g?"Ignore":"Mark as Resolved"}),(0,z.jsx)(_e,{listItemHandler:()=>{ge.A.trackEvent(ge.s.edit_transaction_click,{from_where:"Transactions Page"}),s(i,n)},itemName:"Edit"}),(0,z.jsx)(_e,{listItemHandler:()=>v(i),itemName:"Clone"}),((null===i||void 0===i?void 0:i.isMergedTrx)||"trade"===(null===i||void 0===i?void 0:i.transactionType)||"transfer"===(null===i||void 0===i?void 0:i.transactionType))&&(0,z.jsx)(_e,{listItemHandler:()=>r(i,n),itemName:"Split"}),(0,z.jsx)(_e,{listItemHandler:()=>a({status:!0,id:null===i||void 0===i?void 0:i.id}),itemName:"Delete"}),(0,z.jsx)(_e,{listItemHandler:e=>{m(e,null===i||void 0===i?void 0:i.id)},itemName:"More details"}),!_&&(0,z.jsx)(_e,{listItemHandler:()=>{x(i)},itemName:"Show DB"})]})})]})})};var ye=i(65390),Ce=i(43710);const Te="delete-transaction-modal_Overlay__qZ1ht",fe="delete-transaction-modal_Modal__BChqm",be="delete-transaction-modal_titleAndIcon__vpeNn",Ne="delete-transaction-modal_infoContainer__99rZE",we="delete-transaction-modal_netWorthContainer__rJSwm",ke="delete-transaction-modal_actionBtnContainer__PKM8F",Ae="delete-transaction-modal_
1cancelBtn__BQpvv",Se="delete-transaction-modal_updateBtn__uqMQM",Ie=e=>{var n,i,l;let{postDetail:t,onCancel:s,setShowDeleteModal:a,deleteHandler:d}=e;return(0,z.jsx)("div",{className:Te,onClick:e=>e.stopPropagation(),children:(0,z.jsxs)("div",{className:fe,children:[(0,z.jsxs)("div",{className:be,children:[(0,z.jsx)("h1",{children:"Delete Transaction"}),(0,z.jsx)("img",{src:o.T.CrossBlack,alt:"close",onClick:s})]}),(0,z.jsxs)("div",{className:Ne,children:[(0,z.jsx)("img",{src:o.T.InfoBlue,alt:"info"}),(0,z.jsx)("p",{children:"Once you delete this transaction, it will be permanently removed from your records. This action is irreversible."})]}),(0,z.jsxs)("div",{className:we,children:[(0,z.jsx)("p",{children:"Are you sure you want to delete this transaction?"}),(0,z.jsx)("p",{children:"Transaction ID"}),(0,z.jsxs)("p",{children:[null===t||void 0===t||null===(n=t.transactionId)||void 0===n?void 0:n.substring(0,12),"...",null===t||void 0===t||null===(i=t.transactionId)||void 0===i?void 0:i.substring((null===t||void 0===t||null===(l=t.transactionId)||void 0===l?void 0:l.length)-12)]}),(0,z.jsxs)("div",{className:ke,children:[(0,z.jsx)("button",{className:Ae,onClick:e=>{s(),e.stopPropagation()},children:"Cancel"}),(0,z.jsx)("button",{className:Se,onClick:e=>{a({status:!1,id:t.id}),d(t),e.stopPropagation()},children:"Delete"})]})]})]})})};var De=i(17279),Me=i(5685),Le=i(9618);const Fe=e=>{let{activeTab:n,setActiveTab:i}=e;return(0,z.jsx)("div",{className:Le.A.tabHeadingsContainer,children:["details","ledger","comments"].map((e,l)=>(0,z.jsx)("h5",{className:n===e?Le.A.headingTextActive:Le.A.headingText,id:e,onClick:e=>{i(e.target.id)},children:e},l))})};var Pe=i(31789),Be=i(25045),Re=i.n(Be);const Ee={disposalTable:"disposal-history_disposalTable__9tyFd",arrow:"disposal-history_arrow__LZ8vS",arrowDown:"disposal-history_arrowDown__+Z-Sy","smooth-blink":"disposal-history_smooth-blink__Co4IQ",arrowUp:"disposal-history_arrowUp__4d4yZ",descriptionDisposal:"disposal-history_descriptionDisposal__D-hsM"};var He=i(28429),Ue=i(43616);const We=e=>{var n,i,s,a,r,c,u,v,h,g,x,p,_,j,y,C,T,f,b,N,w,k,A,S,I,D,M,L;let{postDetail:F,userSettings:P,isProcessing:B,customDesc:R,isTriggered:E,timestamp:H,setUpdated:U,protocolData:W}=e;const[Y,V]=(0,t.useState)(!1),[O,G]=(0,t.useState)(!1),[Z,J]=(0,t.useState)(!1),[q,X]=(0,t.useState)(!1),[K,$]=(0,t.useState)(""),[ee,ne]=(0,t.useState)(!1),ie=(e,n)=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1e3)}).catch(e=>{console.error("Failed to copy: ",e)})};function le(e){try{JSON.parse(e)}catch(n){return!1}return!0}return(0,z.jsxs)("div",{className:Le.A.analysisTabMainContianer,children:[(0,z.jsxs)("div",{className:Le.A.transactionDetails,children:[(0,z.jsxs)("div",{className:Le.A.detailRow,children:[(0,z.jsx)("span",{className:Le.A.detailLabel,children:"Timestamp:"}),(0,z.jsx)("span",{className:Le.A.detailValue,children:F&&F.length>0&&null!==(n=F[0])&&void 0!==n&&n.timestamp?(0,z.jsxs)(z.Fragment,{children:[Re().tz(F[0].timestamp,P.timezone).fromNow()," ","(",Re().tz(F[0].timestamp,P.timezone).format("YYYY/MM/DD hh:mm:ss A"),")"]}):H?(0,z.jsxs)(z.Fragment,{children:[Re().tz(H,P.timezone).fromNow()," (",Re().tz(H,P.timezone).format("YYYY/MM/DD hh:mm:ss A"),")"]}):"Timestamp not available"})]}),(0,z.jsxs)("div",{className:Le.A.detailRow,children:[F&&F.length>0?(0,z.jsxs)(z.Fragment,{children:[null!==(i=F[0])&&void 0!==i&&i.desc&&le(null===(s=F[0])||void 0===s?void 0:s.desc)&&null!==JSON&&void 0!==JSON&&null!==(a=JSON.parse(null===(r=F[0])||void 0===r?void 0:r.desc))&&void 0!==a&&a.id?(0,z.jsxs)("div",{className:Le.A.flex,children:[(0,z.jsx)("span",{className:Le.A.detailLabel,children:"Transaction Hash:"}),(0,z.jsx)("span",{className:Le.A.detailValue,children:"".concat(null===JSON||void 0===JSON||null===(c=JSON.parse(null===(v=F[0])||void 0===v?void 0:v.desc))||void 0===c||null===(u=c.id)||void 0===u?void 0:u.slice(0,6),"...").concat(null===JSON||void 0===JSON||null===(h=JSON.parse(null===(x=F[0])||void 0===x?void 0:x.desc))||void 0===h||null===(g=h.id)||void 0===g?void 0:g.slice(-6))}),(0,z.jsx)("img",{src:Z?o.T.CheckMark:o.T.CopyClipBoard,alt:Z?"Check":"Copy",className:Le.A.copyIcon,onClick:()=>{var e,n;return ie(null===JSON||void 0===JSON||null===(e=JSON.parse(null===(n=F[0])||void 0===n?void 0:n.desc))||void 0===e?void 0:e.id,J)}})]}):null,(0,z.jsxs)("div",{className:Le.A.flex,children:[(0,z.jsx)("span",{className:Le.A.detailLabel,children:"Transaction ID:"}),(0,z.jsx)("span",{className:Le.A.detailValue,children:"".concat(null===(p=F[0])||void 0===p||null===(_=p.trx_doc_id)||void 0===_?void 0:_.slice(0,6),"...").concat(null===(j=F[0])||void 0===j||null===(y=j.trx_doc_id)||void 0===y?void 0:y.slice(-6))}),(0,z.jsx)("img",{src:q?o.T.CheckMark:o.T.CopyClipBoard,alt:q?"Check":"Copy",className:Le.A.copyIcon,onClick:()=>{var e;return ie(null===(e=F[0])||void 0===e?void 0:e.trx_doc_id,X)}})]})]}):null,F&&F.length>0&&(null===(C=F[0])||void 0===C||null===(T=C.from)||void 0===T?void 0:T.address)&&(0,z.jsx)(z.Fragment,{children:(0,z.jsxs)("div",{className:Le.A.flex,children:[(0,z.jsx)("span",{className:Le.A.detailLabel,children:"From:"}),(0,z.jsx)("span",{className:Le.A.detailValue,children:"".concat(null===(f=F[0])||void 0===f||null===(b=f.from)||void 0===b?void 0:b.address.slice(0,6),"...").concat(null===(N=F[0])||void 0===N||null===(w=N.from)||void 0===w?void 0:w.address.slice(-6))}),(0,z.jsx)("img",{src:Y?o.T.CheckMark:o.T.CopyClipBoard,alt:Y?"Check":"Copy",className:Le.A.copyIcon,onClick:()=>{var e,n;return ie(null===(e=F[0])||void 0===e||null===(n=e.from)||void 0===n?void 0:n.address,V)}})]})}),F&&F.length>0&&(null===(k=F[0])||void 0===k||null===(A=k.target)||void 0===A?void 0:A.address)&&(0,z.jsx)(z.Fragment,{children:(0,z.jsxs)("div",{className:Le.A.flex,children:[(0,z.jsx)("span",{className:Le.A.detailLabel,children:"To:"}),(0,z.jsx)("span",{className:Le.A.detailValue,children:"".concat(null===(S=F[0])||void 0===S||null===(I=S.target)||void 0===I?void 0:I.address.slice(0,6),"...").concat(null===(D=F[0])||void 0===D||null===(M=D.target)||void 0===M?void 0:M.address.slice(-6))}),(0,z.jsx)("img",{src:O?o.T.CheckMark:o.T.CopyClipBoard,alt:O?"Check":"Copy",className:Le.A.copyIcon,onClick:()=>{var e,n;return ie(null===(e=F[0])||void 0===e||null===(n=e.target)||void 0===n?void 0:n.address,G)}})]})}),F&&F.length>0&&(null===(L=F[0])||void 0===L?void 0:L.desc)&&(()=>{try{var e;const n=le(F[0].desc)?JSON.parse(F[0].desc):null,i=null===n||void 0===n||null===(e=n.tx)||void 0===e?void 0:e.name;return i?(0,z.jsx)(z.Fragment,{children:(0,z.jsxs)("div",{className:Le.A.flex,children:[(0,z.jsx)("span",{className:Le.A.detailLabel,children:"Function:"}),(0,z.jsx)("span",{className:Le.A.detailValue,children:i.length>18?"".concat(i.slice(0,12),"..."):i})]})}):null}catch(n){return null}})(),W&&(0,z.jsx)(z.Fragment,{children:(0,z.jsxs)("div",{className:Le.A.flex,children:[(0,z.jsx)("span",{className:Le.A.detailLabel,children:"Protocol:"}),(0,z.jsx)("img",{src:(null===W||void 0===W?void 0:W.logo_url)||"http://www.gravatar.com/avatar/".concat(d().enc.Hex.stringify(d().SHA1((null===W||void 0===W?void 0:W.id)||"")),"?d=retro"),alt:"redirect",className:Le.A.copyIcon,style:{marginRight:10,width:24,height:24,borderRadius:4,cursor:"auto"}}),(0,z.jsx)("span",{className:Le.A.detailValue,children:null===W||void 0===W?void 0:W.name}),(0,z.jsx)("a",{href:null===W||void 0===W?void 0:W.site_url,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",justifyContent:"center"}
1,children:(0,z.jsx)("img",{src:o.T.Export,alt:"redirect",className:Le.A.copyIcon})})]})})]})]}),(0,z.jsx)("div",{className:Le.A.descriptionContainer,style:{width:"100%",position:"static",minHeight:100},children:(0,z.jsxs)("div",{className:Le.A.descContentContainer,children:[(0,z.jsx)("h4",{children:"Description"}),(0,z.jsx)("p",{children:R}),(0,z.jsx)("img",{src:o.T.TrxDetailsDesc,alt:"desc",style:{width:70,top:"-10%"}})]})}),(0,z.jsx)("div",{className:Le.A.marketTablesMainContainer,style:{marginTop:20},children:(0,z.jsx)("div",{className:Le.A.scrollContainer,children:(0,z.jsx)("div",{className:[Le.A.pricesTableContainer,Le.A.analysisPricesTableContainer].join(" "),children:(0,z.jsx)("table",{style:{borderLeft:0},children:(0,z.jsxs)("tbody",{children:[(0,z.jsxs)("tr",{children:[(0,z.jsx)("th",{style:{padding:"0 60px",textAlign:"left",width:250,maxWidth:250},children:"Date"}),(0,z.jsx)("th",{children:"Details"}),(0,z.jsx)("th",{style:{textAlign:"right"},children:"Quantity"}),(0,z.jsx)("th",{style:{textAlign:"right"},children:"Cost"}),(0,z.jsx)("th",{style:{textAlign:"right"},children:"Gains"}),(0,z.jsx)("th",{style:{width:25,textAlign:"center"}})]}),F&&F.length>0&&null!==F&&void 0!==F&&F.length?null===F||void 0===F?void 0:F.map((e,n)=>{var i,t,s,a,d;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("tr",{className:Le.A.marketDataMainContainer,style:(0,l.A)({},ee&&e.docId===(null===K||void 0===K?void 0:K.docId)&&{backgroundColor:"#f6f6f8"}),children:[(0,z.jsxs)("td",{style:{padding:"0 20px",width:250,maxWidth:250,display:"flex",alignItems:"center",height:50},children:[(0,z.jsx)("span",{style:"out"===(null===e||void 0===e?void 0:e.dir)?{color:"#EC6745"}:{color:"#00C693"},className:Le.A.dirSymbol,children:(0,z.jsx)("div",{className:Le.A.notationContainer,children:"out"===(null===e||void 0===e?void 0:e.dir)?(0,z.jsx)("img",{src:o.T.MinusRed,alt:"-"}):(0,z.jsx)("img",{src:o.T.PlusGreen,alt:"+"})})})," ",Re()(+(null===e||void 0===e?void 0:e.timestamp)).tz(null===P||void 0===P?void 0:P.timezone).format("YYYY/MM/DD HH:mm:ss")]}),(0,z.jsx)("td",{children:null!==e&&void 0!==e&&null!==(i=e.currency)&&void 0!==i&&i.amount?(0,z.jsxs)("div",{children:[(0,z.jsxs)("span",{children:[(0,m.B_)((null===e||void 0===e||null===(t=e.currency)||void 0===t?void 0:t.amount)||0,5),(0,z.jsx)(Q.A,{className:Le.A.tooltip,text:(0,m.TZ)(null===e||void 0===e||null===(s=e.currency)||void 0===s?void 0:s.amount),theme:"light",bubbleStyle:"bottom-center",customStyle:{top:"-30px"}})," ",null===e||void 0===e||null===(a=e.currency)||void 0===a?void 0:a.currency]})," ",(0,z.jsxs)("span",{children:["Worth"," ",(0,m.B_)((null===e||void 0===e?void 0:e.price)||0,3,null===P||void 0===P?void 0:P.baseCurrency),(0,z.jsx)(Q.A,{className:Le.A.tooltip,text:(0,m.TZ)((null===e||void 0===e?void 0:e.price)||0),theme:"light",bubbleStyle:"bottom-center",customStyle:{top:"-30px"}})]})]}):(0,z.jsx)("div",{children:"--"})}),(0,z.jsx)("td",{style:{textAlign:"right"},children:(0,z.jsxs)("span",{children:[(0,m.B_)((null===e||void 0===e?void 0:e.change)||0,5),(0,z.jsx)(Q.A,{className:[Le.A.tooltip,Le.A.lastElTooltip].join(" "),text:(0,m.TZ)(null===e||void 0===e?void 0:e.change),theme:"light",bubbleStyle:"bottom-left",customStyle:{top:"-30px"}})]})}),(0,z.jsx)("td",{style:{textAlign:"right"},children:(0,z.jsxs)("span",{children:[(0,m.B_)((null===e||void 0===e?void 0:e.costbasis)||0,3,null===P||void 0===P?void 0:P.baseCurrency),(0,z.jsx)(Q.A,{className:Le.A.tooltip,text:(0,m.TZ)((null===e||void 0===e?void 0:e.costbasis)||0),theme:"light",bubbleStyle:"bottom-left",customStyle:{top:"-30px"}})]})}),(0,z.jsx)("td",{style:{color:null!==e&&void 0!==e&&e.gain&&e.gain.toString().includes("-")?"#EC6745":"#00c693",textAlign:"right"},children:null!==e&&void 0!==e&&e.gain?(0,z.jsxs)("span",{children:[(0,m.B_)((null===e||void 0===e?void 0:e.gain)||0,3,null===P||void 0===P?void 0:P.baseCurrency),(0,z.jsx)(Q.A,{className:Le.A.tooltip,text:(0,m.TZ)((null===e||void 0===e?void 0:e.gain)||0),theme:"light",bubbleStyle:"bottom-left",customStyle:{top:"-30px"}})]}):(0,z.jsx)("div",{style:{color:"#2b3674b3"},children:"--"})}),(0,z.jsx)("td",{style:{width:50,textAlign:"right"},children:e.disposalLotsHistory&&(null===(d=e.disposalLotsHistory)||void 0===d?void 0:d.length)>0?(0,z.jsx)("div",{onClick:()=>{ne(n=>e.docId===(null===K||void 0===K?void 0:K.docId)?($(null),!1):($(e),!0)),U(e=>!e)},children:(0,z.jsx)("img",{src:o.T.DropdownIcon,alt:"arrow",className:"".concat(Ee.arrow," ").concat(ee&&e.docId===(null===K||void 0===K?void 0:K.docId)?Ee.arrowUp:Ee.arrowDown)})}):(0,z.jsx)("div",{})})]},n),ee&&e.docId===(null===K||void 0===K?void 0:K.docId)&&(0,z.jsx)(Ye,{lots:e.disposalLotsHistory,setUpdated:U,trx_doc:K})]})}):B&&[...Array(4)].map((e,n)=>(0,z.jsxs)("tr",{className:Le.A.marketDataMainContainer,children:[(0,z.jsx)("td",{children:(0,z.jsx)("div",{className:Le.A.Skleton})}),(0,z.jsx)("td",{children:(0,z.jsx)("div",{className:Le.A.Skleton})}),(0,z.jsx)("td",{children:(0,z.jsx)("div",{className:Le.A.Skleton})}),(0,z.jsx)("td",{children:(0,z.jsx)("div",{className:Le.A.Skleton})}),(0,z.jsx)("td",{children:(0,z.jsx)("div",{className:Le.A.Skleton})})]},n))]})})})})})]})},Ye=e=>{let{lots:n,setUpdated:i,trx_doc:l}=e;const{isTriggered:s}=(0,h.d4)(e=>e.session),{userSettings:a}=(0,t.useContext)(u.N),{currentUser:r}=new t.useContext(c.c);(0,He.Zp)();(0,t.useEffect)(()=>{(async()=>{r&&n.length&&i(e=>!e)})()},[r,n]);const v=e=>{if(e){const n=e.slice(0,8),i=e.slice(-5);return"".concat(n,"...").concat(i)}};return(0,z.jsx)("tr",{children:(0,z.jsxs)("td",{colSpan:6,style:{paddingTop:10,paddingBottom:16,paddingRight:16,paddingLeft:60,backgroundColor:"rgba(246, 246, 248, 0.5)"},children:[(0,z.jsx)("div",{className:Ee.descriptionDisposal,children:(0,z.jsx)("p",{children:"Disposal Lot History"})}),(0,z.jsx)("div",{className:[Ee.disposalTable].join(" "),children:(0,z.jsx)("table",{children:(0,z.jsxs)("tbody",{children:[(0,z.jsxs)("tr",{children:[(0,z.jsx)("th",{style:{padding:"0 20px"},children:"Exchange/Wallet"}),(0,z.jsx)("th",{children:"Date"}),(0,z.jsx)("th",{children:"Asset"}),(0,z.jsx)("th",{children:"Change"}),(0,z.jsx)("th",{children:"Price"}),(0,z.jsx)("th",{})]}),n&&n.length>0&&null!==n&&void 0!==n&&n.length?null===n||void 0===n?void 0:n.map((e,n)=>{var i,t,r,c,u,h,g,x,p,_,j,y,C,T,f;return(0,z.jsxs)("tr",{className:Le.A.marketDataMainContainer,children:[(0,z.jsx)("td",{children:(0,z.jsxs)("div",{className:Le.A.assetNameContainer,children:[null!==l&&void 0!==l&&null!==(i=l.source)&&void 0!==i&&i.name?(0,z.jsx)("img",{src:(null===l||void 0===l||null===(t=l.sender)||void 0===t?void 0:t.logo_url)||(null===l||void 0===l||null===(r=l.source)||void 0===r?void 0:r.logo_url)||Ue.A,alt:"logo",style:{marginLeft:20}}):(0,z.jsx)("img",{src:Ue.A,alt:"logo",style:{marginLeft:20}}),(0,z.jsxs)("div",{className:Le.A.tooltipContainer,children:[(0,z.jsx)("p",{children:(null===l||void 0===l||null===(c=l.source)||void 0===c||null===(u=c.alias)||void 0===u?void 0:u.length)>12?v(null===l||void 0===l||null===(h=l.source)||void 0===h?void 0:h.alias):null===l||void 0===l||null===(g=l.source)||void 0===g?void 0:g.alias}
1),(0,z.jsx)(Q.A,{className:Le.A.tooltip,text:null===l||void 0===l||null===(x=l.source)||void 0===x?void 0:x.alias,theme:"light",bubbleStyle:"bottom-left",customStyle:{top:"-30px"}})]})]})})," ",(0,z.jsx)("td",{children:(0,z.jsx)("div",{children:null!==e&&void 0!==e&&e.timestamp?Re()(+(null===e||void 0===e?void 0:e.timestamp)).tz(a.timezone).format("YYYY/MM/DD HH:mm:ss"):"NA"})}),(0,z.jsx)("td",{children:(0,z.jsxs)("div",{className:Le.A.assetNameContainer,children:[(0,z.jsx)("img",{src:(null===l||void 0===l||null===(p=l.currency)||void 0===p?void 0:p.logo_url)||"http://www.gravatar.com/avatar/".concat(d().enc.Hex.stringify(d().SHA1(null===l||void 0===l||null===(_=l.currency)||void 0===_?void 0:_.id)),"?d=retro"),alt:"logo",style:{marginLeft:0}}),(0,z.jsx)("p",{children:(null===l||void 0===l||null===(j=l.currency)||void 0===j||null===(y=j.currency)||void 0===y?void 0:y.length)>12?(null===l||void 0===l||null===(C=l.currency)||void 0===C||null===(T=C.currency)||void 0===T?void 0:T.substring(0,12))+"...":null===l||void 0===l||null===(f=l.currency)||void 0===f?void 0:f.currency})]})}),(0,z.jsx)("td",{children:(0,z.jsxs)("span",{children:[(null===e||void 0===e?void 0:e.amount)<0?"-":(null===e||void 0===e?void 0:e.amount)>0?"+":"",(0,m.B_)(null===e||void 0===e?void 0:e.amount,5),(0,z.jsx)(Q.A,{className:Le.A.tooltip,text:(0,m.TZ)((null===e||void 0===e?void 0:e.amount)||0),theme:"light",bubbleStyle:"bottom-left",customStyle:{top:-30}})]})}),(0,z.jsx)("td",{children:null!==e&&void 0!==e&&e.price?(0,z.jsx)("div",{children:(0,z.jsxs)("span",{children:[(0,m.B_)(null===e||void 0===e?void 0:e.price,3,null===a||void 0===a?void 0:a.baseCurrency),(0,z.jsx)(Q.A,{className:Le.A.tooltip,text:(0,m.TZ)((null===e||void 0===e?void 0:e.price)||0),theme:"light",bubbleStyle:"bottom-left",customStyle:{top:-30}})]})}):(0,z.jsx)("div",{children:"--"})}),"start"!==s?(0,z.jsx)("td",{children:null!==e&&void 0!==e&&e.isZeroCost?"Zero Cost":(0,z.jsx)("img",{className:Le.A.icon,src:o.T.Export,onClick:()=>{var n;return(e=>{const n=new URLSearchParams(window.location.search);n.delete("page"),n.set("highlightedTrx",e),n.set("pageContext",e);const i=window.open("".concat(J.e6,"?").concat(n.toString()),"_blank","noopener,noreferrer");i&&(i.opener=null)})(null===e||void 0===e?void 0:e.trxId,null===l||void 0===l||null===(n=l.currency)||void 0===n||n.id,l.source.walletId)},alt:"fee"})}):null]},n)}):null]})})})]})})},Ve=e=>{var n,i;let{postDetail:l,handleAddComments:s,handleUpdateComments:a,handleDeleteComments:d,isAddCommentClicked:r,setAddCommentClicked:c,isUpdated:u,setUpdated:v}=e;const[m,h]=(0,t.useState)(""),[g,x]=(0,t.useState)(""),[p,_]=(0,t.useState)(-1);return(0,z.jsxs)("div",{className:Le.A.commentsTabMainContainer,children:[(0,z.jsxs)("div",{className:Le.A.commentsBoxContainer,children:[(0,z.jsx)("textarea",{name:"comments",id:"comments",minLength:0,maxLength:200,className:Le.A.textAreaBox,placeholder:"add comment here...",value:m,onChange:e=>h((0,j.o)(e.target.value))}),(0,z.jsx)("span",{children:"".concat(null===m||void 0===m?void 0:m.length,"/200")}),(0,z.jsx)("button",{onClick:()=>{m&&(s(l,m),h(""),v(!u))},disabled:!m,children:r?(0,z.jsx)("img",{src:o.T.Loader,alt:""}):"Add comment"})]}),null!==l&&void 0!==l&&null!==(n=l.comments)&&void 0!==n&&n.length?(0,z.jsxs)("div",{className:Le.A.commentsHistoryContainer,children:[(0,z.jsx)("p",{children:"Comment History"}),null===l||void 0===l||null===(i=l.comments)||void 0===i?void 0:i.sort((e,n)=>n.timestamp-e.timestamp).map((e,n)=>(0,z.jsxs)("div",{className:Le.A.userCommentsContainer,children:[p===n?(0,z.jsx)("textarea",{name:"comments",id:"comments",minLength:0,maxLength:200,className:Le.A.textAreaBox,placeholder:"add comment here...",defaultValue:e.comment,onChange:e=>x((0,j.o)(e.target.value))}):(0,z.jsx)("div",{className:Le.A.userComments,children:e.comment}),(0,z.jsx)("div",{className:Le.A.commentDate,children:he()(e.timestamp).format("DD/MM/YYYY hh:mm a")}),p!==n?(0,z.jsxs)("div",{className:Le.A.actionsBtns,children:[(0,z.jsx)("i",{className:"fas fa-pen",onClick:()=>{_(n),v(!u)}}
1),(0,z.jsx)("i",{className:"fas fa-trash-alt",onClick:()=>{d(l,n),v(!u)}})]}):(0,z.jsxs)("div",{className:Le.A.actionsBtns,style:{top:"95%",right:0},children:[(0,z.jsx)("button",{disabled:!g,onClick:()=>{a(l,g,n),_(-1),v(!u)},children:"Update"}),(0,z.jsx)("button",{onClick:()=>{_(-1),v(!u)},children:"Cancel"})]})]}))]}):null]})},Oe=e=>{var n;let{postDetail:i,typeIcon:l,userSettings:s,isProcessing:o,handleAddComments:a,handleUpdateComments:d,handleDeleteComments:r,isAddCommentClicked:c,setAddCommentClicked:u,isCommentClicked:v,divRef:m,setRefDivHeight:g,offSetWidth:x,links:p,isLedgersFetching:_}=e;const{isTriggered:j}=(0,h.d4)(e=>e.session),[y,C]=(0,t.useState)(v?"comments":"details"),[T,f]=(0,t.useState)(""),[b,N]=(0,t.useState)(!0),[w,k]=(0,t.useState)((null===i||void 0===i||null===(n=i.comments)||void 0===n?void 0:n.length)||0);(0,t.useEffect)(()=>{A()},[]),(0,t.useEffect)(()=>{v&&C("comments")},[v]),(0,t.useEffect)(()=>{var e;const n=(null===i||void 0===i||null===(e=i.comments)||void 0===e?void 0:e.length)||0;if(n!==w&&(k(n),m.current)){const e=m.current.offsetHeight;g(e)}},[null===i||void 0===i?void 0:i.comments,w]),(0,t.useEffect)(()=>{if(m.current){const e=m.current.offsetHeight;g(e)}},[y,b,null===i||void 0===i?void 0:i.ledgerEntries,null===i||void 0===i?void 0:i.comments]);const A=()=>{var e,n,l,t,o,a,d,r,c,u,v,m;let h="";const g="".concat(null!==i&&void 0!==i&&null!==(e=i.gainsDetails)&&void 0!==e&&e.costBasis?", effectively locking in a cost basis of ".concat(null===s||void 0===s?void 0:s.baseCurrency," ").concat(null===(n=Number(null===i||void 0===i||null===(l=i.gainsDetails)||void 0===l?void 0:l.costBasis))||void 0===n?void 0:n.toFixed(2)):""," ").concat(null!==i&&void 0!==i&&null!==(t=i.gainsDetails)&&void 0!==t&&t.capitalGain?"and a capital gains of ".concat(null===s||void 0===s?void 0:s.baseCurrency," ").concat(null===(o=Number(null===i||void 0===i||null===(a=i.gainsDetails)||void 0===a?void 0:a.capitalGain))||void 0===o?void 0:o.toFixed(2),","):""," \n ").concat(null!==i&&void 0!==i&&null!==(d=i.fee)&&void 0!==d&&d.amount&&null!==i&&void 0!==i&&null!==(r=i.feeValue)&&void 0!==r&&r.fiatValue?"The fee incurred is ".concat(null===s||void 0===s?void 0:s.baseCurrency," ").concat(null===(c=Number(null===i||void 0===i||null===(u=i.feeValue)||void 0===u?void 0:u.fiatValue))||void 0===c?void 0:c.toFixed(2)):""),x=null!==i&&void 0!==i&&null!==(v=i.netValue)&&void 0!==v&&v.fiatValue?"valued at ".concat(null===s||void 0===s?void 0:s.baseCurrency," ").concat(parseFloat(null===i||void 0===i||null===(m=i.netValue)||void 0===m?void 0:m.fiatValue).toFixed(2)):"";if("deposit"===(null===i||void 0===i?void 0:i.transactionType)){var p,_,j;const e=null===(p=Number(null===i||void 0===i||null===(_=i.receivedCurrency)||void 0===_?void 0:_.amount))||void 0===p?void 0:p.toFixed(5),n=null===i||void 0===i||null===(j=i.receivedCurrency)||void 0===j?void 0:j.currency;h=Pe.uH.includes(n)?"You bought or received ".concat(e," ").concat(n):"You bought or received ".concat(e," ").concat(n," ").concat(x)}else if("withdrawal"===(null===i||void 0===i?void 0:i.transactionType)){var y,C,T;const e=null===(y=Number(null===i||void 0===i||null===(C=i.sentCurrency)||void 0===C?void 0:C.amount))||void 0===y?void 0:y.toFixed(5),n=null===i||void 0===i||null===(T=i.sentCurrency)||void 0===T?void 0:T.currency;h=Pe.uH.includes(n)?"You sent or withdrew ".concat(e," ").concat(n," to someone").concat(g):"You sent or withdrew ".concat(e," ").concat(n," ").concat(x," to someone").concat(g)}if("trade"===(null===i||void 0===i?void 0:i.transactionType)){var b,N,w,k,A,S;const e=null===(b=Number(null===i||void 0===i||null===(N=i.sentCurrency)||void 0===N?void 0:N.amount))||void 0===b?void 0:b.toFixed(5),n=null===(w=Number(null===i||void 0===i||null===(k=i.receivedCurrency)||void 0===k?void 0:k.amount))||void 0===w?void 0:w.toFixed(5),l=null===i||void 0===i||null===(A=i.sentCurrency)||void 0===A?void 0:A.currency,t=null===i||void 0===i||null===(S=i.receivedCurrency)||void 0===S?void 0:S.currency;h="Executed a trade of ".concat(e," ").concat(l," to ").concat(n," ").concat(t," ").concat(x," ").concat(g)}else if("transfer"===(null===i||void 0===i?void 0:i.transactionType)){var I,D,M,L,F;const e=null===(I=Number(null===i||void 0===i||null===(D=i.receivedCurrency)||void 0===D?void 0:D.amount))||void 0===I?void 0:I.toFixed(5),n=null===i||void 0===i||null===(M=i.receivedCurrency)||void 0===M?void 0:M.currency;h="You transferred ".concat(e," ").concat(n," from ").concat(null===i||void 0===i||null===(L=i.sender)||void 0===L?void 0:L.alias," to ").concat(null===i||void 0===i||null===(F=i.receiver)||void 0===F?void 0:F.alias)}else if("payment"===(null===i||void 0===i?void 0:i.transactionType)){var P,B,R;const e=null===(P=Number(null===i||void 0===i||null===(B=i.sentCurrency)||void 0===B?void 0:B.amount))||void 0===P?void 0:P.toFixed(5),n=null===i||void 0===i||null===(R=i.sentCurrency)||void 0===R?void 0:R.currency;h="You made a payment of ".concat(e," ").concat(n," ").concat(x," to someone").concat(g)}f(h)};return(0,z.jsxs)("div",{className:Le.A.trxInfoMainContainer,ref:m,style:x<=1125?{marginLeft:0,width:"100%",borderLeft:0,paddingLeft:0,borderBottomLeftRadius:0}:void 0,children:[(0,z.jsx)(Fe,{activeTab:y,setActiveTab:C}),(0,z.jsx)("div",{className:Le.A.tabContentContainer,children:"details"===y?(0,z.jsx)(We,{postDetail:null===i||void 0===i?void 0:i.ledgerEntries,userSettings:s,customDesc:T,isTriggered:j,timestamp:null===i||void 0===i?void 0:i.timestamp,setUpdated:N,protocolData:(null===i||void 0===i?void 0:i.defi)&&(null===i||void 0===i?void 0:i.protocol)||null}):"ledger"===y?(0,z.jsx)(Me.A,{postDetail:null===i||void 0===i?void 0:i.ledgerEntries,userSettings:s,isProcessing:o,isTriggered:j,links:p,isLedgersFetching:_}):"analysis"===y?(0,z.jsx)(We,{postDetail:null===i||void 0===i?void 0:i.ledgerEntries,userSettings:s,customDesc:T,isTriggered:j}):"comments"===y?(0,z.jsx)(Ve,{postDetail:i,handleAddComments:a,handleUpdate
1Comments:d,handleDeleteComments:r,isAddCommentClicked:c,setAddCommentClicked:u,isUpdated:b,setUpdated:N}):null})]})},Ge=e=>{let{GroupedTrx:n,allCheckBox:i,handleAllCheckbox:a,onChange:v,offSetWidth:m,handleShowModal:h,showExplorerLink:g,isReviewTagHandler:x,handleSplit:_,handleCloneTransaction:j,deleteHandler:C,handleAddComments:T,handleUpdateComments:f,handleDeleteComments:b,isAddCommentClicked:N,setAddCommentClicked:w,clicked:k,setClicked:A,links:S,from:I,updateEditedTrx:D,setEditedTrxList:M,isReviewPage:L,selectedTrx:F,pageRowFilter:P,setSelectionBox:B,isLedgersFetching:R,editedBgColor:E,isEditedModeOn:H,setTransactions:U,fetchTransactionsNew:W,onTransactionUpdate:Y,setFilterTypesChecked:V,handleShowDb:O,isProd:G}=e;const Z=(0,t.useRef)(null),[J,K]=(0,t.useState)(0),{currentUser:$,idToken:ee}=(0,t.useContext)(c.c),{userSettings:ne}=(0,t.useContext)(u.N),[le,te]=(0,t.useState)(!1),[se,oe]=(0,t.useState)([]),[ae,de]=(0,t.useState)(!1),[ce,ve]=(0,t.useState)(!1),[me,he]=(0,t.useState)(-1),[ge,pe]=(0,t.useState)(!0),[_e,Te]=(0,t.useState)({status:!1,id:null}),[fe,be]=(0,t.useState)({status:!1,id:null}),[Ne,we]=(0,t.useState)({status:!1,id:null}),[ke,Ae]=(0,t.useState)(!1),[Se,Me]=(0,t.useState)({status:!1,id:null}),Le=new URLSearchParams(window.location.search).get("highlightedTrx"),Fe=new p.Gf,[Pe,Be]=(0,t.useState)(!1),[Re,Ee]=(0,t.useState)(null),He=(e,n)=>{"comments"===e.target.id?Ae(!0):Ae(!1),Ne.id===n?we({status:!1,id:null}):we({status:!0,id:n})},Ue=async(e,n)=>{if(null===e||void 0===e||!e.id)return void console.error("Invalid postDetail data:",e);const i="Bearer "+ee;let t={isHighPnLReviewed:(null===e||void 0===e?void 0:e.isHighPnLReviewed)||!1,isMissingPriceIgnored:(null===e||void 0===e?void 0:e.isMissingPriceIgnored)||!1,isUncategorisedIgnored:(null===e||void 0===e?void 0:e.isUncategorisedIgnored)||!1};"Ignore"===n&&(t.isUncategorisedIgnored=!0),"Mark as Resolved"===n&&(t.isHighPnLReviewed=!0);let s=(0,l.A)((0,l.A)({},e),{},{isHighPnLReviewed:e.isHighPnLReviewed||"Mark as Resolved"===n,isUncategorisedIgnored:e.isUncategorisedIgnored||"Ignore"===n,isMissingPriceIgnored:e.isMissingPriceIgnored||"Ignore Trx"===n}),o={recalculate:!0,isEditMode:H,list:[s]};const a={"Mark as Resolved":"Resolved","Ignore Trx":"Ignore",Ignore:"Ignore"};try{await Fe.editTransaction(i,o),(0,y.y)("Success!",'Transaction marked as "'.concat(a[n],'"'),"info"),U(n=>n.filter(n=>n.id!==e.id)),Y&&Y()}catch(d){console.error("Error in handleIgnoreClick:",d),(0,y.y)("Failed!","Failed to update transaction","info")}},We=()=>{pe(!1),he(-1),ve(!1),localStorage.setItem("isCostbasisUpated","true")},Ye=e=>{Te({status:!0,id:e})},Ve=e=>{be({status:!0,id:e})},Ge=(e,n,i)=>{e.stopPropagation(),v(n,i)},ze=e=>{let n;return n=null!==e&&void 0!==e&&e.logo_url?null===e||void 0===e?void 0:e.logo_url:"http://www.gravatar.com/avatar/".concat(d().enc.Hex.stringify(d().SHA1(null===e||void 0===e?void 0:e.id)),"?d=retro"),n},Ze=e=>{const n=(null===e||void 0===e?void 0:e.sentCurrency)&&ze(null===e||void 0===e?void 0:e.sentCurrency),i=(null===e||void 0===e?void 0:e.receivedCurrency)&&ze(null===e||void 0===e?void 0:e.receivedCurrency),t=null!==e&&void 0!==e&&e.fee?ze(null===e||void 0===e?void 0:e.fee):null,s=null===e||void 0===e?void 0:e.transactionId;let a={};switch(null===e||void 0===e?void 0:e.transactionType){case"deposit":a={transactionType:o.T.DepositFilled,ignoredType:o.T.DepositIgnoreFilled,buttonText:"Deposit"};break;case"withdrawal":a={transactionType:o.T.WithdrawalFilled,ignoredType:o.T.WithdrawalIgnoreFilled,buttonText:"Withdrawal"};break;case"payment":a={transactionType:o.T.PaymentFilled,ignoredType:o.T.PaymentIgnoreFilled,buttonText:"Payment"};break;case"trade":a={transactionType:o.T.TradeFilled,ignoredType:o.T.TradeIgnoreFilled,buttonText:"Trade"};break;case"transfer":a={transactionType:o.T.TransferFilled,ignoredType:o.T.TransferIgnoreFilled,buttonText:"Transfer"}}return a=(0,l.A)((0,l.A)({},a),{},{sentImg:n,receivedImg:i,feeImg:t,transactionId:s}),a},Je="#1e1f4b14",Qe=(0,t.useRef)({});return(0,t.useEffect)(()=>{Le&&Qe.current[Le]&&Qe.current[Le].scrollIntoView({behavior:"smooth",block:"center"})},[Le,n]),(0,z.jsxs)("div",{className:[s.marketTablesMainContainer],children:[(0,z.jsx)("div",{className:s.tokensTableContainer,children:(0,z.jsx)("table",{children:(0,z.jsxs)("tbody",{children:[(0,z.jsx)("tr",{className:s.tableHeading,style:m<=1125?{position:"static"}:void 0,children:(0,z.jsx)("div",{className:s.trThInnerContainer,style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderRightColor:"transparent",background:E},children:(0,z.jsx)("th",{children:(0,z.jsxs)("div",{className:s.checkBoxContainer,children:[(0,z.jsx)("input",{type:"checkbox",name:"checkbox",checked:i,onChange:e=>{var n;a(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.checked)},disabled:0===(null===n||void 0===n?void 0:n.length)}),(0,z.jsx)("span",{className:s.checkSign,style:{background:E}})]})})})}),null===n||void 0===n?void 0:n.map((e,n)=>(0,z.jsx)(t.Fragment,{children:e.transactions.map((n,i)=>{var l,t,a,d,r,c,u;const v=0===i,h=i===e.transactions.length-1;return(0,z.jsx)("tr",{children:(0,z.jsxs)("div",{style:null!==Ne&&void 0!==Ne&&Ne.status&&(null===Ne||void 0===Ne?void 0:Ne.id)===(null===n||void 0===n?void 0:n.id)?{height:"auto",width:"100%"}:void 0,children:[(0,z.jsxs)("div",{className:Re===(null===n||void 0===n?void 0:n.id)||null!==Ne&&void 0!==Ne&&Ne.status&&(null===Ne||void 0===Ne?void 0:Ne.id)===(null===n||void 0===n?void 0:n.id)?[s.trInnerContainer,s.trInnerHovered].join(" "):s.trInnerContainer,style:v&&(null===(l=e.transactions)||void 0===l?void 0:l.length)>1?{marginTop:e.date?35:0,borderTopLeftRadius:4,borderRight:0,borderTop:"1px solid #e6e9fb",background:Le===(null===n||void 0===n?void 0:n.id)?Je:""}:v&&1===(null===(t=e.transactions)||void 0===t?void 0:t.length)?{marginTop:e.date?35:0,borderTopLeftRadius:4,borderBottomLeftRadius:4,borderRight:0,borderTop:"1px solid #e6e9fb",background:Le===(null===n||void 0===n?void 0:n.id)?Je:""}:h?{borderBottomLeftRadius:4,borderRight:0,background:Le===(null===n||void 0===n?void 0:n.id)?Je:""}:{borderRight:0,background:Le===(null===n||void 0===n?void 0:n.id)?Je:""},onClick:e=>He(e,null===n||void 0===n?void 0:n.id),onMouseEnter:()=>Ee(n.id),onMouseLeave:()=>Ee(null),ref:e=>Qe.current[n.id]=e,children:[v&&e.date?(0,z.jsx)("div",{className:s.groupedDateTxt,children:"".concat(e.date," (").concat((null===e||void 0===e||null===(a=e.transactions)||void 0===a?void 0:a.length)||0," ").concat(1===(null===e||void 0===e||null===(d=e.transactions)||void 0===d?void 0:d.length)?"Transaction":"Transactions",")")}):null,(0,z.jsx)("td",{children:(0,z.jsx)("div",{className:s.trxTypeAndCheckboxContainer,children:null!==n&&void 0!==n&&n.isChecked?(0,z.jsx)("img",{className:s.checkBoxMain,src:o.T.Checkbox,alt:"transactionType",onClick:e=>Ge(e,null===n||void 0===n?void 0:n.id,i),onMouseEnter:()=>te(null===n||void 0===n?void 0:n.id),onMouseLeave:()=>te(-1)}):(null===(r=Ze(n))||void 0===r?void 0:r.transactionType)&&(0,z.jsx)("img",{className:s.checkBoxMain,src:le===(null===n||void 0===n?void 0:n.id)?o.T.EmptyC
1heckbox:"Ignore"===(null===n||void 0===n?void 0:n.label)?null===(c=Ze(n))||void 0===c?void 0:c.ignoredType:null===(u=Ze(n))||void 0===u?void 0:u.transactionType,alt:"transactionType",onClick:e=>Ge(e,null===n||void 0===n?void 0:n.id,i),onMouseEnter:()=>te(null===n||void 0===n?void 0:n.id),onMouseLeave:()=>te(-1)})})}),(0,z.jsxs)("div",{className:s.tagsContainer,children:[n&&null!==n&&void 0!==n&&n.isReviewTag?(0,z.jsxs)("div",{className:s.manualTrxSymbol,style:v&&null!==n&&void 0!==n&&n.isManualTrx?{borderRadius:"4px 0 0px 0"}:!v||null!==n&&void 0!==n&&n.isManualTrx?!v&&null!==n&&void 0!==n&&n.isManualTrx?{borderRadius:"0px 0 0px 0"}:void 0:{borderRadius:"4px 0 4px 0"},children:[(0,z.jsx)("img",{src:o.T.Tag,alt:"F"}),(0,z.jsx)("p",{children:"Tagged as further Review"})]}):null,null!==n&&void 0!==n&&n.isManualTrx?(0,z.jsxs)("div",{className:s.manualTrxSymbol,style:v&&null!==n&&void 0!==n&&n.isReviewTag?{borderRadius:"0px 0 4px 0"}:!v||null!==n&&void 0!==n&&n.isReviewTag?!v&&null!==n&&void 0!==n&&n.isReviewTag?{borderRadius:"0px 0 4px 0"}:void 0:{borderRadius:"4px 0 4px 0"},children:[(0,z.jsx)("span",{children:"M"}),(0,z.jsx)("p",{children:"Manually Added Transaction"})]}):null,null!==n&&void 0!==n&&n.isMergedTrx?(0,z.jsxs)("div",{className:s.manualTrxSymbol,children:[(0,z.jsx)("img",{src:o.T.MergeWhite,alt:"F",className:s.mergedIcon}),(0,z.jsx)("p",{children:"Merged Transactions"})]}):null]})]}),null!==Ne&&void 0!==Ne&&Ne.status&&(null===Ne||void 0===Ne?void 0:Ne.id)===(null===n||void 0===n?void 0:n.id)?(0,z.jsx)("div",{className:s.trxInfoContainer,style:{borderLeft:m<=1125?"1px solid #2b367426":void 0,borderBottom:m<=1125?"1px solid #2b367426":void 0,borderBottomLeftRadius:4,marginBottom:10,height:J-.5,background:m<=1125?"#f6f6f880":"transparent"}}):null]})})})},n))]})})}),(0,z.jsx)("div",{className:s.scrollContainer,style:m<=1125?{overflowY:"hidden",overflowX:"auto"}:void 0,children:(0,z.jsx)("div",{className:s.pricesTableContainer,children:(0,z.jsx)("table",{children:(0,z.jsxs)("tbody",{children:[(0,z.jsx)("tr",{className:s.tableHeading,children:(0,z.jsxs)("div",{className:s.trThInnerContainer,style:{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftColor:"transparent",background:E},children:[(0,z.jsx)("th",{children:"Type"}),(0,z.jsx)("th",{children:"From"}),(0,z.jsx)("th",{children:"To"}),(0,z.jsx)("th",{children:"Fees"}),(0,z.jsx)("th",{children:"Value"}),(0,z.jsx)("th",{children:"Gains"}),(0,z.jsx)("th",{})]})}),null===n||void 0===n?void 0:n.map((e,n)=>(0,z.jsx)(t.Fragment,{children:e.transactions.map((l,t)=>{var a,d,c,u;const p=0===t,y=t===e.transactions.length-1,D=Ze(l);return(0,z.jsx)("tr",{children:(0,z.jsxs)("div",{style:null!==Ne&&void 0!==Ne&&Ne.status&&(null===Ne||void 0===Ne?void 0:Ne.id)===(null===l||void 0===l?void 0:l.id)?{height:"auto",width:"100%"}:void 0,children:[(0,z.jsxs)("div",{className:Re===(null===l||void 0===l?void 0:l.id)||null!==Ne&&void 0!==Ne&&Ne.status&&(null===Ne||void 0===Ne?void 0:Ne.id)===(null===l||void 0===l?void 0:l.id)?[s.trInnerContainer,s.trInnerHovered].join(" "):s.trInnerContainer,style:p&&(null===(a=e.transactions)||void 0===a?void 0:a.length)>1?{marginTop:e.date?35:0,borderLeft:0,borderTopRightRadius:4,borderTop:"1px solid #e6e9fb",background:Le===(null===l||void 0===l?void 0:l.id)?Je:""}:p&&1===(null===(d=e.transactions)||void 0===d?void 0:d.length)?{marginTop:e.date?35:0,borderLeft:0,borderTopRightRadius:4,borderBottomRightRadius:4,borderTop:"1px solid #e6e9fb",background:Le===(null===l||void 0===l?void 0:l.id)?Je:""}:y&&(null===(c=e.transactions)||void 0===c?void 0:c.length)>1?{borderBottomRightRadius:4,borderLeft:0,background:Le===(null===l||void 0===l?void 0:l.id)?Je:""}:{borderLeft:0,background:Le===(null===l||void 0===l?void 0:l.id)?Je:""},onClick:e=>He(e,null===l||void 0===l?void 0:l.id),onMouseEnter:()=>Ee(l.id),onMouseLeave:()=>Ee(null),children:[(0,z.jsx)("td",{children:(0,z.jsx)(r.A,{currentUser:$,userSettings:ne,typeIcon:null===D||void 0===D?void 0:D.transactionType,tagsList:se,setTagsList:oe,setTagIgnore:de,showLoader:ce,setShowLoader:ve,showTagType:me,setShowTagType:he,postDetail:l,openDown:!0,showDate:!0,handleHooksAfterRes:We,showWarning:ge,displayData:D,handleShowModal:h,handleMissingPriceModal:Ye,handleMissingPurchaseModal:Ve,name:t,onChange:v,allCheckBox:i,setTrxInfo:we,index:n,from:I,setEditedTrxList:M,isReviewPage:L,setSelectionBox:B,editedBgColor:E,isEditedModeOn:H,fetchTransactionsNew:W,setFilterTypesChecked:V})}),(0,z.jsx)("td",{children:(0,z.jsx)(q,{displayData:D,postDetail:l,userSettings:ne,fetchTransactionsNew:W})}),(0,z.jsx)("td",{children:(0,z.jsx)(X,{displayData:D,postDetail:l,userSettings:ne,fetchTransactionsNew:W})}),(0,z.jsx)("td",{children:(0,z.jsx)(ie,{postDetail:l,userSettings:ne})}),(0,z.jsx)("td",{children:(0,z.jsx)(re,{postDetail:l,showLoader:ce,userSettings:ne})}),(0,z.jsx)("td",{children:(0,z.jsx)(ue,{postDetail:l,showLoader:ce,userSettings:ne})}),(0,z.jsxs)("td",{children:[(null===l||void 0===l?void 0:l.isEdited)&&(0,z.jsx)("div",{className:s.editedText,children:"(Edited)"}),(0,z.jsxs)("div",{className:s.actionButtonsContainer,children:[l&&null!==l&&void 0!==l&&l.comments&&null!==l&&void 0!==l&&null!==(u=l.comments)&&void 0!==u&&u.length?(0,z.jsxs)("div",{className:s.commentsContainer,children:[(0,z.jsx)("img",{src:o.T.MessageNotification,alt:"comments",id:"comments",onClick:()=>{Ae(!0),we({status:!0,id:null===l||void 0===l?void 0:l.id})}}),(0,z.jsx)(Q.A,{className:s.tooltipHover,text:"View Comments",theme:"dark",bubbleStyle:"bottom-center",customStyle:{left:"-220%",background:"#1e1f4b"},isNotShowCopyButton:!0})]}):(0,z.jsxs)("div",{className:s.commentsContainer,children:[(0,z.jsx)("img",{src:o.T.Messages,alt:"comments",id:"comments",onClick:()=>{Ae(!0),we({status:!0,id:null===l||void 0===l?void 0:l.id})}}),(0,z.jsx)(Q.A,{className:s.tooltipHover,text:"Add Comments",theme:"dark",bubbleStyle:"bottom-center",customStyle:{left:"-220%",background:"#1e1f4b"},isNotShowCopyButton:!0})]}),!g||null!==l&&void 0!==l&&l.isMergedTrx||l.isManualTrx||null===l||void 0===l||!l.explorerLink?(0,z.jsx)("div",{style:{width:24,height:24,display:"flex"}}):(0,z.jsx)(xe,{explorerLink:null===l||void 0===l?void 0:l.explorerLink,postDetail:l}),(0,z.jsx)(je,{displayData:D,postDetail:l,handleShowModal:h,setShowDeleteModal:Me,isReviewTagHandler:x,handleSplit:_,handleCloneTransaction:j,handleMoreDetailsClick:He,handleIgnoreClick:Ue,from:I,handleShowDb:O,isProd:G})]})]}),fe.status&&(null===fe||void 0===fe?void 0:fe.id)===(null===l||void 0===l?void 0:l.id)?(0,z.jsx)(ye.A,{postDetail:l,currentUser:$,userSettings:ne,onCancel:()=>be({status:!1,id:null}),isProcessing:ce,setIsMissingPurchaseHistoryFixClicked:Be,links:S}):null,null!==_e&&void 0!==_e&&_e.status&&(null===_e||void 0===_e?void 0:_e.id)===(null===l||void 0===l?void 0:l.id)?(0,z.jsx)(Ce.A,{postDetail:l,idToken:ee,currentUser:$,userSettings:ne,clicked:k,setClicked:A,onCancel:()=>Te({status:!1,id:null}),isEditedModeOn:H}):null,null!==Se&&void 0!==Se&&Se.status&&(null===Se||void 0===Se?void 0:Se.id)===(null===l||void 0===l?void 0:l.id)?(0,z.jsx)(Ie,{postDetail:l,onCancel:()=>Me({status:!1,id:null}),setShowDeleteModal:Me,deleteHandler:C}):null]}),(0,z.jsx)("div",{className:s.trxInfoContainer,children:(null===Ne||void 0===Ne?void 0:Ne.status)&&(null===Ne||void 0===Ne?void 0:Ne.id)===(null===l||void 0===l?void 0:l.id)&&(0,z.jsx)(Oe,{postDetail:l,typeIcon:D.transactionType,userSettings:ne,isProcessing:ce,handleAddComments:T,handleUpdate
1Comments:f,handleDeleteComments:b,isAddCommentClicked:N,setAddCommentClicked:w,isCommentClicked:ke,divRef:Z,setRefDivHeight:K,offSetWidth:m,links:S,isLedgersFetching:R})})]})})})},n))]})})})}),Pe?(0,z.jsx)(De.A,{onCancel:()=>Be(!1),propsClick:k,setPropsClicked:A,isEditedModeOn:H}):null]})}},97626:(e,n,i)=>{i.d(n,{y:()=>s});var l=i(89379);const t=new(i(84355).A),s=async(e,n)=>await Promise.all(e.map(async e=>{try{const i=await t.getLedgerEntriesByTradeId(n,e.id);return(0,l.A)((0,l.A)({},e),{},{ledgerEntries:null===i||void 0===i?void 0:i.sort((e,n)=>e.timestamp===n.timestamp&&e.tradeId===n.tradeId?"IS_TRX_FEE"===e.desc?1:"IS_TRX_FEE"===n.desc?-1:0:e.timestamp-n.timestamp)})}catch(i){return console.error("\u274c Error fetching ledger entries for tradeId: ".concat(e.id),i),(0,l.A)((0,l.A)({},e),{},{isChecked:!1,ledgerEntries:[]})}}))}}]);
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.