1import{j as e,C as A,f as z,g as O,k as b,h as N,d as S,y as q,a as R,c as C,p as _,A as B,a3 as Z,v as I,H as Q,i as G,E as W,a5 as J,D as K,Z as X,r as x,t as $,I as Y}from"./index-fZpeWOwm.js";import{e as M}from"./entities-DuU4wTr2.js";import{S as u,a as g,b as v,c as f,d as i}from"./select-CpeevHxa.js";import{F as ee}from"./filter-CSx87BVT.js";import{A as D,a as P,b as V}from"./avatar-dUZH2Lw-.js";import{V as se}from"./video-uKQSF5Am.js";import{A as ae}from"./arrow-left-CEXd2iI2.js";import"./index-BdQq_4o_.js";import"./index-CbMBln-V.js";const le=["Strategy Consulting","Digital Transformation","Operations Consulting","Financial Advisory","HR Consulting","IT Consulting","Marketing Consulting","Change Management","Business Development","Risk Management"],te=["North America","Europe","Asia Pacific","Latin America","Middle East","Africa"];function ie({filters:s,onFiltersChange:j}){const r=(n,h)=>{j(y=>({...y,[n]:h}))},m=()=>{j({specialization:"",location:"",region:"",experience:"",budget:"",rating:"",availability:""})},o=Object.values(s).filter(Boolean).length;return e.jsxs(A,{className:"sticky top-4 shadow-lg border-slate-200",children:[e.jsxs(z,{className:"pb-4",children:[e.jsxs(O,{className:"flex items-center justify-between text-lg",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ee,{className:"w-5 h-5 text-slate-600"}),"Filters"]}),o>0&&e.jsx(b,{variant:"ghost",size:"sm",onClick:m,className:"text-slate-500 hover:text-slate-700",children:"Clear All"})]}),o>0&&e.jsxs(N,{variant:"secondary",className:"w-fit",children:[o," active"]})]}),e.jsxs(S,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-slate-700",children:"Specialization"}),e.jsxs(u,{value:s.specialization,onValueChange:n=>r("specialization",n),children:[e.jsx(g,{children:e.jsx(v,{placeholder:"All Specializations"})}),e.jsxs(f,{children:[e.jsx(i,{value:null,children:"All Specializations"}),le.map(n=>e.jsx(i,{value:n,children:n},n))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-slate-700",children:"Region"}),e.jsxs(u,{value:s.region,onValueChange:n=>r("region",n),children:[e.jsx(g,{children:e.jsx(v,{placeholder:"All Regions"})}),e.jsxs(f,{children:[e.jsx(i,{value:null,children:"All Regions"}),te.map(n=>e.jsx(i,{value:n,children:n},n))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-slate-700",children:"Experience"}),e.jsxs(u,{value:s.experience,onValueChange:n=>r("experience",n),children:[e.jsx(g,{children:e.jsx(v,{placeholder:"Any Experience"})}),e.jsxs(f,{children:[e.jsx(i,{value:null,children:"Any Experience"}),e.jsx(i,{value:"0-2",children:"0-2 years"}),e.jsx(i,{value:"3-5",children:"3-5 years"}),e.jsx(i,{value:"6-10",children:"6-10 years"}),e.jsx(i,{value:"11-15",children:"11-15 years"}),e.jsx(i,{value:"15-50",children:"15+ years"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-slate-700",children:"Hourly Rate"}),e.jsxs(u,{value:s.budget,onValueChange:n=>r("budget",n),children:[e.jsx(g,{children:e.jsx(v,{placeholder:"Any Budget"})}),e.jsxs(f,{children:[e.jsx(i,{value:null,children:"Any Budget"}),e.jsx(i,{value:"0-100",children:"$0 - $100/hr"}),e.jsx(i,{value:"100-250",children:"$100 - $250/hr"}),e.jsx(i,{value:"250-500",children:"$250 - $500/hr"}),e.jsx(i,{value:"500-1000",children:"$500 - $1000/hr"}),e.jsx(i,{value:"1000-10000",children:"$1000+/hr"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-slate-700",children:"Rating"}),e.jsxs(u,{value:s.rating,onValueChange:n=>r("rating",n),children:[e.jsx(g,{children:e.jsx(v,{placeholder:"Any Rating"})}),e.jsxs(f,{children:[e.jsx(i,{value:null,children:"Any Rating"}),e.jsx(i,{value:"4.5",children:"4.5+ stars"}),e.jsx(i,{value:"4",children:"4+ stars"}),e.jsx(i,{value:"3.5",children:"3.5+ stars"}),e.jsx(i,{value:"3",children:"3+ stars"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-slate-700",children:"Availability"}),e.jsxs(u,{value:s.availability,onValueChange:n=>r("availability",n),children:[e.jsx(g,{children:e.jsx(v,{placeholder:"Any Status"})}),e.jsxs(f,{children:[e.jsx(i,{value:null,children:"Any Status"}),e.jsx(i,{value:"Available",children:"Available Now"}),e.jsx(i,{value:"Busy",children:"Busy"}),e.jsx(i,{value:"Unavailable",children:"Unavailable"})]})]})]})]})]})}function re({consultant:s}){var h,y;const j=q(),r=c=>(c==null?void 0:c.split(" ").map(w=>w[0]).join("").toUpperCase())||"C",m=c=>{switch(c){case"Available":return"bg-emerald-100 text-emerald-800 border-emerald-200";case"Busy":return"bg-orange-100 text-orange-800 border-orange-200";case"Unavailable":return"bg-red-100 text-red-800 border-red-200";default:return"bg-slate-100 text-slate-800 border-slate-200"}},o=c=>{c.stopPropagation()},n=async c=>{c.preventDefault(),c.stopPropagation();try{j(C("Messages")+`?recipient_id=${s.user_id}`)}catch(w){console.error("Error initiating message:",w)}};return e.jsx(R,{to:C(`ConsultantProfile?id=${s.id}`),className:"block group",children:e.jsx(_.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},whileHover:{y:-5,boxShadow:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"},transition:{duration:.3},className:"h-full",children:e.jsxs(A,{className:"h-full border-slate-200 bg-white/80 backdrop-blur-sm transition-all duration-300",children:[e.jsxs(z,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsxs(D,{className:"w-16 h-16 border-2 border-white shadow-lg",children:[e.jsx(P,{src:s.profile_image_url}),e.jsx(V,{className:"bg-gradient-to-r from-slate-600 to-slate-700 text-white font-semibold",children:r(s.company_name)})]}),s.verified&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-6 h-6 bg-emerald-500 rounded-full flex items-center justify-center shadow-lg",children:e.jsx(B,{className:"w-3 h-3 text-white"})})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-bold text-lg text-slate-900 group-hover:text-emerald-700 transition-colors",children:s.company_name}),e.jsx("p",{className:"text-slate-600 text-sm mb-1",children:s.tagline}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-slate-500",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Z,{className:"w-4 h-4"}),s.location]}),s.rating>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(I,{className:"w-4 h-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{className:"font-medium",children:s.rating.toFixed(1)}),e.jsxs("span",{children:["(",s.total_reviews,")"]})]})]})]})]}),s.featured&&e.jsx(N,{className:"bg-gradient-to-r from-emerald-500 to-blue-500 text-white",children:"Featured"})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[(h=s.specializations)==null?void 0:h.slice(0,3).map(c=>e.jsx(N,{variant:"secondary",className:"text-xs",children:c},c)),((y=s.specializations)==null?void 0:y.length)>3&&e.jsxs(N,{variant:"outline",className:"text-xs",children:["+",s.specializations.length-3," more"]})]})]}),e.jsxs(S,{className:"space-y-4",children:[e.jsx("p",{className:"text-slate-600 text-sm line-clamp-3 leading-relaxed",children:s.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4 text-slate-400"}),e.jsxs("span",{className:"text-slate-600",children:[s.experience_years,"+ years"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{className:"w-4 h-4 text-slate-400"}),e.jsxs("span",{className:"text-slate-600",children:[s.projects_completed," projects"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-slate-100",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-1 text-slate-900",children:[e.jsx(W,{className:"w-4 h-4"}),e.jsxs("span",{className:"font-semibold",children:["$",s.hourly_rate_min,"-$",s.hourly_rate_max]}),e.jsx("span",{className:"text-sm text-slate-500",children:"/hr"})]}),e.jsx(N,{variant:"outline",className:`w-fit mt-1 text-xs ${m(s.availability_status)}`,children:s.availability_status})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(b,{size:"sm",onClick:n,className:"bg-blue-600 hover:bg-blue-700 text-white shadow-md",children:[e.jsx(J,{className:"w-4 h-4 mr-1"}),"Message"]}),s.video_intro_url&&e.jsx("a",{href:s.video_intro_url,target:"_blank",rel:"noopener noreferrer",onClick:o,children:e.jsx(b,{variant:"outline",size:"icon",className:"w-8 h-8",children:e.jsx(se,{className:"w-4 h-4"})})}),s.brochure_url&&e.jsx("a",{href:s.brochure_url,target:"_blank",rel:"noopener noreferrer",onClick:o,children:e.jsx(b,{variant:"outline",size:"icon",className:"w-8 h-8",children:e.jsx(K,{className:"w-4 h-4"})})})]})]})]})]})})})}function ne({consultants:s}){if(!s||s.length===0)return null;const j=r=>(r==null?void 0:r.split(" ").map(m=>m[0]).join("").toUpperCase())||"C";return e.jsxs("div",{className:"mb-12",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-r from-emerald-500 to-blue-500 rounded-lg flex items-center justify-center",children:e.jsx(X,{className:"w-5 h-5 text-white"})}),e.jsx("h2",{className:"text-2xl font-bold text-slate-900",children:"Featured Consultants"}),e.jsx(N,{className:"bg-emerald-100 text-emerald-700 border-emerald-200",children:"Top Rated"})]}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:s.slice(0,3).map((r,m)=>{var o,n;return e.jsx(_.div,{initial:{opacity:0,y:30}
1,animate:{opacity:1,y:0},transition:{delay:m*.1},children:e.jsx(A,{className:"h-full bg-gradient-to-br from-white via-slate-50 to-emerald-50 border-emerald-200 hover:shadow-xl transition-all duration-300 group",children:e.jsxs(S,{className:"p-6",children:[e.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[e.jsxs("div",{className:"relative",children:[e.jsxs(D,{className:"w-12 h-12 border-2 border-white shadow-md",children:[e.jsx(P,{src:r.profile_image_url}),e.jsx(V,{className:"bg-gradient-to-r from-emerald-600 to-blue-600 text-white font-semibold",children:j(r.company_name)})]}),e.jsx("div",{className:"absolute -top-1 -right-1 w-5 h-5 bg-emerald-500 rounded-full flex items-center justify-center",children:e.jsx(B,{className:"w-3 h-3 text-white"})})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-bold text-slate-900 group-hover:text-emerald-700 transition-colors",children:r.company_name}),e.jsx("p",{className:"text-sm text-slate-600 mb-2",children:r.tagline}),e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(I,{className:"w-4 h-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{className:"font-semibold",children:((o=r.rating)==null?void 0:o.toFixed(1))||"5.0"})]}),e.jsx("span",{className:"text-slate-500",children:"â¢"}),e.jsxs("span",{className:"text-slate-600",children:[r.projects_completed||0," projects"]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex flex-wrap gap-1",children:(n=r.specializations)==null?void 0:n.slice(0,2).map(h=>e.jsx(N,{className:"bg-emerald-100 text-emerald-700 text-xs border-emerald-200",children:h},h))}),e.jsx("p",{className:"text-sm text-slate-600 line-clamp-2",children:r.description})]}),e.jsx("div",{className:"mt-4 pt-4 border-t border-emerald-100",children:e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-slate-600",children:r.location}),e.jsxs("span",{className:"font-semibold text-slate-900",children:["$",r.hourly_rate_min,"-$",r.hourly_rate_max,"/hr"]})]})})]})})},r.id)})})]})}function ge(){const[s,j]=x.useState([]),[r,m]=x.useState([]),[o,n]=x.useState(!0),[h,y]=x.useState(null),[c,w]=x.useState(""),[d,k]=x.useState({specialization:"",location:"",region:"",experience:"",budget:"",rating:"",availability:""}),[F,H]=x.useState("featured");x.useEffect(()=>{(async()=>{try{const a=await M.User.me();y(a),a?await U():window.location.href=C("Auth")}catch(a){console.error("Auth error:",a),window.location.href=C("Auth")}})()},[]);const U=async()=>{n(!0);try{const a=(await M.Consultant.list("-created_date")).map(t=>({...t,rating:t.rating||(Math.random()*1+4).toFixed(1),total_reviews:t.total_reviews||Math.floor(Math.random()*50)+5,projects_completed:t.projects_completed||Math.floor(Math.random()*20)+1}));j(a)}catch(l){console.error("Error loading consultants:",l)}finally{n(!1)}},E=x.useCallback(()=>{let l=[...s];if(c&&(l=l.filter(a=>{var t,p,L;return((t=a.company_name)==null?void 0:t.toLowerCase().includes(c.toLowerCase()))||((p=a.description)==null?void 0:p.toLowerCase().includes(c.toLowerCase()))||((L=a.specializations)==null?void 0:L.some(T=>T.toLowerCase().includes(c.toLowerCase())))})),d.specialization&&(l=l.filter(a=>{var t;return(t=a.specializations)==null?void 0:t.includes(d.specialization)})),d.location&&(l=l.filter(a=>{var t;return(t=a.location)==null?void 0:t.toLowerCase().includes(d.location.toLowerCase())})),d.region&&(l=l.filter(a=>a.region===d.region)),d.experience){const[a,t]=d.experience.split("-").map(Number);l=l.filter(p=>p.experience_years>=a&&(!t||p.experience_years<=t))}if(d.budget){const[a,t]=d.budget.split("-").map(Number);l=l.filter(p=>p.hourly_rate_min<=t&&p.hourly_rate_max>=a)}switch(d.rating&&(l=l.filter(a=>a.rating>=parseFloat(d.rating))),d.availability&&(l=l.filter(a=>a.availability_status===d.availability)),F){case"featured":l.sort((a,t)=>a.featured!==t.featured?t.featured-a.featured:t.rating-a.rating);break;case"rating":l.sort((a,t)=>t.rating-a.rating);break;case"experience":l.sort((a,t)=>t.experience_years-a.experience_years);break;case"price-low":l.sort((a,t)=>a.hourly_rate_min-t.hourly_rate_min);break;case"price-high":l.sort((a,t)=>t.hourly_rate_max-a.hourly_rate_max);break}m(l)},[s,c,d,F]);return x.useEffect(()=>{E()},[E]),h?e.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-slate-50 to-white",children:[e.jsx("div",{className:"bg-white py-2 px-6 shadow-sm border-b",children:e.jsxs(R,{to:C("ClientDashboard"),
1className:"inline-flex items-center gap-2 text-emerald-700 font-medium transition-colors bg-emerald-50 hover:bg-emerald-100 rounded-md px-3 py-1.5",children:[e.jsx(ae,{className:"w-4 h-4"}),"Back to Dashboard"]})}),e.jsxs("div",{className:"bg-gradient-to-r from-slate-900 via-slate-800 to-slate-900 relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-emerald-600/10 to-blue-600/10"}),e.jsx("div",{className:"relative max-w-7xl mx-auto px-6 py-20",children:e.jsxs("div",{className:"text-center",children:[e.jsxs(_.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-4xl md:text-5xl font-bold text-white mb-6",children:["Find Expert",e.jsx("span",{className:"bg-gradient-to-r from-emerald-400 to-blue-400 bg-clip-text text-transparent",children:" Consultants"})]}),e.jsx(_.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"text-xl text-slate-300 mb-8 max-w-2xl mx-auto",children:"Connect with verified consultants who deliver results. Advanced search, AI matching, and quality assurance."})]})})]}),e.jsx("div",{className:"max-w-7xl mx-auto px-6 -mt-8 relative z-10",children:e.jsxs(_.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},className:"bg-white rounded-2xl shadow-2xl p-8",children:[e.jsxs("div",{className:"relative mb-6",children:[e.jsx($,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-slate-400 w-6 h-6"}),e.jsx(Y,{placeholder:"Search by expertise, industry, or location...",value:c,onChange:l=>w(l.target.value),className:"w-full pl-14 pr-4 py-4 text-lg border-2 border-slate-200 rounded-xl focus:border-emerald-500"})]}),e.jsx("div",{className:"flex flex-wrap gap-3",children:["Strategy","Digital Transformation","Operations","Finance","HR","Marketing"].map(l=>e.jsx(b,{variant:"outline",size:"sm",onClick:()=>k(a=>({...a,specialization:l})),className:"rounded-full",children:l},l))})]})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-16",children:[e.jsx(ne,{consultants:s.filter(l=>l.featured)}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8 mt-16",children:[e.jsx("div",{className:"lg:w-80",children:e.jsx("div",{className:"sticky top-4",children:e.jsx(ie,{filters:d,onFiltersChange:k})})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold text-slate-900",children:o?"Loading...":`${r.length} Expert Consultants`}),e.jsx("p",{className:"text-slate-600 mt-1",children:c?`Results for "${c}"`:"All verified consultants"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-slate-600",children:"Sort by:"}),e.jsxs(u,{value:F,onValueChange:H,children:[e.jsx(g,{className:"w-48",children:e.jsx(v,{})}),e.jsxs(f,{children:[e.jsx(i,{value:"featured",children:"Featured First"}),e.jsx(i,{value:"rating",children:"Highest Rated"}),e.jsx(i,{value:"experience",children:"Most Experienced"}),e.jsx(i,{value:"price-low",children:"Price: Low to High"}),e.jsx(i,{value:"price-high",children:"Price: High to Low"})]})]})]})]}),o?e.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:[...Array(6)].map((l,a)=>e.jsxs(A,{className:"animate-pulse",children:[e.jsx(z,{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-200 rounded-xl"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-slate-200 rounded w-32"}),e.jsx("div",{className:"h-3 bg-slate-200 rounded w-24"})]})]})}),e.jsx(S,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-3 bg-slate-200 rounded w-full"}),e.jsx("div",{className:"h-3 bg-slate-200 rounded w-3/4"})]})})]},a))}):r.length>0?e.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:r.map(l=>e.jsx(re,{consultant:l},l.id))}):e.jsxs(_.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"text-center py-16",children:[e.jsx("div",{className:"w-24 h-24 bg-slate-100 rounded-full flex items-center justify-center mx-auto mb-6",children:e.jsx($,{className:"w-12 h-12 text-slate-400"})}),e.jsx("h3",{className:"text-2xl font-semibold text-slate-900 mb-4",children:"No consultants found"}),e.jsx("p",{className:"text-slate-600 mb-6 max-w-md mx-auto",children:"Try adjusting your search criteria or filters to find the perfect consultant for your project."}),e.jsx(b,{variant:"outline",onClick:()=>{w(""),k({specialization:"",location:"",region:"",experience:"",budget:"",rating:"",availability:""})},children:"Clear All Filters"})]})]})]})]})]}):e.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-4",children:"Authentication Required"}),e.jsx("p",{className:"text-slate-600 mb-6",children:"Please sign in to access the consultant directory."}),e.jsx(b,{onClick:()=>window.location.href=C("Auth"),children:"Sign In"})]})})}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.