PageSourceSearch

https://thetool.company/_next/static/chunks/0wwjy8q-higt7.js

js thetool.company collected 2026-10-02 01:53:02 UTC 38,928 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,703365,746366,e=>{"use strict";var a=e.i(843476),n=e.i(271645),t=e.i(920755),s=e.i(630374),i=e.i(167881),l=e.i(23750),r=e.i(10708),o=e.i(184762),c=e.i(447170),d=e.i(6762),m=e.i(443929),u=e.i(930780),p=e.i(37727),h=e.i(664659),x=e.i(522014),g=e.i(59377),f=e.i(753751),y=e.i(692293),v=e.i(679880),j=e.i(846696),b=e.i(501949),w=e.i(247992),C=e.i(647163),N=e.i(37214),_=e.i(800047),S=e.i(745385),k=e.i(46939),I=e.i(131511),L=e.i(852861),F=e.i(992947),P=e.i(839687),U=e.i(539059),D=e.i(923017),T=e.i(460044),O=e.i(839174),q=e.i(156697),A=e.i(643531),E=e.i(344523),R=e.i(213788);let B="id, name, domain, logo_url, parent_company_id";async function $(e,a){let n=new Set,t=[a];for(let s=0;s<10&&t.length>0;s++){let{data:s}=await e.from("companies").select("id").in("parent_company_id",t),i=(s??[]).map(e=>e.id).filter(e=>e!==a&&!n.has(e));if(0===i.length)break;i.forEach(e=>n.add(e)),t=i}return n}function M({companyId:e,value:s,onChange:l,label:o="Parent company",showLabel:c=!0}
1){let[d,m]=(0,n.useState)(!1),[u,h]=(0,n.useState)(""),[x,y]=(0,n.useState)([]),[v,j]=(0,n.useState)(null),[b,w]=(0,n.useState)(new Set),[N,_]=(0,n.useState)(!1),S=(0,t.createClient)(),k=u.trim();(0,n.useEffect)(()=>{if(!d)return;let e=!1,a=setTimeout(()=>{_(!0);let a=S.from("companies").select(B).order("name").limit(20);k&&(a=a.ilike("name",`%${k}%`)),a.then(({data:a,error:n})=>{e||(n&&console.error("Failed to fetch companies:",n),y(a??[]),_(!1))})},200*!!k);return()=>{e=!0,clearTimeout(a)}},[d,k,S]),(0,n.useEffect)(()=>{if(!d||!e)return;let a=!1;return $(S,e).then(e=>{a||w(e)}),()=>{a=!0}},[d,e,S]);let I=(v?.id===s?v:null)??x.find(e=>e.id===s)??null;(0,n.useEffect)(()=>{if(!s||I)return;let e=!1;return S.from("companies").select(B).eq("id",s).maybeSingle().then(({data:a})=>{!e&&a&&j(a)}),()=>{e=!0}},[s,I,S]);let L=new Set([e,...b]),F=x.filter(e=>!L.has(e.id));return(0,a.jsxs)("div",{className:(0,C.cn)(c&&"space-y-2"),children:[c&&(0,a.jsx)(r.Label,{children:o}),(0,a.jsxs)(g.Popover,{open:d,onOpenChange:e=>{m(e),e||h("")},children:[(0,a.jsx)(g.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(i.Button,{variant:"outline",role:"combobox","aria-expanded":d,className:"w-full justify-between font-normal",children:[I?(0,a.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,a.jsx)(R.CompanyLogo,{domain:I.domain,companyName:I.name,logoUrl:I.logo_url,size:"xs"}),I.name]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"No parent company"}),(0,a.jsx)(E.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(g.PopoverContent,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:(0,a.jsxs)(f.Command,{shouldFilter:!1,children:[(0,a.jsx)(f.CommandInput,{placeholder:"Search companies...",value:u,onValueChange:h}),(0,a.jsxs)(f.CommandList,{children:[(0,a.jsx)(f.CommandEmpty,{children:N?"Searching…":"No company found."}),(0,a.jsxs)(f.CommandGroup,{children:[(0,a.jsxs)(f.CommandItem,{value:"__none__",onSelect:()=>{l(null),m(!1)},children:[(0,a.jsx)(A.Check,{className:(0,C.cn)("mr-2 h-4 w-4",s?"opacity-0":"opacity-100")}),(0,a.jsx)(p.X,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground"}),"No parent company"]}),F.map(e=>(0,a.jsxs)(f.CommandItem,{value:e.id,onSelect:()=>{l(e.id),m(!1)},children:[(0,a.jsx)(A.Check,{className:(0,C.cn)("mr-2 h-4 w-4",s===e.id?"opacity-100":"opacity-0")}),(0,a.jsx)(R.CompanyLogo,{domain:e.domain,companyName:e.name,logoUrl:e.logo_url,size:"xs"}),(0,a.jsx)("span",{className:"ml-2 truncate",children:e.name})]},e.id))]})]})]})})]})]})}async function z(e){if(!e.website_url)return e;let[a]=await (0,F.resolveCompanyWebsites)(e.id);return a?{...e,...a}:e}function H(e,a,n){(0,I.checkStripeAssociations)(e,a,n.domain,n.name,n.website_url)}e.s(["ParentCompanyCombobox",0,M],746366);let K=["1-10","11-50","51-200","201-500","501-1000","1001-5000","5001-10000","10001+"];function X({domain:e,region:t,onRegionChange:s,onRemove:i}){let[l,r]=(0,n.useState)(!1);return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md border bg-muted/50 pl-1 pr-2 py-0.5 text-xs",children:[(0,a.jsxs)(g.Popover,{open:l,onOpenChange:r,children:[(0,a.jsx)(g.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",className:"flex items-center gap-0.5 px-0.5 rounded hover:bg-muted transition-colors",title:t?v.PHONE_COUNTRIES.find(e=>e.code===t)?.name:"Set region",children:[t?(0,a.jsx)(y.CountryFlag,{country:t,className:"h-2.5 w-3.5"}):(0,a.jsx)("span",{className:"text-muted-foreground/50 text-[10px]",children:"🌐"}),(0,a.jsx)(h.ChevronDown,{className:"h-2 w-2 opacity-40"})]})}),(0,a.jsx)(g.PopoverContent,{className:"w-56 p-0",align:"start",children:(0,a.jsxs)(f.Command,{children:[(0,a.jsx)(f.CommandInput,{placeholder:"Search region..."}),(0,a.jsxs)(f.CommandList,{children:[(0,a.jsx)(f.CommandEmpty,{children:"No region found."}),(0,a.jsxs)(f.CommandGroup,{children:[(0,a.jsx)(f.CommandItem,{value:"none",onSelect:()=>{s(null),r(!1)},children:(0,a.jsx)("span",{className:"text-muted-foreground",children:"No region"})}),v.PHONE_COUNTRIES.map(e=>(0,a.jsxs)(f.CommandItem,{value:`${e.name} ${e.code}`,onSelect:()=>{s(e.code),r(!1)},children:[(0,a.jsx)(y.CountryFlag,{country:e.code,className:"mr-1.5 h-3 w-4 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.name}),(0,a.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:e.code})]},e.code))]})]})]})})]}),e,(0,a.jsx)("button",{type:"button",onClick:i,className:"text-muted-foreground hover:text-destructive transition-colors",children:(0,a.jsx)(p.X,{className:"h-3 w-3"})})]})}e.s(["CompanyDialog",0,function({open:e,onOpenChange:h,company:g,defaultName:f,onSaved:y,workspaceMembers:v=[],contacts:I=[]}
1){let[F,A]=(0,n.useState)(""),[E,R]=(0,n.useState)(""),[B,$]=(0,n.useState)(null),[V,W]=(0,n.useState)(""),[G,J]=(0,n.useState)(""),[Y,Q]=(0,n.useState)([]),[Z,ee]=(0,n.useState)(""),[ea,en]=(0,n.useState)("none"),[et,es]=(0,n.useState)(""),[ei,el]=(0,n.useState)(""),[er,eo]=(0,n.useState)(""),[ec,ed]=(0,n.useState)(""),[em,eu]=(0,n.useState)(""),[ep,eh]=(0,n.useState)(""),[ex,eg]=(0,n.useState)(""),[ef,ey]=(0,n.useState)(""),[ev,ej]=(0,n.useState)(""),[eb,ew]=(0,n.useState)(""),[eC,eN]=(0,n.useState)(""),[e_,eS]=(0,n.useState)(""),[ek,eI]=(0,n.useState)(""),[eL,eF]=(0,n.useState)(""),[eP,eU]=(0,n.useState)(""),[eD,eT]=(0,n.useState)(""),[eO,eq]=(0,n.useState)("none"),[eA,eE]=(0,n.useState)("none"),[eR,eB]=(0,n.useState)("none"),[e$,eM]=(0,n.useState)(null),[ez,eH]=(0,n.useState)(null),[eK,eX]=(0,n.useState)([]),[eV,eW]=(0,n.useState)(!1),[eG,eJ]=(0,n.useState)(!0),[eY,eQ]=(0,n.useState)(""),eZ=(0,t.createClient)(),e0=(0,n.useRef)(!1),e1=(0,n.useRef)(null),e2=!!g,e4=e=>eY.length>=2&&e.toLowerCase().includes(eY.toLowerCase()),e3=e=>e4(e)?"ring-2 ring-amber-400/50 bg-amber-50/20 dark:bg-amber-400/5 rounded-lg p-2":"";(0,n.useEffect)(()=>{if(eY.length<2||!e1.current)return;let e=setTimeout(()=>{let e=e1.current?.querySelector('[data-field-match="true"]');e&&e.scrollIntoView({behavior:"smooth",block:"center"})},150);return()=>clearTimeout(e)},[eY]),(0,n.useEffect)(()=>{e||eQ("")},[e]),(0,n.useEffect)(()=>{let a=e&&!e0.current;e0.current=e,a&&(g?(A(g.name),R(g.natural_name||""),$(g.source??null),W(g.domain||""),J(g.phone_number||""),ee(g.industry||""),en(g.employee_range||"none"),es(g.employee_count?.toString()||""),el(g.website_url||""),eo(g.linkedin_url||""),ed(g.linkedin_id||""),eu(g.linkedin_urn||""),eh(g.sales_navigator_urn||""),eg(g.x_handle?`@${g.x_handle}`:""),ey(g.headquarters||""),ej(g.legal_name||""),ew(g.billing_address||""),eN(g.finance_email||""),eS((g.keywords??[]).join(", ")),eI(g.founded_year?.toString()||""),eF(g.company_type||""),eU(g.description||""),eT(g.notes||""),eq(g.status||"none"),eE(g.assigned_to||"none"),eB(g.contact_id||"none"),eM(g.parent_company_id||null),eH(g.logo_url||null),eZ.from("company_contact_roles").select("*").eq("company_id",g.id).order("sort_order").then(({data:e})=>eX(e??[])),eZ.from("company_email_domains").select("*").eq("company_id",g.id).order("is_primary",{ascending:!1}).then(({data:e})=>{Q((e||[]).map(e=>({domain:e.domain,region:e.region??null})))}),void 0===g.description||void 0===g.notes?(eJ(!1),eZ.from("companies").select("description, notes").eq("id",g.id).single().then(({data:e})=>{e&&(eU(e.description||""),eT(e.notes||""),eJ(!0))})):eJ(!0)):(eJ(!0),A(f?.trim()||""),R(""),$(null),W(""),J(""),Q([]),ee(""),en("none"),es(""),el(""),eo(""),ed(""),eu(""),eh(""),eg(""),ey(""),ej(""),ew(""),eN(""),eS(""),eI(""),eF(""),eU(""),eT(""),eq("none"),eE("none"),eB("none"),eM(null),eH(null),eX([])))},[g,e,f]);let e5=(0,n.useMemo)(()=>new Map(I.map(e=>[e.id,e])),[I]),e6=(0,n.useCallback)(e=>eK.filter(a=>a.role===e).sort((e,a)=>e.sort_order-a.sort_order).map(e=>e5.get(e.contact_id)).filter(e=>!!e),[eK,e5]);async function e7(e,a){if(!g)return;let n=eK.filter(a=>a.role===e).reduce((e,a)=>Math.max(e,a.sort_order),-1)+1,t={id:crypto.randomUUID(),company_id:g.id,contact_id:a,role:e,sort_order:n,created_at:new Date().toISOString()};eX(e=>[...e,t]);let{data:s,error:i}=await eZ.from("company_contact_roles").insert({company_id:g.id,contact_id:a,role:e,sort_order:n}).select().single();if(i){j.toast.error(`Failed to add ${e.replace("_"," ")}`),eX(e=>e.filter(e=>e.id!==t.id));return}eX(e=>e.map(e=>e.id===t.id?s:e))}async function e9(e,a){if(!g)return;eX(n=>n.filter(n=>n.role!==e||n.contact_id!==a));let{error:n}=await eZ.from("company_contact_roles").delete().eq("company_id",g.id).eq("contact_id",a).eq("role",e);n&&(j.toast.error(`Failed to remove ${e.replace("_"," ")}`),eX(eK))}async function e8(e){let a=Y.filter(e=>e.domain.trim());if(await eZ.from("company_email_domains").delete().eq("company_id",e),0===a.length)return;let n=a.map((a,n)=>({company_id:e,domain:a.domain.trim().toLowerCase(),region:a.region,source:"manual",is_primary:0===n}));await eZ.from("company_email_domains").upsert(n,{onConflict:"company_id,domain"})}async function ae(e){if(e.preventDefault(),!F.trim())return void j.toast.error("Company name is required");eW(!0);try{let e=e_.split(",").map(e=>
1e.trim()).filter(Boolean),a=JSON.stringify(e)!==JSON.stringify(g?.keywords??[]),n={name:F.trim(),natural_name:E.trim()||null,source:B&&B.length>0?B:null,domain:(0,L.getBaseDomain)(V.trim())||function(e){let a=e.trim();if(!a)return null;let n=(0,L.extractDomainFromUrl)(a);return n&&!(0,L.isShortenerDomain)(n)?n:null}(ei)||null,phone_number:G.trim()||null,industry:Z.trim()||null,employee_range:"none"===ea?null:ea,employee_count:et?parseInt(et,10):null,website_url:(0,L.cleanWebsiteUrl)(ei.trim())||null,linkedin_url:er.trim()||null,linkedin_id:ec.trim()||null,linkedin_urn:em.trim()||null,sales_navigator_urn:ep.trim()||null,x_handle:(0,S.xHandleFromInput)(ex)||null,headquarters:ef.trim()||null,legal_name:ev.trim()||null,billing_address:eb.trim()||null,finance_email:eC.trim()||null,...a?{keywords:e}:{},founded_year:ek?parseInt(ek,10):null,company_type:eL.trim()||null,...eG?{description:eP.trim()||null,notes:eD.trim()||null}:{},status:eO,assigned_to:"none"===eA?null:eA,contact_id:"none"===eR?null:eR,parent_company_id:e$,logo_url:ez,updated_at:new Date().toISOString()};if(e2){!(0,b.sameParsedIdentity)((0,b.bestCompanyIdentifier)(g),(0,b.bestCompanyIdentifier)(n))&&(n.linkedin_url||n.linkedin_urn||n.sales_navigator_urn||n.linkedin_id)&&await (0,w.captureEnrichmentSnapshot)("company",g.id,{reason:"identity_changed",nextLinkedinUrl:n.linkedin_url??null});let{data:e,error:a}=await eZ.from("companies").update(n).eq("id",g.id).select().single();if(a)throw a;await e8(g.id);let t=Object.keys(n).filter(e=>n[e]!==g[e]);t.length>0&&(0,_.markFieldsManuallyEdited)(eZ,"companies",g.id,t),j.toast.success("Company updated");let s=await z(e);(0,N.triggerDomainDiscovery)(eZ,s),H(eZ,g.id,s),y(s)}else{let{data:{user:e}}=await eZ.auth.getUser();if(!e)return void j.toast.error("You must be logged in");let{data:a,error:t}=await eZ.from("companies").insert({...n,owner_id:e.id}).select().single();if(t)throw t;await e8(a.id),j.toast.success("Company created");let s=await z(a);(0,N.triggerDomainDiscovery)(eZ,s),H(eZ,a.id,s),y(s,!0)}h(!1)}catch{j.toast.error(e2?"Failed to update company":"Failed to create company")}finally{eW(!1)}}return(0,a.jsx)(s.Dialog,{open:e,onOpenChange:h,children:(0,a.jsxs)(s.DialogContent,{showCloseButton:!1,container:null,className:"w-full sm:max-w-[calc(100vw-64px)] h-full sm:h-[calc(100dvh-64px)] sm:max-h-[calc(100dvh-64px)] p-0 rounded-2xl gap-0 flex flex-col overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3.5 border-b shrink-0",children:[(0,a.jsx)(s.DialogTitle,{className:"text-base font-semibold",children:e2?"Edit Company":"New Company"}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(x.SearchInput,{value:eY,onChange:eQ,placeholder:"Search fields…",size:"sm",className:"w-44 sm:w-56 shrink-0"}),(0,a.jsx)("button",{type:"button",onClick:()=>h(!1),className:"flex h-7 w-7 items-center justify-center squircle text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:(0,a.jsx)(p.X,{className:"h-4 w-4"})})]})]}),(0,a.jsx)(k.LinkedInPrefillSearch,{fetcher:S.linkedInCompanyPreview,onPick:e=>(function(e){let a=(e,a)=>e.trim()?e:(a||"").trim();if(A(n=>a(n,e.name)),ee(n=>a(n,e.industry)),ey(n=>a(n,e.location)),eU(n=>a(n,e.description)),eH(a=>a||e.image_url),eo(n=>a(n,(0,S.companyResultLinkedInUrl)(e))),eu(n=>a(n,e.company_urn)),e.employees){let a=K.find(a=>e.employees.includes(a));a&&en(e=>"none"===e?a:e)}})(e.data),placeholder:"Search LinkedIn for a company…"}),(0,a.jsx)(s.DialogNav,{}),(0,a.jsxs)("form",{onSubmit:ae,className:"fit-fields flex flex-col flex-1 min-h-0",children:[(0,a.jsxs)("div",{ref:e1,"data-slot":"dialog-body",className:"flex-1 overflow-y-auto px-4 sm:px-6 py-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 pb-4","data-dialog-section":"Basics",children:[(0,a.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider whitespace-nowrap",children:"Basic Information"}),(0,a.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-6 pb-8 sm:flex-row sm:items-start",children:[(0,a.jsxs)("div",{className:"grid min-w-0 flex-1 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{"data-field-match":e4("name")||void 0,className:(0,C.cn)("space-y-2",e3("name")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-name",children:"Name"}),(0,a.jsx)(l.Input,{id:"company-name",variant:"default",placeholder:"e.g., Acme Corp",value:F,onChange:e=>A(e.target.value),required:!0})]}),(0,a.jsxs)("div",{"data-field-match":e4("natural name")||void 0,className:(0,C.cn)("space-y-2",e3("natural name")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-natural-name",children:"Natural name"}),(0,a.jsx)(l.Input,{id:"company-natural-name",variant:"default",placeholder:"e.g., Acme",value:E,onChange:e=>R(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("source")||void 0,className:(0,C.cn)("space-y-2",e3("source")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-source",children:"Source"}
1),(0,a.jsx)(U.RecordSourceBadge,{kind:"company",value:B,onChange:$})]}),e2&&g&&(0,a.jsxs)("div",{"data-field-match":e4("tags")||void 0,className:(0,C.cn)("space-y-2",e3("tags")),children:[(0,a.jsx)(r.Label,{children:"Tags"}),(0,a.jsx)(T.ContactTagInline,{entityType:"company",entityId:g.id})]}),(0,a.jsxs)("div",{"data-field-match":e4("phone")||void 0,className:(0,C.cn)("space-y-2",e3("phone")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-phone",children:"Phone number"}),(0,a.jsx)(l.Input,{id:"company-phone",variant:"default",type:"tel",placeholder:"e.g., +1 415 555 0100",value:G,onChange:e=>J(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("status")||void 0,className:(0,C.cn)("space-y-2",e3("status")),children:[(0,a.jsx)(r.Label,{children:"Status"}),(0,a.jsx)(D.RecordStatusBadge,{status:eO,onChange:e=>eq(e)})]}),(0,a.jsx)("div",{"data-field-match":e4("parent company")||void 0,className:(0,C.cn)("space-y-2",e3("parent company")),children:(0,a.jsx)(M,{companyId:g?.id??"",value:e$,onChange:eM})})]}),(0,a.jsx)("div",{"data-field-match":e4("logo")||void 0,className:(0,C.cn)("shrink-0",e3("logo")),children:(0,a.jsx)(P.ImageInput,{value:ez,onChange:eH,onUpload:async e=>{let a=g?.id||crypto.randomUUID();return await (0,O.uploadImage)(e,"companies",a)},label:"Logo"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 pb-4","data-dialog-section":"Team",children:[(0,a.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider whitespace-nowrap",children:"Team"}),(0,a.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 pb-8",children:[(0,a.jsx)("div",{"data-field-match":e4("assigned")||void 0,className:(0,C.cn)(e3("assigned")),children:(0,a.jsx)(d.WorkspaceMemberCombobox,{members:v,value:eA,onChange:eE,label:"Assigned to"})}),(0,a.jsx)("div",{"data-field-match":e4("primary person")||void 0,className:(0,C.cn)(e3("primary person")),children:(0,a.jsx)(m.ContactCombobox,{contacts:I,value:eR,onChange:eB,label:"Primary person"})}),e2&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{"data-field-match":e4("primary contact")||void 0,className:(0,C.cn)("space-y-2",e3("primary contact")),children:[(0,a.jsx)(r.Label,{children:"Primary Contact"}),(0,a.jsx)(u.ContactRoleInline,{selectedContacts:e6("primary_contact"),allContacts:I,onAdd:e=>e7("primary_contact",e),onRemove:e=>e9("primary_contact",e),placeholder:"Set primary contact..."})]}),(0,a.jsxs)("div",{"data-field-match":e4("billing contact")||void 0,className:(0,C.cn)("space-y-2",e3("billing contact")),children:[(0,a.jsx)(r.Label,{children:"Billing Contact"}),(0,a.jsx)(u.ContactRoleInline,{selectedContacts:e6("billing_contact"),allContacts:I,onAdd:e=>e7("billing_contact",e),onRemove:e=>e9("billing_contact",e),placeholder:"Set billing contact..."})]}),(0,a.jsxs)("div",{"data-field-match":e4("champion")||void 0,className:(0,C.cn)("space-y-2",e3("champion")),children:[(0,a.jsx)(r.Label,{children:"Champion"}),(0,a.jsx)(u.ContactRoleInline,{selectedContacts:e6("champion"),allContacts:I,onAdd:e=>e7("champion",e),onRemove:e=>e9("champion",e),placeholder:"Set champion..."})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 pb-4","data-dialog-section":"Domain",children:[(0,a.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider whitespace-nowrap",children:"Domain & Industry"}),(0,a.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 pb-8",children:[(0,a.jsxs)("div",{"data-field-match":e4("domain")||void 0,className:(0,C.cn)("space-y-2",e3("domain")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-domain",children:"Domain"}),(0,a.jsx)(l.Input,{id:"company-domain",variant:"default",placeholder:"e.g., acme.com",value:V,onChange:e=>W(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("industry")||void 0,className:(0,C.cn)("space-y-2",e3("industry")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-industry",children:"Industry"}),(0,a.jsx)(l.Input,{id:"company-industry",variant:"default",placeholder:"e.g., Technology",value:Z,onChange:e=>ee(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("website")||void 0,className:(0,C.cn)("space-y-2",e3("website")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-website",children:"Website URL"}),(0,a.jsx)(l.Input,{id:"company-website",variant:"default",placeholder:"https://acme.com",value:ei,onChange:e=>el(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("email domain")||void 0,className:(0,C.cn)("sm:col-span-2 lg:col-span-3 space-y-2",e3("email domain")),children:[(0,a.jsx)(r.Label,{children:"Email Domains"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[Y.map((e,n)=>(0,a.jsx)(X,{domain:e.domain,region:e.region,onRegionChange:e=>{Q(a=>a.map((a,t)=>t===n?{...a,region:e}:a))},onRemove:()=>{Q(e=>e.filter((e,a)=>a!==n))}},`${e.domain}-${n}`)),(0,a.jsx)(l.Input,{variant:"default",placeholder:"Add domain…",className:"h-7 w-32 text-xs",onKeyDown:e=>{if("Enter"===e.key||","===e.key){e.preventDefault();let a=e.currentTarget.value.trim().toLowerCase();a&&!Y.some(e=>e.domain===a)&&(Q(e=>[...e,{domain:a,region:null}]),e.currentTarget.value="")}},onBlur:e=>{let a=e.currentTarget.value.trim().toLowerCase();a&&!Y.some(e=>e.domain===a)&&(Q(e=>[...e,{domain:a,region:null}]),e.currentTarget.value="")}})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 pb-4","data-dialog-section":"Details",children:[(0,a.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider whitespace-nowrap",children:"Company Details"}),(0,a.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 pb-8",children:[(0,a.jsxs)("div",{"data-field-match":e4("employee range")||void 0,className:(0,C.cn)("space-y-2",e3("employee range")),children:[(0,a.jsx)(r.Label,{children:"Employee range"}),(0,a.jsx)(c.SearchableSelect,{variant:"default",modal:!0,value:ea,onValueChange:en,placeholder:"Select range",className:"w-full",options:[{value:"none",label:"Unknown"},...K.map(e=>({value:e,label:e}))]})]}),(0,a.jsxs)("div",{"data-field-match":e4("employee count")||void 0,className:(0,C.cn)("space-y-2",e3("employee count")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-employees",children:"Employee count"}),(0,a.jsx)(l.Input,{id:"company-employees",variant:"default",type:"number",placeholder:"e.g., 150",value:et,onChange:e=>es(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("headquarters")||void 0,className:(0,C.cn)("space-y-2",e3("headquarters")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-hq",children:"Headquarters"}),(0,a.jsx)(l.Input,{id:"company-hq",variant:"default",placeholder:"e.g., San Francisco, CA",value:ef,onChange:e=>ey(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("founded")||void 0,className:(0,C.cn)("space-y-2",e3("founded")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-founded",children:"Founded year"}),(0,a.jsx)(l.Input,{id:"company-founded",variant:"default",type:"number",placeholder:"e.g., 2010",value:ek,onChange:e=>eI(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("company type")||void 0,className:(0,C.cn)("space-y-2",e3("company type")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-type",children:"Company type"}),(0,a.jsx)(l.Input,{id:"company-type",variant:"default",placeholder:"e.g., Public, Private",value:eL,onChange:e=>eF(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("legal name")||void 0,className:(0,C.cn)("space-y-2",e3("legal name")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-legal-name",children:"Legal name"}),(0,a.jsx)(l.Input,{id:"company-legal-name",variant:"default",placeholder:"e.g., Acme Corporation Inc.",value:ev,onChange:e=>ej(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("finance email")||void 0,className:(0,C.cn)("space-y-2",e3("finance email")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-finance-email",children:"Finance email"}),(0,a.jsx)(l.Input,{id:"company-finance-email",variant:"default",type:"email",placeholder:"e.g., [email protected]",value:eC,onChange:e=>eN(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("billing address")||void 0,className:(0,C.cn)("sm:col-span-2 lg:col-span-3 space-y-2",e3("billing address")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-billing-address",children:"Billing address"}),(0,a.jsx)(l.Input,{id:"company-billing-address",variant:"default",placeholder:"e.g., 500 Market St, San Francisco, CA 94105",value:eb,onChange:e=>ew(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("keywords")||void 0,className:(0,C.cn)("sm:col-span-2 lg:col-span-3 space-y-2",e3("keywords")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-keywords",children:"Keywords"}),(0,a.jsx)(l.Input,{id:"company-keywords",variant:"default",placeholder:"Comma separated, e.g., saas, fintech, payments",value:e_,onChange:e=>eS(e.target.value)})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 pb-4","data-dialog-section":"Social",children:[(0,a.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider whitespace-nowrap",children:"LinkedIn & Social"}),(0,a.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 pb-8",children:[(0,a.jsxs)("div",{"data-field-match":e4("linkedin url")||void 0,className:(0,C.cn)("sm:col-span-2 space-y-2",e3("linkedin url")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-linkedin",children:"LinkedIn URL"}),(0,a.jsx)(l.Input,{id:"company-linkedin",variant:"default",placeholder:"https://linkedin.com/company/acme",value:er,onCh
1ange:e=>eo(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("linkedin id")||void 0,className:(0,C.cn)("space-y-2",e3("linkedin id")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-linkedin-id",children:"LinkedIn ID"}),(0,a.jsx)(l.Input,{id:"company-linkedin-id",variant:"default",placeholder:"e.g., 123456789",value:ec,onChange:e=>ed(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("linkedin urn")||void 0,className:(0,C.cn)("space-y-2",e3("linkedin urn")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-linkedin-urn",children:"LinkedIn URN"}),(0,a.jsx)(l.Input,{id:"company-linkedin-urn",variant:"default",placeholder:"e.g., urn:li:company:123456",value:em,onChange:e=>eu(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("sales navigator")||void 0,className:(0,C.cn)("sm:col-span-2 space-y-2",e3("sales navigator")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-sales-nav-urn",children:"Sales Navigator URN"}),(0,a.jsx)(l.Input,{id:"company-sales-nav-urn",variant:"default",placeholder:"e.g., urn:li:fs_salesCompany:123456",value:ep,onChange:e=>eh(e.target.value)})]}),(0,a.jsxs)("div",{"data-field-match":e4("x handle twitter")||void 0,className:(0,C.cn)("sm:col-span-2 space-y-2",e3("x handle twitter")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-x-handle",children:"X Handle"}),(0,a.jsx)(l.Input,{id:"company-x-handle",variant:"default",placeholder:"e.g., @acme",value:ex,onChange:e=>eg(e.target.value)})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 pb-4","data-dialog-section":"Notes",children:[(0,a.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider whitespace-nowrap",children:"Description & Notes"}),(0,a.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 pb-8",children:[(0,a.jsxs)("div",{"data-field-match":e4("description")||void 0,className:(0,C.cn)("space-y-2",e3("description")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-description",children:"Description"}),(0,a.jsx)(o.Textarea,{id:"company-description",variant:"default",placeholder:"Brief company description...",value:eP,onChange:e=>eU(e.target.value),rows:3})]}),(0,a.jsxs)("div",{"data-field-match":e4("notes")||void 0,className:(0,C.cn)("space-y-2",e3("notes")),children:[(0,a.jsx)(r.Label,{htmlFor:"company-notes",children:"Notes"}),(0,a.jsx)(o.Textarea,{id:"company-notes",variant:"default",placeholder:"Any notes about this company...",value:eD,onChange:e=>eT(e.target.value),rows:3})]})]}),e2&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 pb-4","data-dialog-section":"Custom fields",children:[(0,a.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider whitespace-nowrap",children:"Custom Fields"}),(0,a.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,a.jsx)("div",{className:"pb-4",children:(0,a.jsx)(q.CustomFieldsSection,{entityType:"company",entityId:g.id,showHidden:!0,hideAddButton:!0})})]})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 border-t px-4 sm:px-6 py-4 pb-[max(1rem,env(safe-area-inset-bottom))] shrink-0",children:[(0,a.jsx)(i.Button,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),(0,a.jsx)(i.Button,{type:"submit",disabled:eV,children:eV?"Saving...":e2?"Update":"Create"})]})]})]})})}],703365)},443929,930780,e=>{"use strict";var a=e.i(843476),n=e.i(271645),t=e.i(643531),s=e.i(344523),i=e.i(37727),l=e.i(167881),r=e.i(10708),o=e.i(59377),c=e.i(753751),d=e.i(647163),m=e.i(660662);let u=e=>[e.name,e.email];e.s(["ContactCombobox",0,function({contacts:e,value:p,onChange:h,label:x="Primary contact"}){let[g,f]=(0,n.useState)(!1),y=(0,n.useMemo)(()=>p&&"none"!==p?[p]:[],[p]),v=(0,m.useHydratedOptions)({ids:y,known:e,param:"contactIds",pick:m.pickContacts}),j=(0,n.useMemo)(()=>(0,m.mergeById)(e,v),[e,v]),{query:b,setQuery:w,items:C,searching:N,truncated:_}=(0,m.useOptionSearch)({base:j,search:m.searchContactOptions,searchText:u}),S=j.find(e=>e.id===p);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(r.Label,{children:x}),(0,a.jsxs)(o.Popover,{open:g,onOpenChange:f,children:[(0,a.jsx)(o.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(l.Button,{variant:"outline",role:"combobox","aria-expanded":g,className:"w-full justify-between font-normal",children:[S?(0,a.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,a.jsx)("span",{className:"flex h-5 w-5 items-center justify-center squircle bg-muted text-[10px] font-medium shrink-0 overflow-hidden",children:S.imageUrl?(0,a.jsx)("img",{src:S.imageUrl,alt:"",className:"h-full w-full object-cover"}):S.name.charAt(0).toUpperCase()}),S.name]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"Select a contact..."}),(0,a.jsx)(s.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(o.PopoverContent,{className:"min-w-56 w-[--radix-popover-trigger-width] p-0",align:"start",children:(0,a.jsxs)(c.Command,{shouldFilter:!1,children:[(0,a.jsx)(c.C
1ommandInput,{placeholder:"Search contacts...",value:b,onValueChange:w}),(0,a.jsxs)(c.CommandList,{children:[0===C.length&&(0,a.jsx)(c.CommandEmpty,{children:N?"Searching…":"No contact found."}),(0,a.jsxs)(c.CommandGroup,{children:[(0,a.jsxs)(c.CommandItem,{value:"__none__",onSelect:()=>{h("none"),f(!1)},children:[(0,a.jsx)(t.Check,{className:(0,d.cn)("size-4 shrink-0","none"===p?"opacity-100":"opacity-0")}),(0,a.jsx)(i.X,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,a.jsx)("span",{children:"No contact"})]}),C.map(e=>(0,a.jsxs)(c.CommandItem,{value:e.id,onSelect:()=>{h(e.id),f(!1)},children:[(0,a.jsx)(t.Check,{className:(0,d.cn)("size-4 shrink-0",p===e.id?"opacity-100":"opacity-0")}),(0,a.jsx)("span",{className:"flex size-5 items-center justify-center squircle bg-muted text-[10px] font-medium shrink-0 overflow-hidden",children:e.imageUrl?(0,a.jsx)("img",{src:e.imageUrl,alt:"",className:"h-full w-full object-cover"}):e.name.charAt(0).toUpperCase()}),(0,a.jsxs)("div",{className:"flex flex-col min-w-0 overflow-hidden",children:[(0,a.jsx)("span",{className:"truncate text-sm leading-tight",children:e.name}),(0,a.jsx)("span",{className:"truncate text-xs text-muted-foreground leading-tight",children:e.email})]})]},e.id))]}),_&&(0,a.jsxs)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:["Showing the first ",C.length,". Type to search everyone."]})]})]})})]})]})}],443929);var p=e.i(941388),h=e.i(548106);let x=e=>[e.name,e.email];function g({allContacts:e,selectedIds:n,onSelect:s}){let{query:i,setQuery:l,items:r,searching:u,truncated:p}=(0,m.useOptionSearch)({base:e,search:m.searchContactOptions,searchText:x});return(0,a.jsx)(o.PopoverContent,{className:"w-56 p-0",align:"start",children:(0,a.jsxs)(c.Command,{shouldFilter:!1,children:[(0,a.jsx)(c.CommandInput,{placeholder:"Search contacts...",value:i,onValueChange:l}),(0,a.jsxs)(c.CommandList,{children:[0===r.length&&(0,a.jsx)(c.CommandEmpty,{children:u?"Searching…":"No contact found."}),(0,a.jsx)(c.CommandGroup,{children:r.map(e=>(0,a.jsxs)(c.CommandItem,{value:e.id,onSelect:()=>s(e.id),children:[(0,a.jsx)(t.Check,{className:(0,d.cn)("size-4 shrink-0",n.has(e.id)?"opacity-100":"opacity-0")}),(0,a.jsx)("div",{className:"flex h-5 w-5 items-center justify-center squircle bg-muted text-[10px] font-medium shrink-0 overflow-hidden",children:e.imageUrl?(0,a.jsx)(h.SafeImage,{src:e.imageUrl,alt:e.name,className:"h-full w-full object-cover",fallback:e.name.charAt(0).toUpperCase()}):e.name.charAt(0).toUpperCase()}),(0,a.jsx)("span",{className:"truncate text-sm",children:e.name})]},e.id))}),p&&(0,a.jsxs)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:["Showing the first ",r.length,". Type to search everyone."]})]})]})})}e.s(["ContactRoleInline",0,function({selectedContacts:e,allContacts:t,onAdd:s,onRemove:l,placeholder:r="Add contact..."}){let[c,d]=(0,n.useState)(!1),m=new Set(e.map(e=>e.id)),u=(0,n.useCallback)(e=>{m.has(e)?l(e):s(e)},[m,s,l]);return 0===e.length?(0,a.jsxs)(o.Popover,{open:c,onOpenChange:d,children:[(0,a.jsx)(o.PopoverTrigger,{asChild:!0,children:(0,a.jsx)("button",{type:"button",className:"flex items-center gap-2 text-left rounded-sm px-1 -mx-1 transition-colors cursor-pointer hover:underline underline-offset-2 decoration-foreground/30",children:(0,a.jsx)("span",{className:"text-muted-foreground text-sm",children:r})})}),(0,a.jsx)(g,{allContacts:t,selectedIds:m,onSelect:u})]}):(0,a.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.map(e=>(0,a.jsxs)("div",{className:"group flex items-center gap-1.5 rounded-md bg-muted/50 pl-0.5 pr-1.5 py-0.5 text-sm",children:[(0,a.jsx)("div",{className:"flex h-5 w-5 items-center justify-center squircle bg-muted text-[10px] font-medium shrink-0 overflow-hidden",children:e.imageUrl?(0,a.jsx)(h.SafeImage,{src:e.imageUrl,alt:e.name,className:"h-full w-full object-cover",fallback:e.name.charAt(0).toUpperCase()}):e.name.charAt(0).toUpperCase()}),(0,a.jsx)("span",{className:"text-sm leading-none",children:e.name}),(0,a.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),l(e.id)},className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground -mr-0.5",children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]},e.id)),(0,a.jsxs)(o.Popover,{open:c,onOpenChange:d,children:[(0,a.jsx)(o.PopoverTrigger,{asChild:!0,children:(0,a.jsx)("button",{type:"button",className:"flex h-5 w-5 items-center justify-center squircle text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",children:(0,a.jsx)(p.Plus,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(g,{allContacts:t,selectedIds:m,onSelect:u})]})]})}],930780)},46939,e=>{"use strict";var a=e.i(843476),n=e.i(572377),t=e.i(668270),s=e.i(522014),i=e.i(647163),l=e.i(271645);e.s(["LinkedInPrefillSearch",0,function({fetcher:e,onPick:r,placeholder:o,className:c}){let[d,m]=(0,l.useState)(""),u=(0,t.useSearchPreview)(d,e),p=(0,t.usePreviewDismissRef)(u.setOpen);function h(e){r(e),m(e.title),u.clear(e.title)}return(0,a.jsxs)("div",{className:(0,i.cn)("flex items-center gap-3 px-4 sm:px-6 py-2.5 border-b shrink-0",c),children:[(0,a.jsx)(n.LinkedInSquircle,{className:"h-5 w-5"}),(0,a.jsxs)("div",{ref:p,className:"relative w-full max-w-[20rem]",children:[(0,a.jsx)(s.SearchInput,{value:d,onChange:m,onKeyDown:e=>{(0,t.handlePreviewKeyDown)(e,u,h)},onFocus:()=>{u.items.length>0&&u.setOpen(!0)},placeholder:o,size:"sm",className:"w-full","aria-label":o}),(0,a.jsx)(t.SearchPreviewDropdown,{preview:u,keyword:d,onPick:h})]}),(0,a.jsx)("span",{className:"hidden md:block text-xs text-muted-foreground truncate",children:u.loading?"Searching LinkedIn…":"Pick a result to fill the form"})]})}])},992947,e=>{"use strict";
1async function a(e){let a=(Array.isArray(e)?e:[e]).filter(Boolean);if(0===a.length)return[];try{let e=await fetch("/api/companies/resolve-website",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({company_ids:a})});if(!e.ok)return[];let n=await e.json();return Array.isArray(n.results)?n.results:[]}catch{return[]}}e.s(["resolveCompanyWebsites",0,a])},37214,e=>{"use strict";e.s(["triggerDomainDiscovery",0,function(e,a){a.website_url&&e.functions.invoke("discover-company-domain",{body:{company_id:a.id,website_url:a.website_url}}).then(({data:e,error:n})=>{n?console.warn("[domain-discovery] Edge Function error:",n.message):e?.reason==="unreachable"&&console.warn("[domain-discovery] site unreachable:",a.website_url)}).catch(e=>{console.warn("[domain-discovery] Network error:",e)})}])},247992,e=>{"use strict";function a(e,a){return"company"===e?`/api/companies/${a}/enrichment-snapshot`:`/api/contacts/${a}/enrichment-snapshot`}async function n(e,n,t){try{return(await fetch(a(e,n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:t.reason,nextLinkedinUrl:t.nextLinkedinUrl??null})})).ok}catch{return!1}}async function t(e,n){try{let t=await fetch(a(e,n));if(!t.ok)return null;let s=await t.json();return s?.snapshot??null}catch{return null}}async function s(e,n){try{let t=await fetch(`${a(e,n)}/restore`,{method:"POST"}),s=await t.json().catch(()=>({}));if(!t.ok)return{ok:!1,error:s?.error||"Could not undo the enrichment."};return{ok:!0,restored:s?.restored}}catch{return{ok:!1,error:"Network error while undoing the enrichment."}}}e.s(["captureEnrichmentSnapshot",0,n,"fetchUndoableEnrichment",0,t,"shortLinkedinUrl",0,function(e){return e?e.replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/$/,""):null},"timeSince",0,function(e){let a=new Date(e).getTime();if(!Number.isFinite(a))return"recently";let n=Math.max(0,Math.round((Date.now()-a)/1e3));if(n<45)return"just now";let t=Math.round(n/60);if(t<60)return`${t} minute${1===t?"":"s"} ago`;let s=Math.round(t/60);if(s<24)return`${s} hour${1===s?"":"s"} ago`;let i=Math.round(s/24);return`${i} day${1===i?"":"s"} ago`},"undoEnrichment",0,s])},800047,e=>{"use strict";let a={name:["name","first_name","last_name","nickname","suffix","middle_name"],first_name:["name","first_name"],last_name:["name","last_name","suffix"],suffix:["name","suffix","last_name"]},n={website_url:["website_url","domain"],domain:["website_url","domain"]},t=new Set(["name","first_name","last_name","middle_name","suffix","nickname","headline","location","image_url"]),s=new Set(["description","industry","website_url","domain","headquarters","employee_count","employee_range","founded_year","company_type","logo_url","keywords"]);async function i(e,i,l,r){let o=function(e,i){let l="contacts"===e?t:s,r=new Set;for(let t of i){for(let s of("contacts"===e?a:n)[t]??[t])l.has(s)&&r.add(s)}return Array.from(r)}(i,r);0!==o.length&&await e.rpc("add_manual_overrides",{p_table:i,p_id:l,p_fields:o})}e.s(["markFieldsManuallyEdited",0,i])}]);

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.