;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="0add7cad-656e-5548-177f-980128816d5d")}catch(e){}}(); (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,591762,e=>{"use strict";var t=e.i(595052);let s=(...e)=>e.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim(),i=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,t.forwardRef)(({color:e="currentColor",size:i=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:l="",children:a,iconNode:c,...u},d)=>(0,t.createElement)("svg",{ref:d,...r,width:i,height:i,stroke:e,strokeWidth:o?24*Number(n)/Number(i):n,className:s("lucide",l),...!a&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(u)&&{"aria-hidden":"true"},...u},[...c.map(([e,s])=>(0,t.createElement)(e,s)),...Array.isArray(a)?a:[a]])),o=(e,r)=>{let o=(0,t.forwardRef)(({className:o,...l},a)=>(0,t.createElement)(n,{ref:a,iconNode:r,className:s(`lucide-${i(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o),...l}));return o.displayName=i(e),o};e.s(["default",()=>o],591762)},38959,e=>{"use strict";let t=(0,e.i(591762).default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);e.s(["Zap",()=>t],38959)},402874,739219,e=>{"use strict";var t=e.i(319181),s=e.i(595052),i=e.i(190642),r=e.i(842428),n=e.i(38959);let o=()=>(0,t.jsx)("div",{className:"relative w-7 h-7 flex items-center justify-center group cursor-pointer hover:scale-110 transition-transform duration-300",children:(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-slate-400 via-[#0B0F1A] to-slate-600 p-[2px] shadow-xl group-hover:shadow-amber-500/30 group-hover:shadow-2xl transition-shadow duration-300",children:(0,t.jsx)("div",{className:"w-full h-full rounded-full bg-[#0a0a0b] flex items-center justify-center relative overflow-hidden",children:(0,t.jsxs)("div",{className:"relative z-10 flex flex-col items-center",children:[(0,t.jsx)(n.Zap,{size:12,className:"text-amber-500 fill-amber-500"}),(0,t.jsx)("div",{className:"h-1 w-[1px] bg-amber-400"})]})})})});e.s(["SignalHooksLogo",0,o,"SignalHooksLogoCompact",0,()=>(0,t.jsx)("div",{className:"relative w-6 h-6 flex items-center justify-center",children:(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-slate-400 via-[#0B0F1A] to-slate-600 p-[1px] shadow-lg",children:(0,t.jsx)("div",{className:"w-full h-full rounded-full bg-[#0a0a0b] flex items-center justify-center",children:(0,t.jsx)(n.Zap,{size:10,className:"text-amber-400 fill-amber-400 drop-shadow-[0_0_4px_#d97706]"})})})})],739219);var l=e.i(121169);function a(){let[e,n]=(0,s.useState)(!1),[a,c]=(0,s.useState)(!1),[u,d]=(0,s.useState)(!1),m=(0,s.useRef)(null),f=(0,s.useRef)(null),x=(0,s.useRef)(null),{data:h,status:b}=(0,l.useSession)(),g="authenticated"===b&&!!h?.user;return(0,s.useEffect)(()=>{function e(e){m.current&&!m.current.contains(e.target)&&c(!1)}if(a)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[a]),(0,s.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&(n(!1),f.current?.focus())}},[e]),(0,s.useEffect)(()=>{e&&setTimeout(()=>{x.current?.focus()},10)},[e]),(0,s.useEffect)(()=>{function e(){d(window.scrollY>24)}return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 focus:z-[100] focus:rounded-lg focus:bg-amber-600 focus:px-4 focus:py-2 focus:text-sm focus:font-semibold focus:text-white focus:outline-none focus:ring-2 focus:ring-white",children:"Skip to main content"}),(0,t.jsxs)(r.motion.nav,{"aria-label":"Main navigation",className:`sticky top-0 z-50 transition-all duration-300 ${u?"border-b border-white/[0.08] bg-[#0a0a0b] shadow-[0_1px_0_rgba(255,255,255,0.04)]":"border-b border-transparent bg-[#0a0a0b]/20 backdrop-blur-sm"}`,initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.4,ease:[.16,1,.3,1]},children:[(0,t.jsxs)("div",{className:"mx-auto flex h-[4.25rem] max-w-[90rem] items-center justify-between px-6 lg:px-10",children:[(0,t.jsxs)(i.default,{href:"/",className:"flex items-center gap-2.5 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#080808]",children:[(0,t.jsx)(o,{}),(0,t.jsx)("span",{className:"text-[1rem] font-bold tracking-[-0.01em] text-white drop-shadow-[0_1px_10px_rgba(0,0,0,0.28)]",children:"GetSignalHooks"})]}),(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-8",children:[(0,t.jsx)(i.default,{href:"/#how-it-works",className:"text-[0.875rem] font-medium text-zinc-400 transition-colors duration-200 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#080808] rounded-sm",children:"How it works"}),(0,t.jsx)(i.default,{href:"/#demo",className:"text-[0.875rem] font-medium text-zinc-400 transition-colors duration-200 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#080808] rounded-sm",children:"Demo"}),(0,t.jsx)(i.default,{href:"/#pricing",className:"text-[0.875rem] font-medium text-zinc-400 transition-colors duration-200 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#080808] rounded-sm",children:"Pricing"}),g?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.default,{href:"/app/agent",className:"bg-amber-600 text-white h-11 px-4 rounded-lg text-sm font-semibold inline-flex items-center focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#080808]",children:"Open agent"}),(0,t.jsxs)("div",{className:"relative",ref:m,children:[(0,t.jsxs)("button",{onClick:()=>c(!a),"aria-haspopup":"menu","aria-expanded":a,"aria-label":"User menu",className:"flex items-center gap-2 text-[0.875rem] text-zinc-400 hover:text-white transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a0a0b] rounded-sm",children:[(0,t.jsx)("span",{className:"w-7 h-7 rounded-full bg-amber-600 flex items-center justify-center text-xs font-bold text-white",children:(h.user.name?.[0]||h.user.email?.[0]||"?").toUpperCase()}),(0,t.jsx)("span",{className:"max-w-[10rem] truncate",children:h.user.name||h.user.email}),(0,t.jsx)("svg",{className:`w-3.5 h-3.5 transition-transform duration-200 ${a?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),a&&(0,t.jsxs)("div",{role:"menu",className:"absolute right-0 mt-2 w-48 bg-zinc-900 border border-zinc-700/60 rounded-xl shadow-2xl shadow-black/40 py-1.5 z-50",children:[(0,t.jsx)("p",{className:"px-4 py-2 text-xs text-zinc-500 truncate border-b border-zinc-800 mb-1",children:h.user.email}),(0,t.jsxs)(i.default,{href:"/app/agent",role:"menuitem",onClick:()=>c(!1),className:"flex items-center gap-2.5 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-800 hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-inset",children:[(0,t.jsx)("svg",{className:"w-4 h-4 text-zinc-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"})}),"Command Center"]}),(0,t.jsxs)(i.default,{href:"/app/settings",role:"menuitem",onClick:()=>c(!1),className:"flex items-center gap-2.5 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-800 hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-inset",children:[(0,t.jsxs)("svg",{className:"w-4 h-4 text-zinc-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),"Settings"]}),(0,t.jsx)("div",{className:"border-t border-zinc-800 mt-1 pt-1",children:(0,t.jsxs)("button",{onClick:()=>{c(!1),(0,l.signOut)({callbackUrl:"/"})},role:"menuitem",className:"flex items-center gap-2.5 w-full px-4 py-2 text-sm text-zinc-400 hover:bg-zinc-800 hover:text-red-400 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-inset",children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),"Log out"]})})]})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.default,{href:"/login",className:"text-[0.875rem] font-medium text-zinc-400 transition-colors duration-200 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#080808] rounded-sm",children:"Log in"}),(0,t.jsxs)(i.default,{href:"/register",className:"group inline-flex h-10 items-center gap-1.5 rounded-full border border-amber-400/35 bg-amber-600 px-5 text-[0.875rem] font-semibold tracking-[-0.01em] text-white shadow-[0_10px_32px_rgba(217,119,6,0.25)] transition-all duration-200 hover:bg-amber-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#080808]",children:["Try it free",(0,t.jsx)("svg",{className:"h-3.5 w-3.5 transition-transform duration-200 group-hover:translate-x-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3"})})]})]})]}),(0,t.jsx)("button",{ref:f,onClick:()=>n(!e),"aria-expanded":e,className:"sm:hidden p-3 text-zinc-400 hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a0a0b] rounded-sm","aria-label":"Toggle menu",children:e?(0,t.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}):(0,t.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})})]}),e&&(0,t.jsxs)("div",{className:"sm:hidden border-t border-white/[0.06] bg-[#0a0a0b] px-6 py-4 space-y-3",children:[(0,t.jsx)(i.default,{href:"/#how-it-works",ref:x,onClick:()=>n(!1),className:"block text-sm text-zinc-400 hover:text-white py-1 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a0a0b]",children:"How it works"}),(0,t.jsx)(i.default,{href:"/#demo",onClick:()=>n(!1),className:"block text-sm text-zinc-400 hover:text-white py-1 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a0a0b]",children:"Demo"}),(0,t.jsx)(i.default,{href:"/#pricing",onClick:()=>n(!1),className:"block text-sm text-zinc-400 hover:text-white py-1 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a0a0b]",children:"Pricing"}),g?(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"border-t border-zinc-800 pt-3 mt-2",children:[(0,t.jsx)("p",{className:"text-sm text-zinc-500 mb-3",children:h.user.name||h.user.email}),(0,t.jsx)(i.default,{href:"/app/agent",onClick:()=>n(!1),className:"block text-sm text-zinc-300 hover:text-white py-1.5 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a0a0b]",children:"Command Center"}),(0,t.jsx)(i.default,{href:"/app/settings",onClick:()=>n(!1),className:"block text-sm text-zinc-300 hover:text-white py-1.5 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a0a0b]",children:"Settings"}),(0,t.jsx)("button",{onClick:()=>{n(!1),(0,l.signOut)({callbackUrl:"/"})},className:"block text-sm text-zinc-400 hover:text-red-400 py-1.5 mt-1 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a0a0b]",children:"Log out"})]})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.default,{href:"/login",onClick:()=>n(!1),className:"block text-sm text-zinc-400 hover:text-white py-1 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a0a0b]",children:"Log in"}),(0,t.jsx)(i.default,{href:"/register",onClick:()=>n(!1),className:"block w-full text-center bg-amber-600 hover:bg-amber-500 text-white text-sm font-semibold py-2.5 rounded-lg transition-colors mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a0a0b]",children:"Try it free"})]})]})]})]})}e.s(["Navbar",()=>a],402874)},203263,e=>{"use strict";function t(e){let t=function(e){if(e)return e.match(/^https?:\/\//)?e:`https://${e}`}(e.url),s=e.companyName?.trim()||void 0;if(t||s)for(let i of e.styles&&e.styles.length>0?e.styles:[e.messagingStyle||"evidence"])fetch("/api/generate-hooks",{method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0,body:JSON.stringify({url:t,companyName:s,targetRole:e.targetRole||void 0,messagingStyle:"evidence"!==i?i:void 0,context:e.context||void 0,prewarm:!0,prewarmSource:e.source||void 0})}).catch(()=>{})}e.s(["triggerHooksPrewarm",()=>t])},461865,e=>{"use strict";let t=(0,e.i(591762).default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);e.s(["ArrowRight",()=>t],461865)},777333,e=>{"use strict";var t=e.i(319181),s=e.i(595052),i=e.i(203263);let r=["e.g. Gong","e.g. Shopify","e.g. Salesforce","e.g. HubSpot","e.g. Notion"],n="gsh_recent_searches";function o(e){let t=e.toLowerCase();return t.includes("linkedin")?"bg-[#0077b5]/10 border-[#0077b5]/30 text-[#38aee6]":t.includes("news")?"bg-amber-500/10 border-amber-500/30 text-amber-400":t.includes("press")?"bg-amber-600/10 border-amber-500/20 text-amber-400":t.includes("funding")?"bg-emerald-500/10 border-emerald-500/30 text-emerald-400":t.includes("revenue")?"bg-rose-500/10 border-rose-500/30 text-rose-400":"bg-zinc-600/10 border-zinc-500/20 text-zinc-400"}function l(){return(0,t.jsxs)("div",{className:"flex items-center gap-3 w-full rounded-lg border border-white/[0.06] bg-[#0e0f10] px-4 py-2.5",children:[(0,t.jsx)("div",{className:"relative overflow-hidden h-5 w-20 rounded bg-[#1e2025] shrink-0",children:(0,t.jsx)("div",{className:"absolute inset-0 animate-shimmer bg-gradient-to-r from-transparent via-zinc-700/20 to-transparent"})}),(0,t.jsx)("div",{className:"relative overflow-hidden h-4 flex-1 rounded bg-[#1e2025]",children:(0,t.jsx)("div",{className:"absolute inset-0 animate-shimmer bg-gradient-to-r from-transparent via-zinc-700/20 to-transparent"})})]})}function a({onSourceSelected:e,onCompanyNameChange:a,prewarmTargetRole:c,prewarmMessagingStyle:u,prewarmContext:d}){let m,f,[x,h]=(0,s.useState)(""),[b,g]=(0,s.useState)([]),[v,p]=(0,s.useState)(!1),[w,j]=(0,s.useState)(null),[k,N]=(0,s.useState)(!1),[y,z]=(0,s.useState)(""),[L,C]=(0,s.useState)(null),[S,A]=(0,s.useState)([]),[M,E]=(0,s.useState)([]),[R,W]=(0,s.useState)(-1),[B,T]=(0,s.useState)(!1),[_,H]=(0,s.useState)(!1),[U,O]=(0,s.useState)(0),[$,D]=(0,s.useState)(!0),P=(0,s.useRef)(null),F=(0,s.useRef)(null),Z=(0,s.useRef)(null),I=(0,s.useRef)(0);async function V(e){if(!e.trim())return;let t=++I.current;p(!0),j(null),g([]),W(-1);try{let s=await fetch("/api/search-sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({companyName:e.trim()})});if(t!==I.current)return;let i=await s.json();if(!s.ok)throw Error(i.error||"Search failed");g(i.sources??[]),i.sources?.length||j("no_results")}catch(e){if(t!==I.current)return;j(e instanceof Error?e.message:"Search failed")}finally{t===I.current&&p(!1)}}function J(t){let s=x.trim();!function(e){let t=e.trim();if(!t)return;let s=[t,...S.filter(e=>e!==t)].slice(0,3);A(s);try{localStorage.setItem(n,JSON.stringify(s))}catch{}}(s),C({url:t.url,label:t.label,domain:t.domain,companyName:s}),g([]),T(!1),e(t.url,s),(0,i.triggerHooksPrewarm)({url:t.url,companyName:s,targetRole:c,messagingStyle:u,context:d,source:"company-search-source"})}(0,s.useEffect)(()=>{try{let e=localStorage.getItem(n);e&&A(JSON.parse(e))}catch{}window.location.pathname.startsWith("/app")&&fetch("/api/leads?limit=200").then(e=>e.json()).then(e=>{if(!e.leads)return;let t=new Set,s=[];for(let i of e.leads){let e=i.companyName?.trim();if(!e||t.has(e.toLowerCase()))continue;t.add(e.toLowerCase());let r="";try{i.companyWebsite&&(r=new URL(i.companyWebsite).hostname.replace("www.",""))}catch{}s.push({name:e,domain:r})}E(s)}).catch(()=>{})},[]),(0,s.useEffect)(()=>{let e=setInterval(()=>{D(!1),setTimeout(()=>{O(e=>(e+1)%r.length),D(!0)},300)},2500);return()=>clearInterval(e)},[]),(0,s.useEffect)(()=>{function e(e){F.current&&!F.current.contains(e.target)&&T(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,s.useEffect)(()=>{if(x.length<2){H(!1),P.current&&clearTimeout(P.current);return}return H(!0),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{H(!1),V(x)},350),()=>{P.current&&clearTimeout(P.current)}},[x]);let K=x.length>=1?M.filter(e=>e.name.toLowerCase().includes(x.toLowerCase())||e.domain.toLowerCase().includes(x.toLowerCase())).slice(0,3):[],Y=[...""===x?S.map(e=>({kind:"recent",name:e})):[],...K.map(e=>({kind:"lead",name:e.name,domain:e.domain})),...b.map(e=>({kind:"source",source:e}))],q=B&&!L&&(""===x&&S.length>0||K.length>0||_||v||b.length>0||null!==w);return(0,t.jsx)("div",{children:L?(0,t.jsxs)("div",{className:"animate-fade-in flex items-center gap-2 bg-[#0e0e10] border border-amber-500/30 rounded-xl px-3 py-3",children:[(0,t.jsx)("span",{className:`shrink-0 rounded-md border px-2 py-0.5 text-[0.6875rem] font-semibold whitespace-nowrap ${o(L.label)}`,children:L.label}),(0,t.jsx)("span",{className:"text-sm text-zinc-300 truncate flex-1",children:L.domain}),(0,t.jsx)("button",{type:"button",onClick:function(){C(null),h(""),g([]),j(null),W(-1),a(""),setTimeout(()=>Z.current?.focus(),50)},className:"shrink-0 text-zinc-600 hover:text-zinc-300 transition-colors ml-1 p-2 -mr-2 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-1 focus-visible:ring-offset-[#0e0e10]","aria-label":"Clear selection",children:(0,t.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}):(0,t.jsxs)("div",{ref:F,className:"relative",children:[(0,t.jsxs)("div",{className:"relative",children:[!x&&(0,t.jsx)("div",{className:"absolute inset-y-0 left-12 flex items-center pointer-events-none",style:{transition:"opacity 0.3s ease, transform 0.3s ease",opacity:+!!$,transform:$?"translateY(0)":"translateY(4px)"},children:(0,t.jsx)("span",{className:"text-slate-600 text-sm",children:r[U]})}),_&&(0,t.jsx)("div",{className:"absolute inset-y-0 right-4 flex items-center pointer-events-none",children:(0,t.jsx)("span",{className:"h-2 w-2 rounded-full bg-amber-500 animate-pulse"})}),(0,t.jsx)("svg",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-600 pointer-events-none",width:18,height:18,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 15.803a7.5 7.5 0 0 0 10.607 0z"})}),(0,t.jsx)("input",{id:"company-search",ref:Z,type:"text",value:x,onChange:e=>{let t=e.target.value;h(t),g([]),j(null),W(-1),a(t)},onKeyDown:function(e){if("Enter"===e.key){if(e.preventDefault(),R>=0&&RMath.min(e+1,Y.length-1));return}if("ArrowUp"===e.key){e.preventDefault(),W(e=>Math.max(e-1,-1));return}},onFocus:()=>T(!0),className:"w-full bg-[#0e0e10] border border-white/10 rounded-xl p-4 pl-12 text-sm focus:border-amber-500/50 outline-none transition-all"})]}),q&&(0,t.jsxs)("div",{className:"absolute top-full left-0 right-0 mt-1.5 z-20 animate-slide-in-bottom rounded-xl border border-white/[0.06] bg-[#14161a]/95 backdrop-blur-sm shadow-2xl overflow-hidden",children:[""===x&&S.length>0&&(0,t.jsxs)("div",{className:"p-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 mb-0.5",children:[(0,t.jsx)("svg",{className:"h-3 w-3 text-zinc-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,t.jsx)("span",{className:"text-[0.6875rem] text-zinc-600 font-medium uppercase tracking-wider",children:"Recent"})]}),S.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 group",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{h(e),T(!0),a(e),V(e)},className:`flex-1 text-left px-3 py-2 rounded-lg text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-1 focus-visible:ring-offset-[#14161a] ${R===s?"bg-[#1a1c22] text-zinc-200":"text-zinc-400 hover:text-zinc-200 hover:bg-[#1a1c22]"}`,children:e}),(0,t.jsx)("button",{type:"button",onClick:()=>(function(e){let t=S.filter(t=>t!==e);A(t);try{localStorage.setItem(n,JSON.stringify(t))}catch{}})(e),className:"opacity-0 group-hover:opacity-100 p-1.5 text-zinc-600 hover:text-zinc-400 transition-all mr-1 focus-visible:opacity-100 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-1 focus-visible:ring-offset-[#14161a]","aria-label":"Remove from recent",children:(0,t.jsx)("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},e))]}),x.length>=1&&K.length>0&&(m=""===x?S.length:0,(0,t.jsxs)("div",{className:"p-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 mb-0.5",children:[(0,t.jsx)("svg",{className:"h-3 w-3 text-zinc-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"})}),(0,t.jsx)("span",{className:"text-[0.6875rem] text-zinc-600 font-medium uppercase tracking-wider",children:"Your Leads"})]}),K.map((e,s)=>(0,t.jsxs)("button",{type:"button",onClick:()=>{h(e.name),a(e.name),T(!0),V(e.name)},className:`flex items-center gap-3 w-full text-left px-3 py-2 rounded-lg text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-offset-1 focus-visible:ring-offset-[#14161a] ${R===m+s?"bg-[#1a1c22] text-zinc-200":"text-zinc-400 hover:text-zinc-200 hover:bg-[#1a1c22]"}`,children:[(0,t.jsx)("span",{className:"text-zinc-300",children:e.name}),e.domain&&(0,t.jsx)("span",{className:"text-zinc-600 text-xs",children:e.domain})]},e.name))]})),(_||v)&&(0,t.jsxs)("div",{className:"p-2 flex flex-col gap-1.5",children:[(0,t.jsx)(l,{}),(0,t.jsx)(l,{}),(0,t.jsx)(l,{})]}),!v&&b.length>0&&(f=Y.findIndex(e=>"source"===e.kind),(0,t.jsxs)("div",{className:"p-2",children:[(0,t.jsx)("p",{className:"text-[0.6875rem] text-zinc-600 font-medium uppercase tracking-wider px-2 py-1 mb-0.5",children:"Sources — ranked by signal quality"}),(0,t.jsx)("div",{className:"flex flex-col gap-1",children:b.map((e,s)=>(0,t.jsxs)("button",{type:"button",onClick:()=>J(e),style:{animationDelay:`${50*s}ms`},className:`animate-fade-in flex items-center gap-3 w-full rounded-lg border px-4 py-2.5 text-left transition-all group focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 focus-visible:ring-inset ${R===f+s?"border-amber-500/40 bg-amber-500/5 ring-1 ring-inset ring-amber-500/20":"border-white/[0.06] bg-[#0e0f10] hover:border-amber-500/40 hover:bg-[#111319]"}`,children:[(0,t.jsx)("span",{className:`shrink-0 rounded-md border px-2 py-0.5 text-[0.6875rem] font-semibold whitespace-nowrap ${o(e.label)}`,children:e.label}),(0,t.jsxs)("span",{className:"flex flex-col min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-sm text-zinc-400 group-hover:text-zinc-200 transition-colors truncate",children:e.domain}),e.title&&(0,t.jsx)("span",{className:"text-[11px] text-zinc-600 group-hover:text-zinc-500 transition-colors truncate",children:e.title})]}),(0,t.jsx)("svg",{className:"h-3.5 w-3.5 text-zinc-600 group-hover:text-amber-400 shrink-0 transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3"})})]},e.url))})]})),!v&&"no_results"===w&&(0,t.jsxs)("div",{className:"p-6 text-center",children:[(0,t.jsx)("svg",{className:"h-10 w-10 text-zinc-700 mx-auto mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 15.803a7.5 7.5 0 0 0 10.607 0z"})}),(0,t.jsxs)("p",{className:"text-sm text-zinc-400 mb-1",children:["No sources found for ",(0,t.jsxs)("span",{className:"text-zinc-200",children:["“",x,"”"]})]}),(0,t.jsx)("p",{className:"text-xs text-zinc-600 mb-3",children:"Try a different spelling or paste a URL directly"}),!k&&(0,t.jsx)("button",{type:"button",onClick:()=>{N(!0),T(!1)},className:"text-xs text-amber-400 hover:text-amber-300 underline underline-offset-2 transition-colors",children:"Paste a URL directly →"})]}),!v&&w&&"no_results"!==w&&(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)("p",{className:"text-sm text-red-400",children:w})})]}),(0,t.jsx)("div",{className:"mt-2",children:k?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("label",{htmlFor:"direct-url",className:"sr-only",children:"Direct article URL"}),(0,t.jsx)("input",{id:"direct-url",type:"text",placeholder:"https://techcrunch.com/...",value:y,onChange:e=>z(e.target.value),onKeyDown:t=>{"Enter"===t.key&&y.trim()&&(t.preventDefault(),e(y.trim(),x.trim()),(0,i.triggerHooksPrewarm)({url:y.trim(),companyName:x.trim(),targetRole:c,messagingStyle:u,context:d,source:"company-search-direct-url"}))},className:"mt-1 w-full bg-[#0e0e10] border border-white/10 rounded-xl px-3 py-2 text-sm text-white placeholder:text-slate-600 focus:border-amber-500/50 outline-none transition-all"})]}):(0,t.jsx)("button",{type:"button",onClick:()=>N(!0),className:"text-xs text-zinc-600 hover:text-zinc-400 transition-colors underline underline-offset-2",children:"Already have a URL? Paste it directly"})})]})})}e.s(["CompanySearchInput",()=>a])}]); //# debugId=0add7cad-656e-5548-177f-980128816d5d //# sourceMappingURL=bad39a0c24ec3cbe.js.map