{"version":3,"sources":["data/firebaseConfig.js","data/api.js","data/loanPools.js","assets/icons.svg","components/Icon/index.js","assets/images/brand_logo_light.png","components/Button/index.js","components/AppBar/index.js","data/conversations.js","data/utils.js","pages/Portal/MarketplaceActivities.js","pages/Portal/Table.js","pages/Portal/DealRoom.js","pages/Portal/History.js","pages/Portal/index.js","assets/images/brand_logo.svg","assets/images/logo.svg","pages/Login/index.js","data/documents.js","components/Mapchart/index.js","assets/styles/modalStyles.js","components/LoanCard/index.js","components/FilterOption/index.js","components/FilterDropdown/index.js","components/LoansTable/FilterBar.js","components/LoansTable/index.js","pages/Marketplace/Pagination.js","pages/Marketplace/index.js","components/ChatMessage/Avatar.js","components/ChatItem/index.js","components/ChatRoster/index.js","context/eventBus.js","context/PanelPublisher.js","components/ChatMessage/index.js","data/hooks/useAllDocuments.js","components/Chat/ChatBox.js","components/Chat/ChatBoxHeader.js","assets/images/avatar-placeholder.png","components/UserImage/index.js","components/Chat/ButtonAdd.js","components/Chat/UserChat.js","components/Chat/index.js","components/TextField/index.js","assets/images/thumbnails/Contract.svg","assets/images/thumbnails/Contract-1.svg","assets/images/thumbnails/Contract-2.svg","components/Payment/CongratsModal.js","assets/images/wise_logo.svg","components/Payment/index.js","data/hooks/useRenderDocuments.js","components/ChatPanel/index.js","components/ConfirmationModal.js","data/hooks/useTwilioClient.js","pages/Messages/index.js","pages/Upload/StepButtons.js","pages/Upload/Details.js","pages/Upload/ListingType.js","pages/Upload/ProductClass.js","pages/Upload/Tags.js","pages/Upload/SelectRegion.js","components/Compensation/index.js","pages/Upload/StateCompensation.js","pages/Upload/NumericalDetails.js","components/UploadDropZone/index.js","assets/HELOC_pool.pdf","pages/Upload/UploadBrochure.js","pages/Upload/Submit.js","pages/Upload/ProductType.js","pages/Upload/ProgressBar.js","components/RouterPrompt.js","pages/Upload/index.js","assets/three-dots.svg","components/DocumentHistory/DocumentItem.js","components/DocumentVersion/ButtonSmall.js","components/DocumentVersion/VersionItem.js","components/DocumentVersion/VersionContainer.js","components/DocumentVersion/index.js","components/DocumentHistory/index.js","pages/LoanDetail/index.js","components/PrivateRoute/index.js","pages/Settings/SectionModal.js","pages/EntityProfile/EditFinancial.js","components/Button/EditIcon.js","pages/EntityProfile/FinancialHighlights.js","pages/EntityProfile/Person.js","pages/Settings/InNetwork.js","pages/EntityProfile/PersonDetail.js","pages/EntityProfile/People.js","pages/EntityProfile/MarketplaceListings.js","pages/EntityProfile/EditAbout.js","pages/EntityProfile/About.js","components/BusinessImage/index.js","assets/images/placeholder-company.png","pages/EntityProfile/Header.js","pages/EntityProfile/index.js","assets/images/audit_frame.png","pages/DealRoom/SettlementCard.js","pages/DealRoom/ManageMenu.js","data/hooks/useContract.js","pages/DealRoom/ContractVersion.js","pages/DealRoom/Contract.js","pages/DealRoom/DealAction.js","assets/images/audit.png","pages/DealRoom/index.js","components/RegistrationStep/index.js","pages/Register/index.js","data/auth.js","data/wildcard.js","pages/SignUp/index.js","pages/Settings/Section.js","pages/Settings/Account.js","pages/Settings/Organization.js","pages/Settings/Transaction.js","pages/Settings/Profile.js","pages/Settings/AvatarEdit.js","pages/Settings/index.js","router.js","App.js","index.js"],"names":["app","firebase","initializeApp","apiKey","process","authDomain","databaseURL","projectId","storageBucket","messagingSenderId","appId","instance","axios","create","baseURL","headers","Accept","getAccessToken","a","user","auth","currentUser","getIdTokenResult","token","expirationTime","Date","getTime","now","getIdToken","interceptors","request","use","config","Authorization","api","response","r","err","status","window","location","getLoanPools","currentPage","url","objParams","params","page","size","get","data","getLoanPoolById","id","updateLoanPool","loanPool","put","settlement","updateDealRoom","dealInfo","getActiveDeals","getProposedBuyers","loanId","getBusiness","name","updateBusiness","info","uploadUser","getUser","entity","email","getUserByEmail","Icon","props","href","icons","classes","Button","children","className","variant","disabled","isLoading","onClick","classNames","includes","color","AppBar","selectedIndex","state","useState","isVisible","setVisible","navItems","text","path","routes","root","marketplace","messages","history","useHistory","profileRef","useRef","queryClient","useQueryClient","handleClickOutside","event","current","contains","target","handleLogout","signOut","then","console","log","localStorage","clear","push","useEffect","document","addEventListener","removeEventListener","to","src","brand_logo_light","alt","map","navItem","index","pathname","ref","settings","getConversationsByUser","getMessages","sid","createConversation","buyerInfo","getToken","username","post","cleanUrlParams","split","host","replaceState","title","getBuyer","locationStateEntity","res","buyer","result","filtered","proposedBuyers","filter","b","toLowerCase","e","getImage","profile","link","image","responseType","avatar","blob","URL","createObjectURL","setItem","JSON","stringify","initConversations","setBuyer","setCurrentSid","countersigner","esignConvSid","isOwner","owner","signedUser","currentBuyer","existingConversationSid","conversationSid","currentChat","convByUser","find","item","participants","getCounterpartyFromSid","loan","conversations","seller","getConvCounterparty","MarketplaceActivities","currentIdx","setCurrentIdx","parse","getItem","loanPools","length","word","charAt","toUpperCase","slice","profileWithName","displayName","upload","detail","listType","replace","Table","dealroom","DealRoom","tabIndex","setTabIndex","showAll","setShowAll","onSelect","History","useQuery","error","message","Portal","isSuccess","activeDeals","setActiveDeals","dealroomData","retrieveActiveDeals","deals","latest","sort","lastUpdated","dealRole","styles","label","top","left","Login","useForm","register","watch","handleSubmit","handleSignInSubmit","password","signInWithEmailAndPassword","authToken","claims","brand_logo","logo","onSubmit","style","type","uploadDoc","formData","uploadContract","append","getAllDocNames","getDoc","docName","responseEncoding","getContract","getThumbnail","restoreDoc","docInfo","getDocthumbnail","customizeDoc","getESign","getDocEsign","filename","Mapchart","statesInfo","projection","geography","geographies","geo","stateInfo","states","stroke","fill","percentLoan","rsmKey","modalStyles","overlay","backgroundColor","content","right","bottom","marginRight","transform","borderRadius","Modal","setAppElement","LoanCard","footer","bookmark","setBookmark","isModalOpen","setModalOpen","brochure","setBrochure","handleBookmark","handleBrochureMessage","docNames","doc","description","toaster","loanType","loanClass","productTags","tag","reverse","generalInfo","currentBalance","numeral","format","originalBalance","grossWAC","price","Number","sellerRetainedPercent","serviceFee","waBalance","waCreditScore","waDebtToIncome","waLTV","waCLTV","count","isOpen","onRequestClose","width","height","FilterOption","checked","value","onValueChange","onChange","htmlFor","FilterDropdown","onFilter","valuesKey","isClearable","setClearable","Object","keys","isChecked","values","setValues","listContainer","handleValueChange","v","checkedValues","FilterBar","onGlobalFilter","placeholder","LoansTable","onToggle","loanClicked","setLoanClicked","useMemo","columns","Header","accessor","rows","_","filterValue","row","Cell","availability","productTag","join","some","cell","original","handleMessageClick","tableInstance","useTable","useGlobalFilter","useFilters","getTableProps","getTableBodyProps","headerGroups","setGlobalFilter","setFilter","prepareRow","headerGroup","getHeaderGroupProps","column","getHeaderProps","render","getRowProps","handleLoanClick","cells","getCellProps","Pagination","setCurrentPage","isPreviousData","totalPages","total","p","Marketplace","listed","keepPreviousData","isTabular","setTabular","handleToggle","metaData","Avatar","ChatItem","chat","selected","imageLoaded","setImageLoaded","retrieveAvatar","lastActivity","dateFormat","ChatRoster","currentSid","source","chats","setChats","initChats","withUniqueSid","uniqBy","threads","conversation","i","date_created","unSettled","undefined","chatA","chatB","handleClick","list","Map","on","eventType","eventAction","this","has","set","emit","args","forEach","cb","PanelPublisher","ChatMessage","mediaUrl","setMediaUrl","media","getContentTemporaryUrl","author","body","date","contentType","codeStatus","download","rel","useAllDocuments","parseInt","enabled","ChatBox","thread","onLastActivity","reset","chatBox","inputFile","setMessages","setConversation","setLoading","isFileSending","setFileSending","refetch","messageAdded","dateCreated","attributes","scrollTop","scrollHeight","removeListener","initConversation","items","uploadFile","file","FormData","substr","indexOf","accessType","handleFileChange","files","sendMessage","reduce","groupedMessages","group","getYear","getMonth","getDate","autoComplete","ChatBoxHeader","buyerDisplayName","setModalUsersOpen","minHeight","ionClick","UserImage","person","setSrc","retrieveUser","photo","ButtonAdd","UserChat","reload","setIsLoading","handleOnClick","setTimeout","success","role","Chat","client","isModalUsersOpen","team","setTeam","setThread","setParticipants","setReload","initThread","getConversationBySid","retrieveParticipants","getParticipants","identity","retrieveBusiness","reloadParticipants","TextField","innerRef","CongratsModal","didPay","onClose","contract","contract1","contract2","Payment","documents","setDocuments","setPay","retrieveDocs","thumbnail","originalFilename","plugins","resolve","slidesToShowPlugin","options","numberOfSlides","wiseLogo","useRenderDocuments","useMutation","ChatPanel","buyerEmail","setLoadingOverlay","isLoiSigned","setLoiSigned","showSatisfiedButtons","setShowSatisfiedButtons","counterSignButton","setCounterSignButton","isContractSigned","setContractSigned","isDealUpdated","setDealUpdated","envelopeId","redirectUrl","eSign","setESign","proposedBuyer","setProposedBuyer","renderLOI","refreshKey","setRefreshKey","docusignevent","URLSearchParams","search","substring","docusignEnvelopeId","signature","docuSignId","catch","getMessage","oldKey","throttle","leading","trailing","signStatus","entries","docType","handleLoiSigned","handleCounterSign","esignRes","loi","templateName","seller_org","buyer_org","mutate","onSuccess","onError","zIndex","ConfirmationModal","textOk","textCancel","showPrompt","handleOK","handleCancel","onOk","onCancel","txt","key","useTwilioClient","setClient","initClient","ConversationsClient","toString","Messages","match","setLoanPools","setConversations","showErrorPrompt","setErrorPromptOpen","loadingOverlay","retrieveConversations","active","spinner","StepButtons","nextStep","previousStep","totalSteps","step","Details","useFormContext","errors","formState","required","isActive","update","ListingType","defaultValues","option","ProductClass","loanClasses","Tags","SelectRegion","viewBox","d","clipRule","fillRule","Compensation","onPercentageChange","min","max","StateCompensation","statesInfoData","region","setRegion","setStatesInfo","handlePercentChange","delta","percentResult","prev","next","obj","statesFilter","initialData","textA","textB","tooltip","classDependentFields","Consumer","Residential","Other","LabelTooltip","tip","NumericalDetails","control","form","field","thousandSeparator","prefix","fixedDecimalScale","allowEmptyFormatting","allowNegative","customInput","c","loanTerm","waRemainingTerm","decimalScale","maxLength","allowLeadingZeros","rules","defaultValue","UploadDropZone","onDrop","accept","useDropzone","noClick","noKeyboard","getRootProps","getInputProps","UploadBrochure","setFiles","useCallback","acceptedFiles","heloc_pool","Submit","isUploading","isErrorUpload","isErrorBrochure","ErrorBrochure","loanpool","submit","ProductType","ProgressBar","currentStep","RouterPrompt","when","onOK","setShowPrompt","currentPath","setCurrentPath","block","prompt","Promise","Upload","methods","trigger","showSubmitPrompt","setSubmitPrompt","showLeavePrompt","setLeavePrompt","setCurrentStep","mapData","setMapData","setIsUploading","setIsSuccess","setIsErrorUpload","setIsErrorBrochure","updateState","updateForm","alertUser","preventDefault","returnValue","loanRes","isValid","onStepChange","stats","activeStep","scrollTo","behavior","nav","DocumentItem","handleSelectDoc","handleVersion","truncate","dots","ButtonSmall","loadingLabel","VersionItem","version","currentVersion","reviewContract","setModalContractOpen","contractSigned","showButtonsReviewContract","isDownloading","setIsDownloading","isRestoring","setIsRestoring","uploadDate","toLocaleString","handleDownload","createElement","click","revokeObjectURL","VersionContainer","DocumentVersion","versions","links","versionedDocs","created","poolId","pop","DocumentHistory","carousel","selectedDoc","setSelectedDoc","selectedVersion","setSelectedVersion","isModalVersionOpen","setModalVersionOpen","isLoadingInfo","setIsLoadingInfo","dobj","LoanDetail","setLoanPool","retrieveLoanPool","PrivateRoute","Component","component","isUserLoggedIn","renderProps","login","SectionModal","onSave","disableSave","EditFinancial","isDirty","minWidth","EditIcon","setOpen","FinancialHighlights","business","isEditOpen","setEditOpen","highlights","financials","assets","totalDeposits","loans","members","shareGrowth","loanGrowth","netWorthRatio","loanToShare","highlight","select","Person","edit","InNetwork","PersonDetail","inNetwork","linkedInProfile","People","people","setPerson","mode","isSaving","setIsSaving","dirtyValues","touchedFields","allValues","Array","isArray","fromEntries","onUpdate","dirtyFields","usersData","promises","userData","all","MarketplaceListings","listings","EditAbout","about","phone","website","ceo","identification","numEmployeesRange","address","city","country","street","zipCode","mask","formats","regexps","formatString","phoneNumber","l","normalize","About","BusinessImage","EntityProfile","useParams","businessProfile","setBusinessProfile","isLoadingUser","setIsLoadingUser","businessResponse","reloadBusinessInfo","SettlementCard","ManageMenu","manageContainer","isManageOpen","setManageOpen","isSaleEnding","setSaleEnding","isSettlement","setSettlement","isEndingLoading","setEndingLoading","inputContractFile","dataset","end","handleEndSaleWanted","handleEndSale","handleContractChange","MenuSettlement","MenuContent","ConfirmAction","actor","memo","useContract","ContractVersion","setContract","setLatest","contractQuery","at","Contract","isModalContractOpen","DealAction","setProposedLoaded","accountId","esign","contractBuyer","setContractBuyer","contractSeller","setContractSeller","setShowButtonsReviewContract","isAuditOpen","setAuditOpen","setProposedBuyers","promptMessage","setPromptMessage","contractSignAgreed","audit_frame","setConversationSid","proposedLoaded","retrieveConversation","existingConversation","RegistrationStep","stepQuestion","Register","isDecisionMaker","setDecisionMaker","handleDecisionMaker","signup","term","SignUp","setValue","setError","setTerm","setToken","setSelected","fieldsQuery","init","handleSignUpSubmit","firstName","lastName","financialInstitution","createUserWithEmailAndPassword","confirmPassword","handleItemClick","innerText","institution","Section","onEdit","Account","reloadSettings","validationSchema","Yup","shape","oneOf","formOptions","resolver","yupResolver","register1","handleSubmit1","reset1","isDirty1","Name","updatePassword","Organization","entityType","decisionMaker","isDesicionMaker","responsability","Transaction","assetClass","geographicInterests","transactionInterests","Sell","Buy","Profile","matches","AvatarEdit","square","change","setChange","preview","setPreview","dataUriToBlob","dataUri","splitDataUri","byteString","atob","decodeURI","mimeString","ia","Uint8Array","charCodeAt","Blob","handlePhotoSave","exportAsSquare","onCrop","Settings","isAccountOpen","setAccountOpen","isOrganizationOpen","setOrganizationOpen","isTransactionOpen","setTransactionOpen","isProfileOpen","setProfileOpen","setUser","setLoadingUser","userResponse","account","Email","Password","organization","transaction","preferences","Tag","AppRouter","getUserConfirmation","exact","QueryClient","App","initializing","setInitializing","onIdTokenChanged","removeItem","position","ReactDOM","StrictMode","getElementById"],"mappings":"gsrHAGMA,G,OAAMC,IAASC,cAAc,CACjCC,OAAQC,0CACRC,WAAYD,+BACZE,YAAaF,mDACbG,UAAWH,eACXI,cAAeJ,2BACfK,kBAAmBL,eACnBM,MAAON,+C,wDCPHO,E,OAAWC,EAAMC,OAAO,CAC5BC,QAASV,4CACTW,QAAS,CACPC,OAAQ,mBACR,eAAgB,sBAIdC,EAAc,uCAAG,kCAAAC,EAAA,2DACfC,EAAOnB,EAAIoB,OAAOC,aADH,iCAKmBF,EAAKG,mBALxB,mBAKbC,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,EAAIoB,OAAOi/B,iBAAiBA,KAE9C,IAECF,EACF,qBAAKt7B,UAAU,4CAAf,SACE,qBAAKA,UAAU,cAAf,SACE,cAAC,KAAD,QAMJ,eAAC,sBAAD,CAAqBib,OAAQxZ,GAA7B,UACE,cAAC,GAAD,IAEA,cAAC,KAAD,CAASi6B,SAAS,kBChExBC,IAASzoB,OACP,cAAC,IAAM0oB,WAAP,UACE,cAAC,GAAD,MAEFn5B,SAASo5B,eAAe,W","file":"static/js/main.7868e206.chunk.js","sourcesContent":["import firebase from 'firebase/app'\nimport 'firebase/auth'\n\nconst app = firebase.initializeApp({\n  apiKey: process.env.REACT_APP_FIREBASE_API_KEY,\n  authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,\n  databaseURL: process.env.REACT_APP_FIREBASE_DATABASE_URL,\n  projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,\n  storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,\n  messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,\n  appId: process.env.REACT_APP_FIREBASE_APP_ID\n})\n\nexport { app }\n","import axios from 'axios'\nimport { app } from '../data/firebaseConfig'\n\nconst instance = axios.create({\n  baseURL: process.env.REACT_APP_API_URL,\n  headers: {\n    Accept: 'application/json',\n    'Content-Type': 'application/json'\n  }\n})\n\nconst getAccessToken = async () => {\n  const user = app.auth().currentUser;\n  if (user) {\n    // getIdTokenResult provides token metadata in the result\n    // will return current token, unless it's expired where a fresh token is grabbed\n    let { token, expirationTime } = await user.getIdTokenResult();\n\n    const expiresMS = (new Date(expirationTime)).getTime();\n    if (expiresMS - Date.now() < 300000) {\n      // if the token will expire in the next 5 minutes, \n      // forcefully grab a fresh token\n      token = await user.getIdToken(true);\n    }\n    return token;\n  }\n  return null;\n};\n\ninstance.interceptors.request.use(async (config) => {\n  const token = await getAccessToken();\n  config.headers.Authorization = `Bearer ${token}`;\n  return config;\n});\n\nconst api = () => {\n  instance.interceptors.response.use(\n    r => r,\n    err => {\n      if (err.response?.status === 403) {\n        window.location = '/'\n      }\n      if (err.response?.status === 401) {\n        window.location = '/login'\n      }\n\n      throw err\n    }\n  )\n  return instance\n}\n\nexport default api\n","import api from './api'\n\nexport const getLoanPools = async currentPage => {\n  var url = 'loanpool'\n  var objParams = {}\n  // TODO: Fix currentPage is being passed as a react query object\n  if (typeof(currentPage) == 'number') {\n    url = 'loanpool/pages'\n    objParams = {\n      params: { page: currentPage, size: 9 }\n    }\n  }\n  const data = await api().get(url, objParams)\n  return data.data\n}\n\nexport const getLoanPoolByTitle = async title => {\n  const data = await api().get(`loanpool/title/${title}`)\n  return data.data\n}\n\nexport const getLoanPoolById = async id => {\n  const data = await api().get(`loanpool/id/${id}`)\n  return data.data\n}\n\nexport const updateLoanPool = async loanPool => {\n  const data = await api().put('loanpool', loanPool)\n  return data.data\n}\n\nexport const settlement = async loanPool => {\n  const data = await api().put('loanpool/settlement', loanPool)\n  return data.data\n}\n\nexport const updateDealRoom = async dealInfo => {\n  const data = await api().put('loanpool/deal', dealInfo)\n  return data.data\n}\n\nexport const getActiveDeals = async user => {\n  const data = await api().get(`loanpool/activedeals/${user}`)\n  return data.data\n}\n\nexport const getProposedBuyers = async loanId => {\n  const data = await api().get(`loanpool/proposedbuyers/loan/${loanId}`)\n  return data.data\n}\n\nexport const getMyLoanPool = async owner => {\n  const data = await api().get(`loanpool/owner/${owner}`)\n  return data.data\n}\n\nexport const getBusiness = async name => {\n  const data = await api().get(`loanpool/business/${name}`)\n  return data.data\n}\n\nexport const getBusinessUser = async name => {\n  const data = await api().get(`loanpool/business/${name}/users`)\n  return data.data\n}\n\nexport const updateBusiness = async info => {\n  const data = await api().put('loanpool/business', info)\n  return data.data\n}\n\nexport const uploadUser = async user => {\n  const data = await api().put(`loanpool/business/user`, user, {\n    headers: { 'Content-Type': 'multipart/form-data' }\n  })\n  return data.data\n}\n\nexport const getUser = async (entity, email) => {\n  const data = await api().get(`loanpool/business/${entity}/user/${email}`)\n  return data.data\n}\n\nexport const getUserByEmail = async (email) => {\n  const data = await api().get(`loanpool/user/${email}`)\n  return data.data\n}\n","export default __webpack_public_path__ + \"static/media/icons.dc58e8ac.svg\";","import icons from '../../assets/icons.svg'\n\nconst Icon = ({ id, ...props}) => (\n  <svg {...props}>\n    <use href={`${icons}#${id}`} />\n  </svg>\n)\n\nexport default Icon\n","export default __webpack_public_path__ + \"static/media/brand_logo_light.cbca2aa6.png\";","import classNames from 'classnames'\nimport BeatLoader from 'react-spinners/BeatLoader'\nimport { Fragment } from 'react'\n\nconst classes = {\n  button: 'font-semibold py-2 px-5 focus:outline-none rounded',\n  disabled: 'opacity-50 cursor-default',\n  contained: 'border border-black bg-black text-white',\n  success: 'border border-grey bg-pantone text-white',\n  outlined: 'border border-black hover:bg-black hover:text-white',\n  link: 'focus:outline-none hover:underline',\n  rounded: 'border rounded-full focus:outline-none border-quickSilver'\n}\n\nconst Button = ({\n  children,\n  className,\n  variant,\n  disabled,\n  isLoading = false,\n  onClick,\n  ...props\n}) => {\n  const handleOnClick = () => {\n    if (!isLoading) {\n      // Check if prop exists\n      if (typeof onClick == 'function') {\n        onClick()\n      }\n    }\n  }\n\n  return (\n    <button\n      className={classNames(\n        { [classes['button']]: variant !== 'link' },\n        { [classes['disabled']]: disabled },\n        { [classes['contained']]: variant === 'contained' },\n        { [classes['success']]: variant === 'success' },\n        { [classes['outlined']]: variant === 'outlined' },\n        { [classes['link']]: variant === 'link' },\n        { [classes['rounded']]: variant === 'rounded' },\n        { 'text-md': !className?.includes('text') },\n        className\n      )}\n      disabled={disabled}\n      onClick={handleOnClick}\n      {...props}\n    >\n      {isLoading ? (\n        <BeatLoader\n          size={7}\n          color={variant === 'contained' ? 'white' : 'green'}\n        />\n      ) : (\n        <>{children}</>\n      )}\n    </button>\n  )\n}\nexport default Button\n","import { Link, useHistory } from 'react-router-dom'\nimport { routes } from '../../router'\nimport classNames from 'classnames'\nimport Icon from '../Icon'\nimport brand_logo_light from '../../assets/images/brand_logo_light.png'\nimport { useEffect, useRef, useState } from 'react'\nimport Button from '../Button'\nimport firebase from 'firebase/app'\nimport { useQueryClient } from 'react-query'\n\nconst AppBar = ({ selectedIndex, state }) => {\n  const [isVisible, setVisible] = useState(false)\n  const navItems = [\n    { text: 'Portal', path: routes.root },\n    { text: 'Marketplace', path: routes.marketplace },\n    { text: 'Messages', path: routes.messages },\n  ]\n  const history = useHistory()\n  const profileRef = useRef()\n  const queryClient = useQueryClient()\n\n  const handleProfileClick = () => setVisible(isVisible => !isVisible)\n\n  const handleClickOutside = event => {\n    if (profileRef.current && !profileRef.current.contains(event.target))\n      setVisible(false)\n  }\n\n  const handleLogout = async () => {\n    firebase.auth().signOut().then(() => {\n      console.log('logged out')\n      localStorage.clear()\n      queryClient.clear()\n      history.push(routes.root)\n    })\n  }\n\n  const handleSettings = () => {\n    history.push(routes.settings)\n  }\n\n  useEffect(() => {\n    document.addEventListener('click', handleClickOutside)\n\n    return () => document.removeEventListener('click', handleClickOutside)\n  }, [])\n\n  return (\n    <div className=\"flex items-center justify-between px-6 py-5 border-b border-platinum\">\n      <nav className=\"flex\">\n        <Link to=\"/\">\n          <img className=\"w-14\" src={brand_logo_light} alt=\"Date Logo\" />\n        </Link>\n        <ul className=\"flex items-center\">\n          {navItems.map((navItem, index) => (\n            <li key={index} className=\"ml-4 first:ml-8\">\n              <Link\n                className={classNames({ 'font-bold': index === selectedIndex })}\n                to={{ pathname: navItem.path, state }}\n              >\n                {navItem.text}\n              </Link>\n            </li>\n          ))}\n        </ul>\n      </nav>\n      <div ref={profileRef} className=\"relative\">\n        <button className=\"flex items-center py-1 pl-2 pr-1 border rounded-full focus:outline-none border-quickSilver\" onClick={handleProfileClick}>\n          <Icon className=\"w-4 h-4 text-black fill-current\" id=\"profile_menu\" />\n          <div className=\"p-2 ml-2 bg-black rounded-full\">\n            <Icon className=\"w-3 h-3 text-white fill-current\" id=\"profile\" />\n          </div>\n        </button>\n        {isVisible && <div className=\"absolute right-0 w-32 p-3 mt-1 bg-white border rounded shadow-md\">\n          <ul className=\"text-center\">\n            <Button className=\"whitespace-nowrap\" variant=\"link\" onClick={handleLogout}>Log out</Button>\n            <Button className=\"whitespace-nowrap\" variant=\"link\" onClick={handleSettings}>Settings</Button>\n          </ul>\n        </div>}\n      </div>\n    </div>\n  )\n}\n\nexport default AppBar\n","import api from './api'\n\nexport const getConversationsByLoan = async loanId => {\n  const data = await api().get(`loanpool/conversations/${loanId}`)\n  return data.data\n}\n\nexport const getConversationsByUser = async email => {\n  const data = await api().get(`loanpool/conversations/user/${email}`)\n  return data.data\n}\n\nexport const getMessages = async sid => {\n  const data = await api().get(\n    `chat/messages/${sid}`\n  )\n  return data.data.data\n}\n\nexport const createConversation = async buyerInfo => {\n  const data = await api().put(`loanpool/conversation`, buyerInfo)\n  return data.data\n}\n\nexport const getToken = async username => {\n  const data = await api().post('chat/conversations/token', { username })\n  return data.data\n}\n","// import { useLocalStorage } from './hooks/useLocalStorage'\nimport { getProposedBuyers } from './loanPools'\nimport api from './api'\nimport { getUserByEmail } from './loanPools'\nimport { getConversationsByUser } from './conversations'\n\nexport const cleanUrlParams = () => {\n  // https://stackoverflow.com/a/66739808/4032361\n  var currURL = window.location.href\n  var url = currURL.split(window.location.host)[1].split('?')[0]\n  window.history.replaceState({}, document.title, url)\n}\n\nexport const getBuyer = async (id, locationStateEntity) => {\n  const res = await getProposedBuyers(id)\n  let result\n  if (res.buyer) {\n    // Contract signed\n    result = res.buyer\n  } else {\n    try {\n      const filtered = res?.proposedBuyers.filter(\n        b => b.entity.toLowerCase() === locationStateEntity.toLowerCase()\n      )\n      result = filtered[0]\n    } catch (e) {\n      console.log('getBuyer: ', e)\n    }\n  }\n  return result\n}\n\nexport const getParticipantsAvatars = (participants) => {\n  participants.forEach(async item => {\n    const link = JSON.parse(item.attributes).avatar\n    const avatar = await api().get(link, {\n      responseType: 'blob'\n    })\n    let blob = URL.createObjectURL(avatar.data)\n    localStorage.setItem(item.identity, JSON.stringify(blob))\n  })\n}\n\nexport const getImage = async (profile) => {\n   try {\n    const link = profile.image\n    const avatar = await api().get(link, {\n      responseType: 'blob'\n    })\n    let blob = URL.createObjectURL(avatar.data)\n    localStorage.setItem(profile.email, JSON.stringify(blob))\n    } catch(e) {\n      console.log('e: ', e);\n    }\n}\n\nexport const initConversations = async (\n  loanPool,\n  email,\n  entity,\n  setBuyer,\n  createConversation,\n  setCurrentSid,\n  location,\n  countersigner,\n  esignConvSid\n) => {\n  const isOwner = email === loanPool?.owner?.email\n  let signedUser = null\n  if (isOwner) {\n    try {\n      signedUser = await getBuyer(loanPool.id, location.state?.entity)\n    } catch (e) {\n      console.log('signedUser error: ', e)\n    }\n  }\n\n  const currentBuyer = () => {\n    if (countersigner) {\n      return countersigner\n    }\n    return signedUser ? signedUser.email : location.state?.email\n  }\n\n  const currentChat = () => {\n    if (esignConvSid) {\n      return esignConvSid\n    }\n\n    if (location.state?.conversationSid) {\n      return location.state?.conversationSid\n    }\n  }\n\n  // From callbackurl, portal or left panel chat\n  let existingConversationSid = currentChat()\n\n  if (!existingConversationSid) {\n    try {\n      const convByUser = await getConversationsByUser(currentBuyer())\n      const result = convByUser.find(item => item.loanId === loanPool.id)\n      existingConversationSid = result.conversationSid\n    } catch (e) {\n      console.log('convByUser e:', e)\n    }\n  }\n\n  if (isOwner) {\n    const user = await getUserByEmail(currentBuyer())\n    setBuyer(user)\n  }\n\n  const participants = await createConversation({\n    loanId: loanPool.id,\n    email,\n    entity,\n    conversationSid: existingConversationSid\n  })\n  // getParticipantsAvatars(participants)\n  setCurrentSid(participants[0].conversationSid)\n}\n\n// conversations: [\n// {\n//   loanId: \"31\"\n//   conversationSid: \"23423\"\n//   buyer: [{email: \"\", entity: \"\"}, {email: \"\", entity: \"\"}, ...],\n//   seller: [{email: \"\", entity: \"\"}, {email: \"\", entity: \"\"}, ...]\n// },\n// {\n//   loanId: \"31\"\n//   conversationSid: \"12312\"\n//   buyer: [{email: \"\", entity: \"\"}, {email: \"\", entity: \"\"}, ...],\n//   seller: [{email: \"\", entity: \"\"}, {email: \"\", entity: \"\"}, ...],\n// }\n// ]\n\nexport const getCounterpartyFromSid = (loan, email, conversationSid) => {\n  let profile = null\n  if (loan.conversations && loan.owner.email === email) {\n    profile = loan.conversations?.find(item => item.conversationSid === conversationSid)?.buyer?.[0]\n  } else if (loan.conversations) {\n    profile = loan.conversations?.find(item => item.conversationSid === conversationSid)?.seller?.[0] || loan.owner\n  }\n  return profile\n}\n\nexport const getConvCounterparty = (loan, email) => {\n  let profile = null\n  if (loan.conversations && loan.owner.email === email) {\n    profile = loan.conversations[0]?.buyer?.[0]\n  } else if (loan.conversations) {\n    profile = loan.conversations[0]?.seller?.[0] || loan.owner\n  }\n  return profile\n}\n","import { routes } from '../../router'\nimport { Link } from 'react-router-dom'\nimport Button from '../../components/Button'\nimport Icon from '../../components/Icon'\nimport { useState } from 'react'\nimport { getConvCounterparty } from '../../data/utils'\n\nconst MarketplaceActivities = ({ isLoading, data }) => {\n  const [currentIdx, setCurrentIdx] = useState(0)\n  const { email, entity } = JSON.parse(localStorage.getItem('user'))\n  const limit = 5\n  const loanPools = data?.loanPools?.filter(\n    loan =>\n      (loan.conversations || loan.owner.email.includes(email)) &&\n      (loan.status.includes('not started') ||\n        loan.status.includes('in progress') ||\n        loan.status.includes('in draft'))\n  )\n\n  const handleNextClick = () => {\n    setCurrentIdx(currentIdx => currentIdx + limit)\n  }\n\n  const handlePrevClick = () => {\n    setCurrentIdx(currentIdx => currentIdx - limit)\n  }\n\n  return (\n    <div className=\"p-8 my-6 border shadow-md\">\n      <div className=\"flex items-center justify-between\">\n        <h2 className=\"text-xl font-bold text-pantone\">\n          Marketplace Activities\n        </h2>\n        <div className=\"flex items-center\">\n          <p className=\"mr-6\">\n            Showing{' '}\n            <span className=\"font-bold\">\n              {loanPools?.length > 0 ? currentIdx + 1 : 0}-\n              {loanPools?.length >= currentIdx + limit\n                ? currentIdx + limit\n                : loanPools?.length}\n            </span>{' '}\n            from {loanPools?.length} activities\n          </p>\n          <div className=\"space-x-2\">\n            <Button\n              className=\"underline\"\n              variant=\"link\"\n              onClick={handlePrevClick}\n              disabled={currentIdx === 0}\n            >\n              Prev\n            </Button>\n            <Button\n              className=\"underline\"\n              variant=\"link\"\n              onClick={handleNextClick}\n              disabled={currentIdx + limit >= loanPools?.length}\n            >\n              Next\n            </Button>\n          </div>\n        </div>\n      </div>\n      {isLoading ? (\n        <p className=\"mt-8\">Loading...</p>\n      ) : (\n        <table className=\"w-full mt-8\">\n          <thead>\n            <tr className=\"pb-3 border-b border-platinum\">\n              <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n                Transaction\n              </th>\n              <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n                Counter Party\n              </th>\n              <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n                {entity.split(' ').map(word => word.charAt(0).toUpperCase())}{' '}\n                Listing\n              </th>\n              <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n                Listing Type\n              </th>\n              <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n                Status\n              </th>\n            </tr>\n          </thead>\n          <tbody>\n            {loanPools &&\n              loanPools\n                .slice(currentIdx, currentIdx + limit)\n                .map((loan, index) => {\n                  const profile = getConvCounterparty(loan, email)\n\n                  const profileWithName = {\n                    name: profile?.displayName,\n                    ...profile\n                  }\n\n                  return (\n                    <tr key={index} className=\"border-b border-platinum\">\n                      <td className=\"py-6 text-sm font-bold\">\n                        <Link\n                          className=\"font-bold underline text-md\"\n                          to={\n                            loan.status === 'in draft'\n                              ? { pathname: routes.upload, state: loan }\n                              : {\n                                  pathname: `${routes.detail}/${loan.id}`,\n                                  state: profileWithName\n                                }\n                          }\n                        >\n                          {loan.title}\n                        </Link>\n                      </td>\n                      <td className=\"py-6 text-sm\">\n                        <Link\n                          className=\"font-bold underline text-md\"\n                          to={`${routes.profile}/${profile?.entity}`}\n                        >\n                          {profile?.entity}\n                        </Link>\n                      </td>\n                      <td className=\"py-6 text-sm\">\n                        {email === loan.owner.email ? 'Yes' : 'No'}\n                      </td>\n                      <td className=\"py-6 text-sm\">{loan.listType}</td>\n                      {!loan.status.includes('in progress') ? (\n                        <td className=\"py-6 text-sm\">\n                          {loan.conversations ? 'messaging' : loan.status}\n                        </td>\n                      ) : (\n                        <td className=\"flex items-center py-6 text-sm\">\n                          <Icon\n                            className=\"w-4 h-4 mr-1\"\n                            id={loan.status.replace(' ', '_').toLowerCase()}\n                          />\n                          {loan.status}\n                        </td>\n                      )}\n                    </tr>\n                  )\n                })}\n          </tbody>\n        </table>\n      )}\n    </div>\n  )\n}\n\nexport default MarketplaceActivities\n","import { Link } from 'react-router-dom'\nimport { routes } from '../../router'\nimport { getConvCounterparty } from '../../data/utils'\n\nconst Table = ({ loanPools }) => {\n  const { email } = JSON.parse(localStorage.getItem('user'))\n  return (\n    <table className=\"w-full mt-8\">\n      <thead>\n        <tr className=\"pb-3 border-b border-platinum\">\n          <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n            Transaction\n          </th>\n          <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n            Counter Party\n          </th>\n          <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n            Status\n          </th>\n        </tr>\n      </thead>\n      <tbody>\n        {loanPools?.map((loan, index) => {\n          const profile = getConvCounterparty(loan, email)\n          return (\n          <tr key={index} className=\"border-b border-platinum\">\n            <td className=\"py-6 text-sm font-bold\">\n              <Link\n                className=\"font-bold underline text-md\"\n                to={`${routes.dealroom}/${loan.id}`}\n              >\n                {loan.title}\n              </Link>\n            </td>\n            <td className=\"py-6 text-sm\">\n              <Link\n                className=\"font-bold underline text-md\"\n                to={`${routes.profile}/${profile?.entity}`}\n              >\n                {profile?.entity}\n              </Link>\n            </td>\n            <td className=\"py-6 text-sm\">\n              {loan.status.includes('pending')\n                ? 'LOI Signed'\n                : loan.status.includes('sold')\n                ? 'Contract Signed'\n                : loan.status.includes('completed')\n                ? 'Completed'\n                : loan.status.includes('in contract')\n                ? 'In Contract'\n                : null}\n            </td>\n          </tr>\n        )})}\n      </tbody>\n    </table>\n  )\n}\n\nexport default Table\n","import { useState } from 'react'\nimport { Tab, Tabs, TabList, TabPanel } from 'react-tabs'\nimport Button from '../../components/Button'\nimport Table from './Table'\n\nconst DealRoom = ({\n  isLoading,\n  data,\n  tabIndex,\n  setTabIndex,\n  email,\n}) => {\n  const [showAll, setShowAll] = useState(false)\n\n  const handleClick = () => setShowAll(showAll => !showAll)\n\n  return (\n    <div className=\"p-8 my-6 border shadow-md col-span-4\">\n      <div className=\"flex items-center justify-between\">\n        <h2 className=\"text-xl font-bold text-pantone\">Deal Room</h2>\n        <div className=\"flex items-center\">\n          <Button className=\"underline\" variant=\"link\" onClick={handleClick}>\n            {showAll ? 'Show less' : 'View all'}\n          </Button>\n        </div>\n      </div>\n      {isLoading ? (\n        <p className=\"mt-8\">Loading...</p>\n      ) : showAll ? (\n        <Table loanPools={data} email={email} />\n      ) : (\n        <Tabs\n          className=\"mt-8\"\n          selectedIndex={tabIndex}\n          onSelect={index => setTabIndex(index)}\n        >\n          <TabList className=\"flex\">\n            <Tab\n              className={`flex-1 font-bold text-center text-md pb-4 cursor-pointer ${\n                tabIndex === 0\n                  ? 'text-pantone border-b-4 border-pantone'\n                  : 'text-quickSilver'\n              }`}\n            >\n              Buy\n            </Tab>\n            <Tab\n              className={`flex-1 font-bold text-center text-md cursor-pointer pb-4 ${\n                tabIndex === 1\n                  ? 'text-pantone border-b-4 border-pantone'\n                  : 'text-quickSilver'\n              }`}\n            >\n              Sell\n            </Tab>\n          </TabList>\n          <TabPanel>\n            <Table\n              loanPools={data?.filter(\n                loan => !loan.owner.email.includes(email)\n              )}\n              email={email}\n            />\n          </TabPanel>\n          <TabPanel>\n            <Table\n              loanPools={data?.filter(loan => loan.owner.email.includes(email))}\n              email={email}\n            />\n          </TabPanel>\n        </Tabs>\n      )}\n    </div>\n  )\n}\n\nexport default DealRoom\n","import { useQuery } from 'react-query'\nimport { getLoanPools } from '../../data/loanPools'\nimport { routes } from '../../router'\nimport { Link } from 'react-router-dom'\nimport Button from '../../components/Button'\nimport { getConvCounterparty } from '../../data/utils'\n\nconst History = () => {\n  const { isLoading, error, data } = useQuery('loanpools', getLoanPools)\n  const { email } = JSON.parse(localStorage.getItem('user'))\n\n  if (error) return error.message\n\n  const limit = 5\n  const loanPools = data?.loanPools?.filter(\n    loan => loan.status.includes('sold') || loan.status.includes('completed')\n  )\n\n  return (\n    <div className=\"p-8 my-6 border shadow-md col-span-3\">\n      <div className=\"flex items-center justify-between\">\n        <h2 className=\"text-xl font-bold text-pantone\">History</h2>\n        <div className=\"flex items-center\">\n          <Button className=\"underline\" variant=\"link\">\n            View all\n          </Button>\n        </div>\n      </div>\n      {isLoading ? (\n        <p className=\"mt-8\">Loading...</p>\n      ) : (\n        <table className=\"w-full mt-8\">\n          <thead>\n            <tr className=\"pb-3 border-b border-platinum\">\n              <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n                Transaction\n              </th>\n              <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n                Counter Party\n              </th>\n              <th className=\"pb-3 text-xs font-bold text-left uppercase text-onyx whitespace-nowrap\">\n                Final Status\n              </th>\n            </tr>\n          </thead>\n          <tbody>\n            {loanPools?.slice(0, limit).map((loan, index) => {\n              const profile = getConvCounterparty(loan, email)\n              return (\n              <tr key={index} className=\"border-b border-platinum\">\n                <td className=\"py-6 text-sm font-bold\">\n                  <Link\n                    className=\"font-bold underline text-md\"\n                    to={`${routes.detail}/${loan.id}`}\n                  >\n                    {loan.title}\n                  </Link>\n                </td>\n                <td className=\"py-6 text-sm\">\n                  <Link\n                    className=\"font-bold underline text-md\"\n                    to={`${routes.profile}/${profile?.entity}`}\n                  >\n                    {profile?.entity}\n                  </Link>\n                </td>\n                <td className=\"flex py-6 text-sm\">{loan.listType}</td>\n              </tr>\n            )})}\n          </tbody>\n        </table>\n      )}\n    </div>\n  )\n}\n\nexport default History\n","import { useEffect, useState } from 'react'\nimport { useQuery } from 'react-query'\nimport { getLoanPools } from '../../data/loanPools'\nimport AppBar from '../../components/AppBar'\nimport MarketplaceActivities from './MarketplaceActivities'\nimport DealRoom from './DealRoom'\nimport Button from '../../components/Button'\nimport History from './History'\nimport { useHistory } from 'react-router-dom'\nimport { getActiveDeals } from '../../data/loanPools'\n\nconst Portal = () => {\n  const { isLoading, error, data, isSuccess } = useQuery('loanpools', () => getLoanPools)\n  const { email, entity } = JSON.parse(localStorage.getItem('user'))\n  const [tabIndex, setTabIndex] = useState(0)\n  const [activeDeals, setActiveDeals] = useState([])\n  const history = useHistory()\n\n  const dealroomData = data?.loanPools?.filter(\n    loanPool =>\n      (loanPool.status.includes('pending') ||\n        loanPool.status.includes('sold') ||\n        loanPool.status.includes('in contract') ||\n        loanPool.status.includes('completed')) &&\n      loanPool.conversations\n  )\n\n  useEffect(() => {\n    const retrieveActiveDeals = async () => {\n      try {\n        const res = await getActiveDeals(email)\n        setActiveDeals(res?.deals)\n      } catch (e) {\n        console.log(e)\n      }\n    }\n    retrieveActiveDeals()\n  }, [entity, email])\n\n  useEffect(() => {\n    if (activeDeals) {\n      const latest = activeDeals.sort(\n        (a, b) => Date.parse(b.lastUpdated?.replace(' ', '')) - Date.parse(a.lastUpdated?.replace(' ', ''))\n      )[0]\n      if (latest?.dealRole === 'buyer') {\n        setTabIndex(0)\n      } else if (latest?.dealRole === 'seller') {\n        setTabIndex(1)\n      }\n    }\n  }, [activeDeals])\n\n  return (\n    <div>\n      <AppBar selectedIndex={0} />\n      <div className=\"px-12 my-6\">\n        <div className=\"container min-h-screen py-8 mx-auto\">\n          <div className=\"flex items-center justify-between mb-5\">\n            <h1 className=\"text-3xl font-bold align-middle text-eerie\">\n              {entity}\n            </h1>\n            <span>\n              <Button\n                onClick={() => history.push('/upload')}\n                className=\"ml-8\"\n                variant=\"contained\"\n              >\n                Create marketplace listing\n              </Button>\n            </span>\n          </div>\n          <MarketplaceActivities\n            isLoading={isLoading}\n            error={error}\n            data={data}\n          />\n          <div className=\"grid grid-cols-7 gap-x-6\">\n            <DealRoom\n              isSuccess={isSuccess}\n              isLoading={isLoading}\n              error={error}\n              data={dealroomData}\n              tabIndex={tabIndex}\n              setTabIndex={setTabIndex}\n              email={email}\n            />\n            <History />\n          </div>\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default Portal\n","export default __webpack_public_path__ + \"static/media/brand_logo.380025ae.svg\";","export default __webpack_public_path__ + \"static/media/logo.caedf520.svg\";","import { useHistory, Link } from 'react-router-dom'\nimport { useForm } from 'react-hook-form'\nimport { routes } from '../../router'\nimport Button from '../../components/Button'\nimport brand_logo from '../../assets/images/brand_logo.svg'\nimport logo from '../../assets/images/logo.svg'\nimport { app } from '../../data/firebaseConfig'\n\nconst styles = {\n  label: {\n    top: '8px',\n    left: '16px'\n  }\n}\n\nconst Login = () => {\n  const { register, watch, handleSubmit } = useForm()\n  const history = useHistory()\n\n  const handleSignInSubmit = async ({ email, password }) => {\n    const { user } = await app\n      .auth()\n      .signInWithEmailAndPassword(email, password)\n    if (!user) return\n    const authToken = await user.getIdToken()\n    console.log('authToken: ', authToken);\n    const { claims } = await app.auth().currentUser.getIdTokenResult()\n    localStorage.setItem(\n      'user',\n      JSON.stringify({\n        email: email.toLowerCase(),\n        authToken,\n        entity: claims.entity\n      })\n    )\n    if (user) history.push(routes.root)\n  }\n\n  return (\n    <div className=\"flex flex-col items-center justify-center min-h-screen bg-cover bg-login\">\n      <div className=\"flex flex-col\">\n        <img\n          src={brand_logo}\n          alt=\"PN logo\"\n          className=\"inline-block w-48 mb-8\"\n          />\n        <img\n          src={logo}\n          alt=\"Date logo\"\n          className=\"inline-block w-48 mb-8\"\n          />\n      </div>\n      <form\n        name=\"loginForm\"\n        className=\"w-2/5 p-6 bg-white rounded-lg\"\n        onSubmit={handleSubmit(handleSignInSubmit)}\n      >\n        <div className=\"relative\">\n          <label\n            className=\"absolute text-sm text-quickSilver\"\n            style={styles.label}\n          >\n            Email\n          </label>\n          <input\n            name=\"email\"\n            type=\"email\"\n            className=\"w-full px-4 pb-2 border rounded-lg rounded-bl-none rounded-br-none pt-7 border-quickSilver focus:outline-none text-md\"\n            {...register('email')}\n            />\n        </div>\n        <div className=\"relative\">\n          <label\n            className=\"absolute text-sm text-quickSilver\"\n            style={styles.label}\n          >\n            Password\n          </label>\n          <input\n            name=\"password\"\n            type=\"password\"\n            className=\"w-full px-4 pb-2 border border-t-0 rounded-lg rounded-tl-none rounded-tr-none pt-7 border-quickSilver focus:outline-none text-md\"\n            {...register('password')}\n            />\n        </div>\n        <Button\n          id=\"loginBtn\"\n          className=\"w-full mt-4 bg-quickSilver\"\n          type=\"submit\"\n          disabled={!watch().email || !watch().password}\n        >\n          Continue\n        </Button>\n        <div className=\"flex items-center mt-3\">\n          <div className=\"flex-1 border-b border-quickSilver\" />\n          <span className=\"mx-4 text-sm text-quickSilver\">or</span>\n          <div className=\"flex-1 border-b border-quickSilver\" />\n        </div>\n        <p className=\"mt-4 text-sm\">\n          Don't have an account?{' '}\n          <Link className=\"underline\" to=\"/signup\">\n          Sign up\n          </Link>\n        </p>\n      </form>\n    </div>\n  )\n}\n\nexport default Login\n","import api from './api'\n\nexport const uploadDoc = async (loanId, formData) => {\n  const data = await api().post(`loanpool/pool/${loanId}/uploadDoc`, formData, {\n    headers: { 'Content-Type': 'multipart/form-data' }\n  })\n  return data.data\n}\n\nexport const uploadContract = async (loanId, formData) => {\n  formData.append('name', 'contract')\n  formData.append('accessType', 'due diligence')\n  const data = await api().put(`loanpool/pool/${loanId}/contract`, formData, {\n    headers: { 'Content-Type': 'multipart/form-data' }\n  })\n  return data.data\n}\n\nexport const getAllDocNames = async loanId => {\n  const data = await api().get(`loanpool/pool/${loanId}/allDocNames`)\n  return data.data\n}\n\nexport const getDoc = async (loanId, docName) => {\n  const data = await api().get(`loanpool/pool/${loanId}/getDoc/${docName}`, {\n    responseType: 'blob',\n    responseEncoding: 'binary'\n  })\n  return data.data\n}\n\nexport const getContract = async (loanId) => {\n  const data = await api().get(`loanpool/pool/${loanId}/contract`)\n  return data.data\n}\n\nexport const getThumbnail = async (loanId, docName) => {\n  const data = await api().get(`loanpool/pool/${loanId}/thumbnail/${docName}`, {\n    responseType: 'blob'\n  })\n  return data.data\n}\n\nexport const restoreDoc = async (loanId, docInfo) => {\n// version is the desired version\n// { \"docName\": \"string\", \"version\": \"string\" }\n  const data = await api().put(`/loanpool/pool/${loanId}/restoreDoc`, docInfo)\n  return data.data\n}\n\nexport const getDocthumbnail = async (loanId, docName) => {\n  const data = await api().get(\n    `loanpool/pool/${loanId}/docthumbnail/${docName}`\n  )\n  return data.data\n}\n\nexport const customizeDoc = async data => {\n  const response = await api().post('/loanpool/customize/doc', data, {\n    responseType: 'blob',\n    responseEncoding: 'binary'\n  })\n  return response.data\n}\n\nexport const getClickWrap = async data => {\n  const response = await api().post('docusign/clickwrap', data, {\n    headers: { 'Content-Type': 'multipart/form-data' }\n  })\n  return response.data\n}\n\nexport const getESign = async data => {\n  const response = await api().post('docusign/esign', data, {\n    headers: { 'Content-Type': 'multipart/form-data' }\n  })\n  return response.data\n}\n\nexport const getDocEsign = async (id, filename) => {\n  const response = await api().get(`/docusign/esign/${id}/${filename}`, {\n    responseType: 'blob',\n    responseEncoding: 'binary'\n  })\n  return response.data\n}\n","import { ComposableMap, Geographies, Geography } from 'react-simple-maps'\nimport geography from './geography.json'\nimport states from './states.json'\n\nconst Mapchart = ({ statesInfo }) => {\n  return (\n    <ComposableMap projection=\"geoAlbersUsa\">\n      <Geographies geography={geography}>\n        {({ geographies }) => (\n          <>\n            {geographies.map(geo => {\n              const stateInfo = statesInfo?.find(\n                stateInfo => states[stateInfo.state].id === geo.id\n              )\n              return (\n                <Geography\n                  key={geo.rsmKey}\n                  stroke=\"white\"\n                  fill={\n                    stateInfo?.percentLoan > 0\n                      ? `rgba(68, 183, 87, ${stateInfo.percentLoan / 100})`\n                      : stateInfo\n                      ? '#A7A7A7'\n                      : '#EAEAED'\n                  }\n                  geography={geo}\n                />\n              )\n            })}\n          </>\n        )}\n      </Geographies>\n    </ComposableMap>\n  )\n}\n\nexport default Mapchart\n","const modalStyles = {\n  overlay: {\n    backgroundColor: 'rgba(0, 0, 0, 0.7)'\n  },\n  content: {\n    top: '50%',\n    left: '50%',\n    right: 'auto',\n    bottom: 'auto',\n    marginRight: '-50%',\n    transform: 'translate(-50%, -50%)',\n    borderRadius: 12\n  }\n}\n\nexport default modalStyles\n","import { useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { updateLoanPool } from '../../data/loanPools'\nimport { getAllDocNames, getDoc } from '../../data/documents'\nimport { routes } from '../../router'\nimport classNames from 'classnames'\nimport numeral from 'numeral'\nimport Modal from 'react-modal'\nimport Button from '../Button'\nimport Icon from '../Icon'\nimport Mapchart from '../Mapchart'\nimport modalStyles from '../../assets/styles/modalStyles'\nimport toaster from 'react-hot-toast'\n\nModal.setAppElement('#root')\n\nconst LoanCard = ({ children, loanPool, className, footer = true, isOwner }) => {\n  const [bookmark, setBookmark] = useState(loanPool.bookmark)\n  const [isModalOpen, setModalOpen] = useState(false)\n  const [brochure, setBrochure] = useState(null)\n  const history = useHistory()\n\n  const handleMessage = () => {\n    history.push(`${routes.detail}/${loanPool.id}`)\n  }\n\n  const handleBookmark = async () => {\n    await updateLoanPool({ ...loanPool, bookmark: !loanPool.bookmark })\n    setBookmark(bookmark => !bookmark)\n  }\n\n  const handleBrochureMessage = async () => {\n    try {\n      const docNames = await getAllDocNames(loanPool.id)\n      const brochure = await getDoc(\n        loanPool.id,\n        docNames.filter(doc => doc.description.includes('brochure'))[0].name\n      )\n      const blob = URL.createObjectURL(brochure)\n      setBrochure(blob)\n      setModalOpen(true)\n    } catch (err) {\n      toaster.error(err.response.data.message)\n    }\n  }\n\n  return (\n    <>\n      <div\n        className={classNames(\n          'flex flex-col justify-between p-6 border shadow-lg min-w-loan-card max-w-loan-card',\n          className\n        )}\n      >\n        <div>\n          <header>\n            <div className=\"flex justify-between\">\n              <h1 className=\"text-2xl font-bold\">{loanPool.title}</h1>\n              <button className=\"focus:outline-none\" onClick={handleBookmark}>\n                <Icon\n                  className=\"w-5 h-5\"\n                  id={bookmark ? 'bookmark_filled' : 'bookmark'}\n                />\n              </button>\n            </div>\n            <p className=\"pt-3 text-md\">\n              Originated by{' '}\n              <a className=\"underline\" href=\"/#\">\n                {loanPool.owner?.displayName}\n              </a>\n            </p>\n            <p className=\"pt-4 text-md\">{loanPool.description}</p>\n          </header>\n          <section>\n            <ul className=\"flex justify-around pt-5 pb-2 text-center\">\n              <li id=\"listType\" className=\"flex items-center px-3 py-2 text-sm rounded-full bg-cultured\">\n                {loanPool.listType}\n              </li>\n              <li id=\"loanClass\" className=\"flex items-center px-3 py-2 ml-3 text-sm rounded-full bg-cultured\">\n                {loanPool.loanType?.loanClass}\n              </li>\n              <li id=\"loanType\" className=\"flex items-center px-3 py-2 ml-3 text-sm rounded-full bg-cultured\">\n                {loanPool.loanType?.type}\n              </li>\n            </ul>\n          </section>\n          <section className=\"mb-3\">\n            <ul className=\"flex flex-wrap justify-around m-2 text-center\">\n              {loanPool.productTags?.map((tag, index) => (\n              <li\n                key={'tag-'+index}\n                id=\"productTags\"\n                className=\"flex items-center text-sm\">\n                <span>\n                  <Icon\n                    className=\"w-3 h-3\"\n                    id='tag'\n                  />\n                </span>\n                <span className=\"ml-1\">\n                  {tag}\n                </span>\n              </li>\n              ))}\n            </ul>\n          </section>\n          <section className=\"flex px-6 py-4\">\n            <Mapchart statesInfo={loanPool.statesInfo} />\n            <table className=\"ml-5\">\n              <thead>\n                <tr className=\"text-left\">\n                  <th className=\"text-sm font-normal\">States</th>\n                  <th className=\"text-sm font-normal\">Compositions</th>\n                </tr>\n              </thead>\n              <tbody>\n                {loanPool.statesInfo\n                  ?.sort((a, b) => a.percentLoan - b.percentLoan)\n                  .reverse()\n                  .map((state, index) => (\n                    <tr key={index}>\n                      <td className=\"text-sm\">{state.state}</td>\n                      <td className=\"text-sm text-right\">\n                        {state.percentLoan} %\n                      </td>\n                    </tr>\n                  ))}\n              </tbody>\n            </table>\n          </section>\n          <section className=\"mb-6\">\n            <ul>\n              {loanPool.generalInfo?.currentBalance && (\n              <li className=\"flex justify-between py-2 border-b text-md\">\n                <span>Current Balance</span>\n                <span>\n                  {numeral(loanPool.generalInfo?.currentBalance).format(\n                    '$ 0,0'\n                  )}\n                </span>\n              </li>\n              )}\n              {loanPool.generalInfo?.originalBalance && (\n              <li className=\"flex justify-between py-2 border-b text-md\">\n                <span>Original Balance</span>\n                <span>\n                  {numeral(loanPool.generalInfo?.originalBalance).format(\n                    '$ 0,0'\n                  )}\n                </span>\n              </li>\n              )}\n              {loanPool.generalInfo?.grossWAC && ( \n              <li className=\"flex justify-between py-2 border-b text-md\">\n                <span>Gross WAC</span>\n                <span>\n                  {numeral(loanPool.generalInfo?.grossWAC / 100).format(\n                    '0.00 %'\n                  )}\n                </span>\n              </li>\n              )}\n              {loanPool.generalInfo?.price && ( \n              <li className=\"flex justify-between py-2 border-b text-md\">\n                <span>Price</span>\n                  <span>\n                    {numeral(loanPool.generalInfo?.price).format('0,0.000')}\n                  </span>\n              </li>\n              )}\n              {Number(loanPool.generalInfo?.sellerRetainedPercent) !== 0 && (\n              <li className=\"flex justify-between py-2 border-b text-md\">\n                <span>Seller Retained</span>\n                <span>\n                  {numeral(\n                    loanPool.generalInfo?.sellerRetainedPercent / 100\n                  ).format('0 %')}\n                </span>\n              </li>\n              )}\n              {loanPool.generalInfo?.serviceFee && ( \n              <li className=\"flex justify-between py-2 border-b text-md\">\n                <span>Service Fee</span>\n                <span>{loanPool.generalInfo?.serviceFee}</span>\n              </li>\n              )}\n              {loanPool.generalInfo?.waBalance && ( \n              <li className=\"flex justify-between py-2 border-b text-md\">\n                <span>WA Balance</span>\n                <span>\n                  {numeral(loanPool.generalInfo?.waBalance).format('$ 0,0')}\n                </span>\n              </li>\n              )}\n              {loanPool.loanType?.waCreditScore && (\n                <li className=\"flex justify-between py-2 border-b text-md\">\n                  <span>WA Credit Score</span>\n                  <span>\n                    {numeral(loanPool.loanType?.waCreditScore).format('0,0.0')}\n                  </span>\n                </li>\n              )}\n              {loanPool.loanType?.waDebtToIncome && (\n                <li className=\"flex justify-between py-2 border-b text-md\">\n                  <span>WA Debt To Income</span>\n                  <span>\n                    {numeral(loanPool.loanType?.waDebtToIncome).format('0,0.0')}\n                  </span>\n                </li>\n              )}\n              {loanPool.loanType?.waLTV && (\n                <li className=\"flex justify-between py-2 border-b text-md\">\n                  <span>WA Loan To Value</span>\n                  <span>\n                    {numeral(loanPool.loanType?.waLTV).format('0,0.0')}\n                  </span>\n                </li>\n              )}\n              {loanPool.loanType?.waCLTV && (\n                <li className=\"flex justify-between py-2 border-b text-md\">\n                  <span>WA Combined Loan To Value</span>\n                  <span>\n                    {numeral(loanPool.loanType?.waCLTV).format('0,0.0')}\n                  </span>\n                </li>\n              )}\n              {loanPool.generalInfo?.count && (\n              <li className=\"flex justify-between py-2 border-b text-md\">\n                <span>Count</span>\n                <span>{loanPool.generalInfo?.count}</span>\n              </li>\n              )}\n            </ul>\n          </section>\n        </div>\n        {footer && (\n          <footer className=\"flex justify-between\">\n            <Button variant=\"outlined\" onClick={handleBrochureMessage}>\n              View Brochure\n            </Button>\n            <Button variant=\"outlined\" onClick={handleMessage} disabled={isOwner}>\n              Message Seller\n            </Button>\n          </footer>\n        )}\n        {children}\n      </div>\n      <Modal\n        isOpen={isModalOpen}\n        onRequestClose={() => setModalOpen(false)}\n        style={modalStyles}\n      >\n        <iframe\n          src={brochure}\n          width=\"900px\"\n          height=\"700px\"\n        ></iframe>\n      </Modal>\n    </>\n  )\n}\n\nexport default LoanCard\n","const FilterOption = ({ children, checked, value, onValueChange }) => {\n  const handleChange = event => onValueChange(event)\n\n  return (\n    <li className=\"flex items-center py-0.5\">\n      <input\n        className=\"mr-2\"\n        type=\"checkbox\"\n        name={value}\n        id={value}\n        value={value}\n        checked={checked}\n        onChange={handleChange}\n      />\n      <label className=\"text-md whitespace-nowrap\" htmlFor={value}>\n        {children}\n      </label>\n    </li>\n  )\n}\n\nexport default FilterOption\n","import { useState, useRef, useEffect } from 'react'\nimport classNames from 'classnames'\nimport Icon from '../Icon'\nimport Button from '../Button'\nimport FilterOption from '../FilterOption'\nimport loan from '../../data/loan.json'\n\nconst FilterDropdown = ({ text, onFilter, valuesKey, className }) => {\n  const [isVisible, setVisible] = useState(false)\n  const [isClearable, setClearable] = useState(false)\n  const [values, setValues] = useState(\n    Object.keys(loan[valuesKey]).map(value => {\n      return { value, isChecked: false }\n    })\n  )\n  const listContainer = useRef()\n\n  const handleClickOutside = event => {\n    if (listContainer.current && !listContainer.current.contains(event.target))\n      setVisible(false)\n  }\n\n  const handleClick = () => setVisible(isVisible => !isVisible)\n\n  const handleFilterClick = () => {\n    const checkedValues = values\n      .filter(value => value.isChecked)\n      .map(value => value.value)\n    onFilter(valuesKey, checkedValues)\n    setClearable(checkedValues.length > 0)\n  }\n\n  const handleClearClick = () => {\n    onFilter(valuesKey, [])\n    setValues(values =>\n      values.map(value => {\n        return { ...value, isChecked: false }\n      })\n    )\n    setClearable(false)\n  }\n\n  const handleValueChange = event => {\n    setValues(values =>\n      values.map(value => {\n        return value.value === event.target.value\n          ? { ...value, isChecked: event.target.checked }\n          : value\n      })\n    )\n  }\n\n  useEffect(() => {\n    document.addEventListener('click', handleClickOutside)\n\n    return () => document.removeEventListener('click', handleClickOutside)\n  }, [])\n\n  return (\n    <div className={classNames('relative', className)} ref={listContainer}>\n      <button\n        className={classNames(\n          'flex items-center px-4 py-2 border rounded-full focus:outline-none',\n          isVisible ? 'border-black' : 'border-quickSilver',\n          { 'bg-black text-white': isClearable }\n        )}\n        onClick={handleClick}\n      >\n        <span className=\"mr-1.5 text-md\">{text}</span>\n        <Icon\n          id=\"chevron_down\"\n          className={classNames(\n            'w-3 h-3 transform transition-transform duration-150',\n            { 'fill-current text-white': isClearable },\n            {\n              '-rotate-180': isVisible\n            }\n          )}\n        />\n      </button>\n      {isVisible && (\n        <div className=\"absolute p-3 bg-white rounded shadow\">\n          <ul className=\"\">\n            {Object.keys(loan[valuesKey]).sort().map((value, index) => (\n              <FilterOption\n                key={index}\n                value={value}\n                onValueChange={handleValueChange}\n                checked={values.find(v => v.value === value).isChecked}\n              >\n                {loan[valuesKey][value]}\n              </FilterOption>\n            ))}\n          </ul>\n          <hr className=\"my-4\" />\n          <div className=\"flex items-center justify-between\">\n            <Button\n              className=\"mr-8\"\n              variant=\"link\"\n              onClick={handleClearClick}\n              disabled={!isClearable}\n            >\n              Clear\n            </Button>\n            <Button variant=\"contained\" onClick={handleFilterClick}>\n              Apply\n            </Button>\n          </div>\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport default FilterDropdown\n","import Button from '../../components/Button'\nimport FilterDropdown from '../../components/FilterDropdown'\nimport Icon from '../../components/Icon'\nconst FilterBar = ({ onGlobalFilter, onFilter }) => {\n  const handleChange = event => {\n    onGlobalFilter(event.target.value)\n  }\n  return (\n    <div className=\"flex justify-between mb-8\">\n      <div className=\"flex\">\n        <div className=\"relative\">\n          <input\n            className=\"py-2 pl-10 pr-6 border rounded-full text-onyx bg-cultured border-quickSilver text-md focus:outline-none\"\n            placeholder=\"Search loans\"\n            onChange={handleChange}\n          />\n          <Icon\n            className=\"absolute w-3.5 h-3.5 fill-current top-2/4 left-5 transform -translate-y-1/2 text-quickSilver\"\n            id=\"search\"\n          />\n        </div>\n        <FilterDropdown\n          className=\"ml-4\"\n          text=\"Listing Type\"\n          onFilter={onFilter}\n          valuesKey=\"listType\"\n        />\n        <FilterDropdown\n          className=\"ml-2\"\n          text=\"Loan Class\"\n          onFilter={onFilter}\n          valuesKey=\"loanClass\"\n        />\n        <FilterDropdown\n          className=\"ml-2\"\n          text=\"Loan Type\"\n          onFilter={onFilter}\n          valuesKey=\"loanType\"\n        />\n        <FilterDropdown\n          className=\"ml-2\"\n          text=\"Product Tag\"\n          onFilter={onFilter}\n          valuesKey=\"productTag\"\n        />\n        <FilterDropdown\n          className=\"ml-2\"\n          text=\"Location\"\n          onFilter={onFilter}\n          valuesKey=\"location\"\n        />\n      </div>\n      <Button variant=\"contained\">Save Filter Preferences</Button>\n    </div>\n  )\n}\n\nexport default FilterBar\n","import { useMemo, useState } from 'react'\nimport { useTable, useGlobalFilter, useFilters } from 'react-table'\nimport { useHistory } from 'react-router-dom'\nimport { routes } from '../../router'\nimport Modal from 'react-modal'\nimport FilterBar from './FilterBar'\nimport Button from '../Button'\nimport Icon from '../Icon'\nimport loan from '../../data/loan.json'\nimport LoanCard from '../LoanCard'\nimport modalStyles from '../../assets/styles/modalStyles'\n\nconst LoansTable = ({ loanPools, onToggle }) => {\n  const history = useHistory()\n  const [loanClicked, setLoanClicked] = useState(null)\n  const [isModalOpen, setModalOpen] = useState(false)\n  const data = useMemo(() => loanPools, [loanPools])\n  const { email } = JSON.parse(localStorage.getItem('user'))\n  const columns = useMemo(() => {\n    const handleMessageClick = loanId => {\n      history.push(`${routes.messages}/${loanId}`)\n    }\n\n    /*NOTE: We're not using loan.json since backend now returns dispayable\n     * values instead of capitalized enums\n     */\n    return [\n      {\n        Header: 'Type',\n        id: 'listType',\n        accessor: ({ listType }) => loan.listType[listType.toUpperCase()],\n        filter: (rows, _, filterValue) =>\n          rows.filter(\n            row =>\n              filterValue.includes(row.values.listType.toUpperCase()) ||\n              filterValue.length === 0\n          )\n      },\n      {\n        Header: 'Listing',\n        accessor: 'title',\n        Cell: function Listing({ value }) {\n          return <span className=\"font-bold whitespace-nowrap\">{value}</span>\n        }\n      },\n      {\n        Header: 'Listed by',\n        accessor: 'owner.displayName',\n        Cell: function ListedBy({ value }) {\n          return (\n            <a className=\"underline whitespace-nowrap\" href=\"/\">\n              {value}\n            </a>\n          )\n        }\n      },\n      {\n        Header: 'Availability',\n        id: 'availability',\n        accessor: ({ availability }) =>\n          loan.availability[availability.toUpperCase()],\n        Cell: function Availability({ value }) {\n          return (\n            <div className=\"flex items-center\">\n              <Icon\n                className={`w-4 h-4 mr-1 fill-current text-${\n                  value.toUpperCase().includes('NOT') ? 'error' : 'pantone'\n                }`}\n                id={\n                  value.toUpperCase().includes('NOT')\n                    ? 'unavailable'\n                    : 'available'\n                }\n              />\n              {value}\n            </div>\n          )\n        }\n      },\n      // {\n      //   Header: 'Status',\n      //   id: 'status',\n      //   accessor: ({ status }) => loan.status[status],\n      //   Cell: ({ value }) => (\n      //     <div className=\"flex items-center whitespace-nowrap\">\n      //       <Icon className=\"w-4 h-4 mr-1\" id=\"in_progress\" />\n      //       {value}\n      //     </div>\n      //   )\n      // },\n      {\n        Header: 'Loan Class',\n        id: 'loanClass',\n        accessor: props => {\n          //console.log(props?.loanType?.loanClass?.toUpperCase())\n          return loan.loanClass[props?.loanType?.loanClass?.toUpperCase()]\n        },\n\n        filter: (rows, _, filterValue) =>\n          rows.filter(\n            row =>\n              filterValue.includes(row.values.loanClass?.toUpperCase()) ||\n              filterValue.length === 0\n          )\n      },\n      {\n        Header: 'Loan Type',\n        id: 'loanType',\n        accessor: props => loan.loanType[props?.loanType?.type?.toUpperCase()],\n        filter: (rows, _, filterValue) =>\n          rows.filter(\n            row =>\n              filterValue.includes(row.values.loanType?.toUpperCase()) ||\n              filterValue.length === 0\n          )\n      },\n      {\n        Header: 'Product Tags',\n        id: 'productTag',\n        accessor: ({ productTags }) =>\n          productTags.map(\n            productTag => loan.productTag[productTag.toUpperCase()]\n          ),\n        Cell: ({ value }) => value.map(tag => tag).join(','),\n        filter: (rows, _, filterValue) =>\n          rows.filter(row =>\n            row.values.productTag.some(\n              tag =>\n                filterValue.includes(tag?.toUpperCase()) ||\n                filterValue.length === 0\n            )\n          )\n      },\n      {\n        Header: 'Location',\n        id: 'location',\n        accessor: ({ statesInfo }) =>\n          statesInfo.map(stateInfo => stateInfo.state),\n        Cell: ({ value }) => value.map(state => loan.location[state]).join(','),\n        filter: (rows, _, filterValue) =>\n          rows.filter(row =>\n            row.values.location.some(\n              location =>\n                filterValue.includes(location.toUpperCase()) ||\n                filterValue.length === 0\n            )\n          )\n      },\n      {\n        Header: 'Message Lister',\n        Cell: function MessageLister({ cell }) {\n          const loanId = cell.row.original.id\n          return (\n            <Button\n              variant=\"outlined\"\n              onClick={() => handleMessageClick(loanId)}\n              disabled={email === cell.row.original.owner.email}\n            >\n              Message\n            </Button>\n          )\n        }\n      }\n    ]\n  }, [history])\n\n  const tableInstance = useTable({ columns, data }, useGlobalFilter, useFilters)\n  const {\n    getTableProps,\n    getTableBodyProps,\n    headerGroups,\n    rows,\n    setGlobalFilter,\n    setFilter,\n    prepareRow\n  } = tableInstance\n\n  const handleLoanClick = row => {\n    setLoanClicked(row.original)\n    setModalOpen(true)\n  }\n\n  return (\n    <div className=\"m-5\">\n      <div className=\"flex items-center justify-between\">\n        <h1 className=\"my-6 text-2xl font-semibold text-eerie\">\n          {`${rows.length} loans`}\n        </h1>\n        <span>\n          <Button variant=\"outlined\" onClick={onToggle}>\n            Card View\n          </Button>\n          <Button\n            onClick={() => history.push('/upload')}\n            className=\"ml-8\"\n            variant=\"contained\"\n          >\n            Create marketplace listing\n          </Button>\n      </span>\n      </div>\n      <FilterBar onGlobalFilter={setGlobalFilter} onFilter={setFilter} />\n      <div className=\"overflow-x-auto\">\n        <table {...getTableProps()}>\n          <thead>\n            {headerGroups.map((headerGroup, index) => (\n              <tr\n                key={'headergroup' + index}\n                className=\"border-b border-platinum\"\n                {...headerGroup.getHeaderGroupProps()}\n              >\n                {headerGroup.headers.map((column, index) => (\n                  <th\n                    key={'header' + index}\n                    className=\"px-4 py-2 font-semibold text-left uppercase text-md text-onyx whitespace-nowrap\"\n                    {...column.getHeaderProps()}\n                  >\n                    {column.render('Header')}\n                  </th>\n                ))}\n              </tr>\n            ))}\n          </thead>\n          <tbody {...getTableBodyProps()}>\n            {rows.map((row, index) => {\n              prepareRow(row)\n              return (\n                <tr\n                  key={'row' + index}\n                  className=\"border-b cursor-pointer border-platinum hover:bg-platinum\"\n                  {...row.getRowProps()}\n                  onClick={() => handleLoanClick(row)}\n                >\n                  {row.cells.map((cell, index) => (\n                    <td\n                      key={'cell' + index}\n                      className=\"px-4 py-4 text-md\"\n                      {...cell.getCellProps()}\n                    >\n                      {cell.render('Cell')}\n                    </td>\n                  ))}\n                </tr>\n              )\n            })}\n          </tbody>\n        </table>\n      </div>\n      <Modal\n        isOpen={isModalOpen}\n        onRequestClose={() => setModalOpen(false)}\n        style={modalStyles}\n      >\n        <LoanCard loanPool={loanClicked} />\n      </Modal>\n    </div>\n  )\n}\n\nexport default LoansTable\n","const Pagination = ({\n  setCurrentPage,\n  isPreviousData,\n  currentPage,\n  totalPages = 1\n}) => {\n\n  const page = currentPage + 1\n  const total = totalPages + 1\n\n  return (\n    <div className=\"pt-2 pb-4\">\n      <button\n        disabled={isPreviousData || currentPage <= 0}\n        className=\"p-2 text-sm bg-white border rounded-full\"\n        onClick={() => {\n          setCurrentPage(p => p - 1)\n        }}\n      >\n        Prev\n      </button>\n      <span className=\"text-sm\">\n        {' '}\n        Page: {page}/{total - 1}{' '}\n      </span>\n      <button\n        disabled={isPreviousData || currentPage === totalPages - 1}\n        className=\"p-2 text-sm bg-white border rounded-full\"\n        onClick={() => {\n          setCurrentPage(p => p + 1)\n        }}\n      >\n        Next\n      </button>\n    </div>\n  )\n}\n\nexport default Pagination\n","import { useState } from 'react'\nimport { useQuery } from 'react-query'\nimport { useHistory } from 'react-router-dom'\nimport { getLoanPools } from '../../data/loanPools'\nimport AppBar from '../../components/AppBar'\nimport LoanCard from '../../components/LoanCard'\nimport Button from '../../components/Button'\nimport LoansTable from '../../components/LoansTable'\nimport Pagination from './Pagination'\n\nconst Marketplace = () => {\n  const history = useHistory()\n  const listed = ['not started', 'in progress']\n\n  const [currentPage, setCurrentPage] = useState(0)\n  const { isLoading, error, data, isPreviousData } = useQuery(\n    ['loanpools', currentPage],\n    () => getLoanPools(currentPage),\n    {\n      keepPreviousData: true\n    }\n  )\n  const [isTabular, setTabular] = useState(false)\n  const { email } = JSON.parse(localStorage.getItem('user'))\n\n  if (error) return error.message\n\n  const handleToggle = () => setTabular(isTabular => !isTabular)\n\n  // console.log(data?.loanPools)\n\n  const loanPools = data?.loanPools?.filter(\n    loanPool => listed.includes(loanPool.status)\n  )\n\n  return (\n    <div>\n      <AppBar selectedIndex={1} />\n      <div className=\"container mx-auto\">\n        {isTabular ? (\n          <LoansTable loanPools={loanPools} onToggle={handleToggle} />\n        ) : (\n          <>\n            <div className=\"flex items-center justify-between m-5\">\n              <h1 className=\"my-6 text-3xl font-bold text-eerie\">\n                Marketplace\n              </h1>\n              <span>\n                <Button variant=\"outlined\" onClick={handleToggle}>\n                  Tabular view\n                </Button>\n                <Button\n                  onClick={() => history.push('/upload')}\n                  className=\"ml-8\"\n                  variant=\"contained\"\n                >\n                  Create marketplace listing\n                </Button>\n              </span>\n            </div>\n            <section className=\"flex flex-wrap justify-between mx-5\">\n              {isLoading ? <div>Loading...</div> : null}\n              {loanPools?.map((loanPool, index) => (\n                <LoanCard\n                  className=\"mb-14\"\n                  key={index}\n                  loanPool={loanPool}\n                  isOwner={email === loanPool.owner.email}\n                />\n              ))}\n            </section>\n          </>\n        )}\n        <Pagination\n          setCurrentPage={setCurrentPage}\n          isPreviousData={isPreviousData}\n          currentPage={currentPage}\n          totalPages={data?.metaData?.totalPages}\n        />\n      </div>\n    </div>\n  )\n}\n\nexport default Marketplace\n","import Icon from '../Icon'\n\nconst Avatar = ({ email }) => {\n  if (email in localStorage) {\n    const image = JSON.parse(localStorage.getItem(email));\n    if (image) {\n      return (\n        <div className=\"w-10 h-10 border rounded-full min-w-10 min-h-10\">\n          <img src={image} />\n        </div>\n      ) \n    }\n  }\n\n  return (\n    <div className=\"inline-block p-3 bg-black border rounded-full\">\n      <Icon className=\"w-3 h-3\" fill=\"white\" id=\"profile\" />\n    </div>\n  )\n}\n\nexport default Avatar\n","import { useEffect, useState } from 'react'\nimport dateFormat from 'dateformat'\nimport classNames from 'classnames'\nimport Avatar from '../ChatMessage/Avatar'\nimport { getImage } from '../../data/utils'\nimport Icon from '../Icon'\n\nconst ChatItem = ({ chat, selected, onClick }) => {\n  const [imageLoaded, setImageLoaded] = useState(false)\n\n  useEffect(() => {\n    const retrieveAvatar = async () => {\n      await getImage(chat)\n      setImageLoaded(true)\n    }\n    retrieveAvatar()\n  }, [chat])\n\n  const handleClick = () => {\n    onClick(chat)\n  }\n\n  return (\n    <div\n      className={classNames('flex items-center p-3 cursor-pointer', {\n        'bg-platinum': selected\n      })}\n      onClick={handleClick}\n    >\n      {imageLoaded ? (\n        <Avatar email={chat.email} />\n      ) : (\n        <div className=\"inline-block p-3 bg-black border rounded-full\">\n          <Icon className=\"w-3 h-3\" id=\"profile\" fill=\"white\" />\n        </div>\n      )}\n      <div className=\"ml-2\">\n        <strong className=\"block text-base\">{chat.displayName}</strong>\n        <strong className=\"block text-base\">{chat.entity}</strong>\n        <p className=\"text-md\">\n          {chat.loanId} - {chat.title}\n        </p>\n        {chat.lastActivity && (\n          <p className=\"text-md\">\n            {dateFormat(chat.lastActivity, 'm/d/yy · h:MM TT')}\n          </p>\n        )}\n      </div>\n    </div>\n  )\n}\n\nexport default ChatItem\n","import _ from 'lodash'\nimport { useEffect, useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { routes } from '../../router'\nimport { getMessages } from '../../data/conversations'\nimport Icon from '../Icon'\nimport ChatItem from '../ChatItem'\nimport { getCounterpartyFromSid } from '../../data/utils'\n\nconst ChatRoster = ({ conversations, loanPools, currentSid, source }) => {\n  const { email } = JSON.parse(localStorage.getItem('user'))\n  const history = useHistory()\n  const [chats, setChats] = useState([])\n\n  useEffect(() => {\n    const initChats = async () => {\n      const withUniqueSid = _.uniqBy(conversations, 'conversationSid')\n      const threads = withUniqueSid.map(conversation => {\n        const loan = loanPools.find(\n          loanPool => loanPool.id === conversation.loanId\n        ) || {}\n        const profile = getCounterpartyFromSid(loan, email, conversation.conversationSid)\n        return {\n          conversationSid: conversation.conversationSid,\n          loanId: conversation.loanId,\n          displayName: profile?.displayName,\n          entity: profile?.entity,\n          email: profile?.email,\n          title: loan?.title,\n          image: profile?.image\n        }\n      })\n      for (let i = 0; i < threads.length; i++) {\n        const messages = await getMessages(threads[i].conversationSid)\n        threads[i].lastActivity =\n          messages.length > 0\n            ? new Date(messages[messages.length - 1].date_created)\n            : null\n      }\n      // Settlemend card removes loanpool from list of loanPools\n      // map function breaks, so short circuit in find function solves it\n      // but it sets the fields as undefined\n      const unSettled = threads.filter(item => item.title !== undefined ) \n      unSettled\n      .sort((chatA, chatB) => {\n          return chatA.lastActivity - chatB.lastActivity\n        })\n        .reverse()\n      setChats(unSettled)\n    }\n    initChats()\n  }, [conversations, loanPools])\n\n  const handleClick = chat => {\n    if (source === 'detail') {\n      history.push(`${routes.detail}/${chat.loanId}`, chat)\n    } else if (source === 'messages') {\n      history.push(`${routes.messages}/${chat.loanId}`, chat)\n    }\n  }\n  return (\n    <div>\n      <header className=\"flex items-center justify-between p-6 border-b border-platinum\">\n        <h2 className=\"text-base font-bold\">Messages</h2>\n        <button className=\"focus:outline-none\">\n          <Icon className=\"w-5 h-5\" id=\"filter_chats\" />\n        </button>\n      </header>\n      <section className=\"overflow-y-auto\">\n        {chats.map(chat => (\n          <ChatItem\n            key={chat.conversationSid}\n            chat={chat}\n            selected={chat.conversationSid === currentSid}\n            onClick={handleClick}\n          />\n        ))}\n      </section>\n    </div>\n  )\n}\n\nexport default ChatRoster\n","export const eventType = {\n  refetch: \"refetch\",\n};\n\nconst event = {\n  list: new Map(),\n  on(eventType, eventAction) {\n    this.list.has(eventType) || this.list.set(eventType, []);\n    if (this.list.get(eventType)) this.list.get(eventType).push(eventAction);\n    return this;\n  },\n\n  emit(eventType, ...args) {\n    this.list.get(eventType) &&\n      this.list.get(eventType).forEach((cb) => {\n        cb(...args);\n      });\n  }\n};\n\nexport default event;\n","import event from \"./eventBus\";\n\nexport const PanelPublisher = {\n  message: (content) => {\n    event.emit(\"refetch\", content);\n  },\n  clearAllMessage: () => {\n    event.emit(\"clearAllMessage\");\n  }\n};\n","import { useEffect, useState } from 'react'\nimport classNames from 'classnames'\nimport dateFormat from 'dateformat'\nimport { PanelPublisher } from '../../context/PanelPublisher'\nimport Avatar from './Avatar'\n\nconst ChatMessage = ({ message, className }) => {\n  const [mediaUrl, setMediaUrl] = useState(null)\n\n  useEffect(() => {\n    if (message.media) {\n      message.media.getContentTemporaryUrl().then(url => {\n        setMediaUrl(url)\n      })\n    }\n  })\n\n  if (message.author.includes('admin')) {\n    PanelPublisher.message(message.body)\n    return (\n      <p className=\"text-base font-bold text-center mt-9\">{message.body}</p>\n    )\n  }\n\n  const messageContent = () => {\n    if (message.media) {\n      // In case of image\n      if (message.media.contentType.includes('image')) {\n        return (\n          // If upload failed render an error message above the image\n          <div>\n            {message.codeStatus !== 200 && (\n              <p className=\"text-error\">\n                {/*Handle different kinds of errors. Defaults to a general \"fail\"*/}\n                {message.codeStatus === 304\n                  ? 'This version of the file has been previously uploaded'\n                  : 'Fail to send message'}\n              </p>\n            )}\n            {/*Image to be rendered, put some styles in case of error*/}\n            <div\n              className={classNames(\n                { 'bg-black': message.codeStatus !== 200 },\n                'inline-block'\n              )}\n            >\n              <img\n                className={classNames(\n                  { 'opacity-50': message.codeStatus !== 200 },\n                  'w-32'\n                )}\n                src={mediaUrl}\n                alt={message.media.filename}\n              />\n            </div>\n          </div>\n        )\n      }\n      // if it's media but it's not an image, then assume it's a file\n      return message.codeStatus === 200 ? (\n        <a\n          className=\"underline\"\n          href={mediaUrl}\n          download={message.media.filename}\n          target=\"_blank\"\n          rel=\"noreferrer\"\n        >\n          {message.media.filename}\n        </a>\n      ) : (\n        <div>\n          <p className=\"text-error\">\n            {message.codeStatus === 304\n              ? 'This version of the file has been previously uploaded'\n              : 'Fail to send message'}\n          </p>\n          <span className=\"underline cursor-default opacity-30\">\n            {message.media.filename}\n          </span>\n        </div>\n      )\n    }\n    // In case of plain text\n    return <p className=\"mt-1 text-base\">{message.body}</p>\n  }\n\n  return (\n    <div className={classNames('flex items-start', className)}>\n      <Avatar email={message.author}/>\n      <div className=\"ml-3\">\n        <div className=\"flex\">\n          <h3 className=\"text-base font-bold\">{message.author}</h3>\n          <span className=\"ml-2 text-sm text-quickSilver\">\n            {dateFormat(message.date, 'h:MM TT')}\n          </span>\n        </div>\n        {messageContent()}\n      </div>\n    </div>\n  )\n}\n\nexport default ChatMessage\n","import { useQuery } from 'react-query'\nimport { getAllDocNames } from '../../data/documents'\n\nconst useAllDocuments = id => {\n  return useQuery(['alldocnames', parseInt(id)], () => getAllDocNames(id), {\n    enabled: false\n  })\n}\n\nexport default useAllDocuments\n","import { useEffect, useState, useRef } from 'react'\nimport { useForm } from 'react-hook-form'\nimport ClipLoader from 'react-spinners/ClipLoader'\nimport { uploadDoc } from '../../data/documents'\nimport dateFormat from 'dateformat'\nimport classNames from 'classnames'\nimport ChatMessage from '../ChatMessage'\nimport Icon from '../Icon'\nimport useAllDocuments from '../../../src/data/hooks/useAllDocuments'\n\nconst ChatBox = ({ thread, conversationSid, loanId, onLastActivity, dealroom }) => {\n  const { email } = JSON.parse(localStorage.getItem('user'))\n  const { register, reset, handleSubmit } = useForm()\n  const chatBox = useRef()\n  const inputFile = useRef()\n  const [messages, setMessages] = useState([])\n  const [conversation, setConversation] = useState(null)\n  const [isLoading, setLoading] = useState(false)\n  const [isFileSending, setFileSending] = useState(false)\n  const { refetch } = useAllDocuments(loanId)\n\n  const messageAdded = message => {\n    if (onLastActivity) onLastActivity(conversationSid, message.dateCreated)\n\n    setMessages(messages => [\n      ...messages,\n      {\n        author: message.author,\n        body: message.body,\n        media: message.media,\n        codeStatus: message.attributes.codeStatus,\n        date: new Date(message.dateCreated)\n      }\n    ])\n\n    if (chatBox.current) {\n      chatBox.current.scrollTop = chatBox.current.scrollHeight\n    }\n  }\n\n  useEffect(() => {\n    if (conversation) {\n      conversation.on('messageAdded', messageAdded)\n    }\n\n    return () => {\n      if (conversation) {\n        conversation.removeListener('messageAdded', messageAdded)\n      }\n    }\n    // eslint-disable-next-line\n  }, [conversation])\n\n\n  useEffect(() => {\n    const initConversation = async () => {\n      setLoading(true)\n      const messages = await thread.getMessages()\n      setConversation(thread)\n      setMessages(\n        messages.items.map(message => {\n          return {\n            author: message.author,\n            body: message.body,\n            media: message.media,\n            codeStatus: message.attributes.codeStatus,\n            date: new Date(message.dateCreated)\n          }\n        })\n      )\n      if (chatBox.current) {\n        chatBox.current.scrollTop = chatBox.current.scrollHeight\n      }\n      setLoading(false)\n    }\n    if (thread) initConversation()\n  }, [thread])\n\n  const handleSendMessageSubmit = ({ message }) => {\n    conversation.sendMessage(message)\n    reset()\n  }\n\n  const uploadFile = async (loanId, file) => {\n    const formData = new FormData()\n    formData.append('name', file.name.substr(0, file.name.indexOf('.')))\n    formData.append('description', 'doc description')\n    formData.append('filetype', file.type)\n    formData.append('data', file)\n    formData.append('accessType', file.accessType | 'ALL_ACCESS')\n    const response = await uploadDoc(loanId, formData)\n    refetch()\n    return response\n  }\n\n  const handleFileChange = async () => {\n    const file = inputFile.current.files[0]\n    console.log('the file is->', file)\n    if (!file) return\n    const formData = new FormData()\n    formData.append('file', file)\n    let codeStatus\n    try {\n      setFileSending(true)\n      const response = await uploadFile(loanId, file)\n      console.log('successful response when uploading document', response)\n      codeStatus = 200\n    } catch (error) {\n      console.log('error when uploading document', error)\n      codeStatus = error.response.status\n      console.log('codeStatus->', codeStatus)\n    }\n    conversation.sendMessage(formData, {\n      codeStatus\n    })\n    setFileSending(false)\n  }\n  return (\n    <div>\n      <div\n        className={`py-6 overflow-y-auto px-14 ${\n          (dealroom && 'h-chatbox-dealroom') || 'h-chatbox'\n        }`}\n        ref={chatBox}\n      >\n        {isLoading\n          ? 'Loading...'\n          : messages\n              ?.reduce((groupedMessages, message) => {\n                let group = groupedMessages.find(group => {\n                  return !group || !message\n                    ? false\n                    : group.date.getYear() === message.date.getYear() &&\n                        group.date.getMonth() === message.date.getMonth() &&\n                        group.date.getDate() === message.date.getDate()\n                })\n                if (group) group.messages.push(message)\n                else {\n                  group = { date: message.date, messages: [message] }\n                  groupedMessages.push(group)\n                }\n                return groupedMessages\n              }, [])\n              .map((group, index) => (\n                <div key={`group-${index}`}>\n                  <p className=\"text-sm font-bold text-center mt-9 text-davys\">\n                    {dateFormat(group.date, 'mmmm d, yyyy')}\n                  </p>\n                  {group.messages.map((message, index) => (\n                    <ChatMessage\n                      key={`message-${index}`}\n                      className={`mt-9 ${message.author === email ? \"justify-end\" : \"\"}`}\n                      message={message}\n                    />\n                  ))}\n                </div>\n              ))}\n      </div>\n      <div className=\"pb-6 px-14\">\n        <form\n          id=\"upload-file\"\n          className=\"relative flex items-center w-full\"\n          onSubmit={handleSubmit(handleSendMessageSubmit)}\n        >\n          <input\n            autoComplete=\"off\"\n            className=\"inline-block w-full py-2 pl-5 pr-12 mr-2 border border-black rounded-full focus:outline-none text-md\"\n            type=\"text\"\n            placeholder=\"Type a message\"\n            disabled={isLoading || !conversation}\n            {...register('message')}\n          />\n          {isFileSending ? (\n            <ClipLoader color=\"#44B757\" />\n          ) : (\n            <label\n              htmlFor=\"file\"\n              className={classNames(\n                'flex items-center p-2 text-white rounded cursor-pointer bg-pantone text-md',\n                {\n                  'pointer-events-none opacity-40': !conversation\n                }\n              )}\n            >\n              <Icon\n                className=\"items-center w-5 h-5 mr-1 fill-current\"\n                id=\"upload_document\"\n              />\n              Upload\n            </label>\n          )}\n          <input\n            id=\"file\"\n            className=\"hidden\"\n            type=\"file\"\n            ref={inputFile}\n            onChange={handleFileChange}\n          />\n        </form>\n      </div>\n    </div>\n  )\n}\n\nexport default ChatBox\n","import Button from '../Button'\nconst ChatBoxHeader = ({ buyerDisplayName, loanPool, setModalUsersOpen }) => {\n  return (\n    <header\n      className=\"flex items-center justify-between px-6 border-b border-platinum\"\n      style={{ minHeight: 72.771 }}\n    >\n      <h2 className=\"text-base font-bold\">\n        {buyerDisplayName || loanPool?.owner?.displayName}\n      </h2>\n      <div className=\"flex items-center\">\n        <Button className=\"text-sm\" variant=\"rounded\" disabled ionClick={() => setModalUsersOpen(true)}>\n          Add Users\n        </Button>\n      </div>\n    </header>\n  )\n}\n\nexport default ChatBoxHeader\n","export default __webpack_public_path__ + \"static/media/avatar-placeholder.157f088b.png\";","import { useEffect, useState } from 'react'\nimport { getUser } from '../../data/loanPools'\nimport classNames from 'classnames'\nimport api from '../../data/api'\nimport placeholder from '../../assets/images/avatar-placeholder.png'\n\nconst UserImage = ({ className, person }) => {\n  const [src, setSrc] = useState(null)\n\n  useEffect(() => {\n    const retrieveUser = async () => {\n      if (person.entity && person.email) {\n        try {\n          const user = await getUser(person.entity, person.email)\n          if (user.image) {\n            const data = await api().get(user.image, {\n              responseType: 'blob'\n            })\n            const photo = URL.createObjectURL(data.data)\n            setSrc(photo)\n          }\n        } catch (e) {\n          console.log(e)\n        }\n      }\n    }\n    retrieveUser()\n  }, [person])\n\n  return (\n    <img\n      className={classNames('my-auto rounded-full h-168', className)}\n      src={src ? src : placeholder}\n      alt=\"\"\n      width=\"100\"\n      height=\"100\"\n    ></img>\n  )\n}\n\nexport default UserImage\n","import { BeatLoader } from 'react-spinners'\nimport Icon from '../Icon'\n\nconst ButtonAdd = ({ label, isLoading, disabled, onClick }) => {\n  return (\n    <div className=\"mx-auto text-center\">\n      {isLoading ? (\n        <BeatLoader size={7} color=\"black\" />\n      ) : (\n        <button disabled={isLoading || disabled} onClick={onClick}>\n          <Icon\n            className=\"w-5 h-5 mx-auto text-white fill-current\"\n            id=\"add\"\n          />\n          <span className=\"text-sm\">{label}</span>\n        </button>\n      )}\n    </div>\n  )\n}\n\nexport default ButtonAdd\n","import toaster from 'react-hot-toast'\nimport UserImage from '../UserImage'\nimport ButtonAdd from './ButtonAdd'\nimport Button from '../Button'\nimport { useState } from 'react'\nimport { createConversation } from '../../data/conversations'\n\nconst UserChat = ({ person, participants, conversationSid, loanId, reload }) => {\n  const [isLoading, setIsLoading] = useState(false)\n\n  const handleOnClick = async () => {\n    setIsLoading(true)\n    try {\n      const data = {\n        loanId,\n        email: person.email,\n        entity: person.entity,\n        conversationSid\n      }\n      // Add use to conversation\n      await createConversation(data)\n      setTimeout(() => {\n        setIsLoading(false)\n        reload()\n        toaster.success('User added')\n      }, [2000])\n    } catch (e) {\n      console.log('e: ', e);\n      toaster.error('Something went wrong, please try again later')\n      setIsLoading(false)\n    }\n  }\n\n  return (\n    <>\n      <figure className=\"my-2 md:flex\">\n        <UserImage className=\"w-16 rounded-full\" person={person} />\n        <div className=\"px-6 py-4 text-center md:text-left space-y-2\">\n          <blockquote>\n            <Button className=\"text-lg font-semibold\" variant=\"link\">\n              {person.displayName}\n            </Button>\n            <p className=\"text-sm capitalize\">{person.role}</p>\n          </blockquote>\n        </div>\n      </figure>\n      {!participants.includes(person.email) ? (\n        <div className=\"w-28\">\n          <ButtonAdd isLoading={isLoading} label=\"Add\" onClick={handleOnClick} />\n        </div>\n      ) : null}\n    </>\n  )\n}\n\nexport default UserChat\n","import { useEffect, useState } from 'react'\nimport ChatBox from './ChatBox'\nimport ChatBoxHeader from './ChatBoxHeader'\nimport Modal from 'react-modal'\nimport modalStyles from '../../assets/styles/modalStyles'\nimport { getBusiness } from '../../data/loanPools'\nimport UserChat from './UserChat'\n\nconst Chat = ({\n  conversationSid,\n  loanPool,\n  buyerDisplayName,\n  onLastActivity,\n  dealroom,\n  client,\n}) => {\n  const { entity } = JSON.parse(localStorage.getItem('user'))\n  const [isModalUsersOpen, setModalUsersOpen] = useState(false)\n  const [team, setTeam] = useState(null)\n  const [thread, setThread] = useState(null)\n  const [participants, setParticipants] = useState(null)\n  const [reload, setReload] = useState(false)\n\n  useEffect(() => {\n    const initThread = async () => {\n      const res = await client.getConversationBySid(conversationSid)\n      setThread(res)\n    }\n    if (conversationSid && client) initThread()\n  }, [client, conversationSid])\n\n   useEffect(() => {\n    const retrieveParticipants = async () => {\n      const res = await thread.getParticipants()\n      setParticipants(res.map(p => p.state.identity))\n    }\n    if (thread) retrieveParticipants()\n  }, [thread, reload])\n\n  useEffect(() => {\n    const retrieveBusiness = async () => {\n      // setIsLoading(true)\n      try {\n        const res = await getBusiness(entity)\n        setTeam(res?.team.sort((a, b) => (a.email > b.email ? 1 : -1)))\n        // setIsLoading(false)\n      } catch (error) {\n        // setIsLoading(false)\n        console.log(error)\n      }\n    }\n    retrieveBusiness()\n  }, [])\n\n  const reloadParticipants = () => {\n    setReload(!reload)\n  }\n\n  return (\n    <div className=\"w-full border-l border-r border-platinum\">\n      <ChatBoxHeader\n        buyerDisplayName={buyerDisplayName}\n        loanPool={loanPool}\n        setModalUsersOpen={setModalUsersOpen}\n      />\n      <ChatBox\n        thread={thread}\n        conversationSid={conversationSid}\n        loanId={loanPool?.id}\n        onLastActivity={onLastActivity}\n        dealroom={dealroom}\n      />\n      <Modal\n        isOpen={isModalUsersOpen}\n        onRequestClose={() => setModalUsersOpen(false)}\n        style={modalStyles}\n      >\n        <h2 className=\"px-3 py-2 text-lg font-bold\">Add a user to this deal</h2>\n        {team &&\n          team.map((item, index) => (\n            <div\n              key={'select-' + index}\n              className=\"flex items-center justify-between\"\n            >\n              <UserChat\n                participants={participants}\n                person={item}\n                conversationSid={conversationSid}\n                loanId={loanPool?.id}\n                reload={reloadParticipants}\n              />\n            </div>\n          ))}\n      </Modal>\n    </div>\n  )\n}\n\nexport default Chat\n","import classNames from 'classnames'\n\nconst TextField = ({ className, type, innerRef, ...props }) => (\n  <input\n    className={classNames(\n      'p-2.5 border border-black rounded-md focus:outline-none text-md',\n      className\n    )}\n    type={type || 'text'}\n    autoComplete=\"off\"\n    {...innerRef}\n    {...props}\n  />\n)\n\nexport default TextField\n","export default __webpack_public_path__ + \"static/media/Contract.86e5516f.svg\";","export default __webpack_public_path__ + \"static/media/Contract-1.403c4ef8.svg\";","export default __webpack_public_path__ + \"static/media/Contract-2.9c92690e.svg\";","import Modal from 'react-modal'\nimport contract from '../../assets/images/thumbnails/Contract.svg'\nimport contract1 from '../../assets/images/thumbnails/Contract-1.svg'\nimport contract2 from '../../assets/images/thumbnails/Contract-2.svg'\nimport modalStyles from '../../assets/styles/modalStyles'\n\nModal.setAppElement('#root')\n\nconst CongratsModal = ({ didPay, onClose }) => {\n  return (\n    <Modal isOpen={didPay} onRequestClose={onClose} style={modalStyles}>\n      <h1 className=\"text-2xl font-bold text-eerie\">\n        Congratulations on purchasing your new loan!\n      </h1>\n      <p className=\"mt-8 text-base text-davys\">\n        <strong>\n          Offical copies of all documents will be mailed to your business address\n          on file within 5-7 business days\n        </strong>\n      </p>\n      <hr className=\"my-8\" />\n      <div className=\"flex mb-8\">\n        <img src={contract} alt=\"Contract\"/>\n        <img src={contract1} alt=\"Contract 1\"/>\n        <img src={contract2} alt=\"Contract 2\"/>\n      </div>\n    </Modal>\n  )\n}\n\nexport default CongratsModal\n","export default __webpack_public_path__ + \"static/media/wise_logo.6e76d202.svg\";","import { useState, useEffect } from 'react'\nimport { getAllDocNames } from '../../data/documents'\nimport { getThumbnail } from '../../data/documents'\nimport Carousel, { slidesToShowPlugin } from '@brainhubeu/react-carousel'\nimport '@brainhubeu/react-carousel/lib/style.css'\nimport TextField from '../TextField'\nimport Button from '../Button'\nimport CongratsModal from './CongratsModal'\nimport wiseLogo from '../../assets/images/wise_logo.svg'\n\nconst Payment = ({ loanId }) => {\n  const [documents, setDocuments] = useState([])\n  const [didPay, setPay] = useState(false)\n\n  useEffect(() => {\n    const retrieveDocs = async () => {\n      const docsInfo = await getAllDocNames(loanId)\n      docsInfo.forEach(async docInfo => {\n        const thumbnail = await getThumbnail(loanId, docInfo.name)\n        const blob = URL.createObjectURL(thumbnail)\n        setDocuments(documents => [\n          ...documents,\n          {\n            thumbnail: blob,\n            filename: docInfo.originalFilename\n          }\n        ])\n      })\n    }\n    retrieveDocs()\n  }, [loanId])\n\n  const handlePayClick = () => setPay(true)\n\n  return (\n    <div className=\"p-6 grid grid-cols-1 gap-6\">\n      <div>\n        <label className=\"inline-block mb-2 text-md\">\n          Enter business entity name\n        </label>\n        <TextField className=\"w-full\" placeholder=\"Example\" />\n      </div>\n      <div>\n        <label className=\"inline-block mb-2 text-md\">\n          Enter bank routing number\n        </label>\n        <TextField className=\"w-full\" placeholder=\"Example\" />\n      </div>\n      <div>\n        <label className=\"inline-block mb-2 text-md\">\n          Re enter bank routing number\n        </label>\n        <TextField className=\"w-full\" placeholder=\"Example\" />\n      </div>\n      <div>\n        <label className=\"inline-block mb-2 text-md\">\n          Enter bank account number\n        </label>\n        <TextField className=\"w-full\" placeholder=\"Example\" />\n      </div>\n      <div>\n        <label className=\"inline-block mb-2 text-md\">\n          Re enter bank account number\n        </label>\n        <TextField className=\"w-full\" placeholder=\"Example\" />\n      </div>\n      <div>\n        <p className=\"mb-6 font-semibold text-md\">Review Documents</p>\n        <Carousel plugins={[\n          {\n            resolve: slidesToShowPlugin,\n            options: {\n              numberOfSlides: 2\n            }\n          }\n        ]}>\n          {documents.map((document, index) => (\n            <div key={index}>\n              <img src={document.thumbnail} alt={document.filename} />\n              <span>{document.filename}</span>\n            </div>\n          ))}\n        </Carousel>\n        <Button\n          className=\"flex items-center mx-auto mt-6 font-bold\"\n          variant=\"contained\"\n          onClick={handlePayClick}\n        >\n          Confirm payment with{' '}\n          <img className=\"ml-2 -mt-px w-14\" src={wiseLogo} alt=\"Wise Logo\" />\n        </Button>\n      </div>\n      <CongratsModal didPay={didPay} onClose={() => setPay(false)}/>\n    </div>\n  )\n}\n\nexport default Payment\n","import { useMutation } from 'react-query'\nimport { customizeDoc } from '../../data/documents'\n\nconst useRenderDocuments = () => {\n  return useMutation(data => customizeDoc(data))\n}\n\nexport default useRenderDocuments\n","import _ from 'lodash'\nimport { useState, useEffect } from 'react'\nimport { updateDealRoom, getProposedBuyers } from '../../data/loanPools'\nimport Payment from '../Payment'\nimport Icon from '../Icon'\nimport LoanCard from '../LoanCard'\nimport Button from '../Button'\nimport useRenderDocuments from '../../data/hooks/useRenderDocuments'\nimport { getESign } from '../../data/documents'\nimport event from '../../context/eventBus'\nimport { useHistory } from 'react-router-dom'\nimport { routes } from '../../router'\nimport { getDocEsign } from '../../data/documents'\nimport { uploadDoc } from '../../data/documents'\nimport toaster from 'react-hot-toast'\nimport { cleanUrlParams } from '../../data/utils'\n\nconst ChatPanel = ({ loanPool, buyerEmail, setLoadingOverlay, currentSid }) => {\n  const [isLoiSigned, setLoiSigned] = useState(false)\n  const [showSatisfiedButtons, setShowSatisfiedButtons] = useState(false)\n  const [counterSignButton, setCounterSignButton] = useState(false)\n  const [isContractSigned, setContractSigned] = useState(false)\n  const [isDealUpdated, setDealUpdated] = useState(false)\n  const [eSign, setESign] = useState({ envelopeId: '', redirectUrl: '' })\n  const [proposedBuyer, setProposedBuyer] = useState({})\n  const { email, entity } = JSON.parse(localStorage.getItem('user'))\n  const renderLOI = useRenderDocuments()\n  const [refreshKey, setRefreshKey] = useState(0)\n  const history = useHistory()\n  const isOwner = loanPool?.owner?.email === email\n\n  const docusignevent = new URLSearchParams(\n    document.location.search.substring(1)\n  ).get('event')\n\n  const docusignEnvelopeId = new URLSearchParams(\n    document.location.search.substring(1)\n  ).get('envelopeId')\n\n  useEffect(() => {\n    if (loanPool) {\n      getProposedBuyers(loanPool.id)\n        .then(res => {\n\n          // If I'm the loanPool owner, show counter sign only if other party already signed\n          // buyerEmail it's needed to know which chat is in focus\n          // proposedBuyers - exists only if anybody signed loi\n          // buyer - exists only if a both parties signed\n          //\n          // I'm the owner (seller) of this loanpool?\n          if (isOwner) {\n            if (\n              buyerEmail !== undefined &&\n              res.buyer?.email !== undefined &&\n              buyerEmail === res.buyer?.email\n            ) {\n              // Since buyer property exists, assume that both of us signed LOI\n              setLoiSigned(true)\n              setShowSatisfiedButtons(true)\n            } else {\n              // Maybe somebody signed LOI? show countersign option\n              const result = res.proposedBuyers.find(\n                item => item.email === buyerEmail\n              )\n              setLoiSigned(false)\n              if (result && result.signature === 'loi signed') {\n                setESign({\n                  envelopeId: result.docuSignId\n                })\n                setProposedBuyer(result)\n                setCounterSignButton(true)\n              } else {\n                setProposedBuyer({})\n                setCounterSignButton(false)\n              }\n            }\n            // I'm a buyer\n          } else {\n            if (res.buyer?.email !== undefined && email === res.buyer?.email) {\n              // Since buyer property exists, assume that both of us signed LOI\n              setLoiSigned(true)\n              setShowSatisfiedButtons(true)\n            } else {\n              // Is this loi already signed by me? (check if I'm in the proposedBuyers array)\n              const result = res.proposedBuyers.find(\n                item => item.email === email || item.entity === entity\n              )\n              if (result !== undefined && result?.signature === 'loi signed') {\n                // Show documents option without buttons\n                setLoiSigned(true)\n              } else {\n                setCounterSignButton(false)\n                setLoiSigned(false)\n              }\n            }\n          }\n        })\n        .catch(() => {\n          // Revert everything to original state\n          setCounterSignButton(false)\n          setContractSigned(false)\n          setLoiSigned(false)\n        })\n    }\n  }, [loanPool, email, entity, buyerEmail, refreshKey, isDealUpdated])\n\n  const getMessage = () => {\n\n    setTimeout(() => {\n      setRefreshKey(oldKey => oldKey + 1)\n    }, 3000)\n  }\n\n  useEffect(() => {\n    event.on(\n      'refetch',\n      _.throttle(getMessage, 1000, { leading: true, trailing: false })\n    )\n  }, [])\n\n  const handleInterested = () => {\n    setLoadingOverlay(true)\n    const loi = {\n      loanId: loanPool.id,\n      templateName: 'loi',\n      seller: loanPool.owner.displayName,\n      seller_org: loanPool.owner.entity,\n      buyer: email,\n      buyer_org: entity\n    }\n\n    renderLOI.mutate(loi, {\n      onSuccess: async res => {\n        const data = new FormData()\n\n        data.append('file', res)\n        data.append('buyerSign', email)\n        data.append('currentSid', currentSid)\n        data.append(\n          'signer',\n          JSON.stringify({ email: email, name: entity, role: 'Buyer' })\n        ),\n          data.append(\n            'counterSigner',\n            JSON.stringify({\n              email: loanPool.owner.email,\n              name: loanPool.owner.entity,\n              role: 'Seller'\n            })\n          )\n        data.append('dsReturnUrl', location.href)\n        data.append('templateName', 'LOI')\n        data.append('clickwrapName', 'Letter of Intent')\n        try {\n          const esignRes = await getESign(data)\n          window.location.href = esignRes.redirectUrl\n        } catch (e) {\n          setLoadingOverlay(false)\n        }\n      },\n      onError: () => {\n        setLoadingOverlay(false)\n        toaster.error('Something went wrong, please try again later')\n      }\n    })\n  }\n\n  useEffect(() => {\n    // triggered when buyer or seller signs,\n    // take different action depending on which (if seller this function\n    // is equivalent to countersignagreed)\n    const handleLoiSigned = (signStatus) => {\n      // If I'm the owner I need to wait to first fetch the buyer before\n      // trying to update the deal\n      if (isOwner && Object.entries(proposedBuyer).length === 0) {\n        return\n      }\n\n      let signature = ''\n      if (signStatus === 'signing_complete' || signStatus === 'viewing_complete') {\n        signature = 'loi signed'\n      }\n      if (signStatus === 'decline') {\n        signature = 'loi rejected'\n      }\n      if (signStatus === 'cancel') {\n        cleanUrlParams()\n        return\n      }\n\n      const data = {\n        loanId: loanPool.id,\n        docType: 'loi',\n        docuSignId: docusignEnvelopeId,\n        buyer: isOwner\n          ? {\n              role: 'buyer',\n              email: proposedBuyer.email,\n              entity: proposedBuyer.entity,\n              signature: signature\n            }\n          : {\n              role: 'buyer',\n              email,\n              entity,\n              signature: signature\n            },\n        seller: {\n          role: 'seller',\n          email: loanPool.owner.email,\n          entity: loanPool.owner.entity,\n          signature: isOwner ? signature : 'not started'\n        }\n      }\n      updateDealRoom(data)\n        .then(() => {\n          if (isOwner) {\n            // upload signed document to backend\n            let filename = 'LOI_' + loanPool.id + '_Signed'\n            getDocEsign(docusignEnvelopeId, filename).then(file => {\n              const formData = new FormData()\n              formData.append('name', filename)\n              formData.append('description', 'Loi signed')\n              formData.append('filetype', file.type)\n              formData.append('data', file, filename + '.pdf')\n              formData.append('accessType', file.accessType | 'ALL_ACCESS')\n              uploadDoc(loanPool.id, formData).then(() => {\n                // refetch in document history\n              })\n            })\n          }\n          setDealUpdated(true)\n          cleanUrlParams()\n        })\n        .catch((e) => {\n          console.log('updateDealRoom e:', e)\n          // toaster.error(err.response.data.message)\n        })\n    }\n    // wait for loanpool to be sent\n    if (loanPool && docusignevent) handleLoiSigned(docusignevent)\n  }, [loanPool, docusignevent, docusignEnvelopeId, proposedBuyer])\n\n  const handleCounterSign = async () => {\n    setLoadingOverlay(true)\n    const data = new FormData()\n    data.append('envelopeId', eSign.envelopeId)\n    data.append('dsReturnUrl', location.href)\n    data.append('templateName', 'LOI')\n    data.append('buyerSign', buyerEmail)\n    data.append('currentSid', currentSid)\n    try {\n      const esignRes = await getESign(data)\n      console.log('esignRes: ', esignRes);\n      window.location.href = esignRes.redirectUrl\n    } catch (e) {\n      console.log('counterSign e: ', e);\n      setLoadingOverlay(false)\n    }\n  }\n\n  return (\n    <div>\n      <div id=\"ds-terms-of-service\"></div>\n      <header className=\"flex justify-between p-6 border-b border-platinum\">\n        <h2 className=\"text-base font-bold\">\n          {isContractSigned\n            ? 'Enter payment information'\n            : isLoiSigned\n            ? 'Details'\n            : 'Details'}\n        </h2>\n        <button className=\"focus:outline-none\">\n          <Icon className=\"w-5 h-5\" id=\"filter_documents\" />\n        </button>\n      </header>\n      {loanPool && !isLoiSigned && (\n        <LoanCard\n          className=\"border-none shadow-none\"\n          loanPool={loanPool}\n          footer={false}\n        >\n          {counterSignButton ? (\n            <Button\n              className=\"w-full\"\n              variant=\"outlined\"\n              onClick={handleCounterSign}\n              isLoading={renderLOI.isLoading}\n            >\n              Sign LOI\n            </Button>\n          ) : isOwner || loanPool.status === 'pending' ? null : (\n            <Button\n              className=\"w-full\"\n              variant=\"outlined\"\n              onClick={handleInterested}\n              isLoading={renderLOI.isLoading}\n            >\n              Interested in this loan?\n            </Button>\n          )}\n          {loanPool.status === 'pending' ? (\n            <p className=\"text-center text-pantone\">Pending</p>\n          ) : null}\n        </LoanCard>\n      )}\n      {isLoiSigned && !isContractSigned && (\n        <LoanCard\n          className=\"border-none shadow-none\"\n          loanPool={loanPool}\n          footer={false}\n        >\n          {showSatisfiedButtons ? (\n            <Button\n              className=\"w-full\"\n              variant=\"outlined\"\n              onClick={() => history.push(`${routes.dealroom}/${loanPool.id}`)}\n            >\n              Go to the Deal Room\n            </Button>\n          ) : (\n            <p className=\"pt-2 text-center text-pantone\">\n              Waiting for counterparty response\n            </p>\n          )}\n        </LoanCard>\n      )}\n      {isContractSigned && <Payment loanId={loanPool.id} />}\n    </div>\n  )\n}\n\nexport default ChatPanel\n","import Modal from 'react-modal'\nimport Button from './Button'\n\nconst styles = {\n  overlay: {\n    backgroundColor: 'rgba(0, 0, 0, 0.7)',\n    zIndex: 1000\n  },\n  content: {\n    top: '50%',\n    left: '50%',\n    right: 'auto',\n    bottom: 'auto',\n    marginRight: '-50%',\n    transform: 'translate(-50%, -50%)',\n    borderRadius: 12\n  }\n}\n\nconst ConfirmationModal = ({\n  title,\n  textOk,\n  textCancel,\n  showPrompt,\n  handleOK,\n  handleCancel\n}) => {\n  return (\n    <Modal\n      style={styles}\n      isOpen={showPrompt}\n      onOk={handleOK}\n      onCancel={handleCancel}\n    >\n      <div className=\"flex flex-col mx-20 mt-3 mb-4\">\n        <div className=\"my-3 font-semibold\">\n          {title\n            .replace('\\\\n', '\\n')\n            .split('\\n')\n            .map((txt, key) => {\n              return <div key={key}>{txt}</div>\n            })}\n        </div>\n        <br />\n        <div className=\"self-center\">\n          <Button variant=\"success\" onClick={handleOK}>\n            {textOk}\n          </Button>\n        </div>\n        <br />\n        <button onClick={handleCancel}>\n          <span className=\"font-semibold\">{textCancel}</span>\n        </button>\n      </div>\n    </Modal>\n  )\n}\n\nexport default ConfirmationModal\n","import { useEffect, useState } from \"react\"\nimport ConversationsClient from '@twilio/conversations'\nimport { getToken } from '../../data/conversations'\n\nconst useTwilioClient = (email) => {\n  const [client, setClient] = useState()\n\n  useEffect(() => {\n    const initClient = async () => {\n      const { token } = await getToken(email)\n      try {\n        const res = await ConversationsClient.create(token)\n        setClient(res)\n      } catch (error) {\n        console.log(error)\n        console.log('error.toString: ', error.toString())\n      }\n    }\n    initClient()\n  }, [])\n\n  return client \n}\n\nexport default useTwilioClient\n","import { useState, useEffect } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport {\n  createConversation,\n  getConversationsByUser\n} from '../../data/conversations'\nimport { getLoanPools } from '../../data/loanPools'\nimport AppBar from '../../components/AppBar'\nimport ChatRoster from '../../components/ChatRoster'\nimport Chat from '../../components/Chat'\nimport ChatPanel from '../../components/ChatPanel'\nimport ConfirmationModal from '../../components/ConfirmationModal'\nimport LoadingOverlay from 'react-loading-overlay-ts'\nimport { initConversations } from '../../data/utils'\nimport useTwilioClient from '../../data/hooks/useTwilioClient'\n\nconst Messages = ({ match, location }) => {\n  const { loanId } = match.params\n  const [loanPools, setLoanPools] = useState([])\n  const [conversations, setConversations] = useState([])\n  const [currentSid, setCurrentSid] = useState('')\n  const [buyer, setBuyer] = useState('')\n  const [showErrorPrompt, setErrorPromptOpen] = useState(false)\n  const history = useHistory()\n  const [loadingOverlay, setLoadingOverlay] = useState(false)\n  const { email } = JSON.parse(localStorage.getItem('user'))\n  const client = useTwilioClient(email)\n\n  const countersigner = new URLSearchParams(\n    document.location.search.substring(1)\n  ).get('buyerSign')\n\n  const esignConvSid = new URLSearchParams(\n    document.location.search.substring(1)\n  ).get('currentSid')\n\n  useEffect(() => {\n    const retrieveConversations = async () => {\n      const { loanPools } = await getLoanPools()\n      setLoanPools(loanPools)\n      const { email, entity } = JSON.parse(localStorage.getItem('user'))\n      if (loanId) {\n        const loanPool = loanPools?.find(\n          loanPool => loanPool.id === parseInt(loanId)\n        )\n        if (!loanPool) {\n          setErrorPromptOpen(true)\n          return\n        }\n        initConversations(\n          loanPool,\n          email,\n          entity,\n          setBuyer,\n          createConversation,\n          setCurrentSid,\n          location,\n          countersigner,\n          esignConvSid,\n        )\n      }\n      const conversations = await getConversationsByUser(email)\n      setConversations(conversations)\n    }\n    retrieveConversations()\n  }, [loanId, location.state])\n\n  const handleLastActivity = (conversationSid, lastActivity) => {\n    setConversations(conversations =>\n      conversations.map(conversation =>\n        conversation.conversationSid === conversationSid\n          ? { ...conversation, lastActivity: new Date(lastActivity) }\n          : conversation\n      )\n    )\n  }\n\n  return (\n    <div>\n      <LoadingOverlay active={loadingOverlay} spinner>\n        {/*<p>Buyer signature: {buyer?.email}</p>*/}\n        <AppBar selectedIndex={2} />\n        <div className=\"grid grid-cols-messages\">\n          <ChatRoster\n            conversations={conversations}\n            loanPools={loanPools}\n            currentSid={currentSid}\n            source=\"messages\"\n            setCurrentSid={setCurrentSid}\n          />\n          <Chat\n            loanPool={loanPools?.find(\n              loanPool => loanPool.id === parseInt(loanId)\n            )}\n            conversationSid={currentSid}\n            buyerDisplayName={buyer?.displayName}\n            onLastActivity={handleLastActivity}\n            client={client}\n          />\n          <ChatPanel\n            buyerEmail={buyer?.email}\n            loanPool={loanPools?.find(\n              loanPool => loanPool.id === parseInt(loanId)\n            )}\n            setLoadingOverlay={setLoadingOverlay}\n            currentSid={currentSid}\n          />\n        </div>\n        <ConfirmationModal\n          title=\"Conversation doesn't exists\"\n          textOk={'Ok'}\n          showPrompt={showErrorPrompt}\n          handleOK={() => history.push('/')}\n        />\n      </LoadingOverlay>\n    </div>\n  )\n}\n\nexport default Messages\n","import Button from '../../components/Button'\n\nconst StepButtons = ({\n  // currentStep,\n  // firstStep,\n  // goToStep,\n  // lastStep,\n  nextStep,\n  previousStep,\n  totalSteps,\n  step\n}) => (\n  <div className=\"mt-10\">\n    <hr className=\"mb-5\" />\n    <div className=\"flex justify-between\">\n      {step > 1 && (\n          <Button onClick={previousStep}>Go back</Button>\n      )}\n      {step < totalSteps ? (\n        <Button variant=\"success\" onClick={nextStep}>\n          Continue\n        </Button>\n      ) : (\n        <Button variant=\"success\" onClick={nextStep}>\n          Upload\n        </Button>\n      )}\n    </div>\n  </div>\n)\n\nexport default StepButtons\n","import TextField from '../../components/TextField'\nimport StepButtons from './StepButtons'\nimport { useFormContext } from 'react-hook-form'\n\nconst Details = props => {\n  const {\n    register,\n    handleSubmit,\n    formState: { errors }\n  } = useFormContext()\n\n  const onSubmit = data => {\n    Object.keys(data).map(key => props.update(key, data[key]))\n    props.nextStep()\n  }\n\n  return (\n    <div className=\"pt-10 mt-10\">\n      <h3>Enter the details of your loan pool</h3>\n      <br />\n      <form>\n        <div>\n          {errors.title && (\n            <div className=\"mb-1 text-sm text-red-600\">\n              Please enter a user friendly name for your loan pool'\n            </div>\n          )}\n          <TextField\n            className=\"w-full\"\n            placeholder=\"e.g. Loan Pool Name\"\n            innerRef={register('title', {\n              required: props.isActive\n            })}\n          />\n          <p className=\"text-sm text-gray-400\">\n            This is the name that appears on the offering sheet\n          </p>\n          <br />\n        </div>\n        <div>\n          <label className=\"inline-block mt-2 mb-2 text-md\">\n            Enter a description of the loan pool\n          </label>\n          {errors.description && (\n            <div className=\"mb-1 text-sm text-red-600\">\n              Please enter a description for your loan pool\n            </div>\n          )}\n          <textarea\n            className=\"w-full px-3 py-2 text-gray-700 border border-black rounded-lg focus:outline-none\"\n            rows=\"4\"\n            {...register('description', {\n              required: props.isActive\n            })}\n          ></textarea>\n        </div>\n      </form>\n      <StepButtons step={1} {...props} nextStep={handleSubmit(onSubmit)} />\n    </div>\n  )\n}\n\nexport default Details\n","import StepButtons from './StepButtons'\nimport { useFormContext } from 'react-hook-form'\n\nconst ListingType = props => {\n  const {\n    register,\n    handleSubmit,\n    formState: { errors }\n  } = useFormContext({ defaultValues: { listType: 'For sale' } })\n\n  const options = ['For Sale', 'Looking to Buy', 'For Participation']\n\n  const onSubmit = data => {\n    props.update('listType', data.listType)\n    props.nextStep()\n  }\n\n  return (\n    <div className=\"pt-10 mt-10 w-96\">\n      <h3>Select the listing type</h3>\n      <br />\n      <form>\n        {errors.listType && (\n          <div className=\"mb-1 text-sm text-red-600\">\n            Please select a listing type\n          </div>\n        )}\n        {options.map(option => (\n          <div key={option}>\n            <input\n              id={option}\n              name=\"listType\"\n              type=\"radio\"\n              value={option}\n              {...register('listType', {\n                required: props.isActive,\n              })}\n            />{' '}\n            <label htmlFor={option}>{option}</label>\n          </div>\n        ))}\n      </form>\n      <StepButtons step={2} {...props} nextStep={handleSubmit(onSubmit)} />\n    </div>\n  )\n}\n\nexport default ListingType\n","import StepButtons from './StepButtons'\nimport loanClasses from './loanClasses.json'\nimport { useFormContext } from 'react-hook-form'\n\nconst ProductClass = props => {\n  const {\n    register,\n    handleSubmit,\n    formState: { errors }\n  } = useFormContext()\n\n  const onSubmit = data => {\n    props.update('loanType', data.loanType)\n    props.nextStep()\n  }\n\n  return (\n    <div className=\"pt-10 mt-10\">\n      <h3>Select the loan pool class</h3>\n      <br />\n      {errors.loanType?.loanClass && (\n        <div className=\"mb-1 text-sm text-red-600\">\n          Please select a loan pool class\n        </div>\n      )}\n      <form>\n        {Object.keys(loanClasses).map(loan => (\n          <div key={loan}>\n            <input\n              type=\"radio\"\n              value={loan}\n              name=\"loanClasses\"\n              {...register('loanType.loanClass', {\n                required: props.isActive,\n              })}\n            />{' '}\n            <span>{loan}</span>\n          </div>\n        ))}\n      </form>\n      <StepButtons step={3} {...props} nextStep={handleSubmit(onSubmit)} />\n    </div>\n  )\n}\n\nexport default ProductClass\n","import StepButtons from './StepButtons'\nimport { useFormContext } from 'react-hook-form'\n\nconst Tags = props => {\n  const { register, handleSubmit } = useFormContext()\n\n  const options = [\n    'My Listing',\n    'Non-Performing',\n    'Non-QM',\n    'REO',\n    'Seasoned',\n    'Servicing Released',\n    'Servicing Retained',\n    'CRA Eligible',\n    'Non-Bank Originator',\n    'Non-Owner Occupied',\n    'Owner-Occupied',\n    'Re-Performing',\n    'Scratch & Dent'\n  ]\n\n  const onSubmit = data => {\n    console.log(data)\n    props.update('productTags', data.productTags || [])\n    props.nextStep()\n  }\n\n  return (\n    <div className=\"pt-10 mt-10\">\n      <h3>Add product tags</h3>\n      <br />\n      <form>\n        {options.map((option) => (\n          <div key={option}>\n            <input\n              type=\"checkbox\"\n              value={option}\n              {...register('productTags')}\n            />{' '}\n            <span>{option}</span>\n          </div>\n        ))}\n      </form>\n      <StepButtons step={5} {...props} nextStep={handleSubmit(onSubmit)} />\n    </div>\n  )\n}\n\nexport default Tags\n","const SelectRegion = ({ options, onChange }) => {\n  return (\n    <div>\n      <div className=\"relative inline-block w-full mt-2 text-gray-700\">\n        <select\n          className=\"w-full h-10 pl-3 pr-6 text-base placeholder-gray-600 border rounded-lg appearance-none focus:shadow-outline\"\n          placeholder=\"Regular input\"\n          onChange={onChange}\n        >\n          {options.map(option => (\n            <option key={option}>{option}</option>\n          ))}\n        </select>\n        <div className=\"absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none\">\n          <svg className=\"w-4 h-4 fill-current\" viewBox=\"0 0 20 20\">\n            <path\n              d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\"\n              clipRule=\"evenodd\"\n              fillRule=\"evenodd\"\n            ></path>\n          </svg>\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default SelectRegion\n","import states from '../../components//Mapchart/states.json'\n\nconst Compensation = ({ stateInfo, onPercentageChange }) => (\n  <li className=\"flex items-center justify-between mb-3\">\n    <label className=\"inline-block px-4 py-2 mr-3 text-white rounded bg-pantone\">\n      {states[stateInfo.state].name}\n    </label>\n    <div className=\"relative\">\n      <input\n        type=\"number\"\n        min=\"0\"\n        max=\"100\"\n        step=\"1\"\n        name={stateInfo.state}\n        className=\"w-32 py-2 pr-6 text-right border rounded-md border-quickSilver focus:outline-none text-onyx\"\n        onChange={onPercentageChange}\n        value={stateInfo.percentLoan}\n      />\n      <span className=\"absolute right-2 top-1/2 transform -translate-y-1/2\">\n        %\n      </span>\n    </div>\n  </li>\n)\n\nexport default Compensation\n","import { useState, useEffect } from 'react'\nimport StepButtons from './StepButtons'\nimport Mapchart from '../../components/Mapchart'\nimport SelectRegion from './SelectRegion'\nimport Compensation from '../../components/Compensation'\n\nconst StateCompensation = props => {\n  const options = [\n    'All states',\n    'Northeast',\n    'Southeast',\n    'Midwest',\n    'Southwest',\n    'West'\n  ]\n  const statesInfoData = [\n    { state: 'CT', percentLoan: 0, region: 'Northeast' },\n    { state: 'MA', percentLoan: 0, region: 'Northeast' },\n    { state: 'ME', percentLoan: 0, region: 'Northeast' },\n    { state: 'NH', percentLoan: 0, region: 'Northeast' },\n    { state: 'NJ', percentLoan: 0, region: 'Northeast' },\n    { state: 'NY', percentLoan: 0, region: 'Northeast' },\n    { state: 'PR', percentLoan: 0, region: 'Northeast' },\n    { state: 'RI', percentLoan: 0, region: 'Northeast' },\n    { state: 'VI', percentLoan: 0, region: 'Northeast' },\n    { state: 'VT', percentLoan: 0, region: 'Northeast' },\n    { state: 'AL', percentLoan: 0, region: 'Southeast' },\n    { state: 'DC', percentLoan: 0, region: 'Southeast' },\n    { state: 'DE', percentLoan: 0, region: 'Southeast' },\n    { state: 'FL', percentLoan: 0, region: 'Southeast' },\n    { state: 'GA', percentLoan: 0, region: 'Southeast' },\n    { state: 'KY', percentLoan: 0, region: 'Southeast' },\n    { state: 'MD', percentLoan: 0, region: 'Southeast' },\n    { state: 'MS', percentLoan: 0, region: 'Southeast' },\n    { state: 'NC', percentLoan: 0, region: 'Southeast' },\n    { state: 'PA', percentLoan: 0, region: 'Southeast' },\n    { state: 'SC', percentLoan: 0, region: 'Southeast' },\n    { state: 'TN', percentLoan: 0, region: 'Southeast' },\n    { state: 'VA', percentLoan: 0, region: 'Southeast' },\n    { state: 'WV', percentLoan: 0, region: 'Southeast' },\n    { state: 'IL', percentLoan: 0, region: 'Midwest' },\n    { state: 'IN', percentLoan: 0, region: 'Midwest' },\n    { state: 'IA', percentLoan: 0, region: 'Midwest' },\n    { state: 'KS', percentLoan: 0, region: 'Midwest' },\n    { state: 'MI', percentLoan: 0, region: 'Midwest' },\n    { state: 'MN', percentLoan: 0, region: 'Midwest' },\n    { state: 'MO', percentLoan: 0, region: 'Midwest' },\n    { state: 'NE', percentLoan: 0, region: 'Midwest' },\n    { state: 'OH', percentLoan: 0, region: 'Midwest' },\n    { state: 'WI', percentLoan: 0, region: 'Midwest' },\n    { state: 'AR', percentLoan: 0, region: 'Southwest' },\n    { state: 'LA', percentLoan: 0, region: 'Southwest' },\n    { state: 'NM', percentLoan: 0, region: 'Southwest' },\n    { state: 'OK', percentLoan: 0, region: 'Southwest' },\n    { state: 'TX', percentLoan: 0, region: 'Southwest' },\n    { state: 'AK', percentLoan: 0, region: 'West' },\n    { state: 'AS', percentLoan: 0, region: 'West' },\n    { state: 'AZ', percentLoan: 0, region: 'West' },\n    { state: 'CA', percentLoan: 0, region: 'West' },\n    { state: 'CO', percentLoan: 0, region: 'West' },\n    { state: 'MP', percentLoan: 0, region: 'West' },\n    { state: 'GU', percentLoan: 0, region: 'West' },\n    { state: 'HI', percentLoan: 0, region: 'West' },\n    { state: 'ID', percentLoan: 0, region: 'West' },\n    { state: 'MT', percentLoan: 0, region: 'West' },\n    { state: 'NV', percentLoan: 0, region: 'West' },\n    { state: 'ND', percentLoan: 0, region: 'West' },\n    { state: 'OR', percentLoan: 0, region: 'West' },\n    { state: 'SD', percentLoan: 0, region: 'West' },\n    { state: 'UT', percentLoan: 0, region: 'West' },\n    { state: 'WA', percentLoan: 0, region: 'West' },\n    { state: 'WY', percentLoan: 0, region: 'West' }\n  ]\n\n  const [region, setRegion] = useState(options[0])\n  const [statesInfo, setStatesInfo] = useState(statesInfoData)\n\n  const handleRegionChange = event => {\n    setStatesInfo(statesInfoData)\n    setRegion(event.target.value)\n  }\n\n  const handlePercentChange = event => {\n    // Never let the input go into empty state\n    if (event.target.value === '') event.target.value = 0\n    const max = 100\n    let total\n    let delta\n    let percentResult\n\n    const value = parseInt(event.target.value)\n\n    try {\n      // Filter the states for the current region except the one that is being modified\n      let regionStates = statesInfo.filter(\n        stateInfo =>\n          !stateInfo.state.includes(event.target.name) &&\n          (stateInfo.region.includes(region) || region.includes('All states'))\n      )\n      // Get the sum of percentages for the states of the current region\n      total = regionStates\n        .map(stateInfo => stateInfo.percentLoan)\n        .reduce((prev, next) => prev + next)\n      delta = max - total\n      percentResult = value < delta ? value : delta\n    } catch(e)  {\n      total = statesInfo\n        .map(stateInfo => parseInt(stateInfo.percentLoan))\n        .reduce((prev, next) => prev + next)\n      delta = max - total + value\n      percentResult = value < delta ? value : delta - 1\n    }\n    // If the sum for all the other states and the current state is greater\n    // than 100 put the maximum possible value (difference)\n    setStatesInfo(statesInfo =>\n      statesInfo.map(stateInfo =>\n        stateInfo.state.includes(event.target.name)\n          ? {\n              ...stateInfo,\n              percentLoan:\n              percentResult\n            }\n          : stateInfo\n      )\n    )\n  }\n\n  useEffect(() => {\n    // Filter by non zero percentage\n    props.update(\n      'statesInfo',\n      statesInfo.filter(obj => obj.percentLoan !== 0)\n    )\n    // eslint-disable-next-line\n  }, [statesInfo])\n\n  const statesFilter = data => {\n    try {\n      return data.filter(\n        stateInfo =>\n          stateInfo.region.includes(region) || region.includes('All states')\n      )\n    } catch (e) {\n      return data\n    }\n  }\n\n  useEffect(() => {\n    if (props.initialData) {\n      console.log('initialData', props.initialData)\n      setStatesInfo(props.initialData)\n    }\n  }, [props.initialData])\n\n  return (\n    <div className=\"pt-10 mt-10\">\n      <h3>Select state composition percentage</h3>\n      <br />\n      <p className=\"text-sm text-gray-400\">Select a region</p>\n      <SelectRegion options={options} onChange={handleRegionChange} />\n      <Mapchart\n        statesInfo={statesFilter(statesInfo)}\n      />\n      <ul>\n        {statesFilter(statesInfo)\n          .sort((a, b) => {\n            const textA = a.state.toUpperCase()\n            const textB = b.state.toUpperCase()\n            return textA < textB ? -1 : textA > textB ? 1 : 0\n          })\n          .map(stateInfo => (\n            <Compensation\n              key={stateInfo.state}\n              stateInfo={stateInfo}\n              onPercentageChange={handlePercentChange}\n            />\n          ))}\n      </ul>\n      <StepButtons step={6} {...props} />\n    </div>\n  )\n}\n\nexport default StateCompensation\n","import TextField from '../../components/TextField'\nimport StepButtons from './StepButtons'\nimport { Controller, useFormContext } from 'react-hook-form'\nimport NumberFormat from 'react-number-format'\nimport ReactTooltip from 'react-tooltip'\nimport Icon from '../../components/Icon'\n\nconst waCreditScore = {\n  title: 'WA Credit Score',\n  tooltip: 'This is the WA Credit Score',\n  name: 'loanType.waCreditScore'\n}\n\nconst waDebtToIncome = {\n  title: 'WA Debt To Income',\n  tooltip: 'This is the WA debt to income',\n  name: \"loanType.waDebtToIncome\"\n}\n\nconst waLTV = {\n  title: 'WA Loan To Value',\n  tooltip: 'This is the WA Loan to value',\n  name: \"loanType.waLTV\"\n}\n\nconst waCLTV = {\n  title: 'WA Combined Loan To Value',\n  tooltip: 'This is the WA combined loan to value',\n  name: \"loanType.waCLTV\"\n}\n\nconst classDependentFields = {\n  Consumer: [waCreditScore],\n  'Commercial & Industrial': [waDebtToIncome, waLTV, waCLTV],\n  Residential: [waCreditScore, waLTV, waCLTV],\n  'Commercial Real Estate': [waDebtToIncome, waLTV, waCLTV],\n  Other: [waDebtToIncome, waCreditScore]\n}\n\nconst LabelTooltip = ({ label, tip }) => (\n  <div className=\"flex items-center mb-2\">\n    <ReactTooltip />\n    <label className=\"inline-block mr-1 text-md whitespace-nowrap\">{label}</label>\n    <Icon id=\"question\" className=\"w-3 h-3\" data-tip={tip} />\n  </div>\n)\n\nconst NumericalDetails = props => {\n  const {\n    control,\n    handleSubmit,\n    formState: { errors }\n  } = useFormContext()\n\n  const loanClass = props.form.loanType?.loanClass\n\n  const onSubmit = data => {\n    console.log('Data', data)\n    props.update('generalInfo', data.generalInfo)\n    props.update('loanTerm', data.loanTerm)\n    props.update('loanType', data.loanType)\n    props.nextStep()\n  }\n\n  // console.log(formState)\n  // console.log(classDependentFields)\n\n  return (\n    <div className=\"pt-10 mt-10\">\n      <h3>Enter numerical details of the loan</h3>\n      <br />\n      <form className=\"grid grid-cols-2 gap-4\">\n        <div className=\"col-span-1\">\n          <LabelTooltip\n            label=\"Current Balance\"\n            tip=\"This is the current balance\"\n          />\n          {errors.generalInfo?.currentBalance && (\n            <div className=\"mb-1 text-sm text-red-600\">\n              {errors.generalInfo?.currentBalance?.message}\n            </div>\n          )}\n          <Controller\n            render={({ field: { onChange, value } }) => {\n              return (\n                <NumberFormat\n                  value={value}\n                  className=\"w-full mb-2\"\n                  placeholder=\"#\"\n                  thousandSeparator={true}\n                  prefix={'$'}\n                  control={control}\n                  fixedDecimalScale={true}\n                  allowEmptyFormatting={false}\n                  allowNegative={false}\n                  customInput={TextField}\n                  onValueChange={c => {\n                    onChange(c.value)\n                  }}\n                />\n              )\n            }}\n            name=\"generalInfo.currentBalance\"\n            control={control}\n          />\n          <LabelTooltip label=\"WA Balance\" tip=\"This is the WA balance\" />\n          {errors.generalInfo?.waBalance && (\n            <div className=\"mb-1 text-sm text-red-600\">\n              {errors.generalInfo?.waBalance?.message}\n            </div>\n          )}\n          <Controller\n            render={({ field: { onChange, value } }) => {\n              return (\n                <NumberFormat\n                  value={value}\n                  className=\"w-full mb-2\"\n                  placeholder=\"#\"\n                  thousandSeparator={true}\n                  prefix={'$'}\n                  control={control}\n                  fixedDecimalScale={true}\n                  allowEmptyFormatting={false}\n                  allowNegative={false}\n                  customInput={TextField}\n                  onValueChange={c => {\n                    onChange(c.value)\n                  }}\n                />\n              )\n            }}\n            name=\"generalInfo.waBalance\"\n            control={control}\n          />\n          <LabelTooltip label=\"Loan Count\" tip=\"This is the loan count\" />\n          {errors.generalInfo?.count && (\n            <div className=\"mb-1 text-sm text-red-600\">\n              {errors.generalInfo?.count?.message}\n            </div>\n          )}\n          <Controller\n            render={({ field: { onChange, value } }) => {\n              return (\n                <NumberFormat\n                  value={value}\n                  className=\"w-full mb-2\"\n                  placeholder=\"#\"\n                  thousandSeparator={true}\n                  control={control}\n                  fixedDecimalScale={true}\n                  allowEmptyFormatting={false}\n                  allowNegative={false}\n                  customInput={TextField}\n                  onValueChange={c => {\n                    onChange(c.value)\n                  }}\n                />\n              )\n            }}\n            name=\"generalInfo.count\"\n            control={control}\n          />\n          <LabelTooltip\n            label=\"WA Remaining Term\"\n            tip=\"This is the WA remaining term\"\n          />\n          {errors.loanTerm?.waRemainingTerm && (\n            <div className=\"mb-1 text-sm text-red-600\">\n              {errors.loanTerm?.waRemainingTerm?.message}\n            </div>\n          )}\n          <Controller\n            render={({ field: { onChange, value } }) => {\n              return (\n                <NumberFormat\n                  value={value}\n                  className=\"w-full mb-2\"\n                  placeholder=\"#\"\n                  control={control}\n                  allowEmptyFormatting={false}\n                  allowNegative={false}\n                  customInput={TextField}\n                  onValueChange={c => {\n                    onChange(c.value)\n                  }}\n                />\n              )\n            }}\n            name=\"loanTerm.waRemainingTerm\"\n            control={control}\n          />\n        </div>\n        <div className=\"col-span-1\">\n          <LabelTooltip\n            label=\"Original Balance\"\n            tip=\"This is the original balance\"\n          />\n          {errors.generalInfo?.originalBalance && (\n            <div className=\"mb-1 text-sm text-red-600\">\n              {errors.generalInfo?.originalBalance?.message}\n            </div>\n          )}\n          <Controller\n            render={({ field: { onChange, value } }) => {\n              return (\n                <NumberFormat\n                  value={value}\n                  className=\"w-full mb-2\"\n                  placeholder=\"#\"\n                  thousandSeparator={true}\n                  prefix={'$'}\n                  control={control}\n                  fixedDecimalScale={true}\n                  allowEmptyFormatting={false}\n                  allowNegative={false}\n                  customInput={TextField}\n                  onValueChange={c => {\n                    onChange(c.value)\n                  }}\n                />\n              )\n            }}\n            name=\"generalInfo.originalBalance\"\n            control={control}\n          />\n          <LabelTooltip label=\"Price\" tip=\"This is the price\" />\n          <Controller\n            render={({ field: { onChange, value } }) => {\n              return (\n                <NumberFormat\n                  value={value}\n                  className=\"w-full mb-2\"\n                  placeholder=\"Par Value\"\n                  thousandSeparator={true}\n                  control={control}\n                  fixedDecimalScale={true}\n                  allowEmptyFormatting={false}\n                  allowNegative={false}\n                  customInput={TextField}\n                  onValueChange={c => {\n                    onChange(c.value)\n                  }}\n                />\n              )\n            }}\n            name=\"generalInfo.price\"\n            control={control}\n          />\n          <LabelTooltip label=\"Gross WAC\" tip=\"This is the gross WAC\" />\n          {errors.generalInfo?.grossWAC && (\n            <div className=\"mb-1 text-sm text-red-600\">\n              {errors.generalInfo?.grossWAC?.message}\n            </div>\n          )}\n          <Controller\n            render={({ field: { onChange, value } }) => {\n              return (\n                <NumberFormat\n                  value={value}\n                  className=\"w-full mb-2\"\n                  placeholder=\"%\"\n                  control={control}\n                  allowEmptyFormatting={false}\n                  allowNegative={false}\n                  fixedDecimalScale={true}\n                  decimalScale={2}\n                  maxLength={6}\n                  allowLeadingZeros={true}\n                  customInput={TextField}\n                  onValueChange={c => {\n                    onChange(c.value)\n                  }}\n                />\n              )\n            }}\n            name=\"generalInfo.grossWAC\"\n            control={control}\n            rules={{\n              min: {\n                value: 0.01,\n                message: 'Only values greater than 0.01 allowed'\n              },\n              max: { value: 100, message: 'Max value not greater than 100' }\n            }}\n          />\n          <LabelTooltip label=\"Servicing Fee\" tip=\"This is the servicing fee\" />\n          {errors.generalInfo?.serviceFee && (\n            <div className=\"mb-1 text-sm text-red-600\">\n              {errors.generalInfo?.serviceFee?.message}\n            </div>\n          )}\n          <Controller\n            render={({ field: { onChange, value } }) => {\n              return (\n                <NumberFormat\n                  value={value}\n                  className=\"w-full mb-2\"\n                  placeholder=\"bps\"\n                  control={control}\n                  allowEmptyFormatting={false}\n                  allowNegative={false}\n                  decimalScale={0}\n                  maxLength={3}\n                  customInput={TextField}\n                  onValueChange={c => {\n                    onChange(c.value)\n                  }}\n                />\n              )\n            }}\n            name=\"generalInfo.serviceFee\"\n            control={control}\n            rules={{\n              min: {\n                value: 0,\n                message: 'Greater or equal than zero values allowed'\n              },\n              max: { value: 200, message: 'Max value not greater than 200' }\n            }}\n          />\n        </div>\n        {/* Class related input fields */}\n        {loanClass && classDependentFields[loanClass].map((field,index) => (\n          <div key={`field.name-${index}`}>\n            <LabelTooltip\n              label={field.title}\n              tip={field.tooltip}\n            />\n            <Controller\n              render={({ field: { onChange, value } }) => {\n                return (\n                  <NumberFormat\n                    value={value}\n                    className=\"w-full mb-2\"\n                    placeholder=\"#\"\n                    control={control}\n                    allowEmptyFormatting={false}\n                    allowNegative={false}\n                    customInput={TextField}\n                    onValueChange={c => {\n                      onChange(c.value)\n                    }}\n                  />\n                )\n              }}\n              name={field.name}\n              control={control}\n            />\n          </div>\n        ))}\n        <div>\n          <LabelTooltip\n            label=\"Seller Retained\"\n            tip=\"This is the seller retained\"\n          />\n          {errors.generalInfo?.sellerRetainedPercent && (\n            <div className=\"mb-1 text-sm text-red-600\">\n              {errors.generalInfo?.sellerRetainedPercent?.message}\n            </div>\n          )}\n          <Controller\n            render={({ field: { onChange, value } }) => {\n              return (\n                <NumberFormat\n                  className=\"w-full mb-2\"\n                  placeholder=\"%\"\n                  control={control}\n                  allowEmptyFormatting={true}\n                  allowNegative={false}\n                  decimalScale={0}\n                  customInput={TextField}\n                  value={value === undefined || value === '' ? '0' : value}\n                  onValueChange={c => {\n                    onChange(c.value)\n                  }}\n                />\n              )\n            }}\n            name=\"generalInfo.sellerRetainedPercent\"\n            control={control}\n            rules={{\n              min: { value: 0, message: 'Only non zero values allowed' },\n              max: { value: 100, message: 'Max value not greater than 100' }\n            }}\n            defaultValue={'0'}\n          />\n        </div>\n      </form>\n      <StepButtons step={7} {...props} nextStep={handleSubmit(onSubmit)} />\n    </div>\n  )\n}\n\nexport default NumericalDetails\n","import { useDropzone } from 'react-dropzone'\nimport Icon from '../../components/Icon'\n\nconst UploadDropZone = ({ children, text, id, onDrop, accept }) => {\n  const { getRootProps, getInputProps } = useDropzone({\n    onDrop,\n    noClick: true,\n    noKeyboard: true,\n    accept\n  })\n\n  return (\n    <section className=\"p-4 border rounded-md border-quickSilver\">\n      <div\n        {...getRootProps({\n          className:\n            'h-72 border-2 border-quickSilver rounded-md border-dashed flex flex-col items-center justify-center'\n        })}\n      >\n        <input id={id} {...getInputProps()} />\n        <label\n          htmlFor={id}\n          style={{ backgroundColor: '#59a8ab'}}\n          className=\"px-6 py-5 text-white rounded-lg cursor-pointer\"\n        >\n          <Icon style={{ color: '#59a8ab'}} className=\"inline-block w-4 h-4 mr-2 fill-current\" id=\"upload\" />\n          {text}\n        </label>\n        <span className=\"mt-2 text-quickSilver text-md\">or drag them in</span>\n      </div>\n      <aside className=\"pt-2\">\n        <h2>PDF Files Only</h2>\n      </aside>\n      {children}\n    </section>\n  )\n}\n\nexport default UploadDropZone\n","export default __webpack_public_path__ + \"static/media/HELOC_pool.63eeec4c.pdf\";","import { useState, useCallback } from 'react'\nimport StepButtons from './StepButtons'\nimport UploadDropZone from '../../components/UploadDropZone'\nimport heloc_pool from '../../assets/HELOC_pool.pdf'\n\nconst UploadBrochure = props => {\n  const [files, setFiles] = useState([])\n\n  const onDrop = useCallback(\n    acceptedFiles => {\n      console.log(acceptedFiles)\n      if (acceptedFiles.length > 0) {\n        setFiles(acceptedFiles)\n        props.update('brochure', acceptedFiles)\n      }\n    },\n    [props]\n  )\n\n  return (\n    <div className=\"pt-10 mt-10\">\n      <h3 className=\"text-xl font-bold\">Upload brochure (optional)</h3>\n      <p className=\"inline-block my-2 font-bold text-md text-onyx\">\n        Upload sales sheet of the assets within the loan pool.\n      </p>\n      <p className=\"inline-block mb-2 font-bold text-md text-onyx\">\n        This will be downloadable in the marketplace\n      </p>\n      <UploadDropZone\n        id=\"documents\"\n        text=\"Upload Brochure\"\n        onDrop={onDrop}\n        accept=\".pdf\"\n      >\n        <ul className=\"flex flex-wrap\">\n          {files.map(file => (\n            <li key={file.path}>{file.path}</li>\n          ))}\n        </ul>\n      </UploadDropZone>\n      <p className=\"inline-block mt-4 text-md\">\n        Download a sample brochure{' '}\n        <a\n          className=\"underline\"\n          href={heloc_pool}\n          target=\"_blank\"\n          rel=\"noreferrer\"\n        >\n          here\n        </a>\n      </p>\n      <StepButtons step={8} {...props} />\n    </div>\n  )\n}\n\nexport default UploadBrochure\n","import LoanCard from '../../components/LoanCard'\nimport StepButtons from './StepButtons'\n\nconst Submit = props => {\n  const isUploading = props.isUploading\n  const isSuccess = props.isSuccess\n  const isErrorUpload = props.isErrorUpload\n  const isErrorBrochure = props.ErrorBrochure\n  const loanpool = props.loanpool\n\n  return (\n    <div className=\"pt-10 mt-10\">\n      <h3>Review loan pool</h3>\n      <br />\n      <label className=\"inline-block mb-2 text-md\">\n        Double check that all information is entered correctly before loan pool\n        is entered into the marketplace.\n      </label>\n      <br />\n      <LoanCard loanPool={loanpool} footer={false} />\n      {isSuccess ? (\n        <div className=\"mt-10 text-center text-pantone\">\n          Uploaded successfully\n        </div>\n      ) : null}\n      {isErrorBrochure ? (\n        <div className=\"my-3 text-sm text-center text-red-600\">\n          Error uploading brochure, please try again later\n        </div>\n      ) : null}\n      {isErrorUpload ? (\n        <div className=\"my-3 text-sm text-center text-red-600\">\n          Something went wrong, please try again later\n        </div>\n      ) : null}\n      {isUploading ? (\n        <div className=\"my-10 text-center animate-pulse\">Uploading...</div>\n      ) : isSuccess ? null : (\n        <StepButtons step={9} {...props} nextStep={props.submit} />\n      )}\n    </div>\n  )\n}\n\nexport default Submit\n","import StepButtons from './StepButtons'\nimport loanClasses from './loanClasses.json'\nimport { useFormContext } from 'react-hook-form'\n\nconst ProductType = props => {\n  const {\n    register,\n    handleSubmit,\n    formState: { errors }\n  } = useFormContext()\n  const loanType = props.form.loanType?.loanClass\n\n  const onSubmit = data => {\n    props.update('loanType', data.loanType )\n    props.nextStep()\n  }\n\n  return (\n    <div className=\"pt-10 mt-10\">\n      <h3>Select the loan pool type</h3>\n      <br />\n        {errors.loanType?.type && (\n          <div className=\"mb-1 text-sm text-red-600\">\n            Please select a loan pool type\n          </div>\n        )}\n        <form>\n          {loanType &&\n            loanClasses[loanType].map((item, index) => (\n              <div key={item.id + '-' + index}>\n                <input\n                  type=\"radio\"\n                  value={item.name}\n                  name=\"loanTypes\"\n                  {...register('loanType.type', {\n                    required: props.isActive,\n                  })}\n                />{' '}\n                <span>{item.name}</span>\n              </div>\n            ))}\n        </form>\n      <StepButtons step={4} {...props} nextStep={handleSubmit(onSubmit)} />\n    </div>\n  )\n}\n\nexport default ProductType\n","const ProgressBar = props => {\n  return (\n    <div className=\"absolute left-1/2 transform -translate-x-1/2 -translate-y-1/2 mt-3 w-screen overflow-hidden\">\n      <div className=\"overflow-hidden h-2 mb-4 text-xs flex bg-gray-200\">\n        <div\n          style={{ width: `${(100 / props.totalSteps) * props.currentStep}%` }}\n          className=\"shadow-none flex flex-col text-center whitespace-nowrap text-white rounded-md justify-center bg-pantone\"\n        ></div>\n      </div>\n    </div>\n  )\n}\n\nexport default ProgressBar\n","import React, { useCallback, useEffect, useState } from 'react'\nimport { useHistory } from 'react-router'\nimport ConfirmationModal from './ConfirmationModal'\n\nexport function RouterPrompt(props) {\n  const { when, onOK, onCancel, title, textOk, textCancel } = props\n\n  const history = useHistory()\n\n  const [showPrompt, setShowPrompt] = useState(false)\n  const [currentPath, setCurrentPath] = useState('')\n\n  useEffect(() => {\n    if (when) {\n      history.block(prompt => {\n        setCurrentPath(prompt.pathname)\n        setShowPrompt(true)\n        return 'true'\n      })\n    } else {\n      history.block(() => {})\n    }\n\n    return () => {\n      history.block(() => {})\n    }\n  }, [history, when])\n\n  const handleOK = useCallback(async () => {\n    if (onOK) {\n      const canRoute = await Promise.resolve(onOK())\n      if (canRoute) {\n        history.block(() => {})\n        history.push(currentPath)\n      }\n    }\n  }, [currentPath, history, onOK])\n\n  const handleCancel = useCallback(async () => {\n    if (onCancel) {\n      const canRoute = await Promise.resolve(onCancel())\n      if (canRoute) {\n        history.block(() => {})\n        history.push(currentPath)\n      }\n    }\n    setShowPrompt(false)\n  }, [currentPath, history, onCancel])\n\n  return showPrompt ? (\n    <ConfirmationModal\n      title={title}\n      textOk={textOk}\n      textCancel={textCancel}\n      showPrompt={showPrompt}\n      handleOK={handleOK}\n      handleCancel={handleCancel}\n    />\n  ) : null\n}\n","import { useState, useEffect } from 'react'\nimport AppBar from '../../components/AppBar'\nimport StepWizard from 'react-step-wizard'\nimport Details from './Details'\nimport ListingType from './ListingType'\nimport ProductClass from './ProductClass'\nimport Tags from './Tags'\nimport StateCompensation from './StateCompensation'\nimport NumericalDetails from './NumericalDetails'\nimport UploadBrochure from './UploadBrochure'\nimport Submit from './Submit'\nimport ProductType from './ProductType'\nimport ProgressBar from './ProgressBar'\nimport { RouterPrompt } from '../../components/RouterPrompt'\nimport { useForm, FormProvider } from 'react-hook-form'\nimport { updateLoanPool } from '../../data/loanPools'\nimport { uploadDoc } from '../../data/documents'\nimport toaster from 'react-hot-toast';\n\nconst Upload = ({ location }) => {\n  const methods = useForm({ defaultValues: { productTags: [] } })\n  const formState = methods.formState\n  const trigger = methods.trigger\n  const { email, entity } = JSON.parse(localStorage.getItem('user'))\n  const [showSubmitPrompt, setSubmitPrompt] = useState(false)\n  const [showLeavePrompt, setLeavePrompt] = useState(false)\n  const [currentStep, setCurrentStep] = useState()\n  const [mapData, setMapData] = useState(null)\n\n  // From submit component\n  const [isUploading, setIsUploading] = useState(false)\n  const [isSuccess, setIsSuccess] = useState(false)\n  const [isErrorUpload, setIsErrorUpload] = useState(false)\n  const [isErrorBrochure, setIsErrorBrochure] = useState(false)\n\n  const [state, updateState] = useState({\n    form: {\n      conversationSid: null,\n      owner: { email, entity, displayName: email },\n      brochure: null\n    }\n  })\n\n  const updateForm = (key, value) => {\n    const { form } = state\n\n    form[key] = value\n    updateState({\n      ...state,\n      form\n    })\n  }\n\n  const onStepChange = stats => {\n    setCurrentStep(stats.activeStep)\n    if (stats.activeStep > 4) {\n      // Trigger validation manually for all screens\n      trigger()\n    }\n\n    if (\n      (stats.previousStep === 6 && stats.activeStep === 5) ||\n      (stats.previousStep === 6 && stats.activeStep === 7)\n    ) {\n      window.scrollTo({\n        top: 0,\n        behavior: 'smooth'\n      })\n    }\n  }\n\n  useEffect(() => {\n    // Load loanpool from history.push state\n    if (location.state) {\n      console.log('Location state', location.state)\n      methods.reset(location.state)\n      setMapData(location.state.statesInfo)\n    }\n  }, [location.state])\n\n  useEffect(() => {\n    window.addEventListener('beforeunload', alertUser)\n    // logic after leaving the page\n    // window.addEventListener('unload', afterLeavePage)\n    return () => {\n      window.removeEventListener('beforeunload', alertUser)\n      // logic after leaving the page\n      // window.removeEventListener('unload', afterLeavePage)\n      // handleEndConcert()\n    }\n  }, [])\n\n  const alertUser = e => {\n    e.preventDefault()\n    e.returnValue = ''\n  }\n\n  // const afterLeavePage = async () => {\n  //   await fetcher({\n  //     url: endConcert(concert.id),\n  //     method: 'PUT'\n  //   })\n  // }\n  const handleSubmitOk = () => {\n    // console.log('Ok')\n    submit()\n    return true\n  }\n\n  const handleSubmitCancel = () => {\n    // console.log('Cancel')\n    return true\n  }\n\n  const handleLeaveOk = () => {\n    // console.log('Leave Ok')\n    return true\n  }\n\n  const handleLeaveCancel = () => {\n    // console.log('Leave Cancel')\n    return false\n  }\n\n  const submit = async () => {\n    const loanpool = state.form\n\n    if (currentStep === 9) {\n      loanpool.status = 'not started'\n    }\n\n    setIsUploading(true)\n    setIsErrorUpload(false)\n    setIsErrorBrochure(false)\n    updateLoanPool(loanpool)\n      .then(loanRes => {\n        if (loanpool.brochure) {\n          const file = loanpool.brochure[0]\n          const formData = new FormData()\n          formData.append('name', file.name.substr(0, file.name.indexOf('.')))\n          formData.append('description', 'brochure')\n          formData.append('filetype', file.type)\n          formData.append('data', file)\n          formData.append('accessType', file.accessType | 'ALL_ACCESS')\n          uploadDoc(loanRes.id, formData)\n            .then(res => {\n              console.log('Successful upload', res)\n              setIsErrorBrochure(false)\n            })\n            .catch(e => {\n              console.log('Error uploading brochure', e)\n              setIsErrorBrochure(true)\n            })\n        }\n        setTimeout(() => {\n          setIsSuccess(true)\n          setIsUploading(false)\n          setIsErrorUpload(false)\n          setSubmitPrompt(false)\n          toaster.success('Loan pool saved')\n        }, 3000)\n      })\n      .catch(e => {\n        console.log(e)\n        toaster.error('Something went wrong')\n        setIsUploading(false)\n        setIsErrorUpload(true)\n      })\n  }\n\n  useEffect(() => {\n    if (currentStep > 4 && formState.isValid) {\n      setSubmitPrompt(true)\n      setLeavePrompt(false)\n    } else {\n      setSubmitPrompt(false)\n      setLeavePrompt(true)\n    }\n    // Disable prompts after successfull loan upload\n    if (isSuccess) {\n      setSubmitPrompt(false)\n      setLeavePrompt(false)\n    }\n  }, [formState])\n\n  return (\n    <div>\n      <AppBar />\n      {showSubmitPrompt ? (\n        <>\n          <RouterPrompt\n            title=\"Do you want to save your loan pool\\n and come back to it later?\"\n            textOk=\"Save loan pool\"\n            textCancel=\"Delete\"\n            when={showSubmitPrompt}\n            onOK={handleSubmitOk}\n            onCancel={handleSubmitCancel}\n          />\n        </>\n      ) : null}\n      {showLeavePrompt ? (\n        <>\n          <RouterPrompt\n            title=\"Discard your changes?\"\n            textOk=\"Accept\"\n            textCancel=\"Cancel\"\n            when={showLeavePrompt}\n            onOK={handleLeaveOk}\n            onCancel={handleLeaveCancel}\n          />\n        </>\n      ) : null}\n      <div className=\"container relative mx-auto\">\n        <div className=\"md:flex md:justify-center mb-7\">\n          <FormProvider {...methods}>\n            <StepWizard\n              className=\"min-w-wizard max-w-wizard\"\n              onStepChange={onStepChange}\n              nav={<ProgressBar />}\n            >\n              <Details update={updateForm} />\n              <ListingType update={updateForm} />\n              <ProductClass update={updateForm} />\n              <ProductType update={updateForm} form={state.form} />\n              <Tags update={updateForm} />\n              <StateCompensation update={updateForm} initialData={mapData} />\n              <NumericalDetails update={updateForm} form={state.form}/>\n              <UploadBrochure update={updateForm} />\n              <Submit\n                isUploading={isUploading}\n                isSuccess={isSuccess}\n                isErrorUpload={isErrorUpload}\n                isErrorBrochure={isErrorBrochure}\n                loanpool={state.form}\n                submit={submit}\n              />\n            </StepWizard>\n          </FormProvider>\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default Upload\n","export default __webpack_public_path__ + \"static/media/three-dots.47158f33.svg\";","import _ from 'lodash'\nimport dots from '../../assets/three-dots.svg'\n\nconst DocumentItem = ({\n  doc,\n  index,\n  handleSelectDoc,\n  handleVersion\n}) => {\n  return (\n    <div className=\"flex-shrink-0 mx-2 my-3\" key={index}>\n      <img\n        className=\"w-32 h-32 shadow cursor-pointer rounded-md\"\n        onClick={() => handleSelectDoc(index)}\n        src={doc.thumbnail}\n        alt={doc.filename}\n      />\n      <div className=\"flex justify-between mt-2\">\n        <div className=\"pt-1 text-sm font-bold whitespace-nowrap\">\n          {_.truncate(doc.filename, { length: 16 })}\n        </div>\n        <div>\n          <img\n            className=\"w-6 cursor-pointer\"\n            onClick={() => handleVersion(index)}\n            src={dots}\n            alt=\"dots\"\n          />\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default DocumentItem\n","import classNames from 'classnames'\n\nconst classes = {\n  button: 'p-2 text-xs bg-white border rounded-full',\n  disabled: 'opacity-50 cursor-default'\n}\n\nconst ButtonSmall = ({\n  label,\n  isLoading,\n  loadingLabel,\n  onClick,\n  disabled,\n}) => {\n  return (\n    <>\n      <button\n        disabled={isLoading || disabled}\n        onClick={onClick}\n        className={classNames(\n          {[classes['disabled']]: disabled},\n          classes['button']\n        )}\n      >\n        {isLoading ? (\n          <span className=\"text-pantone animate-pulse\">{loadingLabel}</span>\n        ) : (\n          <span>{label}</span>\n        )}\n      </button>\n    </>\n  )\n}\n\nexport default ButtonSmall\n","import _ from 'lodash'\nimport { useState } from 'react'\nimport api from '../../data/api'\nimport toaster from 'react-hot-toast'\nimport { restoreDoc } from '../../data/documents'\nimport ButtonSmall from './ButtonSmall'\nimport useAllDocuments from '../../data/hooks/useAllDocuments'\n\nconst VersionItem = ({\n  name,\n  date,\n  link,\n  filename,\n  version,\n  loanId,\n  currentVersion,\n  source,\n  reviewContract,\n  setModalContractOpen,\n  contractSigned,\n  showButtonsReviewContract\n}) => {\n  const [isDownloading, setIsDownloading] = useState(false)\n  const [isRestoring, setIsRestoring] = useState(false)\n  const uploadDate = new Date(date).toLocaleString()\n  const { refetch } = useAllDocuments(loanId)\n\n  const handleDownload = async () => {\n    setIsDownloading(true)\n    try {\n      // Current version for first item in the list\n      const file = await api().get(link, {\n        responseType: 'blob',\n        responseEncoding: 'binary'\n      })\n\n      const doc = await URL.createObjectURL(file.data)\n      const a = document.createElement('a')\n      a.href = doc\n      a.download = name\n      setTimeout(() => {\n        a.click()\n        URL.revokeObjectURL(doc)\n        setIsDownloading(false)\n      }, 3000)\n    } catch (e) {\n      setIsDownloading(false)\n      console.log(e)\n      toaster.error('Unable to get file')\n    }\n  }\n\n  // /loanpool/pool/:id/restoreDoc --> with\n  // { \"docName\": \"string\", \"version\": \"string\" }\n  // version is the desired version\n  const handleRestore = () => {\n    setIsRestoring(true)\n    const data = {\n      docName: filename,\n      version: version\n    }\n    restoreDoc(loanId, data)\n      .then(res => {\n        console.log(res)\n        setTimeout(() => {\n          setIsRestoring(false)\n          toaster.success('Document restored!')\n          refetch()\n        }, 2000)\n      })\n      .catch(err => {\n        console.log(err)\n        setTimeout(() => {\n          setIsRestoring(false)\n          toaster.error(err.response.data.message || err.response.data.error)\n        }, 2000)\n      })\n  }\n\n  return (\n    <>\n      <li className=\"px-6 pt-4 overflow-hidden bg-gray-100 border border-gray-300 rounded-lg\">\n        <p className=\"text-xl font-bold\">{_.truncate(name, { length: 25 })}</p>\n        <p className=\"text-sm\">{uploadDate}</p>\n        {!currentVersion ? <p className=\"text-sm\">Version: {version}</p> : null}\n        <div className=\"flex justify-between pt-2 my-2\">\n          {currentVersion ? (\n            <>\n              <ButtonSmall label={`Current version: ${currentVersion}`} />\n              <ButtonSmall\n                label=\"Download\"\n                onClick={handleDownload}\n                isLoading={isDownloading}\n                loadingLabel=\"Downloading\"\n              />\n              {source === 'contract' ? (\n                <>\n                  <ButtonSmall\n                    disabled={contractSigned || !showButtonsReviewContract}\n                    label={contractSigned ? 'Signed' : 'Sign'}\n                    onClick={reviewContract}\n                  />\n                  <ButtonSmall\n                    label=\"View All\"\n                    onClick={() => setModalContractOpen(true)}\n                  />\n                </>\n              ) : null}\n            </>\n          ) : (\n            <>\n              <ButtonSmall\n                label=\"Restore\"\n                onClick={handleRestore}\n                isLoading={isRestoring}\n                loadingLabel=\"Restoring\"\n              />\n              <ButtonSmall\n                label=\"Download\"\n                onClick={handleDownload}\n                isLoading={isDownloading}\n                loadingLabel=\"Downloading\"\n              />\n              <button className=\"p-2 text-xs bg-white border rounded-full\">\n                Audit log\n              </button>\n            </>\n          )}\n        </div>\n      </li>\n    </>\n  )\n}\n\nexport default VersionItem\n","const VersionContainer = ({ title, filename, children }) => {\n  return (\n    <div className=\"w-400\">\n      <div className=\"px-2 py-4 mb-3 bg-white border-b border-gray-200 sm:px-2\">\n        <h3 className=\"font-medium font-bold text-gray-900 leading-6\">\n          {filename}\n        </h3>\n        <p className=\"pt-1 text-sm text-gray-600\">{title}</p>\n      </div>\n      <ul className=\"px-3 pb-4 overflow-y-auto space-y-3 h-screen/2\">\n        {children}\n      </ul>\n    </div>\n  )\n}\n\nexport default VersionContainer\n","import VersionItem from './VersionItem'\nimport VersionContainer from './VersionContainer'\n\nconst DocumentVersion = props => {\n  const versions = props.doc?.links.versionedDocs.slice(0).reverse()\n  const latest = versions[0]\n  const doc = props.doc\n  const filename = props.doc?.filename\n\n  return (\n    <VersionContainer title=\"Version History\" filename={filename}>\n      <VersionItem\n        name={doc?.filename}\n        date={doc?.created}\n        filename={doc?.name}\n        loanId={doc?.poolId}\n        link={latest?.link}\n        currentVersion={doc?.currentVersion}\n      />\n      {versions.length > 1 &&\n        versions.map((item, index) => (\n          <VersionItem\n            key={index}\n            date={item.uploadDate}\n            name={item.link.split('/').pop()}\n            link={item.link}\n            filename={doc?.name}\n            version={item.version}\n            loanId={doc?.poolId}\n          />\n        ))}\n    </VersionContainer>\n  )\n}\n\nexport default DocumentVersion\n","import Modal from 'react-modal'\nimport dateFormat from 'dateformat'\nimport classNames from 'classnames'\nimport _ from 'lodash'\nimport { useEffect, useState } from 'react'\nimport Button from '../Button'\nimport { getDocthumbnail } from '../../data/documents'\nimport useAllDocuments from '../../../src/data/hooks/useAllDocuments'\nimport api from '../../data/api'\nimport DocumentItem from './DocumentItem'\nimport DocumentVersion from '../DocumentVersion'\nimport modalStyles from '../../assets/styles/modalStyles'\nimport toaster from 'react-hot-toast'\n\nconst DocumentHistory = ({ loanId, carousel = false }) => {\n  const [documents, setDocuments] = useState([])\n  const [selectedDoc, setSelectedDoc] = useState(null)\n  const [isModalOpen, setModalOpen] = useState(false)\n  const [selectedVersion, setSelectedVersion] = useState(null)\n  const [isModalVersionOpen, setModalVersionOpen] = useState(false)\n  const [isLoadingInfo, setIsLoadingInfo] = useState(false)\n  const { isLoading, isSuccess, data, refetch, error } = useAllDocuments(loanId)\n\n  useEffect(() => {\n    setDocuments([])\n    if (isSuccess) {\n      setIsLoadingInfo(true)\n      const docsInfo = data\n      docsInfo.forEach(async docInfo => {\n        const links = await getDocthumbnail(loanId, docInfo.name)\n        // Show latest version\n        const file = await api().get(links.versionedDocs[0].link, {\n          responseType: 'blob',\n          responseEncoding: 'binary'\n        })\n        const thumbnail = await api().get(links.thumbnail, {\n          responseType: 'blob'\n        })\n        const blob = URL.createObjectURL(thumbnail.data)\n        setDocuments(documents => [\n          ...documents,\n          {\n            ...docInfo,\n            file: file.data,\n            thumbnail: blob,\n            filename: docInfo.originalFilename,\n            links\n          }\n        ])\n      })\n      setIsLoadingInfo(false)\n    }\n  }, [loanId, data, isSuccess])\n\n  useEffect(() => {\n    // Documents service\n    if (error) {\n      if (error.response?.status === 403) {\n        toaster.error(error.response.data.message)\n      }\n    }\n  }, [error])\n\n  const handleSelectDoc = index => {\n    const selected = documents[index]\n    const doc = URL.createObjectURL(documents[index].file)\n\n    if (\n      selected.file.type.match('image.*') ||\n      selected.file.type === 'application/pdf'\n    ) {\n      setSelectedDoc(doc)\n      setModalOpen(true)\n    } else {\n      const a = document.createElement('a')\n      a.href = doc\n      a.download = selected.filename || 'download'\n      a.click()\n      URL.revokeObjectURL(doc)\n    }\n  }\n\n  const handleCloseModal = () => {\n    setModalOpen(false)\n  };\n\n  const handleVersion = index => {\n    const version = documents[index]\n    setSelectedVersion(version)\n    setModalVersionOpen(true)\n  }\n\n  useEffect(() => {\n    refetch()\n  }, [refetch])\n\n  return (\n    <div className={classNames('p-8 h-64 border-t border-r')}>\n      <div className=\"flex items-center justify-between\">\n        <h2\n          className={classNames(\n            'font-bold',\n            { 'text-md text-pantone pt-2': !carousel },\n            { 'text-xl': carousel }\n          )}\n        >\n          Document History\n        </h2>\n        <div className=\"flex items-center\">\n          <Button className=\"text-right underline\" variant=\"link\">\n            View all\n          </Button>\n        </div>\n      </div>\n      {isLoading || isLoadingInfo ? <p>Loading documents...</p> : null}\n\n      {carousel ? (\n        <div className=\"flex w-auto overflow-x-auto\">\n          {documents &&\n            documents.map((document, index) => (\n              <DocumentItem\n                key={`document-${index}`}\n                loanId={loanId}\n                doc={document}\n                index={index}\n                handleSelectDoc={handleSelectDoc}\n                handleVersion={handleVersion}\n              />\n            ))}\n        </div>\n      ) : (\n        <table className=\"w-full mt-8 table-fixed\">\n          <thead>\n            <tr className=\"pb-3 border-b border-platinum\">\n              <th className=\"w-3/5 pb-3 text-xs font-bold text-left uppercase text-onyx\">\n                Document\n              </th>\n              <th className=\"w-2/5 pb-3 text-xs font-bold text-center uppercase text-onyx\">\n                Date\n              </th>\n            </tr>\n          </thead>\n          <tbody className=\"h-32\">\n            {documents.map((doc, index) => {\n              const dobj = Date.parse(doc.created)\n              return (\n                <tr\n                  key={`document-${index}`}\n                  className=\"border-b border-platinum\"\n                >\n                  <td className=\"py-6 mr-5 text-sm font-bold whitespace-nowrap\">\n                    <Button\n                      variant=\"link\"\n                      onClick={() => handleSelectDoc(index)}\n                    >\n                      {_.truncate(doc.originalFilename, { length: 18 })}\n                    </Button>\n                  </td>\n                  <td className=\"py-6 text-sm\">\n                    {dateFormat(dobj, 'mmmm d, yyyy h:MM:ss TT')}\n                  </td>\n                </tr>\n              )\n            })}\n          </tbody>\n        </table>\n      )}\n\n      <Modal\n        isOpen={isModalOpen}\n        onRequestClose={() => setModalOpen(false)}\n        style={modalStyles}\n      >\n        <button\n          className=\"uk-button uk-button-danger uk-button-small\"\n          onClick={handleCloseModal}\n        >\n          Close\n        </button>\n        <iframe\n          title=\"selectedDoc\"\n          src={selectedDoc}\n          width=\"900px\"\n          height=\"500px\"\n        ></iframe>\n      </Modal>\n      <Modal\n        isOpen={isModalVersionOpen}\n        onRequestClose={() => setModalVersionOpen(false)}\n        style={modalStyles}\n      >\n        <DocumentVersion doc={selectedVersion} />\n      </Modal>\n    </div>\n  )\n}\n\nexport default DocumentHistory\n","import { useEffect, useState } from 'react'\nimport { createConversation } from '../../data/conversations'\nimport { getLoanPoolById } from '../../data/loanPools'\nimport AppBar from '../../components/AppBar'\nimport Chat from '../../components/Chat'\nimport ChatPanel from '../../components/ChatPanel'\nimport DocumentHistory from '../../components/DocumentHistory'\nimport ChatRoster from '../../components/ChatRoster'\nimport LoadingOverlay from 'react-loading-overlay-ts'\nimport { initConversations } from '../../data/utils'\nimport useTwilioClient from '../../data/hooks/useTwilioClient'\n\nconst LoanDetail = ({ match, location }) => {\n  const { loanId } = match.params\n  const [loanPool, setLoanPool] = useState(null)\n  const [currentSid, setCurrentSid] = useState('')\n  const [buyer, setBuyer] = useState('')\n  const { email, entity } = JSON.parse(localStorage.getItem('user'))\n  const [loadingOverlay, setLoadingOverlay] = useState(false)\n  const client = useTwilioClient(email)\n\n  const countersigner = new URLSearchParams(\n    document.location.search.substring(1)\n  ).get('buyerSign')\n\n  const esignConvSid = new URLSearchParams(\n    document.location.search.substring(1)\n  ).get('currentSid')\n\n  useEffect(() => {\n    const retrieveLoanPool = async () => {\n      const loanPool = await getLoanPoolById(loanId)\n      setLoanPool(loanPool)\n    }\n    retrieveLoanPool()\n  }, [loanId])\n\n  useEffect(() => {\n    if (loanPool)\n      initConversations(\n        loanPool,\n        email,\n        entity,\n        setBuyer,\n        createConversation,\n        setCurrentSid,\n        location,\n        countersigner,\n        esignConvSid,\n      )\n  }, [loanPool, location.state])\n\n  return (\n    <div>\n      <LoadingOverlay active={loadingOverlay} spinner>\n        {/*<p>Buyer signature: {buyer?.email}</p>*/}\n        <AppBar />\n        <div className=\"min-h-messages grid grid-cols-messages\">\n          <div className=\"flex flex-col justify-between\">\n            <ChatRoster\n              conversations={\n                loanPool?.conversations ? loanPool.conversations : []\n              }\n              loanPools={[loanPool]}\n              currentSid={currentSid}\n              source=\"detail\"\n            />\n            <DocumentHistory loanId={loanId} />\n          </div>\n          <Chat\n            loanPool={loanPool}\n            conversationSid={currentSid}\n            buyerDisplayName={buyer?.displayName}\n            client={client}\n          />\n          <ChatPanel\n            loanPool={loanPool}\n            buyerEmail={buyer?.email}\n            setLoadingOverlay={setLoadingOverlay}\n            currentSid={currentSid}\n          />\n        </div>\n      </LoadingOverlay>\n    </div>\n  )\n}\n\nexport default LoanDetail\n","import { Redirect, Route } from 'react-router-dom'\nimport { routes } from '../../router'\n\nconst PrivateRoute = ({ component: Component, ...props }) => {\n  const isUserLoggedIn = localStorage.getItem('user')\n\n  return (\n    <Route\n      {...props}\n      render={renderProps =>\n        isUserLoggedIn ? (\n          <Component {...renderProps} />\n        ) : (\n          <Redirect to={routes.login} />\n        )\n      }\n    />\n  )\n}\n\nexport default PrivateRoute\n","import Button from '../../components/Button'\n\nconst SectionModal = ({ title, onCancel, onSave, children, isLoading, disableSave = false }) => {\n  return (\n    <div className=\"text-center\">\n      <h4 className=\"text-xl font-bold text-pantone\">{title}</h4>\n      <div className=\"my-6 border-b\"></div>\n      <div className=\"my-6\">{children}</div>\n      <div className=\"my-6 border-b\"></div>\n      <div className=\"flex h-12 space-x-4\">\n        <Button variant=\"outlined\" className=\"flex-1\" onClick={onCancel} >Cancel</Button>\n        <Button variant=\"contained\" className=\"flex-1\" onClick={onSave} isLoading={isLoading} disabled={disableSave}>Save</Button>\n      </div>\n    </div>\n  )\n}\n\nexport default SectionModal\n","import { useState } from 'react'\nimport toaster from 'react-hot-toast'\nimport TextField from '../../components/TextField'\nimport SectionModal from '../Settings/SectionModal'\nimport { useForm } from 'react-hook-form'\nimport { updateBusiness } from '../../data/loanPools'\n\nconst EditFinancial = ({ entity, data, onCancel, reload }) => {\n  const [isLoading, setIsLoading] = useState(false)\n  const {\n    register,\n    handleSubmit,\n    formState: { isDirty },\n    reset\n  } = useForm({\n    defaultValues: {\n      name: entity,\n    }\n  })\n\n  const onSave = async data => {\n    setIsLoading(true)\n    try {\n      await updateBusiness(data)\n      setTimeout(() => {\n        setIsLoading(false)\n        // set to isDirty to false\n        reset(data)\n        reload()\n        toaster.success('Saved')\n      }, 2000)\n    } catch (e) {\n      setIsLoading(false)\n      if (e.response.data.message) {\n        toaster.error(e.response.data.message)\n      } else {\n        toaster.error('Something went wrong, please try again later')\n      }\n      console.log(e)\n      // set isSubmitSuccessful to false :)\n      throw e\n    }\n  }\n\n  return (\n    <SectionModal\n      isLoading={isLoading}\n      onCancel={onCancel}\n      onSave={handleSubmit(onSave)}\n      title=\"Financial Highlights\"\n      disableSave={!isDirty}\n    >\n      <div style={{ minWidth: 470 }} className=\"p-3 text-left space-y-5\">\n        <div className=\"grid grid-cols-2 gap-4\">\n          {data &&\n            Object.keys(data).map((item, index) => (\n              <div key={index} className=\"col-span-1\">\n                <div className=\"px-1\">\n                  <h5 className=\"mb-3 font-bold\">{data[item].title}</h5>\n                  <TextField\n                    type=\"number\"\n                    defaultValue={data[item].value}\n                    innerRef={register(data[item].name)} />\n                </div>\n              </div>\n            ))}\n        </div>\n      </div>\n    </SectionModal>\n  )\n}\n\nexport default EditFinancial\n","import { BeatLoader } from 'react-spinners'\nimport Icon from '../Icon'\n\nconst EditIcon = ({ isLoading=false, setOpen }) => {\n  return (\n    <>\n      {isLoading ? (\n        <BeatLoader\n          size={5}\n          color={'black'}\n        />\n      ) : (\n        <Icon\n          id=\"edit\"\n          className=\"w-4 h-4 cursor-pointer\"\n          onClick={() => setOpen(true)}\n        />\n      )}\n    </>\n  )\n}\n\nexport default EditIcon\n","import numeral from 'numeral'\nimport { useState } from 'react'\nimport Modal from 'react-modal'\nimport modalStyles from '../../assets/styles/modalStyles'\nimport EditFinancial from './EditFinancial'\nimport EditIcon from '../../components/Button/EditIcon'\n\nconst FinancialHighlights = ({ business, reload, isLoading }) => {\n  const [isEditOpen, setEditOpen] = useState(false)\n\n  const highlights = [\n    {\n      title: 'Assets',\n      text: numeral(business?.financials?.assets).format('$0,0'),\n      value: business?.financials?.assets,\n      name: 'financials.assets'\n    },\n    {\n      title: 'Shares/Total Deposits',\n      text: numeral(business?.financials?.totalDeposits).format('$0,0'),\n      value: business?.financials?.totalDeposits,\n      name: 'financials.totalDeposits'\n    },\n    {\n      title: 'Loans',\n      text: numeral(business?.financials?.loans).format('$0,0'),\n      value: business?.financials?.loans,\n      name: 'financials.loans'\n    },\n    {\n      title: '# of Members',\n      text: numeral(business?.financials?.members).format('0,0'),\n      value: business?.financials?.members,\n      name: 'financials.members'\n    },\n    {\n      title: 'Share Growth',\n      // text: numeral(business?.financials?.shareGrowth).format('0.00%'),\n      text: business?.financials?.shareGrowth ? business?.financials?.shareGrowth + '%' : '0%',\n      value: business?.financials?.shareGrowth,\n      name: 'financials.shareGrowth'\n    },\n    {\n      title: 'Loan Growth',\n      text: business?.financials?.loanGrowth ? business?.financials?.loanGrowth + '%' : '0%',\n      value: business?.financials?.loanGrowth,\n      name: 'financials.loanGrowth'\n    },\n    {\n      title: 'Net Worth Ratio',\n      text: business?.financials?.netWorthRatio ? business?.financials?.netWorthRatio + '%' : '0%',\n      value: business?.financials?.netWorthRatio,\n      name: 'financials.netWorthRatio'\n    },\n    {\n      title: 'Loan-to-Share',\n      text: business?.financials?.loanToShare ? business?.financials?.loanToShare + '%' : '0%',\n      value: business?.financials?.loanToShare,\n      name: 'financials.loanToShare'\n    }\n  ]\n  return (\n    <div>\n      <Modal\n        isOpen={isEditOpen}\n        style={modalStyles}\n        onRequestClose={() => setEditOpen(false)}\n      >\n        <EditFinancial\n          entity={business?.name}\n          data={highlights}\n          onCancel={() => setEditOpen(false)}\n          reload={reload}\n        />\n      </Modal>\n      <div className=\"flex justify-between\">\n        <h2 className=\"mb-4 text-lg font-bold\">Financial Highlights</h2>\n        <EditIcon isLoading={isLoading} setOpen={() => setEditOpen(true)} />\n      </div>\n      <div className=\"flex flex-wrap text-sm\">\n        {highlights.map((highlight, index) => (\n          <div\n            key={highlight.title + index}\n            style={{ width: 175 }}\n            className=\"flex flex-col justify-between px-5 py-3 mb-3 mr-3 border border-gray-300 rounded-md\"\n          >\n            <h1 className=\"mb-2 font-bold\">{highlight.title}</h1>\n            <p className=\"font-bold text-pantone\">{highlight.text}</p>\n          </div>\n        ))}\n      </div>\n    </div>\n  )\n}\n\nexport default FinancialHighlights\n","// import { routes } from '../../router'\n// import { Link } from 'react-router-dom'\nimport Button from '../../components/Button'\nimport UserImage from '../../components/UserImage';\n\nconst styles = {\n  select: [\n    'capitalize',\n    'w-48',\n    'h-10',\n    'pl-3',\n    'pr-6',\n    'text-base',\n    'placeholder-gray-600',\n    'border',\n    'bg-white',\n    'rounded-lg',\n    'appearance-none',\n    'focus:shadow-outline',\n  ].join(' ')\n}\n\nconst Person = ({ person, handleClick, innerRef, edit = false, ...props }) => {\n  const options = [\n    'pending',\n    'active (in network)',\n    'active (3rd party)',\n    'approved',\n    'disabled'\n  ]\n\n  return (\n    <>\n      <figure className=\"my-2 md:flex\">\n        <UserImage className=\"w-16 rounded-full\" person={person} />\n        <div className=\"px-6 py-4 text-center md:text-left space-y-2\">\n          <blockquote>\n            <Button\n              className=\"text-lg font-semibold\"\n              variant=\"link\"\n              onClick={edit ? null : () => handleClick()}\n            >\n              {person.displayName}\n            </Button>\n            <p className=\"text-sm capitalize\">\n              {edit ? person.role : person.status}\n            </p>\n          </blockquote>\n        </div>\n      </figure>\n      <div>\n        {edit ? (\n          <select\n            name={person.email}\n            className={styles.select}\n            {...innerRef}\n            {...props}\n          >\n            {options.map((item, key) => (\n              <option\n                key={'option-' + key}\n                value={JSON.stringify({ user: person.email, value: item })}\n              >\n                {item}\n              </option>\n            ))}\n          </select>\n        ) : null}\n      </div>\n    </>\n  )\n}\n\nexport default Person\n","import Icon from '../../components/Icon'\n\nconst InNetwork = ({ status }) => {\n  return (\n    <div className=\"flex items-center justify-center mt-1\">\n      {status ? (\n        <>\n          <Icon\n            id=\"available\"\n            className=\"w-4 h-4 mr-1 fill-current text-pantone\"\n          />\n          In-Network\n        </>\n      ) : (\n        <>\n          <Icon\n            id=\"unavailable\"\n            className=\"w-4 h-4 mr-1 fill-current text-error\"\n          />\n          Out-of-Network\n        </>\n      )}\n    </div>\n  )\n}\n\nexport default InNetwork\n","import Icon from '../../components/Icon'\nimport InNetwork from '../Settings/InNetwork'\nimport UserImage from '../../components/UserImage'\n\nconst PersonDetail = ({ person }) => {\n  return (\n    <>\n      <div className=\"flex\">\n        <UserImage className=\"w-20 rounded-full\" person={person} />\n        <div className=\"my-auto ml-6\">\n          <h1 className=\"text-lg font-bold\">{person.displayName}</h1>\n          <p className=\"\">{person.role}</p>\n          <div className=\"flex items-center text-md\">\n            <InNetwork status={person.inNetwork} />\n          </div>\n        </div>\n      </div>\n      <div className=\"mt-5 border-b\"></div>\n      <div className=\"pt-6 pl-6 ml-20\">\n        <h2 className=\"text-lg\">Contact Info</h2>\n        <div className=\"mt-4\">\n          {person.linkedInProfile ? (\n            <>\n              <div className=\"flex items-center\">\n                <Icon\n                  id=\"linked_in\"\n                  className=\"w-4 h-4 mr-1 text-black fill-current\"\n                />\n                <p className=\"font-bold text-md\">LinkedIn Profile</p>\n              </div>\n              <a\n                href={person.linkedInProfile}\n                target=\"_blank\"\n                rel=\"noreferrer\"\n                className=\"inline-block mt-2 text-blue-600 text-md\"\n              >\n                {person.linkedInProfile}\n              </a>\n            </>\n          ) : null}\n        </div>\n        <div className=\"mt-4\">\n          <div className=\"flex items-center\">\n            <Icon id=\"email\" className=\"w-4 h-4 mr-1 text-black fill-current\" />\n            <p className=\"font-bold text-md\">Email</p>\n          </div>\n          <a\n            href={\"mailto:\" + person.email}\n            target=\"_blank\"\n            rel=\"noreferrer\"\n            className=\"inline-block mt-2 text-blue-600 text-md\"\n          >\n            {person.email}\n          </a>\n        </div>\n      </div>\n    </>\n  )\n}\n\nexport default PersonDetail\n","import { useState } from 'react'\nimport Modal from 'react-modal'\nimport toaster from 'react-hot-toast'\nimport { useForm } from 'react-hook-form'\nimport modalStyles from '../../assets/styles/modalStyles'\nimport Person from './Person'\nimport Button from '../../components/Button'\nimport PersonDetail from './PersonDetail'\nimport EditIcon from '../../components/Button/EditIcon'\nimport { uploadUser } from '../../data/loanPools'\n\nconst People = ({ business, reload, isLoading }) => {\n  const people = business?.team.sort((a,b) => a.email > b.email ? 1 : -1)\n  const [isOpen, setOpen] = useState(false)\n  const [isEditOpen, setEditOpen] = useState(false)\n  const [person, setPerson] = useState(null)\n  const { register, handleSubmit, formState, reset } = useForm({\n    mode: 'onChange'\n  })\n  const [isSaving, setIsSaving] = useState(false)\n\n  const handleClick = index => {\n    setPerson(people[index])\n    setOpen(true)\n  }\n\n  const dirtyValues = (touchedFields, allValues) => {\n    if (touchedFields === true || Array.isArray(touchedFields)) {\n      return allValues\n    }\n    return Object.fromEntries(\n      Object.keys(touchedFields).map(key => [\n        key,\n        dirtyValues(touchedFields[key], allValues[key])\n      ])\n    )\n  }\n\n  const onUpdate = async data => {\n    setIsSaving(true)\n    const dirtyFields = dirtyValues(formState.touchedFields, data)\n    const values = Object.entries(dirtyFields).map(item => JSON.parse(item[1]))\n    let usersData = []\n    for (const item in values) {\n      const formData = new FormData()\n      formData.append('email', values[item].user)\n      formData.append('entity', business.name)\n      formData.append('status', values[item].value)\n      usersData.push(formData)\n    }\n\n    const promises = usersData.map(userData => uploadUser(userData))\n\n    try {\n      await Promise.all(promises)\n      setTimeout(() => {\n        setIsSaving(false)\n        reset()\n        reload()\n        toaster.success('Saved')\n      }, 2000)\n    } catch (e) {\n      reload()\n      setIsSaving(false)\n      if (e.response.data.message) {\n        toaster.error(e.response.data.message)\n      } else {\n        toaster.error('Something went wrong, please try again later')\n      }\n      console.log(e)\n      throw e\n    }\n  }\n\n  return (\n    <div>\n      <div className=\"flex justify-between\">\n        <h2 className=\"mb-4 text-lg font-bold\">People</h2>\n        <EditIcon isLoading={isLoading} setOpen={() => {reset(); setEditOpen(true)}} />\n      </div>\n      {people &&\n        people.map((person, index) => (\n          <Person\n            key={index}\n            person={person}\n            handleClick={() => handleClick(index)}\n          />\n        ))}\n      {person && (\n        // Show team member info\n        <Modal\n          isOpen={isOpen}\n          onRequestClose={() => setOpen(false)}\n          style={modalStyles}\n        >\n          <PersonDetail person={person} />\n        </Modal>\n      )}\n      <Modal\n        isOpen={isEditOpen}\n        onRequestClose={() => setEditOpen(false)}\n        style={modalStyles}\n      >\n        {people &&\n          people.map((person, index) => (\n            <div\n              key={'selector-' + index}\n              className=\"flex items-center justify-between\"\n            >\n              <Person\n                person={person}\n                edit={true}\n                defaultValue={JSON.stringify({\n                  user: person.email,\n                  value: person.status\n                })}\n                innerRef={register('user-' + index)}\n              />\n            </div>\n          ))}\n        <Button\n          disabled={!formState.isDirty}\n          isLoading={isSaving}\n          variant=\"contained\"\n          className=\"w-full mt-2\"\n          onClick={handleSubmit(onUpdate)}\n        >\n          Update\n        </Button>\n      </Modal>\n    </div>\n  )\n}\n\nexport default People\n","import Mapchart from '../../components/Mapchart'\nimport { Link } from 'react-router-dom'\nimport { routes } from '../../router'\n\nconst MarketplaceListings = ({ business }) => {\n  return (\n    <div className=\"\">\n      <h2 className=\"mb-5 text-lg font-bold\">Marketplace Listings</h2>\n      <div className=\"overflow-y-auto\">\n        {business?.listings?.map((loanPool, index) => (\n          <Link key={index} to={`${routes.detail}/${loanPool.id}`}>\n            <div className=\"flex justify-start mb-4 overflow-y-auto text-sm max-h-32\">\n              <div className=\"w-16\">\n                <Mapchart statesInfo={loanPool.statesInfo} />\n              </div>\n              <div className=\"ml-4\">\n                <h3 className=\"mb-1 text-base font-bold\">{loanPool.title}</h3>\n                <p>{loanPool.description}</p>\n              </div>\n            </div>\n          </Link>\n        ))}\n      </div>\n    </div>\n  )\n}\n\nexport default MarketplaceListings\n","import { useState } from 'react'\nimport toaster from 'react-hot-toast'\nimport TextField from '../../components/TextField'\nimport SectionModal from '../Settings/SectionModal'\nimport { useForm, Controller } from 'react-hook-form'\nimport { updateBusiness } from '../../data/loanPools'\nimport NumberFormat from 'react-number-format'\n\nconst EditAbout = ({ data, onCancel, reload }) => {\n  const [isLoading, setIsLoading] = useState(false)\n  const {\n    control,\n    register,\n    handleSubmit,\n    formState: { isDirty },\n    reset\n  } = useForm({\n    defaultValues: {\n      name: data?.name,\n      'profile.about': data?.about,\n      'profile.phone': data?.phone,\n      'profile.website': data?.website,\n      'profile.ceo': data?.ceo,\n      'profile.identification': data?.identification,\n      'profile.numEmployeesRange': data?.numEmployeesRange,\n      'profile.address.city': data?.address.city,\n      'profile.address.country': data?.address.country,\n      'profile.address.state': data?.address.state,\n      'profile.address.street': data?.address.street,\n      'profile.address.zipCode': data?.address.zipCode\n    }\n  })\n\n  const onSave = async data => {\n    console.log('postData: ', data)\n    setIsLoading(true)\n    try {\n      await updateBusiness(data)\n      setTimeout(() => {\n        setIsLoading(false)\n        // set to isDirty to false\n        reset(data)\n        reload()\n        toaster.success('Saved')\n      }, 2000)\n    } catch (e) {\n      setIsLoading(false)\n      if (e.response.data.message) {\n        toaster.error(e.response.data.message)\n      } else {\n        toaster.error('Something went wrong, please try again later')\n      }\n      console.log(e)\n      // set isSubmitSuccessful to false :)\n      throw e\n    }\n  }\n\n  return (\n    <SectionModal\n      isLoading={isLoading}\n      onCancel={onCancel}\n      onSave={handleSubmit(onSave)}\n      title=\"About\"\n      disableSave={!isDirty}\n    >\n      <div style={{ minWidth: 470 }} className=\"p-3 text-left space-y-5\">\n        <div>\n          <h5 className=\"mb-3 font-bold\">Description</h5>\n          <textarea\n            className=\"w-full px-3 py-2 text-gray-700 border border-black rounded-lg focus:outline-none\"\n            rows=\"3\"\n            {...register('profile.about')}\n          ></textarea>\n        </div>\n        <div className=\"flex\">\n          <div className=\"px-1\">\n            <h5 className=\"mb-3 font-bold\">City</h5>\n            <TextField innerRef={register('profile.address.city')} />\n          </div>\n          <div className=\"px-1\">\n            <h5 className=\"mb-3 font-bold\">Country</h5>\n            <TextField innerRef={register('profile.address.country')} />\n          </div>\n        </div>\n        <div className=\"flex\">\n          <div className=\"px-1\">\n            <h5 className=\"mb-3 font-bold\">Street</h5>\n            <TextField innerRef={register('profile.address.street')} />\n          </div>\n          <div className=\"px-1\">\n            <h5 className=\"mb-3 font-bold\">State</h5>\n            <TextField innerRef={register('profile.address.state')} />\n          </div>\n        </div>\n        <div className=\"flex\">\n          <div className=\"px-1\">\n            <h5 className=\"mb-3 font-bold\">Zip Code</h5>\n            <TextField innerRef={register('profile.address.zipCode')} />\n          </div>\n          <div className=\"px-1\">\n            <h5 className=\"mb-3 font-bold\">Phone</h5>\n            <Controller\n              render={({ field: { onChange, value } }) => {\n                return (\n                  <NumberFormat\n                    value={value}\n                    control={control}\n                    format=\"+1 (###) ###-####\"\n                    mask=\"_\"\n                    customInput={TextField}\n                    onValueChange={c => {\n                      onChange(c.value)\n                    }}\n                  />\n                )\n              }}\n              name=\"profile.phone\"\n              control={control}\n            />\n          </div>\n        </div>\n        <div className=\"flex\">\n          <div className=\"px-1\">\n            <h5 className=\"mb-3 font-bold\">Website</h5>\n            <TextField type=\"url\" innerRef={register('profile.website')} />\n          </div>\n          <div className=\"px-1\">\n            <h5 className=\"mb-3 font-bold\">CEO</h5>\n            <TextField innerRef={register('profile.ceo')} />\n          </div>\n        </div>\n        <div className=\"flex\">\n          <div className=\"px-1\">\n            <h5 className=\"mb-3 font-bold\">FI Number (CU or Bank ID)</h5>\n            <TextField innerRef={register('profile.identification')} />\n          </div>\n          <div className=\"px-1\">\n            <h5 className=\"mb-3 font-bold\">No. of Employees</h5>\n            <TextField innerRef={register('profile.numEmployeesRange')} />\n          </div>\n        </div>\n      </div>\n    </SectionModal>\n  )\n}\n\nexport default EditAbout\n","import { useState } from 'react'\nimport Modal from 'react-modal'\nimport EditAbout from './EditAbout'\nimport modalStyles from '../../assets/styles/modalStyles'\nimport EditIcon from '../../components/Button/EditIcon'\nimport numeral from 'numeral'\n\nif (numeral.formats['phone'] === undefined) {\n  numeral.register('format', 'phone', {\n    regexps: {\n      // eslint-disable-next-line\n      format: /\\+?N?[\\.\\ \\-]?\\(?NNN\\)?[\\.\\ \\-]?NNN[\\.\\ \\-]?NNNN/\n    },\n    format: function (value, formatString) {\n      function normalize(phoneNumber) {\n        return phoneNumber.toString().replace(\n          // eslint-disable-next-line\n          /^[\\+\\d{1,3}\\-\\s]*\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/,\n          '$1$2$3'\n        )\n      }\n\n      function format(phoneNumber, formatString) {\n        phoneNumber = normalize(phoneNumber)\n        for (var i = 0, l = phoneNumber.length; i < l; i++) {\n          formatString = formatString.replace('N', phoneNumber[i])\n        }\n        return formatString\n      }\n\n      return format(value, formatString)\n    }\n  })\n}\n\nconst About = ({ business, reload, isLoading }) => {\n  const profile = business?.profile\n  const [isEditOpen, setEditOpen] = useState(false)\n\n  return (\n    <div>\n      <Modal\n        isOpen={isEditOpen}\n        style={modalStyles}\n        onRequestClose={() => setEditOpen(false)}\n      >\n        <EditAbout\n          data={profile}\n          onCancel={() => setEditOpen(false)}\n          reload={reload}\n        />\n      </Modal>\n      <div className=\"flex justify-between\">\n        <h2 className=\"mb-4 text-lg font-bold\">About</h2>\n        <EditIcon isLoading={isLoading} setOpen={() => setEditOpen(true)} />\n      </div>\n      <p className=\"text-sm\">{profile?.about}</p>\n      <table className=\"flex mt-6 text-sm\">\n        <thead>\n          <tr className=\"flex flex-col mr-4\">\n            <td className=\"py-2 font-bold\">Address</td>\n            <td className=\"py-2 font-bold\">Phone</td>\n            <td className=\"py-2 font-bold\">Website</td>\n            <td className=\"py-2 font-bold\">CEO</td>\n            <td className=\"py-2 font-bold\">FI Number (CU or Bank ID)</td>\n            <td className=\"py-2 font-bold\">No. of Employees</td>\n          </tr>\n        </thead>\n        <tbody>\n          <tr className=\"flex flex-col\">\n            <td className=\"py-2\">\n              {profile?.address?.street} {profile?.address?.zipCode}\n            </td>\n            <td className=\"py-2\">\n              {profile?.phone && numeral(profile?.phone).format('+1 (NNN) NNN-NNNN')}\n            </td>\n            <td className=\"py-2\">{profile?.website}</td>\n            <td className=\"py-2\">{profile?.ceo}</td>\n            <td className=\"py-2\">{profile?.identification}</td>\n            <td className=\"py-2\">{profile?.numEmployeesRange}</td>\n          </tr>\n        </tbody>\n      </table>\n    </div>\n  )\n}\n\nexport default About\n","import { useEffect, useState } from 'react'\nimport { getBusiness } from '../../data/loanPools'\nimport classNames from 'classnames'\nimport api from '../../data/api'\nimport placeholder from '../../assets/images/placeholder-company.png'\n\nconst BusinessImage = ({ className, entity }) => {\n  const [src, setSrc] = useState(null)\n\n  useEffect(() => {\n    const retrieveBusiness = async () => {\n      if (entity) {\n        try {\n          const business = await getBusiness(entity)\n          if (business.image) {\n            const data = await api().get(business.image, {\n              responseType: 'blob'\n            })\n            const photo = URL.createObjectURL(data.data)\n            setSrc(photo)\n          }\n        } catch (e) {\n          console.log(e)\n        }\n      }\n    }\n    retrieveBusiness()\n  }, [entity])\n\n  return (\n    <img\n      className={classNames('my-auto h-168', className)}\n      src={src ? src : placeholder}\n      alt=\"\"\n      width=\"100\"\n      height=\"100\"\n    ></img>\n  )\n}\n\nexport default BusinessImage\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAEsCAMAAADaaRXwAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjp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kq48oKwdvtFBEBSwtblsgJD3kYBkMl4uA+H+/rwd6NW0xIuINkVw9xsLyCNQYbV4b1bAuTok7rvWw8BZLd6CCMEENLvgDBCACkCeaZAnLobIF1B7AzEv7OyJfWQ1PQYIBMQWQJxVkS09FvaNtJkIWdshkZT6iELI8Sbf8Nk5Gpmm+Xud5XwLlyk2xeQcYvVfUloUqFaAHmli7n7PSF1Itruc8dAUp8FID2iqIQLCCCAHAzirw4ijypW2CwpIEfU1EXGO+Gve2Hnm0GGxx+evs5q6rxBtQeIPppK3KyE2/2aWEDWTuq+U7YXkGbZ3o739gJyXD0EEEbIVUu4KyC8Fn0EiDYBSfunf2SbfxHk/Vlt4Rri57/ZySPkVf+VofKllHDHn7X7ou79s/N9AEjpuwZkHSR2Ujf3X3ITfs+tpcmhLUh0DQkVRPMCkWFqGaJjk8ModfDbi7oOk/kocVhVQGwBItRDupZwAfl2ECqGgJxpUQcEEHZZjBDWEEAAAQSQC4H8dRaF5q6hv4uvq9gJ5PnEQ++7CdcHLdz/ToFqJxAqhoAAAggggAACCCCAAAIIIIAAAggggAACCCBXAMn/YslLNspt1Ifk1jfGLe4y1KJeEf4wvHc9/p81/GHawqpN/0Wy9BfKPiDuRiT+7gACCHE8iPCkAfnOEEAYIUTS0QkQRggBCCCAAMK2FxBAAAGENQQQQAAhAAEEEEAAAQQQQAC5zknd2FPE8+LSM4fZB4ToG4AAQgACCAEIIAQggBCAAEIAQgACCAEIIAQggBCAAEIAQgACCAEIIAQggBCAAEIAQkTivwADACEY/RIDlg4wAAAAAElFTkSuQmCC\"","import BusinessImage from '../../components/BusinessImage'\n\nconst Header = ({ business }) => {\n  return (\n    <div className=\"flex items-end\">\n      <BusinessImage className=\"p-1 border rounded-md w-36\" entity={business?.name} />\n      <h1 className=\"mb-1 ml-6 text-3xl font-bold text-eerie\">\n        {business?.name}\n      </h1>\n    </div>\n  )\n}\n\nexport default Header\n","import { useEffect, useState } from 'react'\nimport { useParams } from 'react-router-dom'\nimport AppBar from '../../components/AppBar'\nimport FinancialHighlights from './FinancialHighlights'\nimport People from './People'\nimport MarketplaceListings from './MarketplaceListings'\nimport About from './About'\nimport Header from './Header'\nimport { getBusiness } from '../../data/loanPools'\n\nconst EntityProfile = () => {\n  const { entity } = useParams()\n  const [businessProfile, setBusinessProfile] = useState(null)\n  const [reload, setReload] = useState(false)\n  const [isLoadingUser, setIsLoadingUser] = useState(false)\n\n  useEffect(() => {\n    const retrieveBusiness = async () => {\n      setIsLoadingUser(true)\n      try {\n        const businessResponse = await getBusiness(entity)\n        setBusinessProfile(businessResponse)\n        setIsLoadingUser(false)\n      } catch (error) {\n        setIsLoadingUser(false)\n        console.log(error)\n      }\n    }\n    retrieveBusiness()\n  }, [reload])\n\n  const reloadBusinessInfo = () => {\n    setReload(!reload)\n  }\n\n  return (\n    <div>\n      <AppBar />\n      <div className=\"px-12 my-6\">\n        <div className=\"container py-8 mx-auto\">\n          <div className=\"flex items-end justify-between mb-5\">\n            <Header business={businessProfile} />\n          </div>\n          <div className=\"grid grid-cols-7 gap-x-4\">\n            <div className=\"p-4 mt-6 mb-3 border border-gray-200 rounded-md col-span-4\">\n              <About\n                isLoading={isLoadingUser}\n                business={businessProfile}\n                reload={reloadBusinessInfo}\n              />\n            </div>\n            <div className=\"p-4 mt-6 mb-3 border border-gray-200 rounded-md col-span-3\">\n              <MarketplaceListings business={businessProfile} />\n            </div>\n          </div>\n          <div className=\"grid grid-cols-7 gap-x-4\">\n            <div className=\"p-4 mt-3 mb-3 border border-gray-200 rounded-md col-span-4\">\n              <FinancialHighlights\n                isLoading={isLoadingUser}\n                business={businessProfile}\n                reload={reloadBusinessInfo}\n              />\n            </div>\n            <div className=\"p-4 mt-3 mb-3 border border-gray-200 rounded-md col-span-3\">\n              <People\n                isLoading={isLoadingUser}\n                business={businessProfile}\n                reload={reloadBusinessInfo}\n              />\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default EntityProfile\n","export default __webpack_public_path__ + \"static/media/audit_frame.0ca5f522.png\";","import { useState } from 'react'\nimport classNames from 'classnames'\nimport Mapchart from '../../components/Mapchart'\nimport TextField from '../../components/TextField'\nimport Button from '../../components/Button'\nimport { useForm, Controller } from 'react-hook-form'\nimport { settlement } from '../../data/loanPools'\nimport toaster from 'react-hot-toast'\nimport NumberFormat from 'react-number-format'\n\nconst SettlementCard = ({ loanPool }) => {\n  const {\n    control,\n    handleSubmit,\n    formState: { errors }\n  } = useForm({ defaultValues: loanPool, mode: 'onChange' })\n\n  const [isUploading, setIsUploading] = useState(false)\n  const [isSuccess, setIsSuccess] = useState(false)\n  const [statesInfo, setStatesInfo] = useState(loanPool?.statesInfo)\n\n  const onPercentageChange = event => {\n    if (event.target.value === '') event.target.value = 0\n\n    const max = 100\n    const total = statesInfo\n      .map(stateInfo => parseInt(stateInfo.percentLoan))\n      .reduce((prev, next) => prev + next)\n    const value = parseInt(event.target.value)\n    const delta = max - total + value\n\n    setStatesInfo(statesInfo =>\n      statesInfo.map(stateInfo =>\n        stateInfo.state.includes(event.target.name)\n          ? {\n              ...stateInfo,\n              percentLoan: value < delta ? value : delta - 1\n            }\n          : stateInfo\n      )\n    )\n  }\n\n  const onSubmit = data => {\n    setIsUploading(true)\n    settlement(data)\n      .then(() => {\n        setTimeout(() => {\n          setIsUploading(false)\n          setIsSuccess(true)\n          toaster.success('Settlement saved')\n        }, 3000)\n      })\n      .catch(e => {\n        console.log(e)\n        setIsUploading(false)\n        toaster.error(e.response.data.message)\n      })\n  }\n\n  return (\n    <>\n      <div\n        className={classNames(\n          'flex flex-col px-6 min-w-loan-card max-w-loan-card pt-2'\n        )}\n      >\n        <div>\n          <header>\n            <div className=\"flex justify-between\">\n              <h1 className=\"text-2xl font-bold\">{loanPool.title}</h1>\n            </div>\n            <p className=\"pt-3 text-md\">\n              Originated by{' '}\n              <a className=\"underline\" href=\"/#\">\n                {loanPool.owner?.displayName}\n              </a>\n            </p>\n            <p className=\"pt-4 text-md\">{loanPool.description}</p>\n          </header>\n          <section>\n            <ul className=\"flex pt-5 text-center\">\n              <li className=\"flex items-center px-3 py-2 text-sm rounded-full bg-cultured\">\n                {loanPool.listType}\n              </li>\n              <li className=\"flex items-center px-3 py-2 ml-3 text-sm rounded-full bg-cultured\">\n                {loanPool.loanType?.loanClass}\n              </li>\n              <li className=\"flex items-center px-3 py-2 ml-3 text-sm rounded-full bg-cultured\">\n                {loanPool.loanType?.type}\n              </li>\n            </ul>\n          </section>\n          <section className=\"flex px-6 py-4 mt-4\">\n            <Mapchart statesInfo={loanPool.statesInfo} />\n            <table className=\"ml-5\">\n              <thead>\n                <tr className=\"text-left\">\n                  <th className=\"text-sm font-normal\">States</th>\n                  <th className=\"text-sm font-normal\">Compositions</th>\n                </tr>\n              </thead>\n              <tbody>\n                {statesInfo\n                  .sort((a, b) => {\n                    const textA = a.state.toUpperCase()\n                    const textB = b.state.toUpperCase()\n                    return textA < textB ? -1 : textA > textB ? 1 : 0\n                  })\n                  .map((stateInfo, index) => (\n                    <tr key={index}>\n                      <td className=\"text-sm\">{stateInfo.state}</td>\n                      <td className=\"text-sm text-right\">\n                        <TextField\n                          name={stateInfo.state}\n                          type=\"number\"\n                          min=\"0\"\n                          max=\"100\"\n                          step=\"1\"\n                          value={stateInfo.percentLoan}\n                          className=\"w-full !p-0\"\n                          onChange={onPercentageChange}\n                        />\n                      </td>\n                    </tr>\n                  ))}\n              </tbody>\n            </table>\n          </section>\n          <section className=\"mb-6\">\n            <ul className=\"col\">\n              {loanPool.generalInfo?.currentBalance && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">Current Balance</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"#\"\n                            thousandSeparator={true}\n                            prefix={'$'}\n                            control={control}\n                            fixedDecimalScale={true}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"generalInfo.currentBalance\"\n                      control={control}\n                    />\n                  </span>\n                </li>\n              )}\n              {loanPool.generalInfo?.originalBalance && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">Original Balance</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"#\"\n                            thousandSeparator={true}\n                            prefix={'$'}\n                            control={control}\n                            fixedDecimalScale={true}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"generalInfo.originalBalance\"\n                      control={control}\n                    />\n                  </span>\n                </li>\n              )}\n              {errors.generalInfo?.grossWAC && (\n                <li className=\"text-sm text-red-600\">\n                  {errors.generalInfo?.grossWAC?.message}\n                </li>\n              )}\n              {loanPool.generalInfo?.grossWAC && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">Gross WAC</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"%\"\n                            control={control}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            fixedDecimalScale={true}\n                            decimalScale={2}\n                            maxLength={6}\n                            allowLeadingZeros={true}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"generalInfo.grossWAC\"\n                      control={control}\n                      rules={{\n                        min: {\n                          value: 0.01,\n                          message: 'Only values greater than 0.01 allowed'\n                        },\n                        max: {\n                          value: 100,\n                          message: 'Max value not greater than 100'\n                        }\n                      }}\n                    />\n                  </span>\n                </li>\n              )}\n              {loanPool.generalInfo?.price && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">Price</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"Par Value\"\n                            thousandSeparator={true}\n                            control={control}\n                            fixedDecimalScale={true}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"generalInfo.price\"\n                      control={control}\n                    />\n                  </span>\n                </li>\n              )}\n              {errors.generalInfo?.sellerRetainedPercent && (\n                <li className=\"text-sm text-red-600\">\n                  {errors.generalInfo?.sellerRetainedPercent?.message}\n                </li>\n              )}\n              {Number(loanPool.generalInfo?.sellerRetainedPercent) !== 0 && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">Seller Retained</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            className=\"w-full mb-2\"\n                            placeholder=\"%\"\n                            control={control}\n                            allowEmptyFormatting={true}\n                            allowNegative={false}\n                            decimalScale={0}\n                            customInput={TextField}\n                            value={\n                              value === undefined || value === '' ? '0' : value\n                            }\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"generalInfo.sellerRetainedPercent\"\n                      control={control}\n                      rules={{\n                        min: {\n                          value: 0,\n                          message: 'Only non zero values allowed'\n                        },\n                        max: {\n                          value: 100,\n                          message: 'Max value not greater than 100'\n                        }\n                      }}\n                      defaultValue={'0'}\n                    />\n                  </span>\n                </li>\n              )}\n              {errors.generalInfo?.serviceFee && (\n                <li className=\"text-sm text-red-600\">\n                  {errors.generalInfo?.serviceFee?.message}\n                </li>\n              )}\n              {loanPool.generalInfo?.serviceFee && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">Service Fee</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"bps\"\n                            control={control}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            decimalScale={0}\n                            maxLength={3}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"generalInfo.serviceFee\"\n                      control={control}\n                      rules={{\n                        min: {\n                          value: 0,\n                          message: 'Greater or equal than zero values allowed'\n                        },\n                        max: {\n                          value: 200,\n                          message: 'Max value not greater than 200'\n                        }\n                      }}\n                    />\n                  </span>\n                </li>\n              )}\n              {loanPool.generalInfo?.waBalance && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">WA Balance</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"#\"\n                            control={control}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"generalInfo.waBalance\"\n                      control={control}\n                    />\n                  </span>\n                </li>\n              )}\n              {loanPool.loanType?.waCreditScore && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">WA Credit Score</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"#\"\n                            control={control}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"loanType.waCreditScore\"\n                      control={control}\n                    />\n                  </span>\n                </li>\n              )}\n              {loanPool.loanType?.waDebtToIncome && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">WA Debt To Income</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"#\"\n                            control={control}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"loanType.waDebtToIncome\"\n                      control={control}\n                    />\n                  </span>\n                </li>\n              )}\n              {loanPool.loanType?.waLTV && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">WA Loan To Value</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"#\"\n                            control={control}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"loanType.waLTV\"\n                      control={control}\n                    />\n                  </span>\n                </li>\n              )}\n              {loanPool.loanType?.waCLTV && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">WA Combined Loan To Value</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"#\"\n                            control={control}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"loanType.waCLTV\"\n                      control={control}\n                    />\n                  </span>\n                </li>\n              )}\n              {loanPool.generalInfo?.count && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">Count</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"#\"\n                            thousandSeparator={true}\n                            control={control}\n                            fixedDecimalScale={true}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"generalInfo.count\"\n                      control={control}\n                    />\n                  </span>\n                </li>\n              )}\n              {loanPool.loanTerm?.waRemainingTerm && (\n                <li className=\"flex items-center py-1 text-md\">\n                  <span className=\"w-1/2\">WA Remaining Term</span>\n                  <span className=\"w-1/2\">\n                    <Controller\n                      render={({ field: { onChange, value } }) => {\n                        return (\n                          <NumberFormat\n                            value={value}\n                            className=\"w-full\"\n                            placeholder=\"#\"\n                            control={control}\n                            allowEmptyFormatting={false}\n                            allowNegative={false}\n                            customInput={TextField}\n                            onValueChange={c => {\n                              onChange(c.value)\n                            }}\n                          />\n                        )\n                      }}\n                      name=\"loanTerm.waRemainingTerm\"\n                      control={control}\n                    />\n                  </span>\n                </li>\n              )}\n            </ul>\n          </section>\n        </div>\n        <div>\n          <Button\n            isLoading={isUploading}\n            disabled={isSuccess}\n            onClick={handleSubmit(onSubmit)}\n            variant=\"outlined\"\n            className=\"block w-48 h-12 mx-auto mt-2\"\n          >\n            Submit\n          </Button>\n        </div>\n      </div>\n    </>\n  )\n}\n\nexport default SettlementCard\n","import { useState, useRef, useEffect, memo } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport FadeLoader from 'react-spinners/ClipLoader'\nimport Button from '../../components/Button'\nimport Icon from '../../components/Icon'\nimport { updateDealRoom } from '../../data/loanPools'\nimport { routes } from '../../router'\nimport SettlementCard from './SettlementCard'\nimport { uploadContract } from '../../data/documents'\nimport BeatLoader from 'react-spinners/BeatLoader'\nimport toaster from 'react-hot-toast'\n\nconst ManageMenu = ({ isOwner, loanPool, buyer, proposedBuyers }) => {\n  const manageContainer = useRef()\n  const [isManageOpen, setManageOpen] = useState(false)\n  const [isSaleEnding, setSaleEnding] = useState(false)\n  const [isSettlement, setSettlement] = useState(false)\n  const [isEndingLoading, setEndingLoading] = useState(false)\n  const [isUploading, setIsUploading] = useState(false)\n  const { email } = JSON.parse(localStorage.getItem('user'))\n  const history = useHistory()\n  const inputContractFile = useRef()\n\n  useEffect(() => {\n    if (\n      proposedBuyers?.buyer?.signature === 'contract signed' &&\n      proposedBuyers?.seller?.signature === 'contract signed'\n    ) {\n      setSettlement(true)\n    }\n  }, [proposedBuyers])\n\n  const handleClickOutside = event => {\n    if (\n      manageContainer.current &&\n      !manageContainer.current.contains(event.target) &&\n      // Need this because of button not being a parte of manageContainer\n      // anymore when switching views with isSaleEnding\n      !event.target.dataset.end\n    ) {\n      setManageOpen(false)\n      setSaleEnding(false)\n    }\n  }\n\n  useEffect(() => {\n    document.addEventListener('click', handleClickOutside)\n    return () => document.removeEventListener('click', handleClickOutside)\n  }, [])\n\n  const handleManageClick = () => setManageOpen(isManageOpen => !isManageOpen)\n\n  const handleEndSaleWanted = () => setSaleEnding(true)\n\n  const handleEndSale = async signature => {\n    setEndingLoading(true)\n    console.log('buyer:', buyer)\n    const data = {\n      loanId: loanPool.id,\n      docType: 'End Sale',\n      buyer: {\n        role: 'buyer',\n        email: buyer.email,\n        entity: buyer.entity\n      },\n      seller: {\n        role: 'seller',\n        email: loanPool.owner.email,\n        entity: loanPool.owner.entity\n      }\n    }\n    if (email === loanPool.owner.email) {\n      console.log('Ending sale as a seller')\n      data.seller.signature = signature\n    } else {\n      console.log('Ending sale as a buyer')\n      data.buyer.signature = signature\n    }\n    try {\n      const response = await updateDealRoom(data)\n      setEndingLoading(false)\n      // After seller end sale\n      if (signature === 'end sale edit') {\n        // Redirect to loanpool edit page\n        history.push(routes.upload, response)\n      } else {\n        history.push(routes.marketplace)\n      }\n    } catch (e) {\n      setEndingLoading(false)\n      console.log(e)\n    }\n  }\n\n  const uploadFile = async (loanId, file) => {\n    const formData = new FormData()\n    formData.append('data', file)\n    formData.append('filetype', file.type)\n    const response = await uploadContract(loanId, formData)\n    return response\n  }\n\n  const handleContractChange = async (e) => {\n    console.log('e: ', e.target.value);\n    setIsUploading(true)\n    const file = inputContractFile.current.files[0]\n    console.log('the contract file is ->', file)\n    if (!file) return\n    const formData = new FormData()\n    formData.append('file', file)\n    try {\n      await uploadFile(loanPool?.id, file)\n      setTimeout(() => {\n        setManageOpen(false)\n        setIsUploading(false)\n        toaster.success('Saved')\n      }, 2000)\n    } catch (error) {\n      setIsUploading(false)\n      if (error.response.status === 304) {\n        toaster.success('The dcument is identical to the previous version')\n      } else {\n        console.log('Error when uploading document', error)\n\n        toaster.error('Something went wrong, please try again later')\n      }\n    }\n  }\n\n  const MenuSettlement = () => {\n    return (\n      <>\n        {isSaleEnding ? (\n          <SettlementCard loanPool={loanPool} />\n        ) : (\n          <div className=\"h-12 mt-8 text-center\">\n            <Button\n              data-end={true}\n              variant=\"contained\"\n              className=\"whitespace-nowrap\"\n              onClick={handleEndSaleWanted}\n            >\n              Settle Loan Pool\n            </Button>\n          </div>\n        )}\n      </>\n    )\n  }\n\n  const MenuContent = () => {\n    // buyer ends loanpool: Issue contract, end sale -> buyer cancels : End sale\n    // seller ends loanpool: Issue contract, end sale, -> seller cancels (ends) loanpool: Relist, Edit (ends loanpool)\n\n    const ConfirmAction = () => {\n      let actor = ''\n      isOwner ? (actor = 'seller') : (actor = 'buyer')\n\n      if (actor === 'buyer') {\n        return (\n          <div>\n            <p className=\"whitespace-nowrap\">\n              You've chosen to end the sale without closing. Please confirm,\n              <br />\n              this action cannot be undone.\n            </p>\n            <Button\n              variant=\"contained\"\n              className=\"block w-48 h-12 mx-auto mt-8\"\n              onClick={() => handleEndSale('end sale request')}\n            >\n              End Sale\n            </Button>\n          </div>\n        )\n      }\n      if (actor === 'seller') {\n        return (\n          <div>\n            <p className=\"whitespace-nowrap\">\n              You've chosen to end the sale without closing. Please confirm,\n              <br />\n              this action cannot be undone.\n            </p>\n            <div className=\"flex\">\n              <Button\n                variant=\"contained\"\n                className=\"block w-48 h-12 mx-auto mt-8\"\n                onClick={() => handleEndSale('end sale relist')}\n                data-end={true}\n              >\n                Relist Loanpool\n              </Button>\n              <Button\n                variant=\"contained\"\n                className=\"block w-48 h-12 mx-auto mt-8\"\n                onClick={() => handleEndSale('end sale edit')}\n                data-end={true}\n              >\n                Edit Loanpool\n              </Button>\n            </div>\n          </div>\n        )\n      }\n    }\n\n    return (\n      <>\n        {isSaleEnding ? (\n          <ConfirmAction />\n        ) : (\n          <div className=\"flex space-x-4\">\n            <label\n              htmlFor=\"contract-upload\"\n              className=\"p-2 font-semibold text-white bg-black border border-black rounded cursor-pointer whitespace-nowrap text-md\"\n            >\n              {isUploading ? (\n                <BeatLoader size={7} color=\"white\" />\n              ) : (\n                <span>Issue Contract</span>\n              )}\n            </label>\n            <input\n              disabled={isUploading}\n              id=\"contract-upload\"\n              className=\"hidden\"\n              type=\"file\"\n              ref={inputContractFile}\n              onChange={handleContractChange}\n            />\n            <Button\n              data-end={true}\n              variant=\"contained\"\n              className=\"whitespace-nowrap\"\n              onClick={handleEndSaleWanted}\n            >\n              End Sale\n            </Button>\n          </div>\n        )}\n      </>\n    )\n  }\n\n  return (\n    <div className=\"relative\" ref={manageContainer}>\n      <Icon\n        id=\"menu\"\n        className=\"w-4 h-4 ml-4 cursor-pointer\"\n        onClick={handleManageClick}\n      />\n      {isManageOpen && (\n        <div className=\"absolute right-0 p-6 overflow-y-auto bg-white border rounded border-onyx top-8\">\n          <h3 className=\"text-lg font-bold text-center text-pantone whitespace-nowrap\">\n            Manage Loan Pool Sale\n          </h3>\n          <div className=\"my-6 border-b\"></div>\n          {isSettlement ? (\n            <MenuSettlement />\n          ) : isEndingLoading ? (\n            <div className=\"flex justify-center\">\n              <FadeLoader />\n            </div>\n          ) : (\n            <MenuContent />\n          )}\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport default memo(ManageMenu)\n","import { useQuery } from 'react-query'\nimport { getContract } from '../../data/documents'\n\nconst useContract = id => {\n  return useQuery(['contract', parseInt(id)], () => getContract(id), {\n    enabled: true\n  })\n}\n\nexport default useContract\n","import { useEffect, useState } from 'react'\nimport VersionItem from '../../components/DocumentVersion/VersionItem'\nimport VersionContainer from '../../components/DocumentVersion/VersionContainer'\nimport useContract from '../../data/hooks/useContract'\n\nconst ContractVersion = ({ loanId }) => {\n  const [contract, setContract] = useState(null)\n  const [latest, setLatest] = useState(null)\n  const contractQuery = useContract(loanId)\n\n  useEffect(() => {\n    if (contractQuery.isSuccess) {\n      setLatest(contractQuery.data.versionedDocs.at(-1))\n      setContract(contractQuery.data)\n    }\n  }, [loanId, contractQuery?.data])\n\n  return (\n    <>\n      <VersionContainer title=\"Version History\" filename={contract?.filename}>\n        <VersionItem\n          date={latest?.uploadDate}\n          name={contract?.filename}\n          filename={contract?.filename}\n          link={latest?.link}\n          version={latest?.version}\n          loanId={loanId}\n          currentVersion={contract?.currentVersion}\n        />\n        {contract?.versionedDocs?.length > 1 &&\n          contract?.versionedDocs?.slice(0).reverse().map((item, index) => (\n            <VersionItem\n              key={index}\n              date={item.uploadDate}\n              name={item.link.split('/').pop()}\n              link={item.link}\n              filename={contract?.filename}\n              version={item.version}\n              loanId={loanId}\n            />\n          ))}\n      </VersionContainer>\n    </>\n  )\n}\n\nexport default ContractVersion\n","import { useEffect, useState } from 'react'\nimport VersionItem from '../../components/DocumentVersion/VersionItem'\nimport useContract from '../../data/hooks/useContract'\nimport Modal from 'react-modal'\nimport modalStyles from '../../assets/styles/modalStyles'\nimport ContractVersion from './ContractVersion'\n\nconst Contract = ({ loanId, reviewContract, contractSigned, showButtonsReviewContract }) => {\n  const [contract, setContract] = useState(null)\n  const [latest, setLatest] = useState(null)\n  const [isModalContractOpen, setModalContractOpen] = useState(false)\n  const contractQuery = useContract(loanId)\n\n  useEffect(() => {\n    if (contractQuery.isSuccess) {\n      console.log('contractQuery: ', contractQuery.data);\n      setLatest(contractQuery.data.versionedDocs.at(-1))\n      setContract(contractQuery.data)\n    }\n  }, [loanId, contractQuery?.data])\n\n  return (\n    <div>\n      {contractQuery.isLoading ? (\n        <p className=\"pt-4 text-center text-md\">Loading contract</p>\n      ) : latest === null ? (\n        <p className=\"pt-4 text-center text-md\">Not started</p>\n      ) : null}\n      {latest && (\n        <>\n          <h3 className=\"pb-2 pl-1 font-medium font-bold text-gray-900 leading-6\">\n            Manage Sale Contract\n          </h3>\n          <ul className=\"pb-4 space-y-3\">\n            <VersionItem\n              date={latest?.uploadDate}\n              name={contract?.filename}\n              filename={contract?.filename}\n              link={latest?.link}\n              version={latest?.version}\n              loanId={loanId}\n              currentVersion={contract?.currentVersion}\n              source=\"contract\"\n              reviewContract={reviewContract}\n              setModalContractOpen={setModalContractOpen}\n              contractSigned={contractSigned}\n              showButtonsReviewContract={showButtonsReviewContract}\n            />\n          </ul>\n        </>\n      )}\n      <Modal\n        isOpen={isModalContractOpen}\n        onRequestClose={() => setModalContractOpen(false)}\n        style={modalStyles}\n      >\n        <ContractVersion loanId={loanId} />\n      </Modal>\n    </div>\n  )\n}\n\nexport default Contract\n","import _ from 'lodash'\nimport { useEffect, useState } from 'react'\nimport event from '../../context/eventBus'\nimport LoanCard from '../../components/LoanCard'\nimport Button from '../../components/Button'\nimport { updateDealRoom, getProposedBuyers } from '../../data/loanPools'\nimport { getESign } from '../../data/documents'\nimport audit_image from '../../assets/images/audit.png'\nimport audit_frame from '../../assets/images/audit_frame.png'\nimport Modal from 'react-modal'\nimport ManageMenu from './ManageMenu'\nimport { getDocEsign } from '../../data/documents'\nimport { uploadDoc } from '../../data/documents'\nimport useAllDocuments from '../../../src/data/hooks/useAllDocuments'\nimport toaster from 'react-hot-toast'\nimport ConfirmationModal from '../../components/ConfirmationModal'\nimport { useHistory } from 'react-router-dom'\nimport { cleanUrlParams } from './../../data/utils'\nimport modalStyles from './../../assets/styles/modalStyles'\nimport Contract from './Contract'\nimport { getContract } from '../../data/documents'\nimport api from '../../data/api'\n\nModal.setAppElement('#root')\n\nconst DealAction = ({\n  loanPool,\n  email,\n  buyer,\n  setProposedLoaded,\n  setLoadingOverlay,\n  // currentSid\n}) => {\n  const [esign, setESign] = useState({\n    accountId: '',\n    envelopeId: '',\n    redirectUrl: ''\n  })\n  const [contractBuyer, setContractBuyer] = useState({})\n  const [contractSeller, setContractSeller] = useState({})\n  // const [signatureTypeContractSeller, setSignatureTypeContractSeller] =\n    useState()\n  // const [signatureTypeContractBuyer, setSignatureTypeContractBuyer] = useState()\n  const [contractSigned, setContractSigned] = useState(false)\n  const [showButtonsReviewContract, setShowButtonsReviewContract] =\n    useState(false)\n  const [refreshKey, setRefreshKey] = useState(0)\n  //const accountId = 'dfd56213-7d61-4704-89a7-ac1bcd3e767c'\n  const accountId = '75692d6a-37ce-4fc8-8d21-cff9fece7aae'\n\n  const docusignevent = new URLSearchParams(\n    document.location.search.substring(1)\n  ).get('event')\n\n  const docusignEnvelopeId = new URLSearchParams(\n    document.location.search.substring(1)\n  ).get('envelopeId')\n\n  const [isAuditOpen, setAuditOpen] = useState(false)\n  const [proposedBuyers, setProposedBuyers] = useState({})\n  const { refetch } = useAllDocuments(loanPool?.id)\n  const [showErrorPrompt, setErrorPromptOpen] = useState(false)\n  const [promptMessage, setPromptMessage] = useState('')\n  const history = useHistory()\n\n  useEffect(() => {\n    if (loanPool) {\n      getProposedBuyers(loanPool.id)\n        .then(res => {\n          setProposedBuyers(res)\n          setProposedLoaded(true)\n          if (loanPool.owner.email === email) {\n            // Seller\n            res.buyer.signature === 'contract signed' &&\n            res.seller.signature === 'loi signed'\n              ? setShowButtonsReviewContract(true)\n              : setShowButtonsReviewContract(false)\n            res.buyer.signature === 'contract signed' &&\n            res.seller.signature === 'contract signed'\n              ? setContractSigned(true)\n              : setContractSigned(false)\n            setContractBuyer(res.buyer)\n            setContractSeller(res.seller)\n            // setSignatureTypeContractBuyer('contract signed')\n            // setSignatureTypeContractSeller('contract signed')\n            if (res.docuSignId && res.docType === 'Contract') {\n              setESign({\n                accountId: accountId,\n                envelopeId: res.docuSignId\n              })\n            }\n          } else {\n            // Buyer\n            setShowButtonsReviewContract(true)\n            setContractBuyer(res.buyer)\n            setContractSeller(res.seller)\n            setESign({\n              accountId: accountId,\n              envelopeId: '',\n              redirectUrl: ''\n            })\n            // setSignatureTypeContractBuyer('contract signed')\n            // setSignatureTypeContractSeller('loi signed')\n            // // Switch to payment panel?\n            if (\n              res.buyer.signature === 'contract signed' &&\n              res.seller.signature === 'loi signed'\n            ) {\n              setShowButtonsReviewContract(false)\n            }\n            if (\n              res.buyer.signature === 'contract signed' &&\n              res.seller.signature === 'contract signed'\n            ) {\n              setShowButtonsReviewContract(false)\n              setContractSigned(true)\n            }\n          }\n        })\n        .catch(e => {\n          setProposedLoaded(false)\n          if (e?.response?.data?.message) {\n            setPromptMessage(e.response.data.message)\n          } else {\n            setPromptMessage('Something went wrong, please try again later')\n          }\n          setErrorPromptOpen(true)\n          setShowButtonsReviewContract(false)\n          setContractSigned(false)\n        })\n    }\n  }, [loanPool, email, refreshKey])\n\n  const getMessage = () => {\n    setTimeout(() => {\n      setRefreshKey(oldKey => oldKey + 1)\n    }, 3000)\n  }\n\n  useEffect(() => {\n    event.on(\n      'refetch',\n      _.throttle(getMessage, 1000, { leading: true, trailing: false })\n    )\n  }, [])\n\n  const reviewContract = async () => {\n    setLoadingOverlay(true)\n\n    if (esign.envelopeId === '') {\n      const buyer = JSON.stringify({\n        email: contractBuyer.email,\n        name: contractBuyer.entity,\n        role: 'Buyer'\n      })\n      const seller = JSON.stringify({\n        email: loanPool.owner.email,\n        name: loanPool.owner.entity,\n        role: 'Seller'\n      })\n\n      const data = new FormData()\n\n      try {\n        const contract = await getContract(loanPool.id)\n        const latest = contract.versionedDocs.at(-1)\n        const file = await api().get(latest.link, {\n          responseType: 'blob',\n          responseEncoding: 'binary'\n        })\n        data.append('file', file.data)\n        // data.append('fileExtension', file.type)\n        if (email === contractBuyer.email) {\n          data.append('signer', buyer), data.append('counterSigner', seller)\n        } else {\n          data.append('signer', seller), data.append('counterSigner', buyer)\n        }\n        data.append('templateName', 'Contract')\n        data.append('dsReturnUrl', location.href)\n      } catch (e) {\n        console.log('e: ', e)\n        setLoadingOverlay(false)\n        toaster.error('Something went wrong, please try again later')\n        throw e\n      }\n      try {\n        const esignRes = await getESign(data)\n        console.log('esignRes: ', esignRes);\n        if (esignRes.err) {\n          console.log('esign Err: ', esignRes.err);\n        }\n        window.location.href = esignRes.redirectUrl\n      } catch (e) {\n        setESign({})\n        setLoadingOverlay(false)\n        console.log(e)\n      }\n      // console.log(err)\n      // setLoadingOverlay(false)\n      // if (err.response.data.message) {\n      //   toaster.error(err.response.data.message)\n      // } else {\n      //   toaster.error('Something went wrong, please try again later')\n      // }\n    } else {\n      const data = new FormData()\n      data.append('envelopeId', esign.envelopeId)\n      data.append('dsReturnUrl', location.href)\n      data.append('templateName', 'Contract')\n      try {\n        const esignRes = await getESign(data)\n        if (esignRes.err) {\n          console.log('esign Err: ', esignRes.err);\n        }\n        window.location.href = esignRes.redirectUrl\n      } catch (e) {\n        setLoadingOverlay(false)\n        console.log('e:', e)\n      }\n    }\n  }\n\n  useEffect(() => {\n    const contractSignAgreed = signStatus => {\n      const isOwner = loanPool.owner.email === email\n\n      let signature = ''\n      if (signStatus === 'signing_complete' || signStatus === 'viewing_complete') {\n        signature = 'contract signed'\n      }\n      if (signStatus === 'decline') {\n        signature = 'contract rejected'\n      }\n      if (signStatus === 'cancel') {\n        cleanUrlParams()\n        return\n      }\n\n      // console.log('is owner?', isOwner)\n      // console.log('loanpool status', loanPool.status)\n      // console.log('contractSeller->', contractSeller)\n      // console.log('contractBuyer->', contractBuyer)\n      // console.log('signatureTypeContractSeller->', signatureTypeContractSeller)\n      // console.log('signatureTypeContractBuyer->', signatureTypeContractBuyer)\n      if (\n        Object.entries(contractBuyer).length === 0 ||\n        Object.entries(contractSeller).length === 0\n      )\n        return\n      if (\n        (contractBuyer.signature === 'contract signed' && !isOwner) ||\n        contractSeller.signature === 'contract signed'\n      )\n        return\n\n      console.log('contract agreed')\n\n      const data = {\n        loanId: loanPool.id,\n        docType: 'contract',\n        docuSignId: docusignEnvelopeId,\n        buyer: {\n          role: 'buyer',\n          email: contractBuyer.email,\n          entity: contractBuyer.entity,\n          signature: isOwner ? contractBuyer.signature : signature\n        },\n        seller: {\n          role: 'seller',\n          email: loanPool.owner.email,\n          entity: loanPool.owner.entity,\n          signature: isOwner ? signature : 'loi signed'\n        }\n      }\n      console.log('payload for contract', data)\n      setLoadingOverlay(true)\n      updateDealRoom(data)\n        .then(() => {\n          if (isOwner) {\n            // upload signed document to backend\n            let filename = 'Contract_' + loanPool.id + '_Signed'\n            getDocEsign(docusignEnvelopeId, filename).then(file => {\n              const formData = new FormData()\n              formData.append('name', filename)\n              formData.append('description', 'Loi signed')\n              formData.append('filetype', file.type)\n              formData.append('data', file, filename + '.pdf')\n              formData.append('accessType', file.accessType | 'ALL_ACCESS')\n              uploadDoc(loanPool.id, formData).then(res => {\n                // refetch files from document history\n                console.log('Upload contract signed seller', res)\n                refetch()\n              })\n            })\n          }\n          setContractSigned(true)\n          cleanUrlParams()\n          setTimeout(() => {\n            setLoadingOverlay(false)\n          }, 2000)\n        })\n        .then(e => {\n          console.log(e)\n          setLoadingOverlay(false)\n          // TODO: Fix error message after success\n          // toaster.error('Error saving signature, please try again later')\n        })\n    }\n    // Wait for objects to be ready before attempting to update a deal\n    // Sign: signing_complete\n    // Later: cancel\n    // Decline: decline.\n    if (loanPool && docusignevent) contractSignAgreed(docusignevent)\n  }, [loanPool, docusignevent, contractBuyer])\n\n  const handleAuditClick = () => setAuditOpen(true)\n\n  // const manageMenu = useMemo(() => (\n  //   <ManageMenu\n  //     buyer={buyer}\n  //     isOwner={loanPool?.owner?.email === email}\n  //     loanPool={loanPool}\n  //     proposedBuyers={proposedBuyers}\n  //   />\n  // ), [])\n\n  return (\n    <div id=\"deal-action\" className=\"py-6\">\n      <div id=\"ds-terms-of-service\"></div>\n      <div className=\"flex items-center justify-between px-6\">\n        <h2 className=\"text-lg font-bold text-pantone\">Loan Details</h2>\n        <div className=\"flex items-center\">\n          <div>\n            <img src={audit_image} className=\"w-8\" />\n            <Button\n              variant=\"link\"\n              className=\"underline\"\n              onClick={handleAuditClick}\n            >\n              Audit\n            </Button>\n          </div>\n          <ManageMenu\n            buyer={buyer}\n            isOwner={loanPool?.owner?.email === email}\n            loanPool={loanPool}\n            proposedBuyers={proposedBuyers}\n          />\n        </div>\n      </div>\n      <div className=\"flex-grow overflow-y-auto h-screen/2\">\n        {loanPool && (\n          <LoanCard\n            className=\"border-none shadow-none\"\n            loanPool={loanPool}\n            footer={false}\n          />\n        )}\n      </div>\n      <div className=\"p-6 border-t-4 rounded-xl border-platinun\">\n        <Contract\n          loanId={loanPool?.id}\n          reviewContract={reviewContract}\n          contractSigned={contractSigned}\n          showButtonsReviewContract={showButtonsReviewContract}\n        />\n        {showButtonsReviewContract ? null : (\n          <p className=\"pt-6 text-center text-pantone\">\n            {contractSigned ? (\n              <span>Contract signed</span>\n            ) : (\n              <span>Waiting for counterparty response</span>\n            )}\n          </p>\n        )}\n      </div>\n      <Modal\n        isOpen={isAuditOpen}\n        onRequestClose={() => setAuditOpen(false)}\n        style={modalStyles}\n      >\n        <h2 className=\"text-xl font-bold\">Audit Log</h2>\n        <div className=\"py-2 border-b\"></div>\n        <iframe\n          src={audit_frame}\n          className=\"pt-4\"\n          width=\"900px\"\n          height=\"500px\"\n        ></iframe>\n      </Modal>\n      <ConfirmationModal\n        title={promptMessage}\n        textOk={'Ok'}\n        showPrompt={showErrorPrompt}\n        handleOK={() => history.push('/')}\n      />\n    </div>\n  )\n}\n\nexport default DealAction\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAuCAYAAABEbmvDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAtJSURBVHgB3VkJWJVVGn7vDnfjAiLIIsgiiwqU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2YkR+6I4DyUkYO/0PXCoNxuMv9N987PzpJ8kFxsX+Sk1T+7fWfy8Z45aS9/ezzQp2N9WcS8WZ6tRnM0VdzUJaE5PCqsO1p9cCL1iI1YHpZBqN29heWNarx1eCw8qIBev+8CjIRPh9NdSdO7NwoiydbZvoWbI97O199qzttqGi9lFtRnZxfufjDcPm3PGc8QOtnRaS26EJ/jxPODmlOu5VmXzU4UmdPUUfMqZ8eeaRW2nwV41M/ZFpV05NAv9Z23M+eAFdyJD910MWfd3qAOKJJOdkSrp6Xh0yQ/FNRqedMyJ6CYMLEICz//HXt9vqOuedm2z07H479l61eMf+SlZ0ME4Qfwz6bIAOHsp3b82kyfZxaFCWkx9qrBvn9QZ7DMrDWtTUxKXzMGktKr3MfkjIkuDX7OXRikDdqx8gabC7SdBRt/uJc3w4xqGN+yE8Xl1OIRmxwYN+68AYO0O/oB4lwUZJ+cDHuzhfKN+E7JOvCaZkWVo037qm3RSV/hDuyu/GTz4rIQN32z4mUphIoJXqUfL15X3Ij/V/sXzWflMXq5YS0AAAAASUVORK5CYII=\"","import DealAction from './DealAction'\nimport { useEffect, useState } from 'react'\nimport { createConversation } from '../../data/conversations'\nimport { getLoanPoolById } from '../../data/loanPools'\nimport AppBar from '../../components/AppBar'\nimport Chat from '../../components/Chat'\nimport Icon from '../../components/Icon'\nimport DocumentHistory from '../../components/DocumentHistory'\nimport ConfirmationModal from '../../components/ConfirmationModal'\nimport { useHistory } from 'react-router-dom'\nimport { getProposedBuyers } from '../../data/loanPools'\nimport LoadingOverlay from 'react-loading-overlay-ts'\nimport useTwilioClient from '../../data/hooks/useTwilioClient'\n\nconst DealRoom = ({ match }) => {\n  const { loanId } = match.params\n  const [loanPool, setLoanPool] = useState(null)\n  const [conversationSid, setConversationSid] = useState('')\n  const [buyer, setBuyer] = useState('')\n  const { email, entity } = JSON.parse(localStorage.getItem('user'))\n  const [proposedLoaded, setProposedLoaded] = useState(false)\n  const [showErrorPrompt, setErrorPromptOpen] = useState(false)\n  const [promptMessage, setPromptMessage] = useState('')\n  const history = useHistory()\n  const [loadingOverlay, setLoadingOverlay] = useState(false)\n  const client = useTwilioClient(email)\n\n  useEffect(() => {\n    const retrieveLoanPool = async () => {\n      try {\n        const loanPool = await getLoanPoolById(loanId)\n        setLoanPool(loanPool)\n      } catch (e) {\n        if (e.response.data.message) {\n          setPromptMessage(e.response.data.message)\n        } else {\n          setPromptMessage('Something went wrong, please try again later')\n        }\n        setErrorPromptOpen(true)\n      }\n    }\n    retrieveLoanPool()\n  }, [loanId])\n\n  useEffect(() => {\n    if (loanPool) {\n      const getBuyer = async () => {\n        try {\n          const res = await getProposedBuyers(loanPool.id)\n          setBuyer(res.buyer)\n        } catch (e) {\n          console.log(e)\n        }\n      }\n      getBuyer()\n    }\n  }, [loanPool])\n\n  useEffect(() => {\n    const retrieveConversation = async () => {\n      const existingConversation = loanPool.conversations.find(\n        c => c.conversationSid === buyer.conversationSid\n      )\n      const participants = await createConversation({\n        loanId: loanPool.id,\n        email,\n        entity,\n        conversationSid: existingConversation?.conversationSid\n      })\n      setConversationSid(participants[0].conversationSid)\n    }\n    if (loanPool && loanPool.conversations) retrieveConversation()\n    // eslint-disable-next-line\n  }, [buyer])\n\n  return (\n    <div>\n      <LoadingOverlay active={loadingOverlay} spinner>\n        <AppBar />\n        <div className=\"flex\">\n          <div className=\"w-full\">\n            <div id=\"ds-terms-of-service\"></div>\n            <div className=\"flex\">\n              <div style={{ minWidth: 300 }}>\n                <header className=\"justify-between p-6\">\n                  <h2 className=\"text-xl font-bold text-pantone\">Deal Room</h2>\n                  <h3 className=\"block mt-4 text-xl font-bold\">Message</h3>\n                </header>\n                <section className=\"\">\n                  <div className=\"flex items-center p-3\">\n                    <div className=\"inline-block p-3 bg-black border rounded-full\">\n                      <Icon className=\"w-3 h-3\" id=\"profile\" fill=\"white\" />\n                    </div>\n                    <div className=\"ml-2\">\n                      <strong className=\"block text-base\">\n                        {loanPool?.owner.email === email\n                          ? buyer.displayName\n                          : loanPool?.owner.displayName}\n                      </strong>\n                      <div className=\"flex items-center text-md\">\n                        <Icon\n                          id=\"available\"\n                          className=\"w-4 h-4 mr-1 fill-current text-pantone\"\n                        />\n                        In-Network\n                      </div>\n                    </div>\n                  </div>\n                </section>\n              </div>\n              <Chat\n                loanPool={loanPool}\n                conversationSid={conversationSid}\n                buyerDisplayName={buyer.displayName}\n                client={client}\n                dealroom\n              />\n            </div>\n            <div>\n              {proposedLoaded ? (\n                <DocumentHistory loanId={loanId} carousel />\n              ) : null}\n            </div>\n          </div>\n          <DealAction\n            setProposedLoaded={setProposedLoaded}\n            loanPool={loanPool}\n            email={email}\n            entity={entity}\n            buyer={buyer}\n            setLoadingOverlay={setLoadingOverlay}\n            currentSid={conversationSid}\n          />\n        </div>\n        <ConfirmationModal\n          title={promptMessage}\n          textOk={'Ok'}\n          showPrompt={showErrorPrompt}\n          handleOK={() => history.push('/')}\n        />\n      </LoadingOverlay>\n    </div>\n  )\n}\n\nexport default DealRoom\n","import Button from '../Button'\n\nconst RegistrationStep = ({ children, stepQuestion, currentStep, nextStep, previousStep}) => {\n  console.log('currentStep', currentStep)\n  return (\n    <div className=\"text-center w-500\">\n      <div className=\"shadow-lg text-center rounded-xl\">\n        <div className=\"p-10 border-b\">\n          <p className=\"text-onyx text-md mb-3\">{currentStep} / 3</p>\n          <h1 className=\"text-pantone text-lg font-bold\">Account Registration</h1>\n          <p className=\"text-xl font-bold mt-8 mb-6\">{stepQuestion}</p>\n          {children}\n        </div>\n        <div className=\"flex\">\n          <Button className=\"flex-1 h-12 rounded-tr-none rounded-br-none rounded-tl-none rounded-bl-xl\" disabled={currentStep === 1 ? true : false} onClick={previousStep}>Back</Button>\n          <Button className=\"flex-1 h-12 bg-davys text-cultured rounded-tl-none rounded-bl-none rounded-tr-none rounded-br-xl\" onClick={nextStep}>Next</Button>\n        </div>\n      </div>\n      <Button variant=\"link\" className=\"text-pantone underline font-bold mt-7\">Save and finish later</Button>\n    </div>\n  )\n}\n\nexport default RegistrationStep\n","import { useHistory } from \"react-router-dom\";\nimport StepWizard from \"react-step-wizard\";\nimport AppBar from \"../../components/AppBar\";\nimport RegistrationStep from \"../../components/RegistrationStep\";\nimport Button from \"../../components/Button\";\nimport TextField from \"../../components/TextField\";\nimport { routes } from \"../../router\";\nimport { useState } from \"react\";\n\nconst Register = () => {\n  const history = useHistory();\n  const [isDecisionMaker, setDecisionMaker] = useState(true)\n\n  const handleDecisionMaker = () => {\n    setDecisionMaker(!isDecisionMaker);\n  }\n\n  return (\n    <div>\n      <AppBar />\n      <div className=\"container mx-auto mt-10\">\n        <div className=\"md:flex md:justify-center\">\n          <StepWizard>\n            <RegistrationStep stepQuestion=\"What kind of institution are you?\">\n              <select\n                className=\"w-full h-10 pl-3 pr-6 text-base bg-white border rounded-lg focus:shadow-outline focus:outline-none\"\n                placeholder=\"Regular input\"\n              >\n                <option className=\"bg-white\">Asset Manager</option>\n                <option className=\"bg-white\">Bank</option>\n                <option className=\"bg-white\">Broker</option>\n                <option className=\"bg-white\">Credit Union</option>\n                <option className=\"bg-white\">Due Diligence Firm</option>\n              </select>\n            </RegistrationStep>\n            <RegistrationStep stepQuestion=\"Will you be the primary decision maker for your institution?\">\n              <div className=\"text-left\">\n                <div className=\"mb-3\">\n                  <input\n                    name=\"DecisionMaker\"\n                    id=\"Yes\"\n                    type=\"radio\"\n                    value=\"Yes\"\n                    checked={isDecisionMaker}\n                    onChange={handleDecisionMaker}\n                  />\n                  <label className=\"ml-2\" htmlFor=\"Yes\">\n                    Yes\n                  </label>\n                </div>\n                <div>\n                  <input\n                    name=\"DecisionMaker\"\n                    id=\"No\"\n                    type=\"radio\"\n                    value=\"No\"\n                    checked={!isDecisionMaker}\n                    onChange={handleDecisionMaker}\n                  />\n                  <label className=\"ml-2\" htmlFor=\"No\">\n                    No\n                  </label>\n                </div>\n                {!isDecisionMaker && (\n                  <div className=\"mt-3\">\n                    <p className=\"text-sm\">\n                      Please enter the email address of the primary decision\n                      maker\n                    </p>\n                    <TextField\n                      className=\"w-full mt-1\"\n                      type=\"email\"\n                      placeholder=\"Email Address\"\n                    />\n                  </div>\n                )}\n              </div>\n            </RegistrationStep>\n            <RegistrationStep stepQuestion=\"What is your primary responsability within your organization?\">\n              <select\n                className=\"w-full h-10 pl-3 pr-6 text-base bg-white border rounded-lg focus:shadow-outline focus:outline-none\"\n                placeholder=\"Regular input\"\n              >\n                <option className=\"bg-white\">Conduct Transactions</option>\n                <option className=\"bg-white\">Research Loans</option>\n                <option className=\"bg-white\">Office Administrator</option>\n                <option className=\"bg-white\">Others</option>\n              </select>\n            </RegistrationStep>\n            <div className=\"w-500\">\n              <div className=\"px-10 py-16 shadow-lg rounded-xl\">\n                <p className=\"mb-8 text-2xl font-bold\">\n                  Thank you for your interest in registering with DATE!\n                </p>\n                <p className=\"mb-4\">\n                  We will contact you shortly with additional information to\n                  complete the registration process. <br />\n                  Once completed, you will have access to DATE.\n                </p>\n                <p>\n                  Until then, your account will not be active.\n                  <br />\n                  Thank you got yout understanding and we look forward to having\n                  you join the DATE marketplace!\n                </p>\n              </div>\n              <div className=\"text-center\">\n                <Button\n                  variant=\"link\"\n                  className=\"font-bold underline text-pantone mt-7\"\n                  onClick={() => history.push(routes.root)}\n                >\n                  Return to Homepage\n                </Button>\n              </div>\n            </div>\n          </StepWizard>\n        </div>\n      </div>\n    </div>\n  );\n};\n\nexport default Register;\n","import api from './api'\n\nexport const signup = async data => {\n  console.log('payload', data)\n  const response = await api().post('/signup/loanpool', data)\n  return response.data\n}\n","import api from \"./api\";\n\nexport const search = async (term, authToken) => {\n  const data = await api().get(`loanpool/business/wildcard/${term}`, {\n    headers: { Authorization: `Bearer ${authToken}` },\n  });\n  console.log(data.data)\n  return data.data;\n};\n","import TextField from '../../components/TextField'\nimport Button from '../../components/Button'\nimport { signup } from '../../data/auth'\nimport { useEffect, useState } from 'react'\nimport { useForm } from 'react-hook-form'\nimport { useHistory } from 'react-router-dom'\nimport { routes } from '../../router'\nimport { useQuery } from 'react-query'\nimport { search } from '../../data/wildcard'\nimport { app } from '../../data/firebaseConfig'\n\nconst SignUp = () => {\n  const {\n    register,\n    handleSubmit,\n    setValue,\n    watch,\n  } = useForm()\n  const [isLoading, setLoading] = useState(false)\n  const [error, setError] = useState('')\n  const history = useHistory()\n  const [term, setTerm] = useState('')\n  const [token, setToken] = useState('')\n  const [selected, setSelected] = useState(false)\n\n  const fieldsQuery = useQuery(['fields', term], () => search(term, token), {\n    enabled: false\n  })\n\n  useEffect(() => {\n    if (term && !selected) {\n      fieldsQuery.refetch()\n    }\n  }, [term])\n\n  useEffect(() => {\n    const init = async () => {\n      const { user } = await app\n        .auth()\n        .signInWithEmailAndPassword('admin@permissionednetworks.com', 'test123')\n      const authToken = await user.getIdToken()\n      setToken(authToken)\n    }\n    init()\n  }, [])\n\n  const handleSignUpSubmit = async ({\n    firstName,\n    lastName,\n    email,\n    password,\n    financialInstitution\n  }) => {\n    try {\n      setError('')\n      setLoading(true)\n      const { user } = await app\n        .auth()\n        .createUserWithEmailAndPassword(email, password)\n      console.log('user', user)\n      const authToken = await user.getIdToken()\n      console.log(authToken)\n      localStorage.setItem(\n        'user',\n        JSON.stringify({\n          email: email.toLowerCase(),\n          authToken,\n          entity: financialInstitution\n        })\n      )\n      const data = await signup({\n        email,\n        password,\n        confirmPassword: password,\n        entity: financialInstitution,\n        displayName: `${firstName} ${lastName}`\n      })\n      setLoading(false)\n      console.log(data)\n      history.push(routes.register)\n    } catch (error) {\n      setError(error.message)\n      setLoading(false)\n    }\n  }\n\n  const handleBankChange = e => {\n    setTerm(e.target.value)\n    setSelected(false)\n  }\n\n  const handleItemClick = e => {\n    setValue('financialInstitution', e.target.innerText)\n    setSelected(true)\n  }\n\n  return (\n    <div className=\"flex items-center min-h-screen\">\n      <div className=\"mx-auto border-t shadow-lg rounded-xl w-500\">\n        <div className=\"p-4 border-b\">\n          <h1 className=\"text-2xl font-bold text-center text-pantone\">date</h1>\n        </div>\n        <div className=\"p-4\">\n          <h2 className=\"mb-6 text-lg font-bold\">Sign Up</h2>\n          <form\n            className=\"space-y-4\"\n            onSubmit={handleSubmit(handleSignUpSubmit)}\n          >\n            <div className=\"flex space-x-4\">\n              <TextField\n                className=\"w-1/2\"\n                placeholder=\"First name\"\n                innerRef={register('firstName')}\n              />\n              <TextField\n                className=\"w-1/2\"\n                placeholder=\"Last name\"\n                innerRef={register('lastName')}\n              />\n            </div>\n            <div className=\"relative\">\n              <TextField\n                type=\"select\"\n                className=\"w-full\"\n                placeholder=\"Financial Institution\"\n                innerRef={register('financialInstitution')}\n                onChange={handleBankChange}\n              />\n              <ul className=\"absolute z-10 truncate bg-white border-b border-l border-r whitespace-nowrap\">\n                {fieldsQuery.data?.map((institution, index) => {\n                  return (\n                    term && !selected && (\n                      <li\n                        key={index}\n                        className=\"p-2 cursor-default hover:bg-gray-100\"\n                        onClick={handleItemClick}\n                      >\n                        {institution.name}\n                      </li>\n                    )\n                  )\n                })}\n              </ul>\n            </div>\n            <TextField\n              className=\"w-full\"\n              placeholder=\"Work email address\"\n              type=\"email\"\n              innerRef={register('email')}\n            />\n            <TextField\n              className=\"w-full\"\n              placeholder=\"Password\"\n              type=\"password\"\n              innerRef={register('password')}\n            />\n            <Button\n              className=\"w-full rounded-lg\"\n              variant=\"contained\"\n              isLoading={isLoading}\n              disabled={\n                !watch().firstName ||\n                !watch().lastName ||\n                !watch().email ||\n                !watch().password\n              }\n            >\n              Create an account\n            </Button>\n            <span className=\"block text-sm text-center text-error\">\n              {error}\n            </span>\n            <p className=\"text-sm text-center\">\n              Already have an account?{' '}\n              <Button className=\"text-sm font-bold underline\" variant=\"link\">\n                Sign In\n              </Button>\n            </p>\n          </form>\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default SignUp\n","import { Link } from 'react-router-dom'\nimport Button from '../../components/Button'\nimport { routes } from '../../router'\n\nconst renderItems = items => {\n  if (items.length > 1) {\n    return items.map((item, index) => (\n      <span key={index}>\n        {item}\n        {index ? '' : ', '}\n      </span>\n    ))\n  }\n  return items\n}\n\nconst renderBool = item => {\n  return item ? 'Yes' : 'No'\n}\n\nconst Section = ({ title, data, onEdit, isLoading, children }) => {\n  return (\n    <div className=\"px-8 py-12 border-t shadow-md\">\n      {children ? (\n        <>\n          <div className=\"flex justify-between\">\n            <h3 className=\"text-xl font-bold text-pantone\">{title}</h3>\n          </div>\n          <div className=\"mt-8\">{children}</div>\n        </>\n      ) : (\n        <>\n          <div className=\"flex justify-between\">\n            <h3 className=\"text-xl font-bold text-pantone\">{title}</h3>\n            <Button\n              isLoading={isLoading}\n              variant=\"link\"\n              className=\"underline\"\n              onClick={onEdit}\n            >\n              Edit\n            </Button>\n          </div>\n          <table className=\"flex w-full mt-8\">\n            <thead>\n              <tr className=\"flex flex-col items-start mr-16 space-y-3\">\n                {Object.keys(data).map((key, index) => (\n                  <th key={index}>{key}:</th>\n                ))}\n              </tr>\n            </thead>\n            <tbody>\n              <tr className=\"flex flex-col space-y-3\">\n                {Object.keys(data).map((key, index) => (\n                  <td key={index}>\n                    {key === 'Financial Institution' ? (\n                      <Link\n                        to={`${routes.profile}/${data[key]}`}\n                        className=\"underline\"\n                      >\n                        {data[key]}\n                      </Link>\n                    ) : typeof data[key] === 'object' ? (\n                      renderItems(data[key])\n                    ) : typeof data[key] === 'boolean' ? (\n                      renderBool(data[key])\n                    ) : (\n                      data[key]\n                    )}\n                  </td>\n                ))}\n              </tr>\n            </tbody>\n          </table>\n        </>\n      )}\n    </div>\n  )\n}\n\nexport default Section\n","import { useState } from 'react'\nimport { app } from '../../../src/data/firebaseConfig'\nimport { yupResolver } from '@hookform/resolvers/yup'\nimport toaster from 'react-hot-toast'\nimport * as Yup from 'yup'\nimport SectionModal from './SectionModal'\nimport TextField from '../../components/TextField'\nimport Button from '../../components/Button'\nimport { useForm } from 'react-hook-form'\nimport { uploadUser } from '../../data/loanPools'\n\nconst Account = ({ data, onCancel, reloadSettings }) => {\n  const [isLoading, setIsLoading] = useState(false)\n\n  const user = app.auth().currentUser\n\n  const validationSchema = Yup.object().shape({\n    password: Yup.string()\n      .required('Password is required')\n      .min(6, 'Password must be at least 6 characters'),\n    confirmPassword: Yup.string()\n      .required('Confirm password is required')\n      .oneOf([Yup.ref('password')], 'Passwords must match')\n  })\n  const formOptions = { resolver: yupResolver(validationSchema) }\n\n  const {\n    register,\n    handleSubmit,\n    reset,\n    formState: { isDirty, errors }\n  } = useForm(formOptions)\n\n  const {\n    register: register1,\n    handleSubmit: handleSubmit1,\n    reset: reset1,\n    formState: { isDirty: isDirty1 }\n  } = useForm({\n    defaultValues: { displayName: data.displayName, entity: data.entity }\n  })\n\n  const onUpdate = data => {\n    user\n      .updatePassword(data.password)\n      .then(() => {\n        toaster.success('Password updated!')\n        reset({ password: '', confirmPassword: '' })\n      })\n      .catch(e => {\n        toaster.error(e.message)\n      })\n  }\n\n  const onSave = async data => {\n    setIsLoading(true)\n    const { email } = JSON.parse(localStorage.getItem('user'))\n    const formData = new FormData()\n\n    formData.append('email', email)\n    formData.append('displayName', `${data.firstName} ${data.lastName}`)\n    formData.append('entity', data.entity)\n\n    try {\n      await uploadUser(formData)\n      setTimeout(() => {\n        setIsLoading(false)\n        // set to isDirty to false\n        reset1(data)\n        reloadSettings()\n        toaster.success('Saved')\n      }, 2000)\n    } catch (e) {\n      setIsLoading(false)\n      if (e.response.data.message) {\n        toaster.error(e.response.data.message)\n      } else {\n        toaster.error('Something went wrong, please try again later')\n      }\n      console.log(e)\n      // set isSubmitSuccessful to false :)\n      throw e\n    }\n  }\n\n  return (\n    <SectionModal\n      title=\"Account Settings\"\n      onCancel={onCancel}\n      onSave={handleSubmit1(onSave)}\n      isLoading={isLoading}\n      disableSave={!isDirty1}\n    >\n      <div className=\"space-y-5\">\n        <div className=\"flex space-x-4\">\n          <div className=\"relative w-1/2\">\n            <label className=\"absolute text-sm text-quickSilver top-2 left-4\">\n              First name\n            </label>\n            <TextField\n              className=\"w-full px-4 pt-7\"\n              defaultValue={data.Name.split(' ')[0]}\n              innerRef={register1('firstName')}\n            />\n          </div>\n          <div className=\"relative w-1/2\">\n            <label className=\"absolute text-sm text-quickSilver top-2 left-4\">\n              Last name\n            </label>\n            <TextField\n              className=\"w-full px-4 pt-7\"\n              defaultValue={data.Name.split(' ')[1]}\n              innerRef={register1('lastName')}\n            />\n          </div>\n        </div>\n        <div className=\"relative w-full\">\n          <label className=\"absolute text-sm text-quickSilver top-2 left-4\">\n            Financial institution\n          </label>\n          <TextField\n            className=\"w-full px-4 pt-7\"\n            defaultValue={data['Financial Institution']}\n            innerRef={register1('entity')}\n          />\n        </div>\n        <div className=\"relative w-full\">\n          <label className=\"absolute text-sm text-quickSilver top-2 left-4\">\n            Password\n          </label>\n          <TextField\n            className=\"w-full px-4 pt-7\"\n            type=\"password\"\n            autoComplete=\"new-password\"\n            innerRef={register('password')}\n          />\n          <span className=\"block text-sm text-center text-error\">\n            {errors.password?.message}\n          </span>\n        </div>\n        <div className=\"relative w-full\">\n          <label className=\"absolute text-sm text-quickSilver top-2 left-4\">\n            Confirm password\n          </label>\n          <TextField\n            className=\"w-full px-4 pt-7\"\n            type=\"password\"\n            autoComplete=\"new-password\"\n            innerRef={register('confirmPassword')}\n          />\n          <span className=\"block text-sm text-center text-error\">\n            {errors.confirmPassword?.message}\n          </span>\n        </div>\n        <div className=\"flex space-x-4\">\n          <Button\n            disabled={!isDirty}\n            variant=\"outlined\"\n            className=\"flex-1\"\n            onClick={handleSubmit(onUpdate)}\n          >\n            Update password\n          </Button>\n          <Button\n            disabled={!isDirty}\n            variant=\"outlined\"\n            className=\"flex-1\"\n            onClick={() => reset({ password: '', confirmPassword: '' })}\n          >\n            Reset\n          </Button>\n        </div>\n      </div>\n    </SectionModal>\n  )\n}\nexport default Account\n","import { useState } from 'react'\nimport toaster from 'react-hot-toast'\nimport SectionModal from './SectionModal'\nimport TextField from '../../components/TextField'\nimport { useForm } from 'react-hook-form'\nimport { uploadUser } from '../../data/loanPools'\n\nconst Organization = ({ data, onCancel, reloadSettings }) => {\n  const [isLoading, setIsLoading] = useState(false)\n  const { register, watch, handleSubmit, formState, reset } = useForm({\n    defaultValues: {\n      entityType: data['Institution Type'],\n      role: data['Primary Responsability'],\n      decisionMaker: data['Decision Maker']\n    }\n  })\n\n  const { isDirty } = formState;\n  const isDesicionMaker = watch(\"decisionMaker\")\n\n  const institutionTypes = [\n    'Asset Manager',\n    'Bank',\n    'Broker',\n    'Credit Union',\n    'Due Diligence Firm'\n  ]\n\n  const responsabilities = [\n    'Conduct Transactions',\n    'Review Loan Sales',\n    'Support Loan Sale Activities',\n  ]\n\n  const onSave = async (data) => {\n    setIsLoading(true)\n    const { email } = JSON.parse(localStorage.getItem('user'))\n    const formData = new FormData()\n    formData.append('email', email)\n    formData.append('role', data.role)\n    formData.append('entityType', data.entityType)\n    formData.append('decisionMaker', data.decisionMaker)\n\n    try {\n      await uploadUser(formData)\n      setTimeout(() => {\n        setIsLoading(false)\n        // set to isDirty to false\n        reset(data)\n        reloadSettings()\n        toaster.success('Saved')\n      }, 2000)\n    } catch (e) {\n      setIsLoading(false)\n      if (e.response.data.message) {\n        toaster.error(e.response.data.message)\n      } else {\n        toaster.error('Something went wrong, please try again later')\n      }\n      console.log(e)\n      // set isSubmitSuccessful to false :)\n      throw e;\n    }\n  }\n\n  return (\n    <SectionModal\n      title=\"Organization Profile\"\n      onCancel={onCancel}\n      onSave={handleSubmit(onSave)}\n      isLoading={isLoading}\n      disableSave={!isDirty}\n    >\n      <div style={{ minWidth: 470 }} className=\"p-3 text-left space-y-5\">\n        <div>\n          <h5 className=\"mb-3 font-bold\">Institution Type:</h5>\n          <select\n            {...register('entityType')}\n            className=\"w-full h-10 pl-3 pr-6 text-base placeholder-gray-600 bg-white border rounded-lg focus:shadow-outline border-quickSilver\"\n          >\n            {institutionTypes.map((type, index) => (\n              <option key={index} value={type}>\n                {type}\n              </option>\n            ))}\n          </select>\n        </div>\n        <div>\n          <h5 className=\"mb-3 font-bold\">Primary Decision Maker:</h5>\n          <div className=\"mb-3\">\n            <input\n              name=\"DecisionMaker\"\n              type=\"checkbox\"\n              {...register('decisionMaker')}\n            />\n            <label className=\"ml-2\">\n              I am the Primary Decision Maker\n            </label>\n          </div>\n          {!isDesicionMaker && (\n            <div className=\"mt-3 ml-5\">\n              <p className=\"text-sm\">\n                Please enter the email address of the primary decision maker\n              </p>\n              <TextField\n                className=\"w-full mt-1\"\n                type=\"email\"\n                placeholder=\"Email Address\"\n              />\n            </div>\n          )}\n        </div>\n        <div>\n          <h5 className=\"mb-3 font-bold\">Primary Responsability:</h5>\n          <select\n            {...register('role')}\n            className=\"w-full h-10 pl-3 pr-6 text-base placeholder-gray-600 bg-white border rounded-lg focus:shadow-outline border-quickSilver\"\n          >\n            {responsabilities.map((responsability, index) => (\n              <option key={index} value={responsability}>\n                {responsability}\n              </option>\n            ))}\n          </select>\n        </div>\n      </div>\n    </SectionModal>\n  )\n}\n\nexport default Organization\n","import { useState } from 'react'\nimport toaster from 'react-hot-toast'\nimport SectionModal from './SectionModal'\nimport { useForm } from 'react-hook-form'\nimport { uploadUser } from '../../data/loanPools'\n\nconst Transaction = ({ data, onCancel, reloadSettings }) => {\n  const [isLoading, setIsLoading] = useState(false)\n  const { register, handleSubmit, formState, reset } = useForm({\n    defaultValues: {\n      assetClass: data['Loan Class'],\n      productTags: data['Tag'],\n      geographicInterests: data['Geographic Interests'],\n      listType: data['Transaction Interests']\n    }\n  })\n  const { isDirty } = formState\n\n  const loanClasses = [\n    'Consumer',\n    'Residential',\n    'Commercial & Industrial',\n    'Commercial Real Estate',\n    'Other'\n  ]\n\n  const tags = [\n    'My Listing',\n    'Non Performing',\n    'Non-QM',\n    'REO',\n    'Seasoned',\n    'Servicing Released',\n    'Servicing Retained',\n    'CRA Eligible',\n    'Non-Bank Originator',\n    'Non-Owner Occupied',\n    'Owner-Occupied',\n    'Re-Performing',\n    'Scratch & Dent'\n  ]\n\n  const transactionInterests = {\n    Sell: 'For Sale',\n    Buy: 'Looking to Buy'\n    // 'Looking to finance',\n    // 'Looking for finance',\n    // 'Forward Flow',\n    // 'For Participation'\n  }\n\n  const regions = [\n    'All states',\n    'Northeast',\n    'Southeast',\n    'Midwest',\n    'Southwest',\n    'West'\n  ]\n\n  const onSave = async data => {\n    console.log('postData: ', data)\n    setIsLoading(true)\n    const { email } = JSON.parse(localStorage.getItem('user'))\n    const formData = new FormData()\n    formData.append('email', email)\n    formData.append('preferences', JSON.stringify(data))\n\n    try {\n      await uploadUser(formData)\n      setTimeout(() => {\n        setIsLoading(false)\n        // set to isDirty to false\n        reset(data)\n        reloadSettings()\n        toaster.success('Saved')\n      }, 2000)\n    } catch (e) {\n      setIsLoading(false)\n      if (e.response.data.message) {\n        toaster.error(e.response.data.message)\n      } else {\n        toaster.error('Something went wrong, please try again later')\n      }\n      console.log(e)\n      // set isSubmitSuccessful to false :)\n      throw e\n    }\n  }\n\n  return (\n    <SectionModal\n      title=\"Transaction Preferences\"\n      onCancel={onCancel}\n      onSave={handleSubmit(onSave)}\n      isLoading={isLoading}\n      disableSave={!isDirty}\n    >\n      <div style={{ width: 470 }} className=\"p-3 text-left space-y-5\">\n        <div>\n          <h5 className=\"mb-3 font-bold\">Transaction Interest:</h5>\n          <div className=\"flex space-x-2.5\">\n            {Object.keys(transactionInterests).map(item => (\n              <div key={item} className=\"flex items-center space-x-1\">\n                <input\n                  type=\"checkbox\"\n                  value={transactionInterests[item]}\n                  {...register('listType')}\n                />\n                <label htmlFor=\"Buy\">{item}</label>\n              </div>\n            ))}\n          </div>\n        </div>\n        <div>\n          <h5 className=\"mb-3 font-bold\">Loan Class:</h5>\n          <div className=\"flex flex-wrap\">\n            {loanClasses.map((loanClass, index) => (\n              <div\n                key={index}\n                className=\"flex items-center mb-1 mr-3 space-x-1\"\n              >\n                <input\n                  name=\"loanClass\"\n                  type=\"checkbox\"\n                  value={loanClass}\n                  {...register('assetClass')}\n                />\n                <label htmlFor={loanClass}>{loanClass}</label>\n              </div>\n            ))}\n          </div>\n        </div>\n        <div>\n          <h5 className=\"mb-3 font-bold\">Associated Tag:</h5>\n          <div className=\"flex flex-wrap\">\n            {tags.map((tag, index) => (\n              <div\n                key={index}\n                className=\"flex items-center mb-1 mr-3 space-x-1\"\n              >\n                <input\n                  type=\"checkbox\"\n                  value={tag}\n                  {...register('productTags')}\n                />\n                <label htmlFor={tag}>{tag}</label>\n              </div>\n            ))}\n          </div>\n        </div>\n        <div>\n          <h5 className=\"mb-3 font-bold\">Geographic Interests:</h5>\n          <div className=\"flex flex-wrap\">\n            {regions.map((region, index) => (\n              <div\n                key={index}\n                className=\"flex items-center mb-1 mr-3 space-x-1\"\n              >\n                <input\n                  type=\"checkbox\"\n                  value={region}\n                  {...register('geographicInterests')}\n                />\n                <label>{region}</label>\n              </div>\n            ))}\n          </div>\n        </div>\n      </div>\n    </SectionModal>\n  )\n}\n\nexport default Transaction\n","import { useState } from 'react'\nimport SectionModal from './SectionModal'\nimport TextField from '../../components/TextField'\nimport { useForm } from 'react-hook-form'\nimport { uploadUser } from '../../data/loanPools'\nimport toaster from 'react-hot-toast'\nimport * as Yup from 'yup'\nimport { yupResolver } from '@hookform/resolvers/yup'\n\nconst Profile = ({ data, onCancel, reloadSettings }) => {\n  const [isLoading, setIsLoading] = useState(false)\n  // eslint-disable-next-line\n  const regMatch = /^((http|https):\\/\\/)?(www.)?(?!.*(http|https|www.))[a-zA-Z0-9_-]+(\\.[a-zA-Z]+)+(\\/)?.([\\w\\?[a-zA-Z-_%\\/@?]+)*([^\\/\\w\\?[a-zA-Z0-9_-]+=\\w+(&[a-zA-Z0-9_]+=\\w+)*)?$/;\n\n  const validationSchema = Yup.object().shape({\n    linkedInProfile: Yup.string().matches(regMatch, \"Website should be a valid URL\")\n  })\n\n  const {\n    register,\n    handleSubmit,\n    reset,\n    formState: { isDirty, errors }\n  } = useForm({\n    defaultValues: {\n      linkedInProfile: data['LinkedIn Profile']\n    },\n    resolver: yupResolver(validationSchema) \n  })\n\n  const onSave = async data => {\n    setIsLoading(true)\n    const { email } = JSON.parse(localStorage.getItem('user'))\n    const formData = new FormData()\n    formData.append('email', email)\n    formData.append('linkedInProfile', data.linkedInProfile)\n\n    try {\n      await uploadUser(formData)\n      setTimeout(() => {\n        setIsLoading(false)\n        reset(data)\n        reloadSettings()\n        toaster.success('Saved')\n      }, 2000)\n    } catch (e) {\n      setIsLoading(false)\n      if (e.response.data.message) {\n        toaster.error(e.response.data.message)\n      } else {\n        toaster.error('Something went wrong, please try again later')\n      }\n      console.log(e)\n      // set isSubmitSuccessful to false :)\n      throw e\n    }\n  }\n\n  return (\n    <SectionModal\n      title=\"Profile Preferences\"\n      onCancel={onCancel}\n      onSave={handleSubmit(onSave)}\n      isLoading={isLoading}\n      disableSave={!isDirty}\n    >\n      <div style={{ minWidth: 470 }} className=\"p-3 text-left space-y-5\">\n        <div>\n          <h5 className=\"mb-3 font-bold\">Linkedin Profile:</h5>\n          <TextField\n            className=\"w-full\"\n            innerRef={register('linkedInProfile')}\n          />\n          <span className=\"block text-sm text-center text-error\">\n            {errors.linkedInProfile?.message}\n          </span>\n        </div>\n      </div>\n    </SectionModal>\n  )\n}\n\nexport default Profile\n","import { useState } from 'react'\nimport Icon from '../../components/Icon'\nimport Avatar from 'react-avatar-edit'\nimport Button from '../../components/Button'\nimport toaster from 'react-hot-toast'\n\nconst AvatarEdit = ({ children, entity, email, onSave, square=false }) => {\n  const [change, setChange] = useState(false)\n  const [preview, setPreview] = useState(null)\n\n  const handlePhotoChange = () => setChange(true)\n\n  const handleCrop = preview => setPreview(preview)\n\n  const dataUriToBlob = dataUri => {\n    const splitDataUri = dataUri.split(',')\n    const byteString =\n      splitDataUri[0].indexOf('base64') >= 0\n        ? atob(splitDataUri[1])\n        : decodeURI(splitDataUri[1])\n    const mimeString = splitDataUri[0].split(':')[1].split(';')[0]\n    const ia = new Uint8Array(byteString.length)\n    for (let i = 0; i < byteString.length; i++) {\n      ia[i] = byteString.charCodeAt(i)\n    }\n    return new Blob([ia], { type: mimeString })\n  }\n\n  const handlePhotoSave = async () => {\n    const formData = new FormData()\n    if (email) {\n      formData.append('email', email)\n    }\n    if (entity) {\n      formData.append('name', entity)\n    }\n    formData.append('picture', dataUriToBlob(preview))\n    try {\n      await onSave(formData)\n      setChange(false)\n      setPreview(null)\n    } catch (err) {\n      if (err.response.data.message) {\n        toaster.error(err.response.data.message)\n      } else {\n        toaster.error('Something went wrong, please try again later')\n      }\n    }\n  }\n\n  return (\n    <div className=\"flex flex-col items-center\">\n      {!change ? (\n        <>\n          <div className=\"flex ml-9\">\n            {children}\n            <div>\n              <label\n                htmlFor=\"photo\"\n                className=\"shadow-md ml-3 p-2.5 border-t inline-block rounded-full cursor-pointer right-3 bottom-3 bg-white\"\n                onClick={handlePhotoChange}\n              >\n                <Icon id=\"camera\" className=\"w-4 h-4\" />\n              </label>\n            </div>\n          </div>\n        </>\n      ) : (\n        <>\n          <Avatar\n            width={160}\n            height={160}\n            label=\"Click to select\"\n            exportAsSquare={square}\n            onCrop={handleCrop}\n          />\n          <div className=\"mt-3 space-x-3\">\n            <Button\n              variant=\"contained\"\n              onClick={() => setChange(false)}\n            >\n              Cancel\n            </Button>\n            <Button\n              variant=\"contained\"\n              onClick={handlePhotoSave}\n              disabled={!preview}\n            >\n              Save\n            </Button>\n          </div>\n        </>\n      )}\n    </div>\n  )\n}\n\nexport default AvatarEdit\n","import Modal from 'react-modal'\nimport AppBar from '../../components/AppBar'\nimport Icon from '../../components/Icon'\nimport Button from '../../components/Button'\nimport Section from './Section'\nimport Account from './Account'\nimport Organization from './Organization'\nimport Transaction from './Transaction'\nimport { useEffect, useState } from 'react'\nimport { getUser } from '../../data/loanPools'\nimport modalStyles from '../../assets/styles/modalStyles'\nimport Profile from './Profile'\nimport InNetwork from './InNetwork'\nimport AvatarEdit from './AvatarEdit'\nimport UserImage from './../../components/UserImage'\nimport { uploadUser } from '../../data/loanPools'\nimport { updateBusiness } from '../../data/loanPools'\nimport BusinessImage from '../../components/BusinessImage'\n\nModal.setAppElement('#root')\n\nconst Settings = () => {\n  const [isAccountOpen, setAccountOpen] = useState(false)\n  const [isOrganizationOpen, setOrganizationOpen] = useState(false)\n  const [isTransactionOpen, setTransactionOpen] = useState(false)\n  const [isProfileOpen, setProfileOpen] = useState(false)\n  const [user, setUser] = useState({})\n  const [reload, setReload] = useState(false)\n  const [isLoadingUser, setLoadingUser] = useState(false)\n\n  useEffect(() => {\n    const retrieveUser = async () => {\n      setLoadingUser(true)\n      const { entity, email } = JSON.parse(localStorage.getItem('user'))\n      try {\n        const userResponse = await getUser(entity, email)\n        setUser(userResponse)\n        setLoadingUser(false)\n      } catch (error) {\n        console.log(error.message)\n        setLoadingUser(false)\n      }\n    }\n    retrieveUser()\n  }, [reload])\n\n  const account = {\n    Name: user.displayName,\n    'Financial Institution': user.entity,\n    Email: user.email,\n    Password: '*******'\n  }\n\n  const organization = {\n    'Institution Type': user.entityType,\n    'Decision Maker': user.decisionMaker,\n    'Primary Responsability': user.role\n  }\n\n  const transaction = {\n    'Transaction Interests': user.preferences?.listType,\n    'Loan Class': user.preferences?.assetClass,\n    Tag: user.preferences?.productTags,\n    'Geographic Interests': user.preferences?.geographicInterests\n  }\n\n  const profile = {\n    'LinkedIn Profile': user.linkedInProfile,\n    Email: user.email,\n    'In Network': user.inNetwork\n  }\n\n  const reloadSettings = () => {\n    setReload(!reload)\n  }\n\n  return (\n    <div>\n      <AppBar />\n      <div className=\"flex\">\n        {/* TODO: change height for a proper class name with no magic values*/}\n        <div className=\"inline-block px-12 py-16 text-center shadow-md\">\n          <h1 className=\"mb-10 text-xl font-bold\">Profile</h1>\n          <div>\n            <AvatarEdit email={user.email} onSave={uploadUser}>\n              <UserImage className=\"w-40\" person={user} />\n            </AvatarEdit>\n            <h2 className=\"text-lg font-bold mt-7\">{user.displayName}</h2>\n            <p>Executive Vice President</p>\n            <InNetwork status={user.inNetwork} />\n            <div className=\"my-4\">\n              <h2 className=\"mb-4 font-bold\">Contact Info</h2>\n              <div className=\"space-y-2\">\n                {user.linkedInProfile ? (\n                  <div>\n                    <div className=\"flex items-center justify-center\">\n                      <Icon\n                        id=\"linked_in\"\n                        className=\"w-4 h-4 mr-1 text-black fill-current\"\n                      />\n                      <p className=\"text-md\">LinkedIn Profile</p>\n                    </div>\n                    <a\n                      href={'https://' + user.linkedInProfile}\n                      target=\"_blank\"\n                      rel=\"noreferrer\"\n                      className=\"inline-block text-blue-600 text-md\"\n                    >\n                      {user.linkedInProfile}\n                    </a>\n                  </div>\n                ) : null}\n                <div>\n                  <div className=\"flex items-center justify-center\">\n                    <Icon\n                      id=\"email\"\n                      className=\"w-4 h-4 mr-1 text-black fill-current\"\n                    />\n                    <p className=\"text-md\">Email</p>\n                  </div>\n                  <a\n                    href={'mailto:' + user.email}\n                    target=\"_blank\"\n                    rel=\"noreferrer\"\n                    className=\"inline-block text-blue-600 text-md\"\n                  >\n                    {user.email}\n                  </a>\n                </div>\n              </div>\n            </div>\n            <Button\n              isLoading={isLoadingUser}\n              variant=\"link\"\n              className=\"underline\"\n              onClick={() => setProfileOpen(true)}\n            >\n              Edit\n            </Button>\n          </div>\n          <div className=\"mt-8 border-b\"></div>\n          <div>\n            <ul className=\"my-6\">\n              <li>\n                <Button\n                  variant=\"link\"\n                  className=\"mb-2 text-base\"\n                  onClick={() => setAccountOpen(true)}\n                >\n                  Account Settings\n                </Button>\n              </li>\n              <li>\n                <Button\n                  variant=\"link\"\n                  className=\"mb-2 text-base\"\n                  onClick={() => setOrganizationOpen(true)}\n                >\n                  Organization Profile\n                </Button>\n              </li>\n              <li>\n                <Button\n                  variant=\"link\"\n                  className=\"text-base\"\n                  onClick={() => setTransactionOpen(true)}\n                >\n                  Transaction Preferences\n                </Button>\n              </li>\n            </ul>\n          </div>\n          <div className=\"mt-8 border-b\"></div>\n          <Button variant=\"contained\" className=\"mt-16\">\n            Log Out\n          </Button>\n        </div>\n        <div className=\"flex-1 py-12 pl-12 pr-48 mr-20 space-y-12\">\n          <Section\n            isLoading={isLoadingUser}\n            title=\"Account Settings\"\n            onEdit={() => setAccountOpen(true)}\n            data={account}\n          />\n          <Section\n            isLoading={isLoadingUser}\n            title=\"Organization Profile\"\n            onEdit={() => setOrganizationOpen(true)}\n            data={organization}\n          />\n          <Section\n            isLoading={isLoadingUser}\n            title=\"Transaction Preferences\"\n            onEdit={() => setTransactionOpen(true)}\n            data={transaction}\n          />\n          <Section title=\"Institution Logo\">\n            <AvatarEdit\n              entity={user.entity}\n              square={true}\n              onSave={updateBusiness}\n            >\n              <BusinessImage className=\"w-40\" entity={user.entity} />\n            </AvatarEdit>\n          </Section>\n        </div>\n      </div>\n      <Modal\n        isOpen={isAccountOpen}\n        style={modalStyles}\n        onRequestClose={() => setAccountOpen(false)}\n      >\n        <Account\n          data={account}\n          onCancel={() => setAccountOpen(false)}\n          reloadSettings={reloadSettings}\n        />\n      </Modal>\n      <Modal\n        isOpen={isOrganizationOpen}\n        style={modalStyles}\n        onRequestClose={() => setOrganizationOpen(false)}\n      >\n        <Organization\n          data={organization}\n          onCancel={() => setOrganizationOpen(false)}\n          reloadSettings={reloadSettings}\n        />\n      </Modal>\n      <Modal\n        isOpen={isTransactionOpen}\n        style={modalStyles}\n        onRequestClose={() => setTransactionOpen(false)}\n      >\n        <Transaction\n          data={transaction}\n          onCancel={() => setTransactionOpen(false)}\n          reloadSettings={reloadSettings}\n        />\n      </Modal>\n      <Modal\n        isOpen={isProfileOpen}\n        style={modalStyles}\n        onRequestClose={() => setProfileOpen(false)}\n      >\n        <Profile\n          data={profile}\n          onCancel={() => setProfileOpen(false)}\n          reloadSettings={reloadSettings}\n        />\n      </Modal>\n    </div>\n  )\n}\n\nexport default Settings\n","import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'\nimport Portal from './pages/Portal'\nimport Login from './pages/Login'\nimport Marketplace from './pages/Marketplace'\nimport Messages from './pages/Messages'\nimport Upload from './pages/Upload'\nimport LoanDetail from './pages/LoanDetail'\nimport PrivateRoute from './components/PrivateRoute'\nimport EntityProfile from './pages/EntityProfile'\nimport DealRoom from './pages/DealRoom'\nimport Register from './pages/Register'\nimport SignUp from './pages/SignUp'\nimport Settings from './pages/Settings'\n\nexport const routes = {\n  root: '/',\n  login: '/login',\n  marketplace: '/marketplace',\n  messages: '/messages',\n  upload: '/upload',\n  detail: '/detail',\n  profile: '/profile',\n  dealroom: '/dealroom',\n  register: '/register',\n  signup: '/signup',\n  settings: '/settings'\n}\n\nconst AppRouter = () => (\n  <Router\n    getUserConfirmation={() => {\n      /* Empty callback to block the default browser prompt */\n    }}\n  >\n    <Switch>\n      <PrivateRoute path={routes.root} exact component={Portal} />\n      <Route path={routes.login} component={Login} />\n      <PrivateRoute path={routes.marketplace} component={Marketplace} />\n      <PrivateRoute path={`${routes.messages}/:loanId?`} component={Messages} />\n      <PrivateRoute path={routes.upload} component={Upload} />\n      <PrivateRoute path={`${routes.detail}/:loanId`} component={LoanDetail} />\n      <PrivateRoute path={`${routes.profile}/:entity`} component={EntityProfile} />\n      <PrivateRoute path={`${routes.dealroom}/:loanId`} component={DealRoom} />\n      <PrivateRoute path={`${routes.register}`} component={Register} />\n      <PrivateRoute path={`${routes.settings}`} component={Settings} />\n      <Route path={`${routes.signup}`} component={SignUp} />\n    </Switch>\n  </Router>\n)\n\nexport default AppRouter\n","import { useState, useEffect } from 'react'\nimport { app } from '../src/data/firebaseConfig'\nimport { QueryClient, QueryClientProvider } from 'react-query'\nimport AppRouter from './router'\nimport '@fontsource/inter'\nimport { Toaster } from 'react-hot-toast'\nimport PropagateLoader from 'react-spinners/PropagateLoader'\n// import { ReactQueryDevtools } from 'react-query/devtools'\n\nconst queryClient = new QueryClient()\n\nconst App = () => {\n  const [initializing, setInitializing] = useState(true)\n\n  // Handle user state changes\n  function onIdTokenChanged(user) {\n    if (user) {\n      user\n        .getIdToken()\n        .then(() => {\n          app\n            .auth()\n            .currentUser.getIdTokenResult()\n            .then(res => {\n              localStorage.setItem(\n                'user',\n                JSON.stringify({\n                  email: user.email.toLowerCase(),\n                  entity: res.claims.entity\n                })\n              )\n              if (initializing) {\n                setTimeout(() => {\n                  setInitializing(false)\n                }, 2000)\n              }\n            })\n        })\n        .catch(err => {\n          console.log(err)\n        })\n    } else {\n      // not logged in\n      localStorage.removeItem('user')\n      if (initializing) {\n        setTimeout(() => {\n          setInitializing(false)\n        }, 2000)\n      }\n    }\n  }\n\n  useEffect(() => {\n    const subscriber = app.auth().onIdTokenChanged(onIdTokenChanged)\n    return subscriber // unsubscribe on unmount\n  }, [])\n\n  if (initializing) return (\n    <div className=\"flex items-center justify-center h-screen\">\n      <div className=\"text-center\">\n        <PropagateLoader />\n      </div>\n    </div>\n  )\n\n  return (\n    <QueryClientProvider client={queryClient}>\n      <AppRouter />\n      {/* <ReactQueryDevtools initialIsOpen={false} /> */}\n      <Toaster position=\"top-right\" />\n    </QueryClientProvider>\n  )\n}\n\nexport default App\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport './index.css'\nimport App from './App'\n\nReactDOM.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>,\n  document.getElementById('root')\n)\n"],"sourceRoot":""}