PageSourceSearch

https://newlocal.ca/assets/useScrapedJobs-gvGTZpy6.js

js newlocal.ca collected 2026-10-04 23:45:35 UTC 1,608 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{r as t}from"./IconBase.es-DEPGDkbK.js";import{n}from"./client-B646rCiM.js";import{n as r}from"./input-sanitizer-COG7lz55.js";var i=e(t(),1),a=[`AF`,`KE`,`NG`,`ZA`,`GH`,`EG`,`UG`,`TZ`,`RW`,`ET`,`MU`,`MA`,`SN`],o={weworkremotely:`WeWorkRemotely`,remoteok:`RemoteOK`,jobicy:`Jobicy`,arbeitnow:`Arbeitnow`,remotive:`Remotive`,brightermonday:`BrighterMonday`,jobberman:`Jobberman`,myjobmag:`MyJobMag`,himalayas:`Himalayas`,wellfound:`Wellfound`,"remote.co":`Remote.co`,workingnomads:`WorkingNomads`},s=(e={})=>{let[t,s]=(0,i.useState)([]),[c,l]=(0,i.useState)(!0),[u,d]=(0,i.useState)(null),[f,p]=(0,i.useState)(0),m=e.countries?.join(`,`)??``,h=e.search??``,g=e.limit??0,_=e.source??``,v=e.ids!==void 0,y=e.ids?.join(`,`)??``,b=(0,i.useCallback)(async()=>{if(v&&!y){s([]),p(0),l(!1);return}l(!0),d(null);try{let e=n.from(`scraped_jobs`).select(`*`,{count:`exact`}).eq(`is_active`,!0).not(`description`,`is`,null).order(`scraped_at`,{ascending:!1});if(v&&(e=e.in(`id`,y.split(`,`))),m){let t=m.split(`,`);e=t.includes(`AF`)?e.in(`country_code`,a):e.in(`country_code`,t)}if(h){let t=r(h);t&&(e=e.or(`title.ilike.%${t}%,employer.ilike.%${t}%,description.ilike.%${t}%`))}if(_&&_!==`all`){let t=o[_]||_;e=e.eq(`source_name`,t)}g>0&&(e=e.limit(g));let{data:t,error:i,count:c}=await e;if(i)throw i;s(t||[]),p(c||0)}catch(e){console.error(`Error fetching scraped jobs:`,e),d(e instanceof Error?e.message:`Failed to fetch jobs`)}finally{l(!1)}},[m,h,g,_,v,y]);return(0,i.useEffect)(()=>{b()},[b]),{jobs:t,loading:c,error:u,totalCount:f,refetch:b}};export{s as t};

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.