PageSourceSearch

https://5ducks.ai/assets/index-Ce07gEuN.js

js 5ducks.ai collected 2026-10-05 15:17:49 UTC 7,465 bytes, 1 lines download raw bytes

1import{u as ce}from"./home-DBHBThhP.js";import{j as e,r as y,ai as S,O as v,aR as w,H as u,aA as C,S as M,B as j,aa as k,ab as F,g as L}from"./index-BA-hDO3C.js";import{E as A}from"./external-link-BC7xl8Dm.js";import{L as z}from"./linkedin-UAFeFJyr.js";import"./seo-head-Chmo95B1.js";import"./confetti-ujQDGIfe.js";import"./building-BgjY0t8u.js";import"./pen-D2DENtO3.js";import"./building-2-B59OQuVd.js";import"./mail-ZTV35zlk.js";import"./user-search-DD3oUyUp.js";import"./form-BlxB3cD1.js";import"./settings-B8h2hIg2.js";import"./square-anTqQ9Ws.js";import"./search-BKbM58WA.js";import"./checkbox-ZpY8b9Nw.js";import"./scroll-area-rnGeKXLQ.js";import"./switch-JUsuRP0a.js";import"./popover-BZcGkHPI.js";import"./format-CW0G_LzU.js";import"./chevron-left-CJuQnFIJ.js";import"./email-link-generator-l1i5n3fe.js";import"./separator-BBS0OGtK.js";import"./badge-BmS2sdGI.js";import"./refresh-cw-Bjqttn03.js";function E({columns:o,results:m,plan:c}){if(m.length===0)return e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No results yet..."});const a=new Map;if(c!=null&&c.customFields)for(const t of c.customFields)a.set(t.label.toLowerCase(),t.key);const p=(t,n)=>{const r=n.toLowerCase();if(r==="name")return t.name;if(r==="company")return t.type==="contact"?t.company:t.name;if(r==="role"||r==="title"||r==="position")return t.type==="contact"&&t.role||"—";if(r==="location"){const s=t.city,d=t.country;return s&&d?`${s}, ${d}`:s||d||"—"}if(r==="city")return t.city||"—";if(r==="state")return t.state||"—";if(r==="country")return t.country||"—";if(r==="department")return t.type==="contact"&&t.department||"—";if(r==="website"){const s=t.type==="company"?t.website:t.companyWebsite;return s?e.jsxs("a",{href:s.startsWith("http")?s:`https://${s}`,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:[s.replace(/^https?:\/\//,"").replace(/\/$/,""),e.jsx(A,{className:"h-3 w-3"})]}):"—"}if(r==="linkedin")return t.type==="contact"&&t.linkedinUrl?e.jsx("a",{href:t.linkedinUrl,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:e.jsx(z,{className:"h-4 w-4"})}):"—";if(r==="description")return t.type==="company"&&t.description||"—";if(r==="size"){if(t.type==="company"){const s=t.size;return s?String(s):"—"}return"—"}if(r==="services"){if(t.type==="company"){const s=t.services;return Array.isArray(s)&&s.length>0?s.join(", "):typeof s=="string"?s:"—"}return"—"}const l=a.get(r);if(l&&t.superSearchMeta&&l in t.superSearchMeta){const s=t.superSearchMeta[l];return typeof s=="string"||typeof s=="number"?String(s):JSON.stringify(s)}if(t.superSearchMeta){if(n in t.superSearchMeta){const i=t.superSearchMeta[n];return typeof i=="string"||typeof i=="number"?String(i):JSON.stringify(i)}const d=Object.keys(t.superSearchMeta).find(i=>i.toLowerCase()===r);if(d){const i=t.superSearchMeta[d];return typeof i=="string"||typeof i=="number"?String(i):JSON.stringify(i)}}return"—"};return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{className:"border-b border-border",children:o.map((t,n)=>e.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-foreground bg-muted",children:t},n))})}),e.jsx("tbody",{children:m.map((t,n)=>e.jsx("tr",{className:"border-b border-border hover:bg-muted/50 transition-colors",children:o.map((r,l)=>e.jsx("td",{className:"py-3 px-4 text-sm",children:p(t,r)},l))},n))})]})})}function b(o){return{name:"Name",website:"Website",city:"City",state:"State",country:"Country",description:"Description",size:"Size",services:"Services",role:"Role",company:"Company",companyWebsite:"Website",linkedinUrl:"LinkedIn",department:"Department"}[o]||o.charAt(0).toUpperCase()+o.slice(1)}function O(o){const m=["name","role","company"],c=[];for(const a of m)o.standardFields.includes(a)&&c.push(b(a));for(const a of o.customFields)c.push(a.label);for(const a of o.standardFields)m.includes(a)||c.push(b(a));return c}function ne({state:o,query:m,onSaved:c,alreadySaved:a=!1,onExpandResults:p}){const{status:t,plan:n,results:r,progressMessages:l,error:s,completionStats:d,isExpanding:i}=o,[x,h]=y.useState(a);y.useEffect(()=>{h(a)},[a]);const f=S({mutationFn:async()=>
1{if(!m||!n)throw new Error("Missing query or plan");return(await v("POST","/api/super-search/save",{query:m,plan:n,results:r})).json()},onSuccess:g=>{h(!0),w.invalidateQueries({queryKey:["/api/lists"]}),c==null||c(g.listId)}});if(t==="idle")return null;if(t==="connecting")return e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(u,{className:"h-6 w-6 animate-spin text-accent mr-2"}),e.jsx("span",{className:"text-muted-foreground",children:"Connecting to Super Search..."})]});if(t==="error")return e.jsxs("div",{className:"flex items-center justify-center py-12 text-destructive",children:[e.jsx(C,{className:"h-5 w-5 mr-2"}),e.jsx("span",{children:s||"An error occurred"})]});const N=n?O(n):["Name","Company","Role","Location","LinkedIn"];return e.jsxs("div",{className:"space-y-4",children:[n&&e.jsx("div",{className:"bg-accent/5 border border-accent/20 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(M,{className:"h-5 w-5 text-accent mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold text-foreground mb-1",children:"Search Strategy"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n.searchStrategy}),e.jsxs("div",{className:"flex gap-4 mt-2 text-xs text-muted-foreground/80",children:[e.jsxs("span",{children:["Mode: ",n.queryType," list"]}),e.jsxs("span",{children:["Target: ",n.targetCount," results"]})]})]})]})}),l.length>0&&t==="streaming"&&e.jsx("div",{className:"text-sm text-muted-foreground animate-pulse",children:l[l.length-1]}),r.length>0&&e.jsx("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:e.jsx(E,{columns:N,results:r,plan:n})}),t==="streaming"&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(u,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Streaming results... (",r.length," found)"]})]}),i&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(u,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Adding more results... (",r.length," total)"]})]}),t==="complete"&&d&&e.jsxs("div",{className:"flex items-center justify-between bg-muted/50 rounded-lg p-3",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Search complete: ",r.length," results found."]}),e.jsxs("div",{className:"flex items-center gap-2",children:[p&&!i&&e.jsxs(j,{variant:"outline",size:"sm",onClick:()=>p(5),disabled:i,children:[e.jsx(k,{className:"h-4 w-4 mr-2"}),"Add 5 More"]}),m&&!x&&e.jsx(j,{variant:"outline",size:"sm",onClick:()=>f.mutate(),disabled:f.isPending,children:f.isPending?e.jsxs(e.Fragment,{children:[e.jsx(u,{className:"h-4 w-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"h-4 w-4 mr-2"}),"Save Results"]})}),x&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[e.jsx(L,{className:"h-4 w-4"}),"Saved!"]})]})]})]})}export{ne as SuperSearchResults,E as SuperSearchTable,ce as useSuperSearch};

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.