import{j as e}from"./vendor-radix-DNp60FuA.js";import{L as d,k as N}from"./vendor-react-DL0tRKZA.js";import{u as g,s as b,N as c,a0 as y,a1 as v}from"./index-DbhEjV5W.js";import{C as p}from"./CompanyLogo-COTywlkX.js";import{h as w,a as _}from"./index-BxeYe70z.js";import{u as j,i as u}from"./useCompanyJobs-4PiA-ZGn.js";import{S as m}from"./skeleton-Dsa0O-T7.js";import{a as k}from"./dateUtils-B9qxNWi9.js";import{H as C}from"./HTMLContent-DsPGG4ZZ.js";import{f}from"./formatDistanceToNow-F80pU6-C.js";import h from"./Footer-CxLqhqCI.js";import{H as $}from"./HeroSection-wLFSKvnL.js";import{a as L}from"./index-luXPprhF.js";import{E as z}from"./Explore-job-Bn7RC76o.js";import{u as q}from"./vendor-query-CKQAY9LX.js";import"./vendor-supabase-B4f4CcZD.js";import"./vendor-charts-CPng-d0O.js";import"./whatsapp-bfrw3Kdz.js";import"./format-NXe5WdhZ.js";import"./en-US-DsJ0-K0a.js";import"./dollar-sign-ViAIwAyr.js";import"./euro-CUo8ioOr.js";import"./pound-sterling-DfVlRdZN.js";import"./constructNow-Cf1joT6_.js";import"./differenceInCalendarMonths-DnfRIrCK.js";import"./endOfDay-DfXidCUT.js";import"./endOfMonth-DO4kXUER.js";import"./getRoundingMethod-D0I6Z7xl.js";import"./index-BscdM2yK.js";import"./use-mobile-DG-UVPpq.js";import"./brain-CdQ1esqI.js";import"./handshake-Cv5pZAI8.js";import"./cpu-CUCLg3gv.js";import"./BreadcrumbWrapper-BJqeXZE7.js";import"./chevron-right-DiLsh-Na.js";function S({companyId:l,companyName:t,companyLogo:s}){const{data:i,isLoading:x}=j(l),{user:n}=g();return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"container lg:mt-24 mt-16",children:[e.jsxs("div",{className:"grid grid-cols-1 pb-8 text-center",children:[e.jsx("h3",{className:"mb-4 md:text-[26px] md:leading-normal text-2xl leading-normal font-semibold",children:t?`Jobs at ${t}`:"Company Jobs"}),e.jsx("p",{className:"text-slate-400 dark:text-slate-300 max-w-xl mx-auto",children:"Explore current openings and find your next career opportunity."})]}),e.jsx("div",{className:"grid lg:grid-cols-2 md:grid-cols-1 grid-cols-1 gap-[30px] mt-8",children:x?Array(4).fill(0).map((r,a)=>e.jsxs("div",{className:"group relative p-6 rounded-md shadow-sm shadow-gray-200 dark:shadow-gray-700 border border-gray-100 dark:border-gray-700",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(m,{className:"h-6 w-3/4"}),e.jsx(m,{className:"h-4 w-full"}),e.jsx(m,{className:"h-4 w-1/2"})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100 dark:border-gray-700 flex justify-between",children:[e.jsx(m,{className:"h-4 w-20"}),e.jsx(m,{className:"h-4 w-16"})]})]},a)):i&&i.length>0?i.map(r=>{var a;return e.jsxs("div",{className:"group relative p-6 rounded-md shadow-sm shadow-gray-200 dark:shadow-gray-700 border border-gray-100 dark:border-gray-700 hover:shadow-md transition-all duration-300",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(p,{logoUrl:s,companyName:t||"Company",className:"size-12 object-contain rounded-md bg-white dark:bg-slate-900 p-2 shadow-sm"}),e.jsxs("div",{children:[e.jsx(d,{to:`/job-detail-one/${r.id}`,className:"text-lg font-semibold hover:text-emerald-600 transition-colors duration-200",children:r.title}),e.jsxs("p",{className:"text-slate-400 text-sm flex items-center mt-1",children:[e.jsx(w,{className:"me-1 size-3"}),"Posted ",f(new Date(r.created_at||""),{addSuffix:!0})]})]})]}),r.is_featured&&e.jsx("span",{className:"bg-emerald-600 text-white text-xs font-bold px-2 py-1 rounded",children:"Featured"})]}),e.jsx("div",{className:"mt-4",children:r.description&&e.jsx(C,{content:r.description,className:"text-slate-600 dark:text-slate-300 text-sm",maxLines:2,maxLength:200})}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100 dark:border-gray-700 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("span",{className:"text-slate-400 flex items-center text-sm",children:[e.jsx(_,{className:"me-1 size-3"}),r.location||"Remote"]}),e.jsx("span",{className:"bg-emerald-600/10 text-emerald-600 text-xs font-medium px-2 py-1 rounded capitalize",children:(a=r.job_type)==null?void 0:a.replace("_"," ")})]}),(r.salary_min||r.salary_max)&&e.jsx("span",{className:"text-slate-600 dark:text-slate-300 flex items-center text-sm font-medium whitespace-nowrap",children:k(r.salary_min,r.salary_max,r.salary_currency)})]}),e.jsxs("div",{className:"mt-4 flex gap-2",children:[e.jsx(d,{to:`/job-detail-one/${r.id}`,className:"flex-1 bg-emerald-600 hover:bg-emerald-700 text-white text-center py-2 px-4 rounded-md font-medium transition-colors duration-200 inline-block",children:"View Details"}),n?e.jsx(d,{to:`/job-apply?jobId=${r.id}`,className:"flex-1 bg-transparent hover:bg-emerald-600/5 border border-emerald-600 text-emerald-600 text-center py-2 px-4 rounded-md font-medium transition-colors duration-200 inline-block",children:"Apply Now"}):e.jsx(d,{to:`/login?redirect=/job-apply?jobId=${r.id}`,className:"flex-1 bg-transparent hover:bg-emerald-600/5 border border-emerald-600 text-emerald-600 text-center py-2 px-4 rounded-md font-medium transition-colors duration-200 inline-block",children:"Sign in to Apply"})]})]},r.id)}):e.jsxs("div",{className:"col-span-full text-center py-12",children:[e.jsx("p",{className:"text-slate-400 text-lg",children:"No active job postings available at this time."}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:"Check back later for new opportunities."})]})})]})})}function E(l){const t=u(l);return q({queryKey:["public-company",l],queryFn:async()=>{if(!l||!u(l))return null;const{data:s,error:i}=await b.from("companies").select(`
          id,
          name,
          description,
          logo_url,
          banner_url,
          website,
          industry,
          headquarters,
          founded_year,
          company_size,
          total_jobs,
          is_verified,
          created_at,
          updated_at
        `).eq("id",l).eq("status","verified").eq("is_verified",!0).maybeSingle();if(i)throw console.error("Error fetching public company data:",i),i;return s},enabled:!!l&&t,staleTime:10*60*1e3})}function pe(){const t=N().id;if(g(),t&&!u(t))return e.jsxs(e.Fragment,{children:[e.jsx(c,{navClass:"!justify-end nav-light"}),e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-red-600 mb-4",children:"Invalid Company Link"}),e.jsx("p",{className:"text-slate-400 mb-4",children:"The company link you're using is not valid."}),e.jsx(d,{to:"/employer-list",className:"inline-block bg-emerald-600 text-white px-6 py-2 rounded-md hover:bg-emerald-700",children:"Browse All Companies"})]})}),e.jsx(h,{})]});const{data:s,isLoading:i,error:x}=E(t||""),{data:n,isLoading:r}=j(t||"");return i?e.jsxs(e.Fragment,{children:[e.jsx(c,{navClass:"!justify-end nav-light"}),e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-emerald-600"})})]}):x||!s?e.jsxs(e.Fragment,{children:[e.jsx(c,{navClass:"!justify-end nav-light"}),e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-red-600 mb-4",children:"Company Not Found"}),e.jsx("p",{className:"text-slate-400",children:"The company you're looking for doesn't exist or has been removed."}),e.jsx(d,{to:"/employer-list",className:"mt-4 inline-block bg-emerald-600 text-white px-6 py-2 rounded-md hover:bg-emerald-700",children:"View All Companies"})]})}),e.jsx(h,{})]}):e.jsxs(e.Fragment,{children:[e.jsx(c,{navClass:"!justify-end nav-light"}),e.jsx($,{title:(s==null?void 0:s.name)||"Company Profile",description:(s==null?void 0:s.industry)||"Explore company details and open positions",breadcrumbItems:[{label:"Home",href:"/"},{label:"Employers",href:"/employer-list"},{label:(s==null?void 0:s.name)||"Company",isActive:!0}],variant:"dark"}),e.jsxs("section",{className:"relative mb:pb-24 pb-16 -mt-16 z-1",children:[e.jsx("div",{className:"container",children:e.jsx("div",{className:"grid grid-cols-1",children:e.jsx("div",{className:"md:flex justify-between items-center shadow-sm shadow-gray-200 dark:shadow-gray-700 rounded-md p-6 bg-white dark:bg-slate-900",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(p,{logoUrl:s==null?void 0:s.logo_url,companyName:s==null?void 0:s.name,className:"size-20 p-3 shadow-sm shadow-gray-200 dark:shadow-gray-700 rounded-md bg-slate-50 dark:bg-slate-800",size:"lg"}),e.jsxs("div",{className:"ms-4",children:[e.jsx("h5",{className:"text-xl font-bold",children:s==null?void 0:s.name}),e.jsxs("h6",{className:"text-base text-slate-400 flex items-center",children:[e.jsx(y,{className:"me-1"}),(s==null?void 0:s.headquarters)||"Global"]})]})]})})})}),e.jsx("div",{className:"container mt-12",children:e.jsxs("div",{className:"grid md:grid-cols-12 grid-cols-1 gap-[30px]",children:[e.jsxs("div",{className:"lg:col-span-8 md:col-span-7",children:[e.jsx("h5",{className:"text-xl font-semibold",children:"Company Story"}),e.jsx("div",{className:"text-slate-400 mt-4",children:s!=null&&s.description?e.jsx("div",{dangerouslySetInnerHTML:{__html:s.description}}):e.jsx("p",{children:"This company has not provided a description yet."})}),(s==null?void 0:s.banner_url)&&e.jsx("div",{className:"grid grid-cols-12 gap-6 mt-6",children:e.jsx("div",{className:"col-span-12",children:e.jsx("img",{src:s.banner_url,className:"rounded-md shadow-sm shadow-gray-200 dark:shadow-gray-700 w-full h-auto object-cover",alt:`${s.name} banner`})})}),e.jsxs("div",{className:"flex justify-between items-center mt-6",children:[e.jsx("h5",{className:"text-xl font-semibold",children:"Open Positions"}),r&&e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-emerald-600"})]}),n&&n.length>0?e.jsx("div",{className:"grid lg:grid-cols-2 grid-cols-1 gap-6 mt-6",children:n.slice(0,6).map(a=>{var o;return e.jsxs("div",{className:"group relative overflow-hidden rounded-md shadow-sm dark:shadow-gray-800 border border-gray-100 dark:border-gray-700",children:[e.jsxs("div",{className:"p-6",children:[e.jsx(d,{to:`/job-detail-one/${a.id}`,className:"title h5 text-lg font-semibold hover:text-emerald-600",children:a.title}),e.jsxs("p",{className:"text-slate-400 mt-2 flex items-center",children:[e.jsx(L,{className:"text-emerald-600 me-1"}),"Posted ",f(new Date(a.created_at||""),{addSuffix:!0})]}),e.jsxs("div",{className:"flex justify-between items-center mt-4",children:[e.jsx("span",{className:"bg-emerald-600/5 text-emerald-600 text-xs font-bold px-2.5 py-0.5 rounded h-5 capitalize",children:(o=a.job_type)==null?void 0:o.replace("_"," ")}),(a.salary_min||a.salary_max)&&e.jsxs("p",{className:"text-slate-400 flex items-center",children:[e.jsx(v,{className:"text-emerald-600 me-1"}),a.salary_min&&a.salary_max?`${a.salary_currency||"$"}${a.salary_min} - ${a.salary_currency||"$"}${a.salary_max}`:a.salary_min?`${a.salary_currency||"$"}${a.salary_min}+`:`${a.salary_currency||"$"}${a.salary_max}`]})]})]}),e.jsxs("div",{className:"flex items-center p-6 border-t border-gray-100 dark:border-gray-700",children:[e.jsx(p,{logoUrl:s==null?void 0:s.logo_url,companyName:s==null?void 0:s.name,className:"size-12 shadow-md dark:shadow-gray-800 rounded-md p-2 bg-white dark:bg-slate-900",size:"md"}),e.jsxs("div",{className:"ms-3",children:[e.jsx("h6",{className:"mb-0 font-semibold text-base",children:s==null?void 0:s.name}),e.jsx("span",{className:"text-slate-400 text-sm",children:a.location||(s==null?void 0:s.headquarters)})]})]})]},a.id)})}):r?e.jsx("div",{className:"grid lg:grid-cols-2 grid-cols-1 gap-6 mt-6",children:Array(4).fill(0).map((a,o)=>e.jsxs("div",{className:"animate-pulse rounded-md shadow-sm dark:shadow-gray-800 border border-gray-100 dark:border-gray-700 p-6",children:[e.jsx("div",{className:"h-6 bg-gray-200 dark:bg-gray-700 rounded mb-4"}),e.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded mb-2"}),e.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-2/3"})]},o))}):e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-slate-400",children:"No open positions available at this time."})})]}),e.jsx("div",{className:"lg:col-span-4 md:col-span-5",children:e.jsx("div",{className:"bg-slate-50 dark:bg-slate-800 rounded-md shadow-sm shadow-gray-200 dark:shadow-gray-700 p-6 sticky top-20",children:e.jsxs("ul",{className:"list-none",children:[(s==null?void 0:s.founded_year)&&e.jsxs("li",{className:"flex justify-between mt-2",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"Founded:"}),e.jsx("span",{className:"font-medium",children:s.founded_year})]}),(s==null?void 0:s.headquarters)&&e.jsxs("li",{className:"flex justify-between mt-2",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"Headquarters:"}),e.jsx("span",{className:"font-medium",children:s.headquarters})]}),(s==null?void 0:s.industry)&&e.jsxs("li",{className:"flex justify-between mt-2",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"Industry:"}),e.jsx("span",{className:"font-medium",children:s.industry})]}),(s==null?void 0:s.company_size)&&e.jsxs("li",{className:"flex justify-between mt-2",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"Company Size:"}),e.jsx("span",{className:"font-medium",children:s.company_size})]}),(s==null?void 0:s.website)&&e.jsxs("li",{className:"flex justify-between mt-2",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"Website:"}),e.jsx("span",{className:"font-medium",children:e.jsx("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",className:"text-emerald-600 hover:underline",children:"Visit Website"})})]}),e.jsxs("li",{className:"flex justify-between mt-2",children:[e.jsx("span",{className:"text-slate-400 font-medium",children:"Open Jobs:"}),e.jsx("span",{className:"font-medium",children:(s==null?void 0:s.total_jobs)||0})]})]})})})]})}),e.jsx(S,{companyId:t||"",companyName:s==null?void 0:s.name,companyLogo:s==null?void 0:s.logo_url}),e.jsx(z,{})]}),e.jsx(h,{})]})}export{pe as default};