PageSourceSearch

https://www.alpha-sense.com/_next/static/chunks/8845.afc7fd8bc5f3ab5d.js

js alpha-sense.com collected 2026-09-24 08:37:52 UTC 6,937 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8845],{8845:(e,t,a)=>{a.r(t),a.d(t,{default:()=>g});var s=a(54568),n=a(54492),l=a(7620);let r={EXPERT_CALLS:"#00E6C3",TRANSCRIPT:"#33B2FF",COMPANY:"#0091FF",RESEARCH:"#FFA726",PATENTS:"#7B1FA2",INTERNAL_CONTENT:"#9C27B0",NEWS:"#00C853"},i=e=>r[e.toUpperCase()]||"#999999",c={id:"htmlLegend",afterUpdate(e,t,a){var s,n,l;let r=((e,t)=>{let a=document.getElementById(t);if(!a)throw Error("Missing legend container: ".concat(t));let s=a.querySelector("ul");return s||(Object.assign((s=document.createElement("ul")).style,{display:"flex",flexDirection:"column",margin:"0",padding:"0"}),a.appendChild(s)),s})(0,a.containerID);r.innerHTML="";let i=document.createElement("span");i.className="legend-subtitle",i.textContent="Last 1 year",Object.assign(i.style,{color:"#334252ad",fontSize:"15px",fontWeight:"800",display:"block",margin:"20px 0 0 0"}),r.appendChild(i);let c=null==(l=e.options.plugins)||null==(n=l.legend)||null==(s=n.labels)?void 0:s.generateLabels;(c?c(e):[]).forEach(t=>{let a=document.createElement("li");Object.assign(a.style,{display:"flex",alignItems:"center",flexDirection:"row",cursor:"default"});let s=document.createElement("span");Object.assign(s.style,{background:t.fillStyle,borderColor:t.strokeStyle,borderWidth:"".concat(t.lineWidth,"px"),borderRadius:"50%",display:"inline-block",flexShrink:"0",height:"10px",width:"10px",marginRight:"5px"});let n=document.createElement("p");if(Object.assign(n.style,{fontSize:"13px",margin:"0",padding:"0",display:"flex",width:"100%"}),"number"!=typeof t.datasetIndex)return;let l=e.data.datasets[t.datasetIndex].data.reduce((e,t)=>e+t,0),i=document.createTextNode(t.text),c=document.createElement("span");c.className="legend-total",c.textContent=l.toLocaleString(),c.style.marginLeft="auto",n.appendChild(i),n.appendChild(c),a.appendChild(s),a.appendChild(n),r.appendChild(a)})}};var o=a(70960),d=a(12249),p=a(52113),h=a.n(p);n.t1.register(n.A6,n.E8,n.PP,n.kc,n.m_,n.s$);let m="trending-topics-cache";function g(e){let{topics:t}=e,[a,r]=(0,l.useState)({}),[p,g]=(0,l.useState)(!0),[u,x]=(0,l.useState)(!1),f=(0,l.useMemo)(()=>t.map(e=>{let{topicKeyword:t}=e;return t}),[t]),y=(0,l.useMemo)(()=>Object.entries(a).map(e=>{let[t,a]=e,s=[...new Set(a.chart_data.map(e=>e.date))].sort(),n=[...new Set(a.chart_data.map(e=>e.documentType))];return{topic:t,dates:s,types:n,datasets:n.map(e=>{let t=s.map(t=>a.chart_data.filter(a=>a.date===t&&a.documentType===e).reduce((e,t)=>e+t.count,0));return{label:e.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),type:"bar",data:t,backgroundColor:i(e),borderColor:i(e),fill:!0,tension:.4,pointRadius:0,barThickness:2}})}}),[a]);return((0,l.useEffect)(()=>{(async()=>{try{let e=localStorage.getItem(m);if(e)try{let{data:t,timestamp:a}=JSON.parse(e);if(Date.now()-a<36e5){r(t),g(!1);return}}catch(e){console.error("Failed to parse cache data:",e),localStorage.removeItem(m)}x(!0);let t=await fetch("/api/trending-topics",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topics:f})}),a=await t.json();if(Array.isArray(a)){let e=a.reduce((e,t,a)=>(t&&(e[f[a]]=t),e),{});r(e),localStorage.setItem(m,JSON.stringify({data:e,timestamp:Date.now()}))}}catch(e){console.error("Error fetching trending topics data:",e)}finally{g(!1),x(!1)}})()},[f]),(0,l.useEffect)(()=>{y.forEach((e,t)=>{var a;let{topic:s,dates:l,datasets:r}=e,i=document.getElementById("chart-".concat(t));if(!i)return;let o=i.getContext("2d");if(!o)return;null==(a=n.t1.getChart(i))||a.destroy();let d="legend-container-".concat(t);new n.t1(o,{type:"bar",data:{labels:l,datasets:r},options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"nearest",axis:"x",intersect:!1},plugins:{tooltip:{mode:"index",intersect:!1,backgroundColor:"#fff",titleColor:"#0e1318",bodyColor:"#0e1318",borderColor:"#e0e0e0",borderWidth:1,padding:12,displayColors:!0,callbacks:{title:e=>new Date(e[0].label).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),label:e=>{var t;return"".concat(e.dataset.label,": ").concat((null==(t=e.parsed.y)?void 0:t.toLocaleStr
1ing())||"N/A")}}},htmlLegend:{containerID:d},legend:{display:!1}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{font:{size:12},autoSkip:!1,callback:function(e,t,a){let s=new Date(this.getLabelForValue("string"==typeof e?parseInt(e):e)),n=a.length,l=Math.floor(n/4);return 0===t||t===n-1||[1,2,3].some(e=>t===l*e)?s.toLocaleDateString("en-US",{month:"short",year:"2-digit"}):""}}},y:{stacked:!0,grid:{color:"#f5f5f5"},ticks:{color:"#3342526e",font:{size:11},maxTicksLimit:6,callback:e=>{let t="string"==typeof e?parseFloat(e):e;return t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"k":t.toLocaleString()}}}}},plugins:[c]})})},[y]),p&&u)?(0,s.jsx)(o.A,{className:h().component,children:t.map((e,t)=>(0,s.jsx)(d.A,{desktopSpan:4,mobileSpan:12,className:h().col,children:(0,s.jsxs)("div",{className:h()["trend-card"],children:[(0,s.jsxs)("div",{className:h()["trend-header"],children:[(0,s.jsx)("div",{className:h()["loading-skeleton"],style:{width:"60%",height:"24px"}}),(0,s.jsxs)("div",{className:h()["trend-stats"],children:[(0,s.jsxs)("div",{className:h()["stats-group"],children:[(0,s.jsx)("div",{className:h()["loading-skeleton"],style:{width:"80px",height:"20px"}}),(0,s.jsx)("div",{className:h()["loading-skeleton"],style:{width:"60px",height:"16px",marginTop:"4px"}})]}),(0,s.jsxs)("div",{className:h()["stats-group"],children:[(0,s.jsx)("div",{className:h()["loading-skeleton"],style:{width:"80px",height:"20px"}}),(0,s.jsx)("div",{className:h()["loading-skeleton"],style:{width:"60px",height:"16px",marginTop:"4px"}})]})]})]}),(0,s.jsx)("div",{className:h()["trend-chart"],children:(0,s.jsx)("div",{className:h()["loading-skeleton"],style:{width:"100%",height:"200px"}})})]})},"loading-".concat(t)))}):(0,s.jsx)(o.A,{className:h().component,children:Object.entries(a).map((e,t)=>{let[a,n]=e;return(0,s.jsx)(d.A,{desktopSpan:4,mobileSpan:12,className:h().col,children:(0,s.jsxs)("div",{className:h()["trend-card"],children:[(0,s.jsxs)("div",{className:h()["trend-header"],children:[(0,s.jsx)("h3",{children:a}),(0,s.jsxs)("div",{className:h()["trend-stats"],children:[(0,s.jsxs)("div",{className:h()["stats-group"],children:[(0,s.jsx)("div",{className:h()["stat-value"],children:n.total_documents.toLocaleString()}),(0,s.jsx)("div",{className:h()["stat-label"],children:"TOTAL"})]}),(0,s.jsxs)("div",{className:h()["stats-group"],children:[(0,s.jsxs)("div",{className:"".concat(h()["stat-value"]," ").concat(n.percent_change>=0?h().positive:h().negative),children:[(n.percent_change>=0?"+":"")+n.percent_change.toFixed(1),"%"]}),(0,s.jsx)("div",{className:h()["stat-label"],children:"1Y CHANGE"})]})]})]}),(0,s.jsxs)("div",{className:h()["trend-chart"],children:[(0,s.jsx)("canvas",{id:"chart-".concat(t)}),(0,s.jsx)("div",{id:"legend-container-".concat(t)})]})]})},a)})})}}}]);

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.