1import{n as Y,a2 as b,u as _,a1 as Ae,a6 as g,W as N,ac as pe,aj as M,a8 as j,ai as P,C as U,j as m,z as L,ak as R,a7 as Q,Z as Ne,p as Se,A as J,E as Be,y as fe,X as me,a5 as Pe}from"./DGxlnW41.js";import{g as Oe}from"./_CHoJ0K5.js";import{d as z,b as He,g as B,e as Fe,G as We}from"./DlAt7rV2.js";const ee=[{name:"AI Applications",short:"AI Apps",color:"#FF5E49"},{name:"Healthcare",short:"Healthcare",color:"#3378FF"},{name:"Dev Tools & Security",short:"Dev & Security",color:"#C16BFF"},{name:"Infrastructure",short:"Infrastructure",color:"#BFED26"}],Ue="Convertible Note",je=162,Ye=53,de=16,ze=32;function Ve(a){return a.toLocaleDateString(void 0,{year:"numeric"})}function ye(a,r){if(!r)return 0;const n=new Date(r.getFullYear(),0,1);return((a.getFullYear()-n.getFullYear())*12+a.getMonth())*ze}function Ge(a){const r=[];return a.forEach(n=>{let s=!1;for(let u=0;u<r.length;u++){const c=r[u][r[u].length-1];if(n.date.getTime()-c.date.getTime()>864e5){r[u].push(n),n.y=u,s=!0;break}}s||(r.push([n]),n.y=r.length-1)}),a}function Xe(a){let r=0;for(const n of a)n.y>r&&(r=n.y);return r}function Ze(a,r){let n=!1,s;return function(...u){n?s=u:(a.apply(this,u),n=!0,setTimeout(()=>{n=!1,s&&(a.apply(this,s),s=void 0)},r))}}function qe(a){const{dotRect:r,popupRect:n,containerRect:s,isMobile:u}=a,c=u?Ye:je,h=8,E=r.left-s.left+r.width/2,d=r.top-s.top+r.height/2;let o=E-n.width/2,l=d-n.height/2;const v=Math.max(c,h),C=s.width-n.width-h,w=s.height-n.height-h;return C>=v?o=Math.min(Math.max(o,v),C):o=h,w>=h?l=Math.min(Math.max(l,h),w):l=h,{left:o,top:l}}function Ke(a){if(!a)return"";const r=ee.find(n=>n.name===a);return r?r.color:""}const Je={class:"popup-content"},Qe={class:"company-name demibold"},et=["src","alt"],tt={class:"info-row"},nt={class:"info-block"},ot={class:"info-text font-plain-regular"},at={key:0,class:"info-block"},rt=["href"],st={class:"info-text font-plain-regular"},lt={class:"info-text info-text--opacity font-plain-regular"},it=Y({__name:"CompanyInfoPopup",props:{company:{},categoryColor:{},selectedRoundName:{}},setup(a,{expose:r}){const n=a,s=m(null);r({root:s});const u=L(()=>{if(!n.selectedRoundName)return n.company.rounds;const d=n.selectedRoundName.split("-");if(d.length>=3){const o=d.pop(),l=d.pop(),v=d.join("-");return n.company.rounds.filter(C=>C.investment_type===v&&C.year.toString()===l&&C.month.toString()===o)}return n.company.rounds.filter(o=>o.investment_type===n.selectedRoundName)}),c=L(()=>n.company?.website?n.company.website:"#"),h=L(()=>c.value==="#"?"":c.value.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")),E=L(()=>n.company.logoUrl||null);return(d,o)=>(b(),_("div",Ae({class:"company-popup"},d.$attrs,{style:{backgroundColor:n.categoryColor,...d.$attrs.style||{}},ref_key:"root",ref:s}),[g("button",{class:"close-button",onClick:o[0]||(o[0]=l=>d.$emit("close")),"aria-label":"Close"},[...o[1]||(o[1]=[g("svg",{viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[g("path",{d:"M11.707 1.70703L7.41406 6L11.707 10.293L10.293 11.707L6 7.41406L1.70703 11.707L0.292969 10.293L4.58594 6L0.292969 1.70703L1.70703 0.292969L6 4.58594L10.293 0.292969L11.707 1.70703Z",fill:"currentColor"})],-1)])]),g("div",Je,[g("h3",Qe,[E.value?(b(),_("img",{key:0,src:E.value,alt:a.company.name,class:"company-logo"},null,8,et)):(b(),_(N,{key:1},[pe(M(a.company.name),1)],64))]),g("div",tt,[g("div",nt,[o[2]||(o[2]=g("p",{class:"info-text info-text--opacity font-plain-regular"}," Category ",-1)),g("p",ot,M(a.company.category),1)]),h.value?(b(),_("div",at,[o[4]||(o[4]=g("p",{class:"info-text info-text--opacity font-plain-regular"},"Website",-1)),g("a",{class:"link info-text font-plain-regular",href:c.value,target:"_blank",rel:"noopener noreferrer"},[pe(M(h.value)+" ",1),o[3]||(o[3]=g("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[g("circle",{opacity:"0.08",cx:"7.5",cy:"7.5",r:"7.5",fill:"currentColor"}),g("path",{d:"M11.1504 11.5H9.84961V6.07031L4.45996 11.46L3.54004 10.54L8.92969 5.15039H3.5V3.84961H11.1504V11.5Z",fill:"currentColor"})],-1))],8,rt)])):j("",!0),(b(!0),_(N,null,P(u.value,l=>(b(),_("div",{key:`${a.company.name}-${l.investment_type}-${l.year}-${l.month}`,class:"info-block"},[g("p",st,M(l.investment_type),1),g("p",lt,M(U(Ve)(new Date(l.year,l.month-1))),1)]))),128))])])],16))}}),ct=Object.assign(z(it,[["__scopeId","data-v-bcf2b426"]]),{__name:"AiChartCompanyInfoPopup"}),ut={class:"timeline-axis"},pt={key:0,class:"marker-label demibold"},ft=Y({__name:"TimelineMarkers",props:{markers:{},getTimelinePosition:{type:Function}},setup(a){const r=a;return(n,s)=>(b(),_("ul",ut,[(b(!0),_(N,null,P(a.markers,u=>(b(),_("li",{key:`${u.date}-${u.type}`,class:Q(["timeline-marker",u.type]),style:R({left:`${r.getTimelinePosition(u.date)}px`})},[u.type==="year"?(b(),_("p",pt,M(u.label),1)):j("",!0)],6))),128))]))}}),mt=Object.assign(z(ft,[["__scopeId","data-v-18229dcc"]]),{__name:"AiChartTimelineMarkers"}),dt={class:"legend-wrapper"},yt=Y({__name:"ChartLegend",props:{categories:{},bubbleWithLabelHeight:{},getRowHeight:{type:Function},isMobile:{type:Boolean}},setup(a){return(r,n)=>(b(),_("div",dt,[(b(!0),_(N,null,P(a.categories,s=>(b(),_("div",{class:"legend-category",key:s.category.name,style:R({height:`${a.getRowHeight(s)}px`})},[g("p",{class:"legend-category-name font-plain-regular",style:R({color:s.category.color})},M(a.isMobile?s.category.short:s.category.name),5)],4))),128))]))}}),vt=Object.assign(z(yt,[["__scopeId","data-v-96ed2d4b"]]),{__name:"AiChartLegend"});async function gt(){try{let c=function(d){const o=String(d||"").trim();if(!o)return"";const l=o.replace(/^http(s?)\/\//i,"http$1://");return l.startsWith("http://")||l.startsWith("https://")?l:`https://${l}`},h=function(d,o){let l=d||[];if(typeof l=="string")try{l=JSON.parse(l)}catch{l=[]}return Array.isArray(l)?l.map(v=>{if(!v||typeof v!="object")return null;const C=v.investment_type,w=Number(v.month),T=Number(v.year);return typeof C!="string"||!Number.isInteger(w)||w<1||w>12||!Number.isInteger(T)||T<1990||T>2100?null:{investment_type:C,month:w,year:T}}
1).filter(Boolean):[]};const{$cms:a}=He(),r=await a.fetchByType("aiCompany",{include:2,includeTotal:!1,limit:1e3,order:"fields.name",select:"fields.name,fields.category,fields.website,fields.rounds,fields.logo,sys"}),n=m(r.items||[]),s=m("success"),u=m(null);return{companies:L(()=>(n.value||[]).map(d=>{const o=B(d,"logo"),l=Fe(o)||null,v=B(d,"name"),C=h(B(d,"rounds"),v);return{name:v,category:B(d,"category"),website:c(B(d,"website")),rounds:C,logoUrl:l}})),status:s,error:u}}catch(a){return{companies:L(()=>[]),status:m("error"),error:m(a)}}}const ht={key:0,class:"chart-error"},bt=["data-selected","onClick","onMouseenter"],_t=620,wt=20,Ct=16,W=12,Lt=8,Et=150,Mt=Y({__name:"DotsChart",setup(a){const r={passive:!0},n=m(!1),s=m([]),u=m(null),c=m({company:null,round:null}),h=m(!1),E=m(null),d=m(null),o=m(null),l=m(null),v=m(null),C=m({}),w=m(null),T=m(!1),O=m(!1),te=m(!1);let $=null;const ve=We(),{scrollTop:ge}=Ne(ve);function he(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.investment_type!="string"||typeof t.month!="number"||typeof t.year!="number"?null:{investment_type:t.investment_type,month:t.month,year:t.year}}function be(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.name!="string"||typeof t.category!="string"||t.website!==void 0&&typeof t.website!="string")return null;
1const p=Array.isArray(t.rounds)?t.rounds.map(he).filter(Boolean):[];return{name:t.name,category:t.category,website:t.website||"",featured:!!t.featured,rounds:p,logoUrl:t.logoUrl}}async function _e(){try{const{companies:e}=await gt();return(Array.isArray(e.value)?e.value:[]).map(be).filter(p=>!!p)}catch(e){throw e instanceof Error?e:new Error("Failed to load timeline data")}}const A=L(()=>de+(n.value?Ct:wt)),ne=e=>!e.events||e.events.length===0?A.value*.6:e.maxEvents<=1?A.value*3.5:e.maxEvents*A.value+A.value,x=L(()=>{if(!s.value?.length)return{};try{const e=[];for(let i=0;i<s.value.length;i++){const y=s.value[i],D=Array.isArray(y.rounds)?y.rounds:[];if(D.length)for(let I=0;I<D.length;I++){const k=D[I];if(k.investment_type===Ue)continue;const q=`${k.investment_type}-${k.year}-${k.month}`;e.push({date:new Date(k.year,k.month-1),company:y.name,website:y.website,category:y.category,type:q,featured:y.featured||!1})}}if(!e.length)return{startDate:null,endDate:null,categories:ee.map(i=>({category:i,events:[],maxEvents:0,companiesCount:0})),allRounds:e};e.sort((i,y)=>i.date.getTime()-y.date.getTime());const t=[];for(let i=0;i<e.length;i++){const y=e[i];t.push({date:y.date,company:y.company,website:y.website,category:y.category,type:y.type,y:0,featured:y.featured})}const p={};for(const i of t)p[i.category]||(p[i.category]=[]),p[i.category].push(i);const f=ee.map(i=>{const y=Ge(p[i.name]||[]),D=new Set((p[i.name]||[]).map(I=>I.company));return{category:i,events:y,maxEvents:Xe(y),companiesCount:D.size}});return{startDate:t[0].date,endDate:t[t.length-1].date,categories:f,allRounds:e}}catch{return{}}}),V=L(()=>!c.value.company||!s.value?null:s.value.find(e=>e.name===c.value.company)),we=L(()=>{if(!x.value.startDate)return[];const e=x.value.startDate,t=x.value.endDate,p=[],f=e.getMonth()+1,i=e.getFullYear(),y=t.getFullYear(),D=t.getMonth()+1,I=W*y+D,k=W*i+f,q=I-k;for(let F=0;F<=q+Lt;F++){const $e=Math.floor(F/W),K=F%W,ue=i+$e;p.push({date:new Date(ue,K),type:K==0?"year":"month",label:K==0?ue.toString():""})}return p});function Ce(e){return ye(e,x.value.startDate)}function Le(e,t){t.preventDefault(),t.stopPropagation(),c.value.company===e.company&&c.value.round===e.type?H():(w.value=null,c.value={company:e.company,round:e.type},h.value=!0)}function H(){h.value=!1,c.value={company:null,round:null},w.value=null}function Ee(e){l.value=e.company}function Me(){l.value=null}const S=m(null),oe=m(0),ae=m(0);function Te(e){if(!o.value)return;const t=o.value.offsetLeft;t!=null&&(S.value=Date.now(),oe.value=e.pageX-t,ae.value=o.value.scrollLeft)}function ke(e){if(!S.value||!o.value)return;const t=o.value.offsetLeft;if(t==null)return;e.preventDefault();const f=(e.pageX-t-oe.value)*2;o.value.scrollLeft=ae.value-f}function re(e){if(S.value){const p=e.target.getAttribute("data-selected");Date.now()-S.value<Et&&!p&&H()}S.value=null}function xe(e){const t=o.value;t&&Oe.to(t,{scrollLeft:e,duration:3,ease:"power2.out",overwrite:!0})}function De(e){const t=o.value;t&&(t.scrollLeft=e)}async function Ie(){await J(),requestAnimationFrame(()=>{const e=o.value;if(!e)return;const t=e.scrollWidth,p=e.offsetWidth;if(!p||t<=p)return;const f=t-p;De(f/2),xe(f)})}function G(){te.value||!T.value||!O.value||!s.value.length||u.value||(te.value=!0,Ie())}function Re(){if(!E.value){O.value=!0;return}if(!("IntersectionObserver"in window)){O.value=!0,G();return}$=new IntersectionObserver(e=>{e.some(t=>t.isIntersecting)&&(O.value=!0,G(),$?.disconnect(),$=null)},{threshold:.2}),$.observe(E.value)}const X=Ze(()=>ce(),60);async function se(){u.value=null,T.value=!1;try{s.value=await _e()}catch(e){u.value=e instanceof Error?e.message:"Failed to load timeline data",s.value=[]}requestAnimationFrame(()=>{T.value=!0,G()})}const Z=()=>{n.value=window.innerWidth<=_t};Se(async()=>{Z(),window.addEventListener("resize",Z,r),window.addEventListener("keydown",le,r),o.value?.addEventListener("scroll",X,r),await J(),Re(),await se()}),Be(()=>{window.removeEventListener("keydown",le),window.removeEventListener("resize",Z),o.value?.removeEventListener("scroll",X),$?.disconnect(),$=null});function le(e){h.value&&e.key==="Escape"&&H()}function ie(e){return`${e.company}__${e.type}`}
1async function ce(){if(await J(),!h.value||!v.value||!c.value.company||!c.value.round){w.value=null;return}const e=ie({company:c.value.company,type:c.value.round}),t=C.value[e],p=v.value&&typeof v.value=="object"&&"root"in v.value&&v.value.root instanceof HTMLElement?v.value.root:null;if(!t||!p)return;const f=t.getBoundingClientRect(),i=p.getBoundingClientRect(),y=d.value?.getBoundingClientRect();y&&(w.value=qe({dotRect:f,popupRect:i,containerRect:y,isMobile:n.value}))}return fe([h,c],()=>{h.value&&ce()}),fe(ge,()=>{X()}),(e,t)=>(b(),_("section",{ref_key:"chartSectionRef",ref:E,class:"chart-section",id:"chart"},[u.value?(b(),_("div",ht,[g("p",null,M(u.value),1),g("button",{onClick:se,class:"retry-button"}," Retry ")])):j("",!0),g("div",{ref_key:"chartContainerRef",ref:d,class:"chart-container"},[me(vt,{categories:x.value.categories||[],bubbleWithLabelHeight:A.value,getRowHeight:ne,isMobile:n.value},null,8,["categories","bubbleWithLabelHeight","isMobile"]),h.value&&V.value?(b(),Pe(ct,{key:0,ref_key:"popupRef",ref:v,company:V.value,categoryColor:U(Ke)(V.value?.category),selectedRoundName:c.value.round||void 0,onClose:H,style:R(w.value?{top:w.value.top+"px",left:w.value.left+"px"}:{})},null,8,["company","categoryColor","selectedRoundName","style"])):j("",!0),g("div",{ref_key:"timelineRef",ref:o,class:"timeline-container",onMousedown:Te,onMousemove:ke,onMouseup:re,onMouseleave:re},[(b(!0),_(N,null,P(x.value.categories,p=>(b(),_("div",{class:"timeline-content",key:p.category.name,style:R({height:`${ne(p)}px`})},[(b(!0),_(N,null,P(p.events,f=>(b(),_("div",{"data-datapoint":"true",key:`${f.company}-${f.date}-${f.type}`,ref_for:!0,ref:i=>{C.value[ie(f)]=i},"data-selected":c.value.company===f.company&&c.value.round===f.type,class:Q(["datapoint","timeline-event",{selected:c.value.company===f.company&&c.value.round===f.type,dimmed:c.value.company&&c.value.company!==f.company}]),style:R({left:`${U(ye)(f.date,x.value.startDate)-(n.value?9.5:13)}px`,bottom:`${f.y*A.value+U(de)}px`,backgroundColor:p.category.color}),onClick:i=>Le(f,i),onMouseenter:i=>Ee(f),onMouseleave:Me},[g("p",{class:Q(["company-label","font-plain-regular",{"company-label--visible":c.value.company===f.company||l.value===f.company}]),style:R({color:p.category.color})},M(f.company),7)],46,bt))),128))],4))),128)),me(mt,{markers:we.value,getTimelinePosition:Ce},null,8,["markers"])],544)],512)],512))}}),Dt=Object.assign(z(Mt,[["__scopeId","data-v-b5c84e0a"]]),{__name:"AiChartDotsChart"});export{Dt 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.