import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{Fragment as t,jsx as n,jsxs as r}from"hono/jsx/jsx-runtime";import{renderToString as i}from"hono/jsx/dom/server";import{raw as a}from"hono/html";const o={DEFAULT_PAGE_SIZE:20,MAX_PAGE_SIZE:100},s={BASE_URL:`https://hiring.cafe/api/search-jobs`,HEADERS:{"Content-Type":`application/json`}},c=({keywords:e,page:t=0,size:n=o.DEFAULT_PAGE_SIZE})=>({keywords:e.trim(),page:Math.max(0,Math.floor(Number(t))),size:Math.min(Math.max(1,Math.floor(Number(n))),o.MAX_PAGE_SIZE)}),l=async t=>{let n={size:t.size||20,page:t.page||0,searchState:{searchQuery:t.keywords,sortBy:t.sortBy||`date`}};return await e(s.BASE_URL,{method:`POST`,body:n,headers:s.HEADERS})},u=(e,o)=>{let s=!!(o.is_compensation_transparent&&o.yearly_min_compensation&&o.yearly_max_compensation),c=e.company_info_description,l=!!c;return i(r(t,{children:[r(`p`,{children:[n(`strong`,{children:`Company:`}),` `,o.company_name]}),r(`p`,{children:[n(`strong`,{children:`Location:`}),` `,o.formatted_workplace_location??`Remote/Unspecified`]}),s?r(`p`,{children:[n(`strong`,{children:`Compensation:`}),` $`,o.yearly_min_compensation?.toLocaleString(),` - $`,o.yearly_max_compensation?.toLocaleString(),` per year`]}):null,r(`p`,{children:[n(`strong`,{children:`Workplace Type:`}),` `,o.workplace_type??`Not specified`]}),r(`p`,{children:[n(`strong`,{children:`Requirements:`}),` `,o.requirements_summary??`No requirements specified`]}),n(`div`,{class:`job-description`,children:e.description?a(e.description):null}),l?r(t,{children:[r(`h2`,{children:[`About `,o.company_name]}),a(c)]}):null]}))},d=e=>{let{job_information:t,v5_processed_job_data:n,apply_url:r,id:i}=e;return{title:`${t.title} - ${n.company_name}`,description:u(t,n),link:r,pubDate:new Date(n.estimated_publish_date_millis).toUTCString(),category:[n.job_category,...n.role_activities,n.workplace_type].filter(e=>!!e),author:n.company_name,guid:i}};async function f(e){let t=c({keywords:e.req.param(`keywords`)}),n=await l(t),r=n.results.map(e=>d(e));return{title:`HiringCafe Jobs: ${t.keywords}`,description:`Job search results for "${t.keywords}" on HiringCafe`,link:`https://hiring.cafe/jobs?q=${encodeURIComponent(t.keywords)}`,item:r,total:n.total}}const p={path:`/jobs/:keywords`,categories:[`other`],example:`/hiring.cafe/jobs/sustainability`,parameters:{keywords:`Keywords to search for`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`hiring.cafe`]}],name:`Jobs`,maintainers:[`mintyfrankie`],handler:f};export{p as route};