PageSourceSearch

https://sealabor.com/assets/JobSearch-BnZb9cB0.js

js sealabor.com collected 2026-10-06 04:51:49 UTC 9,682 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/JobFilterPills-CTn-6hIX.js","assets/index-CIuIcg-H.js","assets/index-9PalXBK5.css","assets/input-Dtpua3xf.js","assets/select-B0SNM6qS.js","assets/index-CVjHS4wK.js","assets/chevron-up-BGnOwfCs.js","assets/H2BMultiSelect-Dx7rJTNp.js","assets/badge-2JdWMEuW.js","assets/checkbox-BlIbuhxZ.js","assets/DateModalPicker-DyFC_Ums.js","assets/isSameDay-BkiAxaJ2.js","assets/format-DLCB6qiH.js","assets/subDays-DgDMLa3o.js","assets/chevron-left-4Z72HbQU.js","assets/dialog-DIBqc38Z.js","assets/index-ChBH9rNd.js","assets/calendar-LjHV2Jwh.js"])))=>i.map(i=>d[i]);
2import{j as e,d as j,e as f,a6 as c,r as o,H as G,aw as y,B as g,a as D,a4 as V,Q as U,u as W,X as Y,b as P,ao as T,al as E,am as Z,ap as ee,an as se,aq as ae,aT as te}from"./index-CIuIcg-H.js";import{I as H}from"./input-Dtpua3xf.js";import{B as oe}from"./badge-2JdWMEuW.js";import{T as le,a as ne,b as R,c as F}from"./tabs-BhQtnovq.js";import{H as re,S as ie}from"./HeaderActionButton-CHOZrj75.js";import{u as ce,a as de,t as me}from"./SavedJobs-BcPBM4h8.js";import{u as ue}from"./useJobsSearch-BlyxM30n.js";import{A as he,u as pe}from"./AppliedBadge-C04TaSxC.js";import{u as xe}from"./useDebouncedValue-6ND-xOPh.js";import{a as je}from"./format-fRnWDLqa.js";import{M as fe}from"./map-pin-1OiWqLVi.js";import{B as ge}from"./bookmark-CnnikFHe.js";import{B as be}from"./bookmark-plus-BfZxkrFM.js";import{S as ve}from"./sliders-horizontal-DBVQfm7q.js";import"./DestructiveConfirmDialog-pgo02dYs.js";import"./alert-dialog-BreLhdoQ.js";import"./index-ChBH9rNd.js";import"./useDeleteCountdown-BV31GF_p.js";import"./trash-2-DgheFM4D.js";import"./useInfiniteQuery-HS-IOAAE.js";import"./format-DLCB6qiH.js";const Ne=()=>e.jsx(j,{children:e.jsx(f,{className:"p-5",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(c,{className:"h-4 w-2/3"}),e.jsx(c,{className:"h-3 w-1/3"}),e.jsxs("div",{className:"flex gap-3 pt-1",children:[e.jsx(c,{className:"h-3 w-24"}),e.jsx(c,{className:"h-3 w-20"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(c,{className:"h-8 w-8 rounded-md"}),e.jsx(c,{className:"h-8 w-16 rounded-md"})]})]})})}),ye=({count:a=5})=>e.jsx("div",{className:"space-y-3","aria-busy":"true","aria-label":"Loading jobs",children:Array.from({length:a}).map((r,l)=>e.jsx(Ne,{},l))}),we=()=>e.jsx(j,{children:e.jsxs(f,{className:"p-5 flex items-center gap-4",children:[e.jsx(c,{className:"h-12 w-12 rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(c,{className:"h-4 w-1/3"}),e.jsx(c,{className:"h-3 w-1/4"})]}),e.jsx(c,{className:"h-8 w-16 rounded-md"})]})}),Se=({count:a=5})=>e.jsx("div",{className:"space-y-3","aria-busy":"true","aria-label":"Loading companies",children:Array.from({length:a}).map((r,l)=>e.jsx(we,{},l))});function Ce({job:a,isSaved:r,appliedAt:l,canSave:u,onSave:i}){const h=G(),p=je(a.salary_min,a.salary_max,a.salary_currency);return e.jsx(j,{className:"hover:shadow-md transition-shadow cursor-pointer",onClick:()=>h(`/employee/jobs/${a.id}`),children:e.jsx(f,{className:"p-5",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold",children:a.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:y(a.org_name)}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground mt-2",children:[a.location&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(fe,{className:"h-3 w-3"}),a.location]}),p&&e.jsx("span",{children:p})]}),l&&e.jsx("div",{className:"mt-2",children:e.jsx(he,{appliedAt:l})})]}),e.jsxs("div",{className:"flex gap-2",onClick:n=>n.stopPropagation(),children:[u&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>i(a.id),"aria-label":r?"Remove from saved":"Save job",children:r?e.jsx(ge,{className:"h-4 w-4 fill-current"}):e.jsx(be,{className:"h-4 w-4"})}),e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(D,{to:`/employee/jobs/${a.id}`,children:"View"})})]})]})})})}const _e=o.memo(Ce);function M({value:a,onChange:r,onSearch:l,onShowFilters:u}){return e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(V,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(H,{className:"pl-9 h-10",placeholder:"Search jobs by keyword...",value:a,onChange:i=>r(i.target.value),onKeyDown:i=>{i.key==="Enter"&&l()}})]}),u&&e.jsxs(g,{variant:"outline",onClick:u,className:"gap-1.5",children:[e.jsx(ve,{className:"h-4 w-4"})," Filters"]})]})}const ke=o.lazy(()=>te(()=>import("./JobFilterPills-CTn-6hIX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])
2).then(a=>({default:a.JobFilterPills})));function Ge(){const{user:a}=U(),{toast:r}=W(),[l,u]=o.useState("jobs"),[i,h]=o.useState(!1),p=o.useRef(null);o.useEffect(()=>{var s,t;i&&((t=(s=p.current)==null?void 0:s.querySelector("input"))==null||t.focus())},[i]);const[n,b]=o.useState(""),A=xe(n,300),[v,I]=o.useState({}),[$,O]=o.useState(["all"]),[w,S]=o.useState({}),[C,_]=o.useState(!1);o.useEffect(()=>{if(C)return;const s=window;if(typeof s.requestIdleCallback=="function"){const d=s.requestIdleCallback(()=>_(!0),{timeout:1500});return()=>{var z;return(z=s.cancelIdleCallback)==null?void 0:z.call(s,d)}}const t=window.setTimeout(()=>_(!0),600);return()=>window.clearTimeout(t)},[C]);const K=o.useMemo(()=>({...w,q:A||w.q}),[w,A]),k=ue(K,!0),x=o.useMemo(()=>{var s;return(((s=k.data)==null?void 0:s.pages)??[]).flatMap(t=>t.rows)},[k.data]),L=o.useMemo(()=>{const s=new Map;for(const t of x){if(!t.organization_id)continue;const d=s.get(t.organization_id);d?d.jobCount+=1:s.set(t.organization_id,{id:t.organization_id,display_name:y(t.org_name,"Company name pending"),logo_url:t.org_logo_url??null,industry:t.org_industry??null,verified:!!t.org_verified,jobCount:1})}return Array.from(s.values()).sort((t,d)=>t.display_name.localeCompare(d.display_name))},[x]),{data:m}=ce(a==null?void 0:a.id),N=de(a==null?void 0:a.id),Q=pe(),X=o.useCallback(async s=>{if(!a)return;const t=(m==null?void 0:m.has(s))??!1;N(s,!t);try{const d=await me(a.id,s);N(s,d.saved),r({title:d.saved?"Saved":"Removed"})}catch{N(s,t),r({title:"Couldn't update saved jobs",variant:"destructive"})}},[a,m,N,r]),B=n.toLowerCase(),J=B?L.filter(s=>(s.display_name??"").toLowerCase().includes(B)||(s.industry??"").toLowerCase().includes(B)):L,q=k.isLoading&&x.length===0;return e.jsxs(e.Fragment,{children:[e.jsx(re,{children:e.jsx(ie,{open:i,label:"Search jobs and companies","aria-controls":"employee-job-search-panel",onClick:()=>h(s=>!s)})}),i&&e.jsx(j,{id:"employee-job-search-panel",ref:p,className:"mb-4 border-2 border-border/60 shadow-sm animate-in slide-in-from-top-2 duration-200",onKeyDown:s=>{s.key==="Escape"&&(s.stopPropagation(),h(!1))},children:e.jsxs(f,{className:"p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("h2",{className:"text-sm font-semibold",children:["Search ",l==="jobs"?"jobs":"companies"]}),e.jsx(g,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Close search",onClick:()=>h(!1),children:e.jsx(Y,{className:"h-4 w-4"})})]}),l==="jobs"?C?e.jsx(o.Suspense,{fallback:e.jsx(M,{value:n,onChange:b,onSearch:()=>S({...v,q:n})}),children:e.jsx(ke,{value:{...v,q:n},onChange:s=>{"q"in s&&b(s.q??""),I(s)},onSearch:()=>S({...v,q:n}),activeScopes:$,setActiveScopes:O})}):e.jsx(M,{value:n,onChange:b,onSearch:()=>S({...v,q:n}),onShowFilters:()=>_(!0)}):e.jsx("div",{className:"flex gap-2",children:e.jsxs("div",{className:"relative flex-1",children:[e.jsx(V,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-header-toggle"}),e.jsx(H,{className:"pl-9",placeholder:"Search companies...",value:n,onChange:s=>b(s.target.value)})]})})]})}),e.jsxs(le,{value:l,onValueChange:s=>u(s),children:[e.jsxs(ne,{className:"mb-4",children:[e.jsxs(R,{value:"jobs",children:[e.jsx(P,{className:"h-4 w-4 mr-1.5"}),"Jobs"]}),e.jsxs(R,{value:"companies",children:[e.jsx(T,{className:"h-4 w-4 mr-1.5"}),"Companies"]})]}),e.jsx(F,{value:"jobs",children:q?e.jsx(ye,{count:5}):x.length===0?e.jsx(E,{icon:P,title:"No jobs found",description:"Try adjusting your search or check back soon."}):e.jsx("div",{className:"space-y-3",children:x.map(s=>{var t;return e.jsx(_e,{job:s,isSaved:(m==null?void 0:m.has(s.id))??!1,appliedAt:((t=Q[s.id])==null?void 0:t.created_at)??null,canSave:!!a,onSave:X},s.id)})})}),e.jsx(F,{value:"companies",children:q?e.jsx(Se,{count:5}):J.length===0?e.jsx(E,{icon:T,title:"No companies found",description:"Try adjusting your search."}):e.jsx("div",{className:"space-y-3",children:J.map(s=>e.jsx(D,{to:`/employee/companies/${s.id}`,className:"block",children:e.jsx(j,{className:"hover:shadow-md transition-shadow",children:e.jsxs(f,{className:"p-5 flex items-center gap-4",children:[e.jsxs(Z,{className:"h-12 w-12",children:[s.logo_url&&e.jsx(ee,{src:s.logo_url,alt:y(s.display_name,"Company"),className:"object-contain bg-background"}),e.jsx(se,{children:e.jsx(T,{className:"h-5 w-5 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold truncate",children:y(s.display_name)}),e.jsxs(oe,{variant:"outline",className:"text-xs",children:[s.jobCount," ",s.jobCount===1?"job":"jobs"]})]}),s.industry&&e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:ae(s.industry)})]}),e.jsx(g,{variant:"outline",size:"sm",children:"View"})]})})},s.id))})})]})]})}export{Ge 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.