PageSourceSearch

https://app.lendapi.com/v2/assets/LendersList-BqVX6aC7.js

js lendapi.com collected 2026-09-30 16:44:16 UTC 8,121 bytes, 1 lines download raw bytes

1import{j as e,r as m}from"./jodit-BrVACTnI.js";import{u as T,ad as j,aj as F,ar as w,D as O,k as K,b5 as R,ap as p,aq as z,B as E,V as y,a0 as P,ae as U,af as B,ag as G,ah as _,as as A}from"./index-B7-PrN1a.js";import"./firebase-DYVQ3zJ1.js";import{D as b}from"./index-Jt-r8877.js";import{I as H,H as f,f as V,L as $,T as q,e as W,C as Y}from"./index-DG-m-CdQ.js";import{U as Z}from"./UtilityButton-CtUeb1eB.js";import{I as J}from"./types-C2SzhQIP.js";import{S as Q}from"./line-building-06-ol8aY69d.js";import{u as h}from"./RenderTable-D6tKVEcm.js";import{L as r,u as X,a as ee}from"./api-C6sr_DaD.js";import{C as te}from"./ConfirmationDialog-BYAkgmSt.js";import{P as ae}from"./ProductsSelect-DxcO2KsI.js";import{H as M}from"./HideUnlessModuleEdit-DlVY4seJ.js";import{u as oe}from"./useModuleEditSurfaceLocked-CwDVdO5I.js";import"./recharts-DEfAkoYI.js";import"./syntax-highlighter-gAqkbDXa.js";import"./tanstack-ClVY-Fma.js";import"./tiptap-pN2aHUn2.js";import"./lucide-Bj0iXPtR.js";import"./Search-DHG8OvxC.js";import"./SearchInput-zc_3S5z4.js";import"./input-Y4Pst4PJ.js";import"./useDebounce-991HCPMG.js";import"./Footer-BA46-wVg.js";import"./line-arrow-left-Cft7VnxW.js";import"./line-arrow-right-CvBR8fP6.js";import"./table-CGGf7kKq.js";import"./AvatarWithName-DCXmbfq0.js";import"./index-B6JmTvaW.js";import"./line-arrow-down-BYKylDHS.js";import"./date-fns-D279LyOa.js";import"./line-chevron-down-BJQ6Wg0V.js";const ne=[{accessorKey:r.Id,...J,pinBorder:!0,header:t=>{const{toggleSorting:a}=h();return e.jsx(f,{variant:"text",sortDirection:t.column.getCanSort()?t.column.getIsSorted():!1,onSort:()=>a(r.Id),...t,children:"ID"})},cell:t=>{const a=T();return e.jsx(H,{...t,onClick:()=>{a(j.v2.lenders.detail({session:t.row.original.apiData.session}))},children:e.jsx("span",{className:"cursor-pointer",children:t.row.original.id})})}},{accessorKey:r.Name,header:t=>{const{toggleSorting:a}=h();return e.jsx(f,{variant:"text",sortDirection:t.column.getCanSort()?t.column.getIsSorted():!1,onSort:()=>a(r.Name),...t,children:"Lender Name"})},cell:({row:t})=>{const a=t.original;return e.jsx(V,{avatarFallback:e.jsx(Q,{className:"text-fg-quaternary-400"}),className:"gap-size-sm",children:a.name})}},{accessorKey:r.AssignedProducts,header:t=>{const{toggleSorting:a}=h();return e.jsx(f,{variant:"text",sortDirection:t.column.getCanSort()?t.column.getIsSorted():!1,onSort:()=>a(r.AssignedProducts),...t,children:"Assigned Products"})},cell:({row:t})=>{const a=t.getValue(r.AssignedProducts);return e.jsx($,{badges:a==null?void 0:a.map(n=>({label:n.name,onClick:()=>{}})),maxVisibleBadges:2,children:e.jsx(e.Fragment,{})})}},{accessorKey:r.LastModified,header:t=>{const{toggleSorting:a}=h();return e.jsx(f,{variant:"text",sortDirection:t.column.getCanSort()?t.column.getIsSorted():!1,onSort:()=>a(r.LastModified),...t,children:"Last Modified"})},cell:({row:t})=>{const a=t.getValue(r.LastModified);return e.jsx(q,{tooltip:a,children:a})}},{accessorKey:r.Active,header:t=>e.jsx(f,{sortable:!1,...t,children:"Status"}),cell:t=>{const{onRowClickAction:a}=h(),{hasModuleEditAccess:n}=F(),o=n(w.MARKETPLACE),l=t.row.original.active;return e.jsx(W,{...t,disabled:!o,checked:l,onCheckedChange:()=>{o&&(a==null||a({row:t.row.original,columnId:r.Active}))},children:e.jsx(e.Fragment,{})})}},{accessorKey:r.Actions,size:80,minSize:80,maxSize:80,header:t=>e.jsx(f,{variant:"actions",sortable:!1,isLast:!0,...t,children:""}),cell:({row:t})=>{const a=T();return e.jsx(Y,{className:"flex items-center gap-1",children:e.jsx(Z,{size:"xs",variant:"tertiary",tooltip:"Edit",icon:e.jsx(O,{className:"text-fg-quaternary-400 size-4"}),onClick:()=>{a(j.v2.lenders.detail({session:t.original.apiData.session}))}})})}}],se=t=>{if(!t||!(t!=null&&t.lenders))return[];const a=new Map;return t.lender_workflow_map_records&&t.lender_workflow_map_records.forEach(n=>{const o=n.lender,l={id:n.assigned_product,name:n.assigned_product_name};a.has(o)||a.set(o,[]),a.get(o).push(l)}),t.lenders.map(n=>({id:n.id,name:n.name,active:n.active,last_modified:n.updated_at,action:n.action,assigned_products:a.get(n.id)||[],apiData:n}))}
1,re=({products:t,testMode:a})=>e.jsxs(U,{children:[e.jsx(B,{asChild:!0,children:e.jsx(E,{className:"ml-auto",leftIcon:e.jsx(y,{}),children:"Add Lender"})}),e.jsx(G,{className:"mr-size-3xl max-h-72 w-56 overflow-y-auto",children:ie(t,a)})]}),ie=(t,a)=>t.length===0?e.jsx(_,{disabled:!0,children:"No options found"}):t.map(n=>e.jsx(_,{onClick:()=>{window.open(P(j.v2.productStudio.applicationWizard({productReferral:n.referral??"",test_mode:a})),"_blank")},children:n.name},n.referral)),I={type:"error",title:"",description:"",isOpen:!1,className:"sm:max-w-[440px]",onOpenChange:()=>{},onConfirm:()=>{}},le=61,ce=16;function de(){const t=oe(w.MARKETPLACE),[a,n]=m.useState(0),[o,l]=m.useState([]),[D,C]=m.useState(""),[c,N]=m.useState([]),[i,u]=m.useState(I),g=m.useRef(null),{mutate:v}=X(),S=()=>{if(g.current){const s=g.current.offsetTop;n(s)}},L=s=>{const{columnId:x}=s;switch(x){case r.Active:{if(!t)break;const d=s.row.active;u({title:`${d?"Deactivate":"Activate"} Lender?`,description:`Are you sure you want to ${d?"deactivate":"activate"} this lender?`,isOpen:!0,className:"sm:max-w-[440px]",primaryActionText:d?"Deactivate":"Activate",primaryActionVariant:d?"destructive":"default",onOpenChange:k=>{k||u(I)},onConfirm:()=>{v({session:s.row.apiData.session}),u(I)}});break}}};return e.jsxs(e.Fragment,{children:[e.jsx(b.Provider,{tableId:"lenders-table",columns:ne,data:o,onMount:S,onRowClickAction:L,onColumnFiltersChange:s=>{N(s)},onGlobalFilterChange:s=>{C(s)},enableColumnPinning:!0,initialState:{columnPinning:{left:["id"]}},children:e.jsx(me,{tableRef:g,tableTop:a,setTableData:l,globalFilter:D,columnFilters:c})}),e.jsx(te,{...i})]})}function me({tableRef:t,tableTop:a,setTableData:n}){var u,g,v,S,L;const{data:o,isPending:l}=ee(),{table:D}=h(),C=K(R.ENVIRONMENT)==="true",c=D.getState().globalFilter??"",N=(g=(u=o==null?void 0:o.data)==null?void 0:u.lenders)==null?void 0:g.some(s=>{var x,d;return(d=(x=s==null?void 0:s.name)==null?void 0:x.toLowerCase())==null?void 0:d.includes(c==null?void 0:c.toLowerCase())}),i=((v=o==null?void 0:o.data)==null?void 0:v.lender_products)??[];return m.useEffect(()=>{var s;if((s=o==null?void 0:o.data)!=null&&s.lenders){const x=se(o==null?void 0:o.data);n(x)}},[o,n]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b.Search,{className:""}),e.jsx(M,{module:w.MARKETPLACE,children:e.jsx(re,{products:i,testMode:C})})]}),!N&&(c!=null&&c.length)||!l&&((L=(S=o==null?void 0:o.data)==null?void 0:S.lenders)==null?void 0:L.length)===0?e.jsxs(p,{className:"mx-auto",children:[e.jsx(p.Icon,{}),e.jsx(p.Title,{children:"No Lenders Yet"}),e.jsx(p.Description,{children:(i==null?void 0:i.length)>0?e.jsx("span",{children:"Looks like you haven't added any lenders yet. Start by creating a Lender Product and adding a lender."}):e.jsx("span",{children:"No Lender Products available. Please create one in Product Studio before adding a lender."})}),e.jsxs(p.Actions,{children:[e.jsx("a",{href:"https://developer.lendapi.com/reference/introduction",target:"_blank",rel:"noopener noreferrer",className:z({variant:"secondary"}),children:"Read Docs"}),e.jsx(M,{module:w.MARKETPLACE,children:(i==null?void 0:i.length)>0?e.jsx(ae,{products:i,onSelect:s=>{window.open(P(j.v2.productStudio.applicationWizard({productReferral:(s==null?void 0:s.referral)??"",test_mode:C})),"_blank","noopener")},children:e.jsx(E,{className:"ml-auto",leftIcon:e.jsx(y,{}),children:"Add Lender"})}):e.jsx(E,{onClick:()=>{window.open(j.v1.productStudio.index,"_blank","noopener")},children:"Go to Product Studio"})})]})]}):e.jsx(b.Table,{ref:t,className:"mt-size-2xl",skeletonRows:10,isLoading:l,maxHeight:`calc(100vh - ${a}px - ${le}px - ${ce}px)`}),e.jsx(b.Footer,{className:"absolute right-0 bottom-0 left-0"})]})}const He=()=>e.jsxs(A,{seoTitle:"LendAPI | Lenders",children:[e.jsx(A.Header,{title:"Lenders"}),e.jsx(A.Content,{className:"flex h-[calc(100vh-var(--primary-navbar-height))] flex-col overflow-hidden",children:e.jsx(de,{})})]});export{He as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.